plugin-tls 3.5.1 → 3.6.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.
Files changed (68) hide show
  1. package/dist/TierOptionsPluginHostEventEmitter-BjGVIRN6.cjs +1 -0
  2. package/dist/TierOptionsPluginHostEventEmitter-DXTNpSmS.js +131 -0
  3. package/dist/TierOptionsPluginHostEventTarget-Bok_zzQ1.js +131 -0
  4. package/dist/TierOptionsPluginHostEventTarget-DqfVEP_L.cjs +1 -0
  5. package/dist/decorator-Culqv4k6.js +1454 -0
  6. package/dist/decorator-Wf_x4qDo.cjs +1 -0
  7. package/dist/index-com.d.ts +3 -0
  8. package/dist/index-com.d.ts.map +1 -0
  9. package/dist/index-node.cjs +1 -0
  10. package/dist/index-node.d.ts +4 -0
  11. package/dist/index-node.d.ts.map +1 -0
  12. package/dist/index-node.js +58 -0
  13. package/dist/index-web.cjs +1 -0
  14. package/dist/index-web.d.ts +4 -0
  15. package/dist/index-web.d.ts.map +1 -0
  16. package/dist/index-web.js +58 -0
  17. package/dist/index.cjs +1 -0
  18. package/dist/index.d.ts +5 -4
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +60 -1706
  21. package/dist/options/index-com.d.ts +4 -0
  22. package/dist/options/index-com.d.ts.map +1 -0
  23. package/dist/options/index-node.d.ts +3 -0
  24. package/dist/options/index-node.d.ts.map +1 -0
  25. package/dist/options/index-web.d.ts +3 -0
  26. package/dist/options/index-web.d.ts.map +1 -0
  27. package/dist/options/options-plugin-host/{index.d.ts → index-com.d.ts} +1 -1
  28. package/dist/options/options-plugin-host/index-com.d.ts.map +1 -0
  29. package/dist/options/options-plugin-host/index-node.d.ts +4 -0
  30. package/dist/options/options-plugin-host/index-node.d.ts.map +1 -0
  31. package/dist/options/options-plugin-host/index-web.d.ts +4 -0
  32. package/dist/options/options-plugin-host/index-web.d.ts.map +1 -0
  33. package/dist/options/options-plugin-host/tier-mode-options/TierModeOptionsPluginHost.d.ts +1 -1
  34. package/dist/options/options-plugin-host/tier-mode-options/TierModeOptionsPluginHost.d.ts.map +1 -1
  35. package/dist/options/options-plugin-host/tier-mode-options/TierModeOptionsPluginHostEventEmitter.d.ts +2 -2
  36. package/dist/options/options-plugin-host/tier-mode-options/TierModeOptionsPluginHostEventEmitter.d.ts.map +1 -1
  37. package/dist/options/options-plugin-host/tier-mode-options/TierModeOptionsPluginHostEventTarget.d.ts +1 -1
  38. package/dist/options/options-plugin-host/tier-mode-options/TierModeOptionsPluginHostEventTarget.d.ts.map +1 -1
  39. package/dist/options/options-plugin-host/tier-mode-options/index.d.ts +0 -2
  40. package/dist/options/options-plugin-host/tier-mode-options/index.d.ts.map +1 -1
  41. package/dist/options/options-plugin-host/tier-options/TierOptionsPluginHost.d.ts +1 -1
  42. package/dist/options/options-plugin-host/tier-options/TierOptionsPluginHost.d.ts.map +1 -1
  43. package/dist/options/options-plugin-host/tier-options/TierOptionsPluginHostEventEmitter.d.ts +2 -2
  44. package/dist/options/options-plugin-host/tier-options/TierOptionsPluginHostEventEmitter.d.ts.map +1 -1
  45. package/dist/options/options-plugin-host/tier-options/TierOptionsPluginHostEventTarget.d.ts +1 -1
  46. package/dist/options/options-plugin-host/tier-options/TierOptionsPluginHostEventTarget.d.ts.map +1 -1
  47. package/dist/options/options-plugin-host/tier-options/index.d.ts +0 -2
  48. package/dist/options/options-plugin-host/tier-options/index.d.ts.map +1 -1
  49. package/dist/options/plugins/tier-mode-options/type.d.ts +1 -1
  50. package/dist/options/plugins/tier-mode-options/type.d.ts.map +1 -1
  51. package/dist/options/plugins/tier-options/type.d.ts +1 -1
  52. package/dist/options/plugins/tier-options/type.d.ts.map +1 -1
  53. package/dist/plugin-host/{index.d.ts → index-com.d.ts} +1 -3
  54. package/dist/plugin-host/index-com.d.ts.map +1 -0
  55. package/dist/plugin-host/index-node.d.ts +3 -0
  56. package/dist/plugin-host/index-node.d.ts.map +1 -0
  57. package/dist/plugin-host/index-web.d.ts +3 -0
  58. package/dist/plugin-host/index-web.d.ts.map +1 -0
  59. package/dist/plugin-manager/IExtend.d.ts +3 -0
  60. package/dist/plugin-manager/IExtend.d.ts.map +1 -1
  61. package/dist/plugin-manager/mixin.d.ts +4 -0
  62. package/dist/plugin-manager/mixin.d.ts.map +1 -1
  63. package/package.json +23 -6
  64. package/dist/index.umd.cjs +0 -1
  65. package/dist/options/index.d.ts +0 -4
  66. package/dist/options/index.d.ts.map +0 -1
  67. package/dist/options/options-plugin-host/index.d.ts.map +0 -1
  68. package/dist/plugin-host/index.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -1,1708 +1,62 @@
1
- import { Destroyable as M, DestroyableEventEmitter as H, DestroyableEventTarget as V, createDestroyableSubClass as j } from "@gby/destroyable";
2
- import { omitMembers as k, removeUndefined as I, pickMembers as S, serialCallFuns as g } from "com-tools";
3
- import { deepmergeInto as y, deepmerge as w } from "deepmerge-ts";
4
- function p(s, ...t) {
5
- for (const e of t) {
6
- const n = Object.getOwnPropertyDescriptors(e);
7
- Object.defineProperties(s, n);
8
- }
9
- return s;
10
- }
11
- function W(s, t, e) {
12
- let n = Object.getOwnPropertyDescriptors(t);
13
- return e && k(n, e), Object.defineProperties(s, n), s;
14
- }
15
- function G(s, t, e) {
16
- let n = Object.getOwnPropertyDescriptors(t);
17
- return e ? Object.defineProperties(s, I(S(n, e))) : Object.defineProperties(s, n), s;
18
- }
19
- function J(s, t) {
20
- return t;
21
- }
22
- function L() {
23
- return function(t) {
24
- return t;
25
- };
26
- }
27
- function Q(s, t) {
28
- return p(s, t), t;
29
- }
30
- function X(s) {
31
- return function(e) {
32
- return p(s, e), e;
33
- };
34
- }
35
- function c(s, t) {
36
- return p(s, t), s;
37
- }
38
- function Y(s) {
39
- return function(e) {
40
- return p(s, e), s;
41
- };
42
- }
43
- function Z(s, t) {
44
- return t;
45
- }
46
- function tt() {
47
- return function(t) {
48
- return t;
49
- };
50
- }
51
- function et(s, t) {
52
- return p(s.prototype, t), t;
53
- }
54
- function nt(s) {
55
- return function(e) {
56
- return p(s.prototype, e), e;
57
- };
58
- }
59
- function st(s, t) {
60
- return p(s.prototype, t), s;
61
- }
62
- function it(s) {
63
- return function(e) {
64
- return p(s.prototype, e), s;
65
- };
66
- }
67
- const b = ["onCreate", "onInit", "onDestroy"];
68
- function rt(s) {
69
- const t = { ...s };
70
- for (const e of b)
71
- typeof t[e] == "function" && delete t[e];
72
- return t;
73
- }
74
- function T(s, t) {
75
- let e = Object.getOwnPropertyDescriptors(t);
76
- for (const n of b)
77
- typeof t[n] == "function" && delete e[n];
78
- return Object.defineProperties(s, e), s;
79
- }
80
- function A(s) {
81
- return s && typeof s.onUse == "function";
82
- }
83
- class ot extends M {
84
- /**
85
- * 插件的宿主
86
- */
87
- host;
88
- /**
89
- * 所有注册的插件
90
- */
91
- plugins = /* @__PURE__ */ new Map();
92
- /**
93
- * @param host - 插件的宿主
94
- */
95
- constructor(t) {
96
- super(), t && (this.host = t);
97
- }
98
- destroyThis() {
99
- return this.plugins.clear(), this.host = null, super.destroyThis();
100
- }
101
- /**
102
- * 是否注册了插件
103
- * @param plugin - 插件
104
- * @returns 是否注册了插件
105
- */
106
- hasUsed(t) {
107
- return this.plugins.has(t);
108
- }
109
- /**
110
- * 使用插件、注册插件
111
- * @param plugin - 插件
112
- * @param args - 传递给插件的选项
113
- */
114
- use(t, ...e) {
115
- const { plugins: n } = this;
116
- if (n.has(t)) return n.get(t);
117
- const i = t.onUse(this.host, ...e);
118
- return n.set(t, i), i;
119
- }
120
- /**
121
- * 插件宿主实例的注册插件的方法
122
- *
123
- * @remarks
124
- * 会调用每个插件的 {@link IPlugin.use } 方法
125
- * @param hostInst - 插件宿主的新实例
126
- */
127
- instUse(t, e, ...n) {
128
- const { plugins: i } = this;
129
- if (i.has(e)) return i.get(e);
130
- const r = this.use(e, ...n);
131
- return e.onCreate?.(t), r;
132
- }
133
- /**
134
- * 插件宿主创建实例时调用
135
- *
136
- * @remarks
137
- * 会调用每个插件的 {@link IPlugin.onCreate} 方法
138
- * 如果插件的 created 方法返回 Promise,则会等待 Promise resolve
139
- * @param hostInst - 插件宿主的新实例
140
- */
141
- onCreate(t, ...e) {
142
- const n = [];
143
- for (const [i] of this.plugins)
144
- i.onCreate && n.push(i.onCreate.bind(i));
145
- return g(n, void 0, [t, ...e]);
146
- }
147
- /**
148
- * 插件宿主创建实例时调用
149
- *
150
- * @remarks
151
- * 会调用每个插件的 {@link IPlugin.onCreate } 方法
152
- * @param hostInst - 插件宿主的新实例
153
- * @param args - 初始化宿主实例时的参数
154
- */
155
- onInit(t, ...e) {
156
- const n = [];
157
- for (const [i] of this.plugins)
158
- i.onInit && n.push(i.onInit.bind(i));
159
- return g(n, void 0, [t, ...e]);
160
- }
161
- /**
162
- * 插件宿主被销毁时调用
163
- *
164
- * @remarks
165
- * 会调用每个插件的 {@link IPlugin.onDestroy} 方法
166
- * @param hostInst - 被销毁的插件实例
167
- */
168
- onDestroy(t) {
169
- const e = [];
170
- for (const [n] of this.plugins)
171
- n.onDestroy && e.push(n.onDestroy.bind(n));
172
- return e.reverse(), g(e, void 0, [t]);
173
- }
174
- }
175
- class ut extends M {
176
- /**
177
- * 插件的宿主
178
- */
179
- host;
180
- /**
181
- * 所有注册的插件
182
- */
183
- plugins = /* @__PURE__ */ new Set();
184
- /**
185
- * @param host - 插件的宿主
186
- */
187
- constructor(t) {
188
- super(), t && (this.host = t);
189
- }
190
- destroyThis() {
191
- return this.plugins.clear(), this.host = null, super.destroyThis();
192
- }
193
- /**
194
- * 是否注册了插件
195
- * @param plugin - 插件
196
- * @returns 是否注册了插件
197
- */
198
- hasUsed(t) {
199
- return this.plugins.has(t);
200
- }
201
- /**
202
- * 使用插件、注册插件
203
- * @param plugin - 插件
204
- * @returns 返回插件对象本身
205
- */
206
- use(t) {
207
- const { plugins: e } = this;
208
- return e.has(t) || (T(this.host.prototype, t), e.add(t)), t;
209
- }
210
- /**
211
- * 插件宿主实例的注册插件的方法
212
- *
213
- * @remarks
214
- * 会调用每个插件的 {@link IExtend.use } 方法
215
- * @param hostInst - 插件宿主的新实例
216
- */
217
- instUse(t, e, ...n) {
218
- const { plugins: i } = this;
219
- return i.has(e) || (this.use(e), e.onCreate?.call(t, t, ...n)), e;
220
- }
221
- /**
222
- * 插件宿主创建实例时调用
223
- *
224
- * @remarks
225
- * 会调用每个插件的 {@link IExtend.onCreate} 方法
226
- * 如果插件的 created 方法返回 Promise,则会等待 Promise resolve
227
- * @param hostInst - 插件宿主的新实例
228
- */
229
- onCreate(t, ...e) {
230
- const n = [];
231
- for (const i of this.plugins)
232
- i.onCreate && n.push(i.onCreate);
233
- return g(n, t, [t, ...e]);
234
- }
235
- /**
236
- * 插件宿主创建实例时调用
237
- *
238
- * @remarks
239
- * 会调用每个插件的 {@link IExtend.onCreate } 方法
240
- * @param hostInst - 插件宿主的新实例
241
- * @param args - 初始化宿主实例时的参数
242
- */
243
- onInit(t, ...e) {
244
- const n = [];
245
- for (const i of this.plugins)
246
- i.onInit && n.push(i.onInit);
247
- return g(n, t, [t, ...e]);
248
- }
249
- /**
250
- * 插件宿主被销毁时调用
251
- *
252
- * @remarks
253
- * 会调用每个插件的 {@link IExtend.onDestroy} 方法
254
- * @param hostInst - 被销毁的插件实例
255
- */
256
- onDestroy(t) {
257
- const e = [];
258
- for (const n of this.plugins)
259
- n.onDestroy && e.push(n.onDestroy);
260
- return e.reverse(), g(e, t, [t]);
261
- }
262
- }
263
- const O = /* @__PURE__ */ Symbol("extend");
264
- class d extends M {
265
- /**
266
- * 插件的宿主
267
- */
268
- host;
269
- /**
270
- * 所有注册的插件
271
- */
272
- plugins = /* @__PURE__ */ new Map();
273
- /**
274
- * @param host - 插件的宿主
275
- */
276
- constructor(t) {
277
- super(), t && (this.host = t);
278
- }
279
- destroyThis() {
280
- return this.plugins.clear(), this.host = null, super.destroyThis();
281
- }
282
- /**
283
- * 是否注册了插件 或 扩展
284
- * @param plugin - 插件 或 扩展
285
- * @returns 是否注册了插件 或 扩展
286
- */
287
- hasUsed(t) {
288
- return this.plugins.has(t);
289
- }
290
- /**
291
- * 判断一个对象是否是插件
292
- * @param target
293
- * @returns
294
- */
295
- isPlugin(t) {
296
- const { plugins: e } = this;
297
- return e.has(t) ? e.get(t) !== O : A(t);
298
- }
299
- /**
300
- * 使用插件、注册插件
301
- * @param ext - 插件
302
- * @param args - 传递给插件的选项
303
- */
304
- useExtend(t) {
305
- const { plugins: e } = this;
306
- return e.has(t) ? e.get(t) : (T(this.host.prototype, t), e.set(t, O), t);
307
- }
308
- /**
309
- * 插件宿主实例的注册插件的方法
310
- *
311
- * @remarks
312
- * 会调用每个插件的 {@link IExtend.use } 方法
313
- * @param hostInst - 插件宿主的新实例
314
- */
315
- instUseExtend(t, e, ...n) {
316
- const { plugins: i } = this;
317
- return i.has(e) ? i.get(e) : (this.useExtend(e), e.onCreate?.call(t, t, ...n), e);
318
- }
319
- /**
320
- * 使用插件、注册插件
321
- * @param plugin - 插件
322
- * @param args - 传递给插件的选项
323
- */
324
- usePlugin(t, ...e) {
325
- const { plugins: n } = this;
326
- if (n.has(t)) return n.get(t);
327
- const i = t.onUse(this.host, ...e);
328
- return n.set(t, i), i;
329
- }
330
- /**
331
- * 插件宿主实例的注册插件的方法
332
- *
333
- * @remarks
334
- * 会调用每个插件的 {@link IPlugin.use } 方法
335
- * @param hostInst - 插件宿主的新实例
336
- */
337
- instUsePlugin(t, e, ...n) {
338
- const { plugins: i } = this;
339
- if (i.has(e)) return i.get(e);
340
- const r = this.usePlugin(e, ...n);
341
- return e.onCreate?.(t), r;
342
- }
343
- /**
344
- * 插件宿主创建实例时调用
345
- *
346
- * @remarks
347
- * 会调用每个插件的 {@link IPlugin.onCreate} 方法
348
- * 如果插件的 created 方法返回 Promise,则会等待 Promise resolve
349
- * @param hostInst - 插件宿主的新实例
350
- */
351
- onCreate(t, ...e) {
352
- const n = [];
353
- for (const [i, r] of this.plugins)
354
- if (i.onCreate) {
355
- const o = r === O ? i.onCreate : i.onCreate.bind(i);
356
- n.push(o);
357
- }
358
- return g(n, t, [t, ...e]);
359
- }
360
- /**
361
- * 插件宿主创建实例时调用
362
- *
363
- * @remarks
364
- * 会调用每个插件的 {@link IPlugin.onCreate } 方法
365
- * @param hostInst - 插件宿主的新实例
366
- * @param args - 初始化宿主实例时的参数
367
- */
368
- onInit(t, ...e) {
369
- const n = [];
370
- for (const [i, r] of this.plugins)
371
- if (i.onInit) {
372
- const o = r === O ? i.onInit : i.onInit.bind(i);
373
- n.push(o);
374
- }
375
- return g(n, t, [t, ...e]);
376
- }
377
- /**
378
- * 插件宿主被销毁时调用
379
- *
380
- * @remarks
381
- * 会调用每个插件的 {@link IPlugin.onDestroy} 方法
382
- * @param hostInst - 被销毁的插件实例
383
- */
384
- onDestroy(t) {
385
- const e = [];
386
- for (const [n, i] of this.plugins)
387
- if (n.onDestroy) {
388
- const r = i === O ? n.onDestroy : n.onDestroy.bind(n);
389
- e.push(r);
390
- }
391
- return e.reverse(), g(e, t, [t]);
392
- }
393
- }
394
- function at(s, t) {
395
- const e = t ?? "defaultOptions", n = `_${e}`;
396
- return function(r) {
397
- const o = c(r, {
398
- /**
399
- * 全局级别的默认选项
400
- */
401
- get [e]() {
402
- return s;
403
- }
404
- });
405
- c(o.prototype, {
406
- /**
407
- * 实例级的默认选项
408
- */
409
- get [e]() {
410
- return this[n] || (this[n] = structuredClone(o.defaultOptions));
411
- }
412
- });
413
- };
414
- }
415
- function lt(s, t, e) {
416
- const n = `_${t}`;
417
- return c(s.prototype, {
418
- /**
419
- * 实例级的默认选项
420
- */
421
- get [t]() {
422
- return this[n] || (this[n] = structuredClone(s[t]));
423
- }
424
- }), e;
425
- }
426
- function E(s) {
427
- const t = s.split(".");
428
- return t[0] === "" && t.shift(), t;
429
- }
430
- function x(s, t) {
431
- for (const e of t)
432
- if (s = s[e], s == null) return;
433
- return s;
434
- }
435
- function pt(s, t) {
436
- return x(s, E(t));
437
- }
438
- function U(s, t, e) {
439
- const n = t.pop(), i = t.length;
440
- let r = 0;
441
- for (; r < i; ) {
442
- const o = s[t[r]];
443
- if (o == null) break;
444
- s = o, r++;
445
- }
446
- t = t.slice(r);
447
- for (const o of t)
448
- s = s[o] = {};
449
- return s[n] = e, s;
450
- }
451
- function dt(s, t, e) {
452
- return U(s, E(t), e);
453
- }
454
- const P = {
455
- UndefinedAndNull: function(t) {
456
- return t == null;
457
- },
458
- Undefined: function(t) {
459
- return t === void 0;
460
- },
461
- Null: function(t) {
462
- return t === null;
463
- }
464
- };
465
- class v {
466
- /**
467
- * 是否要冻结 fullOption 的成员
468
- * @remarks
469
- * 只会冻结 fullOption 的直接成员的值,不会冻结 fullOption 孙子成员的值
470
- */
471
- freezeMember = !0;
472
- /**
473
- * 可更新顶级成员值的完整的选项
474
- * @remarks
475
- * 合并后的选项;
476
- * plainFullOption 的代理对象,自动监听了顶层成员的屐;所以可以更改顶级成员的值,不可以更改非顶级成员的值;
477
- */
478
- fullOption = new Proxy(this, {
479
- // @ts-ignore
480
- get: function(t, e, n) {
481
- const i = t.plainFullOption[e];
482
- return t.freezeMember ? Object.freeze(i) : i;
483
- },
484
- // @ts-ignore
485
- set: function(t, e, n, i) {
486
- return t.setMember(e, n, !1), !0;
487
- },
488
- // @ts-ignore
489
- has: function(t, e) {
490
- return e in t.plainFullOption;
491
- },
492
- // @ts-ignore
493
- getOwnPropertyDescriptor: function(t, e) {
494
- return Object.getOwnPropertyDescriptor(t.plainFullOption, e);
495
- },
496
- // @ts-ignore
497
- ownKeys: function(t) {
498
- return Reflect.ownKeys(t.plainFullOption);
499
- },
500
- // @ts-ignore
501
- deleteProperty: function(t, e) {
502
- return t.setMember(e, void 0), !0;
503
- },
504
- // @ts-ignore
505
- defineProperty: function(t, e, n) {
506
- return Object.defineProperty(t.option, e, n), !0;
507
- }
508
- });
509
- /**
510
- * 设置选项
511
- * @remarks
512
- * 会将被设置的选项浅合并进当前选项中
513
- * @param option
514
- * @param deep - 是否要进行深度合并
515
- */
516
- setOption(t, e) {
517
- const n = e ? y(this.option, t) : Object.assign(this.option, t);
518
- return this.updateFullOption(), n;
519
- }
520
- /**
521
- * 未定义值的类型
522
- */
523
- get undefinedValue() {
524
- return this._undefinedValue;
525
- }
526
- set undefinedValue(t) {
527
- this._undefinedValue = t, this.isUndefined = P[t] || P.UndefinedAndNull;
528
- }
529
- _undefinedValue = "UndefinedAndNull";
530
- /**
531
- * 未定义值的判断函数
532
- */
533
- isUndefined = P.UndefinedAndNull;
534
- /**
535
- * 获取选项成员
536
- * @param key
537
- * @returns
538
- */
539
- getMember(t) {
540
- return this.option[t];
541
- }
542
- /**
543
- * 设置选项成员
544
- * @param key
545
- * @param value
546
- * @param deep - 是否要进行深度合并
547
- */
548
- setMember(t, e, n) {
549
- const i = this.option;
550
- if (e === void 0)
551
- delete i[t];
552
- else {
553
- const r = i[t];
554
- n && r && typeof r == "object" ? y(r, e) : i[t] = e;
555
- }
556
- this.updateFullOption();
557
- }
558
- /**
559
- * 获取属性路径对应的值
560
- * @param propPath
561
- * @returns
562
- */
563
- getValue(t) {
564
- return x(this.option, t);
565
- }
566
- /**
567
- * 设置属性路径对应的值
568
- * @param propPath
569
- * @param value
570
- * @param deep - 是否要进行深度合并
571
- * @returns
572
- */
573
- setValue(t, e, n) {
574
- const i = this.option;
575
- let r;
576
- n && (r = x(i, t)) && typeof r == "object" ? y(r, e) : U(this.option, t, e), this.updateFullOption();
577
- }
578
- }
579
- class u extends v {
580
- constructor(t, e) {
581
- super(), t && (this.option = t), e && (this.extends = e);
582
- }
583
- /**
584
- * 继承的选项
585
- */
586
- get extends() {
587
- return this._extends;
588
- }
589
- set extends(t) {
590
- this._extends = t, this.updateFullOption();
591
- }
592
- _extends = null;
593
- /**
594
- * 选项
595
- */
596
- option = {};
597
- /**
598
- * 获取完整的选项
599
- * @remarks
600
- * 会与继承来的选项进行合并
601
- */
602
- get plainFullOption() {
603
- let t = this._plainFullOption;
604
- if (t) return t;
605
- const { extends: e, option: n } = this;
606
- if (t = n, e) {
607
- const i = e.plainFullOption;
608
- t = w(i, n);
609
- }
610
- return this._plainFullOption = t;
611
- }
612
- _plainFullOption = null;
613
- /**
614
- * 更新
615
- */
616
- updateFullOption() {
617
- this._plainFullOption = null;
618
- }
619
- /**
620
- * 获取选项成员
621
- * @param key
622
- * @returns
623
- */
624
- getMember(t) {
625
- const e = this.option[t];
626
- if (!this.isUndefined(e)) return e;
627
- const n = this.extends;
628
- if (n)
629
- return n.getMember(t);
630
- }
631
- /**
632
- * 获取属性路径对应的值
633
- * @param propPath
634
- * @returns
635
- */
636
- getValue(t) {
637
- const e = super.getValue(t);
638
- if (!this.isUndefined(e)) return e;
639
- const n = this.extends;
640
- if (n)
641
- return n.getValue(t);
642
- }
643
- }
644
- function gt(s, t) {
645
- const { name: e } = t, n = `_${e}`;
646
- return {
647
- get: function() {
648
- return this[n] || (this[n] = new u(void 0, this.constructor[e]));
649
- }
650
- };
651
- }
652
- class B extends v {
653
- constructor(t, e) {
654
- super(), e && this.setModeOption(t, e), this.mode = t;
655
- }
656
- /**
657
- * 模式的配置
658
- */
659
- modes = {};
660
- /**
661
- * 当前模式
662
- */
663
- get mode() {
664
- return this._mode || (this.mode = this.modeNames[0]);
665
- }
666
- set mode(t) {
667
- this._mode = t, this.hasMode(t) || this.setModeOption(t, {}), this.updateFullOption();
668
- }
669
- _mode;
670
- /**
671
- * 所有的模式名字
672
- */
673
- get modeNames() {
674
- return this._modeNames || (this._modeNames = this.getModeNames());
675
- }
676
- _modeNames = null;
677
- /**
678
- * 获取所有的模式名字
679
- * @returns
680
- */
681
- getModeNames() {
682
- return Object.keys(this.modes);
683
- }
684
- /**
685
- * 判断是否有某个模式
686
- * @param mode
687
- * @returns
688
- */
689
- hasMode(t) {
690
- return !!this.modes[t];
691
- }
692
- /**
693
- * 当前模式的选项
694
- */
695
- get optionManager() {
696
- return this.modes[this.mode];
697
- }
698
- /**
699
- * 当前模式对应的选项
700
- */
701
- get option() {
702
- return this.optionManager.option;
703
- }
704
- get plainFullOption() {
705
- return this._plainFullOption ?? (this._plainFullOption = this.getFullModeOption(this.mode));
706
- }
707
- _plainFullOption = null;
708
- /**
709
- * 更新
710
- */
711
- updateFullOption() {
712
- this._plainFullOption = null, this._modeNames = null;
713
- }
714
- /**
715
- * 返回已合并继承选项的选项
716
- * @remarks
717
- * 与继承选项只是浅合并
718
- * @param mode
719
- * @returns
720
- */
721
- getModeOption(t) {
722
- return this.modes[t].option;
723
- }
724
- /**
725
- * 返回已合并继承选项的完整选项
726
- * @remarks
727
- * 与继承选项合并
728
- * @param mode
729
- * @returns
730
- */
731
- getFullModeOption(t) {
732
- return this.modes[t]?.plainFullOption;
733
- }
734
- /**
735
- * 给模式设置选项
736
- * @param mode
737
- * @param option
738
- * @param deep - 是否要进行深度合并
739
- * @param extend - 继承哪个模式
740
- */
741
- setModeOption(t, e, n, i) {
742
- const { modes: r } = this, o = r[t] || (r[t] = new u());
743
- if (o.setOption(e, n), i) {
744
- const l = r[i];
745
- l && (o.extends = l);
746
- }
747
- return this.updateFullOption(), o;
748
- }
749
- }
750
- class a extends B {
751
- constructor(t, e, n) {
752
- super(t, e), n && (this.extends = n);
753
- }
754
- /**
755
- * 继承的选项
756
- */
757
- get extends() {
758
- return this._extends;
759
- }
760
- set extends(t) {
761
- this._extends = t, this.updateFullOption();
762
- }
763
- _extends = null;
764
- /**
765
- * 返回已合并继承选项的最终选项
766
- * @remarks
767
- * 与继承选项只是浅合并
768
- * @param mode
769
- * @returns
770
- */
771
- getFullModeOption(t) {
772
- const { modes: e, extends: n } = this, i = e[t]?.plainFullOption;
773
- if (n) {
774
- const r = n.getFullModeOption(t);
775
- return i ? w(r, i) : r;
776
- }
777
- return i;
778
- }
779
- /**
780
- * 获取所有的模式名字
781
- * @returns
782
- */
783
- getModeNames() {
784
- const { modes: t, extends: e } = this, n = Object.keys(t);
785
- if (!e) return n;
786
- const i = e.getModeNames();
787
- return [.../* @__PURE__ */ new Set([...n, ...i])];
788
- }
789
- /**
790
- * 在整个层级上判断是否有某个模式
791
- * @param mode
792
- * @returns
793
- */
794
- hasModeOnTier(t) {
795
- if (this.hasMode(t)) return !0;
796
- const e = this.extends;
797
- return e ? e.hasModeOnTier(t) : !1;
798
- }
799
- /**
800
- * 当前模式的选项
801
- */
802
- get optionManager() {
803
- return this.getModeOptionManager(this.mode);
804
- }
805
- /**
806
- * 获取模式对应的选项管理器
807
- * @param mode
808
- * @returns
809
- */
810
- getModeOptionManager(t) {
811
- const e = this.modes[t];
812
- return e || (this.extends?.getModeOptionManager(t) ? this.setModeOption(t, {}) : null);
813
- }
814
- /**
815
- * 获取选项成员
816
- * @param key
817
- * @returns
818
- */
819
- getMember(t) {
820
- const e = this.optionManager.getMember(t);
821
- if (!this.isUndefined(e)) return e;
822
- const n = this.extends;
823
- if (n)
824
- return n.getMember(t);
825
- }
826
- /**
827
- * 获取属性路径对应的值
828
- * @param propPath
829
- * @returns
830
- */
831
- getValue(t) {
832
- const e = this.optionManager.getValue(t);
833
- if (!this.isUndefined(e)) return e;
834
- const n = this.extends;
835
- if (n)
836
- return n.getValue(t);
837
- }
838
- }
839
- function ct(s, t) {
840
- const { name: e } = t, n = `_${e}`;
841
- return {
842
- get: function() {
843
- return this[n] || (this[n] = new a(this.constructor[e].mode, void 0, this.constructor[e]));
844
- }
845
- };
846
- }
847
- class D extends M {
848
- /**
849
- * 是否使用独立的插件管理器
850
- * @defaultValue false
851
- */
852
- static isolatedPluginManager = !1;
853
- /**
854
- * 插件管理器
855
- */
856
- static get pluginManager() {
857
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
858
- }
859
- static _pluginManager = new d(this);
860
- /**
861
- * 插件管理器 {@link PluginHost.pluginManager}
862
- */
863
- get pluginManager() {
864
- return this.constructor.pluginManager;
865
- }
866
- /**
867
- * {@inheritDoc PluginExtendManager.usePlugin}
868
- */
869
- static usePlugin(t, ...e) {
870
- return this.pluginManager.usePlugin(t, ...e);
871
- }
872
- /**
873
- * {@inheritDoc PluginExtendManager.useExtend}
874
- */
875
- static useExtend(t) {
876
- return this.pluginManager.useExtend(t);
877
- }
878
- /**
879
- * 是否注册了插件 或 扩展
880
- * @param plugin - 插件 或 扩展
881
- * @returns 是否注册了插件 或 扩展
882
- */
883
- static hasUsed(t) {
884
- return this.pluginManager.hasUsed(t);
885
- }
886
- /**
887
- * 需要在子类中调用
888
- *
889
- * 之所以没写在该类中的函数中,是因为 `this.pluginManager.onCreate(this,...args)` 通常会在构建函数执行的最后时才调用;
890
- * 如果像下面写在该类的构建函数中,然后子类通过 `super()` 来调用,这样就会导致 `this.pluginManager.onCreate(this,...args)` 不是在最后的执行;
891
- */
892
- // constructor(...args:any) {
893
- // super();
894
- // // @ts-ignore
895
- // this.pluginManager.onCreate(this,...args);
896
- // }
897
- /**
898
- * 实例的注册插件的方法
899
- * @param plugin
900
- * @param args
901
- * @returns
902
- */
903
- usePlugin(t, ...e) {
904
- return this.pluginManager.instUsePlugin(this, t, ...e);
905
- }
906
- /**
907
- * {@inheritDoc PluginExtendManager.useExtend}
908
- */
909
- useExtend(t, ...e) {
910
- return this.pluginManager.instUseExtend(this, t, ...e);
911
- }
912
- /**
913
- * 初始化实例
914
- * @remarks
915
- * 会调用 {@link PluginExtendManager.onInit}
916
- * @param args
917
- */
918
- init(...t) {
919
- return this.pluginManager.onInit(this, ...t);
920
- }
921
- /**
922
- * 销毁实例
923
- * @returns
924
- */
925
- destroyThis() {
926
- const t = this.pluginManager.onDestroy(this);
927
- return t instanceof Promise ? t.finally(() => super.destroyThis()) : super.destroyThis();
928
- }
929
- }
930
- class F extends H {
931
- /**
932
- * 是否使用独立的插件管理器
933
- * @defaultValue false
934
- */
935
- static isolatedPluginManager = !1;
936
- /**
937
- * 插件管理器
938
- */
939
- static get pluginManager() {
940
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
941
- }
942
- static _pluginManager = new d(this);
943
- /**
944
- * 插件管理器 {@link PluginHost.pluginManager}
945
- */
946
- get pluginManager() {
947
- return this.constructor.pluginManager;
948
- }
949
- /**
950
- * {@inheritDoc PluginExtendManager.usePlugin}
951
- */
952
- static usePlugin(t, ...e) {
953
- return this.pluginManager.usePlugin(t, ...e);
954
- }
955
- /**
956
- * {@inheritDoc PluginExtendManager.useExtend}
957
- */
958
- static useExtend(t) {
959
- return this.pluginManager.useExtend(t);
960
- }
961
- /**
962
- * 是否注册了插件 或 扩展
963
- * @param plugin - 插件 或 扩展
964
- * @returns 是否注册了插件 或 扩展
965
- */
966
- static hasUsed(t) {
967
- return this.pluginManager.hasUsed(t);
968
- }
969
- /**
970
- * 需要在子类中调用
971
- *
972
- * 之所以没写在该类中的函数中,是因为 `this.pluginManager.onCreate(this,...args)` 通常会在构建函数执行的最后时才调用;
973
- * 如果像下面写在该类的构建函数中,然后子类通过 `super()` 来调用,这样就会导致 `this.pluginManager.onCreate(this,...args)` 不是在最后的执行;
974
- */
975
- // constructor(...args:any) {
976
- // super();
977
- // // @ts-ignore
978
- // this.pluginManager.onCreate(this,...args);
979
- // }
980
- /**
981
- * 实例的注册插件的方法
982
- * @param plugin
983
- * @param args
984
- * @returns
985
- */
986
- usePlugin(t, ...e) {
987
- return this.pluginManager.instUsePlugin(this, t, ...e);
988
- }
989
- /**
990
- * {@inheritDoc PluginExtendManager.useExtend}
991
- */
992
- useExtend(t, ...e) {
993
- return this.pluginManager.instUseExtend(this, t, ...e);
994
- }
995
- /**
996
- * 初始化实例
997
- * @remarks
998
- * 会调用 {@link PluginExtendManager.onInit}
999
- * @param args
1000
- */
1001
- init(...t) {
1002
- return this.pluginManager.onInit(this, ...t);
1003
- }
1004
- /**
1005
- * 销毁实例
1006
- * @returns
1007
- */
1008
- destroyThis() {
1009
- const t = this.pluginManager.onDestroy(this);
1010
- return t instanceof Promise ? t.finally(() => super.destroyThis()) : super.destroyThis();
1011
- }
1012
- }
1013
- class C extends V {
1014
- /**
1015
- * 是否使用独立的插件管理器
1016
- * @defaultValue false
1017
- */
1018
- static isolatedPluginManager = !1;
1019
- /**
1020
- * 插件管理器
1021
- */
1022
- static get pluginManager() {
1023
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
1024
- }
1025
- static _pluginManager = new d(this);
1026
- /**
1027
- * 插件管理器 {@link PluginHost.pluginManager}
1028
- */
1029
- get pluginManager() {
1030
- return this.constructor.pluginManager;
1031
- }
1032
- /**
1033
- * {@inheritDoc PluginExtendManager.usePlugin}
1034
- */
1035
- static usePlugin(t, ...e) {
1036
- return this.pluginManager.usePlugin(t, ...e);
1037
- }
1038
- /**
1039
- * {@inheritDoc PluginExtendManager.useExtend}
1040
- */
1041
- static useExtend(t) {
1042
- return this.pluginManager.useExtend(t);
1043
- }
1044
- /**
1045
- * 是否注册了插件 或 扩展
1046
- * @param plugin - 插件 或 扩展
1047
- * @returns 是否注册了插件 或 扩展
1048
- */
1049
- static hasUsed(t) {
1050
- return this.pluginManager.hasUsed(t);
1051
- }
1052
- /**
1053
- * 需要在子类中调用
1054
- *
1055
- * 之所以没写在该类中的函数中,是因为 `this.pluginManager.onCreate(this,...args)` 通常会在构建函数执行的最后时才调用;
1056
- * 如果像下面写在该类的构建函数中,然后子类通过 `super()` 来调用,这样就会导致 `this.pluginManager.onCreate(this,...args)` 不是在最后的执行;
1057
- */
1058
- // constructor(...args:any) {
1059
- // super();
1060
- // // @ts-ignore
1061
- // this.pluginManager.onCreate(this,...args);
1062
- // }
1063
- /**
1064
- * 实例的注册插件的方法
1065
- * @param plugin
1066
- * @param args
1067
- * @returns
1068
- */
1069
- usePlugin(t, ...e) {
1070
- return this.pluginManager.instUsePlugin(this, t, ...e);
1071
- }
1072
- /**
1073
- * {@inheritDoc PluginExtendManager.useExtend}
1074
- */
1075
- useExtend(t, ...e) {
1076
- return this.pluginManager.instUseExtend(this, t, ...e);
1077
- }
1078
- /**
1079
- * 初始化实例
1080
- * @remarks
1081
- * 会调用 {@link PluginExtendManager.onInit}
1082
- * @param args
1083
- */
1084
- init(...t) {
1085
- return this.pluginManager.onInit(this, ...t);
1086
- }
1087
- /**
1088
- * 销毁实例
1089
- * @returns
1090
- */
1091
- destroyThis() {
1092
- const t = this.pluginManager.onDestroy(this);
1093
- return t instanceof Promise ? t.finally(() => super.destroyThis()) : super.destroyThis();
1094
- }
1095
- }
1096
- function N(s) {
1097
- const t = j(s);
1098
- return class extends t {
1099
- /**
1100
- * 是否使用独立的插件管理器
1101
- * @defaultValue false
1102
- */
1103
- static isolatedPluginManager = !1;
1104
- /**
1105
- * 插件管理器
1106
- */
1107
- static get pluginManager() {
1108
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
1109
- }
1110
- static _pluginManager = new d(this);
1111
- /**
1112
- * 插件管理器 {@link PluginHostSub.pluginManager}
1113
- */
1114
- get pluginManager() {
1115
- return this.constructor.pluginManager;
1116
- }
1117
- /**
1118
- * {@inheritDoc PluginExtendManager.usePlugin}
1119
- */
1120
- static usePlugin(n, ...i) {
1121
- return this.pluginManager.usePlugin(n, ...i);
1122
- }
1123
- /**
1124
- * {@inheritDoc PluginExtendManager.useExtend}
1125
- */
1126
- static useExtend(n) {
1127
- return this.pluginManager.useExtend(n);
1128
- }
1129
- /**
1130
- * 是否注册了插件 或 扩展
1131
- * @param plugin - 插件 或 扩展
1132
- * @returns 是否注册了插件 或 扩展
1133
- */
1134
- static hasUsed(n) {
1135
- return this.pluginManager.hasUsed(n);
1136
- }
1137
- /**
1138
- * 需要在子类中调用
1139
- *
1140
- * 之所以没写在该类中的函数中,是因为 `this.pluginManager.onCreate(this)` 通常会在构建函数执行的最后时才调用;
1141
- * 如果像下面写在该类的构建函数中,然后子类通过 `super()` 来调用,这样就会导致 `this.pluginManager.onCreate(this)` 不是在最后的执行;
1142
- */
1143
- // constructor() {
1144
- // super();
1145
- // this.pluginManager.onCreate(this);
1146
- // }
1147
- /**
1148
- * 实例的注册插件的方法
1149
- * @param plugin
1150
- * @param args
1151
- * @returns
1152
- */
1153
- usePlugin(n, ...i) {
1154
- return this.pluginManager.instUsePlugin(this, n, ...i);
1155
- }
1156
- /**
1157
- * {@inheritDoc PluginExtendManager.useExtend}
1158
- */
1159
- useExtend(n, ...i) {
1160
- return this.pluginManager.instUseExtend(this, n, ...i);
1161
- }
1162
- /**
1163
- * 初始化实例
1164
- * @remarks
1165
- * 会调用 {@link PluginExtendManager.onInit}
1166
- * @param args
1167
- */
1168
- init(...n) {
1169
- return this.pluginManager.onInit(this, ...n);
1170
- }
1171
- /**
1172
- * 销毁实例
1173
- * @returns
1174
- */
1175
- destroyThis() {
1176
- const n = this.pluginManager.onDestroy(this);
1177
- return n instanceof Promise ? n.finally(() => super.destroyThis()) : super.destroyThis();
1178
- }
1179
- };
1180
- }
1181
- function $(s) {
1182
- const t = c(s, {
1183
- /**
1184
- * 是否使用独立的插件管理器
1185
- * @defaultValue false
1186
- */
1187
- isolatedPluginManager: !1,
1188
- /**
1189
- * PluginHost 的插件管理器
1190
- */
1191
- get pluginManager() {
1192
- return (!this._pluginManager || this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager")) && (this._pluginManager = new d(this)), this._pluginManager;
1193
- },
1194
- // _pluginManager: PluginManager<HOST,Plugin>;
1195
- /**
1196
- * {@inheritDoc PluginExtendManager.usePlugin}
1197
- */
1198
- usePlugin(e, ...n) {
1199
- return this.pluginManager.usePlugin(e, ...n);
1200
- },
1201
- /**
1202
- * {@inheritDoc PluginExtendManager.useExtend}
1203
- */
1204
- useExtend(e) {
1205
- return this.pluginManager.useExtend(e);
1206
- },
1207
- /**
1208
- * 是否注册了插件 或 扩展
1209
- * @param plugin - 插件 或 扩展
1210
- * @returns 是否注册了插件 或 扩展
1211
- */
1212
- hasUsed(e) {
1213
- return this.pluginManager.hasUsed(e);
1214
- }
1215
- });
1216
- return c(t.prototype, {
1217
- /**
1218
- * 插件管理器
1219
- */
1220
- get pluginManager() {
1221
- return this.constructor.pluginManager;
1222
- },
1223
- /**
1224
- * 实例的注册插件的方法
1225
- * @param plugin
1226
- * @param options
1227
- * @returns
1228
- */
1229
- usePlugin(e, ...n) {
1230
- return this.pluginManager.instUsePlugin(this, e, ...n);
1231
- },
1232
- /**
1233
- * {@inheritDoc PluginExtendManager.useExtend}
1234
- */
1235
- useExtend(e, ...n) {
1236
- return this.pluginManager.instUseExtend(this, e, ...n);
1237
- },
1238
- /**
1239
- * 初始化实例
1240
- * @param args
1241
- */
1242
- async init(...e) {
1243
- return super.init && await super.init(...e), this.pluginManager.onInit(this, ...e);
1244
- },
1245
- /**
1246
- * 销毁实例
1247
- * @returns
1248
- */
1249
- async destroy() {
1250
- if (await this.pluginManager.onDestroy(this), super.destroy) return super.destroy();
1251
- }
1252
- }), s;
1253
- }
1254
- function ft(s) {
1255
- const t = $(s);
1256
- return new Proxy(t, {
1257
- construct: function(e, n, i) {
1258
- const r = new e(...n);
1259
- return t.pluginManager.onCreate(this, ...n), r;
1260
- }
1261
- });
1262
- }
1263
- function mt(s) {
1264
- return class extends s {
1265
- /**
1266
- * 是否使用独立的插件管理器
1267
- * @defaultValue false
1268
- */
1269
- static isolatedPluginManager = !1;
1270
- /**
1271
- * 插件管理器
1272
- */
1273
- static get pluginManager() {
1274
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
1275
- }
1276
- static _pluginManager = new d(this);
1277
- /**
1278
- * 插件管理器 {@link PluginHostExtends.pluginManager}
1279
- */
1280
- get pluginManager() {
1281
- return this.constructor.pluginManager;
1282
- }
1283
- /**
1284
- * {@inheritDoc PluginExtendManager.usePlugin}
1285
- */
1286
- static usePlugin(e, ...n) {
1287
- return this.pluginManager.usePlugin(e, ...n);
1288
- }
1289
- /**
1290
- * {@inheritDoc PluginExtendManager.useExtend}
1291
- */
1292
- static useExtend(e) {
1293
- return this.pluginManager.useExtend(e);
1294
- }
1295
- /**
1296
- * 是否注册了插件 或 扩展
1297
- * @param plugin - 插件 或 扩展
1298
- * @returns 是否注册了插件 或 扩展
1299
- */
1300
- static hasUsed(e) {
1301
- return this.pluginManager.hasUsed(e);
1302
- }
1303
- constructor(...e) {
1304
- super(...e), this.pluginManager.onCreate(this, ...e);
1305
- }
1306
- /**
1307
- * 实例的注册插件的方法
1308
- * @param plugin
1309
- * @param args
1310
- * @returns
1311
- */
1312
- usePlugin(e, ...n) {
1313
- return this.pluginManager.instUsePlugin(this, e, ...n);
1314
- }
1315
- /**
1316
- * {@inheritDoc PluginExtendManager.useExtend}
1317
- */
1318
- useExtend(e, ...n) {
1319
- return this.pluginManager.instUseExtend(this, e, ...n);
1320
- }
1321
- /**
1322
- * 初始化实例
1323
- * @remarks
1324
- * 会调用 {@link PluginExtendManager.onInit}
1325
- * @param args
1326
- */
1327
- init(...e) {
1328
- if (super.init) {
1329
- const n = super.init(...e);
1330
- if (n instanceof Promise)
1331
- return n.then(() => this.pluginManager.onInit(this, ...e));
1332
- }
1333
- return this.pluginManager.onInit(this, ...e);
1334
- }
1335
- /**
1336
- * 销毁实例
1337
- * @returns
1338
- */
1339
- destroy() {
1340
- const e = this.pluginManager.onDestroy(this);
1341
- return super.destroy ? e instanceof Promise ? e.finally(() => super.destroy()) : super.destroy() : e;
1342
- }
1343
- };
1344
- }
1345
- class Mt extends D {
1346
- /**
1347
- * 全局级别的默认选项
1348
- */
1349
- static defaultOptions = new u();
1350
- /**
1351
- * 实例级的默认选项
1352
- */
1353
- get defaultOptions() {
1354
- return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
1355
- }
1356
- _defaultOptions;
1357
- constructor(t) {
1358
- super(), this.defaultOptions.option = t;
1359
- }
1360
- }
1361
- class yt extends F {
1362
- /**
1363
- * 全局级别的默认选项
1364
- */
1365
- static defaultOptions = new u();
1366
- /**
1367
- * 实例级的默认选项
1368
- */
1369
- get defaultOptions() {
1370
- return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
1371
- }
1372
- _defaultOptions;
1373
- constructor(t) {
1374
- super(), this.defaultOptions.option = t;
1375
- }
1376
- }
1377
- class Pt extends C {
1378
- /**
1379
- * 全局级别的默认选项
1380
- */
1381
- static defaultOptions = new u();
1382
- /**
1383
- * 实例级的默认选项
1384
- */
1385
- get defaultOptions() {
1386
- return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
1387
- }
1388
- _defaultOptions;
1389
- constructor(t) {
1390
- super(), this.defaultOptions.option = t;
1391
- }
1392
- }
1393
- function _t(s) {
1394
- const t = N(s);
1395
- return class extends t {
1396
- /**
1397
- * 全局级别的默认选项
1398
- */
1399
- static defaultOptions = new u();
1400
- /**
1401
- * 实例级的默认选项
1402
- */
1403
- get defaultOptions() {
1404
- return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
1405
- }
1406
- _defaultOptions;
1407
- constructor(n) {
1408
- super(), this.defaultOptions.option = n;
1409
- }
1410
- };
1411
- }
1412
- const h = "common";
1413
- class wt extends D {
1414
- /**
1415
- * 全局级别的默认选项
1416
- */
1417
- static modeOptions = new a(h);
1418
- /**
1419
- * 实例级的默认选项
1420
- */
1421
- get modeOptions() {
1422
- return this._modeOptions || (this._modeOptions = new a(h, void 0, this.constructor.modeOptions));
1423
- }
1424
- _modeOptions;
1425
- get mode() {
1426
- return this.modeOptions.mode;
1427
- }
1428
- set mode(t) {
1429
- this.modeOptions.mode = t;
1430
- }
1431
- get options() {
1432
- return this.modeOptions.plainFullOption;
1433
- }
1434
- constructor(t) {
1435
- super(), this.modeOptions.setOption(t);
1436
- }
1437
- }
1438
- class bt extends F {
1439
- /**
1440
- * 全局级别的默认选项
1441
- */
1442
- static modeOptions = new a(h);
1443
- /**
1444
- * 实例级的默认选项
1445
- */
1446
- get modeOptions() {
1447
- return this._modeOptions || (this._modeOptions = new a(h, void 0, this.constructor.modeOptions));
1448
- }
1449
- _modeOptions;
1450
- get mode() {
1451
- return this.modeOptions.mode;
1452
- }
1453
- set mode(t) {
1454
- this.modeOptions.mode = t;
1455
- }
1456
- get options() {
1457
- return this.modeOptions.plainFullOption;
1458
- }
1459
- constructor(t) {
1460
- super(), this.modeOptions.setOption(t);
1461
- }
1462
- }
1463
- class Tt extends C {
1464
- /**
1465
- * 全局级别的默认选项
1466
- */
1467
- static modeOptions = new a(h);
1468
- /**
1469
- * 实例级的默认选项
1470
- */
1471
- get modeOptions() {
1472
- return this._modeOptions || (this._modeOptions = new a(h, void 0, this.constructor.modeOptions));
1473
- }
1474
- _modeOptions;
1475
- get mode() {
1476
- return this.modeOptions.mode;
1477
- }
1478
- set mode(t) {
1479
- this.modeOptions.mode = t;
1480
- }
1481
- get options() {
1482
- return this.modeOptions.plainFullOption;
1483
- }
1484
- constructor(t) {
1485
- super(), this.modeOptions.setOption(t);
1486
- }
1487
- }
1488
- function Ut(s) {
1489
- const t = N(s);
1490
- return class extends t {
1491
- /**
1492
- * 全局级别的默认选项
1493
- */
1494
- static modeOptions = new a(h);
1495
- /**
1496
- * 实例级的默认选项
1497
- */
1498
- get modeOptions() {
1499
- return this._modeOptions || (this._modeOptions = new a(h, void 0, this.constructor.modeOptions));
1500
- }
1501
- _modeOptions;
1502
- get mode() {
1503
- return this.modeOptions.mode;
1504
- }
1505
- set mode(n) {
1506
- this.modeOptions.mode = n;
1507
- }
1508
- get options() {
1509
- return this.modeOptions.plainFullOption;
1510
- }
1511
- constructor(n) {
1512
- super(), this.modeOptions.setOption(n);
1513
- }
1514
- };
1515
- }
1516
- function vt(s, t, e) {
1517
- const n = c(s, {
1518
- /**
1519
- * 全局级别的默认选项
1520
- */
1521
- modeOptions: new a(t, e)
1522
- });
1523
- return c(n.prototype, {
1524
- /**
1525
- * 实例级的默认选项
1526
- */
1527
- get modeOptions() {
1528
- return this._modeOptions || (this._modeOptions = new a(t, void 0, this.constructor.modeOptions));
1529
- },
1530
- get mode() {
1531
- return this.modeOptions.mode;
1532
- },
1533
- set mode(i) {
1534
- this.modeOptions.mode = i;
1535
- },
1536
- get options() {
1537
- return this.modeOptions.fullOption;
1538
- }
1539
- }), s;
1540
- }
1541
- const Dt = {
1542
- onUse(s, t, e) {
1543
- const n = t ?? h;
1544
- p(s, {
1545
- modeOptions: new a(
1546
- n,
1547
- void 0,
1548
- e
1549
- )
1550
- }), p(s.prototype, {
1551
- get modeOptions() {
1552
- const i = this, r = s;
1553
- return i._modeOptions || (i._modeOptions = new a(
1554
- r.modeOptions.mode,
1555
- void 0,
1556
- r.modeOptions
1557
- ));
1558
- },
1559
- get mode() {
1560
- return this.modeOptions.mode;
1561
- },
1562
- set mode(i) {
1563
- const r = this;
1564
- r.modeOptions.mode = i;
1565
- },
1566
- get options() {
1567
- return this.modeOptions.plainFullOption;
1568
- }
1569
- });
1570
- },
1571
- onCreate(s, t) {
1572
- s.modeOptions.setOption(t);
1573
- }
1574
- }, Ft = {
1575
- onUse(s, t, e) {
1576
- p(s, {
1577
- /**
1578
- * 全局级别的默认选项
1579
- */
1580
- defaultOptions: new u(t, e)
1581
- }), p(s.prototype, {
1582
- /**
1583
- * 实例级的默认选项
1584
- */
1585
- get defaultOptions() {
1586
- return this._defaultOptions || (this._defaultOptions = new u(void 0, s.defaultOptions));
1587
- }
1588
- });
1589
- },
1590
- onCreate(s, t) {
1591
- s.defaultOptions.option = t;
1592
- }
1593
- };
1594
- function Ct(s, t) {
1595
- const e = c(s, {
1596
- /**
1597
- * 全局级别的默认选项
1598
- */
1599
- defaultOptions: new u(t)
1600
- });
1601
- return c(e.prototype, {
1602
- /**
1603
- * 实例级的默认选项
1604
- */
1605
- get defaultOptions() {
1606
- return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
1607
- }
1608
- }), s;
1609
- }
1610
- function _(s, t) {
1611
- const e = [{ target: s, props: t }];
1612
- let n;
1613
- for (; n = e.shift(); ) {
1614
- const { target: i, props: r } = n;
1615
- for (const [o, l] of Object.entries(r)) {
1616
- if (l != null && typeof l == "object" && (!l.constructor || l.constructor === Object)) {
1617
- e.push({ target: i[o], props: l });
1618
- continue;
1619
- }
1620
- i[o] = l;
1621
- }
1622
- }
1623
- return s;
1624
- }
1625
- function z(s, t) {
1626
- const e = {}, n = [{ target: s, props: t, targetProps: e }];
1627
- let i;
1628
- for (; i = n.shift(); ) {
1629
- const { target: r, props: o, targetProps: l } = i;
1630
- for (const [m, f] of Object.entries(o)) {
1631
- if (f != null && typeof f == "object" && (!f.constructor || f.constructor === Object)) {
1632
- n.push({ target: r[m], props: f, targetProps: l[m] = {} });
1633
- continue;
1634
- }
1635
- l[m] = r[m];
1636
- }
1637
- }
1638
- return e;
1639
- }
1640
- function Nt(s, t) {
1641
- const e = z(s, t);
1642
- function n() {
1643
- _(s, t);
1644
- }
1645
- function i() {
1646
- _(s, e);
1647
- }
1648
- return { set: n, unset: i };
1649
- }
1
+ import { E as s, M as a, P as i, a as n, b as r, T as o, c as g, d as P, e as p, f as d, g as x, h as l, i as u, j as T, k as m, l as c, m as M, n as O, o as E, p as H, q as y, r as f, s as b, t as v, u as D, v as B, w as V, x as h, y as k, z as I, A as N, B as S, C as _, D as j, F as q, G as w, H as z, I as A, J as C, K as F, L as G, N as J, O as K, Q as L, R as Q, S as R, U, V as W, W as X, X as Y, Y as Z } from "./decorator-Culqv4k6.js";
2
+ import { P as ee, T as te, a as se } from "./TierOptionsPluginHostEventEmitter-DXTNpSmS.js";
3
+ import { P as ie, T as ne, a as re } from "./TierOptionsPluginHostEventTarget-Bok_zzQ1.js";
1650
4
  export {
1651
- ut as ExtendManager,
1652
- B as ModeOptions,
1653
- d as PluginExtendManager,
1654
- D as PluginHost,
1655
- F as PluginHostEventEmitter,
1656
- C as PluginHostEventTarget,
1657
- ot as PluginManager,
1658
- a as TierModeOptions,
1659
- wt as TierModeOptionsPluginHost,
1660
- bt as TierModeOptionsPluginHostEventEmitter,
1661
- Tt as TierModeOptionsPluginHostEventTarget,
1662
- u as TierOptions,
1663
- Mt as TierOptionsPluginHost,
1664
- yt as TierOptionsPluginHostEventEmitter,
1665
- Pt as TierOptionsPluginHostEventTarget,
1666
- at as addDefaultOptions,
1667
- lt as addInstOptions,
1668
- $ as becomePluginHost,
1669
- mt as becomePluginHost_Extends,
1670
- ft as becomePluginHost_Proxy,
1671
- vt as becomeTierModeOptionsHost,
1672
- Ct as becomeTierOptionsHost,
1673
- h as commonModeName,
1674
- tt as createDefineExtend,
1675
- L as createDefineMixin,
1676
- it as createExtendTarget,
1677
- Y as createMixinTarget,
1678
- N as createPluginHost,
1679
- Nt as createPropertySetter,
1680
- nt as createTargetExtend,
1681
- X as createTargetMixin,
1682
- Ut as createTierModeOptionsPluginHost,
1683
- _t as createTierOptionsPluginHost,
1684
- Z as defineExtend,
1685
- J as defineMixin,
1686
- O as extendMark,
1687
- st as extendTarget,
1688
- x as getPropertyValue,
1689
- pt as getPropertyValueByPath,
1690
- z as getTargetProperties,
1691
- A as isPlugin,
1692
- _ as mergeProperties,
1693
- p as mixin,
1694
- W as mixinByOmit,
1695
- G as mixinByPick,
1696
- T as mixinIExtend,
1697
- c as mixinTarget,
1698
- E as parsePropertyPath,
1699
- rt as pickHostExtendMembers,
1700
- U as setPropertyValue,
1701
- dt as setPropertyValueByPath,
1702
- et as targetExtend,
1703
- Q as targetMixin,
1704
- ct as tierModeOptionsDecorator,
1705
- Dt as tierModeOptionsPlugin,
1706
- gt as tierOptionsDecorator,
1707
- Ft as tierOptionsPlugin
5
+ s as ExtendManager,
6
+ a as ModeOptions,
7
+ i as PluginExtendManager,
8
+ n as PluginHost,
9
+ ee as PluginHostEventEmitter,
10
+ ie as PluginHostEventTarget,
11
+ r as PluginManager,
12
+ o as TierModeOptions,
13
+ g as TierModeOptionsPluginHost,
14
+ te as TierModeOptionsPluginHostEventEmitter,
15
+ ne as TierModeOptionsPluginHostEventTarget,
16
+ P as TierOptions,
17
+ p as TierOptionsPluginHost,
18
+ se as TierOptionsPluginHostEventEmitter,
19
+ re as TierOptionsPluginHostEventTarget,
20
+ d as addDefaultOptions,
21
+ x as addInstOptions,
22
+ l as becomePluginHost,
23
+ u as becomePluginHost_Extends,
24
+ T as becomePluginHost_Proxy,
25
+ m as becomeTierModeOptionsHost,
26
+ c as becomeTierOptionsHost,
27
+ M as commonModeName,
28
+ O as createDefineExtend,
29
+ E as createDefineMixin,
30
+ H as createExtendTarget,
31
+ y as createMixinTarget,
32
+ f as createPluginHost,
33
+ b as createPropertySetter,
34
+ v as createTargetExtend,
35
+ D as createTargetMixin,
36
+ B as createTierModeOptionsPluginHost,
37
+ V as createTierOptionsPluginHost,
38
+ h as defineExtend,
39
+ k as defineMixin,
40
+ I as extendMark,
41
+ N as extendTarget,
42
+ S as getPropertyValue,
43
+ _ as getPropertyValueByPath,
44
+ j as getTargetProperties,
45
+ q as isPlugin,
46
+ w as mergeProperties,
47
+ z as mixin,
48
+ A as mixinByOmit,
49
+ C as mixinByPick,
50
+ F as mixinIExtend,
51
+ G as mixinTarget,
52
+ J as parsePropertyPath,
53
+ K as pickHostExtendMembers,
54
+ L as setPropertyValue,
55
+ Q as setPropertyValueByPath,
56
+ R as targetExtend,
57
+ U as targetMixin,
58
+ W as tierModeOptionsDecorator,
59
+ X as tierModeOptionsPlugin,
60
+ Y as tierOptionsDecorator,
61
+ Z as tierOptionsPlugin
1708
62
  };