@discuzq/sdk
Version:
discuz dsk
1,108 lines (931 loc) • 38 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
require("core-js/modules/es.symbol.js");
require("core-js/modules/es.symbol.description.js");
require("core-js/modules/es.symbol.iterator.js");
require("core-js/modules/es.symbol.to-string-tag.js");
require("core-js/modules/es.array.concat.js");
require("core-js/modules/es.array.iterator.js");
require("core-js/modules/es.array.join.js");
require("core-js/modules/es.array.map.js");
require("core-js/modules/es.array.slice.js");
require("core-js/modules/es.function.name.js");
require("core-js/modules/es.json.to-string-tag.js");
require("core-js/modules/es.math.to-string-tag.js");
require("core-js/modules/es.number.constructor.js");
require("core-js/modules/es.object.assign.js");
require("core-js/modules/es.object.get-own-property-descriptor.js");
require("core-js/modules/es.object.to-string.js");
require("core-js/modules/es.regexp.exec.js");
require("core-js/modules/es.regexp.to-string.js");
require("core-js/modules/es.string.iterator.js");
require("core-js/modules/es.string.match.js");
require("core-js/modules/es.string.replace.js");
require("core-js/modules/es.string.search.js");
require("core-js/modules/es.string.split.js");
require("core-js/modules/web.dom-collections.iterator.js");
require("core-js/modules/web.url.js");
require("core-js/modules/web.url.to-json.js");
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _typeof3 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
/* eslint-disable */
!function (t) {
var e = {};
function n(r) {
if (e[r]) return e[r].exports;
var o = e[r] = {
i: r,
l: !1,
exports: {}
};
return t[r].call(o.exports, o, o.exports, n), o.l = !0, o.exports;
}
n.m = t, n.c = e, n.d = function (t, e, r) {
n.o(t, e) || Object.defineProperty(t, e, {
enumerable: !0,
get: r
});
}, n.r = function (t) {
typeof Symbol !== 'undefined' && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
value: 'Module'
}), Object.defineProperty(t, '__esModule', {
value: !0
});
}, n.t = function (t, e) {
if (1 & e && (t = n(t)), 8 & e) return t;
if (4 & e && (0, _typeof3.default)(t) === 'object' && t && t.__esModule) return t;
var r = Object.create(null);
if (n.r(r), Object.defineProperty(r, 'default', {
enumerable: !0,
value: t
}), 2 & e && typeof t !== 'string') for (var o in t) {
n.d(r, o, function (e) {
return t[e];
}.bind(null, o));
}
return r;
}, n.n = function (t) {
var e = t && t.__esModule ? function () {
return t.default;
} : function () {
return t;
};
return n.d(e, 'a', e), e;
}, n.o = function (t, e) {
return Object.prototype.hasOwnProperty.call(t, e);
}, n.p = '', n(n.s = 16);
}([function (t, e, n) {
function r() {
return Math.floor(1e8 * Math.random());
}
var o = function o(t) {
t = t ? 1 : 0;
try {
return location.search.substr(t);
} catch (r) {
try {
var _e = document.URL;
var _n = _e.indexOf('?');
if (_n >= 0) return _e.substr(_n + t);
} catch (r) {}
}
return '';
};
var a = {};
!function () {
for (var _t = o(!0).split('&'), _e2 = 0; _e2 < _t.length; _e2++) {
var _n2 = /(.*?)=(.*)/.exec(_t[_e2]);
_n2 && (a[_n2[1]] = _n2[2]);
}
}();
t.exports = {
href: function href() {
try {
return location.href;
} catch (t) {
try {
return document.URL;
} catch (t) {}
}
return '';
},
getQuery: function getQuery(t) {
var e = o();
return e = e ? "".concat(e.replace(/&rand=[^&]+/, ''), "&rand=").concat(r()) : "?rand=".concat(r()), t = t ? 1 : 0, e.substr(t);
},
queryParam: function queryParam(t) {
return a[t];
},
queryMap: function queryMap() {
return $.extend({}, a);
},
parse2rgb: function parse2rgb(t) {
if (!t || typeof t !== 'string') return null;
t = t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, function (t, e, n, r) {
return e + e + n + n + r + r;
});
var e = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
return e ? {
r: parseInt(e[1], 16),
g: parseInt(e[2], 16),
b: parseInt(e[3], 16),
s: "#".concat(e[1]).concat(e[2]).concat(e[3])
} : null;
},
arrIndexOf: function arrIndexOf(t, e) {
if (typeof t.indexOf === 'function') return t.indexOf(e);
for (var _n3 = 0; _n3 < t.length; _n3++) {
if (t[_n3] === e) return _n3;
}
return -1;
}
};
}, function (t, e, n) {
var r = function () {
var t = 1;
var e = /subsid=(\d+)/.exec(location.href);
e && (t = parseInt(e[1], 10) + 1);
var n = function n(e, _n4) {
var r = _n4 || t;
return e = /subsid=\d+/.test(e) ? e.replace(/subsid=\d+/g, "subsid=".concat(r)) : "".concat(e, "&subsid=").concat(r), _n4 || t++, e;
};
return n.get = function () {
return t;
}, n.bind = function () {
var e = t++;
return function (t) {
return n(t, e);
};
}, n;
}();
t.exports = r;
}, function (t, e, n) {
var r = Object.prototype.hasOwnProperty;
var o = Object.prototype.toString;
var a = Object.defineProperty;
var i = Object.getOwnPropertyDescriptor;
var c = function c(t) {
return typeof Array.isArray === 'function' ? Array.isArray(t) : o.call(t) === '[object Array]';
};
var s = function s(t) {
if (!t || o.call(t) !== '[object Object]') return !1;
var e;
var n = r.call(t, 'constructor');
var a = t.constructor && t.constructor.prototype && r.call(t.constructor.prototype, 'isPrototypeOf');
if (t.constructor && !n && !a) return !1;
for (e in t) {
;
}
return void 0 === e || r.call(t, e);
};
var u = function u(t, e) {
a && e.name === '__proto__' ? a(t, e.name, {
enumerable: !0,
configurable: !0,
value: e.newValue,
writable: !0
}) : t[e.name] = e.newValue;
};
var p = function p(t, e) {
if (e === '__proto__') {
if (!r.call(t, e)) return;
if (i) return i(t, e).value;
}
return t[e];
};
t.exports = function f() {
var t;
var e;
var n;
var r;
var o;
var a;
var i = arguments[0];
var l = 1;
var d = arguments.length;
var h = !1;
for (typeof i === 'boolean' && (h = i, i = arguments[1] || {}, l = 2), (i == null || (0, _typeof3.default)(i) !== 'object' && typeof i !== 'function') && (i = {}); l < d; ++l) {
if ((t = arguments[l]) != null) for (e in t) {
n = p(i, e), i !== (r = p(t, e)) && (h && r && (s(r) || (o = c(r))) ? (o ? (o = !1, a = n && c(n) ? n : []) : a = n && s(n) ? n : {}, u(i, {
name: e,
newValue: f(h, a, r)
})) : void 0 !== r && u(i, {
name: e,
newValue: r
}));
}
}
return i;
};
}, function (t, e, n) {
var r;
var o;
var a = n(1);
var i = {
ERROR_TYPE_FRAMEJS_DOWNLOAD_FAIL: 16,
ERROR_TYPE_JSONP_PREHANDLE: 17,
ERROR_TYPE_FRAMEJS_CODE_ERROR: 18,
CALLBACK_NAME: 19
};
var c = {
ERROR_TYPE_FRAMEJS_DOWNLOAD_FAIL: 'ERROR_TYPE_FRAMEJS_DOWNLOAD_FAIL',
ERROR_TYPE_JSONP_PREHANDLE: 'ERROR_TYPE_JSONP_PREHANDLE',
ERROR_TYPE_FRAMEJS_CODE_ERROR: 'ERROR_TYPE_FRAMEJS_CODE_ERROR',
CALLBACK_NAME: 'CALLBACK_NAME'
};
var s = (r = document.referrer, o = location.href || document.URL, r = r.length > 512 ? r.substr(0, 512) : r, o = o.length > 1024 ? o.substr(0, 1024) : o, ["referer=".concat(encodeURIComponent(r)), "href=".concat(encodeURIComponent(o))].join('&'));
t.exports = {
type: i,
send: function send(t, e, n) {
try {
(n = n || c[t]).length > 1024 && n.substr(0, 1024);
var _r = ["type=".concat(t = i[t]), "appid=".concat(e), "reason=".concat(encodeURIComponent(n))];
var _o = "https://aq.qq.com/cn2/manage/mbtoken/cap_monitor?".concat(s, "&").concat(_r.join('&'));
new Image().src = a(_o);
} catch (u) {}
},
perfectStack: function perfectStack(t) {
var e = '';
t && t.stack && (e = t.stack.replace(/\n/gi, '').split(/\bat\b/).join('\n').replace(/\?[^:]+/gi, ''));
try {
var _n5 = t.toString();
e.indexOf(_n5) < 0 && (e = "".concat(_n5, "@").concat(e));
} catch (r) {}
return e;
}
};
},, function (t, e, n) {
t.exports = {
add: function add(t, e, n) {
t && (t.addEventListener ? t.addEventListener(e, n, !1) : t.attachEvent ? t.attachEvent("on".concat(e), n) : t["on".concat(e)] = n);
},
remove: function remove(t, e, n) {
t && (t.removeEventListener ? t.removeEventListener(e, n, !1) : t.detachEvent ? t.detachEvent("on".concat(e), n) : t["on".concat(e)] = null);
}
};
}, function (t, e) {
t.exports = function (t) {
var e = [];
return e.toString = function () {
return this.map(function (e) {
var n = function (t, e) {
var n = t[1] || '';
var r = t[3];
if (!r) return n;
if (e && typeof btoa === 'function') {
var o = (i = r, "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i)))), " */"));
var a = r.sources.map(function (t) {
return "/*# sourceURL=".concat(r.sourceRoot).concat(t, " */");
});
return [n].concat(a).concat([o]).join('\n');
}
var i;
return [n].join('\n');
}(e, t);
return e[2] ? "@media ".concat(e[2], "{").concat(n, "}") : n;
}).join('');
}, e.i = function (t, n) {
typeof t === 'string' && (t = [[null, t, '']]);
for (var r = {}, o = 0; o < this.length; o++) {
var a = this[o][0];
typeof a === 'number' && (r[a] = !0);
}
for (o = 0; o < t.length; o++) {
var i = t[o];
typeof i[0] === 'number' && r[i[0]] || (n && !i[2] ? i[2] = n : n && (i[2] = "(".concat(i[2], ") and (").concat(n, ")")), e.push(i));
}
}, e;
};
}, function (t, e) {
var n = {};
var r = function r(t) {
var e;
return function () {
return void 0 === e && (e = t.apply(this, arguments)), e;
};
};
var o = r(function () {
return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase());
});
var a = r(function () {
return document.head || document.getElementsByTagName('head')[0];
});
var i = null;
var c = 0;
function s(t, e) {
for (var _r2 = 0; _r2 < t.length; _r2++) {
var _o2 = t[_r2];
var _a = n[_o2.id];
if (_a) {
_a.refs++;
for (var i = 0; i < _a.parts.length; i++) {
_a.parts[i](_o2.parts[i]);
}
for (; i < _o2.parts.length; i++) {
_a.parts.push(l(_o2.parts[i], e));
}
} else {
var _c = [];
for (i = 0; i < _o2.parts.length; i++) {
_c.push(l(_o2.parts[i], e));
}
n[_o2.id] = {
id: _o2.id,
refs: 1,
parts: _c
};
}
}
}
function u(t) {
for (var e = [], n = {}, r = 0; r < t.length; r++) {
var _o3 = t[r];
var _a2 = _o3[0];
var _i = {
css: _o3[1],
media: _o3[2],
sourceMap: _o3[3]
};
n[_a2] ? n[_a2].parts.push(_i) : e.push(n[_a2] = {
id: _a2,
parts: [_i]
});
}
return e;
}
function p(t, e) {
var n = Array.prototype.slice.call(arguments, 2);
return function () {
var r = Array.prototype.slice.call(arguments);
t.apply(e, n.concat(r));
};
}
function f() {
var t = document.createElement('style');
var e = a();
return t.type = 'text/css', e.appendChild(t), t;
}
function l(t, e) {
var n;
var r;
var o;
var s;
var u;
if (e.singleton) {
var _l = c++;
n = i || (i = f()), r = p(y, null, n, _l, !1), o = p(y, null, n, _l, !0);
} else t.sourceMap && typeof URL === 'function' && typeof URL.createObjectURL === 'function' && typeof URL.revokeObjectURL === 'function' && typeof Blob === 'function' && typeof btoa === 'function' ? (s = document.createElement('link'), u = a(), s.rel = 'stylesheet', u.appendChild(s), r = p(m, null, n = s), o = function o() {
n.parentNode.removeChild(n), n.href && URL.revokeObjectURL(n.href);
}) : (n = f(), r = p(b, null, n), o = function o() {
n.parentNode.removeChild(n);
});
return r(t), function (e) {
if (e) {
if (e.css === t.css && e.media === t.media && e.sourceMap === t.sourceMap) return;
r(t = e);
} else o();
};
}
t.exports = function (t, e) {
if (typeof DEBUG !== 'undefined' && DEBUG && (typeof document === "undefined" ? "undefined" : (0, _typeof3.default)(document)) !== 'object') throw new Error('The style-loader cannot be used in a non-browser environment');
typeof (e = e || {}).singleton === 'undefined' && (e.singleton = o());
var r = u(t);
return s(r, e), function (t) {
for (var o = [], a = 0; a < r.length; a++) {
var _i2 = r[a];
(c = n[_i2.id]).refs--, o.push(c);
}
t && s(u(t), e);
for (a = 0; a < o.length; a++) {
var c;
if ((c = o[a]).refs === 0) {
for (var _p = 0; _p < c.parts.length; _p++) {
c.parts[_p]();
}
delete n[c.id];
}
}
};
};
var d;
var h = (d = [], function (t, e) {
var n = [];
d[t] = e;
for (var _r3 = 0; _r3 < d.length; _r3++) {
d[_r3] && n.push(d[_r3]);
}
return n.join('\n');
});
function y(t, e, n, r) {
var o = n ? '' : r.css;
if (t.styleSheet) t.styleSheet.cssText = h(e, o);else {
var _a3 = document.createTextNode(o);
var _i3 = t.childNodes;
_i3[e] && t.removeChild(_i3[e]), _i3.length ? t.insertBefore(_a3, _i3[e]) : t.appendChild(_a3);
}
}
function b(t, e) {
var n = e.css;
var r = e.media;
e.sourceMap;
if (r && t.setAttribute('media', r), t.styleSheet) t.styleSheet.cssText = n;else {
for (; t.firstChild;) {
t.removeChild(t.firstChild);
}
t.appendChild(document.createTextNode(n));
}
}
function m(t, e) {
var n = e.css;
var r = (e.media, e.sourceMap);
r && (n += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r)))), " */"));
var o = new Blob([n], {
type: 'text/css'
});
var a = t.href;
t.href = URL.createObjectURL(o), a && URL.revokeObjectURL(a);
}
}, function (module, exports, __webpack_require__) {
var _typeof = typeof Symbol === 'function' && (0, _typeof3.default)(Symbol.iterator) === 'symbol' ? function (t) {
return (0, _typeof3.default)(t);
} : function (t) {
return t && typeof Symbol === 'function' && t.constructor === Symbol && t !== Symbol.prototype ? 'symbol' : (0, _typeof3.default)(t);
};
(typeof JSON === 'undefined' ? 'undefined' : _typeof(JSON)) !== 'object' && (JSON = {}), function () {
var rx_one = /^[\],:{}\s]*$/;
var rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;
var rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
var rx_four = /(?:^|:|,)(?:\s*\[)+/g;
var rx_escapable = /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
var rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
var gap;
var indent;
var meta;
var rep;
function f(t) {
return t < 10 ? "0".concat(t) : t;
}
function this_value() {
return this.valueOf();
}
function quote(t) {
return rx_escapable.lastIndex = 0, rx_escapable.test(t) ? "\"".concat(t.replace(rx_escapable, function (t) {
var e = meta[t];
return typeof e === 'string' ? e : "\\u".concat("0000".concat(t.charCodeAt(0).toString(16)).slice(-4));
}), "\"") : "\"".concat(t, "\"");
}
function str(t, e) {
var n;
var r;
var o;
var a;
var i;
var c = gap;
var s = e[t];
switch (s && (void 0 === s ? 'undefined' : _typeof(s)) === 'object' && typeof s.toJSON === 'function' && (s = s.toJSON(t)), typeof rep === 'function' && (s = rep.call(e, t, s)), void 0 === s ? 'undefined' : _typeof(s)) {
case 'string':
return quote(s);
case 'number':
return isFinite(s) ? String(s) : 'null';
case 'boolean':
case 'null':
return String(s);
case 'object':
if (!s) return 'null';
if (gap += indent, i = [], Object.prototype.toString.apply(s) === '[object Array]') {
for (a = s.length, n = 0; n < a; n += 1) {
i[n] = str(n, s) || 'null';
}
return o = i.length === 0 ? '[]' : gap ? "[\n".concat(gap).concat(i.join(",\n".concat(gap)), "\n").concat(c, "]") : "[".concat(i.join(','), "]"), gap = c, o;
}
if (rep && (void 0 === rep ? 'undefined' : _typeof(rep)) === 'object') for (a = rep.length, n = 0; n < a; n += 1) {
typeof rep[n] === 'string' && (o = str(r = rep[n], s)) && i.push(quote(r) + (gap ? ': ' : ':') + o);
} else for (r in s) {
Object.prototype.hasOwnProperty.call(s, r) && (o = str(r, s)) && i.push(quote(r) + (gap ? ': ' : ':') + o);
}
return o = i.length === 0 ? '{}' : gap ? "{\n".concat(gap).concat(i.join(",\n".concat(gap)), "\n").concat(c, "}") : "{".concat(i.join(','), "}"), gap = c, o;
}
}
typeof Date.prototype.toJSON !== 'function' && (Date.prototype.toJSON = function () {
return isFinite(this.valueOf()) ? "".concat(this.getUTCFullYear(), "-").concat(f(this.getUTCMonth() + 1), "-").concat(f(this.getUTCDate()), "T").concat(f(this.getUTCHours()), ":").concat(f(this.getUTCMinutes()), ":").concat(f(this.getUTCSeconds()), "Z") : null;
}, Boolean.prototype.toJSON = this_value, Number.prototype.toJSON = this_value, String.prototype.toJSON = this_value), typeof JSON.stringify !== 'function' && (meta = {
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"': '\\"',
'\\': '\\\\'
}, JSON.stringify = function (t, e, n) {
var r;
if (gap = '', indent = '', typeof n === 'number') for (r = 0; r < n; r += 1) {
indent += ' ';
} else typeof n === 'string' && (indent = n);
if (rep = e, e && typeof e !== 'function' && ((void 0 === e ? 'undefined' : _typeof(e)) !== 'object' || typeof e.length !== 'number')) throw new Error('JSON.stringify');
return str('', {
'': t
});
}), typeof JSON.parse !== 'function' && (JSON.parse = function (text, reviver) {
var j;
function walk(t, e) {
var n;
var r;
var o = t[e];
if (o && (void 0 === o ? 'undefined' : _typeof(o)) === 'object') for (n in o) {
Object.prototype.hasOwnProperty.call(o, n) && ((r = walk(o, n)) !== undefined ? o[n] = r : delete o[n]);
}
return reviver.call(t, e, o);
}
if (text = String(text), rx_dangerous.lastIndex = 0, rx_dangerous.test(text) && (text = text.replace(rx_dangerous, function (t) {
return "\\u".concat("0000".concat(t.charCodeAt(0).toString(16)).slice(-4));
})), rx_one.test(text.replace(rx_two, '@').replace(rx_three, ']').replace(rx_four, ''))) return j = eval("(".concat(text, ")")), typeof reviver === 'function' ? walk({
'': j
}, '') : j;
throw new SyntaxError('JSON.parse');
});
}();
}, function (t, e, n) {
var r = typeof Symbol === 'function' && (0, _typeof3.default)(Symbol.iterator) === 'symbol' ? function (t) {
return (0, _typeof3.default)(t);
} : function (t) {
return t && typeof Symbol === 'function' && t.constructor === Symbol && t !== Symbol.prototype ? 'symbol' : (0, _typeof3.default)(t);
};
var o = '[CODE_VERIFY]';
var a = ('postMessage' in window);
function i(t, e, n) {
var o = '';
if (arguments.length < 2 ? o = '[Msger] error 1' : (void 0 === t ? 'undefined' : r(t)) != 'object' ? o = '[Msger] error 2' : typeof e !== 'string' && (o = '[Msger] error 3'), o) throw new Error(o);
this.target = t, this.name = e, this.domain = n || '*';
}
function c(t, e) {
this.targets = {}, this.name = t, this.listenFunc = [], typeof (o = e || o) !== 'string' && (o = o.toString()), this.initListen();
}
i.prototype.send = a ? function (t) {
this.target.postMessage(t, this.domain);
} : function (t) {
var e = window.navigator[o + this.name];
if (typeof e !== 'function') throw new Error('target callback function is not defined');
e(t, window);
}, c.prototype.addTarget = function (t, e, n) {
var r = new i(t, e, n);
this.targets[e] = r;
}, c.prototype.initListen = function () {
var t = this;
var e = function e(_e3) {
(void 0 === _e3 ? 'undefined' : r(_e3)) == 'object' && _e3.data && (_e3 = _e3.data);
for (var _n6 = 0; _n6 < t.listenFunc.length; _n6++) {
t.listenFunc[_n6](_e3);
}
};
a ? 'addEventListener' in document ? window.addEventListener('message', e, !1) : 'attachEvent' in document && window.attachEvent('onmessage', e) : window.navigator[o + this.name] = e;
}, c.prototype.listen = function (t) {
this.listenFunc.push(t);
}, c.prototype.clear = function () {
this.listenFunc = [];
}, c.prototype.send = function (t) {
var e;
var n = this.targets;
for (e in n) {
n.hasOwnProperty(e) && n[e].send(t);
}
}, window.TCapMsg = c, t.exports = c;
},,,,,,, function (module, exports, __webpack_require__) {
var _typeof = typeof Symbol === 'function' && (0, _typeof3.default)(Symbol.iterator) === 'symbol' ? function (t) {
return (0, _typeof3.default)(t);
} : function (t) {
return t && typeof Symbol === 'function' && t.constructor === Symbol && t !== Symbol.prototype ? 'symbol' : (0, _typeof3.default)(t);
};
if (!0 === window.__TencentCaptchaExists__) throw new Error("\u8BF7\u52FF\u591A\u6B21\u5F15\u7528\u817E\u8BAF\u9A8C\u8BC1\u7801\u7684\u63A5\u5165js");
window.__TencentCaptchaExists__ = !0, __webpack_require__(17), __webpack_require__(8);
var Messenger = __webpack_require__(9);
var domReady = __webpack_require__(19);
var btoa = window.btoa || __webpack_require__(20);
var extend = Object.assign || __webpack_require__(2);
var loadScript = __webpack_require__(21);
var eventListener = __webpack_require__(5);
var Executor = __webpack_require__(22);
var isIEVar = __webpack_require__(23);
var isElement = __webpack_require__(24);
var invisibleIframe = __webpack_require__(25);
var getScriptDomain = __webpack_require__(26);
var scriptDomain = getScriptDomain() || '';
var isWechatDevtools = navigator.userAgent && /wechatdevtools/.test(navigator.userAgent);
var isWindows = /windows/i.test(navigator.userAgent);
var isMobile = !isWindows && ('ontouchstart' in window || 'ontouchstart' in document.createElement('div') || isWechatDevtools);
var capDomain = 'https://ssl.captcha.qq.com';
capDomain || (capDomain = scriptDomain);
var grayscaleFrameJs = '/tcaptcha-frame.2de3157b.js';
var grayscaleThreshold = 1;
var grayscaleAppId = ['123', '2100049389', '2100049390', '2046103261', '2070173641', '2060075756'];
var grayscaleProb = Math.random();
var needGrayscaleJs = void 0;
var jsLoadStatus = 'none';
var capError = __webpack_require__(3);
var preVerifyData = {};
var capObj = void 0;
var initQueue = [];
var defaultOpt = {
type: 'popup',
pos: isIEVar(6) ? 'absolute' : 'fixed',
lang: 2052,
showHeader: isMobile,
needFeedBack: true,
themeColor: '',
tcaptchaFlag: !0,
gettype: 'cap_union_prehandle',
domain: capDomain,
htdoc_path: capDomain
};
var noop = function noop() {};
var isGrayscaleAppId = function isGrayscaleAppId(t) {
if (needGrayscaleJs !== undefined) return needGrayscaleJs;
for (var e = 0, n = grayscaleAppId.length; e < n; e++) {
if (t == grayscaleAppId[e]) return needGrayscaleJs = !0;
}
return needGrayscaleJs = !1;
};
var callbackWrap = function callbackWrap(t, e) {
return function (n) {
(void 0 === n ? 'undefined' : _typeof(n)) === 'object' && (n = _objectSpread({
bizState: t.options.bizState,
appid: t.options.appid
}, n)), e && e(n);
};
};
var executor = new Executor(function () {
if (initQueue.length > 0) {
for (var t = 0; t < initQueue.length; t++) {
initQueue[t].show();
}
initQueue.length = 0;
}
}, 0);
var Captcha = function Captcha($btn, appid, _tcallback_, opts) {
var bizState = void 0;
if (isElement($btn)) {
if (appid && (void 0 === appid ? 'undefined' : _typeof(appid)) === 'object') opts = appid, appid = null, _tcallback_ = null;else {
if (appid = appid || $btn.getAttribute('data-appid'), !_tcallback_) {
var callbackName = $btn.getAttribute('data-cbfn');
try {
_tcallback_ = eval("window.".concat(callbackName));
} catch (e) {
throw new Error('Lost `callback`');
}
}
bizState = $btn.getAttribute('data-biz-state');
}
} else {
if (typeof $btn !== 'string' || typeof appid !== 'function') throw new Error('Arguments error.');
opts = _tcallback_, _tcallback_ = appid, appid = $btn, $btn = null;
}
opts = opts || {}, opts.callback = _tcallback_ || opts.callback, opts.start = opts.start || noop, opts.end = opts.end || noop;
var readyCallback = typeof opts.ready === 'function' ? opts.ready : noop;
if (opts.ready = function (t) {
readyCallback.call(this, t);
}, opts.appid = appid || opts.appid, opts.bizState = bizState || opts.bizState, opts.fwidth = parseFloat(opts.fwidth) || 0, opts.sdkOpts = opts.sdkOpts || null, opts.ele = $btn, this.options = opts, typeof opts.callback !== 'function') throw new Error('Lost `callback`');
if (this.initOpts = _objectSpread(_objectSpread({}, defaultOpt), opts), this.langFun(), $btn) {
var that = this;
eventListener.add($btn, 'click', function () {
that.show();
});
}
};
Captcha.prototype = {
show: function show() {
if (executor.isDone) this.__show__();else {
for (var t = 0; t < initQueue.length; t++) {
if (initQueue[t] === this) return;
}
initQueue.push(this);
}
},
__show__: function __show__() {
var t = this.initOpts;
if (typeof window.AqSCode === 'undefined') return capError.send('ERROR_TYPE_FRAMEJS_CODE_ERROR', t.appid), alert("\u9875\u9762\u52A0\u8F7D\u5F02\u5E38\uFF0C\u8BF7\u5237\u65B0\u9875\u9762\u91CD\u8BD5");
this.destroy();
var e = [];
for (var n in e.push("aid=".concat(t.appid)), e.push('accver=1'), e.push("showtype=".concat(t.type)), e.push("ua=".concat(encodeURIComponent(btoa((navigator.userAgent || '').replace(/[\u00ff-\uffff]+/g, ''))))), e.push("noheader=".concat("".concat(t.showHeader) == 'false' ? '1' : '0')), e.push("fb=".concat("".concat(t.needFeedBack) == 'false' ? '0' : '1')), e.push("enableDarkMode=".concat(t.enableDarkMode ? '1' : '0')), t.sid && e.push("sid=".concat(t.sid)), preVerifyData) {
preVerifyData[n] && e.push("".concat(n, "=").concat(encodeURIComponent(preVerifyData[n])));
}
t.uid = "".concat(t.uin || ''), needGrayscaleJs && (e.push('grayscale=1'), t.grayscale = 1), isMobile ? (e.push('clientype=1'), t.clientype = 1, t.forceLang && e.push("lang=".concat(t.forceLang)), t.params = "?".concat(e.join('&'))) : (e.push('clientype=2'), t.clientype = 2, needGrayscaleJs && t.forceLang && e.push("lang=".concat(t.forceLang)), t.params = "?".concat(e.join('&')), t.s_type_suffix = "?".concat(e.join('&')), t.src = "".concat(capDomain, "/template/new_placeholder.html").concat(t.s_type_suffix), t.s_type = "".concat(capDomain, "/cap_union_prehandle").concat(t.s_type_suffix), t.slide_src = "".concat(capDomain, "/template/new_slide_placeholder.html").concat(t.s_type_suffix), t.fb = "".concat(t.needFeedBack) == 'false' ? '0' : '1'), (capObj = new AqSCode(t)).listen(callbackWrap(this, t.callback), callbackWrap(this, t.ready)), capObj.start(callbackWrap(t.start)), capObj.end(callbackWrap(t.end)), needGrayscaleJs ? ((t.top || t.left) && capObj.initPos({
top: t.top || undefined,
left: t.left || undefined
}), capObj.create()) : isMobile && ((t.top || t.left) && capObj.initPos({
top: t.top || undefined,
left: t.left || undefined
}), capObj.create());
},
langFun: function langFun() {
if (this.initOpts.forceLang) {
var t = {
'zh-cn': '2052',
'zh-hk': '1028',
en: '1033'
};
var e = this.initOpts.forceLang;
t[e] ? (this.initOpts.lang = t[e], this.initOpts.forceLang = t[e], this.initOpts.forcestyle = 1) : this.initOpts.forceLang = '';
}
},
destroy: function destroy() {
capObj && capObj.destroy && capObj.destroy();
},
refresh: function refresh() {
capObj && capObj.refresh && capObj.refresh();
},
getTicket: function getTicket() {
if (capObj && capObj.getTicket) {
var t = null;
return callbackWrap(this, function (e) {
t = e;
})(capObj.getTicket()), t;
}
return null;
}
};
var autoBindBtn = function autoBindBtn() {
var t = document.getElementById('TencentCaptcha');
t && new Captcha(t);
};
executor.exec(function (t) {
domReady(function () {
try {
autoBindBtn();
} catch (e) {}
new Messenger('TCaptchaVerifyDetect').listen(function (t) {
if (t && (void 0 === t ? 'undefined' : _typeof(t)) === 'object') switch (t.type) {
case 'preVerify':
extend(preVerifyData, t.data);
}
});
try {
invisibleIframe("".concat(capDomain, "/template/captcha-pre-verify.html"));
} catch (e) {}
t();
});
}), executor.exec(function (t) {
jsLoadStatus = 'loading', needGrayscaleJs = !0, loadScript(grayscaleFrameJs, capDomain, capDomain, function () {
return !!window.AqSCode;
}, function () {
jsLoadStatus = 'loaded', t();
}, function () {
jsLoadStatus = 'none', capError.send('ERROR_TYPE_FRAMEJS_DOWNLOAD_FAIL'), t();
});
}), window.TencentCaptcha = Captcha;
}, function (t, e, n) {
var r = n(18);
typeof r === 'string' && (r = [[t.i, r, '']]);
n(7)(r, {});
r.locals && (t.exports = r.locals);
}, function (t, e, n) {
(t.exports = n(6)(!1)).push([t.i, '@keyframes animate_dots{0%{opacity:1}to{opacity:0}}@-webkit-keyframes animate_dots{0%{opacity:1}to{opacity:0}}.dot0,.dot1{animation:animate_dots .9s infinite;-moz-animation:animate_dots .9s infinite;-webkit-animation:animate_dots .9s infinite;-o-animation:animate_dots .9s infinite}.dot1{animation-delay:.2s;-webkit-animation-delay:.2s}.dot2{animation:animate_dots .9s infinite;-moz-animation:animate_dots .9s infinite;-webkit-animation:animate_dots .9s infinite;-o-animation:animate_dots .9s infinite;animation-delay:.4s;-webkit-animation-delay:.4s}.dots_item{display:inline-block;margin-right:5px;width:10px;height:10px;border-radius:50%;background:#4886ff}.verify-icon{position:absolute;width:100%;margin-top:70px;text-align:center}.t-mask{width:100%;height:100%;position:fixed;_position:absolute;left:0;top:0;background:#000;opacity:.5;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50);z-index:2000000000}', '']);
}, function (t, e, n) {
t.exports = function (t) {
var _e5;
var n = [];
var r = document;
var o = r.documentElement;
var a = o.doScroll;
var i = (a ? /^loaded|^c/ : /^loaded|c/).test(r.readyState);
function c(t) {
for (i = 1; t = n.shift();) {
t();
}
}
return r.addEventListener && r.addEventListener('DOMContentLoaded', _e5 = function e() {
r.removeEventListener('DOMContentLoaded', _e5, !1), c();
}, !1), a && r.attachEvent('onreadystatechange', _e5 = function _e4() {
/^c/.test(r.readyState) && (r.detachEvent('onreadystatechange', _e5), c());
}), t = a ? function (e) {
self != top ? i ? e() : n.push(e) : function () {
try {
o.doScroll('left');
} catch (n) {
return setTimeout(function () {
t(e);
}, 50);
}
e();
}();
} : function (t) {
i ? t() : n.push(t);
};
}();
}, function (t, e, n) {
var r = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
var o = function o(t) {
var e = [0, 2, 1][t.length % 3];
var n = t.charCodeAt(0) << 16 | (t.length > 1 ? t.charCodeAt(1) : 0) << 8 | (t.length > 2 ? t.charCodeAt(2) : 0);
return [r.charAt(n >>> 18), r.charAt(n >>> 12 & 63), e >= 2 ? '=' : r.charAt(n >>> 6 & 63), e >= 1 ? '=' : r.charAt(63 & n)].join('');
};
t.exports = function (t) {
return t.replace(/[\s\S]{1,3}/g, o);
};
}, function (t, e, n) {
var r = 2;
t.exports = function o(t, e, n, a, i, c, s) {
s = s || 1;
var u = !1;
var p = document.createElement('script');
function f(t) {
u || (t && t.type === 'load' || /^(loaded|complete)$/.test(this.readyState)) && (a() ? (u = !0, i && i()) : l());
}
p.type = 'text/javascript', p.async = !0, p.src = (s > 1 ? n : e) + t, 'onload' in p ? p.onload = f : p.onreadystatechange = f;
var l = function l() {
u || (u = !0, s >= r ? c && c() : o(t, e, n, a, i, c, s + 1));
};
p.onerror = l, document.getElementsByTagName('head').item(0).appendChild(p);
};
}, function (t, e, n) {
var r = function r(t, e) {
this.i = 0, this.doneCallback = t, this.isDone = !1, this.timeout = e || 0;
var n = this;
this.immediateExec = setTimeout(function () {
n.doneCheck();
}, 0);
};
r.prototype = {
doneCheck: function doneCheck(t, e) {
try {
t && t(e);
} catch (n) {}
if (this.i--, this.i <= 0) try {
this.isDone = !0, this.doneCallback();
} catch (n) {}
},
exec: function exec(t, e, n) {
clearTimeout(this.immediateExec);
var r = !1;
var o = '';
var a = this;
this.i++, this.i > 0 && (this.isDone = !1);
try {
(o = t(function (t) {
r || (r = !0, setTimeout(function () {
a.doneCheck(e, t);
}, 0));
})) && (r = !0, setTimeout(function () {
a.doneCheck(e, o);
}, 0));
} catch (i) {}
(n = n || this.timeout || 0) > 0 && setTimeout(function () {
r || (r = !0, a.doneCheck(e, ''));
}, n);
}
}, t.exports = r;
}, function (t, e, n) {
t.exports = function (t) {
var e = document.createElement('b');
return e.innerHTML = "<!--[if IE ".concat(t, "]><i></i><![endif]-->"), e.getElementsByTagName('i') && e.getElementsByTagName('i').length === 1;
};
}, function (t, e, n) {
var r = typeof Symbol === 'function' && (0, _typeof3.default)(Symbol.iterator) === 'symbol' ? function (t) {
return (0, _typeof3.default)(t);
} : function (t) {
return t && typeof Symbol === 'function' && t.constructor === Symbol && t !== Symbol.prototype ? 'symbol' : (0, _typeof3.default)(t);
};
t.exports = function (t) {
try {
return t instanceof HTMLElement;
} catch (e) {
return (void 0 === t ? 'undefined' : r(t)) === 'object' && t.nodeType === 1 && r(t.style) === 'object' && r(t.ownerDocument) === 'object';
}
};
}, function (t, e, n) {
t.exports = function (t) {
var e = document.createElement('iframe');
return e.src = t, e.style.cssText = 'width: 0px; height: 0px; display: none;', (document.body || document.getElementsByTagName('body').item('0')).appendChild(e), e;
};
}, function (t, e, n) {
var r = n(0).href;
var o = function o(t) {
var e = t.split('?');
if (e.length !== 2) return {};
for (var n = e[1] && e[1].split('&'), r = {}, o = 0; o < n.length; o++) {
var _a4 = n[o].split('=');
_a4[1] && (r[_a4[0]] = decodeURIComponent(_a4[1]));
}
return r;
};
var a = function a() {
for (var _t2 = document.getElementsByTagName('script'), _e6 = 0; _e6 < _t2.length; _e6++) {
var _n7 = _t2[_e6];
if (_n7.src.match(/captcha\.js/i)) return _n7;
}
};
t.exports = function () {
try {
var _t3 = document.getElementById('CaptchaScript') || a() || '';
if (!_t3) return '';
var _e7 = _t3.src;
var _n8 = o(_e7).domain;
if (_n8) return _n8;
var i = /(https?\:\/\/[0-9a-zA-Z-:\.]+)\//i;
var c = _e7.match(i) || r().match(i);
return c ? c[1] : '';
} catch (s) {
return '';
}
};
}]);