testplane 8.11.6 → 8.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/build/package.json +13 -10
- package/build/src/browser/calibrator.d.ts +1 -0
- package/build/src/browser/calibrator.js +2 -2
- package/build/src/browser/calibrator.js.map +1 -1
- package/build/src/browser/client-bridge/client-bridge.js +0 -1
- package/build/src/browser/client-bridge/client-bridge.js.map +1 -1
- package/build/src/browser/client-bridge/index.d.ts +0 -1
- package/build/src/browser/client-bridge/index.js +12 -27
- package/build/src/browser/client-bridge/index.js.map +1 -1
- package/build/src/browser/client-scripts/build.js +70 -0
- package/build/src/browser/client-scripts/bundle.compat.js +23 -0
- package/build/src/browser/client-scripts/bundle.native.js +15 -0
- package/build/src/browser/commands/switchToRepl.js +3 -2
- package/build/src/browser/commands/switchToRepl.js.map +1 -1
- package/build/src/browser/existing-browser.d.ts +1 -2
- package/build/src/bundle/index.js +73801 -1879
- package/build/src/errors/abort-on-reconnect-error.d.ts +3 -0
- package/build/src/errors/abort-on-reconnect-error.js +11 -0
- package/build/src/errors/abort-on-reconnect-error.js.map +1 -0
- package/build/src/errors/testplane-internal-error.d.ts +3 -0
- package/build/src/errors/testplane-internal-error.js +11 -0
- package/build/src/errors/testplane-internal-error.js.map +1 -0
- package/build/src/errors.d.ts +4 -0
- package/build/src/errors.js +4 -0
- package/build/src/errors.js.map +1 -1
- package/build/src/runner/browser-env/vite/browser-modules/errors/index.js +4 -0
- package/build/src/runner/browser-env/vite/browser-modules/errors/index.js.map +1 -1
- package/build/src/runner/browser-env/vite/browser-modules/globals.js +3 -0
- package/build/src/runner/browser-env/vite/browser-modules/globals.js.map +1 -1
- package/build/src/runner/browser-env/vite/browser-modules/tsconfig.tsbuildinfo +1 -1
- package/build/src/runner/browser-env/vite/browser-modules/types.d.ts +5 -2
- package/build/src/runner/browser-env/vite/browser-modules/types.js +1 -0
- package/build/src/runner/browser-env/vite/browser-modules/types.js.map +1 -1
- package/build/src/runner/browser-env/vite/browser-modules/utils/console.js +3 -1
- package/build/src/runner/browser-env/vite/browser-modules/utils/console.js.map +1 -1
- package/build/src/runner/browser-env/vite/server.js.map +1 -1
- package/build/src/runner/browser-env/vite/socket.js +4 -1
- package/build/src/runner/browser-env/vite/socket.js.map +1 -1
- package/build/src/runner/browser-env/vite/types.d.ts +4 -3
- package/build/src/runner/browser-env/vite/types.js +1 -0
- package/build/src/runner/browser-env/vite/types.js.map +1 -1
- package/build/src/worker/browser-env/runner/test-runner/constants.d.ts +2 -0
- package/build/src/worker/browser-env/runner/test-runner/constants.js +3 -1
- package/build/src/worker/browser-env/runner/test-runner/constants.js.map +1 -1
- package/build/src/worker/browser-env/runner/test-runner/execution-thread.d.ts +1 -1
- package/build/src/worker/browser-env/runner/test-runner/execution-thread.js +39 -15
- package/build/src/worker/browser-env/runner/test-runner/execution-thread.js.map +1 -1
- package/build/src/worker/browser-env/runner/test-runner/index.d.ts +4 -0
- package/build/src/worker/browser-env/runner/test-runner/index.js +85 -1
- package/build/src/worker/browser-env/runner/test-runner/index.js.map +1 -1
- package/build/src/worker/runner/test-runner/execution-thread.js +9 -0
- package/build/src/worker/runner/test-runner/execution-thread.js.map +1 -1
- package/build/src/worker/runner/test-runner/index.d.ts +16 -11
- package/build/src/worker/runner/test-runner/index.js +65 -46
- package/build/src/worker/runner/test-runner/index.js.map +1 -1
- package/build/src/worker/runner/test-runner/types.d.ts +0 -2
- package/package.json +13 -10
- package/build/src/browser/client-scripts/ignore-areas.deprecated.js +0 -7
package/README.md
CHANGED
|
@@ -29,6 +29,8 @@ Testplane (ex-Hermione) is a battle-hardened framework for testing web apps at a
|
|
|
29
29
|
|
|
30
30
|
⚡ **Infinite Extensibility:** Testplane offers a versatile plugin system with dozens of open-source plugins on GitHub, along with custom reporters, commands, and execution logic.
|
|
31
31
|
|
|
32
|
+
📦 **Various Test Environments:** With Testplane you can run tests not only in Node.js environment but also in the browser. It means you can run e2e/integration tests in Node.js and [component](docs/component-testing.md)/unit tests in browser.
|
|
33
|
+
|
|
32
34
|
## Getting started
|
|
33
35
|
|
|
34
36
|
> Note: if you prefer manual installation, you can run `npm i -D testplane`. Check out [the Docs](docs/quick-start.md) for details.
|
|
@@ -86,6 +88,7 @@ The documentation is divided into several sections:
|
|
|
86
88
|
- [Testplane CLI](docs/cli.md)
|
|
87
89
|
- [Testplane Events](docs/events.md)
|
|
88
90
|
- [Testplane Programmatic API](docs/programmatic-api.md)
|
|
91
|
+
- [Testplane Component Testing (experimental)](docs/component-testing.md)
|
|
89
92
|
|
|
90
93
|
## Rename from "Hermione"
|
|
91
94
|
|
package/build/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testplane",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.12.0",
|
|
4
4
|
"description": "Tests framework based on mocha and wdio",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
"typings"
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "tsc --build && npm run copy-static && npm run build-
|
|
12
|
-
"build-bundle": "esbuild ./src/bundle/index.ts --outdir=./build/src/bundle --bundle --format=cjs --platform=node --target=ES2021",
|
|
11
|
+
"build": "tsc --build && npm run copy-static && npm run build-bundles",
|
|
13
12
|
"copy-static": "copyfiles 'src/browser/client-scripts/*' build",
|
|
13
|
+
"build-node-bundle": "esbuild ./src/bundle/index.ts --outdir=./build/src/bundle --bundle --format=cjs --platform=node --target=ES2021",
|
|
14
|
+
"build-browser-bundle": "node ./src/browser/client-scripts/build.js",
|
|
15
|
+
"build-bundles": "concurrently -c 'auto' 'npm:build-browser-bundle' 'npm:build-node-bundle --minify'",
|
|
14
16
|
"check-types": "tsc --project tsconfig.spec.json",
|
|
15
17
|
"clean": "rimraf build/ *.tsbuildinfo",
|
|
16
18
|
"lint": "eslint --cache . && prettier --check .",
|
|
@@ -24,9 +26,9 @@
|
|
|
24
26
|
"preversion": "npm run lint && npm test",
|
|
25
27
|
"commitmsg": "commitlint -e",
|
|
26
28
|
"release": "standard-version",
|
|
27
|
-
"watch": "npm run copy-static && concurrently -c 'auto' 'npm:watch:src' 'npm:watch:bundle'",
|
|
29
|
+
"watch": "npm run copy-static && npm run build-browser-bundle && concurrently -c 'auto' 'npm:watch:src' 'npm:watch:bundle'",
|
|
28
30
|
"watch:src": "tsc --build --watch",
|
|
29
|
-
"watch:bundle": "npm run build-bundle -- --watch"
|
|
31
|
+
"watch:bundle": "npm run build-node-bundle -- --watch"
|
|
30
32
|
},
|
|
31
33
|
"repository": {
|
|
32
34
|
"type": "git",
|
|
@@ -56,9 +58,7 @@
|
|
|
56
58
|
"@wdio/types": "8.21.0",
|
|
57
59
|
"@wdio/utils": "8.35.0",
|
|
58
60
|
"@wdio/utils-cjs": "npm:@wdio/utils@7.26.0",
|
|
59
|
-
"aliasify": "1.9.0",
|
|
60
61
|
"bluebird": "3.5.1",
|
|
61
|
-
"browserify": "13.3.0",
|
|
62
62
|
"chalk": "2.4.2",
|
|
63
63
|
"clear-require": "1.0.1",
|
|
64
64
|
"debug": "2.6.9",
|
|
@@ -86,7 +86,6 @@
|
|
|
86
86
|
"strftime": "0.10.2",
|
|
87
87
|
"strip-ansi": "6.0.1",
|
|
88
88
|
"temp": "0.8.3",
|
|
89
|
-
"uglifyify": "3.0.4",
|
|
90
89
|
"urijs": "1.19.11",
|
|
91
90
|
"url-join": "4.0.1",
|
|
92
91
|
"vite": "5.1.6",
|
|
@@ -107,6 +106,7 @@
|
|
|
107
106
|
"@types/babel__code-frame": "7.0.6",
|
|
108
107
|
"@types/babel__core": "7.20.5",
|
|
109
108
|
"@types/bluebird": "3.5.38",
|
|
109
|
+
"@types/browserify": "12.0.40",
|
|
110
110
|
"@types/chai": "4.3.4",
|
|
111
111
|
"@types/chai-as-promised": "7.1.5",
|
|
112
112
|
"@types/debug": "4.1.12",
|
|
@@ -115,13 +115,15 @@
|
|
|
115
115
|
"@types/node": "18.19.3",
|
|
116
116
|
"@types/proxyquire": "1.3.28",
|
|
117
117
|
"@types/sharp": "0.31.1",
|
|
118
|
-
"@types/sinon": "
|
|
118
|
+
"@types/sinon": "17.0.1",
|
|
119
119
|
"@types/sinonjs__fake-timers": "8.1.2",
|
|
120
120
|
"@types/urijs": "1.19.25",
|
|
121
121
|
"@types/url-join": "4.0.3",
|
|
122
122
|
"@typescript-eslint/eslint-plugin": "6.12.0",
|
|
123
123
|
"@typescript-eslint/parser": "6.12.0",
|
|
124
|
+
"aliasify": "1.9.0",
|
|
124
125
|
"app-module-path": "2.2.0",
|
|
126
|
+
"browserify": "13.3.0",
|
|
125
127
|
"chai": "4.2.0",
|
|
126
128
|
"chai-as-promised": "7.1.1",
|
|
127
129
|
"concurrently": "8.2.2",
|
|
@@ -145,7 +147,8 @@
|
|
|
145
147
|
"standard-version": "9.5.0",
|
|
146
148
|
"ts-node": "10.9.1",
|
|
147
149
|
"type-fest": "3.11.1",
|
|
148
|
-
"typescript": "5.3.2"
|
|
150
|
+
"typescript": "5.3.2",
|
|
151
|
+
"uglifyify": "3.0.4"
|
|
149
152
|
},
|
|
150
153
|
"peerDependencies": {
|
|
151
154
|
"ts-node": ">=10.5.0"
|
|
@@ -5,11 +5,11 @@ const Promise = require("bluebird");
|
|
|
5
5
|
const _ = require("lodash");
|
|
6
6
|
const looksSame = require("looks-same");
|
|
7
7
|
const { CoreError } = require("./core-error");
|
|
8
|
-
const clientScriptCalibrate = fs.readFileSync(path.join(__dirname, "client-scripts", "calibrate.js"), "utf8");
|
|
9
8
|
const DIRECTION = { FORWARD: "forward", REVERSE: "reverse" };
|
|
10
9
|
module.exports = class Calibrator {
|
|
11
10
|
constructor() {
|
|
12
11
|
this._cache = {};
|
|
12
|
+
this._script = fs.readFileSync(path.join(__dirname, "client-scripts", "calibrate.js"), "utf8");
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* @param {Browser} browser
|
|
@@ -20,7 +20,7 @@ module.exports = class Calibrator {
|
|
|
20
20
|
return Promise.resolve(this._cache[browser.id]);
|
|
21
21
|
}
|
|
22
22
|
return Promise.resolve(browser.open("about:blank"))
|
|
23
|
-
.then(() => browser.evalScript(
|
|
23
|
+
.then(() => browser.evalScript(this._script))
|
|
24
24
|
.then(features => [features, browser.captureViewportImage()])
|
|
25
25
|
.spread(async (features, image) => {
|
|
26
26
|
const { innerWidth, pixelRatio } = features;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calibrator.js","sourceRoot":"","sources":["../../../src/browser/calibrator.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACpC,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AACxC,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAE9C,MAAM,
|
|
1
|
+
{"version":3,"file":"calibrator.js","sourceRoot":"","sources":["../../../src/browser/calibrator.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AACpC,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC5B,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AACxC,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAE9C,MAAM,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AAC;QACL,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;IACd,CAAC;IAED,KAAK,UAAU,QAAQ,CAAC,CAAC;QACrB,IAAI,KAAK,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACxC,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3B,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAChD,CAAC;AACL,CAAC;AAED,SAAS,OAAO,CAAC,IAAI;IACjB,OAAO;QACH,CAAC,EAAE,IAAI,CAAC,CAAC;QACT,CAAC,EAAE,IAAI,CAAC,CAAC;QACT,CAAC,EAAE,IAAI,CAAC,CAAC;KACZ,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-bridge.js","sourceRoot":"","sources":["../../../../src/browser/client-bridge/client-bridge.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,
|
|
1
|
+
{"version":3,"file":"client-bridge.js","sourceRoot":"","sources":["../../../../src/browser/client-bridge/client-bridge.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAEjD,MAAM,CAAC,OAAO,GAAG,MAAM,YAAY;IAC/B,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM;QACzB,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED,YAAY,OAAO,EAAE,MAAM;QACvB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,EAAE;QAChB,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,IAA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
1
1
|
"use strict";
|
|
2
2
|
const path = require("path");
|
|
3
|
-
const
|
|
4
|
-
const browserify = require("browserify");
|
|
3
|
+
const fs = require("fs");
|
|
5
4
|
const ClientBridge = require("./client-bridge");
|
|
5
|
+
const bundlesCache = {};
|
|
6
6
|
exports.ClientBridge = ClientBridge;
|
|
7
|
-
exports.build = (browser, opts = {}) => {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
output: { screw_ie8: false }, // eslint-disable-line camelcase
|
|
18
|
-
}, "uglifyify");
|
|
19
|
-
const lib = opts.calibration && opts.calibration.needsCompatLib ? "./lib.compat.js" : "./lib.native.js";
|
|
20
|
-
const ignoreAreas = opts.supportDeprecated ? "./ignore-areas.deprecated.js" : "./ignore-areas.js";
|
|
21
|
-
script.transform({
|
|
22
|
-
aliases: {
|
|
23
|
-
"./lib": { relative: lib },
|
|
24
|
-
"./ignore-areas": { relative: ignoreAreas },
|
|
25
|
-
},
|
|
26
|
-
verbose: false,
|
|
27
|
-
}, "aliasify");
|
|
28
|
-
return Promise.fromCallback(cb => script.bundle(cb)).then(buf => {
|
|
29
|
-
const scripts = buf.toString();
|
|
30
|
-
return ClientBridge.create(browser, scripts);
|
|
31
|
-
});
|
|
7
|
+
exports.build = async (browser, opts = {}) => {
|
|
8
|
+
const needsCompatLib = opts.calibration && opts.calibration.needsCompatLib;
|
|
9
|
+
const scriptFileName = needsCompatLib ? "bundle.compat.js" : "bundle.native.js";
|
|
10
|
+
if (bundlesCache[scriptFileName]) {
|
|
11
|
+
return ClientBridge.create(browser, bundlesCache[scriptFileName]);
|
|
12
|
+
}
|
|
13
|
+
const scriptFilePath = path.join(__dirname, "..", "client-scripts", scriptFileName);
|
|
14
|
+
const bundle = await fs.promises.readFile(scriptFilePath, { encoding: "utf8" });
|
|
15
|
+
bundlesCache[scriptFileName] = bundle;
|
|
16
|
+
return ClientBridge.create(browser, bundle);
|
|
32
17
|
};
|
|
33
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/browser/client-bridge/index.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/browser/client-bridge/index.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACzB,MAAM,YAAY,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEhD,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB,OAAO,CAAC,YAAY,GAAG,YAAY,CAAC;AAEpC,OAAO,CAAC,KAAK,GAAG,KAAK,EAAE,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,EAAE;IACzC,MAAM,cAAc,GAAG,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC;IAE3E,MAAM,cAAc,GAAG,cAAc,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,kBAAkB,CAAC;IAEhF,IAAI,YAAY,CAAC,cAAc,CAAC,EAAE,CAAC;QAC/B,OAAO,YAAY,CAAC,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;IACpF,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IAChF,YAAY,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;IAEtC,OAAO,YAAY,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAChD,CAAC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/* global process, __dirname */
|
|
2
|
+
const path = require("path");
|
|
3
|
+
const browserify = require("browserify");
|
|
4
|
+
const uglifyify = require("uglifyify");
|
|
5
|
+
const aliasify = require("aliasify");
|
|
6
|
+
const fs = require("fs-extra");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @param {object} opts
|
|
10
|
+
* @param {boolean} opts.needsCompatLib
|
|
11
|
+
* @returns {Promise<Buffer>}
|
|
12
|
+
*/
|
|
13
|
+
const bundleScript = async opts => {
|
|
14
|
+
const lib = opts.needsCompatLib ? "./lib.compat.js" : "./lib.native.js";
|
|
15
|
+
const script = browserify({
|
|
16
|
+
entries: "./index.js",
|
|
17
|
+
basedir: __dirname
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
script.transform(
|
|
21
|
+
{
|
|
22
|
+
sourcemap: false,
|
|
23
|
+
global: true,
|
|
24
|
+
compress: { screw_ie8: false }, // eslint-disable-line camelcase
|
|
25
|
+
mangle: { screw_ie8: false }, // eslint-disable-line camelcase
|
|
26
|
+
output: { screw_ie8: false } // eslint-disable-line camelcase
|
|
27
|
+
},
|
|
28
|
+
uglifyify
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
script.transform(
|
|
32
|
+
{
|
|
33
|
+
aliases: {
|
|
34
|
+
"./lib": { relative: lib }
|
|
35
|
+
},
|
|
36
|
+
verbose: false
|
|
37
|
+
},
|
|
38
|
+
aliasify
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return new Promise((resolve, reject) => {
|
|
42
|
+
script.bundle((err, buffer) => {
|
|
43
|
+
if (err) {
|
|
44
|
+
reject(err);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
resolve(buffer);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
async function main() {
|
|
53
|
+
const targetDir = path.join("build", path.relative(process.cwd(), __dirname));
|
|
54
|
+
|
|
55
|
+
await fs.ensureDir(targetDir);
|
|
56
|
+
|
|
57
|
+
await Promise.all(
|
|
58
|
+
[
|
|
59
|
+
{ needsCompatLib: true, fileName: "bundle.compat.js" },
|
|
60
|
+
{ needsCompatLib: false, fileName: "bundle.native.js" }
|
|
61
|
+
].map(async ({ needsCompatLib, fileName }) => {
|
|
62
|
+
const buffer = await bundleScript({ needsCompatLib });
|
|
63
|
+
const filePath = path.join(targetDir, fileName);
|
|
64
|
+
|
|
65
|
+
await fs.writeFile(filePath, buffer);
|
|
66
|
+
})
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
module.exports = main();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
|
2
|
+
!function(e){function t(e,t,n,r){var o,i,u,l,a,s,d,p=t&&t.ownerDocument,h=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==h&&9!==h&&11!==h)return n;if(!r&&(q(t),t=t||I,R)){if(11!==h&&(a=ye.exec(e)))if(o=a[1]){if(9===h){if(!(u=t.getElementById(o)))return n;if(u.id===o)return n.push(u),n}else if(p&&(u=p.getElementById(o))&&P(t,u)&&u.id===o)return n.push(u),n}else{if(a[2])return Y.apply(n,t.getElementsByTagName(e)),n;if((o=a[3])&&w.getElementsByClassName&&t.getElementsByClassName)return Y.apply(n,t.getElementsByClassName(o)),n}if(w.qsa&&!V[e+" "]&&(!$||!$.test(e))&&(1!==h||"object"!==t.nodeName.toLowerCase())){if(d=e,p=t,1===h&&(ce.test(e)||ae.test(e))){for(p=ve.test(e)&&c(t.parentNode)||t,p===t&&w.scope||((l=t.getAttribute("id"))?l=l.replace(Ne,Ce):t.setAttribute("id",l=z)),s=E(e),i=s.length;i--;)s[i]=(l?"#"+l:":scope")+" "+f(s[i]);d=s.join(",")}try{return Y.apply(n,p.querySelectorAll(d)),n}catch(g){V(e,!0)}finally{l===z&&t.removeAttribute("id")}}}return S(e.replace(ue,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>N.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[z]=!0,e}function o(e){var t=I.createElement("fieldset");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function i(e,t){for(var n=e.split("|"),r=n.length;r--;)N.attrHandle[n[r]]=t}function u(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function l(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Ee(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function a(e){return r(function(t){return t=+t,r(function(n,r){for(var o,i=e([],n.length,t),u=i.length;u--;)n[o=i[u]]&&(n[o]=!(r[o]=n[o]))})})}function c(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function s(){}function f(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function d(e,t,n){var r=t.dir,o=t.next,i=o||r,u=n&&"parentNode"===i,l=O++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||u)return e(t,n,o);return!1}:function(t,n,a){var c,s,f,d=[k,l];if(a){for(;t=t[r];)if((1===t.nodeType||u)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||u)if(f=t[z]||(t[z]={}),s=f[t.uniqueID]||(f[t.uniqueID]={}),o&&o===t.nodeName.toLowerCase())t=t[r]||t;else{if((c=s[i])&&c[0]===k&&c[1]===l)return d[2]=c[2];if(s[i]=d,d[2]=e(t,n,a))return!0}return!1}}function p(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function h(e,n,r){for(var o=0,i=n.length;o<i;o++)t(e,n[o],r);return r}function g(e,t,n,r,o){for(var i,u=[],l=0,a=e.length,c=null!=t;l<a;l++)(i=e[l])&&(n&&!n(i,r,o)||(u.push(i),c&&t.push(l)));return u}function m(e,t,n,o,i,u){return o&&!o[z]&&(o=m(o)),i&&!i[z]&&(i=m(i,u)),r(function(r,u,l,a){var c,s,f,d=[],p=[],m=u.length,y=r||h(t||"*",l.nodeType?[l]:l,[]),v=!e||!r&&t?y:g(y,d,e,l,a),b=n?i||(r?e:m||o)?[]:u:v;if(n&&n(v,b,l,a),o)for(c=g(b,p),o(c,[],l,a),s=c.length;s--;)(f=c[s])&&(b[p[s]]=!(v[p[s]]=f));if(r){if(i||e){if(i){for(c=[],s=b.length;s--;)(f=b[s])&&c.push(v[s]=f);i(null,b=[],c,a)}for(s=b.length;s--;)(f=b[s])&&(c=i?_(r,f):d[s])>-1&&(r[c]=!(u[c]=f))}}else b=g(b===u?b.splice(m,b.length):b),i?i(null,u,b,a):Y.apply(u,b)})}function y(e){for(var t,n,r,o=e.length,i=N.relative[e[0].type],u=i||N.relative[" "],l=i?1:0,a=d(function(e){return e===t},u,!0),c=d(function(e){return _(t,e)>-1},u,!0),s=[function(e,n,r){var o=!i&&(r||n!==D)||((t=n).nodeType?a(e,n,r):c(e,n,r));return t=null,o}];l<o;l++)if(n=N.relative[e[l].type])s=[d(p(s),n)];else{if(n=N.filter[e[l].type].apply(null,e[l].matches),n[z]){for(r=++l;r<o&&!N.relative[e[r].type];r++);return m(l>1&&p(s),l>1&&f(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(ue,"$1"),n,l<r&&y(e.slice(l,r)),r<o&&y(e=e.slice(r)),r<o&&f(e))}s.push(n)}return p(s)}function v(e,n){var o=n.length>0,i=e.length>0,u=function(r,u,l,a,c){var s,f,d,p=0,h="0",m=r&&[],y=[],v=D,b=r||i&&N.find.TAG("*",c),w=k+=null==v?1:Math.random()||.1,C=b.length;for(c&&(D=u==I||u||c);h!==C&&null!=(s=b[h]);h++){if(i&&s){for(f=0,u||s.ownerDocument==I||(q(s),l=!R);d=e[f++];)if(d(s,u||I,l)){a.push(s);break}c&&(k=w)}o&&((s=!d&&s)&&p--,r&&m.push(s))}if(p+=h,o&&h!==p){for(f=0;d=n[f++];)d(m,y,u,l);if(r){if(p>0)for(;h--;)m[h]||y[h]||(y[h]=Q.call(a));y=g(y)}Y.apply(a,y),c&&!r&&y.length>0&&p+n.length>1&&t.uniqueSort(a)}return c&&(k=w,D=v),m};return o?r(u):u}var b,w,N,C,x,E,A,S,D,T,L,q,I,B,R,$,H,M,P,z="sizzle"+1*new Date,F=e.document,k=0,O=0,j=n(),G=n(),U=n(),V=n(),X=function(e,t){return e===t&&(L=!0),0},J={}.hasOwnProperty,K=[],Q=K.pop,W=K.push,Y=K.push,Z=K.slice,_=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},ee="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",te="[\\x20\\t\\r\\n\\f]",ne="(?:\\\\[\\da-fA-F]{1,6}"+te+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",re="\\["+te+"*("+ne+")(?:"+te+"*([*^$|!~]?=)"+te+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ne+"))|)"+te+"*\\]",oe=":("+ne+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+re+")*)|.*)\\)|)",ie=new RegExp(te+"+","g"),ue=new RegExp("^"+te+"+|((?:^|[^\\\\])(?:\\\\.)*)"+te+"+$","g"),le=new RegExp("^"+te+"*,"+te+"*"),ae=new RegExp("^"+te+"*([>+~]|"+te+")"+te+"*"),ce=new RegExp(te+"|>"),se=new RegExp(oe),fe=new RegExp("^"+ne+"$"),de={ID:new RegExp("^#("+ne+")"),CLASS:new RegExp("^\\.("+ne+")"),TAG:new RegExp("^("+ne+"|[*])"),ATTR:new RegExp("^"+re),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+te+"*(even|odd|(([+-]|)(\\d*)n|)"+te+"*(?:([+-]|)"+te+"*(\\d+)|))"+te+"*\\)|)","i"),bool:new RegExp("^(?:"+ee+")$","i"),needsContext:new RegExp("^"+te+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+te+"*((?:-\\d)?\\d*)"+te+"*\\)|)(?=[^-]|$)","i")},pe=/HTML$/i,he=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ve=/[+~]/,be=new RegExp("\\\\[\\da-fA-F]{1,6}"+te+"?|\\\\([^\\r\\n\\f])","g"),we=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},Ne=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,Ce=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},xe=function(){q()},Ee=d(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{Y.apply(K=Z.call(F.childNodes),F.childNodes),K[F.childNodes.length].nodeType}catch(Se){Y={apply:K.length?function(e,t){W.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}w=t.support={},x=t.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!pe.test(t||n&&n.nodeName||"HTML")},q=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:F;return r!=I&&9===r.nodeType&&r.documentElement?(I=r,B=I.documentElement,R=!x(I),F!=I&&(n=I.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",xe,!1):n.attachEvent&&n.attachEvent("onunload",xe)),w.scope=o(function(e){return B.appendChild(e).appendChild(I.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),w.attributes=o(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=o(function(e){return e.appendChild(I.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=me.test(I.getElementsByClassName),w.getById=o(function(e){return B.appendChild(e).id=z,!I.getElementsByName||!I.getElementsByName(z).length}),w.getById?(N.filter.ID=function(e){var t=e.replace(be,we);return function(e){return e.getAttribute("id")===t}},N.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&R){var n=t.getElementById(e);return n?[n]:[]}}):(N.filter.ID=function(e){var t=e.replace(be,we);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},N.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&R){var n,r,o,i=t.getElementById(e);if(i){if((n=i.getAttributeNode("id"))&&n.value===e)return[i];for(o=t.getElementsByName(e),r=0;i=o[r++];)if((n=i.getAttributeNode("id"))&&n.value===e)return[i]}return[]}}),N.find.TAG=w.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):w.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},N.find.CLASS=w.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&R)return t.getElementsByClassName(e)},H=[],$=[],(w.qsa=me.test(I.querySelectorAll))&&(o(function(e){var t;B.appendChild(e).innerHTML="<a id='"+z+"'></a><select id='"+z+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&$.push("[*^$]="+te+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||$.push("\\["+te+"*(?:value|"+ee+")"),e.querySelectorAll("[id~="+z+"-]").length||$.push("~="),t=I.createElement("input"),t.setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||$.push("\\["+te+"*name"+te+"*="+te+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||$.push(":checked"),e.querySelectorAll("a#"+z+"+*").length||$.push(".#.+[+~]"),e.querySelectorAll("\\\f"),$.push("[\\r\\n\\f]")}),o(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=I.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&$.push("name"+te+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&$.push(":enabled",":disabled"),B.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&$.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),$.push(",.*:")})),(w.matchesSelector=me.test(M=B.matches||B.webkitMatchesSelector||B.mozMatchesSelector||B.oMatchesSelector||B.msMatchesSelector))&&o(function(e){w.disconnectedMatch=M.call(e,"*"),M.call(e,"[s!='']:x"),H.push("!=",oe)}),$=$.length&&new RegExp($.join("|")),H=H.length&&new RegExp(H.join("|")),t=me.test(B.compareDocumentPosition),P=t||me.test(B.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},X=t?function(e,t){if(e===t)return L=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!w.sortDetached&&t.compareDocumentPosition(e)===n?e==I||e.ownerDocument==F&&P(F,e)?-1:t==I||t.ownerDocument==F&&P(F,t)?1:T?_(T,e)-_(T,t):0:4&n?-1:1)}:function(e,t){if(e===t)return L=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,l=[e],a=[t];if(!o||!i)return e==I?-1:t==I?1:o?-1:i?1:T?_(T,e)-_(T,t):0;if(o===i)return u(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;l[r]===a[r];)r++;return r?u(l[r],a[r]):l[r]==F?-1:a[r]==F?1:0},I):I},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if(q(e),w.matchesSelector&&R&&!V[n+" "]&&(!H||!H.test(n))&&(!$||!$.test(n)))try{var r=M.call(e,n);if(r||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(Se){V(n,!0)}return t(n,I,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!=I&&q(e),P(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!=I&&q(e);var n=N.attrHandle[t.toLowerCase()],r=n&&J.call(N.attrHandle,t.toLowerCase())?n(e,t,!R):undefined;return r!==undefined?r:w.attributes||!R?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.escape=function(e){return(e+"").replace(Ne,Ce)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,o=0;if(L=!w.detectDuplicates,T=!w.sortStable&&e.slice(0),e.sort(X),L){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return T=null,e},C=t.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=C(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=C(t);return n},N=t.selectors={cacheLength:50,createPseudo:r,match:de,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,we),e[3]=(e[3]||e[4]||e[5]||"").replace(be,we),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return de.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&se.test(n)&&(t=E(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,we).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=j[e+" "];return t||(t=new RegExp("(^|"+te+")"+e+"("+te+"|$)"))&&j(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(o){var i=t.attr(o,e);return null==i?"!="===n:!n||(i+="","="===n?i===r:"!="===n?i!==r:"^="===n?r&&0===i.indexOf(r):"*="===n?r&&i.indexOf(r)>-1:"$="===n?r&&i.slice(-r.length)===r:"~="===n?(" "+i.replace(ie," ")+" ").indexOf(r)>-1:"|="===n&&(i===r||i.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),u="last"!==e.slice(-4),l="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,a){var c,s,f,d,p,h,g=i!==u?"nextSibling":"previousSibling",m=t.parentNode,y=l&&t.nodeName.toLowerCase(),v=!a&&!l,b=!1;if(m){if(i){for(;g;){for(d=t;d=d[g];)if(l?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[u?m.firstChild:m.lastChild],u&&v){for(d=m,f=d[z]||(d[z]={}),s=f[d.uniqueID]||(f[d.uniqueID]={}),c=s[e]||[],p=c[0]===k&&c[1],b=p&&c[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(b=p=0)||h.pop();)if(1===d.nodeType&&++b&&d===t){s[e]=[k,p,b];break}}else if(v&&(d=t,f=d[z]||(d[z]={}),s=f[d.uniqueID]||(f[d.uniqueID]={}),c=s[e]||[],p=c[0]===k&&c[1],b=p),!1===b)for(;(d=++p&&d&&d[g]||(b=p=0)||h.pop())&&((l?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++b||(v&&(f=d[z]||(d[z]={}),s=f[d.uniqueID]||(f[d.uniqueID]={}),s[e]=[k,b]),d!==t)););return(b-=o)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,n){var o,i=N.pseudos[e]||N.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return i[z]?i(n):i.length>1?(o=[e,e,"",n],N.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,o=i(e,n),u=o.length;u--;)r=_(e,o[u]),e[r]=!(t[r]=o[u])}):function(e){return i(e,0,o)}):i}},pseudos:{not:r(function(e){var t=[],n=[],o=A(e.replace(ue,"$1"));return o[z]?r(function(e,t,n,r){for(var i,u=o(e,null,r,[]),l=e.length;l--;)(i=u[l])&&(e[l]=!(t[l]=i))}):function(e,r,i){return t[0]=e,o(t,null,i,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,we),function(t){return(t.textContent||C(t)).indexOf(e)>-1}}),lang:r(function(e){return fe.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,we).toLowerCase(),function(t){var n;do{if(n=R?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===B},focus:function(e){return e===I.activeElement&&(!I.hasFocus||I.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:l(!1),disabled:l(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!N.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:a(function(){return[0]}),last:a(function(e,t){return[t-1]}),eq:a(function(e,t,n){return[n<0?n+t:n]}),even:a(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:a(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:a(function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e}),gt:a(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},N.pseudos.nth=N.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})N.pseudos[b]=function(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}(b);for(b in{submit:!0,reset:!0})N.pseudos[b]=function(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}(b);s.prototype=N.filters=N.pseudos,N.setFilters=new s,E=t.tokenize=function(e,n){var r,o,i,u,l,a,c,s=G[e+" "];if(s)return n?0:s.slice(0);for(l=e,a=[],c=N.preFilter;l;){r&&!(o=le.exec(l))||(o&&(l=l.slice(o[0].length)||l),a.push(i=[])),r=!1,(o=ae.exec(l))&&(r=o.shift(),i.push({value:r,type:o[0].replace(ue," ")}),l=l.slice(r.length));for(u in N.filter)!(o=de[u].exec(l))||c[u]&&!(o=c[u](o))||(r=o.shift(),i.push({value:r,type:u,matches:o}),l=l.slice(r.length));if(!r)break}return n?l.length:l?t.error(e):G(e,a).slice(0)},A=t.compile=function(e,t){var n,r=[],o=[],i=U[e+" "];if(!i){for(t||(t=E(e)),n=t.length;n--;)i=y(t[n]),i[z]?r.push(i):o.push(i);i=U(e,v(o,r)),i.selector=e}return i},S=t.select=function(e,t,n,r){var o,i,u,l,a,s="function"==typeof e&&e,d=!r&&E(e=s.selector||e);if(n=n||[],1===d.length){if(i=d[0]=d[0].slice(0),i.length>2&&"ID"===(u=i[0]).type&&9===t.nodeType&&R&&N.relative[i[1].type]){if(!(t=(N.find.ID(u.matches[0].replace(be,we),t)||[])[0]))return n;s&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=de.needsContext.test(e)?0:i.length;o--&&(u=i[o],!N.relative[l=u.type]);)if((a=N.find[l])&&(r=a(u.matches[0].replace(be,we),ve.test(i[0].type)&&c(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&f(i)))return Y.apply(n,r),n;break}}return(s||A(e,d))(r,t,!R,n,!t||ve.test(e)&&c(t.parentNode)||t),n},w.sortStable=z.split("").sort(X).join("")===z,w.detectDuplicates=!!L,q(),w.sortDetached=o(function(e){return 1&e.compareDocumentPosition(I.createElement("fieldset"))}),o(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||i("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&o(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||i("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),o(function(e){return null==e.getAttribute("disabled")})||i(ee,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null});var Ae=e.Sizzle;t.noConflict=function(){return e.Sizzle===t&&(e.Sizzle=Ae),t},"function"==typeof define&&define.amd?define(function(){return t}):"undefined"!=typeof module&&module.exports?module.exports=t:e.Sizzle=t}(window);
|
|
3
|
+
},{}],2:[function(require,module,exports){
|
|
4
|
+
"use strict";var lib=require("./lib.compat.js");module.exports=function(r){return lib.queryAll(r)};
|
|
5
|
+
},{"./lib.compat.js":4}],3:[function(require,module,exports){
|
|
6
|
+
(function (global){(function (){
|
|
7
|
+
"use strict";function prepareScreenshotUnsafe(e,t){var r=t.allowViewportOverflow,i=t.captureElementFromTop,o=t.disableAnimation,n=window;if(t.selectorToScroll&&!(n=document.querySelector(t.selectorToScroll)))return{error:"NOTFOUND",message:'Could not find element with css selector specified in "selectorToScroll" option: '+t.selectorToScroll,selector:t.selectorToScroll};var a,l=util.getMainDocumentElem(),c=l.clientWidth,s=l.clientHeight,u=l.scrollWidth,d=l.scrollHeight,p=new Rect({left:util.getScrollLeft(n),top:util.getScrollTop(n),width:c,height:s}).round(),f=configurePixelRatio(t.usePixelRatio),m=[];if(e.forEach(function(e){Rect.isRect(e)?a=a?a.merge(new Rect(e)):new Rect(e):m.push(e)}),a=getCaptureRect(m,{initialRect:a,allowViewportOverflow:r,scrollElem:n,viewportWidth:c,documentHeight:d}),a.error)return a;if(i&&!p.rectInside(a))util.isSafariMobile()?scrollToCaptureAreaInSafari(p,a,n):n.scrollTo(a.left,a.top);else if(r&&p.rectIntersects(a))a.overflowsTopBound(p)&&a.recalculateHeight(p),a.overflowsLeftBound(p)&&a.recalculateWidth(p);else if(!i&&!p.rectIntersects(a))return{error:"OUTSIDE_OF_VIEWPORT",message:'Can not capture element, because it is outside of viewport. Try to set "captureElementFromTop=true" to scroll to it before capture.'};return o&&disableFrameAnimationsUnsafe(),{captureArea:a.scale(f).serialize(),ignoreAreas:findIgnoreAreas(t.ignoreSelectors,{scrollElem:n,pixelRatio:f,viewportWidth:c,documentHeight:d}),viewport:new Rect({left:util.getScrollLeft(n),top:util.getScrollTop(n),width:c,height:s}).scale(f).serialize(),documentHeight:Math.ceil(d*f),documentWidth:Math.ceil(u*f),canHaveCaret:isEditable(document.activeElement),pixelRatio:f}}function disableFrameAnimationsUnsafe(){var e=["","::before","::after"].map(function(e){return"*:not(#testplane-q.testplane-w.testplane-e.testplane-r.testplane-t.testplane-y)"+e}).join(", "),t=[];util.forEachRoot(function(r){var i=document.createElement("style");i.innerHTML=e+["{"," animation-delay: 0ms !important;"," animation-duration: 0ms !important;"," animation-timing-function: step-start !important;"," transition-timing-function: step-start !important;"," scroll-behavior: auto !important;","}"].join("\n"),r.appendChild(i),t.push(i)}),window.__cleanupAnimation=function(){for(var e=0;e<t.length;e++)t[e].parentNode.removeChild(t[e]);delete window.__cleanupAnimation}}function getCaptureRect(e,t){for(var r,i,o=t.initialRect,n=0;n<e.length;n++){if(!(r=lib.queryFirst(e[n])))return{error:"NOTFOUND",message:"Could not find element with css selector specified in setCaptureElements: "+e[n],selector:e[n]};i=getElementCaptureRect(r,t),i&&(o=o?o.merge(i):i)}return o?o.round():{error:"HIDDEN",message:"Area with css selector : "+e+" is hidden",selector:e}}function configurePixelRatio(e){return!1===e?1:window.devicePixelRatio?window.devicePixelRatio:window.screen.deviceXDPI/window.screen.logicalXDPI||1}function findIgnoreAreas(e,t){var r=[];return util.each(e,function(e){var i=queryIgnoreAreas(e);util.each(i,function(e){return addIgnoreArea.call(r,e,t)})}),r}function addIgnoreArea(e,t){var r=e&&getElementCaptureRect(e,t);if(r){var i=r.round().scale(t.pixelRatio).serialize();this.push(i)}}function isHidden(e,t){return"none"===e.display||"hidden"===e.visibility||e.opacity<1e-4||t.width<1e-4||t.height<1e-4}function getElementCaptureRect(e,t){var r=[":before",":after"],i=lib.getComputedStyle(e),o=rect.getAbsoluteClientRect(e,t);if(isHidden(i,o))return null;var n=getExtRect(i,o,t.allowViewportOverflow);return util.each(r,function(r){i=lib.getComputedStyle(e,r),n=n.merge(getExtRect(i,o,t.allowViewportOverflow))}),n}function getExtRect(e,t,r){var i=parseBoxShadow(e.boxShadow),o=parseInt(e.outlineWidth,10);return isNaN(o)&&(o=0),adjustRect(t,i,o,r)}function parseBoxShadow(e){e=e||"";var t,r=/[-+]?\d*\.?\d+px/g,i=e.split(","),o=[];return util.each(i,function(e){(t=e.match(r))&&o.push({offsetX:parseFloat(t[0]),offsetY:parseFloat(t[1])||0,blurRadius:parseFloat(t[2])||0,spreadRadius:parseFloat(t[3])||0,inset:-1!==e.indexOf("inset")})}),o}function adjustRect(e,t,r,i){var o=calculateShadowRect(e,t,i),n=calculateOutlineRect(e,r,i);return o.merge(n)}function calculateOutlineRect(e,t,r){var i=e.top-t,o=e.left-t;return new Rect({top:r?i:Math.max(0,i),left:r?o:Math.max(0,o),bottom:e.bottom+t,right:e.right+t})}function calculateShadowRect(e,t,r){var i=calculateShadowExtent(t),o=e.left+i.left,n=e.top+i.top;return new Rect({left:r?o:Math.max(0,o),top:r?n:Math.max(0,n),width:e.width-i.left+i.right,height:e.height-i.top+i.bottom})}function calculateShadowExtent(e){var t={top:0,left:0,right:0,bottom:0};return util.each(e,function(e){if(!e.inset){var r=e.spreadRadius+e.blurRadius;t.left=Math.min(e.offsetX-r,t.left),t.right=Math.max(e.offsetX+r,t.right),t.top=Math.min(e.offsetY-r,t.top),t.bottom=Math.max(e.offsetY+r,t.bottom)}}),t}function isEditable(e){return!!e&&(/^(input|textarea)$/i.test(e.tagName)||e.isContentEditable)}function scrollToCaptureAreaInSafari(e,t,r){var i=util.getMainDocumentElem(),o=Math.round(i.scrollHeight),n=Math.round(i.clientHeight),a=o-n;r.scrollTo(e.left,Math.min(t.top,a))}var util=require("./util"),rect=require("./rect"),lib=require("./lib.compat.js"),queryIgnoreAreas=require("./ignore-areas"),Rect=rect.Rect;"undefined"==typeof window?global.__geminiCore=exports:window.__geminiCore=exports,exports.queryFirst=lib.queryFirst,exports.prepareScreenshot=function(e,t){t=t||{};try{return prepareScreenshotUnsafe(e,t)}catch(r){return{error:"JS",message:r.stack||r.message}}},exports.disableFrameAnimations=function(){try{return disableFrameAnimationsUnsafe()}catch(e){return{error:"JS",message:e.stack||e.message}}},exports.cleanupFrameAnimations=function(){window.__cleanupAnimation&&window.__cleanupAnimation()},exports.resetZoom=function(){var e=lib.queryFirst('meta[name="viewport"]');if(!e){e=document.createElement("meta"),e.name="viewport";var t=lib.queryFirst("head");t&&t.appendChild(e)}e.content="width=device-width,initial-scale=1.0,user-scalable=no"};
|
|
8
|
+
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
9
|
+
},{"./ignore-areas":2,"./lib.compat.js":4,"./rect":7,"./util":8}],4:[function(require,module,exports){
|
|
10
|
+
"use strict";var Sizzle=require("sizzle"),xpath=require("./xpath");exports.queryFirst=function(e){if(xpath.isXpathSelector(e))return xpath.queryFirst(e);var t=Sizzle(exports.trim(e)+":first");return t.length>0?t[0]:null},exports.queryAll=function(e){return xpath.isXpathSelector(e)?xpath.queryAll(e):Sizzle(e)},exports.trim=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},exports.getComputedStyle=require("./polyfills/getComputedStyle").getComputedStyle,exports.matchMedia=require("./polyfills/matchMedia").matchMedia;
|
|
11
|
+
},{"./polyfills/getComputedStyle":5,"./polyfills/matchMedia":6,"./xpath":9,"sizzle":1}],5:[function(require,module,exports){
|
|
12
|
+
function getComputedStylePixel(t,e,o){var r,i=t.document&&t.currentStyle[e].match(/([\d.]+)(%|cm|em|in|mm|pc|pt|)/)||[0,0,""],n=i[1],l=i[2];return o=o?/%|em/.test(l)&&t.parentElement?getComputedStylePixel(t.parentElement,"fontSize",null):16:o,r="fontSize"===e?o:/width/i.test(e)?t.clientWidth:t.clientHeight,"%"===l?n/100*r:"cm"===l?.3937*n*96:"em"===l?n*o:"in"===l?96*n:"mm"===l?.3937*n*96/10:"pc"===l?12*n*96/72:"pt"===l?96*n/72:n}function setShortStyleProperty(t,e){var o="border"===e?"Width":"",r=e+"Top"+o,i=e+"Right"+o,n=e+"Bottom"+o,l=e+"Left"+o;t[e]=(t[r]===t[i]&&t[r]===t[n]&&t[r]===t[l]?[t[r]]:t[r]===t[n]&&t[l]===t[i]?[t[r],t[i]]:t[l]===t[i]?[t[r],t[i],t[n]]:[t[r],t[i],t[n],t[l]]).join(" ")}function CSSStyleDeclaration(t){var e,o=t.currentStyle,r=getComputedStylePixel(t,"fontSize"),i=function(t){return"-"+t.toLowerCase()};for(e in o)if(Array.prototype.push.call(this,"styleFloat"===e?"float":e.replace(/[A-Z]/,i)),"width"===e)this[e]=t.offsetWidth+"px";else if("height"===e)this[e]=t.offsetHeight+"px";else if("styleFloat"===e)this["float"]=o[e];else if(/margin.|padding.|border.+W/.test(e)&&"auto"!==this[e])this[e]=Math.round(getComputedStylePixel(t,e,r))+"px";else if(/^outline/.test(e))try{this[e]=o[e]}catch(n){this.outlineColor=o.color,this.outlineStyle=this.outlineStyle||"none",this.outlineWidth=this.outlineWidth||"0px",this.outline=[this.outlineColor,this.outlineWidth,this.outlineStyle].join(" ")}else this[e]=o[e];setShortStyleProperty(this,"margin"),setShortStyleProperty(this,"padding"),setShortStyleProperty(this,"border"),this.fontSize=Math.round(r)+"px"}CSSStyleDeclaration.prototype={constructor:CSSStyleDeclaration,getPropertyPriority:function(){throw new Error("NotSupportedError: DOM Exception 9")},getPropertyValue:function(t){return this[t.replace(/-\w/g,function(t){return t[1].toUpperCase()})]},item:function(t){return this[t]},removeProperty:function(){throw new Error("NoModificationAllowedError: DOM Exception 7")},setProperty:function(){throw new Error("NoModificationAllowedError: DOM Exception 7")},getPropertyCSSValue:function(){throw new Error("NotSupportedError: DOM Exception 9")}},exports.CSSStyleDeclaration=CSSStyleDeclaration,exports.getComputedStyle=function(t,e){return window.getComputedStyle?window.getComputedStyle(t,e):new CSSStyleDeclaration(t)};
|
|
13
|
+
},{}],6:[function(require,module,exports){
|
|
14
|
+
(function (global){(function (){
|
|
15
|
+
function evalQuery(e){return e=(e||"true").replace(/^only\s+/,"").replace(/(device)-([\w.]+)/g,"$1.$2").replace(/([\w.]+)\s*:/g,"media.$1 ===").replace(/min-([\w.]+)\s*===/g,"$1 >=").replace(/max-([\w.]+)\s*===/g,"$1 <=").replace(/all|screen/g,"1").replace(/print/g,"0").replace(/,/g,"||").replace(/\band\b/g,"&&").replace(/dpi/g,"").replace(/(\d+)(cm|em|in|dppx|mm|pc|pt|px|rem)/g,function(e,i,t){return i*("cm"===t?37.7952:"em"===t||"rem"===t?16:"in"===t||"dppx"===t?96:"mm"===t?3.77952:"pc"===t?16:"pt"===t?96/72:1)}),new Function("media","try{ return !!(%s) }catch(e){ return false }".replace("%s",e))({width:global.innerWidth,height:global.innerHeight,orientation:global.orientation||"landscape",device:{width:global.screen.width,height:global.screen.height,orientation:global.screen.orientation||global.orientation||"landscape"}})}function MediaQueryList(){this.matches=!1,this.media="invalid"}MediaQueryList.prototype.addListener=function(e){this.addListener.listeners.push(e)},MediaQueryList.prototype.removeListener=function(e){this.addListener.listeners.splice(this.addListener.listeners.indexOf(e),1)},exports.MediaQueryList=MediaQueryList,exports.matchMedia=function(e){var i=new MediaQueryList;if(0===arguments.length)throw new TypeError("Not enough arguments to matchMedia");return i.media=String(e),i.matches=evalQuery(i.media),i.addListener.listeners=[],window.addEventListener("resize",function(){var e=[].concat(i.addListener.listeners),t=evalQuery(i.media);if(t!==i.matches){i.matches=t;for(var r=0,n=e.length;r<n;++r)e[r].call(global,i)}}),i};
|
|
16
|
+
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
17
|
+
},{}],7:[function(require,module,exports){
|
|
18
|
+
"use strict";function Rect(t){if(this.top=t.top,this.left=t.left,"width"in t&&"height"in t)this.width=t.width,this.height=t.height,this.bottom=t.bottom||this.top+this.height,this.right=t.right||this.left+this.width;else{if(!("bottom"in t&&"right"in t))throw new Error("Not enough data for the rect construction");this.bottom=t.bottom,this.right=t.right,this.width=t.right-Math.max(0,t.left),this.height=t.bottom-Math.max(0,t.top)}}function getNestedBoundingClientRect(t,e){var i=util.getOwnerIframe(t);if(null===i||util.getOwnerWindow(i)===e)return t.getBoundingClientRect();for(var o=[t.getBoundingClientRect()],r=i;r;){var h=getBoundingClientRectWithBorderOffset(r);if(o.push(h),(r=util.getOwnerIframe(r))&&util.getOwnerWindow(r)===e){h=getBoundingClientRectWithBorderOffset(r),o.push(h);break}}return mergeRectOffsets(o)}function getBoundingClientRectWithBorderOffset(t){var e=getElementDimensions(t);return mergeRectOffsets([t.getBoundingClientRect(),{top:e.borderTop,left:e.borderLeft,bottom:e.borderBottom,right:e.borderRight,x:e.borderLeft,y:e.borderTop}])}function getElementDimensions(t){var e=util.getOwnerWindow(t).getComputedStyle(t);return{borderLeft:parseFloat(e.borderLeftWidth),borderRight:parseFloat(e.borderRightWidth),borderTop:parseFloat(e.borderTopWidth),borderBottom:parseFloat(e.borderBottomWidth)}}function mergeRectOffsets(t){return t.reduce(function(t,e){if(null===t)return e;var i=t.top+e.top,o=t.left+e.left;return{top:i,left:o,width:t.width,height:t.height,bottom:i+t.height,right:o+t.width,x:o,y:i}})}var util=require("./util");Rect.isRect=function(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&("left"in t&&"top"in t&&("width"in t&&"height"in t||"right"in t&&"bottom"in t))},Rect.prototype={constructor:Rect,merge:function(t){return new Rect({left:Math.min(this.left,t.left),top:Math.min(this.top,t.top),bottom:Math.max(this.bottom,t.bottom),right:Math.max(this.right,t.right)})},translate:function(t,e){return new Rect({left:this.left+t,top:this.top+e,width:this.width,height:this.height})},pointInside:function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},rectInside:function(t){return util.every(t._keyPoints(),function(t){return this.pointInside(t[0],t[1])},this)},rectIntersects:function(t){return!(t.right<=this.left||t.bottom<=this.top||t.left>=this.right||t.top>=this.bottom)},round:function(){return new Rect({top:Math.floor(this.top),left:Math.floor(this.left),right:Math.ceil(this.right),bottom:Math.ceil(this.bottom)})},scale:function(t){var e=new Rect({top:this.top*t,left:this.left*t,right:this.right*t,bottom:this.bottom*t});return util.isInteger(t)?e:e.round()},serialize:function(){return{left:this.left,top:this.top,width:this.width,height:this.height}},overflowsTopBound:function(t){return this._overflowsBound(t,"top")},overflowsLeftBound:function(t){return this._overflowsBound(t,"left")},recalculateHeight:function(t){this.height=this.height-(t.top-Math.max(0,this.top))},recalculateWidth:function(t){this.width=this.width-(t.left-Math.max(0,this.left))},_overflowsBound:function(t,e){return Math.max(0,this[e])<t[e]},_anyPointInside:function(t){return util.some(t,function(t){return this.pointInside(t[0],t[1])},this)},_keyPoints:function(){return[[this.left,this.top],[this.left,this.bottom],[this.right,this.top],[this.right,this.bottom]]}},exports.Rect=Rect,exports.getAbsoluteClientRect=function(t,e){var i=getNestedBoundingClientRect(t,window),o=i.width%e.viewportWidth,r=i.height%e.documentHeight;return new Rect({left:i.left,top:i.top,width:o>0&&o<1?e.viewportWidth:i.width,height:r>0&&r<1?e.documentHeight:i.height}).translate(util.getScrollLeft(e.scrollElem),util.getScrollTop(e.scrollElem))};
|
|
19
|
+
},{"./util":8}],8:[function(require,module,exports){
|
|
20
|
+
"use strict";function arrayUtil(e,t){return e?contextify(e):t}function contextify(e){return function(t){var r=Array.prototype.slice.call(arguments,1);return e.apply(t,r)}}function myForEach(e,t,r){for(var n=0;n<e.length;n++)t.call(r,e[n],n,e)}function mySome(e,t,r){for(var n=0;n<e.length;n++)if(t.call(r,e[n],n,e))return!0;return!1}function myEvery(e,t,r){for(var n=0;n<e.length;n++)if(!t.call(r,e[n],n,e))return!1;return!0}function getScroll(e,t,r){var n=SCROLL_DIR_NAME[t],o=PAGE_OFFSET_NAME[r];return e&&e!==window?e[n]:"undefined"!=typeof window[o]?window[o]:document.documentElement[n]}var SCROLL_DIR_NAME={top:"scrollTop",left:"scrollLeft"},PAGE_OFFSET_NAME={x:"pageXOffset",y:"pageYOffset"};exports.each=arrayUtil(Array.prototype.forEach,myForEach),exports.some=arrayUtil(Array.prototype.some,mySome),exports.every=arrayUtil(Array.prototype.every,myEvery),exports.getScrollTop=function(e){return getScroll(e,"top","y")},exports.getScrollLeft=function(e){return getScroll(e,"left","x")},exports.isSafariMobile=function(){return navigator&&"string"==typeof navigator.vendor&&navigator.vendor.match(/apple/i)&&/(iPhone|iPad).*AppleWebKit.*Safari/i.test(navigator.userAgent)},exports.isInteger=function(e){return e%1==0},exports.forEachRoot=function(e){function t(r){e(r);for(var n=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null,!1),o=n.currentNode;null!==o;o=n.nextNode())o instanceof Element&&o.shadowRoot&&t(o.shadowRoot)}t(document.documentElement)},exports.getOwnerWindow=function(e){return e.ownerDocument?e.ownerDocument.defaultView:null},exports.getOwnerIframe=function(e){var t=exports.getOwnerWindow(e);return t?t.frameElement:null},exports.getMainDocumentElem=function(e){e||(e=document.documentElement);var t=exports.getOwnerIframe(e);if(!t)return e;var r=exports.getOwnerWindow(t);return r?exports.getMainDocumentElem(r.document.documentElement):e};
|
|
21
|
+
},{}],9:[function(require,module,exports){
|
|
22
|
+
"use strict";function isXpathSelector(e){return XPATH_SELECTORS_START.some(function(t){return 0===e.indexOf(t)})}function queryFirst(e){return document.evaluate(e,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}function queryAll(e){var t,u=document.evaluate(e,document,null,XPathResult.ANY_TYPE,null),r=[];for(t=u.iterateNext();t;)r.push(t),t=u.iterateNext();return r}var XPATH_SELECTORS_START=["/","(","../","./","*/"];module.exports={isXpathSelector:isXpathSelector,queryFirst:queryFirst,queryAll:queryAll};
|
|
23
|
+
},{}]},{},[3]);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
|
2
|
+
"use strict";var lib=require("./lib.native.js");module.exports=function(e){return lib.queryAll(e)};
|
|
3
|
+
},{"./lib.native.js":3}],2:[function(require,module,exports){
|
|
4
|
+
(function (global){(function (){
|
|
5
|
+
"use strict";function prepareScreenshotUnsafe(e,t){var r=t.allowViewportOverflow,i=t.captureElementFromTop,o=t.disableAnimation,n=window;if(t.selectorToScroll&&!(n=document.querySelector(t.selectorToScroll)))return{error:"NOTFOUND",message:'Could not find element with css selector specified in "selectorToScroll" option: '+t.selectorToScroll,selector:t.selectorToScroll};var a,l=util.getMainDocumentElem(),c=l.clientWidth,s=l.clientHeight,u=l.scrollWidth,d=l.scrollHeight,p=new Rect({left:util.getScrollLeft(n),top:util.getScrollTop(n),width:c,height:s}).round(),f=configurePixelRatio(t.usePixelRatio),m=[];if(e.forEach(function(e){Rect.isRect(e)?a=a?a.merge(new Rect(e)):new Rect(e):m.push(e)}),a=getCaptureRect(m,{initialRect:a,allowViewportOverflow:r,scrollElem:n,viewportWidth:c,documentHeight:d}),a.error)return a;if(i&&!p.rectInside(a))util.isSafariMobile()?scrollToCaptureAreaInSafari(p,a,n):n.scrollTo(a.left,a.top);else if(r&&p.rectIntersects(a))a.overflowsTopBound(p)&&a.recalculateHeight(p),a.overflowsLeftBound(p)&&a.recalculateWidth(p);else if(!i&&!p.rectIntersects(a))return{error:"OUTSIDE_OF_VIEWPORT",message:'Can not capture element, because it is outside of viewport. Try to set "captureElementFromTop=true" to scroll to it before capture.'};return o&&disableFrameAnimationsUnsafe(),{captureArea:a.scale(f).serialize(),ignoreAreas:findIgnoreAreas(t.ignoreSelectors,{scrollElem:n,pixelRatio:f,viewportWidth:c,documentHeight:d}),viewport:new Rect({left:util.getScrollLeft(n),top:util.getScrollTop(n),width:c,height:s}).scale(f).serialize(),documentHeight:Math.ceil(d*f),documentWidth:Math.ceil(u*f),canHaveCaret:isEditable(document.activeElement),pixelRatio:f}}function disableFrameAnimationsUnsafe(){var e=["","::before","::after"].map(function(e){return"*:not(#testplane-q.testplane-w.testplane-e.testplane-r.testplane-t.testplane-y)"+e}).join(", "),t=[];util.forEachRoot(function(r){var i=document.createElement("style");i.innerHTML=e+["{"," animation-delay: 0ms !important;"," animation-duration: 0ms !important;"," animation-timing-function: step-start !important;"," transition-timing-function: step-start !important;"," scroll-behavior: auto !important;","}"].join("\n"),r.appendChild(i),t.push(i)}),window.__cleanupAnimation=function(){for(var e=0;e<t.length;e++)t[e].parentNode.removeChild(t[e]);delete window.__cleanupAnimation}}function getCaptureRect(e,t){for(var r,i,o=t.initialRect,n=0;n<e.length;n++){if(!(r=lib.queryFirst(e[n])))return{error:"NOTFOUND",message:"Could not find element with css selector specified in setCaptureElements: "+e[n],selector:e[n]};i=getElementCaptureRect(r,t),i&&(o=o?o.merge(i):i)}return o?o.round():{error:"HIDDEN",message:"Area with css selector : "+e+" is hidden",selector:e}}function configurePixelRatio(e){return!1===e?1:window.devicePixelRatio?window.devicePixelRatio:window.screen.deviceXDPI/window.screen.logicalXDPI||1}function findIgnoreAreas(e,t){var r=[];return util.each(e,function(e){var i=queryIgnoreAreas(e);util.each(i,function(e){return addIgnoreArea.call(r,e,t)})}),r}function addIgnoreArea(e,t){var r=e&&getElementCaptureRect(e,t);if(r){var i=r.round().scale(t.pixelRatio).serialize();this.push(i)}}function isHidden(e,t){return"none"===e.display||"hidden"===e.visibility||e.opacity<1e-4||t.width<1e-4||t.height<1e-4}function getElementCaptureRect(e,t){var r=[":before",":after"],i=lib.getComputedStyle(e),o=rect.getAbsoluteClientRect(e,t);if(isHidden(i,o))return null;var n=getExtRect(i,o,t.allowViewportOverflow);return util.each(r,function(r){i=lib.getComputedStyle(e,r),n=n.merge(getExtRect(i,o,t.allowViewportOverflow))}),n}function getExtRect(e,t,r){var i=parseBoxShadow(e.boxShadow),o=parseInt(e.outlineWidth,10);return isNaN(o)&&(o=0),adjustRect(t,i,o,r)}function parseBoxShadow(e){e=e||"";var t,r=/[-+]?\d*\.?\d+px/g,i=e.split(","),o=[];return util.each(i,function(e){(t=e.match(r))&&o.push({offsetX:parseFloat(t[0]),offsetY:parseFloat(t[1])||0,blurRadius:parseFloat(t[2])||0,spreadRadius:parseFloat(t[3])||0,inset:-1!==e.indexOf("inset")})}),o}function adjustRect(e,t,r,i){var o=calculateShadowRect(e,t,i),n=calculateOutlineRect(e,r,i);return o.merge(n)}function calculateOutlineRect(e,t,r){var i=e.top-t,o=e.left-t;return new Rect({top:r?i:Math.max(0,i),left:r?o:Math.max(0,o),bottom:e.bottom+t,right:e.right+t})}function calculateShadowRect(e,t,r){var i=calculateShadowExtent(t),o=e.left+i.left,n=e.top+i.top;return new Rect({left:r?o:Math.max(0,o),top:r?n:Math.max(0,n),width:e.width-i.left+i.right,height:e.height-i.top+i.bottom})}function calculateShadowExtent(e){var t={top:0,left:0,right:0,bottom:0};return util.each(e,function(e){if(!e.inset){var r=e.spreadRadius+e.blurRadius;t.left=Math.min(e.offsetX-r,t.left),t.right=Math.max(e.offsetX+r,t.right),t.top=Math.min(e.offsetY-r,t.top),t.bottom=Math.max(e.offsetY+r,t.bottom)}}),t}function isEditable(e){return!!e&&(/^(input|textarea)$/i.test(e.tagName)||e.isContentEditable)}function scrollToCaptureAreaInSafari(e,t,r){var i=util.getMainDocumentElem(),o=Math.round(i.scrollHeight),n=Math.round(i.clientHeight),a=o-n;r.scrollTo(e.left,Math.min(t.top,a))}var util=require("./util"),rect=require("./rect"),lib=require("./lib.native.js"),queryIgnoreAreas=require("./ignore-areas"),Rect=rect.Rect;"undefined"==typeof window?global.__geminiCore=exports:window.__geminiCore=exports,exports.queryFirst=lib.queryFirst,exports.prepareScreenshot=function(e,t){t=t||{};try{return prepareScreenshotUnsafe(e,t)}catch(r){return{error:"JS",message:r.stack||r.message}}},exports.disableFrameAnimations=function(){try{return disableFrameAnimationsUnsafe()}catch(e){return{error:"JS",message:e.stack||e.message}}},exports.cleanupFrameAnimations=function(){window.__cleanupAnimation&&window.__cleanupAnimation()},exports.resetZoom=function(){var e=lib.queryFirst('meta[name="viewport"]');if(!e){e=document.createElement("meta"),e.name="viewport";var t=lib.queryFirst("head");t&&t.appendChild(e)}e.content="width=device-width,initial-scale=1.0,user-scalable=no"};
|
|
6
|
+
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
|
|
7
|
+
},{"./ignore-areas":1,"./lib.native.js":3,"./rect":4,"./util":5}],3:[function(require,module,exports){
|
|
8
|
+
"use strict";var xpath=require("./xpath");exports.queryFirst=function(t){return xpath.isXpathSelector(t)?xpath.queryFirst(t):document.querySelector(t)},exports.queryAll=function(t){return xpath.isXpathSelector(t)?xpath.queryAll(t):document.querySelectorAll(t)},exports.getComputedStyle=function(t,e){return getComputedStyle(t,e)},exports.matchMedia=function(t){return matchMedia(t)},exports.trim=function(t){return t.trim()};
|
|
9
|
+
},{"./xpath":6}],4:[function(require,module,exports){
|
|
10
|
+
"use strict";function Rect(t){if(this.top=t.top,this.left=t.left,"width"in t&&"height"in t)this.width=t.width,this.height=t.height,this.bottom=t.bottom||this.top+this.height,this.right=t.right||this.left+this.width;else{if(!("bottom"in t&&"right"in t))throw new Error("Not enough data for the rect construction");this.bottom=t.bottom,this.right=t.right,this.width=t.right-Math.max(0,t.left),this.height=t.bottom-Math.max(0,t.top)}}function getNestedBoundingClientRect(t,e){var i=util.getOwnerIframe(t);if(null===i||util.getOwnerWindow(i)===e)return t.getBoundingClientRect();for(var o=[t.getBoundingClientRect()],r=i;r;){var h=getBoundingClientRectWithBorderOffset(r);if(o.push(h),(r=util.getOwnerIframe(r))&&util.getOwnerWindow(r)===e){h=getBoundingClientRectWithBorderOffset(r),o.push(h);break}}return mergeRectOffsets(o)}function getBoundingClientRectWithBorderOffset(t){var e=getElementDimensions(t);return mergeRectOffsets([t.getBoundingClientRect(),{top:e.borderTop,left:e.borderLeft,bottom:e.borderBottom,right:e.borderRight,x:e.borderLeft,y:e.borderTop}])}function getElementDimensions(t){var e=util.getOwnerWindow(t).getComputedStyle(t);return{borderLeft:parseFloat(e.borderLeftWidth),borderRight:parseFloat(e.borderRightWidth),borderTop:parseFloat(e.borderTopWidth),borderBottom:parseFloat(e.borderBottomWidth)}}function mergeRectOffsets(t){return t.reduce(function(t,e){if(null===t)return e;var i=t.top+e.top,o=t.left+e.left;return{top:i,left:o,width:t.width,height:t.height,bottom:i+t.height,right:o+t.width,x:o,y:i}})}var util=require("./util");Rect.isRect=function(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&("left"in t&&"top"in t&&("width"in t&&"height"in t||"right"in t&&"bottom"in t))},Rect.prototype={constructor:Rect,merge:function(t){return new Rect({left:Math.min(this.left,t.left),top:Math.min(this.top,t.top),bottom:Math.max(this.bottom,t.bottom),right:Math.max(this.right,t.right)})},translate:function(t,e){return new Rect({left:this.left+t,top:this.top+e,width:this.width,height:this.height})},pointInside:function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},rectInside:function(t){return util.every(t._keyPoints(),function(t){return this.pointInside(t[0],t[1])},this)},rectIntersects:function(t){return!(t.right<=this.left||t.bottom<=this.top||t.left>=this.right||t.top>=this.bottom)},round:function(){return new Rect({top:Math.floor(this.top),left:Math.floor(this.left),right:Math.ceil(this.right),bottom:Math.ceil(this.bottom)})},scale:function(t){var e=new Rect({top:this.top*t,left:this.left*t,right:this.right*t,bottom:this.bottom*t});return util.isInteger(t)?e:e.round()},serialize:function(){return{left:this.left,top:this.top,width:this.width,height:this.height}},overflowsTopBound:function(t){return this._overflowsBound(t,"top")},overflowsLeftBound:function(t){return this._overflowsBound(t,"left")},recalculateHeight:function(t){this.height=this.height-(t.top-Math.max(0,this.top))},recalculateWidth:function(t){this.width=this.width-(t.left-Math.max(0,this.left))},_overflowsBound:function(t,e){return Math.max(0,this[e])<t[e]},_anyPointInside:function(t){return util.some(t,function(t){return this.pointInside(t[0],t[1])},this)},_keyPoints:function(){return[[this.left,this.top],[this.left,this.bottom],[this.right,this.top],[this.right,this.bottom]]}},exports.Rect=Rect,exports.getAbsoluteClientRect=function(t,e){var i=getNestedBoundingClientRect(t,window),o=i.width%e.viewportWidth,r=i.height%e.documentHeight;return new Rect({left:i.left,top:i.top,width:o>0&&o<1?e.viewportWidth:i.width,height:r>0&&r<1?e.documentHeight:i.height}).translate(util.getScrollLeft(e.scrollElem),util.getScrollTop(e.scrollElem))};
|
|
11
|
+
},{"./util":5}],5:[function(require,module,exports){
|
|
12
|
+
"use strict";function arrayUtil(e,t){return e?contextify(e):t}function contextify(e){return function(t){var r=Array.prototype.slice.call(arguments,1);return e.apply(t,r)}}function myForEach(e,t,r){for(var n=0;n<e.length;n++)t.call(r,e[n],n,e)}function mySome(e,t,r){for(var n=0;n<e.length;n++)if(t.call(r,e[n],n,e))return!0;return!1}function myEvery(e,t,r){for(var n=0;n<e.length;n++)if(!t.call(r,e[n],n,e))return!1;return!0}function getScroll(e,t,r){var n=SCROLL_DIR_NAME[t],o=PAGE_OFFSET_NAME[r];return e&&e!==window?e[n]:"undefined"!=typeof window[o]?window[o]:document.documentElement[n]}var SCROLL_DIR_NAME={top:"scrollTop",left:"scrollLeft"},PAGE_OFFSET_NAME={x:"pageXOffset",y:"pageYOffset"};exports.each=arrayUtil(Array.prototype.forEach,myForEach),exports.some=arrayUtil(Array.prototype.some,mySome),exports.every=arrayUtil(Array.prototype.every,myEvery),exports.getScrollTop=function(e){return getScroll(e,"top","y")},exports.getScrollLeft=function(e){return getScroll(e,"left","x")},exports.isSafariMobile=function(){return navigator&&"string"==typeof navigator.vendor&&navigator.vendor.match(/apple/i)&&/(iPhone|iPad).*AppleWebKit.*Safari/i.test(navigator.userAgent)},exports.isInteger=function(e){return e%1==0},exports.forEachRoot=function(e){function t(r){e(r);for(var n=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null,!1),o=n.currentNode;null!==o;o=n.nextNode())o instanceof Element&&o.shadowRoot&&t(o.shadowRoot)}t(document.documentElement)},exports.getOwnerWindow=function(e){return e.ownerDocument?e.ownerDocument.defaultView:null},exports.getOwnerIframe=function(e){var t=exports.getOwnerWindow(e);return t?t.frameElement:null},exports.getMainDocumentElem=function(e){e||(e=document.documentElement);var t=exports.getOwnerIframe(e);if(!t)return e;var r=exports.getOwnerWindow(t);return r?exports.getMainDocumentElem(r.document.documentElement):e};
|
|
13
|
+
},{}],6:[function(require,module,exports){
|
|
14
|
+
"use strict";function isXpathSelector(e){return XPATH_SELECTORS_START.some(function(t){return 0===e.indexOf(t)})}function queryFirst(e){return document.evaluate(e,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}function queryAll(e){var t,u=document.evaluate(e,document,null,XPathResult.ANY_TYPE,null),r=[];for(t=u.iterateNext();t;)r.push(t),t=u.iterateNext();return r}var XPATH_SELECTORS_START=["/","(","../","./","*/"];module.exports={isXpathSelector:isXpathSelector,queryFirst:queryFirst,queryAll:queryAll};
|
|
15
|
+
},{}]},{},[2]);
|
|
@@ -36,9 +36,9 @@ exports.default = (browser) => {
|
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
session.addCommand("switchToRepl", async function (ctx = {}) {
|
|
39
|
-
const
|
|
39
|
+
const runtimeCfg = runtime_config_1.default.getInstance();
|
|
40
40
|
const { onReplMode } = browser.state;
|
|
41
|
-
if (!replMode?.enabled) {
|
|
41
|
+
if (!runtimeCfg.replMode?.enabled) {
|
|
42
42
|
throw new Error('Command "switchToRepl" available only in REPL mode, which can be started using cli option: "--repl", "--repl-before-test" or "--repl-on-fail"');
|
|
43
43
|
}
|
|
44
44
|
if (onReplMode) {
|
|
@@ -51,6 +51,7 @@ exports.default = (browser) => {
|
|
|
51
51
|
process.chdir(testCwd);
|
|
52
52
|
const replServer = node_repl_1.default.start({ prompt: "> " });
|
|
53
53
|
browser.applyState({ onReplMode: true });
|
|
54
|
+
runtimeCfg.extend({ replServer });
|
|
54
55
|
applyContext(replServer, ctx);
|
|
55
56
|
handleLines(replServer);
|
|
56
57
|
return new Promise(resolve => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switchToRepl.js","sourceRoot":"","sources":["../../../../src/browser/commands/switchToRepl.ts"],"names":[],"mappings":";;;;;AAAA,0DAA6B;AAC7B,0DAA6B;AAC7B,6CAAgD;AAChD,kDAA0B;AAC1B,iFAAwD;AACxD,gEAAwC;AAGxC,MAAM,eAAe,GAAG,MAAM,CAAC;AAE/B,kBAAe,CAAC,OAAgB,EAAQ,EAAE;IACtC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAEvC,MAAM,YAAY,GAAG,CAAC,UAA2B,EAAE,MAA+B,EAAE,EAAQ,EAAE;QAC1F,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YACf,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;QAC1B,CAAC;QAED,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7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,CAAC;YAC/D,OAAO;QACX,CAAC;QAED,gBAAM,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,kFAAkF,CAAC,CAAC,CAAC;QAE7G,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,mBAAI,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,WAAW,CAAC,IAAK,CAAC,CAAC;QAC7E,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEvB,MAAM,UAAU,GAAG,mBAAI,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QAChD,OAAO,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAEzC,UAAU,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC;QAElC,YAAY,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QAC9B,WAAW,CAAC,UAAU,CAAC,CAAC;QAExB,OAAO,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE;YAC/B,OAAO,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;gBAC9B,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBACvB,OAAO,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;gBAC1C,OAAO,EAAE,CAAC;YACd,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
|
|
@@ -37,7 +37,7 @@ declare class ExistingBrowser extends Browser {
|
|
|
37
37
|
_setWindowSize(size: any): globalThis.Promise<void>;
|
|
38
38
|
_performCalibration(calibrator: any): any;
|
|
39
39
|
_calibration: any;
|
|
40
|
-
_buildClientScripts(): Promise<clientBridge.ClientBridge>;
|
|
40
|
+
_buildClientScripts(): globalThis.Promise<clientBridge.ClientBridge>;
|
|
41
41
|
_clientBridge: clientBridge.ClientBridge | undefined;
|
|
42
42
|
_runInEachIframe(cb: any): globalThis.Promise<void>;
|
|
43
43
|
_disableFrameAnimations(): globalThis.Promise<any>;
|
|
@@ -52,4 +52,3 @@ declare class ExistingBrowser extends Browser {
|
|
|
52
52
|
import Browser = require("./browser");
|
|
53
53
|
import Camera = require("./camera");
|
|
54
54
|
import clientBridge = require("./client-bridge");
|
|
55
|
-
import Promise = require("bluebird");
|