storybook 10.1.0-alpha.8 → 10.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_browser-chunks/Color-FTG7SQDA.js +1097 -0
- package/dist/_browser-chunks/WithTooltip-LMROHDUP.js +1651 -0
- package/dist/_browser-chunks/chunk-2FRVAXCZ.js +7 -0
- package/dist/_browser-chunks/{chunk-FDWKXLBI.js → chunk-2XZMBGTA.js} +44 -109
- package/dist/_browser-chunks/chunk-3IAH5M2U.js +171 -0
- package/dist/_browser-chunks/chunk-3OXGAGBE.js +779 -0
- package/dist/_browser-chunks/{chunk-TMDZCWME.js → chunk-3PJE6VLG.js} +1 -3
- package/dist/_browser-chunks/{chunk-VAMFPZY3.js → chunk-45UGUKRX.js} +2 -7
- package/dist/_browser-chunks/chunk-6XWLIJQL.js +11 -0
- package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
- package/dist/_browser-chunks/chunk-AIOS4NGK.js +252 -0
- package/dist/_browser-chunks/chunk-AS2HQEYC.js +14 -0
- package/dist/_browser-chunks/chunk-AXG2BOBL.js +836 -0
- package/dist/_browser-chunks/{chunk-MH6AXFXB.js → chunk-CHUV5WSW.js} +0 -5
- package/dist/_browser-chunks/chunk-EUVGDK4H.js +93 -0
- package/dist/_browser-chunks/chunk-EZSQOHRI.js +18 -0
- package/dist/_browser-chunks/{chunk-CADGRH3P.js → chunk-FNXWN6IK.js} +3 -8
- package/dist/_browser-chunks/chunk-FQ7SLVLR.js +66 -0
- package/dist/_browser-chunks/chunk-GFLS4VP3.js +64 -0
- package/dist/_browser-chunks/chunk-GFY5R5EY.js +47 -0
- package/dist/_browser-chunks/{chunk-L2D73C6Z.js → chunk-H6XK3RSC.js} +13 -21
- package/dist/_browser-chunks/chunk-IPA5A322.js +71 -0
- package/dist/_browser-chunks/chunk-JP7NCOJX.js +37 -0
- package/dist/_browser-chunks/chunk-KJHJLCBK.js +11 -0
- package/dist/_browser-chunks/{chunk-OWPZQM2D.js → chunk-L4RMQ7D7.js} +60 -110
- package/dist/_browser-chunks/chunk-P4F4UVXX.js +951 -0
- package/dist/_browser-chunks/{chunk-AB7OOPUX.js → chunk-QKODTO7K.js} +0 -5
- package/dist/_browser-chunks/chunk-RP5RXKFU.js +2491 -0
- package/dist/_browser-chunks/chunk-SL75JR6Y.js +9 -0
- package/dist/_browser-chunks/chunk-SS2NHR7W.js +2969 -0
- package/dist/_browser-chunks/chunk-UD6FQLAF.js +1481 -0
- package/dist/_browser-chunks/chunk-VYJQ7RU5.js +2853 -0
- package/dist/_browser-chunks/chunk-WJYERY3R.js +136 -0
- package/dist/_browser-chunks/chunk-XJNX76GA.js +85 -0
- package/dist/_browser-chunks/{chunk-F4Q6SGTB.js → chunk-YKE5S47A.js} +177 -399
- package/dist/_browser-chunks/{chunk-SN4J4IQ3.js → chunk-ZUWEVLDX.js} +1 -7
- package/dist/_browser-chunks/{formatter-OMEEQ6HG.js → formatter-QJ4M4OGQ.js} +4 -9
- package/dist/_browser-chunks/{syntaxhighlighter-CAVLW7PM.js → syntaxhighlighter-IQDEPFLK.js} +704 -1848
- package/dist/_node-chunks/{builder-manager-57OYTFQ5.js → builder-manager-BDAQHXFI.js} +510 -1019
- package/dist/_node-chunks/camelcase-3C7DZZPX.js +37 -0
- package/dist/_node-chunks/chunk-2IIQTGNE.js +6024 -0
- package/dist/_node-chunks/chunk-56U5LEMP.js +3043 -0
- package/dist/_node-chunks/chunk-7LIRCAQE.js +20 -0
- package/dist/_node-chunks/chunk-7RN6TXKP.js +603 -0
- package/dist/_node-chunks/chunk-7SJ7PZNL.js +4523 -0
- package/dist/_node-chunks/{chunk-2GK7NW46.js → chunk-BG4RDXG7.js} +8 -10
- package/dist/_node-chunks/chunk-CBQKMXLQ.js +18 -0
- package/dist/_node-chunks/chunk-CN2IW2KQ.js +1564 -0
- package/dist/_node-chunks/chunk-CQMAU6UQ.js +943 -0
- package/dist/_node-chunks/{chunk-RG4Z25PY.js → chunk-D6ND3TVY.js} +116 -276
- package/dist/_node-chunks/chunk-DC355CYB.js +61 -0
- package/dist/_node-chunks/{chunk-EBYCXVVR.js → chunk-EVK2SBW5.js} +292 -688
- package/dist/_node-chunks/chunk-IXWEUXJ2.js +119 -0
- package/dist/_node-chunks/{chunk-6F6CCOXH.js → chunk-KVRF22SH.js} +469 -983
- package/dist/_node-chunks/chunk-LEDP4QQW.js +919 -0
- package/dist/_node-chunks/{chunk-C4KEDJ6O.js → chunk-MMVV6DGG.js} +8133 -8887
- package/dist/_node-chunks/chunk-O5CGEVRI.js +29 -0
- package/dist/_node-chunks/chunk-OZZO56XN.js +299 -0
- package/dist/_node-chunks/chunk-POT2EVGD.js +78 -0
- package/dist/_node-chunks/chunk-R5YGFSTV.js +3781 -0
- package/dist/_node-chunks/chunk-SQCTM2OS.js +23 -0
- package/dist/_node-chunks/chunk-UFOFO5H7.js +54 -0
- package/dist/_node-chunks/chunk-VBF7ALJF.js +72 -0
- package/dist/_node-chunks/chunk-W6MAMTUF.js +70 -0
- package/dist/_node-chunks/chunk-WURL4XOT.js +46662 -0
- package/dist/_node-chunks/chunk-XGK6MVKR.js +61 -0
- package/dist/_node-chunks/chunk-YV3GDSDT.js +765 -0
- package/dist/_node-chunks/{chunk-RSHLCHYY.js → chunk-YWV55YW3.js} +15 -24
- package/dist/_node-chunks/dist-KEP4IFRN.js +121 -0
- package/dist/_node-chunks/globby-4WUBTDCN.js +3452 -0
- package/dist/_node-chunks/lib-JVOEKTYM.js +366 -0
- package/dist/_node-chunks/mdx-N42X6CFJ-C5WFYYXR.js +14329 -0
- package/dist/_node-chunks/p-limit-LDY632RS.js +116 -0
- package/dist/actions/decorator.js +21 -42
- package/dist/actions/index.js +3 -3
- package/dist/babel/index.d.ts +671 -335
- package/dist/babel/index.js +10 -11
- package/dist/bin/core.js +601 -1548
- package/dist/bin/dispatcher.js +36 -36
- package/dist/bin/loader.js +24 -38
- package/dist/channels/index.js +98 -234
- package/dist/cli/index.d.ts +1479 -133
- package/dist/cli/index.js +30 -8540
- package/dist/client-logger/index.js +31 -61
- package/dist/common/index.d.ts +139 -62
- package/dist/common/index.js +66 -51
- package/dist/components/index.d.ts +575 -273
- package/dist/components/index.js +14863 -4313
- package/dist/core-events/index.js +2 -66
- package/dist/core-server/index.d.ts +3 -2
- package/dist/core-server/index.js +2910 -8519
- package/dist/core-server/presets/common-manager.css +2 -2
- package/dist/core-server/presets/common-manager.js +2521 -5233
- package/dist/core-server/presets/common-override-preset.js +31 -60
- package/dist/core-server/presets/common-preset.js +663 -962
- package/dist/csf/index.js +534 -1179
- package/dist/csf-tools/index.js +9 -9
- package/dist/docs-tools/index.js +6 -6
- package/dist/highlight/index.js +2 -2
- package/dist/instrumenter/index.js +199 -415
- package/dist/manager/globals-runtime.js +59044 -67141
- package/dist/manager/globals.js +2 -3
- package/dist/manager/manager-stores.d.ts +1 -0
- package/dist/manager/manager-stores.js +23 -0
- package/dist/manager/runtime.js +11511 -10953
- package/dist/manager-api/index.d.ts +1811 -2
- package/dist/manager-api/index.js +1348 -2401
- package/dist/manager-errors.d.ts +9 -0
- package/dist/manager-errors.js +3 -3
- package/dist/mocking-utils/index.d.ts +1126 -0
- package/dist/mocking-utils/index.js +1181 -0
- package/dist/node-logger/index.d.ts +192 -24
- package/dist/node-logger/index.js +23 -4471
- package/dist/preview/globals.js +2 -3
- package/dist/preview/runtime.js +10799 -22393
- package/dist/preview-api/index.d.ts +1 -1
- package/dist/preview-api/index.js +13 -13
- package/dist/preview-errors.d.ts +9 -0
- package/dist/preview-errors.js +4 -4
- package/dist/router/index.js +347 -899
- package/dist/server-errors.d.ts +34 -1
- package/dist/server-errors.js +17 -10
- package/dist/telemetry/index.d.ts +24 -3
- package/dist/telemetry/index.js +25 -24
- package/dist/test/index.js +6131 -11916
- package/dist/theming/create.d.ts +1 -0
- package/dist/theming/create.js +4 -4
- package/dist/theming/index.d.ts +3366 -2599
- package/dist/theming/index.js +501 -1091
- package/dist/types/index.d.ts +72 -8
- package/dist/types/index.js +27 -12
- package/dist/viewport/index.js +3 -3
- package/package.json +26 -17
- package/dist/_browser-chunks/Color-7ZNS6F6B.js +0 -1676
- package/dist/_browser-chunks/WithTooltip-SK46ZJ2J.js +0 -13
- package/dist/_browser-chunks/chunk-6A7OIVEL.js +0 -66
- package/dist/_browser-chunks/chunk-B4A3ADP3.js +0 -3816
- package/dist/_browser-chunks/chunk-BOOOPFZF.js +0 -2335
- package/dist/_browser-chunks/chunk-FSBVR7H5.js +0 -106
- package/dist/_browser-chunks/chunk-FUOHXXZT.js +0 -23
- package/dist/_browser-chunks/chunk-GTKOCWCT.js +0 -17
- package/dist/_browser-chunks/chunk-HHW4FUMO.js +0 -12
- package/dist/_browser-chunks/chunk-JVSKG4YS.js +0 -4052
- package/dist/_browser-chunks/chunk-LASUB7TL.js +0 -76
- package/dist/_browser-chunks/chunk-LYCSRYYR.js +0 -101
- package/dist/_browser-chunks/chunk-NVV6MIOE.js +0 -243
- package/dist/_browser-chunks/chunk-OBXWFEPB.js +0 -852
- package/dist/_browser-chunks/chunk-OPCDBBL3.js +0 -48
- package/dist/_browser-chunks/chunk-PB6FZ3WE.js +0 -130
- package/dist/_browser-chunks/chunk-RNE2IUTB.js +0 -1300
- package/dist/_browser-chunks/chunk-RW5PKMWM.js +0 -4182
- package/dist/_browser-chunks/chunk-SYS437NN.js +0 -122
- package/dist/_browser-chunks/chunk-U46RQHA4.js +0 -12
- package/dist/_browser-chunks/chunk-UTNZYD2N.js +0 -311
- package/dist/_browser-chunks/chunk-VUAFL5XK.js +0 -20
- package/dist/_browser-chunks/chunk-XDGMHOV7.js +0 -2197
- package/dist/_browser-chunks/chunk-XW6KSYKF.js +0 -16
- package/dist/_browser-chunks/chunk-Y3M7TW6K.js +0 -1041
- package/dist/_browser-chunks/chunk-ZNRFDIVA.js +0 -233
- package/dist/_node-chunks/camelcase-2KEDZHZ2.js +0 -18
- package/dist/_node-chunks/chunk-34NNXTBR.js +0 -28
- package/dist/_node-chunks/chunk-3N2A3KZX.js +0 -420
- package/dist/_node-chunks/chunk-5P7P5KDN.js +0 -90
- package/dist/_node-chunks/chunk-5WBRBDXI.js +0 -79
- package/dist/_node-chunks/chunk-7PWTU7T2.js +0 -697
- package/dist/_node-chunks/chunk-CHRHQ7AZ.js +0 -4272
- package/dist/_node-chunks/chunk-D4EGQLJI.js +0 -64656
- package/dist/_node-chunks/chunk-EKCURTKU.js +0 -1544
- package/dist/_node-chunks/chunk-GBVPPW4H.js +0 -1657
- package/dist/_node-chunks/chunk-J6VOKT2F.js +0 -220
- package/dist/_node-chunks/chunk-JLBYSGXS.js +0 -69
- package/dist/_node-chunks/chunk-LLCELSUL.js +0 -1198
- package/dist/_node-chunks/chunk-NS4OCQ4F.js +0 -61
- package/dist/_node-chunks/chunk-NXVLFYDR.js +0 -1518
- package/dist/_node-chunks/chunk-NZPWAJOZ.js +0 -304
- package/dist/_node-chunks/chunk-OYFSIV3I.js +0 -6712
- package/dist/_node-chunks/chunk-OZ43LMDF.js +0 -5029
- package/dist/_node-chunks/chunk-Q5HJHFF2.js +0 -61
- package/dist/_node-chunks/chunk-QHER4CEN.js +0 -34
- package/dist/_node-chunks/chunk-RF2PJM54.js +0 -1531
- package/dist/_node-chunks/chunk-S3OHGEE3.js +0 -101
- package/dist/_node-chunks/chunk-S5XOMVSV.js +0 -2256
- package/dist/_node-chunks/chunk-SGXQZ47H.js +0 -1586
- package/dist/_node-chunks/chunk-TDU6OVUH.js +0 -111
- package/dist/_node-chunks/chunk-TYQQFNQX.js +0 -1250
- package/dist/_node-chunks/chunk-WNGLARN2.js +0 -4741
- package/dist/_node-chunks/chunk-YUOVDCXL.js +0 -18
- package/dist/_node-chunks/dist-O5FB7YUW.js +0 -175
- package/dist/_node-chunks/globby-3NMV7WHX.js +0 -5222
- package/dist/_node-chunks/lib-VZD7BRSA.js +0 -518
- package/dist/_node-chunks/mdx-N42X6CFJ-3RP7RKKU.js +0 -22017
- package/dist/_node-chunks/p-limit-LIKBTXEJ.js +0 -168
- package/dist/_node-chunks/plugin-2NYZBK4A.js +0 -129
- package/dist/_node-chunks/plugin-6QGMO7J7.js +0 -159
- package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-Z2JI6J2H.js +0 -69102
- package/dist/_node-chunks/webpack-mock-plugin-D4BE2SSI.js +0 -124
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -36
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -33
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hjmvusgt1gv from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hjmvusgt1gv from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hjmvusgt1gv from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hjmvusgt1gv.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hjmvusgt1gv.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hjmvusgt1gv.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -13,30 +13,29 @@ import {
|
|
|
13
13
|
BROWSER_TARGETS,
|
|
14
14
|
NODE_TARGET,
|
|
15
15
|
SUPPORTED_FEATURES
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-BG4RDXG7.js";
|
|
17
17
|
import {
|
|
18
18
|
require_build
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-7RN6TXKP.js";
|
|
20
20
|
import {
|
|
21
21
|
resolveModulePath,
|
|
22
22
|
resolvePackageDir
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-YV3GDSDT.js";
|
|
24
24
|
import {
|
|
25
25
|
join,
|
|
26
26
|
parse
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-IXWEUXJ2.js";
|
|
28
28
|
import {
|
|
29
29
|
slash
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-7LIRCAQE.js";
|
|
31
31
|
import {
|
|
32
32
|
__commonJS,
|
|
33
33
|
__esm,
|
|
34
34
|
__export,
|
|
35
|
-
__name,
|
|
36
35
|
__require,
|
|
37
36
|
__toCommonJS,
|
|
38
37
|
__toESM
|
|
39
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-UFOFO5H7.js";
|
|
40
39
|
|
|
41
40
|
// ../node_modules/tslib/tslib.es6.mjs
|
|
42
41
|
var tslib_es6_exports = {};
|
|
@@ -76,30 +75,26 @@ __export(tslib_es6_exports, {
|
|
|
76
75
|
default: () => tslib_es6_default
|
|
77
76
|
});
|
|
78
77
|
function __extends(d, b) {
|
|
79
|
-
if (typeof b
|
|
78
|
+
if (typeof b != "function" && b !== null)
|
|
80
79
|
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
81
80
|
extendStatics(d, b);
|
|
82
81
|
function __() {
|
|
83
82
|
this.constructor = d;
|
|
84
83
|
}
|
|
85
|
-
__name(__, "__");
|
|
86
84
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
87
85
|
}
|
|
88
86
|
function __rest(s, e) {
|
|
89
87
|
var t = {};
|
|
90
|
-
for (var p in s)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
95
|
-
t[p[i]] = s[p[i]];
|
|
96
|
-
}
|
|
88
|
+
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
89
|
+
if (s != null && typeof Object.getOwnPropertySymbols == "function")
|
|
90
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
|
|
91
|
+
e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
|
|
97
92
|
return t;
|
|
98
93
|
}
|
|
99
94
|
function __decorate(decorators, target, key, desc) {
|
|
100
95
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
101
|
-
if (typeof Reflect
|
|
102
|
-
else for (var i = decorators.length - 1; i >= 0; i--)
|
|
96
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
97
|
+
else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
103
98
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
104
99
|
}
|
|
105
100
|
function __param(paramIndex, decorator) {
|
|
@@ -109,15 +104,10 @@ function __param(paramIndex, decorator) {
|
|
|
109
104
|
}
|
|
110
105
|
function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
111
106
|
function accept(f) {
|
|
112
|
-
if (f !== void 0 && typeof f
|
|
107
|
+
if (f !== void 0 && typeof f != "function") throw new TypeError("Function expected");
|
|
113
108
|
return f;
|
|
114
109
|
}
|
|
115
|
-
|
|
116
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
117
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
118
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
119
|
-
var _, done = false;
|
|
120
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
110
|
+
for (var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value", target = !descriptorIn && ctor ? contextIn.static ? ctor : ctor.prototype : null, descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}), _, done = !1, i = decorators.length - 1; i >= 0; i--) {
|
|
121
111
|
var context = {};
|
|
122
112
|
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
123
113
|
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
@@ -128,34 +118,25 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e
|
|
|
128
118
|
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
129
119
|
if (kind === "accessor") {
|
|
130
120
|
if (result === void 0) continue;
|
|
131
|
-
if (result === null || typeof result
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
135
|
-
} else if (_ = accept(result)) {
|
|
136
|
-
if (kind === "field") initializers.unshift(_);
|
|
137
|
-
else descriptor[key] = _;
|
|
138
|
-
}
|
|
121
|
+
if (result === null || typeof result != "object") throw new TypeError("Object expected");
|
|
122
|
+
(_ = accept(result.get)) && (descriptor.get = _), (_ = accept(result.set)) && (descriptor.set = _), (_ = accept(result.init)) && initializers.unshift(_);
|
|
123
|
+
} else (_ = accept(result)) && (kind === "field" ? initializers.unshift(_) : descriptor[key] = _);
|
|
139
124
|
}
|
|
140
|
-
|
|
141
|
-
done = true;
|
|
125
|
+
target && Object.defineProperty(target, contextIn.name, descriptor), done = !0;
|
|
142
126
|
}
|
|
143
127
|
function __runInitializers(thisArg, initializers, value) {
|
|
144
|
-
var useValue = arguments.length > 2;
|
|
145
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
128
|
+
for (var useValue = arguments.length > 2, i = 0; i < initializers.length; i++)
|
|
146
129
|
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
147
|
-
}
|
|
148
130
|
return useValue ? value : void 0;
|
|
149
131
|
}
|
|
150
132
|
function __propKey(x) {
|
|
151
|
-
return typeof x
|
|
133
|
+
return typeof x == "symbol" ? x : "".concat(x);
|
|
152
134
|
}
|
|
153
135
|
function __setFunctionName(f, name, prefix) {
|
|
154
|
-
|
|
155
|
-
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
136
|
+
return typeof name == "symbol" && (name = name.description ? "[".concat(name.description, "]") : ""), Object.defineProperty(f, "name", { configurable: !0, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
156
137
|
}
|
|
157
138
|
function __metadata(metadataKey, metadataValue) {
|
|
158
|
-
if (typeof Reflect
|
|
139
|
+
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
159
140
|
}
|
|
160
141
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
161
142
|
function adopt(value) {
|
|
@@ -163,7 +144,6 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
163
144
|
resolve(value);
|
|
164
145
|
});
|
|
165
146
|
}
|
|
166
|
-
__name(adopt, "adopt");
|
|
167
147
|
return new (P || (P = Promise))(function(resolve, reject) {
|
|
168
148
|
function fulfilled(value) {
|
|
169
149
|
try {
|
|
@@ -172,28 +152,25 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
172
152
|
reject(e);
|
|
173
153
|
}
|
|
174
154
|
}
|
|
175
|
-
__name(fulfilled, "fulfilled");
|
|
176
155
|
function rejected(value) {
|
|
177
156
|
try {
|
|
178
|
-
step(generator
|
|
157
|
+
step(generator.throw(value));
|
|
179
158
|
} catch (e) {
|
|
180
159
|
reject(e);
|
|
181
160
|
}
|
|
182
161
|
}
|
|
183
|
-
__name(rejected, "rejected");
|
|
184
162
|
function step(result) {
|
|
185
163
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
186
164
|
}
|
|
187
|
-
__name(step, "step");
|
|
188
165
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
189
166
|
});
|
|
190
167
|
}
|
|
191
168
|
function __generator(thisArg, body) {
|
|
192
|
-
var _ = { label: 0, sent:
|
|
169
|
+
var _ = { label: 0, sent: function() {
|
|
193
170
|
if (t[0] & 1) throw t[1];
|
|
194
171
|
return t[1];
|
|
195
|
-
},
|
|
196
|
-
return g.next = verb(0), g
|
|
172
|
+
}, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
|
|
173
|
+
return g.next = verb(0), g.throw = verb(1), g.return = verb(2), typeof Symbol == "function" && (g[Symbol.iterator] = function() {
|
|
197
174
|
return this;
|
|
198
175
|
}), g;
|
|
199
176
|
function verb(n) {
|
|
@@ -201,31 +178,25 @@ function __generator(thisArg, body) {
|
|
|
201
178
|
return step([n, v]);
|
|
202
179
|
};
|
|
203
180
|
}
|
|
204
|
-
__name(verb, "verb");
|
|
205
181
|
function step(op) {
|
|
206
182
|
if (f) throw new TypeError("Generator is already executing.");
|
|
207
|
-
|
|
208
|
-
if (f = 1, y && (t = op[0] & 2 ? y
|
|
209
|
-
|
|
210
|
-
switch (op[0]) {
|
|
183
|
+
for (; g && (g = 0, op[0] && (_ = 0)), _; ) try {
|
|
184
|
+
if (f = 1, y && (t = op[0] & 2 ? y.return : op[0] ? y.throw || ((t = y.return) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
185
|
+
switch (y = 0, t && (op = [op[0] & 2, t.value]), op[0]) {
|
|
211
186
|
case 0:
|
|
212
187
|
case 1:
|
|
213
188
|
t = op;
|
|
214
189
|
break;
|
|
215
190
|
case 4:
|
|
216
|
-
_.label
|
|
217
|
-
return { value: op[1], done: false };
|
|
191
|
+
return _.label++, { value: op[1], done: !1 };
|
|
218
192
|
case 5:
|
|
219
|
-
_.label
|
|
220
|
-
y = op[1];
|
|
221
|
-
op = [0];
|
|
193
|
+
_.label++, y = op[1], op = [0];
|
|
222
194
|
continue;
|
|
223
195
|
case 7:
|
|
224
|
-
op = _.ops.pop();
|
|
225
|
-
_.trys.pop();
|
|
196
|
+
op = _.ops.pop(), _.trys.pop();
|
|
226
197
|
continue;
|
|
227
198
|
default:
|
|
228
|
-
if (
|
|
199
|
+
if (t = _.trys, !(t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
229
200
|
_ = 0;
|
|
230
201
|
continue;
|
|
231
202
|
}
|
|
@@ -234,56 +205,50 @@ function __generator(thisArg, body) {
|
|
|
234
205
|
break;
|
|
235
206
|
}
|
|
236
207
|
if (op[0] === 6 && _.label < t[1]) {
|
|
237
|
-
_.label = t[1];
|
|
238
|
-
t = op;
|
|
208
|
+
_.label = t[1], t = op;
|
|
239
209
|
break;
|
|
240
210
|
}
|
|
241
211
|
if (t && _.label < t[2]) {
|
|
242
|
-
_.label = t[2];
|
|
243
|
-
_.ops.push(op);
|
|
212
|
+
_.label = t[2], _.ops.push(op);
|
|
244
213
|
break;
|
|
245
214
|
}
|
|
246
|
-
|
|
247
|
-
_.trys.pop();
|
|
215
|
+
t[2] && _.ops.pop(), _.trys.pop();
|
|
248
216
|
continue;
|
|
249
217
|
}
|
|
250
218
|
op = body.call(thisArg, _);
|
|
251
219
|
} catch (e) {
|
|
252
|
-
op = [6, e];
|
|
253
|
-
y = 0;
|
|
220
|
+
op = [6, e], y = 0;
|
|
254
221
|
} finally {
|
|
255
222
|
f = t = 0;
|
|
256
223
|
}
|
|
257
224
|
if (op[0] & 5) throw op[1];
|
|
258
|
-
return { value: op[0] ? op[1] : void 0, done:
|
|
225
|
+
return { value: op[0] ? op[1] : void 0, done: !0 };
|
|
259
226
|
}
|
|
260
|
-
__name(step, "step");
|
|
261
227
|
}
|
|
262
228
|
function __exportStar(m, o) {
|
|
263
|
-
for (var p in m)
|
|
229
|
+
for (var p in m) p !== "default" && !Object.prototype.hasOwnProperty.call(o, p) && __createBinding(o, m, p);
|
|
264
230
|
}
|
|
265
231
|
function __values(o) {
|
|
266
|
-
var s = typeof Symbol
|
|
232
|
+
var s = typeof Symbol == "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
267
233
|
if (m) return m.call(o);
|
|
268
|
-
if (o && typeof o.length
|
|
269
|
-
next:
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}, "next")
|
|
234
|
+
if (o && typeof o.length == "number") return {
|
|
235
|
+
next: function() {
|
|
236
|
+
return o && i >= o.length && (o = void 0), { value: o && o[i++], done: !o };
|
|
237
|
+
}
|
|
273
238
|
};
|
|
274
239
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
275
240
|
}
|
|
276
241
|
function __read(o, n) {
|
|
277
|
-
var m = typeof Symbol
|
|
242
|
+
var m = typeof Symbol == "function" && o[Symbol.iterator];
|
|
278
243
|
if (!m) return o;
|
|
279
244
|
var i = m.call(o), r, ar = [], e;
|
|
280
245
|
try {
|
|
281
|
-
|
|
246
|
+
for (; (n === void 0 || n-- > 0) && !(r = i.next()).done; ) ar.push(r.value);
|
|
282
247
|
} catch (error) {
|
|
283
248
|
e = { error };
|
|
284
249
|
} finally {
|
|
285
250
|
try {
|
|
286
|
-
|
|
251
|
+
r && !r.done && (m = i.return) && m.call(i);
|
|
287
252
|
} finally {
|
|
288
253
|
if (e) throw e.error;
|
|
289
254
|
}
|
|
@@ -303,12 +268,8 @@ function __spreadArrays() {
|
|
|
303
268
|
return r;
|
|
304
269
|
}
|
|
305
270
|
function __spreadArray(to, from, pack) {
|
|
306
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++)
|
|
307
|
-
|
|
308
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
309
|
-
ar[i] = from[i];
|
|
310
|
-
}
|
|
311
|
-
}
|
|
271
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++)
|
|
272
|
+
(ar || !(i in from)) && (ar || (ar = Array.prototype.slice.call(from, 0, i)), ar[i] = from[i]);
|
|
312
273
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
313
274
|
}
|
|
314
275
|
function __await(v) {
|
|
@@ -317,7 +278,7 @@ function __await(v) {
|
|
|
317
278
|
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
318
279
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
319
280
|
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
320
|
-
return i = Object.create((typeof AsyncIterator
|
|
281
|
+
return i = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
|
|
321
282
|
return this;
|
|
322
283
|
}, i;
|
|
323
284
|
function awaitReturn(f) {
|
|
@@ -325,18 +286,13 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
325
286
|
return Promise.resolve(v).then(f, reject);
|
|
326
287
|
};
|
|
327
288
|
}
|
|
328
|
-
__name(awaitReturn, "awaitReturn");
|
|
329
289
|
function verb(n, f) {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
};
|
|
336
|
-
if (f) i[n] = f(i[n]);
|
|
337
|
-
}
|
|
290
|
+
g[n] && (i[n] = function(v) {
|
|
291
|
+
return new Promise(function(a, b) {
|
|
292
|
+
q.push([n, v, a, b]) > 1 || resume(n, v);
|
|
293
|
+
});
|
|
294
|
+
}, f && (i[n] = f(i[n])));
|
|
338
295
|
}
|
|
339
|
-
__name(verb, "verb");
|
|
340
296
|
function resume(n, v) {
|
|
341
297
|
try {
|
|
342
298
|
step(g[n](v));
|
|
@@ -344,23 +300,18 @@ function __asyncGenerator(thisArg, _arguments, generator) {
|
|
|
344
300
|
settle(q[0][3], e);
|
|
345
301
|
}
|
|
346
302
|
}
|
|
347
|
-
__name(resume, "resume");
|
|
348
303
|
function step(r) {
|
|
349
304
|
r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
|
|
350
305
|
}
|
|
351
|
-
__name(step, "step");
|
|
352
306
|
function fulfill(value) {
|
|
353
307
|
resume("next", value);
|
|
354
308
|
}
|
|
355
|
-
__name(fulfill, "fulfill");
|
|
356
309
|
function reject(value) {
|
|
357
310
|
resume("throw", value);
|
|
358
311
|
}
|
|
359
|
-
__name(reject, "reject");
|
|
360
312
|
function settle(f, v) {
|
|
361
|
-
|
|
313
|
+
f(v), q.shift(), q.length && resume(q[0][0], q[0][1]);
|
|
362
314
|
}
|
|
363
|
-
__name(settle, "settle");
|
|
364
315
|
}
|
|
365
316
|
function __asyncDelegator(o) {
|
|
366
317
|
var i, p;
|
|
@@ -371,15 +322,14 @@ function __asyncDelegator(o) {
|
|
|
371
322
|
}, i;
|
|
372
323
|
function verb(n, f) {
|
|
373
324
|
i[n] = o[n] ? function(v) {
|
|
374
|
-
return (p = !p) ? { value: __await(o[n](v)), done:
|
|
325
|
+
return (p = !p) ? { value: __await(o[n](v)), done: !1 } : f ? f(v) : v;
|
|
375
326
|
} : f;
|
|
376
327
|
}
|
|
377
|
-
__name(verb, "verb");
|
|
378
328
|
}
|
|
379
329
|
function __asyncValues(o) {
|
|
380
330
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
381
331
|
var m = o[Symbol.asyncIterator], i;
|
|
382
|
-
return m ? m.call(o) : (o = typeof __values
|
|
332
|
+
return m ? m.call(o) : (o = typeof __values == "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
|
|
383
333
|
return this;
|
|
384
334
|
}, i);
|
|
385
335
|
function verb(n) {
|
|
@@ -389,52 +339,42 @@ function __asyncValues(o) {
|
|
|
389
339
|
});
|
|
390
340
|
};
|
|
391
341
|
}
|
|
392
|
-
__name(verb, "verb");
|
|
393
342
|
function settle(resolve, reject, d, v) {
|
|
394
343
|
Promise.resolve(v).then(function(v2) {
|
|
395
344
|
resolve({ value: v2, done: d });
|
|
396
345
|
}, reject);
|
|
397
346
|
}
|
|
398
|
-
__name(settle, "settle");
|
|
399
347
|
}
|
|
400
348
|
function __makeTemplateObject(cooked, raw) {
|
|
401
|
-
|
|
402
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
|
403
|
-
} else {
|
|
404
|
-
cooked.raw = raw;
|
|
405
|
-
}
|
|
406
|
-
return cooked;
|
|
349
|
+
return Object.defineProperty ? Object.defineProperty(cooked, "raw", { value: raw }) : cooked.raw = raw, cooked;
|
|
407
350
|
}
|
|
408
351
|
function __importStar(mod) {
|
|
409
352
|
if (mod && mod.__esModule) return mod;
|
|
410
353
|
var result = {};
|
|
411
|
-
if (mod != null)
|
|
412
|
-
|
|
413
|
-
}
|
|
414
|
-
__setModuleDefault(result, mod);
|
|
415
|
-
return result;
|
|
354
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) k[i] !== "default" && __createBinding(result, mod, k[i]);
|
|
355
|
+
return __setModuleDefault(result, mod), result;
|
|
416
356
|
}
|
|
417
357
|
function __importDefault(mod) {
|
|
418
358
|
return mod && mod.__esModule ? mod : { default: mod };
|
|
419
359
|
}
|
|
420
360
|
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
421
361
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
422
|
-
if (typeof state
|
|
362
|
+
if (typeof state == "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
423
363
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
424
364
|
}
|
|
425
365
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
426
366
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
427
367
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
428
|
-
if (typeof state
|
|
368
|
+
if (typeof state == "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
429
369
|
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
430
370
|
}
|
|
431
371
|
function __classPrivateFieldIn(state, receiver) {
|
|
432
|
-
if (receiver === null || typeof receiver
|
|
433
|
-
return typeof state
|
|
372
|
+
if (receiver === null || typeof receiver != "object" && typeof receiver != "function") throw new TypeError("Cannot use 'in' operator on non-object");
|
|
373
|
+
return typeof state == "function" ? receiver === state : state.has(receiver);
|
|
434
374
|
}
|
|
435
375
|
function __addDisposableResource(env, value, async) {
|
|
436
|
-
if (value
|
|
437
|
-
if (typeof value
|
|
376
|
+
if (value != null) {
|
|
377
|
+
if (typeof value != "object" && typeof value != "function") throw new TypeError("Object expected.");
|
|
438
378
|
var dispose, inner;
|
|
439
379
|
if (async) {
|
|
440
380
|
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
@@ -442,140 +382,89 @@ function __addDisposableResource(env, value, async) {
|
|
|
442
382
|
}
|
|
443
383
|
if (dispose === void 0) {
|
|
444
384
|
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
445
|
-
dispose = value[Symbol.dispose];
|
|
446
|
-
if (async) inner = dispose;
|
|
385
|
+
dispose = value[Symbol.dispose], async && (inner = dispose);
|
|
447
386
|
}
|
|
448
|
-
if (typeof dispose
|
|
449
|
-
|
|
387
|
+
if (typeof dispose != "function") throw new TypeError("Object not disposable.");
|
|
388
|
+
inner && (dispose = function() {
|
|
450
389
|
try {
|
|
451
390
|
inner.call(this);
|
|
452
391
|
} catch (e) {
|
|
453
392
|
return Promise.reject(e);
|
|
454
393
|
}
|
|
455
|
-
},
|
|
456
|
-
|
|
457
|
-
} else if (async) {
|
|
458
|
-
env.stack.push({ async: true });
|
|
459
|
-
}
|
|
394
|
+
}), env.stack.push({ value, dispose, async });
|
|
395
|
+
} else async && env.stack.push({ async: !0 });
|
|
460
396
|
return value;
|
|
461
397
|
}
|
|
462
398
|
function __disposeResources(env) {
|
|
463
399
|
function fail(e) {
|
|
464
|
-
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
465
|
-
env.hasError = true;
|
|
400
|
+
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e, env.hasError = !0;
|
|
466
401
|
}
|
|
467
|
-
__name(fail, "fail");
|
|
468
402
|
var r, s = 0;
|
|
469
403
|
function next() {
|
|
470
|
-
|
|
404
|
+
for (; r = env.stack.pop(); )
|
|
471
405
|
try {
|
|
472
406
|
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
473
407
|
if (r.dispose) {
|
|
474
408
|
var result = r.dispose.call(r.value);
|
|
475
409
|
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) {
|
|
476
|
-
fail(e);
|
|
477
|
-
return next();
|
|
410
|
+
return fail(e), next();
|
|
478
411
|
});
|
|
479
412
|
} else s |= 1;
|
|
480
413
|
} catch (e) {
|
|
481
414
|
fail(e);
|
|
482
415
|
}
|
|
483
|
-
}
|
|
484
416
|
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
485
417
|
if (env.hasError) throw env.error;
|
|
486
418
|
}
|
|
487
|
-
__name(next, "next");
|
|
488
419
|
return next();
|
|
489
420
|
}
|
|
490
421
|
function __rewriteRelativeImportExtension(path, preserveJsx) {
|
|
491
|
-
|
|
492
|
-
return
|
|
493
|
-
|
|
494
|
-
});
|
|
495
|
-
}
|
|
496
|
-
return path;
|
|
422
|
+
return typeof path == "string" && /^\.\.?\//.test(path) ? path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
|
|
423
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
|
|
424
|
+
}) : path;
|
|
497
425
|
}
|
|
498
|
-
var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default
|
|
499
|
-
var init_tslib_es6 = __esm({
|
|
426
|
+
var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default, init_tslib_es6 = __esm({
|
|
500
427
|
"../node_modules/tslib/tslib.es6.mjs"() {
|
|
501
|
-
extendStatics =
|
|
502
|
-
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
428
|
+
extendStatics = function(d, b) {
|
|
429
|
+
return extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
503
430
|
d2.__proto__ = b2;
|
|
504
431
|
} || function(d2, b2) {
|
|
505
|
-
for (var p in b2)
|
|
506
|
-
};
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
__assign = /* @__PURE__ */ __name(function() {
|
|
511
|
-
__assign = Object.assign || /* @__PURE__ */ __name(function __assign2(t) {
|
|
432
|
+
for (var p in b2) Object.prototype.hasOwnProperty.call(b2, p) && (d2[p] = b2[p]);
|
|
433
|
+
}, extendStatics(d, b);
|
|
434
|
+
};
|
|
435
|
+
__assign = function() {
|
|
436
|
+
return __assign = Object.assign || function(t) {
|
|
512
437
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
513
438
|
s = arguments[i];
|
|
514
|
-
for (var p in s)
|
|
439
|
+
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
|
|
515
440
|
}
|
|
516
441
|
return t;
|
|
517
|
-
},
|
|
518
|
-
return __assign.apply(this, arguments);
|
|
519
|
-
}, "__assign");
|
|
520
|
-
__name(__rest, "__rest");
|
|
521
|
-
__name(__decorate, "__decorate");
|
|
522
|
-
__name(__param, "__param");
|
|
523
|
-
__name(__esDecorate, "__esDecorate");
|
|
524
|
-
__name(__runInitializers, "__runInitializers");
|
|
525
|
-
__name(__propKey, "__propKey");
|
|
526
|
-
__name(__setFunctionName, "__setFunctionName");
|
|
527
|
-
__name(__metadata, "__metadata");
|
|
528
|
-
__name(__awaiter, "__awaiter");
|
|
529
|
-
__name(__generator, "__generator");
|
|
530
|
-
__createBinding = Object.create ? function(o, m, k, k2) {
|
|
531
|
-
if (k2 === void 0) k2 = k;
|
|
532
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
533
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
534
|
-
desc = { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
535
|
-
return m[k];
|
|
536
|
-
}, "get") };
|
|
537
|
-
}
|
|
538
|
-
Object.defineProperty(o, k2, desc);
|
|
539
|
-
} : function(o, m, k, k2) {
|
|
540
|
-
if (k2 === void 0) k2 = k;
|
|
541
|
-
o[k2] = m[k];
|
|
542
|
-
};
|
|
543
|
-
__name(__exportStar, "__exportStar");
|
|
544
|
-
__name(__values, "__values");
|
|
545
|
-
__name(__read, "__read");
|
|
546
|
-
__name(__spread, "__spread");
|
|
547
|
-
__name(__spreadArrays, "__spreadArrays");
|
|
548
|
-
__name(__spreadArray, "__spreadArray");
|
|
549
|
-
__name(__await, "__await");
|
|
550
|
-
__name(__asyncGenerator, "__asyncGenerator");
|
|
551
|
-
__name(__asyncDelegator, "__asyncDelegator");
|
|
552
|
-
__name(__asyncValues, "__asyncValues");
|
|
553
|
-
__name(__makeTemplateObject, "__makeTemplateObject");
|
|
554
|
-
__setModuleDefault = Object.create ? function(o, v) {
|
|
555
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
556
|
-
} : function(o, v) {
|
|
557
|
-
o["default"] = v;
|
|
442
|
+
}, __assign.apply(this, arguments);
|
|
558
443
|
};
|
|
559
|
-
|
|
560
|
-
|
|
444
|
+
__createBinding = Object.create ? (function(o, m, k, k2) {
|
|
445
|
+
k2 === void 0 && (k2 = k);
|
|
446
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
447
|
+
(!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) && (desc = { enumerable: !0, get: function() {
|
|
448
|
+
return m[k];
|
|
449
|
+
} }), Object.defineProperty(o, k2, desc);
|
|
450
|
+
}) : (function(o, m, k, k2) {
|
|
451
|
+
k2 === void 0 && (k2 = k), o[k2] = m[k];
|
|
452
|
+
});
|
|
453
|
+
__setModuleDefault = Object.create ? (function(o, v) {
|
|
454
|
+
Object.defineProperty(o, "default", { enumerable: !0, value: v });
|
|
455
|
+
}) : function(o, v) {
|
|
456
|
+
o.default = v;
|
|
457
|
+
}, ownKeys = function(o) {
|
|
458
|
+
return ownKeys = Object.getOwnPropertyNames || function(o2) {
|
|
561
459
|
var ar = [];
|
|
562
|
-
for (var k in o2)
|
|
460
|
+
for (var k in o2) Object.prototype.hasOwnProperty.call(o2, k) && (ar[ar.length] = k);
|
|
563
461
|
return ar;
|
|
564
|
-
};
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
__name(__importStar, "__importStar");
|
|
568
|
-
__name(__importDefault, "__importDefault");
|
|
569
|
-
__name(__classPrivateFieldGet, "__classPrivateFieldGet");
|
|
570
|
-
__name(__classPrivateFieldSet, "__classPrivateFieldSet");
|
|
571
|
-
__name(__classPrivateFieldIn, "__classPrivateFieldIn");
|
|
572
|
-
__name(__addDisposableResource, "__addDisposableResource");
|
|
573
|
-
_SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
462
|
+
}, ownKeys(o);
|
|
463
|
+
};
|
|
464
|
+
_SuppressedError = typeof SuppressedError == "function" ? SuppressedError : function(error, suppressed, message) {
|
|
574
465
|
var e = new Error(message);
|
|
575
466
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
576
467
|
};
|
|
577
|
-
__name(__disposeResources, "__disposeResources");
|
|
578
|
-
__name(__rewriteRelativeImportExtension, "__rewriteRelativeImportExtension");
|
|
579
468
|
tslib_es6_default = {
|
|
580
469
|
__extends,
|
|
581
470
|
__assign,
|
|
@@ -617,45 +506,28 @@ var init_tslib_es6 = __esm({
|
|
|
617
506
|
var require_lib = __commonJS({
|
|
618
507
|
"../node_modules/@yarnpkg/esbuild-plugin-pnp/lib/index.js"(exports) {
|
|
619
508
|
"use strict";
|
|
620
|
-
Object.defineProperty(exports, "__esModule", { value:
|
|
509
|
+
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
621
510
|
exports.pnpPlugin = void 0;
|
|
622
|
-
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
623
|
-
var fs = tslib_1.__importStar(__require("fs"));
|
|
624
|
-
var path_1 = tslib_1.__importDefault(__require("path"));
|
|
625
|
-
var matchAll = /()/;
|
|
626
|
-
var defaultExtensions = [`.tsx`, `.ts`, `.jsx`, `.mjs`, `.cjs`, `.js`, `.css`, `.json`];
|
|
511
|
+
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)), fs = tslib_1.__importStar(__require("fs")), path_1 = tslib_1.__importDefault(__require("path")), matchAll = /()/, defaultExtensions = [".tsx", ".ts", ".jsx", ".mjs", ".cjs", ".js", ".css", ".json"];
|
|
627
512
|
function parseExternals(externals) {
|
|
628
513
|
return externals.map((external) => {
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
return { prefix: external.slice(0, wildcardIdx), suffix: external.slice(wildcardIdx + 1) };
|
|
632
|
-
return external;
|
|
514
|
+
let wildcardIdx = external.indexOf("*");
|
|
515
|
+
return wildcardIdx !== -1 ? { prefix: external.slice(0, wildcardIdx), suffix: external.slice(wildcardIdx + 1) } : external;
|
|
633
516
|
});
|
|
634
517
|
}
|
|
635
|
-
__name(parseExternals, "parseExternals");
|
|
636
518
|
function isExternal(path, externals) {
|
|
637
|
-
for (
|
|
638
|
-
if (typeof external
|
|
639
|
-
if (path.length >= external.prefix.length + external.suffix.length && path.startsWith(external.prefix) && path.endsWith(external.suffix))
|
|
640
|
-
return
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
return true;
|
|
645
|
-
if (!external.startsWith(`/`) && !external.startsWith(`./`) && !external.startsWith(`../`) && external !== `.` && external !== `..`) {
|
|
646
|
-
if (path.startsWith(`${external}/`)) {
|
|
647
|
-
return true;
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
return false;
|
|
519
|
+
for (let external of externals)
|
|
520
|
+
if (typeof external == "object") {
|
|
521
|
+
if (path.length >= external.prefix.length + external.suffix.length && path.startsWith(external.prefix) && path.endsWith(external.suffix))
|
|
522
|
+
return !0;
|
|
523
|
+
} else if (path === external || !external.startsWith("/") && !external.startsWith("./") && !external.startsWith("../") && external !== "." && external !== ".." && path.startsWith(`${external}/`))
|
|
524
|
+
return !0;
|
|
525
|
+
return !1;
|
|
653
526
|
}
|
|
654
|
-
__name(isExternal, "isExternal");
|
|
655
527
|
async function defaultOnLoad(args) {
|
|
656
528
|
return {
|
|
657
529
|
contents: await fs.promises.readFile(args.path),
|
|
658
|
-
loader:
|
|
530
|
+
loader: "default",
|
|
659
531
|
// For regular imports in the `file` namespace, resolveDir is the directory the
|
|
660
532
|
// file being resolved lives in. For all other virtual modules, this defaults to
|
|
661
533
|
// empty string: ""
|
|
@@ -664,65 +536,43 @@ var require_lib = __commonJS({
|
|
|
664
536
|
resolveDir: path_1.default.dirname(args.path)
|
|
665
537
|
};
|
|
666
538
|
}
|
|
667
|
-
__name(defaultOnLoad, "defaultOnLoad");
|
|
668
539
|
async function defaultOnResolve(args, { resolvedPath, error, watchFiles }) {
|
|
669
|
-
|
|
670
|
-
let mergeWith;
|
|
540
|
+
let problems = error ? [{ text: error.message }] : [], mergeWith;
|
|
671
541
|
switch (args.kind) {
|
|
672
|
-
case
|
|
673
|
-
case
|
|
674
|
-
case
|
|
675
|
-
{
|
|
676
|
-
mergeWith = { warnings: problems };
|
|
677
|
-
}
|
|
542
|
+
case "require-call":
|
|
543
|
+
case "require-resolve":
|
|
544
|
+
case "dynamic-import":
|
|
545
|
+
mergeWith = { warnings: problems };
|
|
678
546
|
break;
|
|
679
547
|
default:
|
|
680
|
-
{
|
|
681
|
-
mergeWith = { errors: problems };
|
|
682
|
-
}
|
|
548
|
+
mergeWith = { errors: problems };
|
|
683
549
|
break;
|
|
684
550
|
}
|
|
685
|
-
|
|
686
|
-
return { namespace: `pnp`, path: resolvedPath, watchFiles };
|
|
687
|
-
} else {
|
|
688
|
-
return { external: true, ...mergeWith, watchFiles };
|
|
689
|
-
}
|
|
551
|
+
return resolvedPath !== null ? { namespace: "pnp", path: resolvedPath, watchFiles } : { external: !0, ...mergeWith, watchFiles };
|
|
690
552
|
}
|
|
691
|
-
__name(defaultOnResolve, "defaultOnResolve");
|
|
692
553
|
function pnpPlugin2({ baseDir = process.cwd(), extensions = defaultExtensions, filter = matchAll, onResolve = defaultOnResolve, onLoad = defaultOnLoad } = {}) {
|
|
693
554
|
return {
|
|
694
|
-
name:
|
|
555
|
+
name: "@yarnpkg/esbuild-plugin-pnp",
|
|
695
556
|
setup(build2) {
|
|
696
557
|
var _a, _b;
|
|
697
|
-
|
|
698
|
-
if (typeof findPnpApi
|
|
558
|
+
let { findPnpApi } = __require("module");
|
|
559
|
+
if (typeof findPnpApi > "u")
|
|
699
560
|
return;
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
conditionsDefault
|
|
705
|
-
|
|
706
|
-
conditionsDefault.add(platform);
|
|
707
|
-
const conditionsImport = new Set(conditionsDefault);
|
|
708
|
-
conditionsImport.add(`import`);
|
|
709
|
-
const conditionsRequire = new Set(conditionsDefault);
|
|
710
|
-
conditionsRequire.add(`require`);
|
|
711
|
-
build2.onResolve({ filter }, (args) => {
|
|
561
|
+
let externals = parseExternals((_a = build2.initialOptions.external) !== null && _a !== void 0 ? _a : []), platform = (_b = build2.initialOptions.platform) !== null && _b !== void 0 ? _b : "browser", isPlatformNode = platform === "node", conditionsDefault = new Set(build2.initialOptions.conditions);
|
|
562
|
+
conditionsDefault.add("default"), (platform === "browser" || platform === "node") && conditionsDefault.add(platform);
|
|
563
|
+
let conditionsImport = new Set(conditionsDefault);
|
|
564
|
+
conditionsImport.add("import");
|
|
565
|
+
let conditionsRequire = new Set(conditionsDefault);
|
|
566
|
+
conditionsRequire.add("require"), build2.onResolve({ filter }, (args) => {
|
|
712
567
|
var _a2, _b2;
|
|
713
568
|
if (isExternal(args.path, externals))
|
|
714
|
-
return { external:
|
|
569
|
+
return { external: !0 };
|
|
715
570
|
let conditions = conditionsDefault;
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
else if (args.kind === `require-call` || args.kind === `require-resolve`)
|
|
719
|
-
conditions = conditionsRequire;
|
|
720
|
-
const effectiveImporter = args.resolveDir ? `${args.resolveDir}/` : args.importer ? args.importer : `${baseDir}/`;
|
|
721
|
-
const pnpApi = findPnpApi(effectiveImporter);
|
|
571
|
+
args.kind === "dynamic-import" || args.kind === "import-statement" ? conditions = conditionsImport : (args.kind === "require-call" || args.kind === "require-resolve") && (conditions = conditionsRequire);
|
|
572
|
+
let effectiveImporter = args.resolveDir ? `${args.resolveDir}/` : args.importer ? args.importer : `${baseDir}/`, pnpApi = findPnpApi(effectiveImporter);
|
|
722
573
|
if (!pnpApi)
|
|
723
|
-
return
|
|
724
|
-
let path = null;
|
|
725
|
-
let error;
|
|
574
|
+
return;
|
|
575
|
+
let path = null, error;
|
|
726
576
|
try {
|
|
727
577
|
path = pnpApi.resolveRequest(args.path, effectiveImporter, {
|
|
728
578
|
conditions,
|
|
@@ -732,25 +582,19 @@ var require_lib = __commonJS({
|
|
|
732
582
|
} catch (e) {
|
|
733
583
|
error = e;
|
|
734
584
|
}
|
|
735
|
-
|
|
585
|
+
let watchFiles = [pnpApi.resolveRequest("pnpapi", null)];
|
|
736
586
|
if (path) {
|
|
737
|
-
|
|
587
|
+
let locator = pnpApi.findPackageLocator(path);
|
|
738
588
|
if (locator) {
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
watchFiles.push((_b2 = (_a2 = pnpApi.resolveVirtual) === null || _a2 === void 0 ? void 0 : _a2.call(pnpApi, path)) !== null && _b2 !== void 0 ? _b2 : path);
|
|
742
|
-
}
|
|
589
|
+
let info = pnpApi.getPackageInformation(locator);
|
|
590
|
+
info?.linkType === "SOFT" && watchFiles.push((_b2 = (_a2 = pnpApi.resolveVirtual) === null || _a2 === void 0 ? void 0 : _a2.call(pnpApi, path)) !== null && _b2 !== void 0 ? _b2 : path);
|
|
743
591
|
}
|
|
744
592
|
}
|
|
745
593
|
return onResolve(args, { resolvedPath: path, error, watchFiles });
|
|
746
|
-
});
|
|
747
|
-
if (build2.onLoad !== null) {
|
|
748
|
-
build2.onLoad({ filter }, onLoad);
|
|
749
|
-
}
|
|
594
|
+
}), build2.onLoad !== null && build2.onLoad({ filter }, onLoad);
|
|
750
595
|
}
|
|
751
596
|
};
|
|
752
597
|
}
|
|
753
|
-
__name(pnpPlugin2, "pnpPlugin");
|
|
754
598
|
exports.pnpPlugin = pnpPlugin2;
|
|
755
599
|
}
|
|
756
600
|
});
|
|
@@ -759,16 +603,11 @@ var require_lib = __commonJS({
|
|
|
759
603
|
var require_utils = __commonJS({
|
|
760
604
|
"../node_modules/ejs/lib/utils.js"(exports) {
|
|
761
605
|
"use strict";
|
|
762
|
-
var regExpChars = /[|\\{}()[\]^$+*?.]/g
|
|
763
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
764
|
-
var hasOwn = /* @__PURE__ */ __name(function(obj, key) {
|
|
606
|
+
var regExpChars = /[|\\{}()[\]^$+*?.]/g, hasOwnProperty = Object.prototype.hasOwnProperty, hasOwn = function(obj, key) {
|
|
765
607
|
return hasOwnProperty.apply(obj, [key]);
|
|
766
|
-
}
|
|
608
|
+
};
|
|
767
609
|
exports.escapeRegExpChars = function(string) {
|
|
768
|
-
|
|
769
|
-
return "";
|
|
770
|
-
}
|
|
771
|
-
return String(string).replace(regExpChars, "\\$&");
|
|
610
|
+
return string ? String(string).replace(regExpChars, "\\$&") : "";
|
|
772
611
|
};
|
|
773
612
|
var _ENCODE_HTML_RULES = {
|
|
774
613
|
"&": "&",
|
|
@@ -776,12 +615,10 @@ var require_utils = __commonJS({
|
|
|
776
615
|
">": ">",
|
|
777
616
|
'"': """,
|
|
778
617
|
"'": "'"
|
|
779
|
-
};
|
|
780
|
-
var _MATCH_HTML = /[&<>'"]/g;
|
|
618
|
+
}, _MATCH_HTML = /[&<>'"]/g;
|
|
781
619
|
function encode_char(c) {
|
|
782
620
|
return _ENCODE_HTML_RULES[c] || c;
|
|
783
621
|
}
|
|
784
|
-
__name(encode_char, "encode_char");
|
|
785
622
|
var escapeFuncStr = `var _ENCODE_HTML_RULES = {
|
|
786
623
|
"&": "&"
|
|
787
624
|
, "<": "<"
|
|
@@ -795,97 +632,68 @@ function encode_char(c) {
|
|
|
795
632
|
};
|
|
796
633
|
`;
|
|
797
634
|
exports.escapeXML = function(markup) {
|
|
798
|
-
return markup ==
|
|
635
|
+
return markup == null ? "" : String(markup).replace(_MATCH_HTML, encode_char);
|
|
799
636
|
};
|
|
800
637
|
function escapeXMLToString() {
|
|
801
|
-
return Function.prototype.toString.call(this) +
|
|
638
|
+
return Function.prototype.toString.call(this) + `;
|
|
639
|
+
` + escapeFuncStr;
|
|
802
640
|
}
|
|
803
|
-
__name(escapeXMLToString, "escapeXMLToString");
|
|
804
641
|
try {
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
} else {
|
|
808
|
-
exports.escapeXML.toString = escapeXMLToString;
|
|
809
|
-
}
|
|
810
|
-
} catch (err) {
|
|
642
|
+
typeof Object.defineProperty == "function" ? Object.defineProperty(exports.escapeXML, "toString", { value: escapeXMLToString }) : exports.escapeXML.toString = escapeXMLToString;
|
|
643
|
+
} catch {
|
|
811
644
|
console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)");
|
|
812
645
|
}
|
|
813
646
|
exports.shallowCopy = function(to, from) {
|
|
814
|
-
from = from || {}
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
if (!hasOwn(from, p)) {
|
|
818
|
-
continue;
|
|
819
|
-
}
|
|
820
|
-
if (p === "__proto__" || p === "constructor") {
|
|
821
|
-
continue;
|
|
822
|
-
}
|
|
823
|
-
to[p] = from[p];
|
|
824
|
-
}
|
|
825
|
-
}
|
|
647
|
+
if (from = from || {}, to != null)
|
|
648
|
+
for (var p in from)
|
|
649
|
+
hasOwn(from, p) && (p === "__proto__" || p === "constructor" || (to[p] = from[p]));
|
|
826
650
|
return to;
|
|
827
651
|
};
|
|
828
652
|
exports.shallowCopyFromList = function(to, from, list) {
|
|
829
|
-
list = list || []
|
|
830
|
-
from = from || {};
|
|
831
|
-
if (to !== null && to !== void 0) {
|
|
653
|
+
if (list = list || [], from = from || {}, to != null)
|
|
832
654
|
for (var i = 0; i < list.length; i++) {
|
|
833
655
|
var p = list[i];
|
|
834
|
-
if (typeof from[p]
|
|
835
|
-
if (!hasOwn(from, p))
|
|
656
|
+
if (typeof from[p] < "u") {
|
|
657
|
+
if (!hasOwn(from, p) || p === "__proto__" || p === "constructor")
|
|
836
658
|
continue;
|
|
837
|
-
}
|
|
838
|
-
if (p === "__proto__" || p === "constructor") {
|
|
839
|
-
continue;
|
|
840
|
-
}
|
|
841
659
|
to[p] = from[p];
|
|
842
660
|
}
|
|
843
661
|
}
|
|
844
|
-
}
|
|
845
662
|
return to;
|
|
846
663
|
};
|
|
847
664
|
exports.cache = {
|
|
848
665
|
_data: {},
|
|
849
|
-
set:
|
|
666
|
+
set: function(key, val) {
|
|
850
667
|
this._data[key] = val;
|
|
851
|
-
},
|
|
852
|
-
get:
|
|
668
|
+
},
|
|
669
|
+
get: function(key) {
|
|
853
670
|
return this._data[key];
|
|
854
|
-
},
|
|
855
|
-
remove:
|
|
671
|
+
},
|
|
672
|
+
remove: function(key) {
|
|
856
673
|
delete this._data[key];
|
|
857
|
-
},
|
|
858
|
-
reset:
|
|
674
|
+
},
|
|
675
|
+
reset: function() {
|
|
859
676
|
this._data = {};
|
|
860
|
-
}
|
|
677
|
+
}
|
|
861
678
|
};
|
|
862
679
|
exports.hyphenToCamel = function(str) {
|
|
863
680
|
return str.replace(/-[a-z]/g, function(match) {
|
|
864
681
|
return match[1].toUpperCase();
|
|
865
682
|
});
|
|
866
683
|
};
|
|
867
|
-
exports.createNullProtoObjWherePossible = function() {
|
|
868
|
-
|
|
869
|
-
return
|
|
870
|
-
|
|
871
|
-
};
|
|
872
|
-
}
|
|
873
|
-
if (!({ __proto__: null } instanceof Object)) {
|
|
874
|
-
return function() {
|
|
875
|
-
return { __proto__: null };
|
|
876
|
-
};
|
|
877
|
-
}
|
|
878
|
-
return function() {
|
|
684
|
+
exports.createNullProtoObjWherePossible = (function() {
|
|
685
|
+
return typeof Object.create == "function" ? function() {
|
|
686
|
+
return /* @__PURE__ */ Object.create(null);
|
|
687
|
+
} : { __proto__: null } instanceof Object ? function() {
|
|
879
688
|
return {};
|
|
689
|
+
} : function() {
|
|
690
|
+
return { __proto__: null };
|
|
880
691
|
};
|
|
881
|
-
}();
|
|
692
|
+
})();
|
|
882
693
|
exports.hasOwnOnlyObject = function(obj) {
|
|
883
694
|
var o = exports.createNullProtoObjWherePossible();
|
|
884
|
-
for (var p in obj)
|
|
885
|
-
|
|
886
|
-
o[p] = obj[p];
|
|
887
|
-
}
|
|
888
|
-
}
|
|
695
|
+
for (var p in obj)
|
|
696
|
+
hasOwn(obj, p) && (o[p] = obj[p]);
|
|
889
697
|
return o;
|
|
890
698
|
};
|
|
891
699
|
}
|
|
@@ -943,18 +751,7 @@ var require_package = __commonJS({
|
|
|
943
751
|
var require_ejs = __commonJS({
|
|
944
752
|
"../node_modules/ejs/lib/ejs.js"(exports) {
|
|
945
753
|
"use strict";
|
|
946
|
-
var fs = __require("fs")
|
|
947
|
-
var path = __require("path");
|
|
948
|
-
var utils = require_utils();
|
|
949
|
-
var scopeOptionWarned = false;
|
|
950
|
-
var _VERSION_STRING = require_package().version;
|
|
951
|
-
var _DEFAULT_OPEN_DELIMITER = "<";
|
|
952
|
-
var _DEFAULT_CLOSE_DELIMITER = ">";
|
|
953
|
-
var _DEFAULT_DELIMITER = "%";
|
|
954
|
-
var _DEFAULT_LOCALS_NAME = "locals";
|
|
955
|
-
var _NAME = "ejs";
|
|
956
|
-
var _REGEX_STRING = "(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)";
|
|
957
|
-
var _OPTS_PASSABLE_WITH_DATA = [
|
|
754
|
+
var fs = __require("fs"), path = __require("path"), utils = require_utils(), scopeOptionWarned = !1, _VERSION_STRING = require_package().version, _DEFAULT_OPEN_DELIMITER = "<", _DEFAULT_CLOSE_DELIMITER = ">", _DEFAULT_DELIMITER = "%", _DEFAULT_LOCALS_NAME = "locals", _NAME = "ejs", _REGEX_STRING = "(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)", _OPTS_PASSABLE_WITH_DATA = [
|
|
958
755
|
"delimiter",
|
|
959
756
|
"scope",
|
|
960
757
|
"context",
|
|
@@ -966,255 +763,113 @@ var require_ejs = __commonJS({
|
|
|
966
763
|
"strict",
|
|
967
764
|
"filename",
|
|
968
765
|
"async"
|
|
969
|
-
]
|
|
970
|
-
var _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat("cache");
|
|
971
|
-
var _BOM = /^\uFEFF/;
|
|
972
|
-
var _JS_IDENTIFIER = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
|
|
766
|
+
], _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat("cache"), _BOM = /^\uFEFF/, _JS_IDENTIFIER = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
|
|
973
767
|
exports.cache = utils.cache;
|
|
974
768
|
exports.fileLoader = fs.readFileSync;
|
|
975
769
|
exports.localsName = _DEFAULT_LOCALS_NAME;
|
|
976
770
|
exports.promiseImpl = new Function("return this;")().Promise;
|
|
977
771
|
exports.resolveInclude = function(name, filename, isDir) {
|
|
978
|
-
var dirname3 = path.dirname;
|
|
979
|
-
|
|
980
|
-
var resolve = path.resolve;
|
|
981
|
-
var includePath = resolve(isDir ? filename : dirname3(filename), name);
|
|
982
|
-
var ext = extname(name);
|
|
983
|
-
if (!ext) {
|
|
984
|
-
includePath += ".ejs";
|
|
985
|
-
}
|
|
986
|
-
return includePath;
|
|
772
|
+
var dirname3 = path.dirname, extname = path.extname, resolve = path.resolve, includePath = resolve(isDir ? filename : dirname3(filename), name), ext = extname(name);
|
|
773
|
+
return ext || (includePath += ".ejs"), includePath;
|
|
987
774
|
};
|
|
988
775
|
function resolvePaths(name, paths) {
|
|
989
776
|
var filePath;
|
|
990
777
|
if (paths.some(function(v) {
|
|
991
|
-
filePath = exports.resolveInclude(name, v,
|
|
992
|
-
|
|
993
|
-
})) {
|
|
778
|
+
return filePath = exports.resolveInclude(name, v, !0), fs.existsSync(filePath);
|
|
779
|
+
}))
|
|
994
780
|
return filePath;
|
|
995
|
-
}
|
|
996
781
|
}
|
|
997
|
-
__name(resolvePaths, "resolvePaths");
|
|
998
782
|
function getIncludePath(path2, options) {
|
|
999
|
-
var includePath;
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
path2 = path2.replace(/^\/*/, "");
|
|
1005
|
-
if (Array.isArray(options.root)) {
|
|
1006
|
-
includePath = resolvePaths(path2, options.root);
|
|
1007
|
-
} else {
|
|
1008
|
-
includePath = exports.resolveInclude(path2, options.root || "/", true);
|
|
1009
|
-
}
|
|
1010
|
-
} else {
|
|
1011
|
-
if (options.filename) {
|
|
1012
|
-
filePath = exports.resolveInclude(path2, options.filename);
|
|
1013
|
-
if (fs.existsSync(filePath)) {
|
|
1014
|
-
includePath = filePath;
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
if (!includePath && Array.isArray(views)) {
|
|
1018
|
-
includePath = resolvePaths(path2, views);
|
|
1019
|
-
}
|
|
1020
|
-
if (!includePath && typeof options.includer !== "function") {
|
|
1021
|
-
throw new Error('Could not find the include file "' + options.escapeFunction(path2) + '"');
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
783
|
+
var includePath, filePath, views = options.views, match = /^[A-Za-z]+:\\|^\//.exec(path2);
|
|
784
|
+
if (match && match.length)
|
|
785
|
+
path2 = path2.replace(/^\/*/, ""), Array.isArray(options.root) ? includePath = resolvePaths(path2, options.root) : includePath = exports.resolveInclude(path2, options.root || "/", !0);
|
|
786
|
+
else if (options.filename && (filePath = exports.resolveInclude(path2, options.filename), fs.existsSync(filePath) && (includePath = filePath)), !includePath && Array.isArray(views) && (includePath = resolvePaths(path2, views)), !includePath && typeof options.includer != "function")
|
|
787
|
+
throw new Error('Could not find the include file "' + options.escapeFunction(path2) + '"');
|
|
1024
788
|
return includePath;
|
|
1025
789
|
}
|
|
1026
|
-
__name(getIncludePath, "getIncludePath");
|
|
1027
790
|
function handleCache(options, template) {
|
|
1028
|
-
var func;
|
|
1029
|
-
var filename = options.filename;
|
|
1030
|
-
var hasTemplate = arguments.length > 1;
|
|
791
|
+
var func, filename = options.filename, hasTemplate = arguments.length > 1;
|
|
1031
792
|
if (options.cache) {
|
|
1032
|
-
if (!filename)
|
|
793
|
+
if (!filename)
|
|
1033
794
|
throw new Error("cache option requires a filename");
|
|
1034
|
-
|
|
1035
|
-
func = exports.cache.get(filename);
|
|
1036
|
-
if (func) {
|
|
795
|
+
if (func = exports.cache.get(filename), func)
|
|
1037
796
|
return func;
|
|
1038
|
-
|
|
1039
|
-
if (!hasTemplate) {
|
|
1040
|
-
template = fileLoader(filename).toString().replace(_BOM, "");
|
|
1041
|
-
}
|
|
797
|
+
hasTemplate || (template = fileLoader(filename).toString().replace(_BOM, ""));
|
|
1042
798
|
} else if (!hasTemplate) {
|
|
1043
|
-
if (!filename)
|
|
799
|
+
if (!filename)
|
|
1044
800
|
throw new Error("Internal EJS error: no file name or template provided");
|
|
1045
|
-
}
|
|
1046
801
|
template = fileLoader(filename).toString().replace(_BOM, "");
|
|
1047
802
|
}
|
|
1048
|
-
func = exports.compile(template, options);
|
|
1049
|
-
if (options.cache) {
|
|
1050
|
-
exports.cache.set(filename, func);
|
|
1051
|
-
}
|
|
1052
|
-
return func;
|
|
803
|
+
return func = exports.compile(template, options), options.cache && exports.cache.set(filename, func), func;
|
|
1053
804
|
}
|
|
1054
|
-
__name(handleCache, "handleCache");
|
|
1055
805
|
function tryHandleCache(options, data, cb) {
|
|
1056
806
|
var result;
|
|
1057
|
-
if (
|
|
1058
|
-
if (typeof exports.promiseImpl == "function") {
|
|
1059
|
-
return new exports.promiseImpl(function(resolve, reject) {
|
|
1060
|
-
try {
|
|
1061
|
-
result = handleCache(options)(data);
|
|
1062
|
-
resolve(result);
|
|
1063
|
-
} catch (err) {
|
|
1064
|
-
reject(err);
|
|
1065
|
-
}
|
|
1066
|
-
});
|
|
1067
|
-
} else {
|
|
1068
|
-
throw new Error("Please provide a callback function");
|
|
1069
|
-
}
|
|
1070
|
-
} else {
|
|
807
|
+
if (cb) {
|
|
1071
808
|
try {
|
|
1072
809
|
result = handleCache(options)(data);
|
|
1073
810
|
} catch (err) {
|
|
1074
811
|
return cb(err);
|
|
1075
812
|
}
|
|
1076
813
|
cb(null, result);
|
|
814
|
+
} else {
|
|
815
|
+
if (typeof exports.promiseImpl == "function")
|
|
816
|
+
return new exports.promiseImpl(function(resolve, reject) {
|
|
817
|
+
try {
|
|
818
|
+
result = handleCache(options)(data), resolve(result);
|
|
819
|
+
} catch (err) {
|
|
820
|
+
reject(err);
|
|
821
|
+
}
|
|
822
|
+
});
|
|
823
|
+
throw new Error("Please provide a callback function");
|
|
1077
824
|
}
|
|
1078
825
|
}
|
|
1079
|
-
__name(tryHandleCache, "tryHandleCache");
|
|
1080
826
|
function fileLoader(filePath) {
|
|
1081
827
|
return exports.fileLoader(filePath);
|
|
1082
828
|
}
|
|
1083
|
-
__name(fileLoader, "fileLoader");
|
|
1084
829
|
function includeFile(path2, options) {
|
|
1085
830
|
var opts = utils.shallowCopy(utils.createNullProtoObjWherePossible(), options);
|
|
1086
|
-
opts.filename = getIncludePath(path2, opts)
|
|
1087
|
-
if (typeof options.includer === "function") {
|
|
831
|
+
if (opts.filename = getIncludePath(path2, opts), typeof options.includer == "function") {
|
|
1088
832
|
var includerResult = options.includer(path2, opts.filename);
|
|
1089
|
-
if (includerResult)
|
|
1090
|
-
|
|
1091
|
-
opts.filename = includerResult.filename;
|
|
1092
|
-
}
|
|
1093
|
-
if (includerResult.template) {
|
|
1094
|
-
return handleCache(opts, includerResult.template);
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
833
|
+
if (includerResult && (includerResult.filename && (opts.filename = includerResult.filename), includerResult.template))
|
|
834
|
+
return handleCache(opts, includerResult.template);
|
|
1097
835
|
}
|
|
1098
836
|
return handleCache(opts);
|
|
1099
837
|
}
|
|
1100
|
-
__name(includeFile, "includeFile");
|
|
1101
838
|
function rethrow(err, str, flnm, lineno, esc) {
|
|
1102
|
-
var lines = str.split(
|
|
1103
|
-
|
|
1104
|
-
var end = Math.min(lines.length, lineno + 3);
|
|
1105
|
-
var filename = esc(flnm);
|
|
1106
|
-
var context = lines.slice(start2, end).map(function(line, i) {
|
|
839
|
+
var lines = str.split(`
|
|
840
|
+
`), start2 = Math.max(lineno - 3, 0), end = Math.min(lines.length, lineno + 3), filename = esc(flnm), context = lines.slice(start2, end).map(function(line, i) {
|
|
1107
841
|
var curr = i + start2 + 1;
|
|
1108
842
|
return (curr == lineno ? " >> " : " ") + curr + "| " + line;
|
|
1109
|
-
}).join(
|
|
1110
|
-
|
|
1111
|
-
err.message = (filename || "ejs") + ":" + lineno +
|
|
1112
|
-
|
|
843
|
+
}).join(`
|
|
844
|
+
`);
|
|
845
|
+
throw err.path = filename, err.message = (filename || "ejs") + ":" + lineno + `
|
|
846
|
+
` + context + `
|
|
847
|
+
|
|
848
|
+
` + err.message, err;
|
|
1113
849
|
}
|
|
1114
|
-
__name(rethrow, "rethrow");
|
|
1115
850
|
function stripSemi(str) {
|
|
1116
851
|
return str.replace(/;(\s*$)/, "$1");
|
|
1117
852
|
}
|
|
1118
|
-
|
|
1119
|
-
exports.compile = /* @__PURE__ */ __name(function compile(template, opts) {
|
|
853
|
+
exports.compile = function(template, opts) {
|
|
1120
854
|
var templ;
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
console.warn("`scope` option is deprecated and will be removed in EJS 3");
|
|
1124
|
-
scopeOptionWarned = true;
|
|
1125
|
-
}
|
|
1126
|
-
if (!opts.context) {
|
|
1127
|
-
opts.context = opts.scope;
|
|
1128
|
-
}
|
|
1129
|
-
delete opts.scope;
|
|
1130
|
-
}
|
|
1131
|
-
templ = new Template(template, opts);
|
|
1132
|
-
return templ.compile();
|
|
1133
|
-
}, "compile");
|
|
855
|
+
return opts && opts.scope && (scopeOptionWarned || (console.warn("`scope` option is deprecated and will be removed in EJS 3"), scopeOptionWarned = !0), opts.context || (opts.context = opts.scope), delete opts.scope), templ = new Template(template, opts), templ.compile();
|
|
856
|
+
};
|
|
1134
857
|
exports.render = function(template, d, o) {
|
|
1135
|
-
var data = d || utils.createNullProtoObjWherePossible();
|
|
1136
|
-
|
|
1137
|
-
if (arguments.length == 2) {
|
|
1138
|
-
utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA);
|
|
1139
|
-
}
|
|
1140
|
-
return handleCache(opts, template)(data);
|
|
858
|
+
var data = d || utils.createNullProtoObjWherePossible(), opts = o || utils.createNullProtoObjWherePossible();
|
|
859
|
+
return arguments.length == 2 && utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA), handleCache(opts, template)(data);
|
|
1141
860
|
};
|
|
1142
861
|
exports.renderFile = function() {
|
|
1143
|
-
var args = Array.prototype.slice.call(arguments);
|
|
1144
|
-
|
|
1145
|
-
var cb;
|
|
1146
|
-
var opts = { filename };
|
|
1147
|
-
var data;
|
|
1148
|
-
var viewOpts;
|
|
1149
|
-
if (typeof arguments[arguments.length - 1] == "function") {
|
|
1150
|
-
cb = args.pop();
|
|
1151
|
-
}
|
|
1152
|
-
if (args.length) {
|
|
1153
|
-
data = args.shift();
|
|
1154
|
-
if (args.length) {
|
|
1155
|
-
utils.shallowCopy(opts, args.pop());
|
|
1156
|
-
} else {
|
|
1157
|
-
if (data.settings) {
|
|
1158
|
-
if (data.settings.views) {
|
|
1159
|
-
opts.views = data.settings.views;
|
|
1160
|
-
}
|
|
1161
|
-
if (data.settings["view cache"]) {
|
|
1162
|
-
opts.cache = true;
|
|
1163
|
-
}
|
|
1164
|
-
viewOpts = data.settings["view options"];
|
|
1165
|
-
if (viewOpts) {
|
|
1166
|
-
utils.shallowCopy(opts, viewOpts);
|
|
1167
|
-
}
|
|
1168
|
-
}
|
|
1169
|
-
utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA_EXPRESS);
|
|
1170
|
-
}
|
|
1171
|
-
opts.filename = filename;
|
|
1172
|
-
} else {
|
|
1173
|
-
data = utils.createNullProtoObjWherePossible();
|
|
1174
|
-
}
|
|
1175
|
-
return tryHandleCache(opts, data, cb);
|
|
862
|
+
var args = Array.prototype.slice.call(arguments), filename = args.shift(), cb, opts = { filename }, data, viewOpts;
|
|
863
|
+
return typeof arguments[arguments.length - 1] == "function" && (cb = args.pop()), args.length ? (data = args.shift(), args.length ? utils.shallowCopy(opts, args.pop()) : (data.settings && (data.settings.views && (opts.views = data.settings.views), data.settings["view cache"] && (opts.cache = !0), viewOpts = data.settings["view options"], viewOpts && utils.shallowCopy(opts, viewOpts)), utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA_EXPRESS)), opts.filename = filename) : data = utils.createNullProtoObjWherePossible(), tryHandleCache(opts, data, cb);
|
|
1176
864
|
};
|
|
1177
865
|
exports.Template = Template;
|
|
1178
866
|
exports.clearCache = function() {
|
|
1179
867
|
exports.cache.reset();
|
|
1180
868
|
};
|
|
1181
869
|
function Template(text, optsParam) {
|
|
1182
|
-
var opts = utils.hasOwnOnlyObject(optsParam);
|
|
1183
|
-
|
|
1184
|
-
this.templateText = text;
|
|
1185
|
-
this.mode = null;
|
|
1186
|
-
this.truncate = false;
|
|
1187
|
-
this.currentLine = 1;
|
|
1188
|
-
this.source = "";
|
|
1189
|
-
options.client = opts.client || false;
|
|
1190
|
-
options.escapeFunction = opts.escape || opts.escapeFunction || utils.escapeXML;
|
|
1191
|
-
options.compileDebug = opts.compileDebug !== false;
|
|
1192
|
-
options.debug = !!opts.debug;
|
|
1193
|
-
options.filename = opts.filename;
|
|
1194
|
-
options.openDelimiter = opts.openDelimiter || exports.openDelimiter || _DEFAULT_OPEN_DELIMITER;
|
|
1195
|
-
options.closeDelimiter = opts.closeDelimiter || exports.closeDelimiter || _DEFAULT_CLOSE_DELIMITER;
|
|
1196
|
-
options.delimiter = opts.delimiter || exports.delimiter || _DEFAULT_DELIMITER;
|
|
1197
|
-
options.strict = opts.strict || false;
|
|
1198
|
-
options.context = opts.context;
|
|
1199
|
-
options.cache = opts.cache || false;
|
|
1200
|
-
options.rmWhitespace = opts.rmWhitespace;
|
|
1201
|
-
options.root = opts.root;
|
|
1202
|
-
options.includer = opts.includer;
|
|
1203
|
-
options.outputFunctionName = opts.outputFunctionName;
|
|
1204
|
-
options.localsName = opts.localsName || exports.localsName || _DEFAULT_LOCALS_NAME;
|
|
1205
|
-
options.views = opts.views;
|
|
1206
|
-
options.async = opts.async;
|
|
1207
|
-
options.destructuredLocals = opts.destructuredLocals;
|
|
1208
|
-
options.legacyInclude = typeof opts.legacyInclude != "undefined" ? !!opts.legacyInclude : true;
|
|
1209
|
-
if (options.strict) {
|
|
1210
|
-
options._with = false;
|
|
1211
|
-
} else {
|
|
1212
|
-
options._with = typeof opts._with != "undefined" ? opts._with : true;
|
|
1213
|
-
}
|
|
1214
|
-
this.opts = options;
|
|
1215
|
-
this.regex = this.createRegex();
|
|
870
|
+
var opts = utils.hasOwnOnlyObject(optsParam), options = utils.createNullProtoObjWherePossible();
|
|
871
|
+
this.templateText = text, this.mode = null, this.truncate = !1, this.currentLine = 1, this.source = "", options.client = opts.client || !1, options.escapeFunction = opts.escape || opts.escapeFunction || utils.escapeXML, options.compileDebug = opts.compileDebug !== !1, options.debug = !!opts.debug, options.filename = opts.filename, options.openDelimiter = opts.openDelimiter || exports.openDelimiter || _DEFAULT_OPEN_DELIMITER, options.closeDelimiter = opts.closeDelimiter || exports.closeDelimiter || _DEFAULT_CLOSE_DELIMITER, options.delimiter = opts.delimiter || exports.delimiter || _DEFAULT_DELIMITER, options.strict = opts.strict || !1, options.context = opts.context, options.cache = opts.cache || !1, options.rmWhitespace = opts.rmWhitespace, options.root = opts.root, options.includer = opts.includer, options.outputFunctionName = opts.outputFunctionName, options.localsName = opts.localsName || exports.localsName || _DEFAULT_LOCALS_NAME, options.views = opts.views, options.async = opts.async, options.destructuredLocals = opts.destructuredLocals, options.legacyInclude = typeof opts.legacyInclude < "u" ? !!opts.legacyInclude : !0, options.strict ? options._with = !1 : options._with = typeof opts._with < "u" ? opts._with : !0, this.opts = options, this.regex = this.createRegex();
|
|
1216
872
|
}
|
|
1217
|
-
__name(Template, "Template");
|
|
1218
873
|
Template.modes = {
|
|
1219
874
|
EVAL: "eval",
|
|
1220
875
|
ESCAPED: "escaped",
|
|
@@ -1223,201 +878,121 @@ var require_ejs = __commonJS({
|
|
|
1223
878
|
LITERAL: "literal"
|
|
1224
879
|
};
|
|
1225
880
|
Template.prototype = {
|
|
1226
|
-
createRegex:
|
|
1227
|
-
var str = _REGEX_STRING;
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
return new RegExp(str);
|
|
1233
|
-
}, "createRegex"),
|
|
1234
|
-
compile: /* @__PURE__ */ __name(function() {
|
|
1235
|
-
var src;
|
|
1236
|
-
var fn;
|
|
1237
|
-
var opts = this.opts;
|
|
1238
|
-
var prepended = "";
|
|
1239
|
-
var appended = "";
|
|
1240
|
-
var escapeFn = opts.escapeFunction;
|
|
1241
|
-
var ctor;
|
|
1242
|
-
var sanitizedFilename = opts.filename ? JSON.stringify(opts.filename) : "undefined";
|
|
881
|
+
createRegex: function() {
|
|
882
|
+
var str = _REGEX_STRING, delim = utils.escapeRegExpChars(this.opts.delimiter), open = utils.escapeRegExpChars(this.opts.openDelimiter), close = utils.escapeRegExpChars(this.opts.closeDelimiter);
|
|
883
|
+
return str = str.replace(/%/g, delim).replace(/</g, open).replace(/>/g, close), new RegExp(str);
|
|
884
|
+
},
|
|
885
|
+
compile: function() {
|
|
886
|
+
var src, fn, opts = this.opts, prepended = "", appended = "", escapeFn = opts.escapeFunction, ctor, sanitizedFilename = opts.filename ? JSON.stringify(opts.filename) : "undefined";
|
|
1243
887
|
if (!this.source) {
|
|
1244
|
-
this.generateSource();
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
if (!_JS_IDENTIFIER.test(opts.outputFunctionName))
|
|
888
|
+
if (this.generateSource(), prepended += ` var __output = "";
|
|
889
|
+
function __append(s) { if (s !== undefined && s !== null) __output += s }
|
|
890
|
+
`, opts.outputFunctionName) {
|
|
891
|
+
if (!_JS_IDENTIFIER.test(opts.outputFunctionName))
|
|
1248
892
|
throw new Error("outputFunctionName is not a valid JS identifier.");
|
|
1249
|
-
|
|
1250
|
-
|
|
893
|
+
prepended += " var " + opts.outputFunctionName + ` = __append;
|
|
894
|
+
`;
|
|
1251
895
|
}
|
|
1252
|
-
if (opts.localsName && !_JS_IDENTIFIER.test(opts.localsName))
|
|
896
|
+
if (opts.localsName && !_JS_IDENTIFIER.test(opts.localsName))
|
|
1253
897
|
throw new Error("localsName is not a valid JS identifier.");
|
|
1254
|
-
}
|
|
1255
898
|
if (opts.destructuredLocals && opts.destructuredLocals.length) {
|
|
1256
|
-
var destructuring = " var __locals = (" + opts.localsName +
|
|
1257
|
-
|
|
899
|
+
for (var destructuring = " var __locals = (" + opts.localsName + ` || {}),
|
|
900
|
+
`, i = 0; i < opts.destructuredLocals.length; i++) {
|
|
1258
901
|
var name = opts.destructuredLocals[i];
|
|
1259
|
-
if (!_JS_IDENTIFIER.test(name))
|
|
902
|
+
if (!_JS_IDENTIFIER.test(name))
|
|
1260
903
|
throw new Error("destructuredLocals[" + i + "] is not a valid JS identifier.");
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
destructuring += ",\n ";
|
|
1264
|
-
}
|
|
1265
|
-
destructuring += name + " = __locals." + name;
|
|
904
|
+
i > 0 && (destructuring += `,
|
|
905
|
+
`), destructuring += name + " = __locals." + name;
|
|
1266
906
|
}
|
|
1267
|
-
prepended += destructuring +
|
|
1268
|
-
|
|
1269
|
-
if (opts._with !== false) {
|
|
1270
|
-
prepended += " with (" + opts.localsName + " || {}) {\n";
|
|
1271
|
-
appended += " }\n";
|
|
1272
|
-
}
|
|
1273
|
-
appended += " return __output;\n";
|
|
1274
|
-
this.source = prepended + this.source + appended;
|
|
1275
|
-
}
|
|
1276
|
-
if (opts.compileDebug) {
|
|
1277
|
-
src = "var __line = 1\n , __lines = " + JSON.stringify(this.templateText) + "\n , __filename = " + sanitizedFilename + ";\ntry {\n" + this.source + "} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n";
|
|
1278
|
-
} else {
|
|
1279
|
-
src = this.source;
|
|
1280
|
-
}
|
|
1281
|
-
if (opts.client) {
|
|
1282
|
-
src = "escapeFn = escapeFn || " + escapeFn.toString() + ";\n" + src;
|
|
1283
|
-
if (opts.compileDebug) {
|
|
1284
|
-
src = "rethrow = rethrow || " + rethrow.toString() + ";\n" + src;
|
|
907
|
+
prepended += destructuring + `;
|
|
908
|
+
`;
|
|
1285
909
|
}
|
|
910
|
+
opts._with !== !1 && (prepended += " with (" + opts.localsName + ` || {}) {
|
|
911
|
+
`, appended += ` }
|
|
912
|
+
`), appended += ` return __output;
|
|
913
|
+
`, this.source = prepended + this.source + appended;
|
|
1286
914
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
915
|
+
opts.compileDebug ? src = `var __line = 1
|
|
916
|
+
, __lines = ` + JSON.stringify(this.templateText) + `
|
|
917
|
+
, __filename = ` + sanitizedFilename + `;
|
|
918
|
+
try {
|
|
919
|
+
` + this.source + `} catch (e) {
|
|
920
|
+
rethrow(e, __lines, __filename, __line, escapeFn);
|
|
921
|
+
}
|
|
922
|
+
` : src = this.source, opts.client && (src = "escapeFn = escapeFn || " + escapeFn.toString() + `;
|
|
923
|
+
` + src, opts.compileDebug && (src = "rethrow = rethrow || " + rethrow.toString() + `;
|
|
924
|
+
` + src)), opts.strict && (src = `"use strict";
|
|
925
|
+
` + src), opts.debug && console.log(src), opts.compileDebug && opts.filename && (src = src + `
|
|
926
|
+
//# sourceURL=` + sanitizedFilename + `
|
|
927
|
+
`);
|
|
1296
928
|
try {
|
|
1297
|
-
if (opts.async)
|
|
929
|
+
if (opts.async)
|
|
1298
930
|
try {
|
|
1299
931
|
ctor = new Function("return (async function(){}).constructor;")();
|
|
1300
932
|
} catch (e) {
|
|
1301
|
-
|
|
1302
|
-
throw new Error("This environment does not support async/await");
|
|
1303
|
-
} else {
|
|
1304
|
-
throw e;
|
|
1305
|
-
}
|
|
933
|
+
throw e instanceof SyntaxError ? new Error("This environment does not support async/await") : e;
|
|
1306
934
|
}
|
|
1307
|
-
|
|
935
|
+
else
|
|
1308
936
|
ctor = Function;
|
|
1309
|
-
}
|
|
1310
937
|
fn = new ctor(opts.localsName + ", escapeFn, include, rethrow", src);
|
|
1311
938
|
} catch (e) {
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
e.message += "If the above error is not helpful, you may want to try EJS-Lint:\n";
|
|
1318
|
-
e.message += "https://github.com/RyanZim/EJS-Lint";
|
|
1319
|
-
if (!opts.async) {
|
|
1320
|
-
e.message += "\n";
|
|
1321
|
-
e.message += "Or, if you meant to create an async function, pass `async: true` as an option.";
|
|
1322
|
-
}
|
|
1323
|
-
}
|
|
1324
|
-
throw e;
|
|
939
|
+
throw e instanceof SyntaxError && (opts.filename && (e.message += " in " + opts.filename), e.message += ` while compiling ejs
|
|
940
|
+
|
|
941
|
+
`, e.message += `If the above error is not helpful, you may want to try EJS-Lint:
|
|
942
|
+
`, e.message += "https://github.com/RyanZim/EJS-Lint", opts.async || (e.message += `
|
|
943
|
+
`, e.message += "Or, if you meant to create an async function, pass `async: true` as an option.")), e;
|
|
1325
944
|
}
|
|
1326
|
-
var returnedFn = opts.client ? fn :
|
|
1327
|
-
var include =
|
|
945
|
+
var returnedFn = opts.client ? fn : function(data) {
|
|
946
|
+
var include = function(path2, includeData) {
|
|
1328
947
|
var d = utils.shallowCopy(utils.createNullProtoObjWherePossible(), data);
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
}
|
|
1332
|
-
return includeFile(path2, opts)(d);
|
|
1333
|
-
}, "include");
|
|
948
|
+
return includeData && (d = utils.shallowCopy(d, includeData)), includeFile(path2, opts)(d);
|
|
949
|
+
};
|
|
1334
950
|
return fn.apply(
|
|
1335
951
|
opts.context,
|
|
1336
952
|
[data || utils.createNullProtoObjWherePossible(), escapeFn, include, rethrow]
|
|
1337
953
|
);
|
|
1338
|
-
}
|
|
1339
|
-
if (opts.filename && typeof Object.defineProperty
|
|
1340
|
-
var filename = opts.filename;
|
|
1341
|
-
var basename2 = path.basename(filename, path.extname(filename));
|
|
954
|
+
};
|
|
955
|
+
if (opts.filename && typeof Object.defineProperty == "function") {
|
|
956
|
+
var filename = opts.filename, basename2 = path.basename(filename, path.extname(filename));
|
|
1342
957
|
try {
|
|
1343
958
|
Object.defineProperty(returnedFn, "name", {
|
|
1344
959
|
value: basename2,
|
|
1345
|
-
writable:
|
|
1346
|
-
enumerable:
|
|
1347
|
-
configurable:
|
|
960
|
+
writable: !1,
|
|
961
|
+
enumerable: !1,
|
|
962
|
+
configurable: !0
|
|
1348
963
|
});
|
|
1349
|
-
} catch
|
|
964
|
+
} catch {
|
|
1350
965
|
}
|
|
1351
966
|
}
|
|
1352
967
|
return returnedFn;
|
|
1353
|
-
},
|
|
1354
|
-
generateSource:
|
|
968
|
+
},
|
|
969
|
+
generateSource: function() {
|
|
1355
970
|
var opts = this.opts;
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
}
|
|
1374
|
-
self.scanLine(line);
|
|
1375
|
-
});
|
|
1376
|
-
}
|
|
1377
|
-
}, "generateSource"),
|
|
1378
|
-
parseTemplateText: /* @__PURE__ */ __name(function() {
|
|
1379
|
-
var str = this.templateText;
|
|
1380
|
-
var pat = this.regex;
|
|
1381
|
-
var result = pat.exec(str);
|
|
1382
|
-
var arr = [];
|
|
1383
|
-
var firstPos;
|
|
1384
|
-
while (result) {
|
|
1385
|
-
firstPos = result.index;
|
|
1386
|
-
if (firstPos !== 0) {
|
|
1387
|
-
arr.push(str.substring(0, firstPos));
|
|
1388
|
-
str = str.slice(firstPos);
|
|
1389
|
-
}
|
|
1390
|
-
arr.push(result[0]);
|
|
1391
|
-
str = str.slice(result[0].length);
|
|
1392
|
-
result = pat.exec(str);
|
|
1393
|
-
}
|
|
1394
|
-
if (str) {
|
|
1395
|
-
arr.push(str);
|
|
1396
|
-
}
|
|
1397
|
-
return arr;
|
|
1398
|
-
}, "parseTemplateText"),
|
|
1399
|
-
_addOutput: /* @__PURE__ */ __name(function(line) {
|
|
1400
|
-
if (this.truncate) {
|
|
1401
|
-
line = line.replace(/^(?:\r\n|\r|\n)/, "");
|
|
1402
|
-
this.truncate = false;
|
|
1403
|
-
}
|
|
1404
|
-
if (!line) {
|
|
971
|
+
opts.rmWhitespace && (this.templateText = this.templateText.replace(/[\r\n]+/g, `
|
|
972
|
+
`).replace(/^\s+|\s+$/gm, "")), this.templateText = this.templateText.replace(/[ \t]*<%_/gm, "<%_").replace(/_%>[ \t]*/gm, "_%>");
|
|
973
|
+
var self = this, matches = this.parseTemplateText(), d = this.opts.delimiter, o = this.opts.openDelimiter, c = this.opts.closeDelimiter;
|
|
974
|
+
matches && matches.length && matches.forEach(function(line, index) {
|
|
975
|
+
var closing;
|
|
976
|
+
if (line.indexOf(o + d) === 0 && line.indexOf(o + d + d) !== 0 && (closing = matches[index + 2], !(closing == d + c || closing == "-" + d + c || closing == "_" + d + c)))
|
|
977
|
+
throw new Error('Could not find matching close tag for "' + line + '".');
|
|
978
|
+
self.scanLine(line);
|
|
979
|
+
});
|
|
980
|
+
},
|
|
981
|
+
parseTemplateText: function() {
|
|
982
|
+
for (var str = this.templateText, pat = this.regex, result = pat.exec(str), arr = [], firstPos; result; )
|
|
983
|
+
firstPos = result.index, firstPos !== 0 && (arr.push(str.substring(0, firstPos)), str = str.slice(firstPos)), arr.push(result[0]), str = str.slice(result[0].length), result = pat.exec(str);
|
|
984
|
+
return str && arr.push(str), arr;
|
|
985
|
+
},
|
|
986
|
+
_addOutput: function(line) {
|
|
987
|
+
if (this.truncate && (line = line.replace(/^(?:\r\n|\r|\n)/, ""), this.truncate = !1), !line)
|
|
1405
988
|
return line;
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
scanLine: /* @__PURE__ */ __name(function(line) {
|
|
1414
|
-
var self = this;
|
|
1415
|
-
var d = this.opts.delimiter;
|
|
1416
|
-
var o = this.opts.openDelimiter;
|
|
1417
|
-
var c = this.opts.closeDelimiter;
|
|
1418
|
-
var newLineCount = 0;
|
|
1419
|
-
newLineCount = line.split("\n").length - 1;
|
|
1420
|
-
switch (line) {
|
|
989
|
+
line = line.replace(/\\/g, "\\\\"), line = line.replace(/\n/g, "\\n"), line = line.replace(/\r/g, "\\r"), line = line.replace(/"/g, '\\"'), this.source += ' ; __append("' + line + `")
|
|
990
|
+
`;
|
|
991
|
+
},
|
|
992
|
+
scanLine: function(line) {
|
|
993
|
+
var self = this, d = this.opts.delimiter, o = this.opts.openDelimiter, c = this.opts.closeDelimiter, newLineCount = 0;
|
|
994
|
+
switch (newLineCount = line.split(`
|
|
995
|
+
`).length - 1, line) {
|
|
1421
996
|
case o + d:
|
|
1422
997
|
case o + d + "_":
|
|
1423
998
|
this.mode = Template.modes.EVAL;
|
|
@@ -1432,21 +1007,17 @@ var require_ejs = __commonJS({
|
|
|
1432
1007
|
this.mode = Template.modes.COMMENT;
|
|
1433
1008
|
break;
|
|
1434
1009
|
case o + d + d:
|
|
1435
|
-
this.mode = Template.modes.LITERAL;
|
|
1436
|
-
|
|
1010
|
+
this.mode = Template.modes.LITERAL, this.source += ' ; __append("' + line.replace(o + d + d, o + d) + `")
|
|
1011
|
+
`;
|
|
1437
1012
|
break;
|
|
1438
1013
|
case d + d + c:
|
|
1439
|
-
this.mode = Template.modes.LITERAL;
|
|
1440
|
-
|
|
1014
|
+
this.mode = Template.modes.LITERAL, this.source += ' ; __append("' + line.replace(d + d + c, d + c) + `")
|
|
1015
|
+
`;
|
|
1441
1016
|
break;
|
|
1442
1017
|
case d + c:
|
|
1443
1018
|
case "-" + d + c:
|
|
1444
1019
|
case "_" + d + c:
|
|
1445
|
-
|
|
1446
|
-
this._addOutput(line);
|
|
1447
|
-
}
|
|
1448
|
-
this.mode = null;
|
|
1449
|
-
this.truncate = line.indexOf("-") === 0 || line.indexOf("_") === 0;
|
|
1020
|
+
this.mode == Template.modes.LITERAL && this._addOutput(line), this.mode = null, this.truncate = line.indexOf("-") === 0 || line.indexOf("_") === 0;
|
|
1450
1021
|
break;
|
|
1451
1022
|
default:
|
|
1452
1023
|
if (this.mode) {
|
|
@@ -1454,22 +1025,25 @@ var require_ejs = __commonJS({
|
|
|
1454
1025
|
case Template.modes.EVAL:
|
|
1455
1026
|
case Template.modes.ESCAPED:
|
|
1456
1027
|
case Template.modes.RAW:
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1028
|
+
line.lastIndexOf("//") > line.lastIndexOf(`
|
|
1029
|
+
`) && (line += `
|
|
1030
|
+
`);
|
|
1460
1031
|
}
|
|
1461
1032
|
switch (this.mode) {
|
|
1462
1033
|
// Just executing code
|
|
1463
1034
|
case Template.modes.EVAL:
|
|
1464
|
-
this.source += " ; " + line +
|
|
1035
|
+
this.source += " ; " + line + `
|
|
1036
|
+
`;
|
|
1465
1037
|
break;
|
|
1466
1038
|
// Exec, esc, and output
|
|
1467
1039
|
case Template.modes.ESCAPED:
|
|
1468
|
-
this.source += " ; __append(escapeFn(" + stripSemi(line) +
|
|
1040
|
+
this.source += " ; __append(escapeFn(" + stripSemi(line) + `))
|
|
1041
|
+
`;
|
|
1469
1042
|
break;
|
|
1470
1043
|
// Exec and output
|
|
1471
1044
|
case Template.modes.RAW:
|
|
1472
|
-
this.source += " ; __append(" + stripSemi(line) +
|
|
1045
|
+
this.source += " ; __append(" + stripSemi(line) + `)
|
|
1046
|
+
`;
|
|
1473
1047
|
break;
|
|
1474
1048
|
case Template.modes.COMMENT:
|
|
1475
1049
|
break;
|
|
@@ -1478,23 +1052,18 @@ var require_ejs = __commonJS({
|
|
|
1478
1052
|
this._addOutput(line);
|
|
1479
1053
|
break;
|
|
1480
1054
|
}
|
|
1481
|
-
} else
|
|
1055
|
+
} else
|
|
1482
1056
|
this._addOutput(line);
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
1485
|
-
if (self.opts.compileDebug && newLineCount) {
|
|
1486
|
-
this.currentLine += newLineCount;
|
|
1487
|
-
this.source += " ; __line = " + this.currentLine + "\n";
|
|
1488
1057
|
}
|
|
1489
|
-
|
|
1058
|
+
self.opts.compileDebug && newLineCount && (this.currentLine += newLineCount, this.source += " ; __line = " + this.currentLine + `
|
|
1059
|
+
`);
|
|
1060
|
+
}
|
|
1490
1061
|
};
|
|
1491
1062
|
exports.escapeXML = utils.escapeXML;
|
|
1492
1063
|
exports.__express = exports.renderFile;
|
|
1493
1064
|
exports.VERSION = _VERSION_STRING;
|
|
1494
1065
|
exports.name = _NAME;
|
|
1495
|
-
|
|
1496
|
-
window.ejs = exports;
|
|
1497
|
-
}
|
|
1066
|
+
typeof window < "u" && (window.ejs = exports);
|
|
1498
1067
|
}
|
|
1499
1068
|
});
|
|
1500
1069
|
|
|
@@ -1504,65 +1073,61 @@ import { stringifyProcessEnvs } from "storybook/internal/common";
|
|
|
1504
1073
|
import { logger } from "storybook/internal/node-logger";
|
|
1505
1074
|
|
|
1506
1075
|
// ../node_modules/@fal-works/esbuild-plugin-global-externals/lib/module-info.js
|
|
1507
|
-
var normalizeModuleInfo =
|
|
1508
|
-
|
|
1076
|
+
var normalizeModuleInfo = (value) => {
|
|
1077
|
+
let {
|
|
1509
1078
|
type = "esm",
|
|
1510
1079
|
varName,
|
|
1511
1080
|
namedExports = null,
|
|
1512
|
-
defaultExport =
|
|
1513
|
-
} = typeof value
|
|
1081
|
+
defaultExport = !0
|
|
1082
|
+
} = typeof value == "string" ? { varName: value } : value;
|
|
1514
1083
|
return { type, varName, namedExports, defaultExport };
|
|
1515
|
-
}
|
|
1084
|
+
};
|
|
1516
1085
|
|
|
1517
1086
|
// ../node_modules/@fal-works/esbuild-plugin-global-externals/lib/on-load.js
|
|
1518
|
-
var createCjsContents =
|
|
1519
|
-
var createEsmContents =
|
|
1520
|
-
|
|
1087
|
+
var createCjsContents = (variableName) => `module.exports = ${variableName};`;
|
|
1088
|
+
var createEsmContents = (variableName, namedExports, defaultExport) => {
|
|
1089
|
+
let codeElements = defaultExport ? [`export default ${variableName};`] : [];
|
|
1521
1090
|
if (namedExports && namedExports.length) {
|
|
1522
|
-
|
|
1523
|
-
codeElements.push(`const { ${exportNames} } = ${variableName};`);
|
|
1524
|
-
codeElements.push(`export { ${exportNames} };`);
|
|
1091
|
+
let exportNames = [...new Set(namedExports)].join(", ");
|
|
1092
|
+
codeElements.push(`const { ${exportNames} } = ${variableName};`), codeElements.push(`export { ${exportNames} };`);
|
|
1525
1093
|
}
|
|
1526
|
-
return codeElements.join(
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1094
|
+
return codeElements.join(`
|
|
1095
|
+
`);
|
|
1096
|
+
}, createContents = (moduleInfo) => {
|
|
1097
|
+
let { type, varName, namedExports, defaultExport } = moduleInfo;
|
|
1530
1098
|
switch (type) {
|
|
1531
1099
|
case "esm":
|
|
1532
1100
|
return createEsmContents(varName, namedExports, defaultExport);
|
|
1533
1101
|
case "cjs":
|
|
1534
1102
|
return createCjsContents(varName);
|
|
1535
1103
|
}
|
|
1536
|
-
}
|
|
1104
|
+
};
|
|
1537
1105
|
|
|
1538
1106
|
// ../node_modules/@fal-works/esbuild-plugin-global-externals/lib/with-reg-exp.js
|
|
1539
|
-
var PLUGIN_NAME = "global-externals"
|
|
1540
|
-
|
|
1541
|
-
const { modulePathFilter, getModuleInfo } = globals;
|
|
1107
|
+
var PLUGIN_NAME = "global-externals", globalExternalsWithRegExp = (globals) => {
|
|
1108
|
+
let { modulePathFilter, getModuleInfo } = globals;
|
|
1542
1109
|
return {
|
|
1543
1110
|
name: PLUGIN_NAME,
|
|
1544
1111
|
setup(build2) {
|
|
1545
1112
|
build2.onResolve({ filter: modulePathFilter }, (args) => ({
|
|
1546
1113
|
path: args.path,
|
|
1547
1114
|
namespace: PLUGIN_NAME
|
|
1548
|
-
}))
|
|
1549
|
-
|
|
1550
|
-
const modulePath = args.path;
|
|
1551
|
-
const moduleInfo = normalizeModuleInfo(getModuleInfo(modulePath));
|
|
1115
|
+
})), build2.onLoad({ filter: /.*/, namespace: PLUGIN_NAME }, (args) => {
|
|
1116
|
+
let modulePath = args.path, moduleInfo = normalizeModuleInfo(getModuleInfo(modulePath));
|
|
1552
1117
|
return { contents: createContents(moduleInfo) };
|
|
1553
1118
|
});
|
|
1554
1119
|
}
|
|
1555
1120
|
};
|
|
1556
|
-
}
|
|
1121
|
+
};
|
|
1557
1122
|
|
|
1558
1123
|
// ../node_modules/@fal-works/esbuild-plugin-global-externals/lib/with-object.js
|
|
1559
|
-
var globalExternals =
|
|
1560
|
-
|
|
1124
|
+
var globalExternals = (globals) => {
|
|
1125
|
+
let normalizedGlobals = {
|
|
1561
1126
|
modulePathFilter: new RegExp(`^(?:${Object.keys(globals).join("|")})$`),
|
|
1562
|
-
getModuleInfo:
|
|
1127
|
+
getModuleInfo: (modulePath) => globals[modulePath]
|
|
1563
1128
|
};
|
|
1564
1129
|
return globalExternalsWithRegExp(normalizedGlobals);
|
|
1565
|
-
}
|
|
1130
|
+
};
|
|
1566
1131
|
|
|
1567
1132
|
// src/builder-manager/index.ts
|
|
1568
1133
|
var import_esbuild_plugin_pnp = __toESM(require_lib(), 1);
|
|
@@ -1897,8 +1462,10 @@ var exports_default = {
|
|
|
1897
1462
|
"experimental_useStatusStore",
|
|
1898
1463
|
"experimental_useTestProviderStore",
|
|
1899
1464
|
"experimental_useUniversalStore",
|
|
1465
|
+
"internal_checklistStore",
|
|
1900
1466
|
"internal_fullStatusStore",
|
|
1901
1467
|
"internal_fullTestProviderStore",
|
|
1468
|
+
"internal_universalChecklistStore",
|
|
1902
1469
|
"internal_universalStatusStore",
|
|
1903
1470
|
"internal_universalTestProviderStore",
|
|
1904
1471
|
"isMacLike",
|
|
@@ -1908,6 +1475,7 @@ var exports_default = {
|
|
|
1908
1475
|
"mockChannel",
|
|
1909
1476
|
"optionOrAltSymbol",
|
|
1910
1477
|
"shortcutMatchesShortcut",
|
|
1478
|
+
"shortcutToAriaKeyshortcuts",
|
|
1911
1479
|
"shortcutToHumanString",
|
|
1912
1480
|
"types",
|
|
1913
1481
|
"useAddonState",
|
|
@@ -2048,14 +1616,17 @@ var exports_default = {
|
|
|
2048
1616
|
"storybook/internal/client-logger": ["deprecate", "logger", "once", "pretty"],
|
|
2049
1617
|
"storybook/internal/components": [
|
|
2050
1618
|
"A",
|
|
1619
|
+
"AbstractToolbar",
|
|
2051
1620
|
"ActionBar",
|
|
2052
1621
|
"AddonPanel",
|
|
2053
1622
|
"Badge",
|
|
2054
1623
|
"Bar",
|
|
2055
1624
|
"Blockquote",
|
|
2056
1625
|
"Button",
|
|
1626
|
+
"Card",
|
|
2057
1627
|
"ClipboardCode",
|
|
2058
1628
|
"Code",
|
|
1629
|
+
"Collapsible",
|
|
2059
1630
|
"DL",
|
|
2060
1631
|
"Div",
|
|
2061
1632
|
"DocumentWrapper",
|
|
@@ -2075,42 +1646,60 @@ var exports_default = {
|
|
|
2075
1646
|
"LI",
|
|
2076
1647
|
"Link",
|
|
2077
1648
|
"ListItem",
|
|
1649
|
+
"Listbox",
|
|
2078
1650
|
"Loader",
|
|
2079
1651
|
"Modal",
|
|
1652
|
+
"ModalDecorator",
|
|
2080
1653
|
"OL",
|
|
2081
1654
|
"P",
|
|
2082
1655
|
"Placeholder",
|
|
1656
|
+
"Popover",
|
|
1657
|
+
"PopoverProvider",
|
|
2083
1658
|
"Pre",
|
|
2084
1659
|
"ProgressSpinner",
|
|
2085
1660
|
"ResetWrapper",
|
|
2086
1661
|
"ScrollArea",
|
|
1662
|
+
"Select",
|
|
2087
1663
|
"Separator",
|
|
2088
1664
|
"Spaced",
|
|
2089
1665
|
"Span",
|
|
1666
|
+
"StatelessTab",
|
|
1667
|
+
"StatelessTabList",
|
|
1668
|
+
"StatelessTabPanel",
|
|
1669
|
+
"StatelessTabsView",
|
|
2090
1670
|
"StorybookIcon",
|
|
2091
1671
|
"StorybookLogo",
|
|
2092
1672
|
"SyntaxHighlighter",
|
|
2093
1673
|
"TT",
|
|
2094
1674
|
"TabBar",
|
|
2095
1675
|
"TabButton",
|
|
1676
|
+
"TabList",
|
|
1677
|
+
"TabPanel",
|
|
2096
1678
|
"TabWrapper",
|
|
2097
1679
|
"Table",
|
|
2098
1680
|
"Tabs",
|
|
2099
1681
|
"TabsState",
|
|
1682
|
+
"TabsView",
|
|
1683
|
+
"ToggleButton",
|
|
1684
|
+
"Toolbar",
|
|
1685
|
+
"Tooltip",
|
|
2100
1686
|
"TooltipLinkList",
|
|
2101
1687
|
"TooltipMessage",
|
|
2102
1688
|
"TooltipNote",
|
|
1689
|
+
"TooltipProvider",
|
|
2103
1690
|
"UL",
|
|
2104
1691
|
"WithTooltip",
|
|
2105
1692
|
"WithTooltipPure",
|
|
2106
1693
|
"Zoom",
|
|
2107
1694
|
"codeCommon",
|
|
2108
1695
|
"components",
|
|
1696
|
+
"convertToReactAriaPlacement",
|
|
2109
1697
|
"createCopyToClipboardFunction",
|
|
2110
1698
|
"getStoryHref",
|
|
2111
1699
|
"interleaveSeparators",
|
|
2112
1700
|
"nameSpaceClassNames",
|
|
2113
1701
|
"resetComponents",
|
|
1702
|
+
"useTabsState",
|
|
2114
1703
|
"withReset"
|
|
2115
1704
|
],
|
|
2116
1705
|
"storybook/internal/core-events": [
|
|
@@ -2197,7 +1786,15 @@ var exports_default = {
|
|
|
2197
1786
|
"stringifyQuery",
|
|
2198
1787
|
"useNavigate"
|
|
2199
1788
|
],
|
|
2200
|
-
"storybook/internal/types": [
|
|
1789
|
+
"storybook/internal/types": [
|
|
1790
|
+
"Addon_TypesEnum",
|
|
1791
|
+
"CoreWebpackCompiler",
|
|
1792
|
+
"Feature",
|
|
1793
|
+
"SupportedBuilder",
|
|
1794
|
+
"SupportedFramework",
|
|
1795
|
+
"SupportedLanguage",
|
|
1796
|
+
"SupportedRenderer"
|
|
1797
|
+
]
|
|
2201
1798
|
};
|
|
2202
1799
|
|
|
2203
1800
|
// src/manager/globals/globals.ts
|
|
@@ -2217,8 +1814,7 @@ var globalsNameReferenceMap = {
|
|
|
2217
1814
|
"storybook/internal/manager-errors": "__STORYBOOK_CORE_EVENTS_MANAGER_ERRORS__",
|
|
2218
1815
|
"storybook/internal/router": "__STORYBOOK_ROUTER__",
|
|
2219
1816
|
"storybook/internal/types": "__STORYBOOK_TYPES__"
|
|
2220
|
-
};
|
|
2221
|
-
var globalPackages = Object.keys(globalsNameReferenceMap);
|
|
1817
|
+
}, globalPackages = Object.keys(globalsNameReferenceMap);
|
|
2222
1818
|
|
|
2223
1819
|
// src/manager/globals/globals-module-info.ts
|
|
2224
1820
|
var duplicatedKeys = [
|
|
@@ -2229,25 +1825,18 @@ var duplicatedKeys = [
|
|
|
2229
1825
|
"storybook/actions",
|
|
2230
1826
|
"storybook/highlight",
|
|
2231
1827
|
"storybook/viewport"
|
|
2232
|
-
]
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
varName: globalsNameReferenceMap[key],
|
|
2245
|
-
namedExports: exports_default[key],
|
|
2246
|
-
defaultExport: true
|
|
2247
|
-
};
|
|
2248
|
-
}
|
|
2249
|
-
return acc;
|
|
2250
|
-
},
|
|
1828
|
+
], globalsModuleInfoMap = globalPackages.reduce(
|
|
1829
|
+
(acc, key) => (acc[key] = {
|
|
1830
|
+
type: "esm",
|
|
1831
|
+
varName: globalsNameReferenceMap[key],
|
|
1832
|
+
namedExports: exports_default[key],
|
|
1833
|
+
defaultExport: !0
|
|
1834
|
+
}, duplicatedKeys.includes(key) && (acc[key.replace("storybook", "storybook/internal")] = {
|
|
1835
|
+
type: "esm",
|
|
1836
|
+
varName: globalsNameReferenceMap[key],
|
|
1837
|
+
namedExports: exports_default[key],
|
|
1838
|
+
defaultExport: !0
|
|
1839
|
+
}), acc),
|
|
2251
1840
|
{}
|
|
2252
1841
|
);
|
|
2253
1842
|
|
|
@@ -2258,17 +1847,12 @@ import { getRefs } from "storybook/internal/common";
|
|
|
2258
1847
|
// src/builder-manager/utils/template.ts
|
|
2259
1848
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
2260
1849
|
import { readFile } from "node:fs/promises";
|
|
2261
|
-
var getTemplatePath =
|
|
2262
|
-
|
|
2263
|
-
}, "getTemplatePath");
|
|
2264
|
-
var readTemplate = /* @__PURE__ */ __name(async (template) => {
|
|
2265
|
-
const path = getTemplatePath(template);
|
|
1850
|
+
var getTemplatePath = (template) => join(resolvePackageDir("storybook"), "assets/server", template), readTemplate = async (template) => {
|
|
1851
|
+
let path = getTemplatePath(template);
|
|
2266
1852
|
return readFile(path, { encoding: "utf8" });
|
|
2267
|
-
}
|
|
2268
|
-
var renderHTML =
|
|
2269
|
-
|
|
2270
|
-
const templateRef = await template;
|
|
2271
|
-
const stringifiedGlobals = Object.entries(globals).reduce(
|
|
1853
|
+
};
|
|
1854
|
+
var renderHTML = async (template, title, favicon, customHead, cssFiles, jsFiles, features, refs, logLevel, docsOptions, tagsOptions, { versionCheck, previewUrl, configType, ignorePreview }, globals) => {
|
|
1855
|
+
let titleRef = await title, templateRef = await template, stringifiedGlobals = Object.entries(globals).reduce(
|
|
2272
1856
|
(transformed, [key, value]) => ({ ...transformed, [key]: JSON.stringify(value) }),
|
|
2273
1857
|
{}
|
|
2274
1858
|
);
|
|
@@ -2292,20 +1876,11 @@ var renderHTML = /* @__PURE__ */ __name(async (template, title, favicon, customH
|
|
|
2292
1876
|
head: await customHead || "",
|
|
2293
1877
|
ignorePreview
|
|
2294
1878
|
});
|
|
2295
|
-
}
|
|
1879
|
+
};
|
|
2296
1880
|
|
|
2297
1881
|
// src/builder-manager/utils/data.ts
|
|
2298
|
-
var getData =
|
|
2299
|
-
|
|
2300
|
-
const favicon = options.presets.apply("favicon").then((p) => basename(p));
|
|
2301
|
-
const features = options.presets.apply("features");
|
|
2302
|
-
const logLevel = options.presets.apply("logLevel");
|
|
2303
|
-
const title = options.presets.apply("title");
|
|
2304
|
-
const docsOptions = options.presets.apply("docs", {});
|
|
2305
|
-
const tagsOptions = options.presets.apply("tags", {});
|
|
2306
|
-
const template = readTemplate("template.ejs");
|
|
2307
|
-
const customHead = options.presets.apply("managerHead");
|
|
2308
|
-
const [instance, config] = await Promise.all([
|
|
1882
|
+
var getData = async (options) => {
|
|
1883
|
+
let refs = getRefs(options), favicon = options.presets.apply("favicon").then((p) => basename(p)), features = options.presets.apply("features"), logLevel = options.presets.apply("logLevel"), title = options.presets.apply("title"), docsOptions = options.presets.apply("docs", {}), tagsOptions = options.presets.apply("tags", {}), template = readTemplate("template.ejs"), customHead = options.presets.apply("managerHead"), [instance, config] = await Promise.all([
|
|
2309
1884
|
//
|
|
2310
1885
|
executor.get(),
|
|
2311
1886
|
getConfig(options)
|
|
@@ -2323,136 +1898,93 @@ var getData = /* @__PURE__ */ __name(async (options) => {
|
|
|
2323
1898
|
favicon,
|
|
2324
1899
|
tagsOptions
|
|
2325
1900
|
};
|
|
2326
|
-
}
|
|
1901
|
+
};
|
|
2327
1902
|
|
|
2328
1903
|
// src/builder-manager/utils/files.ts
|
|
2329
1904
|
import { existsSync } from "node:fs";
|
|
2330
1905
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
2331
1906
|
import { dirname, join as join2, normalize, relative } from "node:path";
|
|
2332
1907
|
async function readOrderedFiles(addonsDir, outputFiles) {
|
|
2333
|
-
|
|
1908
|
+
let files = await Promise.all(
|
|
2334
1909
|
outputFiles?.map(async (file) => {
|
|
2335
|
-
|
|
1910
|
+
let { location, url } = sanitizePath(file, addonsDir);
|
|
2336
1911
|
if (!existsSync(location)) {
|
|
2337
|
-
|
|
2338
|
-
await mkdir(directory, { recursive:
|
|
1912
|
+
let directory = dirname(location);
|
|
1913
|
+
await mkdir(directory, { recursive: !0 });
|
|
2339
1914
|
}
|
|
2340
|
-
await writeFile(location, file.contents);
|
|
2341
|
-
return url;
|
|
1915
|
+
return await writeFile(location, file.contents), url;
|
|
2342
1916
|
}) || []
|
|
2343
|
-
);
|
|
2344
|
-
|
|
2345
|
-
const cssFiles = files.filter((file) => file.endsWith(".css"));
|
|
2346
|
-
return { cssFiles, jsFiles };
|
|
1917
|
+
), jsFiles = files.filter((file) => file.endsWith(".js"));
|
|
1918
|
+
return { cssFiles: files.filter((file) => file.endsWith(".css")), jsFiles };
|
|
2347
1919
|
}
|
|
2348
|
-
__name(readOrderedFiles, "readOrderedFiles");
|
|
2349
1920
|
function sanitizePath(file, addonsDir) {
|
|
2350
|
-
|
|
2351
|
-
const location = normalize(join2(addonsDir, filePath));
|
|
2352
|
-
const url = `./sb-addons/${slash(filePath).split("/").map(encodeURIComponent).join("/")}`;
|
|
1921
|
+
let filePath = relative(addonsDir, file.path), location = normalize(join2(addonsDir, filePath)), url = `./sb-addons/${slash(filePath).split("/").map(encodeURIComponent).join("/")}`;
|
|
2353
1922
|
return { location, url };
|
|
2354
1923
|
}
|
|
2355
|
-
__name(sanitizePath, "sanitizePath");
|
|
2356
1924
|
|
|
2357
1925
|
// src/builder-manager/utils/framework.ts
|
|
2358
1926
|
import { sep } from "node:path";
|
|
2359
|
-
import {
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
var pluckThirdPartyPackageFromPath = /* @__PURE__ */ __name((packagePath) => normalizePath(packagePath).split("node_modules/")[1] ?? packagePath, "pluckThirdPartyPackageFromPath");
|
|
2372
|
-
var buildFrameworkGlobalsFromOptions = /* @__PURE__ */ __name(async (options) => {
|
|
2373
|
-
const globals = {};
|
|
2374
|
-
const { builder: builder2 } = await options.presets.apply("core");
|
|
2375
|
-
const frameworkName = await getFrameworkName(options);
|
|
2376
|
-
const rendererName = await extractProperRendererNameFromFramework(frameworkName);
|
|
2377
|
-
if (rendererName) {
|
|
2378
|
-
globals.STORYBOOK_RENDERER = await extractProperRendererNameFromFramework(frameworkName) ?? void 0;
|
|
2379
|
-
}
|
|
2380
|
-
const resolvedPreviewBuilder = pluckNameFromConfigProperty(builder2);
|
|
2381
|
-
if (resolvedPreviewBuilder) {
|
|
2382
|
-
globals.STORYBOOK_BUILDER = pluckStorybookPackageFromPath(resolvedPreviewBuilder) ?? pluckThirdPartyPackageFromPath(resolvedPreviewBuilder);
|
|
2383
|
-
}
|
|
2384
|
-
const framework = pluckNameFromConfigProperty(await options.presets.apply("framework"));
|
|
2385
|
-
if (framework) {
|
|
2386
|
-
globals.STORYBOOK_FRAMEWORK = framework;
|
|
2387
|
-
}
|
|
2388
|
-
if (options.networkAddress) {
|
|
2389
|
-
globals.STORYBOOK_NETWORK_ADDRESS = options.networkAddress;
|
|
2390
|
-
}
|
|
2391
|
-
return globals;
|
|
2392
|
-
}, "buildFrameworkGlobalsFromOptions");
|
|
1927
|
+
import { extractRenderer, getFrameworkName } from "storybook/internal/common";
|
|
1928
|
+
var pluckNameFromConfigProperty = (property) => {
|
|
1929
|
+
if (property)
|
|
1930
|
+
return typeof property == "string" ? property : property.name;
|
|
1931
|
+
}, normalizePath = (packagePath) => packagePath.replaceAll(sep, "/"), pluckStorybookPackageFromPath = (packagePath) => normalizePath(packagePath).match(/(@storybook\/.*)$/)?.[1], pluckThirdPartyPackageFromPath = (packagePath) => normalizePath(packagePath).split("node_modules/")[1] ?? packagePath, buildFrameworkGlobalsFromOptions = async (options) => {
|
|
1932
|
+
let globals = {}, { builder: builder2 } = await options.presets.apply("core"), frameworkName = await getFrameworkName(options), rendererName = await extractRenderer(frameworkName);
|
|
1933
|
+
rendererName && (globals.STORYBOOK_RENDERER = rendererName ?? void 0);
|
|
1934
|
+
let resolvedPreviewBuilder = pluckNameFromConfigProperty(builder2);
|
|
1935
|
+
resolvedPreviewBuilder && (globals.STORYBOOK_BUILDER = pluckStorybookPackageFromPath(resolvedPreviewBuilder) ?? pluckThirdPartyPackageFromPath(resolvedPreviewBuilder));
|
|
1936
|
+
let framework = pluckNameFromConfigProperty(await options.presets.apply("framework"));
|
|
1937
|
+
return framework && (globals.STORYBOOK_FRAMEWORK = framework), options.networkAddress && (globals.STORYBOOK_NETWORK_ADDRESS = options.networkAddress), globals;
|
|
1938
|
+
};
|
|
2393
1939
|
|
|
2394
1940
|
// src/builder-manager/utils/managerEntries.ts
|
|
2395
1941
|
import { existsSync as existsSync2 } from "node:fs";
|
|
2396
1942
|
import { mkdir as mkdir2, writeFile as writeFile2 } from "node:fs/promises";
|
|
2397
1943
|
import { dirname as dirname2, join as join3, parse as parse2, relative as relative2, sep as sep2 } from "node:path";
|
|
2398
1944
|
import { resolvePathInStorybookCache } from "storybook/internal/common";
|
|
2399
|
-
var sanitizeBase =
|
|
2400
|
-
|
|
2401
|
-
}, "sanitizeBase");
|
|
2402
|
-
var sanitizeFinal = /* @__PURE__ */ __name((path) => {
|
|
2403
|
-
const sections = path.split(/-?node_modules-?/);
|
|
1945
|
+
var sanitizeBase = (path) => path.replaceAll(".", "").replaceAll("@", "").replaceAll(sep2, "-").replaceAll("/", "-").replaceAll(new RegExp(/^(-)+/g), ""), sanitizeFinal = (path) => {
|
|
1946
|
+
let sections = path.split(/-?node_modules-?/);
|
|
2404
1947
|
return sections[sections.length - 1].replaceAll("storybook-addon-", "").replaceAll("dist-", "");
|
|
2405
|
-
}
|
|
1948
|
+
};
|
|
2406
1949
|
async function wrapManagerEntries(entrypoints, uniqueId) {
|
|
2407
1950
|
return Promise.all(
|
|
2408
1951
|
entrypoints.map(async (entry, i) => {
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
if (!cacheLocation) {
|
|
1952
|
+
let { name, dir } = parse2(entry), cacheLocation = resolvePathInStorybookCache("sb-manager", uniqueId);
|
|
1953
|
+
if (!cacheLocation)
|
|
2412
1954
|
throw new Error("Could not create/find cache directory");
|
|
2413
|
-
|
|
2414
|
-
const base = relative2(process.cwd(), dir);
|
|
2415
|
-
const location = join3(
|
|
1955
|
+
let base = relative2(process.cwd(), dir), location = join3(
|
|
2416
1956
|
cacheLocation,
|
|
2417
1957
|
sanitizeFinal(join3(`${sanitizeBase(base)}-${i}`, `${sanitizeBase(name)}-bundle.js`))
|
|
2418
1958
|
);
|
|
2419
1959
|
if (!existsSync2(location)) {
|
|
2420
|
-
|
|
2421
|
-
await mkdir2(directory, { recursive:
|
|
1960
|
+
let directory = dirname2(location);
|
|
1961
|
+
await mkdir2(directory, { recursive: !0 });
|
|
2422
1962
|
}
|
|
2423
|
-
await writeFile2(location, `import '${slash(entry).replaceAll(/'/g, "\\'")}';`);
|
|
2424
|
-
return location;
|
|
1963
|
+
return await writeFile2(location, `import '${slash(entry).replaceAll(/'/g, "\\'")}';`), location;
|
|
2425
1964
|
})
|
|
2426
1965
|
);
|
|
2427
1966
|
}
|
|
2428
|
-
__name(wrapManagerEntries, "wrapManagerEntries");
|
|
2429
1967
|
|
|
2430
1968
|
// src/builder-manager/index.ts
|
|
2431
|
-
var CORE_DIR_ORIGIN = join(resolvePackageDir("storybook"), "dist/manager")
|
|
2432
|
-
|
|
2433
|
-
var compilation;
|
|
2434
|
-
var asyncIterator;
|
|
2435
|
-
var getConfig = /* @__PURE__ */ __name(async (options) => {
|
|
2436
|
-
const [managerEntriesFromPresets, envs] = await Promise.all([
|
|
1969
|
+
var CORE_DIR_ORIGIN = join(resolvePackageDir("storybook"), "dist/manager"), isRootPath = /^\/($|\?)/, compilation, asyncIterator, getConfig = async (options) => {
|
|
1970
|
+
let [managerEntriesFromPresets, envs] = await Promise.all([
|
|
2437
1971
|
options.presets.apply("managerEntries", []),
|
|
2438
1972
|
options.presets.apply("env")
|
|
2439
|
-
]);
|
|
2440
|
-
const tsconfigPath = getTemplatePath("addon.tsconfig.json");
|
|
2441
|
-
let configDirManagerEntry;
|
|
1973
|
+
]), tsconfigPath = getTemplatePath("addon.tsconfig.json"), configDirManagerEntry;
|
|
2442
1974
|
try {
|
|
2443
1975
|
configDirManagerEntry = resolveModulePath("./manager", {
|
|
2444
1976
|
from: options.configDir,
|
|
2445
1977
|
extensions: [".js", ".mjs", ".jsx", ".ts", ".mts", ".tsx"]
|
|
2446
1978
|
});
|
|
2447
|
-
} catch
|
|
1979
|
+
} catch {
|
|
2448
1980
|
}
|
|
2449
|
-
|
|
1981
|
+
let entryPoints = configDirManagerEntry ? [...managerEntriesFromPresets, configDirManagerEntry] : managerEntriesFromPresets;
|
|
2450
1982
|
return {
|
|
2451
1983
|
entryPoints: await wrapManagerEntries(entryPoints, options.cacheKey),
|
|
2452
1984
|
outdir: join(options.outputDir || "./", "sb-addons"),
|
|
2453
1985
|
format: "iife",
|
|
2454
|
-
write:
|
|
2455
|
-
ignoreAnnotations:
|
|
1986
|
+
write: !1,
|
|
1987
|
+
ignoreAnnotations: !0,
|
|
2456
1988
|
resolveExtensions: [".ts", ".tsx", ".mjs", ".js", ".jsx"],
|
|
2457
1989
|
outExtension: { ".js": ".js" },
|
|
2458
1990
|
loader: {
|
|
@@ -2476,15 +2008,15 @@ var getConfig = /* @__PURE__ */ __name(async (options) => {
|
|
|
2476
2008
|
target: BROWSER_TARGETS,
|
|
2477
2009
|
supported: SUPPORTED_FEATURES,
|
|
2478
2010
|
platform: "browser",
|
|
2479
|
-
bundle:
|
|
2480
|
-
minify:
|
|
2481
|
-
minifyWhitespace:
|
|
2482
|
-
minifyIdentifiers:
|
|
2483
|
-
minifySyntax:
|
|
2484
|
-
metafile:
|
|
2011
|
+
bundle: !0,
|
|
2012
|
+
minify: !1,
|
|
2013
|
+
minifyWhitespace: !1,
|
|
2014
|
+
minifyIdentifiers: !1,
|
|
2015
|
+
minifySyntax: !0,
|
|
2016
|
+
metafile: !1,
|
|
2485
2017
|
// turn this on to assist with debugging the bundling of managerEntries
|
|
2486
2018
|
// treeShaking: true,
|
|
2487
|
-
sourcemap:
|
|
2019
|
+
sourcemap: !1,
|
|
2488
2020
|
conditions: ["browser", "module", "default"],
|
|
2489
2021
|
jsxFactory: "React.createElement",
|
|
2490
2022
|
jsxFragment: "React.Fragment",
|
|
@@ -2506,22 +2038,18 @@ var getConfig = /* @__PURE__ */ __name(async (options) => {
|
|
|
2506
2038
|
module: "{}"
|
|
2507
2039
|
}
|
|
2508
2040
|
};
|
|
2509
|
-
},
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
const { build: build2 } = await import("esbuild");
|
|
2041
|
+
}, executor = {
|
|
2042
|
+
get: async () => {
|
|
2043
|
+
let { build: build2 } = await import("esbuild");
|
|
2513
2044
|
return build2;
|
|
2514
|
-
}
|
|
2515
|
-
}
|
|
2516
|
-
var starter = /* @__PURE__ */ __name(async function* starterGeneratorFn({
|
|
2045
|
+
}
|
|
2046
|
+
}, starter = async function* ({
|
|
2517
2047
|
startTime,
|
|
2518
2048
|
options,
|
|
2519
2049
|
router
|
|
2520
2050
|
}) {
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
}
|
|
2524
|
-
const {
|
|
2051
|
+
options.quiet || logger.info("Starting...");
|
|
2052
|
+
let {
|
|
2525
2053
|
config,
|
|
2526
2054
|
favicon,
|
|
2527
2055
|
customHead,
|
|
@@ -2535,39 +2063,32 @@ var starter = /* @__PURE__ */ __name(async function* starterGeneratorFn({
|
|
|
2535
2063
|
tagsOptions
|
|
2536
2064
|
} = await getData(options);
|
|
2537
2065
|
yield;
|
|
2538
|
-
|
|
2539
|
-
await rm(addonsDir, { recursive:
|
|
2540
|
-
yield;
|
|
2541
|
-
compilation = await instance({
|
|
2066
|
+
let addonsDir = config.outdir;
|
|
2067
|
+
await rm(addonsDir, { recursive: !0, force: !0 }), yield, compilation = await instance({
|
|
2542
2068
|
...config
|
|
2543
|
-
})
|
|
2544
|
-
yield;
|
|
2545
|
-
router.use(
|
|
2069
|
+
}), yield, router.use(
|
|
2546
2070
|
"/sb-addons",
|
|
2547
2071
|
(0, import_sirv.default)(addonsDir, {
|
|
2548
2072
|
maxAge: 3e5,
|
|
2549
|
-
dev:
|
|
2550
|
-
immutable:
|
|
2073
|
+
dev: !0,
|
|
2074
|
+
immutable: !0
|
|
2551
2075
|
})
|
|
2552
|
-
)
|
|
2553
|
-
router.use(
|
|
2076
|
+
), router.use(
|
|
2554
2077
|
"/sb-manager",
|
|
2555
2078
|
(0, import_sirv.default)(CORE_DIR_ORIGIN, {
|
|
2556
2079
|
maxAge: 3e5,
|
|
2557
|
-
dev:
|
|
2558
|
-
immutable:
|
|
2080
|
+
dev: !0,
|
|
2081
|
+
immutable: !0
|
|
2559
2082
|
})
|
|
2560
2083
|
);
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
}
|
|
2568
|
-
const globals = await buildFrameworkGlobalsFromOptions(options);
|
|
2084
|
+
let { cssFiles, jsFiles } = await readOrderedFiles(addonsDir, compilation?.outputFiles);
|
|
2085
|
+
compilation.metafile && options.outputDir && await writeFile3(
|
|
2086
|
+
join(options.outputDir, "metafile.json"),
|
|
2087
|
+
JSON.stringify(compilation.metafile, null, 2)
|
|
2088
|
+
);
|
|
2089
|
+
let globals = await buildFrameworkGlobalsFromOptions(options);
|
|
2569
2090
|
yield;
|
|
2570
|
-
|
|
2091
|
+
let html = await renderHTML(
|
|
2571
2092
|
template,
|
|
2572
2093
|
title,
|
|
2573
2094
|
favicon,
|
|
@@ -2582,37 +2103,22 @@ var starter = /* @__PURE__ */ __name(async function* starterGeneratorFn({
|
|
|
2582
2103
|
options,
|
|
2583
2104
|
globals
|
|
2584
2105
|
);
|
|
2585
|
-
yield
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
res.write(html);
|
|
2591
|
-
res.end();
|
|
2592
|
-
} else {
|
|
2593
|
-
next();
|
|
2594
|
-
}
|
|
2595
|
-
});
|
|
2596
|
-
router.use(`/index.html`, (req, res) => {
|
|
2597
|
-
res.statusCode = 200;
|
|
2598
|
-
res.setHeader("Content-Type", "text/html");
|
|
2599
|
-
res.write(html);
|
|
2600
|
-
res.end();
|
|
2601
|
-
});
|
|
2602
|
-
return {
|
|
2106
|
+
return yield, router.use("/", ({ url }, res, next) => {
|
|
2107
|
+
url && isRootPath.test(url) ? (res.statusCode = 200, res.setHeader("Content-Type", "text/html"), res.write(html), res.end()) : next();
|
|
2108
|
+
}), router.use("/index.html", (req, res) => {
|
|
2109
|
+
res.statusCode = 200, res.setHeader("Content-Type", "text/html"), res.write(html), res.end();
|
|
2110
|
+
}), {
|
|
2603
2111
|
bail,
|
|
2604
2112
|
stats: {
|
|
2605
|
-
toJson:
|
|
2113
|
+
toJson: () => ({})
|
|
2606
2114
|
},
|
|
2607
2115
|
totalTime: process.hrtime(startTime)
|
|
2608
2116
|
};
|
|
2609
|
-
},
|
|
2610
|
-
|
|
2611
|
-
if (!options.outputDir) {
|
|
2117
|
+
}, builder = async function* ({ startTime, options }) {
|
|
2118
|
+
if (!options.outputDir)
|
|
2612
2119
|
throw new Error("outputDir is required");
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
const {
|
|
2120
|
+
logger.step("Building manager..");
|
|
2121
|
+
let {
|
|
2616
2122
|
config,
|
|
2617
2123
|
customHead,
|
|
2618
2124
|
favicon,
|
|
@@ -2626,27 +2132,20 @@ var builder = /* @__PURE__ */ __name(async function* builderGeneratorFn({ startT
|
|
|
2626
2132
|
tagsOptions
|
|
2627
2133
|
} = await getData(options);
|
|
2628
2134
|
yield;
|
|
2629
|
-
|
|
2630
|
-
const coreDirTarget = join(options.outputDir, `sb-manager`);
|
|
2135
|
+
let addonsDir = config.outdir, coreDirTarget = join(options.outputDir, "sb-manager");
|
|
2631
2136
|
compilation = await instance({
|
|
2632
2137
|
...config,
|
|
2633
|
-
minify:
|
|
2634
|
-
});
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
return true;
|
|
2643
|
-
}, "filter"),
|
|
2644
|
-
recursive: true
|
|
2645
|
-
});
|
|
2646
|
-
const { cssFiles, jsFiles } = await readOrderedFiles(addonsDir, compilation?.outputFiles);
|
|
2647
|
-
const globals = await buildFrameworkGlobalsFromOptions(options);
|
|
2138
|
+
minify: !0
|
|
2139
|
+
}), yield;
|
|
2140
|
+
let managerFiles = cp(CORE_DIR_ORIGIN, coreDirTarget, {
|
|
2141
|
+
filter: (src) => {
|
|
2142
|
+
let { ext } = parse(src);
|
|
2143
|
+
return ext ? ext === ".js" : !0;
|
|
2144
|
+
},
|
|
2145
|
+
recursive: !0
|
|
2146
|
+
}), { cssFiles, jsFiles } = await readOrderedFiles(addonsDir, compilation?.outputFiles), globals = await buildFrameworkGlobalsFromOptions(options);
|
|
2648
2147
|
yield;
|
|
2649
|
-
|
|
2148
|
+
let html = await renderHTML(
|
|
2650
2149
|
template,
|
|
2651
2150
|
title,
|
|
2652
2151
|
favicon,
|
|
@@ -2661,38 +2160,30 @@ var builder = /* @__PURE__ */ __name(async function* builderGeneratorFn({ startT
|
|
|
2661
2160
|
options,
|
|
2662
2161
|
globals
|
|
2663
2162
|
);
|
|
2664
|
-
await Promise.all([writeFile3(join(options.outputDir, "index.html"), html), managerFiles])
|
|
2665
|
-
|
|
2666
|
-
return {
|
|
2667
|
-
toJson: /* @__PURE__ */ __name(() => ({}), "toJson")
|
|
2163
|
+
return await Promise.all([writeFile3(join(options.outputDir, "index.html"), html), managerFiles]), logger.trace({ message: "Manager built", time: process.hrtime(startTime) }), {
|
|
2164
|
+
toJson: () => ({})
|
|
2668
2165
|
};
|
|
2669
|
-
},
|
|
2670
|
-
|
|
2671
|
-
if (asyncIterator) {
|
|
2166
|
+
}, bail = async () => {
|
|
2167
|
+
if (asyncIterator)
|
|
2672
2168
|
try {
|
|
2673
2169
|
await asyncIterator.throw(new Error());
|
|
2674
|
-
} catch
|
|
2170
|
+
} catch {
|
|
2675
2171
|
}
|
|
2676
|
-
|
|
2677
|
-
}, "bail");
|
|
2678
|
-
var start = /* @__PURE__ */ __name(async (options) => {
|
|
2172
|
+
}, start = async (options) => {
|
|
2679
2173
|
asyncIterator = starter(options);
|
|
2680
2174
|
let result;
|
|
2681
|
-
do
|
|
2175
|
+
do
|
|
2682
2176
|
result = await asyncIterator.next();
|
|
2683
|
-
|
|
2177
|
+
while (!result.done);
|
|
2684
2178
|
return result.value;
|
|
2685
|
-
},
|
|
2686
|
-
var build = /* @__PURE__ */ __name(async (options) => {
|
|
2179
|
+
}, build = async (options) => {
|
|
2687
2180
|
asyncIterator = builder(options);
|
|
2688
2181
|
let result;
|
|
2689
|
-
do
|
|
2182
|
+
do
|
|
2690
2183
|
result = await asyncIterator.next();
|
|
2691
|
-
|
|
2184
|
+
while (!result.done);
|
|
2692
2185
|
return result.value;
|
|
2693
|
-
},
|
|
2694
|
-
var corePresets = [];
|
|
2695
|
-
var overridePresets = [];
|
|
2186
|
+
}, corePresets = [], overridePresets = [];
|
|
2696
2187
|
export {
|
|
2697
2188
|
BROWSER_TARGETS,
|
|
2698
2189
|
NODE_TARGET,
|