testplane 9.0.6 → 9.0.8
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/build/package.json +2 -2
- package/build/src/browser/client-bridge/index.d.ts +4 -1
- package/build/src/browser/client-bridge/index.js +7 -7
- package/build/src/browser/client-bridge/index.js.map +1 -1
- package/build/src/browser/client-scripts/browser-utils/build/bundle.compat.js +1 -1
- package/build/src/browser/client-scripts/browser-utils/build/bundle.native.js +1 -1
- package/build/src/browser/client-scripts/browser-utils/tsc-out/client-scripts/shared/lib.compat.js +14 -8
- package/build/src/browser/client-scripts/browser-utils/tsc-out/client-scripts/shared/lib.native.js +14 -8
- package/build/src/browser/client-scripts/screen-shooter/build/bundle.compat.js +8 -8
- package/build/src/browser/client-scripts/screen-shooter/build/bundle.native.js +8 -8
- package/build/src/browser/client-scripts/screen-shooter/tsc-out/client-scripts/screen-shooter/implementation.js +62 -35
- package/build/src/browser/client-scripts/screen-shooter/tsc-out/client-scripts/screen-shooter/operations.js +61 -37
- package/build/src/browser/client-scripts/screen-shooter/tsc-out/client-scripts/screen-shooter/utils/pseudo-element-rect.js +10 -7
- package/build/src/browser/client-scripts/screen-shooter/tsc-out/client-scripts/screen-shooter/utils/scroll.js +34 -7
- package/build/src/browser/client-scripts/screen-shooter/tsc-out/client-scripts/shared/lib.compat.js +14 -8
- package/build/src/browser/client-scripts/screen-shooter/tsc-out/client-scripts/shared/lib.native.js +14 -8
- package/build/src/browser/commands/assert-view/index.js +1 -1
- package/build/src/browser/commands/assert-view/index.js.map +1 -1
- package/build/src/browser/commands/switchToRepl.js +3 -2
- package/build/src/browser/commands/switchToRepl.js.map +1 -1
- package/build/src/browser/screen-shooter/elements-screen-shooter.d.ts +3 -2
- package/build/src/browser/screen-shooter/elements-screen-shooter.js +49 -44
- package/build/src/browser/screen-shooter/elements-screen-shooter.js.map +1 -1
- package/build/src/browser/screen-shooter/operations/wait-for-selectors-to-settle.d.ts +3 -1
- package/build/src/browser/screen-shooter/operations/wait-for-selectors-to-settle.js +37 -17
- package/build/src/browser/screen-shooter/operations/wait-for-selectors-to-settle.js.map +1 -1
- package/build/src/browser/screen-shooter/viewport-screen-shooter.d.ts +1 -0
- package/build/src/browser/screen-shooter/viewport-screen-shooter.js +17 -0
- package/build/src/browser/screen-shooter/viewport-screen-shooter.js.map +1 -1
- package/build/src/bundle/cjs/index.js +203 -17209
- package/package.json +2 -2
package/build/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "testplane",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.8",
|
|
4
4
|
"description": "Tests framework based on mocha and wdio",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"copy-static": "copyfiles 'src/browser/client-scripts/**/*.js' 'src/**/[!cache]*/autogenerated/**/*.json' build",
|
|
24
24
|
"build-node-bundle": "esbuild ./src/bundle/cjs/index.ts --outdir=./build/src/bundle/cjs --bundle --format=cjs --platform=node --target=ES2021",
|
|
25
25
|
"build-browser-bundle": "node ./src/browser/client-scripts/build.js ./src/browser/client-scripts/screen-shooter && node ./src/browser/client-scripts/build.js ./src/browser/client-scripts/browser-utils",
|
|
26
|
-
"build-bundles": "concurrently -c 'auto' 'npm:build-browser-bundle' 'npm:build-node-bundle --minify'",
|
|
26
|
+
"build-bundles": "concurrently -c 'auto' 'npm:build-browser-bundle' 'npm:build-node-bundle -- --minify'",
|
|
27
27
|
"resolve-ubuntu-dependencies": "ts-node ./src/browser-installer/ubuntu-packages/collect-dependencies",
|
|
28
28
|
"check-types": "tsc --project test/tsconfig.json",
|
|
29
29
|
"clean": "rimraf build/ *.tsbuildinfo",
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export type ClientBridgeArgument<T> = T extends Element ? WebdriverIO.Element : T extends object ? {
|
|
2
|
+
[K in keyof T]: ClientBridgeArgument<T[K]>;
|
|
3
|
+
} : T;
|
|
1
4
|
interface Browser {
|
|
2
5
|
execute: <R>(command: string, ...args: unknown[]) => Promise<R>;
|
|
3
6
|
}
|
|
@@ -9,7 +12,7 @@ export declare class ClientBridge<T extends Record<string, (...args: any[]) => a
|
|
|
9
12
|
needsCompatLib?: boolean;
|
|
10
13
|
}): Promise<ClientBridge<T>>;
|
|
11
14
|
constructor(browser: Browser, script: string, namespace: string);
|
|
12
|
-
call<K extends keyof T>(name: K, args: Parameters<T[K]
|
|
15
|
+
call<K extends keyof T>(name: K, args: ClientBridgeArgument<Parameters<T[K]>>): Promise<ReturnType<T[K]>>;
|
|
13
16
|
private _callCommand;
|
|
14
17
|
private _clientMethodCommand;
|
|
15
18
|
private _guardClientCall;
|
|
@@ -37,14 +37,14 @@ class ClientBridge {
|
|
|
37
37
|
this._namespace = namespace;
|
|
38
38
|
}
|
|
39
39
|
async call(name, args) {
|
|
40
|
-
return this._callCommand(this._clientMethodCommand(name, args
|
|
40
|
+
return this._callCommand(this._clientMethodCommand(name), args, true);
|
|
41
41
|
}
|
|
42
|
-
async _callCommand(command, shouldInjectScriptBeforeCall) {
|
|
42
|
+
async _callCommand(command, args, shouldInjectScriptBeforeCall) {
|
|
43
43
|
try {
|
|
44
44
|
if (debug.enabled) {
|
|
45
45
|
debug(` > calling command ${command}`);
|
|
46
46
|
}
|
|
47
|
-
const result = await this._browser.execute(command);
|
|
47
|
+
const result = await this._browser.execute(command, ...args);
|
|
48
48
|
if (debug.enabled) {
|
|
49
49
|
debug(` < result for command ${command.slice(0, 256)}: ${(0, node_util_1.inspect)(result, { depth: null })}`);
|
|
50
50
|
}
|
|
@@ -53,7 +53,7 @@ class ClientBridge {
|
|
|
53
53
|
}
|
|
54
54
|
if (shouldInjectScriptBeforeCall) {
|
|
55
55
|
await this._inject();
|
|
56
|
-
return this._callCommand(command, false);
|
|
56
|
+
return this._callCommand(command, args, false);
|
|
57
57
|
}
|
|
58
58
|
throw new error_1.ClientBridgeError("Unable to inject client script");
|
|
59
59
|
}
|
|
@@ -61,9 +61,9 @@ class ClientBridge {
|
|
|
61
61
|
throw new error_1.ClientBridgeError(`Failed to call command ${command} due to error: ${e?.message ?? "Unknown error"}`, { cause: e });
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
_clientMethodCommand(name
|
|
65
|
-
const
|
|
66
|
-
const call =
|
|
64
|
+
_clientMethodCommand(name) {
|
|
65
|
+
const namespace = `__geminiCore['${this._namespace}']`;
|
|
66
|
+
const call = `${namespace}.${String(name)}.apply(${namespace}, arguments)`;
|
|
67
67
|
return this._guardClientCall(call);
|
|
68
68
|
}
|
|
69
69
|
_guardClientCall(call) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/browser/client-bridge/index.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAoC;AACpC,gDAAwB;AACxB,4CAAoB;AACpB,kDAA8B;AAC9B,mCAA4C;AAG5C,MAAM,KAAK,GAAG,IAAA,eAAS,EAAC,yBAAyB,CAAC,CAAC;AAEnD,MAAM,YAAY,GAA2B,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/browser/client-bridge/index.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAoC;AACpC,gDAAwB;AACxB,4CAAoB;AACpB,kDAA8B;AAC9B,mCAA4C;AAG5C,MAAM,KAAK,GAAG,IAAA,eAAS,EAAC,yBAAyB,CAAC,CAAC;AAEnD,MAAM,YAAY,GAA2B,EAAE,CAAC;AAYhD,8DAA8D;AAC9D,MAAa,YAAY;IAKrB,8DAA8D;IAC9D,MAAM,CAAC,KAAK,CAAC,MAAM,CACf,OAAgB,EAChB,SAAiB,EACjB,IAAkC;QAElC,MAAM,cAAc,GAAG,IAAI,EAAE,cAAc,IAAI,KAAK,CAAC;QACrD,MAAM,cAAc,GAAG,cAAc,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,kBAAkB,CAAC;QAChF,MAAM,cAAc,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,gBAAgB,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;QAExG,IAAI,cAAc,GAAG,EAAE,CAAC;QACxB,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAChB,cAAc,GAAG,GAAI,OAAuB,EAAE,YAAY,EAAE,WAAW,IAClE,OAAuB,EAAE,YAAY,EAAE,cAC5C,IAAK,OAAuB,EAAE,SAAS,EAAE,CAAC;QAC9C,CAAC;QAED,IAAI,YAAY,CAAC,cAAc,CAAC,EAAE,CAAC;YAC/B,KAAK,CACD,0DAA0D,SAAS,OAAO,cAAc,gBAAgB,cAAc,EAAE,CAC3H,CAAC;YACF,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC,CAAC;QAC9E,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QAChF,YAAY,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC;QAEtC,KAAK,CACD,uDAAuD,SAAS,OAAO,cAAc,gBAAgB,cAAc,EAAE,CACxH,CAAC;QAEF,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;IAChD,CAAC;IAED,YAAY,OAAgB,EAAE,MAAc,EAAE,SAAiB;QAC3D,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,IAAI,CAAoB,IAAO,EAAE,IAA4C;QAC/E,OAAO,IAAI,CAAC,YAAY,CAAmB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5F,CAAC;IAEO,KAAK,CAAC,YAAY,CAAI,OAAe,EAAE,IAAe,EAAE,4BAAqC;QACjG,IAAI,CAAC;YACD,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;gBAChB,KAAK,CAAC,sBAAsB,OAAO,EAAE,CAAC,CAAC;YAC3C,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAA0C,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;YAEtG,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;gBAChB,KAAK,CAAC,yBAAyB,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,IAAA,mBAAO,EAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;YACjG,CAAC;YAED,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,yBAAyB,EAAE,CAAC;gBAC/C,OAAO,MAAW,CAAC;YACvB,CAAC;YAED,IAAI,4BAA4B,EAAE,CAAC;gBAC/B,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;gBACrB,OAAO,IAAI,CAAC,YAAY,CAAI,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;YACtD,CAAC;YAED,MAAM,IAAI,yBAAiB,CAAC,gCAAgC,CAAC,CAAC;QAClE,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,MAAM,IAAI,yBAAiB,CACvB,0BAA0B,OAAO,kBAAmB,CAAW,EAAE,OAAO,IAAI,eAAe,EAAE,EAC7F,EAAE,KAAK,EAAE,CAAC,EAAE,CACf,CAAC;QACN,CAAC;IACL,CAAC;IAEO,oBAAoB,CAAoB,IAAO;QACnD,MAAM,SAAS,GAAG,iBAAiB,IAAI,CAAC,UAAU,IAAI,CAAC;QACvD,MAAM,IAAI,GAAG,GAAG,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,SAAS,cAAc,CAAC;QAC3E,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAEO,gBAAgB,CAAC,IAAY;QACjC,OAAO,uEAAuE,IAAI,CAAC,UAAU,yBAAyB,IAAI,sCAAsC,CAAC;IACrK,CAAC;IAEO,KAAK,CAAC,OAAO;QACjB,KAAK,CAAC,sCAAsC,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;QACjG,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IAC/D,CAAC;CACJ;AA7FD,oCA6FC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
},{"./../shared/lib.compat.js":4}],3:[function(require,module,exports){
|
|
6
6
|
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,i,n){n===undefined&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&("get"in r?t.__esModule:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){n===undefined&&(n=i),e[n]=t[i]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&__createBinding(t,e,i);return __setModuleDefault(t,e),t};exports.__esModule=!0;var implementation=__importStar(require("./implementation")),globalObj="undefined"==typeof window?globalThis:window;globalObj.__geminiCore||(globalObj.__geminiCore={}),globalObj.__geminiCore[__geminiNamespace]=implementation;
|
|
7
7
|
},{"./implementation":2}],4:[function(require,module,exports){
|
|
8
|
-
"use strict";function queryFirst(e){if(xpath.isXpathSelector(e))return xpath.queryFirst(e);var t=(0,sizzle_1["default"])(trim(e)+":first");return t.length>0?t[0]:null}function queryAll(e){return xpath.isXpathSelector(e)?xpath.queryAll(e):(0,sizzle_1["default"])(e)}function trim(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function getRootNode(e){for(var t=e;t.parentNode;)t=t.parentNode;return t}var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,i){i===undefined&&(i=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,o)}:function(e,t,r,i){i===undefined&&(i=r),e[i]=t[r]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&__createBinding(t,e,r);return __setModuleDefault(t,e),t},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};exports.__esModule=!0,exports.matchMedia=exports.getComputedStyle=exports.getRootNode=exports.trim=exports.queryAll=exports.queryFirst=void 0;var sizzle_1=__importDefault(require("sizzle")),xpath=__importStar(require("./xpath"));exports.queryFirst=queryFirst,exports.queryAll=queryAll,exports.trim=trim,exports.getRootNode=getRootNode;var getComputedStyle_1=require("./polyfills/getComputedStyle");__createBinding(exports,getComputedStyle_1,"getComputedStyle");var matchMedia_1=require("./polyfills/matchMedia");__createBinding(exports,matchMedia_1,"matchMedia");
|
|
8
|
+
"use strict";function queryFirst(e){if("string"!=typeof e)return e;if(xpath.isXpathSelector(e))return xpath.queryFirst(e);var t=(0,sizzle_1["default"])(trim(e)+":first");return t.length>0?t[0]:null}function queryAll(e){return"string"!=typeof e?[e]:xpath.isXpathSelector(e)?xpath.queryAll(e):(0,sizzle_1["default"])(e)}function trim(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function getRootNode(e){for(var t=e;t.parentNode;)t=t.parentNode;return t}var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,i){i===undefined&&(i=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,o)}:function(e,t,r,i){i===undefined&&(i=r),e[i]=t[r]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&__createBinding(t,e,r);return __setModuleDefault(t,e),t},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};exports.__esModule=!0,exports.matchMedia=exports.getComputedStyle=exports.getRootNode=exports.trim=exports.queryAll=exports.queryFirst=void 0;var sizzle_1=__importDefault(require("sizzle")),xpath=__importStar(require("./xpath"));exports.queryFirst=queryFirst,exports.queryAll=queryAll,exports.trim=trim,exports.getRootNode=getRootNode;var getComputedStyle_1=require("./polyfills/getComputedStyle");__createBinding(exports,getComputedStyle_1,"getComputedStyle");var matchMedia_1=require("./polyfills/matchMedia");__createBinding(exports,matchMedia_1,"matchMedia");
|
|
9
9
|
},{"./polyfills/getComputedStyle":5,"./polyfills/matchMedia":6,"./xpath":7,"sizzle":1}],5:[function(require,module,exports){
|
|
10
10
|
"use strict";function getComputedStylePixel(t,e,o){var r=t.document&&t.currentStyle[e].match(/([\d.]+)(%|cm|em|in|mm|pc|pt|)/)||[0,0,""],i=r[1],n=r[2];o=o?/%|em/.test(n)&&t.parentElement?getComputedStylePixel(t.parentElement,"fontSize",null):16:o;var l="fontSize"===e?o:/width/i.test(e)?t.clientWidth:t.clientHeight;return"%"===n?i/100*l:"cm"===n?.3937*i*96:"em"===n?i*o:"in"===n?96*i:"mm"===n?.3937*i*96/10:"pc"===n?12*i*96/72:"pt"===n?96*i/72:i}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"}function getComputedStyle(t,e){return window.getComputedStyle?window.getComputedStyle(t,e):new CSSStyleDeclaration(t)}exports.__esModule=!0,exports.getComputedStyle=exports.CSSStyleDeclaration=void 0,exports.CSSStyleDeclaration=CSSStyleDeclaration,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.getComputedStyle=getComputedStyle;
|
|
11
11
|
},{}],6:[function(require,module,exports){
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
},{"./../shared/lib.native.js":3}],2:[function(require,module,exports){
|
|
4
4
|
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,i,n){n===undefined&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&("get"in r?t.__esModule:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){n===undefined&&(n=i),e[n]=t[i]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&__createBinding(t,e,i);return __setModuleDefault(t,e),t};exports.__esModule=!0;var implementation=__importStar(require("./implementation")),globalObj="undefined"==typeof window?globalThis:window;globalObj.__geminiCore||(globalObj.__geminiCore={}),globalObj.__geminiCore[__geminiNamespace]=implementation;
|
|
5
5
|
},{"./implementation":1}],3:[function(require,module,exports){
|
|
6
|
-
"use strict";function queryFirst(e){return xpath.isXpathSelector(e)?xpath.queryFirst(e):document.querySelector(e)}function queryAll(e){return xpath.isXpathSelector(e)?xpath.queryAll(e):Array.from(document.querySelectorAll(e))}function getComputedStyle(e,t){return getComputedStyle(e,t)}function matchMedia(e){return matchMedia(e)}function trim(e){return e.trim()}function getRootNode(e){return e.getRootNode()}var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,o){o===undefined&&(o=r);var u=Object.getOwnPropertyDescriptor(t,r);u&&("get"in u?t.__esModule:!u.writable&&!u.configurable)||(u={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,u)}:function(e,t,r,o){o===undefined&&(o=r),e[o]=t[r]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&__createBinding(t,e,r);return __setModuleDefault(t,e),t};exports.__esModule=!0,exports.getRootNode=exports.trim=exports.matchMedia=exports.getComputedStyle=exports.queryAll=exports.queryFirst=void 0;var xpath=__importStar(require("./xpath"));exports.queryFirst=queryFirst,exports.queryAll=queryAll,exports.getComputedStyle=getComputedStyle,exports.matchMedia=matchMedia,exports.trim=trim,exports.getRootNode=getRootNode;
|
|
6
|
+
"use strict";function queryFirst(e){return"string"!=typeof e?e:xpath.isXpathSelector(e)?xpath.queryFirst(e):document.querySelector(e)}function queryAll(e){return"string"!=typeof e?[e]:xpath.isXpathSelector(e)?xpath.queryAll(e):Array.from(document.querySelectorAll(e))}function getComputedStyle(e,t){return getComputedStyle(e,t)}function matchMedia(e){return matchMedia(e)}function trim(e){return e.trim()}function getRootNode(e){return e.getRootNode()}var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,o){o===undefined&&(o=r);var u=Object.getOwnPropertyDescriptor(t,r);u&&("get"in u?t.__esModule:!u.writable&&!u.configurable)||(u={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,u)}:function(e,t,r,o){o===undefined&&(o=r),e[o]=t[r]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&__createBinding(t,e,r);return __setModuleDefault(t,e),t};exports.__esModule=!0,exports.getRootNode=exports.trim=exports.matchMedia=exports.getComputedStyle=exports.queryAll=exports.queryFirst=void 0;var xpath=__importStar(require("./xpath"));exports.queryFirst=queryFirst,exports.queryAll=queryAll,exports.getComputedStyle=getComputedStyle,exports.matchMedia=matchMedia,exports.trim=trim,exports.getRootNode=getRootNode;
|
|
7
7
|
},{"./xpath":4}],4:[function(require,module,exports){
|
|
8
8
|
"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,r=document.evaluate(e,document,null,XPathResult.ANY_TYPE,null),u=[];for(t=r.iterateNext();t;)u.push(t),t=r.iterateNext();return u}exports.__esModule=!0,exports.queryAll=exports.queryFirst=exports.isXpathSelector=void 0;var XPATH_SELECTORS_START=["/","(","../","./","*/"];exports.isXpathSelector=isXpathSelector,exports.queryFirst=queryFirst,exports.queryAll=queryAll;
|
|
9
9
|
},{}]},{},[2]);
|
package/build/src/browser/client-scripts/browser-utils/tsc-out/client-scripts/shared/lib.compat.js
CHANGED
|
@@ -30,19 +30,25 @@ exports.matchMedia = exports.getComputedStyle = exports.getRootNode = exports.tr
|
|
|
30
30
|
/// <reference types="./sizzle" />
|
|
31
31
|
var sizzle_1 = __importDefault(require("sizzle"));
|
|
32
32
|
var xpath = __importStar(require("./xpath"));
|
|
33
|
-
function queryFirst(
|
|
34
|
-
if (
|
|
35
|
-
return
|
|
33
|
+
function queryFirst(target) {
|
|
34
|
+
if (typeof target !== "string") {
|
|
35
|
+
return target;
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
if (xpath.isXpathSelector(target)) {
|
|
38
|
+
return xpath.queryFirst(target);
|
|
39
|
+
}
|
|
40
|
+
var elems = (0, sizzle_1["default"])(trim(target) + ":first");
|
|
38
41
|
return elems.length > 0 ? elems[0] : null;
|
|
39
42
|
}
|
|
40
43
|
exports.queryFirst = queryFirst;
|
|
41
|
-
function queryAll(
|
|
42
|
-
if (
|
|
43
|
-
return
|
|
44
|
+
function queryAll(target) {
|
|
45
|
+
if (typeof target !== "string") {
|
|
46
|
+
return [target];
|
|
47
|
+
}
|
|
48
|
+
if (xpath.isXpathSelector(target)) {
|
|
49
|
+
return xpath.queryAll(target);
|
|
44
50
|
}
|
|
45
|
-
return (0, sizzle_1["default"])(
|
|
51
|
+
return (0, sizzle_1["default"])(target);
|
|
46
52
|
}
|
|
47
53
|
exports.queryAll = queryAll;
|
|
48
54
|
function trim(str) {
|
package/build/src/browser/client-scripts/browser-utils/tsc-out/client-scripts/shared/lib.native.js
CHANGED
|
@@ -25,18 +25,24 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
exports.__esModule = true;
|
|
26
26
|
exports.getRootNode = exports.trim = exports.matchMedia = exports.getComputedStyle = exports.queryAll = exports.queryFirst = void 0;
|
|
27
27
|
var xpath = __importStar(require("./xpath"));
|
|
28
|
-
function queryFirst(
|
|
29
|
-
if (
|
|
30
|
-
return
|
|
28
|
+
function queryFirst(target) {
|
|
29
|
+
if (typeof target !== "string") {
|
|
30
|
+
return target;
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
if (xpath.isXpathSelector(target)) {
|
|
33
|
+
return xpath.queryFirst(target);
|
|
34
|
+
}
|
|
35
|
+
return document.querySelector(target);
|
|
33
36
|
}
|
|
34
37
|
exports.queryFirst = queryFirst;
|
|
35
|
-
function queryAll(
|
|
36
|
-
if (
|
|
37
|
-
return
|
|
38
|
+
function queryAll(target) {
|
|
39
|
+
if (typeof target !== "string") {
|
|
40
|
+
return [target];
|
|
41
|
+
}
|
|
42
|
+
if (xpath.isXpathSelector(target)) {
|
|
43
|
+
return xpath.queryAll(target);
|
|
38
44
|
}
|
|
39
|
-
return Array.from(document.querySelectorAll(
|
|
45
|
+
return Array.from(document.querySelectorAll(target));
|
|
40
46
|
}
|
|
41
47
|
exports.queryAll = queryAll;
|
|
42
48
|
function getComputedStyle(element, pseudoElement) {
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
},{}],2:[function(require,module,exports){
|
|
4
4
|
"use strict";var __extends=this&&this.__extends||function(){var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,t){r.__proto__=t}||function(r,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])})(t,e)};return function(t,e){function o(){this.constructor=t}if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}();exports.__esModule=!0,exports.OutsideOfViewportError=void 0;var _isomorphic_1=require("/home/runner/work/testplane/testplane/src/browser/client-scripts/screen-shooter/tsc-out/isomorphic/index.js"),OutsideOfViewportError=function(r){function t(t){var e=r.call(this,'Can not capture element, because it is completely outside of viewport with no intersection. Try to set "captureElementFromTop=true" assertView option to scroll to it before capture.')||this;return e.name="OutsideOfViewportError",e.errorCode=_isomorphic_1.BrowserSideErrorCode.OUTSIDE_OF_VIEWPORT,e.debugLog=t,e}return __extends(t,r),t}(Error);exports.OutsideOfViewportError=OutsideOfViewportError;
|
|
5
5
|
},{"/home/runner/work/testplane/testplane/src/browser/client-scripts/screen-shooter/tsc-out/isomorphic/index.js":22}],3:[function(require,module,exports){
|
|
6
|
-
"use strict";function sampleRandom(e,o){if(e.length<=o)return e.slice();for(var r=e.slice(),t=0;t<o;t++){var i=t+Math.floor(Math.random()*(r.length-t)),s=r[t];r[t]=r[i],r[i]=s}return r.slice(0,o)}function computeShiftMode(e,o){if(0===e.length)return null;for(var r=e.slice().sort(function(e,o){return e-o}),t=0,i=0,s=0,n=0;s<r.length;s++){for(;n+1<r.length&&r[n+1]-r[s]<=o;)n++;n-s+1>i-t+1&&(t=s,i=n)}var c=r.slice(t,i+1),a=Math.floor(c.length/2);return c.length%2==1?c[a]:(c[a-1]+c[a])/2}function computeActualShift(){var e=(0,dom_1.getScreenshooterNamespaceData)().trackedElementsData;if(!e||0===e.length)return null;for(var o=[],r=0,t=e;r<t.length;r++){var i=t[r];if(i.element.isConnected){var s=i.element.getBoundingClientRect(),n=i.rect;s.width<=0||s.height<=0||Math.abs(s.width-n.width)>1||Math.abs(s.height-n.height)>1||o.push(s.top-n.top)}}if(o.length<MIN_ANCHOR_SAMPLE_SIZE)return null;var c=computeShiftMode(o,ANCHOR_SHIFT_TOLERANCE_CSS);return null===c?null:c}function safeCall(e){for(var o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];try{return e.apply(void 0,o)}catch(t){return t instanceof Error?{errorCode:_isomorphic_1.BrowserSideErrorCode.JS,message:t.stack||t.message}:{errorCode:_isomorphic_1.BrowserSideErrorCode.JS,message:"Unknown error: "+String(t)}}}function prepareElementsScreenshot(e,o){return safeCall(prepareElementsScreenshotUnsafe,e,o)}function scrollBy(e,o,r,t){return safeCall(function(){var i=(0,logger_1.createDebugLogger)({debug:t},"scrollBy"),s=(0,operations_1.computePixelRatio)(),n=r?document.querySelector(r):null,c=null!==n&&void 0!==n?n:(0,scroll_1.getCommonScrollParent)(e),a=(0,descriptions_1.getReadableElementDescriptor)(c),l=r?n?"".concat(r," (").concat(a,")"):"".concat(r," (not found, auto-detected ").concat(a,")"):"auto-detected ".concat(a),p=(0,_isomorphic_1.fromDeviceToCssNumber)(o,s);return(0,scroll_1.scrollElementBy)(c,p),{readableSelectorToScrollDescr:l,debugLog:i()}})}function scrollTo(e,o,r,t){return safeCall(function(){var i=(0,logger_1.createDebugLogger)({debug:t},"scrollTo");i("Asked to scroll to with params: selectorsToCapture:",e,"scrollOffset:",o,"selectorToScroll:",r);var s=(0,operations_1.computePixelRatio)(),n=r?document.querySelector(r):null,c=null!==n&&void 0!==n?n:(0,scroll_1.getCommonScrollParent)(e),a=(0,descriptions_1.getReadableElementDescriptor)(c),l=r?n?"".concat(r," (").concat(a,")"):"".concat(r," (not found, auto-detected ").concat(a,")"):"auto-detected ".concat(a),p=(0,_isomorphic_1.fromDeviceToCssNumber)(o,s);return(0,scroll_1.scrollElementToOffset)(c,p),{readableSelectorToScrollDescr:l,debugLog:i()}})}function getCaptureState(e,o,r,t){return safeCall(function(){var i=(0,logger_1.createDebugLogger)({debug:t},"getCaptureState"),s=(0,operations_1.computePixelRatio)(),n=r?document.querySelector(r):null,c=null!==n&&void 0!==n?n:(0,scroll_1.getCommonScrollParent)(e),a=(0,descriptions_1.getReadableElementDescriptor)(c),l=r?n?"".concat(r," (").concat(a,")"):"".concat(r," (not found, auto-detected ").concat(a,")"):"auto-detected ".concat(a),p=(0,operations_1.computeIgnoreAreas)(o),u=(0,operations_1.computeSafeArea)(e,c,i),m=(0,operations_1.computeCaptureSpecs)(e,i),_=m.map(function(e){return{full:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e.full),s),clip:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e.clip),s),visible:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e.visible),s)}}),f=(0,operations_1.computeScrollOffset)(c),d=(0,operations_1.computeViewportOffset)(),h=computeActualShift(),v=null===h?null:(0,_isomorphic_1.fromCssToDeviceNumber)(h,s);return i("scrollOffset:",f),{captureSpecs:_,ignoreAreas:p.map(function(e){return(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e),s)}),safeArea:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(u),s),scrollOffset:(0,_isomorphic_1.fromCssToDeviceNumber)(f,s),viewportOffset:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.floorCoords)(d),s),anchorShift:v,readableSelectorToScrollDescr:l,debugLog:i()}})}function prepareFullPageScreenshot(e){return void 0===e&&(e={}),safeCall(function(){(0,operations_1.prepareFullPageScrollCleanup)();var o=(0,operations_1.computePixelRatio)(e.usePixelRatio);window.scrollTo(0,0);var r=(0,operations_1.computeDocumentSize)(),t=(0,operations_1.computeViewportSize)(),i=(0,operations_1.computeViewportOffset)(),s=(0,operations_1.computeSafeArea)(["body"],document.documentElement);e.disableAnimation&&(0,operations_1.disableAnimations)();var n=!1;if(e.disableHover===_isomorphic_1.DisableHoverMode.Always)(0,operations_1.disablePointerEvents)(),n=!0;else if(e.disableHover===_isomorphic_1.DisableHoverMode.WhenScrollingNeeded){var c=r.height>t.height;c&&((0,operations_1.disablePointerEvents)(),n=!0)}var a=(0,operations_1.computeElementPositionsProbe)().map(function(e){return e?__assign(__assign({},(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e),o)),{elementDescr:e.elementDescr}):null});return{documentSize:(0,_isomorphic_1.ceilCoords)((0,_isomorphic_1.fromCssToDevice)(r,o)),viewportSize:(0,_isomorphic_1.fromCssToDevice)(t,o),viewportOffset:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.floorCoords)(i),o),safeArea:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(s),o),elementPositionsProbe:a,pixelRatio:o,pointerEventsDisabled:n}})}function scrollFullPage(e,o){return void 0===o&&(o={}),safeCall(function(){var r=(0,operations_1.computePixelRatio)(o.usePixelRatio),t=(0,_isomorphic_1.fromDeviceToCssNumber)(e,r)-1;(0,scroll_1.scrollElementBy)(document.documentElement,t);var i=(0,operations_1.computeViewportOffset)(),s=(0,operations_1.computeElementPositionsProbe)().map(function(e){return e?__assign(__assign({},(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e),r)),{elementDescr:e.elementDescr}):null});return{viewportOffset:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.floorCoords)(i),r),elementPositionsProbe:s}})}function prepareViewportScreenshot(e){return void 0===e&&(e={}),safeCall(function(){var o=(0,operations_1.computePixelRatio)(e.usePixelRatio),r=(0,operations_1.computeViewportSize)(),t=(0,operations_1.computeViewportOffset)(),i=(0,operations_1.computeDocumentSize)(),s=(0,operations_1.computeCanHaveCaret)();e.disableAnimation&&(0,operations_1.disableAnimations)();var n=!1;return e.disableHover===_isomorphic_1.DisableHoverMode.Always&&((0,operations_1.disablePointerEvents)(),n=!0),{viewportSize:(0,_isomorphic_1.fromCssToDevice)(r,o),viewportOffset:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.floorCoords)(t),o),documentSize:(0,_isomorphic_1.ceilCoords)((0,_isomorphic_1.fromCssToDevice)(i,o)),canHaveCaret:s,pixelRatio:o,pointerEventsDisabled:n}})}function disableFrameAnimations(){return safeCall(operations_1.disableAnimations)}function cleanupFrameAnimations(){window.__cleanupAnimation&&window.__cleanupAnimation()}function disablePointerEvents(){return safeCall(operations_1.disablePointerEvents)}function cleanupPointerEvents(){var e=(0,dom_1.getScreenshooterNamespaceData)();e.cleanupPointerEventsCb&&e.cleanupPointerEventsCb()}function cleanupScrolls(){(0,dom_1.getScreenshooterNamespaceData)().trackedElementsData=[],(0,operations_1.cleanupSavedScrolls)()}function captureAnchorBaseline(e){return safeCall(function(){for(var o=(0,operations_1.computeCaptureSpecs)(e),r=o.length>0?(0,_isomorphic_1.getCoveringRect)(o.map(function(e){return e.full})):null,t=[],i=0;i<e.length;i++){var s=document.querySelector(e[i]);if(s){t.push(s);for(var n=s.querySelectorAll("*"),c=0;c<n.length;c++)t.push(n[c])}}var a=t.filter(function(e){var o=e.getBoundingClientRect();if(o.width<=0||o.height<=0)return!1;if(!r)return!0;var t=(0,_isomorphic_1.fromBcrToRect)(o);return Boolean((0,_isomorphic_1.getIntersection)(r,t))}),l=sampleRandom(a,MAX_ANCHOR_TRACKED_ELEMENTS);(0,dom_1.getScreenshooterNamespaceData)().trackedElementsData=l.map(function(e){var o=e.getBoundingClientRect();return{element:e,rect:(0,_isomorphic_1.fromBcrToRect)(o)}})})}function prepareElementsScreenshotUnsafe(e,o){var r=(0,logger_1.createDebugLogger)(o,"prepareElementsScreenshot");(0,operations_1.saveScrollPositions)(e,o.selectorToScroll);var t=(0,operations_1.scrollToCaptureAreaIfNeeded)(e,o.captureElementFromTop,o.allowViewportOverflow,o.selectorToScroll,r).readableSelectorToScrollDescr;o.disableAnimation&&(0,operations_1.disableAnimations)();var i=(0,operations_1.computePixelRatio)(o.usePixelRatio),s=o.selectorToScroll?document.querySelector(o.selectorToScroll):null,n=null!==s&&void 0!==s?s:(0,scroll_1.getCommonScrollParent)(e),c=(0,operations_1.computeIgnoreAreas)(o.ignoreSelectors),a=(0,operations_1.computeCaptureSpecs)(e,r),l=(0,operations_1.computeViewportSize)(),p=(0,operations_1.computeViewportOffset)(),u=(0,operations_1.computeSafeArea)(e,n,r),m=(0,operations_1.computeScrollOffset)(n),_=(0,operations_1.computeDocumentSize)(),f=(0,operations_1.computeCanHaveCaret)(),d=!1;if(o.disableHover===_isomorphic_1.DisableHoverMode.Always)(0,operations_1.disablePointerEvents)(),d=!0;else if(o.disableHover===_isomorphic_1.DisableHoverMode.WhenScrollingNeeded&&o.compositeImage){var h=(0,_isomorphic_1.getCoveringRect)(a.map(function(e){return e.full})),v=(0,_isomorphic_1.getBottom)(h)>(0,_isomorphic_1.getBottom)(u);v&&(r("adding stylesheet with pointer-events: none on all elements (composite capture needs scrolling). captureArea:",h,"safeArea:",u),(0,operations_1.disablePointerEvents)(),d=!0)}return r("scrollOffset:",m),{ignoreAreas:c.map(function(e){return(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e),i)}),captureSpecs:a.map(function(e){return{full:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e.full),i),clip:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e.clip),i),visible:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e.visible),i)}}),viewportSize:(0,_isomorphic_1.fromCssToDevice)(l,i),viewportOffset:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.floorCoords)(p),i),safeArea:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(u),i),documentSize:(0,_isomorphic_1.ceilCoords)((0,_isomorphic_1.fromCssToDevice)(_,i)),canHaveCaret:f,pixelRatio:i,pointerEventsDisabled:d,debugLog:r(),readableSelectorToScrollDescr:t,scrollOffset:(0,_isomorphic_1.fromCssToDeviceNumber)(m,i)}}var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var o,r=1,t=arguments.length;r<t;r++){o=arguments[r];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e},__assign.apply(this,arguments)};exports.__esModule=!0,exports.captureAnchorBaseline=exports.cleanupScrolls=exports.cleanupPointerEvents=exports.disablePointerEvents=exports.cleanupFrameAnimations=exports.disableFrameAnimations=exports.prepareViewportScreenshot=exports.scrollFullPage=exports.prepareFullPageScreenshot=exports.getCaptureState=exports.scrollTo=exports.scrollBy=exports.prepareElementsScreenshot=void 0;var _isomorphic_1=require("/home/runner/work/testplane/testplane/src/browser/client-scripts/screen-shooter/tsc-out/isomorphic/index.js"),logger_1=require("../shared/logger"),operations_1=require("./operations"),descriptions_1=require("./utils/descriptions"),dom_1=require("./utils/dom"),scroll_1=require("./utils/scroll"),MIN_ANCHOR_SAMPLE_SIZE=3,MAX_ANCHOR_TRACKED_ELEMENTS=500,ANCHOR_SHIFT_TOLERANCE_CSS=1.5;exports.prepareElementsScreenshot=prepareElementsScreenshot,exports.scrollBy=scrollBy,exports.scrollTo=scrollTo,exports.getCaptureState=getCaptureState,exports.prepareFullPageScreenshot=prepareFullPageScreenshot,exports.scrollFullPage=scrollFullPage,exports.prepareViewportScreenshot=prepareViewportScreenshot,exports.disableFrameAnimations=disableFrameAnimations,exports.cleanupFrameAnimations=cleanupFrameAnimations,exports.disablePointerEvents=disablePointerEvents,exports.cleanupPointerEvents=cleanupPointerEvents,exports.cleanupScrolls=cleanupScrolls,exports.captureAnchorBaseline=captureAnchorBaseline;
|
|
7
|
-
},{"../shared/logger":16,"./operations":5,"./utils/descriptions":7,"./utils/dom":8,"./utils/scroll":11,"/home/runner/work/testplane/testplane/src/browser/client-scripts/screen-shooter/tsc-out/isomorphic/index.js":22}],4:[function(require,module,exports){
|
|
6
|
+
"use strict";function sampleRandom(e,o){if(e.length<=o)return e.slice();for(var r=e.slice(),t=0;t<o;t++){var i=t+Math.floor(Math.random()*(r.length-t)),s=r[t];r[t]=r[i],r[i]=s}return r.slice(0,o)}function computeShiftMode(e,o){if(0===e.length)return null;for(var r=e.slice().sort(function(e,o){return e-o}),t=0,i=0,s=0,n=0;s<r.length;s++){for(;n+1<r.length&&r[n+1]-r[s]<=o;)n++;n-s+1>i-t+1&&(t=s,i=n)}var a=r.slice(t,i+1),c=Math.floor(a.length/2);return a.length%2==1?a[c]:(a[c-1]+a[c])/2}function computeActualShift(){var e=(0,dom_1.getScreenshooterNamespaceData)().trackedElementsData;if(!e||0===e.length)return null;for(var o=[],r=0,t=e;r<t.length;r++){var i=t[r];if(i.element.isConnected){var s=i.element.getBoundingClientRect(),n=i.rect;s.width<=0||s.height<=0||Math.abs(s.width-n.width)>1||Math.abs(s.height-n.height)>1||o.push(s.top-n.top)}}if(o.length<MIN_ANCHOR_SAMPLE_SIZE)return null;var a=computeShiftMode(o,ANCHOR_SHIFT_TOLERANCE_CSS);return null===a?null:a}function safeCall(e){for(var o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];try{return e.apply(void 0,o)}catch(t){return t instanceof Error?{errorCode:_isomorphic_1.BrowserSideErrorCode.JS,message:t.stack||t.message}:{errorCode:_isomorphic_1.BrowserSideErrorCode.JS,message:"Unknown error: "+String(t)}}}function prepareElementsScreenshot(e,o){return safeCall(prepareElementsScreenshotUnsafe,e,o)}function scrollBy(e,o,r,t){return safeCall(function(){var i=(0,logger_1.createDebugLogger)({debug:t},"scrollBy"),s=(0,operations_1.computePixelRatio)(),n=r?lib.queryFirst(r):null,a=null!==n&&void 0!==n?n:(0,scroll_1.getCommonScrollParent)(e),c=(0,descriptions_1.getReadableElementDescriptor)(a),l=r?n?"".concat(r," (").concat(c,")"):"".concat(r," (not found, auto-detected ").concat(c,")"):"auto-detected ".concat(c),p=(0,_isomorphic_1.fromDeviceToCssNumber)(o,s);return(0,scroll_1.scrollElementBy)(a,p),{readableSelectorToScrollDescr:l,debugLog:i()}})}function scrollTo(e,o,r,t){return safeCall(function(){var i=(0,logger_1.createDebugLogger)({debug:t},"scrollTo");i("Asked to scroll to with params: targetsToCapture:",e,"scrollOffset:",o,"targetToScroll:",r);var s=(0,operations_1.computePixelRatio)(),n=r?lib.queryFirst(r):null,a=null!==n&&void 0!==n?n:(0,scroll_1.getCommonScrollParent)(e),c=(0,descriptions_1.getReadableElementDescriptor)(a),l=r?n?"".concat(r," (").concat(c,")"):"".concat(r," (not found, auto-detected ").concat(c,")"):"auto-detected ".concat(c),p=(0,_isomorphic_1.fromDeviceToCssNumber)(o,s);return(0,scroll_1.scrollElementToOffset)(a,p),{readableSelectorToScrollDescr:l,debugLog:i()}})}function getCaptureState(e,o,r,t){return safeCall(function(){var i=(0,logger_1.createDebugLogger)({debug:t},"getCaptureState"),s=(0,operations_1.computePixelRatio)(),n=r?lib.queryFirst(r):null,a=null!==n&&void 0!==n?n:(0,scroll_1.getCommonScrollParent)(e),c=(0,descriptions_1.getReadableElementDescriptor)(a),l=r?n?"".concat(r," (").concat(c,")"):"".concat(r," (not found, auto-detected ").concat(c,")"):"auto-detected ".concat(c),p=(0,operations_1.computeIgnoreAreas)(o),u=(0,operations_1.computeSafeArea)(e,a,i),_=(0,operations_1.computeCaptureSpecs)(e,i),m=_.map(function(e){return{full:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e.full),s),clip:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e.clip),s),visible:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e.visible),s)}}),f=(0,operations_1.computeScrollOffset)(a),d=(0,operations_1.computeViewportOffset)(),h=computeActualShift(),v=null===h?null:(0,_isomorphic_1.fromCssToDeviceNumber)(h,s);return i("scrollOffset:",f),{captureSpecs:m,ignoreAreas:p.map(function(e){return(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e),s)}),safeArea:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(u),s),scrollOffset:(0,_isomorphic_1.fromCssToDeviceNumber)(f,s),viewportOffset:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.floorCoords)(d),s),anchorShift:v,readableSelectorToScrollDescr:l,debugLog:i()}})}function prepareFullPageScreenshot(e){return void 0===e&&(e={}),safeCall(function(){(0,operations_1.prepareFullPageScrollCleanup)();var o=(0,operations_1.computePixelRatio)(e.usePixelRatio);window.scrollTo(0,0);var r=(0,operations_1.computeDocumentSize)(),t=(0,operations_1.computeViewportSize)(),i=(0,operations_1.computeViewportOffset)(),s=(0,operations_1.computeSafeArea)(["body"],document.documentElement);e.disableAnimation&&(0,operations_1.disableAnimations)();var n=!1;if(e.disableHover===_isomorphic_1.DisableHoverMode.Always)(0,operations_1.disablePointerEvents)(),n=!0;else if(e.disableHover===_isomorphic_1.DisableHoverMode.WhenScrollingNeeded){var a=r.height>t.height;a&&((0,operations_1.disablePointerEvents)(),n=!0)}var c=(0,operations_1.computeElementPositionsProbe)().map(function(e){return e?__assign(__assign({},(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e),o)),{elementDescr:e.elementDescr}):null});return{documentSize:(0,_isomorphic_1.ceilCoords)((0,_isomorphic_1.fromCssToDevice)(r,o)),viewportSize:(0,_isomorphic_1.fromCssToDevice)(t,o),viewportOffset:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.floorCoords)(i),o),safeArea:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(s),o),elementPositionsProbe:c,pixelRatio:o,pointerEventsDisabled:n}})}function scrollFullPage(e,o){return void 0===o&&(o={}),safeCall(function(){var r=(0,operations_1.computePixelRatio)(o.usePixelRatio),t=(0,_isomorphic_1.fromDeviceToCssNumber)(e,r)-1;(0,scroll_1.scrollElementBy)(document.documentElement,t);var i=(0,operations_1.computeViewportOffset)(),s=(0,operations_1.computeElementPositionsProbe)().map(function(e){return e?__assign(__assign({},(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e),r)),{elementDescr:e.elementDescr}):null});return{viewportOffset:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.floorCoords)(i),r),elementPositionsProbe:s}})}function prepareViewportScreenshot(e){return void 0===e&&(e={}),safeCall(function(){var o=(0,operations_1.computePixelRatio)(e.usePixelRatio),r=(0,operations_1.computeViewportSize)(),t=(0,operations_1.computeViewportOffset)(),i=(0,operations_1.computeDocumentSize)(),s=(0,operations_1.computeCanHaveCaret)();e.disableAnimation&&(0,operations_1.disableAnimations)();var n=(0,operations_1.computeIgnoreAreas)(e.ignoreSelectors),a=!1;return e.disableHover===_isomorphic_1.DisableHoverMode.Always&&((0,operations_1.disablePointerEvents)(),a=!0),{viewportSize:(0,_isomorphic_1.fromCssToDevice)(r,o),viewportOffset:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.floorCoords)(t),o),documentSize:(0,_isomorphic_1.ceilCoords)((0,_isomorphic_1.fromCssToDevice)(i,o)),ignoreAreas:n.map(function(e){return(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e),o)}),canHaveCaret:s,pixelRatio:o,pointerEventsDisabled:a}})}function disableFrameAnimations(){return safeCall(operations_1.disableAnimations)}function cleanupFrameAnimations(){window.__cleanupAnimation&&window.__cleanupAnimation()}function disablePointerEvents(){return safeCall(operations_1.disablePointerEvents)}function cleanupPointerEvents(){var e=(0,dom_1.getScreenshooterNamespaceData)();e.cleanupPointerEventsCb&&e.cleanupPointerEventsCb()}function cleanupScrolls(){(0,dom_1.getScreenshooterNamespaceData)().trackedElementsData=[],(0,operations_1.cleanupSavedScrolls)()}function captureAnchorBaseline(e){return safeCall(function(){for(var o=(0,operations_1.computeCaptureSpecs)(e),r=o.length>0?(0,_isomorphic_1.getCoveringRect)(o.map(function(e){return e.full})):null,t=[],i=0;i<e.length;i++){var s=lib.queryFirst((0,pseudo_element_rect_1.parseCaptureTarget)(e[i]).elementTarget);if(s){t.push(s);for(var n=s.querySelectorAll("*"),a=0;a<n.length;a++)t.push(n[a])}}var c=t.filter(function(e){var o=e.getBoundingClientRect();if(o.width<=0||o.height<=0)return!1;if(!r)return!0;var t=(0,_isomorphic_1.fromBcrToRect)(o);return Boolean((0,_isomorphic_1.getIntersection)(r,t))}),l=sampleRandom(c,MAX_ANCHOR_TRACKED_ELEMENTS);(0,dom_1.getScreenshooterNamespaceData)().trackedElementsData=l.map(function(e){var o=e.getBoundingClientRect();return{element:e,rect:(0,_isomorphic_1.fromBcrToRect)(o)}})})}function prepareElementsScreenshotUnsafe(e,o){var r=(0,logger_1.createDebugLogger)(o,"prepareElementsScreenshot");(0,operations_1.saveScrollPositions)(e,o.selectorToScroll);var t=(0,operations_1.scrollToCaptureAreaIfNeeded)(e,o.captureElementFromTop,o.allowViewportOverflow,o.selectorToScroll,r).readableSelectorToScrollDescr;o.disableAnimation&&(0,operations_1.disableAnimations)();var i=(0,operations_1.computePixelRatio)(o.usePixelRatio),s=o.selectorToScroll?lib.queryFirst(o.selectorToScroll):null,n=null!==s&&void 0!==s?s:(0,scroll_1.getCommonScrollParent)(e),a=(0,operations_1.computeIgnoreAreas)(o.ignoreSelectors),c=(0,operations_1.computeCaptureSpecs)(e,r),l=(0,operations_1.computeViewportSize)(),p=(0,operations_1.computeViewportOffset)(),u=(0,operations_1.computeSafeArea)(e,n,r),_=(0,operations_1.computeScrollOffset)(n),m=(0,operations_1.computeDocumentSize)(),f=(0,operations_1.computeCanHaveCaret)(),d=!1;if(o.disableHover===_isomorphic_1.DisableHoverMode.Always)(0,operations_1.disablePointerEvents)(),d=!0;else if(o.disableHover===_isomorphic_1.DisableHoverMode.WhenScrollingNeeded&&o.compositeImage){var h=(0,_isomorphic_1.getCoveringRect)(c.map(function(e){return e.full})),v=(0,_isomorphic_1.getBottom)(h)>(0,_isomorphic_1.getBottom)(u);v&&(r("adding stylesheet with pointer-events: none on all elements (composite capture needs scrolling). captureArea:",h,"safeArea:",u),(0,operations_1.disablePointerEvents)(),d=!0)}return r("scrollOffset:",_),{ignoreAreas:a.map(function(e){return(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e),i)}),captureSpecs:c.map(function(e){return{full:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e.full),i),clip:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e.clip),i),visible:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(e.visible),i)}}),viewportSize:(0,_isomorphic_1.fromCssToDevice)(l,i),viewportOffset:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.floorCoords)(p),i),safeArea:(0,_isomorphic_1.fromCssToDevice)((0,_isomorphic_1.roundCoords)(u),i),documentSize:(0,_isomorphic_1.ceilCoords)((0,_isomorphic_1.fromCssToDevice)(m,i)),canHaveCaret:f,pixelRatio:i,pointerEventsDisabled:d,debugLog:r(),readableSelectorToScrollDescr:t,scrollOffset:(0,_isomorphic_1.fromCssToDeviceNumber)(_,i)}}var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var o,r=1,t=arguments.length;r<t;r++){o=arguments[r];for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e},__assign.apply(this,arguments)},__createBinding=this&&this.__createBinding||(Object.create?function(e,o,r,t){t===undefined&&(t=r);var i=Object.getOwnPropertyDescriptor(o,r);i&&("get"in i?o.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return o[r]}}),Object.defineProperty(e,t,i)}:function(e,o,r,t){t===undefined&&(t=r),e[t]=o[r]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,o){Object.defineProperty(e,"default",{enumerable:!0,value:o})}:function(e,o){e["default"]=o}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var o={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&__createBinding(o,e,r);return __setModuleDefault(o,e),o};exports.__esModule=!0,exports.captureAnchorBaseline=exports.cleanupScrolls=exports.cleanupPointerEvents=exports.disablePointerEvents=exports.cleanupFrameAnimations=exports.disableFrameAnimations=exports.prepareViewportScreenshot=exports.scrollFullPage=exports.prepareFullPageScreenshot=exports.getCaptureState=exports.scrollTo=exports.scrollBy=exports.prepareElementsScreenshot=void 0;var _isomorphic_1=require("/home/runner/work/testplane/testplane/src/browser/client-scripts/screen-shooter/tsc-out/isomorphic/index.js"),lib=__importStar(require("./../shared/lib.compat.js")),logger_1=require("../shared/logger"),operations_1=require("./operations"),descriptions_1=require("./utils/descriptions"),dom_1=require("./utils/dom"),pseudo_element_rect_1=require("./utils/pseudo-element-rect"),scroll_1=require("./utils/scroll"),MIN_ANCHOR_SAMPLE_SIZE=3,MAX_ANCHOR_TRACKED_ELEMENTS=500,ANCHOR_SHIFT_TOLERANCE_CSS=1.5;exports.prepareElementsScreenshot=prepareElementsScreenshot,exports.scrollBy=scrollBy,exports.scrollTo=scrollTo,exports.getCaptureState=getCaptureState,exports.prepareFullPageScreenshot=prepareFullPageScreenshot,exports.scrollFullPage=scrollFullPage,exports.prepareViewportScreenshot=prepareViewportScreenshot,exports.disableFrameAnimations=disableFrameAnimations,exports.cleanupFrameAnimations=cleanupFrameAnimations,exports.disablePointerEvents=disablePointerEvents,exports.cleanupPointerEvents=cleanupPointerEvents,exports.cleanupScrolls=cleanupScrolls,exports.captureAnchorBaseline=captureAnchorBaseline;
|
|
7
|
+
},{"../shared/logger":16,"./../shared/lib.compat.js":15,"./operations":5,"./utils/descriptions":7,"./utils/dom":8,"./utils/pseudo-element-rect":10,"./utils/scroll":11,"/home/runner/work/testplane/testplane/src/browser/client-scripts/screen-shooter/tsc-out/isomorphic/index.js":22}],4:[function(require,module,exports){
|
|
8
8
|
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,i,n){n===undefined&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&("get"in r?t.__esModule:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){n===undefined&&(n=i),e[n]=t[i]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&__createBinding(t,e,i);return __setModuleDefault(t,e),t};exports.__esModule=!0;var implementation=__importStar(require("./implementation")),globalObj="undefined"==typeof window?globalThis:window;globalObj.__geminiCore||(globalObj.__geminiCore={}),globalObj.__geminiCore[__geminiNamespace]=implementation;
|
|
9
9
|
},{"./implementation":3}],5:[function(require,module,exports){
|
|
10
|
-
"use strict";function computeScrollOffset(e){return(0,scroll_1.isRootLikeElement)(e)?window.scrollY:e.scrollTop}function computeViewportSize(){var e=window.visualViewport;return e&&e.width>0&&e.height>0?{width:e.width,height:e.height}:{width:window.innerWidth,height:window.innerHeight}}function computeViewportOffset(){return{left:window.scrollX,top:window.scrollY}}function getProbeAxisCoordinates(e,t){var o=Math.max(1,Math.floor(e));if(t<=1)return[0];for(var r=o-1,n=o/(t-1),i=[],l=0;l<t;l++)i.push(Math.min(r,Math.round(l*n)));return i}function computeElementPositionsProbe(e){void 0===e&&(e=ELEMENT_POSITIONS_PROBE_GRID_SIZE);for(var t=computeViewportSize(),o=getProbeAxisCoordinates(t.width,e),r=getProbeAxisCoordinates(t.height,e),n=[],i=0;i<r.length;i++)for(var l=0;l<o.length;l++){var s=o[l],a=r[i],c=document.elementFromPoint(s,a);c?n.push(__assign(__assign({},(0,_isomorphic_1.fromBcrToRect)(c.getBoundingClientRect())),{elementDescr:(0,descriptions_1.getReadableElementDescriptor)(c)})):n.push(null)}return n}function computeCaptureSpecs(e,t){if(0===e.length)throw new Error("No selectors to compute capture area");null===t||void 0===t||t("========== <computeCaptureSpecs> =========="),null===t||void 0===t||t("selectors:",e);for(var o=performance.now(),r=[],n=0;n<e.length;n++){var i=(0,pseudo_element_rect_1.parseCaptureSelector)(e[n]),l=document.querySelector(i.elementSelector);l&&r.push({element:l,pseudoElement:i.pseudoElement})}for(var s=[],a=0,c=r;a<c.length;a++){var u=c[a],l=u.element,p=u.pseudoElement,m=function(e,o){var r,n=o?(0,element_rect_1.getPseudoElementCaptureRect)(e,o):(0,element_rect_1.getElementCaptureRect)(e,t);if(!n)return null;var i=(0,clip_rect_1.getClipRect)(e,t);return{full:n,visible:null!==(r=(0,_isomorphic_1.getIntersection)(n,i))&&void 0!==r?r:{top:n.top,left:n.left,width:0,height:0},clip:i}}(l,p);m&&s.push(m)}return null===t||void 0===t||t("captureSpecs:",s),null===t||void 0===t||t("computeCaptureSpecs time taken:",(performance.now()-o).toFixed(1)+"ms"),null===t||void 0===t||t("========== </computeCaptureSpecs> =========="),s}function computeIgnoreAreas(e){void 0===e&&(e=[]);for(var t=[],o=0;o<e.length;o++)for(var r=(0,pseudo_element_rect_1.parseCaptureSelector)(e[o]),n=document.querySelectorAll(r.elementSelector),i=0;i<n.length;i++){var l=r.pseudoElement?(0,element_rect_1.getPseudoElementCaptureRect)(n[i],r.pseudoElement):(0,element_rect_1.getElementCaptureRect)(n[i]);null!==l&&t.push(l)}return t}function computeSafeArea(e,t,o){var r,n;null===o||void 0===o||o("========== <computeSafeArea> ==========");var i=performance.now(),l=computeViewportSize(),s={left:0,top:0,width:l.width,height:l.height},a=e.map(function(e){return document.querySelector((0,pseudo_element_rect_1.parseCaptureSelector)(e).elementSelector)}).filter(function(e){return null!==e}),c=computeCaptureSpecs(e).map(function(e){return e.full});if(0===c.length)return{top:s.top,height:s.height};var u,p=null!==t&&void 0!==t?t:document.documentElement;if(p===document.documentElement)null===o||void 0===o||o("setting base safe area to viewport rect"),u=__assign({},s);else{var m=(0,element_rect_1.getBoundingClientContentRect)(p);null===o||void 0===o||o("setting base safe area to visible part of scroll container:",(0,descriptions_1.getReadableElementDescriptor)(p),"contentRect:",m),u=null!==(r=(0,_isomorphic_1.getIntersection)(m,s))&&void 0!==r?r:__assign({},s);var d=(0,element_rect_1.getVerticalRadiusInsets)(p),f=d.top,h=d.bottom;if(f>0||h>0){var _=u.height,g=Math.min(f,_),v=Math.min(h,_-g);null===o||void 0===o||o("applying radius insets to safe area:",{topInset:g,bottomInset:v}),u=__assign(__assign({},u),{top:u.top+g,height:_-g-v})}}var S=__assign({},u);if(a.every(function(e){return"fixed"===getComputedStyle(e).position||null!==(0,dom_1.findFixedPositionedParent)(e)&&null===(0,scroll_1.getScrollParent)(e)}))return null===o||void 0===o||o("all capture elements are fixed or inside non-scrollable fixed subtree, skipping interferences"),{top:S.top,height:S.height};for(var w=(0,_isomorphic_1.getCoveringRect)(c),E=a.map(function(e){return(0,z_index_1.buildZChain)(e)}),C=w.left,P=C+w.width,x=[],b=document.documentElement.querySelectorAll("*"),y=1===a.length?a[0]:null,A=0;A<b.length;A++)!function(e){var t=b[e];if(p===t||t.contains(p))return"continue";if(y&&(t===y||t.contains(y)))return"continue";var r=getComputedStyle(t),i=r.position,l=t.getBoundingClientRect();if(l.width<1||l.height<1||1===l.width&&1===l.height||"hidden"===r.visibility||"none"===r.display||parseFloat(r.opacity)<1e-4||/opacity\(\s*0(?:\.0+)?%?\s*\)/.test(r.filter))return"continue";if(l.right<=C||l.left>=P)return"continue";if(null===(0,_isomorphic_1.getIntersection)((0,_isomorphic_1.fromBcrToRect)(l),s))return"continue";var c=!1,m=!1,d=(0,element_rect_1.domRectToViewportCss)(l),f=(0,dom_1.findFixedPositionedParent)(t),h=null!==f&&(f===p||f.contains(p));if("fixed"===i||f&&!h)c=!0,m=a.some(function(e){return e.contains(t)});else if("absolute"===i){if(a.some(function(e){return e.contains(t)}))return"continue";var _=(0,dom_1.findContainingBlock)(t);p===document.documentElement||p.contains(_)||(c=!0)}else if("sticky"===i){var g=parseFloat(r.top),v=parseFloat(r.bottom),S=null!==(n=(0,scroll_1.getScrollParent)(t))&&void 0!==n?n:document.documentElement;null===o||void 0===o||o("scrollParent:",(0,descriptions_1.getReadableElementDescriptor)(S));var w=S.getBoundingClientRect();if(g+=(0,scroll_1.isRootLikeElement)(S)?0:w.top,m=a.some(function(e){return e===t||e.contains(t)})&&(S===p||(0,scroll_1.isRootLikeElement)(S)&&(0,scroll_1.isRootLikeElement)(p)),isNaN(g)){if(!isNaN(v)){var A=p===document.documentElement,T=A?s.height:u.top+u.height;d={left:l.left,top:T-v-l.height,width:l.width,height:l.height},c=!0}}else d={left:l.left,top:g,width:l.width,height:l.height},c=!0}if(!c)return"continue";var R=(0,z_index_1.buildZChain)(t);if(m||!E.every(function(e){return(0,z_index_1.isChainBehind)(R,e)})){var I=(0,element_rect_1.getExtRect)(r,d),N=I.left;if(N+I.width<=C||N>=P)return"continue";x.push({element:t,rect:I})}}(A);for(var T=u.top,R=u.height,I=S.height,N=0,D=x;N<D.length;N++){var O=D[N];null===o||void 0===o||o("processing interference:",{element:(0,descriptions_1.getReadableElementDescriptor)(O.element),rect:O.rect});var q=O.rect,M=(0,_isomorphic_1.getBottom)({top:T,height:R}),k=(0,_isomorphic_1.getBottom)(q),B=k-T,F=M-q.top,V=T,z=R;B<F?(V=Math.max(k,T),z=Math.max(0,M-V),null===o||void 0===o||o("decided to shrink top")):F&&(z=Math.min(R,q.top-T),null===o||void 0===o||o("decided to shrink bottom")),z<.3*I?null===o||void 0===o||o("decided to skip, because shrinking is too large"):(null===o||void 0===o||o("resulting safe area top:",V,"resulting safe area height:",z),T=V,R=z)}R<.3*I&&(T=S.top,R=S.height),(0,user_agent_1.isSafariMobile)()&&l.height-(T+R)<40&&(R-=40);var L={top:T,height:R};return null===o||void 0===o||o("final safe area:",L),null===o||void 0===o||o("computeSafeArea time taken:",(performance.now()-i).toFixed(1)+"ms"),null===o||void 0===o||o("========== </computeSafeArea> =========="),L}function computeDocumentSize(){var e=(0,dom_1.getMainDocumentElem)();return{width:e.scrollWidth,height:e.scrollHeight}}function computeCanHaveCaret(){var e=document.activeElement;return e instanceof HTMLElement&&(/^(input|textarea)$/i.test(e.tagName)||e.isContentEditable)}function computePixelRatio(e){return void 0===e&&(e=!0),!1===e?1:window.devicePixelRatio?window.devicePixelRatio:window.screen.deviceXDPI/window.screen.logicalXDPI||1}function scrollToCaptureAreaIfNeeded(e,t,o,r,n){var i=computeViewportSize(),l=__assign({top:0,left:0},i),s=computeCaptureSpecs(e);if(!s)return{};var a=r?document.querySelector(r):null,c=e.map(function(e){return(0,pseudo_element_rect_1.parseCaptureSelector)(e).elementSelector}),u=null!==a&&void 0!==a?a:(0,scroll_1.getCommonScrollParent)(c),p=null!==r&&void 0!==r?r:(0,descriptions_1.getReadableElementDescriptor)(u),m=(0,_isomorphic_1.getCoveringRect)(s.map(function(e){return e.full})),d=computeSafeArea(e,u,n),f=(0,_isomorphic_1.getIntersection)(m,d),h=(0,_isomorphic_1.getIntersection)(m,l),_=Math.min(m.height,d.height),g=!f||f.height<_/2,v=m.top>=d.top;if(null===n||void 0===n||n("scrollToCaptureAreaIfNeeded: intersection check",{captureArea:m,safeArea:d,viewport:l,hasViewportIntersection:Boolean(h),hasSafeAreaIntersection:Boolean(f),isIntersectionWithSafeAreaTooSmall:g,captureElementFromTop:Boolean(t)}),!t&&!h)throw null===n||void 0===n||n("scrollToCaptureAreaIfNeeded: throwing OutsideOfViewportError because captureElementFromTop is disabled and target is outside viewport"),new outside_of_viewport_1.OutsideOfViewportError;if((!t||!g)&&v)return null===n||void 0===n||n("scrollToCaptureAreaIfNeeded: skipping scroll",{reason:t?"target already has enough safe area visibility":"captureElementFromTop is disabled"}),{};if(!t&&o)return null===n||void 0===n||n("scrollToCaptureAreaIfNeeded: skipping scroll because allowViewportOverflow is true and captureElementFromTop is false"),{};null===n||void 0===n||n("scrollToCaptureAreaIfNeeded: scrolling is required",{scrollElement:p,requestedSelectorToScroll:null!==r&&void 0!==r?r:null,selectorMatched:Boolean(a)});var S=__spreadArray([],(0,scroll_1.getScrollParentsChain)(u),!0);S[S.length-1]!==u&&S.push(u);for(var w=1;w<S.length;w++){var E=computeSafeArea(e,S[w-1]),C=S[w].getBoundingClientRect().top,P=C-E.top;null===n||void 0===n||n("scrollToCaptureAreaIfNeeded: scrolling chain element",{scrollElement:(0,descriptions_1.getReadableElementDescriptor)(S[w-1]),childElement:(0,descriptions_1.getReadableElementDescriptor)(S[w]),scrollDelta:P}),(0,scroll_1.scrollElementBy)(S[w-1],P,n)}var x=(0,_isomorphic_1.getCoveringRect)(computeCaptureSpecs(e).map(function(e){return e.full}));if(!x)return{};var b=computeSafeArea(e,u),y=x.top-b.top;return null===n||void 0===n||n("scrollToCaptureAreaIfNeeded: final alignment scroll",{scrollElement:p,finalScrollDelta:y}),(0,scroll_1.scrollElementBy)(u,y,n),{readableSelectorToScrollDescr:p}}function saveElementScrollPosition(e){var t=(0,dom_1.getScreenshooterNamespaceData)();if(t.savedScrollPositions||(t.savedScrollPositions=[]),!t.savedScrollPositions.some(function(t){return t.element===e})){var o=(0,scroll_1.isRootLikeElement)(e)?{element:e,left:window.scrollX,top:window.scrollY}:{element:e,left:e.scrollLeft,top:e.scrollTop};t.savedScrollPositions.push(o)}}function saveScrollPositions(e,t){(0,dom_1.getScreenshooterNamespaceData)().savedScrollPositions=[];var o=t?document.querySelector(t):null,r=e.map(function(e){return(0,pseudo_element_rect_1.parseCaptureSelector)(e).elementSelector}),n=null!==o&&void 0!==o?o:(0,scroll_1.getCommonScrollParent)(r),i=__spreadArray([],(0,scroll_1.getScrollParentsChain)(n),!0);i[i.length-1]!==n&&i.push(n);for(var l=0,s=i;l<s.length;l++){saveElementScrollPosition(s[l])}}function prepareFullPageScrollCleanup(){(0,dom_1.getScreenshooterNamespaceData)().savedScrollPositions=[],saveElementScrollPosition(document.documentElement)}function restoreScrollPosition(e){if((0,scroll_1.isRootLikeElement)(e.element))return(0,scroll_1.performScrollFixForSafariIfNeeded)(e.top),void window.scrollTo(e.left,e.top);var t=e.element;if("function"==typeof t.scrollTo)return void t.scrollTo(e.left,e.top);"number"==typeof t.scrollLeft&&(t.scrollLeft=e.left),"number"==typeof t.scrollTop&&(t.scrollTop=e.top)}function cleanupSavedScrolls(){var e;try{var t=(0,dom_1.getScreenshooterNamespaceData)(),o=null!==(e=t.savedScrollPositions)&&void 0!==e?e:[];t.savedScrollPositions=[];for(var r=0,n=o;r<n.length;r++){var i=n[r];try{restoreScrollPosition(i)}catch(l){}}}catch(l){}}function disableAnimations(){function e(e){var r=document.createElement("style");r.innerHTML=t+["{"," animation-delay: 0ms !important;"," animation-duration: 0ms !important;"," animation-timing-function: step-start !important;"," transition-timing-function: step-start !important;"," scroll-behavior: auto !important;"," transition: none !important;","}"].join("\n"),e.appendChild(r),o.push(r)}var t=["","::before","::after"].map(function(e){return"*:not(#testplane-q.testplane-w.testplane-e.testplane-r.testplane-t.testplane-y)"+e}).join(", "),o=[];(0,dom_1.forEachRoot)(function(t){try{e(t)}catch(o){if(!o||!o.message||-1===o.message.indexOf("This document requires 'TrustedHTML' assignment"))throw o;(0,trusted_types_1.createDefaultTrustedTypesPolicy)(),e(t)}}),window.__cleanupAnimation=function(){for(var e=0;e<o.length;e++)o[e].parentNode.removeChild(o[e]);delete window.__cleanupAnimation}}function disablePointerEvents(){function e(e){var r=document.createElement("style");r.innerHTML=t+["{"," pointer-events: none !important;","}"].join("\n"),e.appendChild(r),o.push(r)}var t=["","::before","::after"].map(function(e){return"*:not(#testplane-q.testplane-w.testplane-e.testplane-r.testplane-t.testplane-y)"+e}).join(", "),o=[];(0,dom_1.forEachRoot)(function(t){try{e(t)}catch(o){if(!o||!o.message||-1===o.message.indexOf("This document requires 'TrustedHTML' assignment"))throw o;(0,trusted_types_1.createDefaultTrustedTypesPolicy)(),e(t)}}),(0,dom_1.getScreenshooterNamespaceData)().cleanupPointerEventsCb=function(){for(var e=0;e<o.length;e++)o[e].parentNode.removeChild(o[e])}}var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},__assign.apply(this,arguments)},__spreadArray=this&&this.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))};exports.__esModule=!0,exports.disablePointerEvents=exports.disableAnimations=exports.cleanupSavedScrolls=exports.prepareFullPageScrollCleanup=exports.saveScrollPositions=exports.scrollToCaptureAreaIfNeeded=exports.computePixelRatio=exports.computeCanHaveCaret=exports.computeDocumentSize=exports.computeSafeArea=exports.computeIgnoreAreas=exports.computeCaptureSpecs=exports.computeElementPositionsProbe=exports.computeViewportOffset=exports.computeViewportSize=exports.computeScrollOffset=void 0;var _isomorphic_1=require("/home/runner/work/testplane/testplane/src/browser/client-scripts/screen-shooter/tsc-out/isomorphic/index.js"),outside_of_viewport_1=require("./errors/outside-of-viewport"),descriptions_1=require("./utils/descriptions"),dom_1=require("./utils/dom"),element_rect_1=require("./utils/element-rect"),clip_rect_1=require("./utils/clip-rect"),scroll_1=require("./utils/scroll"),trusted_types_1=require("./utils/trusted-types"),z_index_1=require("./utils/z-index"),pseudo_element_rect_1=require("./utils/pseudo-element-rect"),user_agent_1=require("./utils/user-agent");exports.computeScrollOffset=computeScrollOffset,exports.computeViewportSize=computeViewportSize,exports.computeViewportOffset=computeViewportOffset;var ELEMENT_POSITIONS_PROBE_GRID_SIZE=5;exports.computeElementPositionsProbe=computeElementPositionsProbe,exports.computeCaptureSpecs=computeCaptureSpecs,exports.computeIgnoreAreas=computeIgnoreAreas,exports.computeSafeArea=computeSafeArea,exports.computeDocumentSize=computeDocumentSize,exports.computeCanHaveCaret=computeCanHaveCaret,exports.computePixelRatio=computePixelRatio,exports.scrollToCaptureAreaIfNeeded=scrollToCaptureAreaIfNeeded,exports.saveScrollPositions=saveScrollPositions,exports.prepareFullPageScrollCleanup=prepareFullPageScrollCleanup,exports.cleanupSavedScrolls=cleanupSavedScrolls,exports.disableAnimations=disableAnimations,exports.disablePointerEvents=disablePointerEvents;
|
|
11
|
-
},{"./errors/outside-of-viewport":2,"./utils/clip-rect":6,"./utils/descriptions":7,"./utils/dom":8,"./utils/element-rect":9,"./utils/pseudo-element-rect":10,"./utils/scroll":11,"./utils/trusted-types":12,"./utils/user-agent":13,"./utils/z-index":14,"/home/runner/work/testplane/testplane/src/browser/client-scripts/screen-shooter/tsc-out/isomorphic/index.js":22}],6:[function(require,module,exports){
|
|
10
|
+
"use strict";function computeScrollOffset(e){return(0,scroll_1.isRootLikeElement)(e)?window.scrollY:e.scrollTop}function computeViewportSize(){var e=window.visualViewport;return e&&e.width>0&&e.height>0?{width:e.width,height:e.height}:{width:window.innerWidth,height:window.innerHeight}}function computeViewportOffset(){return{left:window.scrollX,top:window.scrollY}}function getProbeAxisCoordinates(e,t){var o=Math.max(1,Math.floor(e));if(t<=1)return[0];for(var r=o-1,n=o/(t-1),i=[],l=0;l<t;l++)i.push(Math.min(r,Math.round(l*n)));return i}function computeElementPositionsProbe(e){void 0===e&&(e=ELEMENT_POSITIONS_PROBE_GRID_SIZE);for(var t=computeViewportSize(),o=getProbeAxisCoordinates(t.width,e),r=getProbeAxisCoordinates(t.height,e),n=[],i=0;i<r.length;i++)for(var l=0;l<o.length;l++){var s=o[l],a=r[i],c=document.elementFromPoint(s,a);c?n.push(__assign(__assign({},(0,_isomorphic_1.fromBcrToRect)(c.getBoundingClientRect())),{elementDescr:(0,descriptions_1.getReadableElementDescriptor)(c)})):n.push(null)}return n}function computeCaptureSpecs(e,t){if(0===e.length)throw new Error("No targets to compute capture area");null===t||void 0===t||t("========== <computeCaptureSpecs> =========="),null===t||void 0===t||t("targets:",e);for(var o=performance.now(),r=[],n=0;n<e.length;n++){var i=(0,pseudo_element_rect_1.parseCaptureTarget)(e[n]),l=lib.queryFirst(i.elementTarget);l&&r.push({element:l,pseudoElement:i.pseudoElement})}for(var s=[],a=0,c=r;a<c.length;a++){var u=c[a],l=u.element,p=u.pseudoElement,d=function(e,o){var r,n=o?(0,element_rect_1.getPseudoElementCaptureRect)(e,o):(0,element_rect_1.getElementCaptureRect)(e,t);if(!n)return null;var i=(0,clip_rect_1.getClipRect)(e,t);return{full:n,visible:null!==(r=(0,_isomorphic_1.getIntersection)(n,i))&&void 0!==r?r:{top:n.top,left:n.left,width:0,height:0},clip:i}}(l,p);d&&s.push(d)}return null===t||void 0===t||t("captureSpecs:",s),null===t||void 0===t||t("computeCaptureSpecs time taken:",(performance.now()-o).toFixed(1)+"ms"),null===t||void 0===t||t("========== </computeCaptureSpecs> =========="),s}function computeIgnoreAreas(e){void 0===e&&(e=[]);for(var t=[],o=0;o<e.length;o++)for(var r=(0,pseudo_element_rect_1.parseCaptureTarget)(e[o]),n=lib.queryAll(r.elementTarget),i=0;i<n.length;i++){var l=r.pseudoElement?(0,element_rect_1.getPseudoElementCaptureRect)(n[i],r.pseudoElement):(0,element_rect_1.getElementCaptureRect)(n[i]);null!==l&&t.push(l)}return t}function computeSafeArea(e,t,o){var r,n;null===o||void 0===o||o("========== <computeSafeArea> ==========");var i=performance.now(),l=computeViewportSize(),s={left:0,top:0,width:l.width,height:l.height},a=e.map(function(e){return lib.queryFirst((0,pseudo_element_rect_1.parseCaptureTarget)(e).elementTarget)}).filter(function(e){return null!==e}),c=computeCaptureSpecs(e).map(function(e){return e.full});if(0===c.length)return{top:s.top,height:s.height};var u,p=null!==t&&void 0!==t?t:document.documentElement;if(p===document.documentElement)null===o||void 0===o||o("setting base safe area to viewport rect"),u=__assign({},s);else{var d=(0,element_rect_1.getBoundingClientContentRect)(p);null===o||void 0===o||o("setting base safe area to visible part of scroll container:",(0,descriptions_1.getReadableElementDescriptor)(p),"contentRect:",d),u=null!==(r=(0,_isomorphic_1.getIntersection)(d,s))&&void 0!==r?r:__assign({},s);var m=(0,element_rect_1.getVerticalRadiusInsets)(p),f=m.top,h=m.bottom;if(f>0||h>0){var _=u.height,g=Math.min(f,_),v=Math.min(h,_-g);null===o||void 0===o||o("applying radius insets to safe area:",{topInset:g,bottomInset:v}),u=__assign(__assign({},u),{top:u.top+g,height:_-g-v})}}var S=__assign({},u);if(a.every(function(e){return"fixed"===getComputedStyle(e).position||null!==(0,dom_1.findFixedPositionedParent)(e)&&null===(0,scroll_1.getScrollParent)(e)}))return null===o||void 0===o||o("all capture elements are fixed or inside non-scrollable fixed subtree, skipping interferences"),{top:S.top,height:S.height};for(var w=(0,_isomorphic_1.getCoveringRect)(c),E=a.map(function(e){return(0,z_index_1.buildZChain)(e)}),b=w.left,C=b+w.width,P=[],x=document.documentElement.querySelectorAll("*"),y=1===a.length?a[0]:null,T=0;T<x.length;T++)!function(e){var t=x[e];if(p===t||t.contains(p))return"continue";if(y&&(t===y||t.contains(y)))return"continue";var r=getComputedStyle(t),i=r.position,l=t.getBoundingClientRect();if(l.width<1||l.height<1||1===l.width&&1===l.height||"hidden"===r.visibility||"none"===r.display||parseFloat(r.opacity)<1e-4||/opacity\(\s*0(?:\.0+)?%?\s*\)/.test(r.filter))return"continue";if(l.right<=b||l.left>=C)return"continue";if(null===(0,_isomorphic_1.getIntersection)((0,_isomorphic_1.fromBcrToRect)(l),s))return"continue";var c=!1,d=!1,m=(0,element_rect_1.domRectToViewportCss)(l),f=(0,dom_1.findFixedPositionedParent)(t),h=null!==f&&(f===p||f.contains(p));if("fixed"===i||f&&!h)c=!0,d=a.some(function(e){return e.contains(t)});else if("absolute"===i){if(a.some(function(e){return e.contains(t)}))return"continue";var _=(0,dom_1.findContainingBlock)(t);p===document.documentElement||p.contains(_)||(c=!0)}else if("sticky"===i){var g=parseFloat(r.top),v=parseFloat(r.bottom),S=null!==(n=(0,scroll_1.getScrollParent)(t))&&void 0!==n?n:document.documentElement;null===o||void 0===o||o("scrollParent:",(0,descriptions_1.getReadableElementDescriptor)(S));var w=S.getBoundingClientRect();if(g+=(0,scroll_1.isRootLikeElement)(S)?0:w.top,d=a.some(function(e){return e===t||e.contains(t)})&&(S===p||(0,scroll_1.isRootLikeElement)(S)&&(0,scroll_1.isRootLikeElement)(p)),isNaN(g)){if(!isNaN(v)){var T=p===document.documentElement,A=T?s.height:u.top+u.height;m={left:l.left,top:A-v-l.height,width:l.width,height:l.height},c=!0}}else m={left:l.left,top:g,width:l.width,height:l.height},c=!0}if(!c)return"continue";var R=(0,z_index_1.buildZChain)(t);if(d||!E.every(function(e){return(0,z_index_1.isChainBehind)(R,e)})){var I=(0,element_rect_1.getExtRect)(r,m),O=I.left;if(O+I.width<=b||O>=C)return"continue";P.push({element:t,rect:I})}}(T);for(var A=u.top,R=u.height,I=S.height,O=0,D=P;O<D.length;O++){var N=D[O];null===o||void 0===o||o("processing interference:",{element:(0,descriptions_1.getReadableElementDescriptor)(N.element),rect:N.rect});var M=N.rect,q=(0,_isomorphic_1.getBottom)({top:A,height:R}),B=(0,_isomorphic_1.getBottom)(M),F=B-A,k=q-M.top,V=A,z=R;F<k?(V=Math.max(B,A),z=Math.max(0,q-V),null===o||void 0===o||o("decided to shrink top")):k&&(z=Math.min(R,M.top-A),null===o||void 0===o||o("decided to shrink bottom")),z<.3*I?null===o||void 0===o||o("decided to skip, because shrinking is too large"):(null===o||void 0===o||o("resulting safe area top:",V,"resulting safe area height:",z),A=V,R=z)}R<.3*I&&(A=S.top,R=S.height),(0,user_agent_1.isSafariMobile)()&&l.height-(A+R)<40&&(R-=40);var L={top:A,height:R};return null===o||void 0===o||o("final safe area:",L),null===o||void 0===o||o("computeSafeArea time taken:",(performance.now()-i).toFixed(1)+"ms"),null===o||void 0===o||o("========== </computeSafeArea> =========="),L}function computeDocumentSize(){var e=(0,dom_1.getMainDocumentElem)();return{width:e.scrollWidth,height:e.scrollHeight}}function computeCanHaveCaret(){var e=document.activeElement;return e instanceof HTMLElement&&(/^(input|textarea)$/i.test(e.tagName)||e.isContentEditable)}function computePixelRatio(e){return void 0===e&&(e=!0),!1===e?1:window.devicePixelRatio?window.devicePixelRatio:window.screen.deviceXDPI/window.screen.logicalXDPI||1}function scrollToCaptureAreaIfNeeded(e,t,o,r,n){var i=computeViewportSize(),l=__assign({top:0,left:0},i),s=computeCaptureSpecs(e);if(!s)return{};var a=r?lib.queryFirst(r):null,c=null!==a&&void 0!==a?a:(0,scroll_1.getCommonScrollParent)(e),u="string"==typeof r?r:(0,descriptions_1.getReadableElementDescriptor)(null!==a&&void 0!==a?a:c),p=(0,_isomorphic_1.getCoveringRect)(s.map(function(e){return e.full})),d=computeSafeArea(e,c,n),m=(0,_isomorphic_1.getIntersection)(p,d),f=(0,_isomorphic_1.getIntersection)(p,l),h=Math.min(p.height,d.height),_=!m||m.height<h/2,g=p.top>=d.top;if(null===n||void 0===n||n("scrollToCaptureAreaIfNeeded: intersection check",{captureArea:p,safeArea:d,viewport:l,hasViewportIntersection:Boolean(f),hasSafeAreaIntersection:Boolean(m),isIntersectionWithSafeAreaTooSmall:_,captureElementFromTop:Boolean(t)}),!t&&!f)throw null===n||void 0===n||n("scrollToCaptureAreaIfNeeded: throwing OutsideOfViewportError because captureElementFromTop is disabled and target is outside viewport"),new outside_of_viewport_1.OutsideOfViewportError;if((!t||!_)&&g)return null===n||void 0===n||n("scrollToCaptureAreaIfNeeded: skipping scroll",{reason:t?"target already has enough safe area visibility":"captureElementFromTop is disabled"}),{};if(!t&&o)return null===n||void 0===n||n("scrollToCaptureAreaIfNeeded: skipping scroll because allowViewportOverflow is true and captureElementFromTop is false"),{};null===n||void 0===n||n("scrollToCaptureAreaIfNeeded: scrolling is required",{scrollElement:u,requestedTargetToScroll:null!==r&&void 0!==r?r:null,targetResolved:Boolean(a)});var v=__spreadArray([],(0,scroll_1.getScrollParentsChain)(c),!0);v[v.length-1]!==c&&v.push(c);for(var S=1;S<v.length;S++){var w=computeSafeArea(e,v[S-1]),E=v[S].getBoundingClientRect().top,b=E-w.top;null===n||void 0===n||n("scrollToCaptureAreaIfNeeded: scrolling chain element",{scrollElement:(0,descriptions_1.getReadableElementDescriptor)(v[S-1]),childElement:(0,descriptions_1.getReadableElementDescriptor)(v[S]),scrollDelta:b}),(0,scroll_1.scrollElementBy)(v[S-1],b,n)}var C=(0,_isomorphic_1.getCoveringRect)(computeCaptureSpecs(e).map(function(e){return e.full}));if(!C)return{};var P=computeSafeArea(e,c),x=C.top-P.top;return null===n||void 0===n||n("scrollToCaptureAreaIfNeeded: final alignment scroll",{scrollElement:u,finalScrollDelta:x}),(0,scroll_1.scrollElementBy)(c,x,n),{readableSelectorToScrollDescr:u}}function saveElementScrollPosition(e){var t=(0,dom_1.getScreenshooterNamespaceData)();if(t.savedScrollPositions||(t.savedScrollPositions=[]),!t.savedScrollPositions.some(function(t){return t.element===e})){var o=(0,scroll_1.isRootLikeElement)(e)?{element:e,left:window.scrollX,top:window.scrollY}:{element:e,left:e.scrollLeft,top:e.scrollTop};t.savedScrollPositions.push(o)}}function saveScrollPositions(e,t){(0,dom_1.getScreenshooterNamespaceData)().savedScrollPositions=[];var o=t?lib.queryFirst(t):null,r=null!==o&&void 0!==o?o:(0,scroll_1.getCommonScrollParent)(e),n=__spreadArray([],(0,scroll_1.getScrollParentsChain)(r),!0);n[n.length-1]!==r&&n.push(r);for(var i=0,l=n;i<l.length;i++){saveElementScrollPosition(l[i])}}function prepareFullPageScrollCleanup(){(0,dom_1.getScreenshooterNamespaceData)().savedScrollPositions=[],saveElementScrollPosition(document.documentElement)}function restoreScrollPosition(e){if((0,scroll_1.isRootLikeElement)(e.element))return(0,scroll_1.performScrollFixForSafariIfNeeded)(e.top),void window.scrollTo(e.left,e.top);var t=e.element;if("function"==typeof t.scrollTo)return void t.scrollTo(e.left,e.top);"number"==typeof t.scrollLeft&&(t.scrollLeft=e.left),"number"==typeof t.scrollTop&&(t.scrollTop=e.top)}function cleanupSavedScrolls(){var e;try{var t=(0,dom_1.getScreenshooterNamespaceData)(),o=null!==(e=t.savedScrollPositions)&&void 0!==e?e:[];t.savedScrollPositions=[];for(var r=0,n=o;r<n.length;r++){var i=n[r];try{restoreScrollPosition(i)}catch(l){}}}catch(l){}}function disableAnimations(){function e(e){var r=document.createElement("style");r.innerHTML=t+["{"," animation-delay: 0ms !important;"," animation-duration: 0ms !important;"," animation-timing-function: step-start !important;"," transition-timing-function: step-start !important;"," scroll-behavior: auto !important;"," transition: none !important;","}"].join("\n"),e.appendChild(r),o.push(r)}var t=["","::before","::after"].map(function(e){return"*:not(#testplane-q.testplane-w.testplane-e.testplane-r.testplane-t.testplane-y)"+e}).join(", "),o=[];(0,dom_1.forEachRoot)(function(t){try{e(t)}catch(o){if(!o||!o.message||-1===o.message.indexOf("This document requires 'TrustedHTML' assignment"))throw o;(0,trusted_types_1.createDefaultTrustedTypesPolicy)(),e(t)}}),window.__cleanupAnimation=function(){for(var e=0;e<o.length;e++)o[e].parentNode.removeChild(o[e]);delete window.__cleanupAnimation}}function disablePointerEvents(){function e(e){var r=document.createElement("style");r.innerHTML=t+["{"," pointer-events: none !important;","}"].join("\n"),e.appendChild(r),o.push(r)}var t=["","::before","::after"].map(function(e){return"*:not(#testplane-q.testplane-w.testplane-e.testplane-r.testplane-t.testplane-y)"+e}).join(", "),o=[];(0,dom_1.forEachRoot)(function(t){try{e(t)}catch(o){if(!o||!o.message||-1===o.message.indexOf("This document requires 'TrustedHTML' assignment"))throw o;(0,trusted_types_1.createDefaultTrustedTypesPolicy)(),e(t)}}),(0,dom_1.getScreenshooterNamespaceData)().cleanupPointerEventsCb=function(){for(var e=0;e<o.length;e++)o[e].parentNode.removeChild(o[e])}}var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,o=1,r=arguments.length;o<r;o++){t=arguments[o];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},__assign.apply(this,arguments)},__createBinding=this&&this.__createBinding||(Object.create?function(e,t,o,r){r===undefined&&(r=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&("get"in n?t.__esModule:!n.writable&&!n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,n)}:function(e,t,o,r){r===undefined&&(r=o),e[r]=t[o]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&__createBinding(t,e,o);return __setModuleDefault(t,e),t},__spreadArray=this&&this.__spreadArray||function(e,t,o){if(o||2===arguments.length)for(var r,n=0,i=t.length;n<i;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))};exports.__esModule=!0,exports.disablePointerEvents=exports.disableAnimations=exports.cleanupSavedScrolls=exports.prepareFullPageScrollCleanup=exports.saveScrollPositions=exports.scrollToCaptureAreaIfNeeded=exports.computePixelRatio=exports.computeCanHaveCaret=exports.computeDocumentSize=exports.computeSafeArea=exports.computeIgnoreAreas=exports.computeCaptureSpecs=exports.computeElementPositionsProbe=exports.computeViewportOffset=exports.computeViewportSize=exports.computeScrollOffset=void 0;var _isomorphic_1=require("/home/runner/work/testplane/testplane/src/browser/client-scripts/screen-shooter/tsc-out/isomorphic/index.js"),lib=__importStar(require("./../shared/lib.compat.js")),outside_of_viewport_1=require("./errors/outside-of-viewport"),descriptions_1=require("./utils/descriptions"),dom_1=require("./utils/dom"),element_rect_1=require("./utils/element-rect"),clip_rect_1=require("./utils/clip-rect"),scroll_1=require("./utils/scroll"),trusted_types_1=require("./utils/trusted-types"),z_index_1=require("./utils/z-index"),pseudo_element_rect_1=require("./utils/pseudo-element-rect"),user_agent_1=require("./utils/user-agent");exports.computeScrollOffset=computeScrollOffset,exports.computeViewportSize=computeViewportSize,exports.computeViewportOffset=computeViewportOffset;var ELEMENT_POSITIONS_PROBE_GRID_SIZE=5;exports.computeElementPositionsProbe=computeElementPositionsProbe,exports.computeCaptureSpecs=computeCaptureSpecs,exports.computeIgnoreAreas=computeIgnoreAreas,exports.computeSafeArea=computeSafeArea,exports.computeDocumentSize=computeDocumentSize,exports.computeCanHaveCaret=computeCanHaveCaret,exports.computePixelRatio=computePixelRatio,exports.scrollToCaptureAreaIfNeeded=scrollToCaptureAreaIfNeeded,exports.saveScrollPositions=saveScrollPositions,exports.prepareFullPageScrollCleanup=prepareFullPageScrollCleanup,exports.cleanupSavedScrolls=cleanupSavedScrolls,exports.disableAnimations=disableAnimations,exports.disablePointerEvents=disablePointerEvents;
|
|
11
|
+
},{"./../shared/lib.compat.js":15,"./errors/outside-of-viewport":2,"./utils/clip-rect":6,"./utils/descriptions":7,"./utils/dom":8,"./utils/element-rect":9,"./utils/pseudo-element-rect":10,"./utils/scroll":11,"./utils/trusted-types":12,"./utils/user-agent":13,"./utils/z-index":14,"/home/runner/work/testplane/testplane/src/browser/client-scripts/screen-shooter/tsc-out/isomorphic/index.js":22}],6:[function(require,module,exports){
|
|
12
12
|
"use strict";function getViewportRect(){return{top:0,left:0,width:window.innerWidth,height:window.innerHeight}}function hasOverflowClipping(e){return"visible"!==e.overflow||"visible"!==e.overflowX||"visible"!==e.overflowY}function getAbsoluteContainingBlocks(e){for(var t=[],n=e;n&&!(0,scroll_1.isRootLikeElement)(n);){if("absolute"===getComputedStyle(n).position){var i=(0,dom_1.findContainingBlock)(n);t.push({absoluteAncestor:n,containingBlock:i})}n=n.parentElement}return t}function getFixedAncestors(e){for(var t=[],n=e;n&&!(0,scroll_1.isRootLikeElement)(n);)"fixed"===getComputedStyle(n).position&&t.push(n),n=n.parentElement;return t}function escapesOverflowClippingViaAbsoluteContainingBlocks(e,t){return t.some(function(t){var n=t.absoluteAncestor,i=t.containingBlock;return!(n===e||!e.contains(n))&&(i!==e&&i.contains(e))})}function escapesOverflowClippingViaFixedAncestors(e,t){return t.some(function(t){return t!==e&&e.contains(t)})}function getClipRect(e,t){for(var n=getViewportRect(),i=getAbsoluteContainingBlocks(e),o=getFixedAncestors(e),r=n,s=e.parentElement;s&&!(0,scroll_1.isRootLikeElement)(s);){if(hasOverflowClipping(getComputedStyle(s))){if(escapesOverflowClippingViaAbsoluteContainingBlocks(s,i)||escapesOverflowClippingViaFixedAncestors(s,o)){s=s.parentElement;continue}var l=(0,element_rect_1.getBoundingClientContentRect)(s);null===t||void 0===t||t("intersecting with:",(0,descriptions_1.getReadableElementDescriptor)(s),"contentBox:",l);var c=(0,_isomorphic_1.getIntersection)(r,l);if(!c)return null===t||void 0===t||t("no intersection found for:",(0,descriptions_1.getReadableElementDescriptor)(s)),{top:r.top,left:r.left,width:0,height:0};r=c}s=s.parentElement}return r}exports.__esModule=!0,exports.getClipRect=void 0;var _isomorphic_1=require("/home/runner/work/testplane/testplane/src/browser/client-scripts/screen-shooter/tsc-out/isomorphic/index.js"),element_rect_1=require("./element-rect"),scroll_1=require("./scroll"),dom_1=require("./dom"),descriptions_1=require("./descriptions");exports.getClipRect=getClipRect;
|
|
13
13
|
},{"./descriptions":7,"./dom":8,"./element-rect":9,"./scroll":11,"/home/runner/work/testplane/testplane/src/browser/client-scripts/screen-shooter/tsc-out/isomorphic/index.js":22}],7:[function(require,module,exports){
|
|
14
14
|
"use strict";function getReadableElementDescriptor(e){if(e===document.documentElement)return"html";var t=e.tagName.toLowerCase();if(e.id)return"".concat(t,"#").concat(e.id);if(e.classList.length){for(var r=[],s=0;s<e.classList.length;s++)r.push(e.classList[s]);return t+"."+r.join(".")}return t}exports.__esModule=!0,exports.getReadableElementDescriptor=void 0,exports.getReadableElementDescriptor=getReadableElementDescriptor;
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
},{"./../../shared/lib.compat.js":15}],9:[function(require,module,exports){
|
|
18
18
|
"use strict";function domRectToViewportCss(t){return{top:t.top,left:t.left,width:t.width,height:t.height}}function getElementBorderWidths(t){var e=(0,dom_1.getOwnerWindow)(t)||window,o=e.getComputedStyle(t);return{top:parseFloat(o.borderTopWidth),left:parseFloat(o.borderLeftWidth)}}function getIframeContentOrigin(t){var e=getElementBorderWidths(t),o=t.getBoundingClientRect();return{top:o.top+e.top,left:o.left+e.left,width:o.width,height:o.height}}function getNestedBoundingClientRect(t,e){var o=(0,dom_1.getOwnerIframe)(t);if(null===o||(0,dom_1.getOwnerWindow)(o)===window)return null===e||void 0===e||e("getNestedBoundingClientRect ownerIframe is null or window, returning bounding rect untouched"),domRectToViewportCss(t.getBoundingClientRect());null===e||void 0===e||e("getNestedBoundingClientRect ownerIframe is not null or window, returning bounding rect with iframe origin");for(var r=domRectToViewportCss(t.getBoundingClientRect()),n=r.top,i=r.left,d=o;d;){var a=getIframeContentOrigin(d);if(n+=a.top,i+=a.left,(d=(0,dom_1.getOwnerIframe)(d))&&(0,dom_1.getOwnerWindow)(d)===window){var s=getIframeContentOrigin(d);n+=s.top,i+=s.left;break}}return{top:n,left:i,width:r.width,height:r.height}}function parseBoxShadow(t){for(var e=/[-+]?\d*\.?\d+px/g,o=[],r=0,n=(t||"").split(",");r<n.length;r++){var i=n[r],d=i.match(e);d&&o.push({offsetX:parseFloat(d[0]),offsetY:parseFloat(d[1])||0,blurRadius:parseFloat(d[2])||0,spreadRadius:parseFloat(d[3])||0,inset:-1!==i.indexOf("inset")})}return o}function calculateShadowExtent(t){for(var e={top:0,left:0,right:0,bottom:0},o=0,r=t;o<r.length;o++){var n=r[o];if(!n.inset){var i=n.spreadRadius+n.blurRadius;e.left=Math.min(n.offsetX-i,e.left),e.right=Math.max(n.offsetX+i,e.right),e.top=Math.min(n.offsetY-i,e.top),e.bottom=Math.max(n.offsetY+i,e.bottom)}}return e}function calculateShadowRect(t,e){var o=calculateShadowExtent(e);return{left:t.left+o.left,top:t.top+o.top,width:t.width-o.left+o.right,height:t.height-o.top+o.bottom}}function calculateOutlineRect(t,e){return{top:t.top-e,left:t.left-e,width:t.width+2*e,height:t.height+2*e}}function getExtRect(t,e){var o=parseBoxShadow(t.boxShadow),r=parseInt(t.outlineWidth,10),n=isNaN(r)||"none"===t.outlineStyle?0:r;return(0,_isomorphic_1.getCoveringRect)([calculateShadowRect(e,o),calculateOutlineRect(e,n)])}function isHidden(t,e){return"none"===t.display||"hidden"===t.visibility||parseFloat(t.opacity)<1e-4||e.width<1e-4||e.height<1e-4}function getBoundingClientContentRect(t){var e=getComputedStyle(t),o=t.getBoundingClientRect(),r=parseFloat(e.borderLeftWidth)||0,n=parseFloat(e.borderTopWidth)||0,i=parseFloat(e.borderRightWidth)||0,d=parseFloat(e.borderBottomWidth)||0;return{left:o.left+r,top:o.top+n,width:o.width-r-i,height:o.height-n-d}}function getElementCaptureRect(t,e){var o=getComputedStyle(t),r=getNestedBoundingClientRect(t,e);if(null===e||void 0===e||e("getElementCaptureRect clientRect:",r),isHidden(o,r))return null;for(var n=getExtRect(o,r),i=0,d=pseudo_element_rect_1.PSEUDO_ELEMENTS;i<d.length;i++){var a=d[i],s=getComputedStyle(t,a);n=(0,_isomorphic_1.getCoveringRect)([n,getExtRect(s,r)])}return n}function getPseudoElementCaptureRect(t,e){var o=getComputedStyle(t),r=getNestedBoundingClientRect(t);if(isHidden(o,r))return null;var n=(0,pseudo_element_rect_1.getPseudoElementRect)(t,e,r);return n?getExtRect(getComputedStyle(t,e),n):null}function parseBorderRadius(t){var e=t.trim().split(/\s+/),o=e[0],r=e[1],n=parseFloat(null!==r&&void 0!==r?r:o);return isNaN(n)?0:n}function getVerticalRadiusInsets(t){var e=getComputedStyle(t);return{top:Math.max(parseBorderRadius(e.borderTopLeftRadius),parseBorderRadius(e.borderTopRightRadius)),bottom:Math.max(parseBorderRadius(e.borderBottomLeftRadius),parseBorderRadius(e.borderBottomRightRadius))}}exports.__esModule=!0,exports.getVerticalRadiusInsets=exports.getPseudoElementCaptureRect=exports.getElementCaptureRect=exports.getBoundingClientContentRect=exports.getExtRect=exports.domRectToViewportCss=void 0;var _isomorphic_1=require("/home/runner/work/testplane/testplane/src/browser/client-scripts/screen-shooter/tsc-out/isomorphic/index.js"),dom_1=require("./dom"),pseudo_element_rect_1=require("./pseudo-element-rect");exports.domRectToViewportCss=domRectToViewportCss,exports.getExtRect=getExtRect,exports.getBoundingClientContentRect=getBoundingClientContentRect,exports.getElementCaptureRect=getElementCaptureRect,exports.getPseudoElementCaptureRect=getPseudoElementCaptureRect,exports.getVerticalRadiusInsets=getVerticalRadiusInsets;
|
|
19
19
|
},{"./dom":8,"./pseudo-element-rect":10,"/home/runner/work/testplane/testplane/src/browser/client-scripts/screen-shooter/tsc-out/isomorphic/index.js":22}],10:[function(require,module,exports){
|
|
20
|
-
"use strict";function
|
|
20
|
+
"use strict";function parseCaptureTarget(t){if("string"!=typeof t)return{elementTarget:t,pseudoElement:null};var e=t.match(PSEUDO_SELECTOR_REGEXP);if(!e)return{elementTarget:t,pseudoElement:null};var r=e[1].trim();return r?{elementTarget:r,pseudoElement:e[2].toLowerCase()}:{elementTarget:t,pseudoElement:null}}function getElementBorderWidths(t){var e=getComputedStyle(t);return{top:parseFloat(e.borderTopWidth),left:parseFloat(e.borderLeftWidth)}}function parseLengthOrZero(t){var e=parseFloat(t);return isNaN(e)?0:e}function getElementContentBottom(t){var e=document.createRange();try{e.selectNodeContents(t);for(var r=e.getClientRects(),n=-Infinity,a=0;a<r.length;a++){var o=r[a];o.width<1e-4&&o.height<1e-4||(n=Math.max(n,o.bottom))}return n!==-Infinity?n:null}catch(i){return null}finally{"function"==typeof e.detach&&e.detach()}}function getContainingBlockPaddingEdge(t){for(var e=t.parentElement;e;){if("static"!==getComputedStyle(e).position){var r=e.getBoundingClientRect(),n=getElementBorderWidths(e);return{top:r.top+n.top,left:r.left+n.left}}e=e.parentElement}return null}function parseTransformMatrix(t){if(!t||"none"===t)return null;var e=t.match(/matrix\(([^)]+)\)/);if(e){var r=e[1].split(",").map(function(t){return parseFloat(t.trim())});return{a:r[0],b:r[1],c:r[2],d:r[3],tx:r[4],ty:r[5]}}var n=t.match(/matrix3d\(([^)]+)\)/);if(n){var r=n[1].split(",").map(function(t){return parseFloat(t.trim())});return{a:r[0],b:r[1],c:r[4],d:r[5],tx:r[12],ty:r[13]}}return null}function resolveTransformOrigin(t,e,r){function n(t,e){return"%"===t.slice(-1)?parseFloat(t)/100*e:parseFloat(t)||0}var a=t.split(/\s+/);return{x:n(a[0],e),y:n(a[1]||a[0],r)}}function applyTransformToRect(t,e){var r=parseTransformMatrix(e.transform);if(!r)return t;for(var n=resolveTransformOrigin(e.transformOrigin,t.width,t.height),a=t.left+n.x,o=t.top+n.y,i=[[t.left,t.top],[t.left+t.width,t.top],[t.left,t.top+t.height],[t.left+t.width,t.top+t.height]],l=Infinity,p=Infinity,s=-Infinity,f=-Infinity,u=0,d=i;u<d.length;u++){var g=d[u],h=g[0],m=g[1],c=h-a,v=m-o,E=r.a*c+r.c*v+r.tx+a,y=r.b*c+r.d*v+r.ty+o;l=Math.min(l,E),s=Math.max(s,E),p=Math.min(p,y),f=Math.max(f,y)}return{left:l,top:p,width:s-l,height:f-p}}function computeBaseRect(t,e,r,n){var a=parseFloat(r.width),o=parseFloat(r.height);if(isNaN(a)||isNaN(o)||a<1e-4||o<1e-4)return null;var i=r.position;if("fixed"===i){var l=parseFloat(r.top),p=parseFloat(r.left);return{top:isNaN(l)?0:l,left:isNaN(p)?0:p,width:a,height:o}}if("absolute"===i){var s=getComputedStyle(t),f=void 0,u=void 0;if("static"!==s.position){var d=getElementBorderWidths(t);f=n.top+d.top,u=n.left+d.left}else{var g=getContainingBlockPaddingEdge(t);f=g?g.top:0,u=g?g.left:0}var h=parseFloat(r.top),p=parseFloat(r.left);return{top:f+(isNaN(h)?0:h),left:u+(isNaN(p)?0:p),width:a,height:o}}var m=getComputedStyle(t),c=parseLengthOrZero(m.borderTopWidth),v=parseLengthOrZero(m.borderLeftWidth),E=parseLengthOrZero(m.paddingTop),y=parseLengthOrZero(m.paddingLeft),T=parseLengthOrZero(r.marginTop),x=parseLengthOrZero(r.marginLeft),C="relative"===i?parseLengthOrZero(r.top):0,L="relative"===i?parseLengthOrZero(r.left):0,O=n.top+c+E;if("::after"===e&&"block"===r.display){var N=getElementContentBottom(t);null!==N&&(O=Math.max(O,N))}return{top:O+T+C,left:n.left+v+y+x+L,width:a,height:o}}function getPseudoElementRect(t,e,r){var n=getComputedStyle(t,e);if("none"===n.content||"none"===n.display||"hidden"===n.visibility)return null;var a=computeBaseRect(t,e,n,r);return a?applyTransformToRect(a,n):null}exports.__esModule=!0,exports.getPseudoElementRect=exports.parseCaptureTarget=exports.PSEUDO_ELEMENTS=void 0,exports.PSEUDO_ELEMENTS=["::before","::after"];var PSEUDO_SELECTOR_REGEXP=/(.*?)(::before|::after)\s*$/i;exports.parseCaptureTarget=parseCaptureTarget,exports.getPseudoElementRect=getPseudoElementRect;
|
|
21
21
|
},{}],11:[function(require,module,exports){
|
|
22
|
-
"use strict";function
|
|
23
|
-
},{"./dom":8,"./user-agent":13}],12:[function(require,module,exports){
|
|
22
|
+
"use strict";function getElementTarget(e){if("string"!=typeof e)return e;var t=e.match(PSEUDO_SELECTOR_REGEXP);return t?t[1].trim()||e:e}function isScrollable(e){var t=getComputedStyle(e).overflowY;return e.scrollHeight>e.clientHeight&&("auto"===t||"scroll"===t||"overlay"===t)}function getScrollParent(e){if("fixed"===getComputedStyle(e).position)return null;for(var t=(0,dom_1.getParentElement)(e);t&&t!==document.documentElement;){if(isScrollable(t))return t;if("fixed"===getComputedStyle(t).position)return null;t=(0,dom_1.getParentElement)(t)}return t===document.documentElement?document.documentElement:null}function getScrollParentsChain(e){for(var t=[],r=getScrollParent(e);r&&r!==document.documentElement;)t.unshift(r),r=getScrollParent(r);return t.unshift(document.documentElement),t}function getCommonScrollParent(e){var t=e.map(function(e){return lib.queryFirst(getElementTarget(e))}).filter(function(e){return null!==e});if(0===t.length)return document.documentElement;if(1===t.length){var r=getScrollParent(t[0]);return r?normalizeRootLikeElement(r):document.documentElement}for(var o=t.map(function(e){return getScrollParentsChain(e)}),l=Math.min.apply(Math,o.map(function(e){return e.length})),n=document.documentElement,i=0;i<l;i++){if("break"===function(e){if(!o.every(function(t){return t[e]===o[0][e]}))return"break";n=o[0][e]}(i))break}return normalizeRootLikeElement(n)}function getElementScrollTop(e){return isRootLikeElement(e)?window.scrollY:e.scrollTop}function getPageScrollElement(){var e;return null!==(e=document.scrollingElement)&&void 0!==e?e:document.documentElement}function isRootLikeElement(e){var t=getPageScrollElement();return e===document.documentElement||e===document.body||e===t}function normalizeRootLikeElement(e){return isRootLikeElement(e)?document.documentElement:e}function performScrollFixForSafariIfNeeded(e){(0,user_agent_1.isSafariMobile)()&&window.scrollY<100&&e<100&&window.scrollTo(window.scrollX,100)}function scrollElementBy(e,t,r){var o=t,l=isRootLikeElement(e),n=l?getPageScrollElement():e,i=l?window.scrollY:e.scrollTop,c=n.scrollHeight-n.clientHeight,a=Math.max(0,Math.min(i+o,c));l?(null===r||void 0===r||r("scrollElementBy: scrolling window.scrollTo("+window.scrollX+", "+a+")"),performScrollFixForSafariIfNeeded(a),window.scrollTo(window.scrollX,a)):(null===r||void 0===r||r("scrollElementBy: scrolling element.scrollTo("+e.scrollLeft+", "+a+")"),e.scrollTo(e.scrollLeft,a));for(var u=performance.now(),m=0;performance.now()-u<SCROLL_APPLY_MAX_WAIT_MS&&m<SCROLL_APPLY_MAX_ITERATIONS;){if(getElementScrollTop(e)!==i)return;m++}}function scrollElementToOffset(e,t){var r=isRootLikeElement(e),o=r?getPageScrollElement():e,l=r?window.scrollY:e.scrollTop,n=o.scrollHeight-o.clientHeight,i=Math.max(0,Math.min(t,n));r?(performScrollFixForSafariIfNeeded(i),window.scrollTo(window.scrollX,i)):e.scrollTo(e.scrollLeft,i);for(var c=performance.now(),a=0;performance.now()-c<SCROLL_APPLY_MAX_WAIT_MS&&a<SCROLL_APPLY_MAX_ITERATIONS;){if(getElementScrollTop(e)===l)return;a++}}var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,o){o===undefined&&(o=r);var l=Object.getOwnPropertyDescriptor(t,r);l&&("get"in l?t.__esModule:!l.writable&&!l.configurable)||(l={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,l)}:function(e,t,r,o){o===undefined&&(o=r),e[o]=t[r]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&__createBinding(t,e,r);return __setModuleDefault(t,e),t};exports.__esModule=!0,exports.scrollElementToOffset=exports.scrollElementBy=exports.performScrollFixForSafariIfNeeded=exports.isRootLikeElement=exports.getCommonScrollParent=exports.getScrollParentsChain=exports.getScrollParent=void 0;var lib=__importStar(require("./../../shared/lib.compat.js")),dom_1=require("./dom"),user_agent_1=require("./user-agent"),PSEUDO_SELECTOR_REGEXP=/(.*?)(::before|::after)\s*$/i;exports.getScrollParent=getScrollParent,exports.getScrollParentsChain=getScrollParentsChain,exports.getCommonScrollParent=getCommonScrollParent;var SCROLL_APPLY_MAX_WAIT_MS=50,SCROLL_APPLY_MAX_ITERATIONS=1e4;exports.isRootLikeElement=isRootLikeElement,exports.performScrollFixForSafariIfNeeded=performScrollFixForSafariIfNeeded,exports.scrollElementBy=scrollElementBy,exports.scrollElementToOffset=scrollElementToOffset;
|
|
23
|
+
},{"./../../shared/lib.compat.js":15,"./dom":8,"./user-agent":13}],12:[function(require,module,exports){
|
|
24
24
|
"use strict";function createDefaultTrustedTypesPolicy(){var e=window;e.trustedTypes&&e.trustedTypes.createPolicy&&e.trustedTypes.createPolicy("default",{createHTML:function(e){return e}})}exports.__esModule=!0,exports.createDefaultTrustedTypesPolicy=void 0,exports.createDefaultTrustedTypesPolicy=createDefaultTrustedTypesPolicy;
|
|
25
25
|
},{}],13:[function(require,module,exports){
|
|
26
26
|
"use strict";function isSafariMobile(){return Boolean(navigator&&"string"==typeof navigator.vendor&&navigator.vendor.match(/apple/i)&&/(iPhone|iPad).*AppleWebKit.*Safari/i.test(navigator.userAgent))}exports.__esModule=!0,exports.isSafariMobile=void 0,exports.isSafariMobile=isSafariMobile;
|
|
27
27
|
},{}],14:[function(require,module,exports){
|
|
28
28
|
"use strict";function getCssProp(e,t){return e[t]}function hasCssProp(e,t,n){void 0===n&&(n="none");var r=getCssProp(e,t);return r!==undefined&&r!==n}function isFlexContainer(e){return"flex"===e.display||"inline-flex"===e.display}function isGridContainer(e){return-1!==(e.display||"").indexOf("grid")}function hasContainStackingContext(e){return"layout"===e||"paint"===e||"strict"===e||"content"===e||-1!==e.indexOf("paint")||-1!==e.indexOf("layout")}function createsStackingContext(e){var t=getComputedStyle(e),n=t.position,r=t.zIndex;if("fixed"===n||"sticky"===n)return!0;if("size"===getCssProp(t,"containerType")||"inline-size"===getCssProp(t,"containerType"))return!0;if("auto"!==r&&"static"!==n)return!0;if(parseFloat(t.opacity)<1)return!0;if("none"!==t.transform)return!0;if(hasCssProp(t,"scale"))return!0;if(hasCssProp(t,"rotate"))return!0;if(hasCssProp(t,"translate"))return!0;if("normal"!==t.mixBlendMode)return!0;if("none"!==t.filter)return!0;if(hasCssProp(t,"backdropFilter"))return!0;if(hasCssProp(t,"webkitBackdropFilter"))return!0;if("none"!==t.perspective)return!0;if(hasCssProp(t,"clipPath"))return!0;var i=getCssProp(t,"mask")||getCssProp(t,"webkitMask");if(i!==undefined&&"none"!==i)return!0;var o=getCssProp(t,"maskImage")||getCssProp(t,"webkitMaskImage");if(o!==undefined&&"none"!==o)return!0;var a=getCssProp(t,"maskBorder")||getCssProp(t,"webkitMaskBorder");if(a!==undefined&&"none"!==a)return!0;if("isolate"===t.isolation)return!0;var s=t.willChange||"";if(-1!==s.indexOf("transform")||-1!==s.indexOf("opacity"))return!0;if("touch"===getCssProp(t,"webkitOverflowScrolling"))return!0;if("auto"!==r){var u=(0,dom_1.getParentElement)(e);if(u){var f=getComputedStyle(u);if(isFlexContainer(f)||isGridContainer(f))return!0}}return!!hasContainStackingContext(t.contain||"")}function getClosestStackingContext(e){return e&&e!==document.documentElement?e instanceof ShadowRoot?getClosestStackingContext(e.host):e instanceof Element?createsStackingContext(e)?e:getClosestStackingContext((0,dom_1.getParentElement)(e)):getClosestStackingContext(e.parentNode):document.documentElement}function getStackingContextRoot(e){return getClosestStackingContext((0,dom_1.getParentElement)(e))}function getEffectiveZIndex(e){for(var t=e;t&&t!==document.documentElement;){var n=getComputedStyle(t);if("auto"!==n.zIndex){var r=parseFloat(n.zIndex);return isNaN(r)?0:r}if(createsStackingContext(t))return 0;t=t.parentElement}return 0}function buildZChain(e){for(var t=[],n=e;n&&n!==document.documentElement;){var r=getStackingContextRoot(n),i=getEffectiveZIndex(n);if(t.unshift({ctx:r,z:i}),r===document.documentElement)break;n=r}return t}function isChainBehind(e,t){for(var n=t.length-1;n>=0;n--)for(var r=e.length-1;r>=0;r--)if(e[r].ctx===t[n].ctx)return e[r].z<t[n].z;return!1}exports.__esModule=!0,exports.isChainBehind=exports.buildZChain=void 0;var dom_1=require("./dom");exports.buildZChain=buildZChain,exports.isChainBehind=isChainBehind;
|
|
29
29
|
},{"./dom":8}],15:[function(require,module,exports){
|
|
30
|
-
"use strict";function queryFirst(e){if(xpath.isXpathSelector(e))return xpath.queryFirst(e);var t=(0,sizzle_1["default"])(trim(e)+":first");return t.length>0?t[0]:null}function queryAll(e){return xpath.isXpathSelector(e)?xpath.queryAll(e):(0,sizzle_1["default"])(e)}function trim(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function getRootNode(e){for(var t=e;t.parentNode;)t=t.parentNode;return t}var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,i){i===undefined&&(i=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,o)}:function(e,t,r,i){i===undefined&&(i=r),e[i]=t[r]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&__createBinding(t,e,r);return __setModuleDefault(t,e),t},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};exports.__esModule=!0,exports.matchMedia=exports.getComputedStyle=exports.getRootNode=exports.trim=exports.queryAll=exports.queryFirst=void 0;var sizzle_1=__importDefault(require("sizzle")),xpath=__importStar(require("./xpath"));exports.queryFirst=queryFirst,exports.queryAll=queryAll,exports.trim=trim,exports.getRootNode=getRootNode;var getComputedStyle_1=require("./polyfills/getComputedStyle");__createBinding(exports,getComputedStyle_1,"getComputedStyle");var matchMedia_1=require("./polyfills/matchMedia");__createBinding(exports,matchMedia_1,"matchMedia");
|
|
30
|
+
"use strict";function queryFirst(e){if("string"!=typeof e)return e;if(xpath.isXpathSelector(e))return xpath.queryFirst(e);var t=(0,sizzle_1["default"])(trim(e)+":first");return t.length>0?t[0]:null}function queryAll(e){return"string"!=typeof e?[e]:xpath.isXpathSelector(e)?xpath.queryAll(e):(0,sizzle_1["default"])(e)}function trim(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function getRootNode(e){for(var t=e;t.parentNode;)t=t.parentNode;return t}var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,i){i===undefined&&(i=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,o)}:function(e,t,r,i){i===undefined&&(i=r),e[i]=t[r]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e["default"]=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&__createBinding(t,e,r);return __setModuleDefault(t,e),t},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{"default":e}};exports.__esModule=!0,exports.matchMedia=exports.getComputedStyle=exports.getRootNode=exports.trim=exports.queryAll=exports.queryFirst=void 0;var sizzle_1=__importDefault(require("sizzle")),xpath=__importStar(require("./xpath"));exports.queryFirst=queryFirst,exports.queryAll=queryAll,exports.trim=trim,exports.getRootNode=getRootNode;var getComputedStyle_1=require("./polyfills/getComputedStyle");__createBinding(exports,getComputedStyle_1,"getComputedStyle");var matchMedia_1=require("./polyfills/matchMedia");__createBinding(exports,matchMedia_1,"matchMedia");
|
|
31
31
|
},{"./polyfills/getComputedStyle":17,"./polyfills/matchMedia":18,"./xpath":19,"sizzle":1}],16:[function(require,module,exports){
|
|
32
32
|
"use strict";function makeCreateDebugLogger(){return function(e,r){if(e.debug&&-1!==e.debug.indexOf(r)){var t=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];for(var o=0,g=e;o<g.length;o++){var n=g[o];if("object"==typeof n&&null!==n)try{t.log+=JSON.stringify(n,null,2)+"\n"}catch(u){t.log+="failed to log message due to an error: "+u}else t.log+=String(n)+"\n"}return t.log};return t.enabled=!0,t.log="",t}var o=function(){return""};return o.enabled=!1,o}}exports.__esModule=!0,exports.createDebugLogger=void 0,exports.createDebugLogger=makeCreateDebugLogger();
|
|
33
33
|
},{}],17:[function(require,module,exports){
|