Socket
Socket
Sign inDemoInstall

@applitools/dom-capture

Package Overview
Dependencies
2
Maintainers
34
Versions
90
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 11.2.0 to 11.2.1

3

CHANGELOG.md

@@ -6,3 +6,6 @@

## 11.2.1 - 2023/1/26
get elements style from current window to resolve empty styles in firefox
## 11.2.0 - 2022/10/4

@@ -9,0 +12,0 @@

6

dist/captureDom.js

@@ -1,8 +0,8 @@

/* @applitools/dom-capture@11.2.0 */
/* @applitools/dom-capture@11.2.1 */
function __captureDom() {
var captureDom=function(){"use strict";var e=function(){const e=function(e){return function(){function t(e,t=0){const n=e.charCodeAt(t);return n>=55296&&n<56320?1024*(n-55296)+(e.charCodeAt(t+1)-56320)+65536:56320<=n&&n<=57343?-1:n}var n=function(e,n){const o=[];let r=0;for(let s=0;s<e.length;++s){const a=t(e,s);let c=0;a>0&&(c=a<128?1:a<2048?2:a<65536?3:a<2097152?4:a<67108864?5:6),r+c>n?(o.push(s),r=c):r+=c}return o};const o=n,r="SUCCESS",s="SUCCESS_CHUNKED",a="ERROR";var c=function(e,t,n={}){const c=function(e,{chunkByteLength:t=0}={}){if(e){if(e.value){if(t){if(!e.chunks){const n=JSON.stringify(e.value);e.chunks=o(n,t),e.chunks.length>0&&(e.from=0,e.value=n)}if(e.from>=0)return{status:s,value:e.value.substring(e.from,e.from=e.chunks.shift()),done:!e.from}}return{status:r,value:e.value}}return e.error?{status:a,error:e.error}:{status:"WIP"}}return{status:a,error:"unexpected poll request received - cannot find state of current operation"}}((e=e||{})[t],n);return(c.status===r||c.status===a||c.status===s&&c.done)&&(e[t]=null),c};const i=c;var u={chunkify:n,pollify:function(e,t,n){return o=>function(){return t[n]||(t[n]={},e.apply(null,arguments).then((e=>t[n].value=e)).catch((e=>t[n].error=e.message))),i(t,n,o)}},poll:c,absolutizeUrl:function(e,t){return new URL(e,t).href},isInlineFrame:function(e){return e.contentDocument&&e.contentDocument.location&&!/^https?:$/.test(e.contentDocument.location.protocol)},isAccessibleFrame:function(e){try{const t=e.contentDocument;return Boolean(t&&t.defaultView&&t.defaultView.frameElement)}catch(e){return!1}}};const l=/url\((?!['"]?:)['"]?([^'")]*)['"]?\)/;var d={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_CAPTURE_KEY:"domCaptureResult",NODE_TYPES:{ELEMENT:1,TEXT:3,DOCUMENT_FRAGMENT:11},DEFAULT_STYLE_PROPS:["background-repeat","background-origin","background-position","background-color","background-image","background-size","border-width","border-color","border-style","color","display","font-size","font-weight","line-height","margin","opacity","overflow","padding","visibility","text-align","position","border-radius","z-index"],DEFAULT_RECT_PROPS:["width","height","top","left"],DEFAULT_IGNORED_TAG_NAMES:["HEAD","SCRIPT"]};const{NODE_TYPES:f}=d;function m(e){return Array.prototype.filter.call(e.parentNode.childNodes,(t=>t.tagName===e.tagName)).indexOf(e)+1}var h=function(t){var n=e.implementation.createHTMLDocument(""),o=n.createElement("style");return o.textContent=t,n.body.appendChild(o),o.sheet},p=function(e){const t=Array.from(e.attributes).find((e=>"href"===e.name.toLowerCase()));return t&&t.value},g=function(e){if(e.nodeName&&"LINK"===e.nodeName.toUpperCase()&&e.attributes){const t=new Map(Array.from(e.attributes,(e=>[e.name.toLowerCase(),e.value.toLowerCase()])));return"stylesheet"===t.get("rel")||"style"===t.get("as")&&["preload","prefetch"].includes(t.get("rel"))}return!1};const y=p,C=g;const{absolutizeUrl:w,isInlineFrame:E}=u,T=h,N=p,b=g,{NODE_TYPES:S}=d;const{absolutizeUrl:$,isInlineFrame:A}=u,D=function(e){const t=e?e.match(l):void 0;return t?t[1]:t},R=async function({bgImages:e,timeout:t=5e3,Image:n=window.Image}){return(await Promise.all(Array.from(e).map((e=>{return Promise.race([new Promise((t=>{const o=new n;o.onload=()=>t({url:e,width:o.naturalWidth,height:o.naturalHeight}),o.onerror=()=>t(),o.src=e})),(o=t,new Promise((e=>{setTimeout(e,o)})))]);var o})))).reduce(((e,t)=>(t&&(e[t.url]={width:t.width,height:t.height}),e)),{})},_=function e(t){if(!t.ownerDocument)return"";let n="",o=t,r=t.ownerDocument,s=r.defaultView.frameElement;for(;o!==r&&(!o||o.nodeType!==f.DOCUMENT_FRAGMENT);)n=`${o.tagName}[${m(o)}]/${n}`,o=o.parentNode;return s&&(n=`${e(s)},${n}`),n.replace(/\/$/,"")},P=function({parseCss:e,CSSImportRule:t,absolutizeUrl:n,getCssFromCache:o,unfetchedToken:r}){return function s(a,c){let i,u="";try{const l=e(a);for(const e of Array.from(l.cssRules))if(e instanceof t){const t=n(e.href,c),a=o(t);if(void 0!==a){const{bundledCss:e,unfetchedResources:n}=s(a,t);n&&(i=new Set(n)),u=`${u}${e}`}else i=new Set([t]),u=`\n${r}${t}${r}`}}catch(e){console.log(`error during getBundledCssFromCssText, styleBaseUrl=${c}`,e)}var l,d;return u=`${u}${l=a,d=c,`\n/** ${d} **/\n${l}`}`,{bundledCss:u,unfetchedResources:i}}},U=h,v=function(e){const t=["before","after"];try{let n=[];return t.forEach((t=>{const o=window.getComputedStyle(e,`:${t}`);o&&"none"!==o.getPropertyValue("content")&&n.push(t)})),n.join("_and_")}catch(e){return!1}},F=function(e,{fetchTimeLimit:t}={}){return async function(n){const o=new AbortController,r=[e(n,{cache:"force-cache",signal:o.signal}).then((e=>{if(e.ok)return e.text();console.log("/failed to fetch (status "+e.status+") css from: "+n+"/")})).catch((e=>{console.log("/failed to fetch (error "+e.toString()+") css from: "+n+"/")}))];return Number.isNaN(Number(t))||r.push(new Promise((e=>setTimeout(e,t))).then((()=>o.abort()))),Promise.race(r)}},O=function({getCssFromCache:e,absolutizeUrl:t}){return function(n,o){let r,s,a;if(n&&function(e){return e.nodeName&&"STYLE"===e.nodeName.toUpperCase()}(n))r=Array.from(n.childNodes).map((e=>e.nodeValue)).join(""),s=o;else if(n&&C(n)){const c=y(n);!function(e){return e&&e.startsWith("data:")}(c)?(s=t(c,o),r=e(s)):(s=o,r=c.match(/,(.+)/)[1]),a=void 0===r}return{cssText:r,styleBaseUrl:s,isUnfetched:a}}},k=function({extractCssFromNode:e,getBundledCssFromCssText:t,unfetchedToken:n}){return function(o,r){const{styleBaseUrl:s,cssText:a,isUnfetched:c}=e(o,r);let i,u="";if(a){const{bundledCss:e,unfetchedResources:n}=t(a,s);u+=e,i=new Set(n)}else c&&(u+=`${n}${s}${n}`,i=new Set([s]));return{bundledCss:u,unfetchedResources:i}}},I=function(t){return async function(n=e){const o={},r=Date.now(),s=[];return function e(n,o,r,s){function c(e){if(s.push(async function(e,n,o){let r,s;e&&b(e)&&(s=w(N(e),n),r=await t(s),void 0!==r&&(o[s]=r)),r&&await a(r,s,o)}(e,o,r)),e.nodeType===S.ELEMENT)return"IFRAME"===e.tagName.toUpperCase()?u(e):i(e)}async function i(e){Array.prototype.map.call(e.childNodes,c)}async function u(t){if(i(t),t.contentDocument)try{const n=E(t)?t.baseURI:t.contentDocument.location.href;e(t.contentDocument,n,r,s)}catch(t){console.log(t)}}c(n.documentElement)}(n,n.location.href,o,s),await Promise.all(s),console.log("[prefetchAllCss]",Date.now()-r),function(e){return o[e]};async function a(e,n,o){try{const r=T(e),s=[];for(const e of Array.from(r.cssRules))e instanceof CSSImportRule&&s.push((async()=>{const r=w(e.href,n),s=await t(r);o[r]=s,void 0!==s&&await a(s,r,o)})());await Promise.all(s)}catch(e){console.log(`error during fetchBundledCss, resourceUrl=${n}`,e)}}}},{NODE_TYPES:L,DEFAULT_STYLE_PROPS:x,DEFAULT_RECT_PROPS:M,DEFAULT_IGNORED_TAG_NAMES:V}=d,B="1.3.0";return async function({doc:t=e,styleProps:n=x,rectProps:o=M,ignoredTagNames:r=V,addStats:s=!1,fetchTimeLimit:a=3e4}={}){
var captureDom=function(){"use strict";var e=function(){const e=function(e){return function(){function t(e,t=0){const n=e.charCodeAt(t);return n>=55296&&n<56320?1024*(n-55296)+(e.charCodeAt(t+1)-56320)+65536:56320<=n&&n<=57343?-1:n}var n=function(e,n){const o=[];let r=0;for(let s=0;s<e.length;++s){const a=t(e,s);let c=0;a>0&&(c=a<128?1:a<2048?2:a<65536?3:a<2097152?4:a<67108864?5:6),r+c>n?(o.push(s),r=c):r+=c}return o};const o=n,r="SUCCESS",s="SUCCESS_CHUNKED",a="ERROR";var c=function(e,t,n={}){const c=function(e,{chunkByteLength:t=0}={}){if(e){if(e.value){if(t){if(!e.chunks){const n=JSON.stringify(e.value);e.chunks=o(n,t),e.chunks.length>0&&(e.from=0,e.value=n)}if(e.from>=0)return{status:s,value:e.value.substring(e.from,e.from=e.chunks.shift()),done:!e.from}}return{status:r,value:e.value}}return e.error?{status:a,error:e.error}:{status:"WIP"}}return{status:a,error:"unexpected poll request received - cannot find state of current operation"}}((e=e||{})[t],n);return(c.status===r||c.status===a||c.status===s&&c.done)&&(e[t]=null),c};const u=c;var i={chunkify:n,pollify:function(e,t,n){return o=>function(){return t[n]||(t[n]={},e.apply(null,arguments).then((e=>t[n].value=e)).catch((e=>t[n].error=e.message))),u(t,n,o)}},poll:c,absolutizeUrl:function(e,t){return new URL(e,t).href},isInlineFrame:function(e){return e.contentDocument&&e.contentDocument.location&&!/^https?:$/.test(e.contentDocument.location.protocol)},isAccessibleFrame:function(e){try{const t=e.contentDocument;return Boolean(t&&t.defaultView&&t.defaultView.frameElement)}catch(e){return!1}}};const l=/url\((?!['"]?:)['"]?([^'")]*)['"]?\)/;var d={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_CAPTURE_KEY:"domCaptureResult",NODE_TYPES:{ELEMENT:1,TEXT:3,DOCUMENT_FRAGMENT:11},DEFAULT_STYLE_PROPS:["background-repeat","background-origin","background-position","background-color","background-image","background-size","border-width","border-color","border-style","color","display","font-size","font-weight","line-height","margin","opacity","overflow","padding","visibility","text-align","position","border-radius","z-index"],DEFAULT_RECT_PROPS:["width","height","top","left"],DEFAULT_IGNORED_TAG_NAMES:["HEAD","SCRIPT"]};const{NODE_TYPES:f}=d;function m(e){return Array.prototype.filter.call(e.parentNode.childNodes,(t=>t.tagName===e.tagName)).indexOf(e)+1}var h=function(t){var n=e.implementation.createHTMLDocument(""),o=n.createElement("style");return o.textContent=t,n.body.appendChild(o),o.sheet},p=function(e){const t=Array.from(e.attributes).find((e=>"href"===e.name.toLowerCase()));return t&&t.value},g=function(e){if(e.nodeName&&"LINK"===e.nodeName.toUpperCase()&&e.attributes){const t=new Map(Array.from(e.attributes,(e=>[e.name.toLowerCase(),e.value.toLowerCase()])));return"stylesheet"===t.get("rel")||"style"===t.get("as")&&["preload","prefetch"].includes(t.get("rel"))}return!1};const y=p,C=g;const{absolutizeUrl:E,isInlineFrame:w}=i,T=h,N=p,b=g,{NODE_TYPES:S}=d;const{absolutizeUrl:$,isInlineFrame:A}=i,D=function(e){const t=e?e.match(l):void 0;return t?t[1]:t},R=async function({bgImages:e,timeout:t=5e3,Image:n=window.Image}){return(await Promise.all(Array.from(e).map((e=>{return Promise.race([new Promise((t=>{const o=new n;o.onload=()=>t({url:e,width:o.naturalWidth,height:o.naturalHeight}),o.onerror=()=>t(),o.src=e})),(o=t,new Promise((e=>{setTimeout(e,o)})))]);var o})))).reduce(((e,t)=>(t&&(e[t.url]={width:t.width,height:t.height}),e)),{})},_=function e(t){if(!t.ownerDocument)return"";let n="",o=t,r=t.ownerDocument,s=r.defaultView.frameElement;for(;o!==r&&(!o||o.nodeType!==f.DOCUMENT_FRAGMENT);)n=`${o.tagName}[${m(o)}]/${n}`,o=o.parentNode;return s&&(n=`${e(s)},${n}`),n.replace(/\/$/,"")},P=function({parseCss:e,CSSImportRule:t,absolutizeUrl:n,getCssFromCache:o,unfetchedToken:r}){return function s(a,c){let u,i="";try{const l=e(a);for(const e of Array.from(l.cssRules))if(e instanceof t){const t=n(e.href,c),a=o(t);if(void 0!==a){const{bundledCss:e,unfetchedResources:n}=s(a,t);n&&(u=new Set(n)),i=`${i}${e}`}else u=new Set([t]),i=`\n${r}${t}${r}`}}catch(e){console.log(`error during getBundledCssFromCssText, styleBaseUrl=${c}`,e)}var l,d;return i=`${i}${l=a,d=c,`\n/** ${d} **/\n${l}`}`,{bundledCss:i,unfetchedResources:u}}},U=h,v=function(e){const t=["before","after"];try{let n=[];return t.forEach((t=>{const o=e.ownerDocument.defaultView.getComputedStyle(e,`:${t}`);o&&"none"!==o.getPropertyValue("content")&&n.push(t)})),n.join("_and_")}catch(e){return!1}},F=function(e,{fetchTimeLimit:t}={}){return async function(n){const o=new AbortController,r=[e(n,{cache:"force-cache",signal:o.signal}).then((e=>{if(e.ok)return e.text();console.log("/failed to fetch (status "+e.status+") css from: "+n+"/")})).catch((e=>{console.log("/failed to fetch (error "+e.toString()+") css from: "+n+"/")}))];return Number.isNaN(Number(t))||r.push(new Promise((e=>setTimeout(e,t))).then((()=>o.abort()))),Promise.race(r)}},O=function({getCssFromCache:e,absolutizeUrl:t}){return function(n,o){let r,s,a;if(n&&function(e){return e.nodeName&&"STYLE"===e.nodeName.toUpperCase()}(n))r=Array.from(n.childNodes).map((e=>e.nodeValue)).join(""),s=o;else if(n&&C(n)){const c=y(n);!function(e){return e&&e.startsWith("data:")}(c)?(s=t(c,o),r=e(s)):(s=o,r=c.match(/,(.+)/)[1]),a=void 0===r}return{cssText:r,styleBaseUrl:s,isUnfetched:a}}},k=function({extractCssFromNode:e,getBundledCssFromCssText:t,unfetchedToken:n}){return function(o,r){const{styleBaseUrl:s,cssText:a,isUnfetched:c}=e(o,r);let u,i="";if(a){const{bundledCss:e,unfetchedResources:n}=t(a,s);i+=e,u=new Set(n)}else c&&(i+=`${n}${s}${n}`,u=new Set([s]));return{bundledCss:i,unfetchedResources:u}}},I=function(t){return async function(n=e){const o={},r=Date.now(),s=[];return function e(n,o,r,s){function c(e){if(s.push(async function(e,n,o){let r,s;e&&b(e)&&(s=E(N(e),n),r=await t(s),void 0!==r&&(o[s]=r)),r&&await a(r,s,o)}(e,o,r)),e.nodeType===S.ELEMENT)return"IFRAME"===e.tagName.toUpperCase()?i(e):u(e)}async function u(e){Array.prototype.map.call(e.childNodes,c)}async function i(t){if(u(t),t.contentDocument)try{const n=w(t)?t.baseURI:t.contentDocument.location.href;e(t.contentDocument,n,r,s)}catch(t){console.log(t)}}c(n.documentElement)}(n,n.location.href,o,s),await Promise.all(s),console.log("[prefetchAllCss]",Date.now()-r),function(e){return o[e]};async function a(e,n,o){try{const r=T(e),s=[];for(const e of Array.from(r.cssRules))e instanceof CSSImportRule&&s.push((async()=>{const r=E(e.href,n),s=await t(r);o[r]=s,void 0!==s&&await a(s,r,o)})());await Promise.all(s)}catch(e){console.log(`error during fetchBundledCss, resourceUrl=${n}`,e)}}}},{NODE_TYPES:L,DEFAULT_STYLE_PROPS:x,DEFAULT_RECT_PROPS:M,DEFAULT_IGNORED_TAG_NAMES:V}=d,B="1.3.0";return async function({doc:t=e,styleProps:n=x,rectProps:o=M,ignoredTagNames:r=V,addStats:s=!1,fetchTimeLimit:a=3e4}={}){
/* MARKER FOR TEST - DO NOT DELETE */
arguments[1]&&(t=arguments[1]),arguments[2]&&(s=arguments[2]),arguments[3]&&(a=arguments[3]);const c={total:{},prefetchCss:{},doCaptureDoc:{},waitForImages:{}};function i(e){e.startTime=Date.now()}function u(e){e.endTime=Date.now(),e.elapsedTime=e.endTime-e.startTime}const l=[];i(c.total);const d=new Set,f=[],m="@@@@@",h="#####",p="-----";i(c.prefetchCss);const g=I(F(fetch,{fetchTimeLimit:a})),y=await g(t);u(c.prefetchCss);const C=P({parseCss:U,CSSImportRule:CSSImportRule,getCssFromCache:y,absolutizeUrl:$,unfetchedToken:h}),w=O({getCssFromCache:y,absolutizeUrl:$}),E=k({extractCssFromNode:w,getBundledCssFromCssText:C,unfetchedToken:h});i(c.doCaptureDoc);const T=j(t);u(c.doCaptureDoc),i(c.waitForImages),await Promise.all(l),u(c.waitForImages),T.version=B,T.scriptVersion="11.2.0";const N=f.length?`${f.join("\n")}\n`:"",b=d.size?`${Array.from(d).join("\n")}\n`:"",S=JSON.stringify({separator:p,cssStartToken:h,cssEndToken:h,iframeStartToken:`"${m}`,iframeEndToken:`${m}"`});function z(){return s?`\n${p}\n${JSON.stringify(c)}`:""}u(c.total);const Y=`${S}\n${b}${p}\n${N}${p}\n${JSON.stringify(T)}${z()}`;return console.log("[captureFrame]",JSON.stringify(c)),Y;function G(e){return Object.keys(e).length?e:void 0}function J(e){return{tagName:"#text",text:e.textContent}}function j(e,t=e.location&&e.location.href){const s=new Set;let a="";const c=i(e.documentElement||e);return c.css=a,l.push(R({bgImages:s}).then((e=>c.images=e))),c;function i(e){const{bundledCss:n,unfetchedResources:o}=E(e,t);if(a+=n,o)for(const e of o)d.add(e);switch(e.nodeType){case L.TEXT:return J(e);case L.ELEMENT:return"IFRAME"===e.tagName.toUpperCase()?function(e){const t=u(e);let n;try{n=e.contentDocument}catch(e){return o(),t}try{n?t.childNodes=[j(n,A(e)?e.baseURI:n.location.href)]:o()}catch(e){console.log("error in iframeToJSON",e)}return t;function o(){const n=_(e);f.push(n),t.childNodes=[`${m}${n}${m}`]}}(e):u(e);case L.DOCUMENT_FRAGMENT:return{childNodes:Array.prototype.map.call(e.childNodes,i).filter(Boolean)};default:return null}}function u(e){const a=Array.prototype.map.call(e.childNodes,i).filter(Boolean),c=e.shadowRoot&&j(e.shadowRoot,t),u=e.tagName.toUpperCase();if(r.indexOf(u)>-1)return null;const l=window.getComputedStyle(e),d=e.getBoundingClientRect(),f={};for(const e of n)f[e]=l.getPropertyValue(e);f["border-width"]||(f["border-width"]=`${l.getPropertyValue("border-top-width")} ${l.getPropertyValue("border-right-width")} ${l.getPropertyValue("border-bottom-width")} ${l.getPropertyValue("border-left-width")}`);const m={};for(const e of o)m[e]=d[e];const h=Array.from(e.attributes).map((e=>({key:e.name,value:e.value}))).reduce(((e,t)=>(e[t.key]=t.value,e)),{}),p=D(l.getPropertyValue("background-image"));p&&s.add(p);const g=v(e);g&&(h["data-applitools-has-pseudo"]=g);const y={tagName:u,style:G(f),rect:G(m),attributes:G(h),childNodes:a};return c&&(y.shadowRoot=c),y}}}}()};let t=!0;try{let n=document.head.querySelector("[data-applitools-sandbox]");n||(n=document.createElement("iframe"),n.setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n));const o=window.crypto.getRandomValues(new Uint32Array(1))[0],r=n.contentDocument.createElement("script");r.textContent=`window['ctor-${o}'] = ${e.toString()};`,n.contentDocument.head.appendChild(r);const s=n.contentWindow[`ctor-${o}`];return t=!1,s(document).apply(null,arguments)}catch(n){try{return e(document).apply(null,arguments)}catch(e){throw t?e:n}}};return e}();
arguments[1]&&(t=arguments[1]),arguments[2]&&(s=arguments[2]),arguments[3]&&(a=arguments[3]);const c={total:{},prefetchCss:{},doCaptureDoc:{},waitForImages:{}};function u(e){e.startTime=Date.now()}function i(e){e.endTime=Date.now(),e.elapsedTime=e.endTime-e.startTime}const l=[];u(c.total);const d=new Set,f=[],m="@@@@@",h="#####",p="-----";u(c.prefetchCss);const g=I(F(fetch,{fetchTimeLimit:a})),y=await g(t);i(c.prefetchCss);const C=P({parseCss:U,CSSImportRule:CSSImportRule,getCssFromCache:y,absolutizeUrl:$,unfetchedToken:h}),E=O({getCssFromCache:y,absolutizeUrl:$}),w=k({extractCssFromNode:E,getBundledCssFromCssText:C,unfetchedToken:h});u(c.doCaptureDoc);const T=j(t);i(c.doCaptureDoc),u(c.waitForImages),await Promise.all(l),i(c.waitForImages),T.version=B,T.scriptVersion="11.2.1";const N=f.length?`${f.join("\n")}\n`:"",b=d.size?`${Array.from(d).join("\n")}\n`:"",S=JSON.stringify({separator:p,cssStartToken:h,cssEndToken:h,iframeStartToken:`"${m}`,iframeEndToken:`${m}"`});function z(){return s?`\n${p}\n${JSON.stringify(c)}`:""}i(c.total);const Y=`${S}\n${b}${p}\n${N}${p}\n${JSON.stringify(T)}${z()}`;return console.log("[captureFrame]",JSON.stringify(c)),Y;function G(e){return Object.keys(e).length?e:void 0}function J(e){return{tagName:"#text",text:e.textContent}}function j(e,s=e.location&&e.location.href){const a=new Set;let c="";const u=i(e.documentElement||e);return u.css=c,l.push(R({bgImages:a}).then((e=>u.images=e))),u;function i(e){const{bundledCss:t,unfetchedResources:n}=w(e,s);if(c+=t,n)for(const e of n)d.add(e);switch(e.nodeType){case L.TEXT:return J(e);case L.ELEMENT:return"IFRAME"===e.tagName.toUpperCase()?function(e){const t=h(e);let n;try{n=e.contentDocument}catch(e){return o(),t}try{n?t.childNodes=[j(n,A(e)?e.baseURI:n.location.href)]:o()}catch(e){console.log("error in iframeToJSON",e)}return t;function o(){const n=_(e);f.push(n),t.childNodes=[`${m}${n}${m}`]}}(e):h(e);case L.DOCUMENT_FRAGMENT:return{childNodes:Array.prototype.map.call(e.childNodes,i).filter(Boolean)};default:return null}}function h(e){const c=Array.prototype.map.call(e.childNodes,i).filter(Boolean),u=e.shadowRoot&&j(e.shadowRoot,s),l=e.tagName.toUpperCase();if(r.indexOf(l)>-1)return null;const d=t.defaultView.getComputedStyle(e),f=e.getBoundingClientRect(),m={};for(const e of n)m[e]=d.getPropertyValue(e);m["border-width"]||(m["border-width"]=`${d.getPropertyValue("border-top-width")} ${d.getPropertyValue("border-right-width")} ${d.getPropertyValue("border-bottom-width")} ${d.getPropertyValue("border-left-width")}`);const h={};for(const e of o)h[e]=f[e];const p=Array.from(e.attributes).map((e=>({key:e.name,value:e.value}))).reduce(((e,t)=>(e[t.key]=t.value,e)),{}),g=D(d.getPropertyValue("background-image"));g&&a.add(g);const y=v(e);y&&(p["data-applitools-has-pseudo"]=y);const C={tagName:l,style:G(m),rect:G(h),attributes:G(p),childNodes:c};return u&&(C.shadowRoot=u),C}}}}()};let t=!0;try{let n=document.head.querySelector("[data-applitools-sandbox]");n||(n=document.createElement("iframe"),n.setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n));const o=window.crypto.getRandomValues(new Uint32Array(1))[0],r=n.contentDocument.createElement("script");r.textContent=`window['ctor-${o}'] = ${e.toString()};`,n.contentDocument.head.appendChild(r);const s=n.contentWindow[`ctor-${o}`];return t=!1,s(document).apply(null,arguments)}catch(n){try{return e(document).apply(null,arguments)}catch(e){throw t?e:n}}};return e}();
return captureDom.apply(this, arguments);
}

@@ -1,8 +0,8 @@

/* @applitools/dom-capture@11.2.0 */
/* @applitools/dom-capture@11.2.1 */
function __captureDomPoll() {
var captureDomPoll=function(){"use strict";var e=function(){const e=function(e){return function(){function t(e,t=0){const n=e.charCodeAt(t);return n>=55296&&n<56320?1024*(n-55296)+(e.charCodeAt(t+1)-56320)+65536:56320<=n&&n<=57343?-1:n}var n=function(e,n){const o=[];let r=0;for(let s=0;s<e.length;++s){const c=t(e,s);let a=0;c>0&&(a=c<128?1:c<2048?2:c<65536?3:c<2097152?4:c<67108864?5:6),r+a>n?(o.push(s),r=a):r+=a}return o};const o=n,r="SUCCESS",s="SUCCESS_CHUNKED",c="ERROR";var a=function(e,t,n={}){const a=function(e,{chunkByteLength:t=0}={}){if(e){if(e.value){if(t){if(!e.chunks){const n=JSON.stringify(e.value);e.chunks=o(n,t),e.chunks.length>0&&(e.from=0,e.value=n)}if(e.from>=0)return{status:s,value:e.value.substring(e.from,e.from=e.chunks.shift()),done:!e.from}}return{status:r,value:e.value}}return e.error?{status:c,error:e.error}:{status:"WIP"}}return{status:c,error:"unexpected poll request received - cannot find state of current operation"}}((e=e||{})[t],n);return(a.status===r||a.status===c||a.status===s&&a.done)&&(e[t]=null),a};const i=a;var u={chunkify:n,pollify:function(e,t,n){return o=>function(){return t[n]||(t[n]={},e.apply(null,arguments).then((e=>t[n].value=e)).catch((e=>t[n].error=e.message))),i(t,n,o)}},poll:a,absolutizeUrl:function(e,t){return new URL(e,t).href},isInlineFrame:function(e){return e.contentDocument&&e.contentDocument.location&&!/^https?:$/.test(e.contentDocument.location.protocol)},isAccessibleFrame:function(e){try{const t=e.contentDocument;return Boolean(t&&t.defaultView&&t.defaultView.frameElement)}catch(e){return!1}}},l={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_CAPTURE_KEY:"domCaptureResult",NODE_TYPES:{ELEMENT:1,TEXT:3,DOCUMENT_FRAGMENT:11},DEFAULT_STYLE_PROPS:["background-repeat","background-origin","background-position","background-color","background-image","background-size","border-width","border-color","border-style","color","display","font-size","font-weight","line-height","margin","opacity","overflow","padding","visibility","text-align","position","border-radius","z-index"],DEFAULT_RECT_PROPS:["width","height","top","left"],DEFAULT_IGNORED_TAG_NAMES:["HEAD","SCRIPT"]};const d=/url\((?!['"]?:)['"]?([^'")]*)['"]?\)/;const{NODE_TYPES:f}=l;function m(e){return Array.prototype.filter.call(e.parentNode.childNodes,(t=>t.tagName===e.tagName)).indexOf(e)+1}var h=function(t){var n=e.implementation.createHTMLDocument(""),o=n.createElement("style");return o.textContent=t,n.body.appendChild(o),o.sheet},p=function(e){const t=Array.from(e.attributes).find((e=>"href"===e.name.toLowerCase()));return t&&t.value},g=function(e){if(e.nodeName&&"LINK"===e.nodeName.toUpperCase()&&e.attributes){const t=new Map(Array.from(e.attributes,(e=>[e.name.toLowerCase(),e.value.toLowerCase()])));return"stylesheet"===t.get("rel")||"style"===t.get("as")&&["preload","prefetch"].includes(t.get("rel"))}return!1};const y=p,w=g;const{absolutizeUrl:E,isInlineFrame:C}=u,T=h,N=p,S=g,{NODE_TYPES:b}=l;const{absolutizeUrl:A,isInlineFrame:$}=u,_=function(e){const t=e?e.match(d):void 0;return t?t[1]:t},D=async function({bgImages:e,timeout:t=5e3,Image:n=window.Image}){return(await Promise.all(Array.from(e).map((e=>{return Promise.race([new Promise((t=>{const o=new n;o.onload=()=>t({url:e,width:o.naturalWidth,height:o.naturalHeight}),o.onerror=()=>t(),o.src=e})),(o=t,new Promise((e=>{setTimeout(e,o)})))]);var o})))).reduce(((e,t)=>(t&&(e[t.url]={width:t.width,height:t.height}),e)),{})},P=function e(t){if(!t.ownerDocument)return"";let n="",o=t,r=t.ownerDocument,s=r.defaultView.frameElement;for(;o!==r&&(!o||o.nodeType!==f.DOCUMENT_FRAGMENT);)n=`${o.tagName}[${m(o)}]/${n}`,o=o.parentNode;return s&&(n=`${e(s)},${n}`),n.replace(/\/$/,"")},R=function({parseCss:e,CSSImportRule:t,absolutizeUrl:n,getCssFromCache:o,unfetchedToken:r}){return function s(c,a){let i,u="";try{const l=e(c);for(const e of Array.from(l.cssRules))if(e instanceof t){const t=n(e.href,a),c=o(t);if(void 0!==c){const{bundledCss:e,unfetchedResources:n}=s(c,t);n&&(i=new Set(n)),u=`${u}${e}`}else i=new Set([t]),u=`\n${r}${t}${r}`}}catch(e){console.log(`error during getBundledCssFromCssText, styleBaseUrl=${a}`,e)}var l,d;return u=`${u}${l=c,d=a,`\n/** ${d} **/\n${l}`}`,{bundledCss:u,unfetchedResources:i}}},U=h,v=function(e){const t=["before","after"];try{let n=[];return t.forEach((t=>{const o=window.getComputedStyle(e,`:${t}`);o&&"none"!==o.getPropertyValue("content")&&n.push(t)})),n.join("_and_")}catch(e){return!1}},O=function(e,{fetchTimeLimit:t}={}){return async function(n){const o=new AbortController,r=[e(n,{cache:"force-cache",signal:o.signal}).then((e=>{if(e.ok)return e.text();console.log("/failed to fetch (status "+e.status+") css from: "+n+"/")})).catch((e=>{console.log("/failed to fetch (error "+e.toString()+") css from: "+n+"/")}))];return Number.isNaN(Number(t))||r.push(new Promise((e=>setTimeout(e,t))).then((()=>o.abort()))),Promise.race(r)}},F=function({getCssFromCache:e,absolutizeUrl:t}){return function(n,o){let r,s,c;if(n&&function(e){return e.nodeName&&"STYLE"===e.nodeName.toUpperCase()}(n))r=Array.from(n.childNodes).map((e=>e.nodeValue)).join(""),s=o;else if(n&&w(n)){const a=y(n);!function(e){return e&&e.startsWith("data:")}(a)?(s=t(a,o),r=e(s)):(s=o,r=a.match(/,(.+)/)[1]),c=void 0===r}return{cssText:r,styleBaseUrl:s,isUnfetched:c}}},k=function({extractCssFromNode:e,getBundledCssFromCssText:t,unfetchedToken:n}){return function(o,r){const{styleBaseUrl:s,cssText:c,isUnfetched:a}=e(o,r);let i,u="";if(c){const{bundledCss:e,unfetchedResources:n}=t(c,s);u+=e,i=new Set(n)}else a&&(u+=`${n}${s}${n}`,i=new Set([s]));return{bundledCss:u,unfetchedResources:i}}},I=function(t){return async function(n=e){const o={},r=Date.now(),s=[];return function e(n,o,r,s){function a(e){if(s.push(async function(e,n,o){let r,s;e&&S(e)&&(s=E(N(e),n),r=await t(s),void 0!==r&&(o[s]=r)),r&&await c(r,s,o)}(e,o,r)),e.nodeType===b.ELEMENT)return"IFRAME"===e.tagName.toUpperCase()?u(e):i(e)}async function i(e){Array.prototype.map.call(e.childNodes,a)}async function u(t){if(i(t),t.contentDocument)try{const n=C(t)?t.baseURI:t.contentDocument.location.href;e(t.contentDocument,n,r,s)}catch(t){console.log(t)}}a(n.documentElement)}(n,n.location.href,o,s),await Promise.all(s),console.log("[prefetchAllCss]",Date.now()-r),function(e){return o[e]};async function c(e,n,o){try{const r=T(e),s=[];for(const e of Array.from(r.cssRules))e instanceof CSSImportRule&&s.push((async()=>{const r=E(e.href,n),s=await t(r);o[r]=s,void 0!==s&&await c(s,r,o)})());await Promise.all(s)}catch(e){console.log(`error during fetchBundledCss, resourceUrl=${n}`,e)}}}},{NODE_TYPES:L,DEFAULT_STYLE_PROPS:x,DEFAULT_RECT_PROPS:M,DEFAULT_IGNORED_TAG_NAMES:V}=l,B="1.3.0";const{pollify:Y}=u,{EYES_NAMESPACE:z,DOM_CAPTURE_KEY:G}=l,J=async function({doc:t=e,styleProps:n=x,rectProps:o=M,ignoredTagNames:r=V,addStats:s=!1,fetchTimeLimit:c=3e4}={}){
var captureDomPoll=function(){"use strict";var e=function(){const e=function(e){return function(){function t(e,t=0){const n=e.charCodeAt(t);return n>=55296&&n<56320?1024*(n-55296)+(e.charCodeAt(t+1)-56320)+65536:56320<=n&&n<=57343?-1:n}var n=function(e,n){const o=[];let r=0;for(let s=0;s<e.length;++s){const a=t(e,s);let c=0;a>0&&(c=a<128?1:a<2048?2:a<65536?3:a<2097152?4:a<67108864?5:6),r+c>n?(o.push(s),r=c):r+=c}return o};const o=n,r="SUCCESS",s="SUCCESS_CHUNKED",a="ERROR";var c=function(e,t,n={}){const c=function(e,{chunkByteLength:t=0}={}){if(e){if(e.value){if(t){if(!e.chunks){const n=JSON.stringify(e.value);e.chunks=o(n,t),e.chunks.length>0&&(e.from=0,e.value=n)}if(e.from>=0)return{status:s,value:e.value.substring(e.from,e.from=e.chunks.shift()),done:!e.from}}return{status:r,value:e.value}}return e.error?{status:a,error:e.error}:{status:"WIP"}}return{status:a,error:"unexpected poll request received - cannot find state of current operation"}}((e=e||{})[t],n);return(c.status===r||c.status===a||c.status===s&&c.done)&&(e[t]=null),c};const i=c;var u={chunkify:n,pollify:function(e,t,n){return o=>function(){return t[n]||(t[n]={},e.apply(null,arguments).then((e=>t[n].value=e)).catch((e=>t[n].error=e.message))),i(t,n,o)}},poll:c,absolutizeUrl:function(e,t){return new URL(e,t).href},isInlineFrame:function(e){return e.contentDocument&&e.contentDocument.location&&!/^https?:$/.test(e.contentDocument.location.protocol)},isAccessibleFrame:function(e){try{const t=e.contentDocument;return Boolean(t&&t.defaultView&&t.defaultView.frameElement)}catch(e){return!1}}},l={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_CAPTURE_KEY:"domCaptureResult",NODE_TYPES:{ELEMENT:1,TEXT:3,DOCUMENT_FRAGMENT:11},DEFAULT_STYLE_PROPS:["background-repeat","background-origin","background-position","background-color","background-image","background-size","border-width","border-color","border-style","color","display","font-size","font-weight","line-height","margin","opacity","overflow","padding","visibility","text-align","position","border-radius","z-index"],DEFAULT_RECT_PROPS:["width","height","top","left"],DEFAULT_IGNORED_TAG_NAMES:["HEAD","SCRIPT"]};const d=/url\((?!['"]?:)['"]?([^'")]*)['"]?\)/;const{NODE_TYPES:f}=l;function m(e){return Array.prototype.filter.call(e.parentNode.childNodes,(t=>t.tagName===e.tagName)).indexOf(e)+1}var h=function(t){var n=e.implementation.createHTMLDocument(""),o=n.createElement("style");return o.textContent=t,n.body.appendChild(o),o.sheet},p=function(e){const t=Array.from(e.attributes).find((e=>"href"===e.name.toLowerCase()));return t&&t.value},g=function(e){if(e.nodeName&&"LINK"===e.nodeName.toUpperCase()&&e.attributes){const t=new Map(Array.from(e.attributes,(e=>[e.name.toLowerCase(),e.value.toLowerCase()])));return"stylesheet"===t.get("rel")||"style"===t.get("as")&&["preload","prefetch"].includes(t.get("rel"))}return!1};const y=p,E=g;const{absolutizeUrl:w,isInlineFrame:C}=u,T=h,N=p,S=g,{NODE_TYPES:b}=l;const{absolutizeUrl:A,isInlineFrame:$}=u,D=function(e){const t=e?e.match(d):void 0;return t?t[1]:t},_=async function({bgImages:e,timeout:t=5e3,Image:n=window.Image}){return(await Promise.all(Array.from(e).map((e=>{return Promise.race([new Promise((t=>{const o=new n;o.onload=()=>t({url:e,width:o.naturalWidth,height:o.naturalHeight}),o.onerror=()=>t(),o.src=e})),(o=t,new Promise((e=>{setTimeout(e,o)})))]);var o})))).reduce(((e,t)=>(t&&(e[t.url]={width:t.width,height:t.height}),e)),{})},P=function e(t){if(!t.ownerDocument)return"";let n="",o=t,r=t.ownerDocument,s=r.defaultView.frameElement;for(;o!==r&&(!o||o.nodeType!==f.DOCUMENT_FRAGMENT);)n=`${o.tagName}[${m(o)}]/${n}`,o=o.parentNode;return s&&(n=`${e(s)},${n}`),n.replace(/\/$/,"")},R=function({parseCss:e,CSSImportRule:t,absolutizeUrl:n,getCssFromCache:o,unfetchedToken:r}){return function s(a,c){let i,u="";try{const l=e(a);for(const e of Array.from(l.cssRules))if(e instanceof t){const t=n(e.href,c),a=o(t);if(void 0!==a){const{bundledCss:e,unfetchedResources:n}=s(a,t);n&&(i=new Set(n)),u=`${u}${e}`}else i=new Set([t]),u=`\n${r}${t}${r}`}}catch(e){console.log(`error during getBundledCssFromCssText, styleBaseUrl=${c}`,e)}var l,d;return u=`${u}${l=a,d=c,`\n/** ${d} **/\n${l}`}`,{bundledCss:u,unfetchedResources:i}}},U=h,v=function(e){const t=["before","after"];try{let n=[];return t.forEach((t=>{const o=e.ownerDocument.defaultView.getComputedStyle(e,`:${t}`);o&&"none"!==o.getPropertyValue("content")&&n.push(t)})),n.join("_and_")}catch(e){return!1}},O=function(e,{fetchTimeLimit:t}={}){return async function(n){const o=new AbortController,r=[e(n,{cache:"force-cache",signal:o.signal}).then((e=>{if(e.ok)return e.text();console.log("/failed to fetch (status "+e.status+") css from: "+n+"/")})).catch((e=>{console.log("/failed to fetch (error "+e.toString()+") css from: "+n+"/")}))];return Number.isNaN(Number(t))||r.push(new Promise((e=>setTimeout(e,t))).then((()=>o.abort()))),Promise.race(r)}},F=function({getCssFromCache:e,absolutizeUrl:t}){return function(n,o){let r,s,a;if(n&&function(e){return e.nodeName&&"STYLE"===e.nodeName.toUpperCase()}(n))r=Array.from(n.childNodes).map((e=>e.nodeValue)).join(""),s=o;else if(n&&E(n)){const c=y(n);!function(e){return e&&e.startsWith("data:")}(c)?(s=t(c,o),r=e(s)):(s=o,r=c.match(/,(.+)/)[1]),a=void 0===r}return{cssText:r,styleBaseUrl:s,isUnfetched:a}}},k=function({extractCssFromNode:e,getBundledCssFromCssText:t,unfetchedToken:n}){return function(o,r){const{styleBaseUrl:s,cssText:a,isUnfetched:c}=e(o,r);let i,u="";if(a){const{bundledCss:e,unfetchedResources:n}=t(a,s);u+=e,i=new Set(n)}else c&&(u+=`${n}${s}${n}`,i=new Set([s]));return{bundledCss:u,unfetchedResources:i}}},I=function(t){return async function(n=e){const o={},r=Date.now(),s=[];return function e(n,o,r,s){function c(e){if(s.push(async function(e,n,o){let r,s;e&&S(e)&&(s=w(N(e),n),r=await t(s),void 0!==r&&(o[s]=r)),r&&await a(r,s,o)}(e,o,r)),e.nodeType===b.ELEMENT)return"IFRAME"===e.tagName.toUpperCase()?u(e):i(e)}async function i(e){Array.prototype.map.call(e.childNodes,c)}async function u(t){if(i(t),t.contentDocument)try{const n=C(t)?t.baseURI:t.contentDocument.location.href;e(t.contentDocument,n,r,s)}catch(t){console.log(t)}}c(n.documentElement)}(n,n.location.href,o,s),await Promise.all(s),console.log("[prefetchAllCss]",Date.now()-r),function(e){return o[e]};async function a(e,n,o){try{const r=T(e),s=[];for(const e of Array.from(r.cssRules))e instanceof CSSImportRule&&s.push((async()=>{const r=w(e.href,n),s=await t(r);o[r]=s,void 0!==s&&await a(s,r,o)})());await Promise.all(s)}catch(e){console.log(`error during fetchBundledCss, resourceUrl=${n}`,e)}}}},{NODE_TYPES:L,DEFAULT_STYLE_PROPS:x,DEFAULT_RECT_PROPS:M,DEFAULT_IGNORED_TAG_NAMES:V}=l,B="1.3.0";const{pollify:Y}=u,{EYES_NAMESPACE:z,DOM_CAPTURE_KEY:G}=l,J=async function({doc:t=e,styleProps:n=x,rectProps:o=M,ignoredTagNames:r=V,addStats:s=!1,fetchTimeLimit:a=3e4}={}){
/* MARKER FOR TEST - DO NOT DELETE */
arguments[1]&&(t=arguments[1]),arguments[2]&&(s=arguments[2]),arguments[3]&&(c=arguments[3]);const a={total:{},prefetchCss:{},doCaptureDoc:{},waitForImages:{}};function i(e){e.startTime=Date.now()}function u(e){e.endTime=Date.now(),e.elapsedTime=e.endTime-e.startTime}const l=[];i(a.total);const d=new Set,f=[],m="@@@@@",h="#####",p="-----";i(a.prefetchCss);const g=I(O(fetch,{fetchTimeLimit:c})),y=await g(t);u(a.prefetchCss);const w=R({parseCss:U,CSSImportRule:CSSImportRule,getCssFromCache:y,absolutizeUrl:A,unfetchedToken:h}),E=F({getCssFromCache:y,absolutizeUrl:A}),C=k({extractCssFromNode:E,getBundledCssFromCssText:w,unfetchedToken:h});i(a.doCaptureDoc);const T=j(t);u(a.doCaptureDoc),i(a.waitForImages),await Promise.all(l),u(a.waitForImages),T.version=B,T.scriptVersion="11.2.0";const N=f.length?`${f.join("\n")}\n`:"",S=d.size?`${Array.from(d).join("\n")}\n`:"",b=JSON.stringify({separator:p,cssStartToken:h,cssEndToken:h,iframeStartToken:`"${m}`,iframeEndToken:`${m}"`});function Y(){return s?`\n${p}\n${JSON.stringify(a)}`:""}u(a.total);const z=`${b}\n${S}${p}\n${N}${p}\n${JSON.stringify(T)}${Y()}`;return console.log("[captureFrame]",JSON.stringify(a)),z;function G(e){return Object.keys(e).length?e:void 0}function J(e){return{tagName:"#text",text:e.textContent}}function j(e,t=e.location&&e.location.href){const s=new Set;let c="";const a=i(e.documentElement||e);return a.css=c,l.push(D({bgImages:s}).then((e=>a.images=e))),a;function i(e){const{bundledCss:n,unfetchedResources:o}=C(e,t);if(c+=n,o)for(const e of o)d.add(e);switch(e.nodeType){case L.TEXT:return J(e);case L.ELEMENT:return"IFRAME"===e.tagName.toUpperCase()?function(e){const t=u(e);let n;try{n=e.contentDocument}catch(e){return o(),t}try{n?t.childNodes=[j(n,$(e)?e.baseURI:n.location.href)]:o()}catch(e){console.log("error in iframeToJSON",e)}return t;function o(){const n=P(e);f.push(n),t.childNodes=[`${m}${n}${m}`]}}(e):u(e);case L.DOCUMENT_FRAGMENT:return{childNodes:Array.prototype.map.call(e.childNodes,i).filter(Boolean)};default:return null}}function u(e){const c=Array.prototype.map.call(e.childNodes,i).filter(Boolean),a=e.shadowRoot&&j(e.shadowRoot,t),u=e.tagName.toUpperCase();if(r.indexOf(u)>-1)return null;const l=window.getComputedStyle(e),d=e.getBoundingClientRect(),f={};for(const e of n)f[e]=l.getPropertyValue(e);f["border-width"]||(f["border-width"]=`${l.getPropertyValue("border-top-width")} ${l.getPropertyValue("border-right-width")} ${l.getPropertyValue("border-bottom-width")} ${l.getPropertyValue("border-left-width")}`);const m={};for(const e of o)m[e]=d[e];const h=Array.from(e.attributes).map((e=>({key:e.name,value:e.value}))).reduce(((e,t)=>(e[t.key]=t.value,e)),{}),p=_(l.getPropertyValue("background-image"));p&&s.add(p);const g=v(e);g&&(h["data-applitools-has-pseudo"]=g);const y={tagName:u,style:G(f),rect:G(m),attributes:G(h),childNodes:c};return a&&(y.shadowRoot=a),y}}};window[z]=window[z]||{};const j=Y(J,window[z],G);return function(e){return JSON.stringify(j(e)(e))}}()};let t=!0;try{let n=document.head.querySelector("[data-applitools-sandbox]");n||(n=document.createElement("iframe"),n.setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n));const o=window.crypto.getRandomValues(new Uint32Array(1))[0],r=n.contentDocument.createElement("script");r.textContent=`window['ctor-${o}'] = ${e.toString()};`,n.contentDocument.head.appendChild(r);const s=n.contentWindow[`ctor-${o}`];return t=!1,s(document).apply(null,arguments)}catch(n){try{return e(document).apply(null,arguments)}catch(e){throw t?e:n}}};return e}();
arguments[1]&&(t=arguments[1]),arguments[2]&&(s=arguments[2]),arguments[3]&&(a=arguments[3]);const c={total:{},prefetchCss:{},doCaptureDoc:{},waitForImages:{}};function i(e){e.startTime=Date.now()}function u(e){e.endTime=Date.now(),e.elapsedTime=e.endTime-e.startTime}const l=[];i(c.total);const d=new Set,f=[],m="@@@@@",h="#####",p="-----";i(c.prefetchCss);const g=I(O(fetch,{fetchTimeLimit:a})),y=await g(t);u(c.prefetchCss);const E=R({parseCss:U,CSSImportRule:CSSImportRule,getCssFromCache:y,absolutizeUrl:A,unfetchedToken:h}),w=F({getCssFromCache:y,absolutizeUrl:A}),C=k({extractCssFromNode:w,getBundledCssFromCssText:E,unfetchedToken:h});i(c.doCaptureDoc);const T=j(t);u(c.doCaptureDoc),i(c.waitForImages),await Promise.all(l),u(c.waitForImages),T.version=B,T.scriptVersion="11.2.1";const N=f.length?`${f.join("\n")}\n`:"",S=d.size?`${Array.from(d).join("\n")}\n`:"",b=JSON.stringify({separator:p,cssStartToken:h,cssEndToken:h,iframeStartToken:`"${m}`,iframeEndToken:`${m}"`});function Y(){return s?`\n${p}\n${JSON.stringify(c)}`:""}u(c.total);const z=`${b}\n${S}${p}\n${N}${p}\n${JSON.stringify(T)}${Y()}`;return console.log("[captureFrame]",JSON.stringify(c)),z;function G(e){return Object.keys(e).length?e:void 0}function J(e){return{tagName:"#text",text:e.textContent}}function j(e,s=e.location&&e.location.href){const a=new Set;let c="";const i=u(e.documentElement||e);return i.css=c,l.push(_({bgImages:a}).then((e=>i.images=e))),i;function u(e){const{bundledCss:t,unfetchedResources:n}=C(e,s);if(c+=t,n)for(const e of n)d.add(e);switch(e.nodeType){case L.TEXT:return J(e);case L.ELEMENT:return"IFRAME"===e.tagName.toUpperCase()?function(e){const t=h(e);let n;try{n=e.contentDocument}catch(e){return o(),t}try{n?t.childNodes=[j(n,$(e)?e.baseURI:n.location.href)]:o()}catch(e){console.log("error in iframeToJSON",e)}return t;function o(){const n=P(e);f.push(n),t.childNodes=[`${m}${n}${m}`]}}(e):h(e);case L.DOCUMENT_FRAGMENT:return{childNodes:Array.prototype.map.call(e.childNodes,u).filter(Boolean)};default:return null}}function h(e){const c=Array.prototype.map.call(e.childNodes,u).filter(Boolean),i=e.shadowRoot&&j(e.shadowRoot,s),l=e.tagName.toUpperCase();if(r.indexOf(l)>-1)return null;const d=t.defaultView.getComputedStyle(e),f=e.getBoundingClientRect(),m={};for(const e of n)m[e]=d.getPropertyValue(e);m["border-width"]||(m["border-width"]=`${d.getPropertyValue("border-top-width")} ${d.getPropertyValue("border-right-width")} ${d.getPropertyValue("border-bottom-width")} ${d.getPropertyValue("border-left-width")}`);const h={};for(const e of o)h[e]=f[e];const p=Array.from(e.attributes).map((e=>({key:e.name,value:e.value}))).reduce(((e,t)=>(e[t.key]=t.value,e)),{}),g=D(d.getPropertyValue("background-image"));g&&a.add(g);const y=v(e);y&&(p["data-applitools-has-pseudo"]=y);const E={tagName:l,style:G(m),rect:G(h),attributes:G(p),childNodes:c};return i&&(E.shadowRoot=i),E}}};window[z]=window[z]||{};const j=Y(J,window[z],G);return function(e){return JSON.stringify(j(e)(e))}}()};let t=!0;try{let n=document.head.querySelector("[data-applitools-sandbox]");n||(n=document.createElement("iframe"),n.setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n));const o=window.crypto.getRandomValues(new Uint32Array(1))[0],r=n.contentDocument.createElement("script");r.textContent=`window['ctor-${o}'] = ${e.toString()};`,n.contentDocument.head.appendChild(r);const s=n.contentWindow[`ctor-${o}`];return t=!1,s(document).apply(null,arguments)}catch(n){try{return e(document).apply(null,arguments)}catch(e){throw t?e:n}}};return e}();
return captureDomPoll.apply(this, arguments);
}

@@ -1,4 +0,4 @@

/* @applitools/dom-capture@11.2.0 */
"use strict";var e=function(){const e=function(e){return function(){function t(e,t=0){const n=e.charCodeAt(t);return n>=55296&&n<56320?1024*(n-55296)+(e.charCodeAt(t+1)-56320)+65536:56320<=n&&n<=57343?-1:n}var n=function(e,n){const o=[];let r=0;for(let s=0;s<e.length;++s){const c=t(e,s);let a=0;c>0&&(a=c<128?1:c<2048?2:c<65536?3:c<2097152?4:c<67108864?5:6),r+a>n?(o.push(s),r=a):r+=a}return o};const o=n,r="SUCCESS",s="SUCCESS_CHUNKED",c="ERROR";var a=function(e,t,n={}){const a=function(e,{chunkByteLength:t=0}={}){if(e){if(e.value){if(t){if(!e.chunks){const n=JSON.stringify(e.value);e.chunks=o(n,t),e.chunks.length>0&&(e.from=0,e.value=n)}if(e.from>=0)return{status:s,value:e.value.substring(e.from,e.from=e.chunks.shift()),done:!e.from}}return{status:r,value:e.value}}return e.error?{status:c,error:e.error}:{status:"WIP"}}return{status:c,error:"unexpected poll request received - cannot find state of current operation"}}((e=e||{})[t],n);return(a.status===r||a.status===c||a.status===s&&a.done)&&(e[t]=null),a};const i=a;var u={chunkify:n,pollify:function(e,t,n){return o=>function(){return t[n]||(t[n]={},e.apply(null,arguments).then((e=>t[n].value=e)).catch((e=>t[n].error=e.message))),i(t,n,o)}},poll:a,absolutizeUrl:function(e,t){return new URL(e,t).href},isInlineFrame:function(e){return e.contentDocument&&e.contentDocument.location&&!/^https?:$/.test(e.contentDocument.location.protocol)},isAccessibleFrame:function(e){try{const t=e.contentDocument;return Boolean(t&&t.defaultView&&t.defaultView.frameElement)}catch(e){return!1}}},l={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_CAPTURE_KEY:"domCaptureResult",NODE_TYPES:{ELEMENT:1,TEXT:3,DOCUMENT_FRAGMENT:11},DEFAULT_STYLE_PROPS:["background-repeat","background-origin","background-position","background-color","background-image","background-size","border-width","border-color","border-style","color","display","font-size","font-weight","line-height","margin","opacity","overflow","padding","visibility","text-align","position","border-radius","z-index"],DEFAULT_RECT_PROPS:["width","height","top","left"],DEFAULT_IGNORED_TAG_NAMES:["HEAD","SCRIPT"]};const d=/url\((?!['"]?:)['"]?([^'")]*)['"]?\)/;const{NODE_TYPES:f}=l;function m(e){return Array.prototype.filter.call(e.parentNode.childNodes,(t=>t.tagName===e.tagName)).indexOf(e)+1}var h=function(t){var n=e.implementation.createHTMLDocument(""),o=n.createElement("style");return o.textContent=t,n.body.appendChild(o),o.sheet},p=function(e){const t=Array.from(e.attributes).find((e=>"href"===e.name.toLowerCase()));return t&&t.value},g=function(e){if(e.nodeName&&"LINK"===e.nodeName.toUpperCase()&&e.attributes){const t=new Map(Array.from(e.attributes,(e=>[e.name.toLowerCase(),e.value.toLowerCase()])));return"stylesheet"===t.get("rel")||"style"===t.get("as")&&["preload","prefetch"].includes(t.get("rel"))}return!1};const y=p,w=g;const{absolutizeUrl:E,isInlineFrame:C}=u,T=h,N=p,S=g,{NODE_TYPES:b}=l;const{absolutizeUrl:A,isInlineFrame:$}=u,_=function(e){const t=e?e.match(d):void 0;return t?t[1]:t},R=async function({bgImages:e,timeout:t=5e3,Image:n=window.Image}){return(await Promise.all(Array.from(e).map((e=>{return Promise.race([new Promise((t=>{const o=new n;o.onload=()=>t({url:e,width:o.naturalWidth,height:o.naturalHeight}),o.onerror=()=>t(),o.src=e})),(o=t,new Promise((e=>{setTimeout(e,o)})))]);var o})))).reduce(((e,t)=>(t&&(e[t.url]={width:t.width,height:t.height}),e)),{})},D=function e(t){if(!t.ownerDocument)return"";let n="",o=t,r=t.ownerDocument,s=r.defaultView.frameElement;for(;o!==r&&(!o||o.nodeType!==f.DOCUMENT_FRAGMENT);)n=`${o.tagName}[${m(o)}]/${n}`,o=o.parentNode;return s&&(n=`${e(s)},${n}`),n.replace(/\/$/,"")},P=function({parseCss:e,CSSImportRule:t,absolutizeUrl:n,getCssFromCache:o,unfetchedToken:r}){return function s(c,a){let i,u="";try{const l=e(c);for(const e of Array.from(l.cssRules))if(e instanceof t){const t=n(e.href,a),c=o(t);if(void 0!==c){const{bundledCss:e,unfetchedResources:n}=s(c,t);n&&(i=new Set(n)),u=`${u}${e}`}else i=new Set([t]),u=`\n${r}${t}${r}`}}catch(e){console.log(`error during getBundledCssFromCssText, styleBaseUrl=${a}`,e)}var l,d;return u=`${u}${l=c,d=a,`\n/** ${d} **/\n${l}`}`,{bundledCss:u,unfetchedResources:i}}},U=h,v=function(e){const t=["before","after"];try{let n=[];return t.forEach((t=>{const o=window.getComputedStyle(e,`:${t}`);o&&"none"!==o.getPropertyValue("content")&&n.push(t)})),n.join("_and_")}catch(e){return!1}},O=function(e,{fetchTimeLimit:t}={}){return async function(n){const o=new AbortController,r=[e(n,{cache:"force-cache",signal:o.signal}).then((e=>{if(e.ok)return e.text();console.log("/failed to fetch (status "+e.status+") css from: "+n+"/")})).catch((e=>{console.log("/failed to fetch (error "+e.toString()+") css from: "+n+"/")}))];return Number.isNaN(Number(t))||r.push(new Promise((e=>setTimeout(e,t))).then((()=>o.abort()))),Promise.race(r)}},F=function({getCssFromCache:e,absolutizeUrl:t}){return function(n,o){let r,s,c;if(n&&function(e){return e.nodeName&&"STYLE"===e.nodeName.toUpperCase()}(n))r=Array.from(n.childNodes).map((e=>e.nodeValue)).join(""),s=o;else if(n&&w(n)){const a=y(n);!function(e){return e&&e.startsWith("data:")}(a)?(s=t(a,o),r=e(s)):(s=o,r=a.match(/,(.+)/)[1]),c=void 0===r}return{cssText:r,styleBaseUrl:s,isUnfetched:c}}},k=function({extractCssFromNode:e,getBundledCssFromCssText:t,unfetchedToken:n}){return function(o,r){const{styleBaseUrl:s,cssText:c,isUnfetched:a}=e(o,r);let i,u="";if(c){const{bundledCss:e,unfetchedResources:n}=t(c,s);u+=e,i=new Set(n)}else a&&(u+=`${n}${s}${n}`,i=new Set([s]));return{bundledCss:u,unfetchedResources:i}}},I=function(t){return async function(n=e){const o={},r=Date.now(),s=[];return function e(n,o,r,s){function a(e){if(s.push(async function(e,n,o){let r,s;e&&S(e)&&(s=E(N(e),n),r=await t(s),void 0!==r&&(o[s]=r)),r&&await c(r,s,o)}(e,o,r)),e.nodeType===b.ELEMENT)return"IFRAME"===e.tagName.toUpperCase()?u(e):i(e)}async function i(e){Array.prototype.map.call(e.childNodes,a)}async function u(t){if(i(t),t.contentDocument)try{const n=C(t)?t.baseURI:t.contentDocument.location.href;e(t.contentDocument,n,r,s)}catch(t){console.log(t)}}a(n.documentElement)}(n,n.location.href,o,s),await Promise.all(s),console.log("[prefetchAllCss]",Date.now()-r),function(e){return o[e]};async function c(e,n,o){try{const r=T(e),s=[];for(const e of Array.from(r.cssRules))e instanceof CSSImportRule&&s.push((async()=>{const r=E(e.href,n),s=await t(r);o[r]=s,void 0!==s&&await c(s,r,o)})());await Promise.all(s)}catch(e){console.log(`error during fetchBundledCss, resourceUrl=${n}`,e)}}}},{NODE_TYPES:L,DEFAULT_STYLE_PROPS:x,DEFAULT_RECT_PROPS:M,DEFAULT_IGNORED_TAG_NAMES:V}=l,B="1.3.0";const{pollify:Y}=u,{EYES_NAMESPACE:z,DOM_CAPTURE_KEY:G}=l,J=async function({doc:t=e,styleProps:n=x,rectProps:o=M,ignoredTagNames:r=V,addStats:s=!1,fetchTimeLimit:c=3e4}={}){
/* @applitools/dom-capture@11.2.1 */
"use strict";var e=function(){const e=function(e){return function(){function t(e,t=0){const n=e.charCodeAt(t);return n>=55296&&n<56320?1024*(n-55296)+(e.charCodeAt(t+1)-56320)+65536:56320<=n&&n<=57343?-1:n}var n=function(e,n){const o=[];let r=0;for(let s=0;s<e.length;++s){const a=t(e,s);let c=0;a>0&&(c=a<128?1:a<2048?2:a<65536?3:a<2097152?4:a<67108864?5:6),r+c>n?(o.push(s),r=c):r+=c}return o};const o=n,r="SUCCESS",s="SUCCESS_CHUNKED",a="ERROR";var c=function(e,t,n={}){const c=function(e,{chunkByteLength:t=0}={}){if(e){if(e.value){if(t){if(!e.chunks){const n=JSON.stringify(e.value);e.chunks=o(n,t),e.chunks.length>0&&(e.from=0,e.value=n)}if(e.from>=0)return{status:s,value:e.value.substring(e.from,e.from=e.chunks.shift()),done:!e.from}}return{status:r,value:e.value}}return e.error?{status:a,error:e.error}:{status:"WIP"}}return{status:a,error:"unexpected poll request received - cannot find state of current operation"}}((e=e||{})[t],n);return(c.status===r||c.status===a||c.status===s&&c.done)&&(e[t]=null),c};const i=c;var u={chunkify:n,pollify:function(e,t,n){return o=>function(){return t[n]||(t[n]={},e.apply(null,arguments).then((e=>t[n].value=e)).catch((e=>t[n].error=e.message))),i(t,n,o)}},poll:c,absolutizeUrl:function(e,t){return new URL(e,t).href},isInlineFrame:function(e){return e.contentDocument&&e.contentDocument.location&&!/^https?:$/.test(e.contentDocument.location.protocol)},isAccessibleFrame:function(e){try{const t=e.contentDocument;return Boolean(t&&t.defaultView&&t.defaultView.frameElement)}catch(e){return!1}}},l={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_CAPTURE_KEY:"domCaptureResult",NODE_TYPES:{ELEMENT:1,TEXT:3,DOCUMENT_FRAGMENT:11},DEFAULT_STYLE_PROPS:["background-repeat","background-origin","background-position","background-color","background-image","background-size","border-width","border-color","border-style","color","display","font-size","font-weight","line-height","margin","opacity","overflow","padding","visibility","text-align","position","border-radius","z-index"],DEFAULT_RECT_PROPS:["width","height","top","left"],DEFAULT_IGNORED_TAG_NAMES:["HEAD","SCRIPT"]};const d=/url\((?!['"]?:)['"]?([^'")]*)['"]?\)/;const{NODE_TYPES:f}=l;function m(e){return Array.prototype.filter.call(e.parentNode.childNodes,(t=>t.tagName===e.tagName)).indexOf(e)+1}var h=function(t){var n=e.implementation.createHTMLDocument(""),o=n.createElement("style");return o.textContent=t,n.body.appendChild(o),o.sheet},p=function(e){const t=Array.from(e.attributes).find((e=>"href"===e.name.toLowerCase()));return t&&t.value},g=function(e){if(e.nodeName&&"LINK"===e.nodeName.toUpperCase()&&e.attributes){const t=new Map(Array.from(e.attributes,(e=>[e.name.toLowerCase(),e.value.toLowerCase()])));return"stylesheet"===t.get("rel")||"style"===t.get("as")&&["preload","prefetch"].includes(t.get("rel"))}return!1};const y=p,E=g;const{absolutizeUrl:w,isInlineFrame:C}=u,T=h,N=p,S=g,{NODE_TYPES:b}=l;const{absolutizeUrl:A,isInlineFrame:$}=u,_=function(e){const t=e?e.match(d):void 0;return t?t[1]:t},D=async function({bgImages:e,timeout:t=5e3,Image:n=window.Image}){return(await Promise.all(Array.from(e).map((e=>{return Promise.race([new Promise((t=>{const o=new n;o.onload=()=>t({url:e,width:o.naturalWidth,height:o.naturalHeight}),o.onerror=()=>t(),o.src=e})),(o=t,new Promise((e=>{setTimeout(e,o)})))]);var o})))).reduce(((e,t)=>(t&&(e[t.url]={width:t.width,height:t.height}),e)),{})},R=function e(t){if(!t.ownerDocument)return"";let n="",o=t,r=t.ownerDocument,s=r.defaultView.frameElement;for(;o!==r&&(!o||o.nodeType!==f.DOCUMENT_FRAGMENT);)n=`${o.tagName}[${m(o)}]/${n}`,o=o.parentNode;return s&&(n=`${e(s)},${n}`),n.replace(/\/$/,"")},P=function({parseCss:e,CSSImportRule:t,absolutizeUrl:n,getCssFromCache:o,unfetchedToken:r}){return function s(a,c){let i,u="";try{const l=e(a);for(const e of Array.from(l.cssRules))if(e instanceof t){const t=n(e.href,c),a=o(t);if(void 0!==a){const{bundledCss:e,unfetchedResources:n}=s(a,t);n&&(i=new Set(n)),u=`${u}${e}`}else i=new Set([t]),u=`\n${r}${t}${r}`}}catch(e){console.log(`error during getBundledCssFromCssText, styleBaseUrl=${c}`,e)}var l,d;return u=`${u}${l=a,d=c,`\n/** ${d} **/\n${l}`}`,{bundledCss:u,unfetchedResources:i}}},U=h,v=function(e){const t=["before","after"];try{let n=[];return t.forEach((t=>{const o=e.ownerDocument.defaultView.getComputedStyle(e,`:${t}`);o&&"none"!==o.getPropertyValue("content")&&n.push(t)})),n.join("_and_")}catch(e){return!1}},O=function(e,{fetchTimeLimit:t}={}){return async function(n){const o=new AbortController,r=[e(n,{cache:"force-cache",signal:o.signal}).then((e=>{if(e.ok)return e.text();console.log("/failed to fetch (status "+e.status+") css from: "+n+"/")})).catch((e=>{console.log("/failed to fetch (error "+e.toString()+") css from: "+n+"/")}))];return Number.isNaN(Number(t))||r.push(new Promise((e=>setTimeout(e,t))).then((()=>o.abort()))),Promise.race(r)}},F=function({getCssFromCache:e,absolutizeUrl:t}){return function(n,o){let r,s,a;if(n&&function(e){return e.nodeName&&"STYLE"===e.nodeName.toUpperCase()}(n))r=Array.from(n.childNodes).map((e=>e.nodeValue)).join(""),s=o;else if(n&&E(n)){const c=y(n);!function(e){return e&&e.startsWith("data:")}(c)?(s=t(c,o),r=e(s)):(s=o,r=c.match(/,(.+)/)[1]),a=void 0===r}return{cssText:r,styleBaseUrl:s,isUnfetched:a}}},k=function({extractCssFromNode:e,getBundledCssFromCssText:t,unfetchedToken:n}){return function(o,r){const{styleBaseUrl:s,cssText:a,isUnfetched:c}=e(o,r);let i,u="";if(a){const{bundledCss:e,unfetchedResources:n}=t(a,s);u+=e,i=new Set(n)}else c&&(u+=`${n}${s}${n}`,i=new Set([s]));return{bundledCss:u,unfetchedResources:i}}},I=function(t){return async function(n=e){const o={},r=Date.now(),s=[];return function e(n,o,r,s){function c(e){if(s.push(async function(e,n,o){let r,s;e&&S(e)&&(s=w(N(e),n),r=await t(s),void 0!==r&&(o[s]=r)),r&&await a(r,s,o)}(e,o,r)),e.nodeType===b.ELEMENT)return"IFRAME"===e.tagName.toUpperCase()?u(e):i(e)}async function i(e){Array.prototype.map.call(e.childNodes,c)}async function u(t){if(i(t),t.contentDocument)try{const n=C(t)?t.baseURI:t.contentDocument.location.href;e(t.contentDocument,n,r,s)}catch(t){console.log(t)}}c(n.documentElement)}(n,n.location.href,o,s),await Promise.all(s),console.log("[prefetchAllCss]",Date.now()-r),function(e){return o[e]};async function a(e,n,o){try{const r=T(e),s=[];for(const e of Array.from(r.cssRules))e instanceof CSSImportRule&&s.push((async()=>{const r=w(e.href,n),s=await t(r);o[r]=s,void 0!==s&&await a(s,r,o)})());await Promise.all(s)}catch(e){console.log(`error during fetchBundledCss, resourceUrl=${n}`,e)}}}},{NODE_TYPES:L,DEFAULT_STYLE_PROPS:x,DEFAULT_RECT_PROPS:M,DEFAULT_IGNORED_TAG_NAMES:V}=l,B="1.3.0";const{pollify:Y}=u,{EYES_NAMESPACE:z,DOM_CAPTURE_KEY:G}=l,J=async function({doc:t=e,styleProps:n=x,rectProps:o=M,ignoredTagNames:r=V,addStats:s=!1,fetchTimeLimit:a=3e4}={}){
/* MARKER FOR TEST - DO NOT DELETE */
arguments[1]&&(t=arguments[1]),arguments[2]&&(s=arguments[2]),arguments[3]&&(c=arguments[3]);const a={total:{},prefetchCss:{},doCaptureDoc:{},waitForImages:{}};function i(e){e.startTime=Date.now()}function u(e){e.endTime=Date.now(),e.elapsedTime=e.endTime-e.startTime}const l=[];i(a.total);const d=new Set,f=[],m="@@@@@",h="#####",p="-----";i(a.prefetchCss);const g=I(O(fetch,{fetchTimeLimit:c})),y=await g(t);u(a.prefetchCss);const w=P({parseCss:U,CSSImportRule:CSSImportRule,getCssFromCache:y,absolutizeUrl:A,unfetchedToken:h}),E=F({getCssFromCache:y,absolutizeUrl:A}),C=k({extractCssFromNode:E,getBundledCssFromCssText:w,unfetchedToken:h});i(a.doCaptureDoc);const T=j(t);u(a.doCaptureDoc),i(a.waitForImages),await Promise.all(l),u(a.waitForImages),T.version=B,T.scriptVersion="11.2.0";const N=f.length?`${f.join("\n")}\n`:"",S=d.size?`${Array.from(d).join("\n")}\n`:"",b=JSON.stringify({separator:p,cssStartToken:h,cssEndToken:h,iframeStartToken:`"${m}`,iframeEndToken:`${m}"`});function Y(){return s?`\n${p}\n${JSON.stringify(a)}`:""}u(a.total);const z=`${b}\n${S}${p}\n${N}${p}\n${JSON.stringify(T)}${Y()}`;return console.log("[captureFrame]",JSON.stringify(a)),z;function G(e){return Object.keys(e).length?e:void 0}function J(e){return{tagName:"#text",text:e.textContent}}function j(e,t=e.location&&e.location.href){const s=new Set;let c="";const a=i(e.documentElement||e);return a.css=c,l.push(R({bgImages:s}).then((e=>a.images=e))),a;function i(e){const{bundledCss:n,unfetchedResources:o}=C(e,t);if(c+=n,o)for(const e of o)d.add(e);switch(e.nodeType){case L.TEXT:return J(e);case L.ELEMENT:return"IFRAME"===e.tagName.toUpperCase()?function(e){const t=u(e);let n;try{n=e.contentDocument}catch(e){return o(),t}try{n?t.childNodes=[j(n,$(e)?e.baseURI:n.location.href)]:o()}catch(e){console.log("error in iframeToJSON",e)}return t;function o(){const n=D(e);f.push(n),t.childNodes=[`${m}${n}${m}`]}}(e):u(e);case L.DOCUMENT_FRAGMENT:return{childNodes:Array.prototype.map.call(e.childNodes,i).filter(Boolean)};default:return null}}function u(e){const c=Array.prototype.map.call(e.childNodes,i).filter(Boolean),a=e.shadowRoot&&j(e.shadowRoot,t),u=e.tagName.toUpperCase();if(r.indexOf(u)>-1)return null;const l=window.getComputedStyle(e),d=e.getBoundingClientRect(),f={};for(const e of n)f[e]=l.getPropertyValue(e);f["border-width"]||(f["border-width"]=`${l.getPropertyValue("border-top-width")} ${l.getPropertyValue("border-right-width")} ${l.getPropertyValue("border-bottom-width")} ${l.getPropertyValue("border-left-width")}`);const m={};for(const e of o)m[e]=d[e];const h=Array.from(e.attributes).map((e=>({key:e.name,value:e.value}))).reduce(((e,t)=>(e[t.key]=t.value,e)),{}),p=_(l.getPropertyValue("background-image"));p&&s.add(p);const g=v(e);g&&(h["data-applitools-has-pseudo"]=g);const y={tagName:u,style:G(f),rect:G(m),attributes:G(h),childNodes:c};return a&&(y.shadowRoot=a),y}}};window[z]=window[z]||{};const j=Y(J,window[z],G);return function(e){return JSON.stringify(j(e)(e))}}()};let t=!0;try{let n=document.head.querySelector("[data-applitools-sandbox]");n||(n=document.createElement("iframe"),n.setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n));const o=window.crypto.getRandomValues(new Uint32Array(1))[0],r=n.contentDocument.createElement("script");r.textContent=`window['ctor-${o}'] = ${e.toString()};`,n.contentDocument.head.appendChild(r);const s=n.contentWindow[`ctor-${o}`];return t=!1,s(document).apply(null,arguments)}catch(n){try{return e(document).apply(null,arguments)}catch(e){throw t?e:n}}};module.exports=e;
arguments[1]&&(t=arguments[1]),arguments[2]&&(s=arguments[2]),arguments[3]&&(a=arguments[3]);const c={total:{},prefetchCss:{},doCaptureDoc:{},waitForImages:{}};function i(e){e.startTime=Date.now()}function u(e){e.endTime=Date.now(),e.elapsedTime=e.endTime-e.startTime}const l=[];i(c.total);const d=new Set,f=[],m="@@@@@",h="#####",p="-----";i(c.prefetchCss);const g=I(O(fetch,{fetchTimeLimit:a})),y=await g(t);u(c.prefetchCss);const E=P({parseCss:U,CSSImportRule:CSSImportRule,getCssFromCache:y,absolutizeUrl:A,unfetchedToken:h}),w=F({getCssFromCache:y,absolutizeUrl:A}),C=k({extractCssFromNode:w,getBundledCssFromCssText:E,unfetchedToken:h});i(c.doCaptureDoc);const T=j(t);u(c.doCaptureDoc),i(c.waitForImages),await Promise.all(l),u(c.waitForImages),T.version=B,T.scriptVersion="11.2.1";const N=f.length?`${f.join("\n")}\n`:"",S=d.size?`${Array.from(d).join("\n")}\n`:"",b=JSON.stringify({separator:p,cssStartToken:h,cssEndToken:h,iframeStartToken:`"${m}`,iframeEndToken:`${m}"`});function Y(){return s?`\n${p}\n${JSON.stringify(c)}`:""}u(c.total);const z=`${b}\n${S}${p}\n${N}${p}\n${JSON.stringify(T)}${Y()}`;return console.log("[captureFrame]",JSON.stringify(c)),z;function G(e){return Object.keys(e).length?e:void 0}function J(e){return{tagName:"#text",text:e.textContent}}function j(e,s=e.location&&e.location.href){const a=new Set;let c="";const i=u(e.documentElement||e);return i.css=c,l.push(D({bgImages:a}).then((e=>i.images=e))),i;function u(e){const{bundledCss:t,unfetchedResources:n}=C(e,s);if(c+=t,n)for(const e of n)d.add(e);switch(e.nodeType){case L.TEXT:return J(e);case L.ELEMENT:return"IFRAME"===e.tagName.toUpperCase()?function(e){const t=h(e);let n;try{n=e.contentDocument}catch(e){return o(),t}try{n?t.childNodes=[j(n,$(e)?e.baseURI:n.location.href)]:o()}catch(e){console.log("error in iframeToJSON",e)}return t;function o(){const n=R(e);f.push(n),t.childNodes=[`${m}${n}${m}`]}}(e):h(e);case L.DOCUMENT_FRAGMENT:return{childNodes:Array.prototype.map.call(e.childNodes,u).filter(Boolean)};default:return null}}function h(e){const c=Array.prototype.map.call(e.childNodes,u).filter(Boolean),i=e.shadowRoot&&j(e.shadowRoot,s),l=e.tagName.toUpperCase();if(r.indexOf(l)>-1)return null;const d=t.defaultView.getComputedStyle(e),f=e.getBoundingClientRect(),m={};for(const e of n)m[e]=d.getPropertyValue(e);m["border-width"]||(m["border-width"]=`${d.getPropertyValue("border-top-width")} ${d.getPropertyValue("border-right-width")} ${d.getPropertyValue("border-bottom-width")} ${d.getPropertyValue("border-left-width")}`);const h={};for(const e of o)h[e]=f[e];const p=Array.from(e.attributes).map((e=>({key:e.name,value:e.value}))).reduce(((e,t)=>(e[t.key]=t.value,e)),{}),g=_(d.getPropertyValue("background-image"));g&&a.add(g);const y=v(e);y&&(p["data-applitools-has-pseudo"]=y);const E={tagName:l,style:G(m),rect:G(h),attributes:G(p),childNodes:c};return i&&(E.shadowRoot=i),E}}};window[z]=window[z]||{};const j=Y(J,window[z],G);return function(e){return JSON.stringify(j(e)(e))}}()};let t=!0;try{let n=document.head.querySelector("[data-applitools-sandbox]");n||(n=document.createElement("iframe"),n.setAttribute("data-applitools-sandbox",""),n.setAttribute("data-applitools-skip",""),document.head.appendChild(n));const o=window.crypto.getRandomValues(new Uint32Array(1))[0],r=n.contentDocument.createElement("script");r.textContent=`window['ctor-${o}'] = ${e.toString()};`,n.contentDocument.head.appendChild(r);const s=n.contentWindow[`ctor-${o}`];return t=!1,s(document).apply(null,arguments)}catch(n){try{return e(document).apply(null,arguments)}catch(e){throw t?e:n}}};module.exports=e;

@@ -1,2 +0,2 @@

/* @applitools/dom-capture@11.2.0 */
/* @applitools/dom-capture@11.2.1 */
function __pollResult() {

@@ -3,0 +3,0 @@ var pollResult=function(){"use strict";var t=function(){const t=function(t){return function(){function t(t,n=0){const e=t.charCodeAt(n);return e>=55296&&e<56320?1024*(e-55296)+(t.charCodeAt(n+1)-56320)+65536:56320<=e&&e<=57343?-1:e}var n=function(n,e){const o=[];let r=0;for(let u=0;u<n.length;++u){const c=t(n,u);let i=0;c>0&&(i=c<128?1:c<2048?2:c<65536?3:c<2097152?4:c<67108864?5:6),r+i>e?(o.push(u),r=i):r+=i}return o};const e=n,o="SUCCESS",r="SUCCESS_CHUNKED",u="ERROR";var c=function(t,n,c={}){const i=function(t,{chunkByteLength:n=0}={}){if(t){if(t.value){if(n){if(!t.chunks){const o=JSON.stringify(t.value);t.chunks=e(o,n),t.chunks.length>0&&(t.from=0,t.value=o)}if(t.from>=0)return{status:r,value:t.value.substring(t.from,t.from=t.chunks.shift()),done:!t.from}}return{status:o,value:t.value}}return t.error?{status:u,error:t.error}:{status:"WIP"}}return{status:u,error:"unexpected poll request received - cannot find state of current operation"}}((t=t||{})[n],c);return(i.status===o||i.status===u||i.status===r&&i.done)&&(t[n]=null),i};const i=c;var a={chunkify:n,pollify:function(t,n,e){return o=>function(){return n[e]||(n[e]={},t.apply(null,arguments).then((t=>n[e].value=t)).catch((t=>n[e].error=t.message))),i(n,e,o)}},poll:c,absolutizeUrl:function(t,n){return new URL(t,n).href},isInlineFrame:function(t){return t.contentDocument&&t.contentDocument.location&&!/^https?:$/.test(t.contentDocument.location.protocol)},isAccessibleFrame:function(t){try{const n=t.contentDocument;return Boolean(n&&n.defaultView&&n.defaultView.frameElement)}catch(t){return!1}}};const{poll:l}=a,{EYES_NAMESPACE:s,DOM_CAPTURE_KEY:d}={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_CAPTURE_KEY:"domCaptureResult",NODE_TYPES:{ELEMENT:1,TEXT:3,DOCUMENT_FRAGMENT:11},DEFAULT_STYLE_PROPS:["background-repeat","background-origin","background-position","background-color","background-image","background-size","border-width","border-color","border-style","color","display","font-size","font-weight","line-height","margin","opacity","overflow","padding","visibility","text-align","position","border-radius","z-index"],DEFAULT_RECT_PROPS:["width","height","top","left"],DEFAULT_IGNORED_TAG_NAMES:["HEAD","SCRIPT"]};return function(t){return JSON.stringify(l(window[s],d,t))}}()};let n=!0;try{let e=document.head.querySelector("[data-applitools-sandbox]");e||(e=document.createElement("iframe"),e.setAttribute("data-applitools-sandbox",""),e.setAttribute("data-applitools-skip",""),document.head.appendChild(e));const o=window.crypto.getRandomValues(new Uint32Array(1))[0],r=e.contentDocument.createElement("script");r.textContent=`window['ctor-${o}'] = ${t.toString()};`,e.contentDocument.head.appendChild(r);const u=e.contentWindow[`ctor-${o}`];return n=!1,u(document).apply(null,arguments)}catch(e){try{return t(document).apply(null,arguments)}catch(t){throw n?t:e}}};return t}();

@@ -1,2 +0,2 @@

/* @applitools/dom-capture@11.2.0 */
/* @applitools/dom-capture@11.2.1 */
"use strict";var t=function(){const t=function(t){return function(){function t(t,n=0){const e=t.charCodeAt(n);return e>=55296&&e<56320?1024*(e-55296)+(t.charCodeAt(n+1)-56320)+65536:56320<=e&&e<=57343?-1:e}var n=function(n,e){const o=[];let r=0;for(let u=0;u<n.length;++u){const c=t(n,u);let i=0;c>0&&(i=c<128?1:c<2048?2:c<65536?3:c<2097152?4:c<67108864?5:6),r+i>e?(o.push(u),r=i):r+=i}return o};const e=n,o="SUCCESS",r="SUCCESS_CHUNKED",u="ERROR";var c=function(t,n,c={}){const i=function(t,{chunkByteLength:n=0}={}){if(t){if(t.value){if(n){if(!t.chunks){const o=JSON.stringify(t.value);t.chunks=e(o,n),t.chunks.length>0&&(t.from=0,t.value=o)}if(t.from>=0)return{status:r,value:t.value.substring(t.from,t.from=t.chunks.shift()),done:!t.from}}return{status:o,value:t.value}}return t.error?{status:u,error:t.error}:{status:"WIP"}}return{status:u,error:"unexpected poll request received - cannot find state of current operation"}}((t=t||{})[n],c);return(i.status===o||i.status===u||i.status===r&&i.done)&&(t[n]=null),i};const i=c;var a={chunkify:n,pollify:function(t,n,e){return o=>function(){return n[e]||(n[e]={},t.apply(null,arguments).then((t=>n[e].value=t)).catch((t=>n[e].error=t.message))),i(n,e,o)}},poll:c,absolutizeUrl:function(t,n){return new URL(t,n).href},isInlineFrame:function(t){return t.contentDocument&&t.contentDocument.location&&!/^https?:$/.test(t.contentDocument.location.protocol)},isAccessibleFrame:function(t){try{const n=t.contentDocument;return Boolean(n&&n.defaultView&&n.defaultView.frameElement)}catch(t){return!1}}};const{poll:s}=a,{EYES_NAMESPACE:l,DOM_CAPTURE_KEY:d}={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_CAPTURE_KEY:"domCaptureResult",NODE_TYPES:{ELEMENT:1,TEXT:3,DOCUMENT_FRAGMENT:11},DEFAULT_STYLE_PROPS:["background-repeat","background-origin","background-position","background-color","background-image","background-size","border-width","border-color","border-style","color","display","font-size","font-weight","line-height","margin","opacity","overflow","padding","visibility","text-align","position","border-radius","z-index"],DEFAULT_RECT_PROPS:["width","height","top","left"],DEFAULT_IGNORED_TAG_NAMES:["HEAD","SCRIPT"]};return function(t){return JSON.stringify(s(window[l],d,t))}}()};let n=!0;try{let e=document.head.querySelector("[data-applitools-sandbox]");e||(e=document.createElement("iframe"),e.setAttribute("data-applitools-sandbox",""),e.setAttribute("data-applitools-skip",""),document.head.appendChild(e));const o=window.crypto.getRandomValues(new Uint32Array(1))[0],r=e.contentDocument.createElement("script");r.textContent=`window['ctor-${o}'] = ${t.toString()};`,e.contentDocument.head.appendChild(r);const u=e.contentWindow[`ctor-${o}`];return n=!1,u(document).apply(null,arguments)}catch(e){try{return t(document).apply(null,arguments)}catch(t){throw n?t:e}}};module.exports=t;
{
"name": "@applitools/dom-capture",
"version": "11.2.0",
"version": "11.2.1",
"main": "index.js",

@@ -21,3 +21,4 @@ "license": "SEE LICENSE IN LICENSE",

"version": "yarn build && bongo version",
"postversion": "bongo postversion --skip-release-notification"
"postversion": "bongo postversion --skip-release-notification",
"install:firefox": "PUPPETEER_PRODUCT=firefox node ./node_modules/puppeteer/install.js"
},

@@ -56,3 +57,3 @@ "engines": {

"prettier": "^1.19.1",
"puppeteer": "^5.5.0",
"puppeteer": "^10.2.0",
"rollup": "^2.79.1",

@@ -59,0 +60,0 @@ "rollup-plugin-filesize": "^9.1.2",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc