plugin-tls 4.4.0 → 4.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 (33) hide show
  1. package/dist/{createTierModeOptionsPluginHost-CeND_z6P.js → createTierModeOptionsPluginHost-3jPWAW92.js} +184 -106
  2. package/dist/createTierModeOptionsPluginHost-GosxwlJk.cjs +1 -0
  3. package/dist/index-node.cjs +1 -1
  4. package/dist/index-node.js +8 -8
  5. package/dist/index-web.cjs +1 -1
  6. package/dist/index-web.js +6 -6
  7. package/dist/index.cjs +1 -1
  8. package/dist/index.js +186 -219
  9. package/dist/options/options-plugin-host/tier-mode-options/createTierModeOptionsPluginHost.d.ts +2 -2
  10. package/dist/options/options-plugin-host/tier-options/createTierOptionsPluginHost.d.ts +2 -2
  11. package/dist/plugin-host/PluginHost.d.ts +3 -3
  12. package/dist/plugin-host/PluginHost.d.ts.map +1 -1
  13. package/dist/plugin-host/PluginHostEventEmitter.d.ts +3 -3
  14. package/dist/plugin-host/PluginHostEventEmitter.d.ts.map +1 -1
  15. package/dist/plugin-host/PluginHostEventTarget.d.ts +3 -3
  16. package/dist/plugin-host/PluginHostEventTarget.d.ts.map +1 -1
  17. package/dist/plugin-host/createPluginHost.d.ts +3 -3
  18. package/dist/plugin-host/createPluginHost.d.ts.map +1 -1
  19. package/dist/plugin-host/decorator.d.ts +6 -6
  20. package/dist/plugin-host/decorator.d.ts.map +1 -1
  21. package/dist/plugin-host/type.d.ts +3 -3
  22. package/dist/plugin-host/type.d.ts.map +1 -1
  23. package/dist/plugin-manager/IExtend.d.ts +64 -0
  24. package/dist/plugin-manager/IExtend.d.ts.map +1 -1
  25. package/dist/plugin-manager/IPlugin.d.ts +1 -1
  26. package/dist/plugin-manager/PluginExtendManager.d.ts +3 -3
  27. package/dist/plugin-manager/PluginManager.d.ts +3 -3
  28. package/dist/plugin-manager/extend.d.ts +5 -5
  29. package/dist/plugin-manager/extend.d.ts.map +1 -1
  30. package/dist/plugin-manager/mixin.d.ts +6 -6
  31. package/dist/plugin-manager/mixin.d.ts.map +1 -1
  32. package/package.json +1 -1
  33. package/dist/createTierModeOptionsPluginHost-C3kmxB00.cjs +0 -1
@@ -1,24 +1,87 @@
1
- import { Destroyable as m, createDestroyableSubClass as U } from "@gby/destroyable";
2
- import { deepmergeInto as c, deepmerge as M } from "deepmerge-ts";
3
- import { serialCallFuns as h } from "com-tools";
4
- const x = ["onCreate", "onInit", "onDestroy"];
5
- function E(i) {
1
+ import { Destroyable as M, createDestroyableSubClass as U } from "@gby/destroyable";
2
+ import { deepmergeInto as h, deepmerge as x } from "deepmerge-ts";
3
+ import { omitMembers as T, removeUndefined as D, pickMembers as E, serialCallFuns as f } from "com-tools";
4
+ function u(i, ...t) {
5
+ for (const e of t) {
6
+ const n = Object.getOwnPropertyDescriptors(e);
7
+ Object.defineProperties(i, n);
8
+ }
9
+ return i;
10
+ }
11
+ function I(i, t, e) {
12
+ let n = Object.getOwnPropertyDescriptors(t);
13
+ return e && T(n, e), Object.defineProperties(i, n), i;
14
+ }
15
+ function j(i, t, e) {
16
+ let n = Object.getOwnPropertyDescriptors(t);
17
+ return e ? Object.defineProperties(i, D(E(n, e))) : Object.defineProperties(i, n), i;
18
+ }
19
+ function S(i, t) {
20
+ return t;
21
+ }
22
+ function A(i) {
23
+ return function(e) {
24
+ return e;
25
+ };
26
+ }
27
+ function B(i, t) {
28
+ return u(i, t), t;
29
+ }
30
+ function z(i) {
31
+ return function(e) {
32
+ return u(i, e), e;
33
+ };
34
+ }
35
+ function K(i, t) {
36
+ return u(i, t), i;
37
+ }
38
+ function $(i) {
39
+ return function(e) {
40
+ return u(i, e), i;
41
+ };
42
+ }
43
+ const y = ["onCreate", "onInit", "onDestroy"];
44
+ function q(i) {
6
45
  const t = { ...i };
7
- for (const e of x)
46
+ for (const e of y)
8
47
  typeof t[e] == "function" && delete t[e];
9
48
  return t;
10
49
  }
11
- function w(i, t) {
50
+ function v(i, t) {
12
51
  let e = Object.getOwnPropertyDescriptors(t);
13
- for (const n of x)
52
+ for (const n of y)
14
53
  typeof t[n] == "function" && delete e[n];
15
54
  return Object.defineProperties(i, e), i;
16
55
  }
56
+ function G(i, t) {
57
+ return t;
58
+ }
59
+ function L(i) {
60
+ return function(e) {
61
+ return e;
62
+ };
63
+ }
64
+ function R(i, t) {
65
+ return u(i.prototype, t), t;
66
+ }
67
+ function J(i) {
68
+ return function(e) {
69
+ return u(i.prototype, e), e;
70
+ };
71
+ }
72
+ function Q(i, t) {
73
+ return u(i.prototype, t), i;
74
+ }
75
+ function W(i) {
76
+ return function(e) {
77
+ return u(i.prototype, e), i;
78
+ };
79
+ }
17
80
  function N(i) {
18
81
  return i && typeof i.onUse == "function";
19
82
  }
20
- const a = /* @__PURE__ */ Symbol("extend");
21
- class d extends m {
83
+ const l = /* @__PURE__ */ Symbol("extend");
84
+ class p extends M {
22
85
  /**
23
86
  * 插件的宿主
24
87
  */
@@ -51,7 +114,7 @@ class d extends m {
51
114
  */
52
115
  isPlugin(t) {
53
116
  const { plugins: e } = this;
54
- return e.has(t) ? e.get(t) !== a : N(t);
117
+ return e.has(t) ? e.get(t) !== l : N(t);
55
118
  }
56
119
  /**
57
120
  * 使用插件、注册插件
@@ -60,7 +123,7 @@ class d extends m {
60
123
  */
61
124
  useExtend(t) {
62
125
  const { plugins: e } = this;
63
- return e.has(t) ? e.get(t) : (w(this.host.prototype, t), e.set(t, a), t);
126
+ return e.has(t) ? e.get(t) : (v(this.host.prototype, t), e.set(t, l), t);
64
127
  }
65
128
  /**
66
129
  * 插件宿主实例的注册插件的方法
@@ -94,8 +157,8 @@ class d extends m {
94
157
  instUsePlugin(t, e, ...n) {
95
158
  const { plugins: s } = this;
96
159
  if (s.has(e)) return s.get(e);
97
- const o = this.usePlugin(e, ...n);
98
- return e.onCreate?.(t), o;
160
+ const r = this.usePlugin(e, ...n);
161
+ return e.onCreate?.(t), r;
99
162
  }
100
163
  /**
101
164
  * 插件宿主创建实例时调用
@@ -107,12 +170,12 @@ class d extends m {
107
170
  */
108
171
  onCreate(t, ...e) {
109
172
  const n = [];
110
- for (const [s, o] of this.plugins)
173
+ for (const [s, r] of this.plugins)
111
174
  if (s.onCreate) {
112
- const r = o === a ? s.onCreate : s.onCreate.bind(s);
113
- n.push(r);
175
+ const o = r === l ? s.onCreate : s.onCreate.bind(s);
176
+ n.push(o);
114
177
  }
115
- return h(n, t, [t, ...e]);
178
+ return f(n, t, [t, ...e]);
116
179
  }
117
180
  /**
118
181
  * 插件宿主创建实例时调用
@@ -124,12 +187,12 @@ class d extends m {
124
187
  */
125
188
  onInit(t, ...e) {
126
189
  const n = [];
127
- for (const [s, o] of this.plugins)
190
+ for (const [s, r] of this.plugins)
128
191
  if (s.onInit) {
129
- const r = o === a ? s.onInit : s.onInit.bind(s);
130
- n.push(r);
192
+ const o = r === l ? s.onInit : s.onInit.bind(s);
193
+ n.push(o);
131
194
  }
132
- return h(n, t, [t, ...e]);
195
+ return f(n, t, [t, ...e]);
133
196
  }
134
197
  /**
135
198
  * 插件宿主被销毁时调用
@@ -142,39 +205,39 @@ class d extends m {
142
205
  const e = [];
143
206
  for (const [n, s] of this.plugins)
144
207
  if (n.onDestroy) {
145
- const o = s === a ? n.onDestroy : n.onDestroy.bind(n);
146
- e.push(o);
208
+ const r = s === l ? n.onDestroy : n.onDestroy.bind(n);
209
+ e.push(r);
147
210
  }
148
- return e.reverse(), h(e, t, [t]);
211
+ return e.reverse(), f(e, t, [t]);
149
212
  }
150
213
  }
151
- function y(i) {
214
+ function P(i) {
152
215
  const t = i.split(".");
153
216
  return t[0] === "" && t.shift(), t;
154
217
  }
155
- function f(i, t) {
218
+ function O(i, t) {
156
219
  for (const e of t)
157
220
  if (i = i[e], i == null) return;
158
221
  return i;
159
222
  }
160
- function k(i, t) {
161
- return f(i, y(t));
223
+ function X(i, t) {
224
+ return O(i, P(t));
162
225
  }
163
- function P(i, t, e) {
226
+ function _(i, t, e) {
164
227
  const n = t.pop(), s = t.length;
165
- let o = 0;
166
- for (; o < s; ) {
167
- const r = i[t[o]];
168
- if (r == null) break;
169
- i = r, o++;
170
- }
171
- t = t.slice(o);
172
- for (const r of t)
173
- i = i[r] = {};
228
+ let r = 0;
229
+ for (; r < s; ) {
230
+ const o = i[t[r]];
231
+ if (o == null) break;
232
+ i = o, r++;
233
+ }
234
+ t = t.slice(r);
235
+ for (const o of t)
236
+ i = i[o] = {};
174
237
  return i[n] = e, i;
175
238
  }
176
- function H(i, t, e) {
177
- return P(i, y(t), e);
239
+ function Y(i, t, e) {
240
+ return _(i, P(t), e);
178
241
  }
179
242
  const g = {
180
243
  UndefinedAndNull: function(t) {
@@ -187,7 +250,7 @@ const g = {
187
250
  return t === null;
188
251
  }
189
252
  };
190
- class _ {
253
+ class b {
191
254
  /**
192
255
  * 是否要冻结 fullOption 的成员
193
256
  * @remarks
@@ -239,7 +302,7 @@ class _ {
239
302
  * @param deep - 是否要进行深度合并
240
303
  */
241
304
  setOption(t, e) {
242
- const n = e ? c(this.option, t) : Object.assign(this.option, t);
305
+ const n = e ? h(this.option, t) : Object.assign(this.option, t);
243
306
  return this.updateFullOption(), n;
244
307
  }
245
308
  /**
@@ -275,8 +338,8 @@ class _ {
275
338
  if (e === void 0)
276
339
  delete s[t];
277
340
  else {
278
- const o = s[t];
279
- n && o && typeof o == "object" ? c(o, e) : s[t] = e;
341
+ const r = s[t];
342
+ n && r && typeof r == "object" ? h(r, e) : s[t] = e;
280
343
  }
281
344
  this.updateFullOption();
282
345
  }
@@ -286,7 +349,7 @@ class _ {
286
349
  * @returns
287
350
  */
288
351
  getValue(t) {
289
- return f(this.option, t);
352
+ return O(this.option, t);
290
353
  }
291
354
  /**
292
355
  * 设置属性路径对应的值
@@ -297,11 +360,11 @@ class _ {
297
360
  */
298
361
  setValue(t, e, n) {
299
362
  const s = this.option;
300
- let o;
301
- n && (o = f(s, t)) && typeof o == "object" ? c(o, e) : P(this.option, t, e), this.updateFullOption();
363
+ let r;
364
+ n && (r = O(s, t)) && typeof r == "object" ? h(r, e) : _(this.option, t, e), this.updateFullOption();
302
365
  }
303
366
  }
304
- class u extends _ {
367
+ class a extends b {
305
368
  constructor(t, e) {
306
369
  super(), t && (this.option = t), e && (this.extends = e);
307
370
  }
@@ -330,7 +393,7 @@ class u extends _ {
330
393
  const { extends: e, option: n } = this;
331
394
  if (t = n, e) {
332
395
  const s = e.plainFullOption;
333
- t = M(s, n);
396
+ t = x(s, n);
334
397
  }
335
398
  return this._plainFullOption = t;
336
399
  }
@@ -366,15 +429,15 @@ class u extends _ {
366
429
  return n.getValue(t);
367
430
  }
368
431
  }
369
- function C(i, t) {
432
+ function Z(i, t) {
370
433
  const { name: e } = t, n = `_${e}`;
371
434
  return {
372
435
  get: function() {
373
- return this[n] || (this[n] = new u(void 0, this.constructor[e]));
436
+ return this[n] || (this[n] = new a(void 0, this.constructor[e]));
374
437
  }
375
438
  };
376
439
  }
377
- class T extends _ {
440
+ class V extends b {
378
441
  constructor(t, e) {
379
442
  super(), e && this.setModeOption(t, e), this.mode = t;
380
443
  }
@@ -464,15 +527,15 @@ class T extends _ {
464
527
  * @param extend - 继承哪个模式
465
528
  */
466
529
  setModeOption(t, e, n, s) {
467
- const { modes: o } = this, r = o[t] || (o[t] = new u());
468
- if (r.setOption(e, n), s) {
469
- const O = o[s];
470
- O && (r.extends = O);
530
+ const { modes: r } = this, o = r[t] || (r[t] = new a());
531
+ if (o.setOption(e, n), s) {
532
+ const m = r[s];
533
+ m && (o.extends = m);
471
534
  }
472
- return this.updateFullOption(), r;
535
+ return this.updateFullOption(), o;
473
536
  }
474
537
  }
475
- class l extends T {
538
+ class d extends V {
476
539
  constructor(t, e, n) {
477
540
  super(t, e), n && (this.extends = n);
478
541
  }
@@ -496,8 +559,8 @@ class l extends T {
496
559
  getFullModeOption(t) {
497
560
  const { modes: e, extends: n } = this, s = e[t]?.plainFullOption;
498
561
  if (n) {
499
- const o = n.getFullModeOption(t);
500
- return s ? M(o, s) : o;
562
+ const r = n.getFullModeOption(t);
563
+ return s ? x(r, s) : r;
501
564
  }
502
565
  return s;
503
566
  }
@@ -561,15 +624,15 @@ class l extends T {
561
624
  return n.getValue(t);
562
625
  }
563
626
  }
564
- function S(i, t) {
627
+ function tt(i, t) {
565
628
  const { name: e } = t, n = `_${e}`;
566
629
  return {
567
630
  get: function() {
568
- return this[n] || (this[n] = new l(this.constructor[e].mode, void 0, this.constructor[e]));
631
+ return this[n] || (this[n] = new d(this.constructor[e].mode, void 0, this.constructor[e]));
569
632
  }
570
633
  };
571
634
  }
572
- class F extends m {
635
+ class F extends M {
573
636
  /**
574
637
  * 是否使用独立的插件管理器
575
638
  * @defaultValue false
@@ -579,9 +642,9 @@ class F extends m {
579
642
  * 插件管理器
580
643
  */
581
644
  static get pluginManager() {
582
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
645
+ return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new p(this)), this._pluginManager;
583
646
  }
584
- static _pluginManager = new d(this);
647
+ static _pluginManager = new p(this);
585
648
  /**
586
649
  * 插件管理器 {@link PluginHost.pluginManager}
587
650
  */
@@ -652,23 +715,23 @@ class F extends m {
652
715
  return t instanceof Promise ? t.finally(() => super.destroyThis()) : super.destroyThis();
653
716
  }
654
717
  }
655
- class I extends F {
718
+ class et extends F {
656
719
  /**
657
720
  * 全局级别的默认选项
658
721
  */
659
- static defaultOptions = new u();
722
+ static defaultOptions = new a();
660
723
  /**
661
724
  * 实例级的默认选项
662
725
  */
663
726
  get defaultOptions() {
664
- return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
727
+ return this._defaultOptions || (this._defaultOptions = new a(void 0, this.constructor.defaultOptions));
665
728
  }
666
729
  _defaultOptions;
667
730
  constructor(t) {
668
731
  super(), this.defaultOptions.option = t;
669
732
  }
670
733
  }
671
- function b(i) {
734
+ function w(i) {
672
735
  const t = U(i);
673
736
  return class extends t {
674
737
  /**
@@ -680,9 +743,9 @@ function b(i) {
680
743
  * 插件管理器
681
744
  */
682
745
  static get pluginManager() {
683
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
746
+ return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new p(this)), this._pluginManager;
684
747
  }
685
- static _pluginManager = new d(this);
748
+ static _pluginManager = new p(this);
686
749
  /**
687
750
  * 插件管理器 {@link PluginHostSub.pluginManager}
688
751
  */
@@ -753,18 +816,18 @@ function b(i) {
753
816
  }
754
817
  };
755
818
  }
756
- function z(i) {
757
- const t = b(i);
819
+ function st(i) {
820
+ const t = w(i);
758
821
  return class extends t {
759
822
  /**
760
823
  * 全局级别的默认选项
761
824
  */
762
- static defaultOptions = new u();
825
+ static defaultOptions = new a();
763
826
  /**
764
827
  * 实例级的默认选项
765
828
  */
766
829
  get defaultOptions() {
767
- return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
830
+ return this._defaultOptions || (this._defaultOptions = new a(void 0, this.constructor.defaultOptions));
768
831
  }
769
832
  _defaultOptions;
770
833
  constructor(n) {
@@ -772,17 +835,17 @@ function z(i) {
772
835
  }
773
836
  };
774
837
  }
775
- const p = "common";
776
- class K extends F {
838
+ const c = "common";
839
+ class rt extends F {
777
840
  /**
778
841
  * 全局级别的默认选项
779
842
  */
780
- static modeOptions = new l(p);
843
+ static modeOptions = new d(c);
781
844
  /**
782
845
  * 实例级的默认选项
783
846
  */
784
847
  get modeOptions() {
785
- return this._modeOptions || (this._modeOptions = new l(p, void 0, this.constructor.modeOptions));
848
+ return this._modeOptions || (this._modeOptions = new d(c, void 0, this.constructor.modeOptions));
786
849
  }
787
850
  _modeOptions;
788
851
  get mode() {
@@ -798,18 +861,18 @@ class K extends F {
798
861
  super(), this.modeOptions.setOption(t);
799
862
  }
800
863
  }
801
- function $(i) {
802
- const t = b(i);
864
+ function ut(i) {
865
+ const t = w(i);
803
866
  return class extends t {
804
867
  /**
805
868
  * 全局级别的默认选项
806
869
  */
807
- static modeOptions = new l(p);
870
+ static modeOptions = new d(c);
808
871
  /**
809
872
  * 实例级的默认选项
810
873
  */
811
874
  get modeOptions() {
812
- return this._modeOptions || (this._modeOptions = new l(p, void 0, this.constructor.modeOptions));
875
+ return this._modeOptions || (this._modeOptions = new d(c, void 0, this.constructor.modeOptions));
813
876
  }
814
877
  _modeOptions;
815
878
  get mode() {
@@ -827,26 +890,41 @@ function $(i) {
827
890
  };
828
891
  }
829
892
  export {
830
- T as M,
831
- d as P,
832
- l as T,
833
- u as a,
834
- F as b,
835
- p as c,
836
- K as d,
837
- I as e,
838
- b as f,
839
- $ as g,
840
- z as h,
841
- a as i,
842
- f as j,
843
- k,
844
- N as l,
845
- w as m,
846
- E as n,
847
- H as o,
848
- y as p,
849
- C as q,
850
- P as s,
851
- S as t
893
+ P as A,
894
+ q as B,
895
+ _ as C,
896
+ Y as D,
897
+ R as E,
898
+ B as F,
899
+ tt as G,
900
+ Z as H,
901
+ V as M,
902
+ p as P,
903
+ d as T,
904
+ v as a,
905
+ K as b,
906
+ c,
907
+ a as d,
908
+ F as e,
909
+ rt as f,
910
+ et as g,
911
+ L as h,
912
+ A as i,
913
+ W as j,
914
+ $ as k,
915
+ w as l,
916
+ u as m,
917
+ J as n,
918
+ z as o,
919
+ ut as p,
920
+ st as q,
921
+ G as r,
922
+ S as s,
923
+ l as t,
924
+ O as u,
925
+ X as v,
926
+ Q as w,
927
+ N as x,
928
+ I as y,
929
+ j as z
852
930
  };
@@ -0,0 +1 @@
1
+ "use strict";const m=require("@gby/destroyable"),c=require("deepmerge-ts"),d=require("com-tools");function u(i,...e){for(const t of e){const n=Object.getOwnPropertyDescriptors(t);Object.defineProperties(i,n)}return i}function E(i,e,t){let n=Object.getOwnPropertyDescriptors(e);return t&&d.omitMembers(n,t),Object.defineProperties(i,n),i}function U(i,e,t){let n=Object.getOwnPropertyDescriptors(e);return t?Object.defineProperties(i,d.removeUndefined(d.pickMembers(n,t))):Object.defineProperties(i,n),i}function V(i,e){return e}function N(i){return function(t){return t}}function I(i,e){return u(i,e),e}function v(i){return function(t){return u(i,t),t}}function H(i,e){return u(i,e),i}function k(i){return function(t){return u(i,t),i}}const b=["onCreate","onInit","onDestroy"];function C(i){const e={...i};for(const t of b)typeof e[t]=="function"&&delete e[t];return e}function T(i,e){let t=Object.getOwnPropertyDescriptors(e);for(const n of b)typeof e[n]=="function"&&delete t[n];return Object.defineProperties(i,t),i}function j(i,e){return e}function S(i){return function(t){return t}}function B(i,e){return u(i.prototype,e),e}function A(i){return function(t){return u(i.prototype,t),t}}function q(i,e){return u(i.prototype,e),i}function z(i){return function(t){return u(i.prototype,t),i}}function F(i){return i&&typeof i.onUse=="function"}const l=Symbol("extend");class g extends m.Destroyable{host;plugins=new Map;constructor(e){super(),e&&(this.host=e)}destroyThis(){return this.plugins.clear(),this.host=null,super.destroyThis()}hasUsed(e){return this.plugins.has(e)}isPlugin(e){const{plugins:t}=this;return t.has(e)?t.get(e)!==l:F(e)}useExtend(e){const{plugins:t}=this;return t.has(e)?t.get(e):(T(this.host.prototype,e),t.set(e,l),e)}instUseExtend(e,t,...n){const{plugins:s}=this;return s.has(t)?s.get(t):(this.useExtend(t),t.onCreate?.call(e,e,...n),t)}usePlugin(e,...t){const{plugins:n}=this;if(n.has(e))return n.get(e);const s=e.onUse(this.host,...t);return n.set(e,s),s}instUsePlugin(e,t,...n){const{plugins:s}=this;if(s.has(t))return s.get(t);const r=this.usePlugin(t,...n);return t.onCreate?.(e),r}onCreate(e,...t){const n=[];for(const[s,r]of this.plugins)if(s.onCreate){const o=r===l?s.onCreate:s.onCreate.bind(s);n.push(o)}return d.serialCallFuns(n,e,[e,...t])}onInit(e,...t){const n=[];for(const[s,r]of this.plugins)if(s.onInit){const o=r===l?s.onInit:s.onInit.bind(s);n.push(o)}return d.serialCallFuns(n,e,[e,...t])}onDestroy(e){const t=[];for(const[n,s]of this.plugins)if(n.onDestroy){const r=s===l?n.onDestroy:n.onDestroy.bind(n);t.push(r)}return t.reverse(),d.serialCallFuns(t,e,[e])}}function M(i){const e=i.split(".");return e[0]===""&&e.shift(),e}function f(i,e){for(const t of e)if(i=i[t],i==null)return;return i}function K(i,e){return f(i,M(e))}function x(i,e,t){const n=e.pop(),s=e.length;let r=0;for(;r<s;){const o=i[e[r]];if(o==null)break;i=o,r++}e=e.slice(r);for(const o of e)i=i[o]={};return i[n]=t,i}function $(i,e,t){return x(i,M(e),t)}const O={UndefinedAndNull:function(e){return e==null},Undefined:function(e){return e===void 0},Null:function(e){return e===null}};class w{freezeMember=!0;fullOption=new Proxy(this,{get:function(e,t,n){const s=e.plainFullOption[t];return e.freezeMember?Object.freeze(s):s},set:function(e,t,n,s){return e.setMember(t,n,!1),!0},has:function(e,t){return t in e.plainFullOption},getOwnPropertyDescriptor:function(e,t){return Object.getOwnPropertyDescriptor(e.plainFullOption,t)},ownKeys:function(e){return Reflect.ownKeys(e.plainFullOption)},deleteProperty:function(e,t){return e.setMember(t,void 0),!0},defineProperty:function(e,t,n){return Object.defineProperty(e.option,t,n),!0}});setOption(e,t){const n=t?c.deepmergeInto(this.option,e):Object.assign(this.option,e);return this.updateFullOption(),n}get undefinedValue(){return this._undefinedValue}set undefinedValue(e){this._undefinedValue=e,this.isUndefined=O[e]||O.UndefinedAndNull}_undefinedValue="UndefinedAndNull";isUndefined=O.UndefinedAndNull;getMember(e){return this.option[e]}setMember(e,t,n){const s=this.option;if(t===void 0)delete s[e];else{const r=s[e];n&&r&&typeof r=="object"?c.deepmergeInto(r,t):s[e]=t}this.updateFullOption()}getValue(e){return f(this.option,e)}setValue(e,t,n){const s=this.option;let r;n&&(r=f(s,e))&&typeof r=="object"?c.deepmergeInto(r,t):x(this.option,e,t),this.updateFullOption()}}class a extends w{constructor(e,t){super(),e&&(this.option=e),t&&(this.extends=t)}get extends(){return this._extends}set extends(e){this._extends=e,this.updateFullOption()}_extends=null;option={};get plainFullOption(){let e=this._plainFullOption;if(e)return e;const{extends:t,option:n}=this;if(e=n,t){const s=t.plainFullOption;e=c.deepmerge(s,n)}return this._plainFullOption=e}_plainFullOption=null;updateFullOption(){this._plainFullOption=null}getMember(e){const t=this.option[e];if(!this.isUndefined(t))return t;const n=this.extends;if(n)return n.getMember(e)}getValue(e){const t=super.getValue(e);if(!this.isUndefined(t))return t;const n=this.extends;if(n)return n.getValue(e)}}function L(i,e){const{name:t}=e,n=`_${t}`;return{get:function(){return this[n]||(this[n]=new a(void 0,this.constructor[t]))}}}class D extends w{constructor(e,t){super(),t&&this.setModeOption(e,t),this.mode=e}modes={};get mode(){return this._mode||(this.mode=this.modeNames[0])}set mode(e){this._mode=e,this.hasMode(e)||this.setModeOption(e,{}),this.updateFullOption()}_mode;get modeNames(){return this._modeNames||(this._modeNames=this.getModeNames())}_modeNames=null;getModeNames(){return Object.keys(this.modes)}hasMode(e){return!!this.modes[e]}get optionManager(){return this.modes[this.mode]}get option(){return this.optionManager.option}get plainFullOption(){return this._plainFullOption??(this._plainFullOption=this.getFullModeOption(this.mode))}_plainFullOption=null;updateFullOption(){this._plainFullOption=null,this._modeNames=null}getModeOption(e){return this.modes[e].option}getFullModeOption(e){return this.modes[e]?.plainFullOption}setModeOption(e,t,n,s){const{modes:r}=this,o=r[e]||(r[e]=new a);if(o.setOption(t,n),s){const _=r[s];_&&(o.extends=_)}return this.updateFullOption(),o}}class p extends D{constructor(e,t,n){super(e,t),n&&(this.extends=n)}get extends(){return this._extends}set extends(e){this._extends=e,this.updateFullOption()}_extends=null;getFullModeOption(e){const{modes:t,extends:n}=this,s=t[e]?.plainFullOption;if(n){const r=n.getFullModeOption(e);return s?c.deepmerge(r,s):r}return s}getModeNames(){const{modes:e,extends:t}=this,n=Object.keys(e);if(!t)return n;const s=t.getModeNames();return[...new Set([...n,...s])]}hasModeOnTier(e){if(this.hasMode(e))return!0;const t=this.extends;return t?t.hasModeOnTier(e):!1}get optionManager(){return this.getModeOptionManager(this.mode)}getModeOptionManager(e){const t=this.modes[e];return t||(this.extends?.getModeOptionManager(e)?this.setModeOption(e,{}):null)}getMember(e){const t=this.optionManager.getMember(e);if(!this.isUndefined(t))return t;const n=this.extends;if(n)return n.getMember(e)}getValue(e){const t=this.optionManager.getValue(e);if(!this.isUndefined(t))return t;const n=this.extends;if(n)return n.getValue(e)}}function R(i,e){const{name:t}=e,n=`_${t}`;return{get:function(){return this[n]||(this[n]=new p(this.constructor[t].mode,void 0,this.constructor[t]))}}}class y extends m.Destroyable{static isolatedPluginManager=!1;static get pluginManager(){return this.isolatedPluginManager&&!this.hasOwnProperty("_pluginManager")&&(this._pluginManager=new g(this)),this._pluginManager}static _pluginManager=new g(this);get pluginManager(){return this.constructor.pluginManager}static usePlugin(e,...t){return this.pluginManager.usePlugin(e,...t)}static useExtend(e){return this.pluginManager.useExtend(e)}static hasUsed(e){return this.pluginManager.hasUsed(e)}usePlugin(e,...t){return this.pluginManager.instUsePlugin(this,e,...t)}useExtend(e,...t){return this.pluginManager.instUseExtend(this,e,...t)}init(...e){return this.pluginManager.onInit(this,...e)}destroyThis(){const e=this.pluginManager.onDestroy(this);return e instanceof Promise?e.finally(()=>super.destroyThis()):super.destroyThis()}}class G extends y{static defaultOptions=new a;get defaultOptions(){return this._defaultOptions||(this._defaultOptions=new a(void 0,this.constructor.defaultOptions))}_defaultOptions;constructor(e){super(),this.defaultOptions.option=e}}function P(i){const e=m.createDestroyableSubClass(i);return class extends e{static isolatedPluginManager=!1;static get pluginManager(){return this.isolatedPluginManager&&!this.hasOwnProperty("_pluginManager")&&(this._pluginManager=new g(this)),this._pluginManager}static _pluginManager=new g(this);get pluginManager(){return this.constructor.pluginManager}static usePlugin(n,...s){return this.pluginManager.usePlugin(n,...s)}static useExtend(n){return this.pluginManager.useExtend(n)}static hasUsed(n){return this.pluginManager.hasUsed(n)}usePlugin(n,...s){return this.pluginManager.instUsePlugin(this,n,...s)}useExtend(n,...s){return this.pluginManager.instUseExtend(this,n,...s)}init(...n){return this.pluginManager.onInit(this,...n)}destroyThis(){const n=this.pluginManager.onDestroy(this);return n instanceof Promise?n.finally(()=>super.destroyThis()):super.destroyThis()}}}function J(i){const e=P(i);return class extends e{static defaultOptions=new a;get defaultOptions(){return this._defaultOptions||(this._defaultOptions=new a(void 0,this.constructor.defaultOptions))}_defaultOptions;constructor(n){super(),this.defaultOptions.option=n}}}const h="common";class Q extends y{static modeOptions=new p(h);get modeOptions(){return this._modeOptions||(this._modeOptions=new p(h,void 0,this.constructor.modeOptions))}_modeOptions;get mode(){return this.modeOptions.mode}set mode(e){this.modeOptions.mode=e}get options(){return this.modeOptions.plainFullOption}constructor(e){super(),this.modeOptions.setOption(e)}}function W(i){const e=P(i);return class extends e{static modeOptions=new p(h);get modeOptions(){return this._modeOptions||(this._modeOptions=new p(h,void 0,this.constructor.modeOptions))}_modeOptions;get mode(){return this.modeOptions.mode}set mode(n){this.modeOptions.mode=n}get options(){return this.modeOptions.plainFullOption}constructor(n){super(),this.modeOptions.setOption(n)}}}exports.ModeOptions=D;exports.PluginExtendManager=g;exports.PluginHost=y;exports.TierModeOptions=p;exports.TierModeOptionsPluginHost=Q;exports.TierOptions=a;exports.TierOptionsPluginHost=G;exports.commonModeName=h;exports.createDefineIExtend=S;exports.createDefineMixin=N;exports.createIExtendTarget=z;exports.createMixinTarget=k;exports.createPluginHost=P;exports.createTargetIExtend=A;exports.createTargetMixin=v;exports.createTierModeOptionsPluginHost=W;exports.createTierOptionsPluginHost=J;exports.defineIExtend=j;exports.defineMixin=V;exports.extendMark=l;exports.getPropertyValue=f;exports.getPropertyValueByPath=K;exports.iextendTarget=q;exports.isPlugin=F;exports.mixin=u;exports.mixinByOmit=E;exports.mixinByPick=U;exports.mixinIExtend=T;exports.mixinTarget=H;exports.parsePropertyPath=M;exports.pickHostExtendMembers=C;exports.setPropertyValue=x;exports.setPropertyValueByPath=$;exports.targetIExtend=B;exports.targetMixin=I;exports.tierModeOptionsDecorator=R;exports.tierOptionsDecorator=L;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./Destroyable-BqvuD4gL-Cmk1ocqj.cjs"),a=require("node:events"),d=require("com-tools"),s=require("./createTierModeOptionsPluginHost-C3kmxB00.cjs");class l extends a.EventEmitter{refCount=0;get isDestroyed(){return this._isDestroyed}_isDestroyed=!1;get canDestroy(){return!this.isDestroyed&&this.refCount<=0}_destroyers=[];disposeFun(t){return this._destroyers.push(t),t}cancelDisposeFun(t){const e=this._destroyers.indexOf(t);return this._destroyers.splice(e,1),t}disposeObj(t,e){const i=e?function(){return t.destroySync()}:function(){return t.destroy()};return this.disposeFun(i),t.__destroyable_destroyer=i,t}cancelDisposeObj(t){const e=t.__destroyable_destroyer;return e&&this.cancelDisposeFun(e),t}dispose(t,e){return typeof t=="function"?this.disposeFun(t):this.disposeObj(t,e)}cancelDispose(t){return typeof t=="function"?this.cancelDisposeFun(t):this.cancelDisposeObj(t)}destroyThis(){}destroySync(){if(!this.canDestroy)return this.isDestroyed;let t=this._destroyers.length;for(;--t>=0;){const e=this._destroyers[t];try{e()}catch(i){console.error("销毁函数在同步销毁时出错",this,e,i)}}this._destroyers.length=0;try{this.destroyThis()}catch(e){console.error("destroyThis 在异步销毁时出错",this,e)}return r.i(this),!0}destroy(){if(!this.canDestroy)return this.isDestroyed;const t=this._destroyers.toReversed();t.push(this.destroyThis),this._destroyers.length=0;const e=d.serialCallAllFuns(t,this,null,(i,u)=>{console.error("销毁函数在串行销毁时出错",this,u,i)});return e instanceof Promise?e.then(()=>(r.i(this),!0)):(r.i(this),!0)}}class o extends l{static isolatedPluginManager=!1;static get pluginManager(){return this.isolatedPluginManager&&!this.hasOwnProperty("_pluginManager")&&(this._pluginManager=new s.PluginExtendManager(this)),this._pluginManager}static _pluginManager=new s.PluginExtendManager(this);get pluginManager(){return this.constructor.pluginManager}static usePlugin(t,...e){return this.pluginManager.usePlugin(t,...e)}static useExtend(t){return this.pluginManager.useExtend(t)}static hasUsed(t){return this.pluginManager.hasUsed(t)}usePlugin(t,...e){return this.pluginManager.instUsePlugin(this,t,...e)}useExtend(t,...e){return this.pluginManager.instUseExtend(this,t,...e)}init(...t){return this.pluginManager.onInit(this,...t)}destroyThis(){const t=this.pluginManager.onDestroy(this);return t instanceof Promise?t.finally(()=>super.destroyThis()):super.destroyThis()}}class h extends o{static modeOptions=new s.TierModeOptions(s.commonModeName);get modeOptions(){return this._modeOptions||(this._modeOptions=new s.TierModeOptions(s.commonModeName,void 0,this.constructor.modeOptions))}_modeOptions;get mode(){return this.modeOptions.mode}set mode(t){this.modeOptions.mode=t}get options(){return this.modeOptions.plainFullOption}constructor(t){super(),this.modeOptions.setOption(t)}}class c extends o{static defaultOptions=new s.TierOptions;get defaultOptions(){return this._defaultOptions||(this._defaultOptions=new s.TierOptions(void 0,this.constructor.defaultOptions))}_defaultOptions;constructor(t){super(),this.defaultOptions.option=t}}exports.TierModeOptionsPluginHost=s.TierModeOptionsPluginHost;exports.TierOptionsPluginHost=s.TierOptionsPluginHost;exports.commonModeName=s.commonModeName;exports.createTierModeOptionsPluginHost=s.createTierModeOptionsPluginHost;exports.createTierOptionsPluginHost=s.createTierOptionsPluginHost;exports.PluginHostEventEmitter=o;exports.TierModeOptionsPluginHostEventEmitter=h;exports.TierOptionsPluginHostEventEmitter=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./Destroyable-BqvuD4gL-Cmk1ocqj.cjs"),a=require("node:events"),d=require("com-tools"),s=require("./createTierModeOptionsPluginHost-GosxwlJk.cjs");class l extends a.EventEmitter{refCount=0;get isDestroyed(){return this._isDestroyed}_isDestroyed=!1;get canDestroy(){return!this.isDestroyed&&this.refCount<=0}_destroyers=[];disposeFun(t){return this._destroyers.push(t),t}cancelDisposeFun(t){const e=this._destroyers.indexOf(t);return this._destroyers.splice(e,1),t}disposeObj(t,e){const i=e?function(){return t.destroySync()}:function(){return t.destroy()};return this.disposeFun(i),t.__destroyable_destroyer=i,t}cancelDisposeObj(t){const e=t.__destroyable_destroyer;return e&&this.cancelDisposeFun(e),t}dispose(t,e){return typeof t=="function"?this.disposeFun(t):this.disposeObj(t,e)}cancelDispose(t){return typeof t=="function"?this.cancelDisposeFun(t):this.cancelDisposeObj(t)}destroyThis(){}destroySync(){if(!this.canDestroy)return this.isDestroyed;let t=this._destroyers.length;for(;--t>=0;){const e=this._destroyers[t];try{e()}catch(i){console.error("销毁函数在同步销毁时出错",this,e,i)}}this._destroyers.length=0;try{this.destroyThis()}catch(e){console.error("destroyThis 在异步销毁时出错",this,e)}return r.i(this),!0}destroy(){if(!this.canDestroy)return this.isDestroyed;const t=this._destroyers.toReversed();t.push(this.destroyThis),this._destroyers.length=0;const e=d.serialCallAllFuns(t,this,null,(i,u)=>{console.error("销毁函数在串行销毁时出错",this,u,i)});return e instanceof Promise?e.then(()=>(r.i(this),!0)):(r.i(this),!0)}}class o extends l{static isolatedPluginManager=!1;static get pluginManager(){return this.isolatedPluginManager&&!this.hasOwnProperty("_pluginManager")&&(this._pluginManager=new s.PluginExtendManager(this)),this._pluginManager}static _pluginManager=new s.PluginExtendManager(this);get pluginManager(){return this.constructor.pluginManager}static usePlugin(t,...e){return this.pluginManager.usePlugin(t,...e)}static useExtend(t){return this.pluginManager.useExtend(t)}static hasUsed(t){return this.pluginManager.hasUsed(t)}usePlugin(t,...e){return this.pluginManager.instUsePlugin(this,t,...e)}useExtend(t,...e){return this.pluginManager.instUseExtend(this,t,...e)}init(...t){return this.pluginManager.onInit(this,...t)}destroyThis(){const t=this.pluginManager.onDestroy(this);return t instanceof Promise?t.finally(()=>super.destroyThis()):super.destroyThis()}}class h extends o{static modeOptions=new s.TierModeOptions(s.commonModeName);get modeOptions(){return this._modeOptions||(this._modeOptions=new s.TierModeOptions(s.commonModeName,void 0,this.constructor.modeOptions))}_modeOptions;get mode(){return this.modeOptions.mode}set mode(t){this.modeOptions.mode=t}get options(){return this.modeOptions.plainFullOption}constructor(t){super(),this.modeOptions.setOption(t)}}class c extends o{static defaultOptions=new s.TierOptions;get defaultOptions(){return this._defaultOptions||(this._defaultOptions=new s.TierOptions(void 0,this.constructor.defaultOptions))}_defaultOptions;constructor(t){super(),this.defaultOptions.option=t}}exports.TierModeOptionsPluginHost=s.TierModeOptionsPluginHost;exports.TierOptionsPluginHost=s.TierOptionsPluginHost;exports.commonModeName=s.commonModeName;exports.createTierModeOptionsPluginHost=s.createTierModeOptionsPluginHost;exports.createTierOptionsPluginHost=s.createTierOptionsPluginHost;exports.PluginHostEventEmitter=o;exports.TierModeOptionsPluginHostEventEmitter=h;exports.TierOptionsPluginHostEventEmitter=c;
@@ -1,9 +1,9 @@
1
1
  import { i as n } from "./Destroyable-BqvuD4gL-D50ZO9eN.js";
2
- import { EventEmitter as l } from "node:events";
3
- import { serialCallAllFuns as p } from "com-tools";
4
- import { P as r, T as o, c as u, a } from "./createTierModeOptionsPluginHost-CeND_z6P.js";
5
- import { d as D, e as T, g as E, h as x } from "./createTierModeOptionsPluginHost-CeND_z6P.js";
6
- class c extends l {
2
+ import { EventEmitter as p } from "node:events";
3
+ import { serialCallAllFuns as l } from "com-tools";
4
+ import { P as r, T as o, c as u, d as a } from "./createTierModeOptionsPluginHost-3jPWAW92.js";
5
+ import { f as D, g as T, p as E, q as x } from "./createTierModeOptionsPluginHost-3jPWAW92.js";
6
+ class c extends p {
7
7
  /**
8
8
  * 引用计数
9
9
  * @remarks
@@ -114,7 +114,7 @@ class c extends l {
114
114
  if (!this.canDestroy) return this.isDestroyed;
115
115
  const t = this._destroyers.toReversed();
116
116
  t.push(this.destroyThis), this._destroyers.length = 0;
117
- const s = p(t, this, null, (e, h) => {
117
+ const s = l(t, this, null, (e, h) => {
118
118
  console.error("销毁函数在串行销毁时出错", this, h, e);
119
119
  });
120
120
  return s instanceof Promise ? s.then(() => (n(this), !0)) : (n(this), !0);
@@ -203,7 +203,7 @@ class d extends c {
203
203
  return t instanceof Promise ? t.finally(() => super.destroyThis()) : super.destroyThis();
204
204
  }
205
205
  }
206
- class f extends d {
206
+ class m extends d {
207
207
  /**
208
208
  * 全局级别的默认选项
209
209
  */
@@ -247,7 +247,7 @@ class _ extends d {
247
247
  export {
248
248
  d as PluginHostEventEmitter,
249
249
  D as TierModeOptionsPluginHost,
250
- f as TierModeOptionsPluginHostEventEmitter,
250
+ m as TierModeOptionsPluginHostEventEmitter,
251
251
  T as TierOptionsPluginHost,
252
252
  _ as TierOptionsPluginHostEventEmitter,
253
253
  u as commonModeName,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./Destroyable-BqvuD4gL-Cmk1ocqj.cjs"),c=require("com-tools"),n=require("./createTierModeOptionsPluginHost-C3kmxB00.cjs");if(!globalThis.CustomEvent){class i extends Event{detail;constructor(e,s){super(e,s),this.detail=s?.detail}}globalThis.CustomEvent=i}class h extends EventTarget{addEventListener(t,e,s){const r=s?.times;if(r){const o=typeof e=="function"?e:e?.handleEvent;if(o)return this.multipleListen(t,o,r)}return super.addEventListener(t,e,s),()=>{this.removeEventListener(t,e,s)}}dispatchEvent(t,e){const s=t instanceof Event?t:new CustomEvent(t,{detail:e,bubbles:!1,cancelable:!0,composed:!1});return super.dispatchEvent(s)}onceListen(t,e,s){return this.addEventListener(t,e,{...s,once:!0})}multipleListen(t,e,s){let r=0;const o=new AbortController,l=o.signal;return super.addEventListener(t,d=>{++r>=s&&o.abort(),e.call(this,d)},{signal:l}),function(){o.abort()}}}class p extends h{refCount=0;get isDestroyed(){return this._isDestroyed}_isDestroyed=!1;get canDestroy(){return!this.isDestroyed&&this.refCount<=0}_destroyers=[];disposeFun(t){return this._destroyers.push(t),t}cancelDisposeFun(t){const e=this._destroyers.indexOf(t);return this._destroyers.splice(e,1),t}disposeObj(t,e){const s=e?function(){return t.destroySync()}:function(){return t.destroy()};return this.disposeFun(s),t.__destroyable_destroyer=s,t}cancelDisposeObj(t){const e=t.__destroyable_destroyer;return e&&this.cancelDisposeFun(e),t}dispose(t,e){return typeof t=="function"?this.disposeFun(t):this.disposeObj(t,e)}cancelDispose(t){return typeof t=="function"?this.cancelDisposeFun(t):this.cancelDisposeObj(t)}destroyThis(){}destroySync(){if(!this.canDestroy)return this.isDestroyed;let t=this._destroyers.length;for(;--t>=0;){const e=this._destroyers[t];try{e()}catch(s){console.error("销毁函数在同步销毁时出错",this,e,s)}}this._destroyers.length=0;try{this.destroyThis()}catch(e){console.error("destroyThis 在异步销毁时出错",this,e)}return u.i(this),!0}destroy(){if(!this.canDestroy)return this.isDestroyed;const t=this._destroyers.toReversed();t.push(this.destroyThis),this._destroyers.length=0;const e=c.serialCallAllFuns(t,this,null,(s,r)=>{console.error("销毁函数在串行销毁时出错",this,r,s)});return e instanceof Promise?e.then(()=>(u.i(this),!0)):(u.i(this),!0)}}class a extends p{static isolatedPluginManager=!1;static get pluginManager(){return this.isolatedPluginManager&&!this.hasOwnProperty("_pluginManager")&&(this._pluginManager=new n.PluginExtendManager(this)),this._pluginManager}static _pluginManager=new n.PluginExtendManager(this);get pluginManager(){return this.constructor.pluginManager}static usePlugin(t,...e){return this.pluginManager.usePlugin(t,...e)}static useExtend(t){return this.pluginManager.useExtend(t)}static hasUsed(t){return this.pluginManager.hasUsed(t)}usePlugin(t,...e){return this.pluginManager.instUsePlugin(this,t,...e)}useExtend(t,...e){return this.pluginManager.instUseExtend(this,t,...e)}init(...t){return this.pluginManager.onInit(this,...t)}destroyThis(){const t=this.pluginManager.onDestroy(this);return t instanceof Promise?t.finally(()=>super.destroyThis()):super.destroyThis()}}class g extends a{static modeOptions=new n.TierModeOptions(n.commonModeName);get modeOptions(){return this._modeOptions||(this._modeOptions=new n.TierModeOptions(n.commonModeName,void 0,this.constructor.modeOptions))}_modeOptions;get mode(){return this.modeOptions.mode}set mode(t){this.modeOptions.mode=t}get options(){return this.modeOptions.plainFullOption}constructor(t){super(),this.modeOptions.setOption(t)}}class y extends a{static defaultOptions=new n.TierOptions;get defaultOptions(){return this._defaultOptions||(this._defaultOptions=new n.TierOptions(void 0,this.constructor.defaultOptions))}_defaultOptions;constructor(t){super(),this.defaultOptions.option=t}}exports.TierModeOptionsPluginHost=n.TierModeOptionsPluginHost;exports.TierOptionsPluginHost=n.TierOptionsPluginHost;exports.commonModeName=n.commonModeName;exports.createTierModeOptionsPluginHost=n.createTierModeOptionsPluginHost;exports.createTierOptionsPluginHost=n.createTierOptionsPluginHost;exports.PluginHostEventTarget=a;exports.TierModeOptionsPluginHostEventTarget=g;exports.TierOptionsPluginHostEventTarget=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./Destroyable-BqvuD4gL-Cmk1ocqj.cjs"),c=require("com-tools"),n=require("./createTierModeOptionsPluginHost-GosxwlJk.cjs");if(!globalThis.CustomEvent){class i extends Event{detail;constructor(e,s){super(e,s),this.detail=s?.detail}}globalThis.CustomEvent=i}class h extends EventTarget{addEventListener(t,e,s){const r=s?.times;if(r){const o=typeof e=="function"?e:e?.handleEvent;if(o)return this.multipleListen(t,o,r)}return super.addEventListener(t,e,s),()=>{this.removeEventListener(t,e,s)}}dispatchEvent(t,e){const s=t instanceof Event?t:new CustomEvent(t,{detail:e,bubbles:!1,cancelable:!0,composed:!1});return super.dispatchEvent(s)}onceListen(t,e,s){return this.addEventListener(t,e,{...s,once:!0})}multipleListen(t,e,s){let r=0;const o=new AbortController,l=o.signal;return super.addEventListener(t,d=>{++r>=s&&o.abort(),e.call(this,d)},{signal:l}),function(){o.abort()}}}class p extends h{refCount=0;get isDestroyed(){return this._isDestroyed}_isDestroyed=!1;get canDestroy(){return!this.isDestroyed&&this.refCount<=0}_destroyers=[];disposeFun(t){return this._destroyers.push(t),t}cancelDisposeFun(t){const e=this._destroyers.indexOf(t);return this._destroyers.splice(e,1),t}disposeObj(t,e){const s=e?function(){return t.destroySync()}:function(){return t.destroy()};return this.disposeFun(s),t.__destroyable_destroyer=s,t}cancelDisposeObj(t){const e=t.__destroyable_destroyer;return e&&this.cancelDisposeFun(e),t}dispose(t,e){return typeof t=="function"?this.disposeFun(t):this.disposeObj(t,e)}cancelDispose(t){return typeof t=="function"?this.cancelDisposeFun(t):this.cancelDisposeObj(t)}destroyThis(){}destroySync(){if(!this.canDestroy)return this.isDestroyed;let t=this._destroyers.length;for(;--t>=0;){const e=this._destroyers[t];try{e()}catch(s){console.error("销毁函数在同步销毁时出错",this,e,s)}}this._destroyers.length=0;try{this.destroyThis()}catch(e){console.error("destroyThis 在异步销毁时出错",this,e)}return u.i(this),!0}destroy(){if(!this.canDestroy)return this.isDestroyed;const t=this._destroyers.toReversed();t.push(this.destroyThis),this._destroyers.length=0;const e=c.serialCallAllFuns(t,this,null,(s,r)=>{console.error("销毁函数在串行销毁时出错",this,r,s)});return e instanceof Promise?e.then(()=>(u.i(this),!0)):(u.i(this),!0)}}class a extends p{static isolatedPluginManager=!1;static get pluginManager(){return this.isolatedPluginManager&&!this.hasOwnProperty("_pluginManager")&&(this._pluginManager=new n.PluginExtendManager(this)),this._pluginManager}static _pluginManager=new n.PluginExtendManager(this);get pluginManager(){return this.constructor.pluginManager}static usePlugin(t,...e){return this.pluginManager.usePlugin(t,...e)}static useExtend(t){return this.pluginManager.useExtend(t)}static hasUsed(t){return this.pluginManager.hasUsed(t)}usePlugin(t,...e){return this.pluginManager.instUsePlugin(this,t,...e)}useExtend(t,...e){return this.pluginManager.instUseExtend(this,t,...e)}init(...t){return this.pluginManager.onInit(this,...t)}destroyThis(){const t=this.pluginManager.onDestroy(this);return t instanceof Promise?t.finally(()=>super.destroyThis()):super.destroyThis()}}class g extends a{static modeOptions=new n.TierModeOptions(n.commonModeName);get modeOptions(){return this._modeOptions||(this._modeOptions=new n.TierModeOptions(n.commonModeName,void 0,this.constructor.modeOptions))}_modeOptions;get mode(){return this.modeOptions.mode}set mode(t){this.modeOptions.mode=t}get options(){return this.modeOptions.plainFullOption}constructor(t){super(),this.modeOptions.setOption(t)}}class y extends a{static defaultOptions=new n.TierOptions;get defaultOptions(){return this._defaultOptions||(this._defaultOptions=new n.TierOptions(void 0,this.constructor.defaultOptions))}_defaultOptions;constructor(t){super(),this.defaultOptions.option=t}}exports.TierModeOptionsPluginHost=n.TierModeOptionsPluginHost;exports.TierOptionsPluginHost=n.TierOptionsPluginHost;exports.commonModeName=n.commonModeName;exports.createTierModeOptionsPluginHost=n.createTierModeOptionsPluginHost;exports.createTierOptionsPluginHost=n.createTierOptionsPluginHost;exports.PluginHostEventTarget=a;exports.TierModeOptionsPluginHostEventTarget=g;exports.TierOptionsPluginHostEventTarget=y;
package/dist/index-web.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { i as o } from "./Destroyable-BqvuD4gL-D50ZO9eN.js";
2
2
  import { serialCallAllFuns as g } from "com-tools";
3
- import { P as a, T as u, c as l, a as d } from "./createTierModeOptionsPluginHost-CeND_z6P.js";
4
- import { d as P, e as D, g as b, h as x } from "./createTierModeOptionsPluginHost-CeND_z6P.js";
3
+ import { P as u, T as a, c as l, d } from "./createTierModeOptionsPluginHost-3jPWAW92.js";
4
+ import { f as P, g as D, p as b, q as x } from "./createTierModeOptionsPluginHost-3jPWAW92.js";
5
5
  if (!globalThis.CustomEvent) {
6
6
  class n extends Event {
7
7
  detail;
@@ -200,9 +200,9 @@ class h extends f {
200
200
  * 插件管理器
201
201
  */
202
202
  static get pluginManager() {
203
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new a(this)), this._pluginManager;
203
+ return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new u(this)), this._pluginManager;
204
204
  }
205
- static _pluginManager = new a(this);
205
+ static _pluginManager = new u(this);
206
206
  /**
207
207
  * 插件管理器 {@link PluginHost.pluginManager}
208
208
  */
@@ -277,12 +277,12 @@ class E extends h {
277
277
  /**
278
278
  * 全局级别的默认选项
279
279
  */
280
- static modeOptions = new u(l);
280
+ static modeOptions = new a(l);
281
281
  /**
282
282
  * 实例级的默认选项
283
283
  */
284
284
  get modeOptions() {
285
- return this._modeOptions || (this._modeOptions = new u(l, void 0, this.constructor.modeOptions));
285
+ return this._modeOptions || (this._modeOptions = new a(l, void 0, this.constructor.modeOptions));
286
286
  }
287
287
  _modeOptions;
288
288
  get mode() {