@bigbinary/neeto-playwright-commons 1.8.23 → 1.8.25
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/index.cjs.js +2490 -246
- package/index.cjs.js.map +1 -1
- package/index.d.ts +6 -1
- package/index.js +2384 -140
- package/index.js.map +1 -1
- package/package.json +4 -2
package/index.cjs.js
CHANGED
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var test = require('@playwright/test');
|
|
5
|
+
var test$1 = require('@playwright/test');
|
|
6
|
+
var child_process = require('child_process');
|
|
6
7
|
var require$$0$1 = require('fs');
|
|
7
8
|
var ramda = require('ramda');
|
|
9
|
+
var require$$0$2 = require('util');
|
|
8
10
|
var faker = require('@faker-js/faker');
|
|
9
11
|
var MailosaurClient = require('mailosaur');
|
|
10
12
|
var dayjs = require('dayjs');
|
|
11
13
|
var require$$1 = require('tty');
|
|
12
|
-
var require$$0$3 = require('
|
|
13
|
-
var require$$0$2 = require('os');
|
|
14
|
+
var require$$0$3 = require('os');
|
|
14
15
|
var require$$0$4 = require('path');
|
|
15
16
|
var require$$0$5 = require('stream');
|
|
16
17
|
var require$$0$6 = require('events');
|
|
@@ -38,14 +39,14 @@ function _interopNamespace(e) {
|
|
|
38
39
|
return Object.freeze(n);
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
var test__default = /*#__PURE__*/_interopDefaultLegacy(test);
|
|
42
|
+
var test__default = /*#__PURE__*/_interopDefaultLegacy(test$1);
|
|
42
43
|
var require$$0__namespace = /*#__PURE__*/_interopNamespace(require$$0$1);
|
|
43
44
|
var require$$0__default$4 = /*#__PURE__*/_interopDefaultLegacy(require$$0$1);
|
|
45
|
+
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0$2);
|
|
44
46
|
var MailosaurClient__default = /*#__PURE__*/_interopDefaultLegacy(MailosaurClient);
|
|
45
47
|
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
46
48
|
var require$$1__default = /*#__PURE__*/_interopDefaultLegacy(require$$1);
|
|
47
49
|
var require$$0__default$1 = /*#__PURE__*/_interopDefaultLegacy(require$$0$3);
|
|
48
|
-
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0$2);
|
|
49
50
|
var require$$0__default$2 = /*#__PURE__*/_interopDefaultLegacy(require$$0$4);
|
|
50
51
|
var require$$0__default$3 = /*#__PURE__*/_interopDefaultLegacy(require$$0$5);
|
|
51
52
|
var require$$0__default$5 = /*#__PURE__*/_interopDefaultLegacy(require$$0$6);
|
|
@@ -69,6 +70,9 @@ const OTP_EMAIL_PATTERN = "is your login code";
|
|
|
69
70
|
const SLACK_DEFAULT_CHANNEL = "general";
|
|
70
71
|
|
|
71
72
|
/* eslint-disable playwright/no-skipped-test */
|
|
73
|
+
const execCommand = (command) => child_process.execSync(command)
|
|
74
|
+
.toString("utf-8")
|
|
75
|
+
.replace(/[\n\r\s]+$/, "");
|
|
72
76
|
const joinString = (string1, string2, string3 = "", separator = " ") => {
|
|
73
77
|
if (string3 === "") {
|
|
74
78
|
return string1 + separator + string2;
|
|
@@ -128,6 +132,11 @@ const skipTest = {
|
|
|
128
132
|
forDevelopmentEnv: () => test__default["default"].skip(process.env.TEST_ENV === ENVIRONMENT.development),
|
|
129
133
|
forReviewEnv: () => test__default["default"].skip(process.env.TEST_ENV === ENVIRONMENT.review),
|
|
130
134
|
forAllExceptStagingEnv: () => test__default["default"].skip(process.env.TEST_ENV !== ENVIRONMENT.staging),
|
|
135
|
+
forNonNightlyRun: () => {
|
|
136
|
+
const currentBranch = execCommand("git rev-parse --abbrev-ref HEAD");
|
|
137
|
+
const isNightlyRun = currentBranch === "main" && process.env.TEST_ENV === ENVIRONMENT.staging;
|
|
138
|
+
return test__default["default"].skip(ramda.not(isNightlyRun), "Run test only in playwright-nightly");
|
|
139
|
+
},
|
|
131
140
|
};
|
|
132
141
|
const shouldSkipSetupAndTeardown = () => { var _a; return ((_a = getGlobalUserState()) === null || _a === void 0 ? void 0 : _a.isLoggedIn) && process.env.SKIP_SETUP === "true"; };
|
|
133
142
|
|
|
@@ -194,165 +203,6 @@ const COMMON_SELECTORS = {
|
|
|
194
203
|
breadcrumbHeader: "header-breadcrumb",
|
|
195
204
|
};
|
|
196
205
|
|
|
197
|
-
class CustomCommands {
|
|
198
|
-
constructor(page, request, baseURL = process.env.BASE_URL) {
|
|
199
|
-
this.interceptMultipleResponses = ({ responseUrl = "", responseStatus = 200, times = 1, baseUrl, customPageContext, timeout = 35000, } = {}) => {
|
|
200
|
-
const pageContext = customPageContext !== null && customPageContext !== void 0 ? customPageContext : this.page;
|
|
201
|
-
return Promise.all([...new Array(times)].map(() => pageContext.waitForResponse((response) => {
|
|
202
|
-
var _a, _b, _c;
|
|
203
|
-
if (response.request().resourceType() === "xhr" &&
|
|
204
|
-
response.status() === responseStatus &&
|
|
205
|
-
response.url().includes(responseUrl) &&
|
|
206
|
-
response.url().startsWith((_a = baseUrl !== null && baseUrl !== void 0 ? baseUrl : this.baseURL) !== null && _a !== void 0 ? _a : "") &&
|
|
207
|
-
!this.responses.includes((_b = response.headers()) === null || _b === void 0 ? void 0 : _b["x-request-id"])) {
|
|
208
|
-
this.responses.push((_c = response.headers()) === null || _c === void 0 ? void 0 : _c["x-request-id"]);
|
|
209
|
-
return true;
|
|
210
|
-
}
|
|
211
|
-
return false;
|
|
212
|
-
}, { timeout })));
|
|
213
|
-
};
|
|
214
|
-
this.recursiveMethod = async (callback, condition, timeout, startTime) => {
|
|
215
|
-
if (Date.now() - timeout >= startTime) {
|
|
216
|
-
return false;
|
|
217
|
-
}
|
|
218
|
-
else if (await condition()) {
|
|
219
|
-
return await callback();
|
|
220
|
-
}
|
|
221
|
-
return await this.recursiveMethod(callback, condition, timeout, startTime);
|
|
222
|
-
};
|
|
223
|
-
this.executeRecursively = async ({ callback, condition, timeout = 5000, }) => {
|
|
224
|
-
const startTime = Date.now();
|
|
225
|
-
await this.recursiveMethod(callback, condition, timeout, startTime);
|
|
226
|
-
};
|
|
227
|
-
this.verifySuccessToast = async ({ message = "", closeAfterVerification = true, } = {}) => {
|
|
228
|
-
if (!ramda.isEmpty(message)) {
|
|
229
|
-
await test.expect(this.page.getByTestId(COMMON_SELECTORS.toastMessage)).toContainText(message);
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
-
await test.expect(this.page.locator(COMMON_SELECTORS.toastIcon)).toContainText("👍");
|
|
233
|
-
}
|
|
234
|
-
closeAfterVerification &&
|
|
235
|
-
(await this.page.getByTestId(COMMON_SELECTORS.toastCloseButton).click());
|
|
236
|
-
await test.expect(this.page.locator(COMMON_SELECTORS.toastIcon)).toBeHidden();
|
|
237
|
-
};
|
|
238
|
-
this.reloadAndWait = async (requestCount, customPageContext, interceptMultipleResponsesProps = {}) => {
|
|
239
|
-
const pageContext = customPageContext !== null && customPageContext !== void 0 ? customPageContext : this.page;
|
|
240
|
-
const reloadRequests = this.interceptMultipleResponses({
|
|
241
|
-
times: requestCount,
|
|
242
|
-
...interceptMultipleResponsesProps,
|
|
243
|
-
});
|
|
244
|
-
await pageContext.reload();
|
|
245
|
-
await reloadRequests;
|
|
246
|
-
};
|
|
247
|
-
this.apiRequest = async ({ url, failOnStatusCode = true, headers: additionalHeaders, body: data, method = "get", params = {}, ...otherOptions }) => {
|
|
248
|
-
const csrfToken = await this.page
|
|
249
|
-
.locator("[name='csrf-token']")
|
|
250
|
-
.getAttribute("content");
|
|
251
|
-
const requestOptions = {
|
|
252
|
-
failOnStatusCode,
|
|
253
|
-
headers: {
|
|
254
|
-
...additionalHeaders,
|
|
255
|
-
"accept-encoding": "gzip",
|
|
256
|
-
"x-csrf-token": csrfToken !== null && csrfToken !== void 0 ? csrfToken : "",
|
|
257
|
-
},
|
|
258
|
-
data,
|
|
259
|
-
params,
|
|
260
|
-
...otherOptions,
|
|
261
|
-
};
|
|
262
|
-
const httpMethodsHandlers = {
|
|
263
|
-
get: () => this.request.get(url, requestOptions),
|
|
264
|
-
patch: () => this.request.patch(url, requestOptions),
|
|
265
|
-
post: () => this.request.post(url, requestOptions),
|
|
266
|
-
put: () => this.request.put(url, requestOptions),
|
|
267
|
-
delete: () => this.request.delete(url, requestOptions),
|
|
268
|
-
};
|
|
269
|
-
return await httpMethodsHandlers[method]();
|
|
270
|
-
};
|
|
271
|
-
this.verifyFieldValue = values => {
|
|
272
|
-
const verifyEachFieldValue = ({ field, value, }) => test.expect(this.page.getByTestId(field)).toHaveValue(value);
|
|
273
|
-
return Array.isArray(values)
|
|
274
|
-
? Promise.all(values.map(value => verifyEachFieldValue(value)))
|
|
275
|
-
: verifyEachFieldValue(values);
|
|
276
|
-
};
|
|
277
|
-
this.page = page;
|
|
278
|
-
this.responses = [];
|
|
279
|
-
this.request = request;
|
|
280
|
-
this.baseURL = baseURL;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
class MailosaurUtils {
|
|
285
|
-
constructor(mailosaur) {
|
|
286
|
-
this.fetchOtpFromEmail = async ({ email, subjectSubstring = OTP_EMAIL_PATTERN, timeout = 2 * 60 * 1000, receivedAfter = new Date(), }) => {
|
|
287
|
-
var _a, _b, _c;
|
|
288
|
-
const receivedEmail = await this.mailosaur.messages.get(this.serverId, { sentTo: email, subject: subjectSubstring }, { timeout, receivedAfter });
|
|
289
|
-
const otp = (_c = (_b = (_a = receivedEmail === null || receivedEmail === void 0 ? void 0 : receivedEmail.text) === null || _a === void 0 ? void 0 : _a.codes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.value;
|
|
290
|
-
if (ramda.isNil(otp)) {
|
|
291
|
-
throw new Error(`No codes found in the email with subject: ${receivedEmail.subject}. Please re-evaluate the filtering parameters.`);
|
|
292
|
-
}
|
|
293
|
-
return otp;
|
|
294
|
-
};
|
|
295
|
-
this.generateRandomMailosaurEmail = () => faker.faker.internet.email({ provider: `${this.serverId}.mailosaur.net` });
|
|
296
|
-
this.mailosaur = mailosaur;
|
|
297
|
-
if (ramda.isNotNil(process.env.MAILOSAUR_SERVER_ID)) {
|
|
298
|
-
this.serverId = process.env.MAILOSAUR_SERVER_ID;
|
|
299
|
-
}
|
|
300
|
-
else {
|
|
301
|
-
throw new Error("ENV variable MAILOSAUR_SERVER_ID is not defined. Please add the Server ID to use this method. Please visit https://mailosaur.com/app/servers to find the Server ID.");
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
const commands = {
|
|
307
|
-
neetoPlaywrightUtilities: async ({ page, request, baseURL }, use) => {
|
|
308
|
-
const commands = new CustomCommands(page, request, baseURL);
|
|
309
|
-
await use(commands);
|
|
310
|
-
},
|
|
311
|
-
mailosaur: async ({}, use) => {
|
|
312
|
-
skipTest.forAllExceptStagingEnv();
|
|
313
|
-
if (ramda.isNotNil(process.env.MAILOSAUR_API_KEY)) {
|
|
314
|
-
const mailosaur = new MailosaurClient__default["default"](process.env.MAILOSAUR_API_KEY);
|
|
315
|
-
await use(mailosaur);
|
|
316
|
-
}
|
|
317
|
-
else {
|
|
318
|
-
throw new Error("ENV variable MAILOSAUR_API_KEY is not defined. Please add the API key to use this fixture. Please visit https://mailosaur.com/app/account/keys to find the API key.");
|
|
319
|
-
}
|
|
320
|
-
},
|
|
321
|
-
page: async ({ page }, use) => {
|
|
322
|
-
await page.goto("/");
|
|
323
|
-
await page.waitForLoadState();
|
|
324
|
-
await use(page);
|
|
325
|
-
},
|
|
326
|
-
mailosaurUtils: async ({ mailosaur }, use) => {
|
|
327
|
-
skipTest.forAllExceptStagingEnv();
|
|
328
|
-
const mailosaurUtils = new MailosaurUtils(mailosaur);
|
|
329
|
-
await use(mailosaurUtils);
|
|
330
|
-
},
|
|
331
|
-
};
|
|
332
|
-
|
|
333
|
-
const generateStagingData = (product = "invoice") => {
|
|
334
|
-
var _a;
|
|
335
|
-
const timestamp = `${dayjs__default["default"]().format("MMDDHHmmssSSS")}${(_a = process.env.JOB_COMPLETION_INDEX) !== null && _a !== void 0 ? _a : ""}`;
|
|
336
|
-
const firstName = "André";
|
|
337
|
-
const lastName = "O'Reilly";
|
|
338
|
-
const otpBypassKey = process.env.OTP_BYPASS_KEY;
|
|
339
|
-
const stagingOrganization = `cpt-${product}-${timestamp}`;
|
|
340
|
-
return {
|
|
341
|
-
firstName,
|
|
342
|
-
lastName,
|
|
343
|
-
otp: 111111,
|
|
344
|
-
domain: `neeto${product}.net`,
|
|
345
|
-
currentUserName: IS_STAGING_ENV
|
|
346
|
-
? joinString(firstName, lastName)
|
|
347
|
-
: CREDENTIALS.name,
|
|
348
|
-
businessName: stagingOrganization,
|
|
349
|
-
subdomainName: IS_STAGING_ENV ? stagingOrganization : "spinkart",
|
|
350
|
-
email: IS_STAGING_ENV
|
|
351
|
-
? `cpt${otpBypassKey}+${product}+${timestamp}@bigbinary.com`
|
|
352
|
-
: CREDENTIALS.email,
|
|
353
|
-
};
|
|
354
|
-
};
|
|
355
|
-
|
|
356
206
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
357
207
|
|
|
358
208
|
function getDefaultExportFromCjs (x) {
|
|
@@ -380,6 +230,2400 @@ function getAugmentedNamespace(n) {
|
|
|
380
230
|
return a;
|
|
381
231
|
}
|
|
382
232
|
|
|
233
|
+
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
|
234
|
+
var shams = function hasSymbols() {
|
|
235
|
+
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
|
|
236
|
+
if (typeof Symbol.iterator === 'symbol') { return true; }
|
|
237
|
+
|
|
238
|
+
var obj = {};
|
|
239
|
+
var sym = Symbol('test');
|
|
240
|
+
var symObj = Object(sym);
|
|
241
|
+
if (typeof sym === 'string') { return false; }
|
|
242
|
+
|
|
243
|
+
if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
|
|
244
|
+
if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
|
|
245
|
+
|
|
246
|
+
// temp disabled per https://github.com/ljharb/object.assign/issues/17
|
|
247
|
+
// if (sym instanceof Symbol) { return false; }
|
|
248
|
+
// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
|
|
249
|
+
// if (!(symObj instanceof Symbol)) { return false; }
|
|
250
|
+
|
|
251
|
+
// if (typeof Symbol.prototype.toString !== 'function') { return false; }
|
|
252
|
+
// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
|
|
253
|
+
|
|
254
|
+
var symVal = 42;
|
|
255
|
+
obj[sym] = symVal;
|
|
256
|
+
for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
|
|
257
|
+
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
|
|
258
|
+
|
|
259
|
+
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
|
|
260
|
+
|
|
261
|
+
var syms = Object.getOwnPropertySymbols(obj);
|
|
262
|
+
if (syms.length !== 1 || syms[0] !== sym) { return false; }
|
|
263
|
+
|
|
264
|
+
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
|
|
265
|
+
|
|
266
|
+
if (typeof Object.getOwnPropertyDescriptor === 'function') {
|
|
267
|
+
var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
|
|
268
|
+
if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
return true;
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
|
|
275
|
+
var hasSymbolSham = shams;
|
|
276
|
+
|
|
277
|
+
var hasSymbols$1 = function hasNativeSymbols() {
|
|
278
|
+
if (typeof origSymbol !== 'function') { return false; }
|
|
279
|
+
if (typeof Symbol !== 'function') { return false; }
|
|
280
|
+
if (typeof origSymbol('foo') !== 'symbol') { return false; }
|
|
281
|
+
if (typeof Symbol('bar') !== 'symbol') { return false; }
|
|
282
|
+
|
|
283
|
+
return hasSymbolSham();
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
var test = {
|
|
287
|
+
foo: {}
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
var $Object = Object;
|
|
291
|
+
|
|
292
|
+
var hasProto$1 = function hasProto() {
|
|
293
|
+
return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
/* eslint no-invalid-this: 1 */
|
|
297
|
+
|
|
298
|
+
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
|
299
|
+
var toStr$1 = Object.prototype.toString;
|
|
300
|
+
var max = Math.max;
|
|
301
|
+
var funcType = '[object Function]';
|
|
302
|
+
|
|
303
|
+
var concatty = function concatty(a, b) {
|
|
304
|
+
var arr = [];
|
|
305
|
+
|
|
306
|
+
for (var i = 0; i < a.length; i += 1) {
|
|
307
|
+
arr[i] = a[i];
|
|
308
|
+
}
|
|
309
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
310
|
+
arr[j + a.length] = b[j];
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
return arr;
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
var slicy = function slicy(arrLike, offset) {
|
|
317
|
+
var arr = [];
|
|
318
|
+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
319
|
+
arr[j] = arrLike[i];
|
|
320
|
+
}
|
|
321
|
+
return arr;
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
var joiny = function (arr, joiner) {
|
|
325
|
+
var str = '';
|
|
326
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
327
|
+
str += arr[i];
|
|
328
|
+
if (i + 1 < arr.length) {
|
|
329
|
+
str += joiner;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
return str;
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
var implementation$1 = function bind(that) {
|
|
336
|
+
var target = this;
|
|
337
|
+
if (typeof target !== 'function' || toStr$1.apply(target) !== funcType) {
|
|
338
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
339
|
+
}
|
|
340
|
+
var args = slicy(arguments, 1);
|
|
341
|
+
|
|
342
|
+
var bound;
|
|
343
|
+
var binder = function () {
|
|
344
|
+
if (this instanceof bound) {
|
|
345
|
+
var result = target.apply(
|
|
346
|
+
this,
|
|
347
|
+
concatty(args, arguments)
|
|
348
|
+
);
|
|
349
|
+
if (Object(result) === result) {
|
|
350
|
+
return result;
|
|
351
|
+
}
|
|
352
|
+
return this;
|
|
353
|
+
}
|
|
354
|
+
return target.apply(
|
|
355
|
+
that,
|
|
356
|
+
concatty(args, arguments)
|
|
357
|
+
);
|
|
358
|
+
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
var boundLength = max(0, target.length - args.length);
|
|
362
|
+
var boundArgs = [];
|
|
363
|
+
for (var i = 0; i < boundLength; i++) {
|
|
364
|
+
boundArgs[i] = '$' + i;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
|
|
368
|
+
|
|
369
|
+
if (target.prototype) {
|
|
370
|
+
var Empty = function Empty() {};
|
|
371
|
+
Empty.prototype = target.prototype;
|
|
372
|
+
bound.prototype = new Empty();
|
|
373
|
+
Empty.prototype = null;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
return bound;
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
var implementation = implementation$1;
|
|
380
|
+
|
|
381
|
+
var functionBind = Function.prototype.bind || implementation;
|
|
382
|
+
|
|
383
|
+
var call = Function.prototype.call;
|
|
384
|
+
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
385
|
+
var bind$1 = functionBind;
|
|
386
|
+
|
|
387
|
+
/** @type {(o: {}, p: PropertyKey) => p is keyof o} */
|
|
388
|
+
var hasown = bind$1.call(call, $hasOwn);
|
|
389
|
+
|
|
390
|
+
var undefined$1;
|
|
391
|
+
|
|
392
|
+
var $SyntaxError$1 = SyntaxError;
|
|
393
|
+
var $Function = Function;
|
|
394
|
+
var $TypeError$3 = TypeError;
|
|
395
|
+
|
|
396
|
+
// eslint-disable-next-line consistent-return
|
|
397
|
+
var getEvalledConstructor = function (expressionSyntax) {
|
|
398
|
+
try {
|
|
399
|
+
return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
|
|
400
|
+
} catch (e) {}
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
var $gOPD$1 = Object.getOwnPropertyDescriptor;
|
|
404
|
+
if ($gOPD$1) {
|
|
405
|
+
try {
|
|
406
|
+
$gOPD$1({}, '');
|
|
407
|
+
} catch (e) {
|
|
408
|
+
$gOPD$1 = null; // this is IE 8, which has a broken gOPD
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
var throwTypeError = function () {
|
|
413
|
+
throw new $TypeError$3();
|
|
414
|
+
};
|
|
415
|
+
var ThrowTypeError = $gOPD$1
|
|
416
|
+
? (function () {
|
|
417
|
+
try {
|
|
418
|
+
// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
|
|
419
|
+
arguments.callee; // IE 8 does not throw here
|
|
420
|
+
return throwTypeError;
|
|
421
|
+
} catch (calleeThrows) {
|
|
422
|
+
try {
|
|
423
|
+
// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
|
424
|
+
return $gOPD$1(arguments, 'callee').get;
|
|
425
|
+
} catch (gOPDthrows) {
|
|
426
|
+
return throwTypeError;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}())
|
|
430
|
+
: throwTypeError;
|
|
431
|
+
|
|
432
|
+
var hasSymbols = hasSymbols$1();
|
|
433
|
+
var hasProto = hasProto$1();
|
|
434
|
+
|
|
435
|
+
var getProto = Object.getPrototypeOf || (
|
|
436
|
+
hasProto
|
|
437
|
+
? function (x) { return x.__proto__; } // eslint-disable-line no-proto
|
|
438
|
+
: null
|
|
439
|
+
);
|
|
440
|
+
|
|
441
|
+
var needsEval = {};
|
|
442
|
+
|
|
443
|
+
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
|
|
444
|
+
|
|
445
|
+
var INTRINSICS = {
|
|
446
|
+
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
|
|
447
|
+
'%Array%': Array,
|
|
448
|
+
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
|
|
449
|
+
'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
|
|
450
|
+
'%AsyncFromSyncIteratorPrototype%': undefined$1,
|
|
451
|
+
'%AsyncFunction%': needsEval,
|
|
452
|
+
'%AsyncGenerator%': needsEval,
|
|
453
|
+
'%AsyncGeneratorFunction%': needsEval,
|
|
454
|
+
'%AsyncIteratorPrototype%': needsEval,
|
|
455
|
+
'%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
|
|
456
|
+
'%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
|
|
457
|
+
'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
|
|
458
|
+
'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
|
|
459
|
+
'%Boolean%': Boolean,
|
|
460
|
+
'%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
|
|
461
|
+
'%Date%': Date,
|
|
462
|
+
'%decodeURI%': decodeURI,
|
|
463
|
+
'%decodeURIComponent%': decodeURIComponent,
|
|
464
|
+
'%encodeURI%': encodeURI,
|
|
465
|
+
'%encodeURIComponent%': encodeURIComponent,
|
|
466
|
+
'%Error%': Error,
|
|
467
|
+
'%eval%': eval, // eslint-disable-line no-eval
|
|
468
|
+
'%EvalError%': EvalError,
|
|
469
|
+
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
|
|
470
|
+
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
|
|
471
|
+
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
|
|
472
|
+
'%Function%': $Function,
|
|
473
|
+
'%GeneratorFunction%': needsEval,
|
|
474
|
+
'%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
|
|
475
|
+
'%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
|
|
476
|
+
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
|
|
477
|
+
'%isFinite%': isFinite,
|
|
478
|
+
'%isNaN%': isNaN,
|
|
479
|
+
'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
|
|
480
|
+
'%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
|
|
481
|
+
'%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
|
|
482
|
+
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
|
|
483
|
+
'%Math%': Math,
|
|
484
|
+
'%Number%': Number,
|
|
485
|
+
'%Object%': Object,
|
|
486
|
+
'%parseFloat%': parseFloat,
|
|
487
|
+
'%parseInt%': parseInt,
|
|
488
|
+
'%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
|
|
489
|
+
'%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
|
|
490
|
+
'%RangeError%': RangeError,
|
|
491
|
+
'%ReferenceError%': ReferenceError,
|
|
492
|
+
'%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
|
|
493
|
+
'%RegExp%': RegExp,
|
|
494
|
+
'%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
|
|
495
|
+
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
|
|
496
|
+
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
|
|
497
|
+
'%String%': String,
|
|
498
|
+
'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
|
|
499
|
+
'%Symbol%': hasSymbols ? Symbol : undefined$1,
|
|
500
|
+
'%SyntaxError%': $SyntaxError$1,
|
|
501
|
+
'%ThrowTypeError%': ThrowTypeError,
|
|
502
|
+
'%TypedArray%': TypedArray,
|
|
503
|
+
'%TypeError%': $TypeError$3,
|
|
504
|
+
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
|
|
505
|
+
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
|
|
506
|
+
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
|
|
507
|
+
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
|
|
508
|
+
'%URIError%': URIError,
|
|
509
|
+
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
|
|
510
|
+
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
|
|
511
|
+
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
if (getProto) {
|
|
515
|
+
try {
|
|
516
|
+
null.error; // eslint-disable-line no-unused-expressions
|
|
517
|
+
} catch (e) {
|
|
518
|
+
// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
|
|
519
|
+
var errorProto = getProto(getProto(e));
|
|
520
|
+
INTRINSICS['%Error.prototype%'] = errorProto;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
var doEval = function doEval(name) {
|
|
525
|
+
var value;
|
|
526
|
+
if (name === '%AsyncFunction%') {
|
|
527
|
+
value = getEvalledConstructor('async function () {}');
|
|
528
|
+
} else if (name === '%GeneratorFunction%') {
|
|
529
|
+
value = getEvalledConstructor('function* () {}');
|
|
530
|
+
} else if (name === '%AsyncGeneratorFunction%') {
|
|
531
|
+
value = getEvalledConstructor('async function* () {}');
|
|
532
|
+
} else if (name === '%AsyncGenerator%') {
|
|
533
|
+
var fn = doEval('%AsyncGeneratorFunction%');
|
|
534
|
+
if (fn) {
|
|
535
|
+
value = fn.prototype;
|
|
536
|
+
}
|
|
537
|
+
} else if (name === '%AsyncIteratorPrototype%') {
|
|
538
|
+
var gen = doEval('%AsyncGenerator%');
|
|
539
|
+
if (gen && getProto) {
|
|
540
|
+
value = getProto(gen.prototype);
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
INTRINSICS[name] = value;
|
|
545
|
+
|
|
546
|
+
return value;
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
var LEGACY_ALIASES = {
|
|
550
|
+
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
|
551
|
+
'%ArrayPrototype%': ['Array', 'prototype'],
|
|
552
|
+
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
|
553
|
+
'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
|
|
554
|
+
'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
|
|
555
|
+
'%ArrayProto_values%': ['Array', 'prototype', 'values'],
|
|
556
|
+
'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
|
|
557
|
+
'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
|
|
558
|
+
'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
|
|
559
|
+
'%BooleanPrototype%': ['Boolean', 'prototype'],
|
|
560
|
+
'%DataViewPrototype%': ['DataView', 'prototype'],
|
|
561
|
+
'%DatePrototype%': ['Date', 'prototype'],
|
|
562
|
+
'%ErrorPrototype%': ['Error', 'prototype'],
|
|
563
|
+
'%EvalErrorPrototype%': ['EvalError', 'prototype'],
|
|
564
|
+
'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
|
|
565
|
+
'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
|
|
566
|
+
'%FunctionPrototype%': ['Function', 'prototype'],
|
|
567
|
+
'%Generator%': ['GeneratorFunction', 'prototype'],
|
|
568
|
+
'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
|
|
569
|
+
'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
|
|
570
|
+
'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
|
|
571
|
+
'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
|
|
572
|
+
'%JSONParse%': ['JSON', 'parse'],
|
|
573
|
+
'%JSONStringify%': ['JSON', 'stringify'],
|
|
574
|
+
'%MapPrototype%': ['Map', 'prototype'],
|
|
575
|
+
'%NumberPrototype%': ['Number', 'prototype'],
|
|
576
|
+
'%ObjectPrototype%': ['Object', 'prototype'],
|
|
577
|
+
'%ObjProto_toString%': ['Object', 'prototype', 'toString'],
|
|
578
|
+
'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
|
|
579
|
+
'%PromisePrototype%': ['Promise', 'prototype'],
|
|
580
|
+
'%PromiseProto_then%': ['Promise', 'prototype', 'then'],
|
|
581
|
+
'%Promise_all%': ['Promise', 'all'],
|
|
582
|
+
'%Promise_reject%': ['Promise', 'reject'],
|
|
583
|
+
'%Promise_resolve%': ['Promise', 'resolve'],
|
|
584
|
+
'%RangeErrorPrototype%': ['RangeError', 'prototype'],
|
|
585
|
+
'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
|
|
586
|
+
'%RegExpPrototype%': ['RegExp', 'prototype'],
|
|
587
|
+
'%SetPrototype%': ['Set', 'prototype'],
|
|
588
|
+
'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
|
|
589
|
+
'%StringPrototype%': ['String', 'prototype'],
|
|
590
|
+
'%SymbolPrototype%': ['Symbol', 'prototype'],
|
|
591
|
+
'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
|
|
592
|
+
'%TypedArrayPrototype%': ['TypedArray', 'prototype'],
|
|
593
|
+
'%TypeErrorPrototype%': ['TypeError', 'prototype'],
|
|
594
|
+
'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
|
|
595
|
+
'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
|
|
596
|
+
'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
|
|
597
|
+
'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
|
|
598
|
+
'%URIErrorPrototype%': ['URIError', 'prototype'],
|
|
599
|
+
'%WeakMapPrototype%': ['WeakMap', 'prototype'],
|
|
600
|
+
'%WeakSetPrototype%': ['WeakSet', 'prototype']
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
var bind = functionBind;
|
|
604
|
+
var hasOwn$1 = hasown;
|
|
605
|
+
var $concat$1 = bind.call(Function.call, Array.prototype.concat);
|
|
606
|
+
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
|
|
607
|
+
var $replace$1 = bind.call(Function.call, String.prototype.replace);
|
|
608
|
+
var $strSlice = bind.call(Function.call, String.prototype.slice);
|
|
609
|
+
var $exec = bind.call(Function.call, RegExp.prototype.exec);
|
|
610
|
+
|
|
611
|
+
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
|
612
|
+
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
613
|
+
var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
|
|
614
|
+
var stringToPath = function stringToPath(string) {
|
|
615
|
+
var first = $strSlice(string, 0, 1);
|
|
616
|
+
var last = $strSlice(string, -1);
|
|
617
|
+
if (first === '%' && last !== '%') {
|
|
618
|
+
throw new $SyntaxError$1('invalid intrinsic syntax, expected closing `%`');
|
|
619
|
+
} else if (last === '%' && first !== '%') {
|
|
620
|
+
throw new $SyntaxError$1('invalid intrinsic syntax, expected opening `%`');
|
|
621
|
+
}
|
|
622
|
+
var result = [];
|
|
623
|
+
$replace$1(string, rePropName, function (match, number, quote, subString) {
|
|
624
|
+
result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
|
|
625
|
+
});
|
|
626
|
+
return result;
|
|
627
|
+
};
|
|
628
|
+
/* end adaptation */
|
|
629
|
+
|
|
630
|
+
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
|
631
|
+
var intrinsicName = name;
|
|
632
|
+
var alias;
|
|
633
|
+
if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
|
|
634
|
+
alias = LEGACY_ALIASES[intrinsicName];
|
|
635
|
+
intrinsicName = '%' + alias[0] + '%';
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
if (hasOwn$1(INTRINSICS, intrinsicName)) {
|
|
639
|
+
var value = INTRINSICS[intrinsicName];
|
|
640
|
+
if (value === needsEval) {
|
|
641
|
+
value = doEval(intrinsicName);
|
|
642
|
+
}
|
|
643
|
+
if (typeof value === 'undefined' && !allowMissing) {
|
|
644
|
+
throw new $TypeError$3('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
return {
|
|
648
|
+
alias: alias,
|
|
649
|
+
name: intrinsicName,
|
|
650
|
+
value: value
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
throw new $SyntaxError$1('intrinsic ' + name + ' does not exist!');
|
|
655
|
+
};
|
|
656
|
+
|
|
657
|
+
var getIntrinsic = function GetIntrinsic(name, allowMissing) {
|
|
658
|
+
if (typeof name !== 'string' || name.length === 0) {
|
|
659
|
+
throw new $TypeError$3('intrinsic name must be a non-empty string');
|
|
660
|
+
}
|
|
661
|
+
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
|
|
662
|
+
throw new $TypeError$3('"allowMissing" argument must be a boolean');
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
if ($exec(/^%?[^%]*%?$/, name) === null) {
|
|
666
|
+
throw new $SyntaxError$1('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
|
667
|
+
}
|
|
668
|
+
var parts = stringToPath(name);
|
|
669
|
+
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
|
670
|
+
|
|
671
|
+
var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
|
|
672
|
+
var intrinsicRealName = intrinsic.name;
|
|
673
|
+
var value = intrinsic.value;
|
|
674
|
+
var skipFurtherCaching = false;
|
|
675
|
+
|
|
676
|
+
var alias = intrinsic.alias;
|
|
677
|
+
if (alias) {
|
|
678
|
+
intrinsicBaseName = alias[0];
|
|
679
|
+
$spliceApply(parts, $concat$1([0, 1], alias));
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
for (var i = 1, isOwn = true; i < parts.length; i += 1) {
|
|
683
|
+
var part = parts[i];
|
|
684
|
+
var first = $strSlice(part, 0, 1);
|
|
685
|
+
var last = $strSlice(part, -1);
|
|
686
|
+
if (
|
|
687
|
+
(
|
|
688
|
+
(first === '"' || first === "'" || first === '`')
|
|
689
|
+
|| (last === '"' || last === "'" || last === '`')
|
|
690
|
+
)
|
|
691
|
+
&& first !== last
|
|
692
|
+
) {
|
|
693
|
+
throw new $SyntaxError$1('property names with quotes must have matching quotes');
|
|
694
|
+
}
|
|
695
|
+
if (part === 'constructor' || !isOwn) {
|
|
696
|
+
skipFurtherCaching = true;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
intrinsicBaseName += '.' + part;
|
|
700
|
+
intrinsicRealName = '%' + intrinsicBaseName + '%';
|
|
701
|
+
|
|
702
|
+
if (hasOwn$1(INTRINSICS, intrinsicRealName)) {
|
|
703
|
+
value = INTRINSICS[intrinsicRealName];
|
|
704
|
+
} else if (value != null) {
|
|
705
|
+
if (!(part in value)) {
|
|
706
|
+
if (!allowMissing) {
|
|
707
|
+
throw new $TypeError$3('base intrinsic for ' + name + ' exists, but the property is not available.');
|
|
708
|
+
}
|
|
709
|
+
return void undefined$1;
|
|
710
|
+
}
|
|
711
|
+
if ($gOPD$1 && (i + 1) >= parts.length) {
|
|
712
|
+
var desc = $gOPD$1(value, part);
|
|
713
|
+
isOwn = !!desc;
|
|
714
|
+
|
|
715
|
+
// By convention, when a data property is converted to an accessor
|
|
716
|
+
// property to emulate a data property that does not suffer from
|
|
717
|
+
// the override mistake, that accessor's getter is marked with
|
|
718
|
+
// an `originalValue` property. Here, when we detect this, we
|
|
719
|
+
// uphold the illusion by pretending to see that original data
|
|
720
|
+
// property, i.e., returning the value rather than the getter
|
|
721
|
+
// itself.
|
|
722
|
+
if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
|
|
723
|
+
value = desc.get;
|
|
724
|
+
} else {
|
|
725
|
+
value = value[part];
|
|
726
|
+
}
|
|
727
|
+
} else {
|
|
728
|
+
isOwn = hasOwn$1(value, part);
|
|
729
|
+
value = value[part];
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
if (isOwn && !skipFurtherCaching) {
|
|
733
|
+
INTRINSICS[intrinsicRealName] = value;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
return value;
|
|
738
|
+
};
|
|
739
|
+
|
|
740
|
+
var callBind$1 = {exports: {}};
|
|
741
|
+
|
|
742
|
+
var GetIntrinsic$5 = getIntrinsic;
|
|
743
|
+
|
|
744
|
+
var $defineProperty$1 = GetIntrinsic$5('%Object.defineProperty%', true);
|
|
745
|
+
|
|
746
|
+
var hasPropertyDescriptors$1 = function hasPropertyDescriptors() {
|
|
747
|
+
if ($defineProperty$1) {
|
|
748
|
+
try {
|
|
749
|
+
$defineProperty$1({}, 'a', { value: 1 });
|
|
750
|
+
return true;
|
|
751
|
+
} catch (e) {
|
|
752
|
+
// IE 8 has a broken defineProperty
|
|
753
|
+
return false;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
return false;
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
hasPropertyDescriptors$1.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
|
|
760
|
+
// node v0.6 has a bug where array lengths can be Set but not Defined
|
|
761
|
+
if (!hasPropertyDescriptors$1()) {
|
|
762
|
+
return null;
|
|
763
|
+
}
|
|
764
|
+
try {
|
|
765
|
+
return $defineProperty$1([], 'length', { value: 1 }).length !== 1;
|
|
766
|
+
} catch (e) {
|
|
767
|
+
// In Firefox 4-22, defining length on an array throws an exception.
|
|
768
|
+
return true;
|
|
769
|
+
}
|
|
770
|
+
};
|
|
771
|
+
|
|
772
|
+
var hasPropertyDescriptors_1 = hasPropertyDescriptors$1;
|
|
773
|
+
|
|
774
|
+
var GetIntrinsic$4 = getIntrinsic;
|
|
775
|
+
|
|
776
|
+
var $gOPD = GetIntrinsic$4('%Object.getOwnPropertyDescriptor%', true);
|
|
777
|
+
|
|
778
|
+
if ($gOPD) {
|
|
779
|
+
try {
|
|
780
|
+
$gOPD([], 'length');
|
|
781
|
+
} catch (e) {
|
|
782
|
+
// IE 8 has a broken gOPD
|
|
783
|
+
$gOPD = null;
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
var gopd$1 = $gOPD;
|
|
788
|
+
|
|
789
|
+
var hasPropertyDescriptors = hasPropertyDescriptors_1();
|
|
790
|
+
|
|
791
|
+
var GetIntrinsic$3 = getIntrinsic;
|
|
792
|
+
|
|
793
|
+
var $defineProperty = hasPropertyDescriptors && GetIntrinsic$3('%Object.defineProperty%', true);
|
|
794
|
+
if ($defineProperty) {
|
|
795
|
+
try {
|
|
796
|
+
$defineProperty({}, 'a', { value: 1 });
|
|
797
|
+
} catch (e) {
|
|
798
|
+
// IE 8 has a broken defineProperty
|
|
799
|
+
$defineProperty = false;
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
var $SyntaxError = GetIntrinsic$3('%SyntaxError%');
|
|
804
|
+
var $TypeError$2 = GetIntrinsic$3('%TypeError%');
|
|
805
|
+
|
|
806
|
+
var gopd = gopd$1;
|
|
807
|
+
|
|
808
|
+
/** @type {(obj: Record<PropertyKey, unknown>, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */
|
|
809
|
+
var defineDataProperty = function defineDataProperty(
|
|
810
|
+
obj,
|
|
811
|
+
property,
|
|
812
|
+
value
|
|
813
|
+
) {
|
|
814
|
+
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
|
815
|
+
throw new $TypeError$2('`obj` must be an object or a function`');
|
|
816
|
+
}
|
|
817
|
+
if (typeof property !== 'string' && typeof property !== 'symbol') {
|
|
818
|
+
throw new $TypeError$2('`property` must be a string or a symbol`');
|
|
819
|
+
}
|
|
820
|
+
if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {
|
|
821
|
+
throw new $TypeError$2('`nonEnumerable`, if provided, must be a boolean or null');
|
|
822
|
+
}
|
|
823
|
+
if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {
|
|
824
|
+
throw new $TypeError$2('`nonWritable`, if provided, must be a boolean or null');
|
|
825
|
+
}
|
|
826
|
+
if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {
|
|
827
|
+
throw new $TypeError$2('`nonConfigurable`, if provided, must be a boolean or null');
|
|
828
|
+
}
|
|
829
|
+
if (arguments.length > 6 && typeof arguments[6] !== 'boolean') {
|
|
830
|
+
throw new $TypeError$2('`loose`, if provided, must be a boolean');
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
var nonEnumerable = arguments.length > 3 ? arguments[3] : null;
|
|
834
|
+
var nonWritable = arguments.length > 4 ? arguments[4] : null;
|
|
835
|
+
var nonConfigurable = arguments.length > 5 ? arguments[5] : null;
|
|
836
|
+
var loose = arguments.length > 6 ? arguments[6] : false;
|
|
837
|
+
|
|
838
|
+
/* @type {false | TypedPropertyDescriptor<unknown>} */
|
|
839
|
+
var desc = !!gopd && gopd(obj, property);
|
|
840
|
+
|
|
841
|
+
if ($defineProperty) {
|
|
842
|
+
$defineProperty(obj, property, {
|
|
843
|
+
configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,
|
|
844
|
+
enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,
|
|
845
|
+
value: value,
|
|
846
|
+
writable: nonWritable === null && desc ? desc.writable : !nonWritable
|
|
847
|
+
});
|
|
848
|
+
} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {
|
|
849
|
+
// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable
|
|
850
|
+
obj[property] = value; // eslint-disable-line no-param-reassign
|
|
851
|
+
} else {
|
|
852
|
+
throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');
|
|
853
|
+
}
|
|
854
|
+
};
|
|
855
|
+
|
|
856
|
+
var GetIntrinsic$2 = getIntrinsic;
|
|
857
|
+
var define = defineDataProperty;
|
|
858
|
+
var hasDescriptors = hasPropertyDescriptors_1();
|
|
859
|
+
var gOPD = gopd$1;
|
|
860
|
+
|
|
861
|
+
var $TypeError$1 = GetIntrinsic$2('%TypeError%');
|
|
862
|
+
var $floor$1 = GetIntrinsic$2('%Math.floor%');
|
|
863
|
+
|
|
864
|
+
var setFunctionLength = function setFunctionLength(fn, length) {
|
|
865
|
+
if (typeof fn !== 'function') {
|
|
866
|
+
throw new $TypeError$1('`fn` is not a function');
|
|
867
|
+
}
|
|
868
|
+
if (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor$1(length) !== length) {
|
|
869
|
+
throw new $TypeError$1('`length` must be a positive 32-bit integer');
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
var loose = arguments.length > 2 && !!arguments[2];
|
|
873
|
+
|
|
874
|
+
var functionLengthIsConfigurable = true;
|
|
875
|
+
var functionLengthIsWritable = true;
|
|
876
|
+
if ('length' in fn && gOPD) {
|
|
877
|
+
var desc = gOPD(fn, 'length');
|
|
878
|
+
if (desc && !desc.configurable) {
|
|
879
|
+
functionLengthIsConfigurable = false;
|
|
880
|
+
}
|
|
881
|
+
if (desc && !desc.writable) {
|
|
882
|
+
functionLengthIsWritable = false;
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {
|
|
887
|
+
if (hasDescriptors) {
|
|
888
|
+
define(fn, 'length', length, true, true);
|
|
889
|
+
} else {
|
|
890
|
+
define(fn, 'length', length);
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
return fn;
|
|
894
|
+
};
|
|
895
|
+
|
|
896
|
+
(function (module) {
|
|
897
|
+
|
|
898
|
+
var bind = functionBind;
|
|
899
|
+
var GetIntrinsic = getIntrinsic;
|
|
900
|
+
var setFunctionLength$1 = setFunctionLength;
|
|
901
|
+
|
|
902
|
+
var $TypeError = GetIntrinsic('%TypeError%');
|
|
903
|
+
var $apply = GetIntrinsic('%Function.prototype.apply%');
|
|
904
|
+
var $call = GetIntrinsic('%Function.prototype.call%');
|
|
905
|
+
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
|
|
906
|
+
|
|
907
|
+
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
|
|
908
|
+
var $max = GetIntrinsic('%Math.max%');
|
|
909
|
+
|
|
910
|
+
if ($defineProperty) {
|
|
911
|
+
try {
|
|
912
|
+
$defineProperty({}, 'a', { value: 1 });
|
|
913
|
+
} catch (e) {
|
|
914
|
+
// IE 8 has a broken defineProperty
|
|
915
|
+
$defineProperty = null;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
module.exports = function callBind(originalFunction) {
|
|
920
|
+
if (typeof originalFunction !== 'function') {
|
|
921
|
+
throw new $TypeError('a function is required');
|
|
922
|
+
}
|
|
923
|
+
var func = $reflectApply(bind, $call, arguments);
|
|
924
|
+
return setFunctionLength$1(
|
|
925
|
+
func,
|
|
926
|
+
1 + $max(0, originalFunction.length - (arguments.length - 1)),
|
|
927
|
+
true
|
|
928
|
+
);
|
|
929
|
+
};
|
|
930
|
+
|
|
931
|
+
var applyBind = function applyBind() {
|
|
932
|
+
return $reflectApply(bind, $apply, arguments);
|
|
933
|
+
};
|
|
934
|
+
|
|
935
|
+
if ($defineProperty) {
|
|
936
|
+
$defineProperty(module.exports, 'apply', { value: applyBind });
|
|
937
|
+
} else {
|
|
938
|
+
module.exports.apply = applyBind;
|
|
939
|
+
}
|
|
940
|
+
} (callBind$1));
|
|
941
|
+
|
|
942
|
+
var GetIntrinsic$1 = getIntrinsic;
|
|
943
|
+
|
|
944
|
+
var callBind = callBind$1.exports;
|
|
945
|
+
|
|
946
|
+
var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
|
|
947
|
+
|
|
948
|
+
var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
|
|
949
|
+
var intrinsic = GetIntrinsic$1(name, !!allowMissing);
|
|
950
|
+
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
|
951
|
+
return callBind(intrinsic);
|
|
952
|
+
}
|
|
953
|
+
return intrinsic;
|
|
954
|
+
};
|
|
955
|
+
|
|
956
|
+
var util_inspect = require$$0__default["default"].inspect;
|
|
957
|
+
|
|
958
|
+
var hasMap = typeof Map === 'function' && Map.prototype;
|
|
959
|
+
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
|
|
960
|
+
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
|
|
961
|
+
var mapForEach = hasMap && Map.prototype.forEach;
|
|
962
|
+
var hasSet = typeof Set === 'function' && Set.prototype;
|
|
963
|
+
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
|
|
964
|
+
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
|
|
965
|
+
var setForEach = hasSet && Set.prototype.forEach;
|
|
966
|
+
var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
|
|
967
|
+
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
|
|
968
|
+
var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
|
|
969
|
+
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
|
|
970
|
+
var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
|
|
971
|
+
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
|
|
972
|
+
var booleanValueOf = Boolean.prototype.valueOf;
|
|
973
|
+
var objectToString = Object.prototype.toString;
|
|
974
|
+
var functionToString = Function.prototype.toString;
|
|
975
|
+
var $match = String.prototype.match;
|
|
976
|
+
var $slice = String.prototype.slice;
|
|
977
|
+
var $replace = String.prototype.replace;
|
|
978
|
+
var $toUpperCase = String.prototype.toUpperCase;
|
|
979
|
+
var $toLowerCase = String.prototype.toLowerCase;
|
|
980
|
+
var $test = RegExp.prototype.test;
|
|
981
|
+
var $concat = Array.prototype.concat;
|
|
982
|
+
var $join = Array.prototype.join;
|
|
983
|
+
var $arrSlice = Array.prototype.slice;
|
|
984
|
+
var $floor = Math.floor;
|
|
985
|
+
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
|
|
986
|
+
var gOPS = Object.getOwnPropertySymbols;
|
|
987
|
+
var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
|
|
988
|
+
var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
|
|
989
|
+
// ie, `has-tostringtag/shams
|
|
990
|
+
var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
|
|
991
|
+
? Symbol.toStringTag
|
|
992
|
+
: null;
|
|
993
|
+
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
994
|
+
|
|
995
|
+
var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
|
|
996
|
+
[].__proto__ === Array.prototype // eslint-disable-line no-proto
|
|
997
|
+
? function (O) {
|
|
998
|
+
return O.__proto__; // eslint-disable-line no-proto
|
|
999
|
+
}
|
|
1000
|
+
: null
|
|
1001
|
+
);
|
|
1002
|
+
|
|
1003
|
+
function addNumericSeparator(num, str) {
|
|
1004
|
+
if (
|
|
1005
|
+
num === Infinity
|
|
1006
|
+
|| num === -Infinity
|
|
1007
|
+
|| num !== num
|
|
1008
|
+
|| (num && num > -1000 && num < 1000)
|
|
1009
|
+
|| $test.call(/e/, str)
|
|
1010
|
+
) {
|
|
1011
|
+
return str;
|
|
1012
|
+
}
|
|
1013
|
+
var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
|
|
1014
|
+
if (typeof num === 'number') {
|
|
1015
|
+
var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
|
|
1016
|
+
if (int !== num) {
|
|
1017
|
+
var intStr = String(int);
|
|
1018
|
+
var dec = $slice.call(str, intStr.length + 1);
|
|
1019
|
+
return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
return $replace.call(str, sepRegex, '$&_');
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
var utilInspect = util_inspect;
|
|
1026
|
+
var inspectCustom = utilInspect.custom;
|
|
1027
|
+
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
|
|
1028
|
+
|
|
1029
|
+
var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
1030
|
+
var opts = options || {};
|
|
1031
|
+
|
|
1032
|
+
if (has$3(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
|
|
1033
|
+
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
|
1034
|
+
}
|
|
1035
|
+
if (
|
|
1036
|
+
has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
|
|
1037
|
+
? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
|
|
1038
|
+
: opts.maxStringLength !== null
|
|
1039
|
+
)
|
|
1040
|
+
) {
|
|
1041
|
+
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
|
|
1042
|
+
}
|
|
1043
|
+
var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
|
|
1044
|
+
if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
|
|
1045
|
+
throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
if (
|
|
1049
|
+
has$3(opts, 'indent')
|
|
1050
|
+
&& opts.indent !== null
|
|
1051
|
+
&& opts.indent !== '\t'
|
|
1052
|
+
&& !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
|
|
1053
|
+
) {
|
|
1054
|
+
throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
|
|
1055
|
+
}
|
|
1056
|
+
if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
|
|
1057
|
+
throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
|
|
1058
|
+
}
|
|
1059
|
+
var numericSeparator = opts.numericSeparator;
|
|
1060
|
+
|
|
1061
|
+
if (typeof obj === 'undefined') {
|
|
1062
|
+
return 'undefined';
|
|
1063
|
+
}
|
|
1064
|
+
if (obj === null) {
|
|
1065
|
+
return 'null';
|
|
1066
|
+
}
|
|
1067
|
+
if (typeof obj === 'boolean') {
|
|
1068
|
+
return obj ? 'true' : 'false';
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
if (typeof obj === 'string') {
|
|
1072
|
+
return inspectString(obj, opts);
|
|
1073
|
+
}
|
|
1074
|
+
if (typeof obj === 'number') {
|
|
1075
|
+
if (obj === 0) {
|
|
1076
|
+
return Infinity / obj > 0 ? '0' : '-0';
|
|
1077
|
+
}
|
|
1078
|
+
var str = String(obj);
|
|
1079
|
+
return numericSeparator ? addNumericSeparator(obj, str) : str;
|
|
1080
|
+
}
|
|
1081
|
+
if (typeof obj === 'bigint') {
|
|
1082
|
+
var bigIntStr = String(obj) + 'n';
|
|
1083
|
+
return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
|
|
1087
|
+
if (typeof depth === 'undefined') { depth = 0; }
|
|
1088
|
+
if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
|
|
1089
|
+
return isArray$3(obj) ? '[Array]' : '[Object]';
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
var indent = getIndent(opts, depth);
|
|
1093
|
+
|
|
1094
|
+
if (typeof seen === 'undefined') {
|
|
1095
|
+
seen = [];
|
|
1096
|
+
} else if (indexOf(seen, obj) >= 0) {
|
|
1097
|
+
return '[Circular]';
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
function inspect(value, from, noIndent) {
|
|
1101
|
+
if (from) {
|
|
1102
|
+
seen = $arrSlice.call(seen);
|
|
1103
|
+
seen.push(from);
|
|
1104
|
+
}
|
|
1105
|
+
if (noIndent) {
|
|
1106
|
+
var newOpts = {
|
|
1107
|
+
depth: opts.depth
|
|
1108
|
+
};
|
|
1109
|
+
if (has$3(opts, 'quoteStyle')) {
|
|
1110
|
+
newOpts.quoteStyle = opts.quoteStyle;
|
|
1111
|
+
}
|
|
1112
|
+
return inspect_(value, newOpts, depth + 1, seen);
|
|
1113
|
+
}
|
|
1114
|
+
return inspect_(value, opts, depth + 1, seen);
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
|
|
1118
|
+
var name = nameOf(obj);
|
|
1119
|
+
var keys = arrObjKeys(obj, inspect);
|
|
1120
|
+
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
|
|
1121
|
+
}
|
|
1122
|
+
if (isSymbol(obj)) {
|
|
1123
|
+
var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
|
|
1124
|
+
return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
|
|
1125
|
+
}
|
|
1126
|
+
if (isElement(obj)) {
|
|
1127
|
+
var s = '<' + $toLowerCase.call(String(obj.nodeName));
|
|
1128
|
+
var attrs = obj.attributes || [];
|
|
1129
|
+
for (var i = 0; i < attrs.length; i++) {
|
|
1130
|
+
s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
|
|
1131
|
+
}
|
|
1132
|
+
s += '>';
|
|
1133
|
+
if (obj.childNodes && obj.childNodes.length) { s += '...'; }
|
|
1134
|
+
s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
|
|
1135
|
+
return s;
|
|
1136
|
+
}
|
|
1137
|
+
if (isArray$3(obj)) {
|
|
1138
|
+
if (obj.length === 0) { return '[]'; }
|
|
1139
|
+
var xs = arrObjKeys(obj, inspect);
|
|
1140
|
+
if (indent && !singleLineValues(xs)) {
|
|
1141
|
+
return '[' + indentedJoin(xs, indent) + ']';
|
|
1142
|
+
}
|
|
1143
|
+
return '[ ' + $join.call(xs, ', ') + ' ]';
|
|
1144
|
+
}
|
|
1145
|
+
if (isError(obj)) {
|
|
1146
|
+
var parts = arrObjKeys(obj, inspect);
|
|
1147
|
+
if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
|
|
1148
|
+
return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
|
|
1149
|
+
}
|
|
1150
|
+
if (parts.length === 0) { return '[' + String(obj) + ']'; }
|
|
1151
|
+
return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
|
|
1152
|
+
}
|
|
1153
|
+
if (typeof obj === 'object' && customInspect) {
|
|
1154
|
+
if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
|
|
1155
|
+
return utilInspect(obj, { depth: maxDepth - depth });
|
|
1156
|
+
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
|
|
1157
|
+
return obj.inspect();
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
if (isMap(obj)) {
|
|
1161
|
+
var mapParts = [];
|
|
1162
|
+
if (mapForEach) {
|
|
1163
|
+
mapForEach.call(obj, function (value, key) {
|
|
1164
|
+
mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
|
|
1165
|
+
});
|
|
1166
|
+
}
|
|
1167
|
+
return collectionOf('Map', mapSize.call(obj), mapParts, indent);
|
|
1168
|
+
}
|
|
1169
|
+
if (isSet(obj)) {
|
|
1170
|
+
var setParts = [];
|
|
1171
|
+
if (setForEach) {
|
|
1172
|
+
setForEach.call(obj, function (value) {
|
|
1173
|
+
setParts.push(inspect(value, obj));
|
|
1174
|
+
});
|
|
1175
|
+
}
|
|
1176
|
+
return collectionOf('Set', setSize.call(obj), setParts, indent);
|
|
1177
|
+
}
|
|
1178
|
+
if (isWeakMap(obj)) {
|
|
1179
|
+
return weakCollectionOf('WeakMap');
|
|
1180
|
+
}
|
|
1181
|
+
if (isWeakSet(obj)) {
|
|
1182
|
+
return weakCollectionOf('WeakSet');
|
|
1183
|
+
}
|
|
1184
|
+
if (isWeakRef(obj)) {
|
|
1185
|
+
return weakCollectionOf('WeakRef');
|
|
1186
|
+
}
|
|
1187
|
+
if (isNumber$3(obj)) {
|
|
1188
|
+
return markBoxed(inspect(Number(obj)));
|
|
1189
|
+
}
|
|
1190
|
+
if (isBigInt(obj)) {
|
|
1191
|
+
return markBoxed(inspect(bigIntValueOf.call(obj)));
|
|
1192
|
+
}
|
|
1193
|
+
if (isBoolean(obj)) {
|
|
1194
|
+
return markBoxed(booleanValueOf.call(obj));
|
|
1195
|
+
}
|
|
1196
|
+
if (isString$1(obj)) {
|
|
1197
|
+
return markBoxed(inspect(String(obj)));
|
|
1198
|
+
}
|
|
1199
|
+
// note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
|
|
1200
|
+
/* eslint-env browser */
|
|
1201
|
+
if (typeof window !== 'undefined' && obj === window) {
|
|
1202
|
+
return '{ [object Window] }';
|
|
1203
|
+
}
|
|
1204
|
+
if (obj === commonjsGlobal) {
|
|
1205
|
+
return '{ [object globalThis] }';
|
|
1206
|
+
}
|
|
1207
|
+
if (!isDate(obj) && !isRegExp$1(obj)) {
|
|
1208
|
+
var ys = arrObjKeys(obj, inspect);
|
|
1209
|
+
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
1210
|
+
var protoTag = obj instanceof Object ? '' : 'null prototype';
|
|
1211
|
+
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
|
|
1212
|
+
var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
|
|
1213
|
+
var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
|
|
1214
|
+
if (ys.length === 0) { return tag + '{}'; }
|
|
1215
|
+
if (indent) {
|
|
1216
|
+
return tag + '{' + indentedJoin(ys, indent) + '}';
|
|
1217
|
+
}
|
|
1218
|
+
return tag + '{ ' + $join.call(ys, ', ') + ' }';
|
|
1219
|
+
}
|
|
1220
|
+
return String(obj);
|
|
1221
|
+
};
|
|
1222
|
+
|
|
1223
|
+
function wrapQuotes(s, defaultStyle, opts) {
|
|
1224
|
+
var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
|
|
1225
|
+
return quoteChar + s + quoteChar;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
function quote(s) {
|
|
1229
|
+
return $replace.call(String(s), /"/g, '"');
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1233
|
+
function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1234
|
+
function isRegExp$1(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1235
|
+
function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1236
|
+
function isString$1(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1237
|
+
function isNumber$3(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1238
|
+
function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
|
1239
|
+
|
|
1240
|
+
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
|
1241
|
+
function isSymbol(obj) {
|
|
1242
|
+
if (hasShammedSymbols) {
|
|
1243
|
+
return obj && typeof obj === 'object' && obj instanceof Symbol;
|
|
1244
|
+
}
|
|
1245
|
+
if (typeof obj === 'symbol') {
|
|
1246
|
+
return true;
|
|
1247
|
+
}
|
|
1248
|
+
if (!obj || typeof obj !== 'object' || !symToString) {
|
|
1249
|
+
return false;
|
|
1250
|
+
}
|
|
1251
|
+
try {
|
|
1252
|
+
symToString.call(obj);
|
|
1253
|
+
return true;
|
|
1254
|
+
} catch (e) {}
|
|
1255
|
+
return false;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
function isBigInt(obj) {
|
|
1259
|
+
if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
|
|
1260
|
+
return false;
|
|
1261
|
+
}
|
|
1262
|
+
try {
|
|
1263
|
+
bigIntValueOf.call(obj);
|
|
1264
|
+
return true;
|
|
1265
|
+
} catch (e) {}
|
|
1266
|
+
return false;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
|
|
1270
|
+
function has$3(obj, key) {
|
|
1271
|
+
return hasOwn.call(obj, key);
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
function toStr(obj) {
|
|
1275
|
+
return objectToString.call(obj);
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
function nameOf(f) {
|
|
1279
|
+
if (f.name) { return f.name; }
|
|
1280
|
+
var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
|
|
1281
|
+
if (m) { return m[1]; }
|
|
1282
|
+
return null;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
function indexOf(xs, x) {
|
|
1286
|
+
if (xs.indexOf) { return xs.indexOf(x); }
|
|
1287
|
+
for (var i = 0, l = xs.length; i < l; i++) {
|
|
1288
|
+
if (xs[i] === x) { return i; }
|
|
1289
|
+
}
|
|
1290
|
+
return -1;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
function isMap(x) {
|
|
1294
|
+
if (!mapSize || !x || typeof x !== 'object') {
|
|
1295
|
+
return false;
|
|
1296
|
+
}
|
|
1297
|
+
try {
|
|
1298
|
+
mapSize.call(x);
|
|
1299
|
+
try {
|
|
1300
|
+
setSize.call(x);
|
|
1301
|
+
} catch (s) {
|
|
1302
|
+
return true;
|
|
1303
|
+
}
|
|
1304
|
+
return x instanceof Map; // core-js workaround, pre-v2.5.0
|
|
1305
|
+
} catch (e) {}
|
|
1306
|
+
return false;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
function isWeakMap(x) {
|
|
1310
|
+
if (!weakMapHas || !x || typeof x !== 'object') {
|
|
1311
|
+
return false;
|
|
1312
|
+
}
|
|
1313
|
+
try {
|
|
1314
|
+
weakMapHas.call(x, weakMapHas);
|
|
1315
|
+
try {
|
|
1316
|
+
weakSetHas.call(x, weakSetHas);
|
|
1317
|
+
} catch (s) {
|
|
1318
|
+
return true;
|
|
1319
|
+
}
|
|
1320
|
+
return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
|
|
1321
|
+
} catch (e) {}
|
|
1322
|
+
return false;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
function isWeakRef(x) {
|
|
1326
|
+
if (!weakRefDeref || !x || typeof x !== 'object') {
|
|
1327
|
+
return false;
|
|
1328
|
+
}
|
|
1329
|
+
try {
|
|
1330
|
+
weakRefDeref.call(x);
|
|
1331
|
+
return true;
|
|
1332
|
+
} catch (e) {}
|
|
1333
|
+
return false;
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
function isSet(x) {
|
|
1337
|
+
if (!setSize || !x || typeof x !== 'object') {
|
|
1338
|
+
return false;
|
|
1339
|
+
}
|
|
1340
|
+
try {
|
|
1341
|
+
setSize.call(x);
|
|
1342
|
+
try {
|
|
1343
|
+
mapSize.call(x);
|
|
1344
|
+
} catch (m) {
|
|
1345
|
+
return true;
|
|
1346
|
+
}
|
|
1347
|
+
return x instanceof Set; // core-js workaround, pre-v2.5.0
|
|
1348
|
+
} catch (e) {}
|
|
1349
|
+
return false;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
function isWeakSet(x) {
|
|
1353
|
+
if (!weakSetHas || !x || typeof x !== 'object') {
|
|
1354
|
+
return false;
|
|
1355
|
+
}
|
|
1356
|
+
try {
|
|
1357
|
+
weakSetHas.call(x, weakSetHas);
|
|
1358
|
+
try {
|
|
1359
|
+
weakMapHas.call(x, weakMapHas);
|
|
1360
|
+
} catch (s) {
|
|
1361
|
+
return true;
|
|
1362
|
+
}
|
|
1363
|
+
return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
|
|
1364
|
+
} catch (e) {}
|
|
1365
|
+
return false;
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
function isElement(x) {
|
|
1369
|
+
if (!x || typeof x !== 'object') { return false; }
|
|
1370
|
+
if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
|
|
1371
|
+
return true;
|
|
1372
|
+
}
|
|
1373
|
+
return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
function inspectString(str, opts) {
|
|
1377
|
+
if (str.length > opts.maxStringLength) {
|
|
1378
|
+
var remaining = str.length - opts.maxStringLength;
|
|
1379
|
+
var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
|
|
1380
|
+
return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
|
|
1381
|
+
}
|
|
1382
|
+
// eslint-disable-next-line no-control-regex
|
|
1383
|
+
var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
|
|
1384
|
+
return wrapQuotes(s, 'single', opts);
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
function lowbyte(c) {
|
|
1388
|
+
var n = c.charCodeAt(0);
|
|
1389
|
+
var x = {
|
|
1390
|
+
8: 'b',
|
|
1391
|
+
9: 't',
|
|
1392
|
+
10: 'n',
|
|
1393
|
+
12: 'f',
|
|
1394
|
+
13: 'r'
|
|
1395
|
+
}[n];
|
|
1396
|
+
if (x) { return '\\' + x; }
|
|
1397
|
+
return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
function markBoxed(str) {
|
|
1401
|
+
return 'Object(' + str + ')';
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1404
|
+
function weakCollectionOf(type) {
|
|
1405
|
+
return type + ' { ? }';
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
function collectionOf(type, size, entries, indent) {
|
|
1409
|
+
var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
|
|
1410
|
+
return type + ' (' + size + ') {' + joinedEntries + '}';
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
function singleLineValues(xs) {
|
|
1414
|
+
for (var i = 0; i < xs.length; i++) {
|
|
1415
|
+
if (indexOf(xs[i], '\n') >= 0) {
|
|
1416
|
+
return false;
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
return true;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
function getIndent(opts, depth) {
|
|
1423
|
+
var baseIndent;
|
|
1424
|
+
if (opts.indent === '\t') {
|
|
1425
|
+
baseIndent = '\t';
|
|
1426
|
+
} else if (typeof opts.indent === 'number' && opts.indent > 0) {
|
|
1427
|
+
baseIndent = $join.call(Array(opts.indent + 1), ' ');
|
|
1428
|
+
} else {
|
|
1429
|
+
return null;
|
|
1430
|
+
}
|
|
1431
|
+
return {
|
|
1432
|
+
base: baseIndent,
|
|
1433
|
+
prev: $join.call(Array(depth + 1), baseIndent)
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
function indentedJoin(xs, indent) {
|
|
1438
|
+
if (xs.length === 0) { return ''; }
|
|
1439
|
+
var lineJoiner = '\n' + indent.prev + indent.base;
|
|
1440
|
+
return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
function arrObjKeys(obj, inspect) {
|
|
1444
|
+
var isArr = isArray$3(obj);
|
|
1445
|
+
var xs = [];
|
|
1446
|
+
if (isArr) {
|
|
1447
|
+
xs.length = obj.length;
|
|
1448
|
+
for (var i = 0; i < obj.length; i++) {
|
|
1449
|
+
xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
|
|
1453
|
+
var symMap;
|
|
1454
|
+
if (hasShammedSymbols) {
|
|
1455
|
+
symMap = {};
|
|
1456
|
+
for (var k = 0; k < syms.length; k++) {
|
|
1457
|
+
symMap['$' + syms[k]] = syms[k];
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
for (var key in obj) { // eslint-disable-line no-restricted-syntax
|
|
1462
|
+
if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
|
1463
|
+
if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
|
1464
|
+
if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
|
|
1465
|
+
// this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
|
|
1466
|
+
continue; // eslint-disable-line no-restricted-syntax, no-continue
|
|
1467
|
+
} else if ($test.call(/[^\w$]/, key)) {
|
|
1468
|
+
xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
|
|
1469
|
+
} else {
|
|
1470
|
+
xs.push(key + ': ' + inspect(obj[key], obj));
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
if (typeof gOPS === 'function') {
|
|
1474
|
+
for (var j = 0; j < syms.length; j++) {
|
|
1475
|
+
if (isEnumerable.call(obj, syms[j])) {
|
|
1476
|
+
xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
return xs;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1483
|
+
var GetIntrinsic = getIntrinsic;
|
|
1484
|
+
var callBound = callBound$1;
|
|
1485
|
+
var inspect = objectInspect;
|
|
1486
|
+
|
|
1487
|
+
var $TypeError = GetIntrinsic('%TypeError%');
|
|
1488
|
+
var $WeakMap = GetIntrinsic('%WeakMap%', true);
|
|
1489
|
+
var $Map = GetIntrinsic('%Map%', true);
|
|
1490
|
+
|
|
1491
|
+
var $weakMapGet = callBound('WeakMap.prototype.get', true);
|
|
1492
|
+
var $weakMapSet = callBound('WeakMap.prototype.set', true);
|
|
1493
|
+
var $weakMapHas = callBound('WeakMap.prototype.has', true);
|
|
1494
|
+
var $mapGet = callBound('Map.prototype.get', true);
|
|
1495
|
+
var $mapSet = callBound('Map.prototype.set', true);
|
|
1496
|
+
var $mapHas = callBound('Map.prototype.has', true);
|
|
1497
|
+
|
|
1498
|
+
/*
|
|
1499
|
+
* This function traverses the list returning the node corresponding to the
|
|
1500
|
+
* given key.
|
|
1501
|
+
*
|
|
1502
|
+
* That node is also moved to the head of the list, so that if it's accessed
|
|
1503
|
+
* again we don't need to traverse the whole list. By doing so, all the recently
|
|
1504
|
+
* used nodes can be accessed relatively quickly.
|
|
1505
|
+
*/
|
|
1506
|
+
var listGetNode = function (list, key) { // eslint-disable-line consistent-return
|
|
1507
|
+
for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
|
|
1508
|
+
if (curr.key === key) {
|
|
1509
|
+
prev.next = curr.next;
|
|
1510
|
+
curr.next = list.next;
|
|
1511
|
+
list.next = curr; // eslint-disable-line no-param-reassign
|
|
1512
|
+
return curr;
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
};
|
|
1516
|
+
|
|
1517
|
+
var listGet = function (objects, key) {
|
|
1518
|
+
var node = listGetNode(objects, key);
|
|
1519
|
+
return node && node.value;
|
|
1520
|
+
};
|
|
1521
|
+
var listSet = function (objects, key, value) {
|
|
1522
|
+
var node = listGetNode(objects, key);
|
|
1523
|
+
if (node) {
|
|
1524
|
+
node.value = value;
|
|
1525
|
+
} else {
|
|
1526
|
+
// Prepend the new node to the beginning of the list
|
|
1527
|
+
objects.next = { // eslint-disable-line no-param-reassign
|
|
1528
|
+
key: key,
|
|
1529
|
+
next: objects.next,
|
|
1530
|
+
value: value
|
|
1531
|
+
};
|
|
1532
|
+
}
|
|
1533
|
+
};
|
|
1534
|
+
var listHas = function (objects, key) {
|
|
1535
|
+
return !!listGetNode(objects, key);
|
|
1536
|
+
};
|
|
1537
|
+
|
|
1538
|
+
var sideChannel = function getSideChannel() {
|
|
1539
|
+
var $wm;
|
|
1540
|
+
var $m;
|
|
1541
|
+
var $o;
|
|
1542
|
+
var channel = {
|
|
1543
|
+
assert: function (key) {
|
|
1544
|
+
if (!channel.has(key)) {
|
|
1545
|
+
throw new $TypeError('Side channel does not contain ' + inspect(key));
|
|
1546
|
+
}
|
|
1547
|
+
},
|
|
1548
|
+
get: function (key) { // eslint-disable-line consistent-return
|
|
1549
|
+
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
1550
|
+
if ($wm) {
|
|
1551
|
+
return $weakMapGet($wm, key);
|
|
1552
|
+
}
|
|
1553
|
+
} else if ($Map) {
|
|
1554
|
+
if ($m) {
|
|
1555
|
+
return $mapGet($m, key);
|
|
1556
|
+
}
|
|
1557
|
+
} else {
|
|
1558
|
+
if ($o) { // eslint-disable-line no-lonely-if
|
|
1559
|
+
return listGet($o, key);
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
},
|
|
1563
|
+
has: function (key) {
|
|
1564
|
+
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
1565
|
+
if ($wm) {
|
|
1566
|
+
return $weakMapHas($wm, key);
|
|
1567
|
+
}
|
|
1568
|
+
} else if ($Map) {
|
|
1569
|
+
if ($m) {
|
|
1570
|
+
return $mapHas($m, key);
|
|
1571
|
+
}
|
|
1572
|
+
} else {
|
|
1573
|
+
if ($o) { // eslint-disable-line no-lonely-if
|
|
1574
|
+
return listHas($o, key);
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
return false;
|
|
1578
|
+
},
|
|
1579
|
+
set: function (key, value) {
|
|
1580
|
+
if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
|
|
1581
|
+
if (!$wm) {
|
|
1582
|
+
$wm = new $WeakMap();
|
|
1583
|
+
}
|
|
1584
|
+
$weakMapSet($wm, key, value);
|
|
1585
|
+
} else if ($Map) {
|
|
1586
|
+
if (!$m) {
|
|
1587
|
+
$m = new $Map();
|
|
1588
|
+
}
|
|
1589
|
+
$mapSet($m, key, value);
|
|
1590
|
+
} else {
|
|
1591
|
+
if (!$o) {
|
|
1592
|
+
/*
|
|
1593
|
+
* Initialize the linked list as an empty node, so that we don't have
|
|
1594
|
+
* to special-case handling of the first node: we can always refer to
|
|
1595
|
+
* it as (previous node).next, instead of something like (list).head
|
|
1596
|
+
*/
|
|
1597
|
+
$o = { key: {}, next: null };
|
|
1598
|
+
}
|
|
1599
|
+
listSet($o, key, value);
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
};
|
|
1603
|
+
return channel;
|
|
1604
|
+
};
|
|
1605
|
+
|
|
1606
|
+
var replace = String.prototype.replace;
|
|
1607
|
+
var percentTwenties = /%20/g;
|
|
1608
|
+
|
|
1609
|
+
var Format = {
|
|
1610
|
+
RFC1738: 'RFC1738',
|
|
1611
|
+
RFC3986: 'RFC3986'
|
|
1612
|
+
};
|
|
1613
|
+
|
|
1614
|
+
var formats$3 = {
|
|
1615
|
+
'default': Format.RFC3986,
|
|
1616
|
+
formatters: {
|
|
1617
|
+
RFC1738: function (value) {
|
|
1618
|
+
return replace.call(value, percentTwenties, '+');
|
|
1619
|
+
},
|
|
1620
|
+
RFC3986: function (value) {
|
|
1621
|
+
return String(value);
|
|
1622
|
+
}
|
|
1623
|
+
},
|
|
1624
|
+
RFC1738: Format.RFC1738,
|
|
1625
|
+
RFC3986: Format.RFC3986
|
|
1626
|
+
};
|
|
1627
|
+
|
|
1628
|
+
var formats$2 = formats$3;
|
|
1629
|
+
|
|
1630
|
+
var has$2 = Object.prototype.hasOwnProperty;
|
|
1631
|
+
var isArray$2 = Array.isArray;
|
|
1632
|
+
|
|
1633
|
+
var hexTable = (function () {
|
|
1634
|
+
var array = [];
|
|
1635
|
+
for (var i = 0; i < 256; ++i) {
|
|
1636
|
+
array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
return array;
|
|
1640
|
+
}());
|
|
1641
|
+
|
|
1642
|
+
var compactQueue = function compactQueue(queue) {
|
|
1643
|
+
while (queue.length > 1) {
|
|
1644
|
+
var item = queue.pop();
|
|
1645
|
+
var obj = item.obj[item.prop];
|
|
1646
|
+
|
|
1647
|
+
if (isArray$2(obj)) {
|
|
1648
|
+
var compacted = [];
|
|
1649
|
+
|
|
1650
|
+
for (var j = 0; j < obj.length; ++j) {
|
|
1651
|
+
if (typeof obj[j] !== 'undefined') {
|
|
1652
|
+
compacted.push(obj[j]);
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
item.obj[item.prop] = compacted;
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
};
|
|
1660
|
+
|
|
1661
|
+
var arrayToObject = function arrayToObject(source, options) {
|
|
1662
|
+
var obj = options && options.plainObjects ? Object.create(null) : {};
|
|
1663
|
+
for (var i = 0; i < source.length; ++i) {
|
|
1664
|
+
if (typeof source[i] !== 'undefined') {
|
|
1665
|
+
obj[i] = source[i];
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
return obj;
|
|
1670
|
+
};
|
|
1671
|
+
|
|
1672
|
+
var merge$2 = function merge(target, source, options) {
|
|
1673
|
+
/* eslint no-param-reassign: 0 */
|
|
1674
|
+
if (!source) {
|
|
1675
|
+
return target;
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
if (typeof source !== 'object') {
|
|
1679
|
+
if (isArray$2(target)) {
|
|
1680
|
+
target.push(source);
|
|
1681
|
+
} else if (target && typeof target === 'object') {
|
|
1682
|
+
if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
|
|
1683
|
+
target[source] = true;
|
|
1684
|
+
}
|
|
1685
|
+
} else {
|
|
1686
|
+
return [target, source];
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
return target;
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
if (!target || typeof target !== 'object') {
|
|
1693
|
+
return [target].concat(source);
|
|
1694
|
+
}
|
|
1695
|
+
|
|
1696
|
+
var mergeTarget = target;
|
|
1697
|
+
if (isArray$2(target) && !isArray$2(source)) {
|
|
1698
|
+
mergeTarget = arrayToObject(target, options);
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
if (isArray$2(target) && isArray$2(source)) {
|
|
1702
|
+
source.forEach(function (item, i) {
|
|
1703
|
+
if (has$2.call(target, i)) {
|
|
1704
|
+
var targetItem = target[i];
|
|
1705
|
+
if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
|
|
1706
|
+
target[i] = merge(targetItem, item, options);
|
|
1707
|
+
} else {
|
|
1708
|
+
target.push(item);
|
|
1709
|
+
}
|
|
1710
|
+
} else {
|
|
1711
|
+
target[i] = item;
|
|
1712
|
+
}
|
|
1713
|
+
});
|
|
1714
|
+
return target;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
return Object.keys(source).reduce(function (acc, key) {
|
|
1718
|
+
var value = source[key];
|
|
1719
|
+
|
|
1720
|
+
if (has$2.call(acc, key)) {
|
|
1721
|
+
acc[key] = merge(acc[key], value, options);
|
|
1722
|
+
} else {
|
|
1723
|
+
acc[key] = value;
|
|
1724
|
+
}
|
|
1725
|
+
return acc;
|
|
1726
|
+
}, mergeTarget);
|
|
1727
|
+
};
|
|
1728
|
+
|
|
1729
|
+
var assign = function assignSingleSource(target, source) {
|
|
1730
|
+
return Object.keys(source).reduce(function (acc, key) {
|
|
1731
|
+
acc[key] = source[key];
|
|
1732
|
+
return acc;
|
|
1733
|
+
}, target);
|
|
1734
|
+
};
|
|
1735
|
+
|
|
1736
|
+
var decode = function (str, decoder, charset) {
|
|
1737
|
+
var strWithoutPlus = str.replace(/\+/g, ' ');
|
|
1738
|
+
if (charset === 'iso-8859-1') {
|
|
1739
|
+
// unescape never throws, no try...catch needed:
|
|
1740
|
+
return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
1741
|
+
}
|
|
1742
|
+
// utf-8
|
|
1743
|
+
try {
|
|
1744
|
+
return decodeURIComponent(strWithoutPlus);
|
|
1745
|
+
} catch (e) {
|
|
1746
|
+
return strWithoutPlus;
|
|
1747
|
+
}
|
|
1748
|
+
};
|
|
1749
|
+
|
|
1750
|
+
var encode = function encode(str, defaultEncoder, charset, kind, format) {
|
|
1751
|
+
// This code was originally written by Brian White (mscdex) for the io.js core querystring library.
|
|
1752
|
+
// It has been adapted here for stricter adherence to RFC 3986
|
|
1753
|
+
if (str.length === 0) {
|
|
1754
|
+
return str;
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
var string = str;
|
|
1758
|
+
if (typeof str === 'symbol') {
|
|
1759
|
+
string = Symbol.prototype.toString.call(str);
|
|
1760
|
+
} else if (typeof str !== 'string') {
|
|
1761
|
+
string = String(str);
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
if (charset === 'iso-8859-1') {
|
|
1765
|
+
return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
|
|
1766
|
+
return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
|
|
1767
|
+
});
|
|
1768
|
+
}
|
|
1769
|
+
|
|
1770
|
+
var out = '';
|
|
1771
|
+
for (var i = 0; i < string.length; ++i) {
|
|
1772
|
+
var c = string.charCodeAt(i);
|
|
1773
|
+
|
|
1774
|
+
if (
|
|
1775
|
+
c === 0x2D // -
|
|
1776
|
+
|| c === 0x2E // .
|
|
1777
|
+
|| c === 0x5F // _
|
|
1778
|
+
|| c === 0x7E // ~
|
|
1779
|
+
|| (c >= 0x30 && c <= 0x39) // 0-9
|
|
1780
|
+
|| (c >= 0x41 && c <= 0x5A) // a-z
|
|
1781
|
+
|| (c >= 0x61 && c <= 0x7A) // A-Z
|
|
1782
|
+
|| (format === formats$2.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
|
|
1783
|
+
) {
|
|
1784
|
+
out += string.charAt(i);
|
|
1785
|
+
continue;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
if (c < 0x80) {
|
|
1789
|
+
out = out + hexTable[c];
|
|
1790
|
+
continue;
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
if (c < 0x800) {
|
|
1794
|
+
out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
|
|
1795
|
+
continue;
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
if (c < 0xD800 || c >= 0xE000) {
|
|
1799
|
+
out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
|
|
1800
|
+
continue;
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
i += 1;
|
|
1804
|
+
c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
|
|
1805
|
+
/* eslint operator-linebreak: [2, "before"] */
|
|
1806
|
+
out += hexTable[0xF0 | (c >> 18)]
|
|
1807
|
+
+ hexTable[0x80 | ((c >> 12) & 0x3F)]
|
|
1808
|
+
+ hexTable[0x80 | ((c >> 6) & 0x3F)]
|
|
1809
|
+
+ hexTable[0x80 | (c & 0x3F)];
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
return out;
|
|
1813
|
+
};
|
|
1814
|
+
|
|
1815
|
+
var compact = function compact(value) {
|
|
1816
|
+
var queue = [{ obj: { o: value }, prop: 'o' }];
|
|
1817
|
+
var refs = [];
|
|
1818
|
+
|
|
1819
|
+
for (var i = 0; i < queue.length; ++i) {
|
|
1820
|
+
var item = queue[i];
|
|
1821
|
+
var obj = item.obj[item.prop];
|
|
1822
|
+
|
|
1823
|
+
var keys = Object.keys(obj);
|
|
1824
|
+
for (var j = 0; j < keys.length; ++j) {
|
|
1825
|
+
var key = keys[j];
|
|
1826
|
+
var val = obj[key];
|
|
1827
|
+
if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
|
|
1828
|
+
queue.push({ obj: obj, prop: key });
|
|
1829
|
+
refs.push(val);
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
compactQueue(queue);
|
|
1835
|
+
|
|
1836
|
+
return value;
|
|
1837
|
+
};
|
|
1838
|
+
|
|
1839
|
+
var isRegExp = function isRegExp(obj) {
|
|
1840
|
+
return Object.prototype.toString.call(obj) === '[object RegExp]';
|
|
1841
|
+
};
|
|
1842
|
+
|
|
1843
|
+
var isBuffer = function isBuffer(obj) {
|
|
1844
|
+
if (!obj || typeof obj !== 'object') {
|
|
1845
|
+
return false;
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
1849
|
+
};
|
|
1850
|
+
|
|
1851
|
+
var combine = function combine(a, b) {
|
|
1852
|
+
return [].concat(a, b);
|
|
1853
|
+
};
|
|
1854
|
+
|
|
1855
|
+
var maybeMap = function maybeMap(val, fn) {
|
|
1856
|
+
if (isArray$2(val)) {
|
|
1857
|
+
var mapped = [];
|
|
1858
|
+
for (var i = 0; i < val.length; i += 1) {
|
|
1859
|
+
mapped.push(fn(val[i]));
|
|
1860
|
+
}
|
|
1861
|
+
return mapped;
|
|
1862
|
+
}
|
|
1863
|
+
return fn(val);
|
|
1864
|
+
};
|
|
1865
|
+
|
|
1866
|
+
var utils$n = {
|
|
1867
|
+
arrayToObject: arrayToObject,
|
|
1868
|
+
assign: assign,
|
|
1869
|
+
combine: combine,
|
|
1870
|
+
compact: compact,
|
|
1871
|
+
decode: decode,
|
|
1872
|
+
encode: encode,
|
|
1873
|
+
isBuffer: isBuffer,
|
|
1874
|
+
isRegExp: isRegExp,
|
|
1875
|
+
maybeMap: maybeMap,
|
|
1876
|
+
merge: merge$2
|
|
1877
|
+
};
|
|
1878
|
+
|
|
1879
|
+
var getSideChannel = sideChannel;
|
|
1880
|
+
var utils$m = utils$n;
|
|
1881
|
+
var formats$1 = formats$3;
|
|
1882
|
+
var has$1 = Object.prototype.hasOwnProperty;
|
|
1883
|
+
|
|
1884
|
+
var arrayPrefixGenerators = {
|
|
1885
|
+
brackets: function brackets(prefix) {
|
|
1886
|
+
return prefix + '[]';
|
|
1887
|
+
},
|
|
1888
|
+
comma: 'comma',
|
|
1889
|
+
indices: function indices(prefix, key) {
|
|
1890
|
+
return prefix + '[' + key + ']';
|
|
1891
|
+
},
|
|
1892
|
+
repeat: function repeat(prefix) {
|
|
1893
|
+
return prefix;
|
|
1894
|
+
}
|
|
1895
|
+
};
|
|
1896
|
+
|
|
1897
|
+
var isArray$1 = Array.isArray;
|
|
1898
|
+
var push = Array.prototype.push;
|
|
1899
|
+
var pushToArray = function (arr, valueOrArray) {
|
|
1900
|
+
push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
|
|
1901
|
+
};
|
|
1902
|
+
|
|
1903
|
+
var toISO = Date.prototype.toISOString;
|
|
1904
|
+
|
|
1905
|
+
var defaultFormat = formats$1['default'];
|
|
1906
|
+
var defaults$1 = {
|
|
1907
|
+
addQueryPrefix: false,
|
|
1908
|
+
allowDots: false,
|
|
1909
|
+
charset: 'utf-8',
|
|
1910
|
+
charsetSentinel: false,
|
|
1911
|
+
delimiter: '&',
|
|
1912
|
+
encode: true,
|
|
1913
|
+
encoder: utils$m.encode,
|
|
1914
|
+
encodeValuesOnly: false,
|
|
1915
|
+
format: defaultFormat,
|
|
1916
|
+
formatter: formats$1.formatters[defaultFormat],
|
|
1917
|
+
// deprecated
|
|
1918
|
+
indices: false,
|
|
1919
|
+
serializeDate: function serializeDate(date) {
|
|
1920
|
+
return toISO.call(date);
|
|
1921
|
+
},
|
|
1922
|
+
skipNulls: false,
|
|
1923
|
+
strictNullHandling: false
|
|
1924
|
+
};
|
|
1925
|
+
|
|
1926
|
+
var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
|
|
1927
|
+
return typeof v === 'string'
|
|
1928
|
+
|| typeof v === 'number'
|
|
1929
|
+
|| typeof v === 'boolean'
|
|
1930
|
+
|| typeof v === 'symbol'
|
|
1931
|
+
|| typeof v === 'bigint';
|
|
1932
|
+
};
|
|
1933
|
+
|
|
1934
|
+
var sentinel = {};
|
|
1935
|
+
|
|
1936
|
+
var stringify$6 = function stringify(
|
|
1937
|
+
object,
|
|
1938
|
+
prefix,
|
|
1939
|
+
generateArrayPrefix,
|
|
1940
|
+
commaRoundTrip,
|
|
1941
|
+
strictNullHandling,
|
|
1942
|
+
skipNulls,
|
|
1943
|
+
encoder,
|
|
1944
|
+
filter,
|
|
1945
|
+
sort,
|
|
1946
|
+
allowDots,
|
|
1947
|
+
serializeDate,
|
|
1948
|
+
format,
|
|
1949
|
+
formatter,
|
|
1950
|
+
encodeValuesOnly,
|
|
1951
|
+
charset,
|
|
1952
|
+
sideChannel
|
|
1953
|
+
) {
|
|
1954
|
+
var obj = object;
|
|
1955
|
+
|
|
1956
|
+
var tmpSc = sideChannel;
|
|
1957
|
+
var step = 0;
|
|
1958
|
+
var findFlag = false;
|
|
1959
|
+
while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
|
|
1960
|
+
// Where object last appeared in the ref tree
|
|
1961
|
+
var pos = tmpSc.get(object);
|
|
1962
|
+
step += 1;
|
|
1963
|
+
if (typeof pos !== 'undefined') {
|
|
1964
|
+
if (pos === step) {
|
|
1965
|
+
throw new RangeError('Cyclic object value');
|
|
1966
|
+
} else {
|
|
1967
|
+
findFlag = true; // Break while
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
if (typeof tmpSc.get(sentinel) === 'undefined') {
|
|
1971
|
+
step = 0;
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
if (typeof filter === 'function') {
|
|
1976
|
+
obj = filter(prefix, obj);
|
|
1977
|
+
} else if (obj instanceof Date) {
|
|
1978
|
+
obj = serializeDate(obj);
|
|
1979
|
+
} else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
|
|
1980
|
+
obj = utils$m.maybeMap(obj, function (value) {
|
|
1981
|
+
if (value instanceof Date) {
|
|
1982
|
+
return serializeDate(value);
|
|
1983
|
+
}
|
|
1984
|
+
return value;
|
|
1985
|
+
});
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
if (obj === null) {
|
|
1989
|
+
if (strictNullHandling) {
|
|
1990
|
+
return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix;
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
obj = '';
|
|
1994
|
+
}
|
|
1995
|
+
|
|
1996
|
+
if (isNonNullishPrimitive(obj) || utils$m.isBuffer(obj)) {
|
|
1997
|
+
if (encoder) {
|
|
1998
|
+
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key', format);
|
|
1999
|
+
return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value', format))];
|
|
2000
|
+
}
|
|
2001
|
+
return [formatter(prefix) + '=' + formatter(String(obj))];
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
var values = [];
|
|
2005
|
+
|
|
2006
|
+
if (typeof obj === 'undefined') {
|
|
2007
|
+
return values;
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
var objKeys;
|
|
2011
|
+
if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
|
|
2012
|
+
// we need to join elements in
|
|
2013
|
+
if (encodeValuesOnly && encoder) {
|
|
2014
|
+
obj = utils$m.maybeMap(obj, encoder);
|
|
2015
|
+
}
|
|
2016
|
+
objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
|
|
2017
|
+
} else if (isArray$1(filter)) {
|
|
2018
|
+
objKeys = filter;
|
|
2019
|
+
} else {
|
|
2020
|
+
var keys = Object.keys(obj);
|
|
2021
|
+
objKeys = sort ? keys.sort(sort) : keys;
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
|
|
2025
|
+
|
|
2026
|
+
for (var j = 0; j < objKeys.length; ++j) {
|
|
2027
|
+
var key = objKeys[j];
|
|
2028
|
+
var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
|
|
2029
|
+
|
|
2030
|
+
if (skipNulls && value === null) {
|
|
2031
|
+
continue;
|
|
2032
|
+
}
|
|
2033
|
+
|
|
2034
|
+
var keyPrefix = isArray$1(obj)
|
|
2035
|
+
? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
|
|
2036
|
+
: adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
|
|
2037
|
+
|
|
2038
|
+
sideChannel.set(object, step);
|
|
2039
|
+
var valueSideChannel = getSideChannel();
|
|
2040
|
+
valueSideChannel.set(sentinel, sideChannel);
|
|
2041
|
+
pushToArray(values, stringify(
|
|
2042
|
+
value,
|
|
2043
|
+
keyPrefix,
|
|
2044
|
+
generateArrayPrefix,
|
|
2045
|
+
commaRoundTrip,
|
|
2046
|
+
strictNullHandling,
|
|
2047
|
+
skipNulls,
|
|
2048
|
+
generateArrayPrefix === 'comma' && encodeValuesOnly && isArray$1(obj) ? null : encoder,
|
|
2049
|
+
filter,
|
|
2050
|
+
sort,
|
|
2051
|
+
allowDots,
|
|
2052
|
+
serializeDate,
|
|
2053
|
+
format,
|
|
2054
|
+
formatter,
|
|
2055
|
+
encodeValuesOnly,
|
|
2056
|
+
charset,
|
|
2057
|
+
valueSideChannel
|
|
2058
|
+
));
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
return values;
|
|
2062
|
+
};
|
|
2063
|
+
|
|
2064
|
+
var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
|
|
2065
|
+
if (!opts) {
|
|
2066
|
+
return defaults$1;
|
|
2067
|
+
}
|
|
2068
|
+
|
|
2069
|
+
if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
|
|
2070
|
+
throw new TypeError('Encoder has to be a function.');
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
var charset = opts.charset || defaults$1.charset;
|
|
2074
|
+
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
|
2075
|
+
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
var format = formats$1['default'];
|
|
2079
|
+
if (typeof opts.format !== 'undefined') {
|
|
2080
|
+
if (!has$1.call(formats$1.formatters, opts.format)) {
|
|
2081
|
+
throw new TypeError('Unknown format option provided.');
|
|
2082
|
+
}
|
|
2083
|
+
format = opts.format;
|
|
2084
|
+
}
|
|
2085
|
+
var formatter = formats$1.formatters[format];
|
|
2086
|
+
|
|
2087
|
+
var filter = defaults$1.filter;
|
|
2088
|
+
if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
|
|
2089
|
+
filter = opts.filter;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
return {
|
|
2093
|
+
addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
|
|
2094
|
+
allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
|
|
2095
|
+
charset: charset,
|
|
2096
|
+
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
|
|
2097
|
+
delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
|
|
2098
|
+
encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
|
|
2099
|
+
encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
|
|
2100
|
+
encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
|
|
2101
|
+
filter: filter,
|
|
2102
|
+
format: format,
|
|
2103
|
+
formatter: formatter,
|
|
2104
|
+
serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
|
|
2105
|
+
skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
|
|
2106
|
+
sort: typeof opts.sort === 'function' ? opts.sort : null,
|
|
2107
|
+
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
|
|
2108
|
+
};
|
|
2109
|
+
};
|
|
2110
|
+
|
|
2111
|
+
var stringify_1 = function (object, opts) {
|
|
2112
|
+
var obj = object;
|
|
2113
|
+
var options = normalizeStringifyOptions(opts);
|
|
2114
|
+
|
|
2115
|
+
var objKeys;
|
|
2116
|
+
var filter;
|
|
2117
|
+
|
|
2118
|
+
if (typeof options.filter === 'function') {
|
|
2119
|
+
filter = options.filter;
|
|
2120
|
+
obj = filter('', obj);
|
|
2121
|
+
} else if (isArray$1(options.filter)) {
|
|
2122
|
+
filter = options.filter;
|
|
2123
|
+
objKeys = filter;
|
|
2124
|
+
}
|
|
2125
|
+
|
|
2126
|
+
var keys = [];
|
|
2127
|
+
|
|
2128
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
2129
|
+
return '';
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
var arrayFormat;
|
|
2133
|
+
if (opts && opts.arrayFormat in arrayPrefixGenerators) {
|
|
2134
|
+
arrayFormat = opts.arrayFormat;
|
|
2135
|
+
} else if (opts && 'indices' in opts) {
|
|
2136
|
+
arrayFormat = opts.indices ? 'indices' : 'repeat';
|
|
2137
|
+
} else {
|
|
2138
|
+
arrayFormat = 'indices';
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
2142
|
+
if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
|
|
2143
|
+
throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
|
|
2144
|
+
}
|
|
2145
|
+
var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
|
|
2146
|
+
|
|
2147
|
+
if (!objKeys) {
|
|
2148
|
+
objKeys = Object.keys(obj);
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
if (options.sort) {
|
|
2152
|
+
objKeys.sort(options.sort);
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2155
|
+
var sideChannel = getSideChannel();
|
|
2156
|
+
for (var i = 0; i < objKeys.length; ++i) {
|
|
2157
|
+
var key = objKeys[i];
|
|
2158
|
+
|
|
2159
|
+
if (options.skipNulls && obj[key] === null) {
|
|
2160
|
+
continue;
|
|
2161
|
+
}
|
|
2162
|
+
pushToArray(keys, stringify$6(
|
|
2163
|
+
obj[key],
|
|
2164
|
+
key,
|
|
2165
|
+
generateArrayPrefix,
|
|
2166
|
+
commaRoundTrip,
|
|
2167
|
+
options.strictNullHandling,
|
|
2168
|
+
options.skipNulls,
|
|
2169
|
+
options.encode ? options.encoder : null,
|
|
2170
|
+
options.filter,
|
|
2171
|
+
options.sort,
|
|
2172
|
+
options.allowDots,
|
|
2173
|
+
options.serializeDate,
|
|
2174
|
+
options.format,
|
|
2175
|
+
options.formatter,
|
|
2176
|
+
options.encodeValuesOnly,
|
|
2177
|
+
options.charset,
|
|
2178
|
+
sideChannel
|
|
2179
|
+
));
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
var joined = keys.join(options.delimiter);
|
|
2183
|
+
var prefix = options.addQueryPrefix === true ? '?' : '';
|
|
2184
|
+
|
|
2185
|
+
if (options.charsetSentinel) {
|
|
2186
|
+
if (options.charset === 'iso-8859-1') {
|
|
2187
|
+
// encodeURIComponent('✓'), the "numeric entity" representation of a checkmark
|
|
2188
|
+
prefix += 'utf8=%26%2310003%3B&';
|
|
2189
|
+
} else {
|
|
2190
|
+
// encodeURIComponent('✓')
|
|
2191
|
+
prefix += 'utf8=%E2%9C%93&';
|
|
2192
|
+
}
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
return joined.length > 0 ? prefix + joined : '';
|
|
2196
|
+
};
|
|
2197
|
+
|
|
2198
|
+
var utils$l = utils$n;
|
|
2199
|
+
|
|
2200
|
+
var has = Object.prototype.hasOwnProperty;
|
|
2201
|
+
var isArray = Array.isArray;
|
|
2202
|
+
|
|
2203
|
+
var defaults = {
|
|
2204
|
+
allowDots: false,
|
|
2205
|
+
allowPrototypes: false,
|
|
2206
|
+
allowSparse: false,
|
|
2207
|
+
arrayLimit: 20,
|
|
2208
|
+
charset: 'utf-8',
|
|
2209
|
+
charsetSentinel: false,
|
|
2210
|
+
comma: false,
|
|
2211
|
+
decoder: utils$l.decode,
|
|
2212
|
+
delimiter: '&',
|
|
2213
|
+
depth: 5,
|
|
2214
|
+
ignoreQueryPrefix: false,
|
|
2215
|
+
interpretNumericEntities: false,
|
|
2216
|
+
parameterLimit: 1000,
|
|
2217
|
+
parseArrays: true,
|
|
2218
|
+
plainObjects: false,
|
|
2219
|
+
strictNullHandling: false
|
|
2220
|
+
};
|
|
2221
|
+
|
|
2222
|
+
var interpretNumericEntities = function (str) {
|
|
2223
|
+
return str.replace(/&#(\d+);/g, function ($0, numberStr) {
|
|
2224
|
+
return String.fromCharCode(parseInt(numberStr, 10));
|
|
2225
|
+
});
|
|
2226
|
+
};
|
|
2227
|
+
|
|
2228
|
+
var parseArrayValue = function (val, options) {
|
|
2229
|
+
if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
|
|
2230
|
+
return val.split(',');
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2233
|
+
return val;
|
|
2234
|
+
};
|
|
2235
|
+
|
|
2236
|
+
// This is what browsers will submit when the ✓ character occurs in an
|
|
2237
|
+
// application/x-www-form-urlencoded body and the encoding of the page containing
|
|
2238
|
+
// the form is iso-8859-1, or when the submitted form has an accept-charset
|
|
2239
|
+
// attribute of iso-8859-1. Presumably also with other charsets that do not contain
|
|
2240
|
+
// the ✓ character, such as us-ascii.
|
|
2241
|
+
var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')
|
|
2242
|
+
|
|
2243
|
+
// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
|
|
2244
|
+
var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
|
|
2245
|
+
|
|
2246
|
+
var parseValues = function parseQueryStringValues(str, options) {
|
|
2247
|
+
var obj = { __proto__: null };
|
|
2248
|
+
|
|
2249
|
+
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
|
|
2250
|
+
var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
|
|
2251
|
+
var parts = cleanStr.split(options.delimiter, limit);
|
|
2252
|
+
var skipIndex = -1; // Keep track of where the utf8 sentinel was found
|
|
2253
|
+
var i;
|
|
2254
|
+
|
|
2255
|
+
var charset = options.charset;
|
|
2256
|
+
if (options.charsetSentinel) {
|
|
2257
|
+
for (i = 0; i < parts.length; ++i) {
|
|
2258
|
+
if (parts[i].indexOf('utf8=') === 0) {
|
|
2259
|
+
if (parts[i] === charsetSentinel) {
|
|
2260
|
+
charset = 'utf-8';
|
|
2261
|
+
} else if (parts[i] === isoSentinel) {
|
|
2262
|
+
charset = 'iso-8859-1';
|
|
2263
|
+
}
|
|
2264
|
+
skipIndex = i;
|
|
2265
|
+
i = parts.length; // The eslint settings do not allow break;
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
|
|
2270
|
+
for (i = 0; i < parts.length; ++i) {
|
|
2271
|
+
if (i === skipIndex) {
|
|
2272
|
+
continue;
|
|
2273
|
+
}
|
|
2274
|
+
var part = parts[i];
|
|
2275
|
+
|
|
2276
|
+
var bracketEqualsPos = part.indexOf(']=');
|
|
2277
|
+
var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
|
|
2278
|
+
|
|
2279
|
+
var key, val;
|
|
2280
|
+
if (pos === -1) {
|
|
2281
|
+
key = options.decoder(part, defaults.decoder, charset, 'key');
|
|
2282
|
+
val = options.strictNullHandling ? null : '';
|
|
2283
|
+
} else {
|
|
2284
|
+
key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
|
|
2285
|
+
val = utils$l.maybeMap(
|
|
2286
|
+
parseArrayValue(part.slice(pos + 1), options),
|
|
2287
|
+
function (encodedVal) {
|
|
2288
|
+
return options.decoder(encodedVal, defaults.decoder, charset, 'value');
|
|
2289
|
+
}
|
|
2290
|
+
);
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
|
|
2294
|
+
val = interpretNumericEntities(val);
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
if (part.indexOf('[]=') > -1) {
|
|
2298
|
+
val = isArray(val) ? [val] : val;
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
if (has.call(obj, key)) {
|
|
2302
|
+
obj[key] = utils$l.combine(obj[key], val);
|
|
2303
|
+
} else {
|
|
2304
|
+
obj[key] = val;
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
|
|
2308
|
+
return obj;
|
|
2309
|
+
};
|
|
2310
|
+
|
|
2311
|
+
var parseObject = function (chain, val, options, valuesParsed) {
|
|
2312
|
+
var leaf = valuesParsed ? val : parseArrayValue(val, options);
|
|
2313
|
+
|
|
2314
|
+
for (var i = chain.length - 1; i >= 0; --i) {
|
|
2315
|
+
var obj;
|
|
2316
|
+
var root = chain[i];
|
|
2317
|
+
|
|
2318
|
+
if (root === '[]' && options.parseArrays) {
|
|
2319
|
+
obj = [].concat(leaf);
|
|
2320
|
+
} else {
|
|
2321
|
+
obj = options.plainObjects ? Object.create(null) : {};
|
|
2322
|
+
var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
|
|
2323
|
+
var index = parseInt(cleanRoot, 10);
|
|
2324
|
+
if (!options.parseArrays && cleanRoot === '') {
|
|
2325
|
+
obj = { 0: leaf };
|
|
2326
|
+
} else if (
|
|
2327
|
+
!isNaN(index)
|
|
2328
|
+
&& root !== cleanRoot
|
|
2329
|
+
&& String(index) === cleanRoot
|
|
2330
|
+
&& index >= 0
|
|
2331
|
+
&& (options.parseArrays && index <= options.arrayLimit)
|
|
2332
|
+
) {
|
|
2333
|
+
obj = [];
|
|
2334
|
+
obj[index] = leaf;
|
|
2335
|
+
} else if (cleanRoot !== '__proto__') {
|
|
2336
|
+
obj[cleanRoot] = leaf;
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
|
|
2340
|
+
leaf = obj;
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
return leaf;
|
|
2344
|
+
};
|
|
2345
|
+
|
|
2346
|
+
var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
|
|
2347
|
+
if (!givenKey) {
|
|
2348
|
+
return;
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
// Transform dot notation to bracket notation
|
|
2352
|
+
var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
|
|
2353
|
+
|
|
2354
|
+
// The regex chunks
|
|
2355
|
+
|
|
2356
|
+
var brackets = /(\[[^[\]]*])/;
|
|
2357
|
+
var child = /(\[[^[\]]*])/g;
|
|
2358
|
+
|
|
2359
|
+
// Get the parent
|
|
2360
|
+
|
|
2361
|
+
var segment = options.depth > 0 && brackets.exec(key);
|
|
2362
|
+
var parent = segment ? key.slice(0, segment.index) : key;
|
|
2363
|
+
|
|
2364
|
+
// Stash the parent if it exists
|
|
2365
|
+
|
|
2366
|
+
var keys = [];
|
|
2367
|
+
if (parent) {
|
|
2368
|
+
// If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
|
|
2369
|
+
if (!options.plainObjects && has.call(Object.prototype, parent)) {
|
|
2370
|
+
if (!options.allowPrototypes) {
|
|
2371
|
+
return;
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
keys.push(parent);
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2378
|
+
// Loop through children appending to the array until we hit depth
|
|
2379
|
+
|
|
2380
|
+
var i = 0;
|
|
2381
|
+
while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
|
|
2382
|
+
i += 1;
|
|
2383
|
+
if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
|
|
2384
|
+
if (!options.allowPrototypes) {
|
|
2385
|
+
return;
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
keys.push(segment[1]);
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2391
|
+
// If there's a remainder, just add whatever is left
|
|
2392
|
+
|
|
2393
|
+
if (segment) {
|
|
2394
|
+
keys.push('[' + key.slice(segment.index) + ']');
|
|
2395
|
+
}
|
|
2396
|
+
|
|
2397
|
+
return parseObject(keys, val, options, valuesParsed);
|
|
2398
|
+
};
|
|
2399
|
+
|
|
2400
|
+
var normalizeParseOptions = function normalizeParseOptions(opts) {
|
|
2401
|
+
if (!opts) {
|
|
2402
|
+
return defaults;
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2405
|
+
if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
|
|
2406
|
+
throw new TypeError('Decoder has to be a function.');
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2409
|
+
if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
|
|
2410
|
+
throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
|
|
2411
|
+
}
|
|
2412
|
+
var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
|
|
2413
|
+
|
|
2414
|
+
return {
|
|
2415
|
+
allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
|
|
2416
|
+
allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
|
|
2417
|
+
allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
|
|
2418
|
+
arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
|
|
2419
|
+
charset: charset,
|
|
2420
|
+
charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
2421
|
+
comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
|
|
2422
|
+
decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
|
|
2423
|
+
delimiter: typeof opts.delimiter === 'string' || utils$l.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
|
|
2424
|
+
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
2425
|
+
depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
|
|
2426
|
+
ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
|
|
2427
|
+
interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
|
|
2428
|
+
parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
|
|
2429
|
+
parseArrays: opts.parseArrays !== false,
|
|
2430
|
+
plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
|
|
2431
|
+
strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
|
|
2432
|
+
};
|
|
2433
|
+
};
|
|
2434
|
+
|
|
2435
|
+
var parse$6 = function (str, opts) {
|
|
2436
|
+
var options = normalizeParseOptions(opts);
|
|
2437
|
+
|
|
2438
|
+
if (str === '' || str === null || typeof str === 'undefined') {
|
|
2439
|
+
return options.plainObjects ? Object.create(null) : {};
|
|
2440
|
+
}
|
|
2441
|
+
|
|
2442
|
+
var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
|
|
2443
|
+
var obj = options.plainObjects ? Object.create(null) : {};
|
|
2444
|
+
|
|
2445
|
+
// Iterate over the keys and setup the new object
|
|
2446
|
+
|
|
2447
|
+
var keys = Object.keys(tempObj);
|
|
2448
|
+
for (var i = 0; i < keys.length; ++i) {
|
|
2449
|
+
var key = keys[i];
|
|
2450
|
+
var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
|
|
2451
|
+
obj = utils$l.merge(obj, newObj, options);
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2454
|
+
if (options.allowSparse === true) {
|
|
2455
|
+
return obj;
|
|
2456
|
+
}
|
|
2457
|
+
|
|
2458
|
+
return utils$l.compact(obj);
|
|
2459
|
+
};
|
|
2460
|
+
|
|
2461
|
+
var stringify$5 = stringify_1;
|
|
2462
|
+
var parse$5 = parse$6;
|
|
2463
|
+
var formats = formats$3;
|
|
2464
|
+
|
|
2465
|
+
var lib = {
|
|
2466
|
+
formats: formats,
|
|
2467
|
+
parse: parse$5,
|
|
2468
|
+
stringify: stringify$5
|
|
2469
|
+
};
|
|
2470
|
+
|
|
2471
|
+
class CustomCommands {
|
|
2472
|
+
constructor(page, request, baseURL = process.env.BASE_URL) {
|
|
2473
|
+
this.interceptMultipleResponses = ({ responseUrl = "", responseStatus = 200, times = 1, baseUrl, customPageContext, timeout = 35000, } = {}) => {
|
|
2474
|
+
const pageContext = customPageContext !== null && customPageContext !== void 0 ? customPageContext : this.page;
|
|
2475
|
+
return Promise.all([...new Array(times)].map(() => pageContext.waitForResponse((response) => {
|
|
2476
|
+
var _a, _b, _c;
|
|
2477
|
+
if (response.request().resourceType() === "xhr" &&
|
|
2478
|
+
response.status() === responseStatus &&
|
|
2479
|
+
response.url().includes(responseUrl) &&
|
|
2480
|
+
response.url().startsWith((_a = baseUrl !== null && baseUrl !== void 0 ? baseUrl : this.baseURL) !== null && _a !== void 0 ? _a : "") &&
|
|
2481
|
+
!this.responses.includes((_b = response.headers()) === null || _b === void 0 ? void 0 : _b["x-request-id"])) {
|
|
2482
|
+
this.responses.push((_c = response.headers()) === null || _c === void 0 ? void 0 : _c["x-request-id"]);
|
|
2483
|
+
return true;
|
|
2484
|
+
}
|
|
2485
|
+
return false;
|
|
2486
|
+
}, { timeout })));
|
|
2487
|
+
};
|
|
2488
|
+
this.recursiveMethod = async (callback, condition, timeout, startTime) => {
|
|
2489
|
+
if (Date.now() - timeout >= startTime) {
|
|
2490
|
+
return false;
|
|
2491
|
+
}
|
|
2492
|
+
else if (await condition()) {
|
|
2493
|
+
return await callback();
|
|
2494
|
+
}
|
|
2495
|
+
return await this.recursiveMethod(callback, condition, timeout, startTime);
|
|
2496
|
+
};
|
|
2497
|
+
this.executeRecursively = async ({ callback, condition, timeout = 5000, }) => {
|
|
2498
|
+
const startTime = Date.now();
|
|
2499
|
+
await this.recursiveMethod(callback, condition, timeout, startTime);
|
|
2500
|
+
};
|
|
2501
|
+
this.verifySuccessToast = async ({ message = "", closeAfterVerification = true, } = {}) => {
|
|
2502
|
+
if (!ramda.isEmpty(message)) {
|
|
2503
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.toastMessage)).toContainText(message);
|
|
2504
|
+
}
|
|
2505
|
+
else {
|
|
2506
|
+
await test$1.expect(this.page.locator(COMMON_SELECTORS.toastIcon)).toContainText("👍");
|
|
2507
|
+
}
|
|
2508
|
+
closeAfterVerification &&
|
|
2509
|
+
(await this.page.getByTestId(COMMON_SELECTORS.toastCloseButton).click());
|
|
2510
|
+
await test$1.expect(this.page.locator(COMMON_SELECTORS.toastIcon)).toBeHidden();
|
|
2511
|
+
};
|
|
2512
|
+
this.reloadAndWait = async (requestCount, customPageContext, interceptMultipleResponsesProps = {}) => {
|
|
2513
|
+
const pageContext = customPageContext !== null && customPageContext !== void 0 ? customPageContext : this.page;
|
|
2514
|
+
const reloadRequests = this.interceptMultipleResponses({
|
|
2515
|
+
times: requestCount,
|
|
2516
|
+
...interceptMultipleResponsesProps,
|
|
2517
|
+
});
|
|
2518
|
+
await pageContext.reload();
|
|
2519
|
+
await reloadRequests;
|
|
2520
|
+
};
|
|
2521
|
+
this.apiRequest = async ({ url, failOnStatusCode = true, headers: additionalHeaders, body: data, method = "get", params = {}, ...otherOptions }) => {
|
|
2522
|
+
const csrfToken = await this.page
|
|
2523
|
+
.locator("[name='csrf-token']")
|
|
2524
|
+
.getAttribute("content");
|
|
2525
|
+
const requestOptions = {
|
|
2526
|
+
failOnStatusCode,
|
|
2527
|
+
headers: {
|
|
2528
|
+
...additionalHeaders,
|
|
2529
|
+
"accept-encoding": "gzip",
|
|
2530
|
+
"x-csrf-token": csrfToken !== null && csrfToken !== void 0 ? csrfToken : "",
|
|
2531
|
+
},
|
|
2532
|
+
data,
|
|
2533
|
+
...otherOptions,
|
|
2534
|
+
};
|
|
2535
|
+
const formattedUrl = ramda.isEmpty(params)
|
|
2536
|
+
? url
|
|
2537
|
+
: `${url}?${lib.stringify(params, {
|
|
2538
|
+
arrayFormat: "brackets",
|
|
2539
|
+
})}`;
|
|
2540
|
+
return await this.request[method](formattedUrl, requestOptions);
|
|
2541
|
+
};
|
|
2542
|
+
this.verifyFieldValue = values => {
|
|
2543
|
+
const verifyEachFieldValue = ({ field, value, }) => test$1.expect(this.page.getByTestId(field)).toHaveValue(value);
|
|
2544
|
+
return Array.isArray(values)
|
|
2545
|
+
? Promise.all(values.map(value => verifyEachFieldValue(value)))
|
|
2546
|
+
: verifyEachFieldValue(values);
|
|
2547
|
+
};
|
|
2548
|
+
this.page = page;
|
|
2549
|
+
this.responses = [];
|
|
2550
|
+
this.request = request;
|
|
2551
|
+
this.baseURL = baseURL;
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
class MailosaurUtils {
|
|
2556
|
+
constructor(mailosaur) {
|
|
2557
|
+
this.fetchOtpFromEmail = async ({ email, subjectSubstring = OTP_EMAIL_PATTERN, timeout = 2 * 60 * 1000, receivedAfter = new Date(), }) => {
|
|
2558
|
+
var _a, _b, _c;
|
|
2559
|
+
const receivedEmail = await this.mailosaur.messages.get(this.serverId, { sentTo: email, subject: subjectSubstring }, { timeout, receivedAfter });
|
|
2560
|
+
const otp = (_c = (_b = (_a = receivedEmail === null || receivedEmail === void 0 ? void 0 : receivedEmail.text) === null || _a === void 0 ? void 0 : _a.codes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.value;
|
|
2561
|
+
if (ramda.isNil(otp)) {
|
|
2562
|
+
throw new Error(`No codes found in the email with subject: ${receivedEmail.subject}. Please re-evaluate the filtering parameters.`);
|
|
2563
|
+
}
|
|
2564
|
+
return otp;
|
|
2565
|
+
};
|
|
2566
|
+
this.generateRandomMailosaurEmail = () => faker.faker.internet.email({ provider: `${this.serverId}.mailosaur.net` });
|
|
2567
|
+
this.mailosaur = mailosaur;
|
|
2568
|
+
if (ramda.isNotNil(process.env.MAILOSAUR_SERVER_ID)) {
|
|
2569
|
+
this.serverId = process.env.MAILOSAUR_SERVER_ID;
|
|
2570
|
+
}
|
|
2571
|
+
else {
|
|
2572
|
+
throw new Error("ENV variable MAILOSAUR_SERVER_ID is not defined. Please add the Server ID to use this method. Please visit https://mailosaur.com/app/servers to find the Server ID.");
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
}
|
|
2576
|
+
|
|
2577
|
+
const commands = {
|
|
2578
|
+
neetoPlaywrightUtilities: async ({ page, request, baseURL }, use) => {
|
|
2579
|
+
const commands = new CustomCommands(page, request, baseURL);
|
|
2580
|
+
await use(commands);
|
|
2581
|
+
},
|
|
2582
|
+
mailosaur: async ({}, use) => {
|
|
2583
|
+
skipTest.forAllExceptStagingEnv();
|
|
2584
|
+
if (ramda.isNotNil(process.env.MAILOSAUR_API_KEY)) {
|
|
2585
|
+
const mailosaur = new MailosaurClient__default["default"](process.env.MAILOSAUR_API_KEY);
|
|
2586
|
+
await use(mailosaur);
|
|
2587
|
+
}
|
|
2588
|
+
else {
|
|
2589
|
+
throw new Error("ENV variable MAILOSAUR_API_KEY is not defined. Please add the API key to use this fixture. Please visit https://mailosaur.com/app/account/keys to find the API key.");
|
|
2590
|
+
}
|
|
2591
|
+
},
|
|
2592
|
+
page: async ({ page }, use) => {
|
|
2593
|
+
await page.goto("/");
|
|
2594
|
+
await page.waitForLoadState();
|
|
2595
|
+
await use(page);
|
|
2596
|
+
},
|
|
2597
|
+
mailosaurUtils: async ({ mailosaur }, use) => {
|
|
2598
|
+
skipTest.forAllExceptStagingEnv();
|
|
2599
|
+
const mailosaurUtils = new MailosaurUtils(mailosaur);
|
|
2600
|
+
await use(mailosaurUtils);
|
|
2601
|
+
},
|
|
2602
|
+
};
|
|
2603
|
+
|
|
2604
|
+
const generateStagingData = (product = "invoice") => {
|
|
2605
|
+
var _a;
|
|
2606
|
+
const timestamp = `${dayjs__default["default"]().format("MMDDHHmmssSSS")}${(_a = process.env.JOB_COMPLETION_INDEX) !== null && _a !== void 0 ? _a : ""}`;
|
|
2607
|
+
const firstName = "André";
|
|
2608
|
+
const lastName = "O'Reilly";
|
|
2609
|
+
const otpBypassKey = process.env.OTP_BYPASS_KEY;
|
|
2610
|
+
const stagingOrganization = `cpt-${product}-${timestamp}`;
|
|
2611
|
+
return {
|
|
2612
|
+
firstName,
|
|
2613
|
+
lastName,
|
|
2614
|
+
otp: 111111,
|
|
2615
|
+
domain: `neeto${product}.net`,
|
|
2616
|
+
currentUserName: IS_STAGING_ENV
|
|
2617
|
+
? joinString(firstName, lastName)
|
|
2618
|
+
: CREDENTIALS.name,
|
|
2619
|
+
businessName: stagingOrganization,
|
|
2620
|
+
subdomainName: IS_STAGING_ENV ? stagingOrganization : "spinkart",
|
|
2621
|
+
email: IS_STAGING_ENV
|
|
2622
|
+
? `cpt${otpBypassKey}+${product}+${timestamp}@bigbinary.com`
|
|
2623
|
+
: CREDENTIALS.email,
|
|
2624
|
+
};
|
|
2625
|
+
};
|
|
2626
|
+
|
|
383
2627
|
var src = {exports: {}};
|
|
384
2628
|
|
|
385
2629
|
var browser$1 = {exports: {}};
|
|
@@ -1140,7 +3384,7 @@ var hasRequiredSupportsColor;
|
|
|
1140
3384
|
function requireSupportsColor () {
|
|
1141
3385
|
if (hasRequiredSupportsColor) return supportsColor_1;
|
|
1142
3386
|
hasRequiredSupportsColor = 1;
|
|
1143
|
-
const os = require$$0__default["default"];
|
|
3387
|
+
const os = require$$0__default$1["default"];
|
|
1144
3388
|
const tty = require$$1__default["default"];
|
|
1145
3389
|
const hasFlag = requireHasFlag();
|
|
1146
3390
|
|
|
@@ -1288,7 +3532,7 @@ function requireNode () {
|
|
|
1288
3532
|
hasRequiredNode = 1;
|
|
1289
3533
|
(function (module, exports) {
|
|
1290
3534
|
const tty = require$$1__default["default"];
|
|
1291
|
-
const util = require$$0__default
|
|
3535
|
+
const util = require$$0__default["default"];
|
|
1292
3536
|
|
|
1293
3537
|
/**
|
|
1294
3538
|
* This is the Node.js implementation of `debug()`.
|
|
@@ -3158,7 +5402,7 @@ class StealthPlugin extends PuppeteerExtraPlugin {
|
|
|
3158
5402
|
const defaultExport = opts => new StealthPlugin(opts);
|
|
3159
5403
|
var puppeteerExtraPluginStealth = defaultExport;
|
|
3160
5404
|
|
|
3161
|
-
var stealth = test.test.extend({
|
|
5405
|
+
var stealth = test$1.test.extend({
|
|
3162
5406
|
browser: async ({ browser }, use) => {
|
|
3163
5407
|
await browser.close();
|
|
3164
5408
|
chromium.use(puppeteerExtraPluginStealth());
|
|
@@ -3286,7 +5530,7 @@ var path$a = {};
|
|
|
3286
5530
|
|
|
3287
5531
|
Object.defineProperty(path$a, "__esModule", { value: true });
|
|
3288
5532
|
path$a.convertPosixPathToPattern = path$a.convertWindowsPathToPattern = path$a.convertPathToPattern = path$a.escapePosixPath = path$a.escapeWindowsPath = path$a.escape = path$a.removeLeadingDotSegment = path$a.makeAbsolute = path$a.unixify = void 0;
|
|
3289
|
-
const os$1 = require$$0__default["default"];
|
|
5533
|
+
const os$1 = require$$0__default$1["default"];
|
|
3290
5534
|
const path$9 = require$$0__default$2["default"];
|
|
3291
5535
|
const IS_WINDOWS_PLATFORM = os$1.platform() === 'win32';
|
|
3292
5536
|
const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
|
|
@@ -3528,7 +5772,7 @@ var isGlob$1 = function isGlob(str, options) {
|
|
|
3528
5772
|
|
|
3529
5773
|
var isGlob = isGlob$1;
|
|
3530
5774
|
var pathPosixDirname = require$$0__default$2["default"].posix.dirname;
|
|
3531
|
-
var isWin32 = require$$0__default["default"].platform() === 'win32';
|
|
5775
|
+
var isWin32 = require$$0__default$1["default"].platform() === 'win32';
|
|
3532
5776
|
|
|
3533
5777
|
var slash = '/';
|
|
3534
5778
|
var backslash = /\\/g;
|
|
@@ -4024,7 +6268,7 @@ var toRegexRange_1 = toRegexRange$1;
|
|
|
4024
6268
|
* Licensed under the MIT License.
|
|
4025
6269
|
*/
|
|
4026
6270
|
|
|
4027
|
-
const util$1 = require$$0__default
|
|
6271
|
+
const util$1 = require$$0__default["default"];
|
|
4028
6272
|
const toRegexRange = toRegexRange_1;
|
|
4029
6273
|
|
|
4030
6274
|
const isObject$1 = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
|
@@ -7061,7 +9305,7 @@ var picomatch_1 = picomatch$1;
|
|
|
7061
9305
|
module.exports = picomatch_1;
|
|
7062
9306
|
} (picomatch$2));
|
|
7063
9307
|
|
|
7064
|
-
const util = require$$0__default
|
|
9308
|
+
const util = require$$0__default["default"];
|
|
7065
9309
|
const braces = braces_1;
|
|
7066
9310
|
const picomatch = picomatch$2.exports;
|
|
7067
9311
|
const utils$b = utils$f;
|
|
@@ -9764,7 +12008,7 @@ var settings = {};
|
|
|
9764
12008
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9765
12009
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
9766
12010
|
const fs = require$$0__default$4["default"];
|
|
9767
|
-
const os = require$$0__default["default"];
|
|
12011
|
+
const os = require$$0__default$1["default"];
|
|
9768
12012
|
/**
|
|
9769
12013
|
* The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
|
|
9770
12014
|
* https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
|
|
@@ -10101,21 +12345,21 @@ class HelpAndProfilePage {
|
|
|
10101
12345
|
constructor({ page, neetoPlaywrightUtilities, chatApiBaseURL, kbDocsBaseURL, changelogBaseURL, }) {
|
|
10102
12346
|
this.hoverOnBody = () => this.page.locator("body").hover();
|
|
10103
12347
|
this.openHelpCenterV2 = async () => {
|
|
10104
|
-
await test.expect(async () => {
|
|
12348
|
+
await test$1.expect(async () => {
|
|
10105
12349
|
await this.hoverOnBody();
|
|
10106
12350
|
const floatingActionMenuButton = this.page.getByTestId(COMMON_SELECTORS.floatingActionMenuButton);
|
|
10107
12351
|
await floatingActionMenuButton.scrollIntoViewIfNeeded();
|
|
10108
12352
|
await floatingActionMenuButton.hover();
|
|
10109
|
-
await test.expect(this.page.getByTestId(HELP_CENTER_SELECTORS.chatButton)).toBeVisible();
|
|
12353
|
+
await test$1.expect(this.page.getByTestId(HELP_CENTER_SELECTORS.chatButton)).toBeVisible();
|
|
10110
12354
|
}).toPass({ timeout: 15000 });
|
|
10111
12355
|
};
|
|
10112
12356
|
this.openLiveChatAndVerify = async () => {
|
|
10113
|
-
await test.expect(async () => {
|
|
12357
|
+
await test$1.expect(async () => {
|
|
10114
12358
|
await this.openHelpCenterV2();
|
|
10115
12359
|
await this.page.getByTestId(HELP_CENTER_SELECTORS.chatButton).click();
|
|
10116
|
-
await test.expect(this.neetoChatWidget).toBeVisible();
|
|
10117
|
-
await test.expect(this.neetoChatSpinner).toBeHidden({ timeout: 20 * 1000 });
|
|
10118
|
-
await test.expect(this.neetoChatWidget).toBeVisible();
|
|
12360
|
+
await test$1.expect(this.neetoChatWidget).toBeVisible();
|
|
12361
|
+
await test$1.expect(this.neetoChatSpinner).toBeHidden({ timeout: 20 * 1000 });
|
|
12362
|
+
await test$1.expect(this.neetoChatWidget).toBeVisible();
|
|
10119
12363
|
}).toPass({ timeout: 45000 });
|
|
10120
12364
|
};
|
|
10121
12365
|
this.openAndVerifyChatWidgetV2 = async () => {
|
|
@@ -10125,21 +12369,21 @@ class HelpAndProfilePage {
|
|
|
10125
12369
|
});
|
|
10126
12370
|
await this.page.reload();
|
|
10127
12371
|
await chatInitializationApis;
|
|
10128
|
-
await test.test.step("Step 1: Open live chat and verify iframe", this.openLiveChatAndVerify);
|
|
10129
|
-
await test.test.step("Step 2: Close and reopen live chat frame", async () => {
|
|
12372
|
+
await test$1.test.step("Step 1: Open live chat and verify iframe", this.openLiveChatAndVerify);
|
|
12373
|
+
await test$1.test.step("Step 2: Close and reopen live chat frame", async () => {
|
|
10130
12374
|
await this.page.getByTestId(CHAT_WIDGET_SELECTORS.closeChat).click();
|
|
10131
|
-
await test.expect(this.neetoChatWidget).toBeHidden({ timeout:
|
|
12375
|
+
await test$1.expect(this.neetoChatWidget).toBeHidden({ timeout: 35000 });
|
|
10132
12376
|
await this.openLiveChatAndVerify();
|
|
10133
12377
|
});
|
|
10134
|
-
await test.test.step("Step 3: Start new conversation", async () => {
|
|
12378
|
+
await test$1.test.step("Step 3: Start new conversation", async () => {
|
|
10135
12379
|
const newConversationButton = this.neetoChatFrame.getByRole("button", {
|
|
10136
12380
|
name: CHAT_WIDGET_TEXTS.newConversation,
|
|
10137
12381
|
});
|
|
10138
|
-
await test.expect(newConversationButton).toBeVisible({ timeout:
|
|
12382
|
+
await test$1.expect(newConversationButton).toBeVisible({ timeout: 35000 }); // Adding additional toBeVisible to take advantage of the auto-retrying web-first assertion
|
|
10139
12383
|
await newConversationButton.click();
|
|
10140
|
-
await test.expect(this.neetoChatSpinner).toBeHidden({ timeout:
|
|
12384
|
+
await test$1.expect(this.neetoChatSpinner).toBeHidden({ timeout: 35000 });
|
|
10141
12385
|
});
|
|
10142
|
-
await test.test.step("Step 4: Fill and submit email", async () => {
|
|
12386
|
+
await test$1.test.step("Step 4: Fill and submit email", async () => {
|
|
10143
12387
|
var _a, _b;
|
|
10144
12388
|
await this.neetoChatFrame
|
|
10145
12389
|
.getByTestId(CHAT_WIDGET_SELECTORS.preChatEmailInput)
|
|
@@ -10148,42 +12392,42 @@ class HelpAndProfilePage {
|
|
|
10148
12392
|
.getByTestId(CHAT_WIDGET_SELECTORS.preChatSubmitButton)
|
|
10149
12393
|
.getByRole("button")
|
|
10150
12394
|
.click();
|
|
10151
|
-
await test.expect(this.neetoChatSpinner).toBeHidden({ timeout:
|
|
12395
|
+
await test$1.expect(this.neetoChatSpinner).toBeHidden({ timeout: 35000 });
|
|
10152
12396
|
});
|
|
10153
|
-
await test.test.step("Step 5: Verify conversation window", async () => {
|
|
10154
|
-
await test.expect(this.neetoChatFrame.getByTestId(CHAT_WIDGET_SELECTORS.chatBubble)).toHaveText(CHAT_WIDGET_TEXTS.welcomeChatBubble);
|
|
12397
|
+
await test$1.test.step("Step 5: Verify conversation window", async () => {
|
|
12398
|
+
await test$1.expect(this.neetoChatFrame.getByTestId(CHAT_WIDGET_SELECTORS.chatBubble)).toHaveText(CHAT_WIDGET_TEXTS.welcomeChatBubble);
|
|
10155
12399
|
});
|
|
10156
12400
|
};
|
|
10157
12401
|
this.openAndVerifyHelpArticlesV2 = async () => {
|
|
10158
|
-
await test.test.step("Step 1: Open Help Center links", this.openHelpCenterV2);
|
|
10159
|
-
await test.test.step("Step 2: Open and verify help articles link", async () => {
|
|
12402
|
+
await test$1.test.step("Step 1: Open Help Center links", this.openHelpCenterV2);
|
|
12403
|
+
await test$1.test.step("Step 2: Open and verify help articles link", async () => {
|
|
10160
12404
|
const helpArticlesPromise = this.page.waitForEvent("popup");
|
|
10161
12405
|
await this.page
|
|
10162
12406
|
.getByTestId(HELP_CENTER_SELECTORS.documentationButton)
|
|
10163
12407
|
.click();
|
|
10164
12408
|
const helpArticlesPage = await helpArticlesPromise;
|
|
10165
12409
|
await helpArticlesPage.waitForLoadState();
|
|
10166
|
-
await test.expect(helpArticlesPage).toHaveURL(this.kbDocsBaseURL);
|
|
12410
|
+
await test$1.expect(helpArticlesPage).toHaveURL(this.kbDocsBaseURL);
|
|
10167
12411
|
await helpArticlesPage.close();
|
|
10168
12412
|
});
|
|
10169
12413
|
};
|
|
10170
12414
|
this.openChangelogPaneV2 = async () => {
|
|
10171
|
-
await test.expect(async () => {
|
|
12415
|
+
await test$1.expect(async () => {
|
|
10172
12416
|
await this.openHelpCenterV2();
|
|
10173
12417
|
await this.page.getByTestId(HELP_CENTER_SELECTORS.whatsNewButton).click();
|
|
10174
|
-
await test.expect(this.page.locator(CHANGELOG_WIDGET_SELECTORS.changelogWrapper)).toBeVisible();
|
|
12418
|
+
await test$1.expect(this.page.locator(CHANGELOG_WIDGET_SELECTORS.changelogWrapper)).toBeVisible();
|
|
10175
12419
|
}).toPass({ timeout: 45000 });
|
|
10176
12420
|
};
|
|
10177
12421
|
this.openAndVerifyChangelogV2 = async () => {
|
|
10178
|
-
await test.test.step("Step 1: Open Help Center links and changelog", this.openChangelogPaneV2);
|
|
10179
|
-
await test.test.step("Step 2: Close and reopen changelog pane", async () => {
|
|
12422
|
+
await test$1.test.step("Step 1: Open Help Center links and changelog", this.openChangelogPaneV2);
|
|
12423
|
+
await test$1.test.step("Step 2: Close and reopen changelog pane", async () => {
|
|
10180
12424
|
await this.page
|
|
10181
12425
|
.getByTestId(CHANGELOG_WIDGET_SELECTORS.closeButton)
|
|
10182
12426
|
.click();
|
|
10183
|
-
await test.expect(this.page.locator(CHANGELOG_WIDGET_SELECTORS.changelogWrapper)).toBeHidden();
|
|
12427
|
+
await test$1.expect(this.page.locator(CHANGELOG_WIDGET_SELECTORS.changelogWrapper)).toBeHidden();
|
|
10184
12428
|
await this.openChangelogPaneV2();
|
|
10185
12429
|
});
|
|
10186
|
-
await test.test.step("Step 3: Open and verify public URL", async () => {
|
|
12430
|
+
await test$1.test.step("Step 3: Open and verify public URL", async () => {
|
|
10187
12431
|
const changelogPagePromise = this.page.waitForEvent("popup");
|
|
10188
12432
|
await this.page
|
|
10189
12433
|
.getByTestId(CHANGELOG_WIDGET_SELECTORS.publicUrlLink)
|
|
@@ -10194,7 +12438,7 @@ class HelpAndProfilePage {
|
|
|
10194
12438
|
baseUrl: this.changelogBaseURL.split("/site")[0],
|
|
10195
12439
|
times: 3,
|
|
10196
12440
|
});
|
|
10197
|
-
await test.expect(changelogPage).toHaveURL(this.changelogBaseURL);
|
|
12441
|
+
await test$1.expect(changelogPage).toHaveURL(this.changelogBaseURL);
|
|
10198
12442
|
await changelogPage.close();
|
|
10199
12443
|
});
|
|
10200
12444
|
};
|
|
@@ -10222,42 +12466,42 @@ class HelpAndProfilePage {
|
|
|
10222
12466
|
},
|
|
10223
12467
|
];
|
|
10224
12468
|
const shortcuts = [...globalShortcuts, ...productShortcuts];
|
|
10225
|
-
await test.test.step("Step 1: Open Help Center", this.openHelpCenterV2);
|
|
10226
|
-
await test.test.step("Step 2: Open and close keyboard shortcuts from UI", async () => {
|
|
12469
|
+
await test$1.test.step("Step 1: Open Help Center", this.openHelpCenterV2);
|
|
12470
|
+
await test$1.test.step("Step 2: Open and close keyboard shortcuts from UI", async () => {
|
|
10227
12471
|
await this.page
|
|
10228
12472
|
.getByTestId(HELP_CENTER_SELECTORS.keyboardShortcutButton)
|
|
10229
12473
|
.click();
|
|
10230
|
-
await test.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).not.toHaveCSS("width", "1px");
|
|
12474
|
+
await test$1.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).not.toHaveCSS("width", "1px");
|
|
10231
12475
|
await this.page
|
|
10232
12476
|
.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.closePaneButton)
|
|
10233
12477
|
.click();
|
|
10234
|
-
await test.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).toHaveCSS("width", "1px");
|
|
12478
|
+
await test$1.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).toHaveCSS("width", "1px");
|
|
10235
12479
|
});
|
|
10236
|
-
await test.test.step("Step 3: Open and close keyboard shortcuts through shortcut", async () => {
|
|
12480
|
+
await test$1.test.step("Step 3: Open and close keyboard shortcuts through shortcut", async () => {
|
|
10237
12481
|
await this.page.keyboard.press("Shift+/");
|
|
10238
|
-
await test.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).not.toHaveCSS("width", "1px");
|
|
12482
|
+
await test$1.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).not.toHaveCSS("width", "1px");
|
|
10239
12483
|
await this.page.keyboard.press("Escape");
|
|
10240
|
-
await test.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).toHaveCSS("width", "1px");
|
|
12484
|
+
await test$1.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).toHaveCSS("width", "1px");
|
|
10241
12485
|
});
|
|
10242
|
-
await test.test.step("Step 4: Verify all displayed keyboard shortcuts", async () => {
|
|
12486
|
+
await test$1.test.step("Step 4: Verify all displayed keyboard shortcuts", async () => {
|
|
10243
12487
|
await this.page.keyboard.press("Shift+/");
|
|
10244
|
-
await test.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).not.toHaveCSS("width", "1px");
|
|
10245
|
-
await test.expect(this.page
|
|
12488
|
+
await test$1.expect(this.page.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.keyboardShortcutsPane)).not.toHaveCSS("width", "1px");
|
|
12489
|
+
await test$1.expect(this.page
|
|
10246
12490
|
.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.hotKeyItem)
|
|
10247
12491
|
.locator("p")).toHaveText(shortcuts.map(shortcut => shortcut.description));
|
|
10248
12492
|
const formattedSequences = shortcuts.map(shortcut => this.formatKeyboardShortcut(shortcut.sequence, osPlatform));
|
|
10249
|
-
await test.expect(this.page
|
|
12493
|
+
await test$1.expect(this.page
|
|
10250
12494
|
.getByTestId(KEYBOARD_SHORTCUTS_SELECTORS.hotKeyItem)
|
|
10251
12495
|
.locator("div")).toHaveText(formattedSequences);
|
|
10252
12496
|
});
|
|
10253
12497
|
};
|
|
10254
12498
|
this.openAppSwitcherAndVerifyV2 = async () => {
|
|
10255
|
-
await test.test.step("Step 1: Verify hovering over app switcher opens the app switcher drawer", () => test.expect(async () => {
|
|
12499
|
+
await test$1.test.step("Step 1: Verify hovering over app switcher opens the app switcher drawer", () => test$1.expect(async () => {
|
|
10256
12500
|
await this.openHelpCenterV2();
|
|
10257
12501
|
await this.page
|
|
10258
12502
|
.getByTestId(COMMON_SELECTORS.appSwitcherButton)
|
|
10259
12503
|
.hover();
|
|
10260
|
-
await test.expect(this.page.getByTestId(COMMON_SELECTORS.appSwitcherWrapper)).toBeVisible();
|
|
12504
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.appSwitcherWrapper)).toBeVisible();
|
|
10261
12505
|
}).toPass({ timeout: 45000 }));
|
|
10262
12506
|
};
|
|
10263
12507
|
this.openAuthLinkAndVerify = async ({ linkSelector, redirectLink, }) => {
|
|
@@ -10266,18 +12510,18 @@ class HelpAndProfilePage {
|
|
|
10266
12510
|
await this.page.getByTestId(linkSelector).click();
|
|
10267
12511
|
const profilePage = await profilePagePromise;
|
|
10268
12512
|
await profilePage.waitForLoadState();
|
|
10269
|
-
await test.expect(profilePage).toHaveURL(new RegExp(NEETO_AUTH_BASE_URL((_b = (_a = readFileSyncIfExists()) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.subdomainName)));
|
|
10270
|
-
await test.expect(profilePage).toHaveURL(new RegExp(redirectLink));
|
|
12513
|
+
await test$1.expect(profilePage).toHaveURL(new RegExp(NEETO_AUTH_BASE_URL((_b = (_a = readFileSyncIfExists()) === null || _a === void 0 ? void 0 : _a.user) === null || _b === void 0 ? void 0 : _b.subdomainName)));
|
|
12514
|
+
await test$1.expect(profilePage).toHaveURL(new RegExp(redirectLink));
|
|
10271
12515
|
await profilePage.close();
|
|
10272
12516
|
};
|
|
10273
12517
|
this.verifyProfileAndOrganizationLinksV2 = async () => {
|
|
10274
|
-
await test.test.step("Step 1: Open Help center and verify", this.openHelpCenterV2);
|
|
10275
|
-
await test.test.step("Step 2: Open My profile link and verify", async () => this.openAuthLinkAndVerify({
|
|
12518
|
+
await test$1.test.step("Step 1: Open Help center and verify", this.openHelpCenterV2);
|
|
12519
|
+
await test$1.test.step("Step 2: Open My profile link and verify", async () => this.openAuthLinkAndVerify({
|
|
10276
12520
|
linkSelector: PROFILE_SECTION_SELECTORS.myProfileButton,
|
|
10277
12521
|
redirectLink: ROUTES.myProfile,
|
|
10278
12522
|
}));
|
|
10279
|
-
await test.test.step("Step 3: Open Help center and verify", this.openHelpCenterV2);
|
|
10280
|
-
await test.test.step("Step 4: Open My organization link and verify", async () => this.openAuthLinkAndVerify({
|
|
12523
|
+
await test$1.test.step("Step 3: Open Help center and verify", this.openHelpCenterV2);
|
|
12524
|
+
await test$1.test.step("Step 4: Open My organization link and verify", async () => this.openAuthLinkAndVerify({
|
|
10281
12525
|
linkSelector: PROFILE_SECTION_SELECTORS.profileOrganizationSettingsButton,
|
|
10282
12526
|
redirectLink: ROUTES.authSettings,
|
|
10283
12527
|
}));
|
|
@@ -10285,16 +12529,16 @@ class HelpAndProfilePage {
|
|
|
10285
12529
|
this.verifyLogoutV2 = async () => {
|
|
10286
12530
|
if (shouldSkipSetupAndTeardown())
|
|
10287
12531
|
return;
|
|
10288
|
-
await test.test.step("Step 1: Open Help center and verify", this.openHelpCenterV2);
|
|
10289
|
-
await test.test.step("Step 2: Click logout and verify", async () => {
|
|
12532
|
+
await test$1.test.step("Step 1: Open Help center and verify", this.openHelpCenterV2);
|
|
12533
|
+
await test$1.test.step("Step 2: Click logout and verify", async () => {
|
|
10290
12534
|
await this.page
|
|
10291
12535
|
.getByTestId(PROFILE_SECTION_SELECTORS.logoutButton)
|
|
10292
12536
|
.click();
|
|
10293
12537
|
process.env.TEST_ENV === ENVIRONMENT.staging &&
|
|
10294
|
-
(await test.expect(this.page).toHaveURL(new RegExp(NEETO_AUTH_BASE_URL()), {
|
|
12538
|
+
(await test$1.expect(this.page).toHaveURL(new RegExp(NEETO_AUTH_BASE_URL()), {
|
|
10295
12539
|
timeout: 15000,
|
|
10296
12540
|
}));
|
|
10297
|
-
await test.expect(this.page).toHaveURL(new RegExp(ROUTES.loginLink), {
|
|
12541
|
+
await test$1.expect(this.page).toHaveURL(new RegExp(ROUTES.loginLink), {
|
|
10298
12542
|
timeout: 15000,
|
|
10299
12543
|
});
|
|
10300
12544
|
});
|
|
@@ -10338,7 +12582,7 @@ class IntegrationBase {
|
|
|
10338
12582
|
this.connect = async (skipGoTo) => {
|
|
10339
12583
|
!skipGoTo && (await this.gotoIntegrationIndex());
|
|
10340
12584
|
await this.clickOnIntegrationCard();
|
|
10341
|
-
await test.expect(this.page.getByRole("heading", {
|
|
12585
|
+
await test$1.expect(this.page.getByRole("heading", {
|
|
10342
12586
|
name: this.connectHeader,
|
|
10343
12587
|
})).toBeVisible();
|
|
10344
12588
|
await this.page.getByTestId(INTEGRATION_SELECTORS.connectButton).click();
|
|
@@ -10346,17 +12590,17 @@ class IntegrationBase {
|
|
|
10346
12590
|
this.verifyIntegrationStatus = async (status = "connected") => {
|
|
10347
12591
|
await this.gotoIntegrationIndex();
|
|
10348
12592
|
if (status === "connected") {
|
|
10349
|
-
await test.expect(this.integrationCard.getByTestId(INTEGRATION_SELECTORS.integrationStatusTag)).toBeVisible({ timeout: 10000 });
|
|
12593
|
+
await test$1.expect(this.integrationCard.getByTestId(INTEGRATION_SELECTORS.integrationStatusTag)).toBeVisible({ timeout: 10000 });
|
|
10350
12594
|
}
|
|
10351
12595
|
await this.clickOnIntegrationCard();
|
|
10352
12596
|
const header = status === "connected" ? this.connectedHeader : this.connectHeader;
|
|
10353
|
-
await test.expect(this.page.getByRole("heading", { name: header })).toBeVisible();
|
|
12597
|
+
await test$1.expect(this.page.getByRole("heading", { name: header })).toBeVisible();
|
|
10354
12598
|
};
|
|
10355
12599
|
this.clickOnIntegrationCard = async () => {
|
|
10356
|
-
await test.expect(this.page.getByTestId(COMMON_SELECTORS.spinner)).toHaveCount(0);
|
|
12600
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.spinner)).toHaveCount(0);
|
|
10357
12601
|
await this.integrationCard.scrollIntoViewIfNeeded();
|
|
10358
12602
|
await this.integrationCard.click();
|
|
10359
|
-
await test.expect(this.page.getByTestId(COMMON_SELECTORS.pageLoader)).toBeHidden();
|
|
12603
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.pageLoader)).toBeHidden();
|
|
10360
12604
|
};
|
|
10361
12605
|
this.gotoIntegrationIndex = async () => {
|
|
10362
12606
|
neetoCist.isNotEmpty(this.integrationRouteIndex) &&
|
|
@@ -10413,19 +12657,19 @@ class SlackPage extends IntegrationBase {
|
|
|
10413
12657
|
const allowButton = this.page.getByRole("button", {
|
|
10414
12658
|
name: SLACK_WEB_TEXTS.allow,
|
|
10415
12659
|
});
|
|
10416
|
-
await test.expect(allowButton).toBeEnabled({ timeout: 20000 });
|
|
12660
|
+
await test$1.expect(allowButton).toBeEnabled({ timeout: 20000 });
|
|
10417
12661
|
const currentWorkspace = (await this.page
|
|
10418
12662
|
.locator(SLACK_SELECTORS.teamPicketButtonContent)
|
|
10419
12663
|
.textContent()) || "";
|
|
10420
12664
|
await allowButton.click();
|
|
10421
12665
|
await this.page.waitForURL(redirectUrl);
|
|
10422
|
-
await test.expect(this.page.getByTestId(COMMON_SELECTORS.pageLoader)).toBeHidden({ timeout: 10000 });
|
|
10423
|
-
await test.expect(this.page.getByRole("heading", {
|
|
12666
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.pageLoader)).toBeHidden({ timeout: 10000 });
|
|
12667
|
+
await test$1.expect(this.page.getByRole("heading", {
|
|
10424
12668
|
name: this.t("neetoSlack.slack.configure.title", {
|
|
10425
12669
|
teamName: currentWorkspace,
|
|
10426
12670
|
}),
|
|
10427
12671
|
})).toBeVisible();
|
|
10428
|
-
await test.expect(this.page.getByTestId(COMMON_SELECTORS.selectValueContainer)).toContainText(SLACK_DEFAULT_CHANNEL);
|
|
12672
|
+
await test$1.expect(this.page.getByTestId(COMMON_SELECTORS.selectValueContainer)).toContainText(SLACK_DEFAULT_CHANNEL);
|
|
10429
12673
|
await this.page
|
|
10430
12674
|
.getByRole("button", { name: this.t("neetoSlack.common.continue") })
|
|
10431
12675
|
.click();
|
|
@@ -10433,7 +12677,7 @@ class SlackPage extends IntegrationBase {
|
|
|
10433
12677
|
await customSteps();
|
|
10434
12678
|
}
|
|
10435
12679
|
else {
|
|
10436
|
-
await test.expect(this.page.getByRole("heading", {
|
|
12680
|
+
await test$1.expect(this.page.getByRole("heading", {
|
|
10437
12681
|
name: this.t("neetoSlack.slack.finish.title", {
|
|
10438
12682
|
teamName: currentWorkspace,
|
|
10439
12683
|
}),
|
|
@@ -10535,22 +12779,22 @@ class WebhooksPage {
|
|
|
10535
12779
|
const addWebhook = this.neetoPlaywrightUtilities.interceptMultipleResponses({ responseUrl: ROUTES.webhooks, times: 2 });
|
|
10536
12780
|
await this.page.getByTestId(COMMON_SELECTORS.saveChangesButton).click();
|
|
10537
12781
|
await addWebhook;
|
|
10538
|
-
await test.expect(this.page.getByRole("row", { name: webhookSiteURL })).toBeVisible();
|
|
12782
|
+
await test$1.expect(this.page.getByRole("row", { name: webhookSiteURL })).toBeVisible();
|
|
10539
12783
|
};
|
|
10540
12784
|
this.verifyLatestWebhookResponse = async ({ callback = () => { }, webhookToken, ...otherParams }) => {
|
|
10541
12785
|
let response;
|
|
10542
|
-
await test.expect(async () => {
|
|
12786
|
+
await test$1.expect(async () => {
|
|
10543
12787
|
response = await this.request.get(`https://webhook.site/token/${webhookToken}/request/latest`);
|
|
10544
|
-
test.expect(response.status()).toBe(200);
|
|
12788
|
+
test$1.expect(response.status()).toBe(200);
|
|
10545
12789
|
if (response.status() === 200) {
|
|
10546
12790
|
const { content } = await response.json();
|
|
10547
12791
|
const parsedResponse = JSON.parse(content).webhook;
|
|
10548
12792
|
callback({ parsedResponse, ...otherParams });
|
|
10549
12793
|
}
|
|
10550
|
-
}).toPass({ timeout:
|
|
12794
|
+
}).toPass({ timeout: 20000 });
|
|
10551
12795
|
};
|
|
10552
12796
|
this.verifyWebhookDeliveries = async ({ callback = () => { }, ...otherParams }) => {
|
|
10553
|
-
await test.expect(this.page.getByTestId(WEBHOOK_SELECTORS.deliveryResponseCode)).toHaveText("200");
|
|
12797
|
+
await test$1.expect(this.page.getByTestId(WEBHOOK_SELECTORS.deliveryResponseCode)).toHaveText("200");
|
|
10554
12798
|
const requestPayload = (await this.page
|
|
10555
12799
|
.getByTestId(WEBHOOK_SELECTORS.deliveryRequestPayload)
|
|
10556
12800
|
.textContent());
|
|
@@ -10681,7 +12925,7 @@ class OrganizationPage {
|
|
|
10681
12925
|
subdomainName: user.subdomainName,
|
|
10682
12926
|
appName: `neeto${product}`,
|
|
10683
12927
|
});
|
|
10684
|
-
await test.expect(this.page.locator(COMMON_SELECTORS.spinner)).toBeHidden();
|
|
12928
|
+
await test$1.expect(this.page.locator(COMMON_SELECTORS.spinner)).toBeHidden();
|
|
10685
12929
|
const userCredentials = readFileSyncIfExists();
|
|
10686
12930
|
await this.page.context().storageState({ path: STORAGE_STATE });
|
|
10687
12931
|
const mergedCredentials = ramda.mergeAll([
|
|
@@ -10964,10 +13208,10 @@ const memberUtils = {
|
|
|
10964
13208
|
|
|
10965
13209
|
const assertColumnHeaderVisibility = async ({ page, columnName, shouldBeVisible, }) => {
|
|
10966
13210
|
const visibilityAssertion = shouldBeVisible ? "toBeVisible" : "toBeHidden";
|
|
10967
|
-
await test.expect(page.getByRole("columnheader", { name: columnName }))[visibilityAssertion]();
|
|
13211
|
+
await test$1.expect(page.getByRole("columnheader", { name: columnName }))[visibilityAssertion]();
|
|
10968
13212
|
};
|
|
10969
13213
|
const verifyTableColumnsExistence = async ({ page, columnNames, }) => {
|
|
10970
|
-
await Promise.all(columnNames.map(columnName => test.expect(page.getByRole("columnheader", { name: columnName, exact: true })).toBeVisible()));
|
|
13214
|
+
await Promise.all(columnNames.map(columnName => test$1.expect(page.getByRole("columnheader", { name: columnName, exact: true })).toBeVisible()));
|
|
10971
13215
|
};
|
|
10972
13216
|
const toggleColumnCheckboxAndVerifyVisibility = async ({ page, tableColumns, shouldBeChecked, }) => {
|
|
10973
13217
|
await page.getByTestId(COMMON_SELECTORS.columnsDropdownButton).click();
|
|
@@ -10982,8 +13226,8 @@ const toggleColumnCheckboxAndVerifyVisibility = async ({ page, tableColumns, sho
|
|
|
10982
13226
|
await checkbox.click();
|
|
10983
13227
|
}
|
|
10984
13228
|
shouldBeChecked
|
|
10985
|
-
? await test.expect(checkbox).toBeChecked()
|
|
10986
|
-
: await test.expect(checkbox).not.toBeChecked();
|
|
13229
|
+
? await test$1.expect(checkbox).toBeChecked()
|
|
13230
|
+
: await test$1.expect(checkbox).not.toBeChecked();
|
|
10987
13231
|
}
|
|
10988
13232
|
await page.getByTestId(COMMON_SELECTORS.columnsDropdownButton).click();
|
|
10989
13233
|
for (const columnName of tableColumns) {
|
|
@@ -11001,8 +13245,8 @@ const tableUtils = {
|
|
|
11001
13245
|
};
|
|
11002
13246
|
|
|
11003
13247
|
const verifyBreadcrumbs = async ({ page, titlesAndRoutes, }) => {
|
|
11004
|
-
await test.expect(page.getByTestId(COMMON_SELECTORS.breadcrumbHeader)).toHaveCount(titlesAndRoutes.length);
|
|
11005
|
-
await Promise.all(titlesAndRoutes.map(({ title, route }) => test.expect(page.getByTestId(COMMON_SELECTORS.breadcrumbHeader).getByRole("link", {
|
|
13248
|
+
await test$1.expect(page.getByTestId(COMMON_SELECTORS.breadcrumbHeader)).toHaveCount(titlesAndRoutes.length);
|
|
13249
|
+
await Promise.all(titlesAndRoutes.map(({ title, route }) => test$1.expect(page.getByTestId(COMMON_SELECTORS.breadcrumbHeader).getByRole("link", {
|
|
11006
13250
|
name: title,
|
|
11007
13251
|
exact: true,
|
|
11008
13252
|
})).toHaveAttribute("href", route)));
|
|
@@ -11095,7 +13339,7 @@ var require$$4 = {
|
|
|
11095
13339
|
|
|
11096
13340
|
const fs = require$$0__default$4["default"];
|
|
11097
13341
|
const path = require$$0__default$2["default"];
|
|
11098
|
-
const os = require$$0__default["default"];
|
|
13342
|
+
const os = require$$0__default$1["default"];
|
|
11099
13343
|
const crypto = require$$3__default["default"];
|
|
11100
13344
|
const packageJson = require$$4;
|
|
11101
13345
|
|
|
@@ -11509,7 +13753,7 @@ const currentsConfig = {
|
|
|
11509
13753
|
const isCI = [ENVIRONMENT.staging, ENVIRONMENT.review].includes((_b = process.env.TEST_ENV) !== null && _b !== void 0 ? _b : ENVIRONMENT.development) && !!process.env.NEETO_CI_JOB_ID;
|
|
11510
13754
|
const definePlaywrightConfig = (overrides) => {
|
|
11511
13755
|
const { globalOverrides = {}, useOverrides = {}, useCustomProjects = false, projectOverrides = [], currentsOverrides = {}, } = overrides;
|
|
11512
|
-
return test.defineConfig({
|
|
13756
|
+
return test$1.defineConfig({
|
|
11513
13757
|
testDir: "./e2e/tests",
|
|
11514
13758
|
fullyParallel: true,
|
|
11515
13759
|
forbidOnly: isCI,
|
|
@@ -11541,7 +13785,7 @@ const definePlaywrightConfig = (overrides) => {
|
|
|
11541
13785
|
},
|
|
11542
13786
|
{
|
|
11543
13787
|
name: "chromium",
|
|
11544
|
-
use: { ...test.devices["Desktop Chrome"], storageState: STORAGE_STATE },
|
|
13788
|
+
use: { ...test$1.devices["Desktop Chrome"], storageState: STORAGE_STATE },
|
|
11545
13789
|
dependencies: ["setup"],
|
|
11546
13790
|
},
|
|
11547
13791
|
{ name: "cleanup credentials", testMatch: "global.teardown.ts" },
|