storybook 9.1.12 → 9.1.14
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/babel/index.cjs +22495 -21246
- package/dist/babel/index.d.ts +672 -336
- package/dist/babel/index.js +22534 -21285
- package/dist/bin/index.cjs +42 -43
- package/dist/bin/index.js +42 -43
- package/dist/cli/bin/index.cjs +1 -1
- package/dist/cli/bin/index.js +1 -1
- package/dist/cli/index.cjs +27120 -25868
- package/dist/cli/index.js +27267 -26015
- package/dist/common/index.cjs +42 -43
- package/dist/common/index.d.ts +0 -1
- package/dist/common/index.js +42 -43
- package/dist/components/index.cjs +4464 -4353
- package/dist/components/index.js +3290 -3181
- package/dist/core-server/index.cjs +7388 -7318
- package/dist/core-server/index.js +7597 -7529
- package/dist/core-server/presets/common-preset.cjs +20127 -19935
- package/dist/core-server/presets/common-preset.js +20203 -20011
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.cjs +306 -518
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +302 -525
- package/dist/csf-tools/index.cjs +150 -144
- package/dist/csf-tools/index.js +401 -395
- package/dist/manager/globals-runtime.js +16578 -16469
- package/dist/manager-api/index.cjs +1 -1
- package/dist/manager-api/index.js +1 -1
- package/dist/node-logger/index.cjs +71 -71
- package/dist/node-logger/index.js +71 -71
- package/dist/preview/runtime.js +240 -240
- package/dist/telemetry/index.cjs +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/test/index.cjs +267 -267
- package/dist/test/index.js +240 -240
- package/package.json +1 -1
|
@@ -1,308 +1,93 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var xt = (u, t) => () => (t || u((t = { exports: {} }).exports, t), t.exports), kt = (u, t) => {
|
|
2
|
+
var E = Object.defineProperty;
|
|
3
|
+
var K = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var z = Object.getOwnPropertyNames;
|
|
5
|
+
var H = Object.prototype.hasOwnProperty;
|
|
6
|
+
var u = (o, t) => E(o, "name", { value: t, configurable: !0 });
|
|
7
|
+
var V = (o, t) => {
|
|
9
8
|
for (var e in t)
|
|
10
|
-
|
|
11
|
-
},
|
|
9
|
+
E(o, e, { get: t[e], enumerable: !0 });
|
|
10
|
+
}, Y = (o, t, e, i) => {
|
|
12
11
|
if (t && typeof t == "object" || typeof t == "function")
|
|
13
|
-
for (let n of
|
|
14
|
-
!
|
|
15
|
-
return
|
|
12
|
+
for (let n of z(t))
|
|
13
|
+
!H.call(o, n) && n !== e && E(o, n, { get: () => t[n], enumerable: !(i = K(t, n)) || i.enumerable });
|
|
14
|
+
return o;
|
|
16
15
|
};
|
|
17
|
-
var
|
|
18
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
-
t || !u || !u.__esModule ? H(e, "default", { value: u, enumerable: !0 }) : e,
|
|
23
|
-
u
|
|
24
|
-
)), It = (u) => lt(H({}, "__esModule", { value: !0 }), u);
|
|
25
|
-
|
|
26
|
-
// ../node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js
|
|
27
|
-
var ht = xt((Q, at) => {
|
|
28
|
-
(function(u, t) {
|
|
29
|
-
typeof Q == "object" && typeof at < "u" ? t(Q) : typeof define == "function" && define.amd ? define(["exports"], t) : (u = typeof globalThis <
|
|
30
|
-
"u" ? globalThis : u || self, t(u.sourcemapCodec = {}));
|
|
31
|
-
})(Q, function(u) {
|
|
32
|
-
"use strict";
|
|
33
|
-
let i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", n = new Uint8Array(64), o = new Uint8Array(128);
|
|
34
|
-
for (let f = 0; f < i.length; f++) {
|
|
35
|
-
let a = i.charCodeAt(f);
|
|
36
|
-
n[f] = a, o[a] = f;
|
|
37
|
-
}
|
|
38
|
-
function r(f, a) {
|
|
39
|
-
let s = 0, h = 0, g = 0;
|
|
40
|
-
do {
|
|
41
|
-
let _ = f.next();
|
|
42
|
-
g = o[_], s |= (g & 31) << h, h += 5;
|
|
43
|
-
} while (g & 32);
|
|
44
|
-
let m = s & 1;
|
|
45
|
-
return s >>>= 1, m && (s = -2147483648 | -s), a + s;
|
|
46
|
-
}
|
|
47
|
-
d(r, "decodeInteger");
|
|
48
|
-
function l(f, a, s) {
|
|
49
|
-
let h = a - s;
|
|
50
|
-
h = h < 0 ? -h << 1 | 1 : h << 1;
|
|
51
|
-
do {
|
|
52
|
-
let g = h & 31;
|
|
53
|
-
h >>>= 5, h > 0 && (g |= 32), f.write(n[g]);
|
|
54
|
-
} while (h > 0);
|
|
55
|
-
return a;
|
|
56
|
-
}
|
|
57
|
-
d(l, "encodeInteger");
|
|
58
|
-
function c(f, a) {
|
|
59
|
-
return f.pos >= a ? !1 : f.peek() !== 44;
|
|
60
|
-
}
|
|
61
|
-
d(c, "hasMoreVlq");
|
|
62
|
-
let p = 1024 * 16, R = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer < "u" ? {
|
|
63
|
-
decode(f) {
|
|
64
|
-
return Buffer.from(f.buffer, f.byteOffset, f.byteLength).toString();
|
|
65
|
-
}
|
|
66
|
-
} : {
|
|
67
|
-
decode(f) {
|
|
68
|
-
let a = "";
|
|
69
|
-
for (let s = 0; s < f.length; s++)
|
|
70
|
-
a += String.fromCharCode(f[s]);
|
|
71
|
-
return a;
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
class D {
|
|
75
|
-
static {
|
|
76
|
-
d(this, "StringWriter");
|
|
77
|
-
}
|
|
78
|
-
constructor() {
|
|
79
|
-
this.pos = 0, this.out = "", this.buffer = new Uint8Array(p);
|
|
80
|
-
}
|
|
81
|
-
write(a) {
|
|
82
|
-
let { buffer: s } = this;
|
|
83
|
-
s[this.pos++] = a, this.pos === p && (this.out += R.decode(s), this.pos = 0);
|
|
84
|
-
}
|
|
85
|
-
flush() {
|
|
86
|
-
let { buffer: a, out: s, pos: h } = this;
|
|
87
|
-
return h > 0 ? s + R.decode(a.subarray(0, h)) : s;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
class W {
|
|
91
|
-
static {
|
|
92
|
-
d(this, "StringReader");
|
|
93
|
-
}
|
|
94
|
-
constructor(a) {
|
|
95
|
-
this.pos = 0, this.buffer = a;
|
|
96
|
-
}
|
|
97
|
-
next() {
|
|
98
|
-
return this.buffer.charCodeAt(this.pos++);
|
|
99
|
-
}
|
|
100
|
-
peek() {
|
|
101
|
-
return this.buffer.charCodeAt(this.pos);
|
|
102
|
-
}
|
|
103
|
-
indexOf(a) {
|
|
104
|
-
let { buffer: s, pos: h } = this, g = s.indexOf(a, h);
|
|
105
|
-
return g === -1 ? s.length : g;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
let it = [];
|
|
109
|
-
function P(f) {
|
|
110
|
-
let { length: a } = f, s = new W(f), h = [], g = [], m = 0;
|
|
111
|
-
for (; s.pos < a; s.pos++) {
|
|
112
|
-
m = r(s, m);
|
|
113
|
-
let _ = r(s, 0);
|
|
114
|
-
if (!c(s, a)) {
|
|
115
|
-
let k = g.pop();
|
|
116
|
-
k[2] = m, k[3] = _;
|
|
117
|
-
continue;
|
|
118
|
-
}
|
|
119
|
-
let b = r(s, 0), w = r(s, 0) & 1 ? [m, _, 0, 0, b, r(s, 0)] : [m, _, 0, 0, b], x = it;
|
|
120
|
-
if (c(s, a)) {
|
|
121
|
-
x = [];
|
|
122
|
-
do {
|
|
123
|
-
let k = r(s, 0);
|
|
124
|
-
x.push(k);
|
|
125
|
-
} while (c(s, a));
|
|
126
|
-
}
|
|
127
|
-
w.vars = x, h.push(w), g.push(w);
|
|
128
|
-
}
|
|
129
|
-
return h;
|
|
130
|
-
}
|
|
131
|
-
d(P, "decodeOriginalScopes");
|
|
132
|
-
function I(f) {
|
|
133
|
-
let a = new D();
|
|
134
|
-
for (let s = 0; s < f.length; )
|
|
135
|
-
s = L(f, s, a, [0]);
|
|
136
|
-
return a.flush();
|
|
137
|
-
}
|
|
138
|
-
d(I, "encodeOriginalScopes");
|
|
139
|
-
function L(f, a, s, h) {
|
|
140
|
-
let g = f[a], { 0: m, 1: _, 2: b, 3: S, 4: C, vars: w } = g;
|
|
141
|
-
a > 0 && s.write(44), h[0] = l(s, m, h[0]), l(s, _, 0), l(s, C, 0);
|
|
142
|
-
let x = g.length === 6 ? 1 : 0;
|
|
143
|
-
l(s, x, 0), g.length === 6 && l(s, g[5], 0);
|
|
144
|
-
for (let k of w)
|
|
145
|
-
l(s, k, 0);
|
|
146
|
-
for (a++; a < f.length; ) {
|
|
147
|
-
let k = f[a], { 0: y, 1: E } = k;
|
|
148
|
-
if (y > b || y === b && E >= S)
|
|
149
|
-
break;
|
|
150
|
-
a = L(f, a, s, h);
|
|
151
|
-
}
|
|
152
|
-
return s.write(44), h[0] = l(s, b, h[0]), l(s, S, 0), a;
|
|
153
|
-
}
|
|
154
|
-
d(L, "_encodeOriginalScopes");
|
|
155
|
-
function j(f) {
|
|
156
|
-
let { length: a } = f, s = new W(f), h = [], g = [], m = 0, _ = 0, b = 0, S = 0, C = 0, w = 0, x = 0, k = 0;
|
|
157
|
-
do {
|
|
158
|
-
let y = s.indexOf(";"), E = 0;
|
|
159
|
-
for (; s.pos < y; s.pos++) {
|
|
160
|
-
if (E = r(s, E), !c(s, y)) {
|
|
161
|
-
let O = g.pop();
|
|
162
|
-
O[2] = m, O[3] = E;
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
|
-
let A = r(s, 0), J = A & 1, G = A & 2, K = A & 4, ot = null, nt = it, M;
|
|
166
|
-
if (J) {
|
|
167
|
-
let O = r(s, _);
|
|
168
|
-
b = r(s, _ === O ? b : 0), _ = O, M = [m, E, 0, 0, O, b];
|
|
169
|
-
} else
|
|
170
|
-
M = [m, E, 0, 0];
|
|
171
|
-
if (M.isScope = !!K, G) {
|
|
172
|
-
let O = S, U = C;
|
|
173
|
-
S = r(s, S);
|
|
174
|
-
let z = O === S;
|
|
175
|
-
C = r(s, z ? C : 0), w = r(s, z && U === C ? w : 0), ot = [S, C, w];
|
|
176
|
-
}
|
|
177
|
-
if (M.callsite = ot, c(s, y)) {
|
|
178
|
-
nt = [];
|
|
179
|
-
do {
|
|
180
|
-
x = m, k = E;
|
|
181
|
-
let O = r(s, 0), U;
|
|
182
|
-
if (O < -1) {
|
|
183
|
-
U = [[r(s, 0)]];
|
|
184
|
-
for (let z = -1; z > O; z--) {
|
|
185
|
-
let yt = x;
|
|
186
|
-
x = r(s, x), k = r(s, x === yt ? k : 0);
|
|
187
|
-
let bt = r(s, 0);
|
|
188
|
-
U.push([bt, x, k]);
|
|
189
|
-
}
|
|
190
|
-
} else
|
|
191
|
-
U = [[O]];
|
|
192
|
-
nt.push(U);
|
|
193
|
-
} while (c(s, y));
|
|
194
|
-
}
|
|
195
|
-
M.bindings = nt, h.push(M), g.push(M);
|
|
196
|
-
}
|
|
197
|
-
m++, s.pos = y + 1;
|
|
198
|
-
} while (s.pos < a);
|
|
199
|
-
return h;
|
|
200
|
-
}
|
|
201
|
-
d(j, "decodeGeneratedRanges");
|
|
202
|
-
function $(f) {
|
|
203
|
-
if (f.length === 0)
|
|
204
|
-
return "";
|
|
205
|
-
let a = new D();
|
|
206
|
-
for (let s = 0; s < f.length; )
|
|
207
|
-
s = T(f, s, a, [0, 0, 0, 0, 0, 0, 0]);
|
|
208
|
-
return a.flush();
|
|
209
|
-
}
|
|
210
|
-
d($, "encodeGeneratedRanges");
|
|
211
|
-
function T(f, a, s, h) {
|
|
212
|
-
let g = f[a], { 0: m, 1: _, 2: b, 3: S, isScope: C, callsite: w, bindings: x } = g;
|
|
213
|
-
h[0] < m ? (v(s, h[0], m), h[0] = m, h[1] = 0) : a > 0 && s.write(44), h[1] = l(s, g[1], h[1]);
|
|
214
|
-
let k = (g.length === 6 ? 1 : 0) | (w ? 2 : 0) | (C ? 4 : 0);
|
|
215
|
-
if (l(s, k, 0), g.length === 6) {
|
|
216
|
-
let { 4: y, 5: E } = g;
|
|
217
|
-
y !== h[2] && (h[3] = 0), h[2] = l(s, y, h[2]), h[3] = l(s, E, h[3]);
|
|
218
|
-
}
|
|
219
|
-
if (w) {
|
|
220
|
-
let { 0: y, 1: E, 2: A } = g.callsite;
|
|
221
|
-
y !== h[4] ? (h[5] = 0, h[6] = 0) : E !== h[5] && (h[6] = 0), h[4] = l(s, y, h[4]), h[5] = l(s, E, h[5]), h[6] = l(s, A, h[6]);
|
|
222
|
-
}
|
|
223
|
-
if (x)
|
|
224
|
-
for (let y of x) {
|
|
225
|
-
y.length > 1 && l(s, -y.length, 0);
|
|
226
|
-
let E = y[0][0];
|
|
227
|
-
l(s, E, 0);
|
|
228
|
-
let A = m, J = _;
|
|
229
|
-
for (let G = 1; G < y.length; G++) {
|
|
230
|
-
let K = y[G];
|
|
231
|
-
A = l(s, K[1], A), J = l(s, K[2], J), l(s, K[0], 0);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
for (a++; a < f.length; ) {
|
|
235
|
-
let y = f[a], { 0: E, 1: A } = y;
|
|
236
|
-
if (E > b || E === b && A >= S)
|
|
237
|
-
break;
|
|
238
|
-
a = T(f, a, s, h);
|
|
239
|
-
}
|
|
240
|
-
return h[0] < b ? (v(s, h[0], b), h[0] = b, h[1] = 0) : s.write(44), h[1] = l(s, S, h[1]), a;
|
|
241
|
-
}
|
|
242
|
-
d(T, "_encodeGeneratedRanges");
|
|
243
|
-
function v(f, a, s) {
|
|
244
|
-
do
|
|
245
|
-
f.write(59);
|
|
246
|
-
while (++a < s);
|
|
247
|
-
}
|
|
248
|
-
d(v, "catchupLine");
|
|
249
|
-
function N(f) {
|
|
250
|
-
let { length: a } = f, s = new W(f), h = [], g = 0, m = 0, _ = 0, b = 0, S = 0;
|
|
251
|
-
do {
|
|
252
|
-
let C = s.indexOf(";"), w = [], x = !0, k = 0;
|
|
253
|
-
for (g = 0; s.pos < C; ) {
|
|
254
|
-
let y;
|
|
255
|
-
g = r(s, g), g < k && (x = !1), k = g, c(s, C) ? (m = r(s, m), _ = r(s, _), b = r(s, b), c(s, C) ? (S = r(s, S), y = [g, m, _, b, S]) :
|
|
256
|
-
y = [g, m, _, b]) : y = [g], w.push(y), s.pos++;
|
|
257
|
-
}
|
|
258
|
-
x || B(w), h.push(w), s.pos = C + 1;
|
|
259
|
-
} while (s.pos <= a);
|
|
260
|
-
return h;
|
|
261
|
-
}
|
|
262
|
-
d(N, "decode");
|
|
263
|
-
function B(f) {
|
|
264
|
-
f.sort(F);
|
|
265
|
-
}
|
|
266
|
-
d(B, "sort");
|
|
267
|
-
function F(f, a) {
|
|
268
|
-
return f[0] - a[0];
|
|
269
|
-
}
|
|
270
|
-
d(F, "sortComparator");
|
|
271
|
-
function mt(f) {
|
|
272
|
-
let a = new D(), s = 0, h = 0, g = 0, m = 0;
|
|
273
|
-
for (let _ = 0; _ < f.length; _++) {
|
|
274
|
-
let b = f[_];
|
|
275
|
-
if (_ > 0 && a.write(59), b.length === 0)
|
|
276
|
-
continue;
|
|
277
|
-
let S = 0;
|
|
278
|
-
for (let C = 0; C < b.length; C++) {
|
|
279
|
-
let w = b[C];
|
|
280
|
-
C > 0 && a.write(44), S = l(a, w[0], S), w.length !== 1 && (s = l(a, w[1], s), h = l(a, w[2], h), g = l(a, w[3], g), w.length !== 4 &&
|
|
281
|
-
(m = l(a, w[4], m)));
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
return a.flush();
|
|
285
|
-
}
|
|
286
|
-
d(mt, "encode"), u.decode = N, u.decodeGeneratedRanges = j, u.decodeOriginalScopes = P, u.encode = mt, u.encodeGeneratedRanges = $, u.encodeOriginalScopes =
|
|
287
|
-
I, Object.defineProperty(u, "__esModule", { value: !0 });
|
|
288
|
-
});
|
|
289
|
-
});
|
|
16
|
+
var J = (o) => Y(E({}, "__esModule", { value: !0 }), o);
|
|
290
17
|
|
|
291
18
|
// src/core-server/presets/webpack/loaders/webpack-automock-loader.ts
|
|
292
|
-
var
|
|
293
|
-
|
|
294
|
-
default: () =>
|
|
19
|
+
var gt = {};
|
|
20
|
+
V(gt, {
|
|
21
|
+
default: () => W
|
|
295
22
|
});
|
|
296
|
-
module.exports =
|
|
23
|
+
module.exports = J(gt);
|
|
24
|
+
|
|
25
|
+
// ../node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
26
|
+
var Q = 44, X = 59, D = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", $ = new Uint8Array(64), Z = new Uint8Array(128);
|
|
27
|
+
for (let o = 0; o < D.length; o++) {
|
|
28
|
+
let t = D.charCodeAt(o);
|
|
29
|
+
$[o] = t, Z[t] = o;
|
|
30
|
+
}
|
|
31
|
+
function w(o, t, e) {
|
|
32
|
+
let i = t - e;
|
|
33
|
+
i = i < 0 ? -i << 1 | 1 : i << 1;
|
|
34
|
+
do {
|
|
35
|
+
let n = i & 31;
|
|
36
|
+
i >>>= 5, i > 0 && (n |= 32), o.write($[n]);
|
|
37
|
+
} while (i > 0);
|
|
38
|
+
return t;
|
|
39
|
+
}
|
|
40
|
+
u(w, "encodeInteger");
|
|
41
|
+
var j = 1024 * 16, M = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer < "u" ? {
|
|
42
|
+
decode(o) {
|
|
43
|
+
return Buffer.from(o.buffer, o.byteOffset, o.byteLength).toString();
|
|
44
|
+
}
|
|
45
|
+
} : {
|
|
46
|
+
decode(o) {
|
|
47
|
+
let t = "";
|
|
48
|
+
for (let e = 0; e < o.length; e++)
|
|
49
|
+
t += String.fromCharCode(o[e]);
|
|
50
|
+
return t;
|
|
51
|
+
}
|
|
52
|
+
}, tt = class {
|
|
53
|
+
static {
|
|
54
|
+
u(this, "StringWriter");
|
|
55
|
+
}
|
|
56
|
+
constructor() {
|
|
57
|
+
this.pos = 0, this.out = "", this.buffer = new Uint8Array(j);
|
|
58
|
+
}
|
|
59
|
+
write(o) {
|
|
60
|
+
let { buffer: t } = this;
|
|
61
|
+
t[this.pos++] = o, this.pos === j && (this.out += M.decode(t), this.pos = 0);
|
|
62
|
+
}
|
|
63
|
+
flush() {
|
|
64
|
+
let { buffer: o, out: t, pos: e } = this;
|
|
65
|
+
return e > 0 ? t + M.decode(o.subarray(0, e)) : t;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
function T(o) {
|
|
69
|
+
let t = new tt(), e = 0, i = 0, n = 0, r = 0;
|
|
70
|
+
for (let s = 0; s < o.length; s++) {
|
|
71
|
+
let l = o[s];
|
|
72
|
+
if (s > 0 && t.write(X), l.length === 0) continue;
|
|
73
|
+
let a = 0;
|
|
74
|
+
for (let h = 0; h < l.length; h++) {
|
|
75
|
+
let f = l[h];
|
|
76
|
+
h > 0 && t.write(Q), a = w(t, f[0], a), f.length !== 1 && (e = w(t, f[1], e), i = w(t, f[2], i), n = w(t, f[3], n), f.length !== 4 && (r =
|
|
77
|
+
w(t, f[4], r)));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return t.flush();
|
|
81
|
+
}
|
|
82
|
+
u(T, "encode");
|
|
297
83
|
|
|
298
84
|
// ../node_modules/magic-string/dist/magic-string.es.mjs
|
|
299
|
-
var
|
|
300
|
-
var X = class u {
|
|
85
|
+
var I = class o {
|
|
301
86
|
static {
|
|
302
|
-
|
|
87
|
+
u(this, "BitSet");
|
|
303
88
|
}
|
|
304
89
|
constructor(t) {
|
|
305
|
-
this.bits = t instanceof
|
|
90
|
+
this.bits = t instanceof o ? t.bits.slice() : [];
|
|
306
91
|
}
|
|
307
92
|
add(t) {
|
|
308
93
|
this.bits[t >> 5] |= 1 << (t & 31);
|
|
@@ -310,9 +95,9 @@ var X = class u {
|
|
|
310
95
|
has(t) {
|
|
311
96
|
return !!(this.bits[t >> 5] & 1 << (t & 31));
|
|
312
97
|
}
|
|
313
|
-
},
|
|
98
|
+
}, L = class o {
|
|
314
99
|
static {
|
|
315
|
-
|
|
100
|
+
u(this, "Chunk");
|
|
316
101
|
}
|
|
317
102
|
constructor(t, e, i) {
|
|
318
103
|
this.start = t, this.end = e, this.original = i, this.intro = "", this.outro = "", this.content = i, this.storeName = !1, this.edited = !1,
|
|
@@ -325,7 +110,7 @@ var X = class u {
|
|
|
325
110
|
this.intro = this.intro + t;
|
|
326
111
|
}
|
|
327
112
|
clone() {
|
|
328
|
-
let t = new
|
|
113
|
+
let t = new o(this.start, this.end, this.original);
|
|
329
114
|
return t.intro = this.intro, t.outro = this.outro, t.content = this.content, t.storeName = this.storeName, t.edited = this.edited, t;
|
|
330
115
|
}
|
|
331
116
|
contains(t) {
|
|
@@ -356,9 +141,9 @@ var X = class u {
|
|
|
356
141
|
split(t) {
|
|
357
142
|
let e = t - this.start, i = this.original.slice(0, e), n = this.original.slice(e);
|
|
358
143
|
this.original = i;
|
|
359
|
-
let
|
|
360
|
-
return
|
|
361
|
-
this.next,
|
|
144
|
+
let r = new o(t, this.end, n);
|
|
145
|
+
return r.outro = this.outro, this.outro = "", this.end = t, this.edited ? (r.edit("", !1), this.content = "") : this.content = i, r.next =
|
|
146
|
+
this.next, r.next && (r.next.previous = r), r.previous = this, this.next = r, r;
|
|
362
147
|
}
|
|
363
148
|
toString() {
|
|
364
149
|
return this.intro + this.content + this.outro;
|
|
@@ -383,45 +168,45 @@ var X = class u {
|
|
|
383
168
|
} else if (this.edit("", void 0, !0), this.outro = this.outro.replace(t, ""), this.outro.length) return !0;
|
|
384
169
|
}
|
|
385
170
|
};
|
|
386
|
-
function
|
|
387
|
-
return typeof globalThis < "u" && typeof globalThis.btoa == "function" ? (
|
|
388
|
-
"function" ? (
|
|
171
|
+
function et() {
|
|
172
|
+
return typeof globalThis < "u" && typeof globalThis.btoa == "function" ? (o) => globalThis.btoa(unescape(encodeURIComponent(o))) : typeof Buffer ==
|
|
173
|
+
"function" ? (o) => Buffer.from(o, "utf-8").toString("base64") : () => {
|
|
389
174
|
throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
|
|
390
175
|
};
|
|
391
176
|
}
|
|
392
|
-
|
|
393
|
-
var
|
|
177
|
+
u(et, "getBtoa");
|
|
178
|
+
var it = /* @__PURE__ */ et(), R = class {
|
|
394
179
|
static {
|
|
395
|
-
|
|
180
|
+
u(this, "SourceMap");
|
|
396
181
|
}
|
|
397
182
|
constructor(t) {
|
|
398
183
|
this.version = 3, this.file = t.file, this.sources = t.sources, this.sourcesContent = t.sourcesContent, this.names = t.names, this.mappings =
|
|
399
|
-
(
|
|
400
|
-
|
|
184
|
+
T(t.mappings), typeof t.x_google_ignoreList < "u" && (this.x_google_ignoreList = t.x_google_ignoreList), typeof t.debugId < "u" && (this.
|
|
185
|
+
debugId = t.debugId);
|
|
401
186
|
}
|
|
402
187
|
toString() {
|
|
403
188
|
return JSON.stringify(this);
|
|
404
189
|
}
|
|
405
190
|
toUrl() {
|
|
406
|
-
return "data:application/json;charset=utf-8;base64," +
|
|
191
|
+
return "data:application/json;charset=utf-8;base64," + it(this.toString());
|
|
407
192
|
}
|
|
408
193
|
};
|
|
409
|
-
function
|
|
410
|
-
let t =
|
|
411
|
-
`), e = t.filter((
|
|
194
|
+
function nt(o) {
|
|
195
|
+
let t = o.split(`
|
|
196
|
+
`), e = t.filter((r) => /^\t+/.test(r)), i = t.filter((r) => /^ {2,}/.test(r));
|
|
412
197
|
if (e.length === 0 && i.length === 0)
|
|
413
198
|
return null;
|
|
414
199
|
if (e.length >= i.length)
|
|
415
200
|
return " ";
|
|
416
|
-
let n = i.reduce((
|
|
417
|
-
let l = /^ +/.exec(
|
|
418
|
-
return Math.min(l,
|
|
201
|
+
let n = i.reduce((r, s) => {
|
|
202
|
+
let l = /^ +/.exec(s)[0].length;
|
|
203
|
+
return Math.min(l, r);
|
|
419
204
|
}, 1 / 0);
|
|
420
205
|
return new Array(n + 1).join(" ");
|
|
421
206
|
}
|
|
422
|
-
|
|
423
|
-
function
|
|
424
|
-
let e =
|
|
207
|
+
u(nt, "guessIndent");
|
|
208
|
+
function rt(o, t) {
|
|
209
|
+
let e = o.split(/[/\\]/), i = t.split(/[/\\]/);
|
|
425
210
|
for (e.pop(); e[0] === i[0]; )
|
|
426
211
|
e.shift(), i.shift();
|
|
427
212
|
if (e.length) {
|
|
@@ -430,31 +215,31 @@ function Ot(u, t) {
|
|
|
430
215
|
}
|
|
431
216
|
return e.concat(i).join("/");
|
|
432
217
|
}
|
|
433
|
-
|
|
434
|
-
var
|
|
435
|
-
function
|
|
436
|
-
return
|
|
218
|
+
u(rt, "getRelativePath");
|
|
219
|
+
var st = Object.prototype.toString;
|
|
220
|
+
function ot(o) {
|
|
221
|
+
return st.call(o) === "[object Object]";
|
|
437
222
|
}
|
|
438
|
-
|
|
439
|
-
function
|
|
440
|
-
let t =
|
|
223
|
+
u(ot, "isObject");
|
|
224
|
+
function B(o) {
|
|
225
|
+
let t = o.split(`
|
|
441
226
|
`), e = [];
|
|
442
227
|
for (let i = 0, n = 0; i < t.length; i++)
|
|
443
228
|
e.push(n), n += t[i].length + 1;
|
|
444
|
-
return /* @__PURE__ */
|
|
445
|
-
let
|
|
446
|
-
for (;
|
|
447
|
-
let
|
|
448
|
-
n < e[
|
|
449
|
-
}
|
|
450
|
-
let l =
|
|
451
|
-
return { line: l, column:
|
|
229
|
+
return /* @__PURE__ */ u(function(n) {
|
|
230
|
+
let r = 0, s = e.length;
|
|
231
|
+
for (; r < s; ) {
|
|
232
|
+
let h = r + s >> 1;
|
|
233
|
+
n < e[h] ? s = h : r = h + 1;
|
|
234
|
+
}
|
|
235
|
+
let l = r - 1, a = n - e[l];
|
|
236
|
+
return { line: l, column: a };
|
|
452
237
|
}, "locate");
|
|
453
238
|
}
|
|
454
|
-
|
|
455
|
-
var
|
|
239
|
+
u(B, "getLocator");
|
|
240
|
+
var lt = /\w/, A = class {
|
|
456
241
|
static {
|
|
457
|
-
|
|
242
|
+
u(this, "Mappings");
|
|
458
243
|
}
|
|
459
244
|
constructor(t) {
|
|
460
245
|
this.hires = t, this.generatedCodeLine = 0, this.generatedCodeColumn = 0, this.raw = [], this.rawSegments = this.raw[this.generatedCodeLine] =
|
|
@@ -462,35 +247,35 @@ var Dt = /\w/, rt = class {
|
|
|
462
247
|
}
|
|
463
248
|
addEdit(t, e, i, n) {
|
|
464
249
|
if (e.length) {
|
|
465
|
-
let
|
|
250
|
+
let r = e.length - 1, s = e.indexOf(`
|
|
466
251
|
`, 0), l = -1;
|
|
467
|
-
for (;
|
|
468
|
-
let
|
|
469
|
-
n >= 0 &&
|
|
470
|
-
this.generatedCodeColumn = 0, l =
|
|
471
|
-
`,
|
|
252
|
+
for (; s >= 0 && r > s; ) {
|
|
253
|
+
let h = [this.generatedCodeColumn, t, i.line, i.column];
|
|
254
|
+
n >= 0 && h.push(n), this.rawSegments.push(h), this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [],
|
|
255
|
+
this.generatedCodeColumn = 0, l = s, s = e.indexOf(`
|
|
256
|
+
`, s + 1);
|
|
472
257
|
}
|
|
473
|
-
let
|
|
474
|
-
n >= 0 &&
|
|
258
|
+
let a = [this.generatedCodeColumn, t, i.line, i.column];
|
|
259
|
+
n >= 0 && a.push(n), this.rawSegments.push(a), this.advance(e.slice(l + 1));
|
|
475
260
|
} else this.pending && (this.rawSegments.push(this.pending), this.advance(e));
|
|
476
261
|
this.pending = null;
|
|
477
262
|
}
|
|
478
|
-
addUneditedChunk(t, e, i, n,
|
|
479
|
-
let
|
|
480
|
-
for (;
|
|
481
|
-
if (i[
|
|
263
|
+
addUneditedChunk(t, e, i, n, r) {
|
|
264
|
+
let s = e.start, l = !0, a = !1;
|
|
265
|
+
for (; s < e.end; ) {
|
|
266
|
+
if (i[s] === `
|
|
482
267
|
`)
|
|
483
268
|
n.line += 1, n.column = 0, this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn =
|
|
484
|
-
0, l = !0,
|
|
269
|
+
0, l = !0, a = !1;
|
|
485
270
|
else {
|
|
486
|
-
if (this.hires || l ||
|
|
487
|
-
let
|
|
488
|
-
this.hires === "boundary" ?
|
|
489
|
-
push(
|
|
271
|
+
if (this.hires || l || r.has(s)) {
|
|
272
|
+
let h = [this.generatedCodeColumn, t, n.line, n.column];
|
|
273
|
+
this.hires === "boundary" ? lt.test(i[s]) ? a || (this.rawSegments.push(h), a = !0) : (this.rawSegments.push(h), a = !1) : this.rawSegments.
|
|
274
|
+
push(h);
|
|
490
275
|
}
|
|
491
276
|
n.column += 1, this.generatedCodeColumn += 1, l = !1;
|
|
492
277
|
}
|
|
493
|
-
|
|
278
|
+
s += 1;
|
|
494
279
|
}
|
|
495
280
|
this.pending = null;
|
|
496
281
|
}
|
|
@@ -505,17 +290,17 @@ var Dt = /\w/, rt = class {
|
|
|
505
290
|
}
|
|
506
291
|
this.generatedCodeColumn += e[e.length - 1].length;
|
|
507
292
|
}
|
|
508
|
-
},
|
|
509
|
-
`,
|
|
293
|
+
}, _ = `
|
|
294
|
+
`, b = {
|
|
510
295
|
insertLeft: !1,
|
|
511
296
|
insertRight: !1,
|
|
512
297
|
storeName: !1
|
|
513
|
-
},
|
|
298
|
+
}, N = class o {
|
|
514
299
|
static {
|
|
515
|
-
|
|
300
|
+
u(this, "MagicString");
|
|
516
301
|
}
|
|
517
302
|
constructor(t, e = {}) {
|
|
518
|
-
let i = new
|
|
303
|
+
let i = new L(0, t.length, t);
|
|
519
304
|
Object.defineProperties(this, {
|
|
520
305
|
original: { writable: !0, value: t },
|
|
521
306
|
outro: { writable: !0, value: "" },
|
|
@@ -527,7 +312,7 @@ var Dt = /\w/, rt = class {
|
|
|
527
312
|
byEnd: { writable: !0, value: {} },
|
|
528
313
|
filename: { writable: !0, value: e.filename },
|
|
529
314
|
indentExclusionRanges: { writable: !0, value: e.indentExclusionRanges },
|
|
530
|
-
sourcemapLocations: { writable: !0, value: new
|
|
315
|
+
sourcemapLocations: { writable: !0, value: new I() },
|
|
531
316
|
storedNames: { writable: !0, value: {} },
|
|
532
317
|
indentStr: { writable: !0, value: void 0 },
|
|
533
318
|
ignoreList: { writable: !0, value: e.ignoreList },
|
|
@@ -554,31 +339,31 @@ var Dt = /\w/, rt = class {
|
|
|
554
339
|
return i ? i.appendRight(e) : this.outro += e, this;
|
|
555
340
|
}
|
|
556
341
|
clone() {
|
|
557
|
-
let t = new
|
|
342
|
+
let t = new o(this.original, { filename: this.filename, offset: this.offset }), e = this.firstChunk, i = t.firstChunk = t.lastSearchedChunk =
|
|
558
343
|
e.clone();
|
|
559
344
|
for (; e; ) {
|
|
560
345
|
t.byStart[i.start] = i, t.byEnd[i.end] = i;
|
|
561
|
-
let n = e.next,
|
|
562
|
-
|
|
346
|
+
let n = e.next, r = n && n.clone();
|
|
347
|
+
r && (i.next = r, r.previous = i, i = r), e = n;
|
|
563
348
|
}
|
|
564
349
|
return t.lastChunk = i, this.indentExclusionRanges && (t.indentExclusionRanges = this.indentExclusionRanges.slice()), t.sourcemapLocations =
|
|
565
|
-
new
|
|
350
|
+
new I(this.sourcemapLocations), t.intro = this.intro, t.outro = this.outro, t;
|
|
566
351
|
}
|
|
567
352
|
generateDecodedMap(t) {
|
|
568
353
|
t = t || {};
|
|
569
|
-
let e = 0, i = Object.keys(this.storedNames), n = new
|
|
570
|
-
return this.intro && n.advance(this.intro), this.firstChunk.eachNext((
|
|
571
|
-
let l =
|
|
572
|
-
|
|
354
|
+
let e = 0, i = Object.keys(this.storedNames), n = new A(t.hires), r = B(this.original);
|
|
355
|
+
return this.intro && n.advance(this.intro), this.firstChunk.eachNext((s) => {
|
|
356
|
+
let l = r(s.start);
|
|
357
|
+
s.intro.length && n.advance(s.intro), s.edited ? n.addEdit(
|
|
573
358
|
e,
|
|
574
|
-
|
|
359
|
+
s.content,
|
|
575
360
|
l,
|
|
576
|
-
|
|
577
|
-
) : n.addUneditedChunk(e,
|
|
578
|
-
}), {
|
|
361
|
+
s.storeName ? i.indexOf(s.original) : -1
|
|
362
|
+
) : n.addUneditedChunk(e, s, this.original, l, this.sourcemapLocations), s.outro.length && n.advance(s.outro);
|
|
363
|
+
}), this.outro && n.advance(this.outro), {
|
|
579
364
|
file: t.file ? t.file.split(/[/\\]/).pop() : void 0,
|
|
580
365
|
sources: [
|
|
581
|
-
t.source ?
|
|
366
|
+
t.source ? rt(t.file || "", t.source) : t.file || ""
|
|
582
367
|
],
|
|
583
368
|
sourcesContent: t.includeContent ? [this.original] : void 0,
|
|
584
369
|
names: i,
|
|
@@ -587,10 +372,10 @@ var Dt = /\w/, rt = class {
|
|
|
587
372
|
};
|
|
588
373
|
}
|
|
589
374
|
generateMap(t) {
|
|
590
|
-
return new
|
|
375
|
+
return new R(this.generateDecodedMap(t));
|
|
591
376
|
}
|
|
592
377
|
_ensureindentStr() {
|
|
593
|
-
this.indentStr === void 0 && (this.indentStr =
|
|
378
|
+
this.indentStr === void 0 && (this.indentStr = nt(this.original));
|
|
594
379
|
}
|
|
595
380
|
_getRawIndentString() {
|
|
596
381
|
return this._ensureindentStr(), this.indentStr;
|
|
@@ -600,33 +385,33 @@ var Dt = /\w/, rt = class {
|
|
|
600
385
|
}
|
|
601
386
|
indent(t, e) {
|
|
602
387
|
let i = /^[^\r\n]/gm;
|
|
603
|
-
if (
|
|
388
|
+
if (ot(t) && (e = t, t = void 0), t === void 0 && (this._ensureindentStr(), t = this.indentStr || " "), t === "") return this;
|
|
604
389
|
e = e || {};
|
|
605
390
|
let n = {};
|
|
606
|
-
e.exclude && (typeof e.exclude[0] == "number" ? [e.exclude] : e.exclude).forEach((
|
|
607
|
-
for (let
|
|
608
|
-
n[
|
|
391
|
+
e.exclude && (typeof e.exclude[0] == "number" ? [e.exclude] : e.exclude).forEach((f) => {
|
|
392
|
+
for (let C = f[0]; C < f[1]; C += 1)
|
|
393
|
+
n[C] = !0;
|
|
609
394
|
});
|
|
610
|
-
let
|
|
611
|
-
this.intro = this.intro.replace(i,
|
|
612
|
-
let l = 0,
|
|
613
|
-
for (;
|
|
614
|
-
let
|
|
615
|
-
if (
|
|
616
|
-
n[l] || (
|
|
395
|
+
let r = e.indentStart !== !1, s = /* @__PURE__ */ u((h) => r ? `${t}${h}` : (r = !0, h), "replacer");
|
|
396
|
+
this.intro = this.intro.replace(i, s);
|
|
397
|
+
let l = 0, a = this.firstChunk;
|
|
398
|
+
for (; a; ) {
|
|
399
|
+
let h = a.end;
|
|
400
|
+
if (a.edited)
|
|
401
|
+
n[l] || (a.content = a.content.replace(i, s), a.content.length && (r = a.content[a.content.length - 1] === `
|
|
617
402
|
`));
|
|
618
403
|
else
|
|
619
|
-
for (l =
|
|
404
|
+
for (l = a.start; l < h; ) {
|
|
620
405
|
if (!n[l]) {
|
|
621
|
-
let
|
|
622
|
-
|
|
623
|
-
` ?
|
|
406
|
+
let f = this.original[l];
|
|
407
|
+
f === `
|
|
408
|
+
` ? r = !0 : f !== "\r" && r && (r = !1, l === a.start || (this._splitChunk(a, l), a = a.next), a.prependRight(t));
|
|
624
409
|
}
|
|
625
410
|
l += 1;
|
|
626
411
|
}
|
|
627
|
-
l =
|
|
412
|
+
l = a.end, a = a.next;
|
|
628
413
|
}
|
|
629
|
-
return this.outro = this.outro.replace(i,
|
|
414
|
+
return this.outro = this.outro.replace(i, s), this;
|
|
630
415
|
}
|
|
631
416
|
insert() {
|
|
632
417
|
throw new Error(
|
|
@@ -634,25 +419,25 @@ var Dt = /\w/, rt = class {
|
|
|
634
419
|
);
|
|
635
420
|
}
|
|
636
421
|
insertLeft(t, e) {
|
|
637
|
-
return
|
|
422
|
+
return b.insertLeft || (console.warn(
|
|
638
423
|
"magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"
|
|
639
|
-
),
|
|
424
|
+
), b.insertLeft = !0), this.appendLeft(t, e);
|
|
640
425
|
}
|
|
641
426
|
insertRight(t, e) {
|
|
642
|
-
return
|
|
427
|
+
return b.insertRight || (console.warn(
|
|
643
428
|
"magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"
|
|
644
|
-
),
|
|
429
|
+
), b.insertRight = !0), this.prependRight(t, e);
|
|
645
430
|
}
|
|
646
431
|
move(t, e, i) {
|
|
647
432
|
if (t = t + this.offset, e = e + this.offset, i = i + this.offset, i >= t && i <= e) throw new Error("Cannot move a selection inside its\
|
|
648
433
|
elf");
|
|
649
434
|
this._split(t), this._split(e), this._split(i);
|
|
650
|
-
let n = this.byStart[t],
|
|
651
|
-
if (!
|
|
652
|
-
let
|
|
653
|
-
return
|
|
654
|
-
(this.lastChunk = n.previous, this.lastChunk.next = null), n.previous =
|
|
655
|
-
|
|
435
|
+
let n = this.byStart[t], r = this.byEnd[e], s = n.previous, l = r.next, a = this.byStart[i];
|
|
436
|
+
if (!a && r === this.lastChunk) return this;
|
|
437
|
+
let h = a ? a.previous : this.lastChunk;
|
|
438
|
+
return s && (s.next = l), l && (l.previous = s), h && (h.next = n), a && (a.previous = r), n.previous || (this.firstChunk = r.next), r.next ||
|
|
439
|
+
(this.lastChunk = n.previous, this.lastChunk.next = null), n.previous = h, r.next = a || null, h || (this.firstChunk = n), a || (this.lastChunk =
|
|
440
|
+
r), this;
|
|
656
441
|
}
|
|
657
442
|
overwrite(t, e, i, n) {
|
|
658
443
|
return n = n || {}, this.update(t, e, i, { ...n, overwrite: !n.contentOnly });
|
|
@@ -668,30 +453,30 @@ elf");
|
|
|
668
453
|
throw new Error(
|
|
669
454
|
"Cannot overwrite a zero-length range \u2013 use appendLeft or prependRight instead"
|
|
670
455
|
);
|
|
671
|
-
this._split(t), this._split(e), n === !0 && (
|
|
456
|
+
this._split(t), this._split(e), n === !0 && (b.storeName || (console.warn(
|
|
672
457
|
"The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"
|
|
673
|
-
),
|
|
674
|
-
let
|
|
675
|
-
if (
|
|
676
|
-
let
|
|
677
|
-
Object.defineProperty(this.storedNames,
|
|
458
|
+
), b.storeName = !0), n = { storeName: !0 });
|
|
459
|
+
let r = n !== void 0 ? n.storeName : !1, s = n !== void 0 ? n.overwrite : !1;
|
|
460
|
+
if (r) {
|
|
461
|
+
let h = this.original.slice(t, e);
|
|
462
|
+
Object.defineProperty(this.storedNames, h, {
|
|
678
463
|
writable: !0,
|
|
679
464
|
value: !0,
|
|
680
465
|
enumerable: !0
|
|
681
466
|
});
|
|
682
467
|
}
|
|
683
|
-
let l = this.byStart[t],
|
|
468
|
+
let l = this.byStart[t], a = this.byEnd[e];
|
|
684
469
|
if (l) {
|
|
685
|
-
let
|
|
686
|
-
for (;
|
|
687
|
-
if (
|
|
470
|
+
let h = l;
|
|
471
|
+
for (; h !== a; ) {
|
|
472
|
+
if (h.next !== this.byStart[h.end])
|
|
688
473
|
throw new Error("Cannot overwrite across a split point");
|
|
689
|
-
|
|
474
|
+
h = h.next, h.edit("", !1);
|
|
690
475
|
}
|
|
691
|
-
l.edit(i,
|
|
476
|
+
l.edit(i, r, !s);
|
|
692
477
|
} else {
|
|
693
|
-
let
|
|
694
|
-
|
|
478
|
+
let h = new L(t, e, "").edit(i, r);
|
|
479
|
+
a.next = h, h.previous = a;
|
|
695
480
|
}
|
|
696
481
|
return this;
|
|
697
482
|
}
|
|
@@ -750,24 +535,24 @@ elf");
|
|
|
750
535
|
return this.intro.length ? this.intro[this.intro.length - 1] : "";
|
|
751
536
|
}
|
|
752
537
|
lastLine() {
|
|
753
|
-
let t = this.outro.lastIndexOf(
|
|
538
|
+
let t = this.outro.lastIndexOf(_);
|
|
754
539
|
if (t !== -1) return this.outro.substr(t + 1);
|
|
755
540
|
let e = this.outro, i = this.lastChunk;
|
|
756
541
|
do {
|
|
757
542
|
if (i.outro.length > 0) {
|
|
758
|
-
if (t = i.outro.lastIndexOf(
|
|
543
|
+
if (t = i.outro.lastIndexOf(_), t !== -1) return i.outro.substr(t + 1) + e;
|
|
759
544
|
e = i.outro + e;
|
|
760
545
|
}
|
|
761
546
|
if (i.content.length > 0) {
|
|
762
|
-
if (t = i.content.lastIndexOf(
|
|
547
|
+
if (t = i.content.lastIndexOf(_), t !== -1) return i.content.substr(t + 1) + e;
|
|
763
548
|
e = i.content + e;
|
|
764
549
|
}
|
|
765
550
|
if (i.intro.length > 0) {
|
|
766
|
-
if (t = i.intro.lastIndexOf(
|
|
551
|
+
if (t = i.intro.lastIndexOf(_), t !== -1) return i.intro.substr(t + 1) + e;
|
|
767
552
|
e = i.intro + e;
|
|
768
553
|
}
|
|
769
554
|
} while (i = i.previous);
|
|
770
|
-
return t = this.intro.lastIndexOf(
|
|
555
|
+
return t = this.intro.lastIndexOf(_), t !== -1 ? this.intro.substr(t + 1) + e : this.intro + e;
|
|
771
556
|
}
|
|
772
557
|
slice(t = 0, e = this.original.length - this.offset) {
|
|
773
558
|
if (t = t + this.offset, e = e + this.offset, this.original.length !== 0) {
|
|
@@ -782,14 +567,14 @@ elf");
|
|
|
782
567
|
}
|
|
783
568
|
if (n && n.edited && n.start !== t)
|
|
784
569
|
throw new Error(`Cannot use replaced character ${t} as slice start anchor.`);
|
|
785
|
-
let
|
|
570
|
+
let r = n;
|
|
786
571
|
for (; n; ) {
|
|
787
|
-
n.intro && (
|
|
788
|
-
let
|
|
789
|
-
if (
|
|
572
|
+
n.intro && (r !== n || n.start === t) && (i += n.intro);
|
|
573
|
+
let s = n.start < e && n.end >= e;
|
|
574
|
+
if (s && n.edited && n.end !== e)
|
|
790
575
|
throw new Error(`Cannot use replaced character ${e} as slice end anchor.`);
|
|
791
|
-
let l =
|
|
792
|
-
if (i += n.content.slice(l,
|
|
576
|
+
let l = r === n ? t - n.start : 0, a = s ? n.content.length + e - n.end : n.content.length;
|
|
577
|
+
if (i += n.content.slice(l, a), n.outro && (!s || n.end === e) && (i += n.outro), s)
|
|
793
578
|
break;
|
|
794
579
|
n = n.next;
|
|
795
580
|
}
|
|
@@ -802,15 +587,16 @@ elf");
|
|
|
802
587
|
}
|
|
803
588
|
_split(t) {
|
|
804
589
|
if (this.byStart[t] || this.byEnd[t]) return;
|
|
805
|
-
let e = this.lastSearchedChunk, i = t > e.end;
|
|
590
|
+
let e = this.lastSearchedChunk, i = e, n = t > e.end;
|
|
806
591
|
for (; e; ) {
|
|
807
592
|
if (e.contains(t)) return this._splitChunk(e, t);
|
|
808
|
-
e =
|
|
593
|
+
if (e = n ? this.byStart[e.end] : this.byEnd[e.start], e === i) return;
|
|
594
|
+
i = e;
|
|
809
595
|
}
|
|
810
596
|
}
|
|
811
597
|
_splitChunk(t, e) {
|
|
812
598
|
if (t.edited && t.content.length) {
|
|
813
|
-
let n =
|
|
599
|
+
let n = B(this.original)(e);
|
|
814
600
|
throw new Error(
|
|
815
601
|
`Cannot split a chunk that has already been edited (${n.line}:${n.column} \u2013 "${t.original}")`
|
|
816
602
|
);
|
|
@@ -851,9 +637,9 @@ elf");
|
|
|
851
637
|
if (this.outro = this.outro.replace(e, ""), this.outro.length) return !0;
|
|
852
638
|
let i = this.lastChunk;
|
|
853
639
|
do {
|
|
854
|
-
let n = i.end,
|
|
640
|
+
let n = i.end, r = i.trimEnd(e);
|
|
855
641
|
if (i.end !== n && (this.lastChunk === i && (this.lastChunk = i.next), this.byEnd[i.end] = i, this.byStart[i.next.start] = i.next, this.
|
|
856
|
-
byEnd[i.next.end] = i.next),
|
|
642
|
+
byEnd[i.next.end] = i.next), r) return !0;
|
|
857
643
|
i = i.previous;
|
|
858
644
|
} while (i);
|
|
859
645
|
return !1;
|
|
@@ -866,9 +652,9 @@ elf");
|
|
|
866
652
|
if (this.intro = this.intro.replace(e, ""), this.intro.length) return !0;
|
|
867
653
|
let i = this.firstChunk;
|
|
868
654
|
do {
|
|
869
|
-
let n = i.end,
|
|
655
|
+
let n = i.end, r = i.trimStart(e);
|
|
870
656
|
if (i.end !== n && (i === this.lastChunk && (this.lastChunk = i.next), this.byEnd[i.end] = i, this.byStart[i.next.start] = i.next, this.
|
|
871
|
-
byEnd[i.next.end] = i.next),
|
|
657
|
+
byEnd[i.next.end] = i.next), r) return !0;
|
|
872
658
|
i = i.next;
|
|
873
659
|
} while (i);
|
|
874
660
|
return !1;
|
|
@@ -880,44 +666,46 @@ elf");
|
|
|
880
666
|
return this.original !== this.toString();
|
|
881
667
|
}
|
|
882
668
|
_replaceRegexp(t, e) {
|
|
883
|
-
function i(
|
|
884
|
-
return typeof e == "string" ? e.replace(/\$(\$|&|\d+)/g, (l,
|
|
885
|
-
e(...
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
function n(
|
|
889
|
-
let l,
|
|
890
|
-
for (; l =
|
|
891
|
-
|
|
892
|
-
return
|
|
669
|
+
function i(r, s) {
|
|
670
|
+
return typeof e == "string" ? e.replace(/\$(\$|&|\d+)/g, (l, a) => a === "$" ? "$" : a === "&" ? r[0] : +a < r.length ? r[+a] : `$${a}`) :
|
|
671
|
+
e(...r, r.index, s, r.groups);
|
|
672
|
+
}
|
|
673
|
+
u(i, "getReplacement");
|
|
674
|
+
function n(r, s) {
|
|
675
|
+
let l, a = [];
|
|
676
|
+
for (; l = r.exec(s); )
|
|
677
|
+
a.push(l);
|
|
678
|
+
return a;
|
|
893
679
|
}
|
|
894
|
-
if (
|
|
895
|
-
n(t, this.original).forEach((
|
|
896
|
-
if (
|
|
897
|
-
let l = i(
|
|
898
|
-
l !==
|
|
680
|
+
if (u(n, "matchAll"), t.global)
|
|
681
|
+
n(t, this.original).forEach((s) => {
|
|
682
|
+
if (s.index != null) {
|
|
683
|
+
let l = i(s, this.original);
|
|
684
|
+
l !== s[0] && this.overwrite(s.index, s.index + s[0].length, l);
|
|
899
685
|
}
|
|
900
686
|
});
|
|
901
687
|
else {
|
|
902
|
-
let
|
|
903
|
-
if (
|
|
904
|
-
let
|
|
905
|
-
|
|
688
|
+
let r = this.original.match(t);
|
|
689
|
+
if (r && r.index != null) {
|
|
690
|
+
let s = i(r, this.original);
|
|
691
|
+
s !== r[0] && this.overwrite(r.index, r.index + r[0].length, s);
|
|
906
692
|
}
|
|
907
693
|
}
|
|
908
694
|
return this;
|
|
909
695
|
}
|
|
910
696
|
_replaceString(t, e) {
|
|
911
697
|
let { original: i } = this, n = i.indexOf(t);
|
|
912
|
-
return n !== -1 && this.overwrite(n, n + t.length, e), this;
|
|
698
|
+
return n !== -1 && (typeof e == "function" && (e = e(t, n, i)), t !== e && this.overwrite(n, n + t.length, e)), this;
|
|
913
699
|
}
|
|
914
700
|
replace(t, e) {
|
|
915
701
|
return typeof t == "string" ? this._replaceString(t, e) : this._replaceRegexp(t, e);
|
|
916
702
|
}
|
|
917
703
|
_replaceAllString(t, e) {
|
|
918
704
|
let { original: i } = this, n = t.length;
|
|
919
|
-
for (let
|
|
920
|
-
i.slice(
|
|
705
|
+
for (let r = i.indexOf(t); r !== -1; r = i.indexOf(t, r + n)) {
|
|
706
|
+
let s = i.slice(r, r + n), l = e;
|
|
707
|
+
typeof e == "function" && (l = e(s, r, i)), s !== l && this.overwrite(r, r + n, l);
|
|
708
|
+
}
|
|
921
709
|
return this;
|
|
922
710
|
}
|
|
923
711
|
replaceAll(t, e) {
|
|
@@ -932,103 +720,103 @@ elf");
|
|
|
932
720
|
};
|
|
933
721
|
|
|
934
722
|
// src/core-server/presets/vitePlugins/vite-inject-mocker/constants.ts
|
|
935
|
-
var
|
|
723
|
+
var F = "__vitest_mocker__";
|
|
936
724
|
|
|
937
725
|
// src/core-server/mocking-utils/esmWalker.ts
|
|
938
|
-
function
|
|
939
|
-
return
|
|
726
|
+
function v(o) {
|
|
727
|
+
return o.type === "Identifier" ? o.name : o.raw;
|
|
940
728
|
}
|
|
941
|
-
|
|
729
|
+
u(v, "getArbitraryModuleIdentifier");
|
|
942
730
|
|
|
943
731
|
// src/core-server/mocking-utils/automock.ts
|
|
944
|
-
function
|
|
945
|
-
return
|
|
946
|
-
globalThisAccessor: JSON.stringify(
|
|
732
|
+
function U(o, t, e) {
|
|
733
|
+
return ut(o, t ? "autospy" : "automock", e, {
|
|
734
|
+
globalThisAccessor: JSON.stringify(F)
|
|
947
735
|
});
|
|
948
736
|
}
|
|
949
|
-
|
|
950
|
-
function
|
|
951
|
-
let n = i.globalThisAccessor || '"__vitest_mocker__"',
|
|
952
|
-
for (let
|
|
953
|
-
if (
|
|
737
|
+
u(U, "getAutomockCode");
|
|
738
|
+
function ut(o, t, e, i = {}) {
|
|
739
|
+
let n = i.globalThisAccessor || '"__vitest_mocker__"', r = e(o), s = new N(o), l = [], a = 0;
|
|
740
|
+
for (let g of r.body) {
|
|
741
|
+
if (g.type === "ExportAllDeclaration")
|
|
954
742
|
throw new Error(
|
|
955
743
|
"automocking files with `export *` is not supported in browser mode because it cannot be statically analysed"
|
|
956
744
|
);
|
|
957
|
-
if (
|
|
958
|
-
let
|
|
959
|
-
if (
|
|
960
|
-
l.push({ name:
|
|
961
|
-
else if (
|
|
962
|
-
|
|
963
|
-
|
|
745
|
+
if (g.type === "ExportNamedDeclaration") {
|
|
746
|
+
let y = function(c) {
|
|
747
|
+
if (c.type === "Identifier")
|
|
748
|
+
l.push({ name: c.name });
|
|
749
|
+
else if (c.type === "ArrayPattern")
|
|
750
|
+
c.elements.forEach((m) => {
|
|
751
|
+
m && y(m);
|
|
964
752
|
});
|
|
965
|
-
else if (
|
|
966
|
-
|
|
967
|
-
|
|
753
|
+
else if (c.type === "ObjectPattern")
|
|
754
|
+
c.properties.forEach((m) => {
|
|
755
|
+
m.type === "RestElement" ? y(m) : m.type === "Property" && y(m.value);
|
|
968
756
|
});
|
|
969
|
-
else if (
|
|
970
|
-
|
|
757
|
+
else if (c.type === "RestElement")
|
|
758
|
+
y(c.argument);
|
|
971
759
|
else {
|
|
972
|
-
if (
|
|
760
|
+
if (c.type === "AssignmentPattern")
|
|
973
761
|
throw new Error("AssignmentPattern is not supported. Please open a new bug report.");
|
|
974
|
-
if (
|
|
762
|
+
if (c.type === "MemberExpression")
|
|
975
763
|
throw new Error("MemberExpression is not supported. Please open a new bug report.");
|
|
976
764
|
}
|
|
977
765
|
};
|
|
978
|
-
var
|
|
979
|
-
|
|
980
|
-
let
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
}) :
|
|
984
|
-
let
|
|
985
|
-
if (!
|
|
986
|
-
|
|
766
|
+
var mt = y;
|
|
767
|
+
u(y, "traversePattern");
|
|
768
|
+
let d = g, p = d.declaration;
|
|
769
|
+
p && (p.type === "FunctionDeclaration" ? l.push({ name: p.id.name }) : p.type === "VariableDeclaration" ? p.declarations.forEach((c) => {
|
|
770
|
+
y(c.id);
|
|
771
|
+
}) : p.type === "ClassDeclaration" && l.push({ name: p.id.name }), s.remove(d.start, p.start));
|
|
772
|
+
let x = d.specifiers || [], O = d.source;
|
|
773
|
+
if (!O && x.length)
|
|
774
|
+
x.forEach((c) => {
|
|
987
775
|
l.push({
|
|
988
|
-
alias:
|
|
989
|
-
name:
|
|
776
|
+
alias: v(c.exported),
|
|
777
|
+
name: v(c.local)
|
|
990
778
|
});
|
|
991
|
-
}),
|
|
992
|
-
else if (
|
|
993
|
-
let
|
|
994
|
-
|
|
995
|
-
let
|
|
996
|
-
|
|
997
|
-
name:
|
|
998
|
-
alias:
|
|
779
|
+
}), s.remove(d.start, d.end);
|
|
780
|
+
else if (O && x.length) {
|
|
781
|
+
let c = [];
|
|
782
|
+
x.forEach((S) => {
|
|
783
|
+
let k = `__vitest_imported_${a++}__`;
|
|
784
|
+
c.push([v(S.local), k]), l.push({
|
|
785
|
+
name: k,
|
|
786
|
+
alias: v(S.exported)
|
|
999
787
|
});
|
|
1000
788
|
});
|
|
1001
|
-
let
|
|
1002
|
-
|
|
789
|
+
let m = `import { ${c.map(([S, k]) => `${S} as ${k}`).join(", ")} } from '${O.value}'`;
|
|
790
|
+
s.overwrite(d.start, d.end, m);
|
|
1003
791
|
}
|
|
1004
792
|
}
|
|
1005
|
-
if (
|
|
1006
|
-
let
|
|
1007
|
-
l.push({ name: "__vitest_default", alias: "default" }),
|
|
793
|
+
if (g.type === "ExportDefaultDeclaration") {
|
|
794
|
+
let d = g, p = d.declaration;
|
|
795
|
+
l.push({ name: "__vitest_default", alias: "default" }), s.overwrite(d.start, p.start, "const __vitest_default = ");
|
|
1008
796
|
}
|
|
1009
797
|
}
|
|
1010
|
-
let
|
|
798
|
+
let h = `
|
|
1011
799
|
const __vitest_current_es_module__ = {
|
|
1012
800
|
__esModule: true,
|
|
1013
|
-
${l.map(({ name:
|
|
801
|
+
${l.map(({ name: g }) => `["${g}"]: ${g},`).join(`
|
|
1014
802
|
`)}
|
|
1015
803
|
}
|
|
1016
804
|
const __vitest_mocked_module__ = globalThis[${n}].mockObject(__vitest_current_es_module__, "${t}")
|
|
1017
|
-
`,
|
|
1018
|
-
`),
|
|
805
|
+
`, f = l.map(({ name: g }, d) => `const __vitest_mocked_${d}__ = __vitest_mocked_module__["${g}"]`).join(`
|
|
806
|
+
`), G = `
|
|
1019
807
|
export {
|
|
1020
|
-
${l.map(({ name:
|
|
808
|
+
${l.map(({ name: g, alias: d }, p) => ` __vitest_mocked_${p}__ as ${d || g},`).join(`
|
|
1021
809
|
`)}
|
|
1022
810
|
}
|
|
1023
811
|
`;
|
|
1024
|
-
return
|
|
812
|
+
return s.append(h + f + G), s;
|
|
1025
813
|
}
|
|
1026
|
-
|
|
814
|
+
u(ut, "automockModule");
|
|
1027
815
|
|
|
1028
816
|
// src/core-server/mocking-utils/extract.ts
|
|
1029
|
-
var
|
|
1030
|
-
|
|
1031
|
-
var
|
|
817
|
+
var ct = require("node:fs"), P = require("storybook/internal/babel"), ft = require("storybook/internal/node-logger"), dt = require("storybook/internal/telemetry"),
|
|
818
|
+
pt = require("esbuild");
|
|
819
|
+
var q = /* @__PURE__ */ u((o) => P.parser.parse(o, {
|
|
1032
820
|
sourceType: "module",
|
|
1033
821
|
// Enable plugins to handle modern JavaScript features, including TSX.
|
|
1034
822
|
plugins: ["typescript", "jsx", "classProperties", "objectRestSpread"],
|
|
@@ -1036,8 +824,8 @@ var pt = /* @__PURE__ */ d((u) => et.parser.parse(u, {
|
|
|
1036
824
|
}).program, "babelParser");
|
|
1037
825
|
|
|
1038
826
|
// src/core-server/presets/webpack/loaders/webpack-automock-loader.ts
|
|
1039
|
-
function
|
|
827
|
+
function W(o) {
|
|
1040
828
|
let e = this.getOptions().spy === "true";
|
|
1041
|
-
return
|
|
829
|
+
return U(o, e, q).toString();
|
|
1042
830
|
}
|
|
1043
|
-
|
|
831
|
+
u(W, "webpackAutomockLoader");
|