diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7034f9b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,22 @@ +# 告诉EditorConfig插件,这是根文件,不用继续往上查找 +root = true + +# 匹配全部文件 +[*] +# 设置字符集 +charset = utf-8 +# 缩进风格,可选space、tab +indent_style = space +# 缩进的空格数 +indent_size = 2 +# 结尾换行符,可选lf、cr、crlf +end_of_line = lf +# 在文件结尾插入新行 +insert_final_newline = true +# 删除一行中的前后空格 +trim_trailing_whitespace = true + +# 匹配md结尾的文件 +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..a0b0133 --- /dev/null +++ b/.env.development @@ -0,0 +1,11 @@ +# 页面标题 +VUE_APP_TITLE = 信联 + +# 开发环境配置 +ENV = 'development' + +# 信联/开发环境 +VUE_APP_BASE_API = '/dev-api' + +# 路由懒加载 +VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..b12af66 --- /dev/null +++ b/.env.production @@ -0,0 +1,8 @@ +# 页面标题 +VUE_APP_TITLE = 信联 + +# 生产环境配置 +ENV = 'production' + +# 信联/生产环境 +VUE_APP_BASE_API = '/prod-api' diff --git a/.env.staging b/.env.staging new file mode 100644 index 0000000..1c8a4d3 --- /dev/null +++ b/.env.staging @@ -0,0 +1,12 @@ +# 页面标题 +VUE_APP_TITLE = 信联 + +BABEL_ENV = production + +NODE_ENV = production + +# 测试环境配置 +ENV = 'staging' + +# 信联/测试环境 +VUE_APP_BASE_API = '/stage-api' diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78a752d --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +**/*.log + +tests/**/coverage/ +tests/e2e/reports +selenium-debug.log + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.local + +package-lock.json +yarn.lock diff --git a/README.md b/README.md index 65b6e21..00c0ab8 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,30 @@ -# HIsenseYL-localization-migration +## 开发 -海信医疗-远程超声管理平台-信创国产化 \ No newline at end of file +```bash +# 克隆项目 +git clone https://gitee.com/y_project/RuoYi-Vue + +# 进入项目目录 +cd ruoyi-ui + +# 安装依赖 +npm install + +# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题 +npm install --registry=https://registry.npmmirror.com + +# 启动服务 +npm run dev +``` + +浏览器访问 http://localhost:80 + +## 发布 + +```bash +# 构建测试环境 +npm run build:stage + +# 构建生产环境 +npm run build:prod +``` \ No newline at end of file diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..c8267b2 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,13 @@ +module.exports = { + presets: [ + // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app + '@vue/cli-plugin-babel/preset' + ], + 'env': { + 'development': { + // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require(). + // This plugin can significantly increase the speed of hot updates, when you have a large number of pages. + 'plugins': ['dynamic-import-node'] + } + } +} \ No newline at end of file diff --git a/bin/build.bat b/bin/build.bat new file mode 100644 index 0000000..dda590d --- /dev/null +++ b/bin/build.bat @@ -0,0 +1,12 @@ +@echo off +echo. +echo [Ϣ] Weḅdistļ +echo. + +%~d0 +cd %~dp0 + +cd .. +npm run build:prod + +pause \ No newline at end of file diff --git a/bin/package.bat b/bin/package.bat new file mode 100644 index 0000000..0e5bc0f --- /dev/null +++ b/bin/package.bat @@ -0,0 +1,12 @@ +@echo off +echo. +echo [Ϣ] װWeḅnode_modulesļ +echo. + +%~d0 +cd %~dp0 + +cd .. +npm install --registry=https://registry.npmmirror.com + +pause \ No newline at end of file diff --git a/bin/run-web.bat b/bin/run-web.bat new file mode 100644 index 0000000..d30deae --- /dev/null +++ b/bin/run-web.bat @@ -0,0 +1,12 @@ +@echo off +echo. +echo [Ϣ] ʹ Vue CLI Web ̡ +echo. + +%~d0 +cd %~dp0 + +cd .. +npm run dev + +pause \ No newline at end of file diff --git a/build/index.js b/build/index.js new file mode 100644 index 0000000..0c57de2 --- /dev/null +++ b/build/index.js @@ -0,0 +1,35 @@ +const { run } = require('runjs') +const chalk = require('chalk') +const config = require('../vue.config.js') +const rawArgv = process.argv.slice(2) +const args = rawArgv.join(' ') + +if (process.env.npm_config_preview || rawArgv.includes('--preview')) { + const report = rawArgv.includes('--report') + + run(`vue-cli-service build ${args}`) + + const port = 9526 + const publicPath = config.publicPath + + var connect = require('connect') + var serveStatic = require('serve-static') + const app = connect() + + app.use( + publicPath, + serveStatic('./dist', { + index: ['index.html', '/'] + }) + ) + + app.listen(port, function () { + console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`)) + if (report) { + console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`)) + } + + }) +} else { + run(`vue-cli-service build ${args}`) +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..0e759f9 --- /dev/null +++ b/package.json @@ -0,0 +1,71 @@ +{ + "name": "ruoyi", + "version": "3.9.2", + "description": "信联", + "author": "海信", + "license": "MIT", + "scripts": { + "dev": "vue-cli-service serve", + "build:prod": "vue-cli-service build", + "build:stage": "vue-cli-service build --mode staging", + "preview": "node build/index.js --preview" + }, + "keywords": [ + "vue", + "admin", + "dashboard", + "element-ui", + "boilerplate", + "admin-template", + "management-system" + ], + "repository": { + "type": "git", + "url": "https://gitee.com/y_project/RuoYi-Vue.git" + }, + "dependencies": { + "@riophae/vue-treeselect": "0.4.0", + "axios": "0.30.3", + "clipboard": "2.0.8", + "core-js": "3.37.1", + "echarts": "5.4.0", + "element-ui": "2.15.14", + "file-saver": "2.0.5", + "fuse.js": "6.4.3", + "highlight.js": "9.18.5", + "js-beautify": "1.13.0", + "js-cookie": "3.0.1", + "jsencrypt": "3.0.0-rc.1", + "nprogress": "0.2.0", + "quill": "2.0.2", + "screenfull": "5.0.2", + "sortablejs": "1.10.2", + "vue": "2.6.12", + "vue-count-to": "1.0.13", + "vue-cropper": "0.5.5", + "vue-router": "3.4.9", + "vuedraggable": "2.24.3", + "vuex": "3.6.0" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "4.4.6", + "@vue/cli-service": "4.4.6", + "babel-plugin-dynamic-import-node": "2.3.3", + "chalk": "4.1.0", + "compression-webpack-plugin": "6.1.2", + "connect": "3.6.6", + "sass": "1.32.13", + "sass-loader": "10.1.1", + "script-ext-html-webpack-plugin": "2.1.5", + "svg-sprite-loader": "5.1.1", + "vue-template-compiler": "2.6.12" + }, + "engines": { + "node": ">=8.9", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions" + ] +} diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..e263760 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/html/ie.html b/public/html/ie.html new file mode 100644 index 0000000..052ffcd --- /dev/null +++ b/public/html/ie.html @@ -0,0 +1,46 @@ + + + + + + 请升级您的浏览器 + + + + + + +

请升级您的浏览器,以便我们更好的为您提供服务!

+

您正在使用 Internet Explorer 的早期版本(IE11以下版本或使用该内核的浏览器)。这意味着在升级浏览器前,您将无法访问此网站。

+
+

请注意:微软公司对Windows XP 及 Internet Explorer 早期版本的支持已经结束

+

自 2016 年 1 月 12 日起,Microsoft 不再为 IE 11 以下版本提供相应支持和更新。没有关键的浏览器安全更新,您的电脑可能易受有害病毒、间谍软件和其他恶意软件的攻击,它们可以窃取或损害您的业务数据和信息。请参阅 微软对 Internet Explorer 早期版本的支持将于 2016 年 1 月 12 日结束的说明

+
+

您可以选择更先进的浏览器

+

推荐使用以下浏览器的最新版本。如果您的电脑已有以下浏览器的最新版本则直接使用该浏览器访问即可。

+ +
+ + \ No newline at end of file diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..de26463 --- /dev/null +++ b/public/index.html @@ -0,0 +1,222 @@ + + + + + + + + + + + <%= webpackConfig.name %> + + + + + + + + + + + + +
+
+
+
+
+
正在加载系统资源,请耐心等待
+
+
+ + + \ No newline at end of file diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..77470cb --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / \ No newline at end of file diff --git a/public/static/adapter.js b/public/static/adapter.js new file mode 100644 index 0000000..9d6572d --- /dev/null +++ b/public/static/adapter.js @@ -0,0 +1,3423 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.adapter = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i 0 && arguments[0] !== undefined ? arguments[0] : {}, + window = _ref.window; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + shimChrome: true, + shimFirefox: true, + shimSafari: true + }; + + // Utils. + var logging = utils.log; + var browserDetails = utils.detectBrowser(window); + + var adapter = { + browserDetails: browserDetails, + commonShim: commonShim, + extractVersion: utils.extractVersion, + disableLog: utils.disableLog, + disableWarnings: utils.disableWarnings, + // Expose sdp as a convenience. For production apps include directly. + sdp: sdp + }; + + // Shim browser if found. + switch (browserDetails.browser) { + case 'chrome': + if (!chromeShim || !chromeShim.shimPeerConnection || !options.shimChrome) { + logging('Chrome shim is not included in this adapter release.'); + return adapter; + } + if (browserDetails.version === null) { + logging('Chrome shim can not determine version, not shimming.'); + return adapter; + } + logging('adapter.js shimming chrome.'); + // Export to the adapter global object visible in the browser. + adapter.browserShim = chromeShim; + + // Must be called before shimPeerConnection. + commonShim.shimAddIceCandidateNullOrEmpty(window, browserDetails); + + chromeShim.shimGetUserMedia(window, browserDetails); + chromeShim.shimMediaStream(window, browserDetails); + chromeShim.shimPeerConnection(window, browserDetails); + chromeShim.shimOnTrack(window, browserDetails); + chromeShim.shimAddTrackRemoveTrack(window, browserDetails); + chromeShim.shimGetSendersWithDtmf(window, browserDetails); + chromeShim.shimGetStats(window, browserDetails); + chromeShim.shimSenderReceiverGetStats(window, browserDetails); + chromeShim.fixNegotiationNeeded(window, browserDetails); + + commonShim.shimRTCIceCandidate(window, browserDetails); + commonShim.shimConnectionState(window, browserDetails); + commonShim.shimMaxMessageSize(window, browserDetails); + commonShim.shimSendThrowTypeError(window, browserDetails); + commonShim.removeExtmapAllowMixed(window, browserDetails); + break; + case 'firefox': + if (!firefoxShim || !firefoxShim.shimPeerConnection || !options.shimFirefox) { + logging('Firefox shim is not included in this adapter release.'); + return adapter; + } + logging('adapter.js shimming firefox.'); + // Export to the adapter global object visible in the browser. + adapter.browserShim = firefoxShim; + + // Must be called before shimPeerConnection. + commonShim.shimAddIceCandidateNullOrEmpty(window, browserDetails); + + firefoxShim.shimGetUserMedia(window, browserDetails); + firefoxShim.shimPeerConnection(window, browserDetails); + firefoxShim.shimOnTrack(window, browserDetails); + firefoxShim.shimRemoveStream(window, browserDetails); + firefoxShim.shimSenderGetStats(window, browserDetails); + firefoxShim.shimReceiverGetStats(window, browserDetails); + firefoxShim.shimRTCDataChannel(window, browserDetails); + firefoxShim.shimAddTransceiver(window, browserDetails); + firefoxShim.shimGetParameters(window, browserDetails); + firefoxShim.shimCreateOffer(window, browserDetails); + firefoxShim.shimCreateAnswer(window, browserDetails); + + commonShim.shimRTCIceCandidate(window, browserDetails); + commonShim.shimConnectionState(window, browserDetails); + commonShim.shimMaxMessageSize(window, browserDetails); + commonShim.shimSendThrowTypeError(window, browserDetails); + break; + case 'safari': + if (!safariShim || !options.shimSafari) { + logging('Safari shim is not included in this adapter release.'); + return adapter; + } + logging('adapter.js shimming safari.'); + // Export to the adapter global object visible in the browser. + adapter.browserShim = safariShim; + + // Must be called before shimCallbackAPI. + commonShim.shimAddIceCandidateNullOrEmpty(window, browserDetails); + + safariShim.shimRTCIceServerUrls(window, browserDetails); + safariShim.shimCreateOfferLegacy(window, browserDetails); + safariShim.shimCallbacksAPI(window, browserDetails); + safariShim.shimLocalStreamsAPI(window, browserDetails); + safariShim.shimRemoteStreamsAPI(window, browserDetails); + safariShim.shimTrackEventTransceiver(window, browserDetails); + safariShim.shimGetUserMedia(window, browserDetails); + safariShim.shimAudioContext(window, browserDetails); + + commonShim.shimRTCIceCandidate(window, browserDetails); + commonShim.shimMaxMessageSize(window, browserDetails); + commonShim.shimSendThrowTypeError(window, browserDetails); + commonShim.removeExtmapAllowMixed(window, browserDetails); + break; + default: + logging('Unsupported browser!'); + break; + } + + return adapter; + } + +// Browser shims. + + },{"./chrome/chrome_shim":3,"./common_shim":6,"./firefox/firefox_shim":7,"./safari/safari_shim":10,"./utils":11,"sdp":12}],3:[function(require,module,exports){ + /* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.shimGetDisplayMedia = exports.shimGetUserMedia = undefined; + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + var _getusermedia = require('./getusermedia'); + + Object.defineProperty(exports, 'shimGetUserMedia', { + enumerable: true, + get: function get() { + return _getusermedia.shimGetUserMedia; + } + }); + + var _getdisplaymedia = require('./getdisplaymedia'); + + Object.defineProperty(exports, 'shimGetDisplayMedia', { + enumerable: true, + get: function get() { + return _getdisplaymedia.shimGetDisplayMedia; + } + }); + exports.shimMediaStream = shimMediaStream; + exports.shimOnTrack = shimOnTrack; + exports.shimGetSendersWithDtmf = shimGetSendersWithDtmf; + exports.shimGetStats = shimGetStats; + exports.shimSenderReceiverGetStats = shimSenderReceiverGetStats; + exports.shimAddTrackRemoveTrackWithNative = shimAddTrackRemoveTrackWithNative; + exports.shimAddTrackRemoveTrack = shimAddTrackRemoveTrack; + exports.shimPeerConnection = shimPeerConnection; + exports.fixNegotiationNeeded = fixNegotiationNeeded; + + var _utils = require('../utils.js'); + + var utils = _interopRequireWildcard(_utils); + + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + function shimMediaStream(window) { + window.MediaStream = window.MediaStream || window.webkitMediaStream; + } + + function shimOnTrack(window) { + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && !('ontrack' in window.RTCPeerConnection.prototype)) { + Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', { + get: function get() { + return this._ontrack; + }, + set: function set(f) { + if (this._ontrack) { + this.removeEventListener('track', this._ontrack); + } + this.addEventListener('track', this._ontrack = f); + }, + + enumerable: true, + configurable: true + }); + var origSetRemoteDescription = window.RTCPeerConnection.prototype.setRemoteDescription; + window.RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription() { + var _this = this; + + if (!this._ontrackpoly) { + this._ontrackpoly = function (e) { + // onaddstream does not fire when a track is added to an existing + // stream. But stream.onaddtrack is implemented so we use that. + e.stream.addEventListener('addtrack', function (te) { + var receiver = void 0; + if (window.RTCPeerConnection.prototype.getReceivers) { + receiver = _this.getReceivers().find(function (r) { + return r.track && r.track.id === te.track.id; + }); + } else { + receiver = { track: te.track }; + } + + var event = new Event('track'); + event.track = te.track; + event.receiver = receiver; + event.transceiver = { receiver: receiver }; + event.streams = [e.stream]; + _this.dispatchEvent(event); + }); + e.stream.getTracks().forEach(function (track) { + var receiver = void 0; + if (window.RTCPeerConnection.prototype.getReceivers) { + receiver = _this.getReceivers().find(function (r) { + return r.track && r.track.id === track.id; + }); + } else { + receiver = { track: track }; + } + var event = new Event('track'); + event.track = track; + event.receiver = receiver; + event.transceiver = { receiver: receiver }; + event.streams = [e.stream]; + _this.dispatchEvent(event); + }); + }; + this.addEventListener('addstream', this._ontrackpoly); + } + return origSetRemoteDescription.apply(this, arguments); + }; + } else { + // even if RTCRtpTransceiver is in window, it is only used and + // emitted in unified-plan. Unfortunately this means we need + // to unconditionally wrap the event. + utils.wrapPeerConnectionEvent(window, 'track', function (e) { + if (!e.transceiver) { + Object.defineProperty(e, 'transceiver', { value: { receiver: e.receiver } }); + } + return e; + }); + } + } + + function shimGetSendersWithDtmf(window) { + // Overrides addTrack/removeTrack, depends on shimAddTrackRemoveTrack. + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && !('getSenders' in window.RTCPeerConnection.prototype) && 'createDTMFSender' in window.RTCPeerConnection.prototype) { + var shimSenderWithDtmf = function shimSenderWithDtmf(pc, track) { + return { + track: track, + get dtmf() { + if (this._dtmf === undefined) { + if (track.kind === 'audio') { + this._dtmf = pc.createDTMFSender(track); + } else { + this._dtmf = null; + } + } + return this._dtmf; + }, + _pc: pc + }; + }; + + // augment addTrack when getSenders is not available. + if (!window.RTCPeerConnection.prototype.getSenders) { + window.RTCPeerConnection.prototype.getSenders = function getSenders() { + this._senders = this._senders || []; + return this._senders.slice(); // return a copy of the internal state. + }; + var origAddTrack = window.RTCPeerConnection.prototype.addTrack; + window.RTCPeerConnection.prototype.addTrack = function addTrack(track, stream) { + var sender = origAddTrack.apply(this, arguments); + if (!sender) { + sender = shimSenderWithDtmf(this, track); + this._senders.push(sender); + } + return sender; + }; + + var origRemoveTrack = window.RTCPeerConnection.prototype.removeTrack; + window.RTCPeerConnection.prototype.removeTrack = function removeTrack(sender) { + origRemoveTrack.apply(this, arguments); + var idx = this._senders.indexOf(sender); + if (idx !== -1) { + this._senders.splice(idx, 1); + } + }; + } + var origAddStream = window.RTCPeerConnection.prototype.addStream; + window.RTCPeerConnection.prototype.addStream = function addStream(stream) { + var _this2 = this; + + this._senders = this._senders || []; + origAddStream.apply(this, [stream]); + stream.getTracks().forEach(function (track) { + _this2._senders.push(shimSenderWithDtmf(_this2, track)); + }); + }; + + var origRemoveStream = window.RTCPeerConnection.prototype.removeStream; + window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) { + var _this3 = this; + + this._senders = this._senders || []; + origRemoveStream.apply(this, [stream]); + + stream.getTracks().forEach(function (track) { + var sender = _this3._senders.find(function (s) { + return s.track === track; + }); + if (sender) { + // remove sender + _this3._senders.splice(_this3._senders.indexOf(sender), 1); + } + }); + }; + } else if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && 'getSenders' in window.RTCPeerConnection.prototype && 'createDTMFSender' in window.RTCPeerConnection.prototype && window.RTCRtpSender && !('dtmf' in window.RTCRtpSender.prototype)) { + var origGetSenders = window.RTCPeerConnection.prototype.getSenders; + window.RTCPeerConnection.prototype.getSenders = function getSenders() { + var _this4 = this; + + var senders = origGetSenders.apply(this, []); + senders.forEach(function (sender) { + return sender._pc = _this4; + }); + return senders; + }; + + Object.defineProperty(window.RTCRtpSender.prototype, 'dtmf', { + get: function get() { + if (this._dtmf === undefined) { + if (this.track.kind === 'audio') { + this._dtmf = this._pc.createDTMFSender(this.track); + } else { + this._dtmf = null; + } + } + return this._dtmf; + } + }); + } + } + + function shimGetStats(window) { + if (!window.RTCPeerConnection) { + return; + } + + var origGetStats = window.RTCPeerConnection.prototype.getStats; + window.RTCPeerConnection.prototype.getStats = function getStats() { + var _this5 = this; + + var _arguments = Array.prototype.slice.call(arguments), + selector = _arguments[0], + onSucc = _arguments[1], + onErr = _arguments[2]; + + // If selector is a function then we are in the old style stats so just + // pass back the original getStats format to avoid breaking old users. + + + if (arguments.length > 0 && typeof selector === 'function') { + return origGetStats.apply(this, arguments); + } + + // When spec-style getStats is supported, return those when called with + // either no arguments or the selector argument is null. + if (origGetStats.length === 0 && (arguments.length === 0 || typeof selector !== 'function')) { + return origGetStats.apply(this, []); + } + + var fixChromeStats_ = function fixChromeStats_(response) { + var standardReport = {}; + var reports = response.result(); + reports.forEach(function (report) { + var standardStats = { + id: report.id, + timestamp: report.timestamp, + type: { + localcandidate: 'local-candidate', + remotecandidate: 'remote-candidate' + }[report.type] || report.type + }; + report.names().forEach(function (name) { + standardStats[name] = report.stat(name); + }); + standardReport[standardStats.id] = standardStats; + }); + + return standardReport; + }; + + // shim getStats with maplike support + var makeMapStats = function makeMapStats(stats) { + return new Map(Object.keys(stats).map(function (key) { + return [key, stats[key]]; + })); + }; + + if (arguments.length >= 2) { + var successCallbackWrapper_ = function successCallbackWrapper_(response) { + onSucc(makeMapStats(fixChromeStats_(response))); + }; + + return origGetStats.apply(this, [successCallbackWrapper_, selector]); + } + + // promise-support + return new Promise(function (resolve, reject) { + origGetStats.apply(_this5, [function (response) { + resolve(makeMapStats(fixChromeStats_(response))); + }, reject]); + }).then(onSucc, onErr); + }; + } + + function shimSenderReceiverGetStats(window) { + if (!((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && window.RTCRtpSender && window.RTCRtpReceiver)) { + return; + } + + // shim sender stats. + if (!('getStats' in window.RTCRtpSender.prototype)) { + var origGetSenders = window.RTCPeerConnection.prototype.getSenders; + if (origGetSenders) { + window.RTCPeerConnection.prototype.getSenders = function getSenders() { + var _this6 = this; + + var senders = origGetSenders.apply(this, []); + senders.forEach(function (sender) { + return sender._pc = _this6; + }); + return senders; + }; + } + + var origAddTrack = window.RTCPeerConnection.prototype.addTrack; + if (origAddTrack) { + window.RTCPeerConnection.prototype.addTrack = function addTrack() { + var sender = origAddTrack.apply(this, arguments); + sender._pc = this; + return sender; + }; + } + window.RTCRtpSender.prototype.getStats = function getStats() { + var sender = this; + return this._pc.getStats().then(function (result) { + return ( + /* Note: this will include stats of all senders that + * send a track with the same id as sender.track as + * it is not possible to identify the RTCRtpSender. + */ + utils.filterStats(result, sender.track, true) + ); + }); + }; + } + + // shim receiver stats. + if (!('getStats' in window.RTCRtpReceiver.prototype)) { + var origGetReceivers = window.RTCPeerConnection.prototype.getReceivers; + if (origGetReceivers) { + window.RTCPeerConnection.prototype.getReceivers = function getReceivers() { + var _this7 = this; + + var receivers = origGetReceivers.apply(this, []); + receivers.forEach(function (receiver) { + return receiver._pc = _this7; + }); + return receivers; + }; + } + utils.wrapPeerConnectionEvent(window, 'track', function (e) { + e.receiver._pc = e.srcElement; + return e; + }); + window.RTCRtpReceiver.prototype.getStats = function getStats() { + var receiver = this; + return this._pc.getStats().then(function (result) { + return utils.filterStats(result, receiver.track, false); + }); + }; + } + + if (!('getStats' in window.RTCRtpSender.prototype && 'getStats' in window.RTCRtpReceiver.prototype)) { + return; + } + + // shim RTCPeerConnection.getStats(track). + var origGetStats = window.RTCPeerConnection.prototype.getStats; + window.RTCPeerConnection.prototype.getStats = function getStats() { + if (arguments.length > 0 && arguments[0] instanceof window.MediaStreamTrack) { + var track = arguments[0]; + var sender = void 0; + var receiver = void 0; + var err = void 0; + this.getSenders().forEach(function (s) { + if (s.track === track) { + if (sender) { + err = true; + } else { + sender = s; + } + } + }); + this.getReceivers().forEach(function (r) { + if (r.track === track) { + if (receiver) { + err = true; + } else { + receiver = r; + } + } + return r.track === track; + }); + if (err || sender && receiver) { + return Promise.reject(new DOMException('There are more than one sender or receiver for the track.', 'InvalidAccessError')); + } else if (sender) { + return sender.getStats(); + } else if (receiver) { + return receiver.getStats(); + } + return Promise.reject(new DOMException('There is no sender or receiver for the track.', 'InvalidAccessError')); + } + return origGetStats.apply(this, arguments); + }; + } + + function shimAddTrackRemoveTrackWithNative(window) { + // shim addTrack/removeTrack with native variants in order to make + // the interactions with legacy getLocalStreams behave as in other browsers. + // Keeps a mapping stream.id => [stream, rtpsenders...] + window.RTCPeerConnection.prototype.getLocalStreams = function getLocalStreams() { + var _this8 = this; + + this._shimmedLocalStreams = this._shimmedLocalStreams || {}; + return Object.keys(this._shimmedLocalStreams).map(function (streamId) { + return _this8._shimmedLocalStreams[streamId][0]; + }); + }; + + var origAddTrack = window.RTCPeerConnection.prototype.addTrack; + window.RTCPeerConnection.prototype.addTrack = function addTrack(track, stream) { + if (!stream) { + return origAddTrack.apply(this, arguments); + } + this._shimmedLocalStreams = this._shimmedLocalStreams || {}; + + var sender = origAddTrack.apply(this, arguments); + if (!this._shimmedLocalStreams[stream.id]) { + this._shimmedLocalStreams[stream.id] = [stream, sender]; + } else if (this._shimmedLocalStreams[stream.id].indexOf(sender) === -1) { + this._shimmedLocalStreams[stream.id].push(sender); + } + return sender; + }; + + var origAddStream = window.RTCPeerConnection.prototype.addStream; + window.RTCPeerConnection.prototype.addStream = function addStream(stream) { + var _this9 = this; + + this._shimmedLocalStreams = this._shimmedLocalStreams || {}; + + stream.getTracks().forEach(function (track) { + var alreadyExists = _this9.getSenders().find(function (s) { + return s.track === track; + }); + if (alreadyExists) { + throw new DOMException('Track already exists.', 'InvalidAccessError'); + } + }); + var existingSenders = this.getSenders(); + origAddStream.apply(this, arguments); + var newSenders = this.getSenders().filter(function (newSender) { + return existingSenders.indexOf(newSender) === -1; + }); + this._shimmedLocalStreams[stream.id] = [stream].concat(newSenders); + }; + + var origRemoveStream = window.RTCPeerConnection.prototype.removeStream; + window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) { + this._shimmedLocalStreams = this._shimmedLocalStreams || {}; + delete this._shimmedLocalStreams[stream.id]; + return origRemoveStream.apply(this, arguments); + }; + + var origRemoveTrack = window.RTCPeerConnection.prototype.removeTrack; + window.RTCPeerConnection.prototype.removeTrack = function removeTrack(sender) { + var _this10 = this; + + this._shimmedLocalStreams = this._shimmedLocalStreams || {}; + if (sender) { + Object.keys(this._shimmedLocalStreams).forEach(function (streamId) { + var idx = _this10._shimmedLocalStreams[streamId].indexOf(sender); + if (idx !== -1) { + _this10._shimmedLocalStreams[streamId].splice(idx, 1); + } + if (_this10._shimmedLocalStreams[streamId].length === 1) { + delete _this10._shimmedLocalStreams[streamId]; + } + }); + } + return origRemoveTrack.apply(this, arguments); + }; + } + + function shimAddTrackRemoveTrack(window, browserDetails) { + if (!window.RTCPeerConnection) { + return; + } + // shim addTrack and removeTrack. + if (window.RTCPeerConnection.prototype.addTrack && browserDetails.version >= 65) { + return shimAddTrackRemoveTrackWithNative(window); + } + + // also shim pc.getLocalStreams when addTrack is shimmed + // to return the original streams. + var origGetLocalStreams = window.RTCPeerConnection.prototype.getLocalStreams; + window.RTCPeerConnection.prototype.getLocalStreams = function getLocalStreams() { + var _this11 = this; + + var nativeStreams = origGetLocalStreams.apply(this); + this._reverseStreams = this._reverseStreams || {}; + return nativeStreams.map(function (stream) { + return _this11._reverseStreams[stream.id]; + }); + }; + + var origAddStream = window.RTCPeerConnection.prototype.addStream; + window.RTCPeerConnection.prototype.addStream = function addStream(stream) { + var _this12 = this; + + this._streams = this._streams || {}; + this._reverseStreams = this._reverseStreams || {}; + + stream.getTracks().forEach(function (track) { + var alreadyExists = _this12.getSenders().find(function (s) { + return s.track === track; + }); + if (alreadyExists) { + throw new DOMException('Track already exists.', 'InvalidAccessError'); + } + }); + // Add identity mapping for consistency with addTrack. + // Unless this is being used with a stream from addTrack. + if (!this._reverseStreams[stream.id]) { + var newStream = new window.MediaStream(stream.getTracks()); + this._streams[stream.id] = newStream; + this._reverseStreams[newStream.id] = stream; + stream = newStream; + } + origAddStream.apply(this, [stream]); + }; + + var origRemoveStream = window.RTCPeerConnection.prototype.removeStream; + window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) { + this._streams = this._streams || {}; + this._reverseStreams = this._reverseStreams || {}; + + origRemoveStream.apply(this, [this._streams[stream.id] || stream]); + delete this._reverseStreams[this._streams[stream.id] ? this._streams[stream.id].id : stream.id]; + delete this._streams[stream.id]; + }; + + window.RTCPeerConnection.prototype.addTrack = function addTrack(track, stream) { + var _this13 = this; + + if (this.signalingState === 'closed') { + throw new DOMException('The RTCPeerConnection\'s signalingState is \'closed\'.', 'InvalidStateError'); + } + var streams = [].slice.call(arguments, 1); + if (streams.length !== 1 || !streams[0].getTracks().find(function (t) { + return t === track; + })) { + // this is not fully correct but all we can manage without + // [[associated MediaStreams]] internal slot. + throw new DOMException('The adapter.js addTrack polyfill only supports a single ' + ' stream which is associated with the specified track.', 'NotSupportedError'); + } + + var alreadyExists = this.getSenders().find(function (s) { + return s.track === track; + }); + if (alreadyExists) { + throw new DOMException('Track already exists.', 'InvalidAccessError'); + } + + this._streams = this._streams || {}; + this._reverseStreams = this._reverseStreams || {}; + var oldStream = this._streams[stream.id]; + if (oldStream) { + // this is using odd Chrome behaviour, use with caution: + // https://bugs.chromium.org/p/webrtc/issues/detail?id=7815 + // Note: we rely on the high-level addTrack/dtmf shim to + // create the sender with a dtmf sender. + oldStream.addTrack(track); + + // Trigger ONN async. + Promise.resolve().then(function () { + _this13.dispatchEvent(new Event('negotiationneeded')); + }); + } else { + var newStream = new window.MediaStream([track]); + this._streams[stream.id] = newStream; + this._reverseStreams[newStream.id] = stream; + this.addStream(newStream); + } + return this.getSenders().find(function (s) { + return s.track === track; + }); + }; + + // replace the internal stream id with the external one and + // vice versa. + function replaceInternalStreamId(pc, description) { + var sdp = description.sdp; + Object.keys(pc._reverseStreams || []).forEach(function (internalId) { + var externalStream = pc._reverseStreams[internalId]; + var internalStream = pc._streams[externalStream.id]; + sdp = sdp.replace(new RegExp(internalStream.id, 'g'), externalStream.id); + }); + return new RTCSessionDescription({ + type: description.type, + sdp: sdp + }); + } + function replaceExternalStreamId(pc, description) { + var sdp = description.sdp; + Object.keys(pc._reverseStreams || []).forEach(function (internalId) { + var externalStream = pc._reverseStreams[internalId]; + var internalStream = pc._streams[externalStream.id]; + sdp = sdp.replace(new RegExp(externalStream.id, 'g'), internalStream.id); + }); + return new RTCSessionDescription({ + type: description.type, + sdp: sdp + }); + } + ['createOffer', 'createAnswer'].forEach(function (method) { + var nativeMethod = window.RTCPeerConnection.prototype[method]; + var methodObj = _defineProperty({}, method, function () { + var _this14 = this; + + var args = arguments; + var isLegacyCall = arguments.length && typeof arguments[0] === 'function'; + if (isLegacyCall) { + return nativeMethod.apply(this, [function (description) { + var desc = replaceInternalStreamId(_this14, description); + args[0].apply(null, [desc]); + }, function (err) { + if (args[1]) { + args[1].apply(null, err); + } + }, arguments[2]]); + } + return nativeMethod.apply(this, arguments).then(function (description) { + return replaceInternalStreamId(_this14, description); + }); + }); + window.RTCPeerConnection.prototype[method] = methodObj[method]; + }); + + var origSetLocalDescription = window.RTCPeerConnection.prototype.setLocalDescription; + window.RTCPeerConnection.prototype.setLocalDescription = function setLocalDescription() { + if (!arguments.length || !arguments[0].type) { + return origSetLocalDescription.apply(this, arguments); + } + arguments[0] = replaceExternalStreamId(this, arguments[0]); + return origSetLocalDescription.apply(this, arguments); + }; + + // TODO: mangle getStats: https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamstats-streamidentifier + + var origLocalDescription = Object.getOwnPropertyDescriptor(window.RTCPeerConnection.prototype, 'localDescription'); + Object.defineProperty(window.RTCPeerConnection.prototype, 'localDescription', { + get: function get() { + var description = origLocalDescription.get.apply(this); + if (description.type === '') { + return description; + } + return replaceInternalStreamId(this, description); + } + }); + + window.RTCPeerConnection.prototype.removeTrack = function removeTrack(sender) { + var _this15 = this; + + if (this.signalingState === 'closed') { + throw new DOMException('The RTCPeerConnection\'s signalingState is \'closed\'.', 'InvalidStateError'); + } + // We can not yet check for sender instanceof RTCRtpSender + // since we shim RTPSender. So we check if sender._pc is set. + if (!sender._pc) { + throw new DOMException('Argument 1 of RTCPeerConnection.removeTrack ' + 'does not implement interface RTCRtpSender.', 'TypeError'); + } + var isLocal = sender._pc === this; + if (!isLocal) { + throw new DOMException('Sender was not created by this connection.', 'InvalidAccessError'); + } + + // Search for the native stream the senders track belongs to. + this._streams = this._streams || {}; + var stream = void 0; + Object.keys(this._streams).forEach(function (streamid) { + var hasTrack = _this15._streams[streamid].getTracks().find(function (track) { + return sender.track === track; + }); + if (hasTrack) { + stream = _this15._streams[streamid]; + } + }); + + if (stream) { + if (stream.getTracks().length === 1) { + // if this is the last track of the stream, remove the stream. This + // takes care of any shimmed _senders. + this.removeStream(this._reverseStreams[stream.id]); + } else { + // relying on the same odd chrome behaviour as above. + stream.removeTrack(sender.track); + } + this.dispatchEvent(new Event('negotiationneeded')); + } + }; + } + + function shimPeerConnection(window, browserDetails) { + if (!window.RTCPeerConnection && window.webkitRTCPeerConnection) { + // very basic support for old versions. + window.RTCPeerConnection = window.webkitRTCPeerConnection; + } + if (!window.RTCPeerConnection) { + return; + } + + // shim implicit creation of RTCSessionDescription/RTCIceCandidate + if (browserDetails.version < 53) { + ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate'].forEach(function (method) { + var nativeMethod = window.RTCPeerConnection.prototype[method]; + var methodObj = _defineProperty({}, method, function () { + arguments[0] = new (method === 'addIceCandidate' ? window.RTCIceCandidate : window.RTCSessionDescription)(arguments[0]); + return nativeMethod.apply(this, arguments); + }); + window.RTCPeerConnection.prototype[method] = methodObj[method]; + }); + } + } + +// Attempt to fix ONN in plan-b mode. + function fixNegotiationNeeded(window, browserDetails) { + utils.wrapPeerConnectionEvent(window, 'negotiationneeded', function (e) { + var pc = e.target; + if (browserDetails.version < 72 || pc.getConfiguration && pc.getConfiguration().sdpSemantics === 'plan-b') { + if (pc.signalingState !== 'stable') { + return; + } + } + return e; + }); + } + + },{"../utils.js":11,"./getdisplaymedia":4,"./getusermedia":5}],4:[function(require,module,exports){ + /* + * Copyright (c) 2018 The adapter.js project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.shimGetDisplayMedia = shimGetDisplayMedia; + function shimGetDisplayMedia(window, getSourceId) { + if (window.navigator.mediaDevices && 'getDisplayMedia' in window.navigator.mediaDevices) { + return; + } + if (!window.navigator.mediaDevices) { + return; + } + // getSourceId is a function that returns a promise resolving with + // the sourceId of the screen/window/tab to be shared. + if (typeof getSourceId !== 'function') { + console.error('shimGetDisplayMedia: getSourceId argument is not ' + 'a function'); + return; + } + window.navigator.mediaDevices.getDisplayMedia = function getDisplayMedia(constraints) { + return getSourceId(constraints).then(function (sourceId) { + var widthSpecified = constraints.video && constraints.video.width; + var heightSpecified = constraints.video && constraints.video.height; + var frameRateSpecified = constraints.video && constraints.video.frameRate; + constraints.video = { + mandatory: { + chromeMediaSource: 'desktop', + chromeMediaSourceId: sourceId, + maxFrameRate: frameRateSpecified || 3 + } + }; + if (widthSpecified) { + constraints.video.mandatory.maxWidth = widthSpecified; + } + if (heightSpecified) { + constraints.video.mandatory.maxHeight = heightSpecified; + } + return window.navigator.mediaDevices.getUserMedia(constraints); + }); + }; + } + + },{}],5:[function(require,module,exports){ + /* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + exports.shimGetUserMedia = shimGetUserMedia; + + var _utils = require('../utils.js'); + + var utils = _interopRequireWildcard(_utils); + + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + + var logging = utils.log; + + function shimGetUserMedia(window, browserDetails) { + var navigator = window && window.navigator; + + if (!navigator.mediaDevices) { + return; + } + + var constraintsToChrome_ = function constraintsToChrome_(c) { + if ((typeof c === 'undefined' ? 'undefined' : _typeof(c)) !== 'object' || c.mandatory || c.optional) { + return c; + } + var cc = {}; + Object.keys(c).forEach(function (key) { + if (key === 'require' || key === 'advanced' || key === 'mediaSource') { + return; + } + var r = _typeof(c[key]) === 'object' ? c[key] : { ideal: c[key] }; + if (r.exact !== undefined && typeof r.exact === 'number') { + r.min = r.max = r.exact; + } + var oldname_ = function oldname_(prefix, name) { + if (prefix) { + return prefix + name.charAt(0).toUpperCase() + name.slice(1); + } + return name === 'deviceId' ? 'sourceId' : name; + }; + if (r.ideal !== undefined) { + cc.optional = cc.optional || []; + var oc = {}; + if (typeof r.ideal === 'number') { + oc[oldname_('min', key)] = r.ideal; + cc.optional.push(oc); + oc = {}; + oc[oldname_('max', key)] = r.ideal; + cc.optional.push(oc); + } else { + oc[oldname_('', key)] = r.ideal; + cc.optional.push(oc); + } + } + if (r.exact !== undefined && typeof r.exact !== 'number') { + cc.mandatory = cc.mandatory || {}; + cc.mandatory[oldname_('', key)] = r.exact; + } else { + ['min', 'max'].forEach(function (mix) { + if (r[mix] !== undefined) { + cc.mandatory = cc.mandatory || {}; + cc.mandatory[oldname_(mix, key)] = r[mix]; + } + }); + } + }); + if (c.advanced) { + cc.optional = (cc.optional || []).concat(c.advanced); + } + return cc; + }; + + var shimConstraints_ = function shimConstraints_(constraints, func) { + if (browserDetails.version >= 61) { + return func(constraints); + } + constraints = JSON.parse(JSON.stringify(constraints)); + if (constraints && _typeof(constraints.audio) === 'object') { + var remap = function remap(obj, a, b) { + if (a in obj && !(b in obj)) { + obj[b] = obj[a]; + delete obj[a]; + } + }; + constraints = JSON.parse(JSON.stringify(constraints)); + remap(constraints.audio, 'autoGainControl', 'googAutoGainControl'); + remap(constraints.audio, 'noiseSuppression', 'googNoiseSuppression'); + constraints.audio = constraintsToChrome_(constraints.audio); + } + if (constraints && _typeof(constraints.video) === 'object') { + // Shim facingMode for mobile & surface pro. + var face = constraints.video.facingMode; + face = face && ((typeof face === 'undefined' ? 'undefined' : _typeof(face)) === 'object' ? face : { ideal: face }); + var getSupportedFacingModeLies = browserDetails.version < 66; + + if (face && (face.exact === 'user' || face.exact === 'environment' || face.ideal === 'user' || face.ideal === 'environment') && !(navigator.mediaDevices.getSupportedConstraints && navigator.mediaDevices.getSupportedConstraints().facingMode && !getSupportedFacingModeLies)) { + delete constraints.video.facingMode; + var matches = void 0; + if (face.exact === 'environment' || face.ideal === 'environment') { + matches = ['back', 'rear']; + } else if (face.exact === 'user' || face.ideal === 'user') { + matches = ['front']; + } + if (matches) { + // Look for matches in label, or use last cam for back (typical). + return navigator.mediaDevices.enumerateDevices().then(function (devices) { + devices = devices.filter(function (d) { + return d.kind === 'videoinput'; + }); + var dev = devices.find(function (d) { + return matches.some(function (match) { + return d.label.toLowerCase().includes(match); + }); + }); + if (!dev && devices.length && matches.includes('back')) { + dev = devices[devices.length - 1]; // more likely the back cam + } + if (dev) { + constraints.video.deviceId = face.exact ? { exact: dev.deviceId } : { ideal: dev.deviceId }; + } + constraints.video = constraintsToChrome_(constraints.video); + logging('chrome: ' + JSON.stringify(constraints)); + return func(constraints); + }); + } + } + constraints.video = constraintsToChrome_(constraints.video); + } + logging('chrome: ' + JSON.stringify(constraints)); + return func(constraints); + }; + + var shimError_ = function shimError_(e) { + if (browserDetails.version >= 64) { + return e; + } + return { + name: { + PermissionDeniedError: 'NotAllowedError', + PermissionDismissedError: 'NotAllowedError', + InvalidStateError: 'NotAllowedError', + DevicesNotFoundError: 'NotFoundError', + ConstraintNotSatisfiedError: 'OverconstrainedError', + TrackStartError: 'NotReadableError', + MediaDeviceFailedDueToShutdown: 'NotAllowedError', + MediaDeviceKillSwitchOn: 'NotAllowedError', + TabCaptureError: 'AbortError', + ScreenCaptureError: 'AbortError', + DeviceCaptureError: 'AbortError' + }[e.name] || e.name, + message: e.message, + constraint: e.constraint || e.constraintName, + toString: function toString() { + return this.name + (this.message && ': ') + this.message; + } + }; + }; + + var getUserMedia_ = function getUserMedia_(constraints, onSuccess, onError) { + shimConstraints_(constraints, function (c) { + navigator.webkitGetUserMedia(c, onSuccess, function (e) { + if (onError) { + onError(shimError_(e)); + } + }); + }); + }; + navigator.getUserMedia = getUserMedia_.bind(navigator); + + // Even though Chrome 45 has navigator.mediaDevices and a getUserMedia + // function which returns a Promise, it does not accept spec-style + // constraints. + if (navigator.mediaDevices.getUserMedia) { + var origGetUserMedia = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices); + navigator.mediaDevices.getUserMedia = function (cs) { + return shimConstraints_(cs, function (c) { + return origGetUserMedia(c).then(function (stream) { + if (c.audio && !stream.getAudioTracks().length || c.video && !stream.getVideoTracks().length) { + stream.getTracks().forEach(function (track) { + track.stop(); + }); + throw new DOMException('', 'NotFoundError'); + } + return stream; + }, function (e) { + return Promise.reject(shimError_(e)); + }); + }); + }; + } + } + + },{"../utils.js":11}],6:[function(require,module,exports){ + /* + * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + exports.shimRTCIceCandidate = shimRTCIceCandidate; + exports.shimMaxMessageSize = shimMaxMessageSize; + exports.shimSendThrowTypeError = shimSendThrowTypeError; + exports.shimConnectionState = shimConnectionState; + exports.removeExtmapAllowMixed = removeExtmapAllowMixed; + exports.shimAddIceCandidateNullOrEmpty = shimAddIceCandidateNullOrEmpty; + + var _sdp = require('sdp'); + + var _sdp2 = _interopRequireDefault(_sdp); + + var _utils = require('./utils'); + + var utils = _interopRequireWildcard(_utils); + + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function shimRTCIceCandidate(window) { + // foundation is arbitrarily chosen as an indicator for full support for + // https://w3c.github.io/webrtc-pc/#rtcicecandidate-interface + if (!window.RTCIceCandidate || window.RTCIceCandidate && 'foundation' in window.RTCIceCandidate.prototype) { + return; + } + + var NativeRTCIceCandidate = window.RTCIceCandidate; + window.RTCIceCandidate = function RTCIceCandidate(args) { + // Remove the a= which shouldn't be part of the candidate string. + if ((typeof args === 'undefined' ? 'undefined' : _typeof(args)) === 'object' && args.candidate && args.candidate.indexOf('a=') === 0) { + args = JSON.parse(JSON.stringify(args)); + args.candidate = args.candidate.substr(2); + } + + if (args.candidate && args.candidate.length) { + // Augment the native candidate with the parsed fields. + var nativeCandidate = new NativeRTCIceCandidate(args); + var parsedCandidate = _sdp2.default.parseCandidate(args.candidate); + var augmentedCandidate = Object.assign(nativeCandidate, parsedCandidate); + + // Add a serializer that does not serialize the extra attributes. + augmentedCandidate.toJSON = function toJSON() { + return { + candidate: augmentedCandidate.candidate, + sdpMid: augmentedCandidate.sdpMid, + sdpMLineIndex: augmentedCandidate.sdpMLineIndex, + usernameFragment: augmentedCandidate.usernameFragment + }; + }; + return augmentedCandidate; + } + return new NativeRTCIceCandidate(args); + }; + window.RTCIceCandidate.prototype = NativeRTCIceCandidate.prototype; + + // Hook up the augmented candidate in onicecandidate and + // addEventListener('icecandidate', ...) + utils.wrapPeerConnectionEvent(window, 'icecandidate', function (e) { + if (e.candidate) { + Object.defineProperty(e, 'candidate', { + value: new window.RTCIceCandidate(e.candidate), + writable: 'false' + }); + } + return e; + }); + } + + function shimMaxMessageSize(window, browserDetails) { + if (!window.RTCPeerConnection) { + return; + } + + if (!('sctp' in window.RTCPeerConnection.prototype)) { + Object.defineProperty(window.RTCPeerConnection.prototype, 'sctp', { + get: function get() { + return typeof this._sctp === 'undefined' ? null : this._sctp; + } + }); + } + + var sctpInDescription = function sctpInDescription(description) { + if (!description || !description.sdp) { + return false; + } + var sections = _sdp2.default.splitSections(description.sdp); + sections.shift(); + return sections.some(function (mediaSection) { + var mLine = _sdp2.default.parseMLine(mediaSection); + return mLine && mLine.kind === 'application' && mLine.protocol.indexOf('SCTP') !== -1; + }); + }; + + var getRemoteFirefoxVersion = function getRemoteFirefoxVersion(description) { + // TODO: Is there a better solution for detecting Firefox? + var match = description.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/); + if (match === null || match.length < 2) { + return -1; + } + var version = parseInt(match[1], 10); + // Test for NaN (yes, this is ugly) + return version !== version ? -1 : version; + }; + + var getCanSendMaxMessageSize = function getCanSendMaxMessageSize(remoteIsFirefox) { + // Every implementation we know can send at least 64 KiB. + // Note: Although Chrome is technically able to send up to 256 KiB, the + // data does not reach the other peer reliably. + // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=8419 + var canSendMaxMessageSize = 65536; + if (browserDetails.browser === 'firefox') { + if (browserDetails.version < 57) { + if (remoteIsFirefox === -1) { + // FF < 57 will send in 16 KiB chunks using the deprecated PPID + // fragmentation. + canSendMaxMessageSize = 16384; + } else { + // However, other FF (and RAWRTC) can reassemble PPID-fragmented + // messages. Thus, supporting ~2 GiB when sending. + canSendMaxMessageSize = 2147483637; + } + } else if (browserDetails.version < 60) { + // Currently, all FF >= 57 will reset the remote maximum message size + // to the default value when a data channel is created at a later + // stage. :( + // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831 + canSendMaxMessageSize = browserDetails.version === 57 ? 65535 : 65536; + } else { + // FF >= 60 supports sending ~2 GiB + canSendMaxMessageSize = 2147483637; + } + } + return canSendMaxMessageSize; + }; + + var getMaxMessageSize = function getMaxMessageSize(description, remoteIsFirefox) { + // Note: 65536 bytes is the default value from the SDP spec. Also, + // every implementation we know supports receiving 65536 bytes. + var maxMessageSize = 65536; + + // FF 57 has a slightly incorrect default remote max message size, so + // we need to adjust it here to avoid a failure when sending. + // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1425697 + if (browserDetails.browser === 'firefox' && browserDetails.version === 57) { + maxMessageSize = 65535; + } + + var match = _sdp2.default.matchPrefix(description.sdp, 'a=max-message-size:'); + if (match.length > 0) { + maxMessageSize = parseInt(match[0].substr(19), 10); + } else if (browserDetails.browser === 'firefox' && remoteIsFirefox !== -1) { + // If the maximum message size is not present in the remote SDP and + // both local and remote are Firefox, the remote peer can receive + // ~2 GiB. + maxMessageSize = 2147483637; + } + return maxMessageSize; + }; + + var origSetRemoteDescription = window.RTCPeerConnection.prototype.setRemoteDescription; + window.RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription() { + this._sctp = null; + // Chrome decided to not expose .sctp in plan-b mode. + // As usual, adapter.js has to do an 'ugly worakaround' + // to cover up the mess. + if (browserDetails.browser === 'chrome' && browserDetails.version >= 76) { + var _getConfiguration = this.getConfiguration(), + sdpSemantics = _getConfiguration.sdpSemantics; + + if (sdpSemantics === 'plan-b') { + Object.defineProperty(this, 'sctp', { + get: function get() { + return typeof this._sctp === 'undefined' ? null : this._sctp; + }, + + enumerable: true, + configurable: true + }); + } + } + + if (sctpInDescription(arguments[0])) { + // Check if the remote is FF. + var isFirefox = getRemoteFirefoxVersion(arguments[0]); + + // Get the maximum message size the local peer is capable of sending + var canSendMMS = getCanSendMaxMessageSize(isFirefox); + + // Get the maximum message size of the remote peer. + var remoteMMS = getMaxMessageSize(arguments[0], isFirefox); + + // Determine final maximum message size + var maxMessageSize = void 0; + if (canSendMMS === 0 && remoteMMS === 0) { + maxMessageSize = Number.POSITIVE_INFINITY; + } else if (canSendMMS === 0 || remoteMMS === 0) { + maxMessageSize = Math.max(canSendMMS, remoteMMS); + } else { + maxMessageSize = Math.min(canSendMMS, remoteMMS); + } + + // Create a dummy RTCSctpTransport object and the 'maxMessageSize' + // attribute. + var sctp = {}; + Object.defineProperty(sctp, 'maxMessageSize', { + get: function get() { + return maxMessageSize; + } + }); + this._sctp = sctp; + } + + return origSetRemoteDescription.apply(this, arguments); + }; + } + + function shimSendThrowTypeError(window) { + if (!(window.RTCPeerConnection && 'createDataChannel' in window.RTCPeerConnection.prototype)) { + return; + } + + // Note: Although Firefox >= 57 has a native implementation, the maximum + // message size can be reset for all data channels at a later stage. + // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831 + + function wrapDcSend(dc, pc) { + var origDataChannelSend = dc.send; + dc.send = function send() { + var data = arguments[0]; + var length = data.length || data.size || data.byteLength; + if (dc.readyState === 'open' && pc.sctp && length > pc.sctp.maxMessageSize) { + throw new TypeError('Message too large (can send a maximum of ' + pc.sctp.maxMessageSize + ' bytes)'); + } + return origDataChannelSend.apply(dc, arguments); + }; + } + var origCreateDataChannel = window.RTCPeerConnection.prototype.createDataChannel; + window.RTCPeerConnection.prototype.createDataChannel = function createDataChannel() { + var dataChannel = origCreateDataChannel.apply(this, arguments); + wrapDcSend(dataChannel, this); + return dataChannel; + }; + utils.wrapPeerConnectionEvent(window, 'datachannel', function (e) { + wrapDcSend(e.channel, e.target); + return e; + }); + } + + /* shims RTCConnectionState by pretending it is the same as iceConnectionState. + * See https://bugs.chromium.org/p/webrtc/issues/detail?id=6145#c12 + * for why this is a valid hack in Chrome. In Firefox it is slightly incorrect + * since DTLS failures would be hidden. See + * https://bugzilla.mozilla.org/show_bug.cgi?id=1265827 + * for the Firefox tracking bug. + */ + function shimConnectionState(window) { + if (!window.RTCPeerConnection || 'connectionState' in window.RTCPeerConnection.prototype) { + return; + } + var proto = window.RTCPeerConnection.prototype; + Object.defineProperty(proto, 'connectionState', { + get: function get() { + return { + completed: 'connected', + checking: 'connecting' + }[this.iceConnectionState] || this.iceConnectionState; + }, + + enumerable: true, + configurable: true + }); + Object.defineProperty(proto, 'onconnectionstatechange', { + get: function get() { + return this._onconnectionstatechange || null; + }, + set: function set(cb) { + if (this._onconnectionstatechange) { + this.removeEventListener('connectionstatechange', this._onconnectionstatechange); + delete this._onconnectionstatechange; + } + if (cb) { + this.addEventListener('connectionstatechange', this._onconnectionstatechange = cb); + } + }, + + enumerable: true, + configurable: true + }); + + ['setLocalDescription', 'setRemoteDescription'].forEach(function (method) { + var origMethod = proto[method]; + proto[method] = function () { + if (!this._connectionstatechangepoly) { + this._connectionstatechangepoly = function (e) { + var pc = e.target; + if (pc._lastConnectionState !== pc.connectionState) { + pc._lastConnectionState = pc.connectionState; + var newEvent = new Event('connectionstatechange', e); + pc.dispatchEvent(newEvent); + } + return e; + }; + this.addEventListener('iceconnectionstatechange', this._connectionstatechangepoly); + } + return origMethod.apply(this, arguments); + }; + }); + } + + function removeExtmapAllowMixed(window, browserDetails) { + /* remove a=extmap-allow-mixed for webrtc.org < M71 */ + if (!window.RTCPeerConnection) { + return; + } + if (browserDetails.browser === 'chrome' && browserDetails.version >= 71) { + return; + } + if (browserDetails.browser === 'safari' && browserDetails.version >= 605) { + return; + } + var nativeSRD = window.RTCPeerConnection.prototype.setRemoteDescription; + window.RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription(desc) { + if (desc && desc.sdp && desc.sdp.indexOf('\na=extmap-allow-mixed') !== -1) { + var sdp = desc.sdp.split('\n').filter(function (line) { + return line.trim() !== 'a=extmap-allow-mixed'; + }).join('\n'); + // Safari enforces read-only-ness of RTCSessionDescription fields. + if (window.RTCSessionDescription && desc instanceof window.RTCSessionDescription) { + arguments[0] = new window.RTCSessionDescription({ + type: desc.type, + sdp: sdp + }); + } else { + desc.sdp = sdp; + } + } + return nativeSRD.apply(this, arguments); + }; + } + + function shimAddIceCandidateNullOrEmpty(window, browserDetails) { + // Support for addIceCandidate(null or undefined) + // as well as addIceCandidate({candidate: "", ...}) + // https://bugs.chromium.org/p/chromium/issues/detail?id=978582 + // Note: must be called before other polyfills which change the signature. + if (!(window.RTCPeerConnection && window.RTCPeerConnection.prototype)) { + return; + } + var nativeAddIceCandidate = window.RTCPeerConnection.prototype.addIceCandidate; + if (!nativeAddIceCandidate || nativeAddIceCandidate.length === 0) { + return; + } + window.RTCPeerConnection.prototype.addIceCandidate = function addIceCandidate() { + if (!arguments[0]) { + if (arguments[1]) { + arguments[1].apply(null); + } + return Promise.resolve(); + } + // Firefox 68+ emits and processes {candidate: "", ...}, ignore + // in older versions. + // Native support for ignoring exists for Chrome M77+. + // Safari ignores as well, exact version unknown but works in the same + // version that also ignores addIceCandidate(null). + if ((browserDetails.browser === 'chrome' && browserDetails.version < 78 || browserDetails.browser === 'firefox' && browserDetails.version < 68 || browserDetails.browser === 'safari') && arguments[0] && arguments[0].candidate === '') { + return Promise.resolve(); + } + return nativeAddIceCandidate.apply(this, arguments); + }; + } + + },{"./utils":11,"sdp":12}],7:[function(require,module,exports){ + /* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.shimGetDisplayMedia = exports.shimGetUserMedia = undefined; + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + var _getusermedia = require('./getusermedia'); + + Object.defineProperty(exports, 'shimGetUserMedia', { + enumerable: true, + get: function get() { + return _getusermedia.shimGetUserMedia; + } + }); + + var _getdisplaymedia = require('./getdisplaymedia'); + + Object.defineProperty(exports, 'shimGetDisplayMedia', { + enumerable: true, + get: function get() { + return _getdisplaymedia.shimGetDisplayMedia; + } + }); + exports.shimOnTrack = shimOnTrack; + exports.shimPeerConnection = shimPeerConnection; + exports.shimSenderGetStats = shimSenderGetStats; + exports.shimReceiverGetStats = shimReceiverGetStats; + exports.shimRemoveStream = shimRemoveStream; + exports.shimRTCDataChannel = shimRTCDataChannel; + exports.shimAddTransceiver = shimAddTransceiver; + exports.shimGetParameters = shimGetParameters; + exports.shimCreateOffer = shimCreateOffer; + exports.shimCreateAnswer = shimCreateAnswer; + + var _utils = require('../utils'); + + var utils = _interopRequireWildcard(_utils); + + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + function shimOnTrack(window) { + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCTrackEvent && 'receiver' in window.RTCTrackEvent.prototype && !('transceiver' in window.RTCTrackEvent.prototype)) { + Object.defineProperty(window.RTCTrackEvent.prototype, 'transceiver', { + get: function get() { + return { receiver: this.receiver }; + } + }); + } + } + + function shimPeerConnection(window, browserDetails) { + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !(window.RTCPeerConnection || window.mozRTCPeerConnection)) { + return; // probably media.peerconnection.enabled=false in about:config + } + if (!window.RTCPeerConnection && window.mozRTCPeerConnection) { + // very basic support for old versions. + window.RTCPeerConnection = window.mozRTCPeerConnection; + } + + if (browserDetails.version < 53) { + // shim away need for obsolete RTCIceCandidate/RTCSessionDescription. + ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate'].forEach(function (method) { + var nativeMethod = window.RTCPeerConnection.prototype[method]; + var methodObj = _defineProperty({}, method, function () { + arguments[0] = new (method === 'addIceCandidate' ? window.RTCIceCandidate : window.RTCSessionDescription)(arguments[0]); + return nativeMethod.apply(this, arguments); + }); + window.RTCPeerConnection.prototype[method] = methodObj[method]; + }); + } + + var modernStatsTypes = { + inboundrtp: 'inbound-rtp', + outboundrtp: 'outbound-rtp', + candidatepair: 'candidate-pair', + localcandidate: 'local-candidate', + remotecandidate: 'remote-candidate' + }; + + var nativeGetStats = window.RTCPeerConnection.prototype.getStats; + window.RTCPeerConnection.prototype.getStats = function getStats() { + var _arguments = Array.prototype.slice.call(arguments), + selector = _arguments[0], + onSucc = _arguments[1], + onErr = _arguments[2]; + + return nativeGetStats.apply(this, [selector || null]).then(function (stats) { + if (browserDetails.version < 53 && !onSucc) { + // Shim only promise getStats with spec-hyphens in type names + // Leave callback version alone; misc old uses of forEach before Map + try { + stats.forEach(function (stat) { + stat.type = modernStatsTypes[stat.type] || stat.type; + }); + } catch (e) { + if (e.name !== 'TypeError') { + throw e; + } + // Avoid TypeError: "type" is read-only, in old versions. 34-43ish + stats.forEach(function (stat, i) { + stats.set(i, Object.assign({}, stat, { + type: modernStatsTypes[stat.type] || stat.type + })); + }); + } + } + return stats; + }).then(onSucc, onErr); + }; + } + + function shimSenderGetStats(window) { + if (!((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && window.RTCRtpSender)) { + return; + } + if (window.RTCRtpSender && 'getStats' in window.RTCRtpSender.prototype) { + return; + } + var origGetSenders = window.RTCPeerConnection.prototype.getSenders; + if (origGetSenders) { + window.RTCPeerConnection.prototype.getSenders = function getSenders() { + var _this = this; + + var senders = origGetSenders.apply(this, []); + senders.forEach(function (sender) { + return sender._pc = _this; + }); + return senders; + }; + } + + var origAddTrack = window.RTCPeerConnection.prototype.addTrack; + if (origAddTrack) { + window.RTCPeerConnection.prototype.addTrack = function addTrack() { + var sender = origAddTrack.apply(this, arguments); + sender._pc = this; + return sender; + }; + } + window.RTCRtpSender.prototype.getStats = function getStats() { + return this.track ? this._pc.getStats(this.track) : Promise.resolve(new Map()); + }; + } + + function shimReceiverGetStats(window) { + if (!((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && window.RTCRtpSender)) { + return; + } + if (window.RTCRtpSender && 'getStats' in window.RTCRtpReceiver.prototype) { + return; + } + var origGetReceivers = window.RTCPeerConnection.prototype.getReceivers; + if (origGetReceivers) { + window.RTCPeerConnection.prototype.getReceivers = function getReceivers() { + var _this2 = this; + + var receivers = origGetReceivers.apply(this, []); + receivers.forEach(function (receiver) { + return receiver._pc = _this2; + }); + return receivers; + }; + } + utils.wrapPeerConnectionEvent(window, 'track', function (e) { + e.receiver._pc = e.srcElement; + return e; + }); + window.RTCRtpReceiver.prototype.getStats = function getStats() { + return this._pc.getStats(this.track); + }; + } + + function shimRemoveStream(window) { + if (!window.RTCPeerConnection || 'removeStream' in window.RTCPeerConnection.prototype) { + return; + } + window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) { + var _this3 = this; + + utils.deprecated('removeStream', 'removeTrack'); + this.getSenders().forEach(function (sender) { + if (sender.track && stream.getTracks().includes(sender.track)) { + _this3.removeTrack(sender); + } + }); + }; + } + + function shimRTCDataChannel(window) { + // rename DataChannel to RTCDataChannel (native fix in FF60): + // https://bugzilla.mozilla.org/show_bug.cgi?id=1173851 + if (window.DataChannel && !window.RTCDataChannel) { + window.RTCDataChannel = window.DataChannel; + } + } + + function shimAddTransceiver(window) { + // https://github.com/webrtcHacks/adapter/issues/998#issuecomment-516921647 + // Firefox ignores the init sendEncodings options passed to addTransceiver + // https://bugzilla.mozilla.org/show_bug.cgi?id=1396918 + if (!((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection)) { + return; + } + var origAddTransceiver = window.RTCPeerConnection.prototype.addTransceiver; + if (origAddTransceiver) { + window.RTCPeerConnection.prototype.addTransceiver = function addTransceiver() { + this.setParametersPromises = []; + var initParameters = arguments[1]; + var shouldPerformCheck = initParameters && 'sendEncodings' in initParameters; + if (shouldPerformCheck) { + // If sendEncodings params are provided, validate grammar + initParameters.sendEncodings.forEach(function (encodingParam) { + if ('rid' in encodingParam) { + var ridRegex = /^[a-z0-9]{0,16}$/i; + if (!ridRegex.test(encodingParam.rid)) { + throw new TypeError('Invalid RID value provided.'); + } + } + if ('scaleResolutionDownBy' in encodingParam) { + if (!(parseFloat(encodingParam.scaleResolutionDownBy) >= 1.0)) { + throw new RangeError('scale_resolution_down_by must be >= 1.0'); + } + } + if ('maxFramerate' in encodingParam) { + if (!(parseFloat(encodingParam.maxFramerate) >= 0)) { + throw new RangeError('max_framerate must be >= 0.0'); + } + } + }); + } + var transceiver = origAddTransceiver.apply(this, arguments); + if (shouldPerformCheck) { + // Check if the init options were applied. If not we do this in an + // asynchronous way and save the promise reference in a global object. + // This is an ugly hack, but at the same time is way more robust than + // checking the sender parameters before and after the createOffer + // Also note that after the createoffer we are not 100% sure that + // the params were asynchronously applied so we might miss the + // opportunity to recreate offer. + var sender = transceiver.sender; + + var params = sender.getParameters(); + if (!('encodings' in params) || + // Avoid being fooled by patched getParameters() below. + params.encodings.length === 1 && Object.keys(params.encodings[0]).length === 0) { + params.encodings = initParameters.sendEncodings; + sender.sendEncodings = initParameters.sendEncodings; + this.setParametersPromises.push(sender.setParameters(params).then(function () { + delete sender.sendEncodings; + }).catch(function () { + delete sender.sendEncodings; + })); + } + } + return transceiver; + }; + } + } + + function shimGetParameters(window) { + if (!((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCRtpSender)) { + return; + } + var origGetParameters = window.RTCRtpSender.prototype.getParameters; + if (origGetParameters) { + window.RTCRtpSender.prototype.getParameters = function getParameters() { + var params = origGetParameters.apply(this, arguments); + if (!('encodings' in params)) { + params.encodings = [].concat(this.sendEncodings || [{}]); + } + return params; + }; + } + } + + function shimCreateOffer(window) { + // https://github.com/webrtcHacks/adapter/issues/998#issuecomment-516921647 + // Firefox ignores the init sendEncodings options passed to addTransceiver + // https://bugzilla.mozilla.org/show_bug.cgi?id=1396918 + if (!((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection)) { + return; + } + var origCreateOffer = window.RTCPeerConnection.prototype.createOffer; + window.RTCPeerConnection.prototype.createOffer = function createOffer() { + var _this4 = this, + _arguments2 = arguments; + + if (this.setParametersPromises && this.setParametersPromises.length) { + return Promise.all(this.setParametersPromises).then(function () { + return origCreateOffer.apply(_this4, _arguments2); + }).finally(function () { + _this4.setParametersPromises = []; + }); + } + return origCreateOffer.apply(this, arguments); + }; + } + + function shimCreateAnswer(window) { + // https://github.com/webrtcHacks/adapter/issues/998#issuecomment-516921647 + // Firefox ignores the init sendEncodings options passed to addTransceiver + // https://bugzilla.mozilla.org/show_bug.cgi?id=1396918 + if (!((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection)) { + return; + } + var origCreateAnswer = window.RTCPeerConnection.prototype.createAnswer; + window.RTCPeerConnection.prototype.createAnswer = function createAnswer() { + var _this5 = this, + _arguments3 = arguments; + + if (this.setParametersPromises && this.setParametersPromises.length) { + return Promise.all(this.setParametersPromises).then(function () { + return origCreateAnswer.apply(_this5, _arguments3); + }).finally(function () { + _this5.setParametersPromises = []; + }); + } + return origCreateAnswer.apply(this, arguments); + }; + } + + },{"../utils":11,"./getdisplaymedia":8,"./getusermedia":9}],8:[function(require,module,exports){ + /* + * Copyright (c) 2018 The adapter.js project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.shimGetDisplayMedia = shimGetDisplayMedia; + function shimGetDisplayMedia(window, preferredMediaSource) { + if (window.navigator.mediaDevices && 'getDisplayMedia' in window.navigator.mediaDevices) { + return; + } + if (!window.navigator.mediaDevices) { + return; + } + window.navigator.mediaDevices.getDisplayMedia = function getDisplayMedia(constraints) { + if (!(constraints && constraints.video)) { + var err = new DOMException('getDisplayMedia without video ' + 'constraints is undefined'); + err.name = 'NotFoundError'; + // from https://heycam.github.io/webidl/#idl-DOMException-error-names + err.code = 8; + return Promise.reject(err); + } + if (constraints.video === true) { + constraints.video = { mediaSource: preferredMediaSource }; + } else { + constraints.video.mediaSource = preferredMediaSource; + } + return window.navigator.mediaDevices.getUserMedia(constraints); + }; + } + + },{}],9:[function(require,module,exports){ + /* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + exports.shimGetUserMedia = shimGetUserMedia; + + var _utils = require('../utils'); + + var utils = _interopRequireWildcard(_utils); + + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + + function shimGetUserMedia(window, browserDetails) { + var navigator = window && window.navigator; + var MediaStreamTrack = window && window.MediaStreamTrack; + + navigator.getUserMedia = function (constraints, onSuccess, onError) { + // Replace Firefox 44+'s deprecation warning with unprefixed version. + utils.deprecated('navigator.getUserMedia', 'navigator.mediaDevices.getUserMedia'); + navigator.mediaDevices.getUserMedia(constraints).then(onSuccess, onError); + }; + + if (!(browserDetails.version > 55 && 'autoGainControl' in navigator.mediaDevices.getSupportedConstraints())) { + var remap = function remap(obj, a, b) { + if (a in obj && !(b in obj)) { + obj[b] = obj[a]; + delete obj[a]; + } + }; + + var nativeGetUserMedia = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices); + navigator.mediaDevices.getUserMedia = function (c) { + if ((typeof c === 'undefined' ? 'undefined' : _typeof(c)) === 'object' && _typeof(c.audio) === 'object') { + c = JSON.parse(JSON.stringify(c)); + remap(c.audio, 'autoGainControl', 'mozAutoGainControl'); + remap(c.audio, 'noiseSuppression', 'mozNoiseSuppression'); + } + return nativeGetUserMedia(c); + }; + + if (MediaStreamTrack && MediaStreamTrack.prototype.getSettings) { + var nativeGetSettings = MediaStreamTrack.prototype.getSettings; + MediaStreamTrack.prototype.getSettings = function () { + var obj = nativeGetSettings.apply(this, arguments); + remap(obj, 'mozAutoGainControl', 'autoGainControl'); + remap(obj, 'mozNoiseSuppression', 'noiseSuppression'); + return obj; + }; + } + + if (MediaStreamTrack && MediaStreamTrack.prototype.applyConstraints) { + var nativeApplyConstraints = MediaStreamTrack.prototype.applyConstraints; + MediaStreamTrack.prototype.applyConstraints = function (c) { + if (this.kind === 'audio' && (typeof c === 'undefined' ? 'undefined' : _typeof(c)) === 'object') { + c = JSON.parse(JSON.stringify(c)); + remap(c, 'autoGainControl', 'mozAutoGainControl'); + remap(c, 'noiseSuppression', 'mozNoiseSuppression'); + } + return nativeApplyConstraints.apply(this, [c]); + }; + } + } + } + + },{"../utils":11}],10:[function(require,module,exports){ + /* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + exports.shimLocalStreamsAPI = shimLocalStreamsAPI; + exports.shimRemoteStreamsAPI = shimRemoteStreamsAPI; + exports.shimCallbacksAPI = shimCallbacksAPI; + exports.shimGetUserMedia = shimGetUserMedia; + exports.shimConstraints = shimConstraints; + exports.shimRTCIceServerUrls = shimRTCIceServerUrls; + exports.shimTrackEventTransceiver = shimTrackEventTransceiver; + exports.shimCreateOfferLegacy = shimCreateOfferLegacy; + exports.shimAudioContext = shimAudioContext; + + var _utils = require('../utils'); + + var utils = _interopRequireWildcard(_utils); + + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + + function shimLocalStreamsAPI(window) { + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !window.RTCPeerConnection) { + return; + } + if (!('getLocalStreams' in window.RTCPeerConnection.prototype)) { + window.RTCPeerConnection.prototype.getLocalStreams = function getLocalStreams() { + if (!this._localStreams) { + this._localStreams = []; + } + return this._localStreams; + }; + } + if (!('addStream' in window.RTCPeerConnection.prototype)) { + var _addTrack = window.RTCPeerConnection.prototype.addTrack; + window.RTCPeerConnection.prototype.addStream = function addStream(stream) { + var _this = this; + + if (!this._localStreams) { + this._localStreams = []; + } + if (!this._localStreams.includes(stream)) { + this._localStreams.push(stream); + } + // Try to emulate Chrome's behaviour of adding in audio-video order. + // Safari orders by track id. + stream.getAudioTracks().forEach(function (track) { + return _addTrack.call(_this, track, stream); + }); + stream.getVideoTracks().forEach(function (track) { + return _addTrack.call(_this, track, stream); + }); + }; + + window.RTCPeerConnection.prototype.addTrack = function addTrack(track) { + var _this2 = this; + + for (var _len = arguments.length, streams = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + streams[_key - 1] = arguments[_key]; + } + + if (streams) { + streams.forEach(function (stream) { + if (!_this2._localStreams) { + _this2._localStreams = [stream]; + } else if (!_this2._localStreams.includes(stream)) { + _this2._localStreams.push(stream); + } + }); + } + return _addTrack.apply(this, arguments); + }; + } + if (!('removeStream' in window.RTCPeerConnection.prototype)) { + window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) { + var _this3 = this; + + if (!this._localStreams) { + this._localStreams = []; + } + var index = this._localStreams.indexOf(stream); + if (index === -1) { + return; + } + this._localStreams.splice(index, 1); + var tracks = stream.getTracks(); + this.getSenders().forEach(function (sender) { + if (tracks.includes(sender.track)) { + _this3.removeTrack(sender); + } + }); + }; + } + } + + function shimRemoteStreamsAPI(window) { + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !window.RTCPeerConnection) { + return; + } + if (!('getRemoteStreams' in window.RTCPeerConnection.prototype)) { + window.RTCPeerConnection.prototype.getRemoteStreams = function getRemoteStreams() { + return this._remoteStreams ? this._remoteStreams : []; + }; + } + if (!('onaddstream' in window.RTCPeerConnection.prototype)) { + Object.defineProperty(window.RTCPeerConnection.prototype, 'onaddstream', { + get: function get() { + return this._onaddstream; + }, + set: function set(f) { + var _this4 = this; + + if (this._onaddstream) { + this.removeEventListener('addstream', this._onaddstream); + this.removeEventListener('track', this._onaddstreampoly); + } + this.addEventListener('addstream', this._onaddstream = f); + this.addEventListener('track', this._onaddstreampoly = function (e) { + e.streams.forEach(function (stream) { + if (!_this4._remoteStreams) { + _this4._remoteStreams = []; + } + if (_this4._remoteStreams.includes(stream)) { + return; + } + _this4._remoteStreams.push(stream); + var event = new Event('addstream'); + event.stream = stream; + _this4.dispatchEvent(event); + }); + }); + } + }); + var origSetRemoteDescription = window.RTCPeerConnection.prototype.setRemoteDescription; + window.RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription() { + var pc = this; + if (!this._onaddstreampoly) { + this.addEventListener('track', this._onaddstreampoly = function (e) { + e.streams.forEach(function (stream) { + if (!pc._remoteStreams) { + pc._remoteStreams = []; + } + if (pc._remoteStreams.indexOf(stream) >= 0) { + return; + } + pc._remoteStreams.push(stream); + var event = new Event('addstream'); + event.stream = stream; + pc.dispatchEvent(event); + }); + }); + } + return origSetRemoteDescription.apply(pc, arguments); + }; + } + } + + function shimCallbacksAPI(window) { + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !window.RTCPeerConnection) { + return; + } + var prototype = window.RTCPeerConnection.prototype; + var origCreateOffer = prototype.createOffer; + var origCreateAnswer = prototype.createAnswer; + var setLocalDescription = prototype.setLocalDescription; + var setRemoteDescription = prototype.setRemoteDescription; + var addIceCandidate = prototype.addIceCandidate; + + prototype.createOffer = function createOffer(successCallback, failureCallback) { + var options = arguments.length >= 2 ? arguments[2] : arguments[0]; + var promise = origCreateOffer.apply(this, [options]); + if (!failureCallback) { + return promise; + } + promise.then(successCallback, failureCallback); + return Promise.resolve(); + }; + + prototype.createAnswer = function createAnswer(successCallback, failureCallback) { + var options = arguments.length >= 2 ? arguments[2] : arguments[0]; + var promise = origCreateAnswer.apply(this, [options]); + if (!failureCallback) { + return promise; + } + promise.then(successCallback, failureCallback); + return Promise.resolve(); + }; + + var withCallback = function withCallback(description, successCallback, failureCallback) { + var promise = setLocalDescription.apply(this, [description]); + if (!failureCallback) { + return promise; + } + promise.then(successCallback, failureCallback); + return Promise.resolve(); + }; + prototype.setLocalDescription = withCallback; + + withCallback = function withCallback(description, successCallback, failureCallback) { + var promise = setRemoteDescription.apply(this, [description]); + if (!failureCallback) { + return promise; + } + promise.then(successCallback, failureCallback); + return Promise.resolve(); + }; + prototype.setRemoteDescription = withCallback; + + withCallback = function withCallback(candidate, successCallback, failureCallback) { + var promise = addIceCandidate.apply(this, [candidate]); + if (!failureCallback) { + return promise; + } + promise.then(successCallback, failureCallback); + return Promise.resolve(); + }; + prototype.addIceCandidate = withCallback; + } + + function shimGetUserMedia(window) { + var navigator = window && window.navigator; + + if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { + // shim not needed in Safari 12.1 + var mediaDevices = navigator.mediaDevices; + var _getUserMedia = mediaDevices.getUserMedia.bind(mediaDevices); + navigator.mediaDevices.getUserMedia = function (constraints) { + return _getUserMedia(shimConstraints(constraints)); + }; + } + + if (!navigator.getUserMedia && navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { + navigator.getUserMedia = function getUserMedia(constraints, cb, errcb) { + navigator.mediaDevices.getUserMedia(constraints).then(cb, errcb); + }.bind(navigator); + } + } + + function shimConstraints(constraints) { + if (constraints && constraints.video !== undefined) { + return Object.assign({}, constraints, { video: utils.compactObject(constraints.video) }); + } + + return constraints; + } + + function shimRTCIceServerUrls(window) { + if (!window.RTCPeerConnection) { + return; + } + // migrate from non-spec RTCIceServer.url to RTCIceServer.urls + var OrigPeerConnection = window.RTCPeerConnection; + window.RTCPeerConnection = function RTCPeerConnection(pcConfig, pcConstraints) { + if (pcConfig && pcConfig.iceServers) { + var newIceServers = []; + for (var i = 0; i < pcConfig.iceServers.length; i++) { + var server = pcConfig.iceServers[i]; + if (!server.hasOwnProperty('urls') && server.hasOwnProperty('url')) { + utils.deprecated('RTCIceServer.url', 'RTCIceServer.urls'); + server = JSON.parse(JSON.stringify(server)); + server.urls = server.url; + delete server.url; + newIceServers.push(server); + } else { + newIceServers.push(pcConfig.iceServers[i]); + } + } + pcConfig.iceServers = newIceServers; + } + return new OrigPeerConnection(pcConfig, pcConstraints); + }; + window.RTCPeerConnection.prototype = OrigPeerConnection.prototype; + // wrap static methods. Currently just generateCertificate. + if ('generateCertificate' in OrigPeerConnection) { + Object.defineProperty(window.RTCPeerConnection, 'generateCertificate', { + get: function get() { + return OrigPeerConnection.generateCertificate; + } + }); + } + } + + function shimTrackEventTransceiver(window) { + // Add event.transceiver member over deprecated event.receiver + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCTrackEvent && 'receiver' in window.RTCTrackEvent.prototype && !('transceiver' in window.RTCTrackEvent.prototype)) { + Object.defineProperty(window.RTCTrackEvent.prototype, 'transceiver', { + get: function get() { + return { receiver: this.receiver }; + } + }); + } + } + + function shimCreateOfferLegacy(window) { + var origCreateOffer = window.RTCPeerConnection.prototype.createOffer; + window.RTCPeerConnection.prototype.createOffer = function createOffer(offerOptions) { + if (offerOptions) { + if (typeof offerOptions.offerToReceiveAudio !== 'undefined') { + // support bit values + offerOptions.offerToReceiveAudio = !!offerOptions.offerToReceiveAudio; + } + var audioTransceiver = this.getTransceivers().find(function (transceiver) { + return transceiver.receiver.track.kind === 'audio'; + }); + if (offerOptions.offerToReceiveAudio === false && audioTransceiver) { + if (audioTransceiver.direction === 'sendrecv') { + if (audioTransceiver.setDirection) { + audioTransceiver.setDirection('sendonly'); + } else { + audioTransceiver.direction = 'sendonly'; + } + } else if (audioTransceiver.direction === 'recvonly') { + if (audioTransceiver.setDirection) { + audioTransceiver.setDirection('inactive'); + } else { + audioTransceiver.direction = 'inactive'; + } + } + } else if (offerOptions.offerToReceiveAudio === true && !audioTransceiver) { + this.addTransceiver('audio'); + } + + if (typeof offerOptions.offerToReceiveVideo !== 'undefined') { + // support bit values + offerOptions.offerToReceiveVideo = !!offerOptions.offerToReceiveVideo; + } + var videoTransceiver = this.getTransceivers().find(function (transceiver) { + return transceiver.receiver.track.kind === 'video'; + }); + if (offerOptions.offerToReceiveVideo === false && videoTransceiver) { + if (videoTransceiver.direction === 'sendrecv') { + if (videoTransceiver.setDirection) { + videoTransceiver.setDirection('sendonly'); + } else { + videoTransceiver.direction = 'sendonly'; + } + } else if (videoTransceiver.direction === 'recvonly') { + if (videoTransceiver.setDirection) { + videoTransceiver.setDirection('inactive'); + } else { + videoTransceiver.direction = 'inactive'; + } + } + } else if (offerOptions.offerToReceiveVideo === true && !videoTransceiver) { + this.addTransceiver('video'); + } + } + return origCreateOffer.apply(this, arguments); + }; + } + + function shimAudioContext(window) { + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || window.AudioContext) { + return; + } + window.AudioContext = window.webkitAudioContext; + } + + },{"../utils":11}],11:[function(require,module,exports){ + /* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + exports.extractVersion = extractVersion; + exports.wrapPeerConnectionEvent = wrapPeerConnectionEvent; + exports.disableLog = disableLog; + exports.disableWarnings = disableWarnings; + exports.log = log; + exports.deprecated = deprecated; + exports.detectBrowser = detectBrowser; + exports.compactObject = compactObject; + exports.walkStats = walkStats; + exports.filterStats = filterStats; + + function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + + var logDisabled_ = true; + var deprecationWarnings_ = true; + + /** + * Extract browser version out of the provided user agent string. + * + * @param {!string} uastring userAgent string. + * @param {!string} expr Regular expression used as match criteria. + * @param {!number} pos position in the version string to be returned. + * @return {!number} browser version. + */ + function extractVersion(uastring, expr, pos) { + var match = uastring.match(expr); + return match && match.length >= pos && parseInt(match[pos], 10); + } + +// Wraps the peerconnection event eventNameToWrap in a function +// which returns the modified event object (or false to prevent +// the event). + function wrapPeerConnectionEvent(window, eventNameToWrap, wrapper) { + if (!window.RTCPeerConnection) { + return; + } + var proto = window.RTCPeerConnection.prototype; + var nativeAddEventListener = proto.addEventListener; + proto.addEventListener = function (nativeEventName, cb) { + if (nativeEventName !== eventNameToWrap) { + return nativeAddEventListener.apply(this, arguments); + } + var wrappedCallback = function wrappedCallback(e) { + var modifiedEvent = wrapper(e); + if (modifiedEvent) { + if (cb.handleEvent) { + cb.handleEvent(modifiedEvent); + } else { + cb(modifiedEvent); + } + } + }; + this._eventMap = this._eventMap || {}; + if (!this._eventMap[eventNameToWrap]) { + this._eventMap[eventNameToWrap] = new Map(); + } + this._eventMap[eventNameToWrap].set(cb, wrappedCallback); + return nativeAddEventListener.apply(this, [nativeEventName, wrappedCallback]); + }; + + var nativeRemoveEventListener = proto.removeEventListener; + proto.removeEventListener = function (nativeEventName, cb) { + if (nativeEventName !== eventNameToWrap || !this._eventMap || !this._eventMap[eventNameToWrap]) { + return nativeRemoveEventListener.apply(this, arguments); + } + if (!this._eventMap[eventNameToWrap].has(cb)) { + return nativeRemoveEventListener.apply(this, arguments); + } + var unwrappedCb = this._eventMap[eventNameToWrap].get(cb); + this._eventMap[eventNameToWrap].delete(cb); + if (this._eventMap[eventNameToWrap].size === 0) { + delete this._eventMap[eventNameToWrap]; + } + if (Object.keys(this._eventMap).length === 0) { + delete this._eventMap; + } + return nativeRemoveEventListener.apply(this, [nativeEventName, unwrappedCb]); + }; + + Object.defineProperty(proto, 'on' + eventNameToWrap, { + get: function get() { + return this['_on' + eventNameToWrap]; + }, + set: function set(cb) { + if (this['_on' + eventNameToWrap]) { + this.removeEventListener(eventNameToWrap, this['_on' + eventNameToWrap]); + delete this['_on' + eventNameToWrap]; + } + if (cb) { + this.addEventListener(eventNameToWrap, this['_on' + eventNameToWrap] = cb); + } + }, + + enumerable: true, + configurable: true + }); + } + + function disableLog(bool) { + if (typeof bool !== 'boolean') { + return new Error('Argument type: ' + (typeof bool === 'undefined' ? 'undefined' : _typeof(bool)) + '. Please use a boolean.'); + } + logDisabled_ = bool; + return bool ? 'adapter.js logging disabled' : 'adapter.js logging enabled'; + } + + /** + * Disable or enable deprecation warnings + * @param {!boolean} bool set to true to disable warnings. + */ + function disableWarnings(bool) { + if (typeof bool !== 'boolean') { + return new Error('Argument type: ' + (typeof bool === 'undefined' ? 'undefined' : _typeof(bool)) + '. Please use a boolean.'); + } + deprecationWarnings_ = !bool; + return 'adapter.js deprecation warnings ' + (bool ? 'disabled' : 'enabled'); + } + + function log() { + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object') { + if (logDisabled_) { + return; + } + if (typeof console !== 'undefined' && typeof console.log === 'function') { + console.log.apply(console, arguments); + } + } + } + + /** + * Shows a deprecation warning suggesting the modern and spec-compatible API. + */ + function deprecated(oldMethod, newMethod) { + if (!deprecationWarnings_) { + return; + } + console.warn(oldMethod + ' is deprecated, please use ' + newMethod + ' instead.'); + } + + /** + * Browser detector. + * + * @return {object} result containing browser and version + * properties. + */ + function detectBrowser(window) { + // Returned result object. + var result = { browser: null, version: null }; + + // Fail early if it's not a browser + if (typeof window === 'undefined' || !window.navigator) { + result.browser = 'Not a browser.'; + return result; + } + + var navigator = window.navigator; + + + if (navigator.mozGetUserMedia) { + // Firefox. + result.browser = 'firefox'; + result.version = extractVersion(navigator.userAgent, /Firefox\/(\d+)\./, 1); + } else if (navigator.webkitGetUserMedia || window.isSecureContext === false && window.webkitRTCPeerConnection && !window.RTCIceGatherer) { + // Chrome, Chromium, Webview, Opera. + // Version matches Chrome/WebRTC version. + // Chrome 74 removed webkitGetUserMedia on http as well so we need the + // more complicated fallback to webkitRTCPeerConnection. + result.browser = 'chrome'; + result.version = extractVersion(navigator.userAgent, /Chrom(e|ium)\/(\d+)\./, 2); + } else if (window.RTCPeerConnection && navigator.userAgent.match(/AppleWebKit\/(\d+)\./)) { + // Safari. + result.browser = 'safari'; + result.version = extractVersion(navigator.userAgent, /AppleWebKit\/(\d+)\./, 1); + result.supportsUnifiedPlan = window.RTCRtpTransceiver && 'currentDirection' in window.RTCRtpTransceiver.prototype; + } else { + // Default fallthrough: not supported. + result.browser = 'Not a supported browser.'; + return result; + } + + return result; + } + + /** + * Checks if something is an object. + * + * @param {*} val The something you want to check. + * @return true if val is an object, false otherwise. + */ + function isObject(val) { + return Object.prototype.toString.call(val) === '[object Object]'; + } + + /** + * Remove all empty objects and undefined values + * from a nested object -- an enhanced and vanilla version + * of Lodash's `compact`. + */ + function compactObject(data) { + if (!isObject(data)) { + return data; + } + + return Object.keys(data).reduce(function (accumulator, key) { + var isObj = isObject(data[key]); + var value = isObj ? compactObject(data[key]) : data[key]; + var isEmptyObject = isObj && !Object.keys(value).length; + if (value === undefined || isEmptyObject) { + return accumulator; + } + return Object.assign(accumulator, _defineProperty({}, key, value)); + }, {}); + } + + /* iterates the stats graph recursively. */ + function walkStats(stats, base, resultSet) { + if (!base || resultSet.has(base.id)) { + return; + } + resultSet.set(base.id, base); + Object.keys(base).forEach(function (name) { + if (name.endsWith('Id')) { + walkStats(stats, stats.get(base[name]), resultSet); + } else if (name.endsWith('Ids')) { + base[name].forEach(function (id) { + walkStats(stats, stats.get(id), resultSet); + }); + } + }); + } + + /* filter getStats for a sender/receiver track. */ + function filterStats(result, track, outbound) { + var streamStatsType = outbound ? 'outbound-rtp' : 'inbound-rtp'; + var filteredResult = new Map(); + if (track === null) { + return filteredResult; + } + var trackStats = []; + result.forEach(function (value) { + if (value.type === 'track' && value.trackIdentifier === track.id) { + trackStats.push(value); + } + }); + trackStats.forEach(function (trackStat) { + result.forEach(function (stats) { + if (stats.type === streamStatsType && stats.trackId === trackStat.id) { + walkStats(result, stats, filteredResult); + } + }); + }); + return filteredResult; + } + + },{}],12:[function(require,module,exports){ + /* eslint-env node */ + 'use strict'; + +// SDP helpers. + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + var SDPUtils = {}; + +// Generate an alphanumeric identifier for cname or mids. +// TODO: use UUIDs instead? https://gist.github.com/jed/982883 + SDPUtils.generateIdentifier = function () { + return Math.random().toString(36).substr(2, 10); + }; + +// The RTCP CNAME used by all peerconnections from the same JS. + SDPUtils.localCName = SDPUtils.generateIdentifier(); + +// Splits SDP into lines, dealing with both CRLF and LF. + SDPUtils.splitLines = function (blob) { + return blob.trim().split('\n').map(function (line) { + return line.trim(); + }); + }; +// Splits SDP into sessionpart and mediasections. Ensures CRLF. + SDPUtils.splitSections = function (blob) { + var parts = blob.split('\nm='); + return parts.map(function (part, index) { + return (index > 0 ? 'm=' + part : part).trim() + '\r\n'; + }); + }; + +// returns the session description. + SDPUtils.getDescription = function (blob) { + var sections = SDPUtils.splitSections(blob); + return sections && sections[0]; + }; + +// returns the individual media sections. + SDPUtils.getMediaSections = function (blob) { + var sections = SDPUtils.splitSections(blob); + sections.shift(); + return sections; + }; + +// Returns lines that start with a certain prefix. + SDPUtils.matchPrefix = function (blob, prefix) { + return SDPUtils.splitLines(blob).filter(function (line) { + return line.indexOf(prefix) === 0; + }); + }; + +// Parses an ICE candidate line. Sample input: +// candidate:702786350 2 udp 41819902 8.8.8.8 60769 typ relay raddr 8.8.8.8 +// rport 55996" + SDPUtils.parseCandidate = function (line) { + var parts = void 0; + // Parse both variants. + if (line.indexOf('a=candidate:') === 0) { + parts = line.substring(12).split(' '); + } else { + parts = line.substring(10).split(' '); + } + + var candidate = { + foundation: parts[0], + component: { 1: 'rtp', 2: 'rtcp' }[parts[1]], + protocol: parts[2].toLowerCase(), + priority: parseInt(parts[3], 10), + ip: parts[4], + address: parts[4], // address is an alias for ip. + port: parseInt(parts[5], 10), + // skip parts[6] == 'typ' + type: parts[7] + }; + + for (var i = 8; i < parts.length; i += 2) { + switch (parts[i]) { + case 'raddr': + candidate.relatedAddress = parts[i + 1]; + break; + case 'rport': + candidate.relatedPort = parseInt(parts[i + 1], 10); + break; + case 'tcptype': + candidate.tcpType = parts[i + 1]; + break; + case 'ufrag': + candidate.ufrag = parts[i + 1]; // for backward compatibility. + candidate.usernameFragment = parts[i + 1]; + break; + default: + // extension handling, in particular ufrag. Don't overwrite. + if (candidate[parts[i]] === undefined) { + candidate[parts[i]] = parts[i + 1]; + } + break; + } + } + return candidate; + }; + +// Translates a candidate object into SDP candidate attribute. + SDPUtils.writeCandidate = function (candidate) { + var sdp = []; + sdp.push(candidate.foundation); + + var component = candidate.component; + if (component === 'rtp') { + sdp.push(1); + } else if (component === 'rtcp') { + sdp.push(2); + } else { + sdp.push(component); + } + sdp.push(candidate.protocol.toUpperCase()); + sdp.push(candidate.priority); + sdp.push(candidate.address || candidate.ip); + sdp.push(candidate.port); + + var type = candidate.type; + sdp.push('typ'); + sdp.push(type); + if (type !== 'host' && candidate.relatedAddress && candidate.relatedPort) { + sdp.push('raddr'); + sdp.push(candidate.relatedAddress); + sdp.push('rport'); + sdp.push(candidate.relatedPort); + } + if (candidate.tcpType && candidate.protocol.toLowerCase() === 'tcp') { + sdp.push('tcptype'); + sdp.push(candidate.tcpType); + } + if (candidate.usernameFragment || candidate.ufrag) { + sdp.push('ufrag'); + sdp.push(candidate.usernameFragment || candidate.ufrag); + } + return 'candidate:' + sdp.join(' '); + }; + +// Parses an ice-options line, returns an array of option tags. +// a=ice-options:foo bar + SDPUtils.parseIceOptions = function (line) { + return line.substr(14).split(' '); + }; + +// Parses an rtpmap line, returns RTCRtpCoddecParameters. Sample input: +// a=rtpmap:111 opus/48000/2 + SDPUtils.parseRtpMap = function (line) { + var parts = line.substr(9).split(' '); + var parsed = { + payloadType: parseInt(parts.shift(), 10) // was: id + }; + + parts = parts[0].split('/'); + + parsed.name = parts[0]; + parsed.clockRate = parseInt(parts[1], 10); // was: clockrate + parsed.channels = parts.length === 3 ? parseInt(parts[2], 10) : 1; + // legacy alias, got renamed back to channels in ORTC. + parsed.numChannels = parsed.channels; + return parsed; + }; + +// Generate an a=rtpmap line from RTCRtpCodecCapability or +// RTCRtpCodecParameters. + SDPUtils.writeRtpMap = function (codec) { + var pt = codec.payloadType; + if (codec.preferredPayloadType !== undefined) { + pt = codec.preferredPayloadType; + } + var channels = codec.channels || codec.numChannels || 1; + return 'a=rtpmap:' + pt + ' ' + codec.name + '/' + codec.clockRate + (channels !== 1 ? '/' + channels : '') + '\r\n'; + }; + +// Parses an a=extmap line (headerextension from RFC 5285). Sample input: +// a=extmap:2 urn:ietf:params:rtp-hdrext:toffset +// a=extmap:2/sendonly urn:ietf:params:rtp-hdrext:toffset + SDPUtils.parseExtmap = function (line) { + var parts = line.substr(9).split(' '); + return { + id: parseInt(parts[0], 10), + direction: parts[0].indexOf('/') > 0 ? parts[0].split('/')[1] : 'sendrecv', + uri: parts[1] + }; + }; + +// Generates a=extmap line from RTCRtpHeaderExtensionParameters or +// RTCRtpHeaderExtension. + SDPUtils.writeExtmap = function (headerExtension) { + return 'a=extmap:' + (headerExtension.id || headerExtension.preferredId) + (headerExtension.direction && headerExtension.direction !== 'sendrecv' ? '/' + headerExtension.direction : '') + ' ' + headerExtension.uri + '\r\n'; + }; + +// Parses an ftmp line, returns dictionary. Sample input: +// a=fmtp:96 vbr=on;cng=on +// Also deals with vbr=on; cng=on + SDPUtils.parseFmtp = function (line) { + var parsed = {}; + var kv = void 0; + var parts = line.substr(line.indexOf(' ') + 1).split(';'); + for (var j = 0; j < parts.length; j++) { + kv = parts[j].trim().split('='); + parsed[kv[0].trim()] = kv[1]; + } + return parsed; + }; + +// Generates an a=ftmp line from RTCRtpCodecCapability or RTCRtpCodecParameters. + SDPUtils.writeFmtp = function (codec) { + var line = ''; + var pt = codec.payloadType; + if (codec.preferredPayloadType !== undefined) { + pt = codec.preferredPayloadType; + } + if (codec.parameters && Object.keys(codec.parameters).length) { + var params = []; + Object.keys(codec.parameters).forEach(function (param) { + if (codec.parameters[param]) { + params.push(param + '=' + codec.parameters[param]); + } else { + params.push(param); + } + }); + line += 'a=fmtp:' + pt + ' ' + params.join(';') + '\r\n'; + } + return line; + }; + +// Parses an rtcp-fb line, returns RTCPRtcpFeedback object. Sample input: +// a=rtcp-fb:98 nack rpsi + SDPUtils.parseRtcpFb = function (line) { + var parts = line.substr(line.indexOf(' ') + 1).split(' '); + return { + type: parts.shift(), + parameter: parts.join(' ') + }; + }; +// Generate a=rtcp-fb lines from RTCRtpCodecCapability or RTCRtpCodecParameters. + SDPUtils.writeRtcpFb = function (codec) { + var lines = ''; + var pt = codec.payloadType; + if (codec.preferredPayloadType !== undefined) { + pt = codec.preferredPayloadType; + } + if (codec.rtcpFeedback && codec.rtcpFeedback.length) { + // FIXME: special handling for trr-int? + codec.rtcpFeedback.forEach(function (fb) { + lines += 'a=rtcp-fb:' + pt + ' ' + fb.type + (fb.parameter && fb.parameter.length ? ' ' + fb.parameter : '') + '\r\n'; + }); + } + return lines; + }; + +// Parses an RFC 5576 ssrc media attribute. Sample input: +// a=ssrc:3735928559 cname:something + SDPUtils.parseSsrcMedia = function (line) { + var sp = line.indexOf(' '); + var parts = { + ssrc: parseInt(line.substr(7, sp - 7), 10) + }; + var colon = line.indexOf(':', sp); + if (colon > -1) { + parts.attribute = line.substr(sp + 1, colon - sp - 1); + parts.value = line.substr(colon + 1); + } else { + parts.attribute = line.substr(sp + 1); + } + return parts; + }; + + SDPUtils.parseSsrcGroup = function (line) { + var parts = line.substr(13).split(' '); + return { + semantics: parts.shift(), + ssrcs: parts.map(function (ssrc) { + return parseInt(ssrc, 10); + }) + }; + }; + +// Extracts the MID (RFC 5888) from a media section. +// returns the MID or undefined if no mid line was found. + SDPUtils.getMid = function (mediaSection) { + var mid = SDPUtils.matchPrefix(mediaSection, 'a=mid:')[0]; + if (mid) { + return mid.substr(6); + } + }; + + SDPUtils.parseFingerprint = function (line) { + var parts = line.substr(14).split(' '); + return { + algorithm: parts[0].toLowerCase(), // algorithm is case-sensitive in Edge. + value: parts[1] + }; + }; + +// Extracts DTLS parameters from SDP media section or sessionpart. +// FIXME: for consistency with other functions this should only +// get the fingerprint line as input. See also getIceParameters. + SDPUtils.getDtlsParameters = function (mediaSection, sessionpart) { + var lines = SDPUtils.matchPrefix(mediaSection + sessionpart, 'a=fingerprint:'); + // Note: a=setup line is ignored since we use the 'auto' role. + // Note2: 'algorithm' is not case sensitive except in Edge. + return { + role: 'auto', + fingerprints: lines.map(SDPUtils.parseFingerprint) + }; + }; + +// Serializes DTLS parameters to SDP. + SDPUtils.writeDtlsParameters = function (params, setupType) { + var sdp = 'a=setup:' + setupType + '\r\n'; + params.fingerprints.forEach(function (fp) { + sdp += 'a=fingerprint:' + fp.algorithm + ' ' + fp.value + '\r\n'; + }); + return sdp; + }; + +// Parses a=crypto lines into +// https://rawgit.com/aboba/edgertc/master/msortc-rs4.html#dictionary-rtcsrtpsdesparameters-members + SDPUtils.parseCryptoLine = function (line) { + var parts = line.substr(9).split(' '); + return { + tag: parseInt(parts[0], 10), + cryptoSuite: parts[1], + keyParams: parts[2], + sessionParams: parts.slice(3) + }; + }; + + SDPUtils.writeCryptoLine = function (parameters) { + return 'a=crypto:' + parameters.tag + ' ' + parameters.cryptoSuite + ' ' + (_typeof(parameters.keyParams) === 'object' ? SDPUtils.writeCryptoKeyParams(parameters.keyParams) : parameters.keyParams) + (parameters.sessionParams ? ' ' + parameters.sessionParams.join(' ') : '') + '\r\n'; + }; + +// Parses the crypto key parameters into +// https://rawgit.com/aboba/edgertc/master/msortc-rs4.html#rtcsrtpkeyparam* + SDPUtils.parseCryptoKeyParams = function (keyParams) { + if (keyParams.indexOf('inline:') !== 0) { + return null; + } + var parts = keyParams.substr(7).split('|'); + return { + keyMethod: 'inline', + keySalt: parts[0], + lifeTime: parts[1], + mkiValue: parts[2] ? parts[2].split(':')[0] : undefined, + mkiLength: parts[2] ? parts[2].split(':')[1] : undefined + }; + }; + + SDPUtils.writeCryptoKeyParams = function (keyParams) { + return keyParams.keyMethod + ':' + keyParams.keySalt + (keyParams.lifeTime ? '|' + keyParams.lifeTime : '') + (keyParams.mkiValue && keyParams.mkiLength ? '|' + keyParams.mkiValue + ':' + keyParams.mkiLength : ''); + }; + +// Extracts all SDES parameters. + SDPUtils.getCryptoParameters = function (mediaSection, sessionpart) { + var lines = SDPUtils.matchPrefix(mediaSection + sessionpart, 'a=crypto:'); + return lines.map(SDPUtils.parseCryptoLine); + }; + +// Parses ICE information from SDP media section or sessionpart. +// FIXME: for consistency with other functions this should only +// get the ice-ufrag and ice-pwd lines as input. + SDPUtils.getIceParameters = function (mediaSection, sessionpart) { + var ufrag = SDPUtils.matchPrefix(mediaSection + sessionpart, 'a=ice-ufrag:')[0]; + var pwd = SDPUtils.matchPrefix(mediaSection + sessionpart, 'a=ice-pwd:')[0]; + if (!(ufrag && pwd)) { + return null; + } + return { + usernameFragment: ufrag.substr(12), + password: pwd.substr(10) + }; + }; + +// Serializes ICE parameters to SDP. + SDPUtils.writeIceParameters = function (params) { + var sdp = 'a=ice-ufrag:' + params.usernameFragment + '\r\n' + 'a=ice-pwd:' + params.password + '\r\n'; + if (params.iceLite) { + sdp += 'a=ice-lite\r\n'; + } + return sdp; + }; + +// Parses the SDP media section and returns RTCRtpParameters. + SDPUtils.parseRtpParameters = function (mediaSection) { + var description = { + codecs: [], + headerExtensions: [], + fecMechanisms: [], + rtcp: [] + }; + var lines = SDPUtils.splitLines(mediaSection); + var mline = lines[0].split(' '); + for (var i = 3; i < mline.length; i++) { + // find all codecs from mline[3..] + var pt = mline[i]; + var rtpmapline = SDPUtils.matchPrefix(mediaSection, 'a=rtpmap:' + pt + ' ')[0]; + if (rtpmapline) { + var codec = SDPUtils.parseRtpMap(rtpmapline); + var fmtps = SDPUtils.matchPrefix(mediaSection, 'a=fmtp:' + pt + ' '); + // Only the first a=fmtp: is considered. + codec.parameters = fmtps.length ? SDPUtils.parseFmtp(fmtps[0]) : {}; + codec.rtcpFeedback = SDPUtils.matchPrefix(mediaSection, 'a=rtcp-fb:' + pt + ' ').map(SDPUtils.parseRtcpFb); + description.codecs.push(codec); + // parse FEC mechanisms from rtpmap lines. + switch (codec.name.toUpperCase()) { + case 'RED': + case 'ULPFEC': + description.fecMechanisms.push(codec.name.toUpperCase()); + break; + default: + // only RED and ULPFEC are recognized as FEC mechanisms. + break; + } + } + } + SDPUtils.matchPrefix(mediaSection, 'a=extmap:').forEach(function (line) { + description.headerExtensions.push(SDPUtils.parseExtmap(line)); + }); + // FIXME: parse rtcp. + return description; + }; + +// Generates parts of the SDP media section describing the capabilities / +// parameters. + SDPUtils.writeRtpDescription = function (kind, caps) { + var sdp = ''; + + // Build the mline. + sdp += 'm=' + kind + ' '; + sdp += caps.codecs.length > 0 ? '9' : '0'; // reject if no codecs. + sdp += ' UDP/TLS/RTP/SAVPF '; + sdp += caps.codecs.map(function (codec) { + if (codec.preferredPayloadType !== undefined) { + return codec.preferredPayloadType; + } + return codec.payloadType; + }).join(' ') + '\r\n'; + console.log(`[writeRtpDescription]: sdp:${sdp}, codecs:${JSON.stringify(caps.codecs)}`); + sdp += 'c=IN IP4 0.0.0.0\r\n'; + sdp += 'a=rtcp:9 IN IP4 0.0.0.0\r\n'; + + // Add a=rtpmap lines for each codec. Also fmtp and rtcp-fb. + caps.codecs.forEach(function (codec) { + sdp += SDPUtils.writeRtpMap(codec); + sdp += SDPUtils.writeFmtp(codec); + sdp += SDPUtils.writeRtcpFb(codec); + }); + var maxptime = 0; + caps.codecs.forEach(function (codec) { + if (codec.maxptime > maxptime) { + maxptime = codec.maxptime; + } + }); + if (maxptime > 0) { + sdp += 'a=maxptime:' + maxptime + '\r\n'; + } + + if (caps.headerExtensions) { + caps.headerExtensions.forEach(function (extension) { + sdp += SDPUtils.writeExtmap(extension); + }); + } + // FIXME: write fecMechanisms. + return sdp; + }; + +// Parses the SDP media section and returns an array of +// RTCRtpEncodingParameters. + SDPUtils.parseRtpEncodingParameters = function (mediaSection) { + var encodingParameters = []; + var description = SDPUtils.parseRtpParameters(mediaSection); + var hasRed = description.fecMechanisms.indexOf('RED') !== -1; + var hasUlpfec = description.fecMechanisms.indexOf('ULPFEC') !== -1; + + // filter a=ssrc:... cname:, ignore PlanB-msid + var ssrcs = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:').map(function (line) { + return SDPUtils.parseSsrcMedia(line); + }).filter(function (parts) { + return parts.attribute === 'cname'; + }); + var primarySsrc = ssrcs.length > 0 && ssrcs[0].ssrc; + var secondarySsrc = void 0; + + var flows = SDPUtils.matchPrefix(mediaSection, 'a=ssrc-group:FID').map(function (line) { + var parts = line.substr(17).split(' '); + return parts.map(function (part) { + return parseInt(part, 10); + }); + }); + if (flows.length > 0 && flows[0].length > 1 && flows[0][0] === primarySsrc) { + secondarySsrc = flows[0][1]; + } + + description.codecs.forEach(function (codec) { + if (codec.name.toUpperCase() === 'RTX' && codec.parameters.apt) { + var encParam = { + ssrc: primarySsrc, + codecPayloadType: parseInt(codec.parameters.apt, 10) + }; + if (primarySsrc && secondarySsrc) { + encParam.rtx = { ssrc: secondarySsrc }; + } + encodingParameters.push(encParam); + if (hasRed) { + encParam = JSON.parse(JSON.stringify(encParam)); + encParam.fec = { + ssrc: primarySsrc, + mechanism: hasUlpfec ? 'red+ulpfec' : 'red' + }; + encodingParameters.push(encParam); + } + } + }); + if (encodingParameters.length === 0 && primarySsrc) { + encodingParameters.push({ + ssrc: primarySsrc + }); + } + + // we support both b=AS and b=TIAS but interpret AS as TIAS. + var bandwidth = SDPUtils.matchPrefix(mediaSection, 'b='); + if (bandwidth.length) { + if (bandwidth[0].indexOf('b=TIAS:') === 0) { + bandwidth = parseInt(bandwidth[0].substr(7), 10); + } else if (bandwidth[0].indexOf('b=AS:') === 0) { + // use formula from JSEP to convert b=AS to TIAS value. + bandwidth = parseInt(bandwidth[0].substr(5), 10) * 1000 * 0.95 - 50 * 40 * 8; + } else { + bandwidth = undefined; + } + encodingParameters.forEach(function (params) { + params.maxBitrate = bandwidth; + }); + } + return encodingParameters; + }; + +// parses http://draft.ortc.org/#rtcrtcpparameters* + SDPUtils.parseRtcpParameters = function (mediaSection) { + var rtcpParameters = {}; + + // Gets the first SSRC. Note that with RTX there might be multiple + // SSRCs. + var remoteSsrc = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:').map(function (line) { + return SDPUtils.parseSsrcMedia(line); + }).filter(function (obj) { + return obj.attribute === 'cname'; + })[0]; + if (remoteSsrc) { + rtcpParameters.cname = remoteSsrc.value; + rtcpParameters.ssrc = remoteSsrc.ssrc; + } + + // Edge uses the compound attribute instead of reducedSize + // compound is !reducedSize + var rsize = SDPUtils.matchPrefix(mediaSection, 'a=rtcp-rsize'); + rtcpParameters.reducedSize = rsize.length > 0; + rtcpParameters.compound = rsize.length === 0; + + // parses the rtcp-mux attrіbute. + // Note that Edge does not support unmuxed RTCP. + var mux = SDPUtils.matchPrefix(mediaSection, 'a=rtcp-mux'); + rtcpParameters.mux = mux.length > 0; + + return rtcpParameters; + }; + + SDPUtils.writeRtcpParameters = function (rtcpParameters) { + var sdp = ''; + if (rtcpParameters.reducedSize) { + sdp += 'a=rtcp-rsize\r\n'; + } + if (rtcpParameters.mux) { + sdp += 'a=rtcp-mux\r\n'; + } + if (rtcpParameters.ssrc !== undefined && rtcpParameters.cname) { + sdp += 'a=ssrc:' + rtcpParameters.ssrc + ' cname:' + rtcpParameters.cname + '\r\n'; + } + return sdp; + }; + +// parses either a=msid: or a=ssrc:... msid lines and returns +// the id of the MediaStream and MediaStreamTrack. + SDPUtils.parseMsid = function (mediaSection) { + var parts = void 0; + var spec = SDPUtils.matchPrefix(mediaSection, 'a=msid:'); + if (spec.length === 1) { + parts = spec[0].substr(7).split(' '); + return { stream: parts[0], track: parts[1] }; + } + var planB = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:').map(function (line) { + return SDPUtils.parseSsrcMedia(line); + }).filter(function (msidParts) { + return msidParts.attribute === 'msid'; + }); + if (planB.length > 0) { + parts = planB[0].value.split(' '); + return { stream: parts[0], track: parts[1] }; + } + }; + +// SCTP +// parses draft-ietf-mmusic-sctp-sdp-26 first and falls back +// to draft-ietf-mmusic-sctp-sdp-05 + SDPUtils.parseSctpDescription = function (mediaSection) { + var mline = SDPUtils.parseMLine(mediaSection); + var maxSizeLine = SDPUtils.matchPrefix(mediaSection, 'a=max-message-size:'); + var maxMessageSize = void 0; + if (maxSizeLine.length > 0) { + maxMessageSize = parseInt(maxSizeLine[0].substr(19), 10); + } + if (isNaN(maxMessageSize)) { + maxMessageSize = 65536; + } + var sctpPort = SDPUtils.matchPrefix(mediaSection, 'a=sctp-port:'); + if (sctpPort.length > 0) { + return { + port: parseInt(sctpPort[0].substr(12), 10), + protocol: mline.fmt, + maxMessageSize: maxMessageSize + }; + } + var sctpMapLines = SDPUtils.matchPrefix(mediaSection, 'a=sctpmap:'); + if (sctpMapLines.length > 0) { + var parts = sctpMapLines[0].substr(10).split(' '); + return { + port: parseInt(parts[0], 10), + protocol: parts[1], + maxMessageSize: maxMessageSize + }; + } + }; + +// SCTP +// outputs the draft-ietf-mmusic-sctp-sdp-26 version that all browsers +// support by now receiving in this format, unless we originally parsed +// as the draft-ietf-mmusic-sctp-sdp-05 format (indicated by the m-line +// protocol of DTLS/SCTP -- without UDP/ or TCP/) + SDPUtils.writeSctpDescription = function (media, sctp) { + var output = []; + if (media.protocol !== 'DTLS/SCTP') { + output = ['m=' + media.kind + ' 9 ' + media.protocol + ' ' + sctp.protocol + '\r\n', 'c=IN IP4 0.0.0.0\r\n', 'a=sctp-port:' + sctp.port + '\r\n']; + } else { + output = ['m=' + media.kind + ' 9 ' + media.protocol + ' ' + sctp.port + '\r\n', 'c=IN IP4 0.0.0.0\r\n', 'a=sctpmap:' + sctp.port + ' ' + sctp.protocol + ' 65535\r\n']; + } + if (sctp.maxMessageSize !== undefined) { + output.push('a=max-message-size:' + sctp.maxMessageSize + '\r\n'); + } + return output.join(''); + }; + +// Generate a session ID for SDP. +// https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-20#section-5.2.1 +// recommends using a cryptographically random +ve 64-bit value +// but right now this should be acceptable and within the right range + SDPUtils.generateSessionId = function () { + return Math.random().toString().substr(2, 21); + }; + +// Write boiler plate for start of SDP +// sessId argument is optional - if not supplied it will +// be generated randomly +// sessVersion is optional and defaults to 2 +// sessUser is optional and defaults to 'thisisadapterortc' + SDPUtils.writeSessionBoilerplate = function (sessId, sessVer, sessUser) { + var sessionId = void 0; + var version = sessVer !== undefined ? sessVer : 2; + if (sessId) { + sessionId = sessId; + } else { + sessionId = SDPUtils.generateSessionId(); + } + var user = sessUser || 'thisisadapterortc'; + // FIXME: sess-id should be an NTP timestamp. + return 'v=0\r\n' + 'o=' + user + ' ' + sessionId + ' ' + version + ' IN IP4 127.0.0.1\r\n' + 's=-\r\n' + 't=0 0\r\n'; + }; + +// Gets the direction from the mediaSection or the sessionpart. + SDPUtils.getDirection = function (mediaSection, sessionpart) { + // Look for sendrecv, sendonly, recvonly, inactive, default to sendrecv. + var lines = SDPUtils.splitLines(mediaSection); + for (var i = 0; i < lines.length; i++) { + switch (lines[i]) { + case 'a=sendrecv': + case 'a=sendonly': + case 'a=recvonly': + case 'a=inactive': + return lines[i].substr(2); + default: + // FIXME: What should happen here? + } + } + if (sessionpart) { + return SDPUtils.getDirection(sessionpart); + } + return 'sendrecv'; + }; + + SDPUtils.getKind = function (mediaSection) { + var lines = SDPUtils.splitLines(mediaSection); + var mline = lines[0].split(' '); + return mline[0].substr(2); + }; + + SDPUtils.isRejected = function (mediaSection) { + return mediaSection.split(' ', 2)[1] === '0'; + }; + + SDPUtils.parseMLine = function (mediaSection) { + var lines = SDPUtils.splitLines(mediaSection); + var parts = lines[0].substr(2).split(' '); + return { + kind: parts[0], + port: parseInt(parts[1], 10), + protocol: parts[2], + fmt: parts.slice(3).join(' ') + }; + }; + + SDPUtils.parseOLine = function (mediaSection) { + var line = SDPUtils.matchPrefix(mediaSection, 'o=')[0]; + var parts = line.substr(2).split(' '); + return { + username: parts[0], + sessionId: parts[1], + sessionVersion: parseInt(parts[2], 10), + netType: parts[3], + addressType: parts[4], + address: parts[5] + }; + }; + +// a very naive interpretation of a valid SDP. + SDPUtils.isValidSDP = function (blob) { + if (typeof blob !== 'string' || blob.length === 0) { + return false; + } + var lines = SDPUtils.splitLines(blob); + for (var i = 0; i < lines.length; i++) { + if (lines[i].length < 2 || lines[i].charAt(1) !== '=') { + return false; + } + // TODO: check the modifier a bit more. + } + return true; + }; + +// Expose public methods. + if ((typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object') { + module.exports = SDPUtils; + } + },{}]},{},[1])(1) +}); \ No newline at end of file diff --git a/public/static/base64.js b/public/static/base64.js new file mode 100644 index 0000000..c941d8f --- /dev/null +++ b/public/static/base64.js @@ -0,0 +1,161 @@ +(function (global) { + 'use strict'; + let _Base64 = global.Base64; + let version = "2.1.9"; + let buffer; + // constants + let b64chars + = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + let b64tab = function (bin) { + let t = {}; + for (let i = 0, l = bin.length; i < l; i++) t[bin.charAt(i)] = i; + return t; + }(b64chars); + let fromCharCode = String.fromCharCode; + // encoder stuff + let cb_utob = function (c) { + if (c.length < 2) { + let cc = c.charCodeAt(0); + return cc < 0x80 ? c + : cc < 0x800 ? (fromCharCode(0xc0 | (cc >>> 6)) + + fromCharCode(0x80 | (cc & 0x3f))) + : (fromCharCode(0xe0 | ((cc >>> 12) & 0x0f)) + + fromCharCode(0x80 | ((cc >>> 6) & 0x3f)) + + fromCharCode(0x80 | (cc & 0x3f))); + } else { + let cc = 0x10000 + + (c.charCodeAt(0) - 0xD800) * 0x400 + + (c.charCodeAt(1) - 0xDC00); + return (fromCharCode(0xf0 | ((cc >>> 18) & 0x07)) + + fromCharCode(0x80 | ((cc >>> 12) & 0x3f)) + + fromCharCode(0x80 | ((cc >>> 6) & 0x3f)) + + fromCharCode(0x80 | (cc & 0x3f))); + } + }; + let re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g; + let utob = function (u) { + return u.replace(re_utob, cb_utob); + }; + let cb_encode = function (ccc) { + let padlen = [0, 2, 1][ccc.length % 3], + ord = ccc.charCodeAt(0) << 16 + | ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8) + | ((ccc.length > 2 ? ccc.charCodeAt(2) : 0)), + chars = [ + b64chars.charAt(ord >>> 18), + b64chars.charAt((ord >>> 12) & 63), + padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63), + padlen >= 1 ? '=' : b64chars.charAt(ord & 63) + ]; + return chars.join(''); + }; + let btoa = global.btoa ? function (b) { + return global.btoa(b); + } : function (b) { + return b.replace(/[\s\S]{1,3}/g, cb_encode); + }; + let _encode = buffer ? function (u) { + return (u.constructor === buffer.constructor ? u : new buffer(u)) + .toString('base64') + } + : function (u) { + return btoa(utob(u)) + } + ; + let encode = function (u, urisafe) { + return !urisafe + ? _encode(String(u)) + : _encode(String(u)).replace(/[+\/]/g, function (m0) { + return m0 == '+' ? '-' : '_'; + }).replace(/=/g, ''); + }; + let encodeURI = function (u) { + return encode(u, true) + }; + // decoder stuff + let re_btou = new RegExp([ + '[\xC0-\xDF][\x80-\xBF]', + '[\xE0-\xEF][\x80-\xBF]{2}', + '[\xF0-\xF7][\x80-\xBF]{3}' + ].join('|'), 'g'); + let cb_btou = function (cccc) { + switch (cccc.length) { + case 4: + let cp = ((0x07 & cccc.charCodeAt(0)) << 18) + | ((0x3f & cccc.charCodeAt(1)) << 12) + | ((0x3f & cccc.charCodeAt(2)) << 6) + | (0x3f & cccc.charCodeAt(3)), + offset = cp - 0x10000; + return (fromCharCode((offset >>> 10) + 0xD800) + + fromCharCode((offset & 0x3FF) + 0xDC00)); + case 3: + return fromCharCode( + ((0x0f & cccc.charCodeAt(0)) << 12) + | ((0x3f & cccc.charCodeAt(1)) << 6) + | (0x3f & cccc.charCodeAt(2)) + ); + default: + return fromCharCode( + ((0x1f & cccc.charCodeAt(0)) << 6) + | (0x3f & cccc.charCodeAt(1)) + ); + } + }; + let btou = function (b) { + return b.replace(re_btou, cb_btou); + }; + let cb_decode = function (cccc) { + let len = cccc.length, + padlen = len % 4, + n = (len > 0 ? b64tab[cccc.charAt(0)] << 18 : 0) + | (len > 1 ? b64tab[cccc.charAt(1)] << 12 : 0) + | (len > 2 ? b64tab[cccc.charAt(2)] << 6 : 0) + | (len > 3 ? b64tab[cccc.charAt(3)] : 0), + chars = [ + fromCharCode(n >>> 16), + fromCharCode((n >>> 8) & 0xff), + fromCharCode(n & 0xff) + ]; + chars.length -= [0, 0, 2, 1][padlen]; + return chars.join(''); + }; + let atob = global.atob ? function (a) { + return global.atob(a); + } : function (a) { + return a.replace(/[\s\S]{1,4}/g, cb_decode); + }; + let _decode = buffer ? function (a) { + return (a.constructor === buffer.constructor + ? a : new buffer(a, 'base64')).toString(); + } + : function (a) { + return btou(atob(a)) + }; + let decode = function (a) { + return _decode( + String(a).replace(/[-_]/g, function (m0) { + return m0 == '-' ? '+' : '/' + }) + .replace(/[^A-Za-z0-9\+\/]/g, '') + ); + }; + let noConflict = function () { + let Base64 = global.Base64; + global.Base64 = _Base64; + return Base64; + }; + // export Base64 + global.Base64 = { + VERSION: version, + atob: atob, + btoa: btoa, + fromBase64: decode, + toBase64: encode, + utob: utob, + encode: encode, + encodeURI: encodeURI, + btou: btou, + decode: decode, + noConflict: noConflict + }; +})(this); \ No newline at end of file diff --git a/public/static/crypto-js.js b/public/static/crypto-js.js new file mode 100644 index 0000000..be5c2ea --- /dev/null +++ b/public/static/crypto-js.js @@ -0,0 +1,6059 @@ +;(function (root, factory) { + if (typeof exports === "object") { + // CommonJS + module.exports = exports = factory(); + } + else if (typeof define === "function" && define.amd) { + // AMD + define([], factory); + } + else { + // Global (browser) + root.CryptoJS = factory(); + } +}(this, function () { + + /*globals window, global, require*/ + + /** + * CryptoJS core components. + */ + var CryptoJS = CryptoJS || (function (Math, undefined) { + + var crypto; + + // Native crypto from window (Browser) + if (typeof window !== 'undefined' && window.crypto) { + crypto = window.crypto; + } + + // Native (experimental IE 11) crypto from window (Browser) + if (!crypto && typeof window !== 'undefined' && window.msCrypto) { + crypto = window.msCrypto; + } + + // Native crypto from global (NodeJS) + if (!crypto && typeof global !== 'undefined' && global.crypto) { + crypto = global.crypto; + } + + // Native crypto import via require (NodeJS) + if (!crypto && typeof require === 'function') { + try { + crypto = require('crypto'); + } catch (err) {} + } + + /* + * Cryptographically secure pseudorandom number generator + * + * As Math.random() is cryptographically not safe to use + */ + var cryptoSecureRandomInt = function () { + if (crypto) { + // Use getRandomValues method (Browser) + if (typeof crypto.getRandomValues === 'function') { + try { + return crypto.getRandomValues(new Uint32Array(1))[0]; + } catch (err) {} + } + + // Use randomBytes method (NodeJS) + if (typeof crypto.randomBytes === 'function') { + try { + return crypto.randomBytes(4).readInt32LE(); + } catch (err) {} + } + } + + throw new Error('Native crypto module could not be used to get secure random number.'); + }; + + /* + * Local polyfill of Object.create + + */ + var create = Object.create || (function () { + function F() {} + + return function (obj) { + var subtype; + + F.prototype = obj; + + subtype = new F(); + + F.prototype = null; + + return subtype; + }; + }()) + + /** + * CryptoJS namespace. + */ + var C = {}; + + /** + * Library namespace. + */ + var C_lib = C.lib = {}; + + /** + * Base object for prototypal inheritance. + */ + var Base = C_lib.Base = (function () { + + + return { + /** + * Creates a new object that inherits from this object. + * + * @param {Object} overrides Properties to copy into the new object. + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * field: 'value', + * + * method: function () { + * } + * }); + */ + extend: function (overrides) { + // Spawn + var subtype = create(this); + + // Augment + if (overrides) { + subtype.mixIn(overrides); + } + + // Create default initializer + if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { + subtype.init = function () { + subtype.$super.init.apply(this, arguments); + }; + } + + // Initializer's prototype is the subtype object + subtype.init.prototype = subtype; + + // Reference supertype + subtype.$super = this; + + return subtype; + }, + + /** + * Extends this object and runs the init method. + * Arguments to create() will be passed to init(). + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var instance = MyType.create(); + */ + create: function () { + var instance = this.extend(); + instance.init.apply(instance, arguments); + + return instance; + }, + + /** + * Initializes a newly created object. + * Override this method to add some logic when your objects are created. + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * init: function () { + * // ... + * } + * }); + */ + init: function () { + }, + + /** + * Copies properties into this object. + * + * @param {Object} properties The properties to mix in. + * + * @example + * + * MyType.mixIn({ + * field: 'value' + * }); + */ + mixIn: function (properties) { + for (var propertyName in properties) { + if (properties.hasOwnProperty(propertyName)) { + this[propertyName] = properties[propertyName]; + } + } + + // IE won't copy toString using the loop above + if (properties.hasOwnProperty('toString')) { + this.toString = properties.toString; + } + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = instance.clone(); + */ + clone: function () { + return this.init.prototype.extend(this); + } + }; + }()); + + /** + * An array of 32-bit words. + * + * @property {Array} words The array of 32-bit words. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var WordArray = C_lib.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of 32-bit words. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.create(); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); + */ + init: function (words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 4; + } + }, + + /** + * Converts this word array to a string. + * + * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex + * + * @return {string} The stringified word array. + * + * @example + * + * var string = wordArray + ''; + * var string = wordArray.toString(); + * var string = wordArray.toString(CryptoJS.enc.Utf8); + */ + toString: function (encoder) { + return (encoder || Hex).stringify(this); + }, + + /** + * Concatenates a word array to this word array. + * + * @param {WordArray} wordArray The word array to append. + * + * @return {WordArray} This word array. + * + * @example + * + * wordArray1.concat(wordArray2); + */ + concat: function (wordArray) { + // Shortcuts + var thisWords = this.words; + var thatWords = wordArray.words; + var thisSigBytes = this.sigBytes; + var thatSigBytes = wordArray.sigBytes; + + // Clamp excess bits + this.clamp(); + + // Concat + if (thisSigBytes % 4) { + // Copy one byte at a time + for (var i = 0; i < thatSigBytes; i++) { + var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); + } + } else { + // Copy one word at a time + for (var i = 0; i < thatSigBytes; i += 4) { + thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2]; + } + } + this.sigBytes += thatSigBytes; + + // Chainable + return this; + }, + + /** + * Removes insignificant bits. + * + * @example + * + * wordArray.clamp(); + */ + clamp: function () { + // Shortcuts + var words = this.words; + var sigBytes = this.sigBytes; + + // Clamp + words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); + words.length = Math.ceil(sigBytes / 4); + }, + + /** + * Creates a copy of this word array. + * + * @return {WordArray} The clone. + * + * @example + * + * var clone = wordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone.words = this.words.slice(0); + + return clone; + }, + + /** + * Creates a word array filled with random bytes. + * + * @param {number} nBytes The number of random bytes to generate. + * + * @return {WordArray} The random word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.random(16); + */ + random: function (nBytes) { + var words = []; + + for (var i = 0; i < nBytes; i += 4) { + words.push(cryptoSecureRandomInt()); + } + + return new WordArray.init(words, nBytes); + } + }); + + /** + * Encoder namespace. + */ + var C_enc = C.enc = {}; + + /** + * Hex encoding strategy. + */ + var Hex = C_enc.Hex = { + /** + * Converts a word array to a hex string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The hex string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.enc.Hex.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var hexChars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + hexChars.push((bite >>> 4).toString(16)); + hexChars.push((bite & 0x0f).toString(16)); + } + + return hexChars.join(''); + }, + + /** + * Converts a hex string to a word array. + * + * @param {string} hexStr The hex string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Hex.parse(hexString); + */ + parse: function (hexStr) { + // Shortcut + var hexStrLength = hexStr.length; + + // Convert + var words = []; + for (var i = 0; i < hexStrLength; i += 2) { + words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); + } + + return new WordArray.init(words, hexStrLength / 2); + } + }; + + /** + * Latin1 encoding strategy. + */ + var Latin1 = C_enc.Latin1 = { + /** + * Converts a word array to a Latin1 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Latin1 string. + * + * @static + * + * @example + * + * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var latin1Chars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + latin1Chars.push(String.fromCharCode(bite)); + } + + return latin1Chars.join(''); + }, + + /** + * Converts a Latin1 string to a word array. + * + * @param {string} latin1Str The Latin1 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); + */ + parse: function (latin1Str) { + // Shortcut + var latin1StrLength = latin1Str.length; + + // Convert + var words = []; + for (var i = 0; i < latin1StrLength; i++) { + words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); + } + + return new WordArray.init(words, latin1StrLength); + } + }; + + /** + * UTF-8 encoding strategy. + */ + var Utf8 = C_enc.Utf8 = { + /** + * Converts a word array to a UTF-8 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-8 string. + * + * @static + * + * @example + * + * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); + */ + stringify: function (wordArray) { + try { + return decodeURIComponent(escape(Latin1.stringify(wordArray))); + } catch (e) { + throw new Error('Malformed UTF-8 data'); + } + }, + + /** + * Converts a UTF-8 string to a word array. + * + * @param {string} utf8Str The UTF-8 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); + */ + parse: function (utf8Str) { + return Latin1.parse(unescape(encodeURIComponent(utf8Str))); + } + }; + + /** + * Abstract buffered block algorithm template. + * + * The property blockSize must be implemented in a concrete subtype. + * + * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 + */ + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ + /** + * Resets this block algorithm's data buffer to its initial state. + * + * @example + * + * bufferedBlockAlgorithm.reset(); + */ + reset: function () { + // Initial values + this._data = new WordArray.init(); + this._nDataBytes = 0; + }, + + /** + * Adds new data to this block algorithm's buffer. + * + * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. + * + * @example + * + * bufferedBlockAlgorithm._append('data'); + * bufferedBlockAlgorithm._append(wordArray); + */ + _append: function (data) { + // Convert string to WordArray, else assume WordArray already + if (typeof data == 'string') { + data = Utf8.parse(data); + } + + // Append + this._data.concat(data); + this._nDataBytes += data.sigBytes; + }, + + /** + * Processes available data blocks. + * + * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. + * + * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. + * + * @return {WordArray} The processed data. + * + * @example + * + * var processedData = bufferedBlockAlgorithm._process(); + * var processedData = bufferedBlockAlgorithm._process(!!'flush'); + */ + _process: function (doFlush) { + var processedWords; + + // Shortcuts + var data = this._data; + var dataWords = data.words; + var dataSigBytes = data.sigBytes; + var blockSize = this.blockSize; + var blockSizeBytes = blockSize * 4; + + // Count blocks ready + var nBlocksReady = dataSigBytes / blockSizeBytes; + if (doFlush) { + // Round up to include partial blocks + nBlocksReady = Math.ceil(nBlocksReady); + } else { + // Round down to include only full blocks, + // less the number of blocks that must remain in the buffer + nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); + } + + // Count words ready + var nWordsReady = nBlocksReady * blockSize; + + // Count bytes ready + var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); + + // Process blocks + if (nWordsReady) { + for (var offset = 0; offset < nWordsReady; offset += blockSize) { + // Perform concrete-algorithm logic + this._doProcessBlock(dataWords, offset); + } + + // Remove processed words + processedWords = dataWords.splice(0, nWordsReady); + data.sigBytes -= nBytesReady; + } + + // Return processed words + return new WordArray.init(processedWords, nBytesReady); + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = bufferedBlockAlgorithm.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone._data = this._data.clone(); + + return clone; + }, + + _minBufferSize: 0 + }); + + /** + * Abstract hasher template. + * + * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) + */ + var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + */ + cfg: Base.extend(), + + /** + * Initializes a newly created hasher. + * + * @param {Object} cfg (Optional) The configuration options to use for this hash computation. + * + * @example + * + * var hasher = CryptoJS.algo.SHA256.create(); + */ + init: function (cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); + + // Set initial values + this.reset(); + }, + + /** + * Resets this hasher to its initial state. + * + * @example + * + * hasher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); + + // Perform concrete-hasher logic + this._doReset(); + }, + + /** + * Updates this hasher with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {Hasher} This hasher. + * + * @example + * + * hasher.update('message'); + * hasher.update(wordArray); + */ + update: function (messageUpdate) { + // Append + this._append(messageUpdate); + + // Update the hash + this._process(); + + // Chainable + return this; + }, + + /** + * Finalizes the hash computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The hash. + * + * @example + * + * var hash = hasher.finalize(); + * var hash = hasher.finalize('message'); + * var hash = hasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Final message update + if (messageUpdate) { + this._append(messageUpdate); + } + + // Perform concrete-hasher logic + var hash = this._doFinalize(); + + return hash; + }, + + blockSize: 512/32, + + /** + * Creates a shortcut function to a hasher's object interface. + * + * @param {Hasher} hasher The hasher to create a helper for. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); + */ + _createHelper: function (hasher) { + return function (message, cfg) { + return new hasher.init(cfg).finalize(message); + }; + }, + + /** + * Creates a shortcut function to the HMAC's object interface. + * + * @param {Hasher} hasher The hasher to use in this HMAC helper. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); + */ + _createHmacHelper: function (hasher) { + return function (message, key) { + return new C_algo.HMAC.init(hasher, key).finalize(message); + }; + } + }); + + /** + * Algorithm namespace. + */ + var C_algo = C.algo = {}; + + return C; + }(Math)); + + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * Base64 encoding strategy. + */ + var Base64 = C_enc.Base64 = { + /** + * Converts a word array to a Base64 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Base64 string. + * + * @static + * + * @example + * + * var base64String = CryptoJS.enc.Base64.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var map = this._map; + + // Clamp excess bits + wordArray.clamp(); + + // Convert + var base64Chars = []; + for (var i = 0; i < sigBytes; i += 3) { + var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; + var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; + + var triplet = (byte1 << 16) | (byte2 << 8) | byte3; + + for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { + base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); + } + } + + // Add padding + var paddingChar = map.charAt(64); + if (paddingChar) { + while (base64Chars.length % 4) { + base64Chars.push(paddingChar); + } + } + + return base64Chars.join(''); + }, + + /** + * Converts a Base64 string to a word array. + * + * @param {string} base64Str The Base64 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Base64.parse(base64String); + */ + parse: function (base64Str) { + // Shortcuts + var base64StrLength = base64Str.length; + var map = this._map; + var reverseMap = this._reverseMap; + + if (!reverseMap) { + reverseMap = this._reverseMap = []; + for (var j = 0; j < map.length; j++) { + reverseMap[map.charCodeAt(j)] = j; + } + } + + // Ignore padding + var paddingChar = map.charAt(64); + if (paddingChar) { + var paddingIndex = base64Str.indexOf(paddingChar); + if (paddingIndex !== -1) { + base64StrLength = paddingIndex; + } + } + + // Convert + return parseLoop(base64Str, base64StrLength, reverseMap); + + }, + + _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' + }; + + function parseLoop(base64Str, base64StrLength, reverseMap) { + var words = []; + var nBytes = 0; + for (var i = 0; i < base64StrLength; i++) { + if (i % 4) { + var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2); + var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2); + var bitsCombined = bits1 | bits2; + words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8); + nBytes++; + } + } + return WordArray.create(words, nBytes); + } + }()); + + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Constants table + var T = []; + + // Compute constants + (function () { + for (var i = 0; i < 64; i++) { + T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; + } + }()); + + /** + * MD5 hash algorithm. + */ + var MD5 = C_algo.MD5 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476 + ]); + }, + + _doProcessBlock: function (M, offset) { + // Swap endian + for (var i = 0; i < 16; i++) { + // Shortcuts + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + + M[offset_i] = ( + (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | + (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) + ); + } + + // Shortcuts + var H = this._hash.words; + + var M_offset_0 = M[offset + 0]; + var M_offset_1 = M[offset + 1]; + var M_offset_2 = M[offset + 2]; + var M_offset_3 = M[offset + 3]; + var M_offset_4 = M[offset + 4]; + var M_offset_5 = M[offset + 5]; + var M_offset_6 = M[offset + 6]; + var M_offset_7 = M[offset + 7]; + var M_offset_8 = M[offset + 8]; + var M_offset_9 = M[offset + 9]; + var M_offset_10 = M[offset + 10]; + var M_offset_11 = M[offset + 11]; + var M_offset_12 = M[offset + 12]; + var M_offset_13 = M[offset + 13]; + var M_offset_14 = M[offset + 14]; + var M_offset_15 = M[offset + 15]; + + // Working varialbes + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + + // Computation + a = FF(a, b, c, d, M_offset_0, 7, T[0]); + d = FF(d, a, b, c, M_offset_1, 12, T[1]); + c = FF(c, d, a, b, M_offset_2, 17, T[2]); + b = FF(b, c, d, a, M_offset_3, 22, T[3]); + a = FF(a, b, c, d, M_offset_4, 7, T[4]); + d = FF(d, a, b, c, M_offset_5, 12, T[5]); + c = FF(c, d, a, b, M_offset_6, 17, T[6]); + b = FF(b, c, d, a, M_offset_7, 22, T[7]); + a = FF(a, b, c, d, M_offset_8, 7, T[8]); + d = FF(d, a, b, c, M_offset_9, 12, T[9]); + c = FF(c, d, a, b, M_offset_10, 17, T[10]); + b = FF(b, c, d, a, M_offset_11, 22, T[11]); + a = FF(a, b, c, d, M_offset_12, 7, T[12]); + d = FF(d, a, b, c, M_offset_13, 12, T[13]); + c = FF(c, d, a, b, M_offset_14, 17, T[14]); + b = FF(b, c, d, a, M_offset_15, 22, T[15]); + + a = GG(a, b, c, d, M_offset_1, 5, T[16]); + d = GG(d, a, b, c, M_offset_6, 9, T[17]); + c = GG(c, d, a, b, M_offset_11, 14, T[18]); + b = GG(b, c, d, a, M_offset_0, 20, T[19]); + a = GG(a, b, c, d, M_offset_5, 5, T[20]); + d = GG(d, a, b, c, M_offset_10, 9, T[21]); + c = GG(c, d, a, b, M_offset_15, 14, T[22]); + b = GG(b, c, d, a, M_offset_4, 20, T[23]); + a = GG(a, b, c, d, M_offset_9, 5, T[24]); + d = GG(d, a, b, c, M_offset_14, 9, T[25]); + c = GG(c, d, a, b, M_offset_3, 14, T[26]); + b = GG(b, c, d, a, M_offset_8, 20, T[27]); + a = GG(a, b, c, d, M_offset_13, 5, T[28]); + d = GG(d, a, b, c, M_offset_2, 9, T[29]); + c = GG(c, d, a, b, M_offset_7, 14, T[30]); + b = GG(b, c, d, a, M_offset_12, 20, T[31]); + + a = HH(a, b, c, d, M_offset_5, 4, T[32]); + d = HH(d, a, b, c, M_offset_8, 11, T[33]); + c = HH(c, d, a, b, M_offset_11, 16, T[34]); + b = HH(b, c, d, a, M_offset_14, 23, T[35]); + a = HH(a, b, c, d, M_offset_1, 4, T[36]); + d = HH(d, a, b, c, M_offset_4, 11, T[37]); + c = HH(c, d, a, b, M_offset_7, 16, T[38]); + b = HH(b, c, d, a, M_offset_10, 23, T[39]); + a = HH(a, b, c, d, M_offset_13, 4, T[40]); + d = HH(d, a, b, c, M_offset_0, 11, T[41]); + c = HH(c, d, a, b, M_offset_3, 16, T[42]); + b = HH(b, c, d, a, M_offset_6, 23, T[43]); + a = HH(a, b, c, d, M_offset_9, 4, T[44]); + d = HH(d, a, b, c, M_offset_12, 11, T[45]); + c = HH(c, d, a, b, M_offset_15, 16, T[46]); + b = HH(b, c, d, a, M_offset_2, 23, T[47]); + + a = II(a, b, c, d, M_offset_0, 6, T[48]); + d = II(d, a, b, c, M_offset_7, 10, T[49]); + c = II(c, d, a, b, M_offset_14, 15, T[50]); + b = II(b, c, d, a, M_offset_5, 21, T[51]); + a = II(a, b, c, d, M_offset_12, 6, T[52]); + d = II(d, a, b, c, M_offset_3, 10, T[53]); + c = II(c, d, a, b, M_offset_10, 15, T[54]); + b = II(b, c, d, a, M_offset_1, 21, T[55]); + a = II(a, b, c, d, M_offset_8, 6, T[56]); + d = II(d, a, b, c, M_offset_15, 10, T[57]); + c = II(c, d, a, b, M_offset_6, 15, T[58]); + b = II(b, c, d, a, M_offset_13, 21, T[59]); + a = II(a, b, c, d, M_offset_4, 6, T[60]); + d = II(d, a, b, c, M_offset_11, 10, T[61]); + c = II(c, d, a, b, M_offset_2, 15, T[62]); + b = II(b, c, d, a, M_offset_9, 21, T[63]); + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + + var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); + var nBitsTotalL = nBitsTotal; + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = ( + (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) | + (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00) + ); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( + (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) | + (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00) + ); + + data.sigBytes = (dataWords.length + 1) * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var hash = this._hash; + var H = hash.words; + + // Swap endian + for (var i = 0; i < 4; i++) { + // Shortcut + var H_i = H[i]; + + H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | + (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); + } + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + function FF(a, b, c, d, x, s, t) { + var n = a + ((b & c) | (~b & d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function GG(a, b, c, d, x, s, t) { + var n = a + ((b & d) | (c & ~d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function HH(a, b, c, d, x, s, t) { + var n = a + (b ^ c ^ d) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function II(a, b, c, d, x, s, t) { + var n = a + (c ^ (b | ~d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.MD5('message'); + * var hash = CryptoJS.MD5(wordArray); + */ + C.MD5 = Hasher._createHelper(MD5); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacMD5(message, key); + */ + C.HmacMD5 = Hasher._createHmacHelper(MD5); + }(Math)); + + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Reusable object + var W = []; + + /** + * SHA-1 hash algorithm. + */ + var SHA1 = C_algo.SHA1 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476, + 0xc3d2e1f0 + ]); + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + + // Computation + for (var i = 0; i < 80; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; + W[i] = (n << 1) | (n >>> 31); + } + + var t = ((a << 5) | (a >>> 27)) + e + W[i]; + if (i < 20) { + t += ((b & c) | (~b & d)) + 0x5a827999; + } else if (i < 40) { + t += (b ^ c ^ d) + 0x6ed9eba1; + } else if (i < 60) { + t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; + } else /* if (i < 80) */ { + t += (b ^ c ^ d) - 0x359d3e2a; + } + + e = d; + d = c; + c = (b << 30) | (b >>> 2); + b = a; + a = t; + } + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Return final computed hash + return this._hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA1('message'); + * var hash = CryptoJS.SHA1(wordArray); + */ + C.SHA1 = Hasher._createHelper(SHA1); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA1(message, key); + */ + C.HmacSHA1 = Hasher._createHmacHelper(SHA1); + }()); + + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Initialization and round constants tables + var H = []; + var K = []; + + // Compute constants + (function () { + function isPrime(n) { + var sqrtN = Math.sqrt(n); + for (var factor = 2; factor <= sqrtN; factor++) { + if (!(n % factor)) { + return false; + } + } + + return true; + } + + function getFractionalBits(n) { + return ((n - (n | 0)) * 0x100000000) | 0; + } + + var n = 2; + var nPrime = 0; + while (nPrime < 64) { + if (isPrime(n)) { + if (nPrime < 8) { + H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); + } + K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); + + nPrime++; + } + + n++; + } + }()); + + // Reusable object + var W = []; + + /** + * SHA-256 hash algorithm. + */ + var SHA256 = C_algo.SHA256 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init(H.slice(0)); + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + var f = H[5]; + var g = H[6]; + var h = H[7]; + + // Computation + for (var i = 0; i < 64; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var gamma0x = W[i - 15]; + var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ + ((gamma0x << 14) | (gamma0x >>> 18)) ^ + (gamma0x >>> 3); + + var gamma1x = W[i - 2]; + var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ + ((gamma1x << 13) | (gamma1x >>> 19)) ^ + (gamma1x >>> 10); + + W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; + } + + var ch = (e & f) ^ (~e & g); + var maj = (a & b) ^ (a & c) ^ (b & c); + + var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); + var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); + + var t1 = h + sigma1 + ch + K[i] + W[i]; + var t2 = sigma0 + maj; + + h = g; + g = f; + f = e; + e = (d + t1) | 0; + d = c; + c = b; + b = a; + a = (t1 + t2) | 0; + } + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + H[5] = (H[5] + f) | 0; + H[6] = (H[6] + g) | 0; + H[7] = (H[7] + h) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Return final computed hash + return this._hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA256('message'); + * var hash = CryptoJS.SHA256(wordArray); + */ + C.SHA256 = Hasher._createHelper(SHA256); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA256(message, key); + */ + C.HmacSHA256 = Hasher._createHmacHelper(SHA256); + }(Math)); + + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * UTF-16 BE encoding strategy. + */ + var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = { + /** + * Converts a word array to a UTF-16 BE string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-16 BE string. + * + * @static + * + * @example + * + * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var utf16Chars = []; + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff; + utf16Chars.push(String.fromCharCode(codePoint)); + } + + return utf16Chars.join(''); + }, + + /** + * Converts a UTF-16 BE string to a word array. + * + * @param {string} utf16Str The UTF-16 BE string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); + */ + parse: function (utf16Str) { + // Shortcut + var utf16StrLength = utf16Str.length; + + // Convert + var words = []; + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16); + } + + return WordArray.create(words, utf16StrLength * 2); + } + }; + + /** + * UTF-16 LE encoding strategy. + */ + C_enc.Utf16LE = { + /** + * Converts a word array to a UTF-16 LE string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-16 LE string. + * + * @static + * + * @example + * + * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var utf16Chars = []; + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff); + utf16Chars.push(String.fromCharCode(codePoint)); + } + + return utf16Chars.join(''); + }, + + /** + * Converts a UTF-16 LE string to a word array. + * + * @param {string} utf16Str The UTF-16 LE string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str); + */ + parse: function (utf16Str) { + // Shortcut + var utf16StrLength = utf16Str.length; + + // Convert + var words = []; + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16)); + } + + return WordArray.create(words, utf16StrLength * 2); + } + }; + + function swapEndian(word) { + return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff); + } + }()); + + + (function () { + // Check if typed arrays are supported + if (typeof ArrayBuffer != 'function') { + return; + } + + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + + // Reference original init + var superInit = WordArray.init; + + // Augment WordArray.init to handle typed arrays + var subInit = WordArray.init = function (typedArray) { + // Convert buffers to uint8 + if (typedArray instanceof ArrayBuffer) { + typedArray = new Uint8Array(typedArray); + } + + // Convert other array views to uint8 + if ( + typedArray instanceof Int8Array || + (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) || + typedArray instanceof Int16Array || + typedArray instanceof Uint16Array || + typedArray instanceof Int32Array || + typedArray instanceof Uint32Array || + typedArray instanceof Float32Array || + typedArray instanceof Float64Array + ) { + typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); + } + + // Handle Uint8Array + if (typedArray instanceof Uint8Array) { + // Shortcut + var typedArrayByteLength = typedArray.byteLength; + + // Extract bytes + var words = []; + for (var i = 0; i < typedArrayByteLength; i++) { + words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8); + } + + // Initialize this word array + superInit.call(this, words, typedArrayByteLength); + } else { + // Else call normal init + superInit.apply(this, arguments); + } + }; + + subInit.prototype = WordArray; + }()); + + + /** @preserve + (c) 2012 by Cédric Mesnil. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Constants table + var _zl = WordArray.create([ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, + 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, + 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, + 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]); + var _zr = WordArray.create([ + 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, + 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, + 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, + 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, + 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]); + var _sl = WordArray.create([ + 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, + 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, + 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, + 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, + 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]); + var _sr = WordArray.create([ + 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, + 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, + 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, + 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, + 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]); + + var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]); + var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]); + + /** + * RIPEMD160 hash algorithm. + */ + var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ + _doReset: function () { + this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]); + }, + + _doProcessBlock: function (M, offset) { + + // Swap endian + for (var i = 0; i < 16; i++) { + // Shortcuts + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + + // Swap + M[offset_i] = ( + (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | + (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) + ); + } + // Shortcut + var H = this._hash.words; + var hl = _hl.words; + var hr = _hr.words; + var zl = _zl.words; + var zr = _zr.words; + var sl = _sl.words; + var sr = _sr.words; + + // Working variables + var al, bl, cl, dl, el; + var ar, br, cr, dr, er; + + ar = al = H[0]; + br = bl = H[1]; + cr = cl = H[2]; + dr = dl = H[3]; + er = el = H[4]; + // Computation + var t; + for (var i = 0; i < 80; i += 1) { + t = (al + M[offset+zl[i]])|0; + if (i<16){ + t += f1(bl,cl,dl) + hl[0]; + } else if (i<32) { + t += f2(bl,cl,dl) + hl[1]; + } else if (i<48) { + t += f3(bl,cl,dl) + hl[2]; + } else if (i<64) { + t += f4(bl,cl,dl) + hl[3]; + } else {// if (i<80) { + t += f5(bl,cl,dl) + hl[4]; + } + t = t|0; + t = rotl(t,sl[i]); + t = (t+el)|0; + al = el; + el = dl; + dl = rotl(cl, 10); + cl = bl; + bl = t; + + t = (ar + M[offset+zr[i]])|0; + if (i<16){ + t += f5(br,cr,dr) + hr[0]; + } else if (i<32) { + t += f4(br,cr,dr) + hr[1]; + } else if (i<48) { + t += f3(br,cr,dr) + hr[2]; + } else if (i<64) { + t += f2(br,cr,dr) + hr[3]; + } else {// if (i<80) { + t += f1(br,cr,dr) + hr[4]; + } + t = t|0; + t = rotl(t,sr[i]) ; + t = (t+er)|0; + ar = er; + er = dr; + dr = rotl(cr, 10); + cr = br; + br = t; + } + // Intermediate hash value + t = (H[1] + cl + dr)|0; + H[1] = (H[2] + dl + er)|0; + H[2] = (H[3] + el + ar)|0; + H[3] = (H[4] + al + br)|0; + H[4] = (H[0] + bl + cr)|0; + H[0] = t; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( + (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | + (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) + ); + data.sigBytes = (dataWords.length + 1) * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var hash = this._hash; + var H = hash.words; + + // Swap endian + for (var i = 0; i < 5; i++) { + // Shortcut + var H_i = H[i]; + + // Swap + H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | + (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); + } + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + + function f1(x, y, z) { + return ((x) ^ (y) ^ (z)); + + } + + function f2(x, y, z) { + return (((x)&(y)) | ((~x)&(z))); + } + + function f3(x, y, z) { + return (((x) | (~(y))) ^ (z)); + } + + function f4(x, y, z) { + return (((x) & (z)) | ((y)&(~(z)))); + } + + function f5(x, y, z) { + return ((x) ^ ((y) |(~(z)))); + + } + + function rotl(x,n) { + return (x<>>(32-n)); + } + + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.RIPEMD160('message'); + * var hash = CryptoJS.RIPEMD160(wordArray); + */ + C.RIPEMD160 = Hasher._createHelper(RIPEMD160); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacRIPEMD160(message, key); + */ + C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); + }(Math)); + + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var C_algo = C.algo; + + /** + * HMAC algorithm. + */ + var HMAC = C_algo.HMAC = Base.extend({ + /** + * Initializes a newly created HMAC. + * + * @param {Hasher} hasher The hash algorithm to use. + * @param {WordArray|string} key The secret key. + * + * @example + * + * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); + */ + init: function (hasher, key) { + // Init hasher + hasher = this._hasher = new hasher.init(); + + // Convert string to WordArray, else assume WordArray already + if (typeof key == 'string') { + key = Utf8.parse(key); + } + + // Shortcuts + var hasherBlockSize = hasher.blockSize; + var hasherBlockSizeBytes = hasherBlockSize * 4; + + // Allow arbitrary length keys + if (key.sigBytes > hasherBlockSizeBytes) { + key = hasher.finalize(key); + } + + // Clamp excess bits + key.clamp(); + + // Clone key for inner and outer pads + var oKey = this._oKey = key.clone(); + var iKey = this._iKey = key.clone(); + + // Shortcuts + var oKeyWords = oKey.words; + var iKeyWords = iKey.words; + + // XOR keys with pad constants + for (var i = 0; i < hasherBlockSize; i++) { + oKeyWords[i] ^= 0x5c5c5c5c; + iKeyWords[i] ^= 0x36363636; + } + oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; + + // Set initial values + this.reset(); + }, + + /** + * Resets this HMAC to its initial state. + * + * @example + * + * hmacHasher.reset(); + */ + reset: function () { + // Shortcut + var hasher = this._hasher; + + // Reset + hasher.reset(); + hasher.update(this._iKey); + }, + + /** + * Updates this HMAC with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {HMAC} This HMAC instance. + * + * @example + * + * hmacHasher.update('message'); + * hmacHasher.update(wordArray); + */ + update: function (messageUpdate) { + this._hasher.update(messageUpdate); + + // Chainable + return this; + }, + + /** + * Finalizes the HMAC computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The HMAC. + * + * @example + * + * var hmac = hmacHasher.finalize(); + * var hmac = hmacHasher.finalize('message'); + * var hmac = hmacHasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Shortcut + var hasher = this._hasher; + + // Compute HMAC + var innerHash = hasher.finalize(messageUpdate); + hasher.reset(); + var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); + + return hmac; + } + }); + }()); + + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var SHA1 = C_algo.SHA1; + var HMAC = C_algo.HMAC; + + /** + * Password-Based Key Derivation Function 2 algorithm. + */ + var PBKDF2 = C_algo.PBKDF2 = Base.extend({ + /** + * Configuration options. + * + * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) + * @property {Hasher} hasher The hasher to use. Default: SHA1 + * @property {number} iterations The number of iterations to perform. Default: 1 + */ + cfg: Base.extend({ + keySize: 128/32, + hasher: SHA1, + iterations: 1 + }), + + /** + * Initializes a newly created key derivation function. + * + * @param {Object} cfg (Optional) The configuration options to use for the derivation. + * + * @example + * + * var kdf = CryptoJS.algo.PBKDF2.create(); + * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 }); + * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 }); + */ + init: function (cfg) { + this.cfg = this.cfg.extend(cfg); + }, + + /** + * Computes the Password-Based Key Derivation Function 2. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * + * @return {WordArray} The derived key. + * + * @example + * + * var key = kdf.compute(password, salt); + */ + compute: function (password, salt) { + // Shortcut + var cfg = this.cfg; + + // Init HMAC + var hmac = HMAC.create(cfg.hasher, password); + + // Initial values + var derivedKey = WordArray.create(); + var blockIndex = WordArray.create([0x00000001]); + + // Shortcuts + var derivedKeyWords = derivedKey.words; + var blockIndexWords = blockIndex.words; + var keySize = cfg.keySize; + var iterations = cfg.iterations; + + // Generate key + while (derivedKeyWords.length < keySize) { + var block = hmac.update(salt).finalize(blockIndex); + hmac.reset(); + + // Shortcuts + var blockWords = block.words; + var blockWordsLength = blockWords.length; + + // Iterations + var intermediate = block; + for (var i = 1; i < iterations; i++) { + intermediate = hmac.finalize(intermediate); + hmac.reset(); + + // Shortcut + var intermediateWords = intermediate.words; + + // XOR intermediate with block + for (var j = 0; j < blockWordsLength; j++) { + blockWords[j] ^= intermediateWords[j]; + } + } + + derivedKey.concat(block); + blockIndexWords[0]++; + } + derivedKey.sigBytes = keySize * 4; + + return derivedKey; + } + }); + + /** + * Computes the Password-Based Key Derivation Function 2. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * @param {Object} cfg (Optional) The configuration options to use for this computation. + * + * @return {WordArray} The derived key. + * + * @static + * + * @example + * + * var key = CryptoJS.PBKDF2(password, salt); + * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 }); + * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 }); + */ + C.PBKDF2 = function (password, salt, cfg) { + return PBKDF2.create(cfg).compute(password, salt); + }; + }()); + + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var MD5 = C_algo.MD5; + + /** + * This key derivation function is meant to conform with EVP_BytesToKey. + * www.openssl.org/docs/crypto/EVP_BytesToKey.html + */ + var EvpKDF = C_algo.EvpKDF = Base.extend({ + /** + * Configuration options. + * + * @property {number} keySize The key size in words to generate. Default: 4 (128 bits) + * @property {Hasher} hasher The hash algorithm to use. Default: MD5 + * @property {number} iterations The number of iterations to perform. Default: 1 + */ + cfg: Base.extend({ + keySize: 128/32, + hasher: MD5, + iterations: 1 + }), + + /** + * Initializes a newly created key derivation function. + * + * @param {Object} cfg (Optional) The configuration options to use for the derivation. + * + * @example + * + * var kdf = CryptoJS.algo.EvpKDF.create(); + * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 }); + * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 }); + */ + init: function (cfg) { + this.cfg = this.cfg.extend(cfg); + }, + + /** + * Derives a key from a password. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * + * @return {WordArray} The derived key. + * + * @example + * + * var key = kdf.compute(password, salt); + */ + compute: function (password, salt) { + var block; + + // Shortcut + var cfg = this.cfg; + + // Init hasher + var hasher = cfg.hasher.create(); + + // Initial values + var derivedKey = WordArray.create(); + + // Shortcuts + var derivedKeyWords = derivedKey.words; + var keySize = cfg.keySize; + var iterations = cfg.iterations; + + // Generate key + while (derivedKeyWords.length < keySize) { + if (block) { + hasher.update(block); + } + block = hasher.update(password).finalize(salt); + hasher.reset(); + + // Iterations + for (var i = 1; i < iterations; i++) { + block = hasher.finalize(block); + hasher.reset(); + } + + derivedKey.concat(block); + } + derivedKey.sigBytes = keySize * 4; + + return derivedKey; + } + }); + + /** + * Derives a key from a password. + * + * @param {WordArray|string} password The password. + * @param {WordArray|string} salt A salt. + * @param {Object} cfg (Optional) The configuration options to use for this computation. + * + * @return {WordArray} The derived key. + * + * @static + * + * @example + * + * var key = CryptoJS.EvpKDF(password, salt); + * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 }); + * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 }); + */ + C.EvpKDF = function (password, salt, cfg) { + return EvpKDF.create(cfg).compute(password, salt); + }; + }()); + + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var SHA256 = C_algo.SHA256; + + /** + * SHA-224 hash algorithm. + */ + var SHA224 = C_algo.SHA224 = SHA256.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, + 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 + ]); + }, + + _doFinalize: function () { + var hash = SHA256._doFinalize.call(this); + + hash.sigBytes -= 4; + + return hash; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA224('message'); + * var hash = CryptoJS.SHA224(wordArray); + */ + C.SHA224 = SHA256._createHelper(SHA224); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA224(message, key); + */ + C.HmacSHA224 = SHA256._createHmacHelper(SHA224); + }()); + + + (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var X32WordArray = C_lib.WordArray; + + /** + * x64 namespace. + */ + var C_x64 = C.x64 = {}; + + /** + * A 64-bit word. + */ + var X64Word = C_x64.Word = Base.extend({ + /** + * Initializes a newly created 64-bit word. + * + * @param {number} high The high 32 bits. + * @param {number} low The low 32 bits. + * + * @example + * + * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607); + */ + init: function (high, low) { + this.high = high; + this.low = low; + } + + /** + * Bitwise NOTs this word. + * + * @return {X64Word} A new x64-Word object after negating. + * + * @example + * + * var negated = x64Word.not(); + */ + // not: function () { + // var high = ~this.high; + // var low = ~this.low; + + // return X64Word.create(high, low); + // }, + + /** + * Bitwise ANDs this word with the passed word. + * + * @param {X64Word} word The x64-Word to AND with this word. + * + * @return {X64Word} A new x64-Word object after ANDing. + * + * @example + * + * var anded = x64Word.and(anotherX64Word); + */ + // and: function (word) { + // var high = this.high & word.high; + // var low = this.low & word.low; + + // return X64Word.create(high, low); + // }, + + /** + * Bitwise ORs this word with the passed word. + * + * @param {X64Word} word The x64-Word to OR with this word. + * + * @return {X64Word} A new x64-Word object after ORing. + * + * @example + * + * var ored = x64Word.or(anotherX64Word); + */ + // or: function (word) { + // var high = this.high | word.high; + // var low = this.low | word.low; + + // return X64Word.create(high, low); + // }, + + /** + * Bitwise XORs this word with the passed word. + * + * @param {X64Word} word The x64-Word to XOR with this word. + * + * @return {X64Word} A new x64-Word object after XORing. + * + * @example + * + * var xored = x64Word.xor(anotherX64Word); + */ + // xor: function (word) { + // var high = this.high ^ word.high; + // var low = this.low ^ word.low; + + // return X64Word.create(high, low); + // }, + + /** + * Shifts this word n bits to the left. + * + * @param {number} n The number of bits to shift. + * + * @return {X64Word} A new x64-Word object after shifting. + * + * @example + * + * var shifted = x64Word.shiftL(25); + */ + // shiftL: function (n) { + // if (n < 32) { + // var high = (this.high << n) | (this.low >>> (32 - n)); + // var low = this.low << n; + // } else { + // var high = this.low << (n - 32); + // var low = 0; + // } + + // return X64Word.create(high, low); + // }, + + /** + * Shifts this word n bits to the right. + * + * @param {number} n The number of bits to shift. + * + * @return {X64Word} A new x64-Word object after shifting. + * + * @example + * + * var shifted = x64Word.shiftR(7); + */ + // shiftR: function (n) { + // if (n < 32) { + // var low = (this.low >>> n) | (this.high << (32 - n)); + // var high = this.high >>> n; + // } else { + // var low = this.high >>> (n - 32); + // var high = 0; + // } + + // return X64Word.create(high, low); + // }, + + /** + * Rotates this word n bits to the left. + * + * @param {number} n The number of bits to rotate. + * + * @return {X64Word} A new x64-Word object after rotating. + * + * @example + * + * var rotated = x64Word.rotL(25); + */ + // rotL: function (n) { + // return this.shiftL(n).or(this.shiftR(64 - n)); + // }, + + /** + * Rotates this word n bits to the right. + * + * @param {number} n The number of bits to rotate. + * + * @return {X64Word} A new x64-Word object after rotating. + * + * @example + * + * var rotated = x64Word.rotR(7); + */ + // rotR: function (n) { + // return this.shiftR(n).or(this.shiftL(64 - n)); + // }, + + /** + * Adds this word with the passed word. + * + * @param {X64Word} word The x64-Word to add with this word. + * + * @return {X64Word} A new x64-Word object after adding. + * + * @example + * + * var added = x64Word.add(anotherX64Word); + */ + // add: function (word) { + // var low = (this.low + word.low) | 0; + // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; + // var high = (this.high + word.high + carry) | 0; + + // return X64Word.create(high, low); + // } + }); + + /** + * An array of 64-bit words. + * + * @property {Array} words The array of CryptoJS.x64.Word objects. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var X64WordArray = C_x64.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.x64.WordArray.create(); + * + * var wordArray = CryptoJS.x64.WordArray.create([ + * CryptoJS.x64.Word.create(0x00010203, 0x04050607), + * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) + * ]); + * + * var wordArray = CryptoJS.x64.WordArray.create([ + * CryptoJS.x64.Word.create(0x00010203, 0x04050607), + * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) + * ], 10); + */ + init: function (words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 8; + } + }, + + /** + * Converts this 64-bit word array to a 32-bit word array. + * + * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. + * + * @example + * + * var x32WordArray = x64WordArray.toX32(); + */ + toX32: function () { + // Shortcuts + var x64Words = this.words; + var x64WordsLength = x64Words.length; + + // Convert + var x32Words = []; + for (var i = 0; i < x64WordsLength; i++) { + var x64Word = x64Words[i]; + x32Words.push(x64Word.high); + x32Words.push(x64Word.low); + } + + return X32WordArray.create(x32Words, this.sigBytes); + }, + + /** + * Creates a copy of this word array. + * + * @return {X64WordArray} The clone. + * + * @example + * + * var clone = x64WordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + + // Clone "words" array + var words = clone.words = this.words.slice(0); + + // Clone each X64Word object + var wordsLength = words.length; + for (var i = 0; i < wordsLength; i++) { + words[i] = words[i].clone(); + } + + return clone; + } + }); + }()); + + + (function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var C_algo = C.algo; + + // Constants tables + var RHO_OFFSETS = []; + var PI_INDEXES = []; + var ROUND_CONSTANTS = []; + + // Compute Constants + (function () { + // Compute rho offset constants + var x = 1, y = 0; + for (var t = 0; t < 24; t++) { + RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64; + + var newX = y % 5; + var newY = (2 * x + 3 * y) % 5; + x = newX; + y = newY; + } + + // Compute pi index constants + for (var x = 0; x < 5; x++) { + for (var y = 0; y < 5; y++) { + PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5; + } + } + + // Compute round constants + var LFSR = 0x01; + for (var i = 0; i < 24; i++) { + var roundConstantMsw = 0; + var roundConstantLsw = 0; + + for (var j = 0; j < 7; j++) { + if (LFSR & 0x01) { + var bitPosition = (1 << j) - 1; + if (bitPosition < 32) { + roundConstantLsw ^= 1 << bitPosition; + } else /* if (bitPosition >= 32) */ { + roundConstantMsw ^= 1 << (bitPosition - 32); + } + } + + // Compute next LFSR + if (LFSR & 0x80) { + // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1 + LFSR = (LFSR << 1) ^ 0x71; + } else { + LFSR <<= 1; + } + } + + ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); + } + }()); + + // Reusable objects for temporary values + var T = []; + (function () { + for (var i = 0; i < 25; i++) { + T[i] = X64Word.create(); + } + }()); + + /** + * SHA-3 hash algorithm. + */ + var SHA3 = C_algo.SHA3 = Hasher.extend({ + /** + * Configuration options. + * + * @property {number} outputLength + * The desired number of bits in the output hash. + * Only values permitted are: 224, 256, 384, 512. + * Default: 512 + */ + cfg: Hasher.cfg.extend({ + outputLength: 512 + }), + + _doReset: function () { + var state = this._state = [] + for (var i = 0; i < 25; i++) { + state[i] = new X64Word.init(); + } + + this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; + }, + + _doProcessBlock: function (M, offset) { + // Shortcuts + var state = this._state; + var nBlockSizeLanes = this.blockSize / 2; + + // Absorb + for (var i = 0; i < nBlockSizeLanes; i++) { + // Shortcuts + var M2i = M[offset + 2 * i]; + var M2i1 = M[offset + 2 * i + 1]; + + // Swap endian + M2i = ( + (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) | + (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00) + ); + M2i1 = ( + (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) | + (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00) + ); + + // Absorb message into state + var lane = state[i]; + lane.high ^= M2i1; + lane.low ^= M2i; + } + + // Rounds + for (var round = 0; round < 24; round++) { + // Theta + for (var x = 0; x < 5; x++) { + // Mix column lanes + var tMsw = 0, tLsw = 0; + for (var y = 0; y < 5; y++) { + var lane = state[x + 5 * y]; + tMsw ^= lane.high; + tLsw ^= lane.low; + } + + // Temporary values + var Tx = T[x]; + Tx.high = tMsw; + Tx.low = tLsw; + } + for (var x = 0; x < 5; x++) { + // Shortcuts + var Tx4 = T[(x + 4) % 5]; + var Tx1 = T[(x + 1) % 5]; + var Tx1Msw = Tx1.high; + var Tx1Lsw = Tx1.low; + + // Mix surrounding columns + var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31)); + var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31)); + for (var y = 0; y < 5; y++) { + var lane = state[x + 5 * y]; + lane.high ^= tMsw; + lane.low ^= tLsw; + } + } + + // Rho Pi + for (var laneIndex = 1; laneIndex < 25; laneIndex++) { + var tMsw; + var tLsw; + + // Shortcuts + var lane = state[laneIndex]; + var laneMsw = lane.high; + var laneLsw = lane.low; + var rhoOffset = RHO_OFFSETS[laneIndex]; + + // Rotate lanes + if (rhoOffset < 32) { + tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset)); + tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset)); + } else /* if (rhoOffset >= 32) */ { + tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset)); + tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset)); + } + + // Transpose lanes + var TPiLane = T[PI_INDEXES[laneIndex]]; + TPiLane.high = tMsw; + TPiLane.low = tLsw; + } + + // Rho pi at x = y = 0 + var T0 = T[0]; + var state0 = state[0]; + T0.high = state0.high; + T0.low = state0.low; + + // Chi + for (var x = 0; x < 5; x++) { + for (var y = 0; y < 5; y++) { + // Shortcuts + var laneIndex = x + 5 * y; + var lane = state[laneIndex]; + var TLane = T[laneIndex]; + var Tx1Lane = T[((x + 1) % 5) + 5 * y]; + var Tx2Lane = T[((x + 2) % 5) + 5 * y]; + + // Mix rows + lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high); + lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low); + } + } + + // Iota + var lane = state[0]; + var roundConstant = ROUND_CONSTANTS[round]; + lane.high ^= roundConstant.high; + lane.low ^= roundConstant.low; + } + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + var blockSizeBits = this.blockSize * 32; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32); + dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Shortcuts + var state = this._state; + var outputLengthBytes = this.cfg.outputLength / 8; + var outputLengthLanes = outputLengthBytes / 8; + + // Squeeze + var hashWords = []; + for (var i = 0; i < outputLengthLanes; i++) { + // Shortcuts + var lane = state[i]; + var laneMsw = lane.high; + var laneLsw = lane.low; + + // Swap endian + laneMsw = ( + (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) | + (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00) + ); + laneLsw = ( + (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) | + (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00) + ); + + // Squeeze state to retrieve hash + hashWords.push(laneLsw); + hashWords.push(laneMsw); + } + + // Return final computed hash + return new WordArray.init(hashWords, outputLengthBytes); + }, + + clone: function () { + var clone = Hasher.clone.call(this); + + var state = clone._state = this._state.slice(0); + for (var i = 0; i < 25; i++) { + state[i] = state[i].clone(); + } + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA3('message'); + * var hash = CryptoJS.SHA3(wordArray); + */ + C.SHA3 = Hasher._createHelper(SHA3); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA3(message, key); + */ + C.HmacSHA3 = Hasher._createHmacHelper(SHA3); + }(Math)); + + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + + function X64Word_create() { + return X64Word.create.apply(X64Word, arguments); + } + + // Constants + var K = [ + X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), + X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), + X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), + X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), + X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), + X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), + X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), + X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), + X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), + X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), + X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), + X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), + X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), + X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), + X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), + X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), + X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), + X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), + X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), + X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), + X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), + X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), + X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), + X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), + X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), + X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), + X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), + X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), + X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), + X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), + X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), + X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), + X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), + X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), + X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), + X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), + X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), + X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), + X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), + X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817) + ]; + + // Reusable objects + var W = []; + (function () { + for (var i = 0; i < 80; i++) { + W[i] = X64Word_create(); + } + }()); + + /** + * SHA-512 hash algorithm. + */ + var SHA512 = C_algo.SHA512 = Hasher.extend({ + _doReset: function () { + this._hash = new X64WordArray.init([ + new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), + new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), + new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), + new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179) + ]); + }, + + _doProcessBlock: function (M, offset) { + // Shortcuts + var H = this._hash.words; + + var H0 = H[0]; + var H1 = H[1]; + var H2 = H[2]; + var H3 = H[3]; + var H4 = H[4]; + var H5 = H[5]; + var H6 = H[6]; + var H7 = H[7]; + + var H0h = H0.high; + var H0l = H0.low; + var H1h = H1.high; + var H1l = H1.low; + var H2h = H2.high; + var H2l = H2.low; + var H3h = H3.high; + var H3l = H3.low; + var H4h = H4.high; + var H4l = H4.low; + var H5h = H5.high; + var H5l = H5.low; + var H6h = H6.high; + var H6l = H6.low; + var H7h = H7.high; + var H7l = H7.low; + + // Working variables + var ah = H0h; + var al = H0l; + var bh = H1h; + var bl = H1l; + var ch = H2h; + var cl = H2l; + var dh = H3h; + var dl = H3l; + var eh = H4h; + var el = H4l; + var fh = H5h; + var fl = H5l; + var gh = H6h; + var gl = H6l; + var hh = H7h; + var hl = H7l; + + // Rounds + for (var i = 0; i < 80; i++) { + var Wil; + var Wih; + + // Shortcut + var Wi = W[i]; + + // Extend message + if (i < 16) { + Wih = Wi.high = M[offset + i * 2] | 0; + Wil = Wi.low = M[offset + i * 2 + 1] | 0; + } else { + // Gamma0 + var gamma0x = W[i - 15]; + var gamma0xh = gamma0x.high; + var gamma0xl = gamma0x.low; + var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7); + var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25)); + + // Gamma1 + var gamma1x = W[i - 2]; + var gamma1xh = gamma1x.high; + var gamma1xl = gamma1x.low; + var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6); + var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26)); + + // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] + var Wi7 = W[i - 7]; + var Wi7h = Wi7.high; + var Wi7l = Wi7.low; + + var Wi16 = W[i - 16]; + var Wi16h = Wi16.high; + var Wi16l = Wi16.low; + + Wil = gamma0l + Wi7l; + Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0); + Wil = Wil + gamma1l; + Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0); + Wil = Wil + Wi16l; + Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0); + + Wi.high = Wih; + Wi.low = Wil; + } + + var chh = (eh & fh) ^ (~eh & gh); + var chl = (el & fl) ^ (~el & gl); + var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); + var majl = (al & bl) ^ (al & cl) ^ (bl & cl); + + var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); + var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); + var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9)); + var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)); + + // t1 = h + sigma1 + ch + K[i] + W[i] + var Ki = K[i]; + var Kih = Ki.high; + var Kil = Ki.low; + + var t1l = hl + sigma1l; + var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); + var t1l = t1l + chl; + var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); + var t1l = t1l + Kil; + var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0); + var t1l = t1l + Wil; + var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0); + + // t2 = sigma0 + maj + var t2l = sigma0l + majl; + var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); + + // Update working variables + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + el = (dl + t1l) | 0; + eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + al = (t1l + t2l) | 0; + ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; + } + + // Intermediate hash value + H0l = H0.low = (H0l + al); + H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)); + H1l = H1.low = (H1l + bl); + H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)); + H2l = H2.low = (H2l + cl); + H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)); + H3l = H3.low = (H3l + dl); + H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)); + H4l = H4.low = (H4l + el); + H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)); + H5l = H5.low = (H5l + fl); + H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)); + H6l = H6.low = (H6l + gl); + H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)); + H7l = H7.low = (H7l + hl); + H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)); + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Convert hash to 32-bit word array before returning + var hash = this._hash.toX32(); + + // Return final computed hash + return hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + }, + + blockSize: 1024/32 + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA512('message'); + * var hash = CryptoJS.SHA512(wordArray); + */ + C.SHA512 = Hasher._createHelper(SHA512); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA512(message, key); + */ + C.HmacSHA512 = Hasher._createHmacHelper(SHA512); + }()); + + + (function () { + // Shortcuts + var C = CryptoJS; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + var SHA512 = C_algo.SHA512; + + /** + * SHA-384 hash algorithm. + */ + var SHA384 = C_algo.SHA384 = SHA512.extend({ + _doReset: function () { + this._hash = new X64WordArray.init([ + new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), + new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), + new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), + new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4) + ]); + }, + + _doFinalize: function () { + var hash = SHA512._doFinalize.call(this); + + hash.sigBytes -= 16; + + return hash; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA384('message'); + * var hash = CryptoJS.SHA384(wordArray); + */ + C.SHA384 = SHA512._createHelper(SHA384); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA384(message, key); + */ + C.HmacSHA384 = SHA512._createHmacHelper(SHA384); + }()); + + + /** + * Cipher core components. + */ + CryptoJS.lib.Cipher || (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var Base64 = C_enc.Base64; + var C_algo = C.algo; + var EvpKDF = C_algo.EvpKDF; + + /** + * Abstract base cipher template. + * + * @property {number} keySize This cipher's key size. Default: 4 (128 bits) + * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) + * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. + * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. + */ + var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + * + * @property {WordArray} iv The IV to use for this operation. + */ + cfg: Base.extend(), + + /** + * Creates this cipher in encryption mode. + * + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {Cipher} A cipher instance. + * + * @static + * + * @example + * + * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); + */ + createEncryptor: function (key, cfg) { + return this.create(this._ENC_XFORM_MODE, key, cfg); + }, + + /** + * Creates this cipher in decryption mode. + * + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {Cipher} A cipher instance. + * + * @static + * + * @example + * + * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); + */ + createDecryptor: function (key, cfg) { + return this.create(this._DEC_XFORM_MODE, key, cfg); + }, + + /** + * Initializes a newly created cipher. + * + * @param {number} xformMode Either the encryption or decryption transormation mode constant. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @example + * + * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); + */ + init: function (xformMode, key, cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); + + // Store transform mode and key + this._xformMode = xformMode; + this._key = key; + + // Set initial values + this.reset(); + }, + + /** + * Resets this cipher to its initial state. + * + * @example + * + * cipher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); + + // Perform concrete-cipher logic + this._doReset(); + }, + + /** + * Adds data to be encrypted or decrypted. + * + * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. + * + * @return {WordArray} The data after processing. + * + * @example + * + * var encrypted = cipher.process('data'); + * var encrypted = cipher.process(wordArray); + */ + process: function (dataUpdate) { + // Append + this._append(dataUpdate); + + // Process available blocks + return this._process(); + }, + + /** + * Finalizes the encryption or decryption process. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. + * + * @return {WordArray} The data after final processing. + * + * @example + * + * var encrypted = cipher.finalize(); + * var encrypted = cipher.finalize('data'); + * var encrypted = cipher.finalize(wordArray); + */ + finalize: function (dataUpdate) { + // Final data update + if (dataUpdate) { + this._append(dataUpdate); + } + + // Perform concrete-cipher logic + var finalProcessedData = this._doFinalize(); + + return finalProcessedData; + }, + + keySize: 128/32, + + ivSize: 128/32, + + _ENC_XFORM_MODE: 1, + + _DEC_XFORM_MODE: 2, + + /** + * Creates shortcut functions to a cipher's object interface. + * + * @param {Cipher} cipher The cipher to create a helper for. + * + * @return {Object} An object with encrypt and decrypt shortcut functions. + * + * @static + * + * @example + * + * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); + */ + _createHelper: (function () { + function selectCipherStrategy(key) { + if (typeof key == 'string') { + return PasswordBasedCipher; + } else { + return SerializableCipher; + } + } + + return function (cipher) { + return { + encrypt: function (message, key, cfg) { + return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); + }, + + decrypt: function (ciphertext, key, cfg) { + return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); + } + }; + }; + }()) + }); + + /** + * Abstract base stream cipher template. + * + * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) + */ + var StreamCipher = C_lib.StreamCipher = Cipher.extend({ + _doFinalize: function () { + // Process partial blocks + var finalProcessedBlocks = this._process(!!'flush'); + + return finalProcessedBlocks; + }, + + blockSize: 1 + }); + + /** + * Mode namespace. + */ + var C_mode = C.mode = {}; + + /** + * Abstract base block cipher mode template. + */ + var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ + /** + * Creates this mode for encryption. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @static + * + * @example + * + * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); + */ + createEncryptor: function (cipher, iv) { + return this.Encryptor.create(cipher, iv); + }, + + /** + * Creates this mode for decryption. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @static + * + * @example + * + * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); + */ + createDecryptor: function (cipher, iv) { + return this.Decryptor.create(cipher, iv); + }, + + /** + * Initializes a newly created mode. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @example + * + * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); + */ + init: function (cipher, iv) { + this._cipher = cipher; + this._iv = iv; + } + }); + + /** + * Cipher Block Chaining mode. + */ + var CBC = C_mode.CBC = (function () { + /** + * Abstract base CBC mode. + */ + var CBC = BlockCipherMode.extend(); + + /** + * CBC encryptor. + */ + CBC.Encryptor = CBC.extend({ + /** + * Processes the data block at offset. + * + * @param {Array} words The data words to operate on. + * @param {number} offset The offset where the block starts. + * + * @example + * + * mode.processBlock(data.words, offset); + */ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // XOR and encrypt + xorBlock.call(this, words, offset, blockSize); + cipher.encryptBlock(words, offset); + + // Remember this block to use with next block + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); + + /** + * CBC decryptor. + */ + CBC.Decryptor = CBC.extend({ + /** + * Processes the data block at offset. + * + * @param {Array} words The data words to operate on. + * @param {number} offset The offset where the block starts. + * + * @example + * + * mode.processBlock(data.words, offset); + */ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // Remember this block to use with next block + var thisBlock = words.slice(offset, offset + blockSize); + + // Decrypt and XOR + cipher.decryptBlock(words, offset); + xorBlock.call(this, words, offset, blockSize); + + // This block becomes the previous block + this._prevBlock = thisBlock; + } + }); + + function xorBlock(words, offset, blockSize) { + var block; + + // Shortcut + var iv = this._iv; + + // Choose mixing block + if (iv) { + block = iv; + + // Remove IV for subsequent blocks + this._iv = undefined; + } else { + block = this._prevBlock; + } + + // XOR blocks + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= block[i]; + } + } + + return CBC; + }()); + + /** + * Padding namespace. + */ + var C_pad = C.pad = {}; + + /** + * PKCS #5/7 padding strategy. + */ + var Pkcs7 = C_pad.Pkcs7 = { + /** + * Pads data using the algorithm defined in PKCS #5/7. + * + * @param {WordArray} data The data to pad. + * @param {number} blockSize The multiple that the data should be padded to. + * + * @static + * + * @example + * + * CryptoJS.pad.Pkcs7.pad(wordArray, 4); + */ + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + + // Create padding word + var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes; + + // Create padding + var paddingWords = []; + for (var i = 0; i < nPaddingBytes; i += 4) { + paddingWords.push(paddingWord); + } + var padding = WordArray.create(paddingWords, nPaddingBytes); + + // Add padding + data.concat(padding); + }, + + /** + * Unpads data that had been padded using the algorithm defined in PKCS #5/7. + * + * @param {WordArray} data The data to unpad. + * + * @static + * + * @example + * + * CryptoJS.pad.Pkcs7.unpad(wordArray); + */ + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + /** + * Abstract base block cipher template. + * + * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) + */ + var BlockCipher = C_lib.BlockCipher = Cipher.extend({ + /** + * Configuration options. + * + * @property {Mode} mode The block mode to use. Default: CBC + * @property {Padding} padding The padding strategy to use. Default: Pkcs7 + */ + cfg: Cipher.cfg.extend({ + mode: CBC, + padding: Pkcs7 + }), + + reset: function () { + var modeCreator; + + // Reset cipher + Cipher.reset.call(this); + + // Shortcuts + var cfg = this.cfg; + var iv = cfg.iv; + var mode = cfg.mode; + + // Reset block mode + if (this._xformMode == this._ENC_XFORM_MODE) { + modeCreator = mode.createEncryptor; + } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { + modeCreator = mode.createDecryptor; + // Keep at least one block in the buffer for unpadding + this._minBufferSize = 1; + } + + if (this._mode && this._mode.__creator == modeCreator) { + this._mode.init(this, iv && iv.words); + } else { + this._mode = modeCreator.call(mode, this, iv && iv.words); + this._mode.__creator = modeCreator; + } + }, + + _doProcessBlock: function (words, offset) { + this._mode.processBlock(words, offset); + }, + + _doFinalize: function () { + var finalProcessedBlocks; + + // Shortcut + var padding = this.cfg.padding; + + // Finalize + if (this._xformMode == this._ENC_XFORM_MODE) { + // Pad data + padding.pad(this._data, this.blockSize); + + // Process final blocks + finalProcessedBlocks = this._process(!!'flush'); + } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { + // Process final blocks + finalProcessedBlocks = this._process(!!'flush'); + + // Unpad data + padding.unpad(finalProcessedBlocks); + } + + return finalProcessedBlocks; + }, + + blockSize: 128/32 + }); + + /** + * A collection of cipher parameters. + * + * @property {WordArray} ciphertext The raw ciphertext. + * @property {WordArray} key The key to this ciphertext. + * @property {WordArray} iv The IV used in the ciphering operation. + * @property {WordArray} salt The salt used with a key derivation function. + * @property {Cipher} algorithm The cipher algorithm. + * @property {Mode} mode The block mode used in the ciphering operation. + * @property {Padding} padding The padding scheme used in the ciphering operation. + * @property {number} blockSize The block size of the cipher. + * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. + */ + var CipherParams = C_lib.CipherParams = Base.extend({ + /** + * Initializes a newly created cipher params object. + * + * @param {Object} cipherParams An object with any of the possible cipher parameters. + * + * @example + * + * var cipherParams = CryptoJS.lib.CipherParams.create({ + * ciphertext: ciphertextWordArray, + * key: keyWordArray, + * iv: ivWordArray, + * salt: saltWordArray, + * algorithm: CryptoJS.algo.AES, + * mode: CryptoJS.mode.CBC, + * padding: CryptoJS.pad.PKCS7, + * blockSize: 4, + * formatter: CryptoJS.format.OpenSSL + * }); + */ + init: function (cipherParams) { + this.mixIn(cipherParams); + }, + + /** + * Converts this cipher params object to a string. + * + * @param {Format} formatter (Optional) The formatting strategy to use. + * + * @return {string} The stringified cipher params. + * + * @throws Error If neither the formatter nor the default formatter is set. + * + * @example + * + * var string = cipherParams + ''; + * var string = cipherParams.toString(); + * var string = cipherParams.toString(CryptoJS.format.OpenSSL); + */ + toString: function (formatter) { + return (formatter || this.formatter).stringify(this); + } + }); + + /** + * Format namespace. + */ + var C_format = C.format = {}; + + /** + * OpenSSL formatting strategy. + */ + var OpenSSLFormatter = C_format.OpenSSL = { + /** + * Converts a cipher params object to an OpenSSL-compatible string. + * + * @param {CipherParams} cipherParams The cipher params object. + * + * @return {string} The OpenSSL-compatible string. + * + * @static + * + * @example + * + * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); + */ + stringify: function (cipherParams) { + var wordArray; + + // Shortcuts + var ciphertext = cipherParams.ciphertext; + var salt = cipherParams.salt; + + // Format + if (salt) { + wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); + } else { + wordArray = ciphertext; + } + + return wordArray.toString(Base64); + }, + + /** + * Converts an OpenSSL-compatible string to a cipher params object. + * + * @param {string} openSSLStr The OpenSSL-compatible string. + * + * @return {CipherParams} The cipher params object. + * + * @static + * + * @example + * + * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); + */ + parse: function (openSSLStr) { + var salt; + + // Parse base64 + var ciphertext = Base64.parse(openSSLStr); + + // Shortcut + var ciphertextWords = ciphertext.words; + + // Test for salt + if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { + // Extract salt + salt = WordArray.create(ciphertextWords.slice(2, 4)); + + // Remove salt from ciphertext + ciphertextWords.splice(0, 4); + ciphertext.sigBytes -= 16; + } + + return CipherParams.create({ ciphertext: ciphertext, salt: salt }); + } + }; + + /** + * A cipher wrapper that returns ciphertext as a serializable cipher params object. + */ + var SerializableCipher = C_lib.SerializableCipher = Base.extend({ + /** + * Configuration options. + * + * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL + */ + cfg: Base.extend({ + format: OpenSSLFormatter + }), + + /** + * Encrypts a message. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {WordArray|string} message The message to encrypt. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {CipherParams} A cipher params object. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + */ + encrypt: function (cipher, message, key, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Encrypt + var encryptor = cipher.createEncryptor(key, cfg); + var ciphertext = encryptor.finalize(message); + + // Shortcut + var cipherCfg = encryptor.cfg; + + // Create and return serializable cipher params + return CipherParams.create({ + ciphertext: ciphertext, + key: key, + iv: cipherCfg.iv, + algorithm: cipher, + mode: cipherCfg.mode, + padding: cipherCfg.padding, + blockSize: cipher.blockSize, + formatter: cfg.format + }); + }, + + /** + * Decrypts serialized ciphertext. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {CipherParams|string} ciphertext The ciphertext to decrypt. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {WordArray} The plaintext. + * + * @static + * + * @example + * + * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + */ + decrypt: function (cipher, ciphertext, key, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Convert string to CipherParams + ciphertext = this._parse(ciphertext, cfg.format); + + // Decrypt + var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); + + return plaintext; + }, + + /** + * Converts serialized ciphertext to CipherParams, + * else assumed CipherParams already and returns ciphertext unchanged. + * + * @param {CipherParams|string} ciphertext The ciphertext. + * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. + * + * @return {CipherParams} The unserialized ciphertext. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); + */ + _parse: function (ciphertext, format) { + if (typeof ciphertext == 'string') { + return format.parse(ciphertext, this); + } else { + return ciphertext; + } + } + }); + + /** + * Key derivation function namespace. + */ + var C_kdf = C.kdf = {}; + + /** + * OpenSSL key derivation function. + */ + var OpenSSLKdf = C_kdf.OpenSSL = { + /** + * Derives a key and IV from a password. + * + * @param {string} password The password to derive from. + * @param {number} keySize The size in words of the key to generate. + * @param {number} ivSize The size in words of the IV to generate. + * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. + * + * @return {CipherParams} A cipher params object with the key, IV, and salt. + * + * @static + * + * @example + * + * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); + * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); + */ + execute: function (password, keySize, ivSize, salt) { + // Generate random salt + if (!salt) { + salt = WordArray.random(64/8); + } + + // Derive key and IV + var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); + + // Separate key and IV + var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); + key.sigBytes = keySize * 4; + + // Return params + return CipherParams.create({ key: key, iv: iv, salt: salt }); + } + }; + + /** + * A serializable cipher wrapper that derives the key from a password, + * and returns ciphertext as a serializable cipher params object. + */ + var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ + /** + * Configuration options. + * + * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL + */ + cfg: SerializableCipher.cfg.extend({ + kdf: OpenSSLKdf + }), + + /** + * Encrypts a message using a password. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {WordArray|string} message The message to encrypt. + * @param {string} password The password. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {CipherParams} A cipher params object. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); + * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); + */ + encrypt: function (cipher, message, password, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Derive key and other params + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize); + + // Add IV to config + cfg.iv = derivedParams.iv; + + // Encrypt + var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); + + // Mix in derived params + ciphertext.mixIn(derivedParams); + + return ciphertext; + }, + + /** + * Decrypts serialized ciphertext using a password. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {CipherParams|string} ciphertext The ciphertext to decrypt. + * @param {string} password The password. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {WordArray} The plaintext. + * + * @static + * + * @example + * + * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); + * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); + */ + decrypt: function (cipher, ciphertext, password, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Convert string to CipherParams + ciphertext = this._parse(ciphertext, cfg.format); + + // Derive key and other params + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt); + + // Add IV to config + cfg.iv = derivedParams.iv; + + // Decrypt + var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); + + return plaintext; + } + }); + }()); + + + /** + * Cipher Feedback block mode. + */ + CryptoJS.mode.CFB = (function () { + var CFB = CryptoJS.lib.BlockCipherMode.extend(); + + CFB.Encryptor = CFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); + + // Remember this block to use with next block + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); + + CFB.Decryptor = CFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // Remember this block to use with next block + var thisBlock = words.slice(offset, offset + blockSize); + + generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); + + // This block becomes the previous block + this._prevBlock = thisBlock; + } + }); + + function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { + var keystream; + + // Shortcut + var iv = this._iv; + + // Generate keystream + if (iv) { + keystream = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } else { + keystream = this._prevBlock; + } + cipher.encryptBlock(keystream, 0); + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + + return CFB; + }()); + + + /** + * Electronic Codebook block mode. + */ + CryptoJS.mode.ECB = (function () { + var ECB = CryptoJS.lib.BlockCipherMode.extend(); + + ECB.Encryptor = ECB.extend({ + processBlock: function (words, offset) { + this._cipher.encryptBlock(words, offset); + } + }); + + ECB.Decryptor = ECB.extend({ + processBlock: function (words, offset) { + this._cipher.decryptBlock(words, offset); + } + }); + + return ECB; + }()); + + + /** + * ANSI X.923 padding strategy. + */ + CryptoJS.pad.AnsiX923 = { + pad: function (data, blockSize) { + // Shortcuts + var dataSigBytes = data.sigBytes; + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; + + // Compute last byte position + var lastBytePos = dataSigBytes + nPaddingBytes - 1; + + // Pad + data.clamp(); + data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8); + data.sigBytes += nPaddingBytes; + }, + + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + + /** + * ISO 10126 padding strategy. + */ + CryptoJS.pad.Iso10126 = { + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + + // Pad + data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)). + concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); + }, + + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + + /** + * ISO/IEC 9797-1 Padding Method 2. + */ + CryptoJS.pad.Iso97971 = { + pad: function (data, blockSize) { + // Add 0x80 byte + data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); + + // Zero pad the rest + CryptoJS.pad.ZeroPadding.pad(data, blockSize); + }, + + unpad: function (data) { + // Remove zero padding + CryptoJS.pad.ZeroPadding.unpad(data); + + // Remove one more byte -- the 0x80 byte + data.sigBytes--; + } + }; + + + /** + * Output Feedback block mode. + */ + CryptoJS.mode.OFB = (function () { + var OFB = CryptoJS.lib.BlockCipherMode.extend(); + + var Encryptor = OFB.Encryptor = OFB.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var keystream = this._keystream; + + // Generate keystream + if (iv) { + keystream = this._keystream = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } + cipher.encryptBlock(keystream, 0); + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + + OFB.Decryptor = Encryptor; + + return OFB; + }()); + + + /** + * A noop padding strategy. + */ + CryptoJS.pad.NoPadding = { + pad: function () { + }, + + unpad: function () { + } + }; + + + (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var CipherParams = C_lib.CipherParams; + var C_enc = C.enc; + var Hex = C_enc.Hex; + var C_format = C.format; + + var HexFormatter = C_format.Hex = { + /** + * Converts the ciphertext of a cipher params object to a hexadecimally encoded string. + * + * @param {CipherParams} cipherParams The cipher params object. + * + * @return {string} The hexadecimally encoded string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.format.Hex.stringify(cipherParams); + */ + stringify: function (cipherParams) { + return cipherParams.ciphertext.toString(Hex); + }, + + /** + * Converts a hexadecimally encoded ciphertext string to a cipher params object. + * + * @param {string} input The hexadecimally encoded string. + * + * @return {CipherParams} The cipher params object. + * + * @static + * + * @example + * + * var cipherParams = CryptoJS.format.Hex.parse(hexString); + */ + parse: function (input) { + var ciphertext = Hex.parse(input); + return CipherParams.create({ ciphertext: ciphertext }); + } + }; + }()); + + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + + // Lookup tables + var SBOX = []; + var INV_SBOX = []; + var SUB_MIX_0 = []; + var SUB_MIX_1 = []; + var SUB_MIX_2 = []; + var SUB_MIX_3 = []; + var INV_SUB_MIX_0 = []; + var INV_SUB_MIX_1 = []; + var INV_SUB_MIX_2 = []; + var INV_SUB_MIX_3 = []; + + // Compute lookup tables + (function () { + // Compute double table + var d = []; + for (var i = 0; i < 256; i++) { + if (i < 128) { + d[i] = i << 1; + } else { + d[i] = (i << 1) ^ 0x11b; + } + } + + // Walk GF(2^8) + var x = 0; + var xi = 0; + for (var i = 0; i < 256; i++) { + // Compute sbox + var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4); + sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63; + SBOX[x] = sx; + INV_SBOX[sx] = x; + + // Compute multiplication + var x2 = d[x]; + var x4 = d[x2]; + var x8 = d[x4]; + + // Compute sub bytes, mix columns tables + var t = (d[sx] * 0x101) ^ (sx * 0x1010100); + SUB_MIX_0[x] = (t << 24) | (t >>> 8); + SUB_MIX_1[x] = (t << 16) | (t >>> 16); + SUB_MIX_2[x] = (t << 8) | (t >>> 24); + SUB_MIX_3[x] = t; + + // Compute inv sub bytes, inv mix columns tables + var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100); + INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8); + INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16); + INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24); + INV_SUB_MIX_3[sx] = t; + + // Compute next counter + if (!x) { + x = xi = 1; + } else { + x = x2 ^ d[d[d[x8 ^ x2]]]; + xi ^= d[d[xi]]; + } + } + }()); + + // Precomputed Rcon lookup + var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]; + + /** + * AES block cipher algorithm. + */ + var AES = C_algo.AES = BlockCipher.extend({ + _doReset: function () { + var t; + + // Skip reset of nRounds has been set before and key did not change + if (this._nRounds && this._keyPriorReset === this._key) { + return; + } + + // Shortcuts + var key = this._keyPriorReset = this._key; + var keyWords = key.words; + var keySize = key.sigBytes / 4; + + // Compute number of rounds + var nRounds = this._nRounds = keySize + 6; + + // Compute number of key schedule rows + var ksRows = (nRounds + 1) * 4; + + // Compute key schedule + var keySchedule = this._keySchedule = []; + for (var ksRow = 0; ksRow < ksRows; ksRow++) { + if (ksRow < keySize) { + keySchedule[ksRow] = keyWords[ksRow]; + } else { + t = keySchedule[ksRow - 1]; + + if (!(ksRow % keySize)) { + // Rot word + t = (t << 8) | (t >>> 24); + + // Sub word + t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; + + // Mix Rcon + t ^= RCON[(ksRow / keySize) | 0] << 24; + } else if (keySize > 6 && ksRow % keySize == 4) { + // Sub word + t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; + } + + keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; + } + } + + // Compute inv key schedule + var invKeySchedule = this._invKeySchedule = []; + for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { + var ksRow = ksRows - invKsRow; + + if (invKsRow % 4) { + var t = keySchedule[ksRow]; + } else { + var t = keySchedule[ksRow - 4]; + } + + if (invKsRow < 4 || ksRow <= 4) { + invKeySchedule[invKsRow] = t; + } else { + invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^ + INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]]; + } + } + }, + + encryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); + }, + + decryptBlock: function (M, offset) { + // Swap 2nd and 4th rows + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; + + this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); + + // Inv swap 2nd and 4th rows + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; + }, + + _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { + // Shortcut + var nRounds = this._nRounds; + + // Get input, add round key + var s0 = M[offset] ^ keySchedule[0]; + var s1 = M[offset + 1] ^ keySchedule[1]; + var s2 = M[offset + 2] ^ keySchedule[2]; + var s3 = M[offset + 3] ^ keySchedule[3]; + + // Key schedule row counter + var ksRow = 4; + + // Rounds + for (var round = 1; round < nRounds; round++) { + // Shift rows, sub bytes, mix columns, add round key + var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++]; + var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++]; + var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++]; + var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++]; + + // Update state + s0 = t0; + s1 = t1; + s2 = t2; + s3 = t3; + } + + // Shift rows, sub bytes, add round key + var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]; + var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]; + var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]; + var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]; + + // Set output + M[offset] = t0; + M[offset + 1] = t1; + M[offset + 2] = t2; + M[offset + 3] = t3; + }, + + keySize: 256/32 + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg); + */ + C.AES = BlockCipher._createHelper(AES); + }()); + + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + + // Permuted Choice 1 constants + var PC1 = [ + 57, 49, 41, 33, 25, 17, 9, 1, + 58, 50, 42, 34, 26, 18, 10, 2, + 59, 51, 43, 35, 27, 19, 11, 3, + 60, 52, 44, 36, 63, 55, 47, 39, + 31, 23, 15, 7, 62, 54, 46, 38, + 30, 22, 14, 6, 61, 53, 45, 37, + 29, 21, 13, 5, 28, 20, 12, 4 + ]; + + // Permuted Choice 2 constants + var PC2 = [ + 14, 17, 11, 24, 1, 5, + 3, 28, 15, 6, 21, 10, + 23, 19, 12, 4, 26, 8, + 16, 7, 27, 20, 13, 2, + 41, 52, 31, 37, 47, 55, + 30, 40, 51, 45, 33, 48, + 44, 49, 39, 56, 34, 53, + 46, 42, 50, 36, 29, 32 + ]; + + // Cumulative bit shift constants + var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; + + // SBOXes and round permutation constants + var SBOX_P = [ + { + 0x0: 0x808200, + 0x10000000: 0x8000, + 0x20000000: 0x808002, + 0x30000000: 0x2, + 0x40000000: 0x200, + 0x50000000: 0x808202, + 0x60000000: 0x800202, + 0x70000000: 0x800000, + 0x80000000: 0x202, + 0x90000000: 0x800200, + 0xa0000000: 0x8200, + 0xb0000000: 0x808000, + 0xc0000000: 0x8002, + 0xd0000000: 0x800002, + 0xe0000000: 0x0, + 0xf0000000: 0x8202, + 0x8000000: 0x0, + 0x18000000: 0x808202, + 0x28000000: 0x8202, + 0x38000000: 0x8000, + 0x48000000: 0x808200, + 0x58000000: 0x200, + 0x68000000: 0x808002, + 0x78000000: 0x2, + 0x88000000: 0x800200, + 0x98000000: 0x8200, + 0xa8000000: 0x808000, + 0xb8000000: 0x800202, + 0xc8000000: 0x800002, + 0xd8000000: 0x8002, + 0xe8000000: 0x202, + 0xf8000000: 0x800000, + 0x1: 0x8000, + 0x10000001: 0x2, + 0x20000001: 0x808200, + 0x30000001: 0x800000, + 0x40000001: 0x808002, + 0x50000001: 0x8200, + 0x60000001: 0x200, + 0x70000001: 0x800202, + 0x80000001: 0x808202, + 0x90000001: 0x808000, + 0xa0000001: 0x800002, + 0xb0000001: 0x8202, + 0xc0000001: 0x202, + 0xd0000001: 0x800200, + 0xe0000001: 0x8002, + 0xf0000001: 0x0, + 0x8000001: 0x808202, + 0x18000001: 0x808000, + 0x28000001: 0x800000, + 0x38000001: 0x200, + 0x48000001: 0x8000, + 0x58000001: 0x800002, + 0x68000001: 0x2, + 0x78000001: 0x8202, + 0x88000001: 0x8002, + 0x98000001: 0x800202, + 0xa8000001: 0x202, + 0xb8000001: 0x808200, + 0xc8000001: 0x800200, + 0xd8000001: 0x0, + 0xe8000001: 0x8200, + 0xf8000001: 0x808002 + }, + { + 0x0: 0x40084010, + 0x1000000: 0x4000, + 0x2000000: 0x80000, + 0x3000000: 0x40080010, + 0x4000000: 0x40000010, + 0x5000000: 0x40084000, + 0x6000000: 0x40004000, + 0x7000000: 0x10, + 0x8000000: 0x84000, + 0x9000000: 0x40004010, + 0xa000000: 0x40000000, + 0xb000000: 0x84010, + 0xc000000: 0x80010, + 0xd000000: 0x0, + 0xe000000: 0x4010, + 0xf000000: 0x40080000, + 0x800000: 0x40004000, + 0x1800000: 0x84010, + 0x2800000: 0x10, + 0x3800000: 0x40004010, + 0x4800000: 0x40084010, + 0x5800000: 0x40000000, + 0x6800000: 0x80000, + 0x7800000: 0x40080010, + 0x8800000: 0x80010, + 0x9800000: 0x0, + 0xa800000: 0x4000, + 0xb800000: 0x40080000, + 0xc800000: 0x40000010, + 0xd800000: 0x84000, + 0xe800000: 0x40084000, + 0xf800000: 0x4010, + 0x10000000: 0x0, + 0x11000000: 0x40080010, + 0x12000000: 0x40004010, + 0x13000000: 0x40084000, + 0x14000000: 0x40080000, + 0x15000000: 0x10, + 0x16000000: 0x84010, + 0x17000000: 0x4000, + 0x18000000: 0x4010, + 0x19000000: 0x80000, + 0x1a000000: 0x80010, + 0x1b000000: 0x40000010, + 0x1c000000: 0x84000, + 0x1d000000: 0x40004000, + 0x1e000000: 0x40000000, + 0x1f000000: 0x40084010, + 0x10800000: 0x84010, + 0x11800000: 0x80000, + 0x12800000: 0x40080000, + 0x13800000: 0x4000, + 0x14800000: 0x40004000, + 0x15800000: 0x40084010, + 0x16800000: 0x10, + 0x17800000: 0x40000000, + 0x18800000: 0x40084000, + 0x19800000: 0x40000010, + 0x1a800000: 0x40004010, + 0x1b800000: 0x80010, + 0x1c800000: 0x0, + 0x1d800000: 0x4010, + 0x1e800000: 0x40080010, + 0x1f800000: 0x84000 + }, + { + 0x0: 0x104, + 0x100000: 0x0, + 0x200000: 0x4000100, + 0x300000: 0x10104, + 0x400000: 0x10004, + 0x500000: 0x4000004, + 0x600000: 0x4010104, + 0x700000: 0x4010000, + 0x800000: 0x4000000, + 0x900000: 0x4010100, + 0xa00000: 0x10100, + 0xb00000: 0x4010004, + 0xc00000: 0x4000104, + 0xd00000: 0x10000, + 0xe00000: 0x4, + 0xf00000: 0x100, + 0x80000: 0x4010100, + 0x180000: 0x4010004, + 0x280000: 0x0, + 0x380000: 0x4000100, + 0x480000: 0x4000004, + 0x580000: 0x10000, + 0x680000: 0x10004, + 0x780000: 0x104, + 0x880000: 0x4, + 0x980000: 0x100, + 0xa80000: 0x4010000, + 0xb80000: 0x10104, + 0xc80000: 0x10100, + 0xd80000: 0x4000104, + 0xe80000: 0x4010104, + 0xf80000: 0x4000000, + 0x1000000: 0x4010100, + 0x1100000: 0x10004, + 0x1200000: 0x10000, + 0x1300000: 0x4000100, + 0x1400000: 0x100, + 0x1500000: 0x4010104, + 0x1600000: 0x4000004, + 0x1700000: 0x0, + 0x1800000: 0x4000104, + 0x1900000: 0x4000000, + 0x1a00000: 0x4, + 0x1b00000: 0x10100, + 0x1c00000: 0x4010000, + 0x1d00000: 0x104, + 0x1e00000: 0x10104, + 0x1f00000: 0x4010004, + 0x1080000: 0x4000000, + 0x1180000: 0x104, + 0x1280000: 0x4010100, + 0x1380000: 0x0, + 0x1480000: 0x10004, + 0x1580000: 0x4000100, + 0x1680000: 0x100, + 0x1780000: 0x4010004, + 0x1880000: 0x10000, + 0x1980000: 0x4010104, + 0x1a80000: 0x10104, + 0x1b80000: 0x4000004, + 0x1c80000: 0x4000104, + 0x1d80000: 0x4010000, + 0x1e80000: 0x4, + 0x1f80000: 0x10100 + }, + { + 0x0: 0x80401000, + 0x10000: 0x80001040, + 0x20000: 0x401040, + 0x30000: 0x80400000, + 0x40000: 0x0, + 0x50000: 0x401000, + 0x60000: 0x80000040, + 0x70000: 0x400040, + 0x80000: 0x80000000, + 0x90000: 0x400000, + 0xa0000: 0x40, + 0xb0000: 0x80001000, + 0xc0000: 0x80400040, + 0xd0000: 0x1040, + 0xe0000: 0x1000, + 0xf0000: 0x80401040, + 0x8000: 0x80001040, + 0x18000: 0x40, + 0x28000: 0x80400040, + 0x38000: 0x80001000, + 0x48000: 0x401000, + 0x58000: 0x80401040, + 0x68000: 0x0, + 0x78000: 0x80400000, + 0x88000: 0x1000, + 0x98000: 0x80401000, + 0xa8000: 0x400000, + 0xb8000: 0x1040, + 0xc8000: 0x80000000, + 0xd8000: 0x400040, + 0xe8000: 0x401040, + 0xf8000: 0x80000040, + 0x100000: 0x400040, + 0x110000: 0x401000, + 0x120000: 0x80000040, + 0x130000: 0x0, + 0x140000: 0x1040, + 0x150000: 0x80400040, + 0x160000: 0x80401000, + 0x170000: 0x80001040, + 0x180000: 0x80401040, + 0x190000: 0x80000000, + 0x1a0000: 0x80400000, + 0x1b0000: 0x401040, + 0x1c0000: 0x80001000, + 0x1d0000: 0x400000, + 0x1e0000: 0x40, + 0x1f0000: 0x1000, + 0x108000: 0x80400000, + 0x118000: 0x80401040, + 0x128000: 0x0, + 0x138000: 0x401000, + 0x148000: 0x400040, + 0x158000: 0x80000000, + 0x168000: 0x80001040, + 0x178000: 0x40, + 0x188000: 0x80000040, + 0x198000: 0x1000, + 0x1a8000: 0x80001000, + 0x1b8000: 0x80400040, + 0x1c8000: 0x1040, + 0x1d8000: 0x80401000, + 0x1e8000: 0x400000, + 0x1f8000: 0x401040 + }, + { + 0x0: 0x80, + 0x1000: 0x1040000, + 0x2000: 0x40000, + 0x3000: 0x20000000, + 0x4000: 0x20040080, + 0x5000: 0x1000080, + 0x6000: 0x21000080, + 0x7000: 0x40080, + 0x8000: 0x1000000, + 0x9000: 0x20040000, + 0xa000: 0x20000080, + 0xb000: 0x21040080, + 0xc000: 0x21040000, + 0xd000: 0x0, + 0xe000: 0x1040080, + 0xf000: 0x21000000, + 0x800: 0x1040080, + 0x1800: 0x21000080, + 0x2800: 0x80, + 0x3800: 0x1040000, + 0x4800: 0x40000, + 0x5800: 0x20040080, + 0x6800: 0x21040000, + 0x7800: 0x20000000, + 0x8800: 0x20040000, + 0x9800: 0x0, + 0xa800: 0x21040080, + 0xb800: 0x1000080, + 0xc800: 0x20000080, + 0xd800: 0x21000000, + 0xe800: 0x1000000, + 0xf800: 0x40080, + 0x10000: 0x40000, + 0x11000: 0x80, + 0x12000: 0x20000000, + 0x13000: 0x21000080, + 0x14000: 0x1000080, + 0x15000: 0x21040000, + 0x16000: 0x20040080, + 0x17000: 0x1000000, + 0x18000: 0x21040080, + 0x19000: 0x21000000, + 0x1a000: 0x1040000, + 0x1b000: 0x20040000, + 0x1c000: 0x40080, + 0x1d000: 0x20000080, + 0x1e000: 0x0, + 0x1f000: 0x1040080, + 0x10800: 0x21000080, + 0x11800: 0x1000000, + 0x12800: 0x1040000, + 0x13800: 0x20040080, + 0x14800: 0x20000000, + 0x15800: 0x1040080, + 0x16800: 0x80, + 0x17800: 0x21040000, + 0x18800: 0x40080, + 0x19800: 0x21040080, + 0x1a800: 0x0, + 0x1b800: 0x21000000, + 0x1c800: 0x1000080, + 0x1d800: 0x40000, + 0x1e800: 0x20040000, + 0x1f800: 0x20000080 + }, + { + 0x0: 0x10000008, + 0x100: 0x2000, + 0x200: 0x10200000, + 0x300: 0x10202008, + 0x400: 0x10002000, + 0x500: 0x200000, + 0x600: 0x200008, + 0x700: 0x10000000, + 0x800: 0x0, + 0x900: 0x10002008, + 0xa00: 0x202000, + 0xb00: 0x8, + 0xc00: 0x10200008, + 0xd00: 0x202008, + 0xe00: 0x2008, + 0xf00: 0x10202000, + 0x80: 0x10200000, + 0x180: 0x10202008, + 0x280: 0x8, + 0x380: 0x200000, + 0x480: 0x202008, + 0x580: 0x10000008, + 0x680: 0x10002000, + 0x780: 0x2008, + 0x880: 0x200008, + 0x980: 0x2000, + 0xa80: 0x10002008, + 0xb80: 0x10200008, + 0xc80: 0x0, + 0xd80: 0x10202000, + 0xe80: 0x202000, + 0xf80: 0x10000000, + 0x1000: 0x10002000, + 0x1100: 0x10200008, + 0x1200: 0x10202008, + 0x1300: 0x2008, + 0x1400: 0x200000, + 0x1500: 0x10000000, + 0x1600: 0x10000008, + 0x1700: 0x202000, + 0x1800: 0x202008, + 0x1900: 0x0, + 0x1a00: 0x8, + 0x1b00: 0x10200000, + 0x1c00: 0x2000, + 0x1d00: 0x10002008, + 0x1e00: 0x10202000, + 0x1f00: 0x200008, + 0x1080: 0x8, + 0x1180: 0x202000, + 0x1280: 0x200000, + 0x1380: 0x10000008, + 0x1480: 0x10002000, + 0x1580: 0x2008, + 0x1680: 0x10202008, + 0x1780: 0x10200000, + 0x1880: 0x10202000, + 0x1980: 0x10200008, + 0x1a80: 0x2000, + 0x1b80: 0x202008, + 0x1c80: 0x200008, + 0x1d80: 0x0, + 0x1e80: 0x10000000, + 0x1f80: 0x10002008 + }, + { + 0x0: 0x100000, + 0x10: 0x2000401, + 0x20: 0x400, + 0x30: 0x100401, + 0x40: 0x2100401, + 0x50: 0x0, + 0x60: 0x1, + 0x70: 0x2100001, + 0x80: 0x2000400, + 0x90: 0x100001, + 0xa0: 0x2000001, + 0xb0: 0x2100400, + 0xc0: 0x2100000, + 0xd0: 0x401, + 0xe0: 0x100400, + 0xf0: 0x2000000, + 0x8: 0x2100001, + 0x18: 0x0, + 0x28: 0x2000401, + 0x38: 0x2100400, + 0x48: 0x100000, + 0x58: 0x2000001, + 0x68: 0x2000000, + 0x78: 0x401, + 0x88: 0x100401, + 0x98: 0x2000400, + 0xa8: 0x2100000, + 0xb8: 0x100001, + 0xc8: 0x400, + 0xd8: 0x2100401, + 0xe8: 0x1, + 0xf8: 0x100400, + 0x100: 0x2000000, + 0x110: 0x100000, + 0x120: 0x2000401, + 0x130: 0x2100001, + 0x140: 0x100001, + 0x150: 0x2000400, + 0x160: 0x2100400, + 0x170: 0x100401, + 0x180: 0x401, + 0x190: 0x2100401, + 0x1a0: 0x100400, + 0x1b0: 0x1, + 0x1c0: 0x0, + 0x1d0: 0x2100000, + 0x1e0: 0x2000001, + 0x1f0: 0x400, + 0x108: 0x100400, + 0x118: 0x2000401, + 0x128: 0x2100001, + 0x138: 0x1, + 0x148: 0x2000000, + 0x158: 0x100000, + 0x168: 0x401, + 0x178: 0x2100400, + 0x188: 0x2000001, + 0x198: 0x2100000, + 0x1a8: 0x0, + 0x1b8: 0x2100401, + 0x1c8: 0x100401, + 0x1d8: 0x400, + 0x1e8: 0x2000400, + 0x1f8: 0x100001 + }, + { + 0x0: 0x8000820, + 0x1: 0x20000, + 0x2: 0x8000000, + 0x3: 0x20, + 0x4: 0x20020, + 0x5: 0x8020820, + 0x6: 0x8020800, + 0x7: 0x800, + 0x8: 0x8020000, + 0x9: 0x8000800, + 0xa: 0x20800, + 0xb: 0x8020020, + 0xc: 0x820, + 0xd: 0x0, + 0xe: 0x8000020, + 0xf: 0x20820, + 0x80000000: 0x800, + 0x80000001: 0x8020820, + 0x80000002: 0x8000820, + 0x80000003: 0x8000000, + 0x80000004: 0x8020000, + 0x80000005: 0x20800, + 0x80000006: 0x20820, + 0x80000007: 0x20, + 0x80000008: 0x8000020, + 0x80000009: 0x820, + 0x8000000a: 0x20020, + 0x8000000b: 0x8020800, + 0x8000000c: 0x0, + 0x8000000d: 0x8020020, + 0x8000000e: 0x8000800, + 0x8000000f: 0x20000, + 0x10: 0x20820, + 0x11: 0x8020800, + 0x12: 0x20, + 0x13: 0x800, + 0x14: 0x8000800, + 0x15: 0x8000020, + 0x16: 0x8020020, + 0x17: 0x20000, + 0x18: 0x0, + 0x19: 0x20020, + 0x1a: 0x8020000, + 0x1b: 0x8000820, + 0x1c: 0x8020820, + 0x1d: 0x20800, + 0x1e: 0x820, + 0x1f: 0x8000000, + 0x80000010: 0x20000, + 0x80000011: 0x800, + 0x80000012: 0x8020020, + 0x80000013: 0x20820, + 0x80000014: 0x20, + 0x80000015: 0x8020000, + 0x80000016: 0x8000000, + 0x80000017: 0x8000820, + 0x80000018: 0x8020820, + 0x80000019: 0x8000020, + 0x8000001a: 0x8000800, + 0x8000001b: 0x0, + 0x8000001c: 0x20800, + 0x8000001d: 0x820, + 0x8000001e: 0x20020, + 0x8000001f: 0x8020800 + } + ]; + + // Masks that select the SBOX input + var SBOX_MASK = [ + 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, + 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f + ]; + + /** + * DES block cipher algorithm. + */ + var DES = C_algo.DES = BlockCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + + // Select 56 bits according to PC1 + var keyBits = []; + for (var i = 0; i < 56; i++) { + var keyBitPos = PC1[i] - 1; + keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1; + } + + // Assemble 16 subkeys + var subKeys = this._subKeys = []; + for (var nSubKey = 0; nSubKey < 16; nSubKey++) { + // Create subkey + var subKey = subKeys[nSubKey] = []; + + // Shortcut + var bitShift = BIT_SHIFTS[nSubKey]; + + // Select 48 bits according to PC2 + for (var i = 0; i < 24; i++) { + // Select from the left 28 key bits + subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6); + + // Select from the right 28 key bits + subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6); + } + + // Since each subkey is applied to an expanded 32-bit input, + // the subkey can be broken into 8 values scaled to 32-bits, + // which allows the key to be used without expansion + subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31); + for (var i = 1; i < 7; i++) { + subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3); + } + subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27); + } + + // Compute inverse subkeys + var invSubKeys = this._invSubKeys = []; + for (var i = 0; i < 16; i++) { + invSubKeys[i] = subKeys[15 - i]; + } + }, + + encryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._subKeys); + }, + + decryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._invSubKeys); + }, + + _doCryptBlock: function (M, offset, subKeys) { + // Get input + this._lBlock = M[offset]; + this._rBlock = M[offset + 1]; + + // Initial permutation + exchangeLR.call(this, 4, 0x0f0f0f0f); + exchangeLR.call(this, 16, 0x0000ffff); + exchangeRL.call(this, 2, 0x33333333); + exchangeRL.call(this, 8, 0x00ff00ff); + exchangeLR.call(this, 1, 0x55555555); + + // Rounds + for (var round = 0; round < 16; round++) { + // Shortcuts + var subKey = subKeys[round]; + var lBlock = this._lBlock; + var rBlock = this._rBlock; + + // Feistel function + var f = 0; + for (var i = 0; i < 8; i++) { + f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; + } + this._lBlock = rBlock; + this._rBlock = lBlock ^ f; + } + + // Undo swap from last round + var t = this._lBlock; + this._lBlock = this._rBlock; + this._rBlock = t; + + // Final permutation + exchangeLR.call(this, 1, 0x55555555); + exchangeRL.call(this, 8, 0x00ff00ff); + exchangeRL.call(this, 2, 0x33333333); + exchangeLR.call(this, 16, 0x0000ffff); + exchangeLR.call(this, 4, 0x0f0f0f0f); + + // Set output + M[offset] = this._lBlock; + M[offset + 1] = this._rBlock; + }, + + keySize: 64/32, + + ivSize: 64/32, + + blockSize: 64/32 + }); + + // Swap bits across the left and right words + function exchangeLR(offset, mask) { + var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; + this._rBlock ^= t; + this._lBlock ^= t << offset; + } + + function exchangeRL(offset, mask) { + var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask; + this._lBlock ^= t; + this._rBlock ^= t << offset; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg); + */ + C.DES = BlockCipher._createHelper(DES); + + /** + * Triple-DES block cipher algorithm. + */ + var TripleDES = C_algo.TripleDES = BlockCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + // Make sure the key length is valid (64, 128 or >= 192 bit) + if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) { + throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.'); + } + + // Extend the key according to the keying options defined in 3DES standard + var key1 = keyWords.slice(0, 2); + var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4); + var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6); + + // Create DES instances + this._des1 = DES.createEncryptor(WordArray.create(key1)); + this._des2 = DES.createEncryptor(WordArray.create(key2)); + this._des3 = DES.createEncryptor(WordArray.create(key3)); + }, + + encryptBlock: function (M, offset) { + this._des1.encryptBlock(M, offset); + this._des2.decryptBlock(M, offset); + this._des3.encryptBlock(M, offset); + }, + + decryptBlock: function (M, offset) { + this._des3.decryptBlock(M, offset); + this._des2.encryptBlock(M, offset); + this._des1.decryptBlock(M, offset); + }, + + keySize: 192/32, + + ivSize: 64/32, + + blockSize: 64/32 + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg); + */ + C.TripleDES = BlockCipher._createHelper(TripleDES); + }()); + + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + + /** + * RC4 stream cipher algorithm. + */ + var RC4 = C_algo.RC4 = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + var keySigBytes = key.sigBytes; + + // Init sbox + var S = this._S = []; + for (var i = 0; i < 256; i++) { + S[i] = i; + } + + // Key setup + for (var i = 0, j = 0; i < 256; i++) { + var keyByteIndex = i % keySigBytes; + var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff; + + j = (j + S[i] + keyByte) % 256; + + // Swap + var t = S[i]; + S[i] = S[j]; + S[j] = t; + } + + // Counters + this._i = this._j = 0; + }, + + _doProcessBlock: function (M, offset) { + M[offset] ^= generateKeystreamWord.call(this); + }, + + keySize: 256/32, + + ivSize: 0 + }); + + function generateKeystreamWord() { + // Shortcuts + var S = this._S; + var i = this._i; + var j = this._j; + + // Generate keystream word + var keystreamWord = 0; + for (var n = 0; n < 4; n++) { + i = (i + 1) % 256; + j = (j + S[i]) % 256; + + // Swap + var t = S[i]; + S[i] = S[j]; + S[j] = t; + + keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8); + } + + // Update counters + this._i = i; + this._j = j; + + return keystreamWord; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg); + */ + C.RC4 = StreamCipher._createHelper(RC4); + + /** + * Modified RC4 stream cipher algorithm. + */ + var RC4Drop = C_algo.RC4Drop = RC4.extend({ + /** + * Configuration options. + * + * @property {number} drop The number of keystream words to drop. Default 192 + */ + cfg: RC4.cfg.extend({ + drop: 192 + }), + + _doReset: function () { + RC4._doReset.call(this); + + // Drop + for (var i = this.cfg.drop; i > 0; i--) { + generateKeystreamWord.call(this); + } + } + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg); + */ + C.RC4Drop = StreamCipher._createHelper(RC4Drop); + }()); + + + /** @preserve + * Counter block mode compatible with Dr Brian Gladman fileenc.c + * derived from CryptoJS.mode.CTR + * Jan Hruby jhruby.web@gmail.com + */ + CryptoJS.mode.CTRGladman = (function () { + var CTRGladman = CryptoJS.lib.BlockCipherMode.extend(); + + function incWord(word) + { + if (((word >> 24) & 0xff) === 0xff) { //overflow + var b1 = (word >> 16)&0xff; + var b2 = (word >> 8)&0xff; + var b3 = word & 0xff; + + if (b1 === 0xff) // overflow b1 + { + b1 = 0; + if (b2 === 0xff) + { + b2 = 0; + if (b3 === 0xff) + { + b3 = 0; + } + else + { + ++b3; + } + } + else + { + ++b2; + } + } + else + { + ++b1; + } + + word = 0; + word += (b1 << 16); + word += (b2 << 8); + word += b3; + } + else + { + word += (0x01 << 24); + } + return word; + } + + function incCounter(counter) + { + if ((counter[0] = incWord(counter[0])) === 0) + { + // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8 + counter[1] = incWord(counter[1]); + } + return counter; + } + + var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var counter = this._counter; + + // Generate keystream + if (iv) { + counter = this._counter = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } + + incCounter(counter); + + var keystream = counter.slice(0); + cipher.encryptBlock(keystream, 0); + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + + CTRGladman.Decryptor = Encryptor; + + return CTRGladman; + }()); + + + + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + + // Reusable objects + var S = []; + var C_ = []; + var G = []; + + /** + * Rabbit stream cipher algorithm + */ + var Rabbit = C_algo.Rabbit = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var K = this._key.words; + var iv = this.cfg.iv; + + // Swap endian + for (var i = 0; i < 4; i++) { + K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) | + (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00); + } + + // Generate initial state values + var X = this._X = [ + K[0], (K[3] << 16) | (K[2] >>> 16), + K[1], (K[0] << 16) | (K[3] >>> 16), + K[2], (K[1] << 16) | (K[0] >>> 16), + K[3], (K[2] << 16) | (K[1] >>> 16) + ]; + + // Generate initial counter values + var C = this._C = [ + (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), + (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), + (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), + (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) + ]; + + // Carry bit + this._b = 0; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + + // Modify the counters + for (var i = 0; i < 8; i++) { + C[i] ^= X[(i + 4) & 7]; + } + + // IV setup + if (iv) { + // Shortcuts + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; + + // Generate four subvectors + var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); + var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); + var i1 = (i0 >>> 16) | (i2 & 0xffff0000); + var i3 = (i2 << 16) | (i0 & 0x0000ffff); + + // Modify counter values + C[0] ^= i0; + C[1] ^= i1; + C[2] ^= i2; + C[3] ^= i3; + C[4] ^= i0; + C[5] ^= i1; + C[6] ^= i2; + C[7] ^= i3; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var X = this._X; + + // Iterate the system + nextState.call(this); + + // Generate four keystream words + S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); + S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); + S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); + S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); + + for (var i = 0; i < 4; i++) { + // Swap endian + S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | + (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); + + // Encrypt + M[offset + i] ^= S[i]; + } + }, + + blockSize: 128/32, + + ivSize: 64/32 + }); + + function nextState() { + // Shortcuts + var X = this._X; + var C = this._C; + + // Save old counter values + for (var i = 0; i < 8; i++) { + C_[i] = C[i]; + } + + // Calculate new counter values + C[0] = (C[0] + 0x4d34d34d + this._b) | 0; + C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; + C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; + C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; + C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; + C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; + C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; + C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; + this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; + + // Calculate the g-values + for (var i = 0; i < 8; i++) { + var gx = X[i] + C[i]; + + // Construct high and low argument for squaring + var ga = gx & 0xffff; + var gb = gx >>> 16; + + // Calculate high and low result of squaring + var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; + var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); + + // High XOR low + G[i] = gh ^ gl; + } + + // Calculate new state values + X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; + X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; + X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; + X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; + X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; + X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; + X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; + X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); + * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); + */ + C.Rabbit = StreamCipher._createHelper(Rabbit); + }()); + + + /** + * Counter block mode. + */ + CryptoJS.mode.CTR = (function () { + var CTR = CryptoJS.lib.BlockCipherMode.extend(); + + var Encryptor = CTR.Encryptor = CTR.extend({ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher + var blockSize = cipher.blockSize; + var iv = this._iv; + var counter = this._counter; + + // Generate keystream + if (iv) { + counter = this._counter = iv.slice(0); + + // Remove IV for subsequent blocks + this._iv = undefined; + } + var keystream = counter.slice(0); + cipher.encryptBlock(keystream, 0); + + // Increment counter + counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0 + + // Encrypt + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + + CTR.Decryptor = Encryptor; + + return CTR; + }()); + + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + + // Reusable objects + var S = []; + var C_ = []; + var G = []; + + /** + * Rabbit stream cipher algorithm. + * + * This is a legacy version that neglected to convert the key to little-endian. + * This error doesn't affect the cipher's security, + * but it does affect its compatibility with other implementations. + */ + var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var K = this._key.words; + var iv = this.cfg.iv; + + // Generate initial state values + var X = this._X = [ + K[0], (K[3] << 16) | (K[2] >>> 16), + K[1], (K[0] << 16) | (K[3] >>> 16), + K[2], (K[1] << 16) | (K[0] >>> 16), + K[3], (K[2] << 16) | (K[1] >>> 16) + ]; + + // Generate initial counter values + var C = this._C = [ + (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), + (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), + (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), + (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) + ]; + + // Carry bit + this._b = 0; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + + // Modify the counters + for (var i = 0; i < 8; i++) { + C[i] ^= X[(i + 4) & 7]; + } + + // IV setup + if (iv) { + // Shortcuts + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; + + // Generate four subvectors + var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); + var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); + var i1 = (i0 >>> 16) | (i2 & 0xffff0000); + var i3 = (i2 << 16) | (i0 & 0x0000ffff); + + // Modify counter values + C[0] ^= i0; + C[1] ^= i1; + C[2] ^= i2; + C[3] ^= i3; + C[4] ^= i0; + C[5] ^= i1; + C[6] ^= i2; + C[7] ^= i3; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var X = this._X; + + // Iterate the system + nextState.call(this); + + // Generate four keystream words + S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); + S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); + S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); + S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); + + for (var i = 0; i < 4; i++) { + // Swap endian + S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | + (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); + + // Encrypt + M[offset + i] ^= S[i]; + } + }, + + blockSize: 128/32, + + ivSize: 64/32 + }); + + function nextState() { + // Shortcuts + var X = this._X; + var C = this._C; + + // Save old counter values + for (var i = 0; i < 8; i++) { + C_[i] = C[i]; + } + + // Calculate new counter values + C[0] = (C[0] + 0x4d34d34d + this._b) | 0; + C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; + C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; + C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; + C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; + C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; + C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; + C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; + this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; + + // Calculate the g-values + for (var i = 0; i < 8; i++) { + var gx = X[i] + C[i]; + + // Construct high and low argument for squaring + var ga = gx & 0xffff; + var gb = gx >>> 16; + + // Calculate high and low result of squaring + var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; + var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); + + // High XOR low + G[i] = gh ^ gl; + } + + // Calculate new state values + X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; + X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; + X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; + X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; + X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; + X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; + X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; + X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg); + */ + C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); + }()); + + + /** + * Zero padding strategy. + */ + CryptoJS.pad.ZeroPadding = { + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Pad + data.clamp(); + data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes); + }, + + unpad: function (data) { + // Shortcut + var dataWords = data.words; + + // Unpad + var i = data.sigBytes - 1; + for (var i = data.sigBytes - 1; i >= 0; i--) { + if (((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) { + data.sigBytes = i + 1; + break; + } + } + } + }; + + + return CryptoJS; + +})); \ No newline at end of file diff --git a/public/static/saver.js b/public/static/saver.js new file mode 100644 index 0000000..2155e7e --- /dev/null +++ b/public/static/saver.js @@ -0,0 +1,188 @@ +(function (global, factory) { + if (typeof define === "function" && define.amd) { + define([], factory); + } else if (typeof exports !== "undefined") { + factory(); + } else { + let mod = { + exports: {} + }; + factory(); + global.FileSaver = mod.exports; + } +})(this, function () { + "use strict"; + + /* + * FileSaver.js + * A saveAs() FileSaver implementation. + * + * By Eli Grey, http://eligrey.com + * + * License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT) + * source : http://purl.eligrey.com/github/FileSaver.js + */ + // The one and only way of getting global scope in all environments + // https://stackoverflow.com/q/3277182/1008999 + let _global = typeof window === 'object' && window.window === window ? window : typeof self === 'object' && self.self === self ? self : typeof global === 'object' && global.global === global ? global : void 0; + + function bom(blob, opts) { + if (typeof opts === 'undefined') opts = { + autoBom: false + };else if (typeof opts !== 'object') { + console.warn('Deprecated: Expected third argument to be a object'); + opts = { + autoBom: !opts + }; + } // prepend BOM for UTF-8 XML and text/* types (including HTML) + // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF + + if (opts.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(blob.type)) { + return new Blob([String.fromCharCode(0xFEFF), blob], { + type: blob.type + }); + } + + return blob; + } + + function download(url, name, opts) { + let xhr = new XMLHttpRequest(); + xhr.open('GET', url); + xhr.responseType = 'blob'; + + xhr.onload = function () { + saveAs(xhr.response, name, opts); + }; + + xhr.onerror = function () { + console.error('could not download file'); + }; + + xhr.send(); + } + + function corsEnabled(url) { + let xhr = new XMLHttpRequest(); // use sync to avoid popup blocker + + xhr.open('HEAD', url, false); + + try { + xhr.send(); + } catch (e) {} + + return xhr.status >= 200 && xhr.status <= 299; + } // `a.click()` doesn't work for all browsers (#465) + + + function click(node) { + try { + node.dispatchEvent(new MouseEvent('click')); + } catch (e) { + let evt = document.createEvent('MouseEvents'); + evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); + node.dispatchEvent(evt); + } + } // Detect WebView inside a native macOS app by ruling out all browsers + // We just need to check for 'Safari' because all other browsers (besides Firefox) include that too + // https://www.whatismybrowser.com/guides/the-latest-user-agent/macos + + + let isMacOSWebView = /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent); + let saveAs = _global.saveAs || ( // probably in some web worker + typeof window !== 'object' || window !== _global ? function saveAs() {} + /* noop */ + // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView + : 'download' in HTMLAnchorElement.prototype && !isMacOSWebView ? function saveAs(blob, name, opts) { + let URL = _global.URL || _global.webkitURL; + let a = document.createElement('a'); + name = name || blob.name || 'download'; + a.download = name; + a.rel = 'noopener'; // tabnabbing + // TODO: detect chrome extensions & packaged apps + // a.target = '_blank' + + if (typeof blob === 'string') { + // Support regular links + a.href = blob; + + if (a.origin !== location.origin) { + corsEnabled(a.href) ? download(blob, name, opts) : click(a, a.target = '_blank'); + } else { + click(a); + } + } else { + // Support blobs + a.href = URL.createObjectURL(blob); + setTimeout(function () { + URL.revokeObjectURL(a.href); + }, 4E4); // 40s + + setTimeout(function () { + click(a); + }, 0); + } + } // Use msSaveOrOpenBlob as a second approach + : 'msSaveOrOpenBlob' in navigator ? function saveAs(blob, name, opts) { + name = name || blob.name || 'download'; + + if (typeof blob === 'string') { + if (corsEnabled(blob)) { + download(blob, name, opts); + } else { + let a = document.createElement('a'); + a.href = blob; + a.target = '_blank'; + setTimeout(function () { + click(a); + }); + } + } else { + navigator.msSaveOrOpenBlob(bom(blob, opts), name); + } + } // Fallback to using FileReader and a popup + : function saveAs(blob, name, opts, popup) { + // Open a popup immediately do go around popup blocker + // Mostly only available on user interaction and the fileReader is async so... + popup = popup || open('', '_blank'); + + if (popup) { + popup.document.title = popup.document.body.innerText = 'downloading...'; + } + + if (typeof blob === 'string') return download(blob, name, opts); + let force = blob.type === 'application/octet-stream'; + + let isSafari = /constructor/i.test(_global.HTMLElement) || _global.safari; + + let isChromeIOS = /CriOS\/[\d]+/.test(navigator.userAgent); + + if ((isChromeIOS || force && isSafari || isMacOSWebView) && typeof FileReader !== 'undefined') { + // Safari doesn't allow downloading of blob URLs + let reader = new FileReader(); + + reader.onloadend = function () { + let url = reader.result; + url = isChromeIOS ? url : url.replace(/^data:[^;]*;/, 'data:attachment/file;'); + if (popup) popup.location.href = url;else location = url; + popup = null; // reverse-tabnabbing #460 + }; + + reader.readAsDataURL(blob); + } else { + let URL = _global.URL || _global.webkitURL; + let url = URL.createObjectURL(blob); + if (popup) popup.location = url;else location.href = url; + popup = null; // reverse-tabnabbing #460 + + setTimeout(function () { + URL.revokeObjectURL(url); + }, 4E4); // 40s + } + }); + _global.saveAs = saveAs.saveAs = saveAs; + + if (typeof module !== 'undefined') { + module.exports = saveAs; + } +}); diff --git a/public/static/sdk.js b/public/static/sdk.js new file mode 100644 index 0000000..b691502 --- /dev/null +++ b/public/static/sdk.js @@ -0,0 +1,7 @@ +/** + * hirtc-web v1.0.4.2024042434 + * build date: 2024/04/24 + * @JuHaoKan Hisense + */ + +function e(t,r){const o=P();return(e=function(e,t){return o[e-=172]})(t,r)}const t=e;!function(t,r){const o=e,n=P();for(;;)try{if(642255===parseInt(o(910))/1*(parseInt(o(273))/2)+-parseInt(o(779))/3*(parseInt(o(1364))/4)+parseInt(o(1428))/5+parseInt(o(196))/6+-parseInt(o(402))/7*(-parseInt(o(1733))/8)+-parseInt(o(1285))/9+-parseInt(o(1683))/10*(parseInt(o(1434))/11))break;n.push(n.shift())}catch(e){n.push(n.shift())}}();const r=t(1309);function o({url:r="",method:o=t(1287),headers:n,params:i,data:s,timeout:a=5e3,withCredentials:c=!1,responseType:u=t(802),contentType:d,widthRequest:l}){return new Promise(((t,p)=>{const f=e,m={"Content-Type":f(1454),Accept:f(1375)};let b=s;const v={...m,...n||{}};d&&(v[f(1839)]=d),o=o.toUpperCase();let y=new XMLHttpRequest;function h(){const e=f;if(!y)return;const r=e(1416)in y?y.getAllResponseHeaders():{},o=u&&u!==e(1831)&&u!==e(802)?y.response:y[e(1315)];if(y[e(313)]>=200&&y[e(313)]<300||304===y[e(313)]){let r=u===e(802)&&o?JSON.parse(o):o;t(l?{request:y,data:r}:r)}else y.responseHeaders=r,y[e(649)]=o,p(y);y=null}if(i&&i instanceof Object&&(r=r+"?"+Object.keys(i)[f(893)]((e=>e+"="+i[e]))[f(656)]("&")),y.open(o,r,!0),y[f(972)]=a,f(237)in y?y[f(237)]=h:y[f(1405)]=function(){const e=f;y&&4===y[e(1168)]&&(0!==y[e(313)]||y[e(905)]&&0===y[e(905)][e(199)](e(1121)))&&setTimeout(h)},y[f(1187)]=function(){y&&(p(new Error("Request aborted",config)),y=null)},y.onerror=function(e){p(new Error(f(1606))),y=null},y[f(1156)]=function(){const e=f;let t=a?e(1821)+a+"ms exceeded":e(1798);p(new Error(t)),y=null},f(1005)in y&&Object[f(703)](v)[f(1505)]((e=>{y[f(1005)](e,v[e])})),c&&(y.withCredentials=!!c),u&&u!==f(802)&&(y[f(1635)]=u),!b&&!1!==b&&0!==b&&""!==b&&(b=null),[f(1261)].includes(o)&&v["Content-Type"]===m[f(1839)]&&"object"==typeof b){let e="";Object[f(703)](b)[f(1505)]((t=>{e+="&"+t+"="+b[t]})),b=e[f(1515)](1)}y.send(b)}))}const n={DOT:t(1680),COMMON:t(1302),ERR:"error"},i=t(1780);let s=!0,a=!1,c=[],u=null;const d=(m=t(1644),{setItem(t,r){const o=e;typeof r===o(1102)&&(r=JSON[o(1014)](r)),window[m][o(1263)](t,r)},getItem(t,r=!1){const o=e;let n=window[m][o(1247)](t);if(r)try{n=JSON.parse(n)}catch(e){console[o(605)](e),n=null}return n},removeItem(t){const r=e;window[m][r(965)](t)}}),l=(e,r,o=n[t(445)])=>{const i=t;return u&&u[i(781)]?e({url:f(o,u),method:i(1481),sign:!1,data:{json:JSON.stringify(r)},timeout:1e3}):Promise.reject(new Error("No log strategy"))},p=(e,r)=>{const o=t;e?a=!0:(a=!1,c.length>0&&(c[o(1505)]((e=>{e(r)})),c=[]))},f=(e,r)=>{const o=t;switch(e){case n.DOT:return r[o(1086)];case n.ERR:return r[o(423)];default:return r[o(781)]}};var m,b={init:e=>{const{publicCloud:t}=e;!u&&(u=d.getItem("HIRTC_WEB_STRATEGY",!0)||null),u&&u[i]!==t&&(d.removeItem("HIRTC_WEB_STRATEGY"),u=null),s=t},report:(r,o,n)=>new Promise((f=>{a?c.push((t=>{const i=e;t?f():l(r,o,n)[i(515)](f)[i(432)](f)})):u?l(r,o,n).then(f).catch(f):(p(!0),((e,r)=>{const o=t;e({url:s?"https://api-gps.hismarttv.com/log/get_js_strategy":"https://api-gps-julinker.hisense.com/log/get_js_strategy",method:"get",timeout:1e3,sign:!1,params:{policySeq:Math[o(1221)](Date[o(931)]()/1e3),appKey:1192554437,version:"1.0",reportTag:0,receiveTag:2}})[o(515)]((e=>{const t=o;e[t(781)]&&(u=e,u[i]=s,d[t(1263)]("HIRTC_WEB_STRATEGY",u)),p(!1),r()}))[o(432)]((e=>{p(!1,e),r(e)}))})(r,(t=>{const i=e;t?f():l(r,o,n)[i(515)](f).catch(f)})))})),LOG_TYPE:n};const v=function(){const e=t;let r=new Date;return r[e(1815)]()+"/"+(r[e(1200)]()+1)+"/"+r[e(258)]()+" "+r[e(1493)]()+":"+r.getMinutes()+":"+r[e(729)]()+"."+r[e(401)]()},y=function(e,r){const o=t;return Math[o(1221)](Math[o(1403)]()*(r-e+1))+e},h=function(e=10){const t=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];let r="";for(let o=0;o{const r=t;let o=URL[r(1029)](e),n=document[r(214)]("a");n.href=o,n.download=""+e.name,n[r(1355)]=r(1193),setTimeout((function(){const e=r;URL.revokeObjectURL(n[e(269)])}),3e4),setTimeout((function(){n[r(1053)]()}),0)};class k{[t(1827)]=[];[t(1559)]=-1;[t(1622)]={Info:"info",Warn:t(678),Error:"error"};[t(525)]=null;constructor({globalOptions:e}){this[t(525)]=e}[t(1450)](e,...r){const o=t;let n=o(253)+v()+" "+e,i="";if(r[o(1505)]((e=>{i=e instanceof Object?i+" "+JSON.stringify(e):i+" "+e})),i&&(i=n+" -"+i+"\n",console[e](i),this[o(1827)].push(i),this.logContainer[o(1524)]>this[o(525)][o(560)]))for(let e=0,t=this[o(525)][o(560)]/10;e=this.maxListener?this.localLog[o(485)]("too many listeners, add listeners "+e+o(1157)):(this[o(847)][o(1055)](o(706)+e+")"),this[o(326)][e]instanceof Array?-1===this.listeners[e][o(199)](r)&&this.listeners[e][o(801)](r):this[o(326)][e]=[][o(1539)](r))}[t(1473)](e,r){const o=t;if(!this[o(326)][e]||0===this[o(326)][e][o(1524)])return void this[o(847)][o(1023)](o(1369)+e+o(1437));let n=this[o(326)][e][o(199)](r);n>=0&&(this[o(326)][e][o(488)](n,1),this[o(847)][o(1055)](o(1369)+e+o(1163)))}[t(742)](e){const r=t;this.localLog[r(1055)](r(654)+e+")"),this[r(326)][e]=[]}[t(1441)](e=10){this[t(1009)]=e}emit(e){const r=t;if(!e)return;let o=Array[r(225)][r(1515)][r(228)](arguments);if(o[r(1226)](),[r(1127),r(726),r(1169),"audioReport",r(605)].indexOf(e)<0&&(e===r(1449)?this[r(847)].logInfo("event ["+e+r(917)):this[r(847)][r(1055)]("event ["+e+"]",o)),this.listeners[e]&&this[r(326)][e][r(1524)]>0){const t=[];this.listeners[e][r(1505)]((e=>{t[r(801)](e)})),t.forEach((e=>{e[r(962)](null,o)}))}}[t(1022)](){this[t(326)]={}}}const T=navigator[t(1141)][t(1399)](),R=!!T[t(1751)](/\(i[^;]+;( U;)? CPU.+Mac OS X/i),C=(()=>{const e=t,r=T[e(1751)](/cpu iphone os (.*?) like mac os/);return r&&typeof r[1]===e(645)?r[1][e(1190)]?r[1].replaceAll("_","."):(r[1]=r[1][e(1260)]("_","."),r[1].replace("_",".")):null})(),L=/safari/[t(189)](T)&&!/chrome/[t(189)](T);function P(){const e=["joinRoomEx","values","reuse","audioProcessor"," WHERE key = ? LIMIT 1","encodetime","wsUpdateName",",enabled:","ondevicechange","Record","videoFramesDecoded","audioContext","onIceStateChange","update name sucess: ","broadcast","PENDING","users","denoiser start: ","description","muted","resolve","wsHandleStartLive","getQosData","sdk version: ","otherCallRejected","Encoded","blob","video/rtx","4152dJkNxl","currentScript","_initReady","FacingMode","outBandWidth","fpscap normal, trigger unmute","deserialize","oncomplete","isDownloaded","rejected","previewing, try later","AudioOutput","all","audioElem","VideoError","onError","lastMuteAudio","packetsReceived","match","[setRole]: ","routineAudioReport","downloadTime","info","room response error, no token","videoFPSReceived","autoplayHack","setPublishLayer type no support","Capturer","Failed to get type for BinaryArray","forages","stunURL","sdpFmtpLine","startNormalBitrate_time","rtt",", audioInputID:","updateUser","getDeviceInfo","getLayerBw","turnUser","assign","data","cameraPreview","update stream info error","debug",",mauth_signature=","sampleRate","objectStore","_public_cloud_","config","on error, join request deprecated, reqId: ","bad","facingMode","selectLayer: no stream","streamType","getCapabilities","Decoded","QUOTA_ERR","Response","wsHandleNotifyMixer","getSenders","role not in same group",", LastModified: ","script","ispCode","current role can not publish","timeout exceeded","noiseSuppression","_dbInfo","catch an error when apply for stream, ","subscribe stream error",", enable:","uic8","wsHandleUnsubscribe","unpublishEx(tag:","answerRtcPeerConn","muteRemoteStream","E009","askForPermission","[object Blob]","detail","Invalid arguments","updateName","getFullYear","[wsHandleNetStatChanged] msgtype:","readwrite","delUnableAutoPlayElem","destinationNode","setElementSinkId","timeout of ","muteAudio","userActionData","start","media-source","netlevel","logContainer","streamUpdated","autoLayout","need audio track","text","publish error, cannot handle seq id ","wsHandleStreamUpdated","videoRtt","si32","publishedScreenEx","setAttribute","tag","Content-Type","E011","close peer conn error, ","wsHandlePublish() code:","getSerializer","ms and retry:","print before ready, ","publish respond error, requestID: ","stuckData","targetLayerIndex","Invalid serviceID:","set audio output error","connectionState","trackInfo,onended:","deleteObjectStore",", add ice candidate error, ","videoBitrate","trackInfo:","camera had been opened already","publish response code not zero","reviseStreamData","createTextNode","lcoalMuteVideo","supports","SELECT name FROM sqlite_master WHERE type='table' AND name = ?","#audio","[stopMixer]","wsHandleUnPublish","bitrateList","videoNoRcvdTimes","RequestIpInfoErr","videoHeight","localMuteAudio","streamNetworkReport",",url:","index","leaveRoom","mixer","sendonly","isChange","test","firCount","firstDataUploaded",", errdesc: "," msid:(.*)\r?\n","screenLayers","state","6354234Sedccj","netWeakMuteVideo","track","indexOf","pause","localMuteVideo","INSERT OR REPLACE INTO ","captureStream not exit","totalFreezesDuration","set device error","must be an array","not started recording, ","openCursor","crossOrigin","audioRemoteIn","stamp","reject","replacePCTrack","createElement","OPEN","request ip info success, resp:","not found","LogErrorType",")})","diff=",", msg:","setCodecPreferences error:","AES","const","prototype","onunmute","Unsubscribed","call","storeNames",", muteAllStreamAudio: ","), enableInspire: ","replaceCustomTrack","captureStream","qosReport(enable:","videoCodec","wsHandlePing","onloadend","Join","user play fail: ","PrintError","onmute","currentTarget","request ip info error, retry exceed max count:",", uid:","joined","failCheck","addEventListener","framesEncoded","emitNetWeakReport","wsUpdate","unknown","MessageChannel","[websdk] ","addModule","autoFocusScreen","stopMediaStream","failed","getDate","pauseAllStreamAudio","streamVideoReport","context","视频流解码无输出帧","abs","stopMediaTrack","connect","MODULE_NOT_FOUND","[stopWebPage]",",mauth_timestamp=","href","outbound-rtp","video/webm;codecs=h264,opus","add bitrate control error, no minBitrate","2273174EfxUfQ","averageBitrate","视频无发送数据","connection error","WEBSQL","method","[printLocal]","isSubscribeFailed","[object Int32Array]","continueSpeakTime","executeSql","AudioInput","stop denoiser fail: ","编码异常","Constraints","FULFILLED","unsubscribe-","recordLocal","customPreview","Track","userPlay",'The database "',"reason","kick: ","undefined","Decoder","JoinError","autoDownload","preview: plugin not correct","PreviewError","level","previewEx(vodeo.id:","adaptVideoConstraints","framesSent","setSinkId","videoPktsSent","open screen previewEx error, ","pluginEtag","cleanVideoEvent","unpublish","status","self aes decrypt error, ","netWeakChange","remote-inbound-rtp","sdpAddSimulcast","nameUpdated","_localforage_support_test","published","getPluginEtag","setPluginEtag","If-Modified-Since","totalStuckCount","startMixer","listeners",", local publish error,code:","subscribe","wrapStuckData"," WHERE id = ? LIMIT 1","unpublish(streamType:","eventBus","enumerateDevices","record error, stream","encodings","checkQosUplinkError","encode","wsHandleUpdateRoom","toString","wsHandleUserJoined","audio"," meta data received ","previewScreenEx","wsSender","commonweb","LogErrorCode","join room error","negotiate error, type: error, streamID: ","publish error, requestID: ","audioLevel","RTCPeerConnection","Environment","unlogTrackInfo","remote-candidate","storage fail","countryCode","checkVideoPlay","availableIncomingBitrate","ipInfoMaxRetryCount","interruptionCount","203013","`reqest ip info:","includes","playsInline",", tag:","enc","documentElement","[object Uint8Array]","jsCode","websocket connected,","remote pubid:","systemMuteVideo","optimizeDeviceList","init","videoFreezeWarn","uid","result","publish before preview"," (id INTEGER PRIMARY KEY, key unique, value)","applyConstraints fail","updateInfo(streams:","frameRateInterval","detail:","initCore","msg","resetDefaultDevice","openKeyCursor","onClose","muteVideo","trackInfo,onmute:","SetDeviceError","recorder","playDuration","initTime","applyConstraints","getDisplayMedia","getDeviceUsingPermission before await navigator.mediaDevices.getUserMedia(constrains:","markVideoEnded","wsInitialize","updateName(name:","getMilliseconds","1106UFFnvb","[recordRemote]","decodeDelay","beginStuckTime","qosHistroyData","x-google-min-bitrate=",", interval:","previewCustom(videoElement:","setPublishLayer, type:","historyReport","wsHandleNotifyWebPage","readAsBinaryString","open media preview error","response","send","streamInfo","Audio","addVideoEvent","application/json","startMuteTime",'" has been upgraded from version ',"excAddress","bytes","[object Float64Array]","cameraEnableVideo","getNetworkMinBw","value","mediaType","本地无采集输出","drawImage","catch","can not add module to audio worklet,","SetRoleError","open camera preview error, ","wsHandleWebPage","inspired stream: ","candidate-pair","setDevicePreference","inbound-rtp","requestIpInfo","bindWindowEvent","probator","can not stop recording, stream","COMMON","[getDevices]: enableDetail: ","Play","192.","[recordScreen], open screen error","publish error, bad response","wsHandleRole","userDNS","your browser can not support audio context","create","unpublish-","request ip info error, no cityInfo, response:","callback","onConnectionStateChange","name invalid","infoUpdated","_wrapLibraryMethodsWithReady","statusText","Sent","removeEventListener","videoElem","publishEx before join","audioinput","Role","lastIndexOf",', but the storage "',"1.8","onupgradeneeded","wsWebPage","setOption","getElementsByTagName"," failed","videoFps","userArea","checkDeviceList","videoReport(enable:","mute local too often","param error","publish stream error","ipAddr","logError","mediatype","deviceId","splice","auidoTest, levelList:","peeruserid","subscribe recover:",", role:","wasm Etag: ","ask for permission but devices were not readable","controls","VideoInput","succeeded","m=audio","StreamTrack","audioReport","videoPacketsSent","updateTime","getVideoTracks","\" can't be downgraded from version ","wsHandleRoomUpdated","videoEnded","userRole",", detail:","app","levelList","replaceTrack","[streamUpdated] uid:","function","videoTrack","then","screenPreviewEx","codec","Live","Layers","active","unsubscribe","request","getVideoConstraints","streams","globalOptions","audioSource","frameHeight","recordLocalEx","E003","customCanPlay","unpublishScreenEx(tag:","someoneLeft","UplinkWeak","recordRemote","update name error","cleanTimer","ios","audioWorklet","onMessage","cannot set simulcast layers encoding, getParameters or setParameters is not available","MediaType","autoRecovery","webpage","wsHandleUpdate","content","routineQosLog","videoPktsRcvd","created","publisher not found","Custom","Camera","[setPublishRatio]","token","lastIntervalTime","streamAudioTest","parameter(s) error,check it please","url","type","url needed","logSize","_driver","sdpNormalizer","subscribe error,","getBlob","Video","turnURL","Cannot find module '","packetization-mode=1","checkStreamFirstUpload",", open:","framesDropped","audio/opus","Services","Sender","screen","localStorageWrapper","layerindex","reportInfo","guardian","ConstraintError","sdpAddProbator","[join]: role invalid","restartIce","UserRole","inBandWidth","vbad","stuckCount","getStreamByPubIDorTag","createRtcPeerConn","addTrack","[recordLocalEx]"," input","MixerErr","default","open camera before select device","desc","connection state: failed",".txt","averageVideoFps","hirtc-denoiser","REJECTED","playTime","E006","onended","error","hirtc-web@","oncapturehandlechange","subscribed"," mslabel:","record remote before ready","sdpAddSIM","_support","ui08","completed","begin recover","max","onIceNegotiationNeeded",", muteLocal","joinRoom with force areaCode:","errtype","secure","releaseAudioProcessor","setVideoElementStream","wsHandleNetStatChanged","isStarted","group","joinRoom","createInstance","Event","contentHint","label","音频流无接收数据","retry exceed max count:","code","lastvideoinput","getCore","CREATE TABLE IF NOT EXISTS ","bad listener, listener ",", options: ","media preview videotrack is not available","fulfilled","webkit-playsinline","wsHandleNameUpdated","E000","string","framesReceived","getDeviceInfo(deviceID:",", deviceID:","resopnse","inputBuffer",", area:","screenPreview",", levelList:","removeAllListener(","si08","join","audio test audioElement error","enableDomAutoPlay","[object Object]","filter","UserAction","QosEvent","Rtc","INDEXEDDB","needUserPlay","E007","muteStream","last","wsJoin","input","_defaultConfig",", muteLocalCustom","videoinput","_initStorage","PlatformType","getBrowserSupported","destination","warn","resumeAllStreamAudio","getUplinkNetworkReport","wsHandleLeave","ErrorDetail","m=video","decode","[object Int8Array]","not MediaStream","set video element source error, ",", videoInputID:","No available storage method found.","devUrl","preventDefault","screen sharing, can not publish","subscribeBegin","activeDuration","preview(","jitterBufferDelay","setPublishRatio, layer info error","WebAssembly","count","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/","load","request fail","keys","enableDenoiser: ","publishID","addListener(","wsRole","bad response, decryption failure",", muteAudio:","[printRemote]","dType","HiWebrtcsdk","substr","append","deviceList","targetBw","callFulfilled","pair","exports","E005","exT:","item","width","cameraEnableAudio","get permission error","networkReport","muteLocal(streamType:","wsHandleStreamRemoved","getSeconds","setParameters","preview","isArray","forceAreaCode","storeName","onDeviceChange","web page respon error: ","TypeError","onerror","_hiRtcSDK.getDeviceUsingPermission end","reconnectingStreams","quality","removeAllListener","getContext","videoOutList","fps","onOpen","[recordLocalScreenEx]","totalStuckDuration","emitError","peerErrorEvent","symbol","cameraEx","muteLocalStreamCamera","nack","domain","groupId","_getSupportedDrivers","audioOut","substring","denoiser","Couldn't convert value into a JSON string: "," not support yet","Method ",'dropInstance blocked for database "',"not support audio process","wsUpdateInfo","publish","offer","request room error,status: ","setCustomProfile(videoEle:","preview video error, ","bwsend","muteRemote(subscribeID:","video/h264","streamServer","task","getTrackFunc","E008","234438QNJoSj","SecurityError","serAddress","reconnected","data:text/javascript;base64,LyoqCiAqIGhpcnRjLWRlbm9pc2VyLXdhc20gdjEuMC4wLjIwMjMxMTIzMQogKiBidWlsZCBkYXRlOiAyMDIzLzExLzIzCiAqIEBKdUhhb0thbiBIaXNlbnNlCiAqLwoKY29uc3QgdD1GbG9hdDMyQXJyYXkuQllURVNfUEVSX0VMRU1FTlQsZT1VaW50MTZBcnJheS5CWVRFU19QRVJfRUxFTUVOVDtjbGFzcyBue2NvbnN0cnVjdG9yKHQsZSxuLHMpe3RoaXMuX2lzSW5pdGlhbGl6ZWQ9ITEsdGhpcy5fbW9kdWxlPXQsdGhpcy5fbGVuZ3RoPWUsdGhpcy5fbWF4Q2hhbm5lbENvdW50PXM/TWF0aC5taW4ocywzMik6bix0aGlzLl9jaGFubmVsQ291bnQ9bix0aGlzLl9hbGxvY2F0ZUhlYXAoKSx0aGlzLl9pc0luaXRpYWxpemVkPSEwfV9hbGxvY2F0ZUhlYXAoKXtjb25zdCBuPXRoaXMuX2xlbmd0aCp0LHM9dGhpcy5fY2hhbm5lbENvdW50Km47dGhpcy5fZGF0YVB0cj10aGlzLl9tb2R1bGUuX21hbGxvYyhzKSx0aGlzLl9jaGFubmVsRGF0YT1bXTtmb3IobGV0IHQ9MDt0PHRoaXMuX2NoYW5uZWxDb3VudDsrK3Qpe2NvbnN0IHM9dGhpcy5fZGF0YVB0cit0Km4sYT1zK247dGhpcy5fY2hhbm5lbERhdGFbdF09dGhpcy5fbW9kdWxlLkhFQVBGMzIuc3ViYXJyYXkocz4+ZSxhPj5lKX19YWRhcHRDaGFubmVsKHQpe3Q8dGhpcy5fbWF4Q2hhbm5lbENvdW50JiYodGhpcy5fY2hhbm5lbENvdW50PXQpfWdldCBsZW5ndGgoKXtyZXR1cm4gdGhpcy5faXNJbml0aWFsaXplZD90aGlzLl9sZW5ndGg6bnVsbH1nZXQgbnVtYmVyT2ZDaGFubmVscygpe3JldHVybiB0aGlzLl9pc0luaXRpYWxpemVkP3RoaXMuX2NoYW5uZWxDb3VudDpudWxsfWdldCBtYXhDaGFubmVsQ291bnQoKXtyZXR1cm4gdGhpcy5faXNJbml0aWFsaXplZD90aGlzLl9tYXhDaGFubmVsQ291bnQ6bnVsbH1nZXRDaGFubmVsRGF0YSh0KXtyZXR1cm4gdD49dGhpcy5fY2hhbm5lbENvdW50P251bGw6dm9pZCAwPT09dD90aGlzLl9jaGFubmVsRGF0YTp0aGlzLl9jaGFubmVsRGF0YVt0XX1nZXRIZWFwQWRkcmVzcygpe3JldHVybiB0aGlzLl9kYXRhUHRyfWdldFBvaW50ZXIoKXtyZXR1cm4gdGhpcy5fZGF0YVB0cn1mcmVlKCl7dGhpcy5faXNJbml0aWFsaXplZD0hMSx0aGlzLl9tb2R1bGUuX2ZyZWUodGhpcy5fZGF0YVB0ciksdGhpcy5fbW9kdWxlLl9mcmVlKHRoaXMuX3BvaW50ZXJBcnJheVB0ciksdGhpcy5fY2hhbm5lbERhdGE9bnVsbH19ZnVuY3Rpb24gcyh0KXtjb25zdCBlPWBbd2Vic2RrXSAke2Z1bmN0aW9uKCl7bGV0IHQ9bmV3IERhdGU7cmV0dXJuYCR7dC5nZXRGdWxsWWVhcigpfS8ke3QuZ2V0TW9udGgoKSsxfS8ke3QuZ2V0RGF0ZSgpfSAke3QuZ2V0SG91cnMoKX06JHt0LmdldE1pbnV0ZXMoKX06JHt0LmdldFNlY29uZHMoKX0uJHt0LmdldE1pbGxpc2Vjb25kcygpfWB9KCl9IHBsdWdpbiAtICR7dH1gO2NvbnNvbGUubG9nKGUpfWxldCBhPW51bGw7Y2xhc3MgaSBleHRlbmRzIEF1ZGlvV29ya2xldFByb2Nlc3Nvcntjb25zdHJ1Y3Rvcih0KXtzdXBlcigpLHQucHJvY2Vzc29yT3B0aW9ucyYmdC5wcm9jZXNzb3JPcHRpb25zLmpzQ29kZSYmKG5ldyBGdW5jdGlvbih0LnByb2Nlc3Nvck9wdGlvbnMuanNDb2RlKSgpLGE9Z2xvYmFsVGhpcy5Nb2R1bGUsdGhpcy5faGVhcElucHV0QnVmZmVyPW5ldyBuKGEsMTI4LDIsMzIpLHRoaXMuX2hlYXBPdXRwdXRCdWZmZXI9bmV3IG4oYSwxMjgsMiwzMikpLHRoaXMucG9ydC5vbm1lc3NhZ2U9dD0+e2NvbnN0e2RhdGE6ZX09dDtpZihlJiYiZGVzdHJveSI9PT1lLmFjdGlvbilzKCJwcm9jZXNzb3IgZGVzdHJveSIpLGEmJmEuY2NhbGwoImhpX2Rlbm9pc2VyX2ZyZWUiLCJ2b2lkIixbXSl9fXByb2Nlc3ModCxlLG4pe2lmKCF0fHwhYSlyZXR1cm47Y29uc3Qgcz10WzBdLGk9ZVswXSxyPXMubGVuZ3RoO3RoaXMuX2hlYXBJbnB1dEJ1ZmZlci5hZGFwdENoYW5uZWwociksdGhpcy5faGVhcE91dHB1dEJ1ZmZlci5hZGFwdENoYW5uZWwocik7Zm9yKGxldCB0PTA7dDxyOysrdCl0aGlzLl9oZWFwSW5wdXRCdWZmZXIuZ2V0Q2hhbm5lbERhdGEodCkuc2V0KHNbdF0pO2EuY2NhbGwoImhpX2Rlbm9pc2VyX3Byb2Nlc3MiLCJ2b2lkIixbIm51bWJlciIsIm51bWJlciIsIm51bWJlciIsIm51bWJlciJdLFt0aGlzLl9oZWFwSW5wdXRCdWZmZXIuZ2V0SGVhcEFkZHJlc3MoKSx0aGlzLl9oZWFwT3V0cHV0QnVmZmVyLmdldEhlYXBBZGRyZXNzKCkscixzYW1wbGVSYXRlXSk7Zm9yKGxldCB0PTA7dDxyO3QrKylpW3RdLnNldCh0aGlzLl9oZWFwT3V0cHV0QnVmZmVyLmdldENoYW5uZWxEYXRhKHQpKTtyZXR1cm4hMH19cmVnaXN0ZXJQcm9jZXNzb3IoImhpcnRjLWRlbm9pc2VyIixpKTsK"," cname:","pluginLastModified","screenEnableVideo","Cannot call a class as a function","audio/g722","setCustomProfile: url error","getReceivers","denoiser load success, sampleRate: ","checkStreamFirstDownload","Encoder","live","toDataURL","mediaDevices","print picture error","on success, ip request deprecated, msgId: ","-weak:","[object ArrayBuffer]","push","json","gapList","restartRtcPeerConn","play","publish(streamType:","streamID","leaveBeforeUnload","sdp add probator error"," used as a key, but it is not a string.","Error","maxBitrate","layerIndex","handleMessage_","setReceiverCodecPreferences","webPage","resume audio fail, session: ","mimeType","Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver","curVideoQuality","readAsArrayBuffer","_driverSet","reviseStreamDataNormal","setLocalDescription","sysAnchor","subType","mixer task error","IpInfoService","websocket open:","errcode","SubStreamType","version",", requestID: ","denoiser start fail","getUserMedia","isWeak","sampleRate not support: ","netWeakStats","stream","NotReadableError","initAudioContext","stuckDuration","print","params","@@@@ write log to file @@@@\ncore=","wsHandler","localLog","probatorSsrc","pktssent","delete","audioTest","getChannelData","wasm no cache","ready","downlinkStats","sdpAddLayer",", video:","duration"," cname:(.*)\r?\n","wsHandleStopLive","postMessage","user","set audio element source error, ","printLocalScreenEx","FpsList","updateSubLayer",", info:","unpublishCustom","PublishIce"," before preview","subscriber error, cannot handle seq id, params: ","AudioContext","tempMuteVideo","uplinkStats","processNode","outcome","checkedStreamFirstUpload","wrapUserActionData","defineDriver","uplink weak","WebSocket","hdQualityPriority","denoiser suspend","recoverTimeout","requestId: ","recorders","a=x-google-flag:conference\r\n","publishScreenEx before preview","Published","retry","custom sharing, can not publish","user rejected the permission application","map","cameraPreviewEx","triggerSubscribeLogUpload","no file url","oldVersion","onplay","getDeviceUsingPermission","getStreamInfoByRequestID","wsHandleNegotiate Notify: params:","video/H264","pktslost","wsHandleKick","responseURL","emitPeerError","receiver","wsHandleNegotiate() params.type:","iceServers","1fVDvCm","replace stream track, bad track type","routineAudioTestReport",", streamId:","unsubscribeEnd","wsHandleUpdateName","音频无发送数据","] got a msg","MsgType","publishScreenEx, info should be string","setCodecPreferences","queue","qosLogTimer","BeiJing","SubscribeIce","DeviceType","webSQLStorage","time","muteLocalStreamScreen","wsSubscribe","document","now","request ip info error:","wrapBaseData","android","record remote not found","setSimulcastLayerConfig","stack error, "," msid:"," is not implemented by the current driver","duplicate inspire stream: ","not start yet","sinkId","getPluginLastModified","subscribeID","checkRequirement","[WS-SEND]","setSimulcastLayerBitrate","setStreamReport","setPublishLayer","permission",",mauth_userid=","audioJitter","host","onIceStateChange ext:","replace peer connection audio track error,","resetSreenFramerate","wsHandleInfoUpdated","[object Float32Array]","join to session, rejoin mode","started","onConnectionStateChange ext:","apply","isPublishFailed","wsHandleUpdateLayer","removeItem","setPluginLastModified","SELECT * FROM ","sdpAddBitrateControl","networkReportInterval","Token","wsHandleUpdateInfo","timeout","streamRemoved","addTransceiver","localDescription","***","png","join(room:","mixerTask","deltaTime","logToFile","_ready","selected","totalBitrate","subscribe error, bad response, params: ","AbortError","ceil","transaction","get wasm time: ","negotiate error, remote","bps","cameraLayers","203003","unsubscribe, stream not found","setPublishRatio, layer shoud be object","updateNetWeakStats","record error","startSpeakTime","target","createScriptProcessor"," label:(.*)\r?\n","hirtcwebsdk","setOption(options:","open","setRequestHeader","uploadTime","Received","getAudioTracks","maxListener","recordLocalScreenEx","frameWidth","open screen preview error, ","userName","stringify","wsHandleUserLeft","share","wsHandleMessage","onload","end waitStreamTimer","requestID","autoplayFix","destroy","logWarn","cityCode","E010","routineNetworkReport","publishBegin","SELECT key FROM ","createObjectURL","number","publishers","prepare websocket","audioReport(aduioid: ","ssrc","fetchRangePercentL","MixerType","muteLocalScreenEx(tag:","muteLocalCustom(status:","web page task error","isMuting","Can't call config() after localforage has been used.","otherCallFulfilled","wss://","WebPageErr","subscribeEnd",".webm","presenter","start before load","recvonly","websocket disconnected, retry","Pause","communications","click","camera","logInfo","layers","notify","sign error, ","markPermission","negotiate error, local","selectLayer","getQosUplinkData","onblocked","[startMixer]","boolean","negotiate error","advance","aoni webcam A30","negotiate error, bad msg type","close","unpublishEx","initBrowserSupported","Publish","onsuccess","turnPwd","suspended","no cache","E002","LOCALSTORAGE","pause audio fail, session: ","negotiate notify error, params:","publishScreenEx(tag:","stack","negotiate error, bad msg type, params: ","pop","dotAddress","appendChild","jitterBufferEmittedCount","put","wsPing","tokenInfo","wsUpdateNetStat","audioTrackStopped","mediaStuck","reset local description error,",", forceCache: ","first init ws, retry:","Start","PublishError","setCore","websocket closed: ","object","reqId","customLog",", status:","fromCharCode","sdp","reload audioTrack","toggleMute","Receiver","audioPacketsSent","443","webpageTask","selectLayer: layerIndex out of range","X-Sign-For","load denoiser fail ","~~local_forage_type~","minFrameRate","auidoInterval","ondataavailable","file:","elementPlay","setDNS(rules:","cmd","set same role","publish, info should be string","qosReport","web socket disconnected","publishScreenEx","audience","trackInfo,oncapturehandlechange:","[printLocalScreenEx]","serviceKey","Update","videoJitter","negotiate error, streamID: ","negotiate","onDeviceChangeCallback","regionCode",", code not zero","userAgent","stream updated, but stream not found, stream=","publish-","si16","decrypt","browser supported constraints:","decoderImplementation","audioTrack","set autoplay error,invalid dom","answer","wsPrepare","TaskCmd","local pubid:","createOffer","StreamType","ontimeout"," out of limit",", err:","localforage","setSingleLayerConfig","publish before join","create stream fail:",") success!","__PLUGIN_VERSION__","role","backCamera","emit","readyState","videoReport","stopPropagation","NS_ERROR_DOM_QUOTA_REACHED",", has audioElement: ","jitter","join to session, normal mode","already in room","wsHandleNegotiate","videoWidth","publishEx, info should be string","printLocal","report","[WS-GET]","renego","totalVideoFps","network","dns","frames","onabort","Date","loading","replaceAll","wsNegotiate",", uName:","noopener","pliCount","not found stream","websocketPingInterval","continue","audioprocess","options","getMonth","userToken","publishEx","join error,","record","subStreams","driver","wsHandleStreamAdded","ParamsError","mfsip","reconnectStream","setDevice","onicecandidate","reconnectTimeout","forceCache","ErrorCode","_initDriver","onconnectionstatechange","getDriver","logTrackInfo","webkitAudioContext","floor","getQosDownlinkData","videoFPSSent","codecs","muteLocalReturnData","shift","local",", streamType:","Publisher","constructor","LOG_TYPE","getTargetBw","change ","setRole","videoBytesReceived","muteLocalEx(tag:","kick"," WHERE key = ?",",muted:","stuckData:","setDriver","emitNetworkReport","timestamp","InvalidStateError","sett simulcast layer bitrate error, ","unpublish error, bad response","getItem","getResponseHeader","wsHandleUpdateNetStat","srcObject","Warn","Info","unsupport plugin","open screen error","Leave","applyConstraints success","nackCount","msgId",", muteVideo:","replace","POST","Stop","setItem","audioPktsLost","lastLocalMuteAudio","core","screenEnableAudio","getDeviceUsingPermission after await navigator.mediaDevices.getUserMedia(constrains)","websocket error,","port1",", time: ","roomName","publishCustom, info should be string","audiolevel","promise","P000","[native code","no audio track, cant set framerate",", local: ","publishScreenEx before join","request ip info error","ice conn change to","serializer","routineCheckStreamFirstUpload","3719880xTeVEa",", ready:","get","canvas",", code: ","[pauseWebPage]","room service response error, token info error,","_config","clearRect","print ","publishEx(tag:","audioPktsRcvd","replace screen track error","on error, ip request deprecated, msgId: ","currentRoundTripTime","allSettled","getDeviceList","common","clockRate","startLowBitrateTime","videoFreezeLog",", layerIndex:","layout","stopped","1.0.4.2024042434","screenEx","setCustomProfile","customLayers","deviceChanged","unsubscribe(publishIDorTag:","responseText","negotiate error, drop not found stream, params: ","videoNoSentTimes","onFulfilled"," label:","prepare ice reconnection","MutationObserver","MAuth realm=http://marte3.dit.upm.es,mauth_signature_method=HMAC_SHA1","Subscriber","https://brs-hirtc.hismarttv.com/v1/auth/token","requestTimeout","targetBitrate","offer:","previewScreenEx(vodeo.id:","Subscribe","serialize","updateInfo","you browser does not support output device selection","Driver not found.","availableOutgoingBitrate","hidden","Database version must be a number.","room service response error, no token info","replaceStreamTrack","closeRtcPeerConn","dbReady","E004","publicCloud","port2","selectLayer(subscriberID:","userAgent: ","ask for permission error, no valid device,","displaySurface","videoPktsLost","deferredOperations","ipInfoRetryCount","videoOut","NotSelectDevice","setDenoiserConstraints","WebKitMutationObserver","rel","bind","videoDelay",'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.',"a=ssrc:","errdesc","unsubscribeBegin","wsMessage","video","4FSqMdz","frameRate","mute","DROP TABLE IF EXISTS ","videoRemoteIn","removeListener(","key","weak",", params:","audioCodec","a=fmtp:[a-z0-9 -=]*packetization-mode=1;","application/json, text/javascript, */*","negotiate error, drop not found stream ","streamAudioReport","getAudioConstraints","getAttribute","no audio device","audioLevelLog","peerError","selfAESDecrypt","getDownlinkNetworkReport","ui32","wsHandleJoin","packetsSent","sender","releaseAudioTestProcessor",",document:","clearnStreamNetData","enabled","preview audio error, ","negotiate error, stream id not found, params: ","wsPublish","record stream","you were in room already","203005","toLowerCase"," (key, value) VALUES (?, ?)","deviceID needed, should be string","streamInfo.ready:","random","spanDuration","onreadystatechange","subscriber error, code not zero, params: ","If-None-Match","mozCaptureStream","unpublishScreenEx","resetStreamData","getStreamNetLevel","publicIP"," in subscribing process or subscribed already","Joined","getTransceivers","getAllResponseHeaders",", sdp:","setCustomProfile: videoElement error","video-","findCorrectBackCamera","sourceAudioTrack","wsMixer","packetsLost","trackInfo,onunmute:","startFrameRateCheck","muteLocalStream","bytesSent","1055905oAGatF","enableInspire","getWasm fail: response no data","find","echoCancellation","triggerLogUpload","310541ySmCcm","a=ssrc-group:SIM","callRejected",") failed, not function found!","iterator","cityInfo","getParameters","setMaxListeners","previewEx","canvasInterval","candidate","buffer","both audio and video have been disabled","videoInputID","statement","message","log","streamAdded","getStreamInfo","wsHandlePublish(","application/x-www-form-urlencoded; charset=utf-8","sdpMid","Media","[setVideoOption]","ipReqId","logReport","capabilities","getPluginStatus","createMediaStreamSource","checkQosDownlinkError","connectionState failed ext:","sort","iceConnectionState","stuckDuration: ","stopFrameRateCheck","printLocalEx","ConnectionError","publishEnd","min","removeListener","contains","AllDisabled","layerscount",", type: ","SELECT COUNT(key) as c FROM ","wsUnPublish","getWasm","post","joinBegin","rows","firstDataDownloaded","tempVideoElem","denoiser resume","serviceID","setSenderCodecPreferences","saveAs","isInspired","wsHandlePublish","cameraChangePreview","getHours","ip request: ","cannot set simulcast layers bitrate, getParameters or setParameters is not available","charCodeAt","Redefining LocalForage driver: ","onstop","Promise","interval","setSimulcastLayerEncoding","resume","isWsOpen","oniceconnectionstatechange","forEach","parse","monitor","stop","create session description error, ",",readyState:","negotiate notify failed, streamInfo.id:","setAudioElementStream","emitPreviewError","wsUpdateLayer","slice","handle preview error","x5-playsinline","restart ice ok, prepare ice negotiation","videoRemoteInList","enableProbator","lastRequestID","startNormalBitrateTime","framesDecoded","length","NotAllowedError","useCache","audioInputID","session","publishedEx",", subscribeID:","[object Uint16Array]","clone","devices","freezeCount","h264DecodeSupported","response no data","LogType","update","concat","split","disconnect","sourceNode","ice connection state: failed","audioContext add module success","fetchRangePercentH","wasm has cache","someoneJoined","clear","setCustomProfile: custom not preview yet","StreamRole","reconnect stream ","audioDelay","leave()","unableAutoPlay","bytesReceived","sysAudience","audiooutput","chunks","logIndex","muteAllStreamAudio","waitStreamTimer","signature","Notify","isBindWindowEvent","createObjectStore","wsHandleSubscribe","subscribe-","reconnect","src","unshift","denoiser create: ","getConfig","bytessent","joinEnd","disconnected","routineStuckLog","web page notify error: ","keyPrefix","framesPerSecond","custom","qosError, errtype: ","Area","loadedmetadata","setImmediate","unpublishEnd","remoteCandidate","addListener","tryPreview","qosUploadInterval","SYNTAX_ERR","Unpublished","downloadPlugin: ","screenshot remote before subscribe","sdpAddGroup","PreviewAlready","unload","NotFoundError","FULL HD webcam","totalInterruptionDuration","canvasTimer"," play success","canplay","remote","httpRequest","joinReqId","Network Error","wsLeave","replace peer connection video track error,","room response error","keyvaluepairs","tempMuteAudio","154","[object Array]","streamid","getStats","RecordError","change simulcast layer active, ","SUCCESS","DELETE FROM ","audioPktsSent",", id: ","LogLevel","request ip info error, ","connected","E001","multicast","wrapErrorData","videoFrameHeight","denoiser already loaded","sampleNum",".*\r?\n","autoInsertScreen","audioRtt","no need subscribe recover","responseType","getStreamReport","reviseStreamDataRejoining","subscribeRecover","wsUnsubscribe","cameraExLayers","weakDuration","setRole:","stuckLogTimer","sessionStorage","name","dropInstance","enableDenoiser","getNetLevel","objectStoreNames","SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'","hasOwnProperty",'" already exists.',"begin audio test, sampling: ","selectLayer: no subscriberID","act","getPubIdBySubId","init websocket error","anonymous","triggerPublishLogUpload","cleanStreamData","[message] sent a msg to"," , area:","Screen",'" until all open connections are closed',"audioNoRcvdTimes","headers","payloadType","userID","height","wsBaseEvent","videoBytesSent","publishedCustom","onRejected","negotiate error, type: failed, streamID: ","set session description error, err:","loaded","wsHandleLayerReqChanged","camera had been preview already","getLayersByStreamInfo","dot","Unknown","ping","480PYyMpY","Subscribed","203001","Utf8","kind","negotiate error, stream id not found","recordScreen","unsubscribe error, bad response","getTracks","request room error","audioNoSentTimes","roundTripTime","E012","[updateMixer]","unpublishBegin","before subscribe","wsUpdateRoom","closed","supported","receive user stream added but user not found","port","\noptions="];return(P=function(){return e})()}var x={ios:R,iosVer:C,android:T[t(199)](t(934))>-1||T.indexOf("adr")>-1,androidVer:T.match(/android (.*?);/),isSafari:L},O="undefined"!=typeof globalThis?globalThis:typeof window!==t(297)?window:"undefined"!=typeof global?global:typeof self!==t(297)?self:{};function A(e){throw new Error('Could not dynamically require "'+e+t(1358))}var N={exports:{}};N[e(719)]=function t(r,o,n){const i=e;function s(i,c){const u=e;if(!o[i]){if(!r[i]){var d="function"==u(513)&&A;if(!c&&d)return d(i,!0);if(a)return a(i,!0);var l=new Error(u(567)+i+"'");throw l.code=u(266),l}var p=o[i]={exports:{}};r[i][0][u(228)](p[u(719)],(function(e){return s(r[i][1][e]||e)}),p,p[u(719)],t,r,o,n)}return o[i][u(719)]}for(var a="function"==i(513)&&A,c=0;c=43)}}))[r(432)]((function(){return!1}))}function b(e){return"boolean"==typeof De?Ee.resolve(De):m(e).then((function(e){return De=e}))}function v(t){const r=e;var o=Te[t[r(1645)]],n={};n[r(1275)]=new Ee((function(e,t){n[r(1725)]=e,n.reject=t})),o[r(1349)][r(801)](n),o[r(1340)]?o[r(1340)]=o.dbReady[r(515)]((function(){return n[r(1275)]})):o[r(1340)]=n.promise}function y(t){const r=e;var o=Te[t[r(1645)]].deferredOperations[r(1085)]();if(o)return o[r(1725)](),o[r(1275)]}function h(t,r){const o=e;var n=Te[t[o(1645)]][o(1349)][o(1085)]();if(n)return n.reject(r),n[o(1275)]}function g(t,r){return new Ee((function(o,n){const i=e;if(Te[t[i(1645)]]=Te[t.name]||L(),t.db){if(!r)return o(t.db);v(t),t.db[i(1070)]()}var s=[t[i(1645)]];r&&s[i(801)](t[i(832)]);var a=Ie[i(1004)][i(962)](Ie,s);r&&(a.onupgradeneeded=function(e){const r=i;var o=a[r(377)];try{o[r(1565)](t.storeName),e[r(897)]<=1&&o.createObjectStore(ke)}catch(o){if(r(580)!==o.name)throw o;console.warn(r(294)+t[r(1645)]+r(422)+e[r(897)]+" to version "+e.newVersion+r(470)+t[r(734)]+r(1652))}}),a[i(738)]=function(e){e[i(691)](),n(a.error)},a[i(1074)]=function(){var r=a.result;r.onversionchange=function(t){const r=e;t.target[r(1070)]()},o(r),y(t)}}))}function w(e){return g(e,!1)}function S(e){return g(e,!0)}function I(t,r){const o=e;if(!t.db)return!0;var n=!t.db[o(1649)][o(1474)](t[o(734)]),i=t[o(832)]t.db[o(832)];if(i&&(t.version!==r&&console[o(678)](o(294)+t[o(1645)]+o(504)+t.db.version+" to version "+t[o(832)]+"."),t[o(832)]=t.db[o(832)]),s||n){if(n){var a=t.db.version+1;a>t.version&&(t[o(832)]=a)}return!0}return!1}function E(t){return new Ee((function(r,o){const n=e;var i=new FileReader;i.onerror=o,i[n(237)]=function(e){const o=n;var i=btoa(e[o(999)].result||"");r({__local_forage_encoded_blob:!0,data:i,type:t[o(558)]})},i[n(413)](t)}))}function k(t){const r=e;return c([f(atob(t.data))],{type:t[r(558)]})}function D(e){return e&&e.__local_forage_encoded_blob}function T(t){const r=e;var o=this,n=o[r(1735)]()[r(515)]((function(){const e=r;var t=Te[o._dbInfo[e(1645)]];if(t&&t[e(1340)])return t[e(1340)]}));return d(n,t,t),n}function R(t){const r=e;v(t);for(var o=Te[t[r(1645)]],n=o[r(1762)],i=0;i0&&(!t.db||i(1244)===e[i(1645)]||i(1597)===e.name))return Ee[i(1725)]().then((function(){const r=i;if(!t.db||r(1597)===e.name&&!t.db[r(1649)].contains(t[r(734)])&&t[r(832)]<=t.db.version)return t.db&&(t.version=t.db.version+1),S(t)}))[i(515)]((function(){return R(t).then((function(){C(t,r,o,n-1)}))}))[i(432)](o);o(e)}}function L(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function P(t){const r=e;function o(){return Ee.resolve()}var n=this,i={db:null};if(t)for(var s in t)i[s]=t[s];var a=Te[i[r(1645)]];a||(a=L(),Te[i[r(1645)]]=a),a.forages[r(801)](n),n[r(1735)]||(n[r(1735)]=n[r(854)],n[r(854)]=T);for(var c=[],u=0;u>4,p[d++]=(15&i)<<4|s>>2,p[d++]=(3&s)<<6|63&a;return l}function J(t){const r=e;var o,n=new Uint8Array(t),i="";for(o=0;o>2],i+=xe[(3&n[o])<<4|n[o+1]>>4],i+=xe[(15&n[o+1])<<2|n[o+2]>>6],i+=xe[63&n[o+2]];return n[r(1524)]%3==2?i=i.substring(0,i[r(1524)]-1)+"=":n.length%3==1&&(i=i[r(759)](0,i[r(1524)]-2)+"=="),i}function H(t,r){const o=e;var n="";if(t&&(n=Ze[o(228)](t)),t&&(o(800)===n||t[o(1445)]&&"[object ArrayBuffer]"===Ze[o(228)](t.buffer))){var i,s=Ne;t instanceof ArrayBuffer?(i=t,s+=Ve):(i=t.buffer,o(685)===n?s+=We:o(368)===n?s+=Be:"[object Uint8ClampedArray]"===n?s+=Ue:"[object Int16Array]"===n?s+=Fe:o(1531)===n?s+=He:o(281)===n?s+=Je:"[object Uint32Array]"===n?s+=Ge:o(958)===n?s+=qe:o(425)===n?s+=Xe:r(new Error(o(1761)))),r(s+J(i))}else if(o(1811)===n){var a=new FileReader;a[o(1018)]=function(){var e=Oe+t[o(558)]+"~"+J(this.result);r(Ne+je+e)},a[o(821)](t)}else try{r(JSON[o(1014)](t))}catch(e){console.error(o(761),t),r(null,e)}}function G(t){const r=e;if(t[r(759)](0,Me)!==Ne)return JSON[r(1506)](t);var o,n=t[r(759)](_e),i=t[r(759)](Me,_e);if(i===je&&Ae[r(189)](n)){var s=n[r(1751)](Ae);o=s[1],n=n[r(759)](s[0].length)}var a=F(n);switch(i){case Ve:return a;case je:return c([a],{type:o});case We:return new Int8Array(a);case Be:return new Uint8Array(a);case Ue:return new Uint8ClampedArray(a);case Fe:return new Int16Array(a);case He:return new Uint16Array(a);case Je:return new Int32Array(a);case Ge:return new Uint32Array(a);case qe:return new Float32Array(a);case Xe:return new Float64Array(a);default:throw new Error("Unkown type: "+i)}}function q(t,r,o,n){const i=e;t[i(283)](i(637)+r[i(734)]+i(379),[],o,n)}function X(t){const r=e;var o=this,n={db:null};if(t)for(var i in t)n[i]=r(645)!=typeof t[i]?t[i][r(339)]():t[i];var s=new Ee((function(t,i){const s=r;try{n.db=openDatabase(n[s(1645)],String(n[s(832)]),n[s(1723)],n.size)}catch(e){return i(e)}n.db[s(988)]((function(r){q(r,n,(function(){o[e(1800)]=n,t()}),(function(e,t){i(t)}))}),i)}));return n.serializer=ze,s}function _(t,r,o,n,i,s){const a=e;t[a(283)](o,n,i,(function(e,t){const c=a;t[c(634)]===t[c(1590)]?e[c(283)](c(173),[r[c(734)]],(function(e,a){const u=c;a[u(1483)].length?s(e,t):q(e,r,(function(){e[u(283)](o,n,i,s)}),s)}),s):s(e,t)}),s)}function Z(t,r){var o=this;t=l(t);var n=new Ee((function(r,n){const i=e;o[i(854)]()[i(515)]((function(){const e=i;var s=o[e(1800)];s.db[e(988)]((function(o){const i=e;_(o,s,i(967)+s[i(734)]+i(1709),[t],(function(e,t){const o=i;var n=t.rows[o(1524)]?t[o(1483)][o(722)](0)[o(428)]:null;n&&(n=s[o(1283)][o(1739)](n)),r(n)}),(function(e,t){n(t)}))}))}))[i(432)](n)}));return u(n,r),n}function z(t,r){var o=this,n=new Ee((function(r,n){const i=e;o.ready()[i(515)]((function(){const e=i;var s=o[e(1800)];s.db[e(988)]((function(o){const i=e;_(o,s,i(967)+s[i(734)],[],(function(e,o){const n=i;for(var a=o[n(1483)],c=a[n(1524)],u=0;u0)return void s(Y.apply(i,[t,u,o,n-1]));a(e)}}))}))}))[c(432)](a)}));return u(s,o),s}function Q(e,t,r){return Y.apply(this,[e,t,r,1])}function K(t,r){var o=this;t=l(t);var n=new Ee((function(r,n){const i=e;o.ready()[i(515)]((function(){const e=i;var s=o[e(1800)];s.db[e(988)]((function(o){const i=e;_(o,s,i(1619)+s[i(734)]+i(1238),[t],(function(){r()}),(function(e,t){n(t)}))}))}))[i(432)](n)}));return u(n,r),n}function $(t){var r=this,o=new Ee((function(t,o){const n=e;r[n(854)]()[n(515)]((function(){var n=r._dbInfo;n.db.transaction((function(r){_(r,n,"DELETE FROM "+n[e(734)],[],(function(){t()}),(function(e,t){o(t)}))}))}))[n(432)](o)}));return u(o,t),o}function ee(t){var r=this,o=new Ee((function(t,o){const n=e;r.ready().then((function(){const n=e;var i=r[n(1800)];i.db[n(988)]((function(e){const r=n;_(e,i,r(1478)+i[r(734)],[],(function(e,o){const n=r;var i=o[n(1483)][n(722)](0).c;t(i)}),(function(e,t){o(t)}))}))}))[n(432)](o)}));return u(o,t),o}function te(t,r){var o=this,n=new Ee((function(r,n){const i=e;o[i(854)]()[i(515)]((function(){const e=i;var s=o[e(1800)];s.db[e(988)]((function(o){const i=e;_(o,s,i(1028)+s.storeName+i(330),[t+1],(function(e,t){const o=i;var n=t.rows[o(1524)]?t[o(1483)].item(0)[o(1370)]:null;r(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return u(n,r),n}function re(t){var r=this,o=new Ee((function(t,o){const n=e;r[n(854)]()[n(515)]((function(){const e=n;var i=r[e(1800)];i.db[e(988)]((function(r){const n=e;_(r,i,n(1028)+i[n(734)],[],(function(e,r){const o=n;for(var i=[],s=0;s0}function ue(t){const r=e;var o=this,n={};if(t)for(var i in t)n[i]=t[i];return n[r(1578)]=se(t,o[r(671)]),ce()?(o[r(1800)]=n,n[r(1283)]=ze,Ee.resolve()):Ee[r(212)]()}function de(t){const r=e;var o=this,n=o[r(854)]()[r(515)]((function(){const e=r;for(var t=o[e(1800)][e(1578)],n=localStorage[e(1524)]-1;n>=0;n--){var i=localStorage[e(1370)](n);0===i.indexOf(t)&&localStorage[e(965)](i)}}));return u(n,t),n}function le(t,r){const o=e;var n=this;t=l(t);var i=n[o(854)]()[o(515)]((function(){const e=o;var r=n[e(1800)],i=localStorage.getItem(r[e(1578)]+t);return i&&(i=r.serializer[e(1739)](i)),i}));return u(i,r),i}function pe(t,r){const o=e;var n=this,i=n[o(854)]()[o(515)]((function(){const e=o;for(var r=n[e(1800)],i=r[e(1578)],s=i.length,a=localStorage.length,c=1,u=0;u=0;r--){var n=localStorage[t(1370)](r);0===n[t(199)](e)&&localStorage[t(965)](n)}})):Ee[o(212)](o(1813)),r),i}function ge(t,r){t[r]=function(){const o=e;var n=arguments;return t[o(854)]()[o(515)]((function(){const e=o;return t[r][e(962)](t,n)}))}}function we(){const t=e;for(var r=1;r{e&&(W=JSON[t(1506)](e))}));var J={get:F,set:U,getPluginEtag:function(){return F(t(310))||""},setPluginEtag:async function(e){U(t(310),e)},getPluginLastModified:function(){return F(t(785))||""},setPluginLastModified:async function(e){U(t(785),e)},getWasm:async function(){return await B.getItem("wasm")||""},setWasm:async function(e){e&&typeof e===t(645)&&await B.setItem("wasm",e)}};const H={created:"created",loading:t(1189),loaded:"loaded",started:t(960),suspended:t(1076),stopped:t(1308)};var G={create:function(e={}){const r=t,n=r(1164),i=r(783);let s={log:!0,useCache:!1},a=e[r(847)],c=null,u={setConfig:function(e){const t=r;e&&Object[t(1772)](s,e)},getConfig:function(){return s},isStarted:b,isDownloaded:function(){const e=r;return!(!c||!c[e(369)])},getWasm:l,load:async function(){const e=r;a[e(1055)]("denoiser load: "+s[e(557)]+", use cache: "+s[e(1526)]);let t="";if(!window[e(698)])return t="not support WebAssembly",a[e(1023)](t),Promise[e(212)](new Error(t));if(!window[e(872)]||!window.AudioWorkletNode)return t=e(765),a[e(1023)](t),Promise[e(212)](new Error(t));if(!s[e(557)])return t=e(559),a[e(1023)](t),Promise[e(212)](new Error(t));try{if(m())a[e(1055)](e(1629));else{const o=[16e3,32e3,48e3],n=new AudioContext({sampleRate:48e3});if(-1===o[e(199)](n.sampleRate))return t=e(837)+n.sampleRate,a[e(1023)](t),n[e(1070)](),Promise[e(212)](new Error(t));if(u[e(195)]=u[e(1189)],await l(s[e(557)],s[e(1214)]),function(){const e=r;return u[e(195)]===H[e(1308)]}())return Promise[e(212)]("denoiser has stopped");d({context:n});let p=s[e(690)]||i;await c.context[e(538)].addModule(p)}return u[e(195)]===H[e(1189)]&&(u[e(195)]=H[e(1676)]),a[e(1055)](e(791)+c[e(261)][e(1778)]),!0}catch(t){return a[e(1023)]("denoiser load fail",t[e(339)]()),Promise.reject(t)}},start:async function(e){const t=r;a.logInfo(t(1722)+!!e);let o="";if(!f(e))return Promise.reject(new Error(t(686)));if(!m())return o=t(1048),a[t(1023)](o),Promise.reject(new Error(o));try{b()&&(c.sourceNode.disconnect(),c[t(875)][t(1541)](),p(c[t(1819)][t(839)]));const r=new MediaStream([e[t(1008)]()[0]]),o=c[t(261)][t(1462)](r),n=c[t(875)]||new AudioWorkletNode(c[t(261)],t(600),{processorOptions:{jsCode:c[t(369)]}}),i=c[t(261)].createMediaStreamDestination();return o.connect(n),n[t(265)](i),c.sourceNode=o,c[t(875)]=n,c.destinationNode=i,c[t(369)]="",c.context[t(195)]===t(1076)&&await c[t(261)].resume(),u[t(195)]=H[t(960)],a[t(1055)]("denoiser start success"),i[t(839)]}catch(e){return v(),a[t(1023)](t(834),e[t(339)]()),Promise[t(212)](e)}},replace:function(e){const t=r;if(a[t(1055)]("denoiser replace: "+!!e),!f(e))return!1;if(!b()){let e="not start yet";return a[t(1023)](e),!1}const o=e[t(1008)]()[0],n=new MediaStream([o]),{context:i,sourceNode:s,processNode:u,destinationNode:d}=c,l=i[t(1462)](n);return s.disconnect(),l[t(265)](u),c[t(1542)]=l,d[t(839)]},suspend:async function(){const e=r;if(a.logInfo(e(883)),!b()){let t=e(941);return a.logWarn(t),Promise[e(212)](new Error(t))}let t=await c[e(261)].suspend();return u[e(195)]=H[e(1076)],t},resume:async function(){const e=r;if(a[e(1055)](e(1486)),!b()){let t=e(941);return a.logWarn(t),Promise[e(212)](new Error(t))}let t=await c[e(261)][e(1502)]();return u.state=H[e(960)],t},stop:v,state:H[r(548)]};function d(e){const t=r;e?(!c&&(c={}),Object[t(703)](e)[t(1505)]((t=>{c[t]=e[t]}))):c=null}async function l(e,t=!1){const n=r;let i={},s=null,u=J[n(321)](),l=J[n(943)](),p=Date.now();a[n(1055)](n(493)+u+n(1794)+l+n(1096)+t),u&&(i[n(1407)]=u),l&&(i[n(323)]=l);try{s=c&&c.jsCode?c[n(369)]:await J.getWasm()}catch(e){a[n(1023)](e.toString())}if(!s&&(i={},a[n(1055)](n(853))),t)return s?(d({jsCode:s}),a[n(1055)](n(989)+(Date[n(931)]()-p)),s):Promise[n(212)](new Error(n(1077)));let f=null;try{f=await o({url:e,method:n(1287),responseType:"text",timeout:3e4,headers:i,widthRequest:!0})}catch(e){a[n(1023)](n(702),e.toString()),f={request:{status:999}}}let m=f.request[n(313)];if(a[n(1055)]("status: "+m+n(1271)+(Date[n(931)]()-p)),200===m){try{J.setWasm(f[n(1773)]);let e=f[n(522)][n(1248)]("ETag"),t=f.request[n(1248)]("Last-Modified");e&&J[n(322)](e),t&&J[n(966)](t)}catch(e){a[n(1023)](n(355),e[n(339)]())}return d({jsCode:f[n(1773)]}),f.data}return s?(a[n(1055)]("use wasm cache"),d({jsCode:s}),s):(a[n(1023)](n(1430)),Promise[n(212)](new Error(n(1536))))}function p(e){const t=r;e[t(1008)]().forEach((e=>e[t(1508)]()))}function f(e){const t=r;if(!(e instanceof MediaStream))return a[t(1023)]("not MediaStream"),!1;return 0!==e[t(1008)]()[t(1524)]||(a[t(1023)](t(1830)),!1)}function m(){return c&&c[r(261)]}function b(){const e=r;return m()&&c[e(875)]}async function v(){const e=r;if(a[e(1055)]("denoiser stop"),u[e(195)]=H[e(1308)],m()){const t=c;d(null);try{await t.context[e(1070)](),t[e(875)]&&(t[e(875)][e(1703)][e(861)]({action:e(1022)}),t[e(875)][e(1541)]()),t[e(1542)]&&t[e(1542)].disconnect(),t.destinationNode&&p(t[e(1819)][e(839)])}catch(t){a[e(1023)](e(285)+t[e(339)]())}}}return e[r(339)]()===r(659)&&Object[r(1772)](s,e),!s[r(1450)]&&(a={logInfo:()=>{},logWarn:()=>{},logError:()=>{}}),a.logInfo(r(1571)+n),l("",!0)[r(515)]((()=>{const e=r;a[e(1055)](e(1546))}))[r(432)]((()=>{})),u},STATE:{...H}};function q(){const n=t;let i={publicCloud:!0,debug:!1,logSize:2e3,deltaTime:0,serviceID:"",serviceKey:"",forceArea:!1,autoPublishCamera:!1,cameraEnableVideo:!0,cameraEnableAudio:!0,muteCameraVideo:!1,muteCameraAudio:!1,autoPublishScreen:!1,screenEnableVideo:!0,screenEnableAudio:!1,muteScreenVideo:!1,muteScreenAudio:!1,autoSubscribe:!1,autoRecovery:!0,enableQosReport:!1,enableLogUpload:!0,enableDenoiser:!1,Services:{BasicRoomServiceToken:t(1324),IpInfoService:"https://bas-web.hismarttv.com/1.0/bas/ip/info"},requestTimeout:5e3,websocketPingInterval:1e3,qosUploadInterval:5e3,stuckLogInterval:600,networkReportInterval:5e3,cameraLayers:[{width:320,height:180,frameRate:20,targetBw:16e4,layerIndex:0},{width:640,height:360,frameRate:20,targetBw:5e5,layerIndex:1},{width:1280,height:720,frameRate:20,targetBw:11e5,layerIndex:2}],cameraExLayers:[{width:320,height:180,frameRate:20,targetBw:16e4,layerIndex:0},{width:1280,height:720,frameRate:20,targetBw:11e5,layerIndex:1}],screenLayers:[{width:1920,height:1080,frameRate:15,targetBw:15e5,layerIndex:0}],customLayers:[{width:1920,height:1080,frameRate:15,targetBw:15e5,layerIndex:0}],maxListener:10,supported:{},publicIP:"",ispCode:"",countryCode:"",regionCode:"",cityCode:"",hdQualityPriority:!1,enableProbator:!1,leaveBeforeUnload:!0,audioLevelLog:!0,peerErrorEvent:!1,subscribeAutoRecover:!1,autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0,videoFreezeLog:!1,autoplayFix:!1},s=new k({globalOptions:i}),a=new D({localLog:s}),c=window.saveAs,u=window.AudioContext||window[n(1220)]||null,d=window.MediaRecorder||null,l=window.AudioWorkletNode||null,p={};p[n(332)]=a,p[n(847)]=s,p[n(1199)]=i,p.core={retry:0,status:0,roomName:"",userID:"",userName:"",userArea:"",userToken:0,session:"",stunURL:"",turnURL:"",turnUser:"",turnPwd:"",publicIP:"",ispCode:"",countryCode:"",regionCode:"",cityCode:"",ipReqId:"",joinReqId:"",userRole:0,ipInfoMaxRetryCount:3,ipInfoRetryCount:0,permission:{audio:!1,video:!1},camera:{local:!0,type:n(1054),preview:!1,muteAudio:!0,muteVideo:!0,ready:!1,id:null,pc:null,candidate:[],stream:new MediaStream,audioTrack:null,videoTrack:null,lastRequestID:"",info:{app:"",rtc:"",act:0}},cameraEx:{},screen:{local:!0,type:n(575),preview:!1,muteAudio:!1,muteVideo:!1,ready:!1,id:null,pc:null,candidate:[],stream:new MediaStream,audioTrack:null,videoTrack:null,lastRequestID:"",info:{app:"",rtc:"",act:0},subType:"screen"},custom:{local:!0,type:n(575),preview:!1,muteAudio:!1,muteVideo:!1,ready:!1,id:null,pc:null,candidate:[],stream:null,audioTrack:null,videoTrack:null,lastRequestID:"",info:{app:"",rtc:"",act:0},subType:"custom",label:"media playback"},audioTest:{local:!0,type:"aduioTest",sampling:200,stream:null,audioLevel:0,levelList:[]},users:{},publishers:{},devices:{audioinput:"",audiooutput:"",videoinput:"",detail:{audioinput:[],audiooutput:[],videoinput:[]},lastvideoinput:""},unableAutoPlay:[],reconnectingStreams:{},network:{const:{rttMin:50,rttMax:200,fractionLostMin:5,fractionLostMax:10,delayMin:80,delayMax:300,jitterMin:80,jitterMax:400,kMinVideoBitrate:6e4,kMinVideoBitrate2:3e5,kMinVideoFrameRate:2,kMaxExpiredNetLevelStatInMs:1e4,kScreencastStreamBWJitterRatio:.4,kNetUpWeakBitrate:6e4,kNetDownWeakLevel:1,kNetDownWeakFps:5,networkQuality:{unknown:0,vbad:1,bad:2,poor:3,good:4,excellent:5}},uplinkStats:{},downlinkStats:{},netWeakStats:{}},wsBaseEvent:{onOpen:null,onClose:null,onMessage:null,onError:null},dType:10,curVideoQuality:2,userActionData:{},stuckData:{},probatorSsrc:1234,isBindWindowEvent:!1,muteAllStreamAudio:!1,peerErrorEvent:{}},p[n(1185)]={},p[n(760)]=G.create({localLog:s,globalOptions:i}),p[n(384)]=function(){const e=n;p[e(1266)].status=0,p[e(1266)][e(1201)]=0,p.core.session="",p[e(1266)][e(820)]=2,Object[e(1706)](p[e(1155)])[e(1505)]((t=>{const r=e;p[r(1266)][t].id="",p[r(1266)][t].pc=null,p.core[t][r(1444)]=[],p[r(1266)][t].ready=!1,p[r(1266)][t][r(1521)]="",p.core[t][r(1822)]=!1,p.core[t].muteVideo=!1,p.core[t][r(813)]=-1})),p[e(1266)][e(752)]={},p[e(1266)].unableAutoPlay=[],p[e(1266)].users={},p[e(1266)][e(1031)]={},p[e(1266)][e(1823)]={},p[e(1266)][e(1184)].uplinkStats={},p[e(1266)][e(1184)][e(855)]={},p[e(1266)][e(1184)][e(838)]={}},p.setCore=function(e={}){const t=n;!e instanceof Object||Object[t(703)](e)[t(1505)]((r=>{const o=t;p[o(1266)][o(1651)](r)&&(p[o(1266)][r]=e[r])}))},p[n(636)]=function(e=""){const t=n;if(e&&p[t(1266)][t(1651)](e))return p[t(1266)][e]},p[n(1072)]=function(){const e=n;if(navigator[e(796)]&&(!p[e(1199)][e(1701)]||0===Object[e(703)](p[e(1199)].supported)[e(1524)])){let t=navigator[e(796)].getSupportedConstraints();t&&Object.keys(t)[e(1524)]>0&&(s.logInfo(e(1146),t),p[e(1199)][e(1701)]=t)}},p.getBrowserSupported=function(e=""){const t=n;return e&&p[t(1199)].supported&&p[t(1199)][t(1701)][e]||!1},p.bindWindowEvent=function(){const e=n;i[e(808)]&&!p[e(1266)][e(1564)]&&(window.addEventListener(e(1596),(()=>{const t=e;i[t(808)]&&p.leaveRoom(),p.denoiser[t(1508)]()})),p.core.isBindWindowEvent=!0)},p[n(474)]=function(e={}){const t=n;e.serviceID&&(s[t(1055)](t(1728)+r),s[t(1055)](t(1345)+navigator[t(1141)])),p.initBrowserSupported(),!e instanceof Object||(null!=typeof e[t(1776)]&&e.debug&&s[t(1055)](t(1003)+JSON.stringify(e)+")"),Object[t(703)](e)[t(1505)]((r=>{const o=t;o(1487)!==r&&o(1133)!=r&&(typeof e[r]===o(1102)?s[o(1055)](r+":"+JSON[o(1014)](e[r])):s[o(1055)](r+":"+e[r])),p[o(1199)][o(1651)](r)&&(r==o(573)?Object.keys(e[r]).forEach((t=>{const n=o;p.options[r][n(1651)](t)&&(p[n(1199)][r][t]=e[r][t])})):p[o(1199)][r]=e[r])})),(""==p[t(1199)][t(1487)]||""==p.options[t(1133)])&&s[t(485)](t(1849)+p[t(1199)][t(1487)]+" or serviceKey:"+p[t(1199)][t(1133)]),b[t(374)]({publicCloud:p[t(1199)][t(1342)]},o),p[t(442)]())},p[n(452)]=function(e=""){const t=n;if(!e)return"";let r=Object[t(703)](p[t(1185)])||[];for(let o=0,n=r[t(1524)];o=0){let r=p[t(1185)][n];e[t(1190)]?e=e[t(1190)](n,r):e=(e=e[t(1260)](n,r)).replace(n,r);break}}return e},p[n(1604)]=function(e=n(1481),t="",r={},i={},a=S,c=S){const u=n,d={method:e,url:p[u(452)](t),timeout:p.options[u(1325)],contentType:u(420)};i instanceof Object&&Object.keys(i)[u(1524)]>0&&(d[u(1666)]=i),e===u(1287)?d[u(844)]=r:d[u(1773)]=JSON[u(1014)](r),o(d).then((e=>{a(e)}))[u(432)]((e=>{c(e)})),s.logInfo(e+" http request:"+JSON[u(1014)](d))},p[n(1582)]={Unknown:"0",BeiJing:"1",ShangHai:"2",GuangZhou:"3"},p[n(1155)]={Camera:n(1054),Screen:"screen"},p.SubStreamType={Camera:n(1054),Screen:n(575),Custom:n(1580)},p[n(1550)]={Publisher:"publisher",Subscriber:"subscriber"},p[n(918)]={Request:"request",Response:"response",Notify:n(1057)},p[n(499)]={Audio:n(341),Video:"video"},p[n(925)]={AudioInput:"audioinput",VideoInput:n(673),AudioOutput:n(1557)},p.MediaType={Audio:n(341),Video:"video",Screen:n(575)},p[n(1036)]={Live:1,Record:2},p[n(1152)]={Start:"start",Stop:n(1508),Pause:n(200),Play:n(805),Update:n(1538)},p[n(1215)]={PermissionError:n(1276),ParamsError:n(644),JoinError:n(1625),PreviewError:n(1078),PublishError:n(529),SubscribeError:n(1341),ConnectionError:n(720),SetDeviceError:n(603),RecordError:n(666),PrintError:n(778),UpdateInfoErr:n(1809),MixerErr:n(1025),WebPageErr:n(1840),RequestIpInfoErr:n(1695),SetRoleError:"E013"},p[n(682)]={P000:n(725),E000:n(556),E001:n(347),E002:n(1516),E003:n(483),E004:n(1802),E005:n(276),E006:n(205),E007:n(997),E008:n(797),E009:n(1775),E010:n(827),E011:n(1039),E012:n(1281),E013:n(1793)},p[n(584)]={anchor:0,audience:1,sysAnchor:2,sysAudience:3},p[n(675)]={AndroidTv:1,AndroidPhone:2,WinPc:3,Iphone:4,Mac:5,Ipad:6,AndroidPad:7,WinTv:8,TinyApp:9,Web:10},p[n(1736)]={User:n(862),Environment:"environment"},p[n(749)]=function(e="",t=""){const r=n;if(e){let o={desc:""};p.ErrorDetail[e]&&(o[r(596)]=p[r(682)][e]),"string"==typeof t?t&&(o[r(596)]=o.desc+", "+t):(t[r(596)]&&(t[r(596)]=o[r(596)]+", "+t[r(596)]),o={...t}),s[r(485)]("event [error]",e,JSON[r(1014)](o)),a.emit(a[r(629)][r(605)],e,o)}},p.emitPreviewError=function(e){const t=n,{type:r,desc:o,subType:i,error:s}=e;let a=0;switch(s[t(1645)]){case t(986):a=2001;break;case t(1525):a=2002;break;case t(1597):a=2003;break;case t(840):a=2004;break;case"OverconstrainedError":a=2005;break;case t(780):a=2006;break;case t(737):a=2007;break;case"PreviewAlready":a=2008;break;case t(1475):a=2009;break;case t(1352):a=2010;break;case t(1747):a=2011}p[t(749)](p[t(1215)][t(302)],{type:r,desc:o,subType:i,code:a})},p.triggerPublishLogUpload=function(e,t={}){const r=n;if(e){if(e[r(963)])return;e[r(963)]=!0}p[r(1433)](p[r(1537)][r(811)],t)},p[n(895)]=function(e,t){const r=n;if(e){if(e.isSubscribeFailed)return;e[r(280)]=!0}p[r(1433)](p[r(1537)][r(811)],t)},p[n(1537)]={Error:"203011",QosEvent:n(1685),UserAction:n(361),mediaStuck:n(1398),CustomLog:n(1104)},p[n(661)]={Joined:1,Leave:2,Published:3,Unpublished:4,Subscribed:5,Unsubscribed:6,firstDataUploaded:7,firstDataDownloaded:8,toggleMute:9},p[n(406)]={},p.LogErrorType={Audio:1,Video:2,Rtc:3},p[n(346)]={Media:{Capturer:1,Encoder:2,Sender:3,Receiver:4,Rtpdemux:5,Decoder:6,Render:7},Rtc:{Token:1,Join:2,Publish:3,Subscribe:4,PublishIce:5,SubscribeIce:6,UplinkWeak:7}},p[n(1433)]=function(e,t={}){const r=n;if(p.options.enableLogUpload)switch(e){case p[r(1537)].QosEvent:p[r(1727)]()[r(515)]((e=>{const t=r;e[t(1450)][t(1524)]>0&&p.logReport(e[t(1450)],b[t(1231)].COMMON),p.options.enableQosReport&&e[t(1180)][t(1524)]>0&&a[t(1167)](a[t(629)][t(1127)],e[t(1180)])}));break;case p[r(1537)][r(661)]:const o=p[r(878)](e,t);p[r(1459)](o,b[r(1231)][r(445)]);break;case p.LogType[r(1094)]:const n=p[r(329)](t);p[r(1459)](n,b[r(1231)][r(445)]);break;case p.LogType[r(811)]:const i=p[r(1627)](e,t);p[r(1459)](i,b[r(1231)].COMMON)}},p.getQosDownlinkData=function({streamInfo:e,pair:t,video:r,audio:o,videoCodec:i,audioCodec:s,remoteCandidate:a}){const c=n,u={log:[],report:[]},d=o&&!(e[c(1822)]||e[c(181)]),l=r&&!(e.muteVideo||e[c(1861)]);if(!t)return u;const f={...p[c(933)]({eventCode:c(993),streamInfo:e}),userid:p[c(1266)].userID,roomid:p.core[c(1272)],serviceid:p[c(1199)][c(1487)],username:p[c(1266)][c(1013)],streamid:e.id,layerindex:e[c(813)],peeruserid:e[c(376)],mediatype:-1,codec:-1,ssrc:-1,mute:-1,jitter:-1,pktslost:-1,width:-1,height:-1,fps:-1,pli:-1,fir:-1,cpu:-1,memory:-1,netmode:-1,bwtransmit:-1,bwretransmit:-1,nack:-1,audiolevel:-1,bwrecv:-1,bytesrcvd:-1,pktsrcvd:-1,fpsout:-1,remb:-1,delay:-1,framesdropped:-1,netlevel:-1,weak:-1,codecname:-1};if(a&&(e[c(1209)]=a.ip+":"+a.port),d){const r=p[c(406)][o[c(1034)]]?p[c(406)][o[c(1034)]][c(341)]:{packetsLost:0},n={...f,mediatype:p[c(541)][c(418)],ssrc:o[c(1034)],bwrecv:t[c(358)],codec:s?""+s[c(818)][c(1540)]("/")[1]:-1,bytesrcvd:o[c(1555)]-r[c(1555)],pktsrcvd:o[c(1750)]-r[c(1750)],pktslost:o.packetsLost-r[c(1423)],delay:1e3*t[c(1299)]+(o[c(1088)]?o.jitterBufferDelay/o[c(1088)]*1e3:0),jitter:1e3*o[c(1173)],audiolevel:o[c(350)],mute:e[c(1822)]||e[c(181)]?1:0,weak:0,netlevel:5};u[c(1450)].push(n)}if(l){const o=p.qosHistroyData[r[c(1034)]]?p[c(406)][r[c(1034)]][c(1363)]:{packetsLost:0,firCount:0,pliCount:0,nackCount:0,framesDropped:0},n={...f,mediatype:p[c(541)][c(565)],ssrc:r[c(1034)],bwrecv:t[c(358)],codec:i?""+i[c(818)][c(1540)]("/")[1]:-1,bytesrcvd:r[c(1555)]-o[c(1555)],pktsrcvd:r[c(1750)]-o[c(1750)],pktslost:r[c(1423)]-o[c(1423)],width:r.frameWidth,height:r[c(527)],fps:r[c(1579)],fir:r.firCount-o[c(190)],pli:r[c(1194)]-o[c(1194)],nack:r[c(1257)]-o[c(1257)],delay:1e3*t.currentRoundTripTime+(r[c(1088)]?r.jitterBufferDelay/r[c(1088)]*1e3:0),jitter:1e3*r[c(1173)],mute:e[c(389)]||e.localMuteVideo?1:0,framesdropped:r.framesDropped-o[c(571)],weak:0,netlevel:5},s=p[c(1266)][c(1184)][c(855)][e.id],a=p[c(1266)].network[c(838)][e.id];s&&(n.netlevel=p[c(1411)](e.id,!1),n[c(1371)]=a&&a.isWeak?1:0),u.log.push(n)}const m={publishID:e[c(705)],subscribeID:e.id,audio:null,video:null};if(d){const e=p[c(406)][o[c(1034)]];m[c(341)]={bps:e&&e.audio?Math[c(1221)]((o[c(1555)]-e[c(341)][c(1555)])/(o[c(1243)]-e[c(341)][c(1243)])*1e3):0,audiolevel:Math[c(1221)](100*o[c(350)]),codec:s?s[c(818)][c(1540)]("/")[1]+"/"+s.clockRate+" ("+s[c(1667)]+", "+s[c(1764)]+")":"",pktslost:o[c(1423)]},p[c(406)][o[c(1034)]]={audio:o}}if(l){const o=p.qosHistroyData[r[c(1034)]];m[c(1363)]={width:r.frameWidth,height:r[c(527)],bps:o&&o[c(1363)]?Math[c(1221)]((r[c(1555)]-o[c(1363)][c(1555)])/(r[c(1243)]-o[c(1363)][c(1243)])*1e3):0,fps:r[c(1579)],codec:i?i[c(818)].split("/")[1]+"/"+i[c(1303)]+" ("+i[c(1667)]+", "+i[c(1764)]+")":-1,layerindex:e[c(813)],ssrc:r[c(1034)],delay:o&&o[c(1363)]?Math[c(1221)]((r[c(696)]-o[c(1363)][c(696)])/(r[c(1088)]-o[c(1363)][c(1088)])*1e3):0,jitter:r.jitter,pktslost:r[c(1423)],nack:r[c(1257)],mfsip:a?a.ip+":"+a.port:"",pli:r[c(1194)],fir:r[c(190)],bwrecv:t.availableIncomingBitrate},p[c(406)][r[c(1034)]]={video:r}}return(m.audio||m[c(1363)])&&u[c(1180)][c(801)](m),p[c(1463)]({streamInfo:e,pair:t,audioEnable:d,videoEnable:l,audio:o,video:r}),u},p[n(1062)]=function({streamInfo:e,pair:t,videoOutList:r,audioOut:o,videoRemoteInList:i,audioRemoteIn:s,audioSource:a,videoSource:c,videoCodec:u,audioCodec:d,remoteCandidate:l}){const f=n,m={log:[],report:[]},b=(s||o||a)&&!(e[f(1822)]||e.systemMuteAudio),v=r.length>0&&!(e.muteVideo||e[f(372)]);if(!t)return m;const y={...p[f(933)]({eventCode:"203001",streamInfo:e}),userid:p[f(1266)].userID,roomid:p[f(1266)].roomName,username:p[f(1266)][f(1013)],serviceid:p[f(1199)][f(1487)],streamid:e.id,layerindex:e[f(813)],mediatype:-1,codec:-1,ssrc:-1,mute:-1,rtt:-1,pktslost:-1,width:-1,height:-1,fps:-1,pli:-1,fir:-1,cpu:-1,memory:-1,netmode:-1,bwsend:-1,bwtransmit:-1,bwretransmit:-1,bwtarget:-1,bwactual:-1,bytessent:-1,pktssent:-1,fpscap:-1,nack:-1,encodetime:-1,audiolevel:-1,remb:-1,restecho:-1,restechomax:-1,innoise:-1,outnoise:-1,reqlayerindex:-1,netlevel:-1,weak:-1,codecname:-1};if(l&&(e[f(1209)]=l.ip+":"+l[f(1703)]),b){const t=p[f(406)][o.ssrc],r=t?t.audioOut:{nackCount:0,bytesSent:0,packetsSent:0},n=t&&t[f(210)]?t[f(210)]:{packetsLost:0},i={...y,mediatype:p[f(541)][f(418)],mute:e[f(1822)]?1:0,reqlayerindex:e[f(813)],netlevel:5,weak:0};a&&(i[f(1274)]=a[f(350)]),o&&(i.ssrc=o[f(1034)],i[f(1573)]=o.bytesSent-r.bytesSent,i[f(849)]=o.packetsSent-r[f(1387)],i.bwtarget=o[f(1326)],i[f(754)]=o[f(1257)]-r[f(1257)]),s&&(i[f(1034)]=s[f(1034)],i[f(772)]=s.availableOutgoingBitrate,i[f(903)]=s[f(1423)]-n[f(1423)],s[f(1694)]&&(i[f(1766)]=1e3*s[f(1694)])),d&&(i[f(517)]=""+d[f(818)][f(1540)]("/")[1]),m[f(1450)].push(i)}v&&r.forEach(((r,o)=>{const n=f,s=i[n(1431)]((e=>e[n(1034)]===r[n(1034)]));if(s&&e[n(813)]>=o){const i=p[n(406)][r[n(1034)]],a=i?i[n(1351)]:{firCount:0,pliCount:0,nackCount:0},d=i?i[n(1368)]:{packetsLost:0},l={...y,layerindex:o,mediatype:p[n(541)].Video,mute:e.muteVideo?1:0,bwtarget:t[n(1334)],bwsend:t[n(1334)],fpscap:c[n(1579)],ssrc:r[n(1034)],width:r[n(1011)],height:r.frameHeight,bytessent:r.bytesSent-a[n(1427)],pktssent:r[n(1387)]-a[n(1387)],fps:r.framesPerSecond,fir:r[n(190)]-a[n(190)],pli:r.pliCount-a.pliCount,nack:r[n(1257)]-a.nackCount,pktslost:s.packetsLost-d[n(1423)],rtt:1e3*s.roundTripTime,reqlayerindex:e[n(813)]};i&&(l[n(1710)]=(r[n(248)]-i.videoOut[n(248)])/(r[n(1243)]-i.videoOut[n(1243)]));const f=p[n(1266)][n(1184)].uplinkStats[e.id],b=p[n(1266)][n(1184)].netWeakStats[e.id];f&&(l[n(1826)]=p[n(1411)](e.id,!0),l[n(1371)]=b&&b[n(836)]?1:0),u&&(l.codec=""+u[n(818)][n(1540)]("/")[1]),p.qosHistroyData[l[n(1034)]]={videoOut:r,videoRemoteIn:s,videoSource:c},m[n(1450)][n(801)](l)}}));const h={publishID:e.id,audio:null,video:null};if(b){const e={bps:void 0,audiolevel:void 0,codec:void 0,pktslost:void 0};if(a&&(e[f(1274)]=Math.floor(100*a[f(350)])),o){const t=p[f(406)][o.ssrc];!t&&(p[f(406)][o[f(1034)]]={}),e[f(991)]=t&&t[f(758)]?Math.floor((o[f(1427)]-t[f(758)][f(1427)])/(o[f(1243)]-t[f(758)].timestamp)*1e3):0,p[f(406)][o[f(1034)]][f(758)]=o}s&&(e.pktslost=s[f(1423)],p[f(406)][o[f(1034)]].audioRemoteIn=s),d&&(e[f(517)]=d[f(818)][f(1540)]("/")[1]+"/"+d[f(1303)]+" ("+d[f(1667)]+", "+d[f(1764)]+")"),h[f(341)]=e}if(v){if(i[e[f(813)]]){const o=r[e.layerIndex],n=i[f(1431)]((e=>e[f(1034)]===o[f(1034)])),s=p[f(406)][f(1180)+o.ssrc],a={width:o.frameWidth,height:o[f(527)],bps:void 0,fps:o.framesPerSecond,fpscap:c[f(1579)],codec:u?u[f(818)].split("/")[1]+"/"+u[f(1303)]+" ("+u[f(1667)]+", "+u.sdpFmtpLine+")":void 0,layerindex:e[f(813)],ssrc:o.ssrc,rtt:1e3*n[f(1694)],pktslost:n[f(1423)],nack:o[f(1257)],mfsip:l?l.ip+":"+l[f(1703)]:void 0,pli:o[f(1194)],fir:o[f(190)],bwsend:t[f(1334)]};s&&(a[f(991)]=s&&s[f(1351)]?Math.floor((o[f(1427)]-s.videoOut[f(1427)])/(o[f(1243)]-s[f(1351)][f(1243)])*1e3):0),p[f(406)][f(1180)+o[f(1034)]]={videoOut:o,videoRemoteIn:n},h[f(1363)]=a}}return(h[f(341)]||h.video)&&m[f(1180)].push(h),p.checkQosUplinkError({streamInfo:e,videoOutList:r,audioOut:o,videoRemoteInList:i,videoSource:c,audioEnable:b,videoEnable:v}),m},p[n(1727)]=function(){return new Promise(((t,r)=>{const o=e;let n={log:[],report:[]},i=[];Object[o(1706)](p[o(1266)].publishers).forEach((t=>{i.push(new Promise((r=>{const o=e;if(!t.pc||t.pc.connectionState!==o(1624))return r();t.pc[o(1615)]()[o(515)]((e=>{const i=o,s={streamInfo:t,video:null,audio:null,pair:null,audioCodec:null,videoCodec:null,remoteCandidate:null};e[i(1505)]((e=>{const t=i;e[t(558)]===t(438)&&e[t(195)]===t(497)?s[t(718)]=e:e[t(558)]===t(440)?e[t(1034)]!==p[t(1266)][t(848)]&&("video"===e[t(1687)]?e[t(1147)]!==t(251)&&(s[t(1363)]=e):s[t(341)]=e):e[t(558)]===t(517)?"audio/opus"===e.mimeType?s.audioCodec=e:e[t(818)]===t(902)&&(s[t(235)]=e):e[t(558)]===t(354)&&e.ip&&-1===e.ip[t(199)](t(448))&&(s[t(1586)]=e)}));const a=p[i(1222)](s);return a&&(n.log=n.log[i(1539)](a.log),n[i(1180)]=n[i(1180)][i(1539)](a[i(1180)])),r()}))})))})),[p[o(1266)][o(1054)],p.core.screen].concat(Object[o(1706)](p[o(1266)][o(752)]))[o(1505)]((t=>{const r=o;t[r(1838)],t[r(558)],t.preview&&t.pc&&t.pc[r(1851)]===r(1624)&&i[r(801)](new Promise((r=>{t.pc.getStats().then((o=>{const i=e,s={streamInfo:t,pair:null,videoOutList:[],audioOut:null,videoRemoteInList:[],audioRemoteIn:null,videoSource:null,audioSource:null,videoCodec:null,audioCodec:null,remoteCandidate:null};o.forEach((t=>{const r=e;t[r(558)]===r(438)&&"succeeded"===t[r(195)]?s.pair=t:t[r(558)]===r(316)?"video"===t.kind?s[r(1519)].push(t):s[r(210)]=t:t.type===r(270)?t[r(1687)]===r(1363)?s[r(744)].push(t):s.audioOut=t:t[r(558)]===r(1825)?t[r(1687)]===r(1363)?s.videoSource=t:s.audioSource=t:t[r(558)]===r(517)?"audio/opus"===t[r(818)]?s[r(1373)]=t:t[r(818)]===r(902)&&(s[r(235)]=t):t[r(558)]===r(354)&&t.ip&&-1===t.ip[r(199)](r(448))&&(s[r(1586)]=t)}));const a=p.getQosUplinkData(s);return a&&(n[i(1450)]=n[i(1450)][i(1539)](a[i(1450)]),n.report=n[i(1180)][i(1539)](a[i(1180)])),r()}))})))})),Promise.all(i)[o(515)]((()=>{t(n)}))}))},p[n(336)]=function({streamInfo:e,videoOutList:t,audioOut:r,videoRemoteInList:o,videoSource:i,audioEnable:s,videoEnable:a}){const c=n;if(-1===e[c(813)])return;const u=p[c(406)][e.id]||(p[c(406)][e.id]={}),d=u.layerIndex!==e[c(813)];let l=null,f=null,m=null;if(u[c(813)]=e[c(813)],r&&s&&(u.hasOwnProperty(c(1111))&&!e[c(1822)]&&(u[c(1111)]>=r[c(1387)]?u[c(1693)]?u[c(1693)]++:u.audioNoSentTimes=1:u[c(1693)]=0,u.audioNoSentTimes>=2&&(f={errorType:p.LogErrorType[c(418)],errorCode:p[c(346)][c(1456)][c(574)],errorDesc:c(916)})),u[c(1111)]=r.packetsSent),e.type===p.StreamType[c(1663)]){const t=-1===e[c(813)]?0:e.layerIndex;l=p.options[c(194)][t]}else{const t=-1===e.layerIndex?0:e[c(813)];l=p.options[e[c(1838)]?c(1640):c(992)][t]}if(i&&a&&i.framesPerSecond0){let r=0;t.forEach(((t,o)=>{const n=c;if(0===o){const r="videoEncode"+t[n(1034)];if(u.hasOwnProperty(r)&&!d){Math.floor((t[n(248)]-u[r].framesEncoded)/(Date[n(931)]()-u[r][n(1243)])*1e3)=r?u[c(1317)]?u[c(1317)]++:u[c(1317)]=1:u[c(1317)]=0,u[c(1317)]>=2&&(f={errorType:p[c(218)][c(565)],errorCode:p[c(346)].Media[c(574)],errorDesc:c(275)})),u[c(501)]=r)}f?(p[c(1433)](p[c(1537)][c(811)],f),p[c(906)](e,p[c(499)][c(418)],!0,f)):p.emitPeerError(e,p[c(499)].Audio,!1),m?(p[c(1433)](p[c(1537)][c(811)],m),p[c(906)](e,p[c(499)][c(565)],!0,m)):p.emitPeerError(e,p[c(499)].Video,!1)},p[n(1463)]=function({streamInfo:e,pair:t,video:r,audio:o,audioEnable:i,videoEnable:s}){const a=n,c=p.qosHistroyData[e.id]||(p.qosHistroyData[e.id]={});let u=null,d=null;o&&i&&(c[a(1651)](a(1296))&&!e[a(1822)]&&!e[a(181)]&&(c[a(1296)]>=o[a(1750)]?c[a(1665)]?c[a(1665)]++:c[a(1665)]=1:c[a(1665)]=0,c[a(1665)]>=2&&(u={errorType:p[a(218)][a(418)],errorCode:p[a(346)][a(1456)].Receiver,errorDesc:a(632)})),c.audioPktsRcvd=o[a(1750)]),r&&s&&(c[a(1651)]("videoPktsRcvd")&&!e[a(389)]&&!e.localMuteVideo&&(c.videoPktsRcvd>=r[a(1750)]?c[a(178)]?c[a(178)]++:c.videoNoRcvdTimes=1:c.videoNoRcvdTimes=0,c.videoNoRcvdTimes>=2&&(d={errorType:p[a(218)][a(565)],errorCode:p.LogErrorCode[a(1456)][a(1110)],errorDesc:"视频流无接收数据"})),c[a(547)]=r[a(1750)],c[a(1651)](a(1715))&&!e[a(389)]&&!e[a(201)]&&!d&&c[a(1715)]>=r[a(1523)]&&(d={errorType:p[a(218)].Video,errorCode:p.LogErrorCode[a(1456)][a(298)],errorDesc:a(262)}),c[a(1715)]=r[a(1523)]),u?(p[a(1433)](p[a(1537)].Error,u),p[a(906)](e,p.StreamTrack[a(418)],!0,u)):p[a(906)](e,p[a(499)][a(418)],!1),d?(p.triggerLogUpload(p.LogType.Error,d),p[a(906)](e,p[a(499)][a(565)],!0,d)):p.emitPeerError(e,p[a(499)].Video,!1)},p[n(1425)]=function(t){const r=n;p[r(1468)](t);let o=0,i=0;t[r(382)]=setInterval((()=>{const n=r;t.pc&&t.pc.connectionState===n(1624)&&t.pc[n(1615)](t[n(514)])[n(515)]((r=>{r.forEach((r=>{const n=e;if(r[n(558)]===n(1825)&&r[n(1687)]===n(1363)){if(!r[n(1186)])return;o===r[n(1186)]?(i++,i>=3&&(i=0,!t[n(389)]&&!t[n(372)]&&(s[n(1023)]("fpscap zero, trigger mute"),t[n(372)]=!0,p[n(250)](t.id,t[n(372)],t[n(1822)])))):(i=0,!t[n(389)]&&t[n(372)]&&(s.logWarn(n(1738)),t[n(372)]=!1,p[n(250)](t.id,t[n(372)],t.muteAudio))),o=r[n(1186)]}}))}))}),2e3)},p[n(1468)]=function(e){clearInterval(e[n(382)])},p[n(906)]=function(e,t,r,o){const i=n;if(!p[i(1199)][i(750)])return;let s=p[i(1266)][i(750)][e.id],c={streamID:e.id,isAudio:t===p.StreamTrack[i(418)],isVideo:t===p[i(499)][i(565)],isError:r};!s&&(s={},p[i(1266)][i(750)][e.id]=s),r?(s[t]=!0,a[i(1167)](a.Event[i(1382)],{...c,...o})):s[t]&&(s[t]=!1,a[i(1167)](a.Event.peerError,{...c}))},p[n(933)]=function({eventCode:e,streamInfo:t}){const o=n;return{logstamp:o(1612),version:o(471),eventcode:e,eventtime:Date.now(),devicetype:p[o(1266)][o(711)],versionrtc:r,sessionid:p[o(1266)][o(1528)],eventtype:e[o(759)](0,3),eventpos:e[o(759)](e[o(1524)]-3,e[o(1524)]),peerdevicetype:t&&!t[o(1227)]?t.dType:-1,streamtype:t?t[o(558)]===p[o(1155)].Camera?1:2:-1}},p[n(878)]=function(e,t){const r=n,{action:o,streamInfo:i}=t,s={...p[r(933)]({eventCode:e,streamInfo:i}),userid:p[r(1266)][r(1668)],roomid:p[r(1266)][r(1272)],serviceid:p[r(1199)][r(1487)],userevent:o,mediatype:-1,mute:-1,streamid:-1,layerscount:-1,layerindex:-1,netmode:-1,peeruserid:-1,duration:-1,bmcsip:-1};switch(o){case p[r(661)][r(1414)]:const e=p.core[r(1823)][r(656)];s[r(858)]=e[r(1574)]-e[r(1482)],delete p.core[r(1823)][r(656)];break;case p[r(661)][r(1255)]:break;case p.UserAction[r(889)]:s[r(1614)]=i.id,s[r(1476)]=p[r(1679)](i)[r(1524)],s.layerindex=i[r(813)]||0;const o=p[r(1266)][r(1823)]["publish-"+i.id];s[r(858)]=o[r(1471)]-o[r(1027)],i[r(1822)]&&i[r(389)]?delete p[r(1266)][r(1823)]["publish-"+i.id]:p[r(569)](i);break;case p.UserAction[r(1591)]:s[r(1614)]=i.id,s[r(1476)]=p[r(1679)](i).length,s[r(577)]=i[r(813)]||0;const n=p[r(1266)][r(1823)]["unpublish-"+i.id];s[r(858)]=n[r(1585)]-n[r(1697)],delete p[r(1266)][r(1823)][r(455)+i.id];break;case p[r(661)][r(1684)]:s[r(1614)]=i.id,s[r(1476)]=i[r(1056)][r(1524)],s[r(577)]=i[r(813)],s[r(490)]=i[r(376)];const a=p[r(1266)][r(1823)][r(1567)+i[r(705)]];s.duration=a[r(1045)]-a[r(693)],i[r(1822)]&&i.muteVideo?delete p[r(1266)].userActionData[r(1567)+i.publishID]:p.checkStreamFirstDownload(i);break;case p[r(661)][r(227)]:s[r(1614)]=i.id,s[r(1476)]=i.layers[r(1524)],s.layerindex=i.layerIndex;const c=p[r(1266)][r(1823)][r(289)+i.id];s[r(858)]=c[r(914)]-c[r(1361)],s[r(490)]=i[r(376)],delete p[r(1266)][r(1823)][r(289)+i.id];break;case p[r(661)].firstDataUploaded:s[r(1614)]=i.id,s[r(1476)]=p[r(1679)](i)[r(1524)],s[r(577)]=i.layerIndex||0;const u=p[r(1266)].userActionData[r(1143)+i.id];s[r(858)]=u[r(1006)]-u[r(1027)],delete p.core.userActionData[r(1143)+i.id];break;case p[r(661)][r(1484)]:s[r(1614)]=i.id,s[r(1476)]=i[r(1056)][r(1524)],s[r(577)]=i[r(813)],s[r(490)]=i[r(376)];const d=p.core[r(1823)]["subscribe-"+i[r(705)]];s[r(858)]=d.downloadTime-d[r(693)],delete p[r(1266)][r(1823)]["publish-"+i.publishID];break;case p.UserAction[r(1109)]:s[r(486)]=t[r(429)],s.streamid=i.id,s[r(1476)]=p.getLayersByStreamInfo(i)[r(1524)],s[r(577)]=i.layerIndex||0,s.mute=(s[r(486)]===p[r(541)][r(418)]?i[r(1822)]||i[r(181)]:i.muteVideo||i[r(201)])?1:0,i[r(376)]&&(s[r(490)]=i[r(376)])}return s},p[n(329)]=function(t){const r=[];return t.forEach((t=>{const o=e,{streamInfo:n}=t,i={...p.wrapBaseData({eventCode:t[o(429)]==p[o(541)].Audio?o(1398):"203007",streamInfo:n}),userid:p[o(1266)][o(1668)],roomid:p[o(1266)].roomName,serviceid:p[o(1199)][o(1487)],username:p.core[o(1013)],streamid:n.id,mediatype:t[o(429)],mute:t[o(1366)],peeruserid:n[o(376)],stuckcount:t[o(587)],stuckduration:t[o(842)],spanduration:t[o(1404)],playduration:t[o(393)],weakduration:t[o(1641)],cpu:-1,memory:-1,netmode:-1};t[o(429)]!==p[o(541)][o(418)]&&(i[o(577)]=n[o(813)]),r[o(801)](i)})),r},p[n(1627)]=function(e,t){const r=n,{errorType:o,errorCode:i,errorDesc:a,streamInfo:c}=t,u={...p[r(933)]({eventCode:e,streamInfo:c}),userid:p.core.userID,roomid:p[r(1266)].roomName,serviceid:p.options.serviceID,streamid:c?c.id||c[r(944)]:-1,peeruserid:c?c.local?-1:c[r(376)]:-1,errtype:o,errcode:i,errdesc:a,mfsip:c&&c[r(1209)]?c.mfsip:-1,netmode:-1};return p.options[r(1776)]&&s[r(485)](r(1581)+u[r(620)]+", errcode: "+u[r(830)]+r(192)+u[r(1360)]),u},p.routineCheckStreamFirstUpload=function(e){const t=n;!e[t(877)]&&e.pc&&(!p[t(1266)].userActionData[t(1143)+e.id]&&(p[t(1266)][t(1823)]["publish-"+e.id]={}),p[t(1266)][t(1823)][t(1143)+e.id][t(1027)]=Date.now(),p.checkStreamFirstUpload(e))},p[n(569)]=function(e){const t=n;if(!e.pc||e[t(877)]||e[t(1822)]&&e[t(389)])return;const r=e.pc[t(1792)]();if(!r||0===r.length)return;e[t(877)]=!0;let o=r[0];r[t(1524)]>1&&r[t(1505)]((r=>{const n=t;r.track&&(e[n(826)]===p[n(831)][n(550)]?r[n(198)].kind===n(1363)&&(o=r):r[n(198)][n(1687)]===(e[n(389)]||!e[n(1822)]&&-1===e.layerIndex?n(341):n(1363))&&(o=r))}));let i=0;const s=setInterval((()=>{const r=t;e[r(1822)]&&-1===e[r(813)]?(i++,i>4&&(clearInterval(s),delete p.core[r(1823)][r(1143)+e.id],e[r(877)]=!1)):i<40?(i++,o[r(1615)]()[r(515)]((t=>{const n=r;if(!p[n(1266)][n(1823)][n(1143)+e.id])return void clearInterval(s);const i=[];let a=0;t[n(1505)]((e=>{const t=n;e[t(558)]===t(270)&&i.push(e)})),i[n(1505)]((e=>{const t=n;a+=o[t(198)][t(1687)]===t(1363)?e[t(306)]:e[t(1387)]})),a>0&&(clearInterval(s),p[n(1266)][n(1823)][n(1143)+e.id][n(1006)]=Date.now(),p.triggerLogUpload(p[n(1537)][n(661)],{action:p[n(661)][n(191)],streamInfo:e}))}))):(clearInterval(s),p.core[r(1823)][r(1143)+e.id].uploadTime=Date.now(),p[r(1433)](p[r(1537)][r(661)],{action:p[r(661)][r(191)],streamInfo:e}))}),50)},p[n(792)]=function(t){const r=n;if(!t.pc)return;const o=t.pc[r(790)]();if(!o||0===o[r(1524)])return;let i=o[0];o.length>1&&o[r(1505)]((e=>{const o=r;e[o(198)][o(1687)]===(t[o(389)]?o(341):o(1363))&&(i=e)}));let s=0;const a=setInterval((()=>{const o=r;s<10?(s++,i[o(1615)]().then((r=>{const n=o,s=[];let c=0;r.forEach((t=>{const r=e;t[r(558)]===r(440)&&t.ssrc!==p.core[r(848)]&&s[r(801)](t)})),s[n(1505)]((e=>{const t=n;c+=i[t(198)].kind===t(1363)?e.keyFramesDecoded:e[t(1750)]})),c>0&&(clearInterval(a),p.core[n(1823)][n(1567)+t[n(705)]].downloadTime=Date[n(931)](),p.triggerLogUpload(p[n(1537)].UserAction,{action:p[n(661)][n(1484)],streamInfo:t}))}))):(clearInterval(a),p.core[o(1823)]["subscribe-"+t[o(705)]][o(1754)]=Date.now(),p.triggerLogUpload(p[o(1537)][o(661)],{action:p[o(661)][o(1484)],streamInfo:t}))}),50)},p[n(627)]=function(e,t,r,o,i,a=!1){const c=n;if(a){if(!p[c(1266)][c(1528)]||p.ws&&p.ws.readyState===WebSocket.OPEN)return void s[c(485)]("invalid recovery: "+p[c(1266)][c(1528)]+", "+(p.ws?c(829)+(p.ws[c(1168)]===WebSocket.OPEN):"no websocket"))}else{if(p[c(1266)][c(1272)]&&p[c(1266)][c(1272)]!==e||p[c(1266)][c(1668)]&&p[c(1266)][c(1668)]!==t)return p[c(185)](),p[c(627)](e,t,r,i,o);if(1===p[c(1266)][c(313)])return s[c(485)](c(1397)),p.emitError(p[c(1215)].JoinError,c(1175));p[c(384)](),p[c(1100)]({roomName:e,userID:t,userName:r,userArea:o,userRole:i})}!p.core[c(1823)].join&&(p[c(1266)].userActionData.join={}),p[c(1266)][c(1823)][c(656)][c(1482)]=Date.now();let u={reqId:h(),roomName:p[c(1266)][c(1272)]};p.options.forceArea?u[c(733)]=p[c(1266)][c(478)]:(u.publicIP=p.core.publicIP,u[c(1796)]=p[c(1266)][c(1796)],u[c(356)]=p[c(1266)][c(356)],u[c(1139)]=p[c(1266)][c(1139)],u[c(1024)]=p.core[c(1024)],s.logInfo(c(362),p[c(1266)][c(1412)],p[c(1266)][c(1796)],p[c(1266)].countryCode,p.core.regionCode,p[c(1266)][c(1024)]));let d={Authorization:I(p[c(1266)],p.options,p[c(847)])};p[c(1266)][c(1605)]=u[c(1103)],p[c(1604)](c(1481),p.options.Services.BasicRoomServiceToken,u,d,(function(e){const t=c;if(u[t(1103)]===p[t(1266)][t(1605)])return e&&e[t(313)]!==t(1618)?(s.logError("room service response error, "+e[t(385)]),p[t(749)](p[t(1215)][t(299)],t(1609)),void p[t(1433)](p[t(1537)][t(811)],{errorType:p.LogErrorType[t(663)],errorCode:p.LogErrorCode.Rtc[t(970)],errorDesc:t(1609)})):e[t(1651)](t(1091))&&e[t(1091)].hasOwnProperty(t(553))?void p[t(1151)](e.tokenInfo.token,a):(s[t(485)](t(1337)),p.emitError(p[t(1215)][t(299)],"room response error, no token"),void p[t(1433)](p[t(1537)][t(811)],{errorType:p[t(218)].Rtc,errorCode:p[t(346)][t(663)][t(970)],errorDesc:t(1756)}));s[t(1023)]("on success, join request deprecated, reqId: "+u[t(1103)])}),(function(n,d,l){const f=c;if(u[f(1103)]===p[f(1266)].joinReqId){if(n instanceof Object&&401===n[f(313)]){const c=Date.parse(n.getResponseHeader(f(1188)))||0;if(c>0){const n=Date[f(931)]();if(Math[f(263)](c-n-p[f(1199)][f(980)])>6e4)return p[f(1199)][f(980)]=c-n,s[f(1023)]("local timestamp="+n+",","server timestamp="+c+",",f(220)+p.options[f(980)]),p[f(627)](e,t,r,o,i,a)}}return s.logError("request room service error, "+(n[f(462)]||n)+", requestBody: "+JSON.stringify(u)),a?p[f(1568)]():(p[f(1433)](p[f(1537)][f(811)],{errorType:p[f(218)][f(663)],errorCode:p[f(346)][f(663)][f(970)],errorCode:f(769)+n[f(313)]}),p.emitError(p.ErrorCode[f(299)],f(1692)))}s.logWarn(f(1782)+u[f(1103)])}))},p[n(1705)]=function(e,t,r,o,i,a){const c=n;if(p[c(1266)].ipInfoRetryCount=0,p[c(1199)].forceArea)return s[c(1055)](c(619)+o),this[c(627)](e,t,r,o,i,a);p[c(441)](e,t,r,i,a)},p[n(441)]=function(t,r,i,a,c){const u=n;let d={msgId:h()};jhkSign(d,{appKey:u(345),postAndJSON:!0});const l={method:u(1481),url:p[u(452)](p[u(1199)][u(573)][u(828)]),timeout:p[u(1199)][u(1325)],contentType:"application/json"};let f={};f.appKey=u(345),f[u(1115)]=jhkSign(d,{appKey:u(345),postAndJSON:!0}),f instanceof Object&&Object[u(703)](f)[u(1524)]>0&&(l[u(1666)]=f),l.data=JSON[u(1014)](d),p[u(1266)].ipReqId=d[u(1258)],o(l)[u(515)]((o=>{!function(o){const n=e;if(d[n(1258)]!==p[n(1266)][n(1458)])return void s[n(1023)](n(798)+d[n(1258)]);if(o[n(313)]!==n(1618)){if(s[n(485)](n(1623)+JSON[n(1014)](o)),p.core[n(1350)]=2&&(p[n(1266)][n(1139)]=parseInt(f[n(759)](0,2))[n(339)]()),m[n(1524)]>=4&&(p[n(1266)][n(1024)]=parseInt(m.substring(2,4))[n(339)]()),s[n(1055)](n(216)+JSON.stringify(o)),p[n(627)](t,r,i,p.Area[n(1681)],a,c)}(o)})).catch((o=>{!function(o,n,u){const l=e;if(d[l(1258)]===p[l(1266)][l(1458)]){if(s[l(485)](l(932),o,n,u),p[l(1266)][l(1350)]{r=r[e(1190)](t,"")})),r}catch(t){s.logWarn(e(937)+t)}}let t=document[e(475)]("script");return t.length>0?t[t.length-1][e(1569)]:void 0},p[n(841)]=function(){return new Promise((t=>{const r=e;if(p[r(1716)])t();else if(u)if(p[r(1716)]=new u,s[r(1055)]("init audio context ok"),l){let e="data:text/javascript;base64,Y2xhc3MgQXVkaW9MZXZlbFByb2Nlc3NvciBleHRlbmRzIEF1ZGlvV29ya2xldFByb2Nlc3NvciB7Y29uc3RydWN0b3IoKSB7c3VwZXIoKTt0aGlzLl9sYXN0VXBkYXRlID0gY3VycmVudFRpbWU7fXByb2Nlc3MoaW5wdXRzLCBvdXRwdXRzLCBwYXJhbWV0ZXJzKSB7aWYgKCFpbnB1dHMpIHtyZXR1cm47fWlmIChjdXJyZW50VGltZSAtIHRoaXMuX2xhc3RVcGRhdGUgPj0gMC4xKSB7aWYgKCFpbnB1dHNbMF0gfHwgIWlucHV0c1swXVswXSkge3JldHVybjt9Y29uc3QgYnVmZmVyID0gaW5wdXRzWzBdWzBdO2xldCBtYXggPSBNYXRoLmZsb29yKE1hdGgubWF4LmFwcGx5KE1hdGgsIGJ1ZmZlcikgKiAxMDApO2lmIChtYXggPCAwKSB7bWF4ID0gLW1heDt9dGhpcy5wb3J0LnBvc3RNZXNzYWdlKHthdWRpb0xldmVsOiBtYXh9KTt0aGlzLl9sYXN0VXBkYXRlID0gY3VycmVudFRpbWU7fXJldHVybiB0cnVlO319cmVnaXN0ZXJQcm9jZXNzb3IoJ2F1ZGlvTGV2ZWwnLCBBdWRpb0xldmVsUHJvY2Vzc29yKTs=",o=null;o=setTimeout((()=>{s[r(1023)]("audioContext timeout"),t()}),200);try{p.audioContext[r(538)][r(254)](e)[r(515)]((()=>{const e=r;s.logInfo(e(1544)),clearTimeout(o),t()}))[r(432)]((e=>{const n=r;l=null,s[n(1023)]("can not add module to audio worklet,",e[n(339)]()),clearTimeout(o),t()}))}catch(e){l=null,s[r(1023)](r(433),e[r(339)]()),clearTimeout(o),t()}}else t();else s[r(485)](r(453)),t()}))},p[n(523)]=function(e="",t=""){const r=n;if(!p[r(1199)][r(426)])return{video:!1};let o={},i=t?"cameraExLayers":r(992),s=p[r(1199)][i][r(1515)](-1)[0][r(723)]||1280,a=p[r(1199)][i].slice(-1)[0][r(1669)]||720,c=p[r(1199)][i][r(1515)](-1)[0][r(1365)]||30,u={width:s,height:a,aspectRatio:1.7777777777777777,frameRate:{min:c>>1,ideal:c},facingMode:p[r(1266)][r(1054)][r(1784)]};return x.isSafari&&delete u[r(1365)][r(1472)],Object[r(703)](u)[r(1505)]((e=>{p.getBrowserSupported(e)&&(o[e]=u[e])})),e&&(o[r(487)]=e),0===Object[r(703)](o)[r(1524)]?{video:!0}:(o[r(487)]&&p[r(305)](o),{video:o})},p[n(1378)]=function(e=""){const t=n;if(!p[t(1199)][t(724)])return{audio:!1};let r={},o={autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0};return Object[t(703)](o)[t(1505)]((e=>{p[t(676)](e)&&(r[e]=o[e])})),e&&(r[t(487)]=e),0===Object[t(703)](r)[t(1524)]?{audio:!0}:(r.autoGainControl=p[t(1199)].autoGainControl,r[t(1432)]=p[t(1199)][t(1432)],r[t(1799)]=p[t(1199)][t(1799)],{audio:r})},p[n(305)]=function(e){const t=n,r=[{name:t(1068),width:1920,height:1080,frameRate:30,minFrameRate:10},{name:t(1598),frameRate:30,minFrameRate:10}],o=p[t(1266)].devices[t(1812)].videoinput;if(!o||0===o[t(1524)])return;const i=p.core[t(1533)][t(1812)].videoinput.find((t=>t.id==e.deviceId));i&&r[t(1505)]((r=>{const o=t;-1!==i[o(1645)][o(199)](r[o(1645)])&&(r[o(723)]&&(e[o(723)]=r.width),r[o(1669)]&&(e[o(1669)]=r[o(1669)]),e[o(1365)]&&(e[o(1365)]={min:r[o(1118)],ideal:r[o(1365)]}))}))},p[n(1353)]=function(e){e.autoGainControl=!1,e.echoCancellation=!0,e.noiseSuppression=!1},p.logTrackInfo=function(e,t,r){const o=n;e?(s[o(1055)](o(1856)+t+",kind:"+e.kind+",contentHint:"+e[o(630)]+",enabled:"+e[o(1392)]+o(1239)+e.muted+",readyState:"+e[o(1168)]),e[o(607)]=t=>{const r=o;s[r(1023)](r(1131)+e[r(1687)]+",enabled:"+e[r(1392)],t)},e[o(604)]=t=>{const r=o;s.logWarn(r(1852)+e[r(1687)]+r(1712)+e.enabled+r(1510)+e[r(1168)],t)},e[o(241)]=t=>{const n=o;s.logWarn(n(390)+e[n(1687)]+n(1712)+e[n(1392)]+n(1510)+e[n(1168)],t),e[n(1687)]===p.StreamTrack[n(565)]&&r[n(854)]&&!r[n(389)]&&(r[n(372)]=!0,p[n(250)](r.id,r.systemMuteVideo,r[n(1822)]))},e[o(226)]=t=>{const n=o;s[n(1023)](n(1424)+e[n(1687)]+n(1712)+e[n(1392)],t),e[n(1687)]===p[n(499)].Video&&r[n(854)]&&!r[n(389)]&&r.systemMuteVideo&&(r.systemMuteVideo=!1,p[n(250)](r.id,r[n(372)],r[n(1822)]))}):s[o(1023)]("trackInfo: track is null")},p[n(353)]=function(e){const t=n;e&&(e[t(607)]=null,e[t(604)]=null,e[t(241)]=null,e[t(226)]=null)},p[n(899)]=async function(e,t){const r=n;s[r(1055)]("_hiRtcSDK.getDeviceUsingPermission(audio:"+e+r(857)+t+")"),p[r(1072)]();let o={};e&&(o=Object[r(1772)](o,p[r(1378)]())),t&&(o=Object.assign(o,p.getVideoConstraints()));let i=null;try{s[r(1055)](r(397)+JSON.stringify(o)+")"),i=await navigator[r(796)].getUserMedia(o),s[r(1055)](r(1268))}catch(n){return p[r(1059)](!e&&void 0,!t&&void 0),n instanceof Object&&n[r(1645)]===r(1525)?(s[r(1023)](r(892),e,t),a.emit(a[r(629)][r(950)],e,t,!0,!1)):n instanceof Object&&"NotFoundError"===n[r(1645)]?(s[r(1023)](r(1346),e,t,o),a[r(1167)](a[r(629)][r(950)],e,t,!1,!1)):n instanceof Object&&"NotReadableError"===n[r(1645)]?(e&&await p[r(841)](),p[r(1059)](!!e||void 0,!t&&void 0),s[r(1055)](r(494),e,t,o),a[r(1167)](a[r(629)][r(950)],e,t,!0,!0)):(s[r(485)](r(1801)+n[r(339)](),o),a[r(1167)](a[r(629)][r(950)],e,t,!1,!1))}e&&await p[r(841)](),a[r(1167)](a[r(629)][r(950)],e,t,!0,!0),p.stopMediaStream(i),p[r(1059)](!!e||void 0,!!t||void 0),s[r(1055)](r(739))},p[n(1059)]=function(e,t){const r=n;typeof e===r(1065)&&(p[r(1266)][r(950)].audio=e),"boolean"==typeof t&&(p.core[r(950)][r(1363)]=t)},p[n(264)]=function(e){const t=n;e&&(p.unlogTrackInfo(e),e.stop(),e.kind===p[t(499)].Audio&&a[t(1167)](a[t(629)][t(1093)]))},p.stopMediaStream=function(e){const t=n;e&&e[t(1691)]()[t(1505)]((e=>p.stopMediaTrack(e)))},p.replaceCustomTrack=function(){const e=n,t=p[e(1266)].custom,r=t.canvas,o=p[e(1199)].customLayers[0];(o[e(723)]!==r[e(723)]||o[e(1669)]!==r.height)&&(r[e(1837)](e(723),o.width),r[e(1837)](e(1669),o[e(1669)]));try{t[e(1148)]&&(p[e(264)](t[e(1148)]),t[e(839)].removeTrack(t.audioTrack));const r=t[e(465)];let o=null;if(o=null==r[e(1408)]?r[e(233)]():r[e(1408)](),t[e(1148)]=o.getAudioTracks()[0],t[e(1148)]&&(t[e(839)].addTrack(t[e(1148)]),t.pc)){t.pc[e(1792)]()[e(1431)]((t=>(t.track&&t[e(198)][e(1687)])===e(341)||!t[e(198)])).replaceTrack(t[e(1148)])}}catch(t){s[e(485)](e(1297),t[e(339)]())}},p[n(398)]=function(){const e=n;p.core.custom[e(506)]=!0},p[n(357)]=function(){const t=n,r=()=>{const t=e;p[t(232)](),p[t(1266)].custom[t(465)][t(464)]("canplay",r)};p[t(1266)][t(1580)][t(465)]&&p[t(1266)][t(1580)][t(506)]&&p[t(1266)][t(1580)].videoElem[t(247)]("canplay",r),p[t(1266)].custom[t(506)]=!1},p[n(419)]=function(e){const t=n;e&&(e.addEventListener("ended",p[t(398)]),e[t(247)](t(805),p.checkVideoPlay))},p[n(311)]=function(e){const t=n;e&&(e.removeEventListener("ended",p[t(398)]),e[t(464)](t(805),p[t(357)]))},p.replaceStreamTrack=function(e,t,r=!1){const o=n,i={audio:{trackName:o(1148),getTrackFunc:"getAudioTracks"},video:{trackName:o(514),getTrackFunc:o(503)}};if(!e||Object[o(703)](i)[o(199)](e)<0)return s.logWarn(o(911));let a=i[e].trackName,c=i[e][o(777)],u=t[o(839)][c](),d=u[o(1524)]>0;if(t[a])t.stream[o(590)](t[a]),u[o(1505)]((e=>{const n=o;t[n(839)].removeTrack(e),!r&&p[n(264)](e)}));else for(let e=0,r=u[o(1524)];e0&&t[o(839)].removeTrack(r),p.stopMediaTrack(r)}return d},p.replacePCTrack=async function(e="",t){const r=n;if(!(Object[r(1706)](p[r(499)])[r(199)](e)<0)&&t.pc)if(e===p[r(499)][r(418)]){if(t[r(1148)]){let e=t.pc.getSenders()[r(1431)]((e=>e[r(198)]&&e[r(198)].kind===r(341)));if(e)try{await e.replaceTrack(t[r(1148)])}catch(e){s[r(485)](r(955),e[r(339)]())}else p.wsUnPublish(p.StreamType[r(551)],t.id,t.tag),p[r(1395)](p.StreamType[r(551)],t[r(1838)],t.info?t[r(1755)].app:"")}}else if(t.videoTrack){let e=t.pc.getSenders()[r(1431)]((e=>e[r(198)]&&e.track[r(1687)]===r(1363)));if(e)try{await e[r(511)](t[r(514)])}catch(e){s[r(485)](r(1608),e[r(339)]())}else p[r(1479)](p[r(1155)][r(551)],t.id,t.tag),p[r(1395)](p[r(1155)].Camera,t[r(1838)],t[r(1755)]?t.info[r(509)]:"")}},p[n(1311)]=function(e,t,r){const o=n,i=p[o(1266)][o(1580)],s=()=>{const t=o;p[t(232)](),e.removeEventListener(t(1602),s)};r&&p.setOption({customLayers:[...r]}),i[o(465)]===e?(e[o(200)](),e[o(1569)]=t,e[o(247)](o(1602),s)):(i[o(465)].pause(),p[o(311)](i[o(465)]),i[o(1148)]&&p.stopMediaTrack(i[o(1148)]),i[o(465)]=e,p.addVideoEvent(i[o(465)]),e[o(247)](o(1602),s),e[o(1569)]=t,p[o(658)](e),e[o(1724)]=!1)},p[n(1492)]=async function(e){const t=n;if(Object[t(1706)](p[t(499)])[t(199)](e)<0)return;const r=e+t(292),o=e+t(670),i="get"+w(e)+t(287),a=t(1287)+w(e)+"Tracks",c=e===p.StreamTrack[t(565)];let u=!1;const d=p[t(1266)].devices[o];if(!d)return;const l=p[i](d);c&&x.android&&(u=p.core[t(1054)][r]&&p[t(1266)].camera[r][t(1168)]===t(794),u&&p[t(264)](p[t(1266)][t(1054)][r])),c&&d===p[t(1736)].Environment&&(!p[t(1266)][t(1533)][t(1166)]&&await p[t(1301)](!0),p[t(1266)][t(1533)].backCamera&&(l[t(1363)].deviceId=p[t(1266)][t(1533)][t(1166)].id));try{let e=await navigator[t(796)].getUserMedia(l);!c&&p[t(760)][t(195)]===t(960)&&(p[t(264)](p[t(1266)].camera[t(1421)]),p[t(1266)][t(1054)][t(1421)]=e[t(1008)]()[0],e=await p[t(760)][t(1824)](e)),p[t(264)](p[t(1266)].camera[r]),p[t(1266)][t(1054)][r]=e[a]()[0],p[t(1219)](p.core[t(1054)][r],t(1492),p[t(1266)][t(1054)])}catch(r){if(p[t(1266)].devices[o]="",s[t(485)](r&&r[t(1645)]?r[t(1645)]:r),c&&x[t(934)]&&u){const e=p[t(523)](p[t(1266)][t(1533)][t(635)]),r=await navigator[t(796)][t(835)](e);p.core[t(1054)][t(514)]=r[t(503)]()[0],p[t(1338)](p[t(499)][t(565)],p[t(1266)][t(1054)]),p[t(623)](p[t(1266)][t(1054)].videoElem,p[t(1266)][t(1054)].stream),p[t(1266)][t(1054)].pc&&await p.replacePCTrack(p[t(499)].Video,p.core[t(1054)])}return p[t(749)](p[t(1215)][t(391)],{deviceType:e===p[t(499)][t(418)]?p[t(925)].AudioInput:p[t(925)][t(496)],deviceID:d,desc:t(1233)+e+t(592)})}e===p[t(499)][t(418)]?(await p.initAudioContext(),p.replaceStreamTrack(e,p[t(1266)].camera),p[t(622)](p[t(1155)][t(551)])):(p[t(1338)](e,p.core[t(1054)]),p.setVideoElementStream(p[t(1266)].camera[t(465)],p.core[t(1054)].stream),p.options.autoplayFix&&p[t(1122)](p[t(1266)][t(1054)].videoElem,!0)),p[t(1266)][t(1054)].pc&&await p[t(213)](e,p[t(1266)][t(1054)])},p[n(658)]=function(e=null,t=!0,r=!1){const o=n;if(!(e&&e instanceof HTMLElement))return void s[o(1023)](o(1149));t&&(e[o(1724)]=!0),e[o(495)]=!1,e[o(364)]=!0,e.autoplay=!0,e[o(1837)](o(642),""),e[o(1837)](o(1517),"");const i=()=>{const n=o;s[n(1055)](n(t?1363:341)+n(342)+(e.id||"")),!r&&p[n(1122)](e,t),!t&&p[n(1820)](e,p[n(1266)][n(1533)][p[n(925)][n(1744)]]),e[n(464)](n(1583),i)};e.addEventListener("loadedmetadata",i)},p.elementPlay=function(e,t){const r=n;e[r(805)]().then()[r(432)]((o=>{const n=r;p[n(1266)][n(950)][n(839)]||(s.logError("can't autoplay "+(t?n(1363):"audio")+" "+(e.id||"")+", "+o),p.core.unableAutoPlay[n(801)](e),a[n(1167)](a[n(629)][n(665)]))}))},p[n(1758)]=async function(e,t){const r=n;if(!p[r(1199)][r(1021)]||!e)return void(e&&p[r(1122)](e,t));if(x.ios){const o=p[r(1266)].camera;if(o.preview&&o[r(1148)]&&o[r(1148)][r(1168)]===r(794))return void p.elementPlay(e,t)}const o=p[r(1266)].permission;let i=null;try{o[r(839)]?(i=o[r(839)],clearTimeout(o.timeout)):o.audio&&(i=await navigator[r(796)][r(835)]({audio:!0}),o[r(839)]=i),p[r(1122)](e,t),i&&(o[r(972)]=setTimeout((()=>{const e=r;o[e(839)]=null,p[e(256)](i)}),3e4))}catch(o){p[r(1122)](e,t)}},p[n(1774)]=async function(e=null,t,r=!1,o=!1,i=[]){const c=n;if(r||o)r&&p[c(1492)](p.StreamTrack[c(418)])[c(515)](),o&&p[c(1492)](p[c(499)][c(565)])[c(515)]();else if(t){if(p.core[c(1054)][c(731)]&&p.core[c(1054)].stream&&(!e||p[c(1266)].camera.videoElem===e)||p[c(1266)][c(1054)][c(1588)])return s[c(1023)](c(1857)),p.emitPreviewError({type:p[c(1155)][c(551)],desc:c(1678),error:{name:c(1595)}});if(!p.options[c(724)]&&!p[c(1199)].cameraEnableVideo)return p[c(1513)]({type:p[c(1155)][c(551)],desc:c(1446),error:{name:c(1475)}});if(!p[c(1266)].devices.audioinput&&!p.core[c(1533)].videoinput)return p[c(1513)]({type:p.StreamType[c(551)],desc:c(595),error:{name:c(1352)}});e instanceof HTMLElement&&e!==p[c(1266)][c(1054)][c(465)]&&(p[c(658)](e),p.core.camera[c(465)]=e);let t=p.core[c(1533)][c(673)]?p[c(523)](p[c(1266)][c(1533)][c(673)]):{video:!1},r=p.core.devices[c(467)]?p[c(1378)](p[c(1266)][c(1533)][c(467)]):{audio:!1},o=!1,n=!1,u=!1,d=!1,l=null,f=null,m=[],b=async e=>{const t=c;p[t(1266)][t(1054)][t(1148)]=e,n=!0,p[t(1219)](p[t(1266)][t(1054)][t(1148)],t(1774),p[t(1266)].camera),p[t(1338)](p[t(499)][t(418)],p[t(1266)][t(1054)]),await p[t(841)](),p.releaseAudioProcessor(p[t(1155)][t(551)])};p[c(1266)][c(1054)].tryPreview=!0,t[c(1363)]&&(t[c(1363)][c(487)]===p[c(1736)].Environment&&(!p[c(1266)][c(1533)][c(1166)]&&await p.getDeviceList(!0),p[c(1266)][c(1533)][c(1166)]&&(t[c(1363)][c(487)]=p[c(1266)][c(1533)].backCamera.id)),m.push((async()=>{const e=c;let r;try{r=await navigator[e(796)][e(835)](t),p[e(1266)][e(1054)][e(514)]=r.getVideoTracks()[0],o=!0}catch(t){return s[e(1023)](e(771)+t.toString()),void(f=t)}return p[e(1219)](p[e(1266)][e(1054)][e(514)],e(1774),p[e(1266)][e(1054)]),p[e(1338)](p[e(499)].Video,p.core.camera),p[e(623)](p[e(1266)].camera[e(465)],p.core[e(1054)].stream),p[e(1199)][e(1021)]&&p.elementPlay(p[e(1266)][e(1054)][e(465)],!0),r})())),r[c(341)]&&(i[c(1524)]>0&&r[c(341)]instanceof Object&&p[c(1353)](r[c(341)]),m.push((async()=>{const e=c;let t;try{t=await navigator[e(796)][e(835)](r)}catch(t){return s[e(1023)](e(1393)+t[e(339)]()),void(l=t)}return b(t[e(1008)]()[0]),t})())),r.audio&&i[c(1524)]>0&&(p.denoiser.setConfig(i[0]),p.options[c(1647)]?(u=!0,m[c(801)]((async()=>{const e=c;try{await p[e(760)][e(701)]()}catch(e){d=!0}})())):u=!1);let v=await Promise[c(1745)](m);if(!p[c(1266)].camera[c(1588)])return void v[c(1505)]((e=>{e instanceof MediaStream&&p[c(256)](e)}));if(n&&u){if(!d)try{let e=await p.denoiser.start(p[c(1266)][c(1054)][c(839)]);p[c(1266)].camera.sourceAudioTrack=p[c(1266)][c(1054)][c(1148)],p.core[c(1054)].audioTrack=e[c(1008)]()[0],p[c(1338)](p[c(499)][c(418)],p[c(1266)][c(1054)],!0),p[c(622)](p[c(1155)][c(551)])}catch(e){s[c(1055)](e[c(339)]()),d=!0}if(d){s[c(1055)](c(1108));let e=p[c(1378)](p[c(1266)][c(1533)].audioinput),t=await navigator[c(796)][c(835)](e);b(t[c(1008)]()[0])}}if(p[c(1266)][c(1054)].tryPreview=!1,!n&&!o){let e=l||f,t=e[c(339)]();return s[c(485)]("preview error: "+e),p[c(1513)]({type:p[c(1155)].Camera,desc:t,error:e})}p.core[c(1054)].preview=!0,n&&(p[c(1266)][c(1054)][c(1822)]=!1),o&&(p[c(1266)][c(1054)][c(389)]=!1),a[c(1167)](a.Event[c(1054)],!0,n,o,p[c(1266)][c(1054)][c(839)])}else"started"===p[c(760)].state?(p[c(264)](p.core[c(1054)].sourceAudioTrack),p[c(264)](p[c(1266)][c(1054)][c(514)]),p[c(760)][c(1508)]()):p[c(256)](p[c(1266)].camera[c(839)]),p.wsUnPublish(p[c(1155)][c(551)],p[c(1266)][c(1054)].id),p[c(1266)][c(1054)][c(1588)]=!1,p[c(1266)][c(1054)][c(731)]=!1,a[c(1167)](a[c(629)][c(1054)],!1)},p[n(894)]=async function(e=null,t,r,o,i){const c=n;let u=p[c(1266)][c(752)][t];if(i){if(u&&u.preview&&u[c(839)])return a.emit(a.Event[c(752)],i,u[c(839)]);!p[c(1266)][c(752)][t]&&(p[c(1266)][c(752)][t]={local:!0,tag:t,type:p[c(1155)][c(551)],candidate:[],layerIndex:-1,muteAudio:!1,muteVideo:!1,info:{app:"",rtc:"",act:0},stream:new MediaStream},u=p[c(1266)].cameraEx[t]),e instanceof HTMLElement&&e!==u[c(465)]&&(p[c(658)](e),u[c(465)]=e);try{if(r){const e=p[c(1378)](r,t),o=await navigator[c(796)][c(835)](e);u[c(1148)]=o[c(1008)]()[0],p.replaceStreamTrack(p[c(499)].Audio,u),u[c(1527)]=r,u.audio=!0,p[c(1219)](u.audioTrack,c(894),u)}else u[c(341)]=!1,delete u[c(1527)];if(o){const e=p[c(523)](o,t),r=await navigator[c(796)][c(835)](e);u.videoTrack=r[c(503)]()[0],p[c(1338)](p[c(499)][c(565)],u),u[c(1447)]=o,u[c(1363)]=!0,p[c(1219)](u[c(514)],c(894),u)}else u[c(1363)]=!1,delete u.audioInputID;return await p[c(841)](),p[c(623)](u[c(465)],u.stream),u[c(731)]=!0,a[c(1167)](a[c(629)][c(752)],!0,t)}catch(e){return s[c(485)](c(435)+e),void p.emitPreviewError({type:t,desc:"open camera error",error:e})}}else u&&(u.stream&&(u.stream[c(1691)]()[c(1505)]((e=>{e[c(604)]=null,p.stopMediaTrack(e)})),u[c(854)]&&(p[c(1339)](u),p[c(1479)](p[c(1155)][c(551)],u.id,t))),u[c(1148)]&&p[c(264)](u.audioTrack),u[c(514)]&&p[c(264)](u.videoTrack),u[c(731)]=!1),p[c(622)](p[c(1155)][c(551)]+"-"+t),a[c(1167)](a[c(629)][c(752)],!1,t)},p.screenPreview=async function(e=null,t){const r=n;if(t){e instanceof HTMLElement&&e!==p[r(1266)].screen[r(465)]&&(p[r(658)](e),p[r(1266)][r(575)][r(465)]=e);let t={audio:p[r(1199)][r(1267)],video:p[r(1199)][r(786)]};t.video&&(t.video={frameRate:{ideal:p.options[r(194)][0][r(1365)]}});try{p[r(1266)][r(575)][r(839)]=await navigator.mediaDevices[r(396)](t)}catch(e){return s.logError(r(1012)+e),e[r(339)]().indexOf("NotAllowedError")>=0?a[r(1167)](a[r(629)][r(575)],!1):p[r(1513)]({type:p[r(1155)][r(1663)],desc:r(1254),error:e})}const o=p[r(1266)][r(575)][r(839)][r(1008)]()[0],n=p.core[r(575)].stream[r(503)]()[0];n[r(604)]=function(){const e=r;p[e(1479)](p[e(1155)][e(1663)],p.core[e(575)].id),p[e(1266)][e(575)][e(731)]=!1,a[e(1167)](a[e(629)][e(575)],!1,p[e(1266)][e(575)][e(631)]||"share")},p[r(1266)].screen.label=n.getSettings().displaySurface||r(1507),p[r(1266)][r(575)].audioTrack=o,p[r(1266)][r(575)][r(514)]=n,p[r(623)](p[r(1266)][r(575)].videoElem,p[r(1266)][r(575)][r(839)]),p[r(1266)][r(575)][r(731)]=!0,a[r(1167)](a.Event[r(575)],!0,p[r(1266)][r(575)][r(631)]||r(1016))}else p.core[r(575)].stream&&(p.stopMediaStream(p[r(1266)][r(575)][r(839)]),p[r(1479)](p[r(1155)][r(1663)],p[r(1266)].screen.id)),p[r(1266)][r(575)].preview=!1,a[r(1167)](a[r(629)][r(575)],!1,p.core[r(575)][r(631)]||r(1016))},p[n(516)]=async function(e=null,t,r){const o=n;if(r){if(p[o(1266)].cameraEx[t]&&p[o(1266)].cameraEx[t][o(731)]&&p.core[o(752)][t][o(839)])return a[o(1167)](a.Event.screenEx,r,t);!p.core[o(752)][t]&&(p[o(1266)][o(752)][t]={local:!0,audio:p[o(1199)][o(1267)],video:p[o(1199)][o(786)],muteVideo:!1,muteAudio:!1,tag:t,type:p[o(1155)][o(1663)],candidate:[],layerIndex:-1,info:{app:"",rtc:"",act:0}});const n=p[o(1266)][o(752)][t];e instanceof HTMLElement&&e!==n[o(465)]&&(p.enableDomAutoPlay(e),n[o(465)]=e);let i={audio:p[o(1199)][o(1267)],video:p.options.screenEnableVideo};i.video&&(i[o(1363)]={frameRate:{ideal:p[o(1199)][o(194)][0][o(1365)]}});try{n[o(839)]=await navigator[o(796)].getDisplayMedia(i)}catch(e){if(s[o(485)](o(309)+e),e.toString()[o(199)](o(1525))>=0)return a[o(1167)](a.Event.screenEx,!1,t);p[o(1513)]({type:t,desc:"open screen error",error:e})}n[o(839)][o(503)]()[0][o(604)]=function(){const e=o;p.wsUnPublish(p.StreamType[e(1663)],n.id,n[e(1838)]),n[e(731)]=!1,a.emit(a.Event[e(1310)],!1,t,n[e(631)]||"share")},n[o(631)]=n.stream[o(503)]()[0].getSettings()[o(1347)]||o(1507),p[o(623)](n[o(465)],n.stream),n.preview=!0,a[o(1167)](a[o(629)][o(1310)],!0,t,n[o(631)]||o(1016))}else{const e=p[o(1266)].cameraEx[t];e&&(e[o(839)]&&(p.stopMediaStream(e[o(839)]),p.wsUnPublish(p[o(1155)].Screen,e.id,e[o(1838)])),e[o(731)]=!1),p.releaseAudioProcessor(p[o(1155)][o(1663)]+"-"+t),a[o(1167)](a[o(629)][o(1310)],!1,t)}},p[n(291)]=function(e,t,r,o,i){const c=n;let u=p[c(1266)][c(1580)];if(r){if(u[c(731)])return a.emit(a[c(629)][c(1363)],r,u.stream);e[c(1379)](c(209))!=c(1658)&&e[c(1837)](c(209),"anonymous"),e[c(1569)]=t,u[c(1485)]=e,u[c(873)]=o,u.tempMuteAudio=i,p.addVideoEvent(e),p[c(658)](e),e[c(1724)]=i,s[c(1055)]("begin waitStreamTimer"),clearInterval(u.waitStreamTimer),e[c(247)](c(1602),p.customCanPlay),e[c(805)](),u[c(1561)]=setTimeout((()=>{const t=c;u[t(465)][t(464)](t(1602),p[t(530)]),p.cleanVideoEvent(e),p[t(1513)]({type:p.StreamType.Screen,subType:p[t(831)][t(550)],desc:"capture media stream error, timeout",error:{name:t(1747)}})}),5e3)}else{if(!u)return;u[c(465)]&&(u[c(465)][c(200)](),p[c(311)](u[c(465)])),clearInterval(u[c(1600)]),clearInterval(u[c(1561)]),u[c(839)]&&(p[c(256)](u[c(839)]),p[c(1479)](p.StreamType.Screen,u.id,"",p[c(831)][c(550)])),p[c(264)](u[c(1148)]),p[c(264)](u[c(514)]),u[c(1148)]=null,u[c(514)]=null,u[c(731)]=!1,a[c(1167)](a[c(629)][c(1580)],!1,u.label)}},p[n(530)]=function(){const e=n;let t=p[e(1266)][e(1580)];t[e(1485)]!==t[e(465)]&&(p[e(311)](t[e(465)]),t.videoElem=t[e(1485)]),t[e(465)][e(464)](e(1602),p[e(530)]),clearInterval(t.waitStreamTimer),s[e(1055)](e(1019));let r=t[e(1288)]?t[e(1288)]:document.createElement(e(1288)),o=p[e(1199)].customLayers[0];t[e(1288)]=r,r.setAttribute(e(723),o[e(723)]),r[e(1837)](e(1669),o[e(1669)]);let i=r[e(743)]("2d");clearInterval(t[e(1600)]),t[e(1600)]=setInterval((function(){const o=e;i[o(431)](t[o(465)],0,0,r[o(723)],r[o(1669)])}),40);try{p[e(264)](t.audioTrack),p[e(264)](t.videoTrack),t[e(1148)]=null,t[e(514)]=null;let o=null;if(t[e(839)]=new MediaStream,o=typeof t.videoElem[e(1408)]===e(297)?t[e(465)].captureStream():t.videoElem.mozCaptureStream(),!t[e(1611)]&&(t[e(1148)]=o[e(1008)]()[0]),!t[e(873)]){let o=r[e(233)](30);t.videoTrack=o[e(503)]()[0]}}catch(t){return s[e(485)]("open video preview error, "+t),p[e(1513)]({type:p[e(1155)].Screen,subType:p[e(831)][e(550)],desc:e(414),error:{name:e(1747)}})}t.videoTrack?t[e(839)][e(590)](t.videoTrack):s[e(1023)](e(640)),t[e(1148)]?t.stream[e(590)](t[e(1148)]):s[e(1023)]("media preview audioTrack is not available"),t[e(389)]=t.tempMuteVideo,t[e(1822)]=t[e(1611)],t[e(731)]=!0,a[e(1167)](a.Event.custom,!0,t[e(631)],t[e(839)])},p[n(956)]=function(t,r){return new Promise((o=>{const n=e,i=t[n(465)],a=document[n(214)](n(1288));let c=null;if(!a.captureStream)return s.logWarn(n(203)),o();if(p[n(1199)][n(1267)])return o();if(!p.core[n(1054)].audioTrack)return s[n(1023)](n(1278)),o();c=p[n(1266)][n(1054)][n(1148)][n(1532)](),i[n(247)]("loadedmetadata",(function e(s){const u=n;i[u(464)](u(1583),e);const d=document[u(214)](u(1363)),l=a.getContext("2d"),p=s[u(242)]||s[u(999)],f=p[u(1177)],m=p[u(180)],b=new MediaStream;a[u(1837)](u(723),f),a.setAttribute(u(1669),m),t[u(1443)]=setInterval((function(){const e=u;l[e(1293)](0,0,a[e(723)],a.height),l[e(431)](i,0,0,a[e(723)],a[e(1669)])}),40),b[u(590)](c),b[u(590)](a[u(233)](r)[u(503)]()[0]),d[u(1724)]=!0,d[u(1250)]=b,d[u(805)](),t[u(839)]=b,t.offSceenVideo=d,o()}))}))},p[n(667)]=function(e,t,r){const o=n;if(!e[o(839)])return;e[o(839)][o(1691)]()[o(1505)]((e=>{e[o(1687)]===t&&(e.enabled=!r)}))},p[n(1426)]=function(e="",t={},r=!1,o=""){const i=n;let a=null,c="",u={};return t.hasOwnProperty(i(1822))&&(u[i(1822)]=!!t.muteAudio),t[i(1651)](i(389))&&(u[i(389)]=!!t.muteVideo),a=o?o===p[i(831)][i(550)]?p[i(1266)][i(1580)]:p[i(1266)][i(752)][o]:p[i(1266)][e],a?a.preview?a[i(558)]==p.StreamType[i(1663)]?p[i(928)](a,u,r):p[i(753)](a,u,r):(c="mute local before preview",s[i(1023)](c),Promise[i(212)](p[i(1225)](a,{desc:c}))):(c=i(1195),s[i(1023)](c),Promise[i(212)](p[i(1225)](null,{desc:c})))},p[n(1225)]=function(e,t={}){const r=n;return e?{type:e[r(558)],tag:e.tag,subType:e[r(826)],muteAudio:e[r(1822)],muteVideo:e[r(389)],...t}:{...t}},p[n(753)]=async function(e,t,r){const o=n;if(e.isMuting)return Promise.reject(p[o(1225)](e,{desc:o(481)}));let i=r,a=!1,c=p[o(760)];try{if(e[o(1040)]=!0,t[o(1651)]("muteAudio"))if(r)e[o(1822)]=t[o(1822)],!e.muteAudio&&(a=!0);else if(t[o(1822)]!==e[o(1822)]){if(t[o(1822)])!e[o(1838)]&&c&&c[o(195)]===o(960)?p[o(264)](e[o(1421)]):p[o(264)](e.audioTrack);else{const t=e[o(1527)]||p[o(1266)].devices[o(467)],r=p[o(1378)](t);let n=await navigator.mediaDevices.getUserMedia(r),i=n[o(1008)]()[0];if(!e.tag&&c&&"started"===c[o(195)]){p.stopMediaTrack(e[o(1421)]),e[o(1421)]=i,i=(await p.denoiser[o(1824)](n))[o(1008)]()[0]}e.audioTrack=i,p[o(1338)](p.StreamTrack[o(418)],e),e.pc&&await p[o(213)](p[o(499)][o(418)],e)}e[o(1822)]=t[o(1822)],i=!0}if(t[o(1651)]("muteVideo"))if(r)e[o(389)]=t[o(389)],!e[o(389)]&&(a=!0);else if(t[o(389)]!==e.muteVideo){if(t[o(389)])p[o(264)](e[o(514)]);else{const t=e[o(1447)]||p[o(1266)][o(1533)][o(673)],r=p[o(523)](t,e.tag),n=await navigator[o(796)][o(835)](r);e[o(514)]=n[o(503)]()[0],p[o(1338)](p[o(499)].Video,e),e.pc&&await p[o(213)](p.StreamTrack[o(565)],e)}e.muteVideo=t[o(389)],i=!0}return i&&e.pc&&p[o(250)](e.id,e[o(389)],e[o(1822)]),a&&p[o(1284)](e),e[o(1040)]=!1,{type:e[o(558)],tag:e.tag,muteAudio:e[o(1822)],muteVideo:e[o(389)]}}catch(t){return e[o(1040)]=!1,s.logWarn(o(1162),t),Promise[o(212)]({type:e[o(558)],tag:e[o(1838)],muteAudio:e[o(1822)],muteVideo:e.muteVideo,desc:t[o(1645)]})}},p.muteLocalStreamScreen=function(t,r,o){let n=o,i=!1;return new Promise((s=>{const a=e;r[a(1651)](a(1822))&&(r[a(1822)]!==t.muteAudio||o)&&(n=!0,t[a(1822)]=r[a(1822)],p[a(667)](t,p[a(499)][a(418)],r.muteAudio),!o&&!r[a(1822)]&&(i=!0),p[a(1433)](p[a(1537)].UserAction,{action:p[a(661)][a(1109)],mediaType:p[a(541)].Audio,streamInfo:t})),r.hasOwnProperty(a(389))&&(r[a(389)]!==t.muteVideo||o)&&(n=!0,t[a(389)]=r[a(389)],p[a(667)](t,p.StreamTrack.Video,r[a(389)]),!o&&!r.muteVideo&&(i=!0),t.muteVideo&&(t.systemMuteVideo=!1),p.triggerLogUpload(p[a(1537)][a(661)],{action:p.UserAction.toggleMute,mediaType:t.type===p[a(1155)][a(551)]?p[a(541)][a(565)]:p.MediaType[a(1663)],streamInfo:t})),n&&t[a(854)]&&p.wsUpdate(t.id,t[a(389)],t[a(1822)]),i&&p[a(1284)](t),s({type:t[a(558)],tag:t[a(1838)],subType:t[a(826)],muteAudio:t[a(1822)],muteVideo:t.muteVideo})}))},p[n(1808)]=function(e,t={}){const r=n;let o=p[r(1452)](e);if(o){let e=!1;t[r(1651)](r(1822))&&t[r(1822)]!==o[r(181)]&&(e=!0,o[r(181)]=t.muteAudio,p[r(667)](o,p[r(499)][r(418)],t[r(1822)]),p[r(1433)](p[r(1537)][r(661)],{action:p.UserAction.toggleMute,mediaType:p[r(541)][r(418)],streamInfo:o})),t.hasOwnProperty(r(389))&&t[r(389)]!==o[r(201)]&&(e=!0,o[r(201)]=t.muteVideo,p[r(667)](o,p.StreamTrack.Video,t[r(389)]),p[r(1433)](p.LogType[r(661)],{action:p[r(661)][r(1109)],mediaType:o[r(558)]===p.StreamType.Camera?p.MediaType[r(565)]:p[r(541)][r(1663)],streamInfo:o})),e&&o[r(854)]&&p.wsUpdate(o.id,o.localMuteVideo,o[r(181)])}},p[n(1638)]=function(t,r,o=!1){const i=n,c=()=>{const r=e;return p.ws[r(1168)]===WebSocket[r(215)]&&t[r(1521)]&&p.core[r(1528)]};if(typeof t[i(890)]===i(297)&&(t[i(890)]=0),!c())return t[i(890)]=0,void s[i(1055)](i(1634));if(!p.options.subscribeAutoRecover||t[i(890)]>2||o){const e={...t};return t[i(890)]=0,t.id&&p[i(1639)](t.id),void p[i(749)](p[i(1215)].SubscribeError,{publishID:e[i(705)],subscribeID:e.id,desc:r})}let u=1e3*t[i(890)];t[i(884)]=setTimeout((()=>{const e=i;if(c()){const r=t.id;s[e(1055)](e(491)+t[e(890)]),p[e(1639)](t.id),p[e(929)](p[e(1266)][e(1668)],t[e(705)]),a.emit(a[e(629)][e(1638)],{publishID:t.publishID,subscribeID:r,desc:e(615)})}}),u),t[i(890)]++},p[n(1768)]=function(e,t){const r=n,o=p[r(1266)].users[e];o&&Object[r(1772)](o,t)},p.wsPrepare=function(e="",t=!1){const r=n;let o,i;try{let t=JSON[r(1506)](Base64[r(684)](e)),n=t[r(953)][r(1540)](":"),s=n[0],a=n[1],c=t.domain;o=t.path,a&&"80"!==a&&a!==r(1112)&&(o=":"+a+o),o=p[r(452)](r(1043)+(c||s)+o),i={name:r(656),type:"request",stamp:Date[r(931)](),requestID:h(),content:{id:t.tokenId,host:t[r(953)],secure:t[r(621)],signature:t[r(1562)],privateID:p[r(1266)][r(1201)],dType:p[r(1266)].dType,quality:p[r(1199)][r(882)]?1:2,role:p[r(1266)][r(507)],name:p.core[r(1013)]}}}catch(e){if(s[r(485)](r(1291),e.toString(),t),t)return p[r(1568)]();a[r(1167)](a[r(629)][r(605)],p.ErrorCode[r(299)],r(1032)),p[r(1433)](p[r(1537)][r(811)],{errorType:p[r(218)][r(663)],errorCode:p[r(346)][r(663)][r(970)],errorDesc:"token info error: "+e[r(339)]()})}p[r(399)](o,i,t)},p[n(399)]=function(e="",t={},r=!1){const o=n;p.ws&&(r&&p.ws[o(464)](o(1070),p[o(1266)][o(1670)][o(388)]),p.ws.close()),0===p[o(1266)][o(313)]&&(p.core.retry=0,p.core[o(313)]=2);const i=p[o(1266)][o(1670)];p.ws=new WebSocket(e),p.ws[o(247)]("open",i[o(746)]=function(){const r=o;s[r(1055)](r(370),e),p.core[r(890)]=0,p.wsJoin(t)}),p.ws.addEventListener("message",i.onMessage=function(e){const t=o;p[t(846)](e[t(1773)])}),p.ws[o(247)]("close",i.onClose=function(n){const i=o;s.logWarn(i(1101)+(n?n[i(634)]:""));const a=p[i(1266)][i(1670)];if(p.ws[i(464)]("open",a.onOpen),p.ws[i(464)]("message",a[i(539)]),p.ws.removeEventListener(i(1070),a.onClose),p.ws[i(464)]("error",a[i(1748)]),0!==p.core[i(313)])return 2===p[i(1266)][i(313)]?(p[i(1266)][i(890)]++,void(p[i(1266)][i(890)]<=3?(s[i(1055)](i(1097)+p.core[i(890)]),setTimeout((()=>{p.wsInitialize(e,t,r)}),1e3)):(p[i(1266)][i(313)]=0,p[i(1266)][i(890)]=0,p[i(749)](p[i(1215)][i(299)],i(1657))))):void(p[i(1199)][i(542)]&&p.ws?p[i(1568)]():(!p.options[i(542)]&&(s[i(485)](i(1128)),p[i(749)](p[i(1215)][i(1470)])),p[i(185)]()))}),p.ws[o(247)]("error",i[o(1748)]=function(e){const t=o;s[t(485)](t(1269),e),p.ws[t(1070)]()})},p[n(1503)]=function(){const e=n;return p.ws&&p.ws.readyState===WebSocket[e(215)]},p[n(344)]=function(e={},r=null){const o=n;if(p.ws&&p.ws[o(1168)]===WebSocket.OPEN){let r=e;e instanceof Object&&(r=JSON[o(1014)](e),p[o(1199)].debug&&e[o(1645)]!==o(1682)&&s.logInfo(o(946),r),r=function(e){const r=t;if(!e)return;let o=Base64[r(337)](e),n=o[r(199)]("=")<0?0:o[r(1524)]-o[r(199)]("=");o=o[r(1260)](/=/g,"");let i=y(1,25),s="";for(let e=0,t=o[r(1524)];e=47&&t<=57?String[r(1106)](t):t>=65&&t<=90?String[r(1106)](t+i>90?t+i-26:t+i):String.fromCharCode(t+i>122?t+i-26:t+i)}let a=Math[r(1221)](Date[r(931)]()/1e3);return a=1e3*a+100*n+i,JSON.stringify({name:r(579),type:r(522),stamp:a,content:s})}(r)),p.ws[o(416)](r)}if(r)return r()},p.wsHandler=function(e=""){const r=n,o={join:p[r(1386)],leave:p[r(681)],publish:p.wsHandlePublish,unpublish:p.wsHandleUnPublish,subscribe:p[r(1566)],unsubscribe:p[r(1805)],negotiate:p.wsHandleNegotiate,update:p[r(544)],updateSubLayer:p[r(964)],message:p[r(1017)],ping:p[r(236)],startLiveBroadcast:p[r(1726)],stopLiveBroadcast:p[r(860)],updateInfo:p[r(971)],updateRoom:p.wsHandleUpdateRoom,updateName:p.wsHandleUpdateName,userJoined:p.wsHandleUserJoined,userLeft:p[r(1015)],streamAdded:p[r(1207)],streamRemoved:p[r(728)],streamUpdated:p[r(1833)],layerReqChanged:p.wsHandleLayerReqChanged,nameUpdated:p[r(643)],mixer:p.wsHandleMixer,webpage:p[r(436)],infoUpdated:p[r(957)],roomUpdated:p[r(505)],netStatChanged:p[r(624)],updateNetStat:p[r(1249)],kick:p.wsHandleKick,role:p[r(451)]};let i;try{i=JSON[r(1506)](e)}catch(t){return s.logError("can not parse data, "+e+", "+t)}return i&&i.hasOwnProperty(r(1645))&&i[r(545)]?"guardian"===i[r(1645)]?p[r(846)](function(e=0,r="",o){const n=t;if(!e||!r)return;let i,s=Math.floor(e%1e3),a=Math[n(1221)](s/100),c=Math[n(1221)](s%100),u="";for(let e=0,t=r[n(1524)];e=47&&t<=57?String[n(1106)](t):t>=65&&t<=90?String[n(1106)](t-c<65?t-c+26:t-c):String[n(1106)](t-c<97?t-c+26:t-c)}for(let e=0;ee[t(1668)]!==p[t(1266)][t(1668)]))),a[t(1167)](r?a[t(629)][t(782)]:a.Event[t(245)],o,{mixer:e.content[t(186)]||[],webpage:e[t(545)][t(543)]||[]}),p[t(1266)][t(1823)].join[t(1574)]=Date[t(931)](),p.triggerLogUpload(p[t(1537)][t(661)],{action:p.UserAction[t(1414)],reconnected:r}),p[t(1199)].enableLogUpload&&(p[t(546)](),p[t(1576)]()),p.streamNetworkReport(!0,p[t(1199)].networkReportInterval)},p[n(1090)]=function(){const e=n;if(p[e(1682)])try{clearInterval(p.ping),delete p[e(1682)]}catch(e){s.logWarn(e)}p[e(1682)]=setInterval((()=>{const t=e;p.ws&&p.ws[t(1168)]===WebSocket[t(215)]&&p[t(344)]({name:t(1682),type:"request",requestID:h(),stamp:Date[t(931)]()})}),p[e(1199)][e(1196)])},p.wsHandlePing=function(e={}){const t=n;let r=e.content[t(1500)];p[t(1682)]&&r!==p.options[t(1196)]&&(p[t(1199)][t(1196)]=r,p[t(1090)]()),p[t(344)]({name:t(1682),type:t(1057),requestID:e[t(1020)],stamp:Date.now()})},p[n(1607)]=function(){const e=n;p[e(344)]({name:"leave",type:"request",stamp:Date.now(),session:p[e(1266)][e(1528)],requestID:h(),content:{userID:p[e(1266)][e(1668)],meetingID:p[e(1266)][e(1272)]}},(()=>{const t=e;p.ws[t(1070)]()}))},p[n(681)]=function(){},p[n(340)]=function(e={}){const t=n;if(!e.content)return;let r=e[t(545)][t(1668)],o=e[t(545)][t(711)];r!==p[t(1266)][t(1668)]&&(p[t(1266)].users[r]={uid:r,dType:o,streams:[]},a[t(1167)](a[t(629)][t(1547)],e[t(545)].userID))},p[n(1015)]=function(e={}){const t=n;if(!e[t(545)])return;let r=e[t(545)].userID;r!==p[t(1266)][t(1668)]&&(p[t(1266)][t(1721)][r]&&(p[t(1266)][t(1721)][r][t(524)].forEach((e=>{const r=t;p.core[r(1031)][e]&&(p[r(1266)][r(1031)][e].id&&p[r(1266)][r(1031)][e][r(854)]?p.resetStreamData(p[r(1266)][r(1031)][e],!0):delete p[r(1266)][r(1031)][e])})),delete p.core.users[r]),a[t(1167)](a[t(629)][t(532)],e.content[t(1668)]))},p[n(1395)]=function(e="",t="",r="",o=""){const i=n;let s=null;s=t?p.core.cameraEx[t]:o===p[i(831)].Custom?p.core.custom:p[i(1266)][e],""!==r&&(s[i(1755)].act=1|s.info[i(1655)],s[i(1755)].app=r||"");let a=0,c=p[i(1679)](s);c[i(1505)]((e=>a+=e[i(716)]||0)),s[i(813)]=s[i(558)]===p[i(1155)].Screen?0:-1;const u=h();if(p.core[i(1823)][i(1143)+u]={publishBegin:Date[i(931)]()},t){if(!s)return;s.lastRequestID=u;let r={userID:p.core[i(1668)],minVideoBw:0,maxVideoBw:a,label:s.stream.id,type:e,tag:t||"",video:s[i(1363)],audio:s[i(341)],muteVideo:!!s[i(389)],muteAudio:!!s[i(1822)],layers:c};s[i(1755)][i(1655)]>0&&(r[i(1755)]=s[i(1755)][i(509)]),p[i(344)]({name:i(767),type:i(522),stamp:Date[i(931)](),session:p[i(1266)][i(1528)],requestID:s[i(1521)],content:r}),s[i(1755)].act=0}else{s.lastRequestID=u;let t={userID:p[i(1266)].userID,minVideoBw:0,maxVideoBw:a,label:s.stream.id,type:e,video:!!s.videoTrack,audio:!!s[i(1148)],muteVideo:s[i(389)],muteAudio:s[i(1822)],layers:c};p[i(1266)][e][i(1755)][i(1655)]>0&&(t[i(1755)]=s[i(1755)][i(509)]),p[i(344)]({name:"publish",type:i(522),stamp:Date.now(),session:p[i(1266)].session,requestID:s[i(1521)],content:t}),s[i(1755)][i(1655)]=0}s[i(558)]===p[i(1155)][i(1663)]&&p[i(1425)](s)},p[n(1491)]=function(e={}){const t=n;if(!e.content[t(377)]||!e[t(1020)])return s[t(485)](t(450)),void p.triggerPublishLogUpload(null,{errorType:p[t(218)][t(663)],errorCode:p.LogErrorCode[t(663)][t(1073)],errorDesc:t(1846)+e[t(1020)]});let r=p.getStreamInfoByRequestID(e.requestID,p[t(1550)][t(1229)]);if(!r)return s[t(1023)](t(1832)+e.seq),void p[t(1659)](null,{errorType:p[t(218)].Rtc,errorCode:p[t(346)][t(663)][t(1073)],errorDesc:t(349)+e[t(1020)]+", no localStream data"});let o=r[t(558)],i=r.subType,a=r[t(1838)];if(s[t(1055)](t(1453)+JSON[t(1014)](e)+")"),0!==e.content.result[t(634)])return s[t(1055)](t(1842)+e[t(545)][t(377)][t(634)]+", tag:"+a),s[t(1055)](t(383)+(e[t(545)][t(377)].code,e[t(545)][t(377)].detail)),s[t(1023)]("publish error,",e[t(545)][t(377)][t(634)],e[t(545)][t(377)][t(1812)],t(885)+e.requestID),p.emitError(p[t(1215)][t(1099)],{type:o,subType:i,tag:a,desc:t(1858)}),void p.triggerPublishLogUpload(r,{streamInfo:r,errorType:p.LogErrorType[t(663)],errorCode:p[t(346)][t(663)][t(1073)],errorDesc:"publish error, requestID: "+e[t(1020)]+t(1140)});r.id&&p.clearnStreamNetData(r),r.id=e[t(545)][t(705)];let c=p[t(1679)](r);clearInterval(r[t(246)]),p[t(589)](p[t(1550)][t(1229)],r,c)[t(515)]((e=>{p[t(1191)](r.id,"offer",e,0)}))},p[n(1479)]=function(e="",t="",r="",o=""){const i=n;t&&(!p.core[i(1823)][i(455)+t]&&(p[i(1266)][i(1823)]["unpublish-"+t]={}),p[i(1266)][i(1823)]["unpublish-"+t][i(1697)]=Date.now());let s=()=>{const n=i;let s=null;r?(s=p[n(1266)][n(752)][r],p[n(1266)][n(752)][r]&&p[n(1266)][n(752)][r].id&&p.core[n(752)][r].id===t&&(p[n(1266)][n(1823)]["unpublish-"+t][n(417)]={...p[n(1266)].cameraEx[r]},p[n(1410)](p[n(1266)][n(752)][r]))):o===p[n(831)][n(550)]?(s=p[n(1266)].custom,p.core[n(1580)].id&&p[n(1266)].custom.id===t&&(p.core.userActionData[n(455)+t][n(417)]={...p[n(1266)][n(1580)]},p[n(1410)](p[n(1266)][n(1580)]))):(s=p[n(1266)][e],p[n(1266)][e].id&&p.core[e].id===t&&(p[n(1266)][n(1823)]["unpublish-"+t][n(417)]={...p[n(1266)][e]},p[n(1410)](p.core[e]))),s[n(558)]===p[n(1155)][n(1663)]&&p[n(1468)](s)};t||r?p[i(344)]({name:"unpublish",type:i(522),stamp:Date[i(931)](),session:p[i(1266)].session,requestID:h(),content:{userID:p[i(1266)].userID,publishID:t||(o===p.SubStreamType[i(550)]?p.core.custom.id:p[i(1266)][e].id)}},s):s()},p[n(176)]=function(e){const t=n;if(!e[t(545)][t(377)]||!e[t(1020)])return s[t(485)](t(1246));p[t(1266)].userActionData[t(455)+e[t(545)][t(705)]][t(1585)]=Date[t(931)](),p[t(1266)][t(1823)]["unpublish-"+e.content[t(705)]][t(417)]&&p[t(1433)](p[t(1537)][t(661)],{action:p[t(661)].Unpublished,streamInfo:p.core[t(1823)][t(455)+e[t(545)].publishID][t(417)]})},p[n(929)]=function(e,t){const r=n;p[r(1266)][r(1031)][t].layerIndex<0&&(p[r(1266)][r(1031)][t].layerIndex=0),!p.core[r(1823)][r(1567)+t]&&(p[r(1266)][r(1823)]["subscribe-"+t]={}),p[r(1266)].userActionData["subscribe-"+t].subscribeBegin=Date[r(931)](),p[r(1266)].publishers[t].lastRequestID=h();let o=p[r(1266)][r(1031)][t][r(1056)][r(1515)](-1)[0][r(716)]||3e6,i=!1,s=!1,a=0;try{i=p.core[r(1031)][t][r(201)],s=p[r(1266)].publishers[t].localMuteAudio,a=p[r(1266)][r(1031)][t][r(813)]}catch(e){}let c={name:r(328),type:r(522),stamp:Date[r(931)](),session:p.core[r(1528)],requestID:p[r(1266)][r(1031)][t][r(1521)],content:{userID:p[r(1266)].userID,publishID:t,maxVideoBw:o,video:p.core[r(1031)][t].video,audio:p.core.publishers[t][r(341)],muteVideo:i,muteAudio:s,layerIndex:a}};p[r(344)](c)},p[n(1566)]=function(e){const t=n;if(!e[t(545)][t(377)]||!e[t(1020)])return s[t(485)]("subscribe error, bad response"),void p[t(895)](null,{errorType:p[t(218)].Rtc,errorCode:p[t(346)][t(663)][t(1329)],errorDesc:t(985)+JSON[t(1014)](e)});let r=p[t(900)](e[t(1020)]);if(!r)return s[t(1023)]("subscriber error, cannot handle seq id "+e.requestID),void p[t(895)](null,{errorType:p[t(218)][t(663)],errorCode:p.LogErrorCode[t(663)][t(1329)],errorDesc:t(871)+JSON[t(1014)](e)});if(0!==e[t(545)][t(377)].code)return s[t(1023)](t(563),e[t(545)][t(377)].code,e[t(545)][t(377)][t(1812)],t(885)+e.requestID),p.subscribeRecover(r,"response code not zero"),void p[t(895)](r,{streamInfo:r,errorType:p.LogErrorType.Rtc,errorCode:p[t(346)][t(663)][t(1329)],errorDesc:t(1406)+JSON[t(1014)](e)});let o=e.content[t(705)],i=e.content[t(944)];p[t(1266)].publishers[o].id=i,p.createRtcPeerConn(p[t(1550)][t(1323)],p[t(1266)].publishers[o])[t(515)]((e=>{const r=t;e&&p[r(1191)](i,r(768),e)}))},p[n(1639)]=function(e="",t=null){const r=n,o=p[r(1656)](e),i=p[r(1266)].publishers[o];i&&(p[r(1266)][r(1823)]["unsubscribe-"+e]={unsubscribeBegin:Date[r(931)](),streamInfo:{...i}}),p.wsSender({name:r(521),type:r(522),stamp:Date[r(931)](),session:p[r(1266)][r(1528)],requestID:h(),content:{userID:p[r(1266)][r(1668)],subscribeID:e}},(()=>{i&&i.id===e&&p.resetStreamData(i),t instanceof Function&&t()}))},p[n(1805)]=function(e){const t=n;if(!e[t(545)].result||!e[t(1020)])return s.logError(t(1690));p.core[t(1823)][t(289)+e[t(545)][t(944)]]&&(p[t(1266)][t(1823)][t(289)+e.content.subscribeID][t(914)]=Date[t(931)](),p[t(1433)](p.LogType[t(661)],{action:p[t(661)][t(227)],streamInfo:p[t(1266)][t(1823)][t(289)+e[t(545)].subscribeID][t(417)]}))},p.wsNegotiate=function(e,t,r,o=3e6,i=null){const s=n;if(!r)return;let a={name:s(1137),type:"request",stamp:Date[s(931)](),session:p[s(1266)][s(1528)],requestID:h(),content:Object.assign({userID:p.core[s(1668)],streamID:e,type:t,sdp:r,maxVideoBw:o},i)};"renego"===t&&(p[s(1266)].reconnectingStreams[a[s(1020)]]=e),p.wsSender(a)},p[n(1176)]=function(e={}){const t=n;s.logInfo(t(908)+e[t(558)]+t(1372)+JSON[t(1014)](e));let r=e[t(558)];if([p[t(918)][t(1790)],p.MsgType[t(1563)]].indexOf(r)<0)return s[t(485)](t(1069)),void p[t(1433)](p.LogType[t(811)],{errorType:p[t(218)][t(663)],errorCode:p.LogErrorCode[t(663)][t(1329)],errorDesc:t(1084)+JSON[t(1014)](e)});let o=e.content[t(807)],i=e[t(1020)];if(!o)return o=p[t(1266)].reconnectingStreams[i],o?p.reconnectStream(o):(s[t(1023)](t(1688)),void p[t(1433)](p[t(1537)][t(811)],{errorType:p.LogErrorType[t(663)],errorCode:p.LogErrorCode[t(663)][t(1329)],errorDesc:t(1394)+JSON[t(1014)](e)}));i&&delete p[t(1266)][t(740)][i];let c=p[t(1452)](o);if(!c)return p[t(1433)](p[t(1537)][t(811)],{errorType:p[t(218)][t(663)],errorCode:p[t(346)][t(663)][t(1329)],errorDesc:t(1316)+JSON[t(1014)](e)}),s[t(1023)](t(1376)+o);if(r===p[t(918)][t(1563)]){if(s[t(1055)](t(901)+JSON.stringify(e)),"ready"===e[t(545)][t(558)]){let e=!!c.ready;if(c[t(854)]=!0,e)s.logInfo(o,"ice connection had been recovered");else if(c[t(1227)])c.tag?c[t(558)]===p.StreamType[t(551)]?a[t(1167)](a.Event[t(1529)],o,c[t(1838)]):a[t(1167)](a.Event[t(1836)],o,c.tag):c[t(826)]===p[t(831)].Custom?a[t(1167)](a[t(629)][t(1672)],o,c[t(558)],c[t(631)]):a[t(1167)](a[t(629)][t(320)],o,c[t(558)],c[t(631)]),p[t(1426)](c[t(1838)]||c[t(558)],{muteAudio:c.muteAudio,muteVideo:c[t(389)]},!0,c[t(826)]),p[t(1266)][t(1560)]&&(c[t(1749)]=c[t(1822)],c.tag?p[t(1426)](c[t(1838)],{muteAudio:!0}):p.muteLocalStream(c.type,{muteAudio:!0},!1,c.subType)),p[t(1266)][t(1823)][t(1143)+c[t(1521)]]&&(p[t(1266)][t(1823)][t(1143)+c.id]={publishBegin:p[t(1266)].userActionData["publish-"+c[t(1521)]][t(1027)],publishEnd:Date.now()},delete p[t(1266)][t(1823)][t(1143)+c[t(1521)]]),c[t(963)]=!1,p[t(1433)](p[t(1537)][t(661)],{action:p[t(661)][t(889)],streamInfo:c});else{let e=p[t(1656)](o);if(!c.pc)return void p.subscribeRecover(c,"onIceStateChange ext:"+e+t(1286)+c[t(854)]);c.retry=0,a[t(1167)](a[t(629)][t(608)],o,e,c.tag),c.weak&&p.wsHandleNetStatChanged({content:{streamID:o,weak:!0}}),p[t(1266)][t(1560)]&&(c[t(1265)]=c.localMuteAudio,p.muteRemoteStream(o,{muteAudio:!0})),c[t(280)]=!1,p.core.userActionData["subscribe-"+e][t(1045)]=Date[t(931)](),p[t(1433)](p.LogType[t(661)],{action:p[t(661)][t(1684)],streamInfo:c}),p[t(1433)](p[t(1537)][t(661)],{action:p[t(661)].toggleMute,mediaType:p[t(541)][t(418)],streamInfo:c}),p[t(1433)](p[t(1537)][t(661)],{action:p.UserAction.toggleMute,mediaType:c[t(558)]===p[t(1155)].Camera?p[t(541)][t(565)]:p[t(541)][t(1663)],streamInfo:c})}return}if("failed"===e[t(545)][t(558)])return s[t(1023)](t(1511)+c.id+", params:"+JSON[t(1014)](e)),p[t(804)](c),void p.triggerLogUpload(p.LogType[t(811)],{streamInfo:c,errorType:p[t(218)][t(663)],errorCode:c.local?p[t(346)].Rtc[t(1073)]:p[t(346)][t(663)][t(1329)],errorDesc:t(1674)+o+", requestID: "+i});if(e[t(545)][t(558)]===t(605))return s[t(1023)](t(1081)+JSON[t(1014)](e)),p[t(1210)](o),void p[t(1433)](p[t(1537)][t(811)],{streamInfo:c,errorType:p[t(218)].Rtc,errorCode:c.local?p.LogErrorCode[t(663)][t(1073)]:p[t(346)][t(663)][t(1329)],errorDesc:t(348)+o+t(833)+i})}if(r===p[t(918)][t(1790)]&&0!==e[t(545)][t(377)][t(634)]){let r=e.content.result[t(634)],n=e.content[t(377)][t(1812)],a=c[t(558)],u=c[t(826)],d=c.tag,l=d?a+"-"+d:a,f=c[t(705)],m=c.id;return c[t(1227)]?(p[t(1479)](a,m,d,u),s[t(1023)](t(1060),l,r+" "+n),s[t(1055)](t(1402)+c.ready),p[t(749)](p.ErrorCode[t(1099)],{type:a,subType:u,tag:d,publishID:m,desc:t(721)+l+t(327)+r+t(508)+n})):(s[t(1023)](t(990),f,r+" "+n),p[t(1638)](c,t(1066),!0)),c.id="",void p[t(1433)](p.LogType[t(811)],{streamInfo:c,errorType:p[t(218)][t(663)],errorCode:c[t(1227)]?p.LogErrorCode.Rtc[t(1073)]:p[t(346)].Rtc[t(1329)],errorDesc:t(1136)+o+t(833)+i+t(1289)+r+", detail: "+n})}let u=c.pc,d=e[t(545)].sdp,l=c[t(1444)];if(r===p[t(918)][t(1563)]&&e[t(545)][t(558)]===t(1150)&&d){if(!c.pc)return void p[t(1638)](c,t(954)+c[t(705)]+t(1286)+c[t(854)]);p[t(1807)](u,d).then((e=>{const r=t;e&&p.triggerLogUpload(p[r(1537)].Error,{streamInfo:c,errorType:p.LogErrorType[r(663)],errorCode:c.local?p[r(346)][r(663)].Publish:p.LogErrorCode[r(663)][r(1329)],errorDesc:r(1675)+e.toString()+", sdp:"+d})}))}if(l&&l[t(1524)]>0){let e=l[t(1226)]();p[t(1191)](o,t(1444),"a="+e[t(1107)],0,{sdpMLineIndex:e.sdpMLineIndex,sdpMid:e[t(1455)]})}},p.wsHandleStreamAdded=function(e){const t=n;let r=e[t(545)][t(1668)],o=e[t(545)][t(839)];!p.core[t(1721)][r]&&(s.logWarn(t(1702)),p.core.users[r]={uid:r,streams:{}}),p[t(1266)][t(1721)][r][t(524)].push(o[t(705)]),p.core.publishers[o[t(705)]]=Object.assign({uid:r,dType:p[t(1266)][t(1721)][r][t(711)],local:!1,ready:!1,localMuteAudio:!1,localMuteVideo:!1,candidate:[]},o),a[t(1167)](a[t(629)][t(1451)],r,o)},p[n(728)]=function(e={}){const t=n;let r=e[t(545)].userID,o=e[t(545)][t(705)];if(r===p[t(1266)][t(1668)])Object[t(1706)](p.StreamType)[t(1505)]((e=>{const r=t;p.core[e].id===o&&(p[r(1339)](p[r(1266)][e]),p.core[e].id="",p[r(1266)][e][r(1444)]=[],p[r(1266)][e][r(854)]=!1,p[r(1395)](e,"",p.core[e][r(1755)]?p[r(1266)][e][r(1755)].app:"",p.core[e][r(826)]))}));else{if(!p[t(1266)][t(1721)][r]||p[t(1266)][t(1721)][r][t(524)][t(199)](o)<0)return;p.core[t(1031)][o]&&p[t(1266)].publishers[o].id&&p[t(1639)](p[t(1266)][t(1031)][o].id),p[t(1410)](p[t(1266)][t(1031)][o],!0),a[t(1167)](a.Event[t(973)],r,o)}},p[n(250)]=function(e="",t=!1,r=!1){const o=n;p.wsSender({name:"update",type:o(522),stamp:Date[o(931)](),session:p[o(1266)].session,requestID:h(),content:{userID:p[o(1266)][o(1668)],streamID:e,muteVideo:t,muteAudio:r}})},p[n(544)]=function(e){},p.wsUpdateLayer=function(e="",t=0){const r=n;p[r(344)]({name:r(866),type:r(522),stamp:Date[r(931)](),session:p[r(1266)].session,requestID:h(),content:{userID:p[r(1266)][r(1668)],streamID:e,layerIndex:t}})},p[n(964)]=function(e={}){},p[n(1677)]=function(e={}){const t=n;let r=e[t(545)][t(807)];if(p[t(1266)][t(1054)].id===r)p[t(1266)].camera[t(813)]=e.content.layerIndex,p[t(1501)](p.core[t(1054)],p[t(1199)][t(992)],e.content[t(813)]),p.routineCheckStreamFirstUpload(p[t(1266)][t(1054)]);else if(p[t(1266)].screen.id===r)p.core[t(575)][t(813)]=e.content[t(813)],p.routineCheckStreamFirstUpload(p[t(1266)][t(575)]);else if(p[t(1266)][t(1580)].id===r)p[t(1266)][t(1580)][t(813)]=e[t(545)][t(813)],p[t(1284)](p[t(1266)][t(1580)]);else{let o=Object[t(1706)](p[t(1266)][t(752)])[t(1431)]((e=>e.id===r));if(!o)return;o[t(813)]=e[t(545)][t(813)],o[t(558)]===p.StreamType[t(551)]&&p[t(1501)](o,p[t(1199)].cameraExLayers,e[t(545)][t(813)]),p[t(1284)](o)}},p[n(643)]=function(e={}){const t=n;let{userID:r,name:o}=e.content;p[t(1768)](r,{name:o}),a.emit(a.Event[t(318)],{uid:r,name:o})},p.wsHandleStreamUpdated=function(e){const t=n;let r=e.content[t(705)],o=e[t(545)][t(389)],i=e[t(545)][t(1822)];p[t(1266)][t(1031)][r]?(p[t(1266)][t(1031)][r][t(1822)]!==i&&(p[t(1266)][t(1031)][r][t(1822)]=i,s.logInfo(t(512)+p[t(1266)].publishers[r][t(376)]+", streamId:"+r+t(709)+i),a[t(1167)](a.Event[t(1828)],p.core[t(1031)][r].uid,r,p[t(499)][t(418)],i)),p[t(1266)].publishers[r].muteVideo!==o&&(p[t(1266)][t(1031)][r][t(389)]=o,s[t(1055)](t(512)+p[t(1266)].publishers[r][t(376)]+t(913)+r+t(1259)+o),a[t(1167)](a.Event.streamUpdated,p.core[t(1031)][r].uid,r,p[t(499)].Video,o))):s[t(1023)](t(1142)+r+t(1372)+JSON[t(1014)](e))},p[n(1711)]=function(e){const t=n;p[t(344)]({name:t(1814),type:t(522),stamp:Date.now(),session:p[t(1266)][t(1528)],requestID:h(),content:{name:e}}),p[t(1100)]({userName:e})},p[n(915)]=function(e){const t=n;let r=e.content[t(377)];r&&0===r[t(634)]?s.logInfo(t(1718)+e[t(545)][t(1645)]):s[t(1023)](t(535),r[t(1812)])},p[n(766)]=function(e){const t=n;p[t(344)]({name:t(1331),type:t(522),stamp:Date[t(931)](),session:p[t(1266)][t(1528)],requestID:h(),content:{streams:e}})},p[n(971)]=function(e){const t=n;let r=e[t(545)][t(377)];(!r||0!==r[t(634)])&&s[t(1023)]("update info error",r.detail)},p.wsHandleInfoUpdated=function(e){const t=n;if(e[t(545)][t(524)]&&e[t(545)][t(524)][t(1524)]>0){let r=JSON.parse(JSON.stringify(e[t(545)][t(524)]));a.emit(a[t(629)].infoUpdated,r)}},p.wsMessage=function(e="",t=null){const r=n;p[r(344)]({name:r(1449),type:"request",stamp:Date.now(),session:p[r(1266)].session,requestID:h(),content:{userID:p[r(1266)].userID,userList:t,msgType:r(t?1626:1719),dataType:r(645),data:e}})},p[n(1017)]=function(e={}){const t=n;if(e[t(558)]===t(1057)){let r=e[t(545)][t(1668)],o=e[t(545)][t(1773)];a.emit(a[t(629)].message,r,o)}},p[n(1422)]=function(e,t,r,o,i,s,a,c,u,d){const l=n;let f={name:l(186),type:l(522),stamp:Date[l(931)](),session:p.core.session,requestID:h(),content:{cmd:t,task:e}};r&&(f[l(545)].type=r),o&&(f.content.layout=o),i&&(f.content[l(1721)]=i),s&&(f[l(545)][l(775)]=s),a&&(f[l(545)][l(457)]=a),(c||u||d)&&(f[l(545)][l(1632)]=c||!1,f[l(545)][l(255)]=u||!1,f[l(545)][l(1829)]=d||!1),p[l(344)](f)},p.wsHandleMixer=function(e){const t=n;if(e.type===t(1057))return p[t(1791)](e);let r=e.content[t(377)]&&0===e.content[t(377)][t(634)],o=e.content[t(776)]||"",i=e.content[t(1124)]||"";return r?o?a[t(1167)](a[t(629)][t(979)],p[t(1266)][t(1668)],o,i):void 0:p[t(749)](p[t(1215)][t(593)],{taskID:o,cmd:i})},p[n(1791)]=function(e){const t=n;let r=e[t(545)];if(!r)return;let o=r[t(376)],i=r.task,s=r[t(1124)],c=r[t(775)],u=r.users,d=r[t(1307)],l=r.callback,f=r[t(1632)],m=r[t(255)],b=r.autoLayout;i&&(s===p[t(1152)][t(1098)]?a.emit(a[t(629)][t(979)],o,i,s,u,d,c,l,f,m,b):s===p[t(1152)].Update?a[t(1167)](a[t(629)][t(979)],o,i,s,u,d):a[t(1167)](a[t(629)].mixerTask,o,i,s))},p[n(473)]=function(e,t,r,o,i,s,a,c,u,d){const l=n;let f={name:l(543),type:l(522),stamp:Date[l(931)](),session:p.core[l(1528)],requestID:h(),content:{task:e,cmd:t}};r&&(f[l(545)][l(558)]=r,f[l(545)].bps=o,f.content[l(745)]=i,f[l(545)][l(723)]=s,f[l(545)][l(1669)]=a,f.content[l(557)]=c,f[l(545)].streamServer=u,f[l(545)][l(457)]=d),p[l(344)](f)},p[n(436)]=function(e){const t=n;if(e[t(558)]===t(1057))return p[t(412)](e);let r=e[t(545)][t(377)]&&0===e[t(545)][t(377)][t(634)],o=e[t(545)][t(776)]||"",i=e.content.cmd||"";return r?o?a[t(1167)](a[t(629)][t(1113)],p[t(1266)][t(1668)],o,i):void 0:(s[t(485)](t(736)+JSON[t(1014)](e)),p[t(749)](p[t(1215)][t(1044)],{taskID:o,cmd:i}))},p[n(412)]=function(e){const t=n;let r=e[t(545)].task||"",o=e.content.cmd||"",i=e[t(545)][t(634)],a=e.content[t(1812)];return s[t(485)](t(1577)+JSON[t(1014)](e)),p.emitError(p[t(1215)][t(1044)],{taskID:r,cmd:o,code:i,desc:a})},p[n(1699)]=function(){const e=n;let t={name:"updateRoom",type:e(522),stamp:Date[e(931)](),session:p[e(1266)][e(1528)],requestID:h(),content:{quality:p.options.hdQualityPriority?1:2}};p.wsSender(t)},p[n(338)]=function(e){const t=n;!(e[t(545)]&&e[t(545)][t(377)]&&0===e[t(545)][t(377)][t(634)])&&(p[t(1199)].hdQualityPriority=!p[t(1199)].hdQualityPriority),a.emit(a[t(629)].videoOption,{hdQualityPriority:p[t(1199)][t(882)]})},p[n(505)]=function(e){const t=n;if(e[t(545)]&&e.content.quality){const r=e.content[t(741)];p[t(1266)][t(820)]!==r&&(p.core[t(820)]=e.content[t(741)],p[t(1266)][t(1054)].pc&&p.setSimulcastLayerEncoding(p[t(1266)][t(1054)],p[t(1199)].cameraLayers,p[t(1266)][t(1054)][t(813)]||0),Object.values(p.core[t(752)])[t(1505)]((e=>{const r=t;e.pc&&p.setSimulcastLayerEncoding(e,p[r(1199)][r(1640)],e[r(813)]||0)})))}},p[n(1092)]=function(e,t,r){const o=n;s[o(1055)]("ws send updateNetstat, userID:"+e+"-streamID-"+t+o(799)+r);const i={name:"updateNetStat",type:o(522),stamp:Date[o(931)](),session:p[o(1266)][o(1528)],requestID:h(),content:{userID:e,streamID:t,weak:r}};p[o(344)](i)},p[n(1249)]=function(){},p[n(624)]=function(e){const t=n,{streamID:r,weak:o}=e.content,i=p[t(1452)](r);if(s.logInfo(t(1816)+e[t(558)]+t(1372)+JSON[t(1014)](e)),i&&!i[t(389)]){i[t(558)]!==p[t(1155)][t(1663)]&&(i.netWeakMuteVideo=o),i[t(1371)]=o;let e=p[t(1266)][t(1184)][t(838)][r];!e&&(e={id:r,level:1e-9},p[t(1266)][t(1184)].netWeakStats[r]=e),e[t(188)]=!0,p[t(1242)]()}},p[n(904)]=function(e){const t=n,{by:r,uid:o,ip:i,code:c,detail:u}=e.content;s[t(1055)](t(296)+JSON[t(1014)](e[t(545)])),p[t(344)]({name:t(1237),type:t(415),stamp:Date[t(931)](),session:p.core[t(1528)],requestID:h()}),p[t(185)](),a[t(1167)](a.Event[t(1237)],r,o,c,u)},p[n(707)]=function(e){const t=n;p[t(344)]({name:t(1165),type:"request",stamp:Date.now(),session:p.core[t(1528)],requestID:h(),content:{role:e}})},p[n(451)]=function(e){},p[n(589)]=async function(e="",t={},r=[]){const o=n;let i={iceServers:[{urls:[p.core[o(1763)]]}],iceTransportPolicy:o(1745),iceCandidatePoolSize:0};p[o(1266)][o(566)]&&i[o(909)][o(801)]({urls:[p[o(1266)][o(566)]],username:p.core[o(1771)],credential:p[o(1266)][o(1075)]}),t.pc=new RTCPeerConnection(i),t.pc[o(1212)]=e=>p.onIceCandidate(t,e),t.pc[o(1504)]=e=>p[o(1717)](t,e),t.pc[o(1217)]=e=>p[o(458)](t,e),e===p[o(1550)][o(1229)]?t[o(558)]!==p[o(1155)].Camera||t.tag?t[o(839)]&&(t.subType===p[o(831)][o(550)]&&!t[o(1148)]&&t.pc[o(974)](o(341),{direction:o(187),streams:[t[o(839)]]}),t[o(839)][o(1691)]().forEach((e=>{const r=o;t.pc[r(590)](e,t.stream)}))):(t[o(1148)]&&t.pc[o(590)](t[o(1148)],t[o(839)]),t[o(514)]&&t.pc[o(590)](t[o(514)],t[o(839)]),p.setSenderCodecPreferences(t.pc)):t.pc.ontrack=async function(e){const r=o;if(e.track&&(t[r(839)]=e[r(524)][0],e[r(198)][r(1687)]===p[r(499)][r(565)]&&t[r(1363)]&&(p.setVideoElementStream(t[r(465)],t.stream),p[r(1758)](t.videoElem,!0)),e[r(198)][r(1687)]===p[r(499)].Audio&&t[r(341)])){if(t[r(839)]=e[r(524)][0],!t[r(1651)]("audioElem")){let e=document[r(214)]("audio");e.id=t[r(705)]+r(174),t[r(1746)]=e}p[r(1512)](t[r(1746)],new MediaStream([e.track])),p[r(658)](t.audioElem,!1,p.options[r(1021)]),p[r(1758)](t[r(1746)],!1)}};try{let n={};if(e===p[o(1550)][o(1229)])n=await t.pc[o(1154)](),n[o(1107)]=p[o(968)](n[o(1107)],r),n[o(1107)]=p.sdpAddSimulcast(n[o(1107)],r);else{if(t.pc.addTransceiver&&p[o(1199)][o(1520)])t.pc.addTransceiver(o(341),{direction:o(1049)}),t.pc[o(974)]("video",{direction:o(1049)}),t.pc[o(974)](o(1363),{direction:"recvonly"}),p[o(815)](t.pc),n=await t.pc[o(1154)](),n.sdp=p[o(581)](n[o(1107)]);else{let e={offerToReceiveAudio:t[o(341)],offerToReceiveVideo:t[o(1363)]};p[o(815)](t.pc),n=await t.pc[o(1154)](e)}s.logInfo(o(1327)+JSON.stringify(n))}return await t.pc[o(824)](n),e===p.StreamRole.Publisher&&(p[o(936)](t.pc,r),r&&1==r[o(1524)]&&p[o(1160)](t.pc,r[0])),n.sdp}catch(e){return s.logError(o(1509)+e),p[o(1433)](p.LogType[o(811)],{streamInfo:t,errorType:p[o(218)].Rtc,errorCode:t[o(1227)]?p[o(346)].Rtc.Publish:p[o(346)][o(663)].Subscribe,errorDesc:"create session description error: "+e+o(1621)+(t.id||t.subscribeID)}),null}},p.closeRtcPeerConn=function(e){const t=n,r=e.pc;try{r&&r.signalingState!==t(1700)&&(r[t(1212)]=null,r.oniceconnectionstatechange=null,r[t(1217)]=null,r[t(1070)]()),e.pc=null}catch(e){s[t(485)](t(1841)+e)}},p.restartRtcPeerConn=function(e){const t=n;if(e.pc){let r=e.id||e[t(705)];if(s.logInfo(r,t(1320)),e.pc[t(583)]instanceof Function)try{e.pc.restartIce(),s[t(1055)](r,t(1518)),e[t(1444)]=[],p[t(617)](e)}catch(e){s[t(1023)]("restart ice error,",e[t(339)]())}else e.id&&p[t(1639)](e.id,(()=>{const r=t;p[r(929)](e[r(1668)],e.publishID)}))}},p.answerRtcPeerConn=async function(e,t){const r=n;try{t=p[r(562)](e,t);let o=new RTCSessionDescription({sdp:t,type:r(1150)});await e.setRemoteDescription(o)}catch(e){return s[r(485)](r(1675)+e+r(1417)+t),e}},p[n(1488)]=function(e=null){const t=n;e&&e[t(1415)]()[t(1505)]((e=>{const r=t;if("setCodecPreferences"in e&&e[r(1388)]&&e[r(1388)].track){let t=e.sender[r(198)].kind;let o=RTCRtpSender.getCapabilities(t).codecs.filter((e=>{const t=r;let o=e[t(818)][t(1399)](),n=e[t(1764)];return o===t(774)&&n&&n.indexOf("42e01f")>=0&&n[t(199)](t(568))>=0||o===t(1732)||o===t(572)}));if(o&&o[r(1524)]>0)try{e[r(920)](o)}catch(e){s[r(1023)](r(222),e[r(339)]())}}}))},p[n(815)]=function(e=null){const t=n;e&&e[t(1415)]().forEach((e=>{const r=t;if("setCodecPreferences"in e&&e[r(907)]&&e[r(907)][r(198)]){let t=e[r(907)][r(198)][r(1687)];let o=RTCRtpSender.getCapabilities(t)[r(1224)][r(660)]((e=>{const t=r;let o=e.mimeType.toLowerCase();return"video/h264"===o||o===t(572)||o===t(788)}));o&&o[r(1524)]>0&&e.setCodecPreferences(o)}}))},p.sdpNormalizer=function(e,t){const r=n;let o=!0;e&&e.localDescription&&e[r(975)][r(558)]===r(768)&&(o=e[r(975)][r(1107)][r(199)](r(498)){const o=r;e=e.replace(t,t+o(407)+n+";")})),e):(s[r(1023)](r(272)),o)}catch(e){return s[r(1023)]("add bitrate control error,",e[r(339)]()),o}},p[n(317)]=function(e="",t=[]){const r=n;let o=t[r(1524)];if(o<=1)return e;if(null!==e[r(1751)](new RegExp("a=ssrc-group:SIM","g")))return e;let i=e.match(/a=ssrc-group:FID ([0-9]*) ([0-9]*)\r?\n/);if(!i||i.length<=0)return e;let a=e;try{const t=parseInt(i[1],10),n=parseInt(i[2],10),s=e[r(1751)](new RegExp(r(1359)+i[1]+r(859)))[1],a=e.match(new RegExp(r(1359)+i[1]+r(193)))[1],c=e[r(1751)](new RegExp(r(1359)+i[1]+" mslabel:(.*)\r?\n")),u=c&&c[1]?c[1]:"",d=e[r(1751)](new RegExp("a=ssrc:"+i[1]+r(1001))),l=d&&d[1]?d[1]:"";e[r(1751)](new RegExp(r(1359)+i[1]+r(1631),"g"))[r(1505)]((t=>{e=e[r(1260)](t,"")})),e.match(new RegExp(r(1359)+i[2]+r(1631),"g"))[r(1505)]((t=>{e=e[r(1260)](t,"")}));const f=[t],m=[n];for(let e=1;e{t+=" "+e})),t+"\r\n"},p.sdpAddGroup=function(e,t){return"a=ssrc-group:FID "+e+" "+t+"\r\n"},p[n(856)]=function(e,t,r,o,i,s){const a=n;return a(1359)+i+a(784)+e+"\r\na=ssrc:"+i+a(938)+t+"\r\n"+(r?a(1359)+i+a(609)+r+"\r\n":"")+(o?a(1359)+i+a(1319)+o+"\r\n":"")+(a(1359)+s)+" cname:"+e+"\r\n"+(a(1359)+s+a(938)+t)+"\r\n"+(r?a(1359)+s+a(609)+r+"\r\n":"")+(o?a(1359)+s+a(1319)+o+"\r\n":"")},p.setSimulcastLayerConfig=function(e,t=[]){const r=n;if(!e||!t||t[r(1524)]<=1)return;let o=[];for(let e=0;e{const t=r;e[t(198)]&&e[t(198)].kind===t(1363)&&p[t(947)](e,o)}))},p[n(1160)]=function(e,t){const r=n;e.getSenders()[r(1505)]((e=>{const o=r;if(e[o(198)]&&e[o(198)][o(1687)]===o(1363)){const r=e[o(1440)]();let n=t[o(716)]||15e5,i=t.frameRate||15;r[o(335)][0][o(812)]=n,r[o(335)][0].maxFramerate=i,e[o(730)](r)[o(515)]()[o(432)]((e=>{s[o(485)]("set one layer bitrate error, "+e)}))}}))},p[n(947)]=function(e,t=[]){const r=n;if(!(e[r(1440)]instanceof Function&&e[r(730)]instanceof Function))return void s.logError(r(1495));if(!t||t.length<=1)return;const o=e[r(1440)]();for(let e=0;e{const t=r;s[t(485)](t(1245)+e)}))},p.setSimulcastLayerEncoding=function(e,t=[],r=-1){const o=n,i=e.pc;if(!i)return;if(!t||t.length<=1)return;let a=i.getSenders();if(0===a[o(1524)])return;const c=1===p[o(1266)][o(820)];let u=0,d=r;if(c&&(u=t.findIndex((e=>e.width*e.height>=230400)),-1===u?(u=t[o(1524)]-1,d=u):u>r&&(d=u)),-1===r){const t=p[o(1266)][o(1184)][o(838)][e.id];t&&t.isWeak&&(t[o(188)]=!0,t.isWeak=!1,p.emitNetWeakReport()),u=r,d=r}e[o(813)]=d;for(let e=0;ei&&(d=i),t[o(1505)]((e=>{const t=o;n[t(335)][e[t(813)]]&&(n.encodings[e[t(813)]].active=e.layerIndex>=u&&e[t(813)]<=d)})),r[o(730)](n).then()[o(432)]((e=>{const t=o;s[t(485)](t(1617)+e)}));break}},p.onIceCandidate=async function(e,t){const r=n;try{if(t[r(1444)]){let o={sdpMid:"0"===t[r(1444)].sdpMid?r(341):"video",sdpMLineIndex:t[r(1444)].sdpMLineIndex,sdp:t[r(1444)][r(1444)]};e[r(1444)][r(801)](o)}}catch(t){s[r(485)]("stream "+e.id+r(1854)+t)}},p[n(1717)]=function(e){const t=n;let r=e.pc;if(r)if(typeof e[t(890)]===t(297)&&(e[t(890)]=0),r[t(1466)]===t(257)||"disconnected"===r[t(1466)]||r[t(1466)]===t(1700)){let o=e[t(705)]||e.id;if(s.logWarn(o,t(1282),r[t(1466)]),e.ready&&e[t(890)],p.ws&&p.ws.readyState===WebSocket[t(215)]){if(s[t(1055)]("streamInfo.ready:"+e[t(854)]),e[t(1227)]){const r={...e};p[t(1410)](e),p[t(749)](p.ErrorCode[t(1099)],{type:r.type,subType:r[t(826)],tag:r[t(1838)],publishID:r.id,desc:"onIceStateChange ext:"+(r[t(1838)]?r.tag:r[t(558)])+t(1286)+r[t(854)]}),e[t(890)]=0}else e.ready?p[t(1638)](e,t(954)+e[t(705)]+", ready:"+e.ready):p[t(1339)](e);r.iceConnectionState===t(257)&&p[t(1433)](p[t(1537)].Error,{streamInfo:e,errorType:p[t(218)][t(663)],errorCode:e[t(1227)]?p[t(346)][t(663)][t(869)]:p[t(346)][t(663)][t(924)],errorDesc:t(1543)})}}else r[t(1466)]===t(614)&&(e[t(890)]=0)},p[n(458)]=function(e){const t=n,r=e.pc;if(r&&"failed"===r.connectionState){const o=e.publishID||e.id;if(s.logWarn(o,"rtc connection change to",r[t(1851)]),p.ws&&p.ws.readyState===WebSocket.OPEN){if(s[t(1055)](t(1402)+e[t(854)]),e.local){const r={...e};p[t(1410)](e),p[t(749)](p[t(1215)][t(1099)],{type:r[t(558)],subType:r[t(826)],tag:r[t(1838)],publishID:r.id,desc:t(961)+r[t(558)]+t(1286)+r[t(854)]}),e[t(890)]=0}else p[t(1638)](e,t(961)+e.publishID+t(1286)+e.ready);p[t(1433)](p[t(1537)][t(811)],{streamInfo:e,errorType:p[t(218)][t(663)],errorCode:e[t(1227)]?p[t(346)][t(663)].PublishIce:p[t(346)][t(663)][t(924)],errorDesc:t(597)})}}},p.onIceNegotiationNeeded=function(e){const t=n;let r=!0,o=e[t(705)],i=e.id;if(!e[t(1227)]&&!p[t(1266)][t(1031)].hasOwnProperty(o)&&(r=!1),r){let r=[],o="";e.pc[t(1154)]({offerToReceiveAudio:1,offerToReceiveVideo:1})[t(515)]((n=>{const i=t;if(e[i(1227)]){let t=e[i(558)],o=e[i(1838)];r=o?p[i(1199)][i(1640)]:p[i(1199)][t+i(519)],n.sdp=p[i(317)](n[i(1107)],r)}return o=n[i(1107)],s[i(1055)]("offer:"+JSON[i(1014)](n)),e.pc[i(824)](n)})).then((()=>{const n=t;e[n(1227)]&&(p[n(936)](e.pc,r),p.setSimulcastLayerEncoding(e,r,e[n(813)]||0)),p.wsNegotiate(i,n(1182),o)}))[t(432)]((e=>{const r=t;s[r(1023)](r(1095),e[r(339)]())}))}},p.failCheck=function(e){const t=n;e[t(246)]=setInterval((()=>{const r=t;if(e.pc)if(e.pc[r(1851)]===r(257)){if(clearInterval(e[r(246)]),p.ws&&p.ws[r(1168)]===WebSocket.OPEN){const t={...e};p.resetStreamData(e),t.local?p.emitError(p[r(1215)].PublishError,{type:t[r(558)],subType:t[r(826)],tag:t[r(1838)],publishID:t.id,desc:r(1464)+t[r(558)]+", ready:"+t[r(854)]}):p[r(749)](p[r(1215)].SubscribeError,{publishID:t[r(705)],subscribeID:t.id,desc:r(1464)+t.publishID+r(1286)+t[r(854)]}),e[r(890)]=0}}else-1!==[r(1624),"completed","closed"][r(199)](e.pc[r(1466)])&&clearInterval(e.failCheck);else clearInterval(e[r(246)])}),2e3)},p.onDeviceChangeCallback=void 0,p[n(735)]=function(){const e=n;console[e(605)](e(735)),!p[e(1138)]&&(p[e(1138)]=setTimeout((()=>{const t=e;a[t(1167)](a[t(629)][t(1313)]),p.onDeviceChangeCallback=void 0}),500))},p[n(479)]=async function(t,r){const o=n,i=[];return r[o(1505)]((r=>{const n=o;i[n(801)]((()=>new Promise((o=>{const i=n;if(t==p[i(499)][i(565)]){const t=p.core.devices.detail.videoinput[i(1431)]((e=>e.id===r.id));if(t&&t[i(1460)])r[i(1460)]=t.capabilities,o();else{const t={video:{deviceId:{exact:r.id}}};navigator[i(796)][i(835)](t)[i(515)]((t=>{t.getTracks().forEach((t=>{const o=e;t[o(1687)]===p.StreamTrack[o(565)]&&(r[o(1460)]=t[o(1787)]()),t.stop&&t[o(1508)]()})),o()}))[i(432)]((()=>{o()}))}}}))))})),((t,r=10,o)=>new Promise(((n,i)=>{const s=e,a=[...t],c=a[s(1524)]{const e=s;if(o){const r=((t.length-(p+a[e(1524)]))/t[e(1524)]).toFixed(2);o({loaded:r})}},b=(e,t)=>{const r=s;e()[r(515)]((e=>{const o=r;l||(d[t]=e,a[o(1524)]>0?(b(a[o(1226)](),++f),m()):(p--,m(),0===p&&n(d)))}))[r(432)]((e=>{l||(l=!0,i({index:t,error:e}))}))};u[s(1505)](((e,t)=>{f=t,b(e,t)}))})))(i,x.android?1:10)},p[n(1420)]=function(e){const t=n;let r=null;for(let o=0;o=r.capabilities.iso.max)&&(r=e[o])}r&&(p[t(1266)][t(1533)][t(1166)]=r)},p.resetDefaultDevice=function(e={}){const t=n;let r=0,o=!1,i=!1;if(p.core[t(1533)].audioinput&&(r++,o=!0),p[t(1266)].devices[t(673)]&&(r++,i=!0),1===r){if(o&&void 0===e[t(467)].find((e=>e.id===p.core[t(1533)][t(467)])))return p[t(439)](p[t(925)][t(284)],"");if(i&&void 0===e[t(673)][t(1431)]((e=>e.id===p[t(1266)].devices[t(673)])))return p[t(439)](p[t(925)][t(496)],"")}else if(2===r){let r=void 0===e.audioinput[t(1431)]((e=>e.id===p[t(1266)][t(1533)].audioinput)),o=void 0===e.videoinput[t(1431)]((e=>e.id===p.core[t(1533)].videoinput));if(r&&o)return p[t(1266)][t(1533)].audioinput="",p.setDevicePreference(p.DeviceType[t(496)],"");if(r)return p[t(439)](p[t(925)][t(284)],"");if(o)return p[t(439)](p.DeviceType.VideoInput,"")}},p[n(373)]=async function(e,t){const r=n;let o=p.core[r(1533)][r(1812)],i=o[r(467)].filter((t=>{const o=r;return void 0===e[o(467)][o(1431)]((e=>e.id===t.id))})),s=o[r(673)][r(660)]((t=>{const o=r;return void 0===e[o(673)][o(1431)]((e=>e.id===t.id))}));if(i[r(1524)]>0){let t=o[r(673)][r(660)]((e=>{const t=r;return e[t(626)]&&void 0!==i[t(1431)]((r=>r[t(626)]===e[t(626)]))}));e[r(673)]=e[r(673)][r(660)]((e=>{const o=r;return void 0===t[o(1431)]((t=>t[o(1645)]===e.name))}))}if(s.length>0){let t=o[r(467)][r(660)]((e=>e.group&&void 0!==s.find((t=>t.group===e.group))));e[r(467)]=e[r(467)][r(660)]((e=>void 0===t[r(1431)]((t=>t.name===e.name))))}t&&(await p.checkDeviceList(p[r(499)].Video,e[r(673)]),p[r(1420)](e[r(673)])),p[r(386)](e),p.core[r(1533)][r(1812)]=e,a[r(1167)](a[r(629)].deviceList,e)},p[n(1301)]=async function(e){const t=n,r=Object[t(1706)](p[t(925)]),o={},i={};r[t(1505)]((e=>{i[e]=[],o[e]={}})),navigator[t(796)][t(1713)]!==p.onDeviceChange&&(navigator[t(796)][t(1713)]=p[t(735)]);let a=[];try{a=await navigator[t(796)][t(333)]()}catch(e){return s[t(485)]("get device list error, "+e)}a[t(1505)]((function(e){const r=t;if(e[r(487)]&&i[e.kind])if(e[r(487)]===r(594))o[e[r(1687)]]={id:e.deviceId,name:e[r(631)]||e.kind+":"+e[r(487)].substr(0,8),group:e[r(756)],selected:!1};else if(e.deviceId!==r(1052)){const t={id:e[r(487)],name:e.label||e[r(1687)]+":"+e[r(487)][r(713)](0,8),group:e.groupId};""!==o[e[r(1687)]][r(626)]&&e[r(756)]===o[e.kind][r(626)]?(o[e[r(1687)]][r(983)]=!0,i[e[r(1687)]][r(1570)](t)):i[e[r(1687)]][r(801)](t)}})),r.forEach((e=>{const r=t;!o[e][r(983)]&&o[e].id&&(delete o[e][r(983)],i[e][r(1570)](o[e]))})),await p[t(373)](i,e)},p.getDeviceInfo=function(t){return new Promise(((r,o)=>{const n=e,i=p[n(1266)].devices[n(1812)][n(467)],s=p.core.devices[n(1812)][n(1557)],a=p[n(1266)][n(1533)][n(1812)][n(673)];let c=null;if(c=a[n(1431)]((e=>e.id===t)),c)if(c[n(1460)])r(JSON.parse(JSON[n(1014)](c)));else{const e={video:{deviceId:{exact:c.id}}};navigator[n(796)].getUserMedia(e)[n(515)]((e=>{const t=n;e[t(1691)]().forEach((e=>{const r=t;e[r(1687)]===p.StreamTrack[r(565)]&&(c[r(1460)]=e.getCapabilities()),p[r(264)](e)})),r(JSON[t(1506)](JSON[t(1014)](c)))}))[n(432)]((()=>{const e=n;r(JSON.parse(JSON[e(1014)](c)))}))}else c=i.find((e=>e.id===t)),c?r(JSON[n(1506)](JSON[n(1014)](c))):(c=s.find((e=>e.id===t)),c?r(JSON.parse(JSON.stringify(c))):o("can not find device"))}))},p[n(439)]=function(e="",t=""){const r=n;if(p[r(1266)].devices[r(1651)](e)&&p.core.devices[e]!==t)if(e===p[r(925)].VideoInput&&(p[r(1266)].devices[r(668)+e]=p[r(1266)].devices[e]),p[r(1266)][r(1533)][e]=t,e===p[r(925)][r(1744)])Object[r(1706)](p[r(1266)][r(1031)]).forEach((e=>{const o=r;e[o(1746)]&&p[o(1820)](e[o(1746)],t)}));else if(p[r(1266)][r(1054)][r(731)]){let t=e===p[r(925)][r(284)],o=!t;p[r(1774)](null,!0,t,o)}},p[n(949)]=function(e,t){const r=n;let o=null;if(e===p.StreamType.Camera)o=p[r(1266)][r(1054)],p[r(1199)][r(992)]=[t];else{if(!p.core[r(752)][e])return void s[r(1023)](r(1759));o=p[r(1266)].cameraEx[e],p[r(1199)][r(1640)]=[t]}o[r(1056)]=[t],o.pc&&o[r(514)]&&(o[r(514)][r(395)]({width:{ideal:t.width},height:{ideal:t[r(1669)]}})[r(515)]((()=>{const e=r;s[e(1055)](e(1256))}))[r(432)]((e=>{const t=r;s[t(485)](t(380),e)})),p[r(1160)](o.pc,t))},p[n(623)]=function(e,t){const r=n;if(!(e&&e instanceof HTMLElement))return!1;try{return e[r(1250)]=t,e.controls=!1,e.muted=!0,e.onplay=()=>{const t=r;e.onplay=null,s.logInfo(e.id+t(1601))},!0}catch(e){return s[r(485)](r(687)+e),!1}},p[n(1512)]=function(e,t){const r=n;if(e&&e instanceof HTMLElement)try{e.srcObject=t,e[r(495)]=!1,e.onplay=()=>{const t=r;e[t(898)]=null,s[t(1055)](e.id+t(1601))}}catch(e){s[r(485)](r(863)+e)}},p[n(1820)]=function(e,t){const r=n;e&&t&&(e instanceof HTMLElement&&typeof e[r(942)]!==r(297)?e[r(307)](t)[r(515)]().catch((e=>{const o=r;let n=e;e?(n=e[o(1645)]===o(780)?"you need to use HTTPS for selecting audio output device: "+e:e[o(1449)],s.logError(n)):(s[o(485)](e),n=o(1850)),p[o(749)](p[o(1215)].SetDeviceError,{deviceType:p[o(925)].AudioOutput,deviceID:t,desc:n})})):(s[r(485)](r(1332)),p[r(749)](p[r(1215)][r(391)],{deviceType:p[r(925)][r(1744)],deviceID:t,desc:"browser does not support output device selection"})))},p.getPubIdBySubId=function(e=""){const t=n;if(!e)return e;let r=e.split("-");return r.splice(0,r[t(1524)]-1)[t(656)]("-")},p.getStreamInfo=function(e=""){const t=n;if(e===p[t(1266)][t(1054)].id)return p[t(1266)][t(1054)];if(e===p[t(1266)][t(575)].id)return p[t(1266)][t(575)];if(e===p[t(1266)][t(1580)].id)return p.core[t(1580)];if(p[t(1266)][t(1031)][t(1651)](e))return p.core[t(1031)][e];{let r=p.getPubIdBySubId(e);return p[t(1266)][t(1031)][r]?p[t(1266)].publishers[r]:Object[t(1706)](p[t(1266)].cameraEx).find((t=>t.id===e))||null}},p[n(900)]=function(e="",t=p[n(1550)][n(1323)]){const r=n;if(e){if(t===p[r(1550)].Subscriber){let t=Object.values(p[r(1266)][r(1031)]);for(let o=0,n=t[r(1524)];ot.lastRequestID===e))}},p.getStreamByPubIDorTag=function(e){const t=n;let r=p[t(1266)].publishers[e];return!r&&Object[t(1706)](p.core.publishers)[t(1505)]((o=>{o[t(1838)]===e&&(r=o)})),r},p[n(1679)]=function(e){const t=n,{tag:r,type:o,subType:i,local:s}=e;if(!s)return e[t(1056)];let a=[];return a=r?o===p[t(1155)][t(551)]?p[t(1199)][t(1640)]:p[t(1199)][t(194)]:o===p.StreamType[t(551)]?p[t(1199)][t(992)]:i===p[t(831)][t(550)]?p[t(1199)][t(1312)]:p[t(1199)][t(194)],a},p[n(823)]=function(e){const t=n;s.logInfo(t(1174)),Object[t(1706)](p.StreamType)[t(1505)]((e=>{const r=t;p.core[e].id&&p[r(1266)][e][r(854)]&&(p[r(1410)](p[r(1266)][e]),p.wsPublish(e,"",p[r(1266)][e][r(1755)]?p[r(1266)][e][r(1755)].app:"",p[r(1266)][e][r(826)]))})),e[t(1505)]((e=>{const r=t;p[r(1266)][r(1721)][e[r(1668)]]?(e.streams[r(1505)]((t=>{const o=r;p[o(1266)][o(1721)][e[o(1668)]][o(524)].indexOf(t[o(705)])<0?(p[o(1266)][o(1721)][e[o(1668)]][o(524)][o(801)](t[o(705)]),p[o(1266)][o(1031)][t[o(705)]]=Object.assign({uid:e[o(1668)],dType:e[o(711)],local:!1,ready:!1,localMuteAudio:!1,localMuteVideo:!1,candidate:[]},t)):(p.core[o(1031)][t.publishID][o(389)]!==t[o(389)]&&(p.core[o(1031)][t[o(705)]][o(389)]=t.muteVideo),p[o(1266)][o(1031)][t[o(705)]][o(1822)]!==t.muteAudio&&(p[o(1266)].publishers[t[o(705)]].muteAudio=t.muteAudio),p[o(1266)][o(1031)][t[o(705)]][o(854)]&&(p.resetStreamData(p[o(1266)][o(1031)][t[o(705)]]),p[o(929)](e[o(1668)],t[o(705)])))})),p[r(1266)][r(1721)][e.userID][r(524)][r(1505)]((t=>{const o=r;!e[o(524)][o(1431)]((e=>e.publishID===t))&&p[o(1410)](p[o(1266)][o(1031)][t],!0)}))):(p[r(1266)].users[e[r(1668)]]={uid:e[r(1668)],dType:e[r(711)],streams:[]},e[r(524)][r(1505)]((t=>{const o=r;p[o(1266)][o(1721)][e[o(1668)]].streams[o(801)](t[o(705)]),p.core[o(1031)][t[o(705)]]=Object[o(1772)]({uid:e[o(1668)],dType:e[o(711)],local:!1,ready:!1,localMuteAudio:!1,localMuteVideo:!1,candidate:[]},t)})))}))},p[n(1637)]=function(e){const t=n;s[t(1055)](t(959));let r=[];e.forEach((e=>{const o=t;e[o(1668)]===p[o(1266)][o(1668)]?(Object[o(1706)](p[o(1155)]).forEach((t=>{const r=o;if(p[r(1266)][t].id&&p[r(1266)][t].ready){let o=e[r(524)][r(1431)]((e=>e[r(705)]===p[r(1266)][t].id));o?([r(1624),r(614)][r(199)](p[r(1266)][t].pc[r(1466)])<0?p[r(804)](p.core[t]):(p[r(1266)][t][r(1822)]!==o[r(1822)]||p.core[t][r(389)]!==o[r(389)])&&p.wsUpdate(o[r(705)],p[r(1266)][t][r(389)],p[r(1266)][t][r(1822)]),e[r(524)]=e[r(524)][r(660)]((e=>e.publishID!==p[r(1266)][t].id))):(p[r(1410)](p[r(1266)][t]),p[r(1395)](t,"",p[r(1266)][t][r(1755)]?p[r(1266)][t][r(1755)][r(509)]:"",p.core[t].subType))}})),e.streams[o(1505)]((e=>{const t=o;p[t(1479)](e[t(558)],e[t(705)])})),r=e[o(1205)]||[]):p[o(1266)][o(1721)][e[o(1668)]]?(e.streams[o(1505)]((t=>{const r=o;p[r(1266)][r(1721)][e[r(1668)]][r(524)][r(199)](t[r(705)])<0?(p[r(1266)][r(1721)][e[r(1668)]][r(524)][r(801)](t.publishID),p[r(1266)][r(1031)][t[r(705)]]=Object[r(1772)]({uid:e.userID,dType:e[r(711)],local:!1,ready:!1,localMuteAudio:!1,localMuteVideo:!1,candidate:[]},t)):(p[r(1266)][r(1031)][t[r(705)]][r(389)]!==t[r(389)]&&(p[r(1266)].publishers[t[r(705)]][r(389)]=t[r(389)]),p[r(1266)][r(1031)][t.publishID][r(1822)]!==t[r(1822)]&&(p[r(1266)][r(1031)][t[r(705)]][r(1822)]=t[r(1822)]))})),p.core[o(1721)][e.userID][o(524)].forEach((t=>{const r=o;!e.streams[r(1431)]((e=>e.publishID===t))&&p.resetStreamData(p[r(1266)][r(1031)][t],!0)}))):(p.core.users[e[o(1668)]]={uid:e[o(1668)],dType:e[o(711)],streams:[]},e[o(524)][o(1505)]((t=>{const r=o;p[r(1266)][r(1721)][e[r(1668)]][r(524)].push(t[r(705)]),p[r(1266)].publishers[t[r(705)]]=Object[r(1772)]({uid:e[r(1668)],local:!1,ready:!1,localMuteAudio:!1,localMuteVideo:!1,candidate:[]},t)})))})),r.forEach((e=>{const r=t;p[r(1266)].publishers[e[r(705)]]?p[r(1266)][r(1031)][e[r(705)]].id&&p[r(1266)][r(1031)][e[r(705)]][r(854)]&&p[r(1266)][r(1031)][e.publishID].id===e[r(944)]&&(["connected","completed"][r(199)](p[r(1266)][r(1031)][e[r(705)]].pc[r(1466)])<0?p[r(804)](p[r(1266)][r(1031)][e.publishID]):((e.muteAudio!==p[r(1266)][r(1031)][e[r(705)]].localMuteAudio||e[r(389)]!==p[r(1266)].publishers[e.publishID][r(201)])&&p[r(250)](e[r(944)],p[r(1266)][r(1031)][e[r(705)]][r(201)],p.core[r(1031)][e[r(705)]][r(181)]),e[r(813)]!==p[r(1266)][r(1031)][e[r(705)]][r(813)]&&p[r(1514)](e[r(944)],p.core.publishers[e[r(705)]][r(813)]))):p[r(1639)](e[r(944)])})),Object[t(703)](p[t(1266)][t(1721)])[t(1505)]((r=>{const o=t;!e[o(1431)]((e=>e[o(1668)]===r))&&(p[o(1266)].users[r][o(524)][o(1505)]((e=>{const t=o;p[t(1266)].publishers[e]&&p.core[t(1031)][e].id&&p[t(1410)](p.core[t(1031)][e],!0)})),delete p[o(1266)].users[r])}))},p[n(1859)]=function(e=[],t=!1){const r=n;if(!(e&&e instanceof Array&&0!==e[r(1524)])){if(t)return;e=[]}let o=JSON[r(1506)](JSON[r(1014)](e));return t?p[r(1637)](o):p[r(823)](o)},p[n(1210)]=function(e){const t=n;e&&delete p[t(1266)][t(740)][e];let r=p[t(1452)](e);if(r)if(r.local){s[t(1055)](t(1551)+e+", re-publish");let o=r[t(558)],n=r[t(1838)]||"",i=r[t(1755)]?r[t(1755)][t(509)]:"";p[t(1479)](o,r.id,r[t(1838)],r.subType),p[t(1395)](o,n,i,r[t(826)])}else s.logInfo("reconnect stream "+e+", re-subscribe"),p[t(1639)](r.id,(()=>{const e=t;p[e(929)](r[e(1668)],r.publishID)}));else s[t(485)]("reconnect stream "+e+t(476))},p[n(1660)]=function(e=!1){const t=n;p[t(1410)](p[t(1266)][t(1054)]),p[t(1266)].camera[t(963)]=!1,p[t(1266)][t(1054)][t(389)]=!1,p[t(1266)][t(1054)][t(1822)]=!1,p[t(1410)](p[t(1266)].screen),p[t(1266)][t(575)][t(963)]=!1,p[t(1266)][t(575)][t(389)]=!1,p[t(1266)][t(575)].muteAudio=!1,p[t(1266)].cameraEx={},!e&&(Object[t(1706)](p[t(1266)].publishers)[t(1505)]((e=>p[t(1410)](e))),p[t(1266)][t(1031)]=[],p.historyReport={video:{},audio:{},enableInspire:!1,options:{activeDuration:1800,inactiveDuration:1500}},p.qosHistroyData={},p.core.network[t(874)]={},p[t(1266)][t(1184)][t(855)]={},p[t(1266)][t(1184)][t(838)]={})},p.resetStreamData=function(e,t=!1){const r=n;if(!e)return;clearInterval(p[r(246)]),p[r(1339)](e),t&&(p[r(1266)][r(1721)][e[r(376)]]&&(p[r(1266)][r(1721)][e[r(376)]][r(524)]=p[r(1266)][r(1721)][e[r(376)]][r(524)][r(660)]((t=>t!==e[r(705)]))),p[r(1266)][r(1031)][e[r(705)]]&&delete p.core.publishers[e[r(705)]]),p[r(1391)](e);let o=e[r(1227)]?e[r(1838)]?e[r(558)]+"-"+e[r(1838)]:e[r(558)]:e[r(705)];p[r(622)](o),e.id="",e[r(854)]=!1,e[r(1444)]=[],e[r(1755)]={app:"",rtc:"",act:0},e.retry=0,e.checkedStreamFirstUpload=!1,e[r(1521)]="",e.recoverTimeout&&clearTimeout(e[r(884)]),e[r(1746)]&&(e.audioElem[r(898)]=null,p[r(1818)](e[r(1746)])),e.videoElem&&(e[r(465)][r(898)]=null,p[r(1818)](e[r(465)]))},p.clearnStreamNetData=function(e){const t=n,r=p[t(1266)].network,o=p[t(411)];if(r[t(874)][e.id]&&delete r[t(874)][e.id],r.downlinkStats[e.id]&&delete r[t(855)][e.id],r[t(838)][e.id]){const o=r.netWeakStats[e.id];o&&(o[t(836)]||e[t(1371)])&&(o[t(188)]=!0,o[t(836)]=!1,e[t(1371)]=!1,Promise[t(1725)]().then((()=>{p[t(249)]()}))),delete r.netWeakStats[e.id]}o[t(341)][e.id]&&delete o[t(341)][e.id],o[t(1363)][e.id]&&delete o[t(1363)][e.id],delete p[t(406)][e.id]},p.cleanTimer=function(){const e=n;clearInterval(p.audioReport),clearInterval(p[e(1169)]),clearInterval(p[e(726)]),clearInterval(p[e(922)]),clearInterval(p[e(1643)]),clearInterval(p[e(1266)][e(851)][e(1119)])},p[n(1818)]=function(e){const t=n;for(let r=0;r{const t=e;p[t(627)](p[t(1266)][t(1272)],p[t(1266)][t(1668)],p.core.userName,p[t(1266)][t(478)],p[t(1266)].userRole,!0)}),r)},p.historyReport={video:{},audio:{},enableInspire:!1,options:{activeDuration:1500,inactiveDuration:1500}},p[n(1389)]=function(){const e=n;let t=p[e(1266)][e(851)];t[e(1708)]&&(!l&&t.audioProcessor[e(1541)](p.audioContext[e(677)]),t[e(526)][e(1541)](t[e(1708)]),delete t.audioProcessor,delete t[e(526)]),t[e(839)]=null},p[n(622)]=function(e=""){const t=n;Object[t(703)](p[t(411)][t(341)])[t(1505)]((r=>{const o=t;if(""===e||e===r){let e=p[o(411)][o(341)][r];e&&e.audioProcessor&&(!l&&e[o(1708)][o(1541)](p.audioContext[o(677)]),e.audioSource.disconnect(e.audioProcessor),delete e[o(1708)]),delete p.historyReport.audio[r]}}))};class f extends l{constructor(e,t){const r=n;super(e,"audioLevel"),this.streamID=t,this[r(1703)].onmessage=this[r(814)][r(1356)](this),this[r(184)]=0}[n(814)](e){const t=n;try{e[t(1773)][t(350)]?(p[t(411)][t(341)][this.streamID]?p[t(411)][t(341)][this[t(807)]][t(350)]=e[t(1773)][t(350)]||0:this.streamID===p.core[t(851)][t(558)]&&(p[t(1266)][t(851)][t(350)]=e.data[t(350)]),this[t(184)]=0):0===e[t(1773)][t(350)]&&(this[t(184)]>=5?(p[t(411)][t(341)][this[t(807)]]?p[t(411)].audio[this.streamID][t(350)]=0:this[t(807)]===p[t(1266)][t(851)][t(558)]&&(p.core[t(851)][t(350)]=0),this[t(184)]=0):this[t(184)]++)}catch(e){s[t(1055)](this[t(807)],e[t(339)]())}}}return p[n(1753)]=function(){const t=n,r=[0,1,2,3,4,4,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,9,9,9,9,9,9,9,9,9,9,9],o=(t,r,o)=>{const n=e,i=Date[n(931)]();t[n(350)]>8&&!t.muteAudio&&o?(0===t[n(998)]&&(t.startSpeakTime=i),t[n(282)]=i,t[n(421)]=0):(0===t[n(421)]&&(t[n(421)]=i),i-t[n(421)]>r?(t.isInspired&&(s.logInfo("uninspire stream: "+t[n(705)]+n(1477)+t.type+", local: "+t[n(1227)]),t.isInspired=!1),t[n(998)]=0,t[n(282)]=0,t[n(421)]=0):t[n(998)]>0&&(t[n(282)]=i))},i=e=>{e=e>=100?99:e;return 10*r[Math.floor(33*e/100)]};Object[t(1706)](p[t(1266)][t(1031)])[t(1505)]((e=>{const r=t;if(!e.pc||e.pc.connectionState!==r(1624))return;let n=e[r(705)],a=e[r(558)];!p[r(411)][r(341)][n]&&(p.historyReport[r(341)][n]={audioLevel:0,levelList:[],isInspired:!1,local:!1,muteAudio:e[r(1822)],publishID:n,type:a,startSpeakTime:0,startMuteTime:0,continueSpeakTime:0,startVoiceMax:0,continueVoiceMax:0});const c=p[r(411)].audio[n];if(p[r(1716)]&&e.stream&&e[r(839)][r(1008)]()[r(1524)]>0&&!c[r(1708)]){let t,o=p[r(1716)][r(1462)](e.stream);l?(t=new f(p.audioContext,n),o.connect(t)):(t=p[r(1716)][r(1e3)](4096,1,1),o[r(265)](t),t[r(265)](p[r(1716)][r(677)]),t.addEventListener(r(1198),(e=>{const t=r;let o=e[t(650)][t(852)](0);try{c[t(350)]=Math[t(1221)](100*Math[t(616)][t(962)](Math,o))}catch(e){s.logInfo(n,e[t(339)]())}}))),c[r(526)]=o,c[r(1708)]=t,c[r(839)]=e.stream}e.muteAudio?c[r(350)]=0:p.historyReport[r(1429)]&&(c.audioLevel=i(c[r(350)])),c[r(510)][r(801)](c[r(350)]),c[r(510)][r(1524)]>=20&&(p.options[r(1381)]&&s[r(1055)](r(371)+n+r(653),c[r(510)]),c[r(510)]=[]),p[r(411)].enableInspire&&o(c,p.historyReport[r(1199)].inactiveDuration,!!e.pc)})),[p[t(1266)][t(1054)],p.core[t(575)],p.core[t(1580)]][t(1539)](Object[t(1706)](p[t(1266)][t(752)]))[t(1505)]((e=>{const r=t;if(!e[r(731)])return;let n=e.type,a=e[r(1838)],c=a?n+"-"+a:n;!p[r(411)].audio[c]&&(p[r(411)][r(341)][c]={audioLevel:0,levelList:[],isInspired:!1,local:!0,muteAudio:e[r(1822)],publishID:e.id,type:c,startSpeakTime:0,startMuteTime:0,continueSpeakTime:0});const u=p[r(411)].audio[c];if(!u[r(1708)]&&p.audioContext&&e.stream&&e[r(839)][r(1008)]().length>0){let t,o=p[r(1716)][r(1462)](e[r(839)]);l?(t=new f(p[r(1716)],c),o[r(265)](t)):(t=p[r(1716)][r(1e3)](4096,1,1),o[r(265)](t),t[r(265)](p[r(1716)][r(677)]),t[r(247)](r(1198),(e=>{const t=r;let o=e.inputBuffer[t(852)](0);if(o)try{u.audioLevel=Math.floor(100*Math[t(616)].apply(Math,o))}catch(e){s[t(1055)](c,e[t(339)]())}}))),u[r(526)]=o,u.audioProcessor=t}p[r(411)][r(1429)]&&(u[r(350)]=i(u[r(350)])),u[r(510)][r(801)](u[r(350)]),u[r(510)].length>=20&&(p.options[r(1381)]&&s.logInfo(r(1153)+c+", levelList:",u.levelList),u[r(510)]=[]),p[r(411)].enableInspire&&o(u,p.historyReport[r(1199)].inactiveDuration,!!e.pc)}));const c=p[t(411)][t(341)],u={remote:[],local:[]};if(p[t(411)][t(1429)]){const e=p[t(411)][t(1199)][t(694)];let r=0,o=null,n=null;u.inspiredStream=null,Object.keys(c)[t(1524)]>0&&(Object[t(703)](c)[t(1505)]((i=>{const a=t,u=c[i];!n&&u[a(1490)]?n=u:n&&u.isInspired&&s[a(1023)](a(940)+u.publishID);let d=0;u[a(998)]>0&&(d=u[a(282)]-u[a(998)]),(0===r&&d>e||r>u[a(998)]&&d>e)&&(r=u[a(998)],o=u)})),!n&&o&&(n=o,n.isInspired=!0,n[t(421)]=0,s.logInfo(t(437)+n.publishID+t(1477)+n.type+t(1279)+n.local+t(1271)+(n[t(282)]-n[t(998)]))),Object.keys(c)[t(1505)]((e=>{const r=t,o=c[e],n={publishID:o[r(705)],type:o.type,audioLevel:o[r(350)],isInspired:o[r(1490)]};o[r(1490)]&&(u.inspiredStream=n),o[r(1227)]?u[r(1227)][r(801)](n):u[r(1603)].push(n)})),a.emit(a.Event[t(500)],u))}else Object[t(703)](c)[t(1524)]>0&&(Object[t(703)](c).forEach((e=>{const r=t,o=c[e],n={publishID:o[r(705)],type:o[r(558)],audioLevel:o[r(350)]};o[r(1227)]?u[r(1227)].push(n):u.remote[r(801)](n)})),a[t(1167)](a[t(629)][t(500)],u))},p[n(1377)]=function(e,t,r,o,i){const a=n;if(!p[a(1716)]&&s[a(1023)]("get audio report before preview, no permission"),!t)return p[a(622)](),clearInterval(p.audioReport),void delete p.audioReport;p[a(500)]||(p[a(411)].enableInspire=o,i&&(p[a(411)][a(1199)]=i),p[a(500)]=setInterval(p[a(1753)],r))},p[n(555)]=function(e,t,r){const o=n,i=p.core[o(851)];if(!e)return clearInterval(i[o(1119)]),i.audioLevel=0,i[o(510)]=[],void(i[o(839)]&&p[o(1389)]());i.stream=t,p.initAudioContext(),s.logInfo(o(1653)+r),i.auidoInterval=setInterval(p[o(912)],r)},p[n(912)]=function(){const t=n,r=[0,1,2,3,4,4,5,5,5,5,6,6,6,6,6,7,7,7,7,8,8,8,9,9,9,9,9,9,9,9,9,9,9],o=p[t(1266)][t(851)];if(!o.audioProcessor&&p[t(1716)]&&o[t(839)]&&o[t(839)].getAudioTracks()[t(1524)]>0){let e,r=p[t(1716)][t(1462)](o[t(839)]);l?(e=new f(p[t(1716)],o.type),r[t(265)](e)):(e=p[t(1716)][t(1e3)](4096,1,1),r[t(265)](e),e[t(265)](p[t(1716)][t(677)]),e.addEventListener("audioprocess",(e=>{const r=t;let n=e[r(650)][r(852)](0);if(n)try{o[r(350)]=Math[r(1221)](100*Math.max[r(962)](Math,n))}catch(e){s[r(1055)](sid,e[r(339)]())}}))),o.audioSource=r,o.audioProcessor=e}o[t(350)]=(t=>{t=t>=100?99:t;return 10*r[Math[e(1221)](33*t/100)]})(o[t(350)]),o[t(510)][t(801)](o[t(350)]),o[t(510)][t(1524)]>=20&&(s[t(1055)](t(489),o[t(510)]),o[t(510)]=[]),a[t(1167)](a.Event.audioTest,{audioLevel:o[t(350)],type:o[t(558)]})},p.getStreamReport=function(e=!0,t="",r,o={}){const i=n;let s=p[i(411)][i(1363)][t];!s&&(s={timestamp:r.timestamp,bytesSent:0,framesSent:0,framesEncoded:0});let a=r[i(1243)]-s[i(1243)];o.videoFrameWidth=r.frameWidth||0,o[i(1628)]=r[i(527)]||0;let c=i(424)+(e?i(463):"Received");o[i(1855)]=g(r[c],s[c],a,8);let u="videoFPS"+i(e?463:1007),d="frames"+i(e?463:1007);o[u]=g(r[d],s[d],a,1e3);let l="videoFPS"+i(e?1730:1788),f=i(1186)+i(e?1730:1788);o[l]=g(r[f],s[f],a,1e3)},p[n(948)]=function(e=!0,t="",r){const o=n;!p[o(411)].video[t]&&(p[o(411)].video[t]={}),p.historyReport.video[t].timestamp=r[o(1243)];let i="bytes"+(e?o(463):"Received");p[o(411)][o(1363)][t][i]=r[i];let s=o(1186)+o(e?463:1007);p.historyReport[o(1363)][t][s]=r[s];let a=o(1186)+o(e?1730:1788);p[o(411)][o(1363)][t][a]=r[a]},p.routineVideoReport=function(){const t=n;let r={remote:[],local:[]},o=[];Object.values(p[t(1266)].publishers).forEach((t=>{o.push(new Promise((o=>{const n=e;if(!t.pc||"connected"!==t.pc[n(1851)])return o();t.pc[n(1615)]()[n(515)]((e=>{const i=n;let s=t[i(705)],a={publishID:t.publishID,type:t[i(558)]};return e[i(1505)]((e=>{const r=i;e[r(558)]===r(440)&&e.kind===r(1363)&&e.ssrc!==p[r(1266)][r(848)]&&(p.getStreamReport(!1,t.publishID,e,a),p[r(948)](!1,t[r(705)],e))})),r.remote[i(801)](a),!p[i(411)][i(1363)][s]&&(p[i(411)][i(1363)][s]={}),!p[i(411)][i(1363)][s][i(578)]&&(p[i(411)][i(1363)][s][i(578)]={bitrateList:[],FpsList:[]}),p[i(411)][i(1363)][s][i(578)].bitrateList.push(a[i(1855)]),p[i(411)].video[s][i(578)][i(865)].push(a[i(1757)]),p[i(411)][i(1363)][s][i(578)][i(177)][i(1524)]>=20&&(p[i(411)][i(1363)][s][i(578)][i(177)]=[],p[i(411)][i(1363)][s][i(578)][i(865)]=[]),o()}))})))})),[p[t(1266)][t(1054)],p[t(1266)][t(575)],p[t(1266)].custom][t(1539)](Object.values(p.core[t(752)]))[t(1505)]((e=>{const n=t;let i=e.tag,s=e[n(558)],a=i?s+"-"+i:s;e[n(731)]&&e.pc&&e.pc[n(1851)]===n(1624)&&o[n(801)](new Promise((t=>{const o=n;e.pc[o(1615)]()[o(515)]((n=>{const i=o;let s=e.id,c={publishID:e.id,type:a,videoFrameWidth:0,videoFrameHeight:0,videoBitrate:0,videoFPSSent:0,videoFPSEncoded:0},u=[];n[i(1505)]((e=>{const t=i;"outbound-rtp"===e[t(558)]&&"video"===e[t(1687)]&&u.push(e)})),u[i(1465)](((e,t)=>e[i(527)]-t[i(527)]));for(let t=e[i(813)];t>=0;t--){let e=u[t];if(e&&e[i(1427)]){p[i(1636)](!0,a,e,c),p[i(948)](!0,a,e);break}}return r[i(1227)][i(801)](c),!p[i(411)][i(1363)][s]&&(p[i(411)][i(1363)][s]={}),!p[i(411)][i(1363)][s].reportInfo&&(p[i(411)][i(1363)][s].reportInfo={bitrateList:[],FpsList:[]}),p[i(411)][i(1363)][s][i(578)][i(177)][i(801)](c.videoBitrate),p[i(411)].video[s][i(578)][i(865)][i(801)](c[i(1223)]),p[i(411)][i(1363)][s].reportInfo[i(177)].length>=20&&(p[i(411)][i(1363)][s].reportInfo[i(177)]=[],p.historyReport[i(1363)][s].reportInfo.FpsList=[]),t()}))})))})),Promise[t(1745)](o)[t(515)]((()=>{const e=t;Object[e(703)](r)[e(1524)]>0&&a[e(1167)](a[e(629)].videoReport,r)}))},p.streamVideoReport=function(e,t){const r=n;e?p[r(1169)]||(p[r(1169)]=setInterval(p.routineVideoReport,t)):p.videoReport&&(clearInterval(p.videoReport),delete p[r(1169)])},p.emitNetworkReport=function(){const e=n,t=p[e(1266)][e(1184)],r=t[e(874)],o=t[e(855)];t[e(224)];const i={local:[],remote:[],level:0};p.emitNetWeakReport(),Object[e(703)](r)[e(1505)]((t=>{const r=e,o=p[r(1452)](t);o&&i[r(1227)][r(801)]({level:p[r(1411)](t,!0),publishID:o.id})})),Object.keys(o).forEach((t=>{const r=e,o=p[r(1452)](t);o&&i[r(1603)][r(801)]({level:p.getStreamNetLevel(t,!1),subscribeID:o.id,publishID:o[r(705)]})})),i[e(303)]=p[e(1648)](),a[e(1167)](a[e(629)][e(726)],i)},p[n(249)]=function(){const e=n,t=p[e(1266)][e(1184)][e(838)],r={local:[],remote:[]};Object[e(703)](t).forEach((o=>{const n=e,i=t[o],s=p[n(1452)](o);i&&s&&i.isChange&&(i[n(188)]=!1,s.local?(r[n(1227)][n(801)]({weak:!!i.isWeak,publishID:s.id}),i.isWeak&&p.triggerLogUpload(p[n(1537)][n(811)],{errorType:p[n(218)][n(663)],errorCode:p[n(346)][n(663)][n(533)],errorDesc:n(880)})):r.remote[n(801)]({weak:!!i[n(836)],remoteWeak:!!s.weak,subscribeID:s.id,publishID:s[n(705)]}),p[n(1092)](p[n(1266)][n(1668)],s.id,!!i[n(836)]))})),(r[e(1227)][e(1524)]>0||r.remote[e(1524)]>0)&&a[e(1167)](a.Event.netWeakChange,r)},p.routineQosLog=function(){const e=n;clearInterval(p.qosLogTimer),p[e(922)]=setInterval((()=>{const t=e;p.triggerLogUpload(p[t(1537)][t(662)])}),p[e(1199)][e(1589)])},p[n(1576)]=function(){const e=n,t=100;let r=0,o=0,i=0;function c(t){const r=e;p.options[r(1305)]&&t[r(1505)]((e=>{const t=r;if(e[t(429)]===p[t(541)][t(565)]||e[t(1786)]===p.MediaType.Screen){const{streamInfo:r}=e;s[t(1055)](t(1240)+e[t(429)]+"-"+e[t(1404)]+"-"+e[t(393)]+"-"+e.weakDuration+"-"+e[t(1366)]+"-"+e.stuckDuration+t(1390)+!document.hidden+","+r[t(1523)]+"-"+r[t(204)]+"-"+r[t(1534)]),e.stuckDuration&&s.logWarn(t(1467)+e[t(842)]),e[t(842)]/e[t(393)]>.19&&!e[t(417)][t(375)]&&(e[t(417)][t(375)]=!0,a[t(1167)](a.Event[t(375)]))}}))}function u(t,r,o){const n=e,i=typeof t[n(360)]===n(1030)?t[n(360)]:r.stuckCount,s="number"==typeof t[n(1599)]?t[n(1599)]:r[n(842)],a=Date[n(931)](),c={streamInfo:o,mediaType:r[n(558)],stuckCount:i-r.stuckCount,stuckDuration:s-r.stuckDuration,spanDuration:a-r[n(927)],playDuration:r.playDuration,weakDuration:r[n(1641)],mute:r[n(393)]?0:1};return r[n(587)]=i,r[n(842)]=s,r[n(927)]=a,r[n(393)]=0,r.weakDuration=0,c}clearInterval(p[e(1643)]),p.stuckLogTimer=setInterval((()=>{const n=e;if(document[n(1335)]){r=0,o=0;const e=[];Object[n(1706)](p[n(1266)][n(1031)])[n(1505)]((t=>{const r=n;if(p.core[r(1847)][t.id]){const o=p[r(1266)][r(1847)][t.id],n=Date[r(931)](),i=15e3;n-o[r(341)].time>=i&&e.push(u({interruptionCount:0,totalInterruptionDuration:0},o[r(341)],t)),n-o[r(1363)][r(927)]>=i&&e[r(801)](u({interruptionCount:o[r(1363)][r(324)],totalInterruptionDuration:o.video.totalStuckDuration},o[r(1363)],t)),delete p[r(1266)][r(1847)][t.id]}})),e.length>0&&(p.triggerLogUpload(p.LogType[n(1094)],e),c(e))}else{let e=!1,s=!1;r++,r>=6&&(e=!0,r=0),o++,o>=300&&(s=!0,o=0),i++;const a=[],d=[];Object[n(1706)](p[n(1266)][n(1031)])[n(1505)]((r=>{const c=n;!p[c(1266)].stuckData[r.id]&&(p[c(1266)][c(1847)][r.id]={audio:{stuckCount:0,stuckDuration:0,weakDuration:0,time:Date[c(931)](),type:p.MediaType[c(418)],playDuration:0,playTime:Date[c(931)]()},video:{initTime:Date[c(931)](),stuckCount:0,stuckDuration:0,weakDuration:0,time:Date.now(),type:r.type===p.StreamType[c(551)]?p[c(541)][c(565)]:p[c(541)][c(1663)],gapList:[],framesDecoded:0,beginStuckTime:0,lastIntervalTime:Date[c(931)](),totalStuckCount:0,totalStuckDuration:0,playDuration:0,playTime:Date[c(931)]()}});const l=p[c(1266)][c(1847)][r.id];r[c(711)]===p[c(675)].Web&&r[c(558)]===p[c(1155)].Screen&&(i>=12?(i=0,e=!0):e=!1),d[c(801)](new Promise((n=>{const i=c;if(!r.pc||r.pc[i(1851)]!==i(1624)||!r[i(854)]||!p.isWsOpen())return n();r.pc.getStats()[i(515)]((c=>{const d=i;c[d(1505)]((n=>{const i=d;if(n[i(558)]===i(440)&&n[i(1687)]===i(341)){const e=Date.now();!(r[i(1822)]||r[i(181)])&&(l.audio[i(393)]+=e-l[i(341)][i(602)]),l.audio[i(602)]=e,s&&a[i(801)](u(n,l[i(341)],r))}else if(n[i(558)]===i(440)&&"video"===n[i(1687)]){const c=l[i(1363)],d=r[i(389)]||r[i(201)];if(typeof n[i(1523)]===i(1030)&&n.framesDecoded>0){c.gapList[i(801)]({mute:d,framesDecoded:n[i(1523)]});const s=p[i(1266)][i(1184)][i(838)][r.id],a=s&&s[i(836)]||r[i(1371)],u=Date[i(931)]();if(!d){const e=u-c[i(602)];c.playDuration+=e,a&&(c[i(1641)]+=e)}if(c[i(602)]=u,e){if(d||a)c[i(405)]&&c[i(554)]&&(c.totalStuckDuration+=c.lastIntervalTime-c[i(405)]),c[i(405)]=0;else{if(n.framesDecoded<=c[i(1523)]){if(!c[i(405)]){c[i(405)]=c[i(554)],c[i(324)]++;const e=c.gapList[i(488)](0,c[i(803)].length-6);e&&e[i(1505)]((e=>{const r=i;!e.mute&&c.framesDecoded===e[r(1523)]&&(c[r(405)]-=t)}))}}else if(c.beginStuckTime){c[i(748)]+=c.lastIntervalTime-c[i(405)];c[i(803)][i(488)](c[i(803)].length-6,c[i(803)][i(1524)]-1)&&c[i(803)].forEach((e=>{const r=i;!e[r(1366)]&&c[r(1523)]===e[r(1523)]&&(c[r(748)]+=t)})),c[i(405)]=0}r[i(1534)]=n[i(1534)],r[i(204)]=n.totalFreezesDuration,r[i(1523)]=n[i(1523)]}c[i(394)]&&(c[i(324)]=0,c[i(748)]=0,Date[i(931)]()-c[i(394)]>400&&(c[i(394)]=null)),n.interruptionCount=c[i(324)],n[i(1599)]=c[i(748)],c[i(1523)]=n[i(1523)],c[i(554)]=Date.now()}o>12&&c.gapList[i(1524)]>0&&c[i(803)].shift()}s&&(c[i(405)]&&(c.totalStuckDuration+=c.lastIntervalTime-c.beginStuckTime,c[i(405)]=0,n[i(1599)]=c[i(748)]),a[i(801)](u(n,c,r)),c.gapList=[])}})),n()})).catch((e=>{n()}))})))})),d[n(1524)]>0&&Promise[n(1745)](d).then((()=>{const e=n;s&&a[e(1524)]>0&&(p[e(1433)](p[e(1537)][e(1094)],a),c(a))}))}}),t)},p[n(1035)]=function(e,t,r){let o=0;return o=e<=t?1:e>=r?0:1-(e-t)/(r-t),o},p[n(1545)]=function(e,t,r){let o=0;return o=e<=t?0:e>=r?1:(e-t)/(r-t),o},p[n(1232)]=function(e){const t=n;let r,o=0;return r=e.tag?JSON.parse(JSON[t(1014)](p[t(1199)].cameraExLayers)):JSON[t(1506)](JSON.stringify(p[t(1199)][e[t(558)]+t(519)])),r[t(488)](e[t(813)]+1,r.length-e[t(813)]-1),r[t(1505)]((e=>{o+=e[t(716)]})),o},p[n(1770)]=function(e,t){const r=n;let o;return o=e[r(1838)]?JSON[r(1506)](JSON[r(1014)](p.options[r(1640)])):JSON.parse(JSON[r(1014)](p[r(1199)][e[r(558)]+r(519)])),o[t][r(716)]},p.getNetworkMinBw=function(e,t){const r=n,{kMinVideoBitrate:o,kMinVideoBitrate2:i}=p.core[r(1184)].const;let s=Math[r(1221)](e===p[r(1155)].Screen?t/4:t/3);return s>i?s=i:s0&&(i=0,r[e(1505)]((r=>{const o=e,n=t[o(874)][r],c=t[o(838)][r];n.muteAudio&&n[o(389)]||(s++,(!c||!c.isWeak)&&(i+=n[o(303)]),!n.muteVideo&&(a=!0))})));let c=1,u=0,d=!1;o.length>0&&(c=0,o[e(1505)]((r=>{const o=e,n=t.downlinkStats[r],i=t.netWeakStats[r];n[o(1822)]&&n.muteVideo||(u++,(!i||!i[o(836)])&&(c+=n[o(303)]),!n.muteVideo&&(d=!0))})));let l=1;0==s&&0==u?l=0:s>0&&u>0?a&&d?l=(i+c)/(s+u):d?!a&&(l=c/u):l=i/s:s>0?l=i/s:u>0&&(l=c/u);let f=0;return(s>0||u>0)&&(f=Math[e(1221)](4*l+1.5)),f},p[n(1411)]=function(e,t,r=!1){const o=n,i=p[o(1266)].network,s=p[o(1452)](e),a=t?i[o(874)][e]:i[o(855)][e],c=i[o(838)][e];let u=0;return!r&&(c&&c[o(836)]||s&&s[o(1371)])?u=1:a&&a[o(303)]&&(u=Math[o(1221)](4*a[o(303)]+1.5)),u},p[n(680)]=function({streamInfo:e,pair:t,videoOutList:r,audioOut:o,videoRemoteInList:i,audioRemoteIn:s}){const a=n,c=p.core.network.uplinkStats[e.id],{rttMin:u,rttMax:d,kMinVideoBitrate:l,kMinVideoBitrate2:f,fractionLostMin:m,fractionLostMax:b}=p.core[a(1184)][a(224)],v=p[a(1232)](e),y={id:e.id,type:e.type,muteAudio:e[a(1822)],muteVideo:e.muteVideo,timestamp:t?t[a(1243)]:Date[a(931)](),level:0,outBandWidth:v};if(-1===e[a(813)])return y.level=1,y;if(!t)return c;let h=p[a(427)](e[a(558)],p[a(1770)](e,0));if(y[a(1737)]=t[a(1334)],r[a(488)](e.layerIndex+1,r.length-e.layerIndex-1),i[a(488)](e[a(813)]+1,i.length-e.layerIndex-1),s&&(y[a(1633)]=s.roundTripTime,y[a(1264)]=s[a(1423)]),o&&(y[a(1620)]=o[a(1387)]),i&&i[a(1524)]>0){const e=i[i[a(1524)]-1];y.videoRtt=e[a(1694)],y[a(1348)]=0,i[a(1505)]((e=>y[a(1348)]+=e[a(1423)]))}if(r&&r[a(1524)]>0){const e=r[r.length-1];y[a(308)]=0,y[a(1671)]=0,r.forEach((e=>{const t=a;y[t(308)]+=e.packetsSent,y[t(1671)]+=e[t(1427)]})),y[a(306)]=e[a(306)],c&&(y[a(477)]=y[a(306)]100?15:Math.floor((y[a(306)]-c[a(306)])/(y[a(1243)]-c[a(1243)])*1e3),y[a(1737)]=Math.floor(8*(y.videoBytesSent-c.videoBytesSent)/(y.timestamp-c[a(1243)])*1e3),y[a(1348)]&&c[a(1348)]0&&t>0){const r=t/e*100;I=p.fetchRangePercentL(r,m,b)}}if(i&&i[a(1524)]>0&&!y[a(389)]){y[a(1834)]&&(S=p[a(1035)](y.videoRtt,u,d));const e=y.videoPktsSent-c.videoPktsSent,t=y.videoPktsLost-c[a(1348)];if(e>0&&t>0){const r=t/e*100;E=p[a(1035)](r,m,b)}}return!y.muteVideo&&v>0&&y.outBandWidth&&i&&i.length>0&&r&&r[a(1524)]>0&&(g=p[a(1545)](y[a(1737)],h,v)),y[a(1822)]&&y[a(389)]?y.level=0:y[a(1822)]||y.muteVideo?y[a(1822)]?y[a(303)]=.1*S+.2*E+.7*g:y[a(389)]&&(y.level=.5*w+.5*I):y[a(303)]=.1*(w+S)+.1*(I+E)+.6*g,y},p[n(1384)]=function({streamInfo:e,pair:t,video:r,audio:o}){const i=n,s=p[i(1266)].network[i(855)][e.id],{delayMin:a,delayMax:c,jitterMin:u,jitterMax:d,kMinVideoFrameRate:l}=p[i(1266)][i(1184)][i(224)],f=e.layers[e[i(813)]],m=p[i(427)](e[i(558)],e.layers[0].targetBw),b={};if(b.id=e.id,b[i(558)]=e.type,b[i(1822)]=e[i(1822)]||e[i(181)],b[i(389)]=e[i(389)]||e.localMuteVideo||e[i(197)],b[i(1243)]=t?t[i(1243)]:Date[i(931)](),b[i(303)]=0,b[i(585)]=f[i(716)],!t)return s;if(o&&(b[i(1552)]=1e3*t[i(1299)]+(o[i(1088)]?o.jitterBufferDelay/o[i(1088)]*1e3:0),b[i(952)]=1e3*o.jitter,b[i(1296)]=o[i(1750)],b.audioPktsLost=o[i(1423)]),r&&(b[i(1357)]=1e3*t[i(1299)]+(r[i(1088)]?r[i(696)]/r[i(1088)]*1e3:0),b[i(404)]=(r[i(646)]-r.framesDecoded-r[i(571)])/r[i(1579)]*1e3,b[i(1135)]=1e3*r[i(1173)],b[i(547)]=r.packetsReceived,b[i(1348)]=r[i(1423)],b.framesReceived=r[i(646)],b.videoBytesReceived=r.bytesReceived,s&&s.videoBytesReceived&&(b[i(585)]=Math[i(1221)](8*(b[i(1235)]-s[i(1235)])/(b[i(1243)]-s[i(1243)])*1e3))),!s)return b[i(303)]=0,b;r&&(b[i(477)]=Math.floor((b.framesReceived-s[i(646)])/(b[i(1243)]-s[i(1243)])*1e3));let v=1,y=1,h=1,g=1;return o&&!b.muteAudio&&(y=p[i(1035)](b[i(1552)],a,c),h=p.fetchRangePercentL(b[i(952)],u,d)),r&&!b[i(389)]&&(p.fetchRangePercentL(b[i(1357)],a,c),p[i(1035)](b[i(1135)],u,d),f.targetBw>0&&b[i(585)]&&(v=p[i(1545)](b[i(585)],m,f[i(716)])),r.framesPerSecond>0&&(g=p.fetchRangePercentH(b[i(477)],l,f.frameRate))),b.muteAudio&&b[i(389)]?b[i(303)]=0:b.muteAudio||b[i(389)]?b.muteAudio?b.level=.8*v+.2*g:b.muteVideo&&(b[i(303)]=.5*y+.5*h):b[i(303)]=.1*y+.1*h+.1*g+.7*v,b},p.updateNetWeakStats=function(e,t){const r=n,o=p[r(1266)][r(1184)][r(838)],{kNetUpWeakBitrate:i,networkQuality:s,kNetDownWeakFps:a}=p[r(1266)][r(1184)][r(224)],c=Date[r(931)](),u=p[r(1411)](e.id,e[r(1227)],!0),d=t[r(477)],l=e[r(1227)]?t[r(1737)]:t.inBandWidth,f=15e3,m=p.options[r(969)]+500;let b=null;function v(e){const t=r;e[t(599)]=0,e[t(274)]=0,e[t(984)]=0,e[t(1183)]=0,e[t(1630)]=0}0!==u&&(o[e.id]?b=o[e.id]:(b={id:e.id,averageBitrate:0,totalBitrate:0,sampleNum:0,updateTime:0,startLowBitrateTime:0,startNormalBitrateTime:0,isWeak:!1},o[e.id]=b),b[r(502)]=c,e[r(389)]||e.localMuteVideo?(b.startLowBitrateTime=0,b.startNormalBitrate_time=0,v(b)):(e[r(1227)]?u<=s[r(1783)]&&!b[r(836)]?0===b[r(1304)]&&(b[r(1304)]=c,v(b)):u>s[r(1783)]&&b.isWeak&&0===b[r(1522)]&&(b[r(1522)]=c,v(b)):(u<=s[r(586)]||d<=a)&&!b.isWeak?0===b[r(1304)]&&(b[r(1304)]=c,v(b)):u>s[r(586)]&&d>a&&b.isWeak&&0===b.startNormalBitrateTime&&(b.startNormalBitrateTime=c,v(b)),b[r(1304)]>0&&(b[r(1630)]++,b[r(984)]+=l,b[r(1183)]+=d,b[r(274)]=b[r(984)]/b.sampleNum,b[r(599)]=b[r(1183)]/b[r(1630)],e[r(1227)]?u>s[r(1783)]?(b[r(1304)]=0,v(b)):c-b[r(1304)]+m>f&&(b[r(1304)]=0,v(b),!b[r(836)]&&(b[r(836)]=!0,b[r(188)]=!0)):u>s[r(586)]&&d>a?(b[r(1304)]=0,v(b)):c-b[r(1304)]+m>f&&(b[r(1304)]=0,v(b),!b[r(836)]&&(b[r(836)]=!0,b.isChange=!0))),b[r(1522)]>0&&(b[r(1630)]++,b[r(984)]+=l,b[r(1183)]+=d,b[r(274)]=b[r(984)]/b[r(1630)],b.averageVideoFps=b.totalVideoFps/b[r(1630)],e[r(1227)]?u<=s.bad?(b.startNormalBitrateTime=0,v(b)):c-b[r(1522)]+m>f&&(b[r(1522)]=0,v(b),b[r(836)]&&(b[r(836)]=!1,b[r(188)]=!0)):u<=s[r(586)]||d<=a?(b[r(1522)]=0,v(b)):c-b[r(1522)]+m>f&&(b[r(1765)]=0,v(b),b.isWeak&&(b[r(836)]=!1,b[r(188)]=!0)))))},p[n(1026)]=function(){const t=n,r=[];Object[t(1706)](p[t(1266)][t(1031)])[t(1505)]((e=>{const o=t;r[o(801)](new Promise((t=>{const r=o;if(!e.pc||e.pc.connectionState!==r(1624))return t();e.pc[r(1615)]().then((o=>{const n=r,i={streamInfo:e,video:null,audio:null,pair:null};o[n(1505)]((e=>{const t=n;"candidate-pair"===e[t(558)]&&"succeeded"===e[t(195)]?i[t(718)]=e:"inbound-rtp"===e.type&&e.ssrc!==p[t(1266)].probatorSsrc&&(e[t(1687)]===t(1363)?e[t(1147)]!==t(251)&&(i[t(1363)]=e):i.audio=e)}));const s=p[n(1384)](i);return s&&(p[n(1266)].network[n(855)][e.id]=s,i[n(1363)]&&p[n(996)](e,p[n(1266)][n(1184)].downlinkStats[e.id])),t()}))})))}));[p[t(1266)][t(1054)],p[t(1266)][t(575)],p[t(1266)][t(1580)]][t(1539)](Object[t(1706)](p.core[t(752)]))[t(1505)]((o=>{const n=t;o[n(731)]&&o.pc&&o.pc[n(1851)]===n(1624)&&r.push(new Promise((t=>{const r=n;o.pc[r(1615)]().then((n=>{const i=r,s={streamInfo:o,pair:null,videoOutList:[],audioOut:null,videoRemoteInList:[],audioRemoteIn:null};n.forEach((t=>{const r=e;t[r(558)]===r(438)&&t.state===r(497)?s[r(718)]=t:t[r(558)]===r(316)?t[r(1687)]===r(1363)?s[r(1519)][r(801)](t):s.audioRemoteIn=t:"outbound-rtp"===t[r(558)]&&(t.kind===r(1363)?s[r(744)][r(801)](t):s[r(758)]=t)}));const a=p[i(680)](s);return a&&(p.core[i(1184)][i(874)][o.id]=a,p[i(996)](o,a)),t()}))})))})),Promise[t(1745)](r)[t(515)]((()=>{p.emitNetworkReport()}))},p[n(182)]=function(e,t){const r=n;clearInterval(p[r(726)]),delete p[r(726)],e&&(p[r(726)]=setInterval(p.routineNetworkReport,t))},p[n(886)]={},p[n(1204)]=function(e=!0,t="",r=!0,o="",i){const a=n;let u;if(e){if(u=o?p.core[a(752)][o]:p[a(1266)][t],!u[a(731)]||!u[a(839)])return s[a(1023)](a(1396),t,"before preview"),p[a(749)](p[a(1215)][a(1616)],"record local before preview")}else{if(u=p.getStreamInfo(t),!u)return s[a(1023)](a(334),t,"not found"),p[a(749)](p[a(1215)][a(1616)],a(935));if(!u[a(854)])return s[a(1023)](a(1396),t,a(1698)),p[a(749)](p[a(1215)].RecordError,a(610))}let l=o?t+"-"+o:t;if(!r)return p[a(886)][l]?(p.recorders[l][a(392)][a(1508)](),p[a(886)][l][a(300)]=i,p.recorders[l][a(1275)]):(s[a(485)]("can not stop recording, stream",l,"not found"),p[a(749)](p[a(1215)][a(1616)],a(207)+l));{if(p[a(886)][l])return;if(!d)return;let e={chunks:[],recorder:new d(u[a(839)])};e[a(1275)]=new Promise((t=>{e[a(1725)]=t})),e[a(392)][a(1120)]=t=>{const r=a;e[r(1558)][r(801)](t[r(1773)])},e[a(392)][a(1498)]=function(){const t=a;let r=new File([new Blob(e.chunks,{type:e[t(392)][t(818)]})],t(1419)+Date[t(931)]()+t(1046),{type:e[t(392)][t(818)]});e[t(1558)]=[],delete p[t(886)][l],e[t(300)]&&c&&c(r),e[t(1725)](r)},e[a(392)].start(),p.recorders[l]=e}},p.recordTest=function(e=!0,t="",r=!0,o=""){const i=n;let a,u=1;if(a=p[i(1452)](t),!a[i(854)])return;let l=o?t+"-"+o:t;if(r){if(p[i(886)][l])return;if(!d)return;let e={chunks:[],type:a[i(558)],index:u++};e.recorder=new d(a.stream,{}),e[i(392)].ondataavailable=t=>{const r=i;e.chunks[r(801)](t[r(1773)])},e[i(392)][i(1498)]=function(){const t=i;if(c){let r=new File([new Blob(e.chunks,{type:e[t(392)][t(818)]})],t(1419)+e[t(558)]+"-"+Date[t(931)]()+"-"+e[t(184)]+".webm",{type:e.recorder[t(818)]});c(r)}e[t(1558)]=[]},e[i(392)][i(738)]=function(e){console[i(605)]("recordTest",e)},e[i(392)][i(1824)](),p.recorders[l]=e}else{if(!p[i(886)][l])return s[i(485)]("can not stop recording, stream",l,i(217)),p.emitError(p[i(1215)][i(1616)],i(207)+l);p[i(886)][l][i(392)].stop(),delete p[i(886)][l]}},p[n(843)]=function(e=!0,t="",r=""){const o=n;let i;if(e)if(p[o(1266)][o(752)][r]&&p[o(1266)][o(752)][r][o(731)]&&p[o(1266)][o(752)][r].videoElem)i=p.core[o(752)][r][o(465)];else{if(!(p[o(1266)][t]&&p[o(1266)][t][o(731)]&&p.core[t][o(465)]))return s[o(485)]("screenshot local before preview"),p[o(749)](p[o(1215)][o(240)],o(1294)+(r?t+"-"+r:t)+o(870));i=p[o(1266)][t].videoElem}else{let e=p[o(1452)](t);if(!e||!e.ready||!e.videoElem)return s[o(485)](o(1593)),p.emitError(p[o(1215)][o(240)],o(1845)+t);i=e[o(465)]}let a=document.createElement(o(1288));return a[o(723)]=i[o(1177)]||640,a[o(1669)]=i.videoHeight||360,a[o(743)]("2d")[o(431)](i,0,0,a[o(723)],a[o(1669)]),a[o(795)](o(977))},p[n(186)]=function(e="",t="",r,o,i,s,a,c,u,d){p[n(1422)](e,t,i,r,o,u,d,a,s,c)},p[n(816)]=function(e,t,r,o,i,s,a,c,u,d){p[n(473)](e,t,r,o,i,s,a,c,u,d)},p.userPlay=async function(){const e=n;s[e(1055)]("[userPlay]: "+p[e(1266)].unableAutoPlay[e(1524)]);const r=p[e(1266)][e(1554)],o=[];p[e(1266)][e(1554)]=[],r.forEach((t=>{const r=e;t&&t[r(1250)]&&t[r(1250)].active?o.push(new Promise(((e,o)=>{const n=r;t.play()[n(515)]((()=>{e(t)}))[n(432)]((()=>{s[n(485)]("elem play fail:"+t.id),o(t)}))}))):p[r(1266)].unableAutoPlay.push(t)})),(e=>{const r=t;return Promise&&Promise[r(1300)]?Promise[r(1300)](e):new Promise((t=>{const o=r;if(0===e[o(1524)])return t([]);const n=new Array(e[o(1524)]);let i=e[o(1524)];const s=()=>{i--,0===i&&t(n)};e[o(1505)](((e,t)=>{const r=o;e[r(515)]((e=>{const o=r;n[t]={status:o(641),value:e},s()}))[r(432)]((e=>{const o=r;n[t]={status:o(1742),reason:e},s()}))}))}))})(o)[e(515)]((t=>{const r=e;let o=!1;t[r(1505)]((e=>{const t=r;e[t(313)]===t(1742)&&(o=!0,p[t(1266)][t(1554)][t(801)](e[t(295)]))})),o&&(s.logError(r(239)+p[r(1266)][r(1554)][r(1524)]),setTimeout((()=>{a[r(1167)]("needUserPlay")}),1e3))}))},p[n(1689)]=async function(e){const t=n;let r=t(1689),o=null;if(e){if(p[t(886)][r])return void s.logError("recordScreen has already start, sid:"+r);if(!d)return void s[t(485)]("browser is not support MediaRecorder");try{let e={audio:p[t(1199)][t(1267)],video:p[t(1199)][t(786)]};e[t(1363)]&&(e[t(1363)]={frameRate:{ideal:p[t(1199)][t(194)][0][t(1365)]}}),o=await navigator[t(796)].getDisplayMedia(e)}catch(e){if(s.logError(t(1012)+e),e.toString()[t(199)]("NotAllowedError")>=0)return a[t(1167)](a.Event[t(575)],!1);p[t(1513)]({type:p[t(1155)][t(1663)],desc:t(449),error:e})}var i={audioBitsPerSecond:128e3,videoBitsPerSecond:25e5,mimeType:t(271)};let e={chunks:[],recorder:new d(o,i),stream:o};e[t(392)][t(1120)]=r=>{const o=t;e[o(1558)][o(801)](r[o(1773)])},e[t(392)][t(1498)]=function(){const o=t;c&&c(new File([new Blob(e[o(1558)],{type:e.recorder[o(818)]})],o(1419)+Date[o(931)]()+".webm",{type:e.recorder[o(818)]})),e[o(1558)]=[],delete e[o(839)],delete p[o(886)][r]},e.recorder[t(1824)](),p[t(886)][r]=e}else{if(!p[t(886)][r])return s[t(485)](t(444),r,t(217)),p[t(749)](p[t(1215)].RecordError,t(207)+r);p[t(886)][r][t(392)][t(1508)](),p[t(256)](p[t(886)][r][t(839)])}},p[n(1459)]=async(t={},r)=>{const i=n;if(null===t)return;t instanceof Array?t[i(1505)]((e=>{const t=i;Object[t(703)](e)[t(1505)]((t=>{(void 0===e[t]||null===e[t]||""===e[t])&&(e[t]=-1)}))})):t instanceof Object&&Object.keys(t)[i(1505)]((e=>{(void 0===t[e]||null===t[e]||""===t[e])&&(t[e]=-1)}));const s=t=>new Promise(((r,n)=>{const i=e,s={url:t[i(557)],timeout:t[i(972)],method:t.method};t[i(278)]===i(1287)?s[i(844)]=t[i(844)]:s[i(1773)]=t[i(1773)],o(s).then((e=>{r(e)})).catch((e=>{200===e[i(313)]?r():n(e)}))}));if(t instanceof Array&&t[i(1524)]>4){const e=Math[i(987)](t[i(1524)]/4);for(let o=0;o{const r=e;return t[r(1224)][r(660)]((e=>{const t=r;return e.mimeType[t(1399)]()===t(774)}))||[]};t[e(1535)]=o(r)[e(1524)]>0}return t},p[n(1234)]=function(e){const t=n;if(p[t(1266)][t(507)]!==e)if(p[t(1266)][t(1528)]){const r=[p[t(584)].anchor,p[t(584)][t(1130)]],o=[p[t(584)][t(825)],p.UserRole[t(1556)]];r[t(363)](p.core.userRole)&&r[t(363)](e)||o[t(363)](p[t(1266)][t(507)])&&o[t(363)](e)?(p[t(707)](e),p[t(1660)](!0),p[t(1100)]({userRole:e})):p.emitError(p.ErrorCode[t(434)])}else p[t(1100)]({userRole:e});else s[t(1023)](t(1125))},p[n(259)]=function(){const e=n;p[e(1266)][e(1528)]&&!p[e(1266)][e(1560)]?(p.core[e(1560)]=!0,p[e(1266)].camera[e(1749)]=p[e(1266)][e(1054)][e(1822)],p[e(1266)][e(1054)].pc&&p[e(1426)](p[e(1155)][e(551)],{muteAudio:!0}),p[e(1266)][e(575)][e(1749)]=p[e(1266)][e(575)].muteAudio,p.core[e(575)].pc&&p[e(1426)](p[e(1155)][e(1663)],{muteAudio:!0}),p[e(1266)].custom[e(1749)]=p.core[e(1580)][e(1822)],p[e(1266)][e(1580)].pc&&p.muteLocalStream(p[e(1155)][e(1663)],{muteAudio:!!p[e(1266)][e(1580)][e(1749)]},!1,p[e(831)][e(550)]),Object[e(703)](p[e(1266)][e(752)])[e(1505)]((t=>{const r=e;p[r(1266)][r(752)][t][r(1749)]=p[r(1266)][r(752)][t][r(1822)],p[r(1266)].cameraEx[t].pc&&p[r(1426)](t,{muteAudio:!0})})),Object[e(703)](p.core[e(1031)]).forEach((t=>{const r=e;p[r(1266)][r(1031)][t][r(1265)]=p[r(1266)][r(1031)][t].localMuteAudio,p.muteRemoteStream(t,{muteAudio:!0})}))):s[e(1023)](e(1080)+!!p.core.session+e(230)+p[e(1266)][e(1560)])},p[n(679)]=function(){const e=n;p[e(1266)][e(1528)]&&p.core.muteAllStreamAudio?(p.core[e(1560)]=!1,p[e(1426)](p[e(1155)][e(551)],{muteAudio:!!p[e(1266)].camera[e(1749)]}),p[e(1426)](p[e(1155)].Screen,{muteAudio:!!p[e(1266)][e(575)][e(1749)]}),p.muteLocalStream(p[e(1155)][e(1663)],{muteAudio:!!p.core.custom[e(1749)]},!1,p[e(831)].Custom),Object[e(703)](p[e(1266)][e(752)])[e(1505)]((t=>{const r=e;p.muteLocalStream(t,{muteAudio:!!p[r(1266)][r(752)][t][r(1749)]})})),Object[e(703)](p[e(1266)][e(1031)])[e(1505)]((t=>{const r=e;if(p[r(1808)](t,{muteAudio:!!p[r(1266)][r(1031)][t][r(1265)]}),x.android){const e=p.core[r(1031)][t][r(1746)];e&&(e.pause(),setTimeout((()=>{e[r(805)]()}),50))}}))):s[e(1023)](e(817)+!!p[e(1266)].session+e(230)+p[e(1266)][e(1560)])},p[n(1461)]=function([e]){const t=n;return e===t(760)?[{type:e,enable:p[t(1199)][t(1647)],cache:p[t(760)][t(1741)]()}]:null},p[n(1647)]=function(t){return new Promise(((r,o)=>{const n=e;let i={desc:""};if(p[n(1199)][n(1647)]===t)return r(!0);if(p[n(1266)][n(1054)][n(1588)])return i[n(596)]=n(1743),o(i);if(p[n(1199)][n(1647)]=t,!(p[n(1266)][n(1054)].preview&&p.core[n(1533)].audioinput&&p[n(1266)].camera[n(1148)]))return r(!0);if(t){p[n(760)][n(1572)]()[n(557)]?p.denoiser[n(701)]()[n(515)]((async()=>{const e=n;if(!p[e(1266)][e(1533)].audioinput)throw new Error(e(1380));const t=p.getAudioConstraints(p[e(1266)][e(1533)][e(467)]);p[e(1353)](t[e(341)]);const o=await navigator.mediaDevices[e(835)](t);p[e(1266)][e(1054)].audioTrack=o[e(1008)]()[0],p[e(1338)](p[e(499)][e(418)],p[e(1266)][e(1054)]);let i=await p[e(760)].start(o);return p[e(1266)][e(1054)][e(1421)]=p[e(1266)][e(1054)].audioTrack,p[e(1266)].camera[e(1148)]=i[e(1008)]()[0],p[e(1219)](p[e(1266)][e(1054)].audioTrack,e(1647),p[e(1266)][e(1054)]),p[e(1338)](p.StreamTrack.Audio,p.core[e(1054)],!0),await p[e(841)](),p[e(622)](p[e(1155)].Camera),p[e(1266)].camera.pc&&await p[e(213)](p[e(499)][e(418)],p[e(1266)][e(1054)]),r(!0)})).catch((e=>{const t=n;i[t(596)]=t(1116)+e[t(339)](),o(i)})):(i[n(596)]=n(896),o(i))}else{if(!p[n(760)][n(625)]())return r(!0);p[n(760)][n(1508)](),p[n(1492)](p[n(499)][n(418)]).then((()=>{r(!0)}))[n(432)]((e=>{const t=n;i.desc=e[t(339)](),o(i)}))}}))},p[n(1022)]=function(){const e=n;a.destroy(),p[e(1774)](null,!1),p[e(652)](null,!1),Object.values(p[e(1266)][e(752)])[e(1505)]((t=>{const r=e;t[r(558)]===p[r(1155)][r(551)]?p[r(894)](null,t[r(1838)],"","",!1):p[r(516)](null,t[r(1838)],!1)})),p[e(291)](null,"",!1),p[e(185)](!0)},p[n(1383)]=function(e=""){const t=n;if(e&&"string"==typeof e&&!(e.length<45))try{let r=CryptoJS.enc[t(1686)][t(1506)](Base64.decode(e[t(713)](0,22))),o=CryptoJS[t(366)][t(1686)].parse(Base64[t(684)](e[t(713)](22,22))),n=e[t(713)](44);for(let e=0,r=(4-n[t(1524)]%4)%4;e{const t=r;e.domain&&e.ip&&(o[t(1185)][e[t(755)]]=e.ip)}))},init:function(t={}){o[e(474)](t)},addListener:i[e(1587)][e(1356)](i),on:i[e(1587)].bind(i),removeListener:i[e(1473)][e(1356)](i),removeAllListener:i[e(742)][e(1356)](i),askForPermission:function(t=!1,r=!1){const i=e;if(n.logInfo("askForPermission(audio:"+t+", video:"+r+")"),!t&&!r)return o[i(749)](o.ErrorCode[i(1208)],i(1810));o[i(899)](t,r)[i(515)]()},join:function(t,r,i="",s=o.Area[e(923)],a){const c=e;return n[c(1055)](c(978)+t+", uid:"+r+c(1192)+i+c(651)+s+c(492)+a+")"),t&&r&&typeof t===c(645)&&typeof r===c(645)?(typeof a===c(297)&&(a=o.core[c(507)]),typeof a!==c(1030)||void 0===Object[c(1706)](o[c(584)])[c(1431)]((e=>e===a))?o[c(749)](o[c(1215)][c(1208)],c(582)):((!i||typeof i!==c(645))&&(n[c(1023)]("join widthout uName"),i=""),void o[c(1705)](t,r,i,s,a))):o[c(749)](o[c(1215)][c(1208)],"join(room:"+t+c(244)+r+c(1192)+i+c(1662)+s+")")},leave:function(){const t=e;n[t(1055)](t(1553)),o[t(185)]()},preview:function(t=null,r=o[e(1155)][e(551)],i=!0,s=[]){const a=e;return n[a(1055)](a(695)+(t?t.id:"")+a(1228)+r+", open:"+i+")"),Object[a(1706)](o[a(1155)])[a(199)](r)<0?o[a(749)](o[a(1215)].ParamsError,a(731)):s&&s[a(1524)]>0&&("denoiser"!==s[0].type||!s[0].url)?o.emitError(o.ErrorCode.ParamsError,a(301)):void(r===o[a(1155)].Camera?o[a(1774)](t,i,!1,!1,s):o[a(652)](t,i))},previewEx:function(t=null,r,i,s,a){const c=e;return n[c(1055)](c(304)+(t?t.id:"")+c(365)+r+c(1767)+i+c(688)+s+c(570)+a+")"),r?!a||i||s?void o[c(894)](t,r,i,s,a):o[c(749)](o.ErrorCode[c(1208)],"previewEx"):o[c(749)](o.ErrorCode[c(1208)],c(1442))},previewScreenEx:function(t=null,r,i){const s=e;if(n[s(1055)](s(1328)+(t?t.id:"")+s(365)+r+s(570)+i+")"),!r)return o[s(749)](o.ErrorCode[s(1208)],s(343));o[s(516)](t,r,i)},previewCustom:function(t=null,r="",i=!0,s=!1,a=!1){const c=e;if(n[c(1055)](c(409)+!!t+", url:"+r+", open:"+i+c(1259)+s+c(709)+a),i){if(!(t&&t instanceof HTMLElement))return o[c(749)](o[c(1215)][c(1208)],"[previewCustom] videoElement need, and shoud be HTMLElement");if(!r||typeof r!==c(645))return o[c(749)](o[c(1215)][c(1208)],"[previewCustom] url error")}o[c(291)](t,r,i,s,a)},setCustomProfile:function(t,r,i){const s=e;return n.logInfo(s(770)+!!t+s(183)+r+",layers:"+(i?JSON[s(1014)](i):"")),t instanceof HTMLElement?r&&"string"==typeof r?o[s(1266)][s(1580)][s(731)]?void o[s(1311)](t,r,i):o.emitError(o[s(1215)].ParamsError,s(1549)):o[s(749)](o[s(1215)][s(1208)],s(789)):o[s(749)](o[s(1215)][s(1208)],s(1418))},publish:function(t=o[e(1155)][e(551)],r=""){const i=e;return n[i(1055)](i(806)+t+i(867)+JSON[i(1014)](r)+")"),Object.values(o[i(1155)]).indexOf(t)<0?o.emitError(o[i(1215)][i(1208)],i(767)):typeof r!==i(645)?o[i(749)](o[i(1215)][i(1208)],i(1126)):o[i(1266)][i(1528)]?o[i(1266)][i(507)]===o[i(584)][i(1130)]||o[i(1266)][i(507)]===o[i(584)][i(1556)]?(n[i(485)](i(1797)),o.emitError(o[i(1215)][i(1099)],i(1797))):o[i(1266)][t].preview?t===o[i(1155)][i(1663)]&&o.core[i(1580)].id?(n[i(485)](i(891)),o[i(749)](o.ErrorCode.PublishError,"custom sharing, can not publish")):void o[i(1395)](t,"",r):(n[i(485)](i(378)),o[i(749)](o.ErrorCode[i(1099)],"publish before preview")):(n.logError(i(1161)),o[i(749)](o[i(1215)][i(1099)],i(1161)))},publishEx:function(t,r=""){const i=e;return n.logInfo(i(1295)+t+", info:"+JSON.stringify(r)+")"),t?"string"!=typeof r?o[i(749)](o.ErrorCode.ParamsError,i(1178)):o[i(1266)][i(1528)]?o[i(1266)].userRole===o[i(584)][i(1130)]||o[i(1266)][i(507)]===o[i(584)].sysAudience?(n.logError(i(1797)),o[i(749)](o[i(1215)][i(1099)],i(1797))):o[i(1266)][i(752)][t]&&o[i(1266)][i(752)][t][i(731)]?void o[i(1395)](o[i(1155)][i(551)],t,r):(n[i(485)]("publishEx before preview"),o.emitError(o[i(1215)][i(1099)],i(378))):(n[i(485)](i(466)),o[i(749)](o[i(1215)][i(1099)],i(1161))):o[i(749)](o[i(1215)][i(1208)],i(1202))},publishScreenEx:function(t,r=""){const i=e;return n[i(1055)](i(1082)+t+i(867)+JSON[i(1014)](r)+")"),t?"string"!=typeof r?o[i(749)](o[i(1215)].ParamsError,i(919)):o.core[i(1528)]?o[i(1266)][i(507)]===o[i(584)].audience||o.core[i(507)]===o[i(584)][i(1556)]?(n.logError(i(1797)),o[i(749)](o[i(1215)][i(1099)],i(1797))):o[i(1266)][i(752)][t]&&o[i(1266)][i(752)][t][i(731)]?void o.wsPublish(o.StreamType[i(1663)],t,r):(n[i(485)](i(888)),o[i(749)](o[i(1215)][i(1099)],i(378))):(n[i(485)](i(1280)),o[i(749)](o[i(1215)].PublishError,i(1161))):o[i(749)](o[i(1215)][i(1208)],i(1129))},publishCustom:function(t=""){const r=e;return n[r(1055)]("publishCustom(info:"+JSON[r(1014)](t)+")"),typeof t!==r(645)?o.emitError(o[r(1215)][r(1208)],r(1273)):o[r(1266)][r(1528)]?o.core[r(507)]===o[r(584)][r(1130)]||o[r(1266)][r(507)]===o[r(584)][r(1556)]?(n.logError("current role can not publish"),o[r(749)](o.ErrorCode[r(1099)],r(1797))):o.core[r(1580)][r(731)]?o[r(1266)][r(575)].id?(n[r(485)](r(692)),o[r(749)](o[r(1215)][r(1099)],"screen sharing, can not publish")):void o[r(1395)](o[r(1155)][r(1663)],"",t,o.SubStreamType[r(550)]):(n[r(485)](r(378)),o[r(749)](o.ErrorCode[r(1099)],"publish before preview")):(n[r(485)](r(1161)),o[r(749)](o[r(1215)][r(1099)],r(1161)))},unpublish:function(t=o.StreamType[e(551)]){const r=e;if(n[r(1055)](r(331)+t+")"),Object[r(1706)](o.StreamType).indexOf(t)<0)return o.emitError(o[r(1215)].ParamsError,r(312));o.wsUnPublish(t,o[r(1266)][t].id)},unpublishEx:function(t=""){const r=e;if(n[r(1055)](r(1806)+t+")"),!t)return o.emitError(o[r(1215)][r(1208)],r(1071));o.core[r(752)][t]&&o[r(1479)](o[r(1155)].Camera,o[r(1266)][r(752)][t].id,t)},unpublishScreenEx:function(t){const r=e;if(n[r(1055)](r(531)+t+")"),!t)return o[r(749)](o[r(1215)][r(1208)],r(1409));o[r(1266)][r(752)][t]&&o[r(1479)](o[r(1155)][r(1663)],o.core[r(752)][t].id,t)},unpublishCustom:function(){const t=e;n[t(1055)](t(868)),o.wsUnPublish(o[t(1155)][t(1663)],o[t(1266)][t(1580)].id,"",o[t(831)][t(550)])},subscribe:function(t=null,r="",i="",s,a,c){const u=e;if(n[u(1055)]("subscribe("+(t?t.id:"")+", UserID:"+r+", StreamIDorTag:"+i+u(1306)+s+u(709)+a+", muteVideo:"+c+")"),!r||!i)return o[u(749)](o[u(1215)][u(1208)],u(328));const d=o[u(588)](i);if(!d||d[u(376)]!==r)return n[u(485)]("publisher not found",r,i),o[u(749)](o[u(1215)].SubscribeError,u(549));i=d[u(705)],t instanceof HTMLElement&&t!==o[u(1266)][u(1031)][i].videoElem&&(o.enableDomAutoPlay(t),o.core[u(1031)][i][u(465)]=t),o[u(1266)].publishers[i].id?n.logWarn(i+u(1413)):(typeof s===u(1030)&&s>=0?o[u(1266)].publishers[i][u(813)]!==s&&(o[u(1266)][u(1031)][i].layerIndex=s):(s=0,o[u(1266)][u(1031)][i][u(813)]=s),void 0!==a&&o[u(1266)][u(1031)][i][u(181)]!==a&&(o[u(1266)].publishers[i][u(181)]=a),typeof c!==u(297)&&o[u(1266)][u(1031)][i][u(201)]!==c&&(o[u(1266)].publishers[i][u(201)]=c),0===s&&o.options.hdQualityPriority&&o[u(1266)].publishers[i][u(1056)][u(1524)]>1&&(o[u(1266)][u(1031)][i][u(1848)]=s,o[u(1266)].publishers[i].layerIndex=1,s=1),o[u(929)](r,i))},unsubscribe:function(t="",r=""){const i=e;n[i(1055)](i(1314)+t+i(1530)+r+")");const s=o[i(588)](t);r&&t&&s&&!(r[i(199)](s[i(705)])<0)?o.wsUnsubscribe(r):n[i(1023)](i(994))},muteLocal:function(t="",r={}){const i=e;return n[i(1055)](i(727)+t+i(1105)+JSON[i(1014)](r)+")"),r.hasOwnProperty(i(1822))||r.hasOwnProperty("muteVideo")?Object.values(o[i(1155)])[i(199)](t)<0?Promise[i(212)](o[i(1225)](null,{desc:o.ErrorCode[i(1208)]+i(618)})):o[i(1426)](t,r):Promise.reject(o[i(1225)](null,{desc:o[i(1215)][i(1208)]+i(618)}))},muteLocalEx:function(t="",r={}){const i=e;return n[i(1055)](i(1236)+t+i(1105)+JSON[i(1014)](r)+")"),(r[i(1651)](i(1822))||r[i(1651)]("muteVideo"))&&t?o[i(1426)]("",r,!1,t):Promise[i(212)](o.muteLocalReturnData(null,{desc:o[i(1215)].ParamsError+", muteLocalEx"}))},muteLocalScreenEx:function(t="",r={}){const i=e;return n[i(1055)](i(1037)+t+i(1105)+JSON[i(1014)](r)+")"),r[i(1651)]("muteAudio")||r[i(1651)](i(389))?t?o[i(1426)]("",r,!1,t):Promise[i(212)](o[i(1225)](null,{desc:o[i(1215)][i(1208)]+", muteLocalScreenEx"})):Promise.reject(o[i(1225)](null,{desc:o[i(1215)][i(1208)]+", muteLocalScreenEx"}))},muteLocalCustom(t={}){const r=e;return n.logInfo(r(1038)+JSON.stringify(t)+")"),t[r(1651)](r(1822))||t[r(1651)]("muteVideo")?o[r(1426)](o[r(1155)][r(1663)],t,!1,o[r(831)][r(550)]):Promise[r(212)](o[r(1225)](null,{desc:o[r(1215)][r(1208)]+r(672)}))},muteRemote:function(t="",r={}){const i=e;return n[i(1055)](i(773)+t+", status:"+JSON[i(1014)](r)+")"),r[i(1651)](i(1822))||r.hasOwnProperty(i(389))?t?void o[i(1808)](t,r):o.emitError(o[i(1215)][i(1208)],"muteRemote"):o[i(749)](o[i(1215)][i(1208)],"muteRemote")},selectLayer:function(t="",r=0){const i=e;if(n[i(1055)](i(1344)+t+i(1306)+r+")"),!t)return o[i(749)](o.ErrorCode[i(1208)],i(1654));if(r<0)return o[i(749)](o[i(1215)].ParamsError,i(1114));let s=o[i(1656)](t),a=o[i(1266)][i(1031)][s];if(!a)return o[i(749)](o.ErrorCode[i(1208)],i(1785));r>a[i(1056)][i(1524)]-1&&(r=a[i(1056)].length-1),a[i(813)]!==r&&(a[i(813)]=r),0===r&&o[i(1199)][i(882)]&&a.layers[i(1524)]>1&&(r=1),a[i(1848)]=r,a[i(813)]=r,o[i(1514)](t,r)},updateName:function(t){const r=e;n[r(1055)](r(400)+t+r(219)),"string"==typeof t&&t?o[r(1711)](t):n[r(1023)](r(459))},updateInfo:function(t=[]){const r=e;if(n.logInfo(r(381)+JSON.stringify(t)+")"),!t||0===t.length)return o.emitError(o[r(1215)][r(1208)],r(1331));t[r(1505)]((e=>{const t=r;let n=e[t(705)]?o[t(1452)](e[t(705)]):null;if(n){typeof n[t(1755)]===t(1102)?info=n[t(1755)]:info=JSON[t(1506)](n[t(1755)]),e[t(1755)]!=={}&&(info[t(509)]=e[t(1755)],info.act=1);let r=[{userID:o[t(1266)][t(1668)],publishID:e[t(705)],info:JSON[t(1014)](info)}];o[t(766)](r),n[t(1755)][t(1655)]=0}}))},getAppInfo:function(t){const r=e;n.logInfo("getAppInfo(streamId:"+t+")");let i=o[r(1452)](t);return i?i[r(1755)]:{}},message:function(t="",r=null){const i=e;if(n[i(1055)](i(1661),r||i(1745)),!t)return o[i(749)](o.ErrorCode[i(1208)],i(1449));(!r||r instanceof Array&&0===r[i(1524)])&&(r=null),o[i(1362)](t,r)},getDevices:function(t=!1){const r=e;n[r(1055)](r(446)+!!t),o[r(1301)](!!t)[r(515)]()},setDevice:function(t="",r=""){const i=e;if(n.logInfo("setDevice(deviceType:"+t+i(648)+r+")"),Object[i(1706)](o[i(925)])[i(199)](t)<0)return o[i(749)](o[i(1215)][i(1208)],i(1211));o[i(439)](t,r)},getDeviceInfo:function(t){const r=e;return n.logInfo(r(647)+t+")"),typeof t!==r(645)?Promise[r(212)](r(1401)):o[r(1769)](t)},audioReport:function(t=!0,r=250,i=null,s=!1,a){const c=e;if(n[c(1055)](c(1033)+(i?i.id:"")+c(1803)+t+c(408)+r+c(231)+s+c(639)+(typeof a===c(1102)?JSON.stringify(a):"")),isNaN(r))return o.emitError(o[c(1215)][c(1208)],c(1448));let u=r>200&&!s?r:200;o[c(1377)](i?i.captureStream():null,t,u,s,a)},audioTest:function(t,r,i=200){const s=e;if(n[s(1055)]("audioTest(enable:"+t+s(1172)+!!r+s(408)+i+")"),t){if(!(r instanceof HTMLElement&&r))return o[s(749)](o[s(1215)][s(1208)],s(657));if(typeof i!==s(1030))return o[s(749)](o.ErrorCode[s(1208)],"audio test interval error");let e=null;try{e=r[s(233)]()}catch(e){return o[s(749)](o[s(1215)][s(1208)],"audio test audioElement get stream error, "+e)}let n=i>200?i:200;o[s(555)](t,e,n)}else o[s(555)](!1)},videoReport:function(t=!0,r=1e3){const i=e;if(n[i(1055)](i(480)+t+i(408)+r+")"),isNaN(r))return o[i(749)](o[i(1215)].ParamsError,"statement");let s=r>500?r:500;o[i(260)](t,s)},qosReport:function(t=!0){const r=e;n[r(1055)](r(234)+!!t+")"),o[r(1199)].enableQosReport=!!t},recordLocal:function(t=o[e(1155)][e(551)],r=!0,i=!0){const s=e;return n[s(1055)]("[recordLocal]",t,r),Object[s(1706)](o[s(1155)]).indexOf(t)<0?o[s(749)](o.ErrorCode[s(1208)],s(290)):o[s(1204)](!0,t,r,"",i)},recordLocalEx:function(t,r=!0,i=!0){const s=e;return n[s(1055)](s(591),t,r),t?o[s(1204)](!0,o.StreamType[s(551)],r,t,i):o.emitError(o.ErrorCode[s(1208)],s(528))},recordLocalScreenEx:function(t,r=!0,i=!0){const s=e;return n[s(1055)](s(747),t,r),t?o[s(1204)](!0,o[s(1155)][s(1663)],r,t,i):o[s(749)](o[s(1215)].ParamsError,s(1010))},recordRemote:function(t="",r=!0,i=!0){const s=e;return n.logInfo(s(403),t,r),t?o.record(!1,t,r,"",i):o.emitError(o[s(1215)][s(1208)],s(534))},printLocal:function(t=o[e(1155)].Camera){const r=e;return n[r(1055)](r(279),t),Object.values(o[r(1155)])[r(199)](t)<0?o[r(749)](o.ErrorCode[r(1208)],r(1179)):o[r(843)](!0,t)},printLocalEx:function(t){const r=e;return n[r(1055)]("[printLocalEx]",t),t?o[r(843)](!0,o[r(1155)][r(551)],t):o[r(749)](o.ErrorCode[r(1208)],r(1469))},printLocalScreenEx:function(t){const r=e;return n[r(1055)](r(1132),t),t?o[r(843)](!0,o[r(1155)][r(1663)],t):o[r(749)](o[r(1215)][r(1208)],r(864))},printRemote:function(t=""){const r=e;return n.logInfo(r(710),t),t?o.print(!1,t):o.emitError(o[r(1215)].ParamsError,r(1179))},startMixer:function(t=0,r=null,i=0,s=!1,a=!1,c=!1,u="",d=""){const l=e;return n.logInfo(l(1064),t,r,i,s,a,c,u,d),0===t||0==(t&o[l(1036)][l(518)])&&0==(t&o[l(1036)][l(1714)])||0===i?o[l(749)](o.ErrorCode[l(1208)],l(325)):t&o[l(1036)][l(518)]>0&&!u?o.emitError(o[l(1215)][l(1208)],"startMixer"):void o.mixer("",o[l(1152)][l(1098)],i,r,t,a,s,c,u,d)},pauseMixer:function(t,r){const i=e;n.logInfo("[pauseMixer]",t,r),o[i(186)](t,r?o.TaskCmd[i(1051)]:o[i(1152)][i(447)])},stopMixer:function(t){const r=e;n[r(1055)](r(175),t),o[r(186)](t,o.TaskCmd[r(1262)])},updateMixer:function(t,r,i){const s=e;n.logInfo(s(1696),t,r,i),o[s(186)](t,o[s(1152)][s(1134)],i,r)},startWebPage:function(t,r,i,s,a,c,u,d,l){const p=e;n.logInfo("[startWebPage]",t,r,i,s,a,c,u,d,l),o[p(816)](t,o[p(1152)][p(1098)],r,i,s,a,c,u,d,l)},stopWebPage:function(t){const r=e;n[r(1055)](r(267),t),o[r(816)](t,o[r(1152)][r(1262)])},pauseWebPage:function(t,r){const i=e;n.logInfo(i(1290),t,r),o[i(816)](t,r?o.TaskCmd[i(1051)]:o.TaskCmd.Play)},userPlay:function(){const t=e;n.logInfo(t(293)),o.userPlay()[t(515)]()},recordScreen:function(t=!0){const r=e;n[r(1055)](r(1689)),o[r(1689)](t)},checkRequirement:function(){const t=e;return n.logInfo(t(945)),o[t(945)]()},setVideoOption:function(t){const r=e;if(typeof t!==r(1102))return o[r(749)](o[r(1215)].ParamsError,"setVideoOption");if(n[r(1055)](r(1457),t),t[r(1651)](r(882))){const e=!!t.hdQualityPriority;o[r(1199)][r(882)]!==e&&(o[r(1199)][r(882)]=e,1===o[r(1266)][r(313)]&&(o[r(1699)](),Object[r(703)](o[r(1266)][r(1031)])[r(1505)]((t=>{const n=r,i=o.core.publishers[t];i.pc&&0===i[e?n(813):"targetLayerIndex"]&&this[n(1061)](i.id,0)}))))}},setPublishLayer(t,r={}){const i=e;if(n[i(1055)](i(552),t,r),typeof r!==i(1102))return o.emitError(o[i(1215)][i(1208)],i(995));if(!(r[i(716)]&&r[i(1365)]&&r[i(723)]&&r[i(1669)]))return o.emitError(o[i(1215)][i(1208)],i(697));if(t===o[i(1155)][i(551)]){if(1!==o.options[i(992)][i(1524)])return o[i(749)](o[i(1215)][i(1208)],"setPublishLayer, publish should be single layer");o[i(949)](t,r)}else{if(!o[i(1266)][i(752)][t])return o[i(749)](o[i(1215)][i(1208)],i(410)+t+i(762));if(1!==o[i(1199)][i(1640)][i(1524)])return o.emitError(o.ErrorCode[i(1208)],"setPublishLayer, publish should be single layer");o[i(949)](t,r)}},getRole:function(){const t=e;return o[t(1266)][t(507)]},setRole:function(t){const r=e;if(n[r(1055)](r(1642)+t),"number"!=typeof t||typeof Object[r(1706)](o.UserRole).find((e=>e===t))===r(297))return o[r(749)](o[r(1215)][r(1208)],r(1234));n[r(1055)](r(1752)+t),o[r(1234)](t)},pauseAllStreamAudio(){const t=e;n[t(1055)](t(259)),o[t(259)]()},resumeAllStreamAudio(){const t=e;n[t(1055)]("resumeAllStreamAudio"),o[t(679)]()},getPluginStatus(t){const r=e;if(!(t instanceof Array))return n[r(1023)]("param error"),null;const[i]=t;return i&&i===r(760)?o[r(1461)]([i]):(n.logWarn(r(1253)),null)},downloadPlugin(t){const r=e;n[r(1055)](r(1592)+(t?JSON[r(1014)](t):t));let i=null;if(!(t instanceof Array))return i={msg:r(482)},Promise[r(212)](i);const[s]=t;return s&&s[r(558)]===r(760)&&s[r(557)]?new Promise(((e,t)=>{const n=r;o.denoiser[n(1480)](s.url,!1,!0)[n(515)]((()=>{e(!0)}))[n(432)]((()=>{t(!1)}))})):(i={msg:r(482)},Promise[r(212)](i))},enableDenoiser(t=!1){const r=e;return n[r(1055)](r(704)+t),o[r(1647)](!!t)},destroy(){const t=e;n[t(1055)]("destroy"),o.destroy(),o=null,n=null,i=null,Object[t(703)](this)[t(1505)]((e=>{e!==t(454)&&delete this[e]}))},create:X,Area:o[e(1582)],StreamType:o[e(1155)],StreamTrack:o[e(499)],DeviceType:o[e(925)],ErrorCode:o.ErrorCode,Role:o[e(468)],exAPI:{selfAESDecrypt:function(e=""){return o.selfAESDecrypt(e)}}}}!function(e){const r=t;!e.hirtcwebsdk&&(e[r(1002)]=X())}(window); diff --git a/public/static/sign.js b/public/static/sign.js new file mode 100644 index 0000000..dd31cbe --- /dev/null +++ b/public/static/sign.js @@ -0,0 +1 @@ +var _0x5ba4=["JS_MD5_NO_NODE_JS","JS_MD5_NO_ARRAY_BUFFER","92430HIMTvx","hash","Z6rn","versions","4vR_","finalize","1HrnRlh","object","appSecret not found","[object Array]","md5","replace","postAndJSON","start","&wsTime=","bytes","jhkSign","base64","map","videoUrl is required","appKey is required","first","189793SCUbFR","buffer8","sort","charCodeAt","lastByteIndex","5BWn","crypto","split","Chin","prototype","isView","429974UbhOoM","KCak","p+SM","function","136214xFSGLk","toString","appKey not found","join","update","string","Cent","concat","buffer","GxY4","keys","indexOf","erWs","length","exports","1QevvPD","appKey","152369giaOuq","isArray","input is invalid type","finalized","createHash","72542QCPmwL","iWxj","myVidaa","JDh5","hBytes","undefined","keyF","create","265249XKNHRl","stringify","hex","wsSecret=","blocks","constructor","hashed","ikRF","digest","Buffer","array","MORZ","arrayBuffer","call","auQg","0123456789abcdef","JS_MD5_NO_COMMON_JS"],_0x1bdb=function(e,_){return _0x5ba4[e-=424]};(function(_){for(var e=_0x1bdb;;)try{if(230907===parseInt(e(486))+-parseInt(e(437))+parseInt(e(459))+-parseInt(e(433))*-parseInt(e(452))+parseInt(e(508))+-parseInt(e(454))+-parseInt(e(467))*parseInt(e(492)))break;_.push(_.shift())}catch(e){_.push(_.shift())}})(_0x5ba4),function(e,_){var t=_0x1bdb;typeof exports===t(493)&&typeof module!==t(464)?module[t(451)]=_():typeof define===t(436)&&define.amd?define(_):(e=typeof globalThis!==t(464)?globalThis:e||self)[t(502)]=_()}(this,function(){"use strict";var _0x49e9df=_0x1bdb,_0x501dde=typeof globalThis!==_0x49e9df(464)?globalThis:typeof window!==_0x49e9df(464)?window:typeof global!==_0x49e9df(464)?global:typeof self!==_0x49e9df(464)?self:{};function _0x48531b(e){var _={exports:{}};return e(_,_.exports),_.exports}var _0x3c76ae=_0x48531b(function(_0x2d8688){!function(){var _0x1bd91a=_0x1bdb,_0x1a8911=_0x1bd91a(456),_0x4776a7=typeof window===_0x1bd91a(493),_0x249827=_0x4776a7?window:{};_0x249827.JS_MD5_NO_WINDOW&&(_0x4776a7=!1);var _0x31a21d=!_0x4776a7&&"object"==typeof self,_0x58a317=!_0x249827[_0x1bd91a(484)]&&"object"==typeof process&&process[_0x1bd91a(489)]&&process[_0x1bd91a(489)].node;_0x58a317?_0x249827=_0x501dde:_0x31a21d&&(_0x249827=self);var _0x5e24df=!_0x249827[_0x1bd91a(483)]&&"object"===_0x1bd91a(493)&&_0x2d8688[_0x1bd91a(451)],_0x3f8da4=!_0x249827[_0x1bd91a(485)]&&typeof ArrayBuffer!==_0x1bd91a(464),_0x127529=_0x1bd91a(482)[_0x1bd91a(429)](""),_0x2ebab4=[128,32768,8388608,-2147483648],_0x5edd56=[0,8,16,24],_0x34c9f8=[_0x1bd91a(469),_0x1bd91a(477),_0x1bd91a(475),_0x1bd91a(445),_0x1bd91a(479),_0x1bd91a(503)],_0x1b74c2="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[_0x1bd91a(429)](""),_0x5e063e=[],_0x30ff00,_0x278477,_0x30ff00,_0x5e063e;_0x3f8da4&&(_0x278477=new ArrayBuffer(68),_0x30ff00=new Uint8Array(_0x278477),_0x5e063e=new Uint32Array(_0x278477)),!_0x249827[_0x1bd91a(484)]&&Array[_0x1bd91a(455)]||(Array[_0x1bd91a(455)]=function(e){var _=_0x1bd91a;return Object[_(431)][_(438)][_(480)](e)===_(495)}),!_0x3f8da4||!_0x249827.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer[_0x1bd91a(432)]||(ArrayBuffer[_0x1bd91a(432)]=function(e){var _=_0x1bd91a;return typeof e===_(493)&&e.buffer&&e[_(445)][_(472)]===ArrayBuffer});var _0xc927f8=function(t){return function(e){var _=_0x1bdb;return new _0x3863a8(!0)[_(441)](e)[t]()}},_0x406f6d=function(){var t=_0x1bd91a,r=_0xc927f8(t(469));_0x58a317&&(r=_0x59488a(r)),r.create=function(){return new _0x3863a8},r[t(441)]=function(e){var _=t;return r[_(466)]()[_(441)](e)};for(var e=0;e<_0x34c9f8.length;++e){var _=_0x34c9f8[e];r[_]=_0xc927f8(_)}return r},_0x59488a=function(_0x528379){var _0x48491f=eval("var _0x5b831e = _0x1bdb;require(_0x5b831e(428));"),_0x3c9ffa=eval("var _0x18667f = _0x1bdb;require('buffer')[_0x18667f(476)];"),_0x1e931c=function(e){var _=_0x1bdb;if("string"==typeof e)return _0x48491f[_(458)](_(496))[_(441)](e,"utf8")[_(475)](_(469));if(null==e)throw _0x1a8911;return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array[_(455)](e)||ArrayBuffer[_(432)](e)||e[_(472)]===_0x3c9ffa?_0x48491f.createHash("md5")[_(441)](new _0x3c9ffa(e))[_(475)](_(469)):_0x528379(e)};return _0x1e931c};function _0x3863a8(e){var _=_0x1bd91a;e?(_0x5e063e[0]=_0x5e063e[16]=_0x5e063e[1]=_0x5e063e[2]=_0x5e063e[3]=_0x5e063e[4]=_0x5e063e[5]=_0x5e063e[6]=_0x5e063e[7]=_0x5e063e[8]=_0x5e063e[9]=_0x5e063e[10]=_0x5e063e[11]=_0x5e063e[12]=_0x5e063e[13]=_0x5e063e[14]=_0x5e063e[15]=0,this[_(471)]=_0x5e063e,this[_(509)]=_0x30ff00):_0x3f8da4?(e=new ArrayBuffer(68),this.buffer8=new Uint8Array(e),this[_(471)]=new Uint32Array(e)):this[_(471)]=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=this.h1=this.h2=this.h3=this[_(499)]=this[_(501)]=this.hBytes=0,this.finalized=this[_(473)]=!1,this[_(507)]=!0}_0x3863a8[_0x1bd91a(431)][_0x1bd91a(441)]=function(e){var _=_0x1bd91a;if(!this[_(457)]){var t,r=typeof e;if(r!==_(442)){if(r!==_(493))throw _0x1a8911;if(null===e)throw _0x1a8911;if(_0x3f8da4&&e[_(472)]===ArrayBuffer)e=new Uint8Array(e);else if(!(Array[_(455)](e)||_0x3f8da4&&ArrayBuffer[_(432)](e)))throw _0x1a8911;t=!0}for(var x,a,i=0,f=e[_(450)],n=this[_(471)],s=this[_(509)];i>2]|=e[i]<<_0x5edd56[3&a++];else if(_0x3f8da4)for(a=this[_(499)];i>6:(x<55296||57344<=x?s[a++]=224|x>>12:(x=65536+((1023&x)<<10|1023&e[_(425)](++i)),s[a++]=240|x>>18,s[a++]=128|x>>12&63),s[a++]=128|x>>6&63),s[a++]=128|63&x);else for(a=this[_(499)];i>2]|=x<<_0x5edd56[3&a++]:(x<2048?n[a>>2]|=(192|x>>6)<<_0x5edd56[3&a++]:(x<55296||57344<=x?n[a>>2]|=(224|x>>12)<<_0x5edd56[3&a++]:(x=65536+((1023&x)<<10|1023&e[_(425)](++i)),n[a>>2]|=(240|x>>18)<<_0x5edd56[3&a++],n[a>>2]|=(128|x>>12&63)<<_0x5edd56[3&a++]),n[a>>2]|=(128|x>>6&63)<<_0x5edd56[3&a++]),n[a>>2]|=(128|63&x)<<_0x5edd56[3&a++]);this[_(426)]=a,this.bytes+=a-this[_(499)],64<=a?(this[_(499)]=a-64,this[_(487)](),this[_(473)]=!0):this[_(499)]=a}return 4294967295>2]|=_0x2ebab4[3&_],56<=_&&(this.hashed||this[t(487)](),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this[t(501)]<<3,e[15]=this[t(463)]<<3|this.bytes>>>29,this[t(487)]())},_0x3863a8.prototype[_0x1bd91a(487)]=function(){var e,_,t,r,x,a=this[_0x1bd91a(471)],i=(this.first?i=((e=((e=a[0]-680876937)<<7|e>>>25)-271733879<<0)^(_=((_=(-271733879^(t=((t=(-1732584194^2004318071&e)+a[1]-117830708)<<12|t>>>20)+e<<0)&(-271733879^e))+a[2]-1126478375)<<17|_>>>15)+t<<0)&(t^e))+a[3]-1316259209:(e=this.h0,i=this.h1,_=this.h2,i+=((e=((e+=((t=this.h3)^i&(_^t))+a[0]-680876936)<<7|e>>>25)+i<<0)^(_=((_+=(i^(t=((t+=(_^e&(i^_))+a[1]-389564586)<<12|t>>>20)+e<<0)&(e^i))+a[2]+606105819)<<17|_>>>15)+t<<0)&(t^e))+a[3]-1044525330),(i<<22|i>>>10)+_<<0);i=((i+=((e=((e+=(t^i&(_^t))+a[4]-176418897)<<7|e>>>25)+i<<0)^(_=((_+=(i^(t=((t+=(_^e&(i^_))+a[5]+1200080426)<<12|t>>>20)+e<<0)&(e^i))+a[6]-1473231341)<<17|_>>>15)+t<<0)&(t^e))+a[7]-45705983)<<22|i>>>10)+_<<0,i=((i+=((e=((e+=(t^i&(_^t))+a[8]+1770035416)<<7|e>>>25)+i<<0)^(_=((_+=(i^(t=((t+=(_^e&(i^_))+a[9]-1958414417)<<12|t>>>20)+e<<0)&(e^i))+a[10]-42063)<<17|_>>>15)+t<<0)&(t^e))+a[11]-1990404162)<<22|i>>>10)+_<<0,i=((i+=((e=((e+=(t^i&(_^t))+a[12]+1804603682)<<7|e>>>25)+i<<0)^(_=((_+=(i^(t=((t+=(_^e&(i^_))+a[13]-40341101)<<12|t>>>20)+e<<0)&(e^i))+a[14]-1502002290)<<17|_>>>15)+t<<0)&(t^e))+a[15]+1236535329)<<22|i>>>10)+_<<0,i=((i+=((t=((t+=(i^_&((e=((e+=(_^t&(i^_))+a[1]-165796510)<<5|e>>>27)+i<<0)^i))+a[6]-1069501632)<<9|t>>>23)+e<<0)^e&((_=((_+=(e^i&(t^e))+a[11]+643717713)<<14|_>>>18)+t<<0)^t))+a[0]-373897302)<<20|i>>>12)+_<<0,i=((i+=((t=((t+=(i^_&((e=((e+=(_^t&(i^_))+a[5]-701558691)<<5|e>>>27)+i<<0)^i))+a[10]+38016083)<<9|t>>>23)+e<<0)^e&((_=((_+=(e^i&(t^e))+a[15]-660478335)<<14|_>>>18)+t<<0)^t))+a[4]-405537848)<<20|i>>>12)+_<<0,i=((i+=((t=((t+=(i^_&((e=((e+=(_^t&(i^_))+a[9]+568446438)<<5|e>>>27)+i<<0)^i))+a[14]-1019803690)<<9|t>>>23)+e<<0)^e&((_=((_+=(e^i&(t^e))+a[3]-187363961)<<14|_>>>18)+t<<0)^t))+a[8]+1163531501)<<20|i>>>12)+_<<0,i=((i+=((t=((t+=(i^_&((e=((e+=(_^t&(i^_))+a[13]-1444681467)<<5|e>>>27)+i<<0)^i))+a[2]-51403784)<<9|t>>>23)+e<<0)^e&((_=((_+=(e^i&(t^e))+a[7]+1735328473)<<14|_>>>18)+t<<0)^t))+a[12]-1926607734)<<20|i>>>12)+_<<0,i=((i+=((x=(t=((t+=((r=i^_)^(e=((e+=(r^t)+a[5]-378558)<<4|e>>>28)+i<<0))+a[8]-2022574463)<<11|t>>>21)+e<<0)^e)^(_=((_+=(x^i)+a[11]+1839030562)<<16|_>>>16)+t<<0))+a[14]-35309556)<<23|i>>>9)+_<<0,i=((i+=((x=(t=((t+=((r=i^_)^(e=((e+=(r^t)+a[1]-1530992060)<<4|e>>>28)+i<<0))+a[4]+1272893353)<<11|t>>>21)+e<<0)^e)^(_=((_+=(x^i)+a[7]-155497632)<<16|_>>>16)+t<<0))+a[10]-1094730640)<<23|i>>>9)+_<<0,i=((i+=((x=(t=((t+=((r=i^_)^(e=((e+=(r^t)+a[13]+681279174)<<4|e>>>28)+i<<0))+a[0]-358537222)<<11|t>>>21)+e<<0)^e)^(_=((_+=(x^i)+a[3]-722521979)<<16|_>>>16)+t<<0))+a[6]+76029189)<<23|i>>>9)+_<<0,i=((i+=((x=(t=((t+=((r=i^_)^(e=((e+=(r^t)+a[9]-640364487)<<4|e>>>28)+i<<0))+a[12]-421815835)<<11|t>>>21)+e<<0)^e)^(_=((_+=(x^i)+a[15]+530742520)<<16|_>>>16)+t<<0))+a[2]-995338651)<<23|i>>>9)+_<<0,i=((i+=((t=((t+=(i^((e=((e+=(_^(i|~t))+a[0]-198630844)<<6|e>>>26)+i<<0)|~_))+a[7]+1126891415)<<10|t>>>22)+e<<0)^((_=((_+=(e^(t|~i))+a[14]-1416354905)<<15|_>>>17)+t<<0)|~e))+a[5]-57434055)<<21|i>>>11)+_<<0,i=((i+=((t=((t+=(i^((e=((e+=(_^(i|~t))+a[12]+1700485571)<<6|e>>>26)+i<<0)|~_))+a[3]-1894986606)<<10|t>>>22)+e<<0)^((_=((_+=(e^(t|~i))+a[10]-1051523)<<15|_>>>17)+t<<0)|~e))+a[1]-2054922799)<<21|i>>>11)+_<<0,i=((i+=((t=((t+=(i^((e=((e+=(_^(i|~t))+a[8]+1873313359)<<6|e>>>26)+i<<0)|~_))+a[15]-30611744)<<10|t>>>22)+e<<0)^((_=((_+=(e^(t|~i))+a[6]-1560198380)<<15|_>>>17)+t<<0)|~e))+a[13]+1309151649)<<21|i>>>11)+_<<0,i=((i+=((t=((t+=(i^((e=((e+=(_^(i|~t))+a[4]-145523070)<<6|e>>>26)+i<<0)|~_))+a[11]-1120210379)<<10|t>>>22)+e<<0)^((_=((_+=(e^(t|~i))+a[2]+718787259)<<15|_>>>17)+t<<0)|~e))+a[9]-343485551)<<21|i>>>11)+_<<0,this.first?(this.h0=e+1732584193<<0,this.h1=i-271733879<<0,this.h2=_-1732584194<<0,this.h3=t+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+i<<0,this.h2=this.h2+_<<0,this.h3=this.h3+t<<0)},_0x3863a8.prototype.hex=function(){this[_0x1bd91a(491)]();var e=this.h0,_=this.h1,t=this.h2,r=this.h3;return _0x127529[e>>4&15]+_0x127529[15&e]+_0x127529[e>>12&15]+_0x127529[e>>8&15]+_0x127529[e>>20&15]+_0x127529[e>>16&15]+_0x127529[e>>28&15]+_0x127529[e>>24&15]+_0x127529[_>>4&15]+_0x127529[15&_]+_0x127529[_>>12&15]+_0x127529[_>>8&15]+_0x127529[_>>20&15]+_0x127529[_>>16&15]+_0x127529[_>>28&15]+_0x127529[_>>24&15]+_0x127529[t>>4&15]+_0x127529[15&t]+_0x127529[t>>12&15]+_0x127529[t>>8&15]+_0x127529[t>>20&15]+_0x127529[t>>16&15]+_0x127529[t>>28&15]+_0x127529[t>>24&15]+_0x127529[r>>4&15]+_0x127529[15&r]+_0x127529[r>>12&15]+_0x127529[r>>8&15]+_0x127529[r>>20&15]+_0x127529[r>>16&15]+_0x127529[r>>28&15]+_0x127529[r>>24&15]},_0x3863a8[_0x1bd91a(431)][_0x1bd91a(438)]=_0x3863a8[_0x1bd91a(431)][_0x1bd91a(469)],_0x3863a8[_0x1bd91a(431)][_0x1bd91a(475)]=function(){this[_0x1bd91a(491)]();var e=this.h0,_=this.h1,t=this.h2,r=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&_,_>>8&255,_>>16&255,_>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255]},_0x3863a8[_0x1bd91a(431)][_0x1bd91a(477)]=_0x3863a8[_0x1bd91a(431)][_0x1bd91a(475)],_0x3863a8[_0x1bd91a(431)][_0x1bd91a(479)]=function(){this[_0x1bd91a(491)]();var e=new ArrayBuffer(16),_=new Uint32Array(e);return _[0]=this.h0,_[1]=this.h1,_[2]=this.h2,_[3]=this.h3,e},_0x3863a8[_0x1bd91a(431)][_0x1bd91a(445)]=_0x3863a8[_0x1bd91a(431)].arrayBuffer,_0x3863a8[_0x1bd91a(431)][_0x1bd91a(503)]=function(){for(var e,_,t,r="",x=this.array(),a=0;a<15;)e=x[a++],_=x[a++],t=x[a++],r+=_0x1b74c2[e>>>2]+_0x1b74c2[63&(e<<4|_>>>4)]+_0x1b74c2[63&(_<<2|t>>>6)]+_0x1b74c2[63&t];return e=x[a],r+=_0x1b74c2[e>>>2]+_0x1b74c2[e<<4&63]+"=="};var _0x336e66=_0x406f6d();_0x5e24df?_0x2d8688[_0x1bd91a(451)]=_0x336e66:_0x249827[_0x1bd91a(496)]=_0x336e66}()});function _0x25920c(e){var _=_0x49e9df;switch(e){case _(461):return[_(434),_(481),_(427),_(462),"v65Q","bfCL","7bRF",_(474)].join("");case"commonweb":return[_(478),"Rbku",_(460),_(435),_(490),_(446),"pZxL",_(488)][_(440)]("");case"anti-leech-vr":return[_(430),"aNet",_(443),_(449),_(465),"orJu","HaoK","an"][_(440)]("");default:return""}}function _0x47e337(e,_){var t=_0x49e9df;if(!e||typeof e===t(493)&&!Object[t(447)](e)[t(450)])return"";if(null==_||!_[t(453)])throw new Error("appKey is required");var r=_0x25920c(_[t(453)]);if(!r)throw new Error(t(494));r=(!(null==_||!_[t(498)])?_0x22518d:_0x2a6f2e)(e,r);return _0x3c76ae.base64(r)}function _0x2a6f2e(r,e){var _,x=_0x49e9df;return(typeof r===x(442)?r:((_=Object[x(447)](r)[x(504)](function(e){var _=x,t=r[e];return""===t||null==t?"":(typeof t===_(493)&&(t=JSON[_(468)](t)),""[_(444)](e,"=").concat(t))}).filter(function(e){return""!==e}))[x(424)](function(e,_){return _.el-menu-item:not(.is-disabled):focus,.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover,.el-menu--horizontal>.el-submenu .el-submenu__title:hover{background-color:#fff}.el-menu::after,.el-menu::before{display:table;content:""}.el-breadcrumb__item:last-child .el-breadcrumb__separator,.el-menu--collapse>.el-menu-item .el-submenu__icon-arrow,.el-menu--collapse>.el-submenu>.el-submenu__title .el-submenu__icon-arrow{display:none}.el-menu::after{clear:both}.el-menu.el-menu--horizontal{border-bottom:solid 1px #e6e6e6}.el-menu--horizontal{border-right:none}.el-menu--horizontal>.el-menu-item{float:left;height:60px;line-height:60px;margin:0;border-bottom:2px solid transparent;color:#909399}.el-menu--horizontal>.el-menu-item a,.el-menu--horizontal>.el-menu-item a:hover{color:inherit}.el-menu--horizontal>.el-submenu{float:left}.el-menu--horizontal>.el-submenu:focus,.el-menu--horizontal>.el-submenu:hover{outline:0}.el-menu--horizontal>.el-submenu:focus .el-submenu__title,.el-menu--horizontal>.el-submenu:hover .el-submenu__title{color:#303133}.el-menu--horizontal>.el-submenu.is-active .el-submenu__title{border-bottom:2px solid #409EFF;color:#303133}.el-menu--horizontal>.el-submenu .el-submenu__title{height:60px;line-height:60px;border-bottom:2px solid transparent;color:#909399}.el-menu--horizontal>.el-submenu .el-submenu__icon-arrow{position:static;vertical-align:middle;margin-left:8px;margin-top:-3px}.el-menu--collapse .el-submenu,.el-menu-item{position:relative}.el-menu--horizontal .el-menu .el-menu-item,.el-menu--horizontal .el-menu .el-submenu__title{background-color:#FFF;float:none;height:36px;line-height:36px;padding:0 10px;color:#909399}.el-menu--horizontal .el-menu .el-menu-item.is-active,.el-menu--horizontal .el-menu .el-submenu.is-active>.el-submenu__title{color:#303133}.el-menu--horizontal .el-menu-item:not(.is-disabled):focus,.el-menu--horizontal .el-menu-item:not(.is-disabled):hover{outline:0;color:#303133}.el-menu--horizontal>.el-menu-item.is-active{border-bottom:2px solid #409EFF;color:#303133}.el-menu--collapse{width:64px}.el-menu--collapse>.el-menu-item [class^=el-icon-],.el-menu--collapse>.el-submenu>.el-submenu__title [class^=el-icon-]{margin:0;vertical-align:middle;width:24px;text-align:center}.el-menu--collapse>.el-menu-item span,.el-menu--collapse>.el-submenu>.el-submenu__title span{height:0;width:0;overflow:hidden;visibility:hidden;display:inline-block}.el-menu-item,.el-submenu__title{height:56px;line-height:56px;list-style:none}.el-menu--collapse>.el-menu-item.is-active i{color:inherit}.el-menu--collapse .el-menu .el-submenu{min-width:200px}.el-menu--collapse .el-submenu .el-menu{position:absolute;margin-left:5px;top:0;left:100%;z-index:10;border:1px solid #E4E7ED;border-radius:2px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-menu--collapse .el-submenu.is-opened>.el-submenu__title .el-submenu__icon-arrow{-webkit-transform:none;transform:none}.el-menu--popup{z-index:100;min-width:200px;border:none;padding:5px 0;border-radius:2px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-menu--popup-bottom-start{margin-top:5px}.el-menu--popup-right-start{margin-left:5px;margin-right:5px}.el-menu-item{color:#303133;-webkit-transition:border-color .3s,background-color .3s,color .3s;transition:border-color .3s,background-color .3s,color .3s;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap}.el-radio-button__inner,.el-submenu__title{-webkit-box-sizing:border-box;position:relative;white-space:nowrap}.el-menu-item *{vertical-align:middle}.el-menu-item i{color:#909399}.el-menu-item:focus,.el-menu-item:hover{outline:0;background-color:#ecf5ff}.el-menu-item.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-menu-item [class^=el-icon-]{margin-right:5px;width:24px;text-align:center;font-size:18px;vertical-align:middle}.el-menu-item.is-active{color:#409EFF}.el-menu-item.is-active i{color:inherit}.el-submenu{list-style:none;margin:0;padding-left:0}.el-submenu__title{font-size:14px;color:#303133;padding:0 20px;cursor:pointer;-webkit-transition:border-color .3s,background-color .3s,color .3s;transition:border-color .3s,background-color .3s,color .3s;box-sizing:border-box}.el-submenu__title *{vertical-align:middle}.el-submenu__title i{color:#909399}.el-submenu__title:focus,.el-submenu__title:hover{outline:0;background-color:#ecf5ff}.el-submenu__title.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-submenu__title:hover{background-color:#ecf5ff}.el-submenu .el-menu{border:none}.el-submenu .el-menu-item{height:50px;line-height:50px;padding:0 45px;min-width:200px}.el-submenu__icon-arrow{position:absolute;top:50%;right:20px;margin-top:-7px;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;font-size:12px}.el-submenu.is-active .el-submenu__title{border-bottom-color:#409EFF}.el-submenu.is-opened>.el-submenu__title .el-submenu__icon-arrow{-webkit-transform:rotateZ(180deg);transform:rotateZ(180deg)}.el-submenu.is-disabled .el-menu-item,.el-submenu.is-disabled .el-submenu__title{opacity:.25;cursor:not-allowed;background:0 0!important}.el-submenu [class^=el-icon-]{vertical-align:middle;margin-right:5px;width:24px;text-align:center;font-size:18px}.el-menu-item-group>ul{padding:0}.el-menu-item-group__title{padding:7px 0 7px 20px;line-height:normal;font-size:12px;color:#909399}.el-radio-button__inner,.el-radio-group{display:inline-block;line-height:1;vertical-align:middle}.horizontal-collapse-transition .el-submenu__title .el-submenu__icon-arrow{-webkit-transition:.2s;transition:.2s;opacity:0}.el-radio-group{font-size:0}.el-radio-button{position:relative;display:inline-block;outline:0}.el-radio-button__inner{background:#FFF;border:1px solid #DCDFE6;font-weight:500;border-left:0;color:#606266;-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;cursor:pointer;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);padding:12px 20px;font-size:14px;border-radius:0}.el-radio-button__inner.is-round{padding:12px 20px}.el-radio-button__inner:hover{color:#409EFF}.el-radio-button__inner [class*=el-icon-]{line-height:.9}.el-radio-button__inner [class*=el-icon-]+span{margin-left:5px}.el-radio-button:first-child .el-radio-button__inner{border-left:1px solid #DCDFE6;border-radius:4px 0 0 4px;-webkit-box-shadow:none!important;box-shadow:none!important}.el-radio-button__orig-radio{opacity:0;outline:0;position:absolute;z-index:-1}.el-radio-button__orig-radio:checked+.el-radio-button__inner{color:#FFF;background-color:#409EFF;border-color:#409EFF;-webkit-box-shadow:-1px 0 0 0 #409EFF;box-shadow:-1px 0 0 0 #409EFF}.el-radio-button__orig-radio:disabled+.el-radio-button__inner{color:#C0C4CC;cursor:not-allowed;background-image:none;background-color:#FFF;border-color:#EBEEF5;-webkit-box-shadow:none;box-shadow:none}.el-radio-button__orig-radio:disabled:checked+.el-radio-button__inner{background-color:#F2F6FC}.el-radio-button:last-child .el-radio-button__inner{border-radius:0 4px 4px 0}.el-radio-button:first-child:last-child .el-radio-button__inner{border-radius:4px}.el-radio-button--medium .el-radio-button__inner{padding:10px 20px;font-size:14px;border-radius:0}.el-radio-button--medium .el-radio-button__inner.is-round{padding:10px 20px}.el-radio-button--small .el-radio-button__inner{padding:9px 15px;font-size:12px;border-radius:0}.el-radio-button--small .el-radio-button__inner.is-round{padding:9px 15px}.el-radio-button--mini .el-radio-button__inner{padding:7px 15px;font-size:12px;border-radius:0}.el-radio-button--mini .el-radio-button__inner.is-round{padding:7px 15px}.el-radio-button:focus:not(.is-focus):not(:active):not(.is-disabled){-webkit-box-shadow:0 0 2px 2px #409EFF;box-shadow:0 0 2px 2px #409EFF}.el-picker-panel,.el-popover,.el-select-dropdown,.el-table-filter,.el-time-panel{-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-switch{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;position:relative;font-size:14px;line-height:20px;height:20px;vertical-align:middle}.el-switch__core,.el-switch__label{display:inline-block;cursor:pointer}.el-switch.is-disabled .el-switch__core,.el-switch.is-disabled .el-switch__label{cursor:not-allowed}.el-switch__label{-webkit-transition:.2s;transition:.2s;height:20px;font-size:14px;font-weight:500;vertical-align:middle;color:#303133}.el-switch__label.is-active{color:#409EFF}.el-switch__label--left{margin-right:10px}.el-switch__label--right{margin-left:10px}.el-switch__label *{line-height:1;font-size:14px;display:inline-block}.el-switch__input{position:absolute;width:0;height:0;opacity:0;margin:0}.el-switch__core{margin:0;position:relative;width:40px;height:20px;border:1px solid #DCDFE6;outline:0;border-radius:10px;-webkit-box-sizing:border-box;box-sizing:border-box;background:#DCDFE6;-webkit-transition:border-color .3s,background-color .3s;transition:border-color .3s,background-color .3s;vertical-align:middle}.el-input__prefix,.el-input__suffix{-webkit-transition:all .3s;color:#C0C4CC}.el-switch__core:after{content:"";position:absolute;top:1px;left:1px;border-radius:100%;-webkit-transition:all .3s;transition:all .3s;width:16px;height:16px;background-color:#FFF}.el-switch.is-checked .el-switch__core{border-color:#409EFF;background-color:#409EFF}.el-switch.is-checked .el-switch__core::after{left:100%;margin-left:-17px}.el-switch.is-disabled{opacity:.6}.el-switch--wide .el-switch__label.el-switch__label--left span{left:10px}.el-switch--wide .el-switch__label.el-switch__label--right span{right:10px}.el-switch .label-fade-enter,.el-switch .label-fade-leave-active{opacity:0}.el-select-dropdown{position:absolute;z-index:1001;border:1px solid #E4E7ED;border-radius:4px;background-color:#FFF;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;margin:5px 0}.el-select-dropdown.is-multiple .el-select-dropdown__item{padding-right:40px}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected{color:#409EFF;background-color:#FFF}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover{background-color:#F5F7FA}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected::after{position:absolute;right:20px;font-family:element-icons;content:"\e6da";font-size:12px;font-weight:700;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:#999;font-size:14px}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;padding:6px 0;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-select-dropdown__item{font-size:14px;padding:0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#606266;height:34px;line-height:34px;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer}.el-select-dropdown__item.is-disabled{color:#C0C4CC;cursor:not-allowed}.el-select-dropdown__item.is-disabled:hover{background-color:#FFF}.el-select-dropdown__item.hover,.el-select-dropdown__item:hover{background-color:#F5F7FA}.el-select-dropdown__item.selected{color:#409EFF;font-weight:700}.el-select-group{margin:0;padding:0}.el-select-group__wrap{position:relative;list-style:none;margin:0;padding:0}.el-select-group__wrap:not(:last-of-type){padding-bottom:24px}.el-select-group__wrap:not(:last-of-type)::after{content:'';position:absolute;display:block;left:20px;right:20px;bottom:12px;height:1px;background:#E4E7ED}.el-select-group__title{padding-left:20px;font-size:12px;color:#909399;line-height:30px}.el-select-group .el-select-dropdown__item{padding-left:20px}.el-select{display:inline-block;position:relative}.el-select .el-select__tags>span{display:contents}.el-select:hover .el-input__inner{border-color:#C0C4CC}.el-select .el-input__inner{cursor:pointer;padding-right:35px}.el-select .el-input__inner:focus{border-color:#409EFF}.el-select .el-input .el-select__caret{color:#C0C4CC;font-size:14px;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;-webkit-transform:rotateZ(180deg);transform:rotateZ(180deg);cursor:pointer}.el-select .el-input .el-select__caret.is-reverse{-webkit-transform:rotateZ(0);transform:rotateZ(0)}.el-select .el-input .el-select__caret.is-show-close{font-size:14px;text-align:center;-webkit-transform:rotateZ(180deg);transform:rotateZ(180deg);border-radius:100%;color:#C0C4CC;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1)}.el-select .el-input .el-select__caret.is-show-close:hover{color:#909399}.el-select .el-input.is-disabled .el-input__inner{cursor:not-allowed}.el-select .el-input.is-disabled .el-input__inner:hover{border-color:#E4E7ED}.el-range-editor.is-active,.el-range-editor.is-active:hover,.el-select .el-input.is-focus .el-input__inner{border-color:#409EFF}.el-select>.el-input{display:block}.el-select__input{border:none;outline:0;padding:0;margin-left:15px;color:#666;font-size:14px;-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px;background-color:transparent}.el-select__input.is-mini{height:14px}.el-select__close{cursor:pointer;position:absolute;top:8px;z-index:1000;right:25px;color:#C0C4CC;line-height:18px;font-size:14px}.el-select__close:hover{color:#909399}.el-select__tags{position:absolute;line-height:normal;white-space:normal;z-index:1;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap}.el-select__tags-text{overflow:hidden;text-overflow:ellipsis}.el-select .el-tag{-webkit-box-sizing:border-box;box-sizing:border-box;border-color:transparent;margin:2px 0 2px 6px;background-color:#f0f2f5;display:-webkit-box;display:-ms-flexbox;display:flex;max-width:100%;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-select .el-tag__close.el-icon-close{background-color:#C0C4CC;top:0;color:#FFF;-ms-flex-negative:0;flex-shrink:0}.el-select .el-tag__close.el-icon-close:hover{background-color:#909399}.el-table,.el-table__expanded-cell{background-color:#FFF}.el-select .el-tag__close.el-icon-close::before{display:block;-webkit-transform:translate(0,.5px);transform:translate(0,.5px)}.el-table{position:relative;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-flex:1;-ms-flex:1;flex:1;width:100%;max-width:100%;font-size:14px;color:#606266}.el-table__empty-block{min-height:60px;text-align:center;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-table__empty-text{line-height:60px;width:50%;color:#909399}.el-table__expand-column .cell{padding:0;text-align:center}.el-table__expand-icon{position:relative;cursor:pointer;color:#666;font-size:12px;-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out;height:20px}.el-table__expand-icon--expanded{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.el-table__expand-icon>.el-icon{position:absolute;left:50%;top:50%;margin-left:-5px;margin-top:-5px}.el-table__expanded-cell[class*=cell]{padding:20px 50px}.el-table__expanded-cell:hover{background-color:transparent!important}.el-table__placeholder{display:inline-block;width:20px}.el-table__append-wrapper{overflow:hidden}.el-table--fit{border-right:0;border-bottom:0}.el-table--fit .el-table__cell.gutter{border-right-width:1px}.el-table--scrollable-x .el-table__body-wrapper{overflow-x:auto}.el-table--scrollable-y .el-table__body-wrapper{overflow-y:auto}.el-table thead{color:#909399;font-weight:500}.el-table thead.is-group th.el-table__cell{background:#F5F7FA}.el-table .el-table__cell{padding:12px 0;min-width:0;-webkit-box-sizing:border-box;box-sizing:border-box;text-overflow:ellipsis;vertical-align:middle;position:relative;text-align:left}.el-table .el-table__cell.is-center{text-align:center}.el-table .el-table__cell.is-right{text-align:right}.el-table .el-table__cell.gutter{width:15px;border-right-width:0;border-bottom-width:0;padding:0}.el-table .el-table__cell.is-hidden>*{visibility:hidden}.el-table--medium .el-table__cell{padding:10px 0}.el-table--small{font-size:12px}.el-table--small .el-table__cell{padding:8px 0}.el-table--mini{font-size:12px}.el-table--mini .el-table__cell{padding:6px 0}.el-table tr{background-color:#FFF}.el-table tr input[type=checkbox]{margin:0}.el-table td.el-table__cell,.el-table th.el-table__cell.is-leaf{border-bottom:1px solid #EBEEF5}.el-table th.el-table__cell.is-sortable{cursor:pointer}.el-table th.el-table__cell{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#FFF}.el-table th.el-table__cell>.cell{display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;vertical-align:middle;padding-left:10px;padding-right:10px;width:100%}.el-table th.el-table__cell>.cell.highlight{color:#409EFF}.el-table th.el-table__cell.required>div::before{display:inline-block;content:"";width:8px;height:8px;border-radius:50%;background:#ff4d51;margin-right:5px;vertical-align:middle}.el-table td.el-table__cell div{-webkit-box-sizing:border-box;box-sizing:border-box}.el-date-table td,.el-table .cell,.el-table-filter{-webkit-box-sizing:border-box}.el-table td.el-table__cell.gutter{width:0}.el-table .cell{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;line-height:23px;padding-left:10px;padding-right:10px}.el-table .cell.el-tooltip{white-space:nowrap;min-width:50px}.el-table--border,.el-table--group{border:1px solid #EBEEF5}.el-table--border::after,.el-table--group::after,.el-table::before{content:'';position:absolute;background-color:#EBEEF5;z-index:1}.el-table--border::after,.el-table--group::after{top:0;right:0;width:1px;height:100%}.el-table::before{left:0;bottom:0;width:100%;height:1px}.el-table--border{border-right:none;border-bottom:none}.el-table--border.el-loading-parent--relative{border-color:transparent}.el-table--border .el-table__cell,.el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed{border-right:1px solid #EBEEF5}.el-table--border .el-table__cell:first-child .cell{padding-left:10px}.el-table--border th.el-table__cell.gutter:last-of-type{border-bottom:1px solid #EBEEF5;border-bottom-width:1px}.el-table--border th.el-table__cell,.el-table__fixed-right-patch{border-bottom:1px solid #EBEEF5}.el-table--hidden{visibility:hidden}.el-table__fixed,.el-table__fixed-right{position:absolute;top:0;left:0;overflow-x:hidden;overflow-y:hidden;-webkit-box-shadow:0 0 10px rgba(0,0,0,.12);box-shadow:0 0 10px rgba(0,0,0,.12)}.el-table__fixed-right::before,.el-table__fixed::before{content:'';position:absolute;left:0;bottom:0;width:100%;height:1px;background-color:#EBEEF5;z-index:4}.el-table__fixed-right-patch{position:absolute;top:-1px;right:0;background-color:#FFF}.el-table__fixed-right{top:0;left:auto;right:0}.el-table__fixed-right .el-table__fixed-body-wrapper,.el-table__fixed-right .el-table__fixed-footer-wrapper,.el-table__fixed-right .el-table__fixed-header-wrapper{left:auto;right:0}.el-table__fixed-header-wrapper{position:absolute;left:0;top:0;z-index:3}.el-table__fixed-footer-wrapper{position:absolute;left:0;bottom:0;z-index:3}.el-table__fixed-footer-wrapper tbody td.el-table__cell{border-top:1px solid #EBEEF5;background-color:#F5F7FA;color:#606266}.el-table__fixed-body-wrapper{position:absolute;left:0;top:37px;overflow:hidden;z-index:3}.el-table__body-wrapper,.el-table__footer-wrapper,.el-table__header-wrapper{width:100%}.el-table__footer-wrapper{margin-top:-1px}.el-table__footer-wrapper td.el-table__cell{border-top:1px solid #EBEEF5}.el-table__body,.el-table__footer,.el-table__header{table-layout:fixed;border-collapse:separate}.el-table__footer-wrapper,.el-table__header-wrapper{overflow:hidden}.el-table__footer-wrapper tbody td.el-table__cell,.el-table__header-wrapper tbody td.el-table__cell{background-color:#F5F7FA;color:#606266}.el-table__body-wrapper{overflow:hidden;position:relative}.el-table__body-wrapper.is-scrolling-left~.el-table__fixed,.el-table__body-wrapper.is-scrolling-none~.el-table__fixed,.el-table__body-wrapper.is-scrolling-none~.el-table__fixed-right,.el-table__body-wrapper.is-scrolling-right~.el-table__fixed-right{-webkit-box-shadow:none;box-shadow:none}.el-table__body-wrapper .el-table--border.is-scrolling-right~.el-table__fixed-right{border-left:1px solid #EBEEF5}.el-table .caret-wrapper{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:34px;width:24px;vertical-align:middle;cursor:pointer;overflow:initial;position:relative}.el-table .sort-caret{width:0;height:0;border:5px solid transparent;position:absolute;left:7px}.el-table .sort-caret.ascending{border-bottom-color:#C0C4CC;top:5px}.el-table .sort-caret.descending{border-top-color:#C0C4CC;bottom:7px}.el-table .ascending .sort-caret.ascending{border-bottom-color:#409EFF}.el-table .descending .sort-caret.descending{border-top-color:#409EFF}.el-table .hidden-columns{visibility:hidden;position:absolute;z-index:-1}.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell{background:#FAFAFA}.el-table--striped .el-table__body tr.el-table__row--striped.current-row td.el-table__cell,.el-table--striped .el-table__body tr.el-table__row--striped.selection-row td.el-table__cell{background-color:#ecf5ff}.el-table__body tr.hover-row.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped.selection-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped>td.el-table__cell,.el-table__body tr.hover-row.selection-row>td.el-table__cell,.el-table__body tr.hover-row>td.el-table__cell{background-color:#F5F7FA}.el-table__body tr.current-row>td.el-table__cell,.el-table__body tr.selection-row>td.el-table__cell{background-color:#ecf5ff}.el-table__column-resize-proxy{position:absolute;left:200px;top:0;bottom:0;width:0;border-left:1px solid #EBEEF5;z-index:10}.el-table__column-filter-trigger{display:inline-block;line-height:34px;cursor:pointer}.el-table__column-filter-trigger i{color:#909399;font-size:12px;-webkit-transform:scale(.75);transform:scale(.75)}.el-table--enable-row-transition .el-table__body td.el-table__cell{-webkit-transition:background-color .25s ease;transition:background-color .25s ease}.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{background-color:#F5F7FA}.el-table--fluid-height .el-table__fixed,.el-table--fluid-height .el-table__fixed-right{bottom:0;overflow:hidden}.el-table [class*=el-table__row--level] .el-table__expand-icon{display:inline-block;width:20px;line-height:20px;height:20px;text-align:center;margin-right:3px}.el-table-column--selection .cell{padding-left:14px;padding-right:14px}.el-table-filter{border:1px solid #EBEEF5;border-radius:2px;background-color:#FFF;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-sizing:border-box;margin:2px 0}.el-table-filter__list{padding:5px 0;margin:0;list-style:none;min-width:100px}.el-table-filter__list-item{line-height:36px;padding:0 10px;cursor:pointer;font-size:14px}.el-table-filter__list-item:hover{background-color:#ecf5ff;color:#66b1ff}.el-table-filter__list-item.is-active{background-color:#409EFF;color:#FFF}.el-table-filter__content{min-width:100px}.el-table-filter__bottom{border-top:1px solid #EBEEF5;padding:8px}.el-table-filter__bottom button{background:0 0;border:none;color:#606266;cursor:pointer;font-size:13px;padding:0 3px}.el-date-table td.in-range div,.el-date-table td.in-range div:hover,.el-date-table.is-week-mode .el-date-table__row.current div,.el-date-table.is-week-mode .el-date-table__row:hover div{background-color:#F2F6FC}.el-table-filter__bottom button:hover{color:#409EFF}.el-table-filter__bottom button:focus{outline:0}.el-table-filter__bottom button.is-disabled{color:#C0C4CC;cursor:not-allowed}.el-table-filter__wrap{max-height:280px}.el-table-filter__checkbox-group{padding:10px}.el-table-filter__checkbox-group label.el-checkbox{display:block;margin-right:5px;margin-bottom:8px;margin-left:5px}.el-table-filter__checkbox-group .el-checkbox:last-child{margin-bottom:0}.el-date-table{font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-date-table.is-week-mode .el-date-table__row:hover td.available:hover{color:#606266}.el-date-table.is-week-mode .el-date-table__row:hover td:first-child div{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table.is-week-mode .el-date-table__row:hover td:last-child div{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table td{width:32px;height:30px;padding:4px 0;box-sizing:border-box;text-align:center;cursor:pointer;position:relative}.el-date-table td div{height:30px;padding:3px 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-date-table td span{width:24px;height:24px;display:block;margin:0 auto;line-height:24px;position:absolute;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);border-radius:50%}.el-date-table td.next-month,.el-date-table td.prev-month{color:#C0C4CC}.el-date-table td.today{position:relative}.el-date-table td.today span{color:#409EFF;font-weight:700}.el-date-table td.today.end-date span,.el-date-table td.today.start-date span{color:#FFF}.el-date-table td.available:hover{color:#409EFF}.el-date-table td.current:not(.disabled) span{color:#FFF;background-color:#409EFF}.el-date-table td.end-date div,.el-date-table td.start-date div{color:#FFF}.el-date-table td.end-date span,.el-date-table td.start-date span{background-color:#409EFF}.el-date-table td.start-date div{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table td.end-date div{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table td.disabled div{background-color:#F5F7FA;opacity:1;cursor:not-allowed;color:#C0C4CC}.el-date-table td.selected div{margin-left:5px;margin-right:5px;background-color:#F2F6FC;border-radius:15px}.el-date-table td.selected div:hover{background-color:#F2F6FC}.el-date-table td.selected span{background-color:#409EFF;color:#FFF;border-radius:15px}.el-date-table td.week{font-size:80%;color:#606266}.el-month-table,.el-year-table{font-size:12px;border-collapse:collapse}.el-date-table th{padding:5px;color:#606266;font-weight:400;border-bottom:solid 1px #EBEEF5}.el-month-table{margin:-1px}.el-month-table td{text-align:center;padding:8px 0;cursor:pointer}.el-month-table td div{height:48px;padding:6px 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-month-table td.today .cell{color:#409EFF;font-weight:700}.el-month-table td.today.end-date .cell,.el-month-table td.today.start-date .cell{color:#FFF}.el-month-table td.disabled .cell{background-color:#F5F7FA;cursor:not-allowed;color:#C0C4CC}.el-month-table td.disabled .cell:hover{color:#C0C4CC}.el-month-table td .cell{width:60px;height:36px;display:block;line-height:36px;color:#606266;margin:0 auto;border-radius:18px}.el-month-table td .cell:hover{color:#409EFF}.el-month-table td.in-range div,.el-month-table td.in-range div:hover{background-color:#F2F6FC}.el-month-table td.end-date div,.el-month-table td.start-date div{color:#FFF}.el-month-table td.end-date .cell,.el-month-table td.start-date .cell{color:#FFF;background-color:#409EFF}.el-month-table td.start-date div{border-top-left-radius:24px;border-bottom-left-radius:24px}.el-month-table td.end-date div{border-top-right-radius:24px;border-bottom-right-radius:24px}.el-month-table td.current:not(.disabled) .cell{color:#409EFF}.el-year-table{margin:-1px}.el-year-table .el-icon{color:#303133}.el-year-table td{text-align:center;padding:20px 3px;cursor:pointer}.el-year-table td.today .cell{color:#409EFF;font-weight:700}.el-year-table td.disabled .cell{background-color:#F5F7FA;cursor:not-allowed;color:#C0C4CC}.el-year-table td.disabled .cell:hover{color:#C0C4CC}.el-year-table td .cell{width:48px;height:32px;display:block;line-height:32px;color:#606266;margin:0 auto}.el-year-table td .cell:hover,.el-year-table td.current:not(.disabled) .cell{color:#409EFF}.el-date-range-picker{width:646px}.el-date-range-picker.has-sidebar{width:756px}.el-date-range-picker table{table-layout:fixed;width:100%}.el-date-range-picker .el-picker-panel__body{min-width:513px}.el-date-range-picker .el-picker-panel__content{margin:0}.el-date-range-picker__header{position:relative;text-align:center;height:28px}.el-date-range-picker__header [class*=arrow-left]{float:left}.el-date-range-picker__header [class*=arrow-right]{float:right}.el-date-range-picker__header div{font-size:16px;font-weight:500;margin-right:50px}.el-date-range-picker__content{float:left;width:50%;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:16px}.el-date-range-picker__content.is-left{border-right:1px solid #e4e4e4}.el-date-range-picker__content .el-date-range-picker__header div{margin-left:50px;margin-right:50px}.el-date-range-picker__editors-wrap{-webkit-box-sizing:border-box;box-sizing:border-box;display:table-cell}.el-date-range-picker__editors-wrap.is-right{text-align:right}.el-date-range-picker__time-header{position:relative;border-bottom:1px solid #e4e4e4;font-size:12px;padding:8px 5px 5px;display:table;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.el-date-range-picker__time-header>.el-icon-arrow-right{font-size:20px;vertical-align:middle;display:table-cell;color:#303133}.el-date-range-picker__time-picker-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-range-picker__time-picker-wrap .el-picker-panel{position:absolute;top:13px;right:0;z-index:1;background:#FFF}.el-date-picker{width:322px}.el-date-picker.has-sidebar.has-time{width:434px}.el-date-picker.has-sidebar{width:438px}.el-date-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-picker .el-picker-panel__content{width:292px}.el-date-picker table{table-layout:fixed;width:100%}.el-date-picker__editor-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-picker__time-header{position:relative;border-bottom:1px solid #e4e4e4;font-size:12px;padding:8px 5px 5px;display:table;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.el-date-picker__header{margin:12px;text-align:center}.el-date-picker__header--bordered{margin-bottom:0;padding-bottom:12px;border-bottom:solid 1px #EBEEF5}.el-date-picker__header--bordered+.el-picker-panel__content{margin-top:0}.el-date-picker__header-label{font-size:16px;font-weight:500;padding:0 5px;line-height:22px;text-align:center;cursor:pointer;color:#606266}.el-date-picker__header-label.active,.el-date-picker__header-label:hover{color:#409EFF}.el-date-picker__prev-btn{float:left}.el-date-picker__next-btn{float:right}.el-date-picker__time-wrap{padding:10px;text-align:center}.el-date-picker__time-label{float:left;cursor:pointer;line-height:30px;margin-left:10px}.time-select{margin:5px 0;min-width:0}.time-select .el-picker-panel__content{max-height:200px;margin:0}.time-select-item{padding:8px 10px;font-size:14px;line-height:20px}.time-select-item.selected:not(.disabled){color:#409EFF;font-weight:700}.time-select-item.disabled{color:#E4E7ED;cursor:not-allowed}.time-select-item:hover{background-color:#F5F7FA;font-weight:700;cursor:pointer}.el-date-editor{position:relative;display:inline-block;text-align:left}.el-date-editor.el-input,.el-date-editor.el-input__inner{width:220px}.el-date-editor--monthrange.el-input,.el-date-editor--monthrange.el-input__inner{width:300px}.el-date-editor--daterange.el-input,.el-date-editor--daterange.el-input__inner,.el-date-editor--timerange.el-input,.el-date-editor--timerange.el-input__inner{width:350px}.el-date-editor--datetimerange.el-input,.el-date-editor--datetimerange.el-input__inner{width:400px}.el-date-editor--dates .el-input__inner{text-overflow:ellipsis;white-space:nowrap}.el-date-editor .el-icon-circle-close{cursor:pointer}.el-date-editor .el-range__icon{font-size:14px;margin-left:-5px;color:#C0C4CC;float:left;line-height:32px}.el-date-editor .el-range-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;outline:0;display:inline-block;height:100%;margin:0;padding:0;width:39%;text-align:center;font-size:14px;color:#606266}.el-date-editor .el-range-input::-webkit-input-placeholder{color:#C0C4CC}.el-date-editor .el-range-input:-ms-input-placeholder{color:#C0C4CC}.el-date-editor .el-range-input::-ms-input-placeholder{color:#C0C4CC}.el-date-editor .el-range-input::placeholder{color:#C0C4CC}.el-date-editor .el-range-separator{display:inline-block;height:100%;padding:0 5px;margin:0;text-align:center;line-height:32px;font-size:14px;width:5%;color:#303133}.el-date-editor .el-range__close-icon{font-size:14px;color:#C0C4CC;width:25px;display:inline-block;float:right;line-height:32px}.el-range-editor.el-input__inner{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:3px 10px}.el-range-editor .el-range-input{line-height:1}.el-range-editor--medium.el-input__inner{height:36px}.el-range-editor--medium .el-range-separator{line-height:28px;font-size:14px}.el-range-editor--medium .el-range-input{font-size:14px}.el-range-editor--medium .el-range__close-icon,.el-range-editor--medium .el-range__icon{line-height:28px}.el-range-editor--small.el-input__inner{height:32px}.el-range-editor--small .el-range-separator{line-height:24px;font-size:13px}.el-range-editor--small .el-range-input{font-size:13px}.el-range-editor--small .el-range__close-icon,.el-range-editor--small .el-range__icon{line-height:24px}.el-range-editor--mini.el-input__inner{height:28px}.el-range-editor--mini .el-range-separator{line-height:20px;font-size:12px}.el-range-editor--mini .el-range-input{font-size:12px}.el-range-editor--mini .el-range__close-icon,.el-range-editor--mini .el-range__icon{line-height:20px}.el-range-editor.is-disabled{background-color:#F5F7FA;border-color:#E4E7ED;color:#C0C4CC;cursor:not-allowed}.el-range-editor.is-disabled:focus,.el-range-editor.is-disabled:hover{border-color:#E4E7ED}.el-range-editor.is-disabled input{background-color:#F5F7FA;color:#C0C4CC;cursor:not-allowed}.el-range-editor.is-disabled input::-webkit-input-placeholder{color:#C0C4CC}.el-range-editor.is-disabled input:-ms-input-placeholder{color:#C0C4CC}.el-range-editor.is-disabled input::-ms-input-placeholder{color:#C0C4CC}.el-range-editor.is-disabled input::placeholder{color:#C0C4CC}.el-range-editor.is-disabled .el-range-separator{color:#C0C4CC}.el-picker-panel{color:#606266;border:1px solid #E4E7ED;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);background:#FFF;border-radius:4px;line-height:30px;margin:5px 0}.el-picker-panel__body-wrapper::after,.el-picker-panel__body::after{content:"";display:table;clear:both}.el-picker-panel__content{position:relative;margin:15px}.el-picker-panel__footer{border-top:1px solid #e4e4e4;padding:4px;text-align:right;background-color:#FFF;position:relative;font-size:0}.el-picker-panel__shortcut{display:block;width:100%;border:0;background-color:transparent;line-height:28px;font-size:14px;color:#606266;padding-left:12px;text-align:left;outline:0;cursor:pointer}.el-picker-panel__shortcut:hover{color:#409EFF}.el-picker-panel__shortcut.active{background-color:#e6f1fe;color:#409EFF}.el-picker-panel__btn{border:1px solid #dcdcdc;color:#333;line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:0;font-size:12px}.el-picker-panel__btn[disabled]{color:#ccc;cursor:not-allowed}.el-picker-panel__icon-btn{font-size:12px;color:#303133;border:0;background:0 0;cursor:pointer;outline:0;margin-top:8px}.el-picker-panel__icon-btn:hover{color:#409EFF}.el-picker-panel__icon-btn.is-disabled{color:#bbb}.el-picker-panel__icon-btn.is-disabled:hover{cursor:not-allowed}.el-picker-panel__link-btn{vertical-align:middle}.el-picker-panel [slot=sidebar],.el-picker-panel__sidebar{position:absolute;top:0;bottom:0;width:110px;border-right:1px solid #e4e4e4;-webkit-box-sizing:border-box;box-sizing:border-box;padding-top:6px;background-color:#FFF;overflow:auto}.el-picker-panel [slot=sidebar]+.el-picker-panel__body,.el-picker-panel__sidebar+.el-picker-panel__body{margin-left:110px}.el-time-spinner.has-seconds .el-time-spinner__wrapper{width:33.3%}.el-time-spinner__wrapper{max-height:190px;overflow:auto;display:inline-block;width:50%;vertical-align:top;position:relative}.el-time-spinner__wrapper .el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default){padding-bottom:15px}.el-time-spinner__input.el-input .el-input__inner,.el-time-spinner__list{padding:0;text-align:center}.el-time-spinner__wrapper.is-arrow{-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;overflow:hidden}.el-time-spinner__wrapper.is-arrow .el-time-spinner__list{-webkit-transform:translateY(-32px);transform:translateY(-32px)}.el-time-spinner__wrapper.is-arrow .el-time-spinner__item:hover:not(.disabled):not(.active){background:#FFF;cursor:default}.el-time-spinner__arrow{font-size:12px;color:#909399;position:absolute;left:0;width:100%;z-index:1;text-align:center;height:30px;line-height:30px;cursor:pointer}.el-time-spinner__arrow:hover{color:#409EFF}.el-time-spinner__arrow.el-icon-arrow-up{top:10px}.el-time-spinner__arrow.el-icon-arrow-down{bottom:10px}.el-time-spinner__input.el-input{width:70%}.el-time-spinner__list{margin:0;list-style:none}.el-time-spinner__list::after,.el-time-spinner__list::before{content:'';display:block;width:100%;height:80px}.el-time-spinner__item{height:32px;line-height:32px;font-size:12px;color:#606266}.el-time-spinner__item:hover:not(.disabled):not(.active){background:#F5F7FA;cursor:pointer}.el-time-spinner__item.active:not(.disabled){color:#303133;font-weight:700}.el-time-spinner__item.disabled{color:#C0C4CC;cursor:not-allowed}.el-time-panel{margin:5px 0;border:1px solid #E4E7ED;background-color:#FFF;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);border-radius:2px;position:absolute;width:180px;left:0;z-index:1000;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:content-box;box-sizing:content-box}.el-time-panel__content{font-size:0;position:relative;overflow:hidden}.el-time-panel__content::after,.el-time-panel__content::before{content:"";top:50%;position:absolute;margin-top:-15px;height:32px;z-index:-1;left:0;right:0;-webkit-box-sizing:border-box;box-sizing:border-box;padding-top:6px;text-align:left;border-top:1px solid #E4E7ED;border-bottom:1px solid #E4E7ED}.el-time-panel__content::after{left:50%;margin-left:12%;margin-right:12%}.el-time-panel__content::before{padding-left:50%;margin-right:12%;margin-left:12%}.el-time-panel__content.has-seconds::after{left:calc(100% / 3 * 2)}.el-time-panel__content.has-seconds::before{padding-left:calc(100% / 3)}.el-time-panel__footer{border-top:1px solid #e4e4e4;padding:4px;height:36px;line-height:25px;text-align:right;-webkit-box-sizing:border-box;box-sizing:border-box}.el-time-panel__btn{border:none;line-height:28px;padding:0 5px;margin:0 5px;cursor:pointer;background-color:transparent;outline:0;font-size:12px;color:#303133}.el-time-panel__btn.confirm{font-weight:800;color:#409EFF}.el-time-range-picker{width:354px;overflow:visible}.el-time-range-picker__content{position:relative;text-align:center;padding:10px}.el-time-range-picker__cell{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:4px 7px 7px;width:50%;display:inline-block}.el-time-range-picker__header{margin-bottom:5px;text-align:center;font-size:14px}.el-time-range-picker__body{border-radius:2px;border:1px solid #E4E7ED}.el-popover{position:absolute;background:#FFF;min-width:150px;border-radius:4px;border:1px solid #EBEEF5;padding:12px;z-index:2000;color:#606266;line-height:1.4;text-align:justify;font-size:14px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);word-break:break-all}.el-card.is-always-shadow,.el-card.is-hover-shadow:focus,.el-card.is-hover-shadow:hover,.el-cascader__dropdown,.el-color-picker__panel,.el-message-box,.el-notification{-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-popover--plain{padding:18px 20px}.el-popover__title{color:#303133;font-size:16px;line-height:1;margin-bottom:12px}.el-popover:focus,.el-popover:focus:active,.el-popover__reference:focus:hover,.el-popover__reference:focus:not(.focusing){outline-width:0}.v-modal-enter{-webkit-animation:v-modal-in .2s ease;animation:v-modal-in .2s ease}.v-modal-leave{-webkit-animation:v-modal-out .2s ease forwards;animation:v-modal-out .2s ease forwards}@keyframes v-modal-in{0%{opacity:0}}@keyframes v-modal-out{100%{opacity:0}}.v-modal{position:fixed;left:0;top:0;width:100%;height:100%;opacity:.5;background:#000}.el-popup-parent--hidden{overflow:hidden}.el-message-box{display:inline-block;width:420px;padding-bottom:10px;vertical-align:middle;background-color:#FFF;border-radius:4px;border:1px solid #EBEEF5;font-size:18px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);text-align:left;overflow:hidden;-webkit-backface-visibility:hidden;backface-visibility:hidden}.el-message-box__wrapper{position:fixed;top:0;bottom:0;left:0;right:0;text-align:center}.el-message-box__wrapper::after{content:"";display:inline-block;height:100%;width:0;vertical-align:middle}.el-message-box__header{position:relative;padding:15px 15px 10px}.el-message-box__title{padding-left:0;margin-bottom:0;font-size:18px;line-height:1;color:#303133}.el-message-box__headerbtn{position:absolute;top:15px;right:15px;padding:0;border:none;outline:0;background:0 0;font-size:16px;cursor:pointer}.el-form-item.is-error .el-input__inner,.el-form-item.is-error .el-input__inner:focus,.el-form-item.is-error .el-textarea__inner,.el-form-item.is-error .el-textarea__inner:focus,.el-message-box__input input.invalid,.el-message-box__input input.invalid:focus{border-color:#F56C6C}.el-message-box__headerbtn .el-message-box__close{color:#909399}.el-message-box__headerbtn:focus .el-message-box__close,.el-message-box__headerbtn:hover .el-message-box__close{color:#409EFF}.el-message-box__content{padding:10px 15px;color:#606266;font-size:14px}.el-message-box__container{position:relative}.el-message-box__input{padding-top:15px}.el-message-box__status{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);font-size:24px!important}.el-message-box__status::before{padding-left:1px}.el-message-box__status+.el-message-box__message{padding-left:36px;padding-right:12px}.el-message-box__status.el-icon-success{color:#67C23A}.el-message-box__status.el-icon-info{color:#909399}.el-message-box__status.el-icon-warning{color:#E6A23C}.el-message-box__status.el-icon-error{color:#F56C6C}.el-message-box__message{margin:0}.el-message-box__message p{margin:0;line-height:24px}.el-message-box__errormsg{color:#F56C6C;font-size:12px;min-height:18px;margin-top:2px}.el-message-box__btns{padding:5px 15px 0;text-align:right}.el-message-box__btns button:nth-child(2){margin-left:10px}.el-message-box__btns-reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.el-message-box--center{padding-bottom:30px}.el-message-box--center .el-message-box__header{padding-top:30px}.el-message-box--center .el-message-box__title{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-message-box--center .el-message-box__status{position:relative;top:auto;padding-right:5px;text-align:center;-webkit-transform:translateY(-1px);transform:translateY(-1px)}.el-message-box--center .el-message-box__message{margin-left:0}.el-message-box--center .el-message-box__btns,.el-message-box--center .el-message-box__content{text-align:center}.el-message-box--center .el-message-box__content{padding-left:27px;padding-right:27px}.msgbox-fade-enter-active{-webkit-animation:msgbox-fade-in .3s;animation:msgbox-fade-in .3s}.msgbox-fade-leave-active{-webkit-animation:msgbox-fade-out .3s;animation:msgbox-fade-out .3s}@-webkit-keyframes msgbox-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}100%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}}@keyframes msgbox-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}100%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}}@-webkit-keyframes msgbox-fade-out{0%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}100%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}@keyframes msgbox-fade-out{0%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}100%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}.el-breadcrumb{font-size:14px;line-height:1}.el-breadcrumb::after,.el-breadcrumb::before{display:table;content:""}.el-breadcrumb::after{clear:both}.el-breadcrumb__separator{margin:0 9px;font-weight:700;color:#C0C4CC}.el-breadcrumb__separator[class*=icon]{margin:0 6px;font-weight:400}.el-breadcrumb__item{float:left}.el-breadcrumb__inner{color:#606266}.el-breadcrumb__inner a,.el-breadcrumb__inner.is-link{font-weight:700;text-decoration:none;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1);color:#303133}.el-breadcrumb__inner a:hover,.el-breadcrumb__inner.is-link:hover{color:#409EFF;cursor:pointer}.el-breadcrumb__item:last-child .el-breadcrumb__inner,.el-breadcrumb__item:last-child .el-breadcrumb__inner a,.el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover,.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover{font-weight:400;color:#606266;cursor:text}.el-form--label-left .el-form-item__label{text-align:left}.el-form--label-top .el-form-item__label{float:none;display:inline-block;text-align:left;padding:0 0 10px}.el-form--inline .el-form-item{display:inline-block;margin-right:10px;vertical-align:top}.el-form--inline .el-form-item__label{float:none;display:inline-block}.el-form--inline .el-form-item__content{display:inline-block;vertical-align:top}.el-form--inline.el-form--label-top .el-form-item__content{display:block}.el-form-item{margin-bottom:22px}.el-form-item::after,.el-form-item::before{display:table;content:""}.el-form-item::after{clear:both}.el-form-item .el-form-item{margin-bottom:0}.el-form-item--mini.el-form-item,.el-form-item--small.el-form-item{margin-bottom:18px}.el-form-item .el-input__validateIcon{display:none}.el-form-item--medium .el-form-item__content,.el-form-item--medium .el-form-item__label{line-height:36px}.el-form-item--small .el-form-item__content,.el-form-item--small .el-form-item__label{line-height:32px}.el-form-item--small .el-form-item__error{padding-top:2px}.el-form-item--mini .el-form-item__content,.el-form-item--mini .el-form-item__label{line-height:28px}.el-form-item--mini .el-form-item__error{padding-top:1px}.el-form-item__label-wrap{float:left}.el-form-item__label-wrap .el-form-item__label{display:inline-block;float:none}.el-form-item__label{text-align:right;vertical-align:middle;float:left;font-size:14px;color:#606266;line-height:40px;padding:0 12px 0 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-form-item__content{line-height:40px;position:relative;font-size:14px}.el-form-item__content::after,.el-form-item__content::before{display:table;content:""}.el-form-item__content::after{clear:both}.el-form-item__content .el-input-group{vertical-align:top}.el-form-item__error{color:#F56C6C;font-size:12px;line-height:1;padding-top:4px;position:absolute;top:100%;left:0}.el-form-item__error--inline{position:relative;top:auto;left:auto;display:inline-block;margin-left:10px}.el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap>.el-form-item__label:before,.el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before{content:'*';color:#F56C6C;margin-right:4px}.el-form-item.is-error .el-input-group__append .el-input__inner,.el-form-item.is-error .el-input-group__prepend .el-input__inner{border-color:transparent}.el-form-item.is-error .el-input__validateIcon{color:#F56C6C}.el-form-item--feedback .el-input__validateIcon{display:inline-block}.el-tabs__header{padding:0;position:relative;margin:0 0 15px}.el-tabs__active-bar{position:absolute;bottom:0;left:0;height:2px;background-color:#409EFF;z-index:1;-webkit-transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:-webkit-transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1);transition:transform .3s cubic-bezier(.645,.045,.355,1),-webkit-transform .3s cubic-bezier(.645,.045,.355,1);list-style:none}.el-tabs__new-tab{float:right;border:1px solid #d3dce6;height:18px;width:18px;line-height:18px;margin:12px 0 9px 10px;border-radius:3px;text-align:center;font-size:12px;color:#d3dce6;cursor:pointer;-webkit-transition:all .15s;transition:all .15s}.el-tabs__new-tab .el-icon-plus{-webkit-transform:scale(.8,.8);transform:scale(.8,.8)}.el-tabs__new-tab:hover{color:#409EFF}.el-tabs__nav-wrap{overflow:hidden;margin-bottom:-1px;position:relative}.el-tabs__nav-wrap::after{content:"";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:#E4E7ED;z-index:1}.el-tabs__nav-wrap.is-scrollable{padding:0 20px;-webkit-box-sizing:border-box;box-sizing:border-box}.el-tabs__nav-scroll{overflow:hidden}.el-tabs__nav-next,.el-tabs__nav-prev{position:absolute;cursor:pointer;line-height:44px;font-size:12px;color:#909399}.el-tabs__nav-next{right:0}.el-tabs__nav-prev{left:0}.el-tabs__nav{white-space:nowrap;position:relative;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;float:left;z-index:2}.el-tabs__nav.is-stretch{min-width:100%;display:-webkit-box;display:-ms-flexbox;display:flex}.el-tabs__nav.is-stretch>*{-webkit-box-flex:1;-ms-flex:1;flex:1;text-align:center}.el-tabs__item{padding:0 20px;height:40px;-webkit-box-sizing:border-box;box-sizing:border-box;line-height:40px;display:inline-block;list-style:none;font-size:14px;font-weight:500;color:#303133;position:relative}.el-tabs__item:focus,.el-tabs__item:focus:active{outline:0}.el-tabs__item:focus.is-active.is-focus:not(:active){-webkit-box-shadow:0 0 2px 2px #409EFF inset;box-shadow:0 0 2px 2px #409EFF inset;border-radius:3px}.el-tabs__item .el-icon-close{border-radius:50%;text-align:center;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);margin-left:5px}.el-tabs__item .el-icon-close:before{-webkit-transform:scale(.9);transform:scale(.9);display:inline-block}.el-tabs--card>.el-tabs__header .el-tabs__active-bar,.el-tabs--left.el-tabs--card .el-tabs__active-bar.is-left,.el-tabs--right.el-tabs--card .el-tabs__active-bar.is-right{display:none}.el-tabs__item .el-icon-close:hover{background-color:#C0C4CC;color:#FFF}.el-tabs__item.is-active{color:#409EFF}.el-tabs__item:hover{color:#409EFF;cursor:pointer}.el-tabs__item.is-disabled{color:#C0C4CC;cursor:default}.el-tabs__content{overflow:hidden;position:relative}.el-tabs--card>.el-tabs__header{border-bottom:1px solid #E4E7ED}.el-tabs--card>.el-tabs__header .el-tabs__nav-wrap::after{content:none}.el-tabs--card>.el-tabs__header .el-tabs__nav{border:1px solid #E4E7ED;border-bottom:none;border-radius:4px 4px 0 0;-webkit-box-sizing:border-box;box-sizing:border-box}.el-tabs--card>.el-tabs__header .el-tabs__item .el-icon-close{position:relative;font-size:12px;width:0;height:14px;vertical-align:middle;line-height:15px;overflow:hidden;top:-1px;right:-2px;-webkit-transform-origin:100% 50%;transform-origin:100% 50%}.el-tabs--card>.el-tabs__header .el-tabs__item{border-bottom:1px solid transparent;border-left:1px solid #E4E7ED;-webkit-transition:color .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1);transition:color .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1)}.el-tabs--card>.el-tabs__header .el-tabs__item:first-child{border-left:none}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover{padding-left:13px;padding-right:13px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover .el-icon-close{width:14px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active{border-bottom-color:#FFF}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable{padding-left:20px;padding-right:20px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable .el-icon-close{width:14px}.el-tabs--border-card{background:#FFF;border:1px solid #DCDFE6;-webkit-box-shadow:0 2px 4px 0 rgba(0,0,0,.12),0 0 6px 0 rgba(0,0,0,.04);box-shadow:0 2px 4px 0 rgba(0,0,0,.12),0 0 6px 0 rgba(0,0,0,.04)}.el-tabs--border-card>.el-tabs__content{padding:15px}.el-tabs--border-card>.el-tabs__header{background-color:#F5F7FA;border-bottom:1px solid #E4E7ED;margin:0}.el-tabs--border-card>.el-tabs__header .el-tabs__nav-wrap::after{content:none}.el-tabs--border-card>.el-tabs__header .el-tabs__item{-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);border:1px solid transparent;margin-top:-1px;color:#909399}.el-tabs--border-card>.el-tabs__header .el-tabs__item+.el-tabs__item,.el-tabs--border-card>.el-tabs__header .el-tabs__item:first-child{margin-left:-1px}.el-col-offset-0,.el-tabs--border-card>.el-tabs__header .is-scrollable .el-tabs__item:first-child{margin-left:0}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{color:#409EFF;background-color:#FFF;border-right-color:#DCDFE6;border-left-color:#DCDFE6}.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover{color:#409EFF}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-disabled{color:#C0C4CC}.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),.el-tabs--top .el-tabs__item.is-top:nth-child(2){padding-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:last-child,.el-tabs--bottom .el-tabs__item.is-top:last-child,.el-tabs--top .el-tabs__item.is-bottom:last-child,.el-tabs--top .el-tabs__item.is-top:last-child{padding-right:0}.el-cascader-menu:last-child .el-cascader-node,.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child{padding-right:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2){padding-left:20px}.el-tabs--bottom .el-tabs__header.is-bottom{margin-bottom:0;margin-top:10px}.el-tabs--bottom.el-tabs--border-card .el-tabs__header.is-bottom{border-bottom:0;border-top:1px solid #DCDFE6}.el-tabs--bottom.el-tabs--border-card .el-tabs__nav-wrap.is-bottom{margin-top:-1px;margin-bottom:0}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom:not(.is-active){border:1px solid transparent}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom{margin:0 -1px -1px}.el-tabs--left,.el-tabs--right{overflow:hidden}.el-tabs--left .el-tabs__header.is-left,.el-tabs--left .el-tabs__header.is-right,.el-tabs--left .el-tabs__nav-scroll,.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__header.is-left,.el-tabs--right .el-tabs__header.is-right,.el-tabs--right .el-tabs__nav-scroll,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{height:100%}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__active-bar.is-right,.el-tabs--right .el-tabs__active-bar.is-left,.el-tabs--right .el-tabs__active-bar.is-right{top:0;bottom:auto;width:2px;height:auto}.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{margin-bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{height:30px;line-height:30px;width:100%;text-align:center;cursor:pointer}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i{-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg)}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{left:auto;top:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next{right:auto;bottom:0}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__nav-wrap.is-left::after{right:0;left:auto}.el-tabs--left .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--left .el-tabs__nav-wrap.is-right.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-right.is-scrollable{padding:30px 0}.el-tabs--left .el-tabs__nav-wrap.is-left::after,.el-tabs--left .el-tabs__nav-wrap.is-right::after,.el-tabs--right .el-tabs__nav-wrap.is-left::after,.el-tabs--right .el-tabs__nav-wrap.is-right::after{height:100%;width:2px;bottom:auto;top:0}.el-tabs--left .el-tabs__nav.is-left,.el-tabs--left .el-tabs__nav.is-right,.el-tabs--right .el-tabs__nav.is-left,.el-tabs--right .el-tabs__nav.is-right{float:none}.el-tabs--left .el-tabs__item.is-left,.el-tabs--left .el-tabs__item.is-right,.el-tabs--right .el-tabs__item.is-left,.el-tabs--right .el-tabs__item.is-right{display:block}.el-tabs--left .el-tabs__header.is-left{float:left;margin-bottom:0;margin-right:10px}.el-button-group>.el-button:not(:last-child),.el-tabs--left .el-tabs__nav-wrap.is-left{margin-right:-1px}.el-tabs--left .el-tabs__item.is-left{text-align:right}.el-tabs--left.el-tabs--card .el-tabs__item.is-left{border-left:none;border-right:1px solid #E4E7ED;border-bottom:none;border-top:1px solid #E4E7ED;text-align:left}.el-tabs--left.el-tabs--card .el-tabs__item.is-left:first-child{border-right:1px solid #E4E7ED;border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active{border:1px solid #E4E7ED;border-right-color:#fff;border-left:none;border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:first-child{border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:last-child{border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__nav{border-radius:4px 0 0 4px;border-bottom:1px solid #E4E7ED;border-right:none}.el-tabs--left.el-tabs--card .el-tabs__new-tab{float:none}.el-tabs--left.el-tabs--border-card .el-tabs__header.is-left{border-right:1px solid #dfe4ed}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left{border:1px solid transparent;margin:-1px 0 -1px -1px}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left.is-active{border-color:#d1dbe5 transparent}.el-tabs--right .el-tabs__header.is-right{float:right;margin-bottom:0;margin-left:10px}.el-tabs--right .el-tabs__nav-wrap.is-right{margin-left:-1px}.el-tabs--right .el-tabs__nav-wrap.is-right::after{left:0;right:auto}.el-tabs--right .el-tabs__active-bar.is-right{left:0}.el-tabs--right.el-tabs--card .el-tabs__item.is-right{border-bottom:none;border-top:1px solid #E4E7ED}.el-tabs--right.el-tabs--card .el-tabs__item.is-right:first-child{border-left:1px solid #E4E7ED;border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active{border:1px solid #E4E7ED;border-left-color:#fff;border-right:none;border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:first-child{border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:last-child{border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__nav{border-radius:0 4px 4px 0;border-bottom:1px solid #E4E7ED;border-left:none}.el-tabs--right.el-tabs--border-card .el-tabs__header.is-right{border-left:1px solid #dfe4ed}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right{border:1px solid transparent;margin:-1px -1px -1px 0}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right.is-active{border-color:#d1dbe5 transparent}.slideInLeft-transition,.slideInRight-transition{display:inline-block}.slideInRight-enter{-webkit-animation:slideInRight-enter .3s;animation:slideInRight-enter .3s}.slideInRight-leave{position:absolute;left:0;right:0;-webkit-animation:slideInRight-leave .3s;animation:slideInRight-leave .3s}.slideInLeft-enter{-webkit-animation:slideInLeft-enter .3s;animation:slideInLeft-enter .3s}.slideInLeft-leave{position:absolute;left:0;right:0;-webkit-animation:slideInLeft-leave .3s;animation:slideInLeft-leave .3s}@-webkit-keyframes slideInRight-enter{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slideInRight-enter{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slideInRight-leave{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);opacity:0}}@keyframes slideInRight-leave{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(100%);transform:translateX(100%);opacity:0}}@-webkit-keyframes slideInLeft-enter{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slideInLeft-enter{0%{opacity:0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{opacity:1;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slideInLeft-leave{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}}@keyframes slideInLeft-leave{0%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(0);transform:translateX(0);opacity:1}100%{-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:translateX(-100%);transform:translateX(-100%);opacity:0}}.el-tree{position:relative;cursor:default;background:#FFF;color:#606266}.el-tree__empty-block{position:relative;min-height:60px;text-align:center;width:100%;height:100%}.el-tree__empty-text{position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);color:#909399;font-size:14px}.el-tree__drop-indicator{position:absolute;left:0;right:0;height:1px;background-color:#409EFF}.el-tree-node{white-space:nowrap;outline:0}.el-tree-node:focus>.el-tree-node__content{background-color:#F5F7FA}.el-tree-node.is-drop-inner>.el-tree-node__content .el-tree-node__label{background-color:#409EFF;color:#fff}.el-tree-node__content:hover,.el-upload-list__item:hover{background-color:#F5F7FA}.el-tree-node__content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:26px;cursor:pointer}.el-tree-node__content>.el-tree-node__expand-icon{padding:6px}.el-tree-node__content>label.el-checkbox{margin-right:8px}.el-tree.is-dragging .el-tree-node__content{cursor:move}.el-tree.is-dragging .el-tree-node__content *{pointer-events:none}.el-tree.is-dragging.is-drop-not-allow .el-tree-node__content{cursor:not-allowed}.el-tree-node__expand-icon{cursor:pointer;color:#C0C4CC;font-size:12px;-webkit-transform:rotate(0);transform:rotate(0);-webkit-transition:-webkit-transform .3s ease-in-out;transition:-webkit-transform .3s ease-in-out;transition:transform .3s ease-in-out;transition:transform .3s ease-in-out,-webkit-transform .3s ease-in-out}.el-tree-node__expand-icon.expanded{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.el-tree-node__expand-icon.is-leaf{color:transparent;cursor:default}.el-tree-node__label{font-size:14px}.el-tree-node__loading-icon{margin-right:8px;font-size:14px;color:#C0C4CC}.el-tree-node>.el-tree-node__children{overflow:hidden;background-color:transparent}.el-tree-node.is-expanded>.el-tree-node__children{display:block}.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:#f0f7ff}.el-alert{width:100%;padding:8px 16px;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;position:relative;background-color:#FFF;overflow:hidden;opacity:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-transition:opacity .2s;transition:opacity .2s}.el-alert.is-light .el-alert__closebtn{color:#C0C4CC}.el-alert.is-dark .el-alert__closebtn,.el-alert.is-dark .el-alert__description{color:#FFF}.el-alert.is-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-alert--success.is-light{background-color:#f0f9eb;color:#67C23A}.el-alert--success.is-light .el-alert__description{color:#67C23A}.el-alert--success.is-dark{background-color:#67C23A;color:#FFF}.el-alert--info.is-light{background-color:#f4f4f5;color:#909399}.el-alert--info.is-dark{background-color:#909399;color:#FFF}.el-alert--info .el-alert__description{color:#909399}.el-alert--warning.is-light{background-color:#fdf6ec;color:#E6A23C}.el-alert--warning.is-light .el-alert__description{color:#E6A23C}.el-alert--warning.is-dark{background-color:#E6A23C;color:#FFF}.el-alert--error.is-light{background-color:#fef0f0;color:#F56C6C}.el-alert--error.is-light .el-alert__description{color:#F56C6C}.el-alert--error.is-dark{background-color:#F56C6C;color:#FFF}.el-alert__content{display:table-cell;padding:0 8px}.el-alert__icon{font-size:16px;width:16px}.el-alert__icon.is-big{font-size:28px;width:28px}.el-alert__title{font-size:13px;line-height:18px}.el-alert__title.is-bold{font-weight:700}.el-alert .el-alert__description{font-size:12px;margin:5px 0 0}.el-alert__closebtn{font-size:12px;opacity:1;position:absolute;top:12px;right:15px;cursor:pointer}.el-alert-fade-enter,.el-alert-fade-leave-active,.el-loading-fade-enter,.el-loading-fade-leave-active,.el-notification-fade-leave-active,.el-upload iframe{opacity:0}.el-carousel__arrow--right,.el-notification.right{right:16px}.el-alert__closebtn.is-customed{font-style:normal;font-size:13px;top:9px}.el-notification{display:-webkit-box;display:-ms-flexbox;display:flex;width:330px;padding:14px 26px 14px 13px;border-radius:8px;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #EBEEF5;position:fixed;background-color:#FFF;box-shadow:0 2px 12px 0 rgba(0,0,0,.1);-webkit-transition:opacity .3s,left .3s,right .3s,top .4s,bottom .3s,-webkit-transform .3s;transition:opacity .3s,left .3s,right .3s,top .4s,bottom .3s,-webkit-transform .3s;transition:opacity .3s,transform .3s,left .3s,right .3s,top .4s,bottom .3s;transition:opacity .3s,transform .3s,left .3s,right .3s,top .4s,bottom .3s,-webkit-transform .3s;overflow:hidden}.el-notification.left{left:16px}.el-notification__group{margin-left:13px;margin-right:8px}.el-notification__title{font-weight:700;font-size:16px;color:#303133;margin:0}.el-notification__content{font-size:14px;line-height:21px;margin:6px 0 0;color:#606266;text-align:justify}.el-notification__content p{margin:0}.el-notification__icon{height:24px;width:24px;font-size:24px}.el-notification__closeBtn{position:absolute;top:18px;right:15px;cursor:pointer;color:#909399;font-size:16px}.el-notification__closeBtn:hover{color:#606266}.el-notification .el-icon-success{color:#67C23A}.el-notification .el-icon-error{color:#F56C6C}.el-notification .el-icon-info{color:#909399}.el-notification .el-icon-warning{color:#E6A23C}.el-notification-fade-enter.right{right:0;-webkit-transform:translateX(100%);transform:translateX(100%)}.el-notification-fade-enter.left{left:0;-webkit-transform:translateX(-100%);transform:translateX(-100%)}.el-input-number{position:relative;display:inline-block;width:180px;line-height:38px}.el-input-number .el-input{display:block}.el-input-number .el-input__inner{-webkit-appearance:none;padding-left:50px;padding-right:50px;text-align:center}.el-input-number__decrease,.el-input-number__increase{position:absolute;z-index:1;top:1px;width:40px;height:auto;text-align:center;background:#F5F7FA;color:#606266;cursor:pointer;font-size:13px}.el-input-number__decrease:hover,.el-input-number__increase:hover{color:#409EFF}.el-input-number__decrease:hover:not(.is-disabled)~.el-input .el-input__inner:not(.is-disabled),.el-input-number__increase:hover:not(.is-disabled)~.el-input .el-input__inner:not(.is-disabled){border-color:#409EFF}.el-input-number__decrease.is-disabled,.el-input-number__increase.is-disabled{color:#C0C4CC;cursor:not-allowed}.el-input-number__increase{right:1px;border-radius:0 4px 4px 0;border-left:1px solid #DCDFE6}.el-input-number__decrease{left:1px;border-radius:4px 0 0 4px;border-right:1px solid #DCDFE6}.el-input-number.is-disabled .el-input-number__decrease,.el-input-number.is-disabled .el-input-number__increase{border-color:#E4E7ED;color:#E4E7ED}.el-input-number.is-disabled .el-input-number__decrease:hover,.el-input-number.is-disabled .el-input-number__increase:hover{color:#E4E7ED;cursor:not-allowed}.el-input-number--medium{width:200px;line-height:34px}.el-input-number--medium .el-input-number__decrease,.el-input-number--medium .el-input-number__increase{width:36px;font-size:14px}.el-input-number--medium .el-input__inner{padding-left:43px;padding-right:43px}.el-input-number--small{width:130px;line-height:30px}.el-input-number--small .el-input-number__decrease,.el-input-number--small .el-input-number__increase{width:32px;font-size:13px}.el-input-number--small .el-input-number__decrease [class*=el-icon],.el-input-number--small .el-input-number__increase [class*=el-icon]{-webkit-transform:scale(.9);transform:scale(.9)}.el-input-number--small .el-input__inner{padding-left:39px;padding-right:39px}.el-input-number--mini{width:130px;line-height:26px}.el-input-number--mini .el-input-number__decrease,.el-input-number--mini .el-input-number__increase{width:28px;font-size:12px}.el-input-number--mini .el-input-number__decrease [class*=el-icon],.el-input-number--mini .el-input-number__increase [class*=el-icon]{-webkit-transform:scale(.8);transform:scale(.8)}.el-input-number--mini .el-input__inner{padding-left:35px;padding-right:35px}.el-input-number.is-without-controls .el-input__inner{padding-left:15px;padding-right:15px}.el-input-number.is-controls-right .el-input__inner{padding-left:15px;padding-right:50px}.el-input-number.is-controls-right .el-input-number__decrease,.el-input-number.is-controls-right .el-input-number__increase{height:auto;line-height:19px}.el-input-number.is-controls-right .el-input-number__decrease [class*=el-icon],.el-input-number.is-controls-right .el-input-number__increase [class*=el-icon]{-webkit-transform:scale(.8);transform:scale(.8)}.el-input-number.is-controls-right .el-input-number__increase{border-radius:0 4px 0 0;border-bottom:1px solid #DCDFE6}.el-input-number.is-controls-right .el-input-number__decrease{right:1px;bottom:1px;top:auto;left:auto;border-right:none;border-left:1px solid #DCDFE6;border-radius:0 0 4px}.el-input-number.is-controls-right[class*=medium] [class*=decrease],.el-input-number.is-controls-right[class*=medium] [class*=increase]{line-height:17px}.el-input-number.is-controls-right[class*=small] [class*=decrease],.el-input-number.is-controls-right[class*=small] [class*=increase]{line-height:15px}.el-input-number.is-controls-right[class*=mini] [class*=decrease],.el-input-number.is-controls-right[class*=mini] [class*=increase]{line-height:13px}.el-tooltip:focus:hover,.el-tooltip:focus:not(.focusing){outline-width:0}.el-tooltip__popper{position:absolute;border-radius:4px;padding:10px;z-index:2000;font-size:12px;line-height:1.2;min-width:10px;word-wrap:break-word}.el-tooltip__popper .popper__arrow,.el-tooltip__popper .popper__arrow::after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.el-tooltip__popper .popper__arrow{border-width:6px}.el-tooltip__popper .popper__arrow::after{content:" ";border-width:5px}.el-button-group::after,.el-button-group::before,.el-color-dropdown__main-wrapper::after,.el-link.is-underline:hover:after,.el-page-header__left::after,.el-progress-bar__inner::after,.el-row::after,.el-row::before,.el-slider::after,.el-slider::before,.el-slider__button-wrapper::after,.el-transfer-panel .el-transfer-panel__footer::after,.el-upload-cover::after,.el-upload-list--picture-card .el-upload-list__item-actions::after{content:""}.el-tooltip__popper[x-placement^=top]{margin-bottom:12px}.el-tooltip__popper[x-placement^=top] .popper__arrow{bottom:-6px;border-top-color:#303133;border-bottom-width:0}.el-tooltip__popper[x-placement^=top] .popper__arrow::after{bottom:1px;margin-left:-5px;border-top-color:#303133;border-bottom-width:0}.el-tooltip__popper[x-placement^=bottom]{margin-top:12px}.el-tooltip__popper[x-placement^=bottom] .popper__arrow{top:-6px;border-top-width:0;border-bottom-color:#303133}.el-tooltip__popper[x-placement^=bottom] .popper__arrow::after{top:1px;margin-left:-5px;border-top-width:0;border-bottom-color:#303133}.el-tooltip__popper[x-placement^=right]{margin-left:12px}.el-tooltip__popper[x-placement^=right] .popper__arrow{left:-6px;border-right-color:#303133;border-left-width:0}.el-tooltip__popper[x-placement^=right] .popper__arrow::after{bottom:-5px;left:1px;border-right-color:#303133;border-left-width:0}.el-tooltip__popper[x-placement^=left]{margin-right:12px}.el-tooltip__popper[x-placement^=left] .popper__arrow{right:-6px;border-right-width:0;border-left-color:#303133}.el-tooltip__popper[x-placement^=left] .popper__arrow::after{right:1px;bottom:-5px;margin-left:-5px;border-right-width:0;border-left-color:#303133}.el-tooltip__popper.is-dark{background:#303133;color:#FFF}.el-tooltip__popper.is-light{background:#FFF;border:1px solid #303133}.el-tooltip__popper.is-light[x-placement^=top] .popper__arrow{border-top-color:#303133}.el-tooltip__popper.is-light[x-placement^=top] .popper__arrow::after{border-top-color:#FFF}.el-tooltip__popper.is-light[x-placement^=bottom] .popper__arrow{border-bottom-color:#303133}.el-tooltip__popper.is-light[x-placement^=bottom] .popper__arrow::after{border-bottom-color:#FFF}.el-tooltip__popper.is-light[x-placement^=left] .popper__arrow{border-left-color:#303133}.el-tooltip__popper.is-light[x-placement^=left] .popper__arrow::after{border-left-color:#FFF}.el-tooltip__popper.is-light[x-placement^=right] .popper__arrow{border-right-color:#303133}.el-tooltip__popper.is-light[x-placement^=right] .popper__arrow::after{border-right-color:#FFF}.el-slider::after,.el-slider::before{display:table}.el-slider__button-wrapper .el-tooltip,.el-slider__button-wrapper::after{display:inline-block;vertical-align:middle}.el-slider::after{clear:both}.el-slider__runway{width:100%;height:6px;margin:16px 0;background-color:#E4E7ED;border-radius:3px;position:relative;cursor:pointer;vertical-align:middle}.el-slider__runway.show-input{margin-right:160px;width:auto}.el-slider__runway.disabled{cursor:default}.el-slider__runway.disabled .el-slider__bar{background-color:#C0C4CC}.el-slider__runway.disabled .el-slider__button{border-color:#C0C4CC}.el-slider__runway.disabled .el-slider__button-wrapper.dragging,.el-slider__runway.disabled .el-slider__button-wrapper.hover,.el-slider__runway.disabled .el-slider__button-wrapper:hover{cursor:not-allowed}.el-slider__runway.disabled .el-slider__button.dragging,.el-slider__runway.disabled .el-slider__button.hover,.el-slider__runway.disabled .el-slider__button:hover{-webkit-transform:scale(1);transform:scale(1);cursor:not-allowed}.el-slider__button-wrapper,.el-slider__stop{-webkit-transform:translateX(-50%);position:absolute}.el-slider__input{float:right;margin-top:3px;width:130px}.el-slider__input.el-input-number--mini{margin-top:5px}.el-slider__input.el-input-number--medium{margin-top:0}.el-slider__input.el-input-number--large{margin-top:-2px}.el-slider__bar{height:6px;background-color:#409EFF;border-top-left-radius:3px;border-bottom-left-radius:3px;position:absolute}.el-slider__button-wrapper{height:36px;width:36px;z-index:1001;top:-15px;transform:translateX(-50%);background-color:transparent;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:normal}.el-image-viewer__btn,.el-slider__button,.el-step__icon-inner{-moz-user-select:none;-ms-user-select:none}.el-slider__button-wrapper::after{height:100%}.el-slider__button-wrapper.hover,.el-slider__button-wrapper:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button-wrapper.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__button{width:16px;height:16px;border:2px solid #409EFF;background-color:#FFF;border-radius:50%;-webkit-transition:.2s;transition:.2s;-webkit-user-select:none;user-select:none}.el-slider__button.dragging,.el-slider__button.hover,.el-slider__button:hover{-webkit-transform:scale(1.2);transform:scale(1.2)}.el-slider__button.hover,.el-slider__button:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__stop{height:6px;width:6px;border-radius:100%;background-color:#FFF;transform:translateX(-50%)}.el-slider__marks{top:0;left:12px;width:18px;height:100%}.el-slider__marks-text{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%);font-size:14px;color:#909399;margin-top:15px}.el-slider.is-vertical{position:relative}.el-slider.is-vertical .el-slider__runway{width:6px;height:100%;margin:0 16px}.el-slider.is-vertical .el-slider__bar{width:6px;height:auto;border-radius:0 0 3px 3px}.el-slider.is-vertical .el-slider__button-wrapper{top:auto;left:-15px;-webkit-transform:translateY(50%);transform:translateY(50%)}.el-slider.is-vertical .el-slider__stop{-webkit-transform:translateY(50%);transform:translateY(50%)}.el-slider.is-vertical.el-slider--with-input{padding-bottom:58px}.el-slider.is-vertical.el-slider--with-input .el-slider__input{overflow:visible;float:none;position:absolute;bottom:22px;width:36px;margin-top:15px}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input__inner{text-align:center;padding-left:5px;padding-right:5px}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__decrease,.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__increase{top:32px;margin-top:-1px;border:1px solid #DCDFE6;line-height:20px;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__decrease{width:18px;right:18px;border-bottom-left-radius:4px}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__increase{width:19px;border-bottom-right-radius:4px}.el-slider.is-vertical.el-slider--with-input .el-slider__input .el-input-number__increase~.el-input .el-input__inner{border-bottom-left-radius:0;border-bottom-right-radius:0}.el-slider.is-vertical.el-slider--with-input .el-slider__input:hover .el-input-number__decrease,.el-slider.is-vertical.el-slider--with-input .el-slider__input:hover .el-input-number__increase{border-color:#C0C4CC}.el-slider.is-vertical.el-slider--with-input .el-slider__input:active .el-input-number__decrease,.el-slider.is-vertical.el-slider--with-input .el-slider__input:active .el-input-number__increase{border-color:#409EFF}.el-slider.is-vertical .el-slider__marks-text{margin-top:0;left:15px;-webkit-transform:translateY(50%);transform:translateY(50%)}.el-loading-parent--relative{position:relative!important}.el-loading-parent--hidden{overflow:hidden!important}.el-loading-mask{position:absolute;z-index:2000;background-color:rgba(255,255,255,.9);margin:0;top:0;right:0;bottom:0;left:0;-webkit-transition:opacity .3s;transition:opacity .3s}.el-loading-mask.is-fullscreen{position:fixed}.el-loading-mask.is-fullscreen .el-loading-spinner{margin-top:-25px}.el-loading-mask.is-fullscreen .el-loading-spinner .circular{height:50px;width:50px}.el-loading-spinner{top:50%;margin-top:-21px;width:100%;text-align:center;position:absolute}.el-col-pull-0,.el-col-pull-1,.el-col-pull-10,.el-col-pull-11,.el-col-pull-12,.el-col-pull-13,.el-col-pull-14,.el-col-pull-15,.el-col-pull-16,.el-col-pull-17,.el-col-pull-18,.el-col-pull-19,.el-col-pull-2,.el-col-pull-20,.el-col-pull-21,.el-col-pull-22,.el-col-pull-23,.el-col-pull-24,.el-col-pull-3,.el-col-pull-4,.el-col-pull-5,.el-col-pull-6,.el-col-pull-7,.el-col-pull-8,.el-col-pull-9,.el-col-push-0,.el-col-push-1,.el-col-push-10,.el-col-push-11,.el-col-push-12,.el-col-push-13,.el-col-push-14,.el-col-push-15,.el-col-push-16,.el-col-push-17,.el-col-push-18,.el-col-push-19,.el-col-push-2,.el-col-push-20,.el-col-push-21,.el-col-push-22,.el-col-push-23,.el-col-push-24,.el-col-push-3,.el-col-push-4,.el-col-push-5,.el-col-push-6,.el-col-push-7,.el-col-push-8,.el-col-push-9,.el-row,.el-upload-dragger,.el-upload-list__item{position:relative}.el-loading-spinner .el-loading-text{color:#409EFF;margin:3px 0;font-size:14px}.el-loading-spinner .circular{height:42px;width:42px;-webkit-animation:loading-rotate 2s linear infinite;animation:loading-rotate 2s linear infinite}.el-loading-spinner .path{-webkit-animation:loading-dash 1.5s ease-in-out infinite;animation:loading-dash 1.5s ease-in-out infinite;stroke-dasharray:90,150;stroke-dashoffset:0;stroke-width:2;stroke:#409EFF;stroke-linecap:round}.el-loading-spinner i{color:#409EFF}@-webkit-keyframes loading-rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes loading-rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}100%{stroke-dasharray:90,150;stroke-dashoffset:-120px}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}100%{stroke-dasharray:90,150;stroke-dashoffset:-120px}}.el-row{-webkit-box-sizing:border-box;box-sizing:border-box}.el-row::after,.el-row::before{display:table}.el-row::after{clear:both}.el-row--flex{display:-webkit-box;display:-ms-flexbox;display:flex}.el-col-0,.el-row--flex:after,.el-row--flex:before{display:none}.el-row--flex.is-justify-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-row--flex.is-justify-end{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.el-row--flex.is-justify-space-between{-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.el-row--flex.is-justify-space-around{-ms-flex-pack:distribute;justify-content:space-around}.el-row--flex.is-align-top{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.el-row--flex.is-align-middle{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-row--flex.is-align-bottom{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}[class*=el-col-]{float:left;-webkit-box-sizing:border-box;box-sizing:border-box}.el-col-0{width:0%}.el-col-pull-0{right:0}.el-col-push-0{left:0}.el-col-1{width:4.16667%}.el-col-offset-1{margin-left:4.16667%}.el-col-pull-1{right:4.16667%}.el-col-push-1{left:4.16667%}.el-col-2{width:8.33333%}.el-col-offset-2{margin-left:8.33333%}.el-col-pull-2{right:8.33333%}.el-col-push-2{left:8.33333%}.el-col-3{width:12.5%}.el-col-offset-3{margin-left:12.5%}.el-col-pull-3{right:12.5%}.el-col-push-3{left:12.5%}.el-col-4{width:16.66667%}.el-col-offset-4{margin-left:16.66667%}.el-col-pull-4{right:16.66667%}.el-col-push-4{left:16.66667%}.el-col-5{width:20.83333%}.el-col-offset-5{margin-left:20.83333%}.el-col-pull-5{right:20.83333%}.el-col-push-5{left:20.83333%}.el-col-6{width:25%}.el-col-offset-6{margin-left:25%}.el-col-pull-6{right:25%}.el-col-push-6{left:25%}.el-col-7{width:29.16667%}.el-col-offset-7{margin-left:29.16667%}.el-col-pull-7{right:29.16667%}.el-col-push-7{left:29.16667%}.el-col-8{width:33.33333%}.el-col-offset-8{margin-left:33.33333%}.el-col-pull-8{right:33.33333%}.el-col-push-8{left:33.33333%}.el-col-9{width:37.5%}.el-col-offset-9{margin-left:37.5%}.el-col-pull-9{right:37.5%}.el-col-push-9{left:37.5%}.el-col-10{width:41.66667%}.el-col-offset-10{margin-left:41.66667%}.el-col-pull-10{right:41.66667%}.el-col-push-10{left:41.66667%}.el-col-11{width:45.83333%}.el-col-offset-11{margin-left:45.83333%}.el-col-pull-11{right:45.83333%}.el-col-push-11{left:45.83333%}.el-col-12{width:50%}.el-col-offset-12{margin-left:50%}.el-col-pull-12{right:50%}.el-col-push-12{left:50%}.el-col-13{width:54.16667%}.el-col-offset-13{margin-left:54.16667%}.el-col-pull-13{right:54.16667%}.el-col-push-13{left:54.16667%}.el-col-14{width:58.33333%}.el-col-offset-14{margin-left:58.33333%}.el-col-pull-14{right:58.33333%}.el-col-push-14{left:58.33333%}.el-col-15{width:62.5%}.el-col-offset-15{margin-left:62.5%}.el-col-pull-15{right:62.5%}.el-col-push-15{left:62.5%}.el-col-16{width:66.66667%}.el-col-offset-16{margin-left:66.66667%}.el-col-pull-16{right:66.66667%}.el-col-push-16{left:66.66667%}.el-col-17{width:70.83333%}.el-col-offset-17{margin-left:70.83333%}.el-col-pull-17{right:70.83333%}.el-col-push-17{left:70.83333%}.el-col-18{width:75%}.el-col-offset-18{margin-left:75%}.el-col-pull-18{right:75%}.el-col-push-18{left:75%}.el-col-19{width:79.16667%}.el-col-offset-19{margin-left:79.16667%}.el-col-pull-19{right:79.16667%}.el-col-push-19{left:79.16667%}.el-col-20{width:83.33333%}.el-col-offset-20{margin-left:83.33333%}.el-col-pull-20{right:83.33333%}.el-col-push-20{left:83.33333%}.el-col-21{width:87.5%}.el-col-offset-21{margin-left:87.5%}.el-col-pull-21{right:87.5%}.el-col-push-21{left:87.5%}.el-col-22{width:91.66667%}.el-col-offset-22{margin-left:91.66667%}.el-col-pull-22{right:91.66667%}.el-col-push-22{left:91.66667%}.el-col-23{width:95.83333%}.el-col-offset-23{margin-left:95.83333%}.el-col-pull-23{right:95.83333%}.el-col-push-23{left:95.83333%}.el-col-24{width:100%}.el-col-offset-24{margin-left:100%}.el-col-pull-24{right:100%}.el-col-push-24{left:100%}@media only screen and (max-width:767px){.el-col-xs-0{display:none;width:0%}.el-col-xs-offset-0{margin-left:0}.el-col-xs-pull-0{position:relative;right:0}.el-col-xs-push-0{position:relative;left:0}.el-col-xs-1{width:4.16667%}.el-col-xs-offset-1{margin-left:4.16667%}.el-col-xs-pull-1{position:relative;right:4.16667%}.el-col-xs-push-1{position:relative;left:4.16667%}.el-col-xs-2{width:8.33333%}.el-col-xs-offset-2{margin-left:8.33333%}.el-col-xs-pull-2{position:relative;right:8.33333%}.el-col-xs-push-2{position:relative;left:8.33333%}.el-col-xs-3{width:12.5%}.el-col-xs-offset-3{margin-left:12.5%}.el-col-xs-pull-3{position:relative;right:12.5%}.el-col-xs-push-3{position:relative;left:12.5%}.el-col-xs-4{width:16.66667%}.el-col-xs-offset-4{margin-left:16.66667%}.el-col-xs-pull-4{position:relative;right:16.66667%}.el-col-xs-push-4{position:relative;left:16.66667%}.el-col-xs-5{width:20.83333%}.el-col-xs-offset-5{margin-left:20.83333%}.el-col-xs-pull-5{position:relative;right:20.83333%}.el-col-xs-push-5{position:relative;left:20.83333%}.el-col-xs-6{width:25%}.el-col-xs-offset-6{margin-left:25%}.el-col-xs-pull-6{position:relative;right:25%}.el-col-xs-push-6{position:relative;left:25%}.el-col-xs-7{width:29.16667%}.el-col-xs-offset-7{margin-left:29.16667%}.el-col-xs-pull-7{position:relative;right:29.16667%}.el-col-xs-push-7{position:relative;left:29.16667%}.el-col-xs-8{width:33.33333%}.el-col-xs-offset-8{margin-left:33.33333%}.el-col-xs-pull-8{position:relative;right:33.33333%}.el-col-xs-push-8{position:relative;left:33.33333%}.el-col-xs-9{width:37.5%}.el-col-xs-offset-9{margin-left:37.5%}.el-col-xs-pull-9{position:relative;right:37.5%}.el-col-xs-push-9{position:relative;left:37.5%}.el-col-xs-10{width:41.66667%}.el-col-xs-offset-10{margin-left:41.66667%}.el-col-xs-pull-10{position:relative;right:41.66667%}.el-col-xs-push-10{position:relative;left:41.66667%}.el-col-xs-11{width:45.83333%}.el-col-xs-offset-11{margin-left:45.83333%}.el-col-xs-pull-11{position:relative;right:45.83333%}.el-col-xs-push-11{position:relative;left:45.83333%}.el-col-xs-12{width:50%}.el-col-xs-offset-12{margin-left:50%}.el-col-xs-pull-12{position:relative;right:50%}.el-col-xs-push-12{position:relative;left:50%}.el-col-xs-13{width:54.16667%}.el-col-xs-offset-13{margin-left:54.16667%}.el-col-xs-pull-13{position:relative;right:54.16667%}.el-col-xs-push-13{position:relative;left:54.16667%}.el-col-xs-14{width:58.33333%}.el-col-xs-offset-14{margin-left:58.33333%}.el-col-xs-pull-14{position:relative;right:58.33333%}.el-col-xs-push-14{position:relative;left:58.33333%}.el-col-xs-15{width:62.5%}.el-col-xs-offset-15{margin-left:62.5%}.el-col-xs-pull-15{position:relative;right:62.5%}.el-col-xs-push-15{position:relative;left:62.5%}.el-col-xs-16{width:66.66667%}.el-col-xs-offset-16{margin-left:66.66667%}.el-col-xs-pull-16{position:relative;right:66.66667%}.el-col-xs-push-16{position:relative;left:66.66667%}.el-col-xs-17{width:70.83333%}.el-col-xs-offset-17{margin-left:70.83333%}.el-col-xs-pull-17{position:relative;right:70.83333%}.el-col-xs-push-17{position:relative;left:70.83333%}.el-col-xs-18{width:75%}.el-col-xs-offset-18{margin-left:75%}.el-col-xs-pull-18{position:relative;right:75%}.el-col-xs-push-18{position:relative;left:75%}.el-col-xs-19{width:79.16667%}.el-col-xs-offset-19{margin-left:79.16667%}.el-col-xs-pull-19{position:relative;right:79.16667%}.el-col-xs-push-19{position:relative;left:79.16667%}.el-col-xs-20{width:83.33333%}.el-col-xs-offset-20{margin-left:83.33333%}.el-col-xs-pull-20{position:relative;right:83.33333%}.el-col-xs-push-20{position:relative;left:83.33333%}.el-col-xs-21{width:87.5%}.el-col-xs-offset-21{margin-left:87.5%}.el-col-xs-pull-21{position:relative;right:87.5%}.el-col-xs-push-21{position:relative;left:87.5%}.el-col-xs-22{width:91.66667%}.el-col-xs-offset-22{margin-left:91.66667%}.el-col-xs-pull-22{position:relative;right:91.66667%}.el-col-xs-push-22{position:relative;left:91.66667%}.el-col-xs-23{width:95.83333%}.el-col-xs-offset-23{margin-left:95.83333%}.el-col-xs-pull-23{position:relative;right:95.83333%}.el-col-xs-push-23{position:relative;left:95.83333%}.el-col-xs-24{width:100%}.el-col-xs-offset-24{margin-left:100%}.el-col-xs-pull-24{position:relative;right:100%}.el-col-xs-push-24{position:relative;left:100%}}@media only screen and (min-width:768px){.el-col-sm-0{display:none;width:0%}.el-col-sm-offset-0{margin-left:0}.el-col-sm-pull-0{position:relative;right:0}.el-col-sm-push-0{position:relative;left:0}.el-col-sm-1{width:4.16667%}.el-col-sm-offset-1{margin-left:4.16667%}.el-col-sm-pull-1{position:relative;right:4.16667%}.el-col-sm-push-1{position:relative;left:4.16667%}.el-col-sm-2{width:8.33333%}.el-col-sm-offset-2{margin-left:8.33333%}.el-col-sm-pull-2{position:relative;right:8.33333%}.el-col-sm-push-2{position:relative;left:8.33333%}.el-col-sm-3{width:12.5%}.el-col-sm-offset-3{margin-left:12.5%}.el-col-sm-pull-3{position:relative;right:12.5%}.el-col-sm-push-3{position:relative;left:12.5%}.el-col-sm-4{width:16.66667%}.el-col-sm-offset-4{margin-left:16.66667%}.el-col-sm-pull-4{position:relative;right:16.66667%}.el-col-sm-push-4{position:relative;left:16.66667%}.el-col-sm-5{width:20.83333%}.el-col-sm-offset-5{margin-left:20.83333%}.el-col-sm-pull-5{position:relative;right:20.83333%}.el-col-sm-push-5{position:relative;left:20.83333%}.el-col-sm-6{width:25%}.el-col-sm-offset-6{margin-left:25%}.el-col-sm-pull-6{position:relative;right:25%}.el-col-sm-push-6{position:relative;left:25%}.el-col-sm-7{width:29.16667%}.el-col-sm-offset-7{margin-left:29.16667%}.el-col-sm-pull-7{position:relative;right:29.16667%}.el-col-sm-push-7{position:relative;left:29.16667%}.el-col-sm-8{width:33.33333%}.el-col-sm-offset-8{margin-left:33.33333%}.el-col-sm-pull-8{position:relative;right:33.33333%}.el-col-sm-push-8{position:relative;left:33.33333%}.el-col-sm-9{width:37.5%}.el-col-sm-offset-9{margin-left:37.5%}.el-col-sm-pull-9{position:relative;right:37.5%}.el-col-sm-push-9{position:relative;left:37.5%}.el-col-sm-10{width:41.66667%}.el-col-sm-offset-10{margin-left:41.66667%}.el-col-sm-pull-10{position:relative;right:41.66667%}.el-col-sm-push-10{position:relative;left:41.66667%}.el-col-sm-11{width:45.83333%}.el-col-sm-offset-11{margin-left:45.83333%}.el-col-sm-pull-11{position:relative;right:45.83333%}.el-col-sm-push-11{position:relative;left:45.83333%}.el-col-sm-12{width:50%}.el-col-sm-offset-12{margin-left:50%}.el-col-sm-pull-12{position:relative;right:50%}.el-col-sm-push-12{position:relative;left:50%}.el-col-sm-13{width:54.16667%}.el-col-sm-offset-13{margin-left:54.16667%}.el-col-sm-pull-13{position:relative;right:54.16667%}.el-col-sm-push-13{position:relative;left:54.16667%}.el-col-sm-14{width:58.33333%}.el-col-sm-offset-14{margin-left:58.33333%}.el-col-sm-pull-14{position:relative;right:58.33333%}.el-col-sm-push-14{position:relative;left:58.33333%}.el-col-sm-15{width:62.5%}.el-col-sm-offset-15{margin-left:62.5%}.el-col-sm-pull-15{position:relative;right:62.5%}.el-col-sm-push-15{position:relative;left:62.5%}.el-col-sm-16{width:66.66667%}.el-col-sm-offset-16{margin-left:66.66667%}.el-col-sm-pull-16{position:relative;right:66.66667%}.el-col-sm-push-16{position:relative;left:66.66667%}.el-col-sm-17{width:70.83333%}.el-col-sm-offset-17{margin-left:70.83333%}.el-col-sm-pull-17{position:relative;right:70.83333%}.el-col-sm-push-17{position:relative;left:70.83333%}.el-col-sm-18{width:75%}.el-col-sm-offset-18{margin-left:75%}.el-col-sm-pull-18{position:relative;right:75%}.el-col-sm-push-18{position:relative;left:75%}.el-col-sm-19{width:79.16667%}.el-col-sm-offset-19{margin-left:79.16667%}.el-col-sm-pull-19{position:relative;right:79.16667%}.el-col-sm-push-19{position:relative;left:79.16667%}.el-col-sm-20{width:83.33333%}.el-col-sm-offset-20{margin-left:83.33333%}.el-col-sm-pull-20{position:relative;right:83.33333%}.el-col-sm-push-20{position:relative;left:83.33333%}.el-col-sm-21{width:87.5%}.el-col-sm-offset-21{margin-left:87.5%}.el-col-sm-pull-21{position:relative;right:87.5%}.el-col-sm-push-21{position:relative;left:87.5%}.el-col-sm-22{width:91.66667%}.el-col-sm-offset-22{margin-left:91.66667%}.el-col-sm-pull-22{position:relative;right:91.66667%}.el-col-sm-push-22{position:relative;left:91.66667%}.el-col-sm-23{width:95.83333%}.el-col-sm-offset-23{margin-left:95.83333%}.el-col-sm-pull-23{position:relative;right:95.83333%}.el-col-sm-push-23{position:relative;left:95.83333%}.el-col-sm-24{width:100%}.el-col-sm-offset-24{margin-left:100%}.el-col-sm-pull-24{position:relative;right:100%}.el-col-sm-push-24{position:relative;left:100%}}@media only screen and (min-width:992px){.el-col-md-0{display:none;width:0%}.el-col-md-offset-0{margin-left:0}.el-col-md-pull-0{position:relative;right:0}.el-col-md-push-0{position:relative;left:0}.el-col-md-1{width:4.16667%}.el-col-md-offset-1{margin-left:4.16667%}.el-col-md-pull-1{position:relative;right:4.16667%}.el-col-md-push-1{position:relative;left:4.16667%}.el-col-md-2{width:8.33333%}.el-col-md-offset-2{margin-left:8.33333%}.el-col-md-pull-2{position:relative;right:8.33333%}.el-col-md-push-2{position:relative;left:8.33333%}.el-col-md-3{width:12.5%}.el-col-md-offset-3{margin-left:12.5%}.el-col-md-pull-3{position:relative;right:12.5%}.el-col-md-push-3{position:relative;left:12.5%}.el-col-md-4{width:16.66667%}.el-col-md-offset-4{margin-left:16.66667%}.el-col-md-pull-4{position:relative;right:16.66667%}.el-col-md-push-4{position:relative;left:16.66667%}.el-col-md-5{width:20.83333%}.el-col-md-offset-5{margin-left:20.83333%}.el-col-md-pull-5{position:relative;right:20.83333%}.el-col-md-push-5{position:relative;left:20.83333%}.el-col-md-6{width:25%}.el-col-md-offset-6{margin-left:25%}.el-col-md-pull-6{position:relative;right:25%}.el-col-md-push-6{position:relative;left:25%}.el-col-md-7{width:29.16667%}.el-col-md-offset-7{margin-left:29.16667%}.el-col-md-pull-7{position:relative;right:29.16667%}.el-col-md-push-7{position:relative;left:29.16667%}.el-col-md-8{width:33.33333%}.el-col-md-offset-8{margin-left:33.33333%}.el-col-md-pull-8{position:relative;right:33.33333%}.el-col-md-push-8{position:relative;left:33.33333%}.el-col-md-9{width:37.5%}.el-col-md-offset-9{margin-left:37.5%}.el-col-md-pull-9{position:relative;right:37.5%}.el-col-md-push-9{position:relative;left:37.5%}.el-col-md-10{width:41.66667%}.el-col-md-offset-10{margin-left:41.66667%}.el-col-md-pull-10{position:relative;right:41.66667%}.el-col-md-push-10{position:relative;left:41.66667%}.el-col-md-11{width:45.83333%}.el-col-md-offset-11{margin-left:45.83333%}.el-col-md-pull-11{position:relative;right:45.83333%}.el-col-md-push-11{position:relative;left:45.83333%}.el-col-md-12{width:50%}.el-col-md-offset-12{margin-left:50%}.el-col-md-pull-12{position:relative;right:50%}.el-col-md-push-12{position:relative;left:50%}.el-col-md-13{width:54.16667%}.el-col-md-offset-13{margin-left:54.16667%}.el-col-md-pull-13{position:relative;right:54.16667%}.el-col-md-push-13{position:relative;left:54.16667%}.el-col-md-14{width:58.33333%}.el-col-md-offset-14{margin-left:58.33333%}.el-col-md-pull-14{position:relative;right:58.33333%}.el-col-md-push-14{position:relative;left:58.33333%}.el-col-md-15{width:62.5%}.el-col-md-offset-15{margin-left:62.5%}.el-col-md-pull-15{position:relative;right:62.5%}.el-col-md-push-15{position:relative;left:62.5%}.el-col-md-16{width:66.66667%}.el-col-md-offset-16{margin-left:66.66667%}.el-col-md-pull-16{position:relative;right:66.66667%}.el-col-md-push-16{position:relative;left:66.66667%}.el-col-md-17{width:70.83333%}.el-col-md-offset-17{margin-left:70.83333%}.el-col-md-pull-17{position:relative;right:70.83333%}.el-col-md-push-17{position:relative;left:70.83333%}.el-col-md-18{width:75%}.el-col-md-offset-18{margin-left:75%}.el-col-md-pull-18{position:relative;right:75%}.el-col-md-push-18{position:relative;left:75%}.el-col-md-19{width:79.16667%}.el-col-md-offset-19{margin-left:79.16667%}.el-col-md-pull-19{position:relative;right:79.16667%}.el-col-md-push-19{position:relative;left:79.16667%}.el-col-md-20{width:83.33333%}.el-col-md-offset-20{margin-left:83.33333%}.el-col-md-pull-20{position:relative;right:83.33333%}.el-col-md-push-20{position:relative;left:83.33333%}.el-col-md-21{width:87.5%}.el-col-md-offset-21{margin-left:87.5%}.el-col-md-pull-21{position:relative;right:87.5%}.el-col-md-push-21{position:relative;left:87.5%}.el-col-md-22{width:91.66667%}.el-col-md-offset-22{margin-left:91.66667%}.el-col-md-pull-22{position:relative;right:91.66667%}.el-col-md-push-22{position:relative;left:91.66667%}.el-col-md-23{width:95.83333%}.el-col-md-offset-23{margin-left:95.83333%}.el-col-md-pull-23{position:relative;right:95.83333%}.el-col-md-push-23{position:relative;left:95.83333%}.el-col-md-24{width:100%}.el-col-md-offset-24{margin-left:100%}.el-col-md-pull-24{position:relative;right:100%}.el-col-md-push-24{position:relative;left:100%}}@media only screen and (min-width:1200px){.el-col-lg-0{display:none;width:0%}.el-col-lg-offset-0{margin-left:0}.el-col-lg-pull-0{position:relative;right:0}.el-col-lg-push-0{position:relative;left:0}.el-col-lg-1{width:4.16667%}.el-col-lg-offset-1{margin-left:4.16667%}.el-col-lg-pull-1{position:relative;right:4.16667%}.el-col-lg-push-1{position:relative;left:4.16667%}.el-col-lg-2{width:8.33333%}.el-col-lg-offset-2{margin-left:8.33333%}.el-col-lg-pull-2{position:relative;right:8.33333%}.el-col-lg-push-2{position:relative;left:8.33333%}.el-col-lg-3{width:12.5%}.el-col-lg-offset-3{margin-left:12.5%}.el-col-lg-pull-3{position:relative;right:12.5%}.el-col-lg-push-3{position:relative;left:12.5%}.el-col-lg-4{width:16.66667%}.el-col-lg-offset-4{margin-left:16.66667%}.el-col-lg-pull-4{position:relative;right:16.66667%}.el-col-lg-push-4{position:relative;left:16.66667%}.el-col-lg-5{width:20.83333%}.el-col-lg-offset-5{margin-left:20.83333%}.el-col-lg-pull-5{position:relative;right:20.83333%}.el-col-lg-push-5{position:relative;left:20.83333%}.el-col-lg-6{width:25%}.el-col-lg-offset-6{margin-left:25%}.el-col-lg-pull-6{position:relative;right:25%}.el-col-lg-push-6{position:relative;left:25%}.el-col-lg-7{width:29.16667%}.el-col-lg-offset-7{margin-left:29.16667%}.el-col-lg-pull-7{position:relative;right:29.16667%}.el-col-lg-push-7{position:relative;left:29.16667%}.el-col-lg-8{width:33.33333%}.el-col-lg-offset-8{margin-left:33.33333%}.el-col-lg-pull-8{position:relative;right:33.33333%}.el-col-lg-push-8{position:relative;left:33.33333%}.el-col-lg-9{width:37.5%}.el-col-lg-offset-9{margin-left:37.5%}.el-col-lg-pull-9{position:relative;right:37.5%}.el-col-lg-push-9{position:relative;left:37.5%}.el-col-lg-10{width:41.66667%}.el-col-lg-offset-10{margin-left:41.66667%}.el-col-lg-pull-10{position:relative;right:41.66667%}.el-col-lg-push-10{position:relative;left:41.66667%}.el-col-lg-11{width:45.83333%}.el-col-lg-offset-11{margin-left:45.83333%}.el-col-lg-pull-11{position:relative;right:45.83333%}.el-col-lg-push-11{position:relative;left:45.83333%}.el-col-lg-12{width:50%}.el-col-lg-offset-12{margin-left:50%}.el-col-lg-pull-12{position:relative;right:50%}.el-col-lg-push-12{position:relative;left:50%}.el-col-lg-13{width:54.16667%}.el-col-lg-offset-13{margin-left:54.16667%}.el-col-lg-pull-13{position:relative;right:54.16667%}.el-col-lg-push-13{position:relative;left:54.16667%}.el-col-lg-14{width:58.33333%}.el-col-lg-offset-14{margin-left:58.33333%}.el-col-lg-pull-14{position:relative;right:58.33333%}.el-col-lg-push-14{position:relative;left:58.33333%}.el-col-lg-15{width:62.5%}.el-col-lg-offset-15{margin-left:62.5%}.el-col-lg-pull-15{position:relative;right:62.5%}.el-col-lg-push-15{position:relative;left:62.5%}.el-col-lg-16{width:66.66667%}.el-col-lg-offset-16{margin-left:66.66667%}.el-col-lg-pull-16{position:relative;right:66.66667%}.el-col-lg-push-16{position:relative;left:66.66667%}.el-col-lg-17{width:70.83333%}.el-col-lg-offset-17{margin-left:70.83333%}.el-col-lg-pull-17{position:relative;right:70.83333%}.el-col-lg-push-17{position:relative;left:70.83333%}.el-col-lg-18{width:75%}.el-col-lg-offset-18{margin-left:75%}.el-col-lg-pull-18{position:relative;right:75%}.el-col-lg-push-18{position:relative;left:75%}.el-col-lg-19{width:79.16667%}.el-col-lg-offset-19{margin-left:79.16667%}.el-col-lg-pull-19{position:relative;right:79.16667%}.el-col-lg-push-19{position:relative;left:79.16667%}.el-col-lg-20{width:83.33333%}.el-col-lg-offset-20{margin-left:83.33333%}.el-col-lg-pull-20{position:relative;right:83.33333%}.el-col-lg-push-20{position:relative;left:83.33333%}.el-col-lg-21{width:87.5%}.el-col-lg-offset-21{margin-left:87.5%}.el-col-lg-pull-21{position:relative;right:87.5%}.el-col-lg-push-21{position:relative;left:87.5%}.el-col-lg-22{width:91.66667%}.el-col-lg-offset-22{margin-left:91.66667%}.el-col-lg-pull-22{position:relative;right:91.66667%}.el-col-lg-push-22{position:relative;left:91.66667%}.el-col-lg-23{width:95.83333%}.el-col-lg-offset-23{margin-left:95.83333%}.el-col-lg-pull-23{position:relative;right:95.83333%}.el-col-lg-push-23{position:relative;left:95.83333%}.el-col-lg-24{width:100%}.el-col-lg-offset-24{margin-left:100%}.el-col-lg-pull-24{position:relative;right:100%}.el-col-lg-push-24{position:relative;left:100%}}@media only screen and (min-width:1920px){.el-col-xl-0{display:none;width:0%}.el-col-xl-offset-0{margin-left:0}.el-col-xl-pull-0{position:relative;right:0}.el-col-xl-push-0{position:relative;left:0}.el-col-xl-1{width:4.16667%}.el-col-xl-offset-1{margin-left:4.16667%}.el-col-xl-pull-1{position:relative;right:4.16667%}.el-col-xl-push-1{position:relative;left:4.16667%}.el-col-xl-2{width:8.33333%}.el-col-xl-offset-2{margin-left:8.33333%}.el-col-xl-pull-2{position:relative;right:8.33333%}.el-col-xl-push-2{position:relative;left:8.33333%}.el-col-xl-3{width:12.5%}.el-col-xl-offset-3{margin-left:12.5%}.el-col-xl-pull-3{position:relative;right:12.5%}.el-col-xl-push-3{position:relative;left:12.5%}.el-col-xl-4{width:16.66667%}.el-col-xl-offset-4{margin-left:16.66667%}.el-col-xl-pull-4{position:relative;right:16.66667%}.el-col-xl-push-4{position:relative;left:16.66667%}.el-col-xl-5{width:20.83333%}.el-col-xl-offset-5{margin-left:20.83333%}.el-col-xl-pull-5{position:relative;right:20.83333%}.el-col-xl-push-5{position:relative;left:20.83333%}.el-col-xl-6{width:25%}.el-col-xl-offset-6{margin-left:25%}.el-col-xl-pull-6{position:relative;right:25%}.el-col-xl-push-6{position:relative;left:25%}.el-col-xl-7{width:29.16667%}.el-col-xl-offset-7{margin-left:29.16667%}.el-col-xl-pull-7{position:relative;right:29.16667%}.el-col-xl-push-7{position:relative;left:29.16667%}.el-col-xl-8{width:33.33333%}.el-col-xl-offset-8{margin-left:33.33333%}.el-col-xl-pull-8{position:relative;right:33.33333%}.el-col-xl-push-8{position:relative;left:33.33333%}.el-col-xl-9{width:37.5%}.el-col-xl-offset-9{margin-left:37.5%}.el-col-xl-pull-9{position:relative;right:37.5%}.el-col-xl-push-9{position:relative;left:37.5%}.el-col-xl-10{width:41.66667%}.el-col-xl-offset-10{margin-left:41.66667%}.el-col-xl-pull-10{position:relative;right:41.66667%}.el-col-xl-push-10{position:relative;left:41.66667%}.el-col-xl-11{width:45.83333%}.el-col-xl-offset-11{margin-left:45.83333%}.el-col-xl-pull-11{position:relative;right:45.83333%}.el-col-xl-push-11{position:relative;left:45.83333%}.el-col-xl-12{width:50%}.el-col-xl-offset-12{margin-left:50%}.el-col-xl-pull-12{position:relative;right:50%}.el-col-xl-push-12{position:relative;left:50%}.el-col-xl-13{width:54.16667%}.el-col-xl-offset-13{margin-left:54.16667%}.el-col-xl-pull-13{position:relative;right:54.16667%}.el-col-xl-push-13{position:relative;left:54.16667%}.el-col-xl-14{width:58.33333%}.el-col-xl-offset-14{margin-left:58.33333%}.el-col-xl-pull-14{position:relative;right:58.33333%}.el-col-xl-push-14{position:relative;left:58.33333%}.el-col-xl-15{width:62.5%}.el-col-xl-offset-15{margin-left:62.5%}.el-col-xl-pull-15{position:relative;right:62.5%}.el-col-xl-push-15{position:relative;left:62.5%}.el-col-xl-16{width:66.66667%}.el-col-xl-offset-16{margin-left:66.66667%}.el-col-xl-pull-16{position:relative;right:66.66667%}.el-col-xl-push-16{position:relative;left:66.66667%}.el-col-xl-17{width:70.83333%}.el-col-xl-offset-17{margin-left:70.83333%}.el-col-xl-pull-17{position:relative;right:70.83333%}.el-col-xl-push-17{position:relative;left:70.83333%}.el-col-xl-18{width:75%}.el-col-xl-offset-18{margin-left:75%}.el-col-xl-pull-18{position:relative;right:75%}.el-col-xl-push-18{position:relative;left:75%}.el-col-xl-19{width:79.16667%}.el-col-xl-offset-19{margin-left:79.16667%}.el-col-xl-pull-19{position:relative;right:79.16667%}.el-col-xl-push-19{position:relative;left:79.16667%}.el-col-xl-20{width:83.33333%}.el-col-xl-offset-20{margin-left:83.33333%}.el-col-xl-pull-20{position:relative;right:83.33333%}.el-col-xl-push-20{position:relative;left:83.33333%}.el-col-xl-21{width:87.5%}.el-col-xl-offset-21{margin-left:87.5%}.el-col-xl-pull-21{position:relative;right:87.5%}.el-col-xl-push-21{position:relative;left:87.5%}.el-col-xl-22{width:91.66667%}.el-col-xl-offset-22{margin-left:91.66667%}.el-col-xl-pull-22{position:relative;right:91.66667%}.el-col-xl-push-22{position:relative;left:91.66667%}.el-col-xl-23{width:95.83333%}.el-col-xl-offset-23{margin-left:95.83333%}.el-col-xl-pull-23{position:relative;right:95.83333%}.el-col-xl-push-23{position:relative;left:95.83333%}.el-col-xl-24{width:100%}.el-col-xl-offset-24{margin-left:100%}.el-col-xl-pull-24{position:relative;right:100%}.el-col-xl-push-24{position:relative;left:100%}}@-webkit-keyframes progress{0%{background-position:0 0}100%{background-position:32px 0}}.el-upload{display:inline-block;text-align:center;cursor:pointer;outline:0}.el-upload__input{display:none}.el-upload__tip{font-size:12px;color:#606266;margin-top:7px}.el-upload iframe{position:absolute;z-index:-1;top:0;left:0;filter:alpha(opacity=0)}.el-upload--picture-card{background-color:#fbfdff;border:1px dashed #c0ccda;border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;width:148px;height:148px;cursor:pointer;line-height:146px;vertical-align:top}.el-upload--picture-card i{font-size:28px;color:#8c939d}.el-upload--picture-card:hover,.el-upload:focus{border-color:#409EFF;color:#409EFF}.el-upload:focus .el-upload-dragger{border-color:#409EFF}.el-upload-dragger{background-color:#fff;border:1px dashed #d9d9d9;border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;width:360px;height:180px;text-align:center;cursor:pointer;overflow:hidden}.el-upload-dragger .el-icon-upload{font-size:67px;color:#C0C4CC;margin:40px 0 16px;line-height:50px}.el-upload-dragger+.el-upload__tip{text-align:center}.el-upload-dragger~.el-upload__files{border-top:1px solid #DCDFE6;margin-top:7px;padding-top:5px}.el-upload-dragger .el-upload__text{color:#606266;font-size:14px;text-align:center}.el-upload-dragger .el-upload__text em{color:#409EFF;font-style:normal}.el-upload-dragger:hover{border-color:#409EFF}.el-upload-dragger.is-dragover{background-color:rgba(32,159,255,.06);border:2px dashed #409EFF}.el-upload-list{margin:0;padding:0;list-style:none}.el-upload-list__item{-webkit-transition:all .5s cubic-bezier(.55,0,.1,1);transition:all .5s cubic-bezier(.55,0,.1,1);font-size:14px;color:#606266;line-height:1.8;margin-top:5px;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;width:100%}.el-upload-list__item .el-progress{position:absolute;top:20px;width:100%}.el-upload-list__item .el-progress__text{position:absolute;right:0;top:-13px}.el-upload-list__item .el-progress-bar{margin-right:0;padding-right:0}.el-upload-list__item:first-child{margin-top:10px}.el-upload-list__item .el-icon-upload-success{color:#67C23A}.el-upload-list__item .el-icon-close{display:none;position:absolute;top:5px;right:5px;cursor:pointer;opacity:.75;color:#606266}.el-upload-list__item .el-icon-close:hover{opacity:1}.el-upload-list__item .el-icon-close-tip{display:none;position:absolute;top:5px;right:5px;font-size:12px;cursor:pointer;opacity:1;color:#409EFF}.el-upload-list__item:hover .el-icon-close{display:inline-block}.el-upload-list__item:hover .el-progress__text{display:none}.el-upload-list__item.is-success .el-upload-list__item-status-label{display:block}.el-upload-list__item.is-success .el-upload-list__item-name:focus,.el-upload-list__item.is-success .el-upload-list__item-name:hover{color:#409EFF;cursor:pointer}.el-upload-list__item.is-success:focus:not(:hover) .el-icon-close-tip{display:inline-block}.el-upload-list__item.is-success:active,.el-upload-list__item.is-success:not(.focusing):focus{outline-width:0}.el-upload-list__item.is-success:active .el-icon-close-tip,.el-upload-list__item.is-success:focus .el-upload-list__item-status-label,.el-upload-list__item.is-success:hover .el-upload-list__item-status-label,.el-upload-list__item.is-success:not(.focusing):focus .el-icon-close-tip{display:none}.el-upload-list.is-disabled .el-upload-list__item:hover .el-upload-list__item-status-label{display:block}.el-upload-list__item-name{color:#606266;display:block;margin-right:40px;overflow:hidden;padding-left:4px;text-overflow:ellipsis;-webkit-transition:color .3s;transition:color .3s;white-space:nowrap}.el-upload-list__item-name [class^=el-icon]{height:100%;margin-right:7px;color:#909399;line-height:inherit}.el-upload-list__item-status-label{position:absolute;right:5px;top:0;line-height:inherit;display:none}.el-upload-list__item-delete{position:absolute;right:10px;top:0;font-size:12px;color:#606266;display:none}.el-upload-list__item-delete:hover{color:#409EFF}.el-upload-list--picture-card{margin:0;display:inline;vertical-align:top}.el-upload-list--picture-card .el-upload-list__item{overflow:hidden;background-color:#fff;border:1px solid #c0ccda;border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;width:148px;height:148px;margin:0 8px 8px 0;display:inline-block}.el-upload-list--picture-card .el-upload-list__item .el-icon-check,.el-upload-list--picture-card .el-upload-list__item .el-icon-circle-check{color:#FFF}.el-upload-list--picture-card .el-upload-list__item .el-icon-close,.el-upload-list--picture-card .el-upload-list__item:hover .el-upload-list__item-status-label{display:none}.el-upload-list--picture-card .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture-card .el-upload-list__item-name{display:none}.el-upload-list--picture-card .el-upload-list__item-thumbnail{width:100%;height:100%}.el-upload-list--picture-card .el-upload-list__item-status-label{position:absolute;right:-15px;top:-6px;width:40px;height:24px;background:#13ce66;text-align:center;-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-shadow:0 0 1pc 1px rgba(0,0,0,.2);box-shadow:0 0 1pc 1px rgba(0,0,0,.2)}.el-upload-list--picture-card .el-upload-list__item-status-label i{font-size:12px;margin-top:11px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.el-upload-list--picture-card .el-upload-list__item-actions{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;text-align:center;color:#fff;opacity:0;font-size:20px;background-color:rgba(0,0,0,.5);-webkit-transition:opacity .3s;transition:opacity .3s}.el-upload-list--picture-card .el-upload-list__item-actions::after{display:inline-block;height:100%;vertical-align:middle}.el-upload-list--picture-card .el-upload-list__item-actions span{display:none;cursor:pointer}.el-upload-list--picture-card .el-upload-list__item-actions span+span{margin-left:15px}.el-upload-list--picture-card .el-upload-list__item-actions .el-upload-list__item-delete{position:static;font-size:inherit;color:inherit}.el-upload-list--picture-card .el-upload-list__item-actions:hover{opacity:1}.el-upload-list--picture-card .el-upload-list__item-actions:hover span{display:inline-block}.el-upload-list--picture-card .el-progress{top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);bottom:auto;width:126px}.el-upload-list--picture-card .el-progress .el-progress__text{top:50%}.el-upload-list--picture .el-upload-list__item{overflow:hidden;z-index:0;background-color:#fff;border:1px solid #c0ccda;border-radius:6px;-webkit-box-sizing:border-box;box-sizing:border-box;margin-top:10px;padding:10px 10px 10px 90px;height:92px}.el-upload-list--picture .el-upload-list__item .el-icon-check,.el-upload-list--picture .el-upload-list__item .el-icon-circle-check{color:#FFF}.el-upload-list--picture .el-upload-list__item:hover .el-upload-list__item-status-label{background:0 0;-webkit-box-shadow:none;box-shadow:none;top:-2px;right:-12px}.el-upload-list--picture .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name{line-height:70px;margin-top:0}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name i{display:none}.el-upload-list--picture .el-upload-list__item-thumbnail{vertical-align:middle;display:inline-block;width:70px;height:70px;float:left;position:relative;z-index:1;margin-left:-80px;background-color:#FFF}.el-upload-list--picture .el-upload-list__item-name{display:block;margin-top:20px}.el-upload-list--picture .el-upload-list__item-name i{font-size:70px;line-height:1;position:absolute;left:9px;top:10px}.el-upload-list--picture .el-upload-list__item-status-label{position:absolute;right:-17px;top:-7px;width:46px;height:26px;background:#13ce66;text-align:center;-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-shadow:0 1px 1px #ccc;box-shadow:0 1px 1px #ccc}.el-upload-list--picture .el-upload-list__item-status-label i{font-size:12px;margin-top:12px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.el-upload-list--picture .el-progress{position:relative;top:-7px}.el-upload-cover{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;z-index:10;cursor:default}.el-upload-cover::after{display:inline-block;height:100%;vertical-align:middle}.el-upload-cover img{display:block;width:100%;height:100%}.el-upload-cover__label{position:absolute;right:-15px;top:-6px;width:40px;height:24px;background:#13ce66;text-align:center;-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-shadow:0 0 1pc 1px rgba(0,0,0,.2);box-shadow:0 0 1pc 1px rgba(0,0,0,.2)}.el-upload-cover__label i{font-size:12px;margin-top:11px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);color:#fff}.el-upload-cover__progress{display:inline-block;vertical-align:middle;position:static;width:243px}.el-upload-cover__progress+.el-upload__inner{opacity:0}.el-upload-cover__content{position:absolute;top:0;left:0;width:100%;height:100%}.el-upload-cover__interact{position:absolute;bottom:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.72);text-align:center}.el-upload-cover__interact .btn{display:inline-block;color:#FFF;font-size:14px;cursor:pointer;vertical-align:middle;-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);margin-top:60px}.el-upload-cover__interact .btn span{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.el-upload-cover__interact .btn:not(:first-child){margin-left:35px}.el-upload-cover__interact .btn:hover{-webkit-transform:translateY(-13px);transform:translateY(-13px)}.el-upload-cover__interact .btn:hover span{opacity:1}.el-upload-cover__interact .btn i{color:#FFF;display:block;font-size:24px;line-height:inherit;margin:0 auto 5px}.el-upload-cover__title{position:absolute;bottom:0;left:0;background-color:#FFF;height:36px;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400;text-align:left;padding:0 10px;margin:0;line-height:36px;font-size:14px;color:#303133}.el-upload-cover+.el-upload__inner{opacity:0;position:relative;z-index:1}.el-progress{position:relative;line-height:1}.el-progress__text{font-size:14px;color:#606266;display:inline-block;vertical-align:middle;margin-left:10px;line-height:1}.el-progress__text i{vertical-align:middle;display:block}.el-progress--circle,.el-progress--dashboard{display:inline-block}.el-progress--circle .el-progress__text,.el-progress--dashboard .el-progress__text{position:absolute;top:50%;left:0;width:100%;text-align:center;margin:0;-webkit-transform:translate(0,-50%);transform:translate(0,-50%)}.el-progress--circle .el-progress__text i,.el-progress--dashboard .el-progress__text i{vertical-align:middle;display:inline-block}.el-progress--without-text .el-progress__text{display:none}.el-progress--without-text .el-progress-bar{padding-right:0;margin-right:0;display:block}.el-progress--text-inside .el-progress-bar{padding-right:0;margin-right:0}.el-progress.is-success .el-progress-bar__inner{background-color:#67C23A}.el-progress.is-success .el-progress__text{color:#67C23A}.el-progress.is-warning .el-progress-bar__inner{background-color:#E6A23C}.el-badge__content,.el-progress.is-exception .el-progress-bar__inner{background-color:#F56C6C}.el-progress.is-warning .el-progress__text{color:#E6A23C}.el-progress.is-exception .el-progress__text{color:#F56C6C}.el-progress-bar{padding-right:50px;display:inline-block;vertical-align:middle;width:100%;margin-right:-55px;-webkit-box-sizing:border-box;box-sizing:border-box}.el-card__header,.el-message,.el-step__icon{-webkit-box-sizing:border-box}.el-progress-bar__outer{height:6px;border-radius:100px;background-color:#EBEEF5;overflow:hidden;position:relative;vertical-align:middle}.el-progress-bar__inner{position:absolute;left:0;top:0;height:100%;background-color:#409EFF;text-align:right;border-radius:100px;line-height:1;white-space:nowrap;-webkit-transition:width .6s ease;transition:width .6s ease}.el-progress-bar__inner::after{display:inline-block;height:100%;vertical-align:middle}.el-progress-bar__innerText{display:inline-block;vertical-align:middle;color:#FFF;font-size:12px;margin:0 5px}@keyframes progress{0%{background-position:0 0}100%{background-position:32px 0}}.el-time-spinner{width:100%;white-space:nowrap}.el-spinner{display:inline-block;vertical-align:middle}.el-spinner-inner{-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite;width:50px;height:50px}.el-spinner-inner .path{stroke:#ececec;stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}.el-message{min-width:380px;box-sizing:border-box;border-radius:4px;border-width:1px;border-style:solid;border-color:#EBEEF5;position:fixed;left:50%;top:20px;-webkit-transform:translateX(-50%);transform:translateX(-50%);background-color:#edf2fc;-webkit-transition:opacity .3s,top .4s,-webkit-transform .4s;transition:opacity .3s,top .4s,-webkit-transform .4s;transition:opacity .3s,transform .4s,top .4s;transition:opacity .3s,transform .4s,top .4s,-webkit-transform .4s;overflow:hidden;padding:15px 15px 15px 20px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-message.is-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-message.is-closable .el-message__content{padding-right:16px}.el-message p{margin:0}.el-message--info .el-message__content{color:#909399}.el-message--success{background-color:#f0f9eb;border-color:#e1f3d8}.el-message--success .el-message__content{color:#67C23A}.el-message--warning{background-color:#fdf6ec;border-color:#faecd8}.el-message--warning .el-message__content{color:#E6A23C}.el-message--error{background-color:#fef0f0;border-color:#fde2e2}.el-message--error .el-message__content{color:#F56C6C}.el-message__icon{margin-right:10px}.el-message__content{padding:0;font-size:14px;line-height:1}.el-message__content:focus{outline-width:0}.el-message__closeBtn{position:absolute;top:50%;right:15px;-webkit-transform:translateY(-50%);transform:translateY(-50%);cursor:pointer;color:#C0C4CC;font-size:16px}.el-message__closeBtn:focus{outline-width:0}.el-message__closeBtn:hover{color:#909399}.el-message .el-icon-success{color:#67C23A}.el-message .el-icon-error{color:#F56C6C}.el-message .el-icon-info{color:#909399}.el-message .el-icon-warning{color:#E6A23C}.el-message-fade-enter,.el-message-fade-leave-active{opacity:0;-webkit-transform:translate(-50%,-100%);transform:translate(-50%,-100%)}.el-badge{position:relative;vertical-align:middle;display:inline-block}.el-badge__content{border-radius:10px;color:#FFF;display:inline-block;font-size:12px;height:18px;line-height:18px;padding:0 6px;text-align:center;white-space:nowrap;border:1px solid #FFF}.el-badge__content.is-fixed{position:absolute;top:0;right:10px;-webkit-transform:translateY(-50%) translateX(100%);transform:translateY(-50%) translateX(100%)}.el-rate__icon,.el-rate__item{position:relative;display:inline-block}.el-badge__content.is-fixed.is-dot{right:5px}.el-badge__content.is-dot{height:8px;width:8px;padding:0;right:0;border-radius:50%}.el-badge__content--primary{background-color:#409EFF}.el-badge__content--success{background-color:#67C23A}.el-badge__content--warning{background-color:#E6A23C}.el-badge__content--info{background-color:#909399}.el-badge__content--danger{background-color:#F56C6C}.el-card{border-radius:4px;border:1px solid #EBEEF5;background-color:#FFF;overflow:hidden;color:#303133;-webkit-transition:.3s;transition:.3s}.el-card.is-always-shadow,.el-card.is-hover-shadow:focus,.el-card.is-hover-shadow:hover{box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-card__header{padding:18px 20px;border-bottom:1px solid #EBEEF5;box-sizing:border-box}.el-card__body,.el-main{padding:20px}.el-rate{height:20px;line-height:1}.el-rate:active,.el-rate:focus{outline-width:0}.el-rate__item{font-size:0;vertical-align:middle}.el-rate__icon{font-size:18px;margin-right:6px;color:#C0C4CC;-webkit-transition:.3s;transition:.3s}.el-rate__decimal,.el-rate__icon .path2{position:absolute;top:0;left:0}.el-rate__icon.hover{-webkit-transform:scale(1.15);transform:scale(1.15)}.el-rate__decimal{display:inline-block;overflow:hidden}.el-step.is-vertical,.el-steps{display:-webkit-box;display:-ms-flexbox}.el-rate__text{font-size:14px;vertical-align:middle}.el-steps{display:flex}.el-steps--simple{padding:13px 8%;border-radius:4px;background:#F5F7FA}.el-steps--horizontal{white-space:nowrap}.el-steps--vertical{height:100%;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-flow:column;flex-flow:column}.el-step{position:relative;-ms-flex-negative:1;flex-shrink:1}.el-step:last-of-type .el-step__line{display:none}.el-step:last-of-type.is-flex{-ms-flex-preferred-size:auto!important;flex-basis:auto!important;-ms-flex-negative:0;flex-shrink:0;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0}.el-step:last-of-type .el-step__description,.el-step:last-of-type .el-step__main{padding-right:0}.el-step__head{position:relative;width:100%}.el-step__head.is-process{color:#303133;border-color:#303133}.el-step__head.is-wait{color:#C0C4CC;border-color:#C0C4CC}.el-step__head.is-success{color:#67C23A;border-color:#67C23A}.el-step__head.is-error{color:#F56C6C;border-color:#F56C6C}.el-step__head.is-finish{color:#409EFF;border-color:#409EFF}.el-step__icon{position:relative;z-index:1;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:24px;height:24px;font-size:14px;box-sizing:border-box;background:#FFF;-webkit-transition:.15s ease-out;transition:.15s ease-out}.el-step.is-horizontal,.el-step__icon-inner{display:inline-block}.el-step__icon.is-text{border-radius:50%;border:2px solid;border-color:inherit}.el-step__icon.is-icon{width:40px}.el-step__icon-inner{-webkit-user-select:none;user-select:none;text-align:center;font-weight:700;line-height:1;color:inherit}.el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:25px;font-weight:400}.el-step__icon-inner.is-status{-webkit-transform:translateY(1px);transform:translateY(1px)}.el-step__line{position:absolute;border-color:inherit;background-color:#C0C4CC}.el-step__line-inner{display:block;border-width:1px;border-style:solid;border-color:inherit;-webkit-transition:.15s ease-out;transition:.15s ease-out;-webkit-box-sizing:border-box;box-sizing:border-box;width:0;height:0}.el-step__main{white-space:normal;text-align:left}.el-step__title{font-size:16px;line-height:38px}.el-step__title.is-process{font-weight:700;color:#303133}.el-step__title.is-wait{color:#C0C4CC}.el-step__title.is-success{color:#67C23A}.el-step__title.is-error{color:#F56C6C}.el-step__title.is-finish{color:#409EFF}.el-step__description{padding-right:10%;margin-top:-5px;font-size:12px;line-height:20px;font-weight:400}.el-step__description.is-process{color:#303133}.el-step__description.is-wait{color:#C0C4CC}.el-step__description.is-success{color:#67C23A}.el-step__description.is-error{color:#F56C6C}.el-step__description.is-finish{color:#409EFF}.el-step.is-horizontal .el-step__line{height:2px;top:11px;left:0;right:0}.el-step.is-vertical{display:flex}.el-step.is-vertical .el-step__head{-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;width:24px}.el-step.is-vertical .el-step__main{padding-left:10px;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.el-step.is-vertical .el-step__title{line-height:24px;padding-bottom:8px}.el-step.is-vertical .el-step__line{width:2px;top:0;bottom:0;left:11px}.el-step.is-vertical .el-step__icon.is-icon{width:24px}.el-step.is-center .el-step__head,.el-step.is-center .el-step__main{text-align:center}.el-step.is-center .el-step__description{padding-left:20%;padding-right:20%}.el-step.is-center .el-step__line{left:50%;right:-50%}.el-step.is-simple{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-step.is-simple .el-step__head{width:auto;font-size:0;padding-right:10px}.el-step.is-simple .el-step__icon{background:0 0;width:16px;height:16px;font-size:12px}.el-step.is-simple .el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:18px}.el-step.is-simple .el-step__icon-inner.is-status{-webkit-transform:scale(.8) translateY(1px);transform:scale(.8) translateY(1px)}.el-step.is-simple .el-step__main{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.el-step.is-simple .el-step__title{font-size:16px;line-height:20px}.el-step.is-simple:not(:last-of-type) .el-step__title{max-width:50%;word-break:break-all}.el-step.is-simple .el-step__arrow{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-step.is-simple .el-step__arrow::after,.el-step.is-simple .el-step__arrow::before{content:'';display:inline-block;position:absolute;height:15px;width:1px;background:#C0C4CC}.el-step.is-simple .el-step__arrow::before{-webkit-transform:rotate(-45deg) translateY(-4px);transform:rotate(-45deg) translateY(-4px);-webkit-transform-origin:0 0;transform-origin:0 0}.el-step.is-simple .el-step__arrow::after{-webkit-transform:rotate(45deg) translateY(4px);transform:rotate(45deg) translateY(4px);-webkit-transform-origin:100% 100%;transform-origin:100% 100%}.el-step.is-simple:last-of-type .el-step__arrow{display:none}.el-carousel{position:relative}.el-carousel--horizontal{overflow-x:hidden}.el-carousel--vertical{overflow-y:hidden}.el-carousel__container{position:relative;height:300px}.el-carousel__arrow{border:none;outline:0;padding:0;margin:0;height:36px;width:36px;cursor:pointer;-webkit-transition:.3s;transition:.3s;border-radius:50%;background-color:rgba(31,45,61,.11);color:#FFF;position:absolute;top:50%;z-index:10;-webkit-transform:translateY(-50%);transform:translateY(-50%);text-align:center;font-size:12px}.el-carousel__arrow--left{left:16px}.el-carousel__arrow:hover{background-color:rgba(31,45,61,.23)}.el-carousel__arrow i{cursor:pointer}.el-carousel__indicators{position:absolute;list-style:none;margin:0;padding:0;z-index:2}.el-carousel__indicators--horizontal{bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.el-carousel__indicators--vertical{right:0;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-carousel__indicators--outside{bottom:26px;text-align:center;position:static;-webkit-transform:none;transform:none}.el-carousel__indicators--outside .el-carousel__indicator:hover button{opacity:.64}.el-carousel__indicators--outside button{background-color:#C0C4CC;opacity:.24}.el-carousel__indicators--labels{left:0;right:0;-webkit-transform:none;transform:none;text-align:center}.el-carousel__indicators--labels .el-carousel__button{height:auto;width:auto;padding:2px 18px;font-size:12px}.el-carousel__indicators--labels .el-carousel__indicator{padding:6px 4px}.el-carousel__indicator{background-color:transparent;cursor:pointer}.el-carousel__indicator:hover button{opacity:.72}.el-carousel__indicator--horizontal{display:inline-block;padding:12px 4px}.el-carousel__indicator--vertical{padding:4px 12px}.el-carousel__indicator--vertical .el-carousel__button{width:2px;height:15px}.el-carousel__indicator.is-active button{opacity:1}.el-carousel__button{display:block;opacity:.48;width:30px;height:2px;background-color:#FFF;border:none;outline:0;padding:0;margin:0;cursor:pointer;-webkit-transition:.3s;transition:.3s}.el-carousel__item,.el-carousel__mask{height:100%;position:absolute;top:0;left:0}.carousel-arrow-left-enter,.carousel-arrow-left-leave-active{-webkit-transform:translateY(-50%) translateX(-10px);transform:translateY(-50%) translateX(-10px);opacity:0}.carousel-arrow-right-enter,.carousel-arrow-right-leave-active{-webkit-transform:translateY(-50%) translateX(10px);transform:translateY(-50%) translateX(10px);opacity:0}.el-carousel__item{width:100%;display:inline-block;overflow:hidden;z-index:0}.el-carousel__item.is-active{z-index:2}.el-carousel__item.is-animating{-webkit-transition:-webkit-transform .4s ease-in-out;transition:-webkit-transform .4s ease-in-out;transition:transform .4s ease-in-out;transition:transform .4s ease-in-out,-webkit-transform .4s ease-in-out}.el-carousel__item--card{width:50%;-webkit-transition:-webkit-transform .4s ease-in-out;transition:-webkit-transform .4s ease-in-out;transition:transform .4s ease-in-out;transition:transform .4s ease-in-out,-webkit-transform .4s ease-in-out}.el-carousel__item--card.is-in-stage{cursor:pointer;z-index:1}.el-carousel__item--card.is-in-stage.is-hover .el-carousel__mask,.el-carousel__item--card.is-in-stage:hover .el-carousel__mask{opacity:.12}.el-carousel__item--card.is-active{z-index:2}.el-carousel__mask{width:100%;background-color:#FFF;opacity:.24;-webkit-transition:.2s;transition:.2s}.fade-in-linear-enter-active,.fade-in-linear-leave-active{-webkit-transition:opacity .2s linear;transition:opacity .2s linear}.fade-in-linear-enter,.fade-in-linear-leave,.fade-in-linear-leave-active{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active{-webkit-transition:opacity .2s linear;transition:opacity .2s linear}.el-fade-in-linear-enter,.el-fade-in-linear-leave,.el-fade-in-linear-leave-active{opacity:0}.el-fade-in-enter-active,.el-fade-in-leave-active{-webkit-transition:all .3s cubic-bezier(.55,0,.1,1);transition:all .3s cubic-bezier(.55,0,.1,1)}.el-fade-in-enter,.el-fade-in-leave-active{opacity:0}.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{-webkit-transition:all .3s cubic-bezier(.55,0,.1,1);transition:all .3s cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter,.el-zoom-in-center-leave-active{opacity:0;-webkit-transform:scaleX(0);transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);-webkit-transform-origin:center top;transform-origin:center top}.el-zoom-in-top-enter,.el-zoom-in-top-leave-active{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);-webkit-transform-origin:center bottom;transform-origin:center bottom}.el-zoom-in-bottom-enter,.el-zoom-in-bottom-leave-active{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;-webkit-transform:scale(1,1);transform:scale(1,1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);-webkit-transform-origin:top left;transform-origin:top left}.el-zoom-in-left-enter,.el-zoom-in-left-leave-active{opacity:0;-webkit-transform:scale(.45,.45);transform:scale(.45,.45)}.collapse-transition{-webkit-transition:.3s height ease-in-out,.3s padding-top ease-in-out,.3s padding-bottom ease-in-out;transition:.3s height ease-in-out,.3s padding-top ease-in-out,.3s padding-bottom ease-in-out}.horizontal-collapse-transition{-webkit-transition:.3s width ease-in-out,.3s padding-left ease-in-out,.3s padding-right ease-in-out;transition:.3s width ease-in-out,.3s padding-left ease-in-out,.3s padding-right ease-in-out}.el-list-enter-active,.el-list-leave-active{-webkit-transition:all 1s;transition:all 1s}.el-list-enter,.el-list-leave-active{opacity:0;-webkit-transform:translateY(-30px);transform:translateY(-30px)}.el-opacity-transition{-webkit-transition:opacity .3s cubic-bezier(.55,0,.1,1);transition:opacity .3s cubic-bezier(.55,0,.1,1)}.el-collapse{border-top:1px solid #EBEEF5;border-bottom:1px solid #EBEEF5}.el-collapse-item.is-disabled .el-collapse-item__header{color:#bbb;cursor:not-allowed}.el-collapse-item__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:48px;line-height:48px;background-color:#FFF;color:#303133;cursor:pointer;border-bottom:1px solid #EBEEF5;font-size:13px;font-weight:500;-webkit-transition:border-bottom-color .3s;transition:border-bottom-color .3s;outline:0}.el-collapse-item__arrow{margin:0 8px 0 auto;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;font-weight:300}.el-collapse-item__arrow.is-active{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.el-collapse-item__header.focusing:focus:not(:hover){color:#409EFF}.el-collapse-item__header.is-active{border-bottom-color:transparent}.el-collapse-item__wrap{will-change:height;background-color:#FFF;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;border-bottom:1px solid #EBEEF5}.el-cascader__search-input,.el-cascader__tags,.el-tag{-webkit-box-sizing:border-box}.el-collapse-item__content{padding-bottom:25px;font-size:13px;color:#303133;line-height:1.769230769230769}.el-collapse-item:last-child{margin-bottom:-1px}.el-popper .popper__arrow,.el-popper .popper__arrow::after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.el-cascader,.el-tag{display:inline-block}.el-popper .popper__arrow{border-width:6px;-webkit-filter:drop-shadow(0 2px 12px rgba(0, 0, 0, .03));filter:drop-shadow(0 2px 12px rgba(0, 0, 0, .03))}.el-popper .popper__arrow::after{content:" ";border-width:6px}.el-popper[x-placement^=top]{margin-bottom:12px}.el-popper[x-placement^=top] .popper__arrow{bottom:-6px;left:50%;margin-right:3px;border-top-color:#EBEEF5;border-bottom-width:0}.el-popper[x-placement^=top] .popper__arrow::after{bottom:1px;margin-left:-6px;border-top-color:#FFF;border-bottom-width:0}.el-popper[x-placement^=bottom]{margin-top:12px}.el-popper[x-placement^=bottom] .popper__arrow{top:-6px;left:50%;margin-right:3px;border-top-width:0;border-bottom-color:#EBEEF5}.el-popper[x-placement^=bottom] .popper__arrow::after{top:1px;margin-left:-6px;border-top-width:0;border-bottom-color:#FFF}.el-popper[x-placement^=right]{margin-left:12px}.el-popper[x-placement^=right] .popper__arrow{top:50%;left:-6px;margin-bottom:3px;border-right-color:#EBEEF5;border-left-width:0}.el-popper[x-placement^=right] .popper__arrow::after{bottom:-6px;left:1px;border-right-color:#FFF;border-left-width:0}.el-popper[x-placement^=left]{margin-right:12px}.el-popper[x-placement^=left] .popper__arrow{top:50%;right:-6px;margin-bottom:3px;border-right-width:0;border-left-color:#EBEEF5}.el-popper[x-placement^=left] .popper__arrow::after{right:1px;bottom:-6px;margin-left:-6px;border-right-width:0;border-left-color:#FFF}.el-tag{background-color:#ecf5ff;border-color:#d9ecff;height:32px;padding:0 10px;line-height:30px;font-size:12px;color:#409EFF;border-width:1px;border-style:solid;border-radius:4px;box-sizing:border-box;white-space:nowrap}.el-tag.is-hit{border-color:#409EFF}.el-tag .el-tag__close{color:#409eff}.el-tag .el-tag__close:hover{color:#FFF;background-color:#409eff}.el-tag.el-tag--info{background-color:#f4f4f5;border-color:#e9e9eb;color:#909399}.el-tag.el-tag--info.is-hit{border-color:#909399}.el-tag.el-tag--info .el-tag__close{color:#909399}.el-tag.el-tag--info .el-tag__close:hover{color:#FFF;background-color:#909399}.el-tag.el-tag--success{background-color:#f0f9eb;border-color:#e1f3d8;color:#67c23a}.el-tag.el-tag--success.is-hit{border-color:#67C23A}.el-tag.el-tag--success .el-tag__close{color:#67c23a}.el-tag.el-tag--success .el-tag__close:hover{color:#FFF;background-color:#67c23a}.el-tag.el-tag--warning{background-color:#fdf6ec;border-color:#faecd8;color:#e6a23c}.el-tag.el-tag--warning.is-hit{border-color:#E6A23C}.el-tag.el-tag--warning .el-tag__close{color:#e6a23c}.el-tag.el-tag--warning .el-tag__close:hover{color:#FFF;background-color:#e6a23c}.el-tag.el-tag--danger{background-color:#fef0f0;border-color:#fde2e2;color:#f56c6c}.el-tag.el-tag--danger.is-hit{border-color:#F56C6C}.el-tag.el-tag--danger .el-tag__close{color:#f56c6c}.el-tag.el-tag--danger .el-tag__close:hover{color:#FFF;background-color:#f56c6c}.el-tag .el-icon-close{border-radius:50%;text-align:center;position:relative;cursor:pointer;font-size:12px;height:16px;width:16px;line-height:16px;vertical-align:middle;top:-1px;right:-5px}.el-tag .el-icon-close::before{display:block}.el-tag--dark{background-color:#409eff;border-color:#409eff;color:#fff}.el-tag--dark.is-hit{border-color:#409EFF}.el-tag--dark .el-tag__close{color:#fff}.el-tag--dark .el-tag__close:hover{color:#FFF;background-color:#66b1ff}.el-tag--dark.el-tag--info{background-color:#909399;border-color:#909399;color:#fff}.el-tag--dark.el-tag--info.is-hit{border-color:#909399}.el-tag--dark.el-tag--info .el-tag__close{color:#fff}.el-tag--dark.el-tag--info .el-tag__close:hover{color:#FFF;background-color:#a6a9ad}.el-tag--dark.el-tag--success{background-color:#67c23a;border-color:#67c23a;color:#fff}.el-tag--dark.el-tag--success.is-hit{border-color:#67C23A}.el-tag--dark.el-tag--success .el-tag__close{color:#fff}.el-tag--dark.el-tag--success .el-tag__close:hover{color:#FFF;background-color:#85ce61}.el-tag--dark.el-tag--warning{background-color:#e6a23c;border-color:#e6a23c;color:#fff}.el-tag--dark.el-tag--warning.is-hit{border-color:#E6A23C}.el-tag--dark.el-tag--warning .el-tag__close{color:#fff}.el-tag--dark.el-tag--warning .el-tag__close:hover{color:#FFF;background-color:#ebb563}.el-tag--dark.el-tag--danger{background-color:#f56c6c;border-color:#f56c6c;color:#fff}.el-tag--dark.el-tag--danger.is-hit{border-color:#F56C6C}.el-tag--dark.el-tag--danger .el-tag__close{color:#fff}.el-tag--dark.el-tag--danger .el-tag__close:hover{color:#FFF;background-color:#f78989}.el-tag--plain{background-color:#fff;border-color:#b3d8ff;color:#409eff}.el-tag--plain.is-hit{border-color:#409EFF}.el-tag--plain .el-tag__close{color:#409eff}.el-tag--plain .el-tag__close:hover{color:#FFF;background-color:#409eff}.el-tag--plain.el-tag--info{background-color:#fff;border-color:#d3d4d6;color:#909399}.el-tag--plain.el-tag--info.is-hit{border-color:#909399}.el-tag--plain.el-tag--info .el-tag__close{color:#909399}.el-tag--plain.el-tag--info .el-tag__close:hover{color:#FFF;background-color:#909399}.el-tag--plain.el-tag--success{background-color:#fff;border-color:#c2e7b0;color:#67c23a}.el-tag--plain.el-tag--success.is-hit{border-color:#67C23A}.el-tag--plain.el-tag--success .el-tag__close{color:#67c23a}.el-tag--plain.el-tag--success .el-tag__close:hover{color:#FFF;background-color:#67c23a}.el-tag--plain.el-tag--warning{background-color:#fff;border-color:#f5dab1;color:#e6a23c}.el-tag--plain.el-tag--warning.is-hit{border-color:#E6A23C}.el-tag--plain.el-tag--warning .el-tag__close{color:#e6a23c}.el-tag--plain.el-tag--warning .el-tag__close:hover{color:#FFF;background-color:#e6a23c}.el-tag--plain.el-tag--danger{background-color:#fff;border-color:#fbc4c4;color:#f56c6c}.el-tag--plain.el-tag--danger.is-hit{border-color:#F56C6C}.el-tag--plain.el-tag--danger .el-tag__close{color:#f56c6c}.el-tag--plain.el-tag--danger .el-tag__close:hover{color:#FFF;background-color:#f56c6c}.el-tag--medium{height:28px;line-height:26px}.el-tag--medium .el-icon-close{-webkit-transform:scale(.8);transform:scale(.8)}.el-tag--small{height:24px;padding:0 8px;line-height:22px}.el-tag--small .el-icon-close{-webkit-transform:scale(.8);transform:scale(.8)}.el-tag--mini{height:20px;padding:0 5px;line-height:19px}.el-tag--mini .el-icon-close{margin-left:-3px;-webkit-transform:scale(.7);transform:scale(.7)}.el-cascader{position:relative;font-size:14px;line-height:40px}.el-cascader:not(.is-disabled):hover .el-input__inner{cursor:pointer;border-color:#C0C4CC}.el-cascader .el-input .el-input__inner:focus,.el-cascader .el-input.is-focus .el-input__inner{border-color:#409EFF}.el-cascader .el-input{cursor:pointer}.el-cascader .el-input .el-input__inner{text-overflow:ellipsis}.el-cascader .el-input .el-icon-arrow-down{-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;font-size:14px}.el-cascader .el-input .el-icon-arrow-down.is-reverse{-webkit-transform:rotateZ(180deg);transform:rotateZ(180deg)}.el-cascader .el-input .el-icon-circle-close:hover{color:#909399}.el-cascader--medium{font-size:14px;line-height:36px}.el-cascader--small{font-size:13px;line-height:32px}.el-cascader--mini{font-size:12px;line-height:28px}.el-cascader.is-disabled .el-cascader__label{z-index:2;color:#C0C4CC}.el-cascader__dropdown{margin:5px 0;font-size:14px;background:#FFF;border:1px solid #E4E7ED;border-radius:4px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-cascader__tags{position:absolute;left:0;right:30px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;line-height:normal;text-align:left;box-sizing:border-box}.el-cascader__tags .el-tag{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:#f0f2f5}.el-cascader__tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__tags .el-tag>span{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__tags .el-tag .el-icon-close{-webkit-box-flex:0;-ms-flex:none;flex:none;background-color:#C0C4CC;color:#FFF}.el-cascader__tags .el-tag .el-icon-close:hover{background-color:#909399}.el-cascader__suggestion-panel{border-radius:4px}.el-cascader__suggestion-list{max-height:204px;margin:0;padding:6px 0;font-size:14px;color:#606266;text-align:center}.el-cascader__suggestion-item{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:34px;padding:0 15px;text-align:left;outline:0;cursor:pointer}.el-cascader__suggestion-item:focus,.el-cascader__suggestion-item:hover{background:#F5F7FA}.el-cascader__suggestion-item.is-checked{color:#409EFF;font-weight:700}.el-cascader__suggestion-item>span{margin-right:10px}.el-cascader__empty-text{margin:10px 0;color:#C0C4CC}.el-cascader__search-input{-webkit-box-flex:1;-ms-flex:1;flex:1;height:24px;min-width:60px;margin:2px 0 2px 15px;padding:0;color:#606266;border:none;outline:0;box-sizing:border-box}.el-cascader__search-input::-webkit-input-placeholder{color:#C0C4CC}.el-cascader__search-input:-ms-input-placeholder{color:#C0C4CC}.el-cascader__search-input::-ms-input-placeholder{color:#C0C4CC}.el-cascader__search-input::placeholder{color:#C0C4CC}.el-color-predefine{display:-webkit-box;display:-ms-flexbox;display:flex;font-size:12px;margin-top:8px;width:280px}.el-color-predefine__colors{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-wrap:wrap;flex-wrap:wrap}.el-color-predefine__color-selector{margin:0 0 8px 8px;width:20px;height:20px;border-radius:4px;cursor:pointer}.el-color-predefine__color-selector:nth-child(10n+1){margin-left:0}.el-color-predefine__color-selector.selected{-webkit-box-shadow:0 0 3px 2px #409EFF;box-shadow:0 0 3px 2px #409EFF}.el-color-predefine__color-selector>div{display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;border-radius:3px}.el-color-predefine__color-selector.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-hue-slider{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;width:280px;height:12px;background-color:red;padding:0 2px}.el-color-hue-slider__bar{position:relative;background:-webkit-gradient(linear,left top,right top,from(red),color-stop(17%,#ff0),color-stop(33%,#0f0),color-stop(50%,#0ff),color-stop(67%,#00f),color-stop(83%,#f0f),to(red));background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);height:100%}.el-color-hue-slider__thumb{position:absolute;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid #f0f0f0;-webkit-box-shadow:0 0 2px rgba(0,0,0,.6);box-shadow:0 0 2px rgba(0,0,0,.6);z-index:1}.el-color-hue-slider.is-vertical{width:12px;height:180px;padding:2px 0}.el-color-hue-slider.is-vertical .el-color-hue-slider__bar{background:-webkit-gradient(linear,left top,left bottom,from(red),color-stop(17%,#ff0),color-stop(33%,#0f0),color-stop(50%,#0ff),color-stop(67%,#00f),color-stop(83%,#f0f),to(red));background:linear-gradient(to bottom,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}.el-color-hue-slider.is-vertical .el-color-hue-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-svpanel{position:relative;width:280px;height:180px}.el-color-svpanel__black,.el-color-svpanel__white{position:absolute;top:0;left:0;right:0;bottom:0}.el-color-svpanel__white{background:-webkit-gradient(linear,left top,right top,from(#fff),to(rgba(255,255,255,0)));background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.el-color-svpanel__black{background:-webkit-gradient(linear,left bottom,left top,from(#000),to(rgba(0,0,0,0)));background:linear-gradient(to top,#000,rgba(0,0,0,0))}.el-color-svpanel__cursor{position:absolute}.el-color-svpanel__cursor>div{cursor:head;width:4px;height:4px;-webkit-box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);border-radius:50%;-webkit-transform:translate(-2px,-2px);transform:translate(-2px,-2px)}.el-color-alpha-slider{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;width:280px;height:12px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-alpha-slider__bar{position:relative;background:-webkit-gradient(linear,left top,right top,from(rgba(255,255,255,0)),to(white));background:linear-gradient(to right,rgba(255,255,255,0) 0,#fff 100%);height:100%}.el-color-alpha-slider__thumb{position:absolute;cursor:pointer;-webkit-box-sizing:border-box;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid #f0f0f0;-webkit-box-shadow:0 0 2px rgba(0,0,0,.6);box-shadow:0 0 2px rgba(0,0,0,.6);z-index:1}.el-color-alpha-slider.is-vertical{width:20px;height:180px}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__bar{background:-webkit-gradient(linear,left top,left bottom,from(rgba(255,255,255,0)),to(white));background:linear-gradient(to bottom,rgba(255,255,255,0) 0,#fff 100%)}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-dropdown{width:300px}.el-color-dropdown__main-wrapper{margin-bottom:6px}.el-color-dropdown__main-wrapper::after{display:table;clear:both}.el-color-dropdown__btns{margin-top:6px;text-align:right}.el-color-dropdown__value{float:left;line-height:26px;font-size:12px;color:#000;width:160px}.el-color-dropdown__btn{border:1px solid #dcdcdc;color:#333;line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:0;font-size:12px}.el-color-dropdown__btn[disabled]{color:#ccc;cursor:not-allowed}.el-color-dropdown__btn:hover{color:#409EFF;border-color:#409EFF}.el-color-dropdown__link-btn{cursor:pointer;color:#409EFF;text-decoration:none;padding:15px;font-size:12px}.el-color-dropdown__link-btn:hover{color:tint(#409EFF,20%)}.el-color-picker{display:inline-block;position:relative;line-height:normal;height:40px}.el-color-picker.is-disabled .el-color-picker__trigger{cursor:not-allowed}.el-color-picker--medium{height:36px}.el-color-picker--medium .el-color-picker__trigger{height:36px;width:36px}.el-color-picker--medium .el-color-picker__mask{height:34px;width:34px}.el-color-picker--small{height:32px}.el-color-picker--small .el-color-picker__trigger{height:32px;width:32px}.el-color-picker--small .el-color-picker__mask{height:30px;width:30px}.el-color-picker--small .el-color-picker__empty,.el-color-picker--small .el-color-picker__icon{-webkit-transform:translate3d(-50%,-50%,0) scale(.8);transform:translate3d(-50%,-50%,0) scale(.8)}.el-color-picker--mini{height:28px}.el-color-picker--mini .el-color-picker__trigger{height:28px;width:28px}.el-color-picker--mini .el-color-picker__mask{height:26px;width:26px}.el-color-picker--mini .el-color-picker__empty,.el-color-picker--mini .el-color-picker__icon{-webkit-transform:translate3d(-50%,-50%,0) scale(.8);transform:translate3d(-50%,-50%,0) scale(.8)}.el-color-picker__mask{height:38px;width:38px;border-radius:4px;position:absolute;top:1px;left:1px;z-index:1;cursor:not-allowed;background-color:rgba(255,255,255,.7)}.el-color-picker__trigger{display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;height:40px;width:40px;padding:4px;border:1px solid #e6e6e6;border-radius:4px;font-size:0;position:relative;cursor:pointer}.el-color-picker__color{position:relative;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #999;border-radius:2px;width:100%;height:100%;text-align:center}.el-color-picker__icon,.el-input,.el-textarea{display:inline-block;width:100%}.el-color-picker__color.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-picker__color-inner{position:absolute;left:0;top:0;right:0;bottom:0}.el-color-picker__empty{font-size:12px;color:#999;position:absolute;top:50%;left:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0)}.el-color-picker__icon{position:absolute;top:50%;left:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);color:#FFF;text-align:center;font-size:12px}.el-input__prefix,.el-input__suffix{position:absolute;top:0;text-align:center}.el-color-picker__panel{position:absolute;z-index:10;padding:6px;-webkit-box-sizing:content-box;box-sizing:content-box;background-color:#FFF;border:1px solid #EBEEF5;border-radius:4px;box-shadow:0 2px 12px 0 rgba(0,0,0,.1)}.el-input__inner,.el-textarea__inner,.el-transfer-panel{-webkit-box-sizing:border-box}.el-textarea{position:relative;vertical-align:bottom;font-size:14px}.el-textarea__inner{display:block;resize:vertical;padding:5px 15px;line-height:1.5;box-sizing:border-box;width:100%;font-size:inherit;color:#606266;background-color:#FFF;background-image:none;border:1px solid #DCDFE6;border-radius:4px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.el-textarea__inner::-webkit-input-placeholder{color:#C0C4CC}.el-textarea__inner:-ms-input-placeholder{color:#C0C4CC}.el-textarea__inner::-ms-input-placeholder{color:#C0C4CC}.el-textarea__inner::placeholder{color:#C0C4CC}.el-textarea__inner:hover{border-color:#C0C4CC}.el-textarea__inner:focus{outline:0;border-color:#409EFF}.el-textarea .el-input__count{color:#909399;background:#FFF;position:absolute;font-size:12px;bottom:5px;right:10px}.el-textarea.is-disabled .el-textarea__inner{background-color:#F5F7FA;border-color:#E4E7ED;color:#C0C4CC;cursor:not-allowed}.el-textarea.is-disabled .el-textarea__inner::-webkit-input-placeholder{color:#C0C4CC}.el-textarea.is-disabled .el-textarea__inner:-ms-input-placeholder{color:#C0C4CC}.el-textarea.is-disabled .el-textarea__inner::-ms-input-placeholder{color:#C0C4CC}.el-textarea.is-disabled .el-textarea__inner::placeholder{color:#C0C4CC}.el-textarea.is-exceed .el-textarea__inner{border-color:#F56C6C}.el-textarea.is-exceed .el-input__count{color:#F56C6C}.el-input{position:relative;font-size:14px}.el-input::-webkit-scrollbar{z-index:11;width:6px}.el-input::-webkit-scrollbar:horizontal{height:6px}.el-input::-webkit-scrollbar-thumb{border-radius:5px;width:6px;background:#b4bccc}.el-input::-webkit-scrollbar-corner{background:#fff}.el-input::-webkit-scrollbar-track{background:#fff}.el-input::-webkit-scrollbar-track-piece{background:#fff;width:6px}.el-input .el-input__clear{color:#C0C4CC;font-size:14px;cursor:pointer;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1)}.el-input .el-input__clear:hover{color:#909399}.el-input .el-input__count{height:100%;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#909399;font-size:12px}.el-input-group__append .el-button,.el-input-group__append .el-input,.el-input-group__prepend .el-button,.el-input-group__prepend .el-input,.el-input__inner{font-size:inherit}.el-input .el-input__count .el-input__count-inner{background:#FFF;line-height:initial;display:inline-block;padding:0 5px}.el-input__inner{-webkit-appearance:none;background-color:#FFF;background-image:none;border-radius:4px;border:1px solid #DCDFE6;box-sizing:border-box;color:#606266;display:inline-block;height:40px;line-height:40px;outline:0;padding:0 15px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}.el-input__inner::-ms-reveal{display:none}.el-input__inner::-webkit-input-placeholder{color:#C0C4CC}.el-input__inner:-ms-input-placeholder{color:#C0C4CC}.el-input__inner::-ms-input-placeholder{color:#C0C4CC}.el-input__inner::placeholder{color:#C0C4CC}.el-input__inner:hover{border-color:#C0C4CC}.el-input.is-active .el-input__inner,.el-input__inner:focus{border-color:#409EFF;outline:0}.el-input__suffix{height:100%;right:5px;transition:all .3s;pointer-events:none}.el-input__suffix-inner{pointer-events:all}.el-input__prefix{height:100%;left:5px;transition:all .3s}.el-input__icon{height:100%;width:25px;text-align:center;-webkit-transition:all .3s;transition:all .3s;line-height:40px}.el-input__icon:after{content:'';height:100%;width:0;display:inline-block;vertical-align:middle}.el-input__validateIcon{pointer-events:none}.el-input.is-disabled .el-input__inner{background-color:#F5F7FA;border-color:#E4E7ED;color:#C0C4CC;cursor:not-allowed}.el-input.is-disabled .el-input__inner::-webkit-input-placeholder{color:#C0C4CC}.el-input.is-disabled .el-input__inner:-ms-input-placeholder{color:#C0C4CC}.el-input.is-disabled .el-input__inner::-ms-input-placeholder{color:#C0C4CC}.el-input.is-disabled .el-input__inner::placeholder{color:#C0C4CC}.el-input.is-disabled .el-input__icon{cursor:not-allowed}.el-image-viewer__btn,.el-image__preview,.el-link,.el-transfer-panel__filter .el-icon-circle-close{cursor:pointer}.el-input.is-exceed .el-input__inner{border-color:#F56C6C}.el-input.is-exceed .el-input__suffix .el-input__count{color:#F56C6C}.el-input--suffix .el-input__inner{padding-right:30px}.el-input--prefix .el-input__inner{padding-left:30px}.el-input--medium{font-size:14px}.el-input--medium .el-input__inner{height:36px;line-height:36px}.el-input--medium .el-input__icon{line-height:36px}.el-input--small{font-size:13px}.el-input--small .el-input__inner{height:32px;line-height:32px}.el-input--small .el-input__icon{line-height:32px}.el-input--mini{font-size:12px}.el-input--mini .el-input__inner{height:28px;line-height:28px}.el-input--mini .el-input__icon{line-height:28px}.el-input-group{line-height:normal;display:inline-table;width:100%;border-collapse:separate;border-spacing:0}.el-input-group>.el-input__inner{vertical-align:middle;display:table-cell}.el-input-group__append,.el-input-group__prepend{background-color:#F5F7FA;color:#909399;vertical-align:middle;display:table-cell;position:relative;border:1px solid #DCDFE6;border-radius:4px;padding:0 20px;width:1px;white-space:nowrap}.el-input-group--append .el-input__inner,.el-input-group__prepend{border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group__append:focus,.el-input-group__prepend:focus{outline:0}.el-input-group__append .el-button,.el-input-group__append .el-select,.el-input-group__prepend .el-button,.el-input-group__prepend .el-select{display:inline-block;margin:-10px -20px}.el-input-group__append button.el-button,.el-input-group__append div.el-select .el-input__inner,.el-input-group__append div.el-select:hover .el-input__inner,.el-input-group__prepend button.el-button,.el-input-group__prepend div.el-select .el-input__inner,.el-input-group__prepend div.el-select:hover .el-input__inner{border-color:transparent;background-color:transparent;color:inherit;border-top:0;border-bottom:0}.el-input-group__prepend{border-right:0}.el-input-group__append{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.el-input-group--append .el-select .el-input.is-focus .el-input__inner,.el-input-group--prepend .el-select .el-input.is-focus .el-input__inner{border-color:transparent}.el-input-group--prepend .el-input__inner{border-top-left-radius:0;border-bottom-left-radius:0}.el-input__inner::-ms-clear{display:none;width:0;height:0}.el-transfer{font-size:14px}.el-transfer__buttons{display:inline-block;vertical-align:middle;padding:0 30px}.el-transfer__button{display:block;margin:0 auto;padding:10px;border-radius:50%;color:#FFF;background-color:#409EFF;font-size:0}.el-button-group>.el-button+.el-button,.el-transfer-panel__item+.el-transfer-panel__item,.el-transfer__button [class*=el-icon-]+span{margin-left:0}.el-divider__text,.el-image__error,.el-link,.el-timeline,.el-transfer__button i,.el-transfer__button span{font-size:14px}.el-transfer__button.is-with-texts{border-radius:4px}.el-transfer__button.is-disabled,.el-transfer__button.is-disabled:hover{border:1px solid #DCDFE6;background-color:#F5F7FA;color:#C0C4CC}.el-transfer__button:first-child{margin-bottom:10px}.el-transfer__button:nth-child(2){margin:0}.el-transfer-panel{border:1px solid #EBEEF5;border-radius:4px;overflow:hidden;background:#FFF;display:inline-block;vertical-align:middle;width:200px;max-height:100%;box-sizing:border-box;position:relative}.el-transfer-panel__body{height:246px}.el-transfer-panel__body.is-with-footer{padding-bottom:40px}.el-transfer-panel__list{margin:0;padding:6px 0;list-style:none;height:246px;overflow:auto;-webkit-box-sizing:border-box;box-sizing:border-box}.el-transfer-panel__list.is-filterable{height:194px;padding-top:0}.el-transfer-panel__item{height:30px;line-height:30px;padding-left:15px;display:block!important}.el-transfer-panel__item.el-checkbox{color:#606266}.el-transfer-panel__item:hover{color:#409EFF}.el-transfer-panel__item.el-checkbox .el-checkbox__label{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:24px;line-height:30px}.el-transfer-panel__item .el-checkbox__input{position:absolute;top:8px}.el-transfer-panel__filter{text-align:center;margin:15px;-webkit-box-sizing:border-box;box-sizing:border-box;display:block;width:auto}.el-transfer-panel__filter .el-input__inner{height:32px;width:100%;font-size:12px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:16px;padding-right:10px;padding-left:30px}.el-transfer-panel__filter .el-input__icon{margin-left:5px}.el-transfer-panel .el-transfer-panel__header{height:40px;line-height:40px;background:#F5F7FA;margin:0;padding-left:15px;border-bottom:1px solid #EBEEF5;-webkit-box-sizing:border-box;box-sizing:border-box;color:#000}.el-container,.el-header{-webkit-box-sizing:border-box}.el-transfer-panel .el-transfer-panel__header .el-checkbox{display:block;line-height:40px}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label{font-size:16px;color:#303133;font-weight:400}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label span{position:absolute;right:15px;color:#909399;font-size:12px;font-weight:400}.el-transfer-panel .el-transfer-panel__footer{height:40px;background:#FFF;margin:0;padding:0;border-top:1px solid #EBEEF5;position:absolute;bottom:0;left:0;width:100%;z-index:1}.el-transfer-panel .el-transfer-panel__footer::after{display:inline-block;height:100%;vertical-align:middle}.el-container,.el-timeline-item__node{display:-webkit-box;display:-ms-flexbox}.el-transfer-panel .el-transfer-panel__footer .el-checkbox{padding-left:20px;color:#606266}.el-transfer-panel .el-transfer-panel__empty{margin:0;height:30px;line-height:30px;padding:6px 15px 0;color:#909399;text-align:center}.el-transfer-panel .el-checkbox__label{padding-left:8px}.el-transfer-panel .el-checkbox__inner{height:14px;width:14px;border-radius:3px}.el-transfer-panel .el-checkbox__inner::after{height:6px;width:3px;left:4px}.el-container{display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-preferred-size:auto;flex-basis:auto;box-sizing:border-box;min-width:0}.el-container.is-vertical,.el-drawer,.el-empty,.el-result{-webkit-box-orient:vertical;-webkit-box-direction:normal}.el-container.is-vertical{-ms-flex-direction:column;flex-direction:column}.el-header{padding:0 20px;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0}.el-aside{overflow:auto;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0}.el-main{display:block;-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-preferred-size:auto;flex-basis:auto;overflow:auto;-webkit-box-sizing:border-box;box-sizing:border-box}.el-footer{padding:0 20px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0}.el-timeline{margin:0;list-style:none}.el-timeline .el-timeline-item:last-child .el-timeline-item__tail{display:none}.el-timeline-item{position:relative;padding-bottom:20px}.el-timeline-item__wrapper{position:relative;padding-left:28px;top:-3px}.el-timeline-item__tail{position:absolute;left:4px;height:100%;border-left:2px solid #E4E7ED}.el-timeline-item__icon{color:#FFF;font-size:13px}.el-timeline-item__node{position:absolute;background-color:#E4E7ED;border-radius:50%;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-image__error,.el-timeline-item__dot{display:-webkit-box;display:-ms-flexbox}.el-timeline-item__node--normal{left:-1px;width:12px;height:12px}.el-timeline-item__node--large{left:-2px;width:14px;height:14px}.el-timeline-item__node--primary{background-color:#409EFF}.el-timeline-item__node--success{background-color:#67C23A}.el-timeline-item__node--warning{background-color:#E6A23C}.el-timeline-item__node--danger{background-color:#F56C6C}.el-timeline-item__node--info{background-color:#909399}.el-timeline-item__dot{position:absolute;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-timeline-item__content{color:#303133}.el-timeline-item__timestamp{color:#909399;line-height:1;font-size:13px}.el-timeline-item__timestamp.is-top{margin-bottom:8px;padding-top:4px}.el-timeline-item__timestamp.is-bottom{margin-top:8px}.el-link{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;vertical-align:middle;position:relative;text-decoration:none;outline:0;padding:0;font-weight:500}.el-link.is-underline:hover:after{position:absolute;left:0;right:0;height:0;bottom:0;border-bottom:1px solid #409EFF}.el-link.el-link--default:after,.el-link.el-link--primary.is-underline:hover:after,.el-link.el-link--primary:after{border-color:#409EFF}.el-link.is-disabled{cursor:not-allowed}.el-link [class*=el-icon-]+span{margin-left:5px}.el-link.el-link--default{color:#606266}.el-link.el-link--default:hover{color:#409EFF}.el-link.el-link--default.is-disabled{color:#C0C4CC}.el-link.el-link--primary{color:#409EFF}.el-link.el-link--primary:hover{color:#66b1ff}.el-link.el-link--primary.is-disabled{color:#a0cfff}.el-link.el-link--danger.is-underline:hover:after,.el-link.el-link--danger:after{border-color:#F56C6C}.el-link.el-link--danger{color:#F56C6C}.el-link.el-link--danger:hover{color:#f78989}.el-link.el-link--danger.is-disabled{color:#fab6b6}.el-link.el-link--success.is-underline:hover:after,.el-link.el-link--success:after{border-color:#67C23A}.el-link.el-link--success{color:#67C23A}.el-link.el-link--success:hover{color:#85ce61}.el-link.el-link--success.is-disabled{color:#b3e19d}.el-link.el-link--warning.is-underline:hover:after,.el-link.el-link--warning:after{border-color:#E6A23C}.el-link.el-link--warning{color:#E6A23C}.el-link.el-link--warning:hover{color:#ebb563}.el-link.el-link--warning.is-disabled{color:#f3d19e}.el-link.el-link--info.is-underline:hover:after,.el-link.el-link--info:after{border-color:#909399}.el-link.el-link--info{color:#909399}.el-link.el-link--info:hover{color:#a6a9ad}.el-link.el-link--info.is-disabled{color:#c8c9cc}.el-divider{background-color:#DCDFE6;position:relative}.el-divider--horizontal{display:block;height:1px;width:100%;margin:24px 0}.el-divider--vertical{display:inline-block;width:1px;height:1em;margin:0 8px;vertical-align:middle;position:relative}.el-divider__text{position:absolute;background-color:#FFF;padding:0 20px;font-weight:500;color:#303133}.el-image__error,.el-image__placeholder{background:#F5F7FA}.el-divider__text.is-left{left:20px;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-divider__text.is-center{left:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%)}.el-divider__text.is-right{right:20px;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-image__error,.el-image__inner,.el-image__placeholder{width:100%;height:100%}.el-image{position:relative;display:inline-block;overflow:hidden}.el-image__inner{vertical-align:top}.el-image__inner--center{position:relative;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:block}.el-image__error{display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#C0C4CC;vertical-align:middle}.el-image-viewer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.el-image-viewer__btn{position:absolute;z-index:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:50%;opacity:.8;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;user-select:none}.el-button,.el-checkbox,.el-checkbox-button__inner,.el-empty__image img,.el-radio{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.el-image-viewer__close{top:40px;right:40px;width:40px;height:40px;font-size:24px;color:#fff;background-color:#606266}.el-image-viewer__canvas{width:100%;height:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-image-viewer__actions{left:50%;bottom:30px;-webkit-transform:translateX(-50%);transform:translateX(-50%);width:282px;height:44px;padding:0 23px;background-color:#606266;border-color:#fff;border-radius:22px}.el-image-viewer__actions__inner{width:100%;height:100%;text-align:justify;cursor:default;font-size:23px;color:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.el-image-viewer__next,.el-image-viewer__prev{width:44px;height:44px;font-size:24px;color:#fff;background-color:#606266;border-color:#fff;top:50%}.el-image-viewer__prev{-webkit-transform:translateY(-50%);transform:translateY(-50%);left:40px}.el-image-viewer__next{-webkit-transform:translateY(-50%);transform:translateY(-50%);right:40px;text-indent:2px}.el-image-viewer__mask{position:absolute;width:100%;height:100%;top:0;left:0;opacity:.5;background:#000}.viewer-fade-enter-active{-webkit-animation:viewer-fade-in .3s;animation:viewer-fade-in .3s}.viewer-fade-leave-active{-webkit-animation:viewer-fade-out .3s;animation:viewer-fade-out .3s}@-webkit-keyframes viewer-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}100%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}}@keyframes viewer-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}100%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}}@-webkit-keyframes viewer-fade-out{0%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}100%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}@keyframes viewer-fade-out{0%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}100%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}.el-button{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#FFF;border:1px solid #DCDFE6;color:#606266;-webkit-appearance:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;outline:0;margin:0;-webkit-transition:.1s;transition:.1s;font-weight:500;padding:12px 20px;font-size:14px;border-radius:4px}.el-button+.el-button,.el-checkbox.is-bordered+.el-checkbox.is-bordered{margin-left:10px}.el-button:focus,.el-button:hover{color:#409EFF;border-color:#c6e2ff;background-color:#ecf5ff}.el-button:active{color:#3a8ee6;border-color:#3a8ee6;outline:0}.el-button::-moz-focus-inner{border:0}.el-button [class*=el-icon-]+span{margin-left:5px}.el-button.is-plain:focus,.el-button.is-plain:hover{background:#FFF;border-color:#409EFF;color:#409EFF}.el-button.is-active,.el-button.is-plain:active{color:#3a8ee6;border-color:#3a8ee6}.el-button.is-plain:active{background:#FFF;outline:0}.el-button.is-disabled,.el-button.is-disabled:focus,.el-button.is-disabled:hover{color:#C0C4CC;cursor:not-allowed;background-image:none;background-color:#FFF;border-color:#EBEEF5}.el-button.is-disabled.el-button--text{background-color:transparent}.el-button.is-disabled.is-plain,.el-button.is-disabled.is-plain:focus,.el-button.is-disabled.is-plain:hover{background-color:#FFF;border-color:#EBEEF5;color:#C0C4CC}.el-button.is-loading{position:relative;pointer-events:none}.el-button.is-loading:before{pointer-events:none;content:'';position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:inherit;background-color:rgba(255,255,255,.35)}.el-button.is-round{border-radius:20px;padding:12px 23px}.el-button.is-circle{border-radius:50%;padding:12px}.el-button--primary{color:#FFF;background-color:#409EFF;border-color:#409EFF}.el-button--primary:focus,.el-button--primary:hover{background:#66b1ff;border-color:#66b1ff;color:#FFF}.el-button--primary.is-active,.el-button--primary:active{background:#3a8ee6;border-color:#3a8ee6;color:#FFF}.el-button--primary:active{outline:0}.el-button--primary.is-disabled,.el-button--primary.is-disabled:active,.el-button--primary.is-disabled:focus,.el-button--primary.is-disabled:hover{color:#FFF;background-color:#a0cfff;border-color:#a0cfff}.el-button--primary.is-plain{color:#409EFF;background:#ecf5ff;border-color:#b3d8ff}.el-button--primary.is-plain:focus,.el-button--primary.is-plain:hover{background:#409EFF;border-color:#409EFF;color:#FFF}.el-button--primary.is-plain:active{background:#3a8ee6;border-color:#3a8ee6;color:#FFF;outline:0}.el-button--primary.is-plain.is-disabled,.el-button--primary.is-plain.is-disabled:active,.el-button--primary.is-plain.is-disabled:focus,.el-button--primary.is-plain.is-disabled:hover{color:#8cc5ff;background-color:#ecf5ff;border-color:#d9ecff}.el-button--success{color:#FFF;background-color:#67C23A;border-color:#67C23A}.el-button--success:focus,.el-button--success:hover{background:#85ce61;border-color:#85ce61;color:#FFF}.el-button--success.is-active,.el-button--success:active{background:#5daf34;border-color:#5daf34;color:#FFF}.el-button--success:active{outline:0}.el-button--success.is-disabled,.el-button--success.is-disabled:active,.el-button--success.is-disabled:focus,.el-button--success.is-disabled:hover{color:#FFF;background-color:#b3e19d;border-color:#b3e19d}.el-button--success.is-plain{color:#67C23A;background:#f0f9eb;border-color:#c2e7b0}.el-button--success.is-plain:focus,.el-button--success.is-plain:hover{background:#67C23A;border-color:#67C23A;color:#FFF}.el-button--success.is-plain:active{background:#5daf34;border-color:#5daf34;color:#FFF;outline:0}.el-button--success.is-plain.is-disabled,.el-button--success.is-plain.is-disabled:active,.el-button--success.is-plain.is-disabled:focus,.el-button--success.is-plain.is-disabled:hover{color:#a4da89;background-color:#f0f9eb;border-color:#e1f3d8}.el-button--warning{color:#FFF;background-color:#E6A23C;border-color:#E6A23C}.el-button--warning:focus,.el-button--warning:hover{background:#ebb563;border-color:#ebb563;color:#FFF}.el-button--warning.is-active,.el-button--warning:active{background:#cf9236;border-color:#cf9236;color:#FFF}.el-button--warning:active{outline:0}.el-button--warning.is-disabled,.el-button--warning.is-disabled:active,.el-button--warning.is-disabled:focus,.el-button--warning.is-disabled:hover{color:#FFF;background-color:#f3d19e;border-color:#f3d19e}.el-button--warning.is-plain{color:#E6A23C;background:#fdf6ec;border-color:#f5dab1}.el-button--warning.is-plain:focus,.el-button--warning.is-plain:hover{background:#E6A23C;border-color:#E6A23C;color:#FFF}.el-button--warning.is-plain:active{background:#cf9236;border-color:#cf9236;color:#FFF;outline:0}.el-button--warning.is-plain.is-disabled,.el-button--warning.is-plain.is-disabled:active,.el-button--warning.is-plain.is-disabled:focus,.el-button--warning.is-plain.is-disabled:hover{color:#f0c78a;background-color:#fdf6ec;border-color:#faecd8}.el-button--danger{color:#FFF;background-color:#F56C6C;border-color:#F56C6C}.el-button--danger:focus,.el-button--danger:hover{background:#f78989;border-color:#f78989;color:#FFF}.el-button--danger.is-active,.el-button--danger:active{background:#dd6161;border-color:#dd6161;color:#FFF}.el-button--danger:active{outline:0}.el-button--danger.is-disabled,.el-button--danger.is-disabled:active,.el-button--danger.is-disabled:focus,.el-button--danger.is-disabled:hover{color:#FFF;background-color:#fab6b6;border-color:#fab6b6}.el-button--danger.is-plain{color:#F56C6C;background:#fef0f0;border-color:#fbc4c4}.el-button--danger.is-plain:focus,.el-button--danger.is-plain:hover{background:#F56C6C;border-color:#F56C6C;color:#FFF}.el-button--danger.is-plain:active{background:#dd6161;border-color:#dd6161;color:#FFF;outline:0}.el-button--danger.is-plain.is-disabled,.el-button--danger.is-plain.is-disabled:active,.el-button--danger.is-plain.is-disabled:focus,.el-button--danger.is-plain.is-disabled:hover{color:#f9a7a7;background-color:#fef0f0;border-color:#fde2e2}.el-button--info{color:#FFF;background-color:#909399;border-color:#909399}.el-button--info:focus,.el-button--info:hover{background:#a6a9ad;border-color:#a6a9ad;color:#FFF}.el-button--info.is-active,.el-button--info:active{background:#82848a;border-color:#82848a;color:#FFF}.el-button--info:active{outline:0}.el-button--info.is-disabled,.el-button--info.is-disabled:active,.el-button--info.is-disabled:focus,.el-button--info.is-disabled:hover{color:#FFF;background-color:#c8c9cc;border-color:#c8c9cc}.el-button--info.is-plain{color:#909399;background:#f4f4f5;border-color:#d3d4d6}.el-button--info.is-plain:focus,.el-button--info.is-plain:hover{background:#909399;border-color:#909399;color:#FFF}.el-button--info.is-plain:active{background:#82848a;border-color:#82848a;color:#FFF;outline:0}.el-button--info.is-plain.is-disabled,.el-button--info.is-plain.is-disabled:active,.el-button--info.is-plain.is-disabled:focus,.el-button--info.is-plain.is-disabled:hover{color:#bcbec2;background-color:#f4f4f5;border-color:#e9e9eb}.el-button--medium{padding:10px 20px;font-size:14px;border-radius:4px}.el-button--medium.is-round{padding:10px 20px}.el-button--medium.is-circle{padding:10px}.el-button--small{padding:9px 15px;font-size:12px;border-radius:3px}.el-button--small.is-round{padding:9px 15px}.el-button--small.is-circle{padding:9px}.el-button--mini,.el-button--mini.is-round{padding:7px 15px}.el-button--mini{font-size:12px;border-radius:3px}.el-button--mini.is-circle{padding:7px}.el-button--text{border-color:transparent;color:#409EFF;background:0 0;padding-left:0;padding-right:0}.el-button--text:focus,.el-button--text:hover{color:#66b1ff;border-color:transparent;background-color:transparent}.el-button--text:active{color:#3a8ee6;border-color:transparent;background-color:transparent}.el-button--text.is-disabled,.el-button--text.is-disabled:focus,.el-button--text.is-disabled:hover{border-color:transparent}.el-button-group .el-button--danger:last-child,.el-button-group .el-button--danger:not(:first-child):not(:last-child),.el-button-group .el-button--info:last-child,.el-button-group .el-button--info:not(:first-child):not(:last-child),.el-button-group .el-button--primary:last-child,.el-button-group .el-button--primary:not(:first-child):not(:last-child),.el-button-group .el-button--success:last-child,.el-button-group .el-button--success:not(:first-child):not(:last-child),.el-button-group .el-button--warning:last-child,.el-button-group .el-button--warning:not(:first-child):not(:last-child),.el-button-group>.el-dropdown>.el-button{border-left-color:rgba(255,255,255,.5)}.el-button-group .el-button--danger:first-child,.el-button-group .el-button--danger:not(:first-child):not(:last-child),.el-button-group .el-button--info:first-child,.el-button-group .el-button--info:not(:first-child):not(:last-child),.el-button-group .el-button--primary:first-child,.el-button-group .el-button--primary:not(:first-child):not(:last-child),.el-button-group .el-button--success:first-child,.el-button-group .el-button--success:not(:first-child):not(:last-child),.el-button-group .el-button--warning:first-child,.el-button-group .el-button--warning:not(:first-child):not(:last-child){border-right-color:rgba(255,255,255,.5)}.el-button-group{display:inline-block;vertical-align:middle}.el-button-group::after,.el-button-group::before{display:table}.el-button-group::after{clear:both}.el-button-group>.el-button{float:left;position:relative}.el-button-group>.el-button.is-disabled{z-index:1}.el-button-group>.el-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.el-button-group>.el-button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.el-button-group>.el-button:first-child:last-child{border-radius:4px}.el-button-group>.el-button:first-child:last-child.is-round{border-radius:20px}.el-button-group>.el-button:first-child:last-child.is-circle{border-radius:50%}.el-button-group>.el-button:not(:first-child):not(:last-child){border-radius:0}.el-button-group>.el-button.is-active,.el-button-group>.el-button:not(.is-disabled):active,.el-button-group>.el-button:not(.is-disabled):focus,.el-button-group>.el-button:not(.is-disabled):hover{z-index:1}.el-button-group>.el-dropdown>.el-button{border-top-left-radius:0;border-bottom-left-radius:0}.el-calendar{background-color:#fff}.el-calendar__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:12px 20px;border-bottom:1px solid #EBEEF5}.el-backtop,.el-page-header{display:-webkit-box;display:-ms-flexbox}.el-calendar__title{color:#000;-ms-flex-item-align:center;align-self:center}.el-calendar__body{padding:12px 20px 35px}.el-calendar-table{table-layout:fixed;width:100%}.el-calendar-table thead th{padding:12px 0;color:#606266;font-weight:400}.el-calendar-table:not(.is-range) td.next,.el-calendar-table:not(.is-range) td.prev{color:#C0C4CC}.el-backtop,.el-calendar-table td.is-today{color:#409EFF}.el-calendar-table td{border-bottom:1px solid #EBEEF5;border-right:1px solid #EBEEF5;vertical-align:top;-webkit-transition:background-color .2s ease;transition:background-color .2s ease}.el-calendar-table td.is-selected{background-color:#F2F8FE}.el-calendar-table tr:first-child td{border-top:1px solid #EBEEF5}.el-calendar-table tr td:first-child{border-left:1px solid #EBEEF5}.el-calendar-table tr.el-calendar-table__row--hide-border td{border-top:none}.el-calendar-table .el-calendar-day{-webkit-box-sizing:border-box;box-sizing:border-box;padding:8px;height:85px}.el-calendar-table .el-calendar-day:hover{cursor:pointer;background-color:#F2F8FE}.el-backtop{position:fixed;background-color:#FFF;width:40px;height:40px;border-radius:50%;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;font-size:20px;-webkit-box-shadow:0 0 6px rgba(0,0,0,.12);box-shadow:0 0 6px rgba(0,0,0,.12);cursor:pointer;z-index:5}.el-backtop:hover{background-color:#F2F6FC}.el-page-header{display:flex;line-height:24px}.el-page-header__left{display:-webkit-box;display:-ms-flexbox;display:flex;cursor:pointer;margin-right:40px;position:relative}.el-page-header__left::after{position:absolute;width:1px;height:16px;right:-20px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);background-color:#DCDFE6}.el-checkbox,.el-checkbox__input{display:inline-block;position:relative;white-space:nowrap}.el-page-header__left .el-icon-back{font-size:18px;margin-right:6px;-ms-flex-item-align:center;align-self:center}.el-page-header__title{font-size:14px;font-weight:500}.el-page-header__content{font-size:18px;color:#303133}.el-checkbox{color:#606266;font-weight:500;font-size:14px;cursor:pointer;user-select:none;margin-right:30px}.el-checkbox.is-bordered{padding:9px 20px 9px 10px;border-radius:4px;border:1px solid #DCDFE6;-webkit-box-sizing:border-box;box-sizing:border-box;line-height:normal;height:40px}.el-checkbox.is-bordered.is-checked{border-color:#409EFF}.el-checkbox.is-bordered.is-disabled{border-color:#EBEEF5;cursor:not-allowed}.el-checkbox.is-bordered.el-checkbox--medium{padding:7px 20px 7px 10px;border-radius:4px;height:36px}.el-checkbox.is-bordered.el-checkbox--medium .el-checkbox__label{line-height:17px;font-size:14px}.el-checkbox.is-bordered.el-checkbox--medium .el-checkbox__inner{height:14px;width:14px}.el-checkbox.is-bordered.el-checkbox--small{padding:5px 15px 5px 10px;border-radius:3px;height:32px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__label{line-height:15px;font-size:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner::after{height:6px;width:2px}.el-checkbox.is-bordered.el-checkbox--mini{padding:3px 15px 3px 10px;border-radius:3px;height:28px}.el-checkbox.is-bordered.el-checkbox--mini .el-checkbox__label{line-height:12px;font-size:12px}.el-checkbox.is-bordered.el-checkbox--mini .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--mini .el-checkbox__inner::after{height:6px;width:2px}.el-checkbox__input{cursor:pointer;outline:0;line-height:1;vertical-align:middle}.el-checkbox__input.is-disabled .el-checkbox__inner{background-color:#edf2fc;border-color:#DCDFE6;cursor:not-allowed}.el-checkbox__input.is-disabled .el-checkbox__inner::after{cursor:not-allowed;border-color:#C0C4CC}.el-checkbox__input.is-disabled .el-checkbox__inner+.el-checkbox__label{cursor:not-allowed}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner{background-color:#F2F6FC;border-color:#DCDFE6}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after{border-color:#C0C4CC}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner{background-color:#F2F6FC;border-color:#DCDFE6}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner::before{background-color:#C0C4CC;border-color:#C0C4CC}.el-checkbox__input.is-checked .el-checkbox__inner,.el-checkbox__input.is-indeterminate .el-checkbox__inner{background-color:#409EFF;border-color:#409EFF}.el-checkbox__input.is-disabled+span.el-checkbox__label{color:#C0C4CC;cursor:not-allowed}.el-checkbox__input.is-checked .el-checkbox__inner::after{-webkit-transform:rotate(45deg) scaleY(1);transform:rotate(45deg) scaleY(1)}.el-checkbox__input.is-checked+.el-checkbox__label{color:#409EFF}.el-checkbox__input.is-focus .el-checkbox__inner{border-color:#409EFF}.el-checkbox__input.is-indeterminate .el-checkbox__inner::before{content:'';position:absolute;display:block;background-color:#FFF;height:2px;-webkit-transform:scale(.5);transform:scale(.5);left:0;right:0;top:5px}.el-checkbox__input.is-indeterminate .el-checkbox__inner::after{display:none}.el-checkbox__inner{display:inline-block;position:relative;border:1px solid #DCDFE6;border-radius:2px;-webkit-box-sizing:border-box;box-sizing:border-box;width:14px;height:14px;background-color:#FFF;z-index:1;-webkit-transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46);transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.el-checkbox__inner:hover{border-color:#409EFF}.el-checkbox__inner::after{-webkit-box-sizing:content-box;box-sizing:content-box;content:"";border:1px solid #FFF;border-left:0;border-top:0;height:7px;left:4px;position:absolute;top:1px;-webkit-transform:rotate(45deg) scaleY(0);transform:rotate(45deg) scaleY(0);width:3px;-webkit-transition:-webkit-transform .15s ease-in .05s;transition:-webkit-transform .15s ease-in .05s;transition:transform .15s ease-in .05s;transition:transform .15s ease-in .05s,-webkit-transform .15s ease-in .05s;-webkit-transform-origin:center;transform-origin:center}.el-checkbox__original{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.el-checkbox-button,.el-checkbox-button__inner{display:inline-block;position:relative}.el-checkbox__label{display:inline-block;padding-left:10px;line-height:19px;font-size:14px}.el-checkbox:last-of-type{margin-right:0}.el-checkbox-button__inner{line-height:1;font-weight:500;white-space:nowrap;vertical-align:middle;cursor:pointer;background:#FFF;border:1px solid #DCDFE6;border-left:0;color:#606266;-webkit-appearance:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;outline:0;margin:0;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);padding:12px 20px;font-size:14px;border-radius:0}.el-checkbox-button__inner.is-round{padding:12px 20px}.el-checkbox-button__inner:hover{color:#409EFF}.el-checkbox-button__inner [class*=el-icon-]{line-height:.9}.el-checkbox-button__inner [class*=el-icon-]+span{margin-left:5px}.el-checkbox-button__original{opacity:0;outline:0;position:absolute;margin:0;z-index:-1}.el-radio,.el-radio__inner,.el-radio__input{position:relative;display:inline-block}.el-checkbox-button.is-checked .el-checkbox-button__inner{color:#FFF;background-color:#409EFF;border-color:#409EFF;-webkit-box-shadow:-1px 0 0 0 #8cc5ff;box-shadow:-1px 0 0 0 #8cc5ff}.el-checkbox-button.is-checked:first-child .el-checkbox-button__inner{border-left-color:#409EFF}.el-checkbox-button.is-disabled .el-checkbox-button__inner{color:#C0C4CC;cursor:not-allowed;background-image:none;background-color:#FFF;border-color:#EBEEF5;-webkit-box-shadow:none;box-shadow:none}.el-checkbox-button.is-disabled:first-child .el-checkbox-button__inner{border-left-color:#EBEEF5}.el-checkbox-button:first-child .el-checkbox-button__inner{border-left:1px solid #DCDFE6;border-radius:4px 0 0 4px;-webkit-box-shadow:none!important;box-shadow:none!important}.el-checkbox-button.is-focus .el-checkbox-button__inner{border-color:#409EFF}.el-checkbox-button:last-child .el-checkbox-button__inner{border-radius:0 4px 4px 0}.el-checkbox-button--medium .el-checkbox-button__inner{padding:10px 20px;font-size:14px;border-radius:0}.el-checkbox-button--medium .el-checkbox-button__inner.is-round{padding:10px 20px}.el-checkbox-button--small .el-checkbox-button__inner{padding:9px 15px;font-size:12px;border-radius:0}.el-checkbox-button--small .el-checkbox-button__inner.is-round{padding:9px 15px}.el-checkbox-button--mini .el-checkbox-button__inner{padding:7px 15px;font-size:12px;border-radius:0}.el-checkbox-button--mini .el-checkbox-button__inner.is-round{padding:7px 15px}.el-checkbox-group{font-size:0}.el-avatar,.el-cascader-panel,.el-radio,.el-radio--medium.is-bordered .el-radio__label,.el-radio__label{font-size:14px}.el-radio{color:#606266;font-weight:500;line-height:1;cursor:pointer;white-space:nowrap;outline:0;margin-right:30px}.el-cascader-node>.el-radio,.el-radio:last-child{margin-right:0}.el-radio.is-bordered{padding:12px 20px 0 10px;border-radius:4px;border:1px solid #DCDFE6;-webkit-box-sizing:border-box;box-sizing:border-box;height:40px}.el-cascader-menu,.el-cascader-menu__list,.el-radio__inner{-webkit-box-sizing:border-box}.el-radio.is-bordered.is-checked{border-color:#409EFF}.el-radio.is-bordered.is-disabled{cursor:not-allowed;border-color:#EBEEF5}.el-radio__input.is-disabled .el-radio__inner,.el-radio__input.is-disabled.is-checked .el-radio__inner{background-color:#F5F7FA;border-color:#E4E7ED}.el-radio.is-bordered+.el-radio.is-bordered{margin-left:10px}.el-radio--medium.is-bordered{padding:10px 20px 0 10px;border-radius:4px;height:36px}.el-radio--mini.is-bordered .el-radio__label,.el-radio--small.is-bordered .el-radio__label{font-size:12px}.el-radio--medium.is-bordered .el-radio__inner{height:14px;width:14px}.el-radio--small.is-bordered{padding:8px 15px 0 10px;border-radius:3px;height:32px}.el-radio--small.is-bordered .el-radio__inner{height:12px;width:12px}.el-radio--mini.is-bordered{padding:6px 15px 0 10px;border-radius:3px;height:28px}.el-radio--mini.is-bordered .el-radio__inner{height:12px;width:12px}.el-radio__input{white-space:nowrap;cursor:pointer;outline:0;line-height:1;vertical-align:middle}.el-radio__input.is-disabled .el-radio__inner{cursor:not-allowed}.el-radio__input.is-disabled .el-radio__inner::after{cursor:not-allowed;background-color:#F5F7FA}.el-radio__input.is-disabled .el-radio__inner+.el-radio__label{cursor:not-allowed}.el-radio__input.is-disabled.is-checked .el-radio__inner::after{background-color:#C0C4CC}.el-radio__input.is-disabled+span.el-radio__label{color:#C0C4CC;cursor:not-allowed}.el-radio__input.is-checked .el-radio__inner{border-color:#409EFF;background:#409EFF}.el-radio__input.is-checked .el-radio__inner::after{-webkit-transform:translate(-50%,-50%) scale(1);transform:translate(-50%,-50%) scale(1)}.el-radio__input.is-checked+.el-radio__label{color:#409EFF}.el-radio__input.is-focus .el-radio__inner{border-color:#409EFF}.el-radio__inner{border:1px solid #DCDFE6;border-radius:100%;width:14px;height:14px;background-color:#FFF;cursor:pointer;box-sizing:border-box}.el-radio__inner:hover{border-color:#409EFF}.el-radio__inner::after{width:4px;height:4px;border-radius:100%;background-color:#FFF;content:"";position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%,-50%) scale(0);transform:translate(-50%,-50%) scale(0);-webkit-transition:-webkit-transform .15s ease-in;transition:-webkit-transform .15s ease-in;transition:transform .15s ease-in;transition:transform .15s ease-in,-webkit-transform .15s ease-in}.el-radio__original{opacity:0;outline:0;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner{-webkit-box-shadow:0 0 2px 2px #409EFF;box-shadow:0 0 2px 2px #409EFF}.el-radio__label{padding-left:10px}.el-scrollbar{overflow:hidden;position:relative}.el-scrollbar:active>.el-scrollbar__bar,.el-scrollbar:focus>.el-scrollbar__bar,.el-scrollbar:hover>.el-scrollbar__bar{opacity:1;-webkit-transition:opacity 340ms ease-out;transition:opacity 340ms ease-out}.el-scrollbar__wrap{overflow:scroll;height:100%}.el-scrollbar__wrap--hidden-default{scrollbar-width:none}.el-scrollbar__wrap--hidden-default::-webkit-scrollbar{width:0;height:0}.el-scrollbar__thumb{position:relative;display:block;width:0;height:0;cursor:pointer;border-radius:inherit;background-color:rgba(144,147,153,.3);-webkit-transition:.3s background-color;transition:.3s background-color}.el-scrollbar__thumb:hover{background-color:rgba(144,147,153,.5)}.el-scrollbar__bar{position:absolute;right:2px;bottom:2px;z-index:1;border-radius:4px;opacity:0;-webkit-transition:opacity 120ms ease-out;transition:opacity 120ms ease-out}.el-scrollbar__bar.is-vertical{width:6px;top:2px}.el-scrollbar__bar.is-vertical>div{width:100%}.el-scrollbar__bar.is-horizontal{height:6px;left:2px}.el-scrollbar__bar.is-horizontal>div{height:100%}.el-cascader-panel{display:-webkit-box;display:-ms-flexbox;display:flex;border-radius:4px}.el-cascader-panel.is-bordered{border:1px solid #E4E7ED;border-radius:4px}.el-cascader-menu{min-width:180px;box-sizing:border-box;color:#606266;border-right:solid 1px #E4E7ED}.el-cascader-menu:last-child{border-right:none}.el-cascader-menu__wrap{height:204px}.el-cascader-menu__list{position:relative;min-height:100%;margin:0;padding:6px 0;list-style:none;box-sizing:border-box}.el-cascader-menu__hover-zone{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.el-cascader-menu__empty-text{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);text-align:center;color:#C0C4CC}.el-cascader-node{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0 30px 0 20px;height:34px;line-height:34px;outline:0}.el-cascader-node.is-selectable.in-active-path{color:#606266}.el-cascader-node.in-active-path,.el-cascader-node.is-active,.el-cascader-node.is-selectable.in-checked-path{color:#409EFF;font-weight:700}.el-cascader-node:not(.is-disabled){cursor:pointer}.el-cascader-node:not(.is-disabled):focus,.el-cascader-node:not(.is-disabled):hover{background:#F5F7FA}.el-cascader-node.is-disabled{color:#C0C4CC;cursor:not-allowed}.el-cascader-node__prefix{position:absolute;left:10px}.el-cascader-node__postfix{position:absolute;right:10px}.el-cascader-node__label{-webkit-box-flex:1;-ms-flex:1;flex:1;padding:0 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-cascader-node>.el-radio .el-radio__label{padding-left:0}.el-avatar{display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;overflow:hidden;color:#fff;background:#C0C4CC;width:40px;height:40px;line-height:40px}.el-drawer,.el-drawer__body>*{-webkit-box-sizing:border-box}.el-avatar>img{display:block;height:100%;vertical-align:middle}.el-empty__image img,.el-empty__image svg{vertical-align:top;height:100%;width:100%}.el-avatar--circle{border-radius:50%}.el-avatar--square{border-radius:4px}.el-avatar--icon{font-size:18px}.el-avatar--large{width:40px;height:40px;line-height:40px}.el-avatar--medium{width:36px;height:36px;line-height:36px}.el-avatar--small{width:28px;height:28px;line-height:28px}@-webkit-keyframes el-drawer-fade-in{0%{opacity:0}100%{opacity:1}}@keyframes el-drawer-fade-in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes rtl-drawer-in{0%{-webkit-transform:translate(100%,0);transform:translate(100%,0)}100%{-webkit-transform:translate(0,0);transform:translate(0,0)}}@keyframes rtl-drawer-in{0%{-webkit-transform:translate(100%,0);transform:translate(100%,0)}100%{-webkit-transform:translate(0,0);transform:translate(0,0)}}@-webkit-keyframes rtl-drawer-out{0%{-webkit-transform:translate(0,0);transform:translate(0,0)}100%{-webkit-transform:translate(100%,0);transform:translate(100%,0)}}@keyframes rtl-drawer-out{0%{-webkit-transform:translate(0,0);transform:translate(0,0)}100%{-webkit-transform:translate(100%,0);transform:translate(100%,0)}}@-webkit-keyframes ltr-drawer-in{0%{-webkit-transform:translate(-100%,0);transform:translate(-100%,0)}100%{-webkit-transform:translate(0,0);transform:translate(0,0)}}@keyframes ltr-drawer-in{0%{-webkit-transform:translate(-100%,0);transform:translate(-100%,0)}100%{-webkit-transform:translate(0,0);transform:translate(0,0)}}@-webkit-keyframes ltr-drawer-out{0%{-webkit-transform:translate(0,0);transform:translate(0,0)}100%{-webkit-transform:translate(-100%,0);transform:translate(-100%,0)}}@keyframes ltr-drawer-out{0%{-webkit-transform:translate(0,0);transform:translate(0,0)}100%{-webkit-transform:translate(-100%,0);transform:translate(-100%,0)}}@-webkit-keyframes ttb-drawer-in{0%{-webkit-transform:translate(0,-100%);transform:translate(0,-100%)}100%{-webkit-transform:translate(0,0);transform:translate(0,0)}}@keyframes ttb-drawer-in{0%{-webkit-transform:translate(0,-100%);transform:translate(0,-100%)}100%{-webkit-transform:translate(0,0);transform:translate(0,0)}}@-webkit-keyframes ttb-drawer-out{0%{-webkit-transform:translate(0,0);transform:translate(0,0)}100%{-webkit-transform:translate(0,-100%);transform:translate(0,-100%)}}@keyframes ttb-drawer-out{0%{-webkit-transform:translate(0,0);transform:translate(0,0)}100%{-webkit-transform:translate(0,-100%);transform:translate(0,-100%)}}@-webkit-keyframes btt-drawer-in{0%{-webkit-transform:translate(0,100%);transform:translate(0,100%)}100%{-webkit-transform:translate(0,0);transform:translate(0,0)}}@keyframes btt-drawer-in{0%{-webkit-transform:translate(0,100%);transform:translate(0,100%)}100%{-webkit-transform:translate(0,0);transform:translate(0,0)}}@-webkit-keyframes btt-drawer-out{0%{-webkit-transform:translate(0,0);transform:translate(0,0)}100%{-webkit-transform:translate(0,100%);transform:translate(0,100%)}}@keyframes btt-drawer-out{0%{-webkit-transform:translate(0,0);transform:translate(0,0)}100%{-webkit-transform:translate(0,100%);transform:translate(0,100%)}}.el-drawer{position:absolute;box-sizing:border-box;background-color:#FFF;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-shadow:0 8px 10px -5px rgba(0,0,0,.2),0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12);box-shadow:0 8px 10px -5px rgba(0,0,0,.2),0 16px 24px 2px rgba(0,0,0,.14),0 6px 30px 5px rgba(0,0,0,.12);overflow:hidden;outline:0}.el-drawer.rtl{-webkit-animation:rtl-drawer-out .3s;animation:rtl-drawer-out .3s;right:0}.el-drawer__open .el-drawer.rtl{-webkit-animation:rtl-drawer-in .3s 1ms;animation:rtl-drawer-in .3s 1ms}.el-drawer.ltr{-webkit-animation:ltr-drawer-out .3s;animation:ltr-drawer-out .3s;left:0}.el-drawer__open .el-drawer.ltr{-webkit-animation:ltr-drawer-in .3s 1ms;animation:ltr-drawer-in .3s 1ms}.el-drawer.ttb{-webkit-animation:ttb-drawer-out .3s;animation:ttb-drawer-out .3s;top:0}.el-drawer__open .el-drawer.ttb{-webkit-animation:ttb-drawer-in .3s 1ms;animation:ttb-drawer-in .3s 1ms}.el-drawer.btt{-webkit-animation:btt-drawer-out .3s;animation:btt-drawer-out .3s;bottom:0}.el-drawer__open .el-drawer.btt{-webkit-animation:btt-drawer-in .3s 1ms;animation:btt-drawer-in .3s 1ms}.el-drawer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:hidden;margin:0}.el-drawer__header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#72767b;display:-webkit-box;display:-ms-flexbox;display:flex;margin-bottom:32px;padding:20px 20px 0}.el-drawer__header>:first-child{-webkit-box-flex:1;-ms-flex:1;flex:1}.el-drawer__title{margin:0;-webkit-box-flex:1;-ms-flex:1;flex:1;line-height:inherit;font-size:1rem}.el-drawer__close-btn{border:none;cursor:pointer;font-size:20px;color:inherit;background-color:transparent}.el-drawer__body{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:auto}.el-drawer__body>*{box-sizing:border-box}.el-drawer.ltr,.el-drawer.rtl{height:100%;top:0;bottom:0}.el-drawer.btt,.el-drawer.ttb{width:100%;left:0;right:0}.el-drawer__container{position:relative;left:0;right:0;top:0;bottom:0;height:100%;width:100%}.el-drawer-fade-enter-active{-webkit-animation:el-drawer-fade-in .3s;animation:el-drawer-fade-in .3s}.el-drawer-fade-leave-active{animation:el-drawer-fade-in .3s reverse}.el-statistic{width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;color:#000;font-variant:tabular-nums;list-style:none;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum";text-align:center}.el-statistic .head{margin-bottom:4px;color:#606266;font-size:13px}.el-statistic .con{font-family:Sans-serif;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#303133}.el-statistic .con .number{font-size:20px;padding:0 4px}.el-statistic .con span{display:inline-block;margin:0;line-height:100%}.el-popconfirm__main,.el-skeleton__image{display:-ms-flexbox;-webkit-box-align:center;display:-webkit-box}.el-popconfirm__main{display:flex;-ms-flex-align:center;align-items:center}.el-popconfirm__icon{margin-right:5px}.el-popconfirm__action{text-align:right;margin:0}@-webkit-keyframes el-skeleton-loading{0%{background-position:100% 50%}100%{background-position:0 50%}}@keyframes el-skeleton-loading{0%{background-position:100% 50%}100%{background-position:0 50%}}.el-skeleton{width:100%}.el-skeleton__first-line,.el-skeleton__paragraph{height:16px;margin-top:16px;background:#f2f2f2}.el-skeleton.is-animated .el-skeleton__item{background:-webkit-gradient(linear,left top,right top,color-stop(25%,#f2f2f2),color-stop(37%,#e6e6e6),color-stop(63%,#f2f2f2));background:linear-gradient(90deg,#f2f2f2 25%,#e6e6e6 37%,#f2f2f2 63%);background-size:400% 100%;-webkit-animation:el-skeleton-loading 1.4s ease infinite;animation:el-skeleton-loading 1.4s ease infinite}.el-skeleton__item{background:#f2f2f2;display:inline-block;height:16px;border-radius:4px;width:100%}.el-skeleton__circle{border-radius:50%;width:36px;height:36px;line-height:36px}.el-skeleton__circle--lg{width:40px;height:40px;line-height:40px}.el-skeleton__circle--md{width:28px;height:28px;line-height:28px}.el-skeleton__button{height:40px;width:64px;border-radius:4px}.el-skeleton__p{width:100%}.el-skeleton__p.is-last{width:61%}.el-skeleton__p.is-first{width:33%}.el-skeleton__text{width:100%;height:13px}.el-skeleton__caption{height:12px}.el-skeleton__h1{height:20px}.el-skeleton__h3{height:18px}.el-skeleton__h5{height:16px}.el-skeleton__image{width:unset;display:flex;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;border-radius:0}.el-skeleton__image svg{fill:#DCDDE0;width:22%;height:22%}.el-empty{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;padding:40px 0}.el-empty__image{width:160px}.el-empty__image img{user-select:none;-o-object-fit:contain;object-fit:contain}.el-empty__image svg{fill:#DCDDE0}.el-empty__description{margin-top:20px}.el-empty__description p{margin:0;font-size:14px;color:#909399}.el-empty__bottom,.el-result__title{margin-top:20px}.el-descriptions{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px;color:#303133}.el-descriptions__header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:20px}.el-descriptions__title{font-size:16px;font-weight:700}.el-descriptions--mini,.el-descriptions--small{font-size:12px}.el-descriptions__body{color:#606266;background-color:#FFF}.el-descriptions__body .el-descriptions__table{border-collapse:collapse;width:100%;table-layout:fixed}.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell{-webkit-box-sizing:border-box;box-sizing:border-box;text-align:left;font-weight:400;line-height:1.5}.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell.is-left{text-align:left}.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell.is-center{text-align:center}.el-descriptions__body .el-descriptions__table .el-descriptions-item__cell.is-right{text-align:right}.el-descriptions .is-bordered{table-layout:auto}.el-descriptions .is-bordered .el-descriptions-item__cell{border:1px solid #EBEEF5;padding:12px 10px}.el-descriptions :not(.is-bordered) .el-descriptions-item__cell{padding-bottom:12px}.el-descriptions--medium.is-bordered .el-descriptions-item__cell{padding:10px}.el-descriptions--medium:not(.is-bordered) .el-descriptions-item__cell{padding-bottom:10px}.el-descriptions--small.is-bordered .el-descriptions-item__cell{padding:8px 10px}.el-descriptions--small:not(.is-bordered) .el-descriptions-item__cell{padding-bottom:8px}.el-descriptions--mini.is-bordered .el-descriptions-item__cell{padding:6px 10px}.el-descriptions--mini:not(.is-bordered) .el-descriptions-item__cell{padding-bottom:6px}.el-descriptions-item{vertical-align:top}.el-descriptions-item__container{display:-webkit-box;display:-ms-flexbox;display:flex}.el-descriptions-item__container .el-descriptions-item__content,.el-descriptions-item__container .el-descriptions-item__label{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline}.el-descriptions-item__container .el-descriptions-item__content{-webkit-box-flex:1;-ms-flex:1;flex:1}.el-descriptions-item__label.has-colon::after{content:':';position:relative;top:-.5px}.el-descriptions-item__label.is-bordered-label{font-weight:700;color:#909399;background:#fafafa}.el-descriptions-item__label:not(.is-bordered-label){margin-right:10px}.el-descriptions-item__content{word-break:break-word;overflow-wrap:break-word}.el-result{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;padding:40px 30px}.el-result__icon svg{width:64px;height:64px}.el-result__title p{margin:0;font-size:20px;color:#303133;line-height:1.3}.el-result__subtitle{margin-top:10px}.el-result__subtitle p{margin:0;font-size:14px;color:#606266;line-height:1.3}.el-result__extra{margin-top:30px }.el-result .icon-success{fill:#67C23A}.el-result .icon-error{fill:#F56C6C}.el-result .icon-info{fill:#909399}.el-result .icon-warning{fill:#E6A23C} \ No newline at end of file diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..12df51d --- /dev/null +++ b/src/App.vue @@ -0,0 +1,20 @@ + + + + diff --git a/src/api/login.js b/src/api/login.js new file mode 100644 index 0000000..2165d2b --- /dev/null +++ b/src/api/login.js @@ -0,0 +1,69 @@ +import request from '@/utils/request' + +// 登录方法 +export function login(username, password, code, uuid) { + const data = { + username, + password, + code, + uuid + } + return request({ + url: '/login', + headers: { + isToken: false, + repeatSubmit: false + }, + method: 'post', + data: data + }) +} + +// 注册方法 +export function register(data) { + return request({ + url: '/register', + headers: { + isToken: false + }, + method: 'post', + data: data + }) +} + +// 获取用户详细信息 +export function getInfo() { + return request({ + url: '/getInfo', + method: 'get' + }) +} + +// 解锁屏幕 +export function unlockScreen(password) { + return request({ + url: '/unlockscreen', + method: 'post', + data: { password } + }) +} + +// 退出方法 +export function logout() { + return request({ + url: '/logout', + method: 'post' + }) +} + +// 获取验证码 +export function getCodeImg() { + return request({ + url: '/captchaImage', + headers: { + isToken: false + }, + method: 'get', + timeout: 20000 + }) +} \ No newline at end of file diff --git a/src/api/menu.js b/src/api/menu.js new file mode 100644 index 0000000..faef101 --- /dev/null +++ b/src/api/menu.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +// 获取路由 +export const getRouters = () => { + return request({ + url: '/getRouters', + method: 'get' + }) +} \ No newline at end of file diff --git a/src/api/monitor/cache.js b/src/api/monitor/cache.js new file mode 100644 index 0000000..72c5f6a --- /dev/null +++ b/src/api/monitor/cache.js @@ -0,0 +1,57 @@ +import request from '@/utils/request' + +// 查询缓存详细 +export function getCache() { + return request({ + url: '/monitor/cache', + method: 'get' + }) +} + +// 查询缓存名称列表 +export function listCacheName() { + return request({ + url: '/monitor/cache/getNames', + method: 'get' + }) +} + +// 查询缓存键名列表 +export function listCacheKey(cacheName) { + return request({ + url: '/monitor/cache/getKeys/' + cacheName, + method: 'get' + }) +} + +// 查询缓存内容 +export function getCacheValue(cacheName, cacheKey) { + return request({ + url: '/monitor/cache/getValue/' + cacheName + '/' + cacheKey, + method: 'get' + }) +} + +// 清理指定名称缓存 +export function clearCacheName(cacheName) { + return request({ + url: '/monitor/cache/clearCacheName/' + cacheName, + method: 'delete' + }) +} + +// 清理指定键名缓存 +export function clearCacheKey(cacheKey) { + return request({ + url: '/monitor/cache/clearCacheKey/' + cacheKey, + method: 'delete' + }) +} + +// 清理全部缓存 +export function clearCacheAll() { + return request({ + url: '/monitor/cache/clearCacheAll', + method: 'delete' + }) +} diff --git a/src/api/monitor/job.js b/src/api/monitor/job.js new file mode 100644 index 0000000..3815569 --- /dev/null +++ b/src/api/monitor/job.js @@ -0,0 +1,71 @@ +import request from '@/utils/request' + +// 查询定时任务调度列表 +export function listJob(query) { + return request({ + url: '/monitor/job/list', + method: 'get', + params: query + }) +} + +// 查询定时任务调度详细 +export function getJob(jobId) { + return request({ + url: '/monitor/job/' + jobId, + method: 'get' + }) +} + +// 新增定时任务调度 +export function addJob(data) { + return request({ + url: '/monitor/job', + method: 'post', + data: data + }) +} + +// 修改定时任务调度 +export function updateJob(data) { + return request({ + url: '/monitor/job', + method: 'put', + data: data + }) +} + +// 删除定时任务调度 +export function delJob(jobId) { + return request({ + url: '/monitor/job/' + jobId, + method: 'delete' + }) +} + +// 任务状态修改 +export function changeJobStatus(jobId, status) { + const data = { + jobId, + status + } + return request({ + url: '/monitor/job/changeStatus', + method: 'put', + data: data + }) +} + + +// 定时任务立即执行一次 +export function runJob(jobId, jobGroup) { + const data = { + jobId, + jobGroup + } + return request({ + url: '/monitor/job/run', + method: 'put', + data: data + }) +} \ No newline at end of file diff --git a/src/api/monitor/jobLog.js b/src/api/monitor/jobLog.js new file mode 100644 index 0000000..6e0be61 --- /dev/null +++ b/src/api/monitor/jobLog.js @@ -0,0 +1,26 @@ +import request from '@/utils/request' + +// 查询调度日志列表 +export function listJobLog(query) { + return request({ + url: '/monitor/jobLog/list', + method: 'get', + params: query + }) +} + +// 删除调度日志 +export function delJobLog(jobLogId) { + return request({ + url: '/monitor/jobLog/' + jobLogId, + method: 'delete' + }) +} + +// 清空调度日志 +export function cleanJobLog() { + return request({ + url: '/monitor/jobLog/clean', + method: 'delete' + }) +} diff --git a/src/api/monitor/logininfor.js b/src/api/monitor/logininfor.js new file mode 100644 index 0000000..4d112b7 --- /dev/null +++ b/src/api/monitor/logininfor.js @@ -0,0 +1,34 @@ +import request from '@/utils/request' + +// 查询登录日志列表 +export function list(query) { + return request({ + url: '/monitor/logininfor/list', + method: 'get', + params: query + }) +} + +// 删除登录日志 +export function delLogininfor(infoId) { + return request({ + url: '/monitor/logininfor/' + infoId, + method: 'delete' + }) +} + +// 解锁用户登录状态 +export function unlockLogininfor(userName) { + return request({ + url: '/monitor/logininfor/unlock/' + userName, + method: 'get' + }) +} + +// 清空登录日志 +export function cleanLogininfor() { + return request({ + url: '/monitor/logininfor/clean', + method: 'delete' + }) +} diff --git a/src/api/monitor/online.js b/src/api/monitor/online.js new file mode 100644 index 0000000..bd22137 --- /dev/null +++ b/src/api/monitor/online.js @@ -0,0 +1,18 @@ +import request from '@/utils/request' + +// 查询在线用户列表 +export function list(query) { + return request({ + url: '/monitor/online/list', + method: 'get', + params: query + }) +} + +// 强退用户 +export function forceLogout(tokenId) { + return request({ + url: '/monitor/online/' + tokenId, + method: 'delete' + }) +} diff --git a/src/api/monitor/operlog.js b/src/api/monitor/operlog.js new file mode 100644 index 0000000..a04bca8 --- /dev/null +++ b/src/api/monitor/operlog.js @@ -0,0 +1,26 @@ +import request from '@/utils/request' + +// 查询操作日志列表 +export function list(query) { + return request({ + url: '/monitor/operlog/list', + method: 'get', + params: query + }) +} + +// 删除操作日志 +export function delOperlog(operId) { + return request({ + url: '/monitor/operlog/' + operId, + method: 'delete' + }) +} + +// 清空操作日志 +export function cleanOperlog() { + return request({ + url: '/monitor/operlog/clean', + method: 'delete' + }) +} diff --git a/src/api/monitor/server.js b/src/api/monitor/server.js new file mode 100644 index 0000000..e1f9ca2 --- /dev/null +++ b/src/api/monitor/server.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +// 获取服务信息 +export function getServer() { + return request({ + url: '/monitor/server', + method: 'get' + }) +} \ No newline at end of file diff --git a/src/api/system/config.js b/src/api/system/config.js new file mode 100644 index 0000000..a404d82 --- /dev/null +++ b/src/api/system/config.js @@ -0,0 +1,60 @@ +import request from '@/utils/request' + +// 查询参数列表 +export function listConfig(query) { + return request({ + url: '/system/config/list', + method: 'get', + params: query + }) +} + +// 查询参数详细 +export function getConfig(configId) { + return request({ + url: '/system/config/' + configId, + method: 'get' + }) +} + +// 根据参数键名查询参数值 +export function getConfigKey(configKey) { + return request({ + url: '/system/config/configKey/' + configKey, + method: 'get' + }) +} + +// 新增参数配置 +export function addConfig(data) { + return request({ + url: '/system/config', + method: 'post', + data: data + }) +} + +// 修改参数配置 +export function updateConfig(data) { + return request({ + url: '/system/config', + method: 'put', + data: data + }) +} + +// 删除参数配置 +export function delConfig(configId) { + return request({ + url: '/system/config/' + configId, + method: 'delete' + }) +} + +// 刷新参数缓存 +export function refreshCache() { + return request({ + url: '/system/config/refreshCache', + method: 'delete' + }) +} diff --git a/src/api/system/dept.js b/src/api/system/dept.js new file mode 100644 index 0000000..b37643d --- /dev/null +++ b/src/api/system/dept.js @@ -0,0 +1,61 @@ +import request from '@/utils/request' + +// 查询部门列表 +export function listDept(query) { + return request({ + url: '/system/dept/list', + method: 'get', + params: query + }) +} + +// 查询部门列表(排除节点) +export function listDeptExcludeChild(deptId) { + return request({ + url: '/system/dept/list/exclude/' + deptId, + method: 'get' + }) +} + +// 查询部门详细 +export function getDept(deptId) { + return request({ + url: '/system/dept/' + deptId, + method: 'get' + }) +} + +// 新增部门 +export function addDept(data) { + return request({ + url: '/system/dept', + method: 'post', + data: data + }) +} + +// 修改部门 +export function updateDept(data) { + return request({ + url: '/system/dept', + method: 'put', + data: data + }) +} + +// 保存部门排序 +export function updateDeptSort(data) { + return request({ + url: '/system/dept/updateSort', + method: 'put', + data: data + }) +} + +// 删除部门 +export function delDept(deptId) { + return request({ + url: '/system/dept/' + deptId, + method: 'delete' + }) +} \ No newline at end of file diff --git a/src/api/system/dict/data.js b/src/api/system/dict/data.js new file mode 100644 index 0000000..6c9eb79 --- /dev/null +++ b/src/api/system/dict/data.js @@ -0,0 +1,52 @@ +import request from '@/utils/request' + +// 查询字典数据列表 +export function listData(query) { + return request({ + url: '/system/dict/data/list', + method: 'get', + params: query + }) +} + +// 查询字典数据详细 +export function getData(dictCode) { + return request({ + url: '/system/dict/data/' + dictCode, + method: 'get' + }) +} + +// 根据字典类型查询字典数据信息 +export function getDicts(dictType) { + return request({ + url: '/system/dict/data/type/' + dictType, + method: 'get' + }) +} + +// 新增字典数据 +export function addData(data) { + return request({ + url: '/system/dict/data', + method: 'post', + data: data + }) +} + +// 修改字典数据 +export function updateData(data) { + return request({ + url: '/system/dict/data', + method: 'put', + data: data + }) +} + +// 删除字典数据 +export function delData(dictCode) { + return request({ + url: '/system/dict/data/' + dictCode, + method: 'delete' + }) +} diff --git a/src/api/system/dict/type.js b/src/api/system/dict/type.js new file mode 100644 index 0000000..a7a6e01 --- /dev/null +++ b/src/api/system/dict/type.js @@ -0,0 +1,60 @@ +import request from '@/utils/request' + +// 查询字典类型列表 +export function listType(query) { + return request({ + url: '/system/dict/type/list', + method: 'get', + params: query + }) +} + +// 查询字典类型详细 +export function getType(dictId) { + return request({ + url: '/system/dict/type/' + dictId, + method: 'get' + }) +} + +// 新增字典类型 +export function addType(data) { + return request({ + url: '/system/dict/type', + method: 'post', + data: data + }) +} + +// 修改字典类型 +export function updateType(data) { + return request({ + url: '/system/dict/type', + method: 'put', + data: data + }) +} + +// 删除字典类型 +export function delType(dictId) { + return request({ + url: '/system/dict/type/' + dictId, + method: 'delete' + }) +} + +// 刷新字典缓存 +export function refreshCache() { + return request({ + url: '/system/dict/type/refreshCache', + method: 'delete' + }) +} + +// 获取字典选择框列表 +export function optionselect() { + return request({ + url: '/system/dict/type/optionselect', + method: 'get' + }) +} \ No newline at end of file diff --git a/src/api/system/menu.js b/src/api/system/menu.js new file mode 100644 index 0000000..fdf2138 --- /dev/null +++ b/src/api/system/menu.js @@ -0,0 +1,69 @@ +import request from '@/utils/request' + +// 查询菜单列表 +export function listMenu(query) { + return request({ + url: '/system/menu/list', + method: 'get', + params: query + }) +} + +// 查询菜单详细 +export function getMenu(menuId) { + return request({ + url: '/system/menu/' + menuId, + method: 'get' + }) +} + +// 查询菜单下拉树结构 +export function treeselect() { + return request({ + url: '/system/menu/treeselect', + method: 'get' + }) +} + +// 根据角色ID查询菜单下拉树结构 +export function roleMenuTreeselect(roleId) { + return request({ + url: '/system/menu/roleMenuTreeselect/' + roleId, + method: 'get' + }) +} + +// 新增菜单 +export function addMenu(data) { + return request({ + url: '/system/menu', + method: 'post', + data: data + }) +} + +// 修改菜单 +export function updateMenu(data) { + return request({ + url: '/system/menu', + method: 'put', + data: data + }) +} + +// 保存菜单排序 +export function updateMenuSort(data) { + return request({ + url: '/system/menu/updateSort', + method: 'put', + data: data + }) +} + +// 删除菜单 +export function delMenu(menuId) { + return request({ + url: '/system/menu/' + menuId, + method: 'delete' + }) +} \ No newline at end of file diff --git a/src/api/system/notice.js b/src/api/system/notice.js new file mode 100644 index 0000000..5c3ce0f --- /dev/null +++ b/src/api/system/notice.js @@ -0,0 +1,79 @@ +import request from '@/utils/request' + +// 查询公告列表 +export function listNotice(query) { + return request({ + url: '/system/notice/list', + method: 'get', + params: query + }) +} + +// 查询公告详细 +export function getNotice(noticeId) { + return request({ + url: '/system/notice/' + noticeId, + method: 'get' + }) +} + +// 新增公告 +export function addNotice(data) { + return request({ + url: '/system/notice', + method: 'post', + data: data + }) +} + +// 修改公告 +export function updateNotice(data) { + return request({ + url: '/system/notice', + method: 'put', + data: data + }) +} + +// 删除公告 +export function delNotice(noticeId) { + return request({ + url: '/system/notice/' + noticeId, + method: 'delete' + }) +} + +// 首页顶部公告列表(带已读状态) +export function listNoticeTop() { + return request({ + url: '/system/notice/listTop', + method: 'get' + }) +} + +// 标记公告已读 +export function markNoticeRead(noticeId) { + return request({ + url: '/system/notice/markRead', + method: 'post', + params: { noticeId } + }) +} + +// 批量标记已读 +export function markNoticeReadAll(ids) { + return request({ + url: '/system/notice/markReadAll', + method: 'post', + params: { ids } + }) +} + +// 查询公告已读用户列表 +export function listNoticeReadUsers(query) { + return request({ + url: '/system/notice/readUsers/list', + method: 'get', + params: query + }) +} diff --git a/src/api/system/post.js b/src/api/system/post.js new file mode 100644 index 0000000..1a8e9ca --- /dev/null +++ b/src/api/system/post.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询岗位列表 +export function listPost(query) { + return request({ + url: '/system/post/list', + method: 'get', + params: query + }) +} + +// 查询岗位详细 +export function getPost(postId) { + return request({ + url: '/system/post/' + postId, + method: 'get' + }) +} + +// 新增岗位 +export function addPost(data) { + return request({ + url: '/system/post', + method: 'post', + data: data + }) +} + +// 修改岗位 +export function updatePost(data) { + return request({ + url: '/system/post', + method: 'put', + data: data + }) +} + +// 删除岗位 +export function delPost(postId) { + return request({ + url: '/system/post/' + postId, + method: 'delete' + }) +} diff --git a/src/api/system/role.js b/src/api/system/role.js new file mode 100644 index 0000000..f13e6f4 --- /dev/null +++ b/src/api/system/role.js @@ -0,0 +1,119 @@ +import request from '@/utils/request' + +// 查询角色列表 +export function listRole(query) { + return request({ + url: '/system/role/list', + method: 'get', + params: query + }) +} + +// 查询角色详细 +export function getRole(roleId) { + return request({ + url: '/system/role/' + roleId, + method: 'get' + }) +} + +// 新增角色 +export function addRole(data) { + return request({ + url: '/system/role', + method: 'post', + data: data + }) +} + +// 修改角色 +export function updateRole(data) { + return request({ + url: '/system/role', + method: 'put', + data: data + }) +} + +// 角色数据权限 +export function dataScope(data) { + return request({ + url: '/system/role/dataScope', + method: 'put', + data: data + }) +} + +// 角色状态修改 +export function changeRoleStatus(roleId, status) { + const data = { + roleId, + status + } + return request({ + url: '/system/role/changeStatus', + method: 'put', + data: data + }) +} + +// 删除角色 +export function delRole(roleId) { + return request({ + url: '/system/role/' + roleId, + method: 'delete' + }) +} + +// 查询角色已授权用户列表 +export function allocatedUserList(query) { + return request({ + url: '/system/role/authUser/allocatedList', + method: 'get', + params: query + }) +} + +// 查询角色未授权用户列表 +export function unallocatedUserList(query) { + return request({ + url: '/system/role/authUser/unallocatedList', + method: 'get', + params: query + }) +} + +// 取消用户授权角色 +export function authUserCancel(data) { + return request({ + url: '/system/role/authUser/cancel', + method: 'put', + data: data + }) +} + +// 批量取消用户授权角色 +export function authUserCancelAll(data) { + return request({ + url: '/system/role/authUser/cancelAll', + method: 'put', + params: data + }) +} + +// 授权用户选择 +export function authUserSelectAll(data) { + return request({ + url: '/system/role/authUser/selectAll', + method: 'put', + params: data + }) +} + +// 根据角色ID查询部门树结构 +export function deptTreeSelect(roleId) { + return request({ + url: '/system/role/deptTree/' + roleId, + method: 'get' + }) +} diff --git a/src/api/system/user.js b/src/api/system/user.js new file mode 100644 index 0000000..8fae1ba --- /dev/null +++ b/src/api/system/user.js @@ -0,0 +1,136 @@ +import request from '@/utils/request' +import { parseStrEmpty } from "@/utils/ruoyi" + +// 查询用户列表 +export function listUser(query) { + return request({ + url: '/system/user/list', + method: 'get', + params: query + }) +} + +// 查询用户详细 +export function getUser(userId) { + return request({ + url: '/system/user/' + parseStrEmpty(userId), + method: 'get' + }) +} + +// 新增用户 +export function addUser(data) { + return request({ + url: '/system/user', + method: 'post', + data: data + }) +} + +// 修改用户 +export function updateUser(data) { + return request({ + url: '/system/user', + method: 'put', + data: data + }) +} + +// 删除用户 +export function delUser(userId) { + return request({ + url: '/system/user/' + userId, + method: 'delete' + }) +} + +// 用户密码重置 +export function resetUserPwd(userId, password) { + const data = { + userId, + password + } + return request({ + url: '/system/user/resetPwd', + method: 'put', + data: data + }) +} + +// 用户状态修改 +export function changeUserStatus(userId, status) { + const data = { + userId, + status + } + return request({ + url: '/system/user/changeStatus', + method: 'put', + data: data + }) +} + +// 查询用户个人信息 +export function getUserProfile() { + return request({ + url: '/system/user/profile', + method: 'get' + }) +} + +// 修改用户个人信息 +export function updateUserProfile(data) { + return request({ + url: '/system/user/profile', + method: 'put', + data: data + }) +} + +// 用户密码重置 +export function updateUserPwd(oldPassword, newPassword) { + const data = { + oldPassword, + newPassword + } + return request({ + url: '/system/user/profile/updatePwd', + method: 'put', + data: data + }) +} + +// 用户头像上传 +export function uploadAvatar(data) { + return request({ + url: '/system/user/profile/avatar', + method: 'post', + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + data: data + }) +} + +// 查询授权角色 +export function getAuthRole(userId) { + return request({ + url: '/system/user/authRole/' + userId, + method: 'get' + }) +} + +// 保存授权角色 +export function updateAuthRole(data) { + return request({ + url: '/system/user/authRole', + method: 'put', + params: data + }) +} + +// 查询部门下拉树结构 +export function deptTreeSelect() { + return request({ + url: '/system/user/deptTree', + method: 'get' + }) +} diff --git a/src/api/tool/gen.js b/src/api/tool/gen.js new file mode 100644 index 0000000..2075677 --- /dev/null +++ b/src/api/tool/gen.js @@ -0,0 +1,85 @@ +import request from '@/utils/request' + +// 查询生成表数据 +export function listTable(query) { + return request({ + url: '/tool/gen/list', + method: 'get', + params: query + }) +} +// 查询db数据库列表 +export function listDbTable(query) { + return request({ + url: '/tool/gen/db/list', + method: 'get', + params: query + }) +} + +// 查询表详细信息 +export function getGenTable(tableId) { + return request({ + url: '/tool/gen/' + tableId, + method: 'get' + }) +} + +// 修改代码生成信息 +export function updateGenTable(data) { + return request({ + url: '/tool/gen', + method: 'put', + data: data + }) +} + +// 导入表 +export function importTable(data) { + return request({ + url: '/tool/gen/importTable', + method: 'post', + params: data + }) +} + +// 创建表 +export function createTable(data) { + return request({ + url: '/tool/gen/createTable', + method: 'post', + params: data + }) +} + +// 预览生成代码 +export function previewTable(tableId) { + return request({ + url: '/tool/gen/preview/' + tableId, + method: 'get' + }) +} + +// 删除表数据 +export function delTable(tableId) { + return request({ + url: '/tool/gen/' + tableId, + method: 'delete' + }) +} + +// 生成代码(自定义路径) +export function genCode(tableName) { + return request({ + url: '/tool/gen/genCode/' + tableName, + method: 'get' + }) +} + +// 同步数据库 +export function synchDb(tableName) { + return request({ + url: '/tool/gen/synchDb/' + tableName, + method: 'get' + }) +} diff --git a/src/assets/401_images/401.gif b/src/assets/401_images/401.gif new file mode 100644 index 0000000..cd6e0d9 Binary files /dev/null and b/src/assets/401_images/401.gif differ diff --git a/src/assets/404_images/404.png b/src/assets/404_images/404.png new file mode 100644 index 0000000..3d8e230 Binary files /dev/null and b/src/assets/404_images/404.png differ diff --git a/src/assets/404_images/404_cloud.png b/src/assets/404_images/404_cloud.png new file mode 100644 index 0000000..c6281d0 Binary files /dev/null and b/src/assets/404_images/404_cloud.png differ diff --git a/src/assets/icons/index.js b/src/assets/icons/index.js new file mode 100644 index 0000000..2c6b309 --- /dev/null +++ b/src/assets/icons/index.js @@ -0,0 +1,9 @@ +import Vue from 'vue' +import SvgIcon from '@/components/SvgIcon'// svg component + +// register globally +Vue.component('svg-icon', SvgIcon) + +const req = require.context('./svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys().map(requireContext) +requireAll(req) diff --git a/src/assets/icons/svg/404.svg b/src/assets/icons/svg/404.svg new file mode 100644 index 0000000..6df5019 --- /dev/null +++ b/src/assets/icons/svg/404.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/bell.svg b/src/assets/icons/svg/bell.svg new file mode 100644 index 0000000..a7320a0 --- /dev/null +++ b/src/assets/icons/svg/bell.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/bug.svg b/src/assets/icons/svg/bug.svg new file mode 100644 index 0000000..05a150d --- /dev/null +++ b/src/assets/icons/svg/bug.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/build.svg b/src/assets/icons/svg/build.svg new file mode 100644 index 0000000..97c4688 --- /dev/null +++ b/src/assets/icons/svg/build.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/button.svg b/src/assets/icons/svg/button.svg new file mode 100644 index 0000000..904fddc --- /dev/null +++ b/src/assets/icons/svg/button.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/cascader.svg b/src/assets/icons/svg/cascader.svg new file mode 100644 index 0000000..e256024 --- /dev/null +++ b/src/assets/icons/svg/cascader.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/chart.svg b/src/assets/icons/svg/chart.svg new file mode 100644 index 0000000..27728fb --- /dev/null +++ b/src/assets/icons/svg/chart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/checkbox.svg b/src/assets/icons/svg/checkbox.svg new file mode 100644 index 0000000..013fd3a --- /dev/null +++ b/src/assets/icons/svg/checkbox.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/clipboard.svg b/src/assets/icons/svg/clipboard.svg new file mode 100644 index 0000000..90923ff --- /dev/null +++ b/src/assets/icons/svg/clipboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/code.svg b/src/assets/icons/svg/code.svg new file mode 100644 index 0000000..5f9c5ab --- /dev/null +++ b/src/assets/icons/svg/code.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/color.svg b/src/assets/icons/svg/color.svg new file mode 100644 index 0000000..44a81aa --- /dev/null +++ b/src/assets/icons/svg/color.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/component.svg b/src/assets/icons/svg/component.svg new file mode 100644 index 0000000..29c3458 --- /dev/null +++ b/src/assets/icons/svg/component.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/dashboard.svg b/src/assets/icons/svg/dashboard.svg new file mode 100644 index 0000000..5317d37 --- /dev/null +++ b/src/assets/icons/svg/dashboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/date-range.svg b/src/assets/icons/svg/date-range.svg new file mode 100644 index 0000000..fda571e --- /dev/null +++ b/src/assets/icons/svg/date-range.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/date.svg b/src/assets/icons/svg/date.svg new file mode 100644 index 0000000..52dc73e --- /dev/null +++ b/src/assets/icons/svg/date.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/dict.svg b/src/assets/icons/svg/dict.svg new file mode 100644 index 0000000..4849377 --- /dev/null +++ b/src/assets/icons/svg/dict.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/documentation.svg b/src/assets/icons/svg/documentation.svg new file mode 100644 index 0000000..7043122 --- /dev/null +++ b/src/assets/icons/svg/documentation.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/download.svg b/src/assets/icons/svg/download.svg new file mode 100644 index 0000000..c896951 --- /dev/null +++ b/src/assets/icons/svg/download.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/drag.svg b/src/assets/icons/svg/drag.svg new file mode 100644 index 0000000..4185d3c --- /dev/null +++ b/src/assets/icons/svg/drag.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/druid.svg b/src/assets/icons/svg/druid.svg new file mode 100644 index 0000000..a2b4b4e --- /dev/null +++ b/src/assets/icons/svg/druid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/edit.svg b/src/assets/icons/svg/edit.svg new file mode 100644 index 0000000..d26101f --- /dev/null +++ b/src/assets/icons/svg/edit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/education.svg b/src/assets/icons/svg/education.svg new file mode 100644 index 0000000..7bfb01d --- /dev/null +++ b/src/assets/icons/svg/education.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/email.svg b/src/assets/icons/svg/email.svg new file mode 100644 index 0000000..74d25e2 --- /dev/null +++ b/src/assets/icons/svg/email.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/enter.svg b/src/assets/icons/svg/enter.svg new file mode 100644 index 0000000..f7cabf2 --- /dev/null +++ b/src/assets/icons/svg/enter.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/example.svg b/src/assets/icons/svg/example.svg new file mode 100644 index 0000000..46f42b5 --- /dev/null +++ b/src/assets/icons/svg/example.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/excel.svg b/src/assets/icons/svg/excel.svg new file mode 100644 index 0000000..74d97b8 --- /dev/null +++ b/src/assets/icons/svg/excel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/exit-fullscreen.svg b/src/assets/icons/svg/exit-fullscreen.svg new file mode 100644 index 0000000..485c128 --- /dev/null +++ b/src/assets/icons/svg/exit-fullscreen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/eye-open.svg b/src/assets/icons/svg/eye-open.svg new file mode 100644 index 0000000..88dcc98 --- /dev/null +++ b/src/assets/icons/svg/eye-open.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/eye.svg b/src/assets/icons/svg/eye.svg new file mode 100644 index 0000000..16ed2d8 --- /dev/null +++ b/src/assets/icons/svg/eye.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/form.svg b/src/assets/icons/svg/form.svg new file mode 100644 index 0000000..dcbaa18 --- /dev/null +++ b/src/assets/icons/svg/form.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/fullscreen.svg b/src/assets/icons/svg/fullscreen.svg new file mode 100644 index 0000000..0e86b6f --- /dev/null +++ b/src/assets/icons/svg/fullscreen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/github.svg b/src/assets/icons/svg/github.svg new file mode 100644 index 0000000..db0a0d4 --- /dev/null +++ b/src/assets/icons/svg/github.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/guide.svg b/src/assets/icons/svg/guide.svg new file mode 100644 index 0000000..b271001 --- /dev/null +++ b/src/assets/icons/svg/guide.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/icon.svg b/src/assets/icons/svg/icon.svg new file mode 100644 index 0000000..82be8ee --- /dev/null +++ b/src/assets/icons/svg/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/input.svg b/src/assets/icons/svg/input.svg new file mode 100644 index 0000000..ab91381 --- /dev/null +++ b/src/assets/icons/svg/input.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/international.svg b/src/assets/icons/svg/international.svg new file mode 100644 index 0000000..e9b56ee --- /dev/null +++ b/src/assets/icons/svg/international.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/job.svg b/src/assets/icons/svg/job.svg new file mode 100644 index 0000000..2a93a25 --- /dev/null +++ b/src/assets/icons/svg/job.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/language.svg b/src/assets/icons/svg/language.svg new file mode 100644 index 0000000..0082b57 --- /dev/null +++ b/src/assets/icons/svg/language.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/link.svg b/src/assets/icons/svg/link.svg new file mode 100644 index 0000000..48197ba --- /dev/null +++ b/src/assets/icons/svg/link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/list.svg b/src/assets/icons/svg/list.svg new file mode 100644 index 0000000..20259ed --- /dev/null +++ b/src/assets/icons/svg/list.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/lock.svg b/src/assets/icons/svg/lock.svg new file mode 100644 index 0000000..74fee54 --- /dev/null +++ b/src/assets/icons/svg/lock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/log.svg b/src/assets/icons/svg/log.svg new file mode 100644 index 0000000..d879d33 --- /dev/null +++ b/src/assets/icons/svg/log.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/logininfor.svg b/src/assets/icons/svg/logininfor.svg new file mode 100644 index 0000000..267f844 --- /dev/null +++ b/src/assets/icons/svg/logininfor.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/message.svg b/src/assets/icons/svg/message.svg new file mode 100644 index 0000000..14ca817 --- /dev/null +++ b/src/assets/icons/svg/message.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/money.svg b/src/assets/icons/svg/money.svg new file mode 100644 index 0000000..c1580de --- /dev/null +++ b/src/assets/icons/svg/money.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/monitor.svg b/src/assets/icons/svg/monitor.svg new file mode 100644 index 0000000..bc308cb --- /dev/null +++ b/src/assets/icons/svg/monitor.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/more-up.svg b/src/assets/icons/svg/more-up.svg new file mode 100644 index 0000000..d30ac11 --- /dev/null +++ b/src/assets/icons/svg/more-up.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/nested.svg b/src/assets/icons/svg/nested.svg new file mode 100644 index 0000000..06713a8 --- /dev/null +++ b/src/assets/icons/svg/nested.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/number.svg b/src/assets/icons/svg/number.svg new file mode 100644 index 0000000..ad5ce9a --- /dev/null +++ b/src/assets/icons/svg/number.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/online.svg b/src/assets/icons/svg/online.svg new file mode 100644 index 0000000..330a202 --- /dev/null +++ b/src/assets/icons/svg/online.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/password.svg b/src/assets/icons/svg/password.svg new file mode 100644 index 0000000..6c64def --- /dev/null +++ b/src/assets/icons/svg/password.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/pdf.svg b/src/assets/icons/svg/pdf.svg new file mode 100644 index 0000000..957aa0c --- /dev/null +++ b/src/assets/icons/svg/pdf.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/people.svg b/src/assets/icons/svg/people.svg new file mode 100644 index 0000000..2bd54ae --- /dev/null +++ b/src/assets/icons/svg/people.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/peoples.svg b/src/assets/icons/svg/peoples.svg new file mode 100644 index 0000000..aab852e --- /dev/null +++ b/src/assets/icons/svg/peoples.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/phone.svg b/src/assets/icons/svg/phone.svg new file mode 100644 index 0000000..ab8e8c4 --- /dev/null +++ b/src/assets/icons/svg/phone.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/post.svg b/src/assets/icons/svg/post.svg new file mode 100644 index 0000000..2922c61 --- /dev/null +++ b/src/assets/icons/svg/post.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/qq.svg b/src/assets/icons/svg/qq.svg new file mode 100644 index 0000000..ee13d4e --- /dev/null +++ b/src/assets/icons/svg/qq.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/question.svg b/src/assets/icons/svg/question.svg new file mode 100644 index 0000000..cf75bd4 --- /dev/null +++ b/src/assets/icons/svg/question.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/radio.svg b/src/assets/icons/svg/radio.svg new file mode 100644 index 0000000..0cde345 --- /dev/null +++ b/src/assets/icons/svg/radio.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/rate.svg b/src/assets/icons/svg/rate.svg new file mode 100644 index 0000000..aa3b14d --- /dev/null +++ b/src/assets/icons/svg/rate.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/redis-list.svg b/src/assets/icons/svg/redis-list.svg new file mode 100644 index 0000000..98a15b2 --- /dev/null +++ b/src/assets/icons/svg/redis-list.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/redis.svg b/src/assets/icons/svg/redis.svg new file mode 100644 index 0000000..2f1d62d --- /dev/null +++ b/src/assets/icons/svg/redis.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/row.svg b/src/assets/icons/svg/row.svg new file mode 100644 index 0000000..0780992 --- /dev/null +++ b/src/assets/icons/svg/row.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/search.svg b/src/assets/icons/svg/search.svg new file mode 100644 index 0000000..84233dd --- /dev/null +++ b/src/assets/icons/svg/search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/select.svg b/src/assets/icons/svg/select.svg new file mode 100644 index 0000000..d628382 --- /dev/null +++ b/src/assets/icons/svg/select.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/server.svg b/src/assets/icons/svg/server.svg new file mode 100644 index 0000000..eb287e3 --- /dev/null +++ b/src/assets/icons/svg/server.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/shopping.svg b/src/assets/icons/svg/shopping.svg new file mode 100644 index 0000000..87513e7 --- /dev/null +++ b/src/assets/icons/svg/shopping.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/size.svg b/src/assets/icons/svg/size.svg new file mode 100644 index 0000000..ddb25b8 --- /dev/null +++ b/src/assets/icons/svg/size.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/skill.svg b/src/assets/icons/svg/skill.svg new file mode 100644 index 0000000..a3b7312 --- /dev/null +++ b/src/assets/icons/svg/skill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/slider.svg b/src/assets/icons/svg/slider.svg new file mode 100644 index 0000000..fbe4f39 --- /dev/null +++ b/src/assets/icons/svg/slider.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/star.svg b/src/assets/icons/svg/star.svg new file mode 100644 index 0000000..6cf86e6 --- /dev/null +++ b/src/assets/icons/svg/star.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/swagger.svg b/src/assets/icons/svg/swagger.svg new file mode 100644 index 0000000..05d4e7b --- /dev/null +++ b/src/assets/icons/svg/swagger.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/switch.svg b/src/assets/icons/svg/switch.svg new file mode 100644 index 0000000..0ba61e3 --- /dev/null +++ b/src/assets/icons/svg/switch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/system.svg b/src/assets/icons/svg/system.svg new file mode 100644 index 0000000..5992593 --- /dev/null +++ b/src/assets/icons/svg/system.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/tab.svg b/src/assets/icons/svg/tab.svg new file mode 100644 index 0000000..b4b48e4 --- /dev/null +++ b/src/assets/icons/svg/tab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/table.svg b/src/assets/icons/svg/table.svg new file mode 100644 index 0000000..0e3dc9d --- /dev/null +++ b/src/assets/icons/svg/table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/textarea.svg b/src/assets/icons/svg/textarea.svg new file mode 100644 index 0000000..2709f29 --- /dev/null +++ b/src/assets/icons/svg/textarea.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/theme.svg b/src/assets/icons/svg/theme.svg new file mode 100644 index 0000000..5982a2f --- /dev/null +++ b/src/assets/icons/svg/theme.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/time-range.svg b/src/assets/icons/svg/time-range.svg new file mode 100644 index 0000000..13c1202 --- /dev/null +++ b/src/assets/icons/svg/time-range.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/time.svg b/src/assets/icons/svg/time.svg new file mode 100644 index 0000000..b376e32 --- /dev/null +++ b/src/assets/icons/svg/time.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/tool.svg b/src/assets/icons/svg/tool.svg new file mode 100644 index 0000000..48e0e35 --- /dev/null +++ b/src/assets/icons/svg/tool.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/tree-table.svg b/src/assets/icons/svg/tree-table.svg new file mode 100644 index 0000000..8aafdb8 --- /dev/null +++ b/src/assets/icons/svg/tree-table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/tree.svg b/src/assets/icons/svg/tree.svg new file mode 100644 index 0000000..dd4b7dd --- /dev/null +++ b/src/assets/icons/svg/tree.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/upload.svg b/src/assets/icons/svg/upload.svg new file mode 100644 index 0000000..bae49c0 --- /dev/null +++ b/src/assets/icons/svg/upload.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/user.svg b/src/assets/icons/svg/user.svg new file mode 100644 index 0000000..0ba0716 --- /dev/null +++ b/src/assets/icons/svg/user.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/validCode.svg b/src/assets/icons/svg/validCode.svg new file mode 100644 index 0000000..cfb1021 --- /dev/null +++ b/src/assets/icons/svg/validCode.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/wechat.svg b/src/assets/icons/svg/wechat.svg new file mode 100644 index 0000000..c586e55 --- /dev/null +++ b/src/assets/icons/svg/wechat.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svg/zip.svg b/src/assets/icons/svg/zip.svg new file mode 100644 index 0000000..f806fc4 --- /dev/null +++ b/src/assets/icons/svg/zip.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/svgo.yml b/src/assets/icons/svgo.yml new file mode 100644 index 0000000..d11906a --- /dev/null +++ b/src/assets/icons/svgo.yml @@ -0,0 +1,22 @@ +# replace default config + +# multipass: true +# full: true + +plugins: + + # - name + # + # or: + # - name: false + # - name: true + # + # or: + # - name: + # param1: 1 + # param2: 2 + +- removeAttrs: + attrs: + - 'fill' + - 'fill-rule' diff --git a/src/assets/images/dark.svg b/src/assets/images/dark.svg new file mode 100644 index 0000000..f646bd7 --- /dev/null +++ b/src/assets/images/dark.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/images/light.svg b/src/assets/images/light.svg new file mode 100644 index 0000000..ab7cc08 --- /dev/null +++ b/src/assets/images/light.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/images/login-background.jpg b/src/assets/images/login-background.jpg new file mode 100644 index 0000000..8a89eb8 Binary files /dev/null and b/src/assets/images/login-background.jpg differ diff --git a/src/assets/images/pay.png b/src/assets/images/pay.png new file mode 100644 index 0000000..bb8b967 Binary files /dev/null and b/src/assets/images/pay.png differ diff --git a/src/assets/images/profile.jpg b/src/assets/images/profile.jpg new file mode 100644 index 0000000..b3a940b Binary files /dev/null and b/src/assets/images/profile.jpg differ diff --git a/src/assets/logo/logo.png b/src/assets/logo/logo.png new file mode 100644 index 0000000..e263760 Binary files /dev/null and b/src/assets/logo/logo.png differ diff --git a/src/assets/styles/btn.scss b/src/assets/styles/btn.scss new file mode 100644 index 0000000..e6ba1a8 --- /dev/null +++ b/src/assets/styles/btn.scss @@ -0,0 +1,99 @@ +@import './variables.scss'; + +@mixin colorBtn($color) { + background: $color; + + &:hover { + color: $color; + + &:before, + &:after { + background: $color; + } + } +} + +.blue-btn { + @include colorBtn($blue) +} + +.light-blue-btn { + @include colorBtn($light-blue) +} + +.red-btn { + @include colorBtn($red) +} + +.pink-btn { + @include colorBtn($pink) +} + +.green-btn { + @include colorBtn($green) +} + +.tiffany-btn { + @include colorBtn($tiffany) +} + +.yellow-btn { + @include colorBtn($yellow) +} + +.pan-btn { + font-size: 14px; + color: #fff; + padding: 14px 36px; + border-radius: 8px; + border: none; + outline: none; + transition: 600ms ease all; + position: relative; + display: inline-block; + + &:hover { + background: #fff; + + &:before, + &:after { + width: 100%; + transition: 600ms ease all; + } + } + + &:before, + &:after { + content: ''; + position: absolute; + top: 0; + right: 0; + height: 2px; + width: 0; + transition: 400ms ease all; + } + + &::after { + right: inherit; + top: inherit; + left: 0; + bottom: 0; + } +} + +.custom-button { + display: inline-block; + line-height: 1; + white-space: nowrap; + cursor: pointer; + background: #fff; + color: #fff; + -webkit-appearance: none; + text-align: center; + box-sizing: border-box; + outline: 0; + margin: 0; + padding: 10px 15px; + font-size: 14px; + border-radius: 4px; +} diff --git a/src/assets/styles/element-ui.scss b/src/assets/styles/element-ui.scss new file mode 100644 index 0000000..0bd7151 --- /dev/null +++ b/src/assets/styles/element-ui.scss @@ -0,0 +1,116 @@ +// cover some element-ui styles + +.el-breadcrumb__inner, +.el-breadcrumb__inner a { + font-weight: 400 !important; +} + +.el-upload { + input[type="file"] { + display: none !important; + } +} + +.el-upload__input { + display: none; +} + +.cell { + .el-tag { + margin-right: 0px; + } +} + +.small-padding { + .cell { + padding-left: 5px; + padding-right: 5px; + } +} + +.fixed-width { + .el-button--mini { + padding: 7px 10px; + width: 60px; + } +} + +.status-col { + .cell { + padding: 0 10px; + text-align: center; + + .el-tag { + margin-right: 0px; + } + } +} + +// to fixed https://github.com/ElemeFE/element/issues/2461 +.el-dialog { + transform: none; + left: 0; + position: relative; + margin: 0 auto; + border: 1px solid $base-menu-background; + + .el-dialog__header { + background: #eff6f6; + + .el-dialog__title { + color: $base-menu-background; + } + } +} + +.el-drawer { + transform: none; + border: 1px solid $base-menu-background; + + .el-drawer__header { + background: #eff6f6; + + .el-drawer__title { + color: $base-menu-background; + } + } +} + +.el-card { + .el-card__header { + background: #eff6f6; + } +} + +// refine element ui upload +.upload-container { + .el-upload { + width: 100%; + + .el-upload-dragger { + width: 100%; + height: 200px; + } + } +} + +// dropdown +.el-dropdown-menu { + a { + display: block + } +} + +// fix date-picker ui bug in filter-item +.el-range-editor.el-input__inner { + display: inline-flex !important; +} + +// to fix el-date-picker css style +.el-range-separator { + box-sizing: content-box; +} + +.el-menu--collapse>div>.el-submenu>.el-submenu__title .el-submenu__icon-arrow { + display: none; +} \ No newline at end of file diff --git a/src/assets/styles/element-variables.scss b/src/assets/styles/element-variables.scss new file mode 100644 index 0000000..1615ff2 --- /dev/null +++ b/src/assets/styles/element-variables.scss @@ -0,0 +1,31 @@ +/** +* I think element-ui's default theme color is too light for long-term use. +* So I modified the default color and you can modify it to your liking. +**/ + +/* theme color */ +$--color-primary: #1890ff; +$--color-success: #13ce66; +$--color-warning: #ffba00; +$--color-danger: #ff4949; +// $--color-info: #1E1E1E; + +$--button-font-weight: 400; + +// $--color-text-regular: #1f2d3d; + +$--border-color-light: #dfe4ed; +$--border-color-lighter: #e6ebf5; + +$--table-border: 1px solid #dfe6ec; + +/* icon font path, required */ +$--font-path: '~element-ui/lib/theme-chalk/fonts'; + +@import "~element-ui/packages/theme-chalk/src/index"; + +// the :export directive is the magic sauce for webpack +// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass +:export { + theme: $--color-primary; +} diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss new file mode 100644 index 0000000..bb87292 --- /dev/null +++ b/src/assets/styles/index.scss @@ -0,0 +1,178 @@ +@import './variables.scss'; +@import './mixin.scss'; +@import './transition.scss'; +@import './element-ui.scss'; +@import './sidebar.scss'; +@import './btn.scss'; + +body { + height: 100%; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; +} + +label { + font-weight: 700; +} + +html { + height: 100%; + box-sizing: border-box; +} + +#app { + height: 100%; +} + +*, +*:before, +*:after { + box-sizing: inherit; +} + +.no-padding { + padding: 0px !important; +} + +.padding-content { + padding: 4px 0; +} + +a:focus, +a:active { + outline: none; +} + +a, +a:focus, +a:hover { + cursor: pointer; + color: inherit; + text-decoration: none; +} + +div:focus { + outline: none; +} + +.fr { + float: right; +} + +.fl { + float: left; +} + +.pr-5 { + padding-right: 5px; +} + +.pl-5 { + padding-left: 5px; +} + +.block { + display: block; +} + +.pointer { + cursor: pointer; +} + +.inlineBlock { + display: block; +} + +.clearfix { + &:after { + visibility: hidden; + display: block; + font-size: 0; + content: " "; + clear: both; + height: 0; + } +} + +aside { + background: #eef1f6; + padding: 8px 24px; + margin-bottom: 20px; + border-radius: 2px; + display: block; + line-height: 32px; + font-size: 16px; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + color: #2c3e50; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + + a { + color: #337ab7; + cursor: pointer; + + &:hover { + color: rgb(32, 160, 255); + } + } +} + +//main-container全局样式 +.app-container { + padding: 20px; +} + +.components-container { + margin: 30px 50px; + position: relative; +} + +.text-center { + text-align: center +} + +.sub-navbar { + height: 50px; + line-height: 50px; + position: relative; + width: 100%; + text-align: right; + padding-right: 20px; + transition: 600ms ease position; + background: linear-gradient(90deg, rgba(32, 182, 249, 1) 0%, rgba(32, 182, 249, 1) 0%, rgba(33, 120, 241, 1) 100%, rgba(33, 120, 241, 1) 100%); + + .subtitle { + font-size: 20px; + color: #fff; + } + + &.draft { + background: #d0d0d0; + } + + &.deleted { + background: #d0d0d0; + } +} + +.link-type, +.link-type:focus { + color: #337ab7; + cursor: pointer; + + &:hover { + color: rgb(32, 160, 255); + } +} + +.filter-container { + padding-bottom: 10px; + + .filter-item { + display: inline-block; + vertical-align: middle; + margin-bottom: 10px; + } +} diff --git a/src/assets/styles/mixin.scss b/src/assets/styles/mixin.scss new file mode 100644 index 0000000..06fa061 --- /dev/null +++ b/src/assets/styles/mixin.scss @@ -0,0 +1,66 @@ +@mixin clearfix { + &:after { + content: ""; + display: table; + clear: both; + } +} + +@mixin scrollBar { + &::-webkit-scrollbar-track-piece { + background: #d3dce6; + } + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #99a9bf; + border-radius: 20px; + } +} + +@mixin relative { + position: relative; + width: 100%; + height: 100%; +} + +@mixin pct($pct) { + width: #{$pct}; + position: relative; + margin: 0 auto; +} + +@mixin triangle($width, $height, $color, $direction) { + $width: $width/2; + $color-border-style: $height solid $color; + $transparent-border-style: $width solid transparent; + height: 0; + width: 0; + + @if $direction==up { + border-bottom: $color-border-style; + border-left: $transparent-border-style; + border-right: $transparent-border-style; + } + + @else if $direction==right { + border-left: $color-border-style; + border-top: $transparent-border-style; + border-bottom: $transparent-border-style; + } + + @else if $direction==down { + border-top: $color-border-style; + border-left: $transparent-border-style; + border-right: $transparent-border-style; + } + + @else if $direction==left { + border-right: $color-border-style; + border-top: $transparent-border-style; + border-bottom: $transparent-border-style; + } +} diff --git a/src/assets/styles/ruoyi.scss b/src/assets/styles/ruoyi.scss new file mode 100644 index 0000000..cb1314d --- /dev/null +++ b/src/assets/styles/ruoyi.scss @@ -0,0 +1,484 @@ +/** +* 通用css样式布局处理 +* Copyright (c) 2019 ruoyi +*/ + +/** 基础通用 **/ +.pt5 { + padding-top: 5px; +} + +.pr5 { + padding-right: 5px; +} + +.pb5 { + padding-bottom: 5px; +} + +.mt5 { + margin-top: 5px; +} + +.mr5 { + margin-right: 5px; +} + +.mb5 { + margin-bottom: 5px; +} + +.mb8 { + margin-bottom: 8px; +} + +.ml5 { + margin-left: 5px; +} + +.mt10 { + margin-top: 10px; +} + +.mr10 { + margin-right: 10px; +} + +.mb10 { + margin-bottom: 10px; +} +.ml10 { + margin-left: 10px; +} + +.mt20 { + margin-top: 20px; +} + +.mr20 { + margin-right: 20px; +} + +.mb20 { + margin-bottom: 20px; +} +.ml20 { + margin-left: 20px; +} + +.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 { + font-family: inherit; + font-weight: 500; + line-height: 1.1; + color: inherit; +} + +.el-message-box__status + .el-message-box__message{ + word-break: break-word; +} + +.el-dialog:not(.is-fullscreen) { + margin-top: 6vh !important; +} + +.el-dialog__body { + padding: 8px 20px !important; +} + +.el-dialog__wrapper.scrollbar .el-dialog .el-dialog__body { + overflow: auto; + overflow-x: hidden; + max-height: 70vh; + padding: 10px 20px 0; +} + +.el-table { + .el-table__header-wrapper, .el-table__fixed-header-wrapper { + th { + word-break: break-word; + background-color: #f8f8f9; + color: #515a6e; + height: 40px; + font-size: 13px; + } + } + + .el-table__body-wrapper { + .el-button [class*="el-icon-"] + span { + margin-left: 1px; + } + } +} + +/** 表单布局 **/ +.form-header { + font-size: 15px; + color: #6379bb; + border-bottom: 1px solid #ddd; + margin: 8px 10px 25px 10px; + padding-bottom: 5px +} + +/** 表格布局 **/ +.pagination-container { + display: flex; + justify-content: flex-end; + margin-top: 20px; +} + +/* tree border */ +.tree-border { + margin-top: 5px; + border: 1px solid #e5e6e7; + background: #FFFFFF none; + border-radius: 4px; +} + +/* horizontal el menu */ +.el-menu--horizontal .el-menu-item .svg-icon + span, +.el-menu--horizontal .el-submenu__title .svg-icon + span { + margin-left: 3px; +} + +.el-menu--horizontal .el-menu--popup { + min-width: 120px !important; +} + +@media (max-width: 768px) { + .pagination-container .el-pagination > .el-pagination__jump { + display: none !important; + } + .pagination-container .el-pagination > .el-pagination__sizes { + display: none !important; + } +} + +.el-table .fixed-width .el-button--mini { + padding-left: 0; + padding-right: 0; + width: inherit; +} + +/** 表格更多操作下拉样式 */ +.el-table .el-dropdown-link,.el-table .el-dropdown-selfdefine { + cursor: pointer; + margin-left: 5px; +} + +.el-table .el-dropdown, .el-icon-arrow-down { + font-size: 12px; +} + +.el-tree-node__content > .el-checkbox { + margin-right: 8px; +} + +.list-group-striped > .list-group-item { + border-left: 0; + border-right: 0; + border-radius: 0; + padding-left: 0; + padding-right: 0; +} + +.list-group { + padding-left: 0px; + list-style: none; +} + +.list-group-item { + border-bottom: 1px solid #e7eaec; + border-top: 1px solid #e7eaec; + margin-bottom: -1px; + padding: 11px 0px; + font-size: 13px; +} + +.pull-right { + float: right !important; +} + +.el-card__header { + padding: 14px 15px 7px; + min-height: 40px; +} + +.el-card__body { + padding: 15px 20px 20px 20px; +} + +.card-box { + margin-bottom: 10px; +} + +/* button color */ +.el-button--cyan.is-active, +.el-button--cyan:active { + background: #20B2AA; + border-color: #20B2AA; + color: #FFFFFF; +} + +.el-button--cyan:focus, +.el-button--cyan:hover { + background: #48D1CC; + border-color: #48D1CC; + color: #FFFFFF; +} + +.el-button--cyan { + background-color: #20B2AA; + border-color: #20B2AA; + color: #FFFFFF; +} + +/** 详细卡片样式 */ +.detail-drawer { + .el-drawer__header { + margin-bottom: 6px; + padding: 8px 12px 6px; + font-size: 15px; + color: #303133; + background: #f8f8f8; + } + .section-header { + font-size: 15px; + color: #6379bb; + border-bottom: 1px solid #ddd; + margin: 12px 0 16px 0; + padding-bottom: 8px; + } + .drawer-content { + padding: 0 20px 20px 20px; + .info-item { + display: flex; + align-items: flex-start; + padding: 8px 0; + min-height: 40px; + } + .info-label { + flex-shrink: 0; + width: 200px; + color: #606266; + font-size: 13px; + line-height: 1.6; + padding-top: 4px; + text-align: right; + margin-right: 14px; + } + .info-value { + flex: 1; + color: #303133; + font-size: 13px; + font-weight: 500; + line-height: 1.6; + word-break: break-all; + padding-top: 4px; + min-height: 1.6em; + &.plaintext { + border-bottom: 1px dashed #dde1e6; + } + } + } +} + +.detail-wrap { padding: 0 4px; } + +.detail-card { + border: 1px solid #ebeef5; + border-radius: 6px; + margin-bottom: 14px; + overflow: hidden; +} + +.detail-card-title { + background: #f7f9fb; + padding: 8px 16px; + font-size: 13px; + font-weight: 600; + color: #333; + border-bottom: 1px solid #ebeef5; +} +.detail-card-title i { margin-right: 5px; color: #409EFF; } + +.detail-row { padding: 0 8px; } + +.detail-item { + display: flex; + align-items: flex-start; + padding: 10px 8px; + font-size: 13px; + border-bottom: 1px solid #f5f7fa; +} +.detail-item:last-child { border-bottom: none; } + +.detail-label { + flex-shrink: 0; + width: 72px; + color: #909399; + margin-right: 12px; +} +.detail-value { color: #303133; flex: 1; word-break: break-all; } +.detail-location { color: #999; font-size: 12px; } + +.method-tag { + display: inline-block; + padding: 1px 7px; + border-radius: 3px; + font-size: 11px; + font-weight: 700; + margin-right: 6px; + vertical-align: middle; +} +.mono { font-family: Consolas, 'SFMono-Regular', monospace; font-size: 12px; } +.code-body { padding: 14px; } +.code-wrap { + background: #f7f9fb; + border: 1px solid #e8ecf0; + border-radius: 4px; + overflow: hidden; + max-height: 260px; + position: relative; +} +.code-action { + position: absolute; + top: 8px; + right: 8px; + z-index: 10; + margin: 0; + padding: 0; +} +.code-action .el-button { + height: 24px; + font-size: 12px; + padding: 4px 8px; + background: rgba(255, 255, 255, 0.9); + border: 1px solid #dcdcdc; +} +.code-action .el-button:hover { + background: #ffffff; + border-color: #409EFF; +} +.code-pre { + margin: 0; + padding: 12px 14px; + font-size: 12px; + line-height: 1.6; + font-family: Consolas, 'SFMono-Regular', monospace; + color: #444; + white-space: pre-wrap; + word-break: break-all; + overflow: auto; + max-height: 240px; + display: block; +} + +/* tree-sidebar content */ +.tree-sidebar-manage-wrap { + display: flex; + gap: 0; + min-height: calc(100vh - 130px); + padding: 0 !important; + overflow: hidden; +} + +.tree-sidebar-content { + flex: 1; + min-width: 0; + overflow: hidden; + background: #fff; + + .content-inner { + padding: 12px 16px; + height: 100%; + overflow-y: auto; + } +} + +/* error */ +.error-title { color: #c0392b !important; } +.error-title i { color: #c0392b !important; } +.error-body { padding: 12px 16px; } +.error-msg { + background: #fff8f8; + border-left: 3px solid #e74c3c; + border-radius: 3px; + padding: 8px 12px; + color: #c0392b; + font-size: 12px; + line-height: 1.7; + word-break: break-all; + white-space: pre-wrap; +} + +/* http method */ +.method-GET { background: #e8f5e9; color: #27ae60; } +.method-POST { background: #e3f2fd; color: #1565c0; } +.method-PUT { background: #fff3e0; color: #e65100; } +.method-DELETE { background: #ffebee; color: #c62828; } + +/* text color */ +.text-navy { + color: #1ab394; +} + +.text-primary { + color: inherit; +} + +.text-success { + color: #1c84c6; +} + +.text-info { + color: #23c6c8; +} + +.text-warning { + color: #f8ac59; +} + +.text-danger { + color: #ed5565; +} + +.text-muted { + color: #888888; +} + +/* image */ +.img-circle { + border-radius: 50%; +} + +.img-lg { + width: 120px; + height: 120px; +} + +.avatar-upload-preview { + position: relative; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 200px; + height: 200px; + border-radius: 50%; + box-shadow: 0 0 4px #ccc; + overflow: hidden; +} + +/* 拖拽列样式 */ +.allowDrag { cursor: grab; } +.allowDrag:active { cursor: grabbing; } + +.sortable-ghost { + opacity: .8; + color: #fff !important; + background: #42b983 !important; +} + +.top-right-btn { + position: relative; + float: right; +} diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss new file mode 100644 index 0000000..56d300b --- /dev/null +++ b/src/assets/styles/sidebar.scss @@ -0,0 +1,316 @@ +#app { + + .main-container { + height: 100%; + transition: margin-left .28s; + margin-left: $base-sidebar-width; + position: relative; + } + + .sidebarHide { + margin-left: 0 !important; + } + + .sidebar-container { + -webkit-transition: width .28s; + transition: width 0.28s; + width: $base-sidebar-width !important; + background-color: $base-menu-background; + height: 100%; + position: fixed; + font-size: 0px; + top: 0; + bottom: 0; + left: 0; + z-index: 1001; + overflow: hidden; + -webkit-box-shadow: 2px 0 6px rgba(0, 21, 41, .35); + box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1); + + // reset element-ui css + .horizontal-collapse-transition { + transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out; + } + + .scrollbar-wrapper { + overflow-x: hidden !important; + } + + .el-scrollbar__bar.is-vertical { + right: 0px; + } + + .el-scrollbar { + height: 100%; + } + + &.has-logo { + .el-scrollbar { + height: calc(100% - 50px); + } + } + + .is-horizontal { + display: none; + } + + a { + display: inline-block; + width: 100%; + overflow: hidden; + } + + .svg-icon { + margin-right: 10px !important; + } + + .el-menu { + border: none; + height: 100%; + width: 100% !important; + } + + .el-menu-item, + .el-submenu__title { + overflow: hidden !important; + text-overflow: ellipsis !important; + white-space: nowrap !important; + height: 44px !important; + line-height: 44px !important; + margin: 0 2px !important; + border-radius: 20px !important; + color: #fff !important; + } + + // menu hover + .submenu-title-noDropdown, + .el-submenu__title { + &:hover { + background-color: rgba(0, 0, 0, 0.06) !important; + } + } + + & .theme-dark .is-active>.el-submenu__title { + color: $base-menu-color-active !important; + } + + & .nest-menu .el-submenu>.el-submenu__title, + & .el-submenu .el-menu-item { + min-width: $base-sidebar-width !important; + + &:hover { + background-color: rgba(0, 0, 0, 0.06) !important; + } + } + + & .theme-dark .nest-menu .el-submenu>.el-submenu__title, + & .theme-dark .el-submenu .el-menu-item { + background-color: $base-sub-menu-background !important; + + &:hover { + background-color: $base-sub-menu-hover !important; + } + } + + // theme-dark 深色主题 + &.theme-dark { + box-shadow: 2px 0 8px rgba(0, 0, 0, 0.4); + border-right: none; + + .el-menu-item.is-active { + position: relative; + background-color: rgba(0, 0, 0, 0.25) !important; + } + + .el-submenu.is-active>.el-submenu__title { + background-color: rgba(0, 0, 0, 0.25) !important; + } + + .el-menu-item:not(.is-active), + .submenu-title-noDropdown, + .el-submenu__title { + position: relative; + + &::before { + content: ''; + position: absolute; + inset: 0; + background-color: transparent; + pointer-events: none; + z-index: 1; + transition: background-color 0.2s; + } + + &:hover::before { + background-color: var(--current-color-dark-bg, rgba(64, 158, 255, 0.2)); + } + } + } + + // theme-light 浅色主题 + &.theme-light { + border-right: 1px solid #e8eaf0; + box-shadow: none; + + .el-menu-item, + .el-submenu__title { + color: rgba(0, 0, 0, 0.65); + } + + .el-menu-item.is-active { + color: var(--current-color, #409eff) !important; + position: relative; + + &::before { + content: ''; + position: absolute; + inset: 0; + background-color: var(--current-color-light, #ecf5ff); + border-right: 3px solid var(--current-color, #409eff); + pointer-events: none; + z-index: 1; + } + } + + .el-submenu.is-active>.el-submenu__title { + color: var(--current-color, #409eff) !important; + } + + .el-menu-item:not(.is-active):hover, + .submenu-title-noDropdown:hover, + .el-submenu__title:hover { + background-color: #f5f7fa !important; + color: rgba(0, 0, 0, 0.85) !important; + } + + .nest-menu .el-submenu>.el-submenu__title, + .el-submenu .el-menu-item { + background-color: #fafafa !important; + + &:hover { + background-color: #f0f5ff !important; + } + } + } + } + + .hideSidebar { + .sidebar-container { + width: 54px !important; + } + + .main-container { + margin-left: 54px; + } + + .el-menu:not(.el-menu--horizontal) { + .submenu-title-noDropdown { + padding: 0 !important; + position: relative; + + .el-tooltip { + padding: 0 !important; + + .svg-icon { + margin-left: 20px; + } + } + } + } + + .el-submenu { + overflow: hidden; + + &>.el-submenu__title { + padding: 0 !important; + + .svg-icon { + margin-left: 20px; + } + + } + } + + .el-menu--collapse { + .el-submenu { + &>.el-submenu__title { + &>span { + height: 0; + width: 0; + overflow: hidden; + visibility: hidden; + display: inline-block; + } + } + } + } + } + + .el-menu--collapse .el-menu .el-submenu { + min-width: $base-sidebar-width !important; + } + + // mobile responsive + .mobile { + .main-container { + margin-left: 0px; + } + + .sidebar-container { + transition: transform .28s; + width: $base-sidebar-width !important; + } + + &.hideSidebar { + .sidebar-container { + pointer-events: none; + transition-duration: 0.3s; + transform: translate3d(-$base-sidebar-width, 0, 0); + } + } + } + + .withoutAnimation { + + .main-container, + .sidebar-container { + transition: none; + } + } +} + +// when menu collapsed +.el-menu--vertical { + &>.el-menu { + .svg-icon { + margin-right: 16px; + } + } + + .nest-menu .el-submenu>.el-submenu__title, + .el-menu-item { + &:hover { + // you can use $subMenuHover + background-color: rgba(0, 0, 0, 0.06) !important; + } + } + + // the scroll bar appears when the subMenu is too long + >.el-menu--popup { + max-height: 100vh; + overflow-y: auto; + + &::-webkit-scrollbar-track-piece { + background: #d3dce6; + } + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #99a9bf; + border-radius: 20px; + } + } +} \ No newline at end of file diff --git a/src/assets/styles/transition.scss b/src/assets/styles/transition.scss new file mode 100644 index 0000000..073f8c6 --- /dev/null +++ b/src/assets/styles/transition.scss @@ -0,0 +1,49 @@ +// global transition css + +/* fade */ +.fade-enter-active, +.fade-leave-active { + transition: opacity 0.28s; +} + +.fade-enter, +.fade-leave-active { + opacity: 0; +} + +/* fade-transform */ +.fade-transform--move, +.fade-transform-leave-active, +.fade-transform-enter-active { + transition: all .5s; +} + +.fade-transform-enter { + opacity: 0; + transform: translateX(-30px); +} + +.fade-transform-leave-to { + opacity: 0; + transform: translateX(30px); +} + +/* breadcrumb transition */ +.breadcrumb-enter-active, +.breadcrumb-leave-active { + transition: all .5s; +} + +.breadcrumb-enter, +.breadcrumb-leave-active { + opacity: 0; + transform: translateX(20px); +} + +.breadcrumb-move { + transition: all .5s; +} + +.breadcrumb-leave-active { + position: absolute; +} diff --git a/src/assets/styles/variables.scss b/src/assets/styles/variables.scss new file mode 100644 index 0000000..7f8c348 --- /dev/null +++ b/src/assets/styles/variables.scss @@ -0,0 +1,39 @@ +// base color +$blue:#324157; +$light-blue:#3A71A8; +$red:#C03639; +$pink: #E65D6E; +$green: #009393; +$tiffany: #4AB7BD; +$yellow:#FEC171; +$panGreen: #30B08F; + +// 默认菜单主题风格 +$base-menu-color: rgba(255, 255, 255, 0.95); +$base-menu-color-active: #ffffff; +$base-menu-background: #009393; +$base-logo-title-color: #ffffff; + +$base-menu-light-color:rgba(0,0,0,.70); +$base-menu-light-background:#009393; +$base-logo-light-title-color: #ffffff; + +$base-sub-menu-background: #009393; +$base-sub-menu-hover: rgba(0,0,0,.1); + +$base-sidebar-width: 200px; + +// the :export directive is the magic sauce for webpack +// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass +:export { + menuColor: $base-menu-color; + menuLightColor: $base-menu-light-color; + menuColorActive: $base-menu-color-active; + menuBackground: $base-menu-background; + menuLightBackground: $base-menu-light-background; + subMenuBackground: $base-sub-menu-background; + subMenuHover: $base-sub-menu-hover; + sideBarWidth: $base-sidebar-width; + logoTitleColor: $base-logo-title-color; + logoLightTitleColor: $base-logo-light-title-color +} diff --git a/src/components/Breadcrumb/index.vue b/src/components/Breadcrumb/index.vue new file mode 100644 index 0000000..84f4831 --- /dev/null +++ b/src/components/Breadcrumb/index.vue @@ -0,0 +1,102 @@ + + + + + diff --git a/src/components/Crontab/day.vue b/src/components/Crontab/day.vue new file mode 100644 index 0000000..d3faed7 --- /dev/null +++ b/src/components/Crontab/day.vue @@ -0,0 +1,161 @@ + + + diff --git a/src/components/Crontab/hour.vue b/src/components/Crontab/hour.vue new file mode 100644 index 0000000..5659bfb --- /dev/null +++ b/src/components/Crontab/hour.vue @@ -0,0 +1,120 @@ + + + diff --git a/src/components/Crontab/index.vue b/src/components/Crontab/index.vue new file mode 100644 index 0000000..395f615 --- /dev/null +++ b/src/components/Crontab/index.vue @@ -0,0 +1,430 @@ + + + + diff --git a/src/components/Crontab/min.vue b/src/components/Crontab/min.vue new file mode 100644 index 0000000..ec56a44 --- /dev/null +++ b/src/components/Crontab/min.vue @@ -0,0 +1,116 @@ + + + \ No newline at end of file diff --git a/src/components/Crontab/month.vue b/src/components/Crontab/month.vue new file mode 100644 index 0000000..da60132 --- /dev/null +++ b/src/components/Crontab/month.vue @@ -0,0 +1,114 @@ + + + diff --git a/src/components/Crontab/result.vue b/src/components/Crontab/result.vue new file mode 100644 index 0000000..4e2952d --- /dev/null +++ b/src/components/Crontab/result.vue @@ -0,0 +1,558 @@ + + + diff --git a/src/components/Crontab/second.vue b/src/components/Crontab/second.vue new file mode 100644 index 0000000..9201e06 --- /dev/null +++ b/src/components/Crontab/second.vue @@ -0,0 +1,117 @@ + + + diff --git a/src/components/Crontab/week.vue b/src/components/Crontab/week.vue new file mode 100644 index 0000000..75c42ed --- /dev/null +++ b/src/components/Crontab/week.vue @@ -0,0 +1,202 @@ + + + diff --git a/src/components/Crontab/year.vue b/src/components/Crontab/year.vue new file mode 100644 index 0000000..8c18c78 --- /dev/null +++ b/src/components/Crontab/year.vue @@ -0,0 +1,131 @@ + + + diff --git a/src/components/DictData/index.js b/src/components/DictData/index.js new file mode 100644 index 0000000..7b85d4a --- /dev/null +++ b/src/components/DictData/index.js @@ -0,0 +1,49 @@ +import Vue from 'vue' +import store from '@/store' +import DataDict from '@/utils/dict' +import { getDicts as getDicts } from '@/api/system/dict/data' + +function searchDictByKey(dict, key) { + if (key == null && key == "") { + return null + } + try { + for (let i = 0; i < dict.length; i++) { + if (dict[i].key == key) { + return dict[i].value + } + } + } catch (e) { + return null + } +} + +function install() { + Vue.use(DataDict, { + metas: { + '*': { + labelField: 'dictLabel', + valueField: 'dictValue', + request(dictMeta) { + const storeDict = searchDictByKey(store.getters.dict, dictMeta.type) + if (storeDict) { + return new Promise(resolve => { resolve(storeDict) }) + } else { + return new Promise((resolve, reject) => { + getDicts(dictMeta.type).then(res => { + store.dispatch('dict/setDict', { key: dictMeta.type, value: res.data }) + resolve(res.data) + }).catch(error => { + reject(error) + }) + }) + } + }, + }, + }, + }) +} + +export default { + install, +} \ No newline at end of file diff --git a/src/components/DictTag/index.vue b/src/components/DictTag/index.vue new file mode 100644 index 0000000..7c86744 --- /dev/null +++ b/src/components/DictTag/index.vue @@ -0,0 +1,93 @@ + + + + diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue new file mode 100644 index 0000000..553f952 --- /dev/null +++ b/src/components/Editor/index.vue @@ -0,0 +1,297 @@ + + + + + diff --git a/src/components/ExcelImportDialog/index.vue b/src/components/ExcelImportDialog/index.vue new file mode 100644 index 0000000..1d32764 --- /dev/null +++ b/src/components/ExcelImportDialog/index.vue @@ -0,0 +1,126 @@ + + + diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue new file mode 100644 index 0000000..ca37c55 --- /dev/null +++ b/src/components/FileUpload/index.vue @@ -0,0 +1,262 @@ + + + + + diff --git a/src/components/Hamburger/index.vue b/src/components/Hamburger/index.vue new file mode 100644 index 0000000..368b002 --- /dev/null +++ b/src/components/Hamburger/index.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/src/components/HeaderSearch/index.vue b/src/components/HeaderSearch/index.vue new file mode 100644 index 0000000..93f71ea --- /dev/null +++ b/src/components/HeaderSearch/index.vue @@ -0,0 +1,397 @@ + + + + + \ No newline at end of file diff --git a/src/components/IconSelect/index.vue b/src/components/IconSelect/index.vue new file mode 100644 index 0000000..8dadc02 --- /dev/null +++ b/src/components/IconSelect/index.vue @@ -0,0 +1,104 @@ + + + + + + diff --git a/src/components/IconSelect/requireIcons.js b/src/components/IconSelect/requireIcons.js new file mode 100644 index 0000000..99e5c54 --- /dev/null +++ b/src/components/IconSelect/requireIcons.js @@ -0,0 +1,11 @@ + +const req = require.context('../../assets/icons/svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys() + +const re = /\.\/(.*)\.svg/ + +const icons = requireAll(req).map(i => { + return i.match(re)[1] +}) + +export default icons diff --git a/src/components/ImagePreview/index.vue b/src/components/ImagePreview/index.vue new file mode 100644 index 0000000..8b4738b --- /dev/null +++ b/src/components/ImagePreview/index.vue @@ -0,0 +1,90 @@ + + + + + diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue new file mode 100644 index 0000000..6b24f6e --- /dev/null +++ b/src/components/ImageUpload/index.vue @@ -0,0 +1,272 @@ + + + + + diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue new file mode 100644 index 0000000..08ac487 --- /dev/null +++ b/src/components/Pagination/index.vue @@ -0,0 +1,113 @@ + + + + + diff --git a/src/components/PanThumb/index.vue b/src/components/PanThumb/index.vue new file mode 100644 index 0000000..b24e026 --- /dev/null +++ b/src/components/PanThumb/index.vue @@ -0,0 +1,141 @@ + + + + + diff --git a/src/components/ParentView/index.vue b/src/components/ParentView/index.vue new file mode 100644 index 0000000..7bf6148 --- /dev/null +++ b/src/components/ParentView/index.vue @@ -0,0 +1,3 @@ + diff --git a/src/components/RightToolbar/index.vue b/src/components/RightToolbar/index.vue new file mode 100644 index 0000000..d036f7f --- /dev/null +++ b/src/components/RightToolbar/index.vue @@ -0,0 +1,253 @@ + + + + + diff --git a/src/components/RuoYi/Doc/index.vue b/src/components/RuoYi/Doc/index.vue new file mode 100644 index 0000000..75fa864 --- /dev/null +++ b/src/components/RuoYi/Doc/index.vue @@ -0,0 +1,21 @@ + + + \ No newline at end of file diff --git a/src/components/RuoYi/Git/index.vue b/src/components/RuoYi/Git/index.vue new file mode 100644 index 0000000..bdafbae --- /dev/null +++ b/src/components/RuoYi/Git/index.vue @@ -0,0 +1,21 @@ + + + \ No newline at end of file diff --git a/src/components/Screenfull/index.vue b/src/components/Screenfull/index.vue new file mode 100644 index 0000000..d4e539c --- /dev/null +++ b/src/components/Screenfull/index.vue @@ -0,0 +1,57 @@ + + + + + diff --git a/src/components/SizeSelect/index.vue b/src/components/SizeSelect/index.vue new file mode 100644 index 0000000..e513948 --- /dev/null +++ b/src/components/SizeSelect/index.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/components/SvgIcon/index.vue b/src/components/SvgIcon/index.vue new file mode 100644 index 0000000..e4bf5ad --- /dev/null +++ b/src/components/SvgIcon/index.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/src/components/ThemePicker/index.vue b/src/components/ThemePicker/index.vue new file mode 100644 index 0000000..a69ee45 --- /dev/null +++ b/src/components/ThemePicker/index.vue @@ -0,0 +1,170 @@ + + + + + diff --git a/src/components/TreePanel/index.vue b/src/components/TreePanel/index.vue new file mode 100644 index 0000000..9feb10b --- /dev/null +++ b/src/components/TreePanel/index.vue @@ -0,0 +1,709 @@ + + + + + \ No newline at end of file diff --git a/src/components/iFrame/index.vue b/src/components/iFrame/index.vue new file mode 100644 index 0000000..f4334f3 --- /dev/null +++ b/src/components/iFrame/index.vue @@ -0,0 +1,36 @@ + + + diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue new file mode 100644 index 0000000..16d6ba8 --- /dev/null +++ b/src/layout/components/Navbar.vue @@ -0,0 +1,254 @@ + + + + + diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue new file mode 100644 index 0000000..d40f880 --- /dev/null +++ b/src/layout/components/Settings/index.vue @@ -0,0 +1,430 @@ + + + + + diff --git a/src/layout/components/Sidebar/FixiOSBug.js b/src/layout/components/Sidebar/FixiOSBug.js new file mode 100644 index 0000000..6823726 --- /dev/null +++ b/src/layout/components/Sidebar/FixiOSBug.js @@ -0,0 +1,25 @@ +export default { + computed: { + device() { + return this.$store.state.app.device + } + }, + mounted() { + // In order to fix the click on menu on the ios device will trigger the mouseleave bug + this.fixBugIniOS() + }, + methods: { + fixBugIniOS() { + const $subMenu = this.$refs.subMenu + if ($subMenu) { + const handleMouseleave = $subMenu.handleMouseleave + $subMenu.handleMouseleave = (e) => { + if (this.device === 'mobile') { + return + } + handleMouseleave(e) + } + } + } + } +} diff --git a/src/layout/components/Sidebar/Item.vue b/src/layout/components/Sidebar/Item.vue new file mode 100644 index 0000000..be3285d --- /dev/null +++ b/src/layout/components/Sidebar/Item.vue @@ -0,0 +1,33 @@ + diff --git a/src/layout/components/Sidebar/Link.vue b/src/layout/components/Sidebar/Link.vue new file mode 100644 index 0000000..8b0bc93 --- /dev/null +++ b/src/layout/components/Sidebar/Link.vue @@ -0,0 +1,43 @@ + + + diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue new file mode 100644 index 0000000..966e656 --- /dev/null +++ b/src/layout/components/Sidebar/Logo.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue new file mode 100644 index 0000000..bddb65f --- /dev/null +++ b/src/layout/components/Sidebar/SidebarItem.vue @@ -0,0 +1,99 @@ + + + diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue new file mode 100644 index 0000000..817694f --- /dev/null +++ b/src/layout/components/Sidebar/index.vue @@ -0,0 +1,57 @@ + + + diff --git a/src/layout/components/TagsView/ScrollPane.vue b/src/layout/components/TagsView/ScrollPane.vue new file mode 100644 index 0000000..706fa2e --- /dev/null +++ b/src/layout/components/TagsView/ScrollPane.vue @@ -0,0 +1,149 @@ + + + + + diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue new file mode 100644 index 0000000..97947eb --- /dev/null +++ b/src/layout/components/TagsView/index.vue @@ -0,0 +1,760 @@ + + + + + + + \ No newline at end of file diff --git a/src/layout/components/TopBar/index.vue b/src/layout/components/TopBar/index.vue new file mode 100644 index 0000000..698419b --- /dev/null +++ b/src/layout/components/TopBar/index.vue @@ -0,0 +1,98 @@ + + + + + + diff --git a/src/layout/components/TopNav/index.vue b/src/layout/components/TopNav/index.vue new file mode 100644 index 0000000..8e742c5 --- /dev/null +++ b/src/layout/components/TopNav/index.vue @@ -0,0 +1,193 @@ + + + + + diff --git a/src/layout/components/index.js b/src/layout/components/index.js new file mode 100644 index 0000000..104bd3a --- /dev/null +++ b/src/layout/components/index.js @@ -0,0 +1,5 @@ +export { default as AppMain } from './AppMain' +export { default as Navbar } from './Navbar' +export { default as Settings } from './Settings' +export { default as Sidebar } from './Sidebar/index.vue' +export { default as TagsView } from './TagsView/index.vue' diff --git a/src/layout/index.vue b/src/layout/index.vue new file mode 100644 index 0000000..532edfe --- /dev/null +++ b/src/layout/index.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/src/layout/mixin/ResizeHandler.js b/src/layout/mixin/ResizeHandler.js new file mode 100644 index 0000000..e8d0df8 --- /dev/null +++ b/src/layout/mixin/ResizeHandler.js @@ -0,0 +1,45 @@ +import store from '@/store' + +const { body } = document +const WIDTH = 992 // refer to Bootstrap's responsive design + +export default { + watch: { + $route(route) { + if (this.device === 'mobile' && this.sidebar.opened) { + store.dispatch('app/closeSideBar', { withoutAnimation: false }) + } + } + }, + beforeMount() { + window.addEventListener('resize', this.$_resizeHandler) + }, + beforeDestroy() { + window.removeEventListener('resize', this.$_resizeHandler) + }, + mounted() { + const isMobile = this.$_isMobile() + if (isMobile) { + store.dispatch('app/toggleDevice', 'mobile') + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_isMobile() { + const rect = body.getBoundingClientRect() + return rect.width - 1 < WIDTH + }, + $_resizeHandler() { + if (!document.hidden) { + const isMobile = this.$_isMobile() + store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') + + if (isMobile) { + store.dispatch('app/closeSideBar', { withoutAnimation: true }) + } + } + } + } +} diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..da01750 --- /dev/null +++ b/src/main.js @@ -0,0 +1,83 @@ +import Vue from 'vue' + +import Cookies from 'js-cookie' + +import Element from 'element-ui' +import './assets/styles/element-variables.scss' + +import '@/assets/styles/index.scss' // global css +import '@/assets/styles/ruoyi.scss' // ruoyi css +import App from './App' +import store from './store' +import router from './router' +import directive from './directive' // directive +import plugins from './plugins' // plugins +import { download } from '@/utils/request' + +import './assets/icons' // icon +import './permission' // permission control +import { getDicts } from "@/api/system/dict/data" +import { getConfigKey } from "@/api/system/config" +import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi" +// 分页组件 +import Pagination from "@/components/Pagination" +// 自定义表格工具组件 +import RightToolbar from "@/components/RightToolbar" +// 富文本组件 +import Editor from "@/components/Editor" +// 文件上传组件 +import FileUpload from "@/components/FileUpload" +// 图片上传组件 +import ImageUpload from "@/components/ImageUpload" +// 图片预览组件 +import ImagePreview from "@/components/ImagePreview" +// 字典标签组件 +import DictTag from '@/components/DictTag' +// 字典数据组件 +import DictData from '@/components/DictData' + +// 全局方法挂载 +Vue.prototype.getDicts = getDicts +Vue.prototype.getConfigKey = getConfigKey +Vue.prototype.parseTime = parseTime +Vue.prototype.resetForm = resetForm +Vue.prototype.addDateRange = addDateRange +Vue.prototype.selectDictLabel = selectDictLabel +Vue.prototype.selectDictLabels = selectDictLabels +Vue.prototype.download = download +Vue.prototype.handleTree = handleTree + +// 全局组件挂载 +Vue.component('DictTag', DictTag) +Vue.component('Pagination', Pagination) +Vue.component('RightToolbar', RightToolbar) +Vue.component('Editor', Editor) +Vue.component('FileUpload', FileUpload) +Vue.component('ImageUpload', ImageUpload) +Vue.component('ImagePreview', ImagePreview) + +Vue.use(directive) +Vue.use(plugins) +DictData.install() + +/** + * If you don't want to use mock-server + * you want to use MockJs for mock api + * you can execute: mockXHR() + * + * Currently MockJs will be used in the production environment, + * please remove it before going online! ! ! + */ + +Vue.use(Element, { + size: Cookies.get('size') || 'medium' // set element-ui default size +}) + +Vue.config.productionTip = false + +new Vue({ + el: '#app', + router, + store, + render: h => h(App) +}) diff --git a/src/permission.js b/src/permission.js new file mode 100644 index 0000000..b818358 --- /dev/null +++ b/src/permission.js @@ -0,0 +1,70 @@ +import router from './router' +import store from './store' +import { Message } from 'element-ui' +import NProgress from 'nprogress' +import 'nprogress/nprogress.css' +import { getToken } from '@/utils/auth' +import { isPathMatch } from '@/utils/validate' +import { isRelogin } from '@/utils/request' + +NProgress.configure({ showSpinner: false }) + +const whiteList = ['/login', '/register'] + +const isWhiteList = (path) => { + return whiteList.some(pattern => isPathMatch(pattern, path)) +} + +router.beforeEach((to, from, next) => { + NProgress.start() + if (getToken()) { + to.meta.title && store.dispatch('settings/setTitle', to.meta.title) + const isLock = store.getters.isLock + /* has token*/ + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() + } else if (isWhiteList(to.path)) { + next() + } else if (isLock && to.path !== '/lock') { + next({ path: '/lock' }) + NProgress.done() + } else if (!isLock && to.path === '/lock') { + next({ path: '/' }) + NProgress.done() + } else { + if (store.getters.roles.length === 0) { + isRelogin.show = true + // 判断当前用户是否已拉取完user_info信息 + store.dispatch('GetInfo').then(() => { + isRelogin.show = false + store.dispatch('GenerateRoutes').then(accessRoutes => { + // 根据roles权限生成可访问的路由表 + router.addRoutes(accessRoutes) // 动态添加可访问路由表 + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 + }) + }).catch(err => { + store.dispatch('LogOut').then(() => { + Message.error(err) + next({ path: '/' }) + }) + }) + } else { + next() + } + } + } else { + // 没有token + if (isWhiteList(to.path)) { + // 在免登录白名单,直接进入 + next() + } else { + next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 否则全部重定向到登录页 + NProgress.done() + } + } +}) + +router.afterEach(() => { + NProgress.done() +}) diff --git a/src/plugins/auth.js b/src/plugins/auth.js new file mode 100644 index 0000000..3b91c14 --- /dev/null +++ b/src/plugins/auth.js @@ -0,0 +1,60 @@ +import store from '@/store' + +function authPermission(permission) { + const all_permission = "*:*:*" + const permissions = store.getters && store.getters.permissions + if (permission && permission.length > 0) { + return permissions.some(v => { + return all_permission === v || v === permission + }) + } else { + return false + } +} + +function authRole(role) { + const super_admin = "admin" + const roles = store.getters && store.getters.roles + if (role && role.length > 0) { + return roles.some(v => { + return super_admin === v || v === role + }) + } else { + return false + } +} + +export default { + // 验证用户是否具备某权限 + hasPermi(permission) { + return authPermission(permission) + }, + // 验证用户是否含有指定权限,只需包含其中一个 + hasPermiOr(permissions) { + return permissions.some(item => { + return authPermission(item) + }) + }, + // 验证用户是否含有指定权限,必须全部拥有 + hasPermiAnd(permissions) { + return permissions.every(item => { + return authPermission(item) + }) + }, + // 验证用户是否具备某角色 + hasRole(role) { + return authRole(role) + }, + // 验证用户是否含有指定角色,只需包含其中一个 + hasRoleOr(roles) { + return roles.some(item => { + return authRole(item) + }) + }, + // 验证用户是否含有指定角色,必须全部拥有 + hasRoleAnd(roles) { + return roles.every(item => { + return authRole(item) + }) + } +} diff --git a/src/plugins/cache.js b/src/plugins/cache.js new file mode 100644 index 0000000..ea8a53f --- /dev/null +++ b/src/plugins/cache.js @@ -0,0 +1,79 @@ +const sessionCache = { + set (key, value) { + if (!sessionStorage) { + return + } + if (key != null && value != null) { + sessionStorage.setItem(key, value) + } + }, + get (key) { + if (!sessionStorage) { + return null + } + if (key == null) { + return null + } + return sessionStorage.getItem(key) + }, + setJSON (key, jsonValue) { + if (jsonValue != null) { + this.set(key, JSON.stringify(jsonValue)) + } + }, + getJSON (key) { + const value = this.get(key) + if (value != null) { + return JSON.parse(value) + } + return null + }, + remove (key) { + sessionStorage.removeItem(key) + } +} +const localCache = { + set (key, value) { + if (!localStorage) { + return + } + if (key != null && value != null) { + localStorage.setItem(key, value) + } + }, + get (key) { + if (!localStorage) { + return null + } + if (key == null) { + return null + } + return localStorage.getItem(key) + }, + setJSON (key, jsonValue) { + if (jsonValue != null) { + this.set(key, JSON.stringify(jsonValue)) + } + }, + getJSON (key) { + const value = this.get(key) + if (value != null) { + return JSON.parse(value) + } + return null + }, + remove (key) { + localStorage.removeItem(key) + } +} + +export default { + /** + * 会话级缓存 + */ + session: sessionCache, + /** + * 本地缓存 + */ + local: localCache +} diff --git a/src/plugins/download.js b/src/plugins/download.js new file mode 100644 index 0000000..8dc83ea --- /dev/null +++ b/src/plugins/download.js @@ -0,0 +1,79 @@ +import axios from 'axios' +import {Loading, Message} from 'element-ui' +import { saveAs } from 'file-saver' +import { getToken } from '@/utils/auth' +import errorCode from '@/utils/errorCode' +import { blobValidate } from "@/utils/ruoyi" + +const baseURL = process.env.VUE_APP_BASE_API +let downloadLoadingInstance + +export default { + name(name, isDelete = true) { + var url = baseURL + "/common/download?fileName=" + encodeURIComponent(name) + "&delete=" + isDelete + axios({ + method: 'get', + url: url, + responseType: 'blob', + headers: { 'Authorization': 'Bearer ' + getToken() } + }).then((res) => { + const isBlob = blobValidate(res.data) + if (isBlob) { + const blob = new Blob([res.data]) + this.saveAs(blob, decodeURIComponent(res.headers['download-filename'])) + } else { + this.printErrMsg(res.data) + } + }) + }, + resource(resource) { + var url = baseURL + "/common/download/resource?resource=" + encodeURIComponent(resource) + axios({ + method: 'get', + url: url, + responseType: 'blob', + headers: { 'Authorization': 'Bearer ' + getToken() } + }).then((res) => { + const isBlob = blobValidate(res.data) + if (isBlob) { + const blob = new Blob([res.data]) + this.saveAs(blob, decodeURIComponent(res.headers['download-filename'])) + } else { + this.printErrMsg(res.data) + } + }) + }, + zip(url, name) { + var url = baseURL + url + downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }) + axios({ + method: 'get', + url: url, + responseType: 'blob', + headers: { 'Authorization': 'Bearer ' + getToken() } + }).then((res) => { + const isBlob = blobValidate(res.data) + if (isBlob) { + const blob = new Blob([res.data], { type: 'application/zip' }) + this.saveAs(blob, name) + } else { + this.printErrMsg(res.data) + } + downloadLoadingInstance.close() + }).catch((r) => { + console.error(r) + Message.error('下载文件出现错误,请联系管理员!') + downloadLoadingInstance.close() + }) + }, + saveAs(text, name, opts) { + saveAs(text, name, opts) + }, + async printErrMsg(data) { + const resText = await data.text() + const rspObj = JSON.parse(resText) + const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'] + Message.error(errMsg) + } +} + diff --git a/src/plugins/index.js b/src/plugins/index.js new file mode 100644 index 0000000..d000f2d --- /dev/null +++ b/src/plugins/index.js @@ -0,0 +1,20 @@ +import tab from './tab' +import auth from './auth' +import cache from './cache' +import modal from './modal' +import download from './download' + +export default { + install(Vue) { + // 页签操作 + Vue.prototype.$tab = tab + // 认证对象 + Vue.prototype.$auth = auth + // 缓存对象 + Vue.prototype.$cache = cache + // 模态框对象 + Vue.prototype.$modal = modal + // 下载文件 + Vue.prototype.$download = download + } +} diff --git a/src/plugins/modal.js b/src/plugins/modal.js new file mode 100644 index 0000000..92bc1ef --- /dev/null +++ b/src/plugins/modal.js @@ -0,0 +1,83 @@ +import { Message, MessageBox, Notification, Loading } from 'element-ui' + +let loadingInstance + +export default { + // 消息提示 + msg(content) { + Message.info(content) + }, + // 错误消息 + msgError(content) { + Message.error(content) + }, + // 成功消息 + msgSuccess(content) { + Message.success(content) + }, + // 警告消息 + msgWarning(content) { + Message.warning(content) + }, + // 弹出提示 + alert(content) { + MessageBox.alert(content, "系统提示") + }, + // 错误提示 + alertError(content) { + MessageBox.alert(content, "系统提示", { type: 'error' }) + }, + // 成功提示 + alertSuccess(content) { + MessageBox.alert(content, "系统提示", { type: 'success' }) + }, + // 警告提示 + alertWarning(content) { + MessageBox.alert(content, "系统提示", { type: 'warning' }) + }, + // 通知提示 + notify(content) { + Notification.info(content) + }, + // 错误通知 + notifyError(content) { + Notification.error(content) + }, + // 成功通知 + notifySuccess(content) { + Notification.success(content) + }, + // 警告通知 + notifyWarning(content) { + Notification.warning(content) + }, + // 确认窗体 + confirm(content) { + return MessageBox.confirm(content, "系统提示", { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: "warning", + }) + }, + // 提交内容 + prompt(content) { + return MessageBox.prompt(content, "系统提示", { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: "warning", + }) + }, + // 打开遮罩层 + loading(content) { + loadingInstance = Loading.service({ + lock: true, + text: content, + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }) + }, + // 关闭遮罩层 + closeLoading() { + loadingInstance.close() + } +} diff --git a/src/plugins/tab.js b/src/plugins/tab.js new file mode 100644 index 0000000..79ca662 --- /dev/null +++ b/src/plugins/tab.js @@ -0,0 +1,75 @@ +import store from '@/store' +import router from '@/router' + +export default { + // 刷新当前tab页签 + refreshPage(obj) { + const { path, query, matched } = router.currentRoute + // 防止在重定向过程中重复刷新 + if (path.startsWith('/redirect/')) { + return Promise.resolve() + } + if (obj === undefined) { + matched.forEach((m) => { + if (m.components && m.components.default && m.components.default.name) { + if (!['Layout', 'ParentView'].includes(m.components.default.name)) { + obj = { name: m.components.default.name, path: path, query: query } + } + } + }) + } + return store.dispatch('tagsView/delCachedView', obj).then(() => { + const { path, query } = obj + router.replace({ + path: '/redirect' + path, + query: query + }) + }) + }, + // 关闭当前tab页签,打开新页签 + closeOpenPage(obj) { + store.dispatch("tagsView/delView", router.currentRoute) + if (obj !== undefined) { + return router.push(obj) + } + }, + // 关闭指定tab页签 + closePage(obj) { + if (obj === undefined) { + return store.dispatch('tagsView/delView', router.currentRoute).then(({ visitedViews }) => { + const latestView = visitedViews.slice(-1)[0] + if (latestView) { + return router.push(latestView.fullPath) + } + return router.push('/') + }) + } + return store.dispatch('tagsView/delView', obj) + }, + // 关闭所有tab页签 + closeAllPage() { + return store.dispatch('tagsView/delAllViews') + }, + // 关闭左侧tab页签 + closeLeftPage(obj) { + return store.dispatch('tagsView/delLeftTags', obj || router.currentRoute) + }, + // 关闭右侧tab页签 + closeRightPage(obj) { + return store.dispatch('tagsView/delRightTags', obj || router.currentRoute) + }, + // 关闭其他tab页签 + closeOtherPage(obj) { + return store.dispatch('tagsView/delOthersViews', obj || router.currentRoute) + }, + // 添加tab页签 + openPage(title, url, params) { + const obj = { path: url, meta: { title: title } } + store.dispatch('tagsView/addView', obj) + return router.push({ path: url, query: params }) + }, + // 修改tab页签 + updatePage(obj) { + return store.dispatch('tagsView/updateVisitedView', obj) + } +} diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 0000000..8e564c2 --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,202 @@ +import Vue from 'vue' +import Router from 'vue-router' + +Vue.use(Router) + +/* Layout */ +import Layout from '@/layout' + +/** + * Note: 路由配置项 + * + * hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1 + * alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 + * // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面 + * // 若你想不管路由下面的 children 声明的个数都显示你的根路由 + * // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由 + * redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 + * name:'router-name' // 设定路由的名字,一定要填写不然使用时会出现各种问题 + * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数 + * roles: ['admin', 'common'] // 访问路由的角色权限 + * permissions: ['a:a:a', 'b:b:b'] // 访问路由的菜单权限 + * meta : { + noCache: true // 如果设置为true,则不会被 缓存(默认 false) + title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字 + icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg + breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示 + activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。 + } + */ + +// 公共路由 +export const constantRoutes = [ + { + path: '/redirect', + component: Layout, + hidden: true, + children: [ + { + path: '/redirect/:path(.*)', + component: () => import('@/views/redirect') + } + ] + }, + { + path: '/login', + component: () => import('@/views/login'), + hidden: true + }, + { + path: '/register', + component: () => import('@/views/register'), + hidden: true + }, + { + path: '/404', + component: () => import('@/views/error/404'), + hidden: true + }, + { + path: '/401', + component: () => import('@/views/error/401'), + hidden: true + }, + { + path: '', + component: Layout, + redirect: 'index', + children: [ + { + path: 'index', + component: () => import('@/views/index'), + name: 'Index', + meta: { title: '首页', icon: 'dashboard', affix: true } + } + ] + }, + { + path: '/video', + component: Layout, + redirect: '/video/index', + children: [ + { + path: 'index', + component: () => import('@/views/video/index'), + name: 'Video', + meta: { title: '视讯', icon: 'guide' } + } + ] + }, + { + path: '/lock', + component: () => import('@/views/lock'), + hidden: true, + meta: { title: '锁定屏幕' } + }, + { + path: '/user', + component: Layout, + hidden: true, + redirect: 'noredirect', + children: [ + { + path: 'profile', + component: () => import('@/views/system/user/profile/index'), + name: 'Profile', + meta: { title: '个人中心', icon: 'user' } + } + ] + } +] + +// 动态路由,基于用户权限动态去加载 +export const dynamicRoutes = [ + { + path: '/system/user-auth', + component: Layout, + hidden: true, + permissions: ['system:user:edit'], + children: [ + { + path: 'role/:userId(\\d+)', + component: () => import('@/views/system/user/authRole'), + name: 'AuthRole', + meta: { title: '分配角色', activeMenu: '/system/user' } + } + ] + }, + { + path: '/system/role-auth', + component: Layout, + hidden: true, + permissions: ['system:role:edit'], + children: [ + { + path: 'user/:roleId(\\d+)', + component: () => import('@/views/system/role/authUser'), + name: 'AuthUser', + meta: { title: '分配用户', activeMenu: '/system/role' } + } + ] + }, + { + path: '/system/dict-data', + component: Layout, + hidden: true, + permissions: ['system:dict:list'], + children: [ + { + path: 'index/:dictId(\\d+)', + component: () => import('@/views/system/dict/data'), + name: 'Data', + meta: { title: '字典数据', activeMenu: '/system/dict' } + } + ] + }, + { + path: '/monitor/job-log', + component: Layout, + hidden: true, + permissions: ['monitor:job:list'], + children: [ + { + path: 'index/:jobId(\\d+)', + component: () => import('@/views/monitor/job/log'), + name: 'JobLog', + meta: { title: '调度日志', activeMenu: '/monitor/job' } + } + ] + }, + { + path: '/tool/gen-edit', + component: Layout, + hidden: true, + permissions: ['tool:gen:edit'], + children: [ + { + path: 'index/:tableId(\\d+)', + component: () => import('@/views/tool/gen/editTable'), + name: 'GenEdit', + meta: { title: '修改生成配置', activeMenu: '/tool/gen' } + } + ] + } +] + +// 防止连续点击多次路由报错 +let routerPush = Router.prototype.push +let routerReplace = Router.prototype.replace +// push +Router.prototype.push = function push(location) { + return routerPush.call(this, location).catch(err => err) +} +// replace +Router.prototype.replace = function push(location) { + return routerReplace.call(this, location).catch(err => err) +} + +export default new Router({ + mode: 'history', // 去掉url中的# + scrollBehavior: () => ({ y: 0 }), + routes: constantRoutes +}) diff --git a/src/settings.js b/src/settings.js new file mode 100644 index 0000000..5c0fd0e --- /dev/null +++ b/src/settings.js @@ -0,0 +1,66 @@ +module.exports = { + /** + * 网页标题 + */ + title: process.env.VUE_APP_TITLE, + + /** + * 侧边栏主题 深色主题theme-dark,浅色主题theme-light + */ + sideTheme: 'theme-dark', + + /** + * 系统布局配置 + */ + showSettings: true, + + /** + * 菜单导航模式 1、纯左侧 2、混合(左侧+顶部) 3、纯顶部 + */ + navType: 1, + + /** + * 是否显示 tagsView + */ + tagsView: true, + + /** + * 持久化标签页 + */ + tagsViewPersist: false, + + /** + * 显示页签图标 + */ + tagsIcon: false, + + /** + * 标签页样式:card 卡片(默认)、chrome 谷歌浏览器风格 + */ + tagsViewStyle: 'card', + + /** + * 是否固定头部 + */ + fixedHeader: true, + + /** + * 是否显示logo + */ + sidebarLogo: true, + + /** + * 是否显示动态标题 + */ + dynamicTitle: false, + + /** + * 是否显示底部版权 + */ + footerVisible: false, + + /** + * 底部版权文本内容 + */ + footerContent: 'Copyright © 2018-2026 RuoYi. All Rights Reserved.' +} diff --git a/src/store/getters.js b/src/store/getters.js new file mode 100644 index 0000000..3b540a1 --- /dev/null +++ b/src/store/getters.js @@ -0,0 +1,23 @@ +const getters = { + sidebar: state => state.app.sidebar, + size: state => state.app.size, + device: state => state.app.device, + dict: state => state.dict.dict, + isLock: state => state.lock.isLock, + lockPath: state => state.lock.lockPath, + visitedViews: state => state.tagsView.visitedViews, + cachedViews: state => state.tagsView.cachedViews, + token: state => state.user.token, + avatar: state => state.user.avatar, + id: state => state.user.id, + name: state => state.user.name, + nickName: state => state.user.nickName, + introduction: state => state.user.introduction, + roles: state => state.user.roles, + permissions: state => state.user.permissions, + permission_routes: state => state.permission.routes, + topbarRouters: state => state.permission.topbarRouters, + defaultRoutes: state => state.permission.defaultRoutes, + sidebarRouters: state => state.permission.sidebarRouters +} +export default getters diff --git a/src/store/index.js b/src/store/index.js new file mode 100644 index 0000000..a89f0ad --- /dev/null +++ b/src/store/index.js @@ -0,0 +1,27 @@ +import Vue from 'vue' +import Vuex from 'vuex' +import app from './modules/app' +import lock from './modules/lock' +import dict from './modules/dict' +import user from './modules/user' +import tagsView from './modules/tagsView' +import permission from './modules/permission' +import settings from './modules/settings' +import getters from './getters' + +Vue.use(Vuex) + +const store = new Vuex.Store({ + modules: { + app, + lock, + dict, + user, + tagsView, + permission, + settings + }, + getters +}) + +export default store diff --git a/src/store/modules/app.js b/src/store/modules/app.js new file mode 100644 index 0000000..9f99f39 --- /dev/null +++ b/src/store/modules/app.js @@ -0,0 +1,66 @@ +import Cookies from 'js-cookie' + +const state = { + sidebar: { + opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true, + withoutAnimation: false, + hide: false + }, + device: 'desktop', + size: Cookies.get('size') || 'medium' +} + +const mutations = { + TOGGLE_SIDEBAR: state => { + if (state.sidebar.hide) { + return false + } + state.sidebar.opened = !state.sidebar.opened + state.sidebar.withoutAnimation = false + if (state.sidebar.opened) { + Cookies.set('sidebarStatus', 1) + } else { + Cookies.set('sidebarStatus', 0) + } + }, + CLOSE_SIDEBAR: (state, withoutAnimation) => { + Cookies.set('sidebarStatus', 0) + state.sidebar.opened = false + state.sidebar.withoutAnimation = withoutAnimation + }, + TOGGLE_DEVICE: (state, device) => { + state.device = device + }, + SET_SIZE: (state, size) => { + state.size = size + Cookies.set('size', size) + }, + SET_SIDEBAR_HIDE: (state, status) => { + state.sidebar.hide = status + } +} + +const actions = { + toggleSideBar({ commit }) { + commit('TOGGLE_SIDEBAR') + }, + closeSideBar({ commit }, { withoutAnimation }) { + commit('CLOSE_SIDEBAR', withoutAnimation) + }, + toggleDevice({ commit }, device) { + commit('TOGGLE_DEVICE', device) + }, + setSize({ commit }, size) { + commit('SET_SIZE', size) + }, + toggleSideBarHide({ commit }, status) { + commit('SET_SIDEBAR_HIDE', status) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/src/store/modules/dict.js b/src/store/modules/dict.js new file mode 100644 index 0000000..7a1b2f0 --- /dev/null +++ b/src/store/modules/dict.js @@ -0,0 +1,50 @@ +const state = { + dict: new Array() +} +const mutations = { + SET_DICT: (state, { key, value }) => { + if (key !== null && key !== "") { + state.dict.push({ + key: key, + value: value + }) + } + }, + REMOVE_DICT: (state, key) => { + try { + for (let i = 0; i < state.dict.length; i++) { + if (state.dict[i].key == key) { + state.dict.splice(i, 1) + return true + } + } + } catch (e) { + } + }, + CLEAN_DICT: (state) => { + state.dict = new Array() + } +} + +const actions = { + // 设置字典 + setDict({ commit }, data) { + commit('SET_DICT', data) + }, + // 删除字典 + removeDict({ commit }, key) { + commit('REMOVE_DICT', key) + }, + // 清空字典 + cleanDict({ commit }) { + commit('CLEAN_DICT') + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/src/store/modules/lock.js b/src/store/modules/lock.js new file mode 100644 index 0000000..14e1bd0 --- /dev/null +++ b/src/store/modules/lock.js @@ -0,0 +1,34 @@ +const LOCK_KEY = 'screen-lock' +const LOCK_PATH_KEY = 'screen-lock-path' + +const lock = { + namespaced: true, + state: { + isLock: JSON.parse(localStorage.getItem(LOCK_KEY) || 'false'), + lockPath: localStorage.getItem(LOCK_PATH_KEY) || '/index' + }, + mutations: { + SET_LOCK(state, status) { + state.isLock = status + localStorage.setItem(LOCK_KEY, JSON.stringify(status)) + }, + SET_LOCK_PATH(state, path) { + state.lockPath = path + localStorage.setItem(LOCK_PATH_KEY, path) + } + }, + actions: { + // 锁定屏幕,同时记录当前路径 + lockScreen({ commit }, currentPath) { + commit('SET_LOCK_PATH', currentPath || '/index') + commit('SET_LOCK', true) + }, + // 解锁屏幕,清除路径 + unlockScreen({ commit }) { + commit('SET_LOCK', false) + commit('SET_LOCK_PATH', '/index') + } + } +} + +export default lock diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js new file mode 100644 index 0000000..b549ef0 --- /dev/null +++ b/src/store/modules/permission.js @@ -0,0 +1,122 @@ +import auth from '@/plugins/auth' +import router, { constantRoutes, dynamicRoutes } from '@/router' +import { getRouters } from '@/api/menu' +import Layout from '@/layout/index' +import ParentView from '@/components/ParentView' +import InnerLink from '@/layout/components/InnerLink' + +const permission = { + state: { + routes: [], + addRoutes: [], + defaultRoutes: [], + topbarRouters: [], + sidebarRouters: [] + }, + mutations: { + SET_ROUTES: (state, routes) => { + state.addRoutes = routes + state.routes = constantRoutes.concat(routes) + }, + SET_DEFAULT_ROUTES: (state, routes) => { + state.defaultRoutes = constantRoutes.concat(routes) + }, + SET_TOPBAR_ROUTES: (state, routes) => { + state.topbarRouters = routes + }, + SET_SIDEBAR_ROUTERS: (state, routes) => { + state.sidebarRouters = routes + }, + }, + actions: { + // 生成路由 + GenerateRoutes({ commit }) { + return new Promise(resolve => { + // 向后端请求路由数据 + getRouters().then(res => { + const sdata = JSON.parse(JSON.stringify(res.data)) + const rdata = JSON.parse(JSON.stringify(res.data)) + const sidebarRoutes = filterAsyncRouter(sdata) + const rewriteRoutes = filterAsyncRouter(rdata, false, true) + const asyncRoutes = filterDynamicRoutes(dynamicRoutes) + rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true }) + router.addRoutes(asyncRoutes) + commit('SET_ROUTES', rewriteRoutes) + commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes)) + commit('SET_DEFAULT_ROUTES', sidebarRoutes) + commit('SET_TOPBAR_ROUTES', sidebarRoutes) + resolve(rewriteRoutes) + }) + }) + } + } +} + +// 遍历后台传来的路由字符串,转换为组件对象 +function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { + return asyncRouterMap.filter(route => { + if (type && route.children) { + route.children = filterChildren(route.children) + } + if (route.component) { + // Layout ParentView 组件特殊处理 + if (route.component === 'Layout') { + route.component = Layout + } else if (route.component === 'ParentView') { + route.component = ParentView + } else if (route.component === 'InnerLink') { + route.component = InnerLink + } else { + route.component = loadView(route.component) + } + } + if (route.children != null && route.children && route.children.length) { + route.children = filterAsyncRouter(route.children, route, type) + } else { + delete route['children'] + delete route['redirect'] + } + return true + }) +} + +function filterChildren(childrenMap, lastRouter = false) { + var children = [] + childrenMap.forEach(el => { + el.path = lastRouter ? lastRouter.path + '/' + el.path : el.path + if (el.children && el.children.length && el.component === 'ParentView') { + children = children.concat(filterChildren(el.children, el)) + } else { + children.push(el) + } + }) + return children +} + +// 动态路由遍历,验证是否具备权限 +export function filterDynamicRoutes(routes) { + const res = [] + routes.forEach(route => { + if (route.permissions) { + if (auth.hasPermiOr(route.permissions)) { + res.push(route) + } + } else if (route.roles) { + if (auth.hasRoleOr(route.roles)) { + res.push(route) + } + } + }) + return res +} + +export const loadView = (view) => { + if (process.env.NODE_ENV === 'development') { + return (resolve) => require([`@/views/${view}`], resolve) + } else { + // 使用 import 实现生产环境的路由懒加载 + return () => import(`@/views/${view}`) + } +} + +export default permission diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js new file mode 100644 index 0000000..153ee77 --- /dev/null +++ b/src/store/modules/settings.js @@ -0,0 +1,52 @@ +import defaultSettings from '@/settings' +import { useDynamicTitle } from '@/utils/dynamicTitle' + +const { sideTheme, showSettings, navType, tagsView, tagsViewPersist, tagsIcon, tagsViewStyle, fixedHeader, sidebarLogo, dynamicTitle, footerVisible, footerContent } = defaultSettings + +const storageSetting = JSON.parse(localStorage.getItem('layout-setting')) || '' +const state = { + title: '', + theme: storageSetting.theme || '#009393', + sideTheme: storageSetting.sideTheme || sideTheme, + showSettings: showSettings, + navType: storageSetting.navType === undefined ? navType : storageSetting.navType, + tagsView: storageSetting.tagsView === undefined ? tagsView : storageSetting.tagsView, + tagsViewPersist: storageSetting.tagsViewPersist === undefined ? tagsViewPersist : storageSetting.tagsViewPersist, + tagsIcon: storageSetting.tagsIcon === undefined ? tagsIcon : storageSetting.tagsIcon, + tagsViewStyle: storageSetting.tagsViewStyle === undefined ? tagsViewStyle : storageSetting.tagsViewStyle, + fixedHeader: storageSetting.fixedHeader === undefined ? fixedHeader : storageSetting.fixedHeader, + sidebarLogo: storageSetting.sidebarLogo === undefined ? sidebarLogo : storageSetting.sidebarLogo, + dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle, + footerVisible: storageSetting.footerVisible === undefined ? footerVisible : storageSetting.footerVisible, + footerContent: footerContent +} +const mutations = { + CHANGE_SETTING: (state, { key, value }) => { + if (state.hasOwnProperty(key)) { + state[key] = value + } + }, + SET_TITLE: (state, title) => { + state.title = title + } +} + +const actions = { + // 修改布局设置 + changeSetting({ commit }, data) { + commit('CHANGE_SETTING', data) + }, + // 设置网页标题 + setTitle({ commit }, title) { + commit('SET_TITLE', title) + useDynamicTitle() + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/src/store/modules/tagsView.js b/src/store/modules/tagsView.js new file mode 100644 index 0000000..a72ed23 --- /dev/null +++ b/src/store/modules/tagsView.js @@ -0,0 +1,275 @@ +import store from '@/store' +import cache from '@/plugins/cache' + +const PERSIST_KEY = 'tags-view-visited' + +function isPersistEnabled() { + return store.state.settings.tagsViewPersist +} + +function saveVisitedViews(views) { + if (!isPersistEnabled()) return + const toSave = views.filter(v => !(v.meta && v.meta.affix)).map(v => ({ path: v.path, fullPath: v.fullPath, name: v.name, title: v.title, query: v.query, meta: v.meta })) + cache.local.setJSON(PERSIST_KEY, toSave) +} + +function loadVisitedViews() { + return cache.local.getJSON(PERSIST_KEY) || [] +} + +function clearVisitedViews() { + cache.local.remove(PERSIST_KEY) +} + +const state = { + visitedViews: [], + cachedViews: [], + iframeViews: [] +} + +const mutations = { + ADD_IFRAME_VIEW: (state, view) => { + if (state.iframeViews.some(v => v.path === view.path)) return + state.iframeViews.push( + Object.assign({}, view, { + title: view.meta.title || 'no-name' + }) + ) + }, + ADD_VISITED_VIEW: (state, view) => { + if (state.visitedViews.some(v => v.path === view.path)) return + state.visitedViews.push( + Object.assign({}, view, { + title: view.meta.title || 'no-name' + }) + ) + saveVisitedViews(state.visitedViews) + }, + ADD_VISITED_VIEW_FIRST: (state, view) => { + if (state.visitedViews.some(v => v.path === view.path)) return + state.visitedViews.unshift( + Object.assign({}, view, { + title: view.meta.title || 'no-name' + }) + ) + }, + ADD_CACHED_VIEW: (state, view) => { + if (state.cachedViews.includes(view.name)) return + if (view.meta && !view.meta.noCache) { + state.cachedViews.push(view.name) + } + }, + DEL_VISITED_VIEW: (state, view) => { + for (const [i, v] of state.visitedViews.entries()) { + if (v.path === view.path) { + state.visitedViews.splice(i, 1) + break + } + } + state.iframeViews = state.iframeViews.filter(item => item.path !== view.path) + saveVisitedViews(state.visitedViews) + }, + DEL_IFRAME_VIEW: (state, view) => { + state.iframeViews = state.iframeViews.filter(item => item.path !== view.path) + }, + DEL_CACHED_VIEW: (state, view) => { + const index = state.cachedViews.indexOf(view.name) + index > -1 && state.cachedViews.splice(index, 1) + }, + + DEL_OTHERS_VISITED_VIEWS: (state, view) => { + state.visitedViews = state.visitedViews.filter(v => { + return v.meta.affix || v.path === view.path + }) + state.iframeViews = state.iframeViews.filter(item => item.path === view.path) + saveVisitedViews(state.visitedViews) + }, + DEL_OTHERS_CACHED_VIEWS: (state, view) => { + const index = state.cachedViews.indexOf(view.name) + if (index > -1) { + state.cachedViews = state.cachedViews.slice(index, index + 1) + } else { + state.cachedViews = [] + } + }, + DEL_ALL_VISITED_VIEWS: state => { + // keep affix tags + const affixTags = state.visitedViews.filter(tag => tag.meta.affix) + state.visitedViews = affixTags + state.iframeViews = [] + clearVisitedViews() + }, + DEL_ALL_CACHED_VIEWS: state => { + state.cachedViews = [] + }, + UPDATE_VISITED_VIEW: (state, view) => { + for (let v of state.visitedViews) { + if (v.path === view.path) { + v = Object.assign(v, view) + break + } + } + }, + DEL_RIGHT_VIEWS: (state, view) => { + const index = state.visitedViews.findIndex(v => v.path === view.path) + if (index === -1) { + return + } + state.visitedViews = state.visitedViews.filter((item, idx) => { + if (idx <= index || (item.meta && item.meta.affix)) { + return true + } + const i = state.cachedViews.indexOf(item.name) + if (i > -1) { + state.cachedViews.splice(i, 1) + } + if(item.meta.link) { + const fi = state.iframeViews.findIndex(v => v.path === item.path) + state.iframeViews.splice(fi, 1) + } + return false + }) + saveVisitedViews(state.visitedViews) + }, + DEL_LEFT_VIEWS: (state, view) => { + const index = state.visitedViews.findIndex(v => v.path === view.path) + if (index === -1) { + return + } + state.visitedViews = state.visitedViews.filter((item, idx) => { + if (idx >= index || (item.meta && item.meta.affix)) { + return true + } + const i = state.cachedViews.indexOf(item.name) + if (i > -1) { + state.cachedViews.splice(i, 1) + } + if(item.meta.link) { + const fi = state.iframeViews.findIndex(v => v.path === item.path) + state.iframeViews.splice(fi, 1) + } + return false + }) + saveVisitedViews(state.visitedViews) + } +} + +const actions = { + addView({ dispatch }, view) { + dispatch('addVisitedView', view) + dispatch('addCachedView', view) + }, + addIframeView({ commit }, view) { + commit('ADD_IFRAME_VIEW', view) + }, + addVisitedView({ commit }, view) { + commit('ADD_VISITED_VIEW', view) + }, + addAffixView({ commit }, view) { + commit('ADD_VISITED_VIEW_FIRST', view) + }, + addCachedView({ commit }, view) { + commit('ADD_CACHED_VIEW', view) + }, + delView({ dispatch, state }, view) { + return new Promise(resolve => { + dispatch('delVisitedView', view) + dispatch('delCachedView', view) + resolve({ + visitedViews: [...state.visitedViews], + cachedViews: [...state.cachedViews] + }) + }) + }, + delVisitedView({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_VISITED_VIEW', view) + resolve([...state.visitedViews]) + }) + }, + delIframeView({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_IFRAME_VIEW', view) + resolve([...state.iframeViews]) + }) + }, + delCachedView({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_CACHED_VIEW', view) + resolve([...state.cachedViews]) + }) + }, + delOthersViews({ dispatch, state }, view) { + return new Promise(resolve => { + dispatch('delOthersVisitedViews', view) + dispatch('delOthersCachedViews', view) + resolve({ + visitedViews: [...state.visitedViews], + cachedViews: [...state.cachedViews] + }) + }) + }, + delOthersVisitedViews({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_OTHERS_VISITED_VIEWS', view) + resolve([...state.visitedViews]) + }) + }, + delOthersCachedViews({ commit, state }, view) { + return new Promise(resolve => { + commit('DEL_OTHERS_CACHED_VIEWS', view) + resolve([...state.cachedViews]) + }) + }, + delAllViews({ dispatch, state }, view) { + return new Promise(resolve => { + dispatch('delAllVisitedViews', view) + dispatch('delAllCachedViews', view) + resolve({ + visitedViews: [...state.visitedViews], + cachedViews: [...state.cachedViews] + }) + }) + }, + delAllVisitedViews({ commit, state }) { + return new Promise(resolve => { + commit('DEL_ALL_VISITED_VIEWS') + resolve([...state.visitedViews]) + }) + }, + delAllCachedViews({ commit, state }) { + return new Promise(resolve => { + commit('DEL_ALL_CACHED_VIEWS') + resolve([...state.cachedViews]) + }) + }, + updateVisitedView({ commit }, view) { + commit('UPDATE_VISITED_VIEW', view) + }, + delRightTags({ commit }, view) { + return new Promise(resolve => { + commit('DEL_RIGHT_VIEWS', view) + resolve([...state.visitedViews]) + }) + }, + delLeftTags({ commit }, view) { + return new Promise(resolve => { + commit('DEL_LEFT_VIEWS', view) + resolve([...state.visitedViews]) + }) + }, + // 恢复持久化的 tags + loadPersistedViews({ commit }) { + const views = loadVisitedViews() + views.forEach(view => { + commit('ADD_VISITED_VIEW', view) + }) + }, +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/src/store/modules/user.js b/src/store/modules/user.js new file mode 100644 index 0000000..9cb7345 --- /dev/null +++ b/src/store/modules/user.js @@ -0,0 +1,129 @@ +import store from '@/store' +import router from '@/router' +import cache from '@/plugins/cache' +import { MessageBox, } from 'element-ui' +import { login, logout, getInfo } from '@/api/login' +import { getToken, setToken, removeToken } from '@/utils/auth' +import { isHttp, isEmpty } from "@/utils/validate" +import defAva from '@/assets/images/profile.jpg' + +const user = { + state: { + token: getToken(), + id: '', + name: '', + nickName: '', + avatar: '', + roles: [], + permissions: [] + }, + + mutations: { + SET_TOKEN: (state, token) => { + state.token = token + }, + SET_ID: (state, id) => { + state.id = id + }, + SET_NAME: (state, name) => { + state.name = name + }, + SET_NICK_NAME: (state, nickName) => { + state.nickName = nickName + }, + SET_AVATAR: (state, avatar) => { + state.avatar = avatar + }, + SET_ROLES: (state, roles) => { + state.roles = roles + }, + SET_PERMISSIONS: (state, permissions) => { + state.permissions = permissions + } + }, + + actions: { + // 登录 + Login({ commit }, userInfo) { + const username = userInfo.username.trim() + const password = userInfo.password + const code = userInfo.code + const uuid = userInfo.uuid + return new Promise((resolve, reject) => { + login(username, password, code, uuid).then(res => { + setToken(res.token) + commit('SET_TOKEN', res.token) + store.dispatch('lock/unlockScreen') + resolve() + }).catch(error => { + reject(error) + }) + }) + }, + + // 获取用户信息 + GetInfo({ commit, state }) { + return new Promise((resolve, reject) => { + getInfo().then(res => { + const user = res.user + let avatar = user.avatar || "" + if (!isHttp(avatar)) { + avatar = (isEmpty(avatar)) ? defAva : process.env.VUE_APP_BASE_API + avatar + } + if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 + commit('SET_ROLES', res.roles) + commit('SET_PERMISSIONS', res.permissions) + } else { + commit('SET_ROLES', ['ROLE_DEFAULT']) + } + commit('SET_ID', user.userId) + commit('SET_NAME', user.userName) + commit('SET_NICK_NAME', user.nickName) + commit('SET_AVATAR', avatar) + cache.session.set('pwrChrtype', res.pwdChrtype) + /* 初始密码提示 */ + if(res.isDefaultModifyPwd) { + MessageBox.confirm('您的密码还是初始密码,请修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { + router.push({ name: 'Profile', params: { activeTab: 'resetPwd' } }) + }).catch(() => {}) + } + /* 过期密码提示 */ + if(!res.isDefaultModifyPwd && res.isPasswordExpired) { + MessageBox.confirm('您的密码已过期,请尽快修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { + router.push({ name: 'Profile', params: { activeTab: 'resetPwd' } }) + }).catch(() => {}) + } + resolve(res) + }).catch(error => { + reject(error) + }) + }) + }, + + // 退出系统 + LogOut({ commit, state }) { + return new Promise((resolve, reject) => { + logout(state.token).then(() => { + commit('SET_TOKEN', '') + commit('SET_ROLES', []) + commit('SET_PERMISSIONS', []) + removeToken() + resolve() + }).catch(error => { + reject(error) + }) + }) + }, + + // 前端 登出 + FedLogOut({ commit }) { + return new Promise(resolve => { + commit('SET_TOKEN', '') + removeToken() + resolve() + }) + } + } +} + +export default user diff --git a/src/utils/auth.js b/src/utils/auth.js new file mode 100644 index 0000000..08a43d6 --- /dev/null +++ b/src/utils/auth.js @@ -0,0 +1,15 @@ +import Cookies from 'js-cookie' + +const TokenKey = 'Admin-Token' + +export function getToken() { + return Cookies.get(TokenKey) +} + +export function setToken(token) { + return Cookies.set(TokenKey, token) +} + +export function removeToken() { + return Cookies.remove(TokenKey) +} diff --git a/src/utils/dict/Dict.js b/src/utils/dict/Dict.js new file mode 100644 index 0000000..994f6f7 --- /dev/null +++ b/src/utils/dict/Dict.js @@ -0,0 +1,82 @@ +import Vue from 'vue' +import { mergeRecursive } from "@/utils/ruoyi" +import DictMeta from './DictMeta' +import DictData from './DictData' + +const DEFAULT_DICT_OPTIONS = { + types: [], +} + +/** + * @classdesc 字典 + * @property {Object} label 标签对象,内部属性名为字典类型名称 + * @property {Object} dict 字段数组,内部属性名为字典类型名称 + * @property {Array.} _dictMetas 字典元数据数组 + */ +export default class Dict { + constructor() { + this.owner = null + this.label = {} + this.type = {} + } + + init(options) { + if (options instanceof Array) { + options = { types: options } + } + const opts = mergeRecursive(DEFAULT_DICT_OPTIONS, options) + if (opts.types === undefined) { + throw new Error('need dict types') + } + const ps = [] + this._dictMetas = opts.types.map(t => DictMeta.parse(t)) + this._dictMetas.forEach(dictMeta => { + const type = dictMeta.type + Vue.set(this.label, type, {}) + Vue.set(this.type, type, []) + if (dictMeta.lazy) { + return + } + ps.push(loadDict(this, dictMeta)) + }) + return Promise.all(ps) + } + + /** + * 重新加载字典 + * @param {String} type 字典类型 + */ + reloadDict(type) { + const dictMeta = this._dictMetas.find(e => e.type === type) + if (dictMeta === undefined) { + return Promise.reject(`the dict meta of ${type} was not found`) + } + return loadDict(this, dictMeta) + } +} + +/** + * 加载字典 + * @param {Dict} dict 字典 + * @param {DictMeta} dictMeta 字典元数据 + * @returns {Promise} + */ +function loadDict(dict, dictMeta) { + return dictMeta.request(dictMeta) + .then(response => { + const type = dictMeta.type + let dicts = dictMeta.responseConverter(response, dictMeta) + if (!(dicts instanceof Array)) { + console.error('the return of responseConverter must be Array.') + dicts = [] + } else if (dicts.filter(d => d instanceof DictData).length !== dicts.length) { + console.error('the type of elements in dicts must be DictData') + dicts = [] + } + dict.type[type].splice(0, Number.MAX_SAFE_INTEGER, ...dicts) + dicts.forEach(d => { + Vue.set(dict.label[type], d.value, d.label) + }) + return dicts + }) +} diff --git a/src/utils/dict/DictConverter.js b/src/utils/dict/DictConverter.js new file mode 100644 index 0000000..0cf5df8 --- /dev/null +++ b/src/utils/dict/DictConverter.js @@ -0,0 +1,17 @@ +import DictOptions from './DictOptions' +import DictData from './DictData' + +export default function(dict, dictMeta) { + const label = determineDictField(dict, dictMeta.labelField, ...DictOptions.DEFAULT_LABEL_FIELDS) + const value = determineDictField(dict, dictMeta.valueField, ...DictOptions.DEFAULT_VALUE_FIELDS) + return new DictData(dict[label], dict[value], dict) +} + +/** + * 确定字典字段 + * @param {DictData} dict + * @param {...String} fields + */ +function determineDictField(dict, ...fields) { + return fields.find(f => Object.prototype.hasOwnProperty.call(dict, f)) +} diff --git a/src/utils/dict/DictData.js b/src/utils/dict/DictData.js new file mode 100644 index 0000000..afc763e --- /dev/null +++ b/src/utils/dict/DictData.js @@ -0,0 +1,13 @@ +/** + * @classdesc 字典数据 + * @property {String} label 标签 + * @property {*} value 标签 + * @property {Object} raw 原始数据 + */ +export default class DictData { + constructor(label, value, raw) { + this.label = label + this.value = value + this.raw = raw + } +} diff --git a/src/utils/dict/DictMeta.js b/src/utils/dict/DictMeta.js new file mode 100644 index 0000000..617cc00 --- /dev/null +++ b/src/utils/dict/DictMeta.js @@ -0,0 +1,38 @@ +import { mergeRecursive } from "@/utils/ruoyi" +import DictOptions from './DictOptions' + +/** + * @classdesc 字典元数据 + * @property {String} type 类型 + * @property {Function} request 请求 + * @property {String} label 标签字段 + * @property {String} value 值字段 + */ +export default class DictMeta { + constructor(options) { + this.type = options.type + this.request = options.request + this.responseConverter = options.responseConverter + this.labelField = options.labelField + this.valueField = options.valueField + this.lazy = options.lazy === true + } +} + + +/** + * 解析字典元数据 + * @param {Object} options + * @returns {DictMeta} + */ +DictMeta.parse= function(options) { + let opts = null + if (typeof options === 'string') { + opts = DictOptions.metas[options] || {} + opts.type = options + } else if (typeof options === 'object') { + opts = options + } + opts = mergeRecursive(DictOptions.metas['*'], opts) + return new DictMeta(opts) +} diff --git a/src/utils/dict/DictOptions.js b/src/utils/dict/DictOptions.js new file mode 100644 index 0000000..5fd1425 --- /dev/null +++ b/src/utils/dict/DictOptions.js @@ -0,0 +1,51 @@ +import { mergeRecursive } from "@/utils/ruoyi" +import dictConverter from './DictConverter' + +export const options = { + metas: { + '*': { + /** + * 字典请求,方法签名为function(dictMeta: DictMeta): Promise + */ + request: (dictMeta) => { + console.log(`load dict ${dictMeta.type}`) + return Promise.resolve([]) + }, + /** + * 字典响应数据转换器,方法签名为function(response: Object, dictMeta: DictMeta): DictData + */ + responseConverter, + labelField: 'label', + valueField: 'value', + }, + }, + /** + * 默认标签字段 + */ + DEFAULT_LABEL_FIELDS: ['label', 'name', 'title'], + /** + * 默认值字段 + */ + DEFAULT_VALUE_FIELDS: ['value', 'id', 'uid', 'key'], +} + +/** + * 映射字典 + * @param {Object} response 字典数据 + * @param {DictMeta} dictMeta 字典元数据 + * @returns {DictData} + */ +function responseConverter(response, dictMeta) { + const dicts = response.content instanceof Array ? response.content : response + if (dicts === undefined) { + console.warn(`no dict data of "${dictMeta.type}" found in the response`) + return [] + } + return dicts.map(d => dictConverter(d, dictMeta)) +} + +export function mergeOptions(src) { + mergeRecursive(options, src) +} + +export default options diff --git a/src/utils/dict/index.js b/src/utils/dict/index.js new file mode 100644 index 0000000..215eb9e --- /dev/null +++ b/src/utils/dict/index.js @@ -0,0 +1,33 @@ +import Dict from './Dict' +import { mergeOptions } from './DictOptions' + +export default function(Vue, options) { + mergeOptions(options) + Vue.mixin({ + data() { + if (this.$options === undefined || this.$options.dicts === undefined || this.$options.dicts === null) { + return {} + } + const dict = new Dict() + dict.owner = this + return { + dict + } + }, + created() { + if (!(this.dict instanceof Dict)) { + return + } + options.onCreated && options.onCreated(this.dict) + this.dict.init(this.$options.dicts).then(() => { + options.onReady && options.onReady(this.dict) + this.$nextTick(() => { + this.$emit('dictReady', this.dict) + if (this.$options.methods && this.$options.methods.onDictReady instanceof Function) { + this.$options.methods.onDictReady.call(this, this.dict) + } + }) + }) + }, + }) +} diff --git a/src/utils/dynamicTitle.js b/src/utils/dynamicTitle.js new file mode 100644 index 0000000..1b57efb --- /dev/null +++ b/src/utils/dynamicTitle.js @@ -0,0 +1,13 @@ +import store from '@/store' +import defaultSettings from '@/settings' + +/** + * 动态修改标题 + */ +export function useDynamicTitle() { + if (store.state.settings.dynamicTitle) { + document.title = store.state.settings.title + ' - ' + defaultSettings.title + } else { + document.title = defaultSettings.title + } +} \ No newline at end of file diff --git a/src/utils/errorCode.js b/src/utils/errorCode.js new file mode 100644 index 0000000..d2111ee --- /dev/null +++ b/src/utils/errorCode.js @@ -0,0 +1,6 @@ +export default { + '401': '认证失败,无法访问系统资源', + '403': '当前操作没有权限', + '404': '访问资源不存在', + 'default': '系统未知错误,请反馈给管理员' +} diff --git a/src/utils/generator/config.js b/src/utils/generator/config.js new file mode 100644 index 0000000..7abf227 --- /dev/null +++ b/src/utils/generator/config.js @@ -0,0 +1,438 @@ +export const formConf = { + formRef: 'elForm', + formModel: 'formData', + size: 'medium', + labelPosition: 'right', + labelWidth: 100, + formRules: 'rules', + gutter: 15, + disabled: false, + span: 24, + formBtns: true +} + +export const inputComponents = [ + { + label: '单行文本', + tag: 'el-input', + tagIcon: 'input', + placeholder: '请输入', + defaultValue: undefined, + span: 24, + labelWidth: null, + style: { width: '100%' }, + clearable: true, + prepend: '', + append: '', + 'prefix-icon': '', + 'suffix-icon': '', + maxlength: null, + 'show-word-limit': false, + readonly: false, + disabled: false, + required: true, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/input' + }, + { + label: '多行文本', + tag: 'el-input', + tagIcon: 'textarea', + type: 'textarea', + placeholder: '请输入', + defaultValue: undefined, + span: 24, + labelWidth: null, + autosize: { + minRows: 4, + maxRows: 4 + }, + style: { width: '100%' }, + maxlength: null, + 'show-word-limit': false, + readonly: false, + disabled: false, + required: true, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/input' + }, + { + label: '密码', + tag: 'el-input', + tagIcon: 'password', + placeholder: '请输入', + defaultValue: undefined, + span: 24, + 'show-password': true, + labelWidth: null, + style: { width: '100%' }, + clearable: true, + prepend: '', + append: '', + 'prefix-icon': '', + 'suffix-icon': '', + maxlength: null, + 'show-word-limit': false, + readonly: false, + disabled: false, + required: true, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/input' + }, + { + label: '计数器', + tag: 'el-input-number', + tagIcon: 'number', + placeholder: '', + defaultValue: undefined, + span: 24, + labelWidth: null, + min: undefined, + max: undefined, + step: undefined, + 'step-strictly': false, + precision: undefined, + 'controls-position': '', + disabled: false, + required: true, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/input-number' + } +] + +export const selectComponents = [ + { + label: '下拉选择', + tag: 'el-select', + tagIcon: 'select', + placeholder: '请选择', + defaultValue: undefined, + span: 24, + labelWidth: null, + style: { width: '100%' }, + clearable: true, + disabled: false, + required: true, + filterable: false, + multiple: false, + options: [{ + label: '选项一', + value: 1 + }, { + label: '选项二', + value: 2 + }], + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/select' + }, + { + label: '级联选择', + tag: 'el-cascader', + tagIcon: 'cascader', + placeholder: '请选择', + defaultValue: [], + span: 24, + labelWidth: null, + style: { width: '100%' }, + props: { + props: { + multiple: false + } + }, + 'show-all-levels': true, + disabled: false, + clearable: true, + filterable: false, + required: true, + options: [{ + id: 1, + value: 1, + label: '选项1', + children: [{ + id: 2, + value: 2, + label: '选项1-1' + }] + }], + dataType: 'dynamic', + labelKey: 'label', + valueKey: 'value', + childrenKey: 'children', + separator: '/', + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/cascader' + }, + { + label: '单选框组', + tag: 'el-radio-group', + tagIcon: 'radio', + defaultValue: undefined, + span: 24, + labelWidth: null, + style: {}, + optionType: 'default', + border: false, + size: 'medium', + disabled: false, + required: true, + options: [{ + label: '选项一', + value: 1 + }, { + label: '选项二', + value: 2 + }], + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/radio' + }, + { + label: '多选框组', + tag: 'el-checkbox-group', + tagIcon: 'checkbox', + defaultValue: [], + span: 24, + labelWidth: null, + style: {}, + optionType: 'default', + border: false, + size: 'medium', + disabled: false, + required: true, + options: [{ + label: '选项一', + value: 1 + }, { + label: '选项二', + value: 2 + }], + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/checkbox' + }, + { + label: '开关', + tag: 'el-switch', + tagIcon: 'switch', + defaultValue: false, + span: 24, + labelWidth: null, + style: {}, + disabled: false, + required: true, + 'active-text': '', + 'inactive-text': '', + 'active-color': null, + 'inactive-color': null, + 'active-value': true, + 'inactive-value': false, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/switch' + }, + { + label: '滑块', + tag: 'el-slider', + tagIcon: 'slider', + defaultValue: null, + span: 24, + labelWidth: null, + disabled: false, + required: true, + min: 0, + max: 100, + step: 1, + 'show-stops': false, + range: false, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/slider' + }, + { + label: '时间选择', + tag: 'el-time-picker', + tagIcon: 'time', + placeholder: '请选择', + defaultValue: null, + span: 24, + labelWidth: null, + style: { width: '100%' }, + disabled: false, + clearable: true, + required: true, + 'picker-options': { + selectableRange: '00:00:00-23:59:59' + }, + format: 'HH:mm:ss', + 'value-format': 'HH:mm:ss', + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/time-picker' + }, + { + label: '时间范围', + tag: 'el-time-picker', + tagIcon: 'time-range', + defaultValue: null, + span: 24, + labelWidth: null, + style: { width: '100%' }, + disabled: false, + clearable: true, + required: true, + 'is-range': true, + 'range-separator': '至', + 'start-placeholder': '开始时间', + 'end-placeholder': '结束时间', + format: 'HH:mm:ss', + 'value-format': 'HH:mm:ss', + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/time-picker' + }, + { + label: '日期选择', + tag: 'el-date-picker', + tagIcon: 'date', + placeholder: '请选择', + defaultValue: null, + type: 'date', + span: 24, + labelWidth: null, + style: { width: '100%' }, + disabled: false, + clearable: true, + required: true, + format: 'yyyy-MM-dd', + 'value-format': 'yyyy-MM-dd', + readonly: false, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/date-picker' + }, + { + label: '日期范围', + tag: 'el-date-picker', + tagIcon: 'date-range', + defaultValue: null, + span: 24, + labelWidth: null, + style: { width: '100%' }, + type: 'daterange', + 'range-separator': '至', + 'start-placeholder': '开始日期', + 'end-placeholder': '结束日期', + disabled: false, + clearable: true, + required: true, + format: 'yyyy-MM-dd', + 'value-format': 'yyyy-MM-dd', + readonly: false, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/date-picker' + }, + { + label: '评分', + tag: 'el-rate', + tagIcon: 'rate', + defaultValue: 0, + span: 24, + labelWidth: null, + style: {}, + max: 5, + 'allow-half': false, + 'show-text': false, + 'show-score': false, + disabled: false, + required: true, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/rate' + }, + { + label: '颜色选择', + tag: 'el-color-picker', + tagIcon: 'color', + defaultValue: null, + labelWidth: null, + 'show-alpha': false, + 'color-format': '', + disabled: false, + required: true, + size: 'medium', + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/color-picker' + }, + { + label: '上传', + tag: 'el-upload', + tagIcon: 'upload', + action: 'https://jsonplaceholder.typicode.com/posts/', + defaultValue: null, + labelWidth: null, + disabled: false, + required: true, + accept: '', + name: 'file', + 'auto-upload': true, + showTip: false, + buttonText: '点击上传', + fileSize: 2, + sizeUnit: 'MB', + 'list-type': 'text', + multiple: false, + regList: [], + changeTag: true, + document: 'https://element.eleme.cn/#/zh-CN/component/upload' + } +] + +export const layoutComponents = [ + { + layout: 'rowFormItem', + tagIcon: 'row', + type: 'default', + justify: 'start', + align: 'top', + label: '行容器', + layoutTree: true, + children: [], + document: 'https://element.eleme.cn/#/zh-CN/component/layout' + }, + { + layout: 'colFormItem', + label: '按钮', + changeTag: true, + labelWidth: null, + tag: 'el-button', + tagIcon: 'button', + span: 24, + default: '主要按钮', + type: 'primary', + icon: 'el-icon-search', + size: 'medium', + disabled: false, + document: 'https://element.eleme.cn/#/zh-CN/component/button' + } +] + +// 组件rule的触发方式,无触发方式的组件不生成rule +export const trigger = { + 'el-input': 'blur', + 'el-input-number': 'blur', + 'el-select': 'change', + 'el-radio-group': 'change', + 'el-checkbox-group': 'change', + 'el-cascader': 'change', + 'el-time-picker': 'change', + 'el-date-picker': 'change', + 'el-rate': 'change' +} diff --git a/src/utils/generator/css.js b/src/utils/generator/css.js new file mode 100644 index 0000000..c1c62e6 --- /dev/null +++ b/src/utils/generator/css.js @@ -0,0 +1,18 @@ +const styles = { + 'el-rate': '.el-rate{display: inline-block; vertical-align: text-top;}', + 'el-upload': '.el-upload__tip{line-height: 1.2;}' +} + +function addCss(cssList, el) { + const css = styles[el.tag] + css && cssList.indexOf(css) === -1 && cssList.push(css) + if (el.children) { + el.children.forEach(el2 => addCss(cssList, el2)) + } +} + +export function makeUpCss(conf) { + const cssList = [] + conf.fields.forEach(el => addCss(cssList, el)) + return cssList.join('\n') +} diff --git a/src/utils/generator/drawingDefault.js b/src/utils/generator/drawingDefault.js new file mode 100644 index 0000000..18017a2 --- /dev/null +++ b/src/utils/generator/drawingDefault.js @@ -0,0 +1,37 @@ +export const drawingDefaultValue = [] + +export function initDrawingDefaultValue() { + if (drawingDefaultValue.length === 0) { + drawingDefaultValue.push({ + layout: 'colFormItem', + tagIcon: 'input', + label: '手机号', + vModel: 'mobile', + formId: 6, + tag: 'el-input', + placeholder: '请输入手机号', + defaultValue: '', + span: 24, + style: {width: '100%'}, + clearable: true, + prepend: '', + append: '', + 'prefix-icon': 'el-icon-mobile', + 'suffix-icon': '', + maxlength: 11, + 'show-word-limit': true, + readonly: false, + disabled: false, + required: true, + changeTag: true, + regList: [{ + pattern: '/^1(3|4|5|7|8|9)\\d{9}$/', + message: '手机号格式错误' + }] + }) + } +} + +export function cleanDrawingDefaultValue() { + drawingDefaultValue.splice(0, drawingDefaultValue.length) +} diff --git a/src/utils/generator/html.js b/src/utils/generator/html.js new file mode 100644 index 0000000..3b3388d --- /dev/null +++ b/src/utils/generator/html.js @@ -0,0 +1,358 @@ +import { trigger } from './config' + +let confGlobal +let someSpanIsNot24 + +export function dialogWrapper(str) { + return ` + ${str} +
+ 取消 + 确定 +
+
` +} + +export function vueTemplate(str) { + return `` +} + +export function vueScript(str) { + return `` +} + +export function cssStyle(cssStr) { + return `` +} + +function buildFormTemplate(conf, child, type) { + let labelPosition = '' + if (conf.labelPosition !== 'right') { + labelPosition = `label-position="${conf.labelPosition}"` + } + const disabled = conf.disabled ? `:disabled="${conf.disabled}"` : '' + let str = ` + ${child} + ${buildFromBtns(conf, type)} + ` + if (someSpanIsNot24) { + str = ` + ${str} + ` + } + return str +} + +function buildFromBtns(conf, type) { + let str = '' + if (conf.formBtns && type === 'file') { + str = ` + 提交 + 重置 + ` + if (someSpanIsNot24) { + str = ` + ${str} + ` + } + } + return str +} + +// span不为24的用el-col包裹 +function colWrapper(element, str) { + if (someSpanIsNot24 || element.span !== 24) { + return ` + ${str} + ` + } + return str +} + +const layouts = { + colFormItem(element) { + let labelWidth = '' + if (element.labelWidth && element.labelWidth !== confGlobal.labelWidth) { + labelWidth = `label-width="${element.labelWidth}px"` + } + const required = !trigger[element.tag] && element.required ? 'required' : '' + const tagDom = tags[element.tag] ? tags[element.tag](element) : null + let str = ` + ${tagDom} + ` + str = colWrapper(element, str) + return str + }, + rowFormItem(element) { + const type = element.type === 'default' ? '' : `type="${element.type}"` + const justify = element.type === 'default' ? '' : `justify="${element.justify}"` + const align = element.type === 'default' ? '' : `align="${element.align}"` + const gutter = element.gutter ? `gutter="${element.gutter}"` : '' + const children = element.children.map(el => layouts[el.layout](el)) + let str = ` + ${children.join('\n')} + ` + str = colWrapper(element, str) + return str + } +} + +const tags = { + 'el-button': el => { + const { + tag, disabled + } = attrBuilder(el) + const type = el.type ? `type="${el.type}"` : '' + const icon = el.icon ? `icon="${el.icon}"` : '' + const size = el.size ? `size="${el.size}"` : '' + let child = buildElButtonChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${type} ${icon} ${size} ${disabled}>${child}` + }, + 'el-input': el => { + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const maxlength = el.maxlength ? `:maxlength="${el.maxlength}"` : '' + const showWordLimit = el['show-word-limit'] ? 'show-word-limit' : '' + const readonly = el.readonly ? 'readonly' : '' + const prefixIcon = el['prefix-icon'] ? `prefix-icon='${el['prefix-icon']}'` : '' + const suffixIcon = el['suffix-icon'] ? `suffix-icon='${el['suffix-icon']}'` : '' + const showPassword = el['show-password'] ? 'show-password' : '' + const type = el.type ? `type="${el.type}"` : '' + const autosize = el.autosize && el.autosize.minRows + ? `:autosize="{minRows: ${el.autosize.minRows}, maxRows: ${el.autosize.maxRows}}"` + : '' + let child = buildElInputChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${vModel} ${type} ${placeholder} ${maxlength} ${showWordLimit} ${readonly} ${disabled} ${clearable} ${prefixIcon} ${suffixIcon} ${showPassword} ${autosize} ${width}>${child}` + }, + 'el-input-number': el => { + const { disabled, vModel, placeholder } = attrBuilder(el) + const controlsPosition = el['controls-position'] ? `controls-position=${el['controls-position']}` : '' + const min = el.min ? `:min='${el.min}'` : '' + const max = el.max ? `:max='${el.max}'` : '' + const step = el.step ? `:step='${el.step}'` : '' + const stepStrictly = el['step-strictly'] ? 'step-strictly' : '' + const precision = el.precision ? `:precision='${el.precision}'` : '' + + return `<${el.tag} ${vModel} ${placeholder} ${step} ${stepStrictly} ${precision} ${controlsPosition} ${min} ${max} ${disabled}>` + }, + 'el-select': el => { + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const filterable = el.filterable ? 'filterable' : '' + const multiple = el.multiple ? 'multiple' : '' + let child = buildElSelectChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${vModel} ${placeholder} ${disabled} ${multiple} ${filterable} ${clearable} ${width}>${child}` + }, + 'el-radio-group': el => { + const { disabled, vModel } = attrBuilder(el) + const size = `size="${el.size}"` + let child = buildElRadioGroupChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${vModel} ${size} ${disabled}>${child}` + }, + 'el-checkbox-group': el => { + const { disabled, vModel } = attrBuilder(el) + const size = `size="${el.size}"` + const min = el.min ? `:min="${el.min}"` : '' + const max = el.max ? `:max="${el.max}"` : '' + let child = buildElCheckboxGroupChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${vModel} ${min} ${max} ${size} ${disabled}>${child}` + }, + 'el-switch': el => { + const { disabled, vModel } = attrBuilder(el) + const activeText = el['active-text'] ? `active-text="${el['active-text']}"` : '' + const inactiveText = el['inactive-text'] ? `inactive-text="${el['inactive-text']}"` : '' + const activeColor = el['active-color'] ? `active-color="${el['active-color']}"` : '' + const inactiveColor = el['inactive-color'] ? `inactive-color="${el['inactive-color']}"` : '' + const activeValue = el['active-value'] !== true ? `:active-value='${JSON.stringify(el['active-value'])}'` : '' + const inactiveValue = el['inactive-value'] !== false ? `:inactive-value='${JSON.stringify(el['inactive-value'])}'` : '' + + return `<${el.tag} ${vModel} ${activeText} ${inactiveText} ${activeColor} ${inactiveColor} ${activeValue} ${inactiveValue} ${disabled}>` + }, + 'el-cascader': el => { + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const options = el.options ? `:options="${el.vModel}Options"` : '' + const props = el.props ? `:props="${el.vModel}Props"` : '' + const showAllLevels = el['show-all-levels'] ? '' : ':show-all-levels="false"' + const filterable = el.filterable ? 'filterable' : '' + const separator = el.separator === '/' ? '' : `separator="${el.separator}"` + + return `<${el.tag} ${vModel} ${options} ${props} ${width} ${showAllLevels} ${placeholder} ${separator} ${filterable} ${clearable} ${disabled}>` + }, + 'el-slider': el => { + const { disabled, vModel } = attrBuilder(el) + const min = el.min ? `:min='${el.min}'` : '' + const max = el.max ? `:max='${el.max}'` : '' + const step = el.step ? `:step='${el.step}'` : '' + const range = el.range ? 'range' : '' + const showStops = el['show-stops'] ? `:show-stops="${el['show-stops']}"` : '' + + return `<${el.tag} ${min} ${max} ${step} ${vModel} ${range} ${showStops} ${disabled}>` + }, + 'el-time-picker': el => { + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const startPlaceholder = el['start-placeholder'] ? `start-placeholder="${el['start-placeholder']}"` : '' + const endPlaceholder = el['end-placeholder'] ? `end-placeholder="${el['end-placeholder']}"` : '' + const rangeSeparator = el['range-separator'] ? `range-separator="${el['range-separator']}"` : '' + const isRange = el['is-range'] ? 'is-range' : '' + const format = el.format ? `format="${el.format}"` : '' + const valueFormat = el['value-format'] ? `value-format="${el['value-format']}"` : '' + const pickerOptions = el['picker-options'] ? `:picker-options='${JSON.stringify(el['picker-options'])}'` : '' + + return `<${el.tag} ${vModel} ${isRange} ${format} ${valueFormat} ${pickerOptions} ${width} ${placeholder} ${startPlaceholder} ${endPlaceholder} ${rangeSeparator} ${clearable} ${disabled}>` + }, + 'el-date-picker': el => { + const { + disabled, vModel, clearable, placeholder, width + } = attrBuilder(el) + const startPlaceholder = el['start-placeholder'] ? `start-placeholder="${el['start-placeholder']}"` : '' + const endPlaceholder = el['end-placeholder'] ? `end-placeholder="${el['end-placeholder']}"` : '' + const rangeSeparator = el['range-separator'] ? `range-separator="${el['range-separator']}"` : '' + const format = el.format ? `format="${el.format}"` : '' + const valueFormat = el['value-format'] ? `value-format="${el['value-format']}"` : '' + const type = el.type === 'date' ? '' : `type="${el.type}"` + const readonly = el.readonly ? 'readonly' : '' + + return `<${el.tag} ${type} ${vModel} ${format} ${valueFormat} ${width} ${placeholder} ${startPlaceholder} ${endPlaceholder} ${rangeSeparator} ${clearable} ${readonly} ${disabled}>` + }, + 'el-rate': el => { + const { disabled, vModel } = attrBuilder(el) + const max = el.max ? `:max='${el.max}'` : '' + const allowHalf = el['allow-half'] ? 'allow-half' : '' + const showText = el['show-text'] ? 'show-text' : '' + const showScore = el['show-score'] ? 'show-score' : '' + + return `<${el.tag} ${vModel} ${allowHalf} ${showText} ${showScore} ${disabled}>` + }, + 'el-color-picker': el => { + const { disabled, vModel } = attrBuilder(el) + const size = `size="${el.size}"` + const showAlpha = el['show-alpha'] ? 'show-alpha' : '' + const colorFormat = el['color-format'] ? `color-format="${el['color-format']}"` : '' + + return `<${el.tag} ${vModel} ${size} ${showAlpha} ${colorFormat} ${disabled}>` + }, + 'el-upload': el => { + const disabled = el.disabled ? ':disabled=\'true\'' : '' + const action = el.action ? `:action="${el.vModel}Action"` : '' + const multiple = el.multiple ? 'multiple' : '' + const listType = el['list-type'] !== 'text' ? `list-type="${el['list-type']}"` : '' + const accept = el.accept ? `accept="${el.accept}"` : '' + const name = el.name !== 'file' ? `name="${el.name}"` : '' + const autoUpload = el['auto-upload'] === false ? ':auto-upload="false"' : '' + const beforeUpload = `:before-upload="${el.vModel}BeforeUpload"` + const fileList = `:file-list="${el.vModel}fileList"` + const ref = `ref="${el.vModel}"` + let child = buildElUploadChild(el) + + if (child) child = `\n${child}\n` // 换行 + return `<${el.tag} ${ref} ${fileList} ${action} ${autoUpload} ${multiple} ${beforeUpload} ${listType} ${accept} ${name} ${disabled}>${child}` + } +} + +function attrBuilder(el) { + return { + vModel: `v-model="${confGlobal.formModel}.${el.vModel}"`, + clearable: el.clearable ? 'clearable' : '', + placeholder: el.placeholder ? `placeholder="${el.placeholder}"` : '', + width: el.style && el.style.width ? ':style="{width: \'100%\'}"' : '', + disabled: el.disabled ? ':disabled=\'true\'' : '' + } +} + +// el-buttin 子级 +function buildElButtonChild(conf) { + const children = [] + if (conf.default) { + children.push(conf.default) + } + return children.join('\n') +} + +// el-input innerHTML +function buildElInputChild(conf) { + const children = [] + if (conf.prepend) { + children.push(``) + } + if (conf.append) { + children.push(``) + } + return children.join('\n') +} + +function buildElSelectChild(conf) { + const children = [] + if (conf.options && conf.options.length) { + children.push(``) + } + return children.join('\n') +} + +function buildElRadioGroupChild(conf) { + const children = [] + if (conf.options && conf.options.length) { + const tag = conf.optionType === 'button' ? 'el-radio-button' : 'el-radio' + const border = conf.border ? 'border' : '' + children.push(`<${tag} v-for="(item, index) in ${conf.vModel}Options" :key="index" :label="item.value" :disabled="item.disabled" ${border}>{{item.label}}`) + } + return children.join('\n') +} + +function buildElCheckboxGroupChild(conf) { + const children = [] + if (conf.options && conf.options.length) { + const tag = conf.optionType === 'button' ? 'el-checkbox-button' : 'el-checkbox' + const border = conf.border ? 'border' : '' + children.push(`<${tag} v-for="(item, index) in ${conf.vModel}Options" :key="index" :label="item.value" :disabled="item.disabled" ${border}>{{item.label}}`) + } + return children.join('\n') +} + +function buildElUploadChild(conf) { + const list = [] + if (conf['list-type'] === 'picture-card') list.push('') + else list.push(`${conf.buttonText}`) + if (conf.showTip) list.push(`
只能上传不超过 ${conf.fileSize}${conf.sizeUnit} 的${conf.accept}文件
`) + return list.join('\n') +} + +export function makeUpHtml(conf, type) { + const htmlList = [] + confGlobal = conf + someSpanIsNot24 = conf.fields.some(item => item.span !== 24) + conf.fields.forEach(el => { + htmlList.push(layouts[el.layout](el)) + }) + const htmlStr = htmlList.join('\n') + + let temp = buildFormTemplate(conf, htmlStr, type) + if (type === 'dialog') { + temp = dialogWrapper(temp) + } + confGlobal = null + return temp +} diff --git a/src/utils/generator/icon.json b/src/utils/generator/icon.json new file mode 100644 index 0000000..2d9999a --- /dev/null +++ b/src/utils/generator/icon.json @@ -0,0 +1 @@ +["platform-eleme","eleme","delete-solid","delete","s-tools","setting","user-solid","user","phone","phone-outline","more","more-outline","star-on","star-off","s-goods","goods","warning","warning-outline","question","info","remove","circle-plus","success","error","zoom-in","zoom-out","remove-outline","circle-plus-outline","circle-check","circle-close","s-help","help","minus","plus","check","close","picture","picture-outline","picture-outline-round","upload","upload2","download","camera-solid","camera","video-camera-solid","video-camera","message-solid","bell","s-cooperation","s-order","s-platform","s-fold","s-unfold","s-operation","s-promotion","s-home","s-release","s-ticket","s-management","s-open","s-shop","s-marketing","s-flag","s-comment","s-finance","s-claim","s-custom","s-opportunity","s-data","s-check","s-grid","menu","share","d-caret","caret-left","caret-right","caret-bottom","caret-top","bottom-left","bottom-right","back","right","bottom","top","top-left","top-right","arrow-left","arrow-right","arrow-down","arrow-up","d-arrow-left","d-arrow-right","video-pause","video-play","refresh","refresh-right","refresh-left","finished","sort","sort-up","sort-down","rank","loading","view","c-scale-to-original","date","edit","edit-outline","folder","folder-opened","folder-add","folder-remove","folder-delete","folder-checked","tickets","document-remove","document-delete","document-copy","document-checked","document","document-add","printer","paperclip","takeaway-box","search","monitor","attract","mobile","scissors","umbrella","headset","brush","mouse","coordinate","magic-stick","reading","data-line","data-board","pie-chart","data-analysis","collection-tag","film","suitcase","suitcase-1","receiving","collection","files","notebook-1","notebook-2","toilet-paper","office-building","school","table-lamp","house","no-smoking","smoking","shopping-cart-full","shopping-cart-1","shopping-cart-2","shopping-bag-1","shopping-bag-2","sold-out","sell","present","box","bank-card","money","coin","wallet","discount","price-tag","news","guide","male","female","thumb","cpu","link","connection","open","turn-off","set-up","chat-round","chat-line-round","chat-square","chat-dot-round","chat-dot-square","chat-line-square","message","postcard","position","turn-off-microphone","microphone","close-notification","bangzhu","time","odometer","crop","aim","switch-button","full-screen","copy-document","mic","stopwatch","medal-1","medal","trophy","trophy-1","first-aid-kit","discover","place","location","location-outline","location-information","add-location","delete-location","map-location","alarm-clock","timer","watch-1","watch","lock","unlock","key","service","mobile-phone","bicycle","truck","ship","basketball","football","soccer","baseball","wind-power","light-rain","lightning","heavy-rain","sunrise","sunrise-1","sunset","sunny","cloudy","partly-cloudy","cloudy-and-sunny","moon","moon-night","dish","dish-1","food","chicken","fork-spoon","knife-fork","burger","tableware","sugar","dessert","ice-cream","hot-water","water-cup","coffee-cup","cold-drink","goblet","goblet-full","goblet-square","goblet-square-full","refrigerator","grape","watermelon","cherry","apple","pear","orange","coffee","ice-tea","ice-drink","milk-tea","potato-strips","lollipop","ice-cream-square","ice-cream-round"] \ No newline at end of file diff --git a/src/utils/generator/js.js b/src/utils/generator/js.js new file mode 100644 index 0000000..ee8668d --- /dev/null +++ b/src/utils/generator/js.js @@ -0,0 +1,235 @@ +import { exportDefault, titleCase } from '@/utils/index' +import { trigger } from './config' + +const units = { + KB: '1024', + MB: '1024 / 1024', + GB: '1024 / 1024 / 1024' +} +let confGlobal +const inheritAttrs = { + file: '', + dialog: 'inheritAttrs: false,' +} + + +export function makeUpJs(conf, type) { + confGlobal = conf = JSON.parse(JSON.stringify(conf)) + const dataList = [] + const ruleList = [] + const optionsList = [] + const propsList = [] + const methodList = mixinMethod(type) + const uploadVarList = [] + + conf.fields.forEach(el => { + buildAttributes(el, dataList, ruleList, optionsList, methodList, propsList, uploadVarList) + }) + + const script = buildexport( + conf, + type, + dataList.join('\n'), + ruleList.join('\n'), + optionsList.join('\n'), + uploadVarList.join('\n'), + propsList.join('\n'), + methodList.join('\n') + ) + confGlobal = null + return script +} + +function buildAttributes(el, dataList, ruleList, optionsList, methodList, propsList, uploadVarList) { + buildData(el, dataList) + buildRules(el, ruleList) + + if (el.options && el.options.length) { + buildOptions(el, optionsList) + if (el.dataType === 'dynamic') { + const model = `${el.vModel}Options` + const options = titleCase(model) + buildOptionMethod(`get${options}`, model, methodList) + } + } + + if (el.props && el.props.props) { + buildProps(el, propsList) + } + + if (el.action && el.tag === 'el-upload') { + uploadVarList.push( + `${el.vModel}Action: '${el.action}', + ${el.vModel}fileList: [],` + ) + methodList.push(buildBeforeUpload(el)) + if (!el['auto-upload']) { + methodList.push(buildSubmitUpload(el)) + } + } + + if (el.children) { + el.children.forEach(el2 => { + buildAttributes(el2, dataList, ruleList, optionsList, methodList, propsList, uploadVarList) + }) + } +} + +function mixinMethod(type) { + const list = []; const + minxins = { + file: confGlobal.formBtns ? { + submitForm: `submitForm() { + this.$refs['${confGlobal.formRef}'].validate(valid => { + if(!valid) return + // TODO 提交表单 + }) + },`, + resetForm: `resetForm() { + this.$refs['${confGlobal.formRef}'].resetFields() + },` + } : null, + dialog: { + onOpen: 'onOpen() {},', + onClose: `onClose() { + this.$refs['${confGlobal.formRef}'].resetFields() + },`, + close: `close() { + this.$emit('update:visible', false) + },`, + handleConfirm: `handleConfirm() { + this.$refs['${confGlobal.formRef}'].validate(valid => { + if(!valid) return + this.close() + }) + },` + } + } + + const methods = minxins[type] + if (methods) { + Object.keys(methods).forEach(key => { + list.push(methods[key]) + }) + } + + return list +} + +function buildData(conf, dataList) { + if (conf.vModel === undefined) return + let defaultValue + if (typeof (conf.defaultValue) === 'string' && !conf.multiple) { + defaultValue = `'${conf.defaultValue}'` + } else { + defaultValue = `${JSON.stringify(conf.defaultValue)}` + } + dataList.push(`${conf.vModel}: ${defaultValue},`) +} + +function buildRules(conf, ruleList) { + if (conf.vModel === undefined) return + const rules = [] + if (trigger[conf.tag]) { + if (conf.required) { + const type = Array.isArray(conf.defaultValue) ? 'type: \'array\',' : '' + let message = Array.isArray(conf.defaultValue) ? `请至少选择一个${conf.vModel}` : conf.placeholder + if (message === undefined) message = `${conf.label}不能为空` + rules.push(`{ required: true, ${type} message: '${message}', trigger: '${trigger[conf.tag]}' }`) + } + if (conf.regList && Array.isArray(conf.regList)) { + conf.regList.forEach(item => { + if (item.pattern) { + rules.push(`{ pattern: ${eval(item.pattern)}, message: '${item.message}', trigger: '${trigger[conf.tag]}' }`) + } + }) + } + ruleList.push(`${conf.vModel}: [${rules.join(',')}],`) + } +} + +function buildOptions(conf, optionsList) { + if (conf.vModel === undefined) return + if (conf.dataType === 'dynamic') { conf.options = [] } + const str = `${conf.vModel}Options: ${JSON.stringify(conf.options)},` + optionsList.push(str) +} + +function buildProps(conf, propsList) { + if (conf.dataType === 'dynamic') { + conf.valueKey !== 'value' && (conf.props.props.value = conf.valueKey) + conf.labelKey !== 'label' && (conf.props.props.label = conf.labelKey) + conf.childrenKey !== 'children' && (conf.props.props.children = conf.childrenKey) + } + const str = `${conf.vModel}Props: ${JSON.stringify(conf.props.props)},` + propsList.push(str) +} + +function buildBeforeUpload(conf) { + const unitNum = units[conf.sizeUnit]; let rightSizeCode = ''; let acceptCode = ''; const + returnList = [] + if (conf.fileSize) { + rightSizeCode = `let isRightSize = file.size / ${unitNum} < ${conf.fileSize} + if(!isRightSize){ + this.$message.error('文件大小超过 ${conf.fileSize}${conf.sizeUnit}') + }` + returnList.push('isRightSize') + } + if (conf.accept) { + acceptCode = `let isAccept = new RegExp('${conf.accept}').test(file.type) + if(!isAccept){ + this.$message.error('应该选择${conf.accept}类型的文件') + }` + returnList.push('isAccept') + } + const str = `${conf.vModel}BeforeUpload(file) { + ${rightSizeCode} + ${acceptCode} + return ${returnList.join('&&')} + },` + return returnList.length ? str : '' +} + +function buildSubmitUpload(conf) { + const str = `submitUpload() { + this.$refs['${conf.vModel}'].submit() + },` + return str +} + +function buildOptionMethod(methodName, model, methodList) { + const str = `${methodName}() { + // TODO 发起请求获取数据 + this.${model} + },` + methodList.push(str) +} + +function buildexport(conf, type, data, rules, selectOptions, uploadVar, props, methods) { + const str = `${exportDefault}{ + ${inheritAttrs[type]} + components: {}, + props: [], + data () { + return { + ${conf.formModel}: { + ${data} + }, + ${conf.formRules}: { + ${rules} + }, + ${uploadVar} + ${selectOptions} + ${props} + } + }, + computed: {}, + watch: {}, + created () {}, + mounted () {}, + methods: { + ${methods} + } +}` + return str +} diff --git a/src/utils/generator/render.js b/src/utils/generator/render.js new file mode 100644 index 0000000..e8640f0 --- /dev/null +++ b/src/utils/generator/render.js @@ -0,0 +1,126 @@ +import { makeMap } from '@/utils/index' + +// 参考https://github.com/vuejs/vue/blob/v2.6.10/src/platforms/web/server/util.js +const isAttr = makeMap( + 'accept,accept-charset,accesskey,action,align,alt,async,autocomplete,' + + 'autofocus,autoplay,autosave,bgcolor,border,buffered,challenge,charset,' + + 'checked,cite,class,code,codebase,color,cols,colspan,content,http-equiv,' + + 'name,contenteditable,contextmenu,controls,coords,data,datetime,default,' + + 'defer,dir,dirname,disabled,download,draggable,dropzone,enctype,method,for,' + + 'form,formaction,headers,height,hidden,high,href,hreflang,http-equiv,' + + 'icon,id,ismap,itemprop,keytype,kind,label,lang,language,list,loop,low,' + + 'manifest,max,maxlength,media,method,GET,POST,min,multiple,email,file,' + + 'muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,' + + 'preload,radiogroup,readonly,rel,required,reversed,rows,rowspan,sandbox,' + + 'scope,scoped,seamless,selected,shape,size,type,text,password,sizes,span,' + + 'spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,' + + 'target,title,type,usemap,value,width,wrap' +) + +function vModel(self, dataObject, defaultValue) { + dataObject.props.value = defaultValue + + dataObject.on.input = val => { + self.$emit('input', val) + } +} + +const componentChild = { + 'el-button': { + default(h, conf, key) { + return conf[key] + }, + }, + 'el-input': { + prepend(h, conf, key) { + return + }, + append(h, conf, key) { + return + } + }, + 'el-select': { + options(h, conf, key) { + const list = [] + conf.options.forEach(item => { + list.push() + }) + return list + } + }, + 'el-radio-group': { + options(h, conf, key) { + const list = [] + conf.options.forEach(item => { + if (conf.optionType === 'button') list.push({item.label}) + else list.push({item.label}) + }) + return list + } + }, + 'el-checkbox-group': { + options(h, conf, key) { + const list = [] + conf.options.forEach(item => { + if (conf.optionType === 'button') { + list.push({item.label}) + } else { + list.push({item.label}) + } + }) + return list + } + }, + 'el-upload': { + 'list-type': (h, conf, key) => { + const list = [] + if (conf['list-type'] === 'picture-card') { + list.push() + } else { + list.push({conf.buttonText}) + } + if (conf.showTip) { + list.push(
只能上传不超过 {conf.fileSize}{conf.sizeUnit} 的{conf.accept}文件
) + } + return list + } + } +} + +export default { + render(h) { + const dataObject = { + attrs: {}, + props: {}, + on: {}, + style: {} + } + const confClone = JSON.parse(JSON.stringify(this.conf)) + const children = [] + + const childObjs = componentChild[confClone.tag] + if (childObjs) { + Object.keys(childObjs).forEach(key => { + const childFunc = childObjs[key] + if (confClone[key]) { + children.push(childFunc(h, confClone, key)) + } + }) + } + + Object.keys(confClone).forEach(key => { + const val = confClone[key] + if (key === 'vModel') { + vModel(this, dataObject, confClone.defaultValue) + } else if (dataObject[key]) { + dataObject[key] = val + } else if (!isAttr(key)) { + dataObject.props[key] = val + } else { + dataObject.attrs[key] = val + } + }) + return h(this.conf.tag, dataObject, children) + }, + props: ['conf'] +} diff --git a/src/utils/index.js b/src/utils/index.js new file mode 100644 index 0000000..9375db7 --- /dev/null +++ b/src/utils/index.js @@ -0,0 +1,390 @@ +import { parseTime } from './ruoyi' + +/** + * 表格时间格式化 + */ +export function formatDate(cellValue) { + if (cellValue == null || cellValue == "") return "" + var date = new Date(cellValue) + var year = date.getFullYear() + var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 + var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() + var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() + var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() + var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds() + return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds +} + +/** + * @param {number} time + * @param {string} option + * @returns {string} + */ +export function formatTime(time, option) { + if (('' + time).length === 10) { + time = parseInt(time) * 1000 + } else { + time = +time + } + const d = new Date(time) + const now = Date.now() + + const diff = (now - d) / 1000 + + if (diff < 30) { + return '刚刚' + } else if (diff < 3600) { + // less 1 hour + return Math.ceil(diff / 60) + '分钟前' + } else if (diff < 3600 * 24) { + return Math.ceil(diff / 3600) + '小时前' + } else if (diff < 3600 * 24 * 2) { + return '1天前' + } + if (option) { + return parseTime(time, option) + } else { + return ( + d.getMonth() + + 1 + + '月' + + d.getDate() + + '日' + + d.getHours() + + '时' + + d.getMinutes() + + '分' + ) + } +} + +/** + * @param {string} url + * @returns {Object} + */ +export function getQueryObject(url) { + url = url == null ? window.location.href : url + const search = url.substring(url.lastIndexOf('?') + 1) + const obj = {} + const reg = /([^?&=]+)=([^?&=]*)/g + search.replace(reg, (rs, $1, $2) => { + const name = decodeURIComponent($1) + let val = decodeURIComponent($2) + val = String(val) + obj[name] = val + return rs + }) + return obj +} + +/** + * @param {string} input value + * @returns {number} output value + */ +export function byteLength(str) { + // returns the byte length of an utf8 string + let s = str.length + for (var i = str.length - 1; i >= 0; i--) { + const code = str.charCodeAt(i) + if (code > 0x7f && code <= 0x7ff) s++ + else if (code > 0x7ff && code <= 0xffff) s += 2 + if (code >= 0xDC00 && code <= 0xDFFF) i-- + } + return s +} + +/** + * @param {Array} actual + * @returns {Array} + */ +export function cleanArray(actual) { + const newArray = [] + for (let i = 0; i < actual.length; i++) { + if (actual[i]) { + newArray.push(actual[i]) + } + } + return newArray +} + +/** + * @param {Object} json + * @returns {Array} + */ +export function param(json) { + if (!json) return '' + return cleanArray( + Object.keys(json).map(key => { + if (json[key] === undefined) return '' + return encodeURIComponent(key) + '=' + encodeURIComponent(json[key]) + }) + ).join('&') +} + +/** + * @param {string} url + * @returns {Object} + */ +export function param2Obj(url) { + const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') + if (!search) { + return {} + } + const obj = {} + const searchArr = search.split('&') + searchArr.forEach(v => { + const index = v.indexOf('=') + if (index !== -1) { + const name = v.substring(0, index) + const val = v.substring(index + 1, v.length) + obj[name] = val + } + }) + return obj +} + +/** + * @param {string} val + * @returns {string} + */ +export function html2Text(val) { + const div = document.createElement('div') + div.innerHTML = val + return div.textContent || div.innerText +} + +/** + * Merges two objects, giving the last one precedence + * @param {Object} target + * @param {(Object|Array)} source + * @returns {Object} + */ +export function objectMerge(target, source) { + if (typeof target !== 'object') { + target = {} + } + if (Array.isArray(source)) { + return source.slice() + } + Object.keys(source).forEach(property => { + const sourceProperty = source[property] + if (typeof sourceProperty === 'object') { + target[property] = objectMerge(target[property], sourceProperty) + } else { + target[property] = sourceProperty + } + }) + return target +} + +/** + * @param {HTMLElement} element + * @param {string} className + */ +export function toggleClass(element, className) { + if (!element || !className) { + return + } + let classString = element.className + const nameIndex = classString.indexOf(className) + if (nameIndex === -1) { + classString += '' + className + } else { + classString = + classString.substr(0, nameIndex) + + classString.substr(nameIndex + className.length) + } + element.className = classString +} + +/** + * @param {string} type + * @returns {Date} + */ +export function getTime(type) { + if (type === 'start') { + return new Date().getTime() - 3600 * 1000 * 24 * 90 + } else { + return new Date(new Date().toDateString()) + } +} + +/** + * @param {Function} func + * @param {number} wait + * @param {boolean} immediate + * @return {*} + */ +export function debounce(func, wait, immediate) { + let timeout, args, context, timestamp, result + + const later = function() { + // 据上一次触发时间间隔 + const last = +new Date() - timestamp + + // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait + if (last < wait && last > 0) { + timeout = setTimeout(later, wait - last) + } else { + timeout = null + // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用 + if (!immediate) { + result = func.apply(context, args) + if (!timeout) context = args = null + } + } + } + + return function(...args) { + context = this + timestamp = +new Date() + const callNow = immediate && !timeout + // 如果延时不存在,重新设定延时 + if (!timeout) timeout = setTimeout(later, wait) + if (callNow) { + result = func.apply(context, args) + context = args = null + } + + return result + } +} + +/** + * This is just a simple version of deep copy + * Has a lot of edge cases bug + * If you want to use a perfect deep copy, use lodash's _.cloneDeep + * @param {Object} source + * @returns {Object} + */ +export function deepClone(source) { + if (!source && typeof source !== 'object') { + throw new Error('error arguments', 'deepClone') + } + const targetObj = source.constructor === Array ? [] : {} + Object.keys(source).forEach(keys => { + if (source[keys] && typeof source[keys] === 'object') { + targetObj[keys] = deepClone(source[keys]) + } else { + targetObj[keys] = source[keys] + } + }) + return targetObj +} + +/** + * @param {Array} arr + * @returns {Array} + */ +export function uniqueArr(arr) { + return Array.from(new Set(arr)) +} + +/** + * @returns {string} + */ +export function createUniqueString() { + const timestamp = +new Date() + '' + const randomNum = parseInt((1 + Math.random()) * 65536) + '' + return (+(randomNum + timestamp)).toString(32) +} + +/** + * Check if an element has a class + * @param {HTMLElement} elm + * @param {string} cls + * @returns {boolean} + */ +export function hasClass(ele, cls) { + return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')) +} + +/** + * Add class to element + * @param {HTMLElement} elm + * @param {string} cls + */ +export function addClass(ele, cls) { + if (!hasClass(ele, cls)) ele.className += ' ' + cls +} + +/** + * Remove class from element + * @param {HTMLElement} elm + * @param {string} cls + */ +export function removeClass(ele, cls) { + if (hasClass(ele, cls)) { + const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)') + ele.className = ele.className.replace(reg, ' ') + } +} + +export function makeMap(str, expectsLowerCase) { + const map = Object.create(null) + const list = str.split(',') + for (let i = 0; i < list.length; i++) { + map[list[i]] = true + } + return expectsLowerCase + ? val => map[val.toLowerCase()] + : val => map[val] +} + +export const exportDefault = 'export default ' + +export const beautifierConf = { + html: { + indent_size: '2', + indent_char: ' ', + max_preserve_newlines: '-1', + preserve_newlines: false, + keep_array_indentation: false, + break_chained_methods: false, + indent_scripts: 'separate', + brace_style: 'end-expand', + space_before_conditional: true, + unescape_strings: false, + jslint_happy: false, + end_with_newline: true, + wrap_line_length: '110', + indent_inner_html: true, + comma_first: false, + e4x: true, + indent_empty_lines: true + }, + js: { + indent_size: '2', + indent_char: ' ', + max_preserve_newlines: '-1', + preserve_newlines: false, + keep_array_indentation: false, + break_chained_methods: false, + indent_scripts: 'normal', + brace_style: 'end-expand', + space_before_conditional: true, + unescape_strings: false, + jslint_happy: true, + end_with_newline: true, + wrap_line_length: '110', + indent_inner_html: true, + comma_first: false, + e4x: true, + indent_empty_lines: true + } +} + +// 首字母大小 +export function titleCase(str) { + return str.replace(/( |^)[a-z]/g, L => L.toUpperCase()) +} + +// 下划转驼峰 +export function camelCase(str) { + return str.replace(/_[a-z]/g, str1 => str1.substr(-1).toUpperCase()) +} + +export function isNumberStr(str) { + return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str) +} + diff --git a/src/utils/jsencrypt.js b/src/utils/jsencrypt.js new file mode 100644 index 0000000..78d9523 --- /dev/null +++ b/src/utils/jsencrypt.js @@ -0,0 +1,30 @@ +import JSEncrypt from 'jsencrypt/bin/jsencrypt.min' + +// 密钥对生成 http://web.chacuo.net/netrsakeypair + +const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKoR8mX0rGKLqzcWmOzbfj64K8ZIgOdH\n' + + 'nzkXSOVOZbFu/TJhZ7rFAN+eaGkl3C4buccQd/EjEsj9ir7ijT7h96MCAwEAAQ==' + +const privateKey = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY\n' + + '7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKN\n' + + 'PuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gA\n' + + 'kM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWow\n' + + 'cSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99Ecv\n' + + 'DQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthh\n' + + 'YhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3\n' + + 'UP8iWi1Qw0Y=' + +// 加密 +export function encrypt(txt) { + const encryptor = new JSEncrypt() + encryptor.setPublicKey(publicKey) // 设置公钥 + return encryptor.encrypt(txt) // 对数据进行加密 +} + +// 解密 +export function decrypt(txt) { + const encryptor = new JSEncrypt() + encryptor.setPrivateKey(privateKey) // 设置私钥 + return encryptor.decrypt(txt) // 对数据进行解密 +} + diff --git a/src/utils/passwordRule.js b/src/utils/passwordRule.js new file mode 100644 index 0000000..dd56f81 --- /dev/null +++ b/src/utils/passwordRule.js @@ -0,0 +1,71 @@ +/** + * 密码强度规则 + * 根据参数 chrtype 动态生成校验规则 + * + * chrtype 说明: + * 0 - 任意字符(默认) + * 1 - 纯数字(0-9) + * 2 - 纯字母(a-z / A-Z) + * 3 - 字母 + 数字(必须同时包含) + * 4 - 字母 + 数字 + 特殊字符(必须同时包含,特殊字符:~!@#$%^&*()-=_+) + */ +import cache from '@/plugins/cache' + +// 各类型对应的正则、错误提示 +const PWD_RULES = { + '0': { pattern: /^[^<>"'|\\]+$/, message: '密码不能包含非法字符:< > " \' \\ |' }, + '1': { pattern: /^[0-9]+$/, message: '密码只能为数字(0-9)' }, + '2': { pattern: /^[a-zA-Z]+$/, message: '密码只能为英文字母(a-z、A-Z)' }, + '3': { pattern: /^(?=.*[a-zA-Z])(?=.*[0-9])[a-zA-Z0-9]+$/, message: '密码必须同时包含字母和数字' }, + '4': { pattern: /^(?=.*[A-Za-z])(?=.*\d)(?=.*[~!@#$%^&*()\-=_+])[A-Za-z\d~!@#$%^&*()\-=_+]+$/, message: '密码必须同时包含字母、数字和特殊字符(~!@#$%^&*()-=_+)' } +} + +export default { + data() { + return { + // 密码限制类型 + pwdChrType: cache.session.get('pwrChrtype') || '0' + } + }, + computed: { + // 默认密码校验 + pwdValidator() { + const rule = PWD_RULES[this.pwdChrType] || PWD_RULES['0'] + return [ + { required: true, message: '密码不能为空', trigger: 'blur' }, + { min: 6, max: 20, message: '密码长度必须介于 6 和 20 之间', trigger: 'blur' }, + { pattern: rule.pattern, message: rule.message, trigger: 'blur' } + ] + }, + // 校验prompt的inputValidator函数 + pwdPromptValidator() { + const rule = PWD_RULES['0'] + return (value) => { + if (!value || value.length < 6 || value.length > 20) { + return '密码长度必须介于 6 和 20 之间' + } + if (!rule.pattern.test(value)) { + return rule.message + } + } + }, + // 个人中心密码校验 + infoPwdValidator() { + const rule = PWD_RULES[this.pwdChrType] || PWD_RULES['0'] + return [ + { required: true, message: '新密码不能为空', trigger: 'blur' }, + { min: 6, max: 20, message: '新密码长度必须介于 6 和 20 之间', trigger: 'blur' }, + { pattern: rule.pattern, message: rule.message, trigger: 'blur' } + ] + }, + // 注册页面密码校验 + registerPwdValidator() { + const rule = PWD_RULES['0'] + return [ + { required: true, message: '请输入您的密码', trigger: 'blur' }, + { min: 6, max: 20, message: '用户密码长度必须介于 6 和 20 之间', trigger: 'blur' }, + { pattern: rule.pattern, message: rule.message, trigger: 'blur' } + ] + } + } +} diff --git a/src/utils/permission.js b/src/utils/permission.js new file mode 100644 index 0000000..0263bbc --- /dev/null +++ b/src/utils/permission.js @@ -0,0 +1,47 @@ +import store from '@/store' + +/** + * 字符权限校验 + * @param {Array} value 校验值 + * @returns {Boolean} + */ +export function checkPermi(value) { + if (value && value instanceof Array && value.length > 0) { + const permissions = store.getters && store.getters.permissions + const permissionDatas = value + const all_permission = "*:*:*" + + const hasPermission = permissions.some(permission => { + return all_permission === permission || permissionDatas.includes(permission) + }) + + return hasPermission + + } else { + console.error(`need roles! Like checkPermi="['system:user:add','system:user:edit']"`) + return false + } +} + +/** + * 角色权限校验 + * @param {Array} value 校验值 + * @returns {Boolean} + */ +export function checkRole(value) { + if (value && value instanceof Array && value.length > 0) { + const roles = store.getters && store.getters.roles + const permissionRoles = value + const super_admin = "admin" + + const hasRole = roles.some(role => { + return super_admin === role || permissionRoles.includes(role) + }) + + return hasRole + + } else { + console.error(`need roles! Like checkRole="['admin','editor']"`) + return false + } +} \ No newline at end of file diff --git a/src/utils/request.js b/src/utils/request.js new file mode 100644 index 0000000..8695801 --- /dev/null +++ b/src/utils/request.js @@ -0,0 +1,153 @@ +import axios from 'axios' +import { Notification, MessageBox, Message, Loading } from 'element-ui' +import store from '@/store' +import { getToken } from '@/utils/auth' +import errorCode from '@/utils/errorCode' +import { tansParams, blobValidate } from "@/utils/ruoyi" +import cache from '@/plugins/cache' +import { saveAs } from 'file-saver' + +let downloadLoadingInstance +// 是否显示重新登录 +export let isRelogin = { show: false } + +axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' +// 创建axios实例 +const service = axios.create({ + // axios中请求配置有baseURL选项,表示请求URL公共部分 + baseURL: process.env.VUE_APP_BASE_API, + // 超时 + timeout: 10000 +}) + +// request拦截器 +service.interceptors.request.use(config => { + // 是否需要设置 token + const isToken = (config.headers || {}).isToken === false + // 是否需要防止数据重复提交 + const isRepeatSubmit = (config.headers || {}).repeatSubmit === false + // 间隔时间(ms),小于此时间视为重复提交 + const interval = (config.headers || {}).interval || 1000 + if (getToken() && !isToken) { + config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改 + } + // get请求映射params参数 + if (config.method === 'get' && config.params) { + let url = config.url + '?' + tansParams(config.params) + url = url.slice(0, -1) + config.params = {} + config.url = url + } + if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) { + const requestObj = { + url: config.url, + data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data, + time: new Date().getTime() + } + const requestSize = Object.keys(JSON.stringify(requestObj)).length // 请求数据大小 + const limitSize = 5 * 1024 * 1024 // 限制存放数据5M + if (requestSize >= limitSize) { + console.warn(`[${config.url}]: ` + '请求数据大小超出允许的5M限制,无法进行防重复提交验证。') + return config + } + const sessionObj = cache.session.getJSON('sessionObj') + if (sessionObj === undefined || sessionObj === null || sessionObj === '') { + cache.session.setJSON('sessionObj', requestObj) + } else { + const s_url = sessionObj.url // 请求地址 + const s_data = sessionObj.data // 请求数据 + const s_time = sessionObj.time // 请求时间 + if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { + const message = '数据正在处理,请勿重复提交' + console.warn(`[${s_url}]: ` + message) + return Promise.reject(new Error(message)) + } else { + cache.session.setJSON('sessionObj', requestObj) + } + } + } + return config +}, error => { + console.log(error) + Promise.reject(error) +}) + +// 响应拦截器 +service.interceptors.response.use(res => { + // 未设置状态码则默认成功状态 + const code = res.data.code || 200 + // 获取错误信息 + const msg = errorCode[code] || res.data.msg || errorCode['default'] + // 二进制数据则直接返回 + if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { + return res.data + } + if (code === 401) { + if (!isRelogin.show) { + isRelogin.show = true + MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { + isRelogin.show = false + store.dispatch('LogOut').then(() => { + location.href = '/index' + }) + }).catch(() => { + isRelogin.show = false + }) + } + return Promise.reject('无效的会话,或者会话已过期,请重新登录。') + } else if (code === 500) { + Message({ message: msg, type: 'error' }) + return Promise.reject(new Error(msg)) + } else if (code === 601) { + Message({ message: msg, type: 'warning' }) + return Promise.reject('error') + } else if (code !== 200) { + Notification.error({ title: msg }) + return Promise.reject('error') + } else { + return res.data + } + }, + error => { + console.log('err' + error) + let { message } = error + if (message == "Network Error") { + message = "后端接口连接异常" + } else if (message.includes("timeout")) { + message = "系统接口请求超时" + } else if (message.includes("Request failed with status code")) { + message = "系统接口" + message.slice(-3) + "异常" + } + Message({ message: message, type: 'error', duration: 5 * 1000 }) + return Promise.reject(error) + } +) + +// 通用下载方法 +export function download(url, params, filename, config) { + downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", }) + return service.post(url, params, { + transformRequest: [(params) => { return tansParams(params) }], + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + responseType: 'blob', + ...config + }).then(async (data) => { + const isBlob = blobValidate(data) + if (isBlob) { + const blob = new Blob([data]) + saveAs(blob, filename) + } else { + const resText = await data.text() + const rspObj = JSON.parse(resText) + const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default'] + Message.error(errMsg) + } + downloadLoadingInstance.close() + }).catch((r) => { + console.error(r) + Message.error('下载文件出现错误,请联系管理员!') + downloadLoadingInstance.close() + }) +} + +export default service diff --git a/src/utils/ruoyi.js b/src/utils/ruoyi.js new file mode 100644 index 0000000..3de2d98 --- /dev/null +++ b/src/utils/ruoyi.js @@ -0,0 +1,228 @@ +/** + * 通用js方法封装处理 + * Copyright (c) 2019 ruoyi + */ + +// 日期格式化 +export function parseTime(time, pattern) { + if (arguments.length === 0 || !time) { + return null + } + const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' + let date + if (typeof time === 'object') { + date = time + } else { + if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { + time = parseInt(time) + } else if (typeof time === 'string') { + time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), '') + } + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { + let value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] } + if (result.length > 0 && value < 10) { + value = '0' + value + } + return value || 0 + }) + return time_str +} + +// 表单重置 +export function resetForm(refName) { + if (this.$refs[refName]) { + this.$refs[refName].resetFields() + } +} + +// 添加日期范围 +export function addDateRange(params, dateRange, propName) { + let search = params + search.params = typeof (search.params) === 'object' && search.params !== null && !Array.isArray(search.params) ? search.params : {} + dateRange = Array.isArray(dateRange) ? dateRange : [] + if (typeof (propName) === 'undefined') { + search.params['beginTime'] = dateRange[0] + search.params['endTime'] = dateRange[1] + } else { + search.params['begin' + propName] = dateRange[0] + search.params['end' + propName] = dateRange[1] + } + return search +} + +// 回显数据字典 +export function selectDictLabel(datas, value) { + if (value === undefined) { + return "" + } + var actions = [] + Object.keys(datas).some((key) => { + if (datas[key].value == ('' + value)) { + actions.push(datas[key].label) + return true + } + }) + if (actions.length === 0) { + actions.push(value) + } + return actions.join('') +} + +// 回显数据字典(字符串、数组) +export function selectDictLabels(datas, value, separator) { + if (value === undefined || value.length ===0) { + return "" + } + if (Array.isArray(value)) { + value = value.join(",") + } + var actions = [] + var currentSeparator = undefined === separator ? "," : separator + var temp = value.split(currentSeparator) + Object.keys(value.split(currentSeparator)).some((val) => { + var match = false + Object.keys(datas).some((key) => { + if (datas[key].value == ('' + temp[val])) { + actions.push(datas[key].label + currentSeparator) + match = true + } + }) + if (!match) { + actions.push(temp[val] + currentSeparator) + } + }) + return actions.join('').substring(0, actions.join('').length - 1) +} + +// 字符串格式化(%s ) +export function sprintf(str) { + var args = arguments, flag = true, i = 1 + str = str.replace(/%s/g, function () { + var arg = args[i++] + if (typeof arg === 'undefined') { + flag = false + return '' + } + return arg + }) + return flag ? str : '' +} + +// 转换字符串,undefined,null等转化为"" +export function parseStrEmpty(str) { + if (!str || str == "undefined" || str == "null") { + return "" + } + return str +} + +// 数据合并 +export function mergeRecursive(source, target) { + for (var p in target) { + try { + if (target[p].constructor == Object) { + source[p] = mergeRecursive(source[p], target[p]) + } else { + source[p] = target[p] + } + } catch (e) { + source[p] = target[p] + } + } + return source +} + +/** + * 构造树型结构数据 + * @param {*} data 数据源 + * @param {*} id id字段 默认 'id' + * @param {*} parentId 父节点字段 默认 'parentId' + * @param {*} children 孩子节点字段 默认 'children' + */ +export function handleTree(data, id, parentId, children) { + let config = { + id: id || 'id', + parentId: parentId || 'parentId', + childrenList: children || 'children' + } + + var childrenListMap = {} + var tree = [] + for (let d of data) { + let id = d[config.id] + childrenListMap[id] = d + if (!d[config.childrenList]) { + d[config.childrenList] = [] + } + } + + for (let d of data) { + let parentId = d[config.parentId] + let parentObj = childrenListMap[parentId] + if (!parentObj) { + tree.push(d) + } else { + parentObj[config.childrenList].push(d) + } + } + return tree +} + +/** +* 参数处理 +* @param {*} params 参数 +*/ +export function tansParams(params) { + let result = '' + for (const propName of Object.keys(params)) { + const value = params[propName] + var part = encodeURIComponent(propName) + "=" + if (value !== null && value !== "" && typeof (value) !== "undefined") { + if (typeof value === 'object') { + for (const key of Object.keys(value)) { + if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') { + let params = propName + '[' + key + ']' + var subPart = encodeURIComponent(params) + "=" + result += subPart + encodeURIComponent(value[key]) + "&" + } + } + } else { + result += part + encodeURIComponent(value) + "&" + } + } + } + return result +} + +// 返回项目路径 +export function getNormalPath(p) { + if (p.length === 0 || !p || p == 'undefined') { + return p + } + let res = p.replace('//', '/') + if (res[res.length - 1] === '/') { + return res.slice(0, res.length - 1) + } + return res +} + +// 验证是否为blob格式 +export function blobValidate(data) { + return data.type !== 'application/json' +} diff --git a/src/utils/scroll-to.js b/src/utils/scroll-to.js new file mode 100644 index 0000000..c5d8e04 --- /dev/null +++ b/src/utils/scroll-to.js @@ -0,0 +1,58 @@ +Math.easeInOutQuad = function(t, b, c, d) { + t /= d / 2 + if (t < 1) { + return c / 2 * t * t + b + } + t-- + return -c / 2 * (t * (t - 2) - 1) + b +} + +// requestAnimationFrame for Smart Animating http://goo.gl/sx5sts +var requestAnimFrame = (function() { + return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) } +})() + +/** + * Because it's so fucking difficult to detect the scrolling element, just move them all + * @param {number} amount + */ +function move(amount) { + document.documentElement.scrollTop = amount + document.body.parentNode.scrollTop = amount + document.body.scrollTop = amount +} + +function position() { + return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop +} + +/** + * @param {number} to + * @param {number} duration + * @param {Function} callback + */ +export function scrollTo(to, duration, callback) { + const start = position() + const change = to - start + const increment = 20 + let currentTime = 0 + duration = (typeof (duration) === 'undefined') ? 500 : duration + var animateScroll = function() { + // increment the time + currentTime += increment + // find the value with the quadratic in-out easing function + var val = Math.easeInOutQuad(currentTime, start, change, duration) + // move the document.body + move(val) + // do the animation unless its over + if (currentTime < duration) { + requestAnimFrame(animateScroll) + } else { + if (callback && typeof (callback) === 'function') { + // the animation is done so lets callback + callback() + } + } + } + animateScroll() +} diff --git a/src/utils/validate.js b/src/utils/validate.js new file mode 100644 index 0000000..d159859 --- /dev/null +++ b/src/utils/validate.js @@ -0,0 +1,119 @@ +/** + * 路径匹配器 + * @param {string} pattern + * @param {string} path + * @returns {Boolean} + */ +export function isPathMatch(pattern, path) { + const regexPattern = pattern + .replace(/([.+^${}()|\[\]\\])/g, '\\$1') + .replace(/\*\*/g, '__DOUBLE_STAR__') + .replace(/\*/g, '[^/]*') + .replace(/__DOUBLE_STAR__/g, '.*') + .replace(/\?/g, '[^/]') + const regex = new RegExp(`^${regexPattern}$`) + return regex.test(path) +} + +/** + * 判断value字符串是否为空 + * @param {string} value + * @returns {Boolean} + */ +export function isEmpty(value) { + if (value == null || value == "" || value == undefined || value == "undefined") { + return true + } + return false +} + +/** + * 判断url是否是http或https + * @param {string} url + * @returns {Boolean} + */ +export function isHttp(url) { + return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1 +} + +/** + * 判断path是否为外链 + * @param {string} path + * @returns {Boolean} + */ +export function isExternal(path) { + return /^(https?:|mailto:|tel:)/.test(path) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validUsername(str) { + const valid_map = ['admin', 'editor'] + return valid_map.indexOf(str.trim()) >= 0 +} + +/** + * @param {string} url + * @returns {Boolean} + */ +export function validURL(url) { + const reg = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/ + return reg.test(url) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validLowerCase(str) { + const reg = /^[a-z]+$/ + return reg.test(str) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validUpperCase(str) { + const reg = /^[A-Z]+$/ + return reg.test(str) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validAlphabets(str) { + const reg = /^[A-Za-z]+$/ + return reg.test(str) +} + +/** + * @param {string} email + * @returns {Boolean} + */ +export function validEmail(email) { + const reg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ + return reg.test(email) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function isString(str) { + return typeof str === 'string' || str instanceof String +} + +/** + * @param {Array} arg + * @returns {Boolean} + */ +export function isArray(arg) { + if (typeof Array.isArray === 'undefined') { + return Object.prototype.toString.call(arg) === '[object Array]' + } + return Array.isArray(arg) +} diff --git a/src/views/dashboard/BarChart.vue b/src/views/dashboard/BarChart.vue new file mode 100644 index 0000000..88e7ef6 --- /dev/null +++ b/src/views/dashboard/BarChart.vue @@ -0,0 +1,102 @@ + + + diff --git a/src/views/dashboard/LineChart.vue b/src/views/dashboard/LineChart.vue new file mode 100644 index 0000000..702ff73 --- /dev/null +++ b/src/views/dashboard/LineChart.vue @@ -0,0 +1,135 @@ + + + diff --git a/src/views/dashboard/PanelGroup.vue b/src/views/dashboard/PanelGroup.vue new file mode 100644 index 0000000..1a1081f --- /dev/null +++ b/src/views/dashboard/PanelGroup.vue @@ -0,0 +1,181 @@ + + + + + diff --git a/src/views/dashboard/PieChart.vue b/src/views/dashboard/PieChart.vue new file mode 100644 index 0000000..63f0d84 --- /dev/null +++ b/src/views/dashboard/PieChart.vue @@ -0,0 +1,79 @@ + + + diff --git a/src/views/dashboard/RaddarChart.vue b/src/views/dashboard/RaddarChart.vue new file mode 100644 index 0000000..312e018 --- /dev/null +++ b/src/views/dashboard/RaddarChart.vue @@ -0,0 +1,116 @@ + + + diff --git a/src/views/dashboard/mixins/resize.js b/src/views/dashboard/mixins/resize.js new file mode 100644 index 0000000..b1e76e9 --- /dev/null +++ b/src/views/dashboard/mixins/resize.js @@ -0,0 +1,56 @@ +import { debounce } from '@/utils' + +export default { + data() { + return { + $_sidebarElm: null, + $_resizeHandler: null + } + }, + mounted() { + this.initListener() + }, + activated() { + if (!this.$_resizeHandler) { + // avoid duplication init + this.initListener() + } + + // when keep-alive chart activated, auto resize + this.resize() + }, + beforeDestroy() { + this.destroyListener() + }, + deactivated() { + this.destroyListener() + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_sidebarResizeHandler(e) { + if (e.propertyName === 'width') { + this.$_resizeHandler() + } + }, + initListener() { + this.$_resizeHandler = debounce(() => { + this.resize() + }, 100) + window.addEventListener('resize', this.$_resizeHandler) + + this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0] + this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler) + }, + destroyListener() { + window.removeEventListener('resize', this.$_resizeHandler) + this.$_resizeHandler = null + + this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler) + }, + resize() { + const { chart } = this + chart && chart.resize() + } + } +} diff --git a/src/views/error/401.vue b/src/views/error/401.vue new file mode 100644 index 0000000..448b6ec --- /dev/null +++ b/src/views/error/401.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/src/views/error/404.vue b/src/views/error/404.vue new file mode 100644 index 0000000..96f075c --- /dev/null +++ b/src/views/error/404.vue @@ -0,0 +1,233 @@ + + + + + diff --git a/src/views/index.vue b/src/views/index.vue new file mode 100644 index 0000000..011476c --- /dev/null +++ b/src/views/index.vue @@ -0,0 +1,1208 @@ + + + + + + diff --git a/src/views/index_v1.vue b/src/views/index_v1.vue new file mode 100644 index 0000000..d2d2ec6 --- /dev/null +++ b/src/views/index_v1.vue @@ -0,0 +1,98 @@ + + + + + diff --git a/src/views/lock.vue b/src/views/lock.vue new file mode 100644 index 0000000..d6abf08 --- /dev/null +++ b/src/views/lock.vue @@ -0,0 +1,375 @@ + + + + + diff --git a/src/views/login.vue b/src/views/login.vue new file mode 100644 index 0000000..dde986d --- /dev/null +++ b/src/views/login.vue @@ -0,0 +1,223 @@ + + + + + diff --git a/src/views/monitor/cache/index.vue b/src/views/monitor/cache/index.vue new file mode 100644 index 0000000..f8b6648 --- /dev/null +++ b/src/views/monitor/cache/index.vue @@ -0,0 +1,148 @@ + + + diff --git a/src/views/monitor/cache/list.vue b/src/views/monitor/cache/list.vue new file mode 100644 index 0000000..9e0523e --- /dev/null +++ b/src/views/monitor/cache/list.vue @@ -0,0 +1,241 @@ + + + diff --git a/src/views/monitor/druid/index.vue b/src/views/monitor/druid/index.vue new file mode 100644 index 0000000..8c3a257 --- /dev/null +++ b/src/views/monitor/druid/index.vue @@ -0,0 +1,15 @@ + + diff --git a/src/views/monitor/job/detail.vue b/src/views/monitor/job/detail.vue new file mode 100644 index 0000000..6ddca24 --- /dev/null +++ b/src/views/monitor/job/detail.vue @@ -0,0 +1,197 @@ + + + + + diff --git a/src/views/monitor/job/index.vue b/src/views/monitor/job/index.vue new file mode 100644 index 0000000..585c98a --- /dev/null +++ b/src/views/monitor/job/index.vue @@ -0,0 +1,471 @@ + + + diff --git a/src/views/monitor/job/log.vue b/src/views/monitor/job/log.vue new file mode 100644 index 0000000..569c03f --- /dev/null +++ b/src/views/monitor/job/log.vue @@ -0,0 +1,265 @@ + + + diff --git a/src/views/monitor/logininfor/index.vue b/src/views/monitor/logininfor/index.vue new file mode 100644 index 0000000..f16a3dc --- /dev/null +++ b/src/views/monitor/logininfor/index.vue @@ -0,0 +1,246 @@ + + + + diff --git a/src/views/monitor/online/index.vue b/src/views/monitor/online/index.vue new file mode 100644 index 0000000..048e51d --- /dev/null +++ b/src/views/monitor/online/index.vue @@ -0,0 +1,122 @@ + + + + diff --git a/src/views/monitor/operlog/detail.vue b/src/views/monitor/operlog/detail.vue new file mode 100644 index 0000000..362086e --- /dev/null +++ b/src/views/monitor/operlog/detail.vue @@ -0,0 +1,147 @@ + + + diff --git a/src/views/monitor/operlog/index.vue b/src/views/monitor/operlog/index.vue new file mode 100644 index 0000000..7bcb40b --- /dev/null +++ b/src/views/monitor/operlog/index.vue @@ -0,0 +1,279 @@ + + + + diff --git a/src/views/monitor/server/index.vue b/src/views/monitor/server/index.vue new file mode 100644 index 0000000..36b20f8 --- /dev/null +++ b/src/views/monitor/server/index.vue @@ -0,0 +1,207 @@ + + + diff --git a/src/views/redirect.vue b/src/views/redirect.vue new file mode 100644 index 0000000..db4c1d6 --- /dev/null +++ b/src/views/redirect.vue @@ -0,0 +1,12 @@ + diff --git a/src/views/register.vue b/src/views/register.vue new file mode 100644 index 0000000..82f96c5 --- /dev/null +++ b/src/views/register.vue @@ -0,0 +1,214 @@ + + + + + diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue new file mode 100644 index 0000000..beb6c3a --- /dev/null +++ b/src/views/system/config/index.vue @@ -0,0 +1,343 @@ + + + diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue new file mode 100644 index 0000000..3d41ee3 --- /dev/null +++ b/src/views/system/dept/index.vue @@ -0,0 +1,392 @@ + + + diff --git a/src/views/system/dict/data.vue b/src/views/system/dict/data.vue new file mode 100644 index 0000000..17a77a1 --- /dev/null +++ b/src/views/system/dict/data.vue @@ -0,0 +1,402 @@ + + + \ No newline at end of file diff --git a/src/views/system/dict/detail.vue b/src/views/system/dict/detail.vue new file mode 100644 index 0000000..b1e3dc9 --- /dev/null +++ b/src/views/system/dict/detail.vue @@ -0,0 +1,203 @@ + + + + + diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue new file mode 100644 index 0000000..6ea3ada --- /dev/null +++ b/src/views/system/dict/index.vue @@ -0,0 +1,375 @@ + + + \ No newline at end of file diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue new file mode 100644 index 0000000..0255d0e --- /dev/null +++ b/src/views/system/menu/index.vue @@ -0,0 +1,533 @@ + + + diff --git a/src/views/system/notice/ReadUsers.vue b/src/views/system/notice/ReadUsers.vue new file mode 100644 index 0000000..663f350 --- /dev/null +++ b/src/views/system/notice/ReadUsers.vue @@ -0,0 +1,109 @@ + + + + + diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue new file mode 100644 index 0000000..27f65b0 --- /dev/null +++ b/src/views/system/notice/index.vue @@ -0,0 +1,332 @@ + + + diff --git a/src/views/system/post/index.vue b/src/views/system/post/index.vue new file mode 100644 index 0000000..93891ff --- /dev/null +++ b/src/views/system/post/index.vue @@ -0,0 +1,309 @@ + + + diff --git a/src/views/system/role/authUser.vue b/src/views/system/role/authUser.vue new file mode 100644 index 0000000..c11babc --- /dev/null +++ b/src/views/system/role/authUser.vue @@ -0,0 +1,199 @@ + + + \ No newline at end of file diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue new file mode 100644 index 0000000..b061151 --- /dev/null +++ b/src/views/system/role/index.vue @@ -0,0 +1,605 @@ + + + \ No newline at end of file diff --git a/src/views/system/role/selectUser.vue b/src/views/system/role/selectUser.vue new file mode 100644 index 0000000..d2b21bf --- /dev/null +++ b/src/views/system/role/selectUser.vue @@ -0,0 +1,136 @@ + + + diff --git a/src/views/system/user/authRole.vue b/src/views/system/user/authRole.vue new file mode 100644 index 0000000..c06640c --- /dev/null +++ b/src/views/system/user/authRole.vue @@ -0,0 +1,123 @@ + + + \ No newline at end of file diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue new file mode 100644 index 0000000..b6fd14d --- /dev/null +++ b/src/views/system/user/index.vue @@ -0,0 +1,467 @@ + + + diff --git a/src/views/system/user/profile/index.vue b/src/views/system/user/profile/index.vue new file mode 100644 index 0000000..c070cd1 --- /dev/null +++ b/src/views/system/user/profile/index.vue @@ -0,0 +1,95 @@ + + + diff --git a/src/views/system/user/profile/resetPwd.vue b/src/views/system/user/profile/resetPwd.vue new file mode 100644 index 0000000..edbb227 --- /dev/null +++ b/src/views/system/user/profile/resetPwd.vue @@ -0,0 +1,70 @@ + + + diff --git a/src/views/system/user/profile/userAvatar.vue b/src/views/system/user/profile/userAvatar.vue new file mode 100644 index 0000000..59afb35 --- /dev/null +++ b/src/views/system/user/profile/userAvatar.vue @@ -0,0 +1,184 @@ + + + + diff --git a/src/views/system/user/profile/userInfo.vue b/src/views/system/user/profile/userInfo.vue new file mode 100644 index 0000000..0819318 --- /dev/null +++ b/src/views/system/user/profile/userInfo.vue @@ -0,0 +1,88 @@ + + + diff --git a/src/views/system/user/view.vue b/src/views/system/user/view.vue new file mode 100644 index 0000000..04726c0 --- /dev/null +++ b/src/views/system/user/view.vue @@ -0,0 +1,177 @@ + + + diff --git a/src/views/tool/build/CodeTypeDialog.vue b/src/views/tool/build/CodeTypeDialog.vue new file mode 100644 index 0000000..b5c2e2e --- /dev/null +++ b/src/views/tool/build/CodeTypeDialog.vue @@ -0,0 +1,106 @@ + + diff --git a/src/views/tool/build/DraggableItem.vue b/src/views/tool/build/DraggableItem.vue new file mode 100644 index 0000000..e881778 --- /dev/null +++ b/src/views/tool/build/DraggableItem.vue @@ -0,0 +1,100 @@ + diff --git a/src/views/tool/build/IconsDialog.vue b/src/views/tool/build/IconsDialog.vue new file mode 100644 index 0000000..958be50 --- /dev/null +++ b/src/views/tool/build/IconsDialog.vue @@ -0,0 +1,123 @@ + + + diff --git a/src/views/tool/build/RightPanel.vue b/src/views/tool/build/RightPanel.vue new file mode 100644 index 0000000..c2760eb --- /dev/null +++ b/src/views/tool/build/RightPanel.vue @@ -0,0 +1,946 @@ + + + + + diff --git a/src/views/tool/build/TreeNodeDialog.vue b/src/views/tool/build/TreeNodeDialog.vue new file mode 100644 index 0000000..e913d0f --- /dev/null +++ b/src/views/tool/build/TreeNodeDialog.vue @@ -0,0 +1,148 @@ + + diff --git a/src/views/tool/build/index.vue b/src/views/tool/build/index.vue new file mode 100644 index 0000000..889422b --- /dev/null +++ b/src/views/tool/build/index.vue @@ -0,0 +1,775 @@ + + + + + diff --git a/src/views/tool/gen/basicInfoForm.vue b/src/views/tool/gen/basicInfoForm.vue new file mode 100644 index 0000000..3a6e2ed --- /dev/null +++ b/src/views/tool/gen/basicInfoForm.vue @@ -0,0 +1,60 @@ + + + diff --git a/src/views/tool/gen/createTable.vue b/src/views/tool/gen/createTable.vue new file mode 100644 index 0000000..dc71092 --- /dev/null +++ b/src/views/tool/gen/createTable.vue @@ -0,0 +1,45 @@ + + + diff --git a/src/views/tool/gen/editTable.vue b/src/views/tool/gen/editTable.vue new file mode 100644 index 0000000..e8371a1 --- /dev/null +++ b/src/views/tool/gen/editTable.vue @@ -0,0 +1,230 @@ + + + diff --git a/src/views/tool/gen/genInfoForm.vue b/src/views/tool/gen/genInfoForm.vue new file mode 100644 index 0000000..474f9ae --- /dev/null +++ b/src/views/tool/gen/genInfoForm.vue @@ -0,0 +1,336 @@ + + + diff --git a/src/views/tool/gen/importTable.vue b/src/views/tool/gen/importTable.vue new file mode 100644 index 0000000..91d62b7 --- /dev/null +++ b/src/views/tool/gen/importTable.vue @@ -0,0 +1,120 @@ + + + diff --git a/src/views/tool/gen/index.vue b/src/views/tool/gen/index.vue new file mode 100644 index 0000000..05bd735 --- /dev/null +++ b/src/views/tool/gen/index.vue @@ -0,0 +1,349 @@ + + + diff --git a/src/views/tool/swagger/index.vue b/src/views/tool/swagger/index.vue new file mode 100644 index 0000000..dd6b4a2 --- /dev/null +++ b/src/views/tool/swagger/index.vue @@ -0,0 +1,15 @@ + + diff --git a/vue.config.js b/vue.config.js new file mode 100644 index 0000000..a897c5a --- /dev/null +++ b/vue.config.js @@ -0,0 +1,136 @@ +'use strict' +const path = require('path') + +function resolve(dir) { + return path.join(__dirname, dir) +} + +const CompressionPlugin = require('compression-webpack-plugin') + +const name = process.env.VUE_APP_TITLE || '信联' // 网页标题 + +const baseUrl = 'http://vue.ruoyi.vip/prod-api' // 后端接口 + +const port = process.env.port || process.env.npm_config_port || 80 // 端口 + +// vue.config.js 配置说明 +//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions +// 这里只列一部分,具体配置参考文档 +module.exports = { + // 部署生产环境和开发环境下的URL。 + // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 + // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 + publicPath: process.env.NODE_ENV === "production" ? "/" : "/", + // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) + outputDir: 'dist', + // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) + assetsDir: 'static', + // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 + productionSourceMap: false, + transpileDependencies: ['quill'], + // webpack-dev-server 相关配置 + devServer: { + host: '0.0.0.0', + port: port, + open: true, + proxy: { + // detail: https://cli.vuejs.org/config/#devserver-proxy + [process.env.VUE_APP_BASE_API]: { + target: baseUrl, + changeOrigin: true, + pathRewrite: { + ['^' + process.env.VUE_APP_BASE_API]: '' + } + }, + // springdoc proxy + '^/v3/api-docs/(.*)': { + target: baseUrl, + changeOrigin: true + } + }, + disableHostCheck: true + }, + css: { + loaderOptions: { + sass: { + sassOptions: { outputStyle: "expanded" } + } + } + }, + configureWebpack: { + name: name, + resolve: { + alias: { + '@': resolve('src') + } + }, + plugins: [ + // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件 + new CompressionPlugin({ + cache: false, // 不启用文件缓存 + test: /\.(js|css|html|jpe?g|png|gif|svg)?$/i, // 压缩文件格式 + filename: '[path][base].gz[query]', // 压缩后的文件名 + algorithm: 'gzip', // 使用gzip压缩 + minRatio: 0.8, // 压缩比例,小于 80% 的文件不会被压缩 + deleteOriginalAssets: false // 压缩后删除原文件 + }) + ], + }, + chainWebpack(config) { + config.plugins.delete('preload') // TODO: need test + config.plugins.delete('prefetch') // TODO: need test + + // set svg-sprite-loader + config.module + .rule('svg') + .exclude.add(resolve('src/assets/icons')) + .end() + config.module + .rule('icons') + .test(/\.svg$/) + .include.add(resolve('src/assets/icons')) + .end() + .use('svg-sprite-loader') + .loader('svg-sprite-loader') + .options({ + symbolId: 'icon-[name]' + }) + .end() + + config.when(process.env.NODE_ENV !== 'development', config => { + config + .plugin('ScriptExtHtmlWebpackPlugin') + .after('html') + .use('script-ext-html-webpack-plugin', [{ + // `runtime` must same as runtimeChunk name. default is `runtime` + inline: /runtime\..*\.js$/ + }]) + .end() + + config.optimization.splitChunks({ + chunks: 'all', + cacheGroups: { + libs: { + name: 'chunk-libs', + test: /[\\/]node_modules[\\/]/, + priority: 10, + chunks: 'initial' // only package third parties that are initially dependent + }, + elementUI: { + name: 'chunk-elementUI', // split elementUI into a single package + test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm + priority: 20 // the weight needs to be larger than libs and app or it will be packaged into libs or app + }, + commons: { + name: 'chunk-commons', + test: resolve('src/components'), // can customize your rules + minChunks: 3, // minimum common number + priority: 5, + reuseExistingChunk: true + } + } + }) + config.optimization.runtimeChunk('single') + }) + } +}