devfab 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -31
- package/dist/common/models.esm.js +2 -2
- package/dist/common/models.js +2 -2
- package/dist/common/require.esm.js +2 -2
- package/dist/common/require.js +2 -2
- package/dist/common/utils.esm.js +2 -2
- package/dist/common/utils.js +2 -2
- package/dist/index.esm.js +2 -2
- package/dist/index.js +2 -2
- package/dist/index.umd.js +2 -2
- package/lib/devfab.js +130 -125
- package/lib/devfab.min.js +2 -2
- package/lib/devfab.require.js +74 -122
- package/lib/devfab.require.min.js +2 -2
- package/package.json +1 -1
package/lib/devfab.require.js
CHANGED
|
@@ -25,14 +25,6 @@
|
|
|
25
25
|
writable: !1
|
|
26
26
|
}), e;
|
|
27
27
|
}
|
|
28
|
-
function _defineProperty(e, r, t) {
|
|
29
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
30
|
-
value: t,
|
|
31
|
-
enumerable: !0,
|
|
32
|
-
configurable: !0,
|
|
33
|
-
writable: !0
|
|
34
|
-
}) : e[r] = t, e;
|
|
35
|
-
}
|
|
36
28
|
function _getPrototypeOf(t) {
|
|
37
29
|
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
38
30
|
return t.__proto__ || Object.getPrototypeOf(t);
|
|
@@ -58,27 +50,6 @@
|
|
|
58
50
|
return !!t;
|
|
59
51
|
})();
|
|
60
52
|
}
|
|
61
|
-
function ownKeys(e, r) {
|
|
62
|
-
var t = Object.keys(e);
|
|
63
|
-
if (Object.getOwnPropertySymbols) {
|
|
64
|
-
var o = Object.getOwnPropertySymbols(e);
|
|
65
|
-
r && (o = o.filter(function (r) {
|
|
66
|
-
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
67
|
-
})), t.push.apply(t, o);
|
|
68
|
-
}
|
|
69
|
-
return t;
|
|
70
|
-
}
|
|
71
|
-
function _objectSpread2(e) {
|
|
72
|
-
for (var r = 1; r < arguments.length; r++) {
|
|
73
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
74
|
-
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
75
|
-
_defineProperty(e, r, t[r]);
|
|
76
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
77
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
return e;
|
|
81
|
-
}
|
|
82
53
|
function _possibleConstructorReturn(t, e) {
|
|
83
54
|
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
|
84
55
|
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
@@ -113,8 +84,6 @@
|
|
|
113
84
|
}, _typeof(o);
|
|
114
85
|
}
|
|
115
86
|
|
|
116
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
117
|
-
|
|
118
87
|
// ======================================================
|
|
119
88
|
/** vim: et:ts=4:sw=4:sts=4
|
|
120
89
|
* @license RequireJS 2.3.2 Copyright jQuery Foundation and other contributors.
|
|
@@ -124,8 +93,7 @@
|
|
|
124
93
|
// problems with requirejs.exec()/transpiler plugins that may not be strict.
|
|
125
94
|
/* jslint regexp: true, nomen: true, sloppy: true */
|
|
126
95
|
/* global window, navigator, document, importScripts, setTimeout, opera */
|
|
127
|
-
var
|
|
128
|
-
window.__devfab_requirejs = __devfab_requirejs;
|
|
96
|
+
var __requirejs = {};
|
|
129
97
|
(function (global, setTimeout) {
|
|
130
98
|
var requirejs, require, define;
|
|
131
99
|
var req;
|
|
@@ -2130,22 +2098,22 @@
|
|
|
2130
2098
|
// eslint-disable-next-line no-eval
|
|
2131
2099
|
return eval(text);
|
|
2132
2100
|
};
|
|
2133
|
-
|
|
2134
|
-
|
|
2101
|
+
__requirejs.require = require;
|
|
2102
|
+
__requirejs.define = define;
|
|
2135
2103
|
// Set up with config info.
|
|
2136
2104
|
req(cfg);
|
|
2137
|
-
})(
|
|
2105
|
+
})(typeof window !== 'undefined' ? window : globalThis, typeof setTimeout === 'undefined' ? undefined : setTimeout)
|
|
2138
2106
|
|
|
2139
2107
|
/* ----------------------------------------------------------------------------
|
|
2140
2108
|
* 以下为本地适配层,不属于 RequireJS 原始文件内容。
|
|
2141
2109
|
* -------------------------------------------------------------------------- */;
|
|
2142
2110
|
(function (global) {
|
|
2143
|
-
if (
|
|
2111
|
+
if (__requirejs.__requirejsAdapterApplied) {
|
|
2144
2112
|
return;
|
|
2145
2113
|
}
|
|
2146
|
-
|
|
2147
|
-
var rawRequire =
|
|
2148
|
-
var rawDefine =
|
|
2114
|
+
__requirejs.__requirejsAdapterApplied = true;
|
|
2115
|
+
var rawRequire = __requirejs.require;
|
|
2116
|
+
var rawDefine = __requirejs.define;
|
|
2149
2117
|
var require = function require(_domain, _deps, _callback, _errback) {
|
|
2150
2118
|
var domain = _domain;
|
|
2151
2119
|
var deps = _deps;
|
|
@@ -2207,10 +2175,15 @@
|
|
|
2207
2175
|
require[prop] = rawRequire[prop];
|
|
2208
2176
|
}
|
|
2209
2177
|
}
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2178
|
+
|
|
2179
|
+
// 标记本身是为了让人能**验证**适配层究竟有没有生效(测试与现场排查都用它),
|
|
2180
|
+
// 不然「域前缀到底拼没拼」只能靠猜。
|
|
2181
|
+
require.__devfabAdapterApplied = true;
|
|
2182
|
+
define.__devfabAdapterApplied = true;
|
|
2183
|
+
__requirejs._require = rawRequire;
|
|
2184
|
+
__requirejs._define = rawDefine;
|
|
2185
|
+
__requirejs.require = require;
|
|
2186
|
+
__requirejs.define = define;
|
|
2214
2187
|
})();
|
|
2215
2188
|
|
|
2216
2189
|
/**
|
|
@@ -2533,7 +2506,7 @@
|
|
|
2533
2506
|
*/
|
|
2534
2507
|
|
|
2535
2508
|
/** 默认盯防的 key:出现即说明宿主的关键设施被动过 */
|
|
2536
|
-
var DEFAULT_WATCH = ['$', 'jQuery', 'define', 'require', 'requirejs', 'devfab', '__devfab'
|
|
2509
|
+
var DEFAULT_WATCH = ['$', 'jQuery', 'define', 'require', 'requirejs', 'devfab', '__devfab'];
|
|
2537
2510
|
var GlobalGuard = /*#__PURE__*/function () {
|
|
2538
2511
|
function GlobalGuard(options) {
|
|
2539
2512
|
_classCallCheck(this, GlobalGuard);
|
|
@@ -2720,22 +2693,30 @@
|
|
|
2720
2693
|
};
|
|
2721
2694
|
var BaseFileRequire = /*#__PURE__*/function () {
|
|
2722
2695
|
/**
|
|
2723
|
-
* args
|
|
2724
|
-
* - 底层加载器覆盖:`define` / `require` / `undef` / `requireConfig` / `importer`
|
|
2696
|
+
* args 只接受**参数与策略**,不接受加载器覆盖:
|
|
2725
2697
|
* - 加载策略:`version` / `timeout` / `retry` / `strict` / `baseUrl` / `manifest`
|
|
2726
2698
|
* / `origins` / `lockVersion` / `verifyHash` / `pollution` / `watch` / `maxPollution`
|
|
2727
|
-
*
|
|
2699
|
+
* - 通道与时钟:`importer`(ESM 通道用的 import 函数)、`setTimeout` / `clearTimeout`
|
|
2700
|
+
*
|
|
2701
|
+
* 刻意**不再接受** `define` / `require` / `undef` / `requireConfig`:
|
|
2702
|
+
* 这四个是 AMD 加载器本体,AMD 通道只走内嵌的 RequireJS 2.3.2。以前允许覆盖的
|
|
2703
|
+
* 后果是「宿主传了自己的 require,但 undef 仍取内嵌的那份」,两套注册表混用,
|
|
2704
|
+
* 而且被覆盖时是静默的。要换通道请用 `loadModules()`,不要替换加载器。
|
|
2705
|
+
*
|
|
2706
|
+
* 其余配置一律走 `configure(options)` 在运行时改。
|
|
2728
2707
|
*/
|
|
2729
2708
|
function BaseFileRequire(args) {
|
|
2730
|
-
var
|
|
2709
|
+
var _this$__require;
|
|
2731
2710
|
_classCallCheck(this, BaseFileRequire);
|
|
2732
2711
|
var o = args || {};
|
|
2733
|
-
|
|
2712
|
+
// 只有显式传参才写全局。模块加载时会 new 一次单例,若无条件写 false,
|
|
2713
|
+
// 宿主在 import 之前设好的 `window.__devfab.debug` 会被抹掉。
|
|
2714
|
+
if (o.debug !== undefined) this.debug = !!o.debug;
|
|
2734
2715
|
this.__rootPath = undefined;
|
|
2735
|
-
this.__define =
|
|
2736
|
-
this.__require =
|
|
2737
|
-
this.__undef =
|
|
2738
|
-
this.__requireConfig =
|
|
2716
|
+
this.__define = __requirejs.define;
|
|
2717
|
+
this.__require = __requirejs.require;
|
|
2718
|
+
this.__undef = typeof ((_this$__require = this.__require) === null || _this$__require === void 0 ? void 0 : _this$__require.undef) === 'function' ? this.__require.undef : null;
|
|
2719
|
+
this.__requireConfig = this._pickRequireConfig(this.__require);
|
|
2739
2720
|
this.__import = o.importer || null;
|
|
2740
2721
|
this._setTimer = o.setTimeout || function (fn, ms) {
|
|
2741
2722
|
return setTimeout(fn, ms);
|
|
@@ -2756,15 +2737,34 @@
|
|
|
2756
2737
|
}
|
|
2757
2738
|
|
|
2758
2739
|
/**
|
|
2759
|
-
*
|
|
2760
|
-
*
|
|
2740
|
+
* 调试开关的**唯一来源**是 `window.__devfab.debug`。
|
|
2741
|
+
*
|
|
2742
|
+
* 为什么做成访问器:这个开关被三处读——加载器这里、`_utils/models/_extend.js` 的
|
|
2743
|
+
* 扩展脚本装配、`_utils/string.js` 的 isDebug。以前各读各的(实例字段 /
|
|
2744
|
+
* `window.__devfab.debug` / `window.devfab.debug`),宿主开了一个另两个不生效,
|
|
2745
|
+
* 排查时看起来像「日志不打印」。统一读写同一个位置后,`FileRequire.configure({debug:true})`、
|
|
2746
|
+
* `FileRequire.debug = true`、`window.__devfab.debug = true` 三句话效果完全一致。
|
|
2761
2747
|
*/
|
|
2762
2748
|
return _createClass(BaseFileRequire, [{
|
|
2749
|
+
key: "debug",
|
|
2750
|
+
get: function get() {
|
|
2751
|
+
var ns = typeof window !== 'undefined' ? window.__devfab : null;
|
|
2752
|
+
return !!(ns && ns.debug);
|
|
2753
|
+
},
|
|
2754
|
+
set: function set(value) {
|
|
2755
|
+
if (typeof window === 'undefined') return;
|
|
2756
|
+
window.__devfab = window.__devfab || {};
|
|
2757
|
+
window.__devfab.debug = !!value;
|
|
2758
|
+
}
|
|
2759
|
+
|
|
2760
|
+
/**
|
|
2761
|
+
* urlArgs 只能配在真正在用的那个 require 上。AMD 通道固定用内嵌 RequireJS,
|
|
2762
|
+
* 所以这里只从传入的加载器上取 config,不再回落到任何全局。
|
|
2763
|
+
*/
|
|
2764
|
+
}, {
|
|
2763
2765
|
key: "_pickRequireConfig",
|
|
2764
2766
|
value: function _pickRequireConfig(loader) {
|
|
2765
|
-
|
|
2766
|
-
var req = loader && typeof loader.config === 'function' ? loader : (_window$__devfab_requ3 = window.__devfab_requirejs) === null || _window$__devfab_requ3 === void 0 ? void 0 : _window$__devfab_requ3.require;
|
|
2767
|
-
return req && typeof req.config === 'function' ? req.config.bind(req) : null;
|
|
2767
|
+
return loader && typeof loader.config === 'function' ? loader.config.bind(loader) : null;
|
|
2768
2768
|
}
|
|
2769
2769
|
}, {
|
|
2770
2770
|
key: "_guardOptions",
|
|
@@ -2797,7 +2797,7 @@
|
|
|
2797
2797
|
key: "configure",
|
|
2798
2798
|
value: function configure(options) {
|
|
2799
2799
|
var o = options || {};
|
|
2800
|
-
if (o.debug !== undefined) this.
|
|
2800
|
+
if (o.debug !== undefined) this.debug = !!o.debug;
|
|
2801
2801
|
if (o.version !== undefined) this.setVersion(o.version);
|
|
2802
2802
|
if (o.timeout !== undefined) this.options.timeout = Math.max(0, toNumber(o.timeout, this.options.timeout));
|
|
2803
2803
|
if (o.retry !== undefined) this.options.retry = Math.max(0, toNumber(o.retry, this.options.retry));
|
|
@@ -2847,47 +2847,12 @@
|
|
|
2847
2847
|
return this.options.version;
|
|
2848
2848
|
}
|
|
2849
2849
|
|
|
2850
|
-
/**
|
|
2851
|
-
* 导出本实例的配置快照,供 `create()` 派生新实例时继承。
|
|
2852
|
-
*
|
|
2853
|
-
* 为什么需要:`create()` 原先是彻底干净的实例,于是宿主在单例上
|
|
2854
|
-
* `configure({ manifest, lockVersion })` 之后,`_utils/models/_extend.js` 里那句
|
|
2855
|
-
* `FileRequire.create({ require }).require(...)` 完全不受约束 —— 扩展脚本主链路上
|
|
2856
|
-
* 登记制与版本锁等于没开。派生时继承配置,这个缺口才闭合。
|
|
2857
|
-
*
|
|
2858
|
-
* 刻意**不包含加载器**(`define` / `require` / `undef` / `requireConfig` / `importer`):
|
|
2859
|
-
* 构造函数会按当前 `window.__devfab_requirejs` 重新取,派生实例拿到的是「此刻真正
|
|
2860
|
-
* 在用的那个加载器」,而不是父实例构造时捕获的旧引用。要指定加载器请显式传,
|
|
2861
|
-
* `create({ require })` 会覆盖。
|
|
2862
|
-
*/
|
|
2863
|
-
}, {
|
|
2864
|
-
key: "_snapshotConfig",
|
|
2865
|
-
value: function _snapshotConfig() {
|
|
2866
|
-
return {
|
|
2867
|
-
__debug: this.__debug,
|
|
2868
|
-
version: this.options.version,
|
|
2869
|
-
timeout: this.options.timeout,
|
|
2870
|
-
retry: this.options.retry,
|
|
2871
|
-
strict: this.options.strict,
|
|
2872
|
-
baseUrl: this.options.baseUrl,
|
|
2873
|
-
manifest: this.policy.manifest,
|
|
2874
|
-
origins: this.policy.origins,
|
|
2875
|
-
lockVersion: this.policy.lockVersion,
|
|
2876
|
-
verifyHash: this.policy.verifyHash,
|
|
2877
|
-
fetch: this.policy.fetch,
|
|
2878
|
-
pollution: this.guard.enabled,
|
|
2879
|
-
watch: this.guard.watch,
|
|
2880
|
-
maxPollution: this.guard.maxPollution,
|
|
2881
|
-
target: this.guard.target
|
|
2882
|
-
};
|
|
2883
|
-
}
|
|
2884
|
-
|
|
2885
2850
|
/** 策略 + 兜底配置摘要,宿主启动时打一行日志排查效率最高 */
|
|
2886
2851
|
}, {
|
|
2887
2852
|
key: "describe",
|
|
2888
2853
|
value: function describe() {
|
|
2889
2854
|
return Object.assign({}, this.options, {
|
|
2890
|
-
debug: this.
|
|
2855
|
+
debug: this.debug,
|
|
2891
2856
|
policy: this.policy.describe(),
|
|
2892
2857
|
pollutionGuard: this.guard.enabled,
|
|
2893
2858
|
canUndef: typeof this.__undef === 'function',
|
|
@@ -3195,15 +3160,10 @@
|
|
|
3195
3160
|
}
|
|
3196
3161
|
_inherits(FileRequireClass, _BaseFileRequire);
|
|
3197
3162
|
return _createClass(FileRequireClass, [{
|
|
3198
|
-
key: "
|
|
3199
|
-
value: function
|
|
3163
|
+
key: "provide",
|
|
3164
|
+
value: function provide(path, files, callback) {
|
|
3200
3165
|
this._define(path, files, callback);
|
|
3201
3166
|
}
|
|
3202
|
-
}, {
|
|
3203
|
-
key: "defineScript",
|
|
3204
|
-
value: function defineScript(o) {
|
|
3205
|
-
this.provideScript(o);
|
|
3206
|
-
}
|
|
3207
3167
|
}, {
|
|
3208
3168
|
key: "provideScript",
|
|
3209
3169
|
value: function provideScript(o) {
|
|
@@ -3213,11 +3173,11 @@
|
|
|
3213
3173
|
return o;
|
|
3214
3174
|
};
|
|
3215
3175
|
}
|
|
3216
|
-
this.
|
|
3176
|
+
this.provide([], callback);
|
|
3217
3177
|
}
|
|
3218
3178
|
}, {
|
|
3219
|
-
key: "
|
|
3220
|
-
value: function
|
|
3179
|
+
key: "inject",
|
|
3180
|
+
value: function inject(path, files, callback) {
|
|
3221
3181
|
this._load(path, files, callback);
|
|
3222
3182
|
}
|
|
3223
3183
|
}, {
|
|
@@ -3245,32 +3205,24 @@
|
|
|
3245
3205
|
if (typeof error === 'function') {
|
|
3246
3206
|
error(result);
|
|
3247
3207
|
} else {
|
|
3248
|
-
self.
|
|
3208
|
+
self.debug && console.error('[devfab][FileRequire][injectScript] error: ', result);
|
|
3249
3209
|
}
|
|
3250
3210
|
}
|
|
3251
3211
|
}
|
|
3252
|
-
this.
|
|
3253
|
-
}
|
|
3254
|
-
}, {
|
|
3255
|
-
key: "requireScript",
|
|
3256
|
-
value: function requireScript(_path, _files, _callback) {
|
|
3257
|
-
this.injectScript(_path, _files, _callback);
|
|
3212
|
+
this.inject(path, files, onCallback);
|
|
3258
3213
|
}
|
|
3259
3214
|
}]);
|
|
3260
3215
|
}(BaseFileRequire);
|
|
3216
|
+
/**
|
|
3217
|
+
* 全局唯一的加载器实例。
|
|
3218
|
+
*
|
|
3219
|
+
* 加载策略(清单 / 白名单 / 版本锁)、全局污染观测、超时重试
|
|
3220
|
+
* 都是**部署级**约定,一个页面只应该有一套。
|
|
3221
|
+
*/
|
|
3261
3222
|
var FileRequire = new FileRequireClass();
|
|
3262
|
-
FileRequire.create = function (args) {
|
|
3263
|
-
return new FileRequireClass(_objectSpread2(_objectSpread2({}, this._snapshotConfig()), args));
|
|
3264
|
-
};
|
|
3265
3223
|
|
|
3266
3224
|
window.__devfab = Object.assign({}, window.__devfab);
|
|
3267
3225
|
window.__devfab.FileRequire = FileRequire;
|
|
3268
|
-
window.__devfab.filePolicy = {
|
|
3269
|
-
LoadPolicy: LoadPolicy,
|
|
3270
|
-
GlobalGuard: GlobalGuard,
|
|
3271
|
-
CODE_POLICY: CODE_POLICY,
|
|
3272
|
-
CODE_TIMEOUT: CODE_TIMEOUT
|
|
3273
|
-
};
|
|
3274
3226
|
|
|
3275
3227
|
exports.CODE_POLICY = CODE_POLICY;
|
|
3276
3228
|
exports.CODE_TIMEOUT = CODE_TIMEOUT;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).devfab=e.devfab||{},e.devfab.require={}))}(this,function(exports){"use strict";function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _callSuper(e,t,r){return t=_getPrototypeOf(t),_possibleConstructorReturn(e,_isNativeReflectConstruct()?Reflect.construct(t,r||[],_getPrototypeOf(e).constructor):t.apply(e,r))}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_toPropertyKey(i.key),i)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).devfab=e.devfab||{},e.devfab.require={}))}(this,function(exports){"use strict";function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _callSuper(e,t,r){return t=_getPrototypeOf(t),_possibleConstructorReturn(e,_isNativeReflectConstruct()?Reflect.construct(t,r||[],_getPrototypeOf(e).constructor):t.apply(e,r))}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,_toPropertyKey(i.key),i)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}function _possibleConstructorReturn(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _toPrimitive(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:t+""}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}
|
|
2
2
|
/** vim: et:ts=4:sw=4:sts=4
|
|
3
3
|
* @license RequireJS 2.3.2 Copyright jQuery Foundation and other contributors.
|
|
4
4
|
* Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
|
|
5
|
-
*/window.__devfab_requirejs=__devfab_requirejs,function(global,setTimeout){var requirejs,require,define,req,s,head,baseElement,dataMain,src,body,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.2",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){var r;if(e)for(r=0;r<e.length&&(!e[r]||!t(e[r],r,e));r+=1);}function eachReverse(e,t){var r;if(e)for(r=e.length-1;r>-1&&(!e[r]||!t(e[r],r,e));r-=1);}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var r;for(r in e)if(hasProp(e,r)&&t(e[r],r))break}function mixin(e,t,r,i){return t&&eachProp(t,function(t,n){!r&&hasProp(e,n)||(!i||"object"!==_typeof(t)||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[n]=t:(e[n]||(e[n]={}),mixin(e[n],t,r,i)))}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,r,i){var n=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return n.requireType=e,n.requireModules=i,r&&(n.originalError=r),n}if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,r,i){var n,o,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=r,r=i):e=[]),o&&o.context&&(a=o.context),s.name&&(a=s.name),(n=getOwn(contexts,a))||(n=contexts[a]=req.s.newContext(a,s)),o&&n.configure(o),n.require(e,t,r)},req.config=function(e){return req(e)},req.nextTick=void 0!==setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$|\.css$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],body=s.body=document.getElementsByTagName("body")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,r){var i,n="";try{r.split("?")[0].endsWith(".css")&&(n="css")}catch(e){}return"css"===n?((i=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:link"):document.createElement("link")).href=r,i.rel="stylesheet",i.type=e.linkType||"text/css",i):((i=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script")).type=e.scriptType||"text/javascript",i.charset="utf-8",i.async=!1,i)},req.load=function(e,t,r){var i,n=e&&e.config||{};if(isBrowser)return(i=req.createNode(n,t,r)).setAttribute("data-requirecontext",e.contextName),i.setAttribute("data-requiremodule",t),!i.attachEvent||i.attachEvent.toString&&i.attachEvent.toString().indexOf("[native code")<0||isOpera?(i.addEventListener("load",e.onScriptLoad,!1),i.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,i.attachEvent("onreadystatechange",e.onScriptLoad)),i.src=r,n.onNodeCreated&&n.onNodeCreated(i,n,t,r),currentlyAddingScript=i,baseElement?head.insertBefore(i,baseElement):body?body.appendChild(i):head.appendChild(i),currentlyAddingScript=null,i;if(isWebWorker)try{setTimeout(function(){},0),importScripts(r),e.completeLoad(t)}catch(i){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+r,i,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){if(head||(head=e.parentNode),dataMain=e.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||-1!==mainScript.indexOf("!")||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(e,t,r){var i,n;"string"!=typeof e&&(r=t,t=e,e=null),isArray(t)||(r=t,t=null),!t&&isFunction(r)&&(t=[],r.length&&(r.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(e,r){t.push(r)}),t=(1===r.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&(i=currentlyAddingScript||getInteractiveScript())&&(e||(e=i.getAttribute("data-requiremodule")),n=contexts[i.getAttribute("data-requirecontext")]),n?(n.defQueue.push([e,t,r]),n.defQueueMap[e]=!0):globalDefQueue.push([e,t,r])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},__devfab_requirejs.require=require,__devfab_requirejs.define=define,req(cfg)}function newContext(e){var t,r,i,n,o,s={waitSeconds:(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).waitSeconds||30,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},a={},u={},c={},l=[],f={},d={},p={},h=1,m=1;function g(e,t,r){var i,n,o,a,u,c,l,f,d,p,h=t&&t.split("/"),m=s.map,g=m&&m["*"];if(e&&(c=(e=e.split("/")).length-1,s.nodeIdCompat&&jsSuffixRegExp.test(e[c])&&(e[c]=e[c].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),function(e){var t,r;for(t=0;t<e.length;t++)if("."===(r=e[t]))e.splice(t,1),t-=1;else if(".."===r){if(0===t||1===t&&".."===e[2]||".."===e[t-1])continue;t>0&&(e.splice(t-1,2),t-=2)}}(e),e=e.join("/")),r&&m&&(h||g)){for(o=(n=e.split("/")).length;o>0;o-=1){if(u=n.slice(0,o).join("/"),h){var v=!1;for(a=h.length;a>0;a-=1)if((i=getOwn(m,h.slice(0,a).join("/")))&&(i=getOwn(i,u))){l=i,f=o,v=!0;break}if(v)break}!d&&g&&getOwn(g,u)&&(d=getOwn(g,u),p=o)}!l&&d&&(l=d,f=p),l&&(n.splice(0,f,l),e=n.join("/"))}return getOwn(s.pkgs,e)||e}function v(e){isBrowser&&each(scripts(),function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===i.contextName)return t.parentNode.removeChild(t),!0})}function y(e){var t=getOwn(s.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),i.require.undef(e),i.makeRequire(null,{skipMap:!0})([e]),!0}function b(e){var t,r=e?e.indexOf("!"):-1;return r>-1&&(t=e.substring(0,r),e=e.substring(r+1,e.length)),[t,e]}function _(e,t,r,n){var o,s,a,u,c=null,l=t?t.name:null,d=e,p=!0,v="";return e||(p=!1,e="_@r"+(h+=1)),c=(u=b(e))[0],e=u[1],c&&(c=g(c,l,n),s=getOwn(f,c)),e&&(c?v=s&&s.normalize?s.normalize(e,function(e){return g(e,l,n)}):-1===e.indexOf("!")?g(e,l,n):e:(c=(u=b(v=g(e,l,n)))[0],v=u[1],r=!0,o=i.nameToUrl(v))),{prefix:c,name:v,parentMap:t,unnormalized:!!(a=!c||s||r?"":"_unnormalized"+(m+=1)),url:o,originalName:d,isDefine:p,id:(c?c+"!"+v:v)+a}}function x(e){var t=e.id,r=getOwn(a,t);return r||(r=a[t]=new i.Module(e)),r}function k(e,t,r){var i=e.id,n=getOwn(a,i);!hasProp(f,i)||n&&!n.defineEmitComplete?(n=x(e)).error&&"error"===t?r(n.error):n.on(t,r):"defined"===t&&r(f[i])}function w(e,t){var r=e.requireModules,i=!1;t?t(e):(each(r,function(t){var r=getOwn(a,t);r&&(r.error=e,r.events.error&&(i=!0,r.emit("error",e)))}),i||req.onError(e))}function O(){globalDefQueue.length&&(each(globalDefQueue,function(e){var t=e[0];"string"==typeof t&&(i.defQueueMap[t]=!0),l.push(e)}),globalDefQueue=[])}function q(e){delete a[e],delete u[e]}function P(e,t,r){var i=e.map.id;e.error?e.emit("error",e.error):(t[i]=!0,each(e.depMaps,function(i,n){var o=i.id,s=getOwn(a,o);!s||e.depMatched[n]||r[o]||(getOwn(t,o)?(e.defineDep(n,f[o]),e.check()):P(s,t,r))}),r[i]=!0)}function E(){var e,r,n=1e3*s.waitSeconds,a=n&&i.startTime+n<(new Date).getTime(),c=[],l=[],f=!1,d=!0;if(!t){if(t=!0,eachProp(u,function(e){var t=e.map,i=t.id;if(e.enabled&&(t.isDefine||l.push(e),!e.error))if(!e.inited&&a)y(i)?(r=!0,f=!0):(c.push(i),v(i));else if(!e.inited&&e.fetched&&t.isDefine&&(f=!0,!t.prefix))return d=!1}),a&&c.length)return(e=makeError("timeout","Load timeout for modules: "+c,null,c)).contextName=i.contextName,w(e);d&&each(l,function(e){P(e,{},{})}),a&&!r||!f||!isBrowser&&!isWebWorker||o||(o=setTimeout(function(){o=0,E()},50)),t=!1}}function j(e){hasProp(f,e[0])||x(_(e[0],null,!0)).init(e[1],e[2])}function S(e,t,r,i){e.detachEvent&&!isOpera?i&&e.detachEvent(i,t):e.removeEventListener(r,t,!1)}function A(e){var t=e.currentTarget||e.srcElement;return S(t,i.onScriptLoad,"load","onreadystatechange"),S(t,i.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function C(){var e;for(O();l.length;){if(null===(e=l.shift())[0])return w(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));j(e)}i.defQueueMap={}}return n={require:function(e){return e.require?e.require:e.require=i.makeRequire(e.map)},exports:function(e){e.usingExports=!0,e.map.isDefine&&(e.exports?f[e.map.id]=e.exports:e.exports=f[e.map.id]={})},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(s.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},(r=function(e){this.events=getOwn(c,e.id)||{},this.map=e,this.shim=getOwn(s.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0}).prototype={init:function(e,t,r,i){i=i||{},this.inited||(this.factory=t,r?this.on("error",r):this.events.error&&(r=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=r,this.inited=!0,this.ignore=i.ignore,i.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,i.startTime=(new Date).getTime();var e=this.map;if(!this.shim)return e.prefix?this.callPlugin():this.load();i.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}))}},load:function(){var e=this.map.url;d[e]||(d[e]=!0,i.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,r=this.map.id,n=this.depExports,o=this.exports,s=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(s)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{o=i.execCb(r,s,n,o)}catch(t){e=t}else o=i.execCb(r,s,n,o);if(this.map.isDefine&&void 0===o&&((t=this.module)?o=t.exports:this.usingExports&&(o=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",w(this.error=e)}else o=s;if(this.exports=o,this.map.isDefine&&!this.ignore&&(f[r]=o,req.onResourceLoad)){var a=[];each(this.depMaps,function(e){a.push(e.normalizedMap||e)}),req.onResourceLoad(i,this.map,a)}q(r),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(i.defQueueMap,r)||this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=_(e.prefix);this.depMaps.push(r),k(r,"defined",bind(this,function(r){var n,o,u,c=getOwn(p,this.map.id),l=this.map.name,f=this.map.parentMap?this.map.parentMap.name:null,d=i.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(l=r.normalize(l,function(e){return g(e,f,!0)})||""),k(o=_(e.prefix+"!"+l,this.map.parentMap),"defined",bind(this,function(e){this.map.normalizedMap=o,this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),void((u=getOwn(a,o.id))&&(this.depMaps.push(o),this.events.error&&u.on("error",bind(this,function(e){this.emit("error",e)})),u.enable()))):c?(this.map.url=i.nameToUrl(c),void this.load()):((n=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})})).error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(a,function(e){0===e.map.id.indexOf(t+"_unnormalized")&&q(e.map.id)}),w(e)}),n.fromText=bind(this,function(r,o){var a=e.name,u=_(a),c=useInteractive;o&&(r=o),c&&(useInteractive=!1),x(u),hasProp(s.config,t)&&(s.config[a]=s.config[t]);try{req.exec(r)}catch(e){return w(makeError("fromtexteval","fromText eval for "+t+" failed: "+e,e,[t]))}c&&(useInteractive=!0),this.depMaps.push(u),i.completeLoad(a),d([a],n)}),void r.load(e.name,d,n,s))})),i.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){u[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var r,o,s;if("string"==typeof e){if(e=_(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,s=getOwn(n,e.id))return void(this.depExports[t]=s(this));this.depCount+=1,k(e,"defined",bind(this,function(e){this.undefed||(this.defineDep(t,e),this.check())})),this.errback?k(e,"error",bind(this,this.errback)):this.events.error&&k(e,"error",bind(this,function(e){this.emit("error",e)}))}r=e.id,o=a[r],hasProp(n,r)||!o||o.enabled||i.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(a,e.id);t&&!t.enabled&&i.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var r=this.events[e];r||(r=this.events[e]=[]),r.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),"error"===e&&delete this.events[e]}},i={config:s,contextName:e,registry:a,defined:f,urlFetched:d,defQueue:l,defQueueMap:{},Module:r,makeModuleMap:_,nextTick:req.nextTick,onError:w,configure:function(e){if(e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/"),"string"==typeof e.urlArgs){var t=e.urlArgs;e.urlArgs=function(e,r){return(-1===r.indexOf("?")?"?":"&")+t}}var r=s.shim,n={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(e,t){n[t]?(s[t]||(s[t]={}),mixin(s[t],e,!0,!0)):s[t]=e}),e.bundles&&eachProp(e.bundles,function(e,t){each(e,function(e){e!==t&&(p[e]=t)})}),e.shim&&(eachProp(e.shim,function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=i.makeShimExports(e)),r[t]=e}),s.shim=r),e.packages&&each(e.packages,function(e){var t;t=(e="string"==typeof e?{name:e}:e).name,e.location&&(s.paths[t]=e.location),s.pkgs[t]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(a,function(e,t){e.inited||e.map.unnormalized||(e.map=_(t,null,!0))}),(e.deps||e.callback)&&i.require(e.deps||[],e.callback)},makeShimExports:function(e){return function(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}},makeRequire:function(t,r){function o(s,u,c){var l,d;return r.enableBuildCallback&&u&&isFunction(u)&&(u.__requireJsBuild=!0),"string"==typeof s?isFunction(u)?w(makeError("requireargs","Invalid require call"),c):t&&hasProp(n,s)?n[s](a[t.id]):req.get?req.get(i,s,t,o):(l=_(s,t,!1,!0).id,hasProp(f,l)?f[l]:w(makeError("notloaded",'Module name "'+l+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(C(),i.nextTick(function(){C(),(d=x(_(null,t))).skipMap=r.skipMap,d.init(s,u,c,{enabled:!0}),E()}),o)}return r=r||{},mixin(o,{isBrowser:isBrowser,toUrl:function(e){var r,n=e.lastIndexOf("."),o=e.split("/")[0];return-1!==n&&(!("."===o||".."===o)||n>1)&&(r=e.substring(n,e.length),e=e.substring(0,n)),i.nameToUrl(g(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(f,_(e,t,!1,!0).id)},specified:function(e){return e=_(e,t,!1,!0).id,hasProp(f,e)||hasProp(a,e)}}),t||(o.undef=function(e){O();var r=_(e,t,!0),n=getOwn(a,e);n.undefed=!0,v(e),delete f[e],delete d[r.url],delete c[e],eachReverse(l,function(t,r){t[0]===e&&l.splice(r,1)}),delete i.defQueueMap[e],n&&(n.events.defined&&(c[e]=n.events),q(e))}),o},enable:function(e){getOwn(a,e.id)&&x(e).enable()},completeLoad:function(e){var t,r,n,o=getOwn(s.shim,e)||{},u=o.exports;for(O();l.length;){if(null===(r=l.shift())[0]){if(r[0]=e,t)break;t=!0}else r[0]===e&&(t=!0);j(r)}if(i.defQueueMap={},n=getOwn(a,e),!t&&!hasProp(f,e)&&n&&!n.inited){if(!(!s.enforceDefine||u&&getGlobal(u)))return y(e)?void 0:w(makeError("nodefine","No define call for "+e,null,[e]));j([e,o.deps||[],o.exportsFn])}E()},nameToUrl:function(e,t,r){var n,o,a,u,c,l,f=getOwn(s.pkgs,e);if(f&&(e=f),l=getOwn(p,e))return i.nameToUrl(l,t,r);if(req.jsExtRegExp.test(e))u=e+(t||"");else{for(n=s.paths,a=(o=e.split("/")).length;a>0;a-=1)if(c=getOwn(n,o.slice(0,a).join("/"))){isArray(c)&&(c=c[0]),o.splice(0,a,c);break}u=o.join("/"),u=("/"===(u+=t||(/^data:|^blob:|\?/.test(u)||r?"":".js")).charAt(0)||u.match(/^[\w+.-]+:/)?"":s.baseUrl)+u}return s.urlArgs&&!/^blob:/.test(u)?u+s.urlArgs(e,u):u},load:function(e,t){req.load(i,e,t)},execCb:function(e,t,r,i){return t.apply(i,r)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=A(e);i.completeLoad(t.id)}},onScriptError:function(e){var t=A(e);if(!y(t.id)){var r=[];return eachProp(a,function(e,i){0!==i.indexOf("_@r")&&each(e.depMaps,function(e){if(e.id===t.id)return r.push(i),!0})}),w(makeError("scripterror",'Script error for "'+t.id+(r.length?'", needed by: '+r.join(", "):'"'),e,[t.id]))}}},i.require=i.makeRequire(),i}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState||eachReverse(scripts(),function(e){if("interactive"===e.readyState)return interactiveScript=e}),interactiveScript}}(commonjsGlobal,"undefined"==typeof setTimeout?void 0:setTimeout),function(e){if(!__devfab_requirejs.__requirejsAdapterApplied){__devfab_requirejs.__requirejsAdapterApplied=!0;var t=__devfab_requirejs.require,r=__devfab_requirejs.define,i=function(e,r,i,n){var o=e,s=r,a=i,u=n;if(Array.isArray(e)&&"function"==typeof r)t(s=e,a=r,u=i);else{!e&&Array.isArray(s)&&(o=[]),Array.isArray(o)&&Array.isArray(s)&&(o=o.join("/"));var c=o?[]:s;"string"==typeof o&&o&&Array.isArray(s)&&s.forEach(function(e){c.push("".concat(o).concat("/"===e.substr(0,1)?"":"/").concat(e))}),console.debug("[devfab][requirejs]: %c requireInner, Parameter[newdeps] is %o","color:fuchsia",c),t(c,a,u)}};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&void 0===i[n]&&(i[n]=t[n]);__devfab_requirejs._require=t,__devfab_requirejs._define=r,__devfab_requirejs.require=i,__devfab_requirejs.define=function(e,t,i){var n=e,o=t,s=i;if(Array.isArray(e)&&"function"==typeof t)r(o=e,s=t);else{!e&&Array.isArray(o)&&(n=[]),Array.isArray(n)&&Array.isArray(o)&&(n=n.join("/"));var a=n?[]:o;"string"==typeof n&&n&&Array.isArray(o)&&o.forEach(function(e){a.push("".concat(n).concat("/"===e.substr(0,1)?"":"/").concat(e))}),r(a,s)}}}}();var CODE_POLICY=403;function normalizePath(e){return String(null==e?"":e).replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"")}function isAbsoluteUrl(e){return/^(?:[a-z][a-z0-9+.-]*:)?\/\//i.test(e)||/^(?:blob|data):/i.test(e)}function toHex(e){for(var t=new Uint8Array(e),r="",i=0;i<t.length;i++)r+=t[i].toString(16).padStart(2,"0");return r}var LoadPolicy=function(){return _createClass(function e(t){_classCallCheck(this,e),this.manifest=null,this.origins=null,this.lockVersion=null,this.verifyHash=!0,this.fetch=null,this._index=null,this.configure(t)},[{key:"configure",value:function(e){var t=e||{};return void 0!==t.manifest&&(this.manifest=t.manifest||null),void 0!==t.origins&&(this.origins=t.origins?[].concat(t.origins).map(function(e){return String(e).trim().replace(/\/+$/,"")}):null),void 0!==t.lockVersion&&(this.lockVersion=t.lockVersion||null),void 0!==t.verifyHash&&(this.verifyHash=!!t.verifyHash),void 0!==t.fetch?this.fetch=t.fetch||null:this.fetch||"function"!=typeof fetch||(this.fetch=function(){return fetch.apply(void 0,arguments)}),this._index=null,this}},{key:"enabled",get:function(){return!!this.manifest}},{key:"_moduleIndex",value:function(){if(this._index)return this._index;var e={},t=this.manifest&&this.manifest.modules;return Array.isArray(t)?t.forEach(function(t){t&&t.path&&(e[normalizePath(t.path)]=t)}):t&&"object"===_typeof(t)&&Object.keys(t).forEach(function(r){e[normalizePath(r)]=t[r]||{}}),this._index=e,e}},{key:"entryOf",value:function(e){return this.manifest&&this._moduleIndex()[normalizePath(e)]||null}},{key:"checkVersion",value:function(){if(!this.lockVersion||!this.manifest)return null;var e=String(this.manifest.version||"");return e===String(this.lockVersion)?null:{code:CODE_POLICY,message:"清单版本 ".concat(e||"(未声明)"," 与锁定版本 ").concat(this.lockVersion," 不一致,拒绝加载")}}},{key:"checkModules",value:function(e){var t=this.checkVersion();if(t)return t;if(!this.manifest)return null;for(var r=0;r<e.length;r++){var i=normalizePath(e[r]);if(!this._moduleIndex()[i])return{code:CODE_POLICY,message:"Module ".concat(i," not registered in the list, loading denied.")}}return null}},{key:"checkOrigin",value:function(e){if(!this.origins)return null;if(!isAbsoluteUrl(e))return null;var t;try{t=new URL(e).origin}catch(t){return{code:CODE_POLICY,message:"无法解析的地址:".concat(e)}}return-1===this.origins.indexOf(t)?{code:CODE_POLICY,message:"来源 ".concat(t," 不在白名单内(允许:").concat(this.origins.join(", "),")")}:null}},{key:"verify",value:function(e,t){var r=this;if(!this.verifyHash)return Promise.resolve({ok:!0,skipped:"disabled"});if(!t)return Promise.resolve({ok:!0});var i="undefined"!=typeof globalThis&&globalThis.crypto&&globalThis.crypto.subtle;return i?this.fetch?Promise.resolve().then(function(){return r.fetch(e)}).then(function(e){return e&&e.ok?e.arrayBuffer().then(function(e){return i.digest("SHA-256",e)}):{ok:!1,message:"完整性预检请求失败:HTTP ".concat(e&&e.status||"unknown")}}).then(function(e){if(!e||!1===e.ok)return e;var r=toHex(e),i=String(t).toLowerCase();return r!==i?{ok:!1,message:"sha256 不匹配:期望 ".concat(i,",实际 ").concat(r)}:{ok:!0}}).catch(function(e){return{ok:!1,message:"完整性预检异常:".concat(e&&e.message||e),error:e}}):Promise.resolve({ok:!0,skipped:"fetch unavailable"}):Promise.resolve({ok:!0,skipped:"crypto.subtle unavailable(需要 https / localhost)"})}},{key:"describe",value:function(){return{manifest:this.enabled?this.manifest.name||"(unnamed)":null,version:this.manifest&&this.manifest.version||null,lockVersion:this.lockVersion,modules:this.enabled?Object.keys(this._moduleIndex()).length:0,origins:this.origins?this.origins.slice():null,verifyHash:this.verifyHash}}}])}(),DEFAULT_WATCH=["$","jQuery","define","require","requirejs","devfab","__devfab","__devfab_requirejs"],GlobalGuard=function(){return _createClass(function e(t){_classCallCheck(this,e);var r=t||{};this.maxPollution=void 0===r.maxPollution?3:Number(r.maxPollution),this.watch=[].concat(r.watch||DEFAULT_WATCH),this.target=r.target||("undefined"!=typeof window?window:null),this.enabled=void 0===r.enabled||!!r.enabled,this._pending=0,this._before=null,this.lastWarnings=[]},[{key:"_snapshot",value:function(){var e=new Map,t=this.target;return t?(Object.keys(t).forEach(function(r){e.set(r,t[r])}),e):e}},{key:"_diff",value:function(){var e=this,t=this._before,r=this._snapshot(),i=[];if(!t)return i;r.forEach(function(r,n){var o=-1!==e.watch.indexOf(n);t.has(n)?t.get(n)!==r&&i.push({type:"overwritten",key:n,watched:o}):i.push({type:"added",key:n,watched:o})});var n=i.filter(function(e){return e.watched}).length,o=i.filter(function(e){return"added"===e.type}).length;return!n&&o<=this.maxPollution?[]:i}},{key:"begin",value:function(){var e=this;if(!this.enabled||!this.target)return{end:function(){return[]}};this._pending++,1===this._pending&&(this._before=this._snapshot());var t=!1;return{end:function(){if(t)return[];if(t=!0,e._pending--,e._pending>0)return[];var r=e._diff();return e._before=null,e.lastWarnings=r,r}}}},{key:"configure",value:function(e){var t=e||{};return void 0!==t.enabled&&(this.enabled=!!t.enabled),void 0!==t.maxPollution&&(this.maxPollution=Number(t.maxPollution)),void 0!==t.watch&&(this.watch=[].concat(t.watch||[])),void 0!==t.target&&(this.target=t.target||null),this}}])}(),CODE_TIMEOUT=504,nativeImport=null;try{nativeImport=new Function("s","return import(s)")}catch(e){nativeImport=null}function parseArgs(e,t,r,i){var n=e,o=t,s=r;Array.isArray(e)&&!Array.isArray(t)&&(n=null==i?void 0:i.path,o=e,s="function"==typeof t?t:r);var a=(o=Array.isArray(o)?o:[]).join(","),u={code:0,message:"",data:[],warnings:[]};return("require"===i.type&&"function"!=typeof i.require||"define"===i.type&&"function"!=typeof i.define)&&(u.code=404,u.message="requirejs is undefined, the fiels: ".concat(a)),{path:n,files:o,callback:s,filesStr:a,result:u}}function toModuleIds(e,t){var r="";return Array.isArray(e)?r=e.filter(Boolean).join("/"):"string"==typeof e&&(r=e.replace(/\/+$/,"")),t.map(function(e){var t=String(e).replace(/^\/+/,"");return r?"".concat(r,"/").concat(t):t})}function toNumber(e,t){var r=Number(e);return Number.isFinite(r)?r:t}var DEFAULT_OPTIONS={version:"",timeout:15e3,retry:0,strict:!1,baseUrl:""},BaseFileRequire=function(){return _createClass(function e(t){var r,i,n,o;_classCallCheck(this,e);var s=t||{};this.__debug=null!==(r=s.__debug)&&void 0!==r&&r,this.__rootPath=void 0,this.__define=s.define||(null===(i=window.__devfab_requirejs)||void 0===i?void 0:i.define),this.__require=s.require||(null===(n=window.__devfab_requirejs)||void 0===n?void 0:n.require),this.__undef=s.undef||("function"==typeof(null===(o=this.__require)||void 0===o?void 0:o.undef)?this.__require.undef:null),this.__requireConfig=s.requireConfig||this._pickRequireConfig(this.__require),this.__import=s.importer||null,this._setTimer=s.setTimeout||function(e,t){return setTimeout(e,t)},this._clearTimer=s.clearTimeout||function(e){return clearTimeout(e)},this.options={version:s.version?String(s.version):DEFAULT_OPTIONS.version,timeout:void 0===s.timeout?DEFAULT_OPTIONS.timeout:Math.max(0,toNumber(s.timeout,0)),retry:void 0===s.retry?DEFAULT_OPTIONS.retry:Math.max(0,toNumber(s.retry,0)),strict:!!s.strict,baseUrl:s.baseUrl||DEFAULT_OPTIONS.baseUrl},this.policy=new LoadPolicy(s),this.guard=new GlobalGuard(this._guardOptions(s)),this.options.version&&this._applyUrlArgs()},[{key:"_pickRequireConfig",value:function(e){var t,r=e&&"function"==typeof e.config?e:null===(t=window.__devfab_requirejs)||void 0===t?void 0:t.require;return r&&"function"==typeof r.config?r.config.bind(r):null}},{key:"_guardOptions",value:function(e){return!1===e.pollution?{enabled:!1,target:e.target}:e.pollution&&"object"===_typeof(e.pollution)?Object.assign({target:e.target},e.pollution):{target:e.target,watch:e.watch,maxPollution:e.maxPollution,enabled:void 0===e.pollution||!!e.pollution}}},{key:"configure",value:function(e){var t=e||{};return void 0!==t.debug&&(this.__debug=!!t.debug),void 0!==t.version&&this.setVersion(t.version),void 0!==t.timeout&&(this.options.timeout=Math.max(0,toNumber(t.timeout,this.options.timeout))),void 0!==t.retry&&(this.options.retry=Math.max(0,toNumber(t.retry,this.options.retry))),void 0!==t.strict&&(this.options.strict=!!t.strict),void 0!==t.baseUrl&&(this.options.baseUrl=t.baseUrl||""),void 0===t.manifest&&void 0===t.origins&&void 0===t.lockVersion&&void 0===t.verifyHash&&void 0===t.fetch||this.policy.configure(t),void 0!==t.pollution?this.guard.configure(this._guardOptions(t)):void 0===t.watch&&void 0===t.maxPollution&&void 0===t.target||this.guard.configure(t),this}},{key:"setVersion",value:function(e){return this.options.version=e?String(e):"",this._applyUrlArgs(),this}},{key:"_applyUrlArgs",value:function(){if("function"!=typeof this.__requireConfig)return!1;try{return this.__requireConfig({urlArgs:this.options.version?"v=".concat(encodeURIComponent(this.options.version)):""}),!0}catch(e){return!1}}},{key:"getVersion",value:function(){return this.options.version}},{key:"_snapshotConfig",value:function(){return{__debug:this.__debug,version:this.options.version,timeout:this.options.timeout,retry:this.options.retry,strict:this.options.strict,baseUrl:this.options.baseUrl,manifest:this.policy.manifest,origins:this.policy.origins,lockVersion:this.policy.lockVersion,verifyHash:this.policy.verifyHash,fetch:this.policy.fetch,pollution:this.guard.enabled,watch:this.guard.watch,maxPollution:this.guard.maxPollution,target:this.guard.target}}},{key:"describe",value:function(){return Object.assign({},this.options,{debug:this.__debug,policy:this.policy.describe(),pollutionGuard:this.guard.enabled,canUndef:"function"==typeof this.__undef,canNativeImport:"function"==typeof(this.__import||nativeImport)})}},{key:"_define",value:function(e,t,r){var i=parseArgs(e,t,r,{path:this.__rootPath,define:this.__define,type:"define"}),n=i.path,o=i.files,s=i.callback,a=i.result;404!==a.code?this.__define(n,o,s):null==s||s(a)}},{key:"_mergeWarnings",value:function(e,t){var r=(e||[]).slice();return(t||[]).forEach(function(e){r.some(function(t){return t.type===e.type&&t.key===e.key})||r.push(e)}),r}},{key:"_undefModules",value:function(e){var t=this;"function"==typeof this.__undef&&e.forEach(function(e){try{t.__undef(e)}catch(e){}})}},{key:"_load",value:function(e,t,r){var i=this,n=this.options,o=parseArgs(e,t,r,{path:this.__rootPath,require:this.__require,type:"require"}),s=o.path,a=o.files,u=o.callback,c=o.result,l=o.filesStr;if(404!==c.code){var f=toModuleIds(s,a),d=this.policy.checkModules(f);if(d)return c.code=d.code,c.message=d.message,void(null==u||u(c));var p=!1,h=0,m=null,g=null,v=function(){g&&(c.warnings=i._mergeWarnings(c.warnings,g.end()),g=null)},y=function(){p||(p=!0,null!==m&&(i._clearTimer(m),m=null),v(),n.strict&&c.warnings.length&&(c.code=500,c.message="Global pollution detection failed:".concat(c.warnings.map(function(e){return"".concat(e.type,":").concat(e.key)}).join(", "))),null==u||u(c))},b=function(){h++,g=i.guard.begin(),n.timeout>0&&(m=i._setTimer(function(){if(!p){var e=new Error("load timeout after ".concat(n.timeout,"ms: ").concat(l));e.__devfabTimeout=!0,_(e,"files load timeout after ".concat(n.timeout,"ms, the files: ").concat(l))}},n.timeout)),i.__require(s,a,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];c.data=t,y()},function(e){_(e)})},_=function(e,t){if(!p){if(null!==m&&(i._clearTimer(m),m=null),h<=n.retry)return v(),i._undefModules(f),void b();c.code=e&&e.__devfabTimeout?CODE_TIMEOUT:500,c.message=t||"files load error, the files: ".concat(l),c.error=e,y()}};b()}else null==u||u(c)}},{key:"load",value:function(e,t,r){this._load(e,t,r)}},{key:"resolveUrl",value:function(e){var t=String(null==e?"":e);if(/^[a-z][a-z0-9+.-]*:/i.test(t)||/^\/\//.test(t))return t;var r=this.options.baseUrl||("undefined"!=typeof document&&document.baseURI?document.baseURI:"");if(!r)return t;try{return new URL(t,r).href}catch(e){return t}}},{key:"_importOne",value:function(e){var t=this,r=this.resolveUrl(e),i=this.policy.checkOrigin(r);if(i)return Promise.resolve({ok:!1,code:i.code,message:i.message});var n=this.policy.entryOf(e),o=n&&n.sha256,s=function(){var e=t.__import||nativeImport;return"function"!=typeof e?Promise.resolve({ok:!1,code:500,message:"native import() is unavailable(CSP 是否禁用了 unsafe-eval?)"}):Promise.resolve().then(function(){return e(r)}).then(function(e){return{ok:!0,module:e}},function(e){return{ok:!1,code:500,message:"module load error: ".concat(r),error:e}})};return o?this.policy.verify(r,o).then(function(e){return e.ok?s():{ok:!1,code:CODE_POLICY,message:"".concat(e.message,"(").concat(r,")")}}):s()}},{key:"loadModules",value:function(e,t,r){var i=this,n=parseArgs(e,t,r,{path:this.__rootPath,type:"module"}),o=n.path,s=n.files,a=n.callback,u=n.result,c=n.filesStr,l=toModuleIds(o,s),f=function(e){return null==a||a(e),e},d=this.policy.checkModules(l);if(d)return u.code=d.code,u.message=d.message,Promise.resolve(f(u));if(!s.length)return Promise.resolve(f(u));var p=this.guard.begin();return Promise.all(l.map(function(e){return i._importOne(e)})).then(function(e){u.warnings=p.end();var t=e.filter(function(e){return!e.ok});return t.length?(u.code=t[0].code||500,u.message="".concat(t.map(function(e){return e.message}).join("; "),"(the files: ").concat(c,")"),u.error=t[0].error):u.data=e.map(function(e){return e.module}),f(u)})}},{key:"loadModule",value:function(e,t){return this.loadModules([e],t)}}])}(),FileRequireClass=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"define",value:function(e,t,r){this._define(e,t,r)}},{key:"defineScript",value:function(e){this.provideScript(e)}},{key:"provideScript",value:function(e){var t=e;"function"!=typeof e&&(t=function(){return e}),this.define([],t)}},{key:"require",value:function(e,t,r){this._load(e,t,r)}},{key:"injectScript",value:function(e,t,r,i){var n=this,o=e,s=t,a=r,u=i;Array.isArray(e)&&"function"==typeof t&&(o=void 0,s=e,a=t,u=r),this._load(o,s,function(e){if(0==e.code&&Array.isArray(e.data))for(var t=0,r=e.data.length;t<r;t++){var i,o=e.data[t];null===(i=a)||void 0===i||i(o,t)}else"function"==typeof u?u(e):n.__debug&&console.error("[devfab][FileRequire][injectScript] error: ",e)})}},{key:"requireScript",value:function(e,t,r){this.injectScript(e,t,r)}}])}(BaseFileRequire),FileRequire=new FileRequireClass;FileRequire.create=function(e){return new FileRequireClass(_objectSpread2(_objectSpread2({},this._snapshotConfig()),e))},window.__devfab=Object.assign({},window.__devfab),window.__devfab.FileRequire=FileRequire,window.__devfab.filePolicy={LoadPolicy:LoadPolicy,GlobalGuard:GlobalGuard,CODE_POLICY:CODE_POLICY,CODE_TIMEOUT:CODE_TIMEOUT},exports.CODE_POLICY=CODE_POLICY,exports.CODE_TIMEOUT=CODE_TIMEOUT,exports.DEFAULT_WATCH=DEFAULT_WATCH,exports.FileRequire=FileRequire,exports.GlobalGuard=GlobalGuard,exports.LoadPolicy=LoadPolicy,exports.default=FileRequire,Object.defineProperty(exports,"__esModule",{value:!0})});
|
|
5
|
+
*/var __requirejs={};(function(global,setTimeout){var requirejs,require,define,req,s,head,baseElement,dataMain,src,body,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.2",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){var r;if(e)for(r=0;r<e.length&&(!e[r]||!t(e[r],r,e));r+=1);}function eachReverse(e,t){var r;if(e)for(r=e.length-1;r>-1&&(!e[r]||!t(e[r],r,e));r-=1);}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var r;for(r in e)if(hasProp(e,r)&&t(e[r],r))break}function mixin(e,t,r,i){return t&&eachProp(t,function(t,n){!r&&hasProp(e,n)||(!i||"object"!==_typeof(t)||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[n]=t:(e[n]||(e[n]={}),mixin(e[n],t,r,i)))}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,r,i){var n=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return n.requireType=e,n.requireModules=i,r&&(n.originalError=r),n}if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,r,i){var n,o,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=r,r=i):e=[]),o&&o.context&&(a=o.context),s.name&&(a=s.name),(n=getOwn(contexts,a))||(n=contexts[a]=req.s.newContext(a,s)),o&&n.configure(o),n.require(e,t,r)},req.config=function(e){return req(e)},req.nextTick=void 0!==setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$|\.css$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],body=s.body=document.getElementsByTagName("body")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,r){var i,n="";try{r.split("?")[0].endsWith(".css")&&(n="css")}catch(e){}return"css"===n?((i=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:link"):document.createElement("link")).href=r,i.rel="stylesheet",i.type=e.linkType||"text/css",i):((i=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script")).type=e.scriptType||"text/javascript",i.charset="utf-8",i.async=!1,i)},req.load=function(e,t,r){var i,n=e&&e.config||{};if(isBrowser)return(i=req.createNode(n,t,r)).setAttribute("data-requirecontext",e.contextName),i.setAttribute("data-requiremodule",t),!i.attachEvent||i.attachEvent.toString&&i.attachEvent.toString().indexOf("[native code")<0||isOpera?(i.addEventListener("load",e.onScriptLoad,!1),i.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,i.attachEvent("onreadystatechange",e.onScriptLoad)),i.src=r,n.onNodeCreated&&n.onNodeCreated(i,n,t,r),currentlyAddingScript=i,baseElement?head.insertBefore(i,baseElement):body?body.appendChild(i):head.appendChild(i),currentlyAddingScript=null,i;if(isWebWorker)try{setTimeout(function(){},0),importScripts(r),e.completeLoad(t)}catch(i){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+r,i,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){if(head||(head=e.parentNode),dataMain=e.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||-1!==mainScript.indexOf("!")||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(e,t,r){var i,n;"string"!=typeof e&&(r=t,t=e,e=null),isArray(t)||(r=t,t=null),!t&&isFunction(r)&&(t=[],r.length&&(r.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(e,r){t.push(r)}),t=(1===r.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&(i=currentlyAddingScript||getInteractiveScript())&&(e||(e=i.getAttribute("data-requiremodule")),n=contexts[i.getAttribute("data-requirecontext")]),n?(n.defQueue.push([e,t,r]),n.defQueueMap[e]=!0):globalDefQueue.push([e,t,r])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},__requirejs.require=require,__requirejs.define=define,req(cfg)}function newContext(e){var t,r,i,n,o,s={waitSeconds:(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).waitSeconds||30,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},a={},u={},c={},l=[],f={},d={},p={},h=1,m=1;function g(e,t,r){var i,n,o,a,u,c,l,f,d,p,h=t&&t.split("/"),m=s.map,g=m&&m["*"];if(e&&(c=(e=e.split("/")).length-1,s.nodeIdCompat&&jsSuffixRegExp.test(e[c])&&(e[c]=e[c].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),function(e){var t,r;for(t=0;t<e.length;t++)if("."===(r=e[t]))e.splice(t,1),t-=1;else if(".."===r){if(0===t||1===t&&".."===e[2]||".."===e[t-1])continue;t>0&&(e.splice(t-1,2),t-=2)}}(e),e=e.join("/")),r&&m&&(h||g)){for(o=(n=e.split("/")).length;o>0;o-=1){if(u=n.slice(0,o).join("/"),h){var v=!1;for(a=h.length;a>0;a-=1)if((i=getOwn(m,h.slice(0,a).join("/")))&&(i=getOwn(i,u))){l=i,f=o,v=!0;break}if(v)break}!d&&g&&getOwn(g,u)&&(d=getOwn(g,u),p=o)}!l&&d&&(l=d,f=p),l&&(n.splice(0,f,l),e=n.join("/"))}return getOwn(s.pkgs,e)||e}function v(e){isBrowser&&each(scripts(),function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===i.contextName)return t.parentNode.removeChild(t),!0})}function y(e){var t=getOwn(s.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),i.require.undef(e),i.makeRequire(null,{skipMap:!0})([e]),!0}function b(e){var t,r=e?e.indexOf("!"):-1;return r>-1&&(t=e.substring(0,r),e=e.substring(r+1,e.length)),[t,e]}function _(e,t,r,n){var o,s,a,u,c=null,l=t?t.name:null,d=e,p=!0,v="";return e||(p=!1,e="_@r"+(h+=1)),c=(u=b(e))[0],e=u[1],c&&(c=g(c,l,n),s=getOwn(f,c)),e&&(c?v=s&&s.normalize?s.normalize(e,function(e){return g(e,l,n)}):-1===e.indexOf("!")?g(e,l,n):e:(c=(u=b(v=g(e,l,n)))[0],v=u[1],r=!0,o=i.nameToUrl(v))),{prefix:c,name:v,parentMap:t,unnormalized:!!(a=!c||s||r?"":"_unnormalized"+(m+=1)),url:o,originalName:d,isDefine:p,id:(c?c+"!"+v:v)+a}}function x(e){var t=e.id,r=getOwn(a,t);return r||(r=a[t]=new i.Module(e)),r}function k(e,t,r){var i=e.id,n=getOwn(a,i);!hasProp(f,i)||n&&!n.defineEmitComplete?(n=x(e)).error&&"error"===t?r(n.error):n.on(t,r):"defined"===t&&r(f[i])}function w(e,t){var r=e.requireModules,i=!1;t?t(e):(each(r,function(t){var r=getOwn(a,t);r&&(r.error=e,r.events.error&&(i=!0,r.emit("error",e)))}),i||req.onError(e))}function q(){globalDefQueue.length&&(each(globalDefQueue,function(e){var t=e[0];"string"==typeof t&&(i.defQueueMap[t]=!0),l.push(e)}),globalDefQueue=[])}function O(e){delete a[e],delete u[e]}function E(e,t,r){var i=e.map.id;e.error?e.emit("error",e.error):(t[i]=!0,each(e.depMaps,function(i,n){var o=i.id,s=getOwn(a,o);!s||e.depMatched[n]||r[o]||(getOwn(t,o)?(e.defineDep(n,f[o]),e.check()):E(s,t,r))}),r[i]=!0)}function P(){var e,r,n=1e3*s.waitSeconds,a=n&&i.startTime+n<(new Date).getTime(),c=[],l=[],f=!1,d=!0;if(!t){if(t=!0,eachProp(u,function(e){var t=e.map,i=t.id;if(e.enabled&&(t.isDefine||l.push(e),!e.error))if(!e.inited&&a)y(i)?(r=!0,f=!0):(c.push(i),v(i));else if(!e.inited&&e.fetched&&t.isDefine&&(f=!0,!t.prefix))return d=!1}),a&&c.length)return(e=makeError("timeout","Load timeout for modules: "+c,null,c)).contextName=i.contextName,w(e);d&&each(l,function(e){E(e,{},{})}),a&&!r||!f||!isBrowser&&!isWebWorker||o||(o=setTimeout(function(){o=0,P()},50)),t=!1}}function A(e){hasProp(f,e[0])||x(_(e[0],null,!0)).init(e[1],e[2])}function S(e,t,r,i){e.detachEvent&&!isOpera?i&&e.detachEvent(i,t):e.removeEventListener(r,t,!1)}function j(e){var t=e.currentTarget||e.srcElement;return S(t,i.onScriptLoad,"load","onreadystatechange"),S(t,i.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function T(){var e;for(q();l.length;){if(null===(e=l.shift())[0])return w(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));A(e)}i.defQueueMap={}}return n={require:function(e){return e.require?e.require:e.require=i.makeRequire(e.map)},exports:function(e){e.usingExports=!0,e.map.isDefine&&(e.exports?f[e.map.id]=e.exports:e.exports=f[e.map.id]={})},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(s.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},(r=function(e){this.events=getOwn(c,e.id)||{},this.map=e,this.shim=getOwn(s.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0}).prototype={init:function(e,t,r,i){i=i||{},this.inited||(this.factory=t,r?this.on("error",r):this.events.error&&(r=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=r,this.inited=!0,this.ignore=i.ignore,i.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,i.startTime=(new Date).getTime();var e=this.map;if(!this.shim)return e.prefix?this.callPlugin():this.load();i.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}))}},load:function(){var e=this.map.url;d[e]||(d[e]=!0,i.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,r=this.map.id,n=this.depExports,o=this.exports,s=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(s)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{o=i.execCb(r,s,n,o)}catch(t){e=t}else o=i.execCb(r,s,n,o);if(this.map.isDefine&&void 0===o&&((t=this.module)?o=t.exports:this.usingExports&&(o=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",w(this.error=e)}else o=s;if(this.exports=o,this.map.isDefine&&!this.ignore&&(f[r]=o,req.onResourceLoad)){var a=[];each(this.depMaps,function(e){a.push(e.normalizedMap||e)}),req.onResourceLoad(i,this.map,a)}O(r),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(i.defQueueMap,r)||this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=_(e.prefix);this.depMaps.push(r),k(r,"defined",bind(this,function(r){var n,o,u,c=getOwn(p,this.map.id),l=this.map.name,f=this.map.parentMap?this.map.parentMap.name:null,d=i.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(l=r.normalize(l,function(e){return g(e,f,!0)})||""),k(o=_(e.prefix+"!"+l,this.map.parentMap),"defined",bind(this,function(e){this.map.normalizedMap=o,this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),void((u=getOwn(a,o.id))&&(this.depMaps.push(o),this.events.error&&u.on("error",bind(this,function(e){this.emit("error",e)})),u.enable()))):c?(this.map.url=i.nameToUrl(c),void this.load()):((n=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})})).error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(a,function(e){0===e.map.id.indexOf(t+"_unnormalized")&&O(e.map.id)}),w(e)}),n.fromText=bind(this,function(r,o){var a=e.name,u=_(a),c=useInteractive;o&&(r=o),c&&(useInteractive=!1),x(u),hasProp(s.config,t)&&(s.config[a]=s.config[t]);try{req.exec(r)}catch(e){return w(makeError("fromtexteval","fromText eval for "+t+" failed: "+e,e,[t]))}c&&(useInteractive=!0),this.depMaps.push(u),i.completeLoad(a),d([a],n)}),void r.load(e.name,d,n,s))})),i.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){u[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var r,o,s;if("string"==typeof e){if(e=_(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,s=getOwn(n,e.id))return void(this.depExports[t]=s(this));this.depCount+=1,k(e,"defined",bind(this,function(e){this.undefed||(this.defineDep(t,e),this.check())})),this.errback?k(e,"error",bind(this,this.errback)):this.events.error&&k(e,"error",bind(this,function(e){this.emit("error",e)}))}r=e.id,o=a[r],hasProp(n,r)||!o||o.enabled||i.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(a,e.id);t&&!t.enabled&&i.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var r=this.events[e];r||(r=this.events[e]=[]),r.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),"error"===e&&delete this.events[e]}},i={config:s,contextName:e,registry:a,defined:f,urlFetched:d,defQueue:l,defQueueMap:{},Module:r,makeModuleMap:_,nextTick:req.nextTick,onError:w,configure:function(e){if(e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/"),"string"==typeof e.urlArgs){var t=e.urlArgs;e.urlArgs=function(e,r){return(-1===r.indexOf("?")?"?":"&")+t}}var r=s.shim,n={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(e,t){n[t]?(s[t]||(s[t]={}),mixin(s[t],e,!0,!0)):s[t]=e}),e.bundles&&eachProp(e.bundles,function(e,t){each(e,function(e){e!==t&&(p[e]=t)})}),e.shim&&(eachProp(e.shim,function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=i.makeShimExports(e)),r[t]=e}),s.shim=r),e.packages&&each(e.packages,function(e){var t;t=(e="string"==typeof e?{name:e}:e).name,e.location&&(s.paths[t]=e.location),s.pkgs[t]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(a,function(e,t){e.inited||e.map.unnormalized||(e.map=_(t,null,!0))}),(e.deps||e.callback)&&i.require(e.deps||[],e.callback)},makeShimExports:function(e){return function(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}},makeRequire:function(t,r){function o(s,u,c){var l,d;return r.enableBuildCallback&&u&&isFunction(u)&&(u.__requireJsBuild=!0),"string"==typeof s?isFunction(u)?w(makeError("requireargs","Invalid require call"),c):t&&hasProp(n,s)?n[s](a[t.id]):req.get?req.get(i,s,t,o):(l=_(s,t,!1,!0).id,hasProp(f,l)?f[l]:w(makeError("notloaded",'Module name "'+l+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(T(),i.nextTick(function(){T(),(d=x(_(null,t))).skipMap=r.skipMap,d.init(s,u,c,{enabled:!0}),P()}),o)}return r=r||{},mixin(o,{isBrowser:isBrowser,toUrl:function(e){var r,n=e.lastIndexOf("."),o=e.split("/")[0];return-1!==n&&(!("."===o||".."===o)||n>1)&&(r=e.substring(n,e.length),e=e.substring(0,n)),i.nameToUrl(g(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(f,_(e,t,!1,!0).id)},specified:function(e){return e=_(e,t,!1,!0).id,hasProp(f,e)||hasProp(a,e)}}),t||(o.undef=function(e){q();var r=_(e,t,!0),n=getOwn(a,e);n.undefed=!0,v(e),delete f[e],delete d[r.url],delete c[e],eachReverse(l,function(t,r){t[0]===e&&l.splice(r,1)}),delete i.defQueueMap[e],n&&(n.events.defined&&(c[e]=n.events),O(e))}),o},enable:function(e){getOwn(a,e.id)&&x(e).enable()},completeLoad:function(e){var t,r,n,o=getOwn(s.shim,e)||{},u=o.exports;for(q();l.length;){if(null===(r=l.shift())[0]){if(r[0]=e,t)break;t=!0}else r[0]===e&&(t=!0);A(r)}if(i.defQueueMap={},n=getOwn(a,e),!t&&!hasProp(f,e)&&n&&!n.inited){if(!(!s.enforceDefine||u&&getGlobal(u)))return y(e)?void 0:w(makeError("nodefine","No define call for "+e,null,[e]));A([e,o.deps||[],o.exportsFn])}P()},nameToUrl:function(e,t,r){var n,o,a,u,c,l,f=getOwn(s.pkgs,e);if(f&&(e=f),l=getOwn(p,e))return i.nameToUrl(l,t,r);if(req.jsExtRegExp.test(e))u=e+(t||"");else{for(n=s.paths,a=(o=e.split("/")).length;a>0;a-=1)if(c=getOwn(n,o.slice(0,a).join("/"))){isArray(c)&&(c=c[0]),o.splice(0,a,c);break}u=o.join("/"),u=("/"===(u+=t||(/^data:|^blob:|\?/.test(u)||r?"":".js")).charAt(0)||u.match(/^[\w+.-]+:/)?"":s.baseUrl)+u}return s.urlArgs&&!/^blob:/.test(u)?u+s.urlArgs(e,u):u},load:function(e,t){req.load(i,e,t)},execCb:function(e,t,r,i){return t.apply(i,r)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=j(e);i.completeLoad(t.id)}},onScriptError:function(e){var t=j(e);if(!y(t.id)){var r=[];return eachProp(a,function(e,i){0!==i.indexOf("_@r")&&each(e.depMaps,function(e){if(e.id===t.id)return r.push(i),!0})}),w(makeError("scripterror",'Script error for "'+t.id+(r.length?'", needed by: '+r.join(", "):'"'),e,[t.id]))}}},i.require=i.makeRequire(),i}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState||eachReverse(scripts(),function(e){if("interactive"===e.readyState)return interactiveScript=e}),interactiveScript}})("undefined"!=typeof window?window:globalThis,"undefined"==typeof setTimeout?void 0:setTimeout),function(e){if(!__requirejs.__requirejsAdapterApplied){__requirejs.__requirejsAdapterApplied=!0;var t=__requirejs.require,r=__requirejs.define,i=function(e,r,i,n){var o=e,s=r,a=i,u=n;if(Array.isArray(e)&&"function"==typeof r)t(s=e,a=r,u=i);else{!e&&Array.isArray(s)&&(o=[]),Array.isArray(o)&&Array.isArray(s)&&(o=o.join("/"));var c=o?[]:s;"string"==typeof o&&o&&Array.isArray(s)&&s.forEach(function(e){c.push("".concat(o).concat("/"===e.substr(0,1)?"":"/").concat(e))}),console.debug("[devfab][requirejs]: %c requireInner, Parameter[newdeps] is %o","color:fuchsia",c),t(c,a,u)}},n=function(e,t,i){var n=e,o=t,s=i;if(Array.isArray(e)&&"function"==typeof t)r(o=e,s=t);else{!e&&Array.isArray(o)&&(n=[]),Array.isArray(n)&&Array.isArray(o)&&(n=n.join("/"));var a=n?[]:o;"string"==typeof n&&n&&Array.isArray(o)&&o.forEach(function(e){a.push("".concat(n).concat("/"===e.substr(0,1)?"":"/").concat(e))}),r(a,s)}};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&void 0===i[o]&&(i[o]=t[o]);i.__devfabAdapterApplied=!0,n.__devfabAdapterApplied=!0,__requirejs._require=t,__requirejs._define=r,__requirejs.require=i,__requirejs.define=n}}();var CODE_POLICY=403;function normalizePath(e){return String(null==e?"":e).replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"")}function isAbsoluteUrl(e){return/^(?:[a-z][a-z0-9+.-]*:)?\/\//i.test(e)||/^(?:blob|data):/i.test(e)}function toHex(e){for(var t=new Uint8Array(e),r="",i=0;i<t.length;i++)r+=t[i].toString(16).padStart(2,"0");return r}var LoadPolicy=function(){return _createClass(function e(t){_classCallCheck(this,e),this.manifest=null,this.origins=null,this.lockVersion=null,this.verifyHash=!0,this.fetch=null,this._index=null,this.configure(t)},[{key:"configure",value:function(e){var t=e||{};return void 0!==t.manifest&&(this.manifest=t.manifest||null),void 0!==t.origins&&(this.origins=t.origins?[].concat(t.origins).map(function(e){return String(e).trim().replace(/\/+$/,"")}):null),void 0!==t.lockVersion&&(this.lockVersion=t.lockVersion||null),void 0!==t.verifyHash&&(this.verifyHash=!!t.verifyHash),void 0!==t.fetch?this.fetch=t.fetch||null:this.fetch||"function"!=typeof fetch||(this.fetch=function(){return fetch.apply(void 0,arguments)}),this._index=null,this}},{key:"enabled",get:function(){return!!this.manifest}},{key:"_moduleIndex",value:function(){if(this._index)return this._index;var e={},t=this.manifest&&this.manifest.modules;return Array.isArray(t)?t.forEach(function(t){t&&t.path&&(e[normalizePath(t.path)]=t)}):t&&"object"===_typeof(t)&&Object.keys(t).forEach(function(r){e[normalizePath(r)]=t[r]||{}}),this._index=e,e}},{key:"entryOf",value:function(e){return this.manifest&&this._moduleIndex()[normalizePath(e)]||null}},{key:"checkVersion",value:function(){if(!this.lockVersion||!this.manifest)return null;var e=String(this.manifest.version||"");return e===String(this.lockVersion)?null:{code:CODE_POLICY,message:"清单版本 ".concat(e||"(未声明)"," 与锁定版本 ").concat(this.lockVersion," 不一致,拒绝加载")}}},{key:"checkModules",value:function(e){var t=this.checkVersion();if(t)return t;if(!this.manifest)return null;for(var r=0;r<e.length;r++){var i=normalizePath(e[r]);if(!this._moduleIndex()[i])return{code:CODE_POLICY,message:"Module ".concat(i," not registered in the list, loading denied.")}}return null}},{key:"checkOrigin",value:function(e){if(!this.origins)return null;if(!isAbsoluteUrl(e))return null;var t;try{t=new URL(e).origin}catch(t){return{code:CODE_POLICY,message:"无法解析的地址:".concat(e)}}return-1===this.origins.indexOf(t)?{code:CODE_POLICY,message:"来源 ".concat(t," 不在白名单内(允许:").concat(this.origins.join(", "),")")}:null}},{key:"verify",value:function(e,t){var r=this;if(!this.verifyHash)return Promise.resolve({ok:!0,skipped:"disabled"});if(!t)return Promise.resolve({ok:!0});var i="undefined"!=typeof globalThis&&globalThis.crypto&&globalThis.crypto.subtle;return i?this.fetch?Promise.resolve().then(function(){return r.fetch(e)}).then(function(e){return e&&e.ok?e.arrayBuffer().then(function(e){return i.digest("SHA-256",e)}):{ok:!1,message:"完整性预检请求失败:HTTP ".concat(e&&e.status||"unknown")}}).then(function(e){if(!e||!1===e.ok)return e;var r=toHex(e),i=String(t).toLowerCase();return r!==i?{ok:!1,message:"sha256 不匹配:期望 ".concat(i,",实际 ").concat(r)}:{ok:!0}}).catch(function(e){return{ok:!1,message:"完整性预检异常:".concat(e&&e.message||e),error:e}}):Promise.resolve({ok:!0,skipped:"fetch unavailable"}):Promise.resolve({ok:!0,skipped:"crypto.subtle unavailable(需要 https / localhost)"})}},{key:"describe",value:function(){return{manifest:this.enabled?this.manifest.name||"(unnamed)":null,version:this.manifest&&this.manifest.version||null,lockVersion:this.lockVersion,modules:this.enabled?Object.keys(this._moduleIndex()).length:0,origins:this.origins?this.origins.slice():null,verifyHash:this.verifyHash}}}])}(),DEFAULT_WATCH=["$","jQuery","define","require","requirejs","devfab","__devfab"],GlobalGuard=function(){return _createClass(function e(t){_classCallCheck(this,e);var r=t||{};this.maxPollution=void 0===r.maxPollution?3:Number(r.maxPollution),this.watch=[].concat(r.watch||DEFAULT_WATCH),this.target=r.target||("undefined"!=typeof window?window:null),this.enabled=void 0===r.enabled||!!r.enabled,this._pending=0,this._before=null,this.lastWarnings=[]},[{key:"_snapshot",value:function(){var e=new Map,t=this.target;return t?(Object.keys(t).forEach(function(r){e.set(r,t[r])}),e):e}},{key:"_diff",value:function(){var e=this,t=this._before,r=this._snapshot(),i=[];if(!t)return i;r.forEach(function(r,n){var o=-1!==e.watch.indexOf(n);t.has(n)?t.get(n)!==r&&i.push({type:"overwritten",key:n,watched:o}):i.push({type:"added",key:n,watched:o})});var n=i.filter(function(e){return e.watched}).length,o=i.filter(function(e){return"added"===e.type}).length;return!n&&o<=this.maxPollution?[]:i}},{key:"begin",value:function(){var e=this;if(!this.enabled||!this.target)return{end:function(){return[]}};this._pending++,1===this._pending&&(this._before=this._snapshot());var t=!1;return{end:function(){if(t)return[];if(t=!0,e._pending--,e._pending>0)return[];var r=e._diff();return e._before=null,e.lastWarnings=r,r}}}},{key:"configure",value:function(e){var t=e||{};return void 0!==t.enabled&&(this.enabled=!!t.enabled),void 0!==t.maxPollution&&(this.maxPollution=Number(t.maxPollution)),void 0!==t.watch&&(this.watch=[].concat(t.watch||[])),void 0!==t.target&&(this.target=t.target||null),this}}])}(),CODE_TIMEOUT=504,nativeImport=null;try{nativeImport=new Function("s","return import(s)")}catch(e){nativeImport=null}function parseArgs(e,t,r,i){var n=e,o=t,s=r;Array.isArray(e)&&!Array.isArray(t)&&(n=null==i?void 0:i.path,o=e,s="function"==typeof t?t:r);var a=(o=Array.isArray(o)?o:[]).join(","),u={code:0,message:"",data:[],warnings:[]};return("require"===i.type&&"function"!=typeof i.require||"define"===i.type&&"function"!=typeof i.define)&&(u.code=404,u.message="requirejs is undefined, the fiels: ".concat(a)),{path:n,files:o,callback:s,filesStr:a,result:u}}function toModuleIds(e,t){var r="";return Array.isArray(e)?r=e.filter(Boolean).join("/"):"string"==typeof e&&(r=e.replace(/\/+$/,"")),t.map(function(e){var t=String(e).replace(/^\/+/,"");return r?"".concat(r,"/").concat(t):t})}function toNumber(e,t){var r=Number(e);return Number.isFinite(r)?r:t}var DEFAULT_OPTIONS={version:"",timeout:15e3,retry:0,strict:!1,baseUrl:""},BaseFileRequire=function(){return _createClass(function e(t){var r;_classCallCheck(this,e);var i=t||{};void 0!==i.debug&&(this.debug=!!i.debug),this.__rootPath=void 0,this.__define=__requirejs.define,this.__require=__requirejs.require,this.__undef="function"==typeof(null===(r=this.__require)||void 0===r?void 0:r.undef)?this.__require.undef:null,this.__requireConfig=this._pickRequireConfig(this.__require),this.__import=i.importer||null,this._setTimer=i.setTimeout||function(e,t){return setTimeout(e,t)},this._clearTimer=i.clearTimeout||function(e){return clearTimeout(e)},this.options={version:i.version?String(i.version):DEFAULT_OPTIONS.version,timeout:void 0===i.timeout?DEFAULT_OPTIONS.timeout:Math.max(0,toNumber(i.timeout,0)),retry:void 0===i.retry?DEFAULT_OPTIONS.retry:Math.max(0,toNumber(i.retry,0)),strict:!!i.strict,baseUrl:i.baseUrl||DEFAULT_OPTIONS.baseUrl},this.policy=new LoadPolicy(i),this.guard=new GlobalGuard(this._guardOptions(i)),this.options.version&&this._applyUrlArgs()},[{key:"debug",get:function(){var e="undefined"!=typeof window?window.__devfab:null;return!(!e||!e.debug)},set:function(e){"undefined"!=typeof window&&(window.__devfab=window.__devfab||{},window.__devfab.debug=!!e)}},{key:"_pickRequireConfig",value:function(e){return e&&"function"==typeof e.config?e.config.bind(e):null}},{key:"_guardOptions",value:function(e){return!1===e.pollution?{enabled:!1,target:e.target}:e.pollution&&"object"===_typeof(e.pollution)?Object.assign({target:e.target},e.pollution):{target:e.target,watch:e.watch,maxPollution:e.maxPollution,enabled:void 0===e.pollution||!!e.pollution}}},{key:"configure",value:function(e){var t=e||{};return void 0!==t.debug&&(this.debug=!!t.debug),void 0!==t.version&&this.setVersion(t.version),void 0!==t.timeout&&(this.options.timeout=Math.max(0,toNumber(t.timeout,this.options.timeout))),void 0!==t.retry&&(this.options.retry=Math.max(0,toNumber(t.retry,this.options.retry))),void 0!==t.strict&&(this.options.strict=!!t.strict),void 0!==t.baseUrl&&(this.options.baseUrl=t.baseUrl||""),void 0===t.manifest&&void 0===t.origins&&void 0===t.lockVersion&&void 0===t.verifyHash&&void 0===t.fetch||this.policy.configure(t),void 0!==t.pollution?this.guard.configure(this._guardOptions(t)):void 0===t.watch&&void 0===t.maxPollution&&void 0===t.target||this.guard.configure(t),this}},{key:"setVersion",value:function(e){return this.options.version=e?String(e):"",this._applyUrlArgs(),this}},{key:"_applyUrlArgs",value:function(){if("function"!=typeof this.__requireConfig)return!1;try{return this.__requireConfig({urlArgs:this.options.version?"v=".concat(encodeURIComponent(this.options.version)):""}),!0}catch(e){return!1}}},{key:"getVersion",value:function(){return this.options.version}},{key:"describe",value:function(){return Object.assign({},this.options,{debug:this.debug,policy:this.policy.describe(),pollutionGuard:this.guard.enabled,canUndef:"function"==typeof this.__undef,canNativeImport:"function"==typeof(this.__import||nativeImport)})}},{key:"_define",value:function(e,t,r){var i=parseArgs(e,t,r,{path:this.__rootPath,define:this.__define,type:"define"}),n=i.path,o=i.files,s=i.callback,a=i.result;404!==a.code?this.__define(n,o,s):null==s||s(a)}},{key:"_mergeWarnings",value:function(e,t){var r=(e||[]).slice();return(t||[]).forEach(function(e){r.some(function(t){return t.type===e.type&&t.key===e.key})||r.push(e)}),r}},{key:"_undefModules",value:function(e){var t=this;"function"==typeof this.__undef&&e.forEach(function(e){try{t.__undef(e)}catch(e){}})}},{key:"_load",value:function(e,t,r){var i=this,n=this.options,o=parseArgs(e,t,r,{path:this.__rootPath,require:this.__require,type:"require"}),s=o.path,a=o.files,u=o.callback,c=o.result,l=o.filesStr;if(404!==c.code){var f=toModuleIds(s,a),d=this.policy.checkModules(f);if(d)return c.code=d.code,c.message=d.message,void(null==u||u(c));var p=!1,h=0,m=null,g=null,v=function(){g&&(c.warnings=i._mergeWarnings(c.warnings,g.end()),g=null)},y=function(){p||(p=!0,null!==m&&(i._clearTimer(m),m=null),v(),n.strict&&c.warnings.length&&(c.code=500,c.message="Global pollution detection failed:".concat(c.warnings.map(function(e){return"".concat(e.type,":").concat(e.key)}).join(", "))),null==u||u(c))},b=function(){h++,g=i.guard.begin(),n.timeout>0&&(m=i._setTimer(function(){if(!p){var e=new Error("load timeout after ".concat(n.timeout,"ms: ").concat(l));e.__devfabTimeout=!0,_(e,"files load timeout after ".concat(n.timeout,"ms, the files: ").concat(l))}},n.timeout)),i.__require(s,a,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];c.data=t,y()},function(e){_(e)})},_=function(e,t){if(!p){if(null!==m&&(i._clearTimer(m),m=null),h<=n.retry)return v(),i._undefModules(f),void b();c.code=e&&e.__devfabTimeout?CODE_TIMEOUT:500,c.message=t||"files load error, the files: ".concat(l),c.error=e,y()}};b()}else null==u||u(c)}},{key:"load",value:function(e,t,r){this._load(e,t,r)}},{key:"resolveUrl",value:function(e){var t=String(null==e?"":e);if(/^[a-z][a-z0-9+.-]*:/i.test(t)||/^\/\//.test(t))return t;var r=this.options.baseUrl||("undefined"!=typeof document&&document.baseURI?document.baseURI:"");if(!r)return t;try{return new URL(t,r).href}catch(e){return t}}},{key:"_importOne",value:function(e){var t=this,r=this.resolveUrl(e),i=this.policy.checkOrigin(r);if(i)return Promise.resolve({ok:!1,code:i.code,message:i.message});var n=this.policy.entryOf(e),o=n&&n.sha256,s=function(){var e=t.__import||nativeImport;return"function"!=typeof e?Promise.resolve({ok:!1,code:500,message:"native import() is unavailable(CSP 是否禁用了 unsafe-eval?)"}):Promise.resolve().then(function(){return e(r)}).then(function(e){return{ok:!0,module:e}},function(e){return{ok:!1,code:500,message:"module load error: ".concat(r),error:e}})};return o?this.policy.verify(r,o).then(function(e){return e.ok?s():{ok:!1,code:CODE_POLICY,message:"".concat(e.message,"(").concat(r,")")}}):s()}},{key:"loadModules",value:function(e,t,r){var i=this,n=parseArgs(e,t,r,{path:this.__rootPath,type:"module"}),o=n.path,s=n.files,a=n.callback,u=n.result,c=n.filesStr,l=toModuleIds(o,s),f=function(e){return null==a||a(e),e},d=this.policy.checkModules(l);if(d)return u.code=d.code,u.message=d.message,Promise.resolve(f(u));if(!s.length)return Promise.resolve(f(u));var p=this.guard.begin();return Promise.all(l.map(function(e){return i._importOne(e)})).then(function(e){u.warnings=p.end();var t=e.filter(function(e){return!e.ok});return t.length?(u.code=t[0].code||500,u.message="".concat(t.map(function(e){return e.message}).join("; "),"(the files: ").concat(c,")"),u.error=t[0].error):u.data=e.map(function(e){return e.module}),f(u)})}},{key:"loadModule",value:function(e,t){return this.loadModules([e],t)}}])}(),FileRequireClass=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"provide",value:function(e,t,r){this._define(e,t,r)}},{key:"provideScript",value:function(e){var t=e;"function"!=typeof e&&(t=function(){return e}),this.provide([],t)}},{key:"inject",value:function(e,t,r){this._load(e,t,r)}},{key:"injectScript",value:function(e,t,r,i){var n=this,o=e,s=t,a=r,u=i;Array.isArray(e)&&"function"==typeof t&&(o=void 0,s=e,a=t,u=r),this.inject(o,s,function(e){if(0==e.code&&Array.isArray(e.data))for(var t=0,r=e.data.length;t<r;t++){var i,o=e.data[t];null===(i=a)||void 0===i||i(o,t)}else"function"==typeof u?u(e):n.debug&&console.error("[devfab][FileRequire][injectScript] error: ",e)})}}])}(BaseFileRequire),FileRequire=new FileRequireClass;window.__devfab=Object.assign({},window.__devfab),window.__devfab.FileRequire=FileRequire,exports.CODE_POLICY=CODE_POLICY,exports.CODE_TIMEOUT=CODE_TIMEOUT,exports.DEFAULT_WATCH=DEFAULT_WATCH,exports.FileRequire=FileRequire,exports.GlobalGuard=GlobalGuard,exports.LoadPolicy=LoadPolicy,exports.default=FileRequire,Object.defineProperty(exports,"__esModule",{value:!0})});
|