/* @applitools/dom-snapshot@4.2.2 */

function __pollResult() {
  var pollResult=function(){"use strict";function t(t,n=0){const e=t.charCodeAt(n);if(e>=55296&&e<56320){return 1024*(e-55296)+(t.charCodeAt(n+1)-56320)+65536}return 56320<=e&&e<=57343?-1:e}var n=function(n,e){const r=[];let u=0;for(let o=0;o<n.length;++o){const c=t(n,o);let s=0;c>0&&(s=c<128?1:c<2048?2:c<65536?3:c<2097152?4:c<67108864?5:6),u+s>e?(r.push(o),u=s):u+=s}return r};const e="WIP",r="SUCCESS",u="SUCCESS_CHUNKED",o="ERROR";var c=function(t,c,s={}){const a=function(t,{chunkByteLength:c=0}={}){if(t){if(t.value){if(c){if(!t.chunks){const e=JSON.stringify(t.value);t.chunks=n(e,c),t.chunks.length>0&&(t.from=0,t.value=e)}if(t.from>=0)return{status:u,value:t.value.substring(t.from,t.from=t.chunks.shift()),done:!t.from}}return{status:r,value:t.value}}return t.error?{status:o,error:t.error}:{status:e}}return{status:o,error:"unexpected poll request received - cannot find state of current operation"}}((t=t||{})[c],s);return(a.status===r||a.status===o||a.status===u&&a.done)&&(t[c]=null),a};var s=function(t,n){return new URL(t,n).href};var a=function(t){return!/^https?:.+/.test(t.src)||t.contentDocument&&t.contentDocument.location&&(["about:blank","about:srcdoc"].includes(t.contentDocument.location.href)||""===t.getAttribute("src")&&t.contentDocument.location.href===s(t.getAttribute("src"),t.ownerDocument.location.href))};var i={chunkify:n,pollify:function(t,n,e){return r=>function(){return n[e]||(n[e]={},t.apply(null,arguments).then(t=>n[e].value=t).catch(t=>n[e].error=t.message)),c(n,e,r)}},poll:c,absolutizeUrl:s,isInlineFrame:a,isAccessibleFrame:function(t){try{const n=t.contentDocument;return Boolean(n&&n.defaultView&&n.defaultView.frameElement)}catch(t){return!1}}},l={EYES_NAMESPACE:"__EYES__APPLITOOLS__",DOM_SNAPSHOT_KEY:"domSnapshotResult"};const{poll:f}=i,{EYES_NAMESPACE:h,DOM_SNAPSHOT_KEY:S}=l;return function(t){return JSON.stringify(f(window[h],S,t))}}();

  return pollResult.apply(this, arguments);
}