@applitools/eyes-browser 1.6.11 → 1.6.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -15713,6 +15713,23 @@ var require_Configuration = __commonJS({
15713
15713
  this.hostOSInfo = hostOSInfo;
15714
15714
  return this;
15715
15715
  }
15716
+ /** @internal */
15717
+ get httpVersion() {
15718
+ return this._config.httpVersion;
15719
+ }
15720
+ /** @internal */
15721
+ set httpVersion(httpVersion) {
15722
+ this._config.httpVersion = httpVersion;
15723
+ }
15724
+ /** @internal */
15725
+ getHttpVersion() {
15726
+ return this.httpVersion;
15727
+ }
15728
+ /** @internal */
15729
+ setHttpVersion(httpVersion) {
15730
+ this.httpVersion = httpVersion;
15731
+ return this;
15732
+ }
15716
15733
  get ignoreBaseline() {
15717
15734
  return this._config.ignoreBaseline;
15718
15735
  }
@@ -16202,6 +16219,7 @@ var require_Configuration = __commonJS({
16202
16219
  agentId: this.agentId,
16203
16220
  proxy: this.proxy,
16204
16221
  connectionTimeout: this.connectionTimeout,
16222
+ httpVersion: this.httpVersion,
16205
16223
  removeSession: this.removeSession,
16206
16224
  appName: this.appName,
16207
16225
  testName: this.testName,
@@ -19811,7 +19829,7 @@ var init_stop = __esm({
19811
19829
  });
19812
19830
 
19813
19831
  // ../req/dist/fetch-browser.js
19814
- var fetch_browser_default, Request, Headers, Response, getBodySize;
19832
+ var fetch_browser_default, Request, Headers, Response, getFetchForVersion, validateOptionsForVersion;
19815
19833
  var init_fetch_browser = __esm({
19816
19834
  "../req/dist/fetch-browser.js"() {
19817
19835
  "use strict";
@@ -19824,7 +19842,11 @@ var init_fetch_browser = __esm({
19824
19842
  Request = globalThis.Request;
19825
19843
  Headers = globalThis.Headers;
19826
19844
  Response = globalThis.Response;
19827
- getBodySize = () => void 0;
19845
+ getFetchForVersion = (_httpVersion) => ({
19846
+ fetch: globalThis.fetch,
19847
+ getBodySize: () => void 0
19848
+ });
19849
+ validateOptionsForVersion = (_httpVersion, _options) => void 0;
19828
19850
  }
19829
19851
  });
19830
19852
 
@@ -19884,6 +19906,7 @@ var init_req_errors = __esm({
19884
19906
 
19885
19907
  // ../req/dist/req.js
19886
19908
  function makeReq(baseOptions) {
19909
+ validateOptionsForVersion(baseOptions.httpVersion, baseOptions);
19887
19910
  return (location2, options) => req(location2, mergeOptions(baseOptions, options !== null && options !== void 0 ? options : {}));
19888
19911
  }
19889
19912
  async function req(input, ...requestOptions) {
@@ -19936,7 +19959,7 @@ async function req(input, ...requestOptions) {
19936
19959
  }
19937
19960
  return { requestController, requestTimer, abortHandler };
19938
19961
  }
19939
- async function buildRequest(input2, opts, requestController) {
19962
+ async function buildRequest(input2, opts, requestController, getBodySize) {
19940
19963
  var _a, _b, _c, _d, _e;
19941
19964
  const url = new URL(String((_a = input2.url) !== null && _a !== void 0 ? _a : input2), opts.baseUrl);
19942
19965
  if (opts.query) {
@@ -19959,11 +19982,11 @@ async function req(input, ...requestOptions) {
19959
19982
  },
19960
19983
  body: (_e = opts.body) !== null && _e !== void 0 ? _e : input2.body,
19961
19984
  highWaterMark: 1024 * 1024 * 100 + 1,
19962
- agent: makeAgent({
19985
+ agent: opts.httpVersion !== 2 ? makeAgent({
19963
19986
  proxy: opts.proxy,
19964
19987
  useDnsCache: opts.useDnsCache,
19965
19988
  keepAliveOptions: opts.keepAliveOptions
19966
- }),
19989
+ }) : void 0,
19967
19990
  signal: requestController.signal
19968
19991
  };
19969
19992
  const finalSize = await getBodySize(input2, opts);
@@ -20060,7 +20083,9 @@ async function req(input, ...requestOptions) {
20060
20083
  }
20061
20084
  async function singleReq(input2, options2) {
20062
20085
  var _a, _b;
20063
- const fetch2 = (_a = options2.fetch) !== null && _a !== void 0 ? _a : fetch_browser_default;
20086
+ validateOptionsForVersion(options2.httpVersion, options2);
20087
+ const { fetch: versionedFetch, getBodySize } = getFetchForVersion(options2.httpVersion, options2.useDnsCache);
20088
+ const fetch2 = (_a = options2.fetch) !== null && _a !== void 0 ? _a : versionedFetch;
20064
20089
  let optionsFallbacks = [];
20065
20090
  if (options2.fallbacks)
20066
20091
  optionsFallbacks = utils.types.isArray(options2.fallbacks) ? options2.fallbacks : [options2.fallbacks];
@@ -20073,7 +20098,7 @@ async function req(input, ...requestOptions) {
20073
20098
  options2 = await fb.updateOptions({ options: options2 });
20074
20099
  while (true) {
20075
20100
  const { requestController, requestTimer, abortHandler } = setupRequestController(options2);
20076
- const request = await buildRequest(input2, options2, requestController);
20101
+ const request = await buildRequest(input2, options2, requestController, getBodySize);
20077
20102
  try {
20078
20103
  let response = await fetch2(request);
20079
20104
  const fallbackResponse = await tryFallback(request, response, options2, optionsFallbacks);
@@ -20928,6 +20953,7 @@ var require_req_eyes = __commonJS({
20928
20953
  },
20929
20954
  proxy: settings.proxy,
20930
20955
  useDnsCache: settings.useDnsCache,
20956
+ httpVersion: settings.httpVersion,
20931
20957
  connectionTimeout: (_a = settings.connectionTimeout) !== null && _a !== void 0 ? _a : 3e5,
20932
20958
  requestTimeout: (_b = settings.requestTimeout) !== null && _b !== void 0 ? _b : 3e4,
20933
20959
  retryTimeout: (_c = settings.retryTimeout) !== null && _c !== void 0 ? _c : retryDuration,
@@ -28462,6 +28488,7 @@ var require_requests = __commonJS({
28462
28488
  apiKey: settings.apiKey,
28463
28489
  proxy: settings.proxy,
28464
28490
  useDnsCache: settings.useDnsCache,
28491
+ httpVersion: settings.httpVersion,
28465
28492
  agentId: settings.agentId,
28466
28493
  interval: (_a = utils2.general.getEnvValue("HEARTBEAT_INTERVAL", "number")) !== null && _a !== void 0 ? _a : account.processKeepaliveIntervalSec * 1e3
28467
28494
  });
@@ -29010,6 +29037,7 @@ var require_requests = __commonJS({
29010
29037
  apiKey: settings.apiKey,
29011
29038
  proxy: settings.proxy,
29012
29039
  useDnsCache: settings.useDnsCache,
29040
+ httpVersion: settings.httpVersion,
29013
29041
  agentId: settings.agentId,
29014
29042
  interval: (_a = utils2.general.getEnvValue("HEARTBEAT_INTERVAL", "number")) !== null && _a !== void 0 ? _a : account.processKeepaliveIntervalSec * 1e3
29015
29043
  });
@@ -74554,393 +74582,312 @@ var require_dist3 = __commonJS({
74554
74582
  init_setImmediate();
74555
74583
  init_buffer();
74556
74584
  init_setInterval();
74557
- exports.addElementIds = function(arg) {
74585
+ exports.translateTo = function(arg) {
74558
74586
  var s = function() {
74559
74587
  "use strict";
74560
- function e(e2) {
74561
- return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
74562
- }
74563
- var t = function(e2) {
74564
- var t2 = e2 && e2[0] || null;
74565
- return !t2 || ("isConnected" in window.Node.prototype ? !t2.isConnected : document.documentElement.contains ? !document.documentElement.contains(t2) : !t2.ownerDocument.documentElement.contains(t2));
74566
- }, r = t;
74567
- var n = function(e2) {
74568
- if (!e2.hasAttribute("data-applitools-fallback-selector")) {
74569
- if (r([e2]))
74570
- throw new Error("The element is not connected to the DOM: " + function(e3) {
74571
- var t2 = e3.attributes, r2 = e3.tagName, n2 = e3.children.length, o2 = [].slice.call(t2).map(function(e4) {
74572
- return e4.name + '="' + e4.value + '"';
74573
- }).join(" ");
74574
- return "<" + r2 + " " + o2 + (n2 ? ">" : "/>");
74575
- }(e2));
74576
- e2.setAttribute("data-applitools-fallback-selector", function(e3) {
74577
- var t2 = [];
74578
- for (; e3 && e3.nodeType === Node.ELEMENT_NODE; )
74579
- try {
74580
- var r2, n2 = e3.tagName.toLowerCase(), o2 = [].slice.call((null == (r2 = e3.parentNode) ? void 0 : r2.children) || []).indexOf(e3);
74581
- o2 > -1 && (n2 += ":nth-child(" + (o2 + 1) + ")"), t2.unshift(n2), e3 = e3.parentNode;
74582
- } catch (e4) {
74583
- break;
74584
- }
74585
- return t2.length ? t2.join(" > ") : "html";
74586
- }(e2));
74587
- }
74588
- }, o = t;
74589
- function a(e2, t2) {
74590
- if (o([e2])) {
74591
- var r2 = function(e3) {
74592
- if (null == e3 || !e3.getAttribute)
74593
- return { error: "invalid element: " + JSON.stringify(e3) };
74594
- var t3 = e3.getAttribute("data-applitools-fallback-selector");
74595
- return t3;
74596
- }(e2);
74597
- if (!r2)
74598
- return { error: "Failed to recover from stale element" };
74599
- if (r2.error)
74600
- return r2;
74601
- var l = document.querySelectorAll(r2);
74602
- if (!l || 1 !== l.length)
74603
- return { error: "Failed to recover from stale element - selector found: " + r2 };
74604
- var i = l[0];
74605
- return i.setAttribute("data-applitools-selector", t2), i.setAttribute("data-applitools-recovered", true), a(i, t2);
74606
- }
74607
- n(e2);
74608
- var u = e2.getAttribute("data-applitools-selector"), c = u ? u + " " + t2 : t2;
74609
- return e2.setAttribute("data-applitools-selector", c), '[data-applitools-selector~="' + t2 + '"]';
74588
+ function t(t2) {
74589
+ return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
74610
74590
  }
74611
- return e(function(e2) {
74612
- return e2.map(function(e3) {
74613
- var t2 = e3[0], r2 = e3[1];
74614
- return t2.map(function(e4) {
74615
- var t3 = function(e5) {
74616
- var t4 = [{ element: e5, kind: "root" }], r3 = /* @__PURE__ */ new Set([e5]), n2 = e5;
74617
- for (; n2; ) {
74618
- var o2, a2 = n2.getRootNode && n2.getRootNode();
74619
- if (!a2)
74620
- break;
74621
- if (a2.constructor && "ShadowRoot" === a2.constructor.name ? (n2 = a2.host, o2 = "shadow") : (n2 = a2.defaultView ? a2.defaultView.frameElement : null, o2 = "frame"), n2) {
74622
- if (r3.has(n2))
74623
- break;
74624
- r3.add(n2), t4.push({ element: n2, kind: o2 });
74625
- }
74626
- }
74627
- return t4;
74628
- }(e4);
74629
- return t3.map(function(e5) {
74630
- return { selector: a(e5.element, r2), kind: e5.kind };
74631
- });
74632
- });
74633
- });
74591
+ var r = function(t2) {
74592
+ var r2 = void 0 === t2 ? [] : t2, e = r2[0], n = r2[1], o = Object.keys(n).sort(), a = o.reduce(function(t3, r3) {
74593
+ return t3[r3] = { value: e.style.getPropertyValue(r3), important: Boolean(e.style.getPropertyPriority(r3)) }, t3;
74594
+ }, {});
74595
+ return o.forEach(function(t3) {
74596
+ e.style.setProperty(t3, "string" != typeof n[t3] && n[t3] ? n[t3].value : n[t3], n[t3] && n[t3].important ? "important" : "");
74597
+ }), a;
74598
+ };
74599
+ return t(function(t2) {
74600
+ var e = void 0 === t2 ? [] : t2, n = e[0], o = e[1];
74601
+ n = n || document.documentElement;
74602
+ var a = { value: "translate(" + -o.x + "px, " + -o.y + "px)", important: true };
74603
+ return r([n, { transform: a, "-webkit-transform": a }]), o;
74634
74604
  });
74635
74605
  }();
74636
74606
  return s(arg);
74637
74607
  };
74638
- exports.addFallbackSelectorIfNeeded = function(arg) {
74608
+ exports.setElementStyleProperties = function(arg) {
74639
74609
  var s = function() {
74640
74610
  "use strict";
74641
74611
  function t(t2) {
74642
74612
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
74643
74613
  }
74644
- var e = function(t2) {
74645
- var e2 = t2 && t2[0] || null;
74646
- return !e2 || ("isConnected" in window.Node.prototype ? !e2.isConnected : document.documentElement.contains ? !document.documentElement.contains(e2) : !e2.ownerDocument.documentElement.contains(e2));
74647
- };
74648
74614
  return t(function(t2) {
74649
- if (!t2.hasAttribute("data-applitools-fallback-selector")) {
74650
- if (e([t2]))
74651
- throw new Error("The element is not connected to the DOM: " + function(t3) {
74652
- var e2 = t3.attributes, n = t3.tagName, o = t3.children.length, r = [].slice.call(e2).map(function(t4) {
74653
- return t4.name + '="' + t4.value + '"';
74654
- }).join(" ");
74655
- return "<" + n + " " + r + (o ? ">" : "/>");
74656
- }(t2));
74657
- t2.setAttribute("data-applitools-fallback-selector", function(t3) {
74658
- var e2 = [];
74659
- for (; t3 && t3.nodeType === Node.ELEMENT_NODE; )
74660
- try {
74661
- var n, o = t3.tagName.toLowerCase(), r = [].slice.call((null == (n = t3.parentNode) ? void 0 : n.children) || []).indexOf(t3);
74662
- r > -1 && (o += ":nth-child(" + (r + 1) + ")"), e2.unshift(o), t3 = t3.parentNode;
74663
- } catch (t4) {
74664
- break;
74665
- }
74666
- return e2.length ? e2.join(" > ") : "html";
74667
- }(t2));
74668
- }
74615
+ var e = void 0 === t2 ? [] : t2, r = e[0], o = e[1], n = Object.keys(o).sort(), u = n.reduce(function(t3, e2) {
74616
+ return t3[e2] = { value: r.style.getPropertyValue(e2), important: Boolean(r.style.getPropertyPriority(e2)) }, t3;
74617
+ }, {});
74618
+ return n.forEach(function(t3) {
74619
+ r.style.setProperty(t3, "string" != typeof o[t3] && o[t3] ? o[t3].value : o[t3], o[t3] && o[t3].important ? "important" : "");
74620
+ }), u;
74669
74621
  });
74670
74622
  }();
74671
74623
  return s(arg);
74672
74624
  };
74673
- exports.addPageMarker = function(arg) {
74625
+ exports.setElementAttributes = function(arg) {
74674
74626
  var s = function() {
74675
74627
  "use strict";
74676
74628
  function t(t2) {
74677
74629
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
74678
74630
  }
74679
- var e = function(t2) {
74680
- var e2 = void 0 === t2 ? [] : t2, r = e2[0], o = e2[1], n = Object.keys(o).sort(), a = n.reduce(function(t3, e3) {
74681
- return t3[e3] = { value: r.style.getPropertyValue(e3), important: Boolean(r.style.getPropertyPriority(e3)) }, t3;
74682
- }, {});
74683
- return n.forEach(function(t3) {
74684
- r.style.setProperty(t3, "string" != typeof o[t3] && o[t3] ? o[t3].value : o[t3], o[t3] && o[t3].important ? "important" : "");
74685
- }), a;
74686
- };
74687
74631
  return t(function(t2) {
74688
- var r = t2[0], o = r.mask, n = r.size, a = void 0 === n ? 1 : n, i = { 1: "rgb(0, 0, 0)", 0: "rgb(255, 255, 255)" }, s2 = a, p = document.createElement("div");
74689
- p.setAttribute("data-applitools-marker", ""), p.style.setProperty("position", "fixed", "important"), p.style.setProperty("top", "0", "important"), p.style.setProperty("left", "0", "important"), p.style.setProperty("box-sizing", "content-box", "important"), p.style.setProperty("padding", s2 + "px", "important"), p.style.setProperty("background", "rgb(128, 128, 128)", "important"), p.style.setProperty("z-index", "2147483647", "important");
74690
- for (var l, y = 0; y < o.length; y += l) {
74691
- for (l = 1; o[y] === o[y + l]; )
74692
- ++l;
74693
- var m = o[y], d = document.createElement("div");
74694
- d.style.setProperty("display", "block", "important"), d.style.setProperty("float", "left", "important"), d.style.setProperty("width", l * a + "px", "important"), d.style.setProperty("height", a + "px", "important"), d.style.setProperty("background", i[m], "important"), p.appendChild(d);
74695
- }
74696
- var u = { value: "none", important: true }, c = e([document.documentElement, { transform: u, "-webkit-transform": u }]), f = e([document.body, { transform: u, "-webkit-transform": u }]);
74697
- return document.documentElement.setAttribute("data-applitools-original-transforms", JSON.stringify(c)), document.body.setAttribute("data-applitools-original-transforms", JSON.stringify(f)), document.body.appendChild(p), { mask: o, size: a, offset: s2 };
74632
+ var e = void 0 === t2 ? [] : t2, r = e[0], u = e[1];
74633
+ return Object.keys(u).reduce(function(t3, e2) {
74634
+ return t3[e2] = r.getAttribute(e2), r.setAttribute(e2, u[e2]), t3;
74635
+ }, {});
74698
74636
  });
74699
74637
  }();
74700
74638
  return s(arg);
74701
74639
  };
74702
- exports.blurElement = function(arg) {
74640
+ exports.scrollTo = function(arg) {
74703
74641
  var s = function() {
74704
74642
  "use strict";
74705
74643
  function t(t2) {
74706
74644
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
74707
74645
  }
74646
+ var r = function(t2) {
74647
+ var r2 = void 0 === t2 ? [] : t2, o = r2[0], e = r2[1], l = Object.keys(e).sort(), n = l.reduce(function(t3, r3) {
74648
+ return t3[r3] = { value: o.style.getPropertyValue(r3), important: Boolean(o.style.getPropertyPriority(r3)) }, t3;
74649
+ }, {});
74650
+ return l.forEach(function(t3) {
74651
+ o.style.setProperty(t3, "string" != typeof e[t3] && e[t3] ? e[t3].value : e[t3], e[t3] && e[t3].important ? "important" : "");
74652
+ }), n;
74653
+ };
74708
74654
  return t(function(t2) {
74709
- var e = (void 0 === t2 ? [] : t2)[0] || document.activeElement;
74710
- return e && e.blur(), e;
74655
+ var o = void 0 === t2 ? [] : t2, e = o[0], l = o[1];
74656
+ e = e || document.documentElement;
74657
+ var n = r([e, { "scroll-behavior": { value: "auto", important: true } }]);
74658
+ return e.scrollTo ? e.scrollTo(l.x, l.y) : (e.scrollLeft = l.x, e.scrollTop = l.y), r([e, n]), { x: e.scrollLeft, y: e.scrollTop };
74711
74659
  });
74712
74660
  }();
74713
74661
  return s(arg);
74714
74662
  };
74715
- exports.cleanupElementIds = function(arg) {
74663
+ exports.reloadPage = function(arg) {
74716
74664
  var s = function() {
74717
74665
  "use strict";
74718
74666
  function t(t2) {
74719
74667
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
74720
74668
  }
74721
- return t(function(t2) {
74722
- (t2 = t2 && t2[0]) && "function" == typeof t2.forEach && t2.forEach(function(t3) {
74723
- t3.removeAttribute("data-applitools-selector");
74724
- var o = t3;
74725
- if (o.getRootNode)
74726
- try {
74727
- for (; o; ) {
74728
- var e = o.getRootNode();
74729
- if (!e)
74730
- break;
74731
- (o = e.constructor && "ShadowRoot" === e.constructor.name ? e.host : e.defaultView ? e.defaultView.frameElement : null) && o.removeAttribute("data-applitools-selector");
74732
- }
74733
- } catch (t4) {
74734
- }
74735
- });
74669
+ return t(function() {
74670
+ window.location.reload();
74736
74671
  });
74737
74672
  }();
74738
74673
  return s(arg);
74739
74674
  };
74740
- exports.cleanupPageMarker = function(arg) {
74675
+ exports.lazyLoad = function(arg) {
74741
74676
  var s = function() {
74742
74677
  "use strict";
74743
74678
  function t(t2) {
74744
74679
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
74745
74680
  }
74746
- var e = function(t2) {
74747
- var e2 = void 0 === t2 ? [] : t2, r = e2[0], o = e2[1], n = Object.keys(o).sort(), a = n.reduce(function(t3, e3) {
74748
- return t3[e3] = { value: r.style.getPropertyValue(e3), important: Boolean(r.style.getPropertyPriority(e3)) }, t3;
74681
+ var o = function(t2) {
74682
+ var o2 = (void 0 === t2 ? [] : t2)[0];
74683
+ return o2 ? { x: o2.scrollLeft, y: o2.scrollTop } : { x: window.scrollX || window.pageXOffset, y: window.scrollY || window.pageYOffset };
74684
+ };
74685
+ var r = function(t2) {
74686
+ var o2 = void 0 === t2 ? [] : t2, r2 = o2[0], n2 = o2[1], e2 = Object.keys(n2).sort(), i2 = e2.reduce(function(t3, o3) {
74687
+ return t3[o3] = { value: r2.style.getPropertyValue(o3), important: Boolean(r2.style.getPropertyPriority(o3)) }, t3;
74749
74688
  }, {});
74750
- return n.forEach(function(t3) {
74751
- r.style.setProperty(t3, "string" != typeof o[t3] && o[t3] ? o[t3].value : o[t3], o[t3] && o[t3].important ? "important" : "");
74752
- }), a;
74689
+ return e2.forEach(function(t3) {
74690
+ r2.style.setProperty(t3, "string" != typeof n2[t3] && n2[t3] ? n2[t3].value : n2[t3], n2[t3] && n2[t3].important ? "important" : "");
74691
+ }), i2;
74753
74692
  };
74754
- return t(function() {
74755
- var t2 = document.querySelector("[data-applitools-marker]");
74756
- t2 && document.body.removeChild(t2);
74757
- var r = document.documentElement.getAttribute("data-applitools-original-transforms"), o = document.body.getAttribute("data-applitools-original-transforms");
74758
- r && e([document.documentElement, JSON.parse(r)]), o && e([document.body, JSON.parse(o)]);
74693
+ var n = function(t2) {
74694
+ var o2 = void 0 === t2 ? [] : t2, n2 = o2[0], e2 = o2[1];
74695
+ n2 = n2 || document.documentElement;
74696
+ var i2 = r([n2, { "scroll-behavior": { value: "auto", important: true } }]);
74697
+ return n2.scrollTo ? n2.scrollTo(e2.x, e2.y) : (n2.scrollLeft = e2.x, n2.scrollTop = e2.y), r([n2, i2]), { x: n2.scrollLeft, y: n2.scrollTop };
74698
+ }, e = "__EYES__APPLITOOLS__", i = "lazyLoadResult";
74699
+ window[e] = window[e] || {};
74700
+ var l = o, a = n;
74701
+ return t(function(t2) {
74702
+ var o2 = void 0 === t2 ? [] : t2, r2 = o2[0], n2 = o2[1], s2 = void 0 === n2 ? {} : n2, u = s2.scrollLength, c = s2.waitingTime, w = s2.maxAmountToScroll;
74703
+ try {
74704
+ if (window[e][i]) {
74705
+ var d = window[e][i];
74706
+ return "WIP" !== d.status && delete window[e][i], JSON.stringify(d);
74707
+ }
74708
+ window[e][i] = { status: "WIP" };
74709
+ var v = l(), y = [];
74710
+ y.push({ maxAmountToScroll: w, scrollLength: u, waitingTime: c, startingScrollPositionX: v.x, startingScrollPositionY: v.y });
74711
+ var f = Date.now();
74712
+ return function t3(o3) {
74713
+ var n3 = void 0 === o3 ? {} : o3, l2 = n3.doneScrolling, s3 = n3.previousScrollResult, d2 = void 0 === s3 ? {} : s3;
74714
+ setTimeout(function() {
74715
+ try {
74716
+ if (l2) {
74717
+ var o4 = a([r2, v]), n4 = o4.x, s4 = o4.y;
74718
+ return y.push({ x: n4, y: s4, msSinceStart: Date.now() - f }), void (window[e][i] = { status: "SUCCESS", value: y });
74719
+ }
74720
+ var c2 = a([r2, { x: v.x, y: d2.y + u }]), p = c2.x, S = c2.y;
74721
+ y.push({ x: p, y: S, msSinceStart: Date.now() - f }), t3({ doneScrolling: S === d2.y || S === w, previousScrollResult: { x: p, y: S } });
74722
+ } catch (t4) {
74723
+ window[e][i] = { status: "ERROR", error: t4 };
74724
+ }
74725
+ }, c);
74726
+ }(), JSON.stringify(window[e][i]);
74727
+ } catch (t3) {
74728
+ return window[e][i] = { status: "ERROR", error: t3 }, JSON.stringify(window[e][i]);
74729
+ }
74759
74730
  });
74760
74731
  }();
74761
74732
  return s(arg);
74762
74733
  };
74763
- exports.focusElement = function(arg) {
74734
+ exports.isStaleElement = function(arg) {
74764
74735
  var s = function() {
74765
74736
  "use strict";
74766
- function t(t2) {
74767
- return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
74737
+ function n(n2) {
74738
+ return n2 && n2.__esModule && Object.prototype.hasOwnProperty.call(n2, "default") ? n2.default : n2;
74768
74739
  }
74769
- return t(function(t2) {
74770
- var e = (void 0 === t2 ? [] : t2)[0];
74771
- e && e.focus();
74740
+ return n(function(n2) {
74741
+ var e = n2 && n2[0] || null;
74742
+ return !e || ("isConnected" in window.Node.prototype ? !e.isConnected : document.documentElement.contains ? !document.documentElement.contains(e) : !e.ownerDocument.documentElement.contains(e));
74772
74743
  });
74773
74744
  }();
74774
74745
  return s(arg);
74775
74746
  };
74776
- exports.getChildFramesInfo = function(arg) {
74747
+ exports.isEqualElements = function(arg) {
74777
74748
  var s = function() {
74778
74749
  "use strict";
74779
74750
  function t(t2) {
74780
74751
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
74781
74752
  }
74782
- return t(function() {
74783
- return function t2(r) {
74784
- r = r || document;
74785
- var e = [];
74786
- r.querySelectorAll("frame, iframe").forEach(function(t3) {
74787
- return e.push([t3, !t3.contentDocument, t3.src]);
74788
- });
74789
- var n = Array.prototype.filter.call(r.querySelectorAll("*"), function(t3) {
74790
- return t3.shadowRoot;
74791
- }).map(function(r2) {
74792
- return t2(r2.shadowRoot);
74793
- });
74794
- return e.concat.apply(e, n);
74795
- }();
74753
+ return t(function(t2) {
74754
+ var r = void 0 === t2 ? [] : t2;
74755
+ return r[0] === r[1];
74796
74756
  });
74797
74757
  }();
74798
74758
  return s(arg);
74799
74759
  };
74800
- exports.getContextInfo = function(arg) {
74760
+ exports.isElementScrollable = function(arg) {
74801
74761
  var s = function() {
74802
74762
  "use strict";
74803
74763
  function t(t2) {
74804
74764
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
74805
74765
  }
74806
74766
  var e = function(t2) {
74807
- var e2 = (void 0 === t2 ? [] : t2)[0], n = "", r = e2.ownerDocument;
74808
- if (!r)
74809
- return n;
74810
- for (var o = e2; o !== r; ) {
74811
- var a = Array.prototype.filter.call(o.parentNode.childNodes, function(t3) {
74812
- return t3.tagName === o.tagName;
74813
- }).indexOf(o);
74814
- n = "/" + o.tagName + "[" + (a + 1) + "]" + n, o = o.parentNode;
74815
- }
74816
- return n;
74767
+ var e2 = void 0 === t2 ? [] : t2, o = e2[0], r = e2[1], n = void 0 === r ? [] : r, l = window.getComputedStyle(o);
74768
+ return l ? n.map(function(t3) {
74769
+ return l.getPropertyValue(t3);
74770
+ }) : [];
74817
74771
  };
74818
- return t(function() {
74819
- var t2, n, r;
74820
- try {
74821
- t2 = window.top.document === window.document || "root-context" === window.parent.document["applitools-marker"];
74822
- } catch (e2) {
74823
- t2 = false;
74824
- }
74825
- try {
74826
- n = !window.parent.document === window.document;
74827
- } catch (t3) {
74828
- n = true;
74829
- }
74830
- if (!n)
74831
- try {
74832
- r = e([window.frameElement]);
74833
- } catch (t3) {
74834
- r = null;
74835
- }
74836
- return [document.documentElement, r, t2, n];
74772
+ return t(function(t2) {
74773
+ var o = (void 0 === t2 ? [] : t2)[0], r = e([o, ["overflow-x", "overflow-y", "overflow"]]);
74774
+ return ("scroll" === r[0] || "auto" === r[0] || "hidden" === r[2]) && o.scrollWidth > o.clientWidth || ("scroll" === r[1] || "auto" === r[1] || "hidden" === r[2]) && o.scrollHeight > o.clientHeight;
74837
74775
  });
74838
74776
  }();
74839
74777
  return s(arg);
74840
74778
  };
74841
- exports.getDocumentScrollingElement = function(arg) {
74779
+ exports.getViewport = function(arg) {
74842
74780
  var s = function() {
74843
74781
  "use strict";
74844
- function t(t2) {
74845
- return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
74782
+ function e(e2) {
74783
+ return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
74846
74784
  }
74847
- return t(function() {
74848
- var t2 = "HTML", e = document.scrollingElement;
74849
- return e && (t2 = e.tagName), t2.toLowerCase();
74785
+ return e(function() {
74786
+ var e2, n = 0, t = 0;
74787
+ return window.innerHeight ? t = window.innerHeight : document.documentElement && document.documentElement.clientHeight ? t = document.documentElement.clientHeight : document.body && document.body.clientHeight && (t = document.body.clientHeight), window.innerWidth ? n = window.innerWidth : document.documentElement && document.documentElement.clientWidth ? n = document.documentElement.clientWidth : document.body && document.body.clientWidth && (n = document.body.clientWidth), window.screen && window.screen.orientation ? e2 = window.screen.orientation.type.replace(/-primary$/, "") : null != window.orientation && (0 === window.orientation ? e2 = "portrait" : 180 === window.orientation ? e2 = "portrait-secondary" : 90 === window.orientation ? e2 = "landscape" : -90 === window.orientation && (e2 = "landscape-secondary")), { viewportSize: { width: n, height: t }, pixelRatio: window.devicePixelRatio, viewportScale: window.visualViewport && window.visualViewport.scale, orientation: e2 };
74850
74788
  });
74851
74789
  }();
74852
74790
  return s(arg);
74853
74791
  };
74854
- exports.getDocumentSize = function(arg) {
74792
+ exports.getUserAgent = function(arg) {
74855
74793
  var s = function() {
74856
74794
  "use strict";
74857
- function t(t2) {
74858
- return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
74795
+ function n(n2) {
74796
+ return n2 && n2.__esModule && Object.prototype.hasOwnProperty.call(n2, "default") ? n2.default : n2;
74859
74797
  }
74860
- return t(function() {
74861
- var t2 = document.documentElement.scrollWidth, e = document.documentElement.scrollHeight, n = document.documentElement.clientHeight, o = document.body.scrollWidth, c = document.body.scrollHeight, u = document.body.clientHeight;
74862
- return { width: Math.max(t2, o), height: Math.max(n, e, u, c) };
74798
+ function t() {
74799
+ return t = Object.assign ? Object.assign.bind() : function(n2) {
74800
+ for (var t2 = 1; t2 < arguments.length; t2++) {
74801
+ var r2 = arguments[t2];
74802
+ for (var e2 in r2)
74803
+ ({}).hasOwnProperty.call(r2, e2) && (n2[e2] = r2[e2]);
74804
+ }
74805
+ return n2;
74806
+ }, t.apply(null, arguments);
74807
+ }
74808
+ var r = "__EYES__APPLITOOLS__", e = "userAgent";
74809
+ return window[r] = window[r] || {}, n(function() {
74810
+ try {
74811
+ if (window[r][e]) {
74812
+ var n2 = window[r][e];
74813
+ return "WIP" !== n2.status && delete window[r][e], JSON.stringify(n2);
74814
+ }
74815
+ return window.navigator.userAgentData ? (window[r][e] = { status: "WIP" }, window.navigator.userAgentData.getHighEntropyValues(["brands", "platform", "platformVersion", "model"]).then(function(n3) {
74816
+ window[r][e] = { status: "SUCCESS", value: t({ legacy: window.navigator.userAgent }, n3) };
74817
+ }).catch(function(n3) {
74818
+ window[r][e] = { status: "ERROR", error: n3.message };
74819
+ })) : window[r][e] = { status: "SUCCESS", value: window.navigator.userAgent }, JSON.stringify(window[r][e]);
74820
+ } catch (n3) {
74821
+ return window[r][e] = { status: "ERROR", error: n3.message }, JSON.stringify(window[r][e]);
74822
+ }
74863
74823
  });
74864
74824
  }();
74865
74825
  return s(arg);
74866
74826
  };
74867
- exports.getElementComputedStyleProperties = function(arg) {
74827
+ exports.getText = function(arg) {
74868
74828
  var s = function() {
74869
74829
  "use strict";
74870
74830
  function t(t2) {
74871
74831
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
74872
74832
  }
74873
74833
  return t(function(t2) {
74874
- var e = void 0 === t2 ? [] : t2, r = e[0], n = e[1], u = void 0 === n ? [] : n, o = window.getComputedStyle(r);
74875
- return o ? u.map(function(t3) {
74876
- return o.getPropertyValue(t3);
74877
- }) : [];
74834
+ return t2[0].innerText;
74878
74835
  });
74879
74836
  }();
74880
74837
  return s(arg);
74881
74838
  };
74882
- exports.getElementContentSize = function(arg) {
74839
+ exports.getShadowRoot = function(arg) {
74883
74840
  var s = function() {
74884
74841
  "use strict";
74885
74842
  function t(t2) {
74886
74843
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
74887
74844
  }
74888
- var e = function(t2) {
74889
- var e2 = void 0 === t2 ? [] : t2, r2 = e2[0], o = e2[1], n = Object.keys(o).sort(), a = n.reduce(function(t3, e3) {
74890
- return t3[e3] = { value: r2.style.getPropertyValue(e3), important: Boolean(r2.style.getPropertyPriority(e3)) }, t3;
74891
- }, {});
74892
- return n.forEach(function(t3) {
74893
- r2.style.setProperty(t3, "string" != typeof o[t3] && o[t3] ? o[t3].value : o[t3], o[t3] && o[t3].important ? "important" : "");
74894
- }), a;
74895
- }, r = function() {
74896
- var t2 = "HTML", e2 = document.scrollingElement;
74897
- return e2 && (t2 = e2.tagName), t2.toLowerCase();
74898
- };
74899
74845
  return t(function(t2) {
74900
- var o, n = (void 0 === t2 ? [] : t2)[0];
74901
- n !== document.documentElement && n.tagName.toLowerCase() !== r() || (o = e([n, { transform: "none" }]));
74902
- var a = { width: n.scrollWidth, height: n.scrollHeight };
74903
- return o && e([n, o]), a;
74846
+ return (void 0 === t2 ? [] : t2)[0].shadowRoot;
74904
74847
  });
74905
74848
  }();
74906
74849
  return s(arg);
74907
74850
  };
74908
- exports.getElementFixedAncestor = function(arg) {
74851
+ exports.getElementXpath = function(arg) {
74909
74852
  var s = function() {
74910
74853
  "use strict";
74911
- function t(t2) {
74912
- return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
74854
+ function e(e2) {
74855
+ return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
74913
74856
  }
74914
- return t(function(t2) {
74915
- for (var e = (void 0 === t2 ? [] : t2)[0]; e.offsetParent && e.offsetParent !== document.body && e.offsetParent !== document.documentElement; )
74916
- e = e.offsetParent;
74917
- return "fixed" === window.getComputedStyle(e).getPropertyValue("position") ? e : null;
74857
+ return e(function(e2) {
74858
+ var r = (void 0 === e2 ? [] : e2)[0], t = "", n = r.ownerDocument;
74859
+ if (!n)
74860
+ return t;
74861
+ for (var a = r; a !== n; ) {
74862
+ var o = Array.prototype.filter.call(a.parentNode.childNodes, function(e3) {
74863
+ return e3.tagName === a.tagName;
74864
+ }).indexOf(a);
74865
+ t = "/" + a.tagName + "[" + (o + 1) + "]" + t, a = a.parentNode;
74866
+ }
74867
+ return t;
74918
74868
  });
74919
74869
  }();
74920
74870
  return s(arg);
74921
74871
  };
74922
- exports.getElementInnerOffset = function(arg) {
74872
+ exports.getElementTranslateOffset = function(arg) {
74923
74873
  var s = function() {
74924
74874
  "use strict";
74925
74875
  function r(r2) {
74926
74876
  return r2 && r2.__esModule && Object.prototype.hasOwnProperty.call(r2, "default") ? r2.default : r2;
74927
74877
  }
74928
74878
  var t = function(r2) {
74929
- var t2 = void 0 === r2 ? [] : r2, e2 = t2[0], o2 = t2[1];
74930
- return (void 0 === o2 ? [] : o2).reduce(function(r3, t3) {
74931
- return r3[t3] = { value: e2.style.getPropertyValue(t3), important: Boolean(e2.style.getPropertyPriority(t3)) }, r3;
74879
+ var t2 = void 0 === r2 ? [] : r2, e = t2[0], n = t2[1];
74880
+ return (void 0 === n ? [] : n).reduce(function(r3, t3) {
74881
+ return r3[t3] = { value: e.style.getPropertyValue(t3), important: Boolean(e.style.getPropertyPriority(t3)) }, r3;
74932
74882
  }, {});
74933
74883
  };
74934
- var e = function(r2) {
74935
- var t2 = (void 0 === r2 ? [] : r2)[0];
74936
- return t2 ? { x: t2.scrollLeft, y: t2.scrollTop } : { x: window.scrollX || window.pageXOffset, y: window.scrollY || window.pageYOffset };
74937
- }, o = function(r2) {
74938
- var e2 = (void 0 === r2 ? [] : r2)[0], o2 = void 0 === e2 ? document.documentElement : e2, n = t([o2, ["transform", "-webkit-transform"]]), u = Object.keys(n).reduce(function(r3, t2) {
74939
- var e3 = n[t2].value;
74940
- if (e3) {
74941
- var o3 = e3.match(/^translate\s*\(\s*(\-?[\d, \.]+)px\s*(,\s*(-?[\d, \.]+)px)?\s*\)/);
74942
- if (o3) {
74943
- var u2 = o3[1], a = void 0 !== o3[3] ? o3[3] : 0;
74884
+ return r(function(r2) {
74885
+ var e = (void 0 === r2 ? [] : r2)[0], n = void 0 === e ? document.documentElement : e, o = t([n, ["transform", "-webkit-transform"]]), u = Object.keys(o).reduce(function(r3, t2) {
74886
+ var e2 = o[t2].value;
74887
+ if (e2) {
74888
+ var n2 = e2.match(/^translate\s*\(\s*(\-?[\d, \.]+)px\s*(,\s*(-?[\d, \.]+)px)?\s*\)/);
74889
+ if (n2) {
74890
+ var u2 = n2[1], a = void 0 !== n2[3] ? n2[3] : 0;
74944
74891
  r3.push({ x: Math.round(-parseFloat(u2)), y: Math.round(-parseFloat(a)) });
74945
74892
  } else
74946
74893
  r3.push({ x: 0, y: 0 });
@@ -74952,29 +74899,38 @@ var require_dist3 = __commonJS({
74952
74899
  }))
74953
74900
  throw new Error("Got different css positions!");
74954
74901
  return u[0] || { x: 0, y: 0 };
74955
- };
74956
- return r(function(r2) {
74957
- var t2 = (void 0 === r2 ? [] : r2)[0], n = e([t2]), u = o([t2]);
74958
- return { x: n.x + u.x, y: n.y + u.y };
74959
74902
  });
74960
74903
  }();
74961
74904
  return s(arg);
74962
74905
  };
74963
- exports.getElementProperties = function(arg) {
74906
+ exports.getElementStyleProperties = function(arg) {
74964
74907
  var s = function() {
74965
74908
  "use strict";
74966
74909
  function t(t2) {
74967
74910
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
74968
74911
  }
74969
74912
  return t(function(t2) {
74970
- var r = void 0 === t2 ? [] : t2, e = r[0], n = r[1];
74971
- return (void 0 === n ? [] : n).reduce(function(t3, r2) {
74972
- return t3[r2] = e[r2], t3;
74913
+ var e = void 0 === t2 ? [] : t2, r = e[0], o = e[1];
74914
+ return (void 0 === o ? [] : o).reduce(function(t3, e2) {
74915
+ return t3[e2] = { value: r.style.getPropertyValue(e2), important: Boolean(r.style.getPropertyPriority(e2)) }, t3;
74973
74916
  }, {});
74974
74917
  });
74975
74918
  }();
74976
74919
  return s(arg);
74977
74920
  };
74921
+ exports.getElementScrollOffset = function(arg) {
74922
+ var s = function() {
74923
+ "use strict";
74924
+ function o(o2) {
74925
+ return o2 && o2.__esModule && Object.prototype.hasOwnProperty.call(o2, "default") ? o2.default : o2;
74926
+ }
74927
+ return o(function(o2) {
74928
+ var t = (void 0 === o2 ? [] : o2)[0];
74929
+ return t ? { x: t.scrollLeft, y: t.scrollTop } : { x: window.scrollX || window.pageXOffset, y: window.scrollY || window.pageYOffset };
74930
+ });
74931
+ }();
74932
+ return s(arg);
74933
+ };
74978
74934
  exports.getElementRect = function(arg) {
74979
74935
  var s = function() {
74980
74936
  "use strict";
@@ -75044,53 +75000,43 @@ var require_dist3 = __commonJS({
75044
75000
  }();
75045
75001
  return s(arg);
75046
75002
  };
75047
- exports.getElementScrollOffset = function(arg) {
75048
- var s = function() {
75049
- "use strict";
75050
- function o(o2) {
75051
- return o2 && o2.__esModule && Object.prototype.hasOwnProperty.call(o2, "default") ? o2.default : o2;
75052
- }
75053
- return o(function(o2) {
75054
- var t = (void 0 === o2 ? [] : o2)[0];
75055
- return t ? { x: t.scrollLeft, y: t.scrollTop } : { x: window.scrollX || window.pageXOffset, y: window.scrollY || window.pageYOffset };
75056
- });
75057
- }();
75058
- return s(arg);
75059
- };
75060
- exports.getElementStyleProperties = function(arg) {
75003
+ exports.getElementProperties = function(arg) {
75061
75004
  var s = function() {
75062
75005
  "use strict";
75063
75006
  function t(t2) {
75064
75007
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
75065
75008
  }
75066
75009
  return t(function(t2) {
75067
- var e = void 0 === t2 ? [] : t2, r = e[0], o = e[1];
75068
- return (void 0 === o ? [] : o).reduce(function(t3, e2) {
75069
- return t3[e2] = { value: r.style.getPropertyValue(e2), important: Boolean(r.style.getPropertyPriority(e2)) }, t3;
75010
+ var r = void 0 === t2 ? [] : t2, e = r[0], n = r[1];
75011
+ return (void 0 === n ? [] : n).reduce(function(t3, r2) {
75012
+ return t3[r2] = e[r2], t3;
75070
75013
  }, {});
75071
75014
  });
75072
75015
  }();
75073
75016
  return s(arg);
75074
75017
  };
75075
- exports.getElementTranslateOffset = function(arg) {
75018
+ exports.getElementInnerOffset = function(arg) {
75076
75019
  var s = function() {
75077
75020
  "use strict";
75078
75021
  function r(r2) {
75079
75022
  return r2 && r2.__esModule && Object.prototype.hasOwnProperty.call(r2, "default") ? r2.default : r2;
75080
75023
  }
75081
75024
  var t = function(r2) {
75082
- var t2 = void 0 === r2 ? [] : r2, e = t2[0], n = t2[1];
75083
- return (void 0 === n ? [] : n).reduce(function(r3, t3) {
75084
- return r3[t3] = { value: e.style.getPropertyValue(t3), important: Boolean(e.style.getPropertyPriority(t3)) }, r3;
75025
+ var t2 = void 0 === r2 ? [] : r2, e2 = t2[0], o2 = t2[1];
75026
+ return (void 0 === o2 ? [] : o2).reduce(function(r3, t3) {
75027
+ return r3[t3] = { value: e2.style.getPropertyValue(t3), important: Boolean(e2.style.getPropertyPriority(t3)) }, r3;
75085
75028
  }, {});
75086
75029
  };
75087
- return r(function(r2) {
75088
- var e = (void 0 === r2 ? [] : r2)[0], n = void 0 === e ? document.documentElement : e, o = t([n, ["transform", "-webkit-transform"]]), u = Object.keys(o).reduce(function(r3, t2) {
75089
- var e2 = o[t2].value;
75090
- if (e2) {
75091
- var n2 = e2.match(/^translate\s*\(\s*(\-?[\d, \.]+)px\s*(,\s*(-?[\d, \.]+)px)?\s*\)/);
75092
- if (n2) {
75093
- var u2 = n2[1], a = void 0 !== n2[3] ? n2[3] : 0;
75030
+ var e = function(r2) {
75031
+ var t2 = (void 0 === r2 ? [] : r2)[0];
75032
+ return t2 ? { x: t2.scrollLeft, y: t2.scrollTop } : { x: window.scrollX || window.pageXOffset, y: window.scrollY || window.pageYOffset };
75033
+ }, o = function(r2) {
75034
+ var e2 = (void 0 === r2 ? [] : r2)[0], o2 = void 0 === e2 ? document.documentElement : e2, n = t([o2, ["transform", "-webkit-transform"]]), u = Object.keys(n).reduce(function(r3, t2) {
75035
+ var e3 = n[t2].value;
75036
+ if (e3) {
75037
+ var o3 = e3.match(/^translate\s*\(\s*(\-?[\d, \.]+)px\s*(,\s*(-?[\d, \.]+)px)?\s*\)/);
75038
+ if (o3) {
75039
+ var u2 = o3[1], a = void 0 !== o3[3] ? o3[3] : 0;
75094
75040
  r3.push({ x: Math.round(-parseFloat(u2)), y: Math.round(-parseFloat(a)) });
75095
75041
  } else
75096
75042
  r3.push({ x: 0, y: 0 });
@@ -75102,293 +75048,375 @@ var require_dist3 = __commonJS({
75102
75048
  }))
75103
75049
  throw new Error("Got different css positions!");
75104
75050
  return u[0] || { x: 0, y: 0 };
75051
+ };
75052
+ return r(function(r2) {
75053
+ var t2 = (void 0 === r2 ? [] : r2)[0], n = e([t2]), u = o([t2]);
75054
+ return { x: n.x + u.x, y: n.y + u.y };
75105
75055
  });
75106
75056
  }();
75107
75057
  return s(arg);
75108
75058
  };
75109
- exports.getElementXpath = function(arg) {
75059
+ exports.getElementFixedAncestor = function(arg) {
75110
75060
  var s = function() {
75111
75061
  "use strict";
75112
- function e(e2) {
75113
- return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
75062
+ function t(t2) {
75063
+ return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
75114
75064
  }
75115
- return e(function(e2) {
75116
- var r = (void 0 === e2 ? [] : e2)[0], t = "", n = r.ownerDocument;
75117
- if (!n)
75118
- return t;
75119
- for (var a = r; a !== n; ) {
75120
- var o = Array.prototype.filter.call(a.parentNode.childNodes, function(e3) {
75121
- return e3.tagName === a.tagName;
75122
- }).indexOf(a);
75123
- t = "/" + a.tagName + "[" + (o + 1) + "]" + t, a = a.parentNode;
75124
- }
75125
- return t;
75065
+ return t(function(t2) {
75066
+ for (var e = (void 0 === t2 ? [] : t2)[0]; e.offsetParent && e.offsetParent !== document.body && e.offsetParent !== document.documentElement; )
75067
+ e = e.offsetParent;
75068
+ return "fixed" === window.getComputedStyle(e).getPropertyValue("position") ? e : null;
75126
75069
  });
75127
75070
  }();
75128
75071
  return s(arg);
75129
75072
  };
75130
- exports.getShadowRoot = function(arg) {
75073
+ exports.getElementContentSize = function(arg) {
75131
75074
  var s = function() {
75132
75075
  "use strict";
75133
75076
  function t(t2) {
75134
75077
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
75135
75078
  }
75079
+ var e = function(t2) {
75080
+ var e2 = void 0 === t2 ? [] : t2, r2 = e2[0], o = e2[1], n = Object.keys(o).sort(), a = n.reduce(function(t3, e3) {
75081
+ return t3[e3] = { value: r2.style.getPropertyValue(e3), important: Boolean(r2.style.getPropertyPriority(e3)) }, t3;
75082
+ }, {});
75083
+ return n.forEach(function(t3) {
75084
+ r2.style.setProperty(t3, "string" != typeof o[t3] && o[t3] ? o[t3].value : o[t3], o[t3] && o[t3].important ? "important" : "");
75085
+ }), a;
75086
+ }, r = function() {
75087
+ var t2 = "HTML", e2 = document.scrollingElement;
75088
+ return e2 && (t2 = e2.tagName), t2.toLowerCase();
75089
+ };
75136
75090
  return t(function(t2) {
75137
- return (void 0 === t2 ? [] : t2)[0].shadowRoot;
75091
+ var o, n = (void 0 === t2 ? [] : t2)[0];
75092
+ n !== document.documentElement && n.tagName.toLowerCase() !== r() || (o = e([n, { transform: "none" }]));
75093
+ var a = { width: n.scrollWidth, height: n.scrollHeight };
75094
+ return o && e([n, o]), a;
75138
75095
  });
75139
75096
  }();
75140
75097
  return s(arg);
75141
75098
  };
75142
- exports.getText = function(arg) {
75099
+ exports.getElementComputedStyleProperties = function(arg) {
75143
75100
  var s = function() {
75144
75101
  "use strict";
75145
75102
  function t(t2) {
75146
75103
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
75147
75104
  }
75148
75105
  return t(function(t2) {
75149
- return t2[0].innerText;
75106
+ var e = void 0 === t2 ? [] : t2, r = e[0], n = e[1], u = void 0 === n ? [] : n, o = window.getComputedStyle(r);
75107
+ return o ? u.map(function(t3) {
75108
+ return o.getPropertyValue(t3);
75109
+ }) : [];
75150
75110
  });
75151
75111
  }();
75152
75112
  return s(arg);
75153
75113
  };
75154
- exports.getUserAgent = function(arg) {
75114
+ exports.getDocumentSize = function(arg) {
75155
75115
  var s = function() {
75156
75116
  "use strict";
75157
- function n(n2) {
75158
- return n2 && n2.__esModule && Object.prototype.hasOwnProperty.call(n2, "default") ? n2.default : n2;
75159
- }
75160
- function t() {
75161
- return t = Object.assign ? Object.assign.bind() : function(n2) {
75162
- for (var t2 = 1; t2 < arguments.length; t2++) {
75163
- var r2 = arguments[t2];
75164
- for (var e2 in r2)
75165
- ({}).hasOwnProperty.call(r2, e2) && (n2[e2] = r2[e2]);
75166
- }
75167
- return n2;
75168
- }, t.apply(null, arguments);
75117
+ function t(t2) {
75118
+ return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
75169
75119
  }
75170
- var r = "__EYES__APPLITOOLS__", e = "userAgent";
75171
- return window[r] = window[r] || {}, n(function() {
75172
- try {
75173
- if (window[r][e]) {
75174
- var n2 = window[r][e];
75175
- return "WIP" !== n2.status && delete window[r][e], JSON.stringify(n2);
75176
- }
75177
- return window.navigator.userAgentData ? (window[r][e] = { status: "WIP" }, window.navigator.userAgentData.getHighEntropyValues(["brands", "platform", "platformVersion", "model"]).then(function(n3) {
75178
- window[r][e] = { status: "SUCCESS", value: t({ legacy: window.navigator.userAgent }, n3) };
75179
- }).catch(function(n3) {
75180
- window[r][e] = { status: "ERROR", error: n3.message };
75181
- })) : window[r][e] = { status: "SUCCESS", value: window.navigator.userAgent }, JSON.stringify(window[r][e]);
75182
- } catch (n3) {
75183
- return window[r][e] = { status: "ERROR", error: n3.message }, JSON.stringify(window[r][e]);
75184
- }
75120
+ return t(function() {
75121
+ var t2 = document.documentElement.scrollWidth, e = document.documentElement.scrollHeight, n = document.documentElement.clientHeight, o = document.body.scrollWidth, c = document.body.scrollHeight, u = document.body.clientHeight;
75122
+ return { width: Math.max(t2, o), height: Math.max(n, e, u, c) };
75185
75123
  });
75186
75124
  }();
75187
75125
  return s(arg);
75188
75126
  };
75189
- exports.getViewport = function(arg) {
75127
+ exports.getDocumentScrollingElement = function(arg) {
75190
75128
  var s = function() {
75191
75129
  "use strict";
75192
- function e(e2) {
75193
- return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
75130
+ function t(t2) {
75131
+ return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
75194
75132
  }
75195
- return e(function() {
75196
- var e2, n = 0, t = 0;
75197
- return window.innerHeight ? t = window.innerHeight : document.documentElement && document.documentElement.clientHeight ? t = document.documentElement.clientHeight : document.body && document.body.clientHeight && (t = document.body.clientHeight), window.innerWidth ? n = window.innerWidth : document.documentElement && document.documentElement.clientWidth ? n = document.documentElement.clientWidth : document.body && document.body.clientWidth && (n = document.body.clientWidth), window.screen && window.screen.orientation ? e2 = window.screen.orientation.type.replace(/-primary$/, "") : null != window.orientation && (0 === window.orientation ? e2 = "portrait" : 180 === window.orientation ? e2 = "portrait-secondary" : 90 === window.orientation ? e2 = "landscape" : -90 === window.orientation && (e2 = "landscape-secondary")), { viewportSize: { width: n, height: t }, pixelRatio: window.devicePixelRatio, viewportScale: window.visualViewport && window.visualViewport.scale, orientation: e2 };
75133
+ return t(function() {
75134
+ var t2 = "HTML", e = document.scrollingElement;
75135
+ return e && (t2 = e.tagName), t2.toLowerCase();
75198
75136
  });
75199
75137
  }();
75200
75138
  return s(arg);
75201
75139
  };
75202
- exports.isElementScrollable = function(arg) {
75140
+ exports.getContextInfo = function(arg) {
75203
75141
  var s = function() {
75204
75142
  "use strict";
75205
75143
  function t(t2) {
75206
75144
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
75207
75145
  }
75208
75146
  var e = function(t2) {
75209
- var e2 = void 0 === t2 ? [] : t2, o = e2[0], r = e2[1], n = void 0 === r ? [] : r, l = window.getComputedStyle(o);
75210
- return l ? n.map(function(t3) {
75211
- return l.getPropertyValue(t3);
75212
- }) : [];
75147
+ var e2 = (void 0 === t2 ? [] : t2)[0], n = "", r = e2.ownerDocument;
75148
+ if (!r)
75149
+ return n;
75150
+ for (var o = e2; o !== r; ) {
75151
+ var a = Array.prototype.filter.call(o.parentNode.childNodes, function(t3) {
75152
+ return t3.tagName === o.tagName;
75153
+ }).indexOf(o);
75154
+ n = "/" + o.tagName + "[" + (a + 1) + "]" + n, o = o.parentNode;
75155
+ }
75156
+ return n;
75213
75157
  };
75214
- return t(function(t2) {
75215
- var o = (void 0 === t2 ? [] : t2)[0], r = e([o, ["overflow-x", "overflow-y", "overflow"]]);
75216
- return ("scroll" === r[0] || "auto" === r[0] || "hidden" === r[2]) && o.scrollWidth > o.clientWidth || ("scroll" === r[1] || "auto" === r[1] || "hidden" === r[2]) && o.scrollHeight > o.clientHeight;
75158
+ return t(function() {
75159
+ var t2, n, r;
75160
+ try {
75161
+ t2 = window.top.document === window.document || "root-context" === window.parent.document["applitools-marker"];
75162
+ } catch (e2) {
75163
+ t2 = false;
75164
+ }
75165
+ try {
75166
+ n = !window.parent.document === window.document;
75167
+ } catch (t3) {
75168
+ n = true;
75169
+ }
75170
+ if (!n)
75171
+ try {
75172
+ r = e([window.frameElement]);
75173
+ } catch (t3) {
75174
+ r = null;
75175
+ }
75176
+ return [document.documentElement, r, t2, n];
75217
75177
  });
75218
75178
  }();
75219
75179
  return s(arg);
75220
75180
  };
75221
- exports.isEqualElements = function(arg) {
75181
+ exports.getChildFramesInfo = function(arg) {
75222
75182
  var s = function() {
75223
75183
  "use strict";
75224
75184
  function t(t2) {
75225
75185
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
75226
75186
  }
75227
- return t(function(t2) {
75228
- var r = void 0 === t2 ? [] : t2;
75229
- return r[0] === r[1];
75187
+ return t(function() {
75188
+ return function t2(r) {
75189
+ r = r || document;
75190
+ var e = [];
75191
+ r.querySelectorAll("frame, iframe").forEach(function(t3) {
75192
+ return e.push([t3, !t3.contentDocument, t3.src]);
75193
+ });
75194
+ var n = Array.prototype.filter.call(r.querySelectorAll("*"), function(t3) {
75195
+ return t3.shadowRoot;
75196
+ }).map(function(r2) {
75197
+ return t2(r2.shadowRoot);
75198
+ });
75199
+ return e.concat.apply(e, n);
75200
+ }();
75230
75201
  });
75231
75202
  }();
75232
75203
  return s(arg);
75233
75204
  };
75234
- exports.isStaleElement = function(arg) {
75205
+ exports.focusElement = function(arg) {
75235
75206
  var s = function() {
75236
75207
  "use strict";
75237
- function n(n2) {
75238
- return n2 && n2.__esModule && Object.prototype.hasOwnProperty.call(n2, "default") ? n2.default : n2;
75208
+ function t(t2) {
75209
+ return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
75239
75210
  }
75240
- return n(function(n2) {
75241
- var e = n2 && n2[0] || null;
75242
- return !e || ("isConnected" in window.Node.prototype ? !e.isConnected : document.documentElement.contains ? !document.documentElement.contains(e) : !e.ownerDocument.documentElement.contains(e));
75211
+ return t(function(t2) {
75212
+ var e = (void 0 === t2 ? [] : t2)[0];
75213
+ e && e.focus();
75243
75214
  });
75244
75215
  }();
75245
75216
  return s(arg);
75246
75217
  };
75247
- exports.lazyLoad = function(arg) {
75218
+ exports.cleanupPageMarker = function(arg) {
75248
75219
  var s = function() {
75249
75220
  "use strict";
75250
75221
  function t(t2) {
75251
75222
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
75252
75223
  }
75253
- var o = function(t2) {
75254
- var o2 = (void 0 === t2 ? [] : t2)[0];
75255
- return o2 ? { x: o2.scrollLeft, y: o2.scrollTop } : { x: window.scrollX || window.pageXOffset, y: window.scrollY || window.pageYOffset };
75256
- };
75257
- var r = function(t2) {
75258
- var o2 = void 0 === t2 ? [] : t2, r2 = o2[0], n2 = o2[1], e2 = Object.keys(n2).sort(), i2 = e2.reduce(function(t3, o3) {
75259
- return t3[o3] = { value: r2.style.getPropertyValue(o3), important: Boolean(r2.style.getPropertyPriority(o3)) }, t3;
75224
+ var e = function(t2) {
75225
+ var e2 = void 0 === t2 ? [] : t2, r = e2[0], o = e2[1], n = Object.keys(o).sort(), a = n.reduce(function(t3, e3) {
75226
+ return t3[e3] = { value: r.style.getPropertyValue(e3), important: Boolean(r.style.getPropertyPriority(e3)) }, t3;
75260
75227
  }, {});
75261
- return e2.forEach(function(t3) {
75262
- r2.style.setProperty(t3, "string" != typeof n2[t3] && n2[t3] ? n2[t3].value : n2[t3], n2[t3] && n2[t3].important ? "important" : "");
75263
- }), i2;
75228
+ return n.forEach(function(t3) {
75229
+ r.style.setProperty(t3, "string" != typeof o[t3] && o[t3] ? o[t3].value : o[t3], o[t3] && o[t3].important ? "important" : "");
75230
+ }), a;
75264
75231
  };
75265
- var n = function(t2) {
75266
- var o2 = void 0 === t2 ? [] : t2, n2 = o2[0], e2 = o2[1];
75267
- n2 = n2 || document.documentElement;
75268
- var i2 = r([n2, { "scroll-behavior": { value: "auto", important: true } }]);
75269
- return n2.scrollTo ? n2.scrollTo(e2.x, e2.y) : (n2.scrollLeft = e2.x, n2.scrollTop = e2.y), r([n2, i2]), { x: n2.scrollLeft, y: n2.scrollTop };
75270
- }, e = "__EYES__APPLITOOLS__", i = "lazyLoadResult";
75271
- window[e] = window[e] || {};
75272
- var l = o, a = n;
75273
- return t(function(t2) {
75274
- var o2 = void 0 === t2 ? [] : t2, r2 = o2[0], n2 = o2[1], s2 = void 0 === n2 ? {} : n2, u = s2.scrollLength, c = s2.waitingTime, w = s2.maxAmountToScroll;
75275
- try {
75276
- if (window[e][i]) {
75277
- var d = window[e][i];
75278
- return "WIP" !== d.status && delete window[e][i], JSON.stringify(d);
75279
- }
75280
- window[e][i] = { status: "WIP" };
75281
- var v = l(), y = [];
75282
- y.push({ maxAmountToScroll: w, scrollLength: u, waitingTime: c, startingScrollPositionX: v.x, startingScrollPositionY: v.y });
75283
- var f = Date.now();
75284
- return function t3(o3) {
75285
- var n3 = void 0 === o3 ? {} : o3, l2 = n3.doneScrolling, s3 = n3.previousScrollResult, d2 = void 0 === s3 ? {} : s3;
75286
- setTimeout(function() {
75287
- try {
75288
- if (l2) {
75289
- var o4 = a([r2, v]), n4 = o4.x, s4 = o4.y;
75290
- return y.push({ x: n4, y: s4, msSinceStart: Date.now() - f }), void (window[e][i] = { status: "SUCCESS", value: y });
75291
- }
75292
- var c2 = a([r2, { x: v.x, y: d2.y + u }]), p = c2.x, S = c2.y;
75293
- y.push({ x: p, y: S, msSinceStart: Date.now() - f }), t3({ doneScrolling: S === d2.y || S === w, previousScrollResult: { x: p, y: S } });
75294
- } catch (t4) {
75295
- window[e][i] = { status: "ERROR", error: t4 };
75296
- }
75297
- }, c);
75298
- }(), JSON.stringify(window[e][i]);
75299
- } catch (t3) {
75300
- return window[e][i] = { status: "ERROR", error: t3 }, JSON.stringify(window[e][i]);
75301
- }
75232
+ return t(function() {
75233
+ var t2 = document.querySelector("[data-applitools-marker]");
75234
+ t2 && document.body.removeChild(t2);
75235
+ var r = document.documentElement.getAttribute("data-applitools-original-transforms"), o = document.body.getAttribute("data-applitools-original-transforms");
75236
+ r && e([document.documentElement, JSON.parse(r)]), o && e([document.body, JSON.parse(o)]);
75302
75237
  });
75303
75238
  }();
75304
75239
  return s(arg);
75305
75240
  };
75306
- exports.reloadPage = function(arg) {
75241
+ exports.cleanupElementIds = function(arg) {
75307
75242
  var s = function() {
75308
75243
  "use strict";
75309
75244
  function t(t2) {
75310
75245
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
75311
75246
  }
75312
- return t(function() {
75313
- window.location.reload();
75247
+ return t(function(t2) {
75248
+ (t2 = t2 && t2[0]) && "function" == typeof t2.forEach && t2.forEach(function(t3) {
75249
+ t3.removeAttribute("data-applitools-selector");
75250
+ var o = t3;
75251
+ if (o.getRootNode)
75252
+ try {
75253
+ for (; o; ) {
75254
+ var e = o.getRootNode();
75255
+ if (!e)
75256
+ break;
75257
+ (o = e.constructor && "ShadowRoot" === e.constructor.name ? e.host : e.defaultView ? e.defaultView.frameElement : null) && o.removeAttribute("data-applitools-selector");
75258
+ }
75259
+ } catch (t4) {
75260
+ }
75261
+ });
75314
75262
  });
75315
75263
  }();
75316
75264
  return s(arg);
75317
75265
  };
75318
- exports.scrollTo = function(arg) {
75266
+ exports.blurElement = function(arg) {
75319
75267
  var s = function() {
75320
75268
  "use strict";
75321
75269
  function t(t2) {
75322
75270
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
75323
75271
  }
75324
- var r = function(t2) {
75325
- var r2 = void 0 === t2 ? [] : t2, o = r2[0], e = r2[1], l = Object.keys(e).sort(), n = l.reduce(function(t3, r3) {
75326
- return t3[r3] = { value: o.style.getPropertyValue(r3), important: Boolean(o.style.getPropertyPriority(r3)) }, t3;
75327
- }, {});
75328
- return l.forEach(function(t3) {
75329
- o.style.setProperty(t3, "string" != typeof e[t3] && e[t3] ? e[t3].value : e[t3], e[t3] && e[t3].important ? "important" : "");
75330
- }), n;
75331
- };
75332
75272
  return t(function(t2) {
75333
- var o = void 0 === t2 ? [] : t2, e = o[0], l = o[1];
75334
- e = e || document.documentElement;
75335
- var n = r([e, { "scroll-behavior": { value: "auto", important: true } }]);
75336
- return e.scrollTo ? e.scrollTo(l.x, l.y) : (e.scrollLeft = l.x, e.scrollTop = l.y), r([e, n]), { x: e.scrollLeft, y: e.scrollTop };
75273
+ var e = (void 0 === t2 ? [] : t2)[0] || document.activeElement;
75274
+ return e && e.blur(), e;
75337
75275
  });
75338
75276
  }();
75339
75277
  return s(arg);
75340
75278
  };
75341
- exports.setElementAttributes = function(arg) {
75279
+ exports.addPageMarker = function(arg) {
75342
75280
  var s = function() {
75343
75281
  "use strict";
75344
75282
  function t(t2) {
75345
75283
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
75346
75284
  }
75347
- return t(function(t2) {
75348
- var e = void 0 === t2 ? [] : t2, r = e[0], u = e[1];
75349
- return Object.keys(u).reduce(function(t3, e2) {
75350
- return t3[e2] = r.getAttribute(e2), r.setAttribute(e2, u[e2]), t3;
75285
+ var e = function(t2) {
75286
+ var e2 = void 0 === t2 ? [] : t2, r = e2[0], o = e2[1], n = Object.keys(o).sort(), a = n.reduce(function(t3, e3) {
75287
+ return t3[e3] = { value: r.style.getPropertyValue(e3), important: Boolean(r.style.getPropertyPriority(e3)) }, t3;
75351
75288
  }, {});
75289
+ return n.forEach(function(t3) {
75290
+ r.style.setProperty(t3, "string" != typeof o[t3] && o[t3] ? o[t3].value : o[t3], o[t3] && o[t3].important ? "important" : "");
75291
+ }), a;
75292
+ };
75293
+ return t(function(t2) {
75294
+ var r = t2[0], o = r.mask, n = r.size, a = void 0 === n ? 1 : n, i = { 1: "rgb(0, 0, 0)", 0: "rgb(255, 255, 255)" }, s2 = a, p = document.createElement("div");
75295
+ p.setAttribute("data-applitools-marker", ""), p.style.setProperty("position", "fixed", "important"), p.style.setProperty("top", "0", "important"), p.style.setProperty("left", "0", "important"), p.style.setProperty("box-sizing", "content-box", "important"), p.style.setProperty("padding", s2 + "px", "important"), p.style.setProperty("background", "rgb(128, 128, 128)", "important"), p.style.setProperty("z-index", "2147483647", "important");
75296
+ for (var l, y = 0; y < o.length; y += l) {
75297
+ for (l = 1; o[y] === o[y + l]; )
75298
+ ++l;
75299
+ var m = o[y], d = document.createElement("div");
75300
+ d.style.setProperty("display", "block", "important"), d.style.setProperty("float", "left", "important"), d.style.setProperty("width", l * a + "px", "important"), d.style.setProperty("height", a + "px", "important"), d.style.setProperty("background", i[m], "important"), p.appendChild(d);
75301
+ }
75302
+ var u = { value: "none", important: true }, c = e([document.documentElement, { transform: u, "-webkit-transform": u }]), f = e([document.body, { transform: u, "-webkit-transform": u }]);
75303
+ return document.documentElement.setAttribute("data-applitools-original-transforms", JSON.stringify(c)), document.body.setAttribute("data-applitools-original-transforms", JSON.stringify(f)), document.body.appendChild(p), { mask: o, size: a, offset: s2 };
75352
75304
  });
75353
75305
  }();
75354
75306
  return s(arg);
75355
75307
  };
75356
- exports.setElementStyleProperties = function(arg) {
75308
+ exports.addFallbackSelectorIfNeeded = function(arg) {
75357
75309
  var s = function() {
75358
75310
  "use strict";
75359
75311
  function t(t2) {
75360
75312
  return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
75361
75313
  }
75314
+ var e = function(t2) {
75315
+ var e2 = t2 && t2[0] || null;
75316
+ return !e2 || ("isConnected" in window.Node.prototype ? !e2.isConnected : document.documentElement.contains ? !document.documentElement.contains(e2) : !e2.ownerDocument.documentElement.contains(e2));
75317
+ };
75362
75318
  return t(function(t2) {
75363
- var e = void 0 === t2 ? [] : t2, r = e[0], o = e[1], n = Object.keys(o).sort(), u = n.reduce(function(t3, e2) {
75364
- return t3[e2] = { value: r.style.getPropertyValue(e2), important: Boolean(r.style.getPropertyPriority(e2)) }, t3;
75365
- }, {});
75366
- return n.forEach(function(t3) {
75367
- r.style.setProperty(t3, "string" != typeof o[t3] && o[t3] ? o[t3].value : o[t3], o[t3] && o[t3].important ? "important" : "");
75368
- }), u;
75319
+ if (!t2.hasAttribute("data-applitools-fallback-selector")) {
75320
+ if (e([t2]))
75321
+ throw new Error("The element is not connected to the DOM: " + function(t3) {
75322
+ var e2 = t3.attributes, n = t3.tagName, o = t3.children.length, r = [].slice.call(e2).map(function(t4) {
75323
+ return t4.name + '="' + t4.value + '"';
75324
+ }).join(" ");
75325
+ return "<" + n + " " + r + (o ? ">" : "/>");
75326
+ }(t2));
75327
+ t2.setAttribute("data-applitools-fallback-selector", function(t3) {
75328
+ var e2 = [];
75329
+ for (; t3 && t3.nodeType === Node.ELEMENT_NODE; )
75330
+ try {
75331
+ var n, o = t3.tagName.toLowerCase(), r = [].slice.call((null == (n = t3.parentNode) ? void 0 : n.children) || []).indexOf(t3);
75332
+ r > -1 && (o += ":nth-child(" + (r + 1) + ")"), e2.unshift(o), t3 = t3.parentNode;
75333
+ } catch (t4) {
75334
+ break;
75335
+ }
75336
+ return e2.length ? e2.join(" > ") : "html";
75337
+ }(t2));
75338
+ }
75369
75339
  });
75370
75340
  }();
75371
75341
  return s(arg);
75372
75342
  };
75373
- exports.translateTo = function(arg) {
75343
+ exports.addElementIds = function(arg) {
75374
75344
  var s = function() {
75375
75345
  "use strict";
75376
- function t(t2) {
75377
- return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2;
75346
+ function e(e2) {
75347
+ return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
75378
75348
  }
75379
- var r = function(t2) {
75380
- var r2 = void 0 === t2 ? [] : t2, e = r2[0], n = r2[1], o = Object.keys(n).sort(), a = o.reduce(function(t3, r3) {
75381
- return t3[r3] = { value: e.style.getPropertyValue(r3), important: Boolean(e.style.getPropertyPriority(r3)) }, t3;
75382
- }, {});
75383
- return o.forEach(function(t3) {
75384
- e.style.setProperty(t3, "string" != typeof n[t3] && n[t3] ? n[t3].value : n[t3], n[t3] && n[t3].important ? "important" : "");
75385
- }), a;
75386
- };
75387
- return t(function(t2) {
75388
- var e = void 0 === t2 ? [] : t2, n = e[0], o = e[1];
75389
- n = n || document.documentElement;
75390
- var a = { value: "translate(" + -o.x + "px, " + -o.y + "px)", important: true };
75391
- return r([n, { transform: a, "-webkit-transform": a }]), o;
75349
+ var t = function(e2) {
75350
+ var t2 = e2 && e2[0] || null;
75351
+ return !t2 || ("isConnected" in window.Node.prototype ? !t2.isConnected : document.documentElement.contains ? !document.documentElement.contains(t2) : !t2.ownerDocument.documentElement.contains(t2));
75352
+ }, r = t;
75353
+ var n = function(e2) {
75354
+ if (!e2.hasAttribute("data-applitools-fallback-selector")) {
75355
+ if (r([e2]))
75356
+ throw new Error("The element is not connected to the DOM: " + function(e3) {
75357
+ var t2 = e3.attributes, r2 = e3.tagName, n2 = e3.children.length, o2 = [].slice.call(t2).map(function(e4) {
75358
+ return e4.name + '="' + e4.value + '"';
75359
+ }).join(" ");
75360
+ return "<" + r2 + " " + o2 + (n2 ? ">" : "/>");
75361
+ }(e2));
75362
+ e2.setAttribute("data-applitools-fallback-selector", function(e3) {
75363
+ var t2 = [];
75364
+ for (; e3 && e3.nodeType === Node.ELEMENT_NODE; )
75365
+ try {
75366
+ var r2, n2 = e3.tagName.toLowerCase(), o2 = [].slice.call((null == (r2 = e3.parentNode) ? void 0 : r2.children) || []).indexOf(e3);
75367
+ o2 > -1 && (n2 += ":nth-child(" + (o2 + 1) + ")"), t2.unshift(n2), e3 = e3.parentNode;
75368
+ } catch (e4) {
75369
+ break;
75370
+ }
75371
+ return t2.length ? t2.join(" > ") : "html";
75372
+ }(e2));
75373
+ }
75374
+ }, o = t;
75375
+ function a(e2, t2) {
75376
+ if (o([e2])) {
75377
+ var r2 = function(e3) {
75378
+ if (null == e3 || !e3.getAttribute)
75379
+ return { error: "invalid element: " + JSON.stringify(e3) };
75380
+ var t3 = e3.getAttribute("data-applitools-fallback-selector");
75381
+ return t3;
75382
+ }(e2);
75383
+ if (!r2)
75384
+ return { error: "Failed to recover from stale element" };
75385
+ if (r2.error)
75386
+ return r2;
75387
+ var l = document.querySelectorAll(r2);
75388
+ if (!l || 1 !== l.length)
75389
+ return { error: "Failed to recover from stale element - selector found: " + r2 };
75390
+ var i = l[0];
75391
+ return i.setAttribute("data-applitools-selector", t2), i.setAttribute("data-applitools-recovered", true), a(i, t2);
75392
+ }
75393
+ n(e2);
75394
+ var u = e2.getAttribute("data-applitools-selector"), c = u ? u + " " + t2 : t2;
75395
+ return e2.setAttribute("data-applitools-selector", c), '[data-applitools-selector~="' + t2 + '"]';
75396
+ }
75397
+ return e(function(e2) {
75398
+ return e2.map(function(e3) {
75399
+ var t2 = e3[0], r2 = e3[1];
75400
+ return t2.map(function(e4) {
75401
+ var t3 = function(e5) {
75402
+ var t4 = [{ element: e5, kind: "root" }], r3 = /* @__PURE__ */ new Set([e5]), n2 = e5;
75403
+ for (; n2; ) {
75404
+ var o2, a2 = n2.getRootNode && n2.getRootNode();
75405
+ if (!a2)
75406
+ break;
75407
+ if (a2.constructor && "ShadowRoot" === a2.constructor.name ? (n2 = a2.host, o2 = "shadow") : (n2 = a2.defaultView ? a2.defaultView.frameElement : null, o2 = "frame"), n2) {
75408
+ if (r3.has(n2))
75409
+ break;
75410
+ r3.add(n2), t4.push({ element: n2, kind: o2 });
75411
+ }
75412
+ }
75413
+ return t4;
75414
+ }(e4);
75415
+ return t3.map(function(e5) {
75416
+ return { selector: a(e5.element, r2), kind: e5.kind };
75417
+ });
75418
+ });
75419
+ });
75392
75420
  });
75393
75421
  }();
75394
75422
  return s(arg);
@@ -80803,7 +80831,7 @@ ${l2}`}`, { bundledCss: u2, unfetchedResources: i2 };
80803
80831
  return m3 && (k2.shadowRoot = m3), k2;
80804
80832
  }
80805
80833
  }(t4);
80806
- f2(l2.doCaptureDoc), d2(l2.waitForImages), await Promise.all(m2), f2(l2.waitForImages), N2.version = "1.4.0", N2.scriptVersion = "11.7.0";
80834
+ f2(l2.doCaptureDoc), d2(l2.waitForImages), await Promise.all(m2), f2(l2.waitForImages), N2.version = "1.4.0", N2.scriptVersion = "11.7.1";
80807
80835
  const A2 = p2.length ? `${p2.join("\n")}
80808
80836
  ` : "", P2 = h2.size ? `${Array.from(h2).join("\n")}
80809
80837
  ` : "", v2 = JSON.stringify({ separator: w2, cssStartToken: y2, cssEndToken: y2, iframeStartToken: `"${g2}`, iframeEndToken: `${g2}"` });
@@ -87750,7 +87778,7 @@ var require_captureDomPollForIE = __commonJS({
87750
87778
  case 24:
87751
87779
  return L2 = e5.sent, A2(E2.prefetchCss), j2 = N0({ parseCss: U0, CSSImportRule, getCssFromCache: L2, absolutizeUrl: L0, unfetchedToken: P2 }), k2 = B0({ getCssFromCache: L2, absolutizeUrl: L0 }), C2 = z0({ extractCssFromNode: k2, getBundledCssFromCssText: j2, unfetchedToken: P2 }), S2(E2.doCaptureDoc), M2 = H2(i3), A2(E2.doCaptureDoc), S2(E2.waitForImages), e5.next = 35, Promise.all(O2);
87752
87780
  case 35:
87753
- return A2(E2.waitForImages), M2.version = "1.4.0", M2.scriptVersion = "11.7.0", N2 = T2.length ? T2.join("\n") + "\n" : "", U2 = x2.size ? Array.from(x2).join("\n") + "\n" : "", D2 = JSON.stringify({ separator: _2, cssStartToken: P2, cssEndToken: P2, iframeStartToken: '"' + R2, iframeEndToken: R2 + '"' }), A2(E2.total), B2 = JSON.stringify(M2), z2 = D2 + "\n" + U2 + _2 + "\n" + N2 + _2 + "\n" + ("string" == typeof B2 ? B2 : G0(M2)) + F2(), console.log("[captureFrame]", JSON.stringify(E2)), e5.abrupt("return", z2);
87781
+ return A2(E2.waitForImages), M2.version = "1.4.0", M2.scriptVersion = "11.7.1", N2 = T2.length ? T2.join("\n") + "\n" : "", U2 = x2.size ? Array.from(x2).join("\n") + "\n" : "", D2 = JSON.stringify({ separator: _2, cssStartToken: P2, cssEndToken: P2, iframeStartToken: '"' + R2, iframeEndToken: R2 + '"' }), A2(E2.total), B2 = JSON.stringify(M2), z2 = D2 + "\n" + U2 + _2 + "\n" + N2 + _2 + "\n" + ("string" == typeof B2 ? B2 : G0(M2)) + F2(), console.log("[captureFrame]", JSON.stringify(E2)), e5.abrupt("return", z2);
87754
87782
  case 46:
87755
87783
  case "end":
87756
87784
  return e5.stop();
@@ -102606,7 +102634,7 @@ creating temp style for access.`), r3 = Yh(e3);
102606
102634
  function F2(e3) {
102607
102635
  return n4.defaultView && n4.defaultView.frameElement && n4.defaultView.frameElement.getAttribute(e3);
102608
102636
  }
102609
- }(t3).then((e3) => (p2.log("processPage end"), e3.scriptVersion = "4.16.3", e3));
102637
+ }(t3).then((e3) => (p2.log("processPage end"), e3.scriptVersion = "4.16.4", e3));
102610
102638
  }, window[x], "domSnapshotResult");
102611
102639
  return function(e3) {
102612
102640
  try {
@@ -103451,7 +103479,7 @@ var require_to_generated_selectors = __commonJS({
103451
103479
  init_setInterval();
103452
103480
  Object.defineProperty(exports, "__esModule", { value: true });
103453
103481
  exports.toGeneratedSelectors = void 0;
103454
- function toGeneratedSelectors({ elementReferences, logger }) {
103482
+ function toGeneratedSelectors({ elementReferences, logger, logDeprecations }) {
103455
103483
  var _a, _b, _c;
103456
103484
  const elementReferencesToMark = [
103457
103485
  (_a = elementReferences.target) !== null && _a !== void 0 ? _a : [],
@@ -103498,6 +103526,9 @@ var require_to_generated_selectors = __commonJS({
103498
103526
  safeSelector: isError ? null : safeSelector
103499
103527
  };
103500
103528
  });
103529
+ } else if (target || scrolling || calculate.length) {
103530
+ logDeprecations("toGeneratedSelectors: `transformElementReference` was unexpectedly called.");
103531
+ throw new Error("toGeneratedSelectors: `transformElementReference` was unexpectedly called.");
103501
103532
  }
103502
103533
  return { target, scrolling, calculate };
103503
103534
  }
@@ -103588,7 +103619,8 @@ var require_take_snapshots2 = __commonJS({
103588
103619
  const { elementReferences, getSafeCheckSettings } = (0, to_safe_check_settings_1.toSafeCheckSettings)({ settings });
103589
103620
  const { elementReferencesToMark, getGeneratedSelectors } = (0, to_generated_selectors_1.toGeneratedSelectors)({
103590
103621
  elementReferences,
103591
- logger
103622
+ logger,
103623
+ logDeprecations
103592
103624
  });
103593
103625
  let snapshots;
103594
103626
  if (environment.isWeb) {
@@ -103636,6 +103668,7 @@ var require_take_snapshots2 = __commonJS({
103636
103668
  }
103637
103669
  }
103638
103670
  } else {
103671
+ logDeprecations("takeSnapshots: taking native snapshots is no longer supported. How did you reach this message? (dead code)");
103639
103672
  throw new Error("Taking native (non-web) snapshots via VisualGridRunner is no longer supported. Please use ClassicRunner for native apps.");
103640
103673
  }
103641
103674
  await currentContext.focus();
@@ -103671,6 +103704,19 @@ var require_take_snapshots2 = __commonJS({
103671
103704
  title,
103672
103705
  userAgent
103673
103706
  }));
103707
+ function logDeprecations(...args) {
103708
+ core.logEvent({
103709
+ settings: {
103710
+ level: "Error",
103711
+ event: {
103712
+ type: "SDK.unreachableCodeReached",
103713
+ message: args.join(" ")
103714
+ },
103715
+ ...account.eyesServer
103716
+ },
103717
+ logger
103718
+ });
103719
+ }
103674
103720
  };
103675
103721
  }
103676
103722
  exports.makeTakeSnapshots = makeTakeSnapshots;
@@ -103735,6 +103781,7 @@ var require_req_ufg = __commonJS({
103735
103781
  },
103736
103782
  proxy: settings.proxy,
103737
103783
  useDnsCache: settings.useDnsCache,
103784
+ httpVersion: settings.httpVersion,
103738
103785
  connectionTimeout: (_a = settings.connectionTimeout) !== null && _a !== void 0 ? _a : 3e5,
103739
103786
  requestTimeout: {
103740
103787
  base: 3e4,
@@ -118123,6 +118170,8 @@ var require_dom = __commonJS({
118123
118170
  }
118124
118171
  do {
118125
118172
  newFirst.parentNode = parent;
118173
+ var targetDoc = parent.ownerDocument || parent;
118174
+ _updateOwnerDocument(newFirst, targetDoc);
118126
118175
  } while (newFirst !== newLast && (newFirst = newFirst.nextSibling));
118127
118176
  _onUpdateChild(parent.ownerDocument || parent, parent);
118128
118177
  if (node.nodeType == DOCUMENT_FRAGMENT_NODE) {
@@ -118130,6 +118179,25 @@ var require_dom = __commonJS({
118130
118179
  }
118131
118180
  return node;
118132
118181
  }
118182
+ function _updateOwnerDocument(node, newOwnerDocument) {
118183
+ if (node.ownerDocument === newOwnerDocument) {
118184
+ return;
118185
+ }
118186
+ node.ownerDocument = newOwnerDocument;
118187
+ if (node.nodeType === ELEMENT_NODE && node.attributes) {
118188
+ for (var i = 0; i < node.attributes.length; i++) {
118189
+ var attr = node.attributes.item(i);
118190
+ if (attr) {
118191
+ attr.ownerDocument = newOwnerDocument;
118192
+ }
118193
+ }
118194
+ }
118195
+ var child = node.firstChild;
118196
+ while (child) {
118197
+ _updateOwnerDocument(child, newOwnerDocument);
118198
+ child = child.nextSibling;
118199
+ }
118200
+ }
118133
118201
  function _appendSingleChild(parentNode, newChild) {
118134
118202
  if (newChild.parentNode) {
118135
118203
  newChild.parentNode.removeChild(newChild);
@@ -118144,6 +118212,8 @@ var require_dom = __commonJS({
118144
118212
  }
118145
118213
  parentNode.lastChild = newChild;
118146
118214
  _onUpdateChild(parentNode.ownerDocument, parentNode, newChild);
118215
+ var targetDoc = parentNode.ownerDocument || parentNode;
118216
+ _updateOwnerDocument(newChild, targetDoc);
118147
118217
  return newChild;
118148
118218
  }
118149
118219
  Document2.prototype = {
@@ -118170,7 +118240,7 @@ var require_dom = __commonJS({
118170
118240
  return newChild;
118171
118241
  }
118172
118242
  _insertBefore(this, newChild, refChild);
118173
- newChild.ownerDocument = this;
118243
+ _updateOwnerDocument(newChild, this);
118174
118244
  if (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {
118175
118245
  this.documentElement = newChild;
118176
118246
  }
@@ -118184,7 +118254,7 @@ var require_dom = __commonJS({
118184
118254
  },
118185
118255
  replaceChild: function(newChild, oldChild) {
118186
118256
  _insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);
118187
- newChild.ownerDocument = this;
118257
+ _updateOwnerDocument(newChild, this);
118188
118258
  if (oldChild) {
118189
118259
  this.removeChild(oldChild);
118190
118260
  }
@@ -118280,7 +118350,22 @@ var require_dom = __commonJS({
118280
118350
  node.appendData(data);
118281
118351
  return node;
118282
118352
  },
118353
+ /**
118354
+ * Returns a new CDATASection node whose data is `data`.
118355
+ *
118356
+ * __This implementation differs from the specification:__
118357
+ * - calling this method on an HTML document does not throw `NotSupportedError`.
118358
+ *
118359
+ * @param {string} data
118360
+ * @returns {CDATASection}
118361
+ * @throws DOMException with code `INVALID_CHARACTER_ERR` if `data` contains `"]]>"`.
118362
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createCDATASection
118363
+ * @see https://dom.spec.whatwg.org/#dom-document-createcdatasection
118364
+ */
118283
118365
  createCDATASection: function(data) {
118366
+ if (data.indexOf("]]>") !== -1) {
118367
+ throw new DOMException2(INVALID_CHARACTER_ERR, 'data contains "]]>"');
118368
+ }
118284
118369
  var node = new CDATASection();
118285
118370
  node.ownerDocument = this;
118286
118371
  node.appendData(data);
@@ -118683,7 +118768,7 @@ var require_dom = __commonJS({
118683
118768
  node.data.replace(/[<&>]/g, _xmlEncoder)
118684
118769
  );
118685
118770
  case CDATA_SECTION_NODE:
118686
- return buf.push("<![CDATA[", node.data, "]]>");
118771
+ return buf.push("<![CDATA[", node.data.replace(/]]>/g, "]]]]><![CDATA[>"), "]]>");
118687
118772
  case COMMENT_NODE:
118688
118773
  return buf.push("<!--", node.data, "-->");
118689
118774
  case DOCUMENT_TYPE_NODE:
@@ -121511,7 +121596,7 @@ var require_sax = __commonJS({
121511
121596
  function parseInstruction(source, start, domBuilder) {
121512
121597
  var end = source.indexOf("?>", start);
121513
121598
  if (end) {
121514
- var match = source.substring(start, end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);
121599
+ var match = source.substring(start, end).match(/^<\?(\S*)\s*([\s\S]*?)$/);
121515
121600
  if (match) {
121516
121601
  var len = match[0].length;
121517
121602
  domBuilder.processingInstruction(match[1], match[2]);
@@ -125093,7 +125178,7 @@ var require_get_base_eyes2 = __commonJS({
125093
125178
  });
125094
125179
  return getBaseEyesWithCache;
125095
125180
  async function getBaseEyes({ settings, logger = mainLogger }) {
125096
- var _a;
125181
+ var _a, _b;
125097
125182
  logger = logger.extend(mainLogger);
125098
125183
  logger.log(`Command "getBaseEyes" is called with settings`, settings);
125099
125184
  const ufgClient = await eyes2.core.getUFGClient({
@@ -125111,7 +125196,7 @@ var require_get_base_eyes2 = __commonJS({
125111
125196
  const baseEyes = await eyes2.core.base.openEyes({
125112
125197
  settings: {
125113
125198
  ...defaultSettings,
125114
- fallbackBaselineId: (_a = settings.environment) === null || _a === void 0 ? void 0 : _a.fallbackBaselineId,
125199
+ fallbackBaselineId: (_b = (_a = settings.environment) === null || _a === void 0 ? void 0 : _a.fallbackBaselineId) !== null && _b !== void 0 ? _b : defaultSettings.fallbackBaselineId,
125115
125200
  environment: {
125116
125201
  ...defaultSettings.environment,
125117
125202
  ...environment,
@@ -126070,7 +126155,8 @@ var require_populate_eyes_server_settings = __commonJS({
126070
126155
  eyesServerUrl: settings.eyesServerUrl,
126071
126156
  apiKey: settings.apiKey,
126072
126157
  proxy: settings.proxy,
126073
- useDnsCache: settings.useDnsCache
126158
+ useDnsCache: settings.useDnsCache,
126159
+ httpVersion: settings.httpVersion
126074
126160
  };
126075
126161
  }
126076
126162
  exports.populateEyesServerSettings = populateEyesServerSettings;
@@ -128224,7 +128310,7 @@ var require_package3 = __commonJS({
128224
128310
  "../core/package.json"(exports, module) {
128225
128311
  module.exports = {
128226
128312
  name: "@applitools/core",
128227
- version: "4.59.2",
128313
+ version: "4.60.0",
128228
128314
  homepage: "https://applitools.com",
128229
128315
  bugs: {
128230
128316
  url: "https://github.com/applitools/eyes.sdk.javascript1/issues"
@@ -129766,7 +129852,7 @@ var require_package4 = __commonJS({
129766
129852
  "../eyes/package.json"(exports, module) {
129767
129853
  module.exports = {
129768
129854
  name: "@applitools/eyes",
129769
- version: "1.38.14",
129855
+ version: "1.39.0",
129770
129856
  keywords: [
129771
129857
  "applitools",
129772
129858
  "eyes",
@@ -131381,7 +131467,7 @@ var require_package5 = __commonJS({
131381
131467
  "package.json"(exports, module) {
131382
131468
  module.exports = {
131383
131469
  name: "@applitools/eyes-browser",
131384
- version: "1.6.11",
131470
+ version: "1.6.13",
131385
131471
  type: "module",
131386
131472
  keywords: [
131387
131473
  "applitools",