testcafe 2.2.0 → 2.3.1

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.
Files changed (93) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/bin/testcafe-with-v8-flag-filter.js +16 -3
  3. package/lib/api/exportable-lib/index.mjs +27 -0
  4. package/lib/api/structure/fixture.js +7 -3
  5. package/lib/api/structure/test.js +8 -3
  6. package/lib/api/structure/testing-unit.js +15 -1
  7. package/lib/api/test-controller/index.js +4 -4
  8. package/lib/browser/connection/gateway.js +13 -1
  9. package/lib/browser/connection/index.js +10 -1
  10. package/lib/browser/connection/service-routes.js +2 -1
  11. package/lib/browser/provider/built-in/dedicated/chrome/index.js +6 -1
  12. package/lib/browser/provider/index.js +4 -1
  13. package/lib/cli/argument-parser/index.js +58 -59
  14. package/lib/cli/cli.js +3 -2
  15. package/lib/client/automation/index.js +90 -4
  16. package/lib/client/automation/index.min.js +1 -1
  17. package/lib/client/browser/idle-page/index.js +7 -5
  18. package/lib/client/core/deps/hammerhead.js +24 -0
  19. package/lib/client/core/index.js +42 -7
  20. package/lib/client/core/index.min.js +1 -1
  21. package/lib/client/core/utils/values/axis-values.js +43 -0
  22. package/lib/client/driver/index.js +336 -211
  23. package/lib/client/driver/index.min.js +1 -1
  24. package/lib/client/test-run/iframe.js.mustache +2 -1
  25. package/lib/client/test-run/index.js.mustache +30 -28
  26. package/lib/client/ui/index.js +33 -23
  27. package/lib/client/ui/index.min.js +1 -1
  28. package/lib/compiler/babel/load-libs.js +10 -9
  29. package/lib/compiler/compilers.js +7 -7
  30. package/lib/compiler/esm-loader.js +38 -0
  31. package/lib/compiler/index.js +8 -7
  32. package/lib/compiler/interfaces.js +1 -1
  33. package/lib/compiler/prevent-module-caching-suffix.js +6 -0
  34. package/lib/compiler/test-file/add-export-api.js +3 -9
  35. package/lib/compiler/test-file/api-based.js +30 -14
  36. package/lib/compiler/test-file/base.js +4 -1
  37. package/lib/compiler/test-file/formats/coffeescript/compiler.js +5 -4
  38. package/lib/compiler/test-file/formats/es-next/compiler.js +21 -11
  39. package/lib/compiler/test-file/formats/extensions.js +15 -0
  40. package/lib/compiler/test-file/formats/typescript/compiler.js +27 -17
  41. package/lib/compiler/test-file/get-exportable-lib-path.js +17 -0
  42. package/lib/configuration/option-names.js +2 -1
  43. package/lib/custom-client-scripts/get-code.js +4 -3
  44. package/lib/custom-client-scripts/routing.js +3 -3
  45. package/lib/errors/is-internal-stack-frame.js +3 -2
  46. package/lib/errors/process-test-fn-error.js +3 -2
  47. package/lib/errors/runtime/index.js +18 -4
  48. package/lib/errors/runtime/templates.js +2 -1
  49. package/lib/errors/test-run/utils.js +8 -3
  50. package/lib/errors/types.js +2 -1
  51. package/lib/proxyless/api-base.js +25 -0
  52. package/lib/proxyless/client/event-simulator.js +40 -0
  53. package/lib/proxyless/client/types.js +11 -0
  54. package/lib/proxyless/client/utils.js +24 -0
  55. package/lib/proxyless/cookie-provider.js +3 -3
  56. package/lib/proxyless/index.js +20 -2
  57. package/lib/proxyless/request-hooks/event-factory/frame-navigated-event-based.js +40 -0
  58. package/lib/proxyless/request-hooks/event-factory/request-paused-event-based.js +95 -0
  59. package/lib/proxyless/request-hooks/event-provider.js +6 -54
  60. package/lib/proxyless/request-pipeline/context-info.js +55 -0
  61. package/lib/proxyless/request-pipeline/index.js +73 -31
  62. package/lib/proxyless/request-pipeline/resendAuthRequest.js +23 -0
  63. package/lib/proxyless/request-pipeline/special-handlers.js +2 -2
  64. package/lib/proxyless/request-pipeline/test-run-bridge.js +45 -0
  65. package/lib/proxyless/resource-injector.js +41 -29
  66. package/lib/proxyless/session-storage/index.js +39 -0
  67. package/lib/proxyless/storages-provider.js +17 -0
  68. package/lib/proxyless/types.js +8 -1
  69. package/lib/proxyless/utils/cdp.js +29 -2
  70. package/lib/proxyless/utils/get-active-client.js +8 -0
  71. package/lib/runner/bootstrapper.js +3 -2
  72. package/lib/runner/browser-job.js +1 -1
  73. package/lib/runner/task/index.js +2 -2
  74. package/lib/services/compiler/service.js +4 -4
  75. package/lib/services/utils/ipc/interfaces.js +1 -1
  76. package/lib/services/utils/ipc/proxy.js +1 -4
  77. package/lib/shared/utils/is-file-protocol.js +9 -0
  78. package/lib/test-run/commands/actions.js +2 -2
  79. package/lib/test-run/index.js +21 -6
  80. package/lib/test-run/request/send.js +20 -13
  81. package/lib/test-run/storages/base.js +16 -0
  82. package/lib/test-run/storages/factory.js +12 -0
  83. package/lib/testcafe.js +3 -3
  84. package/lib/utils/async-event-emitter.js +1 -1
  85. package/lib/utils/convert-to-best-fit-type.js +1 -1
  86. package/lib/utils/get-options/base.js +1 -1
  87. package/lib/utils/setup-sourcemap-support.js +10 -4
  88. package/package.json +13 -8
  89. package/ts-defs/index.d.ts +4 -4
  90. package/ts-defs/selectors.d.ts +2 -2
  91. package/ts-defs/testcafe-scripts.d.ts +2 -2
  92. package/lib/compiler/test-file/exportble-lib-path.js +0 -7
  93. package/lib/proxyless/request-hooks/event-factory.js +0 -95
@@ -1 +1 @@
1
- window["%hammerhead%"].utils.removeInjectedScript(),function cc(dc){var hc=dc.document;!function(c,e,_,E,n){var s="default"in c?c.default:c;e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function t(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function l(t,s,a,l){return new(a=a||e)(function(n,e){function r(t){try{o(l.next(t))}catch(t){e(t)}}function i(t){try{o(l.throw(t))}catch(t){e(t)}}function o(t){var e;t.done?n(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(r,i)}o((l=l.apply(t,s||[])).next())})}function C(n,r){var i,o,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},l={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function t(e){return function(t){return function(e){if(i)throw new TypeError("Generator is already executing.");for(;l&&e[l=0]&&(a=0),a;)try{if(i=1,o&&(s=2&e[0]?o.return:e[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,e[1])).done)return s;switch(o=0,s&&(e=[2&e[0],s.value]),e[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,o=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=r.call(n,a)}catch(t){e=[6,t],o=0}finally{i=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var i,o,a=Math.floor(399);(o=i=i||{}).ready="ready",o.readyForBrowserManipulation="ready-for-browser-manipulation",o.waitForFileDownload="wait-for-file-download";var u=i,d={dispatchEvent:"dispatch-event",click:"click",rightClick:"right-click",doubleClick:"double-click",drag:"drag",dragToElement:"drag-to-element",hover:"hover",scroll:"scroll",scrollBy:"scroll-by",scrollIntoView:"scroll-into-view",typeText:"type-text",selectText:"select-text",selectTextAreaContent:"select-text-area-content",selectEditableContent:"select-editable-content",pressKey:"press-key",wait:"wait",navigateTo:"navigate-to",setFilesToUpload:"set-files-to-upload",clearUpload:"clear-upload",executeClientFunction:"execute-client-function",executeSelector:"execute-selector",takeScreenshot:"take-screenshot",takeElementScreenshot:"take-element-screenshot",takeScreenshotOnFail:"take-screenshot-on-fail",prepareBrowserManipulation:"prepare-browser-manipulation",showAssertionRetriesStatus:"show-assertion-retries-status",hideAssertionRetriesStatus:"hide-assertion-retries-status",setBreakpoint:"set-breakpoint",resizeWindow:"resize-window",resizeWindowToFitDevice:"resize-window-to-fit-device",maximizeWindow:"maximize-window",switchToIframe:"switch-to-iframe",switchToMainWindow:"switch-to-main-window",openWindow:"open-window",closeWindow:"close-window",getCurrentWindow:"get-current-window",getCurrentWindows:"get-current-windows",switchToWindow:"switch-to-window",switchToWindowByPredicate:"switch-to-window-by-predicate",switchToParentWindow:"switch-to-parent-window",switchToPreviousWindow:"switch-to-previous-window",setNativeDialogHandler:"set-native-dialog-handler",getNativeDialogHistory:"get-native-dialog-history",getBrowserConsoleMessages:"get-browser-console-messages",getActiveElement:"get-active-element",setTestSpeed:"set-test-speed",setPageLoadTimeout:"set-page-load-timeout",debug:"debug",disableDebug:"disable-debug",assertion:"assertion",useRole:"useRole",testDone:"test-done",backupStorages:"backup-storages",executeExpression:"execute-expression",executeAsyncExpression:"execute-async-expression",unlockPage:"unlock-page",closeChildWindowOnFileDownloading:"close-child-window-on-file-downloading",recorder:"recorder",prepareClientEnvironmentInDebugMode:"prepare-client-environment-in-debug-mode",getCookies:"get-cookies",setCookies:"set-cookies",deleteCookies:"delete-cookies",getProxyUrl:"get-proxy-url",request:"request",skipJsErrors:"skip-js-errors",addRequestHooks:"add-request-hooks",removeRequestHooks:"remove-request-hooks",runCustomAction:"run-custom-action"};function h(t){return!(f(r=t)||r.type===d.wait||r.type===d.assertion||r.type===d.executeExpression||m(t)||(n=t).type===d.testDone||n.type===d.showAssertionRetriesStatus||n.type===d.hideAssertionRetriesStatus||n.type===d.setBreakpoint||n.type===d.takeScreenshotOnFail||n.type===d.recorder||n.type===d.getProxyUrl)||p(t)&&!((e=t).type===d.switchToIframe||e.type===d.switchToMainWindow);var e,n,r}function f(t){return t.type===d.executeClientFunction||t.type===d.executeSelector}function p(t){return t.type===d.resizeWindow||t.type===d.resizeWindowToFitDevice||t.type===d.maximizeWindow}function m(t){return(e=t).type===d.takeScreenshot||e.type===d.takeElementScreenshot||e.type===d.takeScreenshotOnFail||p(t);var e}function g(t,e){this.code=t,this.isTestCafeError=!0,this.callsite=e||null}var w,v="step",y="E1",I="E4",S="E5",b="E9",W="E10",T="E11",A="E12",R="E24",x="E26",N="E27",D="E28",P="E29",M="E30",F="E31",k="E32",O="E33",L="E34",U="E35",H="E36",B="E37",G="E39",V="E40",q="E41",z="E42",j="E43",X="E44",Y="E45",K="E46",J="E49",$="E50",Q="E51",Z="E52",tt="E57",et="E64",nt="E65",rt="E68",it="E69",ot="E70",st="E71",at="E72",lt="E73",ut="E74",ct="E76",dt="E77",ht="E78",ft="E82",pt="E83",mt="E90",gt="E91",wt="E92",vt="E93",yt="E94",_t="E95",Et="E97",Ct="E99",It="E100",St="E101",bt=(t(Wt,w=g),Wt);function Wt(t,e,n){var r=w.call(this,t)||this;return r.optionName=e,r.actualValue=n,r}var Tt,At=(t(Rt,Tt=g),Rt);function Rt(t,e){var n=Tt.call(this,J,e)||this;return n.instantiationCallsiteName=t,n}var xt,Nt=(t(Dt,xt=g),Dt);function Dt(t,e){var n=xt.call(this,$,e)||this;return n.instantiationCallsiteName=t,n}var Pt,Mt=(t(Ft,Pt=g),Ft);function Ft(t,e,n){var r=void 0===e?{}:e,i=r.apiFnChain,o=r.apiFnIndex,s=r.reason,a=Pt.call(this,t,n)||this;return a.apiFnChain=i,a.apiFnIndex=o,a.reason=s,a}var kt,Ot=(t(Lt,kt=g),Lt);function Lt(t){return kt.call(this,Q,t)||this}var Ut,Ht=(t(Bt,Ut=Mt),Bt);function Bt(t,e){return Ut.call(this,Z,e,t)||this}var Gt,Vt=(t(qt,Gt=g),qt);function qt(t,e){var n=Gt.call(this,y)||this;return n.errStack=t,n.pageDestUrl=e,n}var zt,jt=(t(Xt,zt=g),Xt);function Xt(t,e,n){var r=zt.call(this,I,n)||this;return r.errMsg=String(e),r.instantiationCallsiteName=t,r}var Yt,Kt=(t(Jt,Yt=g),Jt);function Jt(t,e,n,r){var i=Yt.call(this,S,r)||this;return i.errMsg=String(e),i.property=n,i.instantiationCallsiteName=t,i}var $t,Qt=(t(Zt,$t=g),Zt);function Zt(t){var e=$t.call(this,et)||this;return e.errMsg=String(t),e}var te,ee=(t(ne,te=g),ne);function ne(t,e){var n=te.call(this,nt)||this;return n.errMsg=String(t),n.moduleName=e,n}var re,ie=(t(oe,re=bt),oe);function oe(t,e){return re.call(this,b,t,e)||this}var se,ae=(t(le,se=bt),le);function le(t,e){return se.call(this,W,t,e)||this}var ue,ce=(t(de,ue=bt),de);function de(t,e){return ue.call(this,T,t,e)||this}var he,fe=(t(pe,he=bt),pe);function pe(t,e){return he.call(this,A,t,e)||this}var me,ge=(t(we,me=bt),we);function we(t,e){return me.call(this,mt,t,e)||this}var ve,ye=(t(_e,ve=bt),_e);function _e(t,e){return ve.call(this,Et,t,e)||this}var Ee,Ce=(t(Ie,Ee=bt),Ie);function Ie(t,e){return Ee.call(this,gt,t,e)||this}var Se,be=(t(We,Se=bt),We);function We(t,e){return Se.call(this,wt,t,e)||this}var Te,Ae=(t(Re,Te=bt),Re);function Re(t,e){return Te.call(this,vt,t,e)||this}var xe,Ne=(t(De,xe=bt),De);function De(t,e){return xe.call(this,yt,t,e)||this}var Pe,Me=(t(Fe,Pe=bt),Fe);function Fe(t,e){return Pe.call(this,_t,t,e)||this}var ke,Oe=(t(Le,ke=bt),Le);function Le(t,e){return ke.call(this,Ct,t,e)||this}var Ue,He=(t(Be,Ue=g),Be);function Be(t,e,n){var r=Ue.call(this,It)||this;return r.objectName=t,r.propertyName=e,r.availableProperties=n,r}var Ge,Ve=(t(qe,Ge=Mt),qe);function qe(t,e){return Ge.call(this,R,e,t)||this}var ze,je=(t(Xe,ze=Mt),Xe);function Xe(t,e){return ze.call(this,x,e,t)||this}var Ye,Ke=(t(Je,Ye=g),Je);function Je(t){var e=Ye.call(this,N)||this;return e.nodeDescription=t,e}var $e,Qe=(t(Ze,$e=Mt),Ze);function Ze(t,e){var n=$e.call(this,D,e)||this;return n.argumentName=t,n}var tn,en=(t(nn,tn=g),nn);function nn(t){return tn.call(this,St,t)||this}var rn,on=(t(sn,rn=Mt),sn);function sn(t,e){var n=rn.call(this,P,e)||this;return n.argumentName=t,n}var an,ln=(t(un,an=g),un);function un(t,e){var n=an.call(this,M)||this;return n.argumentName=t,n.nodeDescription=e,n}var cn,dn=(t(hn,cn=g),hn);function hn(){return cn.call(this,F)||this}var fn,pn=(t(mn,fn=g),mn);function mn(){return fn.call(this,k)||this}var gn,wn=(t(vn,gn=g),vn);function vn(t){var e=gn.call(this,O)||this;return e.argumentName=t,e}var yn,_n=(t(En,yn=g),En);function En(){return yn.call(this,U)||this}var Cn,In=(t(Sn,Cn=g),Sn);function Sn(t){var e=Cn.call(this,H)||this;return e.argumentName=t,e}var bn,Wn=(t(Tn,bn=g),Tn);function Tn(t,e){var n=bn.call(this,B)||this;return n.filePaths=t,n.scannedFilePaths=e,n}var An,Rn=(t(xn,An=g),xn);function xn(){return An.call(this,L)||this}var Nn,Dn=(t(Pn,Nn=g),Pn);function Pn(t,e){var n=Nn.call(this,q)||this;return n.properties=t?"scrollTargetY property":e?"scrollTargetX property":"scrollTargetX and scrollTargetY properties",n}var Mn,Fn=(t(kn,Mn=g),kn);function kn(t,e){var n=Mn.call(this,tt)||this;return t<=0?e<=0?(n.verb="are",n.dimensions="width and height"):(n.verb="is",n.dimensions="width"):(n.verb="is",n.dimensions="height"),n}var On,Ln=(t(Un,On=g),Un);function Un(t){return On.call(this,V,t)||this}var Hn,Bn=(t(Gn,Hn=g),Gn);function Gn(){return Hn.call(this,G)||this}var Vn,qn=(t(zn,Vn=g),zn);function zn(){return Vn.call(this,z)||this}var jn,Xn=(t(Yn,jn=g),Yn);function Yn(){return jn.call(this,it)||this}var Kn,Jn=(t($n,Kn=g),$n);function $n(){return Kn.call(this,rt)||this}var Qn,Zn=(t(tr,Qn=g),tr);function tr(){return Qn.call(this,ot)||this}var er,nr=(t(rr,er=g),rr);function rr(){return er.call(this,st)||this}var ir,or=(t(sr,ir=g),sr);function sr(){return ir.call(this,lt)||this}var ar,lr=(t(ur,ar=g),ur);function ur(){return ar.call(this,ft)||this}var cr,dr=(t(hr,cr=g),hr);function hr(t){var e=cr.call(this,ht)||this;return e.errMsg=t,e}var fr,pr=(t(mr,fr=g),mr);function mr(){return fr.call(this,ut)||this}var gr,wr=(t(vr,gr=g),vr);function vr(){return gr.call(this,ct)||this}var yr,_r=(t(Er,yr=g),Er);function Er(){return yr.call(this,dt)||this}var Cr,Ir=(t(Sr,Cr=g),Sr);function Sr(){return Cr.call(this,at)||this}var br,Wr=(t(Tr,br=g),Tr);function Tr(){return br.call(this,pt)||this}var Ar,Rr=(t(xr,Ar=g),xr);function xr(){return Ar.call(this,j)||this}var Nr,Dr=(t(Pr,Nr=g),Pr);function Pr(){return Nr.call(this,X)||this}var Mr,Fr=(t(kr,Mr=g),kr);function kr(t,e){var n=Mr.call(this,Y)||this;return n.dialogType=t,n.pageUrl=e,n}var Or,Lr=(t(Ur,Or=g),Ur);function Ur(t,e,n){var r=Or.call(this,K)||this;return r.dialogType=t,r.errMsg=e,r.pageUrl=n,r}var Hr=Object.freeze({__proto__:null,TestRunErrorBase:g,ClientFunctionExecutionInterruptionError:At,DomNodeClientFunctionResultError:Nt,SelectorErrorBase:Mt,InvalidSelectorResultError:Ot,CannotObtainInfoForElementSpecifiedBySelectorError:Ht,UncaughtErrorOnPage:Vt,UncaughtErrorInClientFunctionCode:jt,UncaughtErrorInCustomDOMPropertyCode:Kt,UncaughtErrorInCustomClientScriptCode:Qt,UncaughtErrorInCustomClientScriptLoadedFromModule:ee,ActionIntegerOptionError:ie,ActionPositiveIntegerOptionError:ae,ActionBooleanOptionError:ce,ActionSpeedOptionError:fe,ActionStringOptionError:ge,ActionStringOrRegexOptionError:ye,ActionDateOptionError:Ce,ActionNumberOptionError:be,ActionUrlOptionError:Ae,ActionUrlSearchParamsOptionError:Ne,ActionObjectOptionError:Me,ActionFunctionOptionError:Oe,ActionInvalidObjectPropertyError:He,ActionElementNotFoundError:Ve,ActionElementIsInvisibleError:je,ActionSelectorMatchesWrongNodeTypeError:Ke,ActionAdditionalElementNotFoundError:Qe,ActionElementIsNotTargetError:en,ActionAdditionalElementIsInvisibleError:on,ActionAdditionalSelectorMatchesWrongNodeTypeError:ln,ActionElementNonEditableError:dn,ActionElementNotTextAreaError:pn,ActionElementNonContentEditableError:wn,ActionRootContainerNotFoundError:_n,ActionIncorrectKeysError:In,ActionCannotFindFileToUploadError:Wn,ActionElementIsNotFileInputError:Rn,ActionInvalidScrollTargetError:Dn,InvalidElementScreenshotDimensionsError:Fn,ActionElementNotIframeError:Ln,ActionIframeIsNotLoadedError:Bn,CurrentIframeIsNotLoadedError:qn,ChildWindowNotFoundError:Xn,ChildWindowIsNotLoadedError:Jn,CannotSwitchToWindowError:Zn,CloseChildWindowError:nr,CannotCloseWindowWithChildrenError:or,CannotCloseWindowWithoutParentError:lr,SwitchToWindowPredicateError:dr,WindowNotFoundError:pr,ParentWindowNotFoundError:wr,PreviousWindowNotFoundError:_r,ChildWindowClosedBeforeSwitchingError:Ir,CannotRestoreChildWindowError:Wr,CurrentIframeNotFoundError:Rr,CurrentIframeIsInvisibleError:Dr,NativeDialogNotHandledError:Fr,UncaughtErrorInNativeDialogHandler:Lr}),Br="_nativeMethods",Gr=(Vr.prototype._ensureNativeMethods=function(t){return t||{objectKeys:Object.keys,arrayForEach:Array.prototype.forEach,arrayConcat:Array.prototype.concat,arraySlice:Array.prototype.slice,objectDefineProperty:Object.defineProperty}},Vr.prototype._getWindowIds=function(t){return this[Br].objectKeys(t)},Vr.prototype._copyArray=function(t){return this[Br].arraySlice.call(t)},Vr.prototype._concatArrays=function(t,e){return this[Br].arrayConcat.call(t,e)},Vr.prototype.ensureMessageContainer=function(t){this[t]||(this[t]={log:[],info:[],warn:[],error:[]})},Vr.prototype.concat=function(e){var n=this;if(!e)return this;var t=this._getWindowIds(e);return this[Br].arrayForEach.call(t,function(t){n.ensureMessageContainer(t),n[t].log=n._concatArrays(n[t].log,e[t].log),n[t].info=n._concatArrays(n[t].info,e[t].info),n[t].warn=n._concatArrays(n[t].warn,e[t].warn),n[t].error=n._concatArrays(n[t].error,e[t].error)}),this},Vr.prototype.addMessage=function(t,e,n){this.ensureMessageContainer(n),this[n][t].push(e)},Vr.prototype.getCopy=function(){var e=this,n={},t=this._getWindowIds(this);return this[Br].arrayForEach.call(t,function(t){n[t]={log:e._copyArray(e[t].log),info:e._copyArray(e[t].info),warn:e._copyArray(e[t].warn),error:e._copyArray(e[t].error)}}),n},Vr);function Vr(t,e){var n=this._ensureNativeMethods(e);n.objectDefineProperty(this,Br,{value:n}),this.concat(t)}var qr,zr=(t(jr,qr=Gr),jr);function jr(t){return qr.call(this,t,c.nativeMethods)||this}var Xr,Yr,Kr=(function(t){function n(t){return!!s[t]}function r(t,e){this.references=t,this.transforms=e,this.circularCandidates=[],this.circularCandidatesDescrs=[],this.circularRefCount=0}var o=/^#*@(t|r)$/,i=(0,eval)("this"),s={Int8Array:"function"==typeof Int8Array?Int8Array:void 0,Uint8Array:"function"==typeof Uint8Array?Uint8Array:void 0,Uint8ClampedArray:"function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0,Int16Array:"function"==typeof Int16Array?Int16Array:void 0,Uint16Array:"function"==typeof Uint16Array?Uint16Array:void 0,Int32Array:"function"==typeof Int32Array?Int32Array:void 0,Uint32Array:"function"==typeof Uint32Array?Uint32Array:void 0,Float32Array:"function"==typeof Float32Array?Float32Array:void 0,Float64Array:"function"==typeof Float64Array?Float64Array:void 0},a="function"==typeof ArrayBuffer,l="function"==typeof Map,u="function"==typeof Set,c="function"==typeof Buffer,d=Array.prototype.slice,e={serialize:function(t){return JSON.stringify(t)},deserialize:function(t){return JSON.parse(t)}};function h(t,e){this.references=t,this.transformMap=e,this.activeTransformsStack=[],this.visitedRefs=Object.create(null)}r._createRefMark=function(t){var e=Object.create(null);return e["@r"]=t,e},r.prototype._createCircularCandidate=function(t,e,n){this.circularCandidates.push(t),this.circularCandidatesDescrs.push({parent:e,key:n,refIdx:-1})},r.prototype._applyTransform=function(t,e,n,r){var i=Object.create(null),o=r.toSerializable(t);return"object"==typeof o&&this._createCircularCandidate(t,e,n),i["@t"]=r.type,i.data=this._handleValue(o,e,n),i},r.prototype._handleArray=function(t){for(var e=[],n=0;n<t.length;n++)e[n]=this._handleValue(t[n],e,n);return e},r.prototype._handlePlainObject=function(n){var r=this,i=Object.create(null);return Object.getOwnPropertyNames(n).forEach(function(t){var e=o.test(t)?"#"+t:t;i[e]=r._handleValue(n[t],i,e)}),i},r.prototype._handleObject=function(t,e,n){return this._createCircularCandidate(t,e,n),Array.isArray(t)?this._handleArray(t):this._handlePlainObject(t)},r.prototype._ensureCircularReference=function(t){var e=this.circularCandidates.indexOf(t);if(-1<e){var n=this.circularCandidatesDescrs[e];return-1===n.refIdx&&(n.refIdx=n.parent?++this.circularRefCount:0),r._createRefMark(n.refIdx)}return null},r.prototype._handleValue=function(t,e,n){var r=typeof t,i="object"==r&&null!==t;if(i){var o=this._ensureCircularReference(t);if(o)return o}for(var s=0;s<this.transforms.length;s++){var a=this.transforms[s];if(a.shouldTransform(r,t))return this._applyTransform(t,e,n,a)}return i?this._handleObject(t,e,n):t},r.prototype.transform=function(){for(var t=[this._handleValue(this.references,null,null)],e=0;e<this.circularCandidatesDescrs.length;e++){var n=this.circularCandidatesDescrs[e];0<n.refIdx&&(t[n.refIdx]=n.parent[n.key],n.parent[n.key]=r._createRefMark(n.refIdx))}return t},h.prototype._handlePlainObject=function(e){var t,n=this,r=Object.create(null),i=Object.getOwnPropertyNames(e);for(t in i.forEach(function(t){n._handleValue(e[t],e,t),o.test(t)&&(r[t.substring(1)]=e[t],delete e[t])}),r)e[t]=r[t]},h.prototype._handleTransformedObject=function(t,e,n){var r=t["@t"],i=this.transformMap[r];if(!i)throw new Error("Can't find transform for \""+r+'" type.');this.activeTransformsStack.push(t),this._handleValue(t.data,t,"data"),this.activeTransformsStack.pop(),e[n]=i.fromSerializable(t.data)},h.prototype._handleCircularSelfRefDuringTransform=function(t,e,n){var r=this.references,i=void 0;Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:function(){return void 0===i&&(i=r[t]),i},set:function(t){return i=t}})},h.prototype._handleCircularRef=function(t,e,n){-1<this.activeTransformsStack.indexOf(this.references[t])?this._handleCircularSelfRefDuringTransform(t,e,n):(this.visitedRefs[t]||(this.visitedRefs[t]=!0,this._handleValue(this.references[t],this.references,t)),e[n]=this.references[t])},h.prototype._handleValue=function(t,e,n){if("object"==typeof t&&null!==t){var r=t["@r"];if(void 0!==r)this._handleCircularRef(r,e,n);else if(t["@t"])this._handleTransformedObject(t,e,n);else if(Array.isArray(t))for(var i=0;i<t.length;i++)this._handleValue(t[i],t,i);else this._handlePlainObject(t)}},h.prototype.transform=function(){return this.visitedRefs[0]=!0,this._handleValue(this.references[0],this.references,0),this.references[0]};var f=[{type:"[[NaN]]",shouldTransform:function(t,e){return"number"===t&&isNaN(e)},toSerializable:function(){return""},fromSerializable:function(){return NaN}},{type:"[[undefined]]",shouldTransform:function(t){return"undefined"===t},toSerializable:function(){return""},fromSerializable:function(){}},{type:"[[Date]]",shouldTransform:function(t,e){return e instanceof Date},toSerializable:function(t){return t.getTime()},fromSerializable:function(t){var e=new Date;return e.setTime(t),e}},{type:"[[RegExp]]",shouldTransform:function(t,e){return e instanceof RegExp},toSerializable:function(t){var e={src:t.source,flags:""};return t.global&&(e.flags+="g"),t.ignoreCase&&(e.flags+="i"),t.multiline&&(e.flags+="m"),e},fromSerializable:function(t){return new RegExp(t.src,t.flags)}},{type:"[[Error]]",shouldTransform:function(t,e){return e instanceof Error},toSerializable:function(t){return{name:t.name,message:t.message,stack:t.stack}},fromSerializable:function(t){var e=new(i[t.name]||Error)(t.message);return e.stack=t.stack,e}},{type:"[[ArrayBuffer]]",shouldTransform:function(t,e){return a&&e instanceof ArrayBuffer},toSerializable:function(t){var e=new Int8Array(t);return d.call(e)},fromSerializable:function(t){if(a){var e=new ArrayBuffer(t.length);return new Int8Array(e).set(t),e}return t}},{type:"[[Buffer]]",shouldTransform:function(t,e){return c&&e instanceof Buffer},toSerializable:function(t){return d.call(t)},fromSerializable:function(t){return c?Buffer.from(t):t}},{type:"[[TypedArray]]",shouldTransform:function(t,e){return Object.keys(s).some(function(t){return n(t)&&e instanceof s[t]})},toSerializable:function(t){return{ctorName:t.constructor.name,arr:d.call(t)}},fromSerializable:function(t){return n(t.ctorName)?new s[t.ctorName](t.arr):t.arr}},{type:"[[Map]]",shouldTransform:function(t,e){return l&&e instanceof Map},toSerializable:function(t){var n=[];return t.forEach(function(t,e){n.push(e),n.push(t)}),n},fromSerializable:function(t){if(l){for(var e=new Map,n=0;n<t.length;n+=2)e.set(t[n],t[n+1]);return e}for(var r=[],i=0;i<t.length;i+=2)r.push([t[n],t[n+1]]);return r}},{type:"[[Set]]",shouldTransform:function(t,e){return u&&e instanceof Set},toSerializable:function(t){var e=[];return t.forEach(function(t){e.push(t)}),e},fromSerializable:function(t){if(u){for(var e=new Set,n=0;n<t.length;n++)e.add(t[n]);return e}return t}}],p=t.exports=function(t){this.transforms=[],this.transformsMap=Object.create(null),this.serializer=t||e,this.addTransforms(f)};p.prototype.addTransforms=function(t){t=Array.isArray(t)?t:[t];for(var e=0;e<t.length;e++){var n=t[e];if(this.transformsMap[n.type])throw new Error('Transform with type "'+n.type+'" was already added.');this.transforms.push(n),this.transformsMap[n.type]=n}return this},p.prototype.removeTransforms=function(t){t=Array.isArray(t)?t:[t];for(var e=0;e<t.length;e++){var n=t[e],r=this.transforms.indexOf(n);-1<r&&this.transforms.splice(r,1),delete this.transformsMap[n.type]}return this},p.prototype.encode=function(t){var e=new r(t,this.transforms).transform();return this.serializer.serialize(e)},p.prototype.decode=function(t){var e=this.serializer.deserialize(t);return new h(e,this.transformsMap).transform()}}(Xr={exports:{}}),Xr.exports),Jr=function(t){return t};function $r(t){return new Kr({serialize:Jr,deserialize:Jr}).addTransforms(t)}var Qr=1,Zr=2,ti=3,ei=((Yr={})[Qr]=/^\.filterVisible\(\)$/,Yr[Zr]=/^\.filterHidden\(\)$/,Yr[ti]=/^\.nth\(\d+\)$/,Yr);function ni(){this._err=null}var ri=(Object.defineProperty(ni.prototype,"error",{get:function(){return this._err},set:function(t){null===this._err&&(this._err=t)},enumerable:!1,configurable:!0}),ni.prototype.filter=function(t,e,n){if(e.filterVisible&&(t=t.filter(_.positionUtils.isElementVisible),this._assertFilterError(t,n,Qr)),e.filterHidden&&(t=t.filter(function(t){return!_.positionUtils.isElementVisible(t)}),this._assertFilterError(t,n,Zr)),e.counterMode)return null===e.index?t.length:ni._getNodeByIndex(t,e.index)?1:0;var r;if(e.collectionMode)return null!==e.index&&(t=(r=ni._getNodeByIndex(t,e.index))?[r]:[],this._assertFilterError(t,n,ti)),t;var i=ni._getNodeByIndex(t,e.index||0);return i||(this.error=ni._getErrorItem(n,ti)),i},ni.prototype.cast=function(t){if(null==t)return[];if(t instanceof c.nativeMethods.Node)return[t];if(function(t){if(c.nativeMethods.isArray(t)){for(var e=0;e<t.length;e++)if(!(t[e]instanceof c.nativeMethods.Node))return;return 1}}(t))return t;if((e=t)instanceof c.nativeMethods.HTMLCollection||e instanceof c.nativeMethods.NodeList)return function(t){for(var e=t.length,n=[],r=0;r<e;r++)n.push(t[r]);return n}(t);var e;throw new Ot},ni.prototype._assertFilterError=function(t,e,n){0===t.length&&(this.error=ni._getErrorItem(e,n))},ni._getErrorItem=function(t,e){var n=t.apiFnChain,r=t.apiFnID;if(e)for(var i=r;i<n.length;i++)if(ei[e].test(n[i]))return i;return null},ni._getNodeByIndex=function(t,e){return e<0?t[t.length+e]:t[e]},new ni);function ii(t,e){return new c.nativeMethods.Function("fnCode","__dependencies$","Promise","RegExp",'"use strict"; return eval(fnCode)')(t,e,c.Promise,RegExp)}var oi=(si.prototype.shouldTransform=function(t){return"function"===t},si.prototype.toSerializable=function(){return""},si.prototype.fromSerializable=function(t){var e=t.fnCode,n=t.dependencies;return"filterOptions"in n&&(n.selectorFilter=ri),ii(e,n)},si);function si(){this.type="Function"}var ai=(li.prototype.shouldTransform=function(t,e){if(e instanceof c.nativeMethods.Node)throw new Nt(this._instantiationCallsiteName);return!1},li.prototype.toSerializable=function(){},li.prototype.fromSerializable=function(){},li);function li(t){this.type="Node",this._instantiationCallsiteName=t}var ui=(ci.prototype.getResult=function(){var e=this;return c.Promise.resolve().then(function(){var t=e.replicator.decode(e.command.args);return e._executeFn(t)}).catch(function(t){throw t.isTestCafeError||(t=new jt(e.command.instantiationCallsiteName,t)),t})},ci.prototype.encodeResult=function(t){return this.replicator.encode(t)},ci.prototype._createReplicator=function(){return $r([new ai(this.command.instantiationCallsiteName),new oi])},ci.prototype._executeFn=function(t){return this.fn.apply(dc,t)},ci);function ci(t){this.command=t,this.replicator=this._createReplicator(),this.dependencies=this.replicator.decode(t.dependencies),this.fn=ii(t.fnCode,this.dependencies)}var di="appeared-dialog",hi="unexpected-dialog",fi="handler-error",pi=s.eventSandbox.message,mi=s.processScript,gi=s.nativeMethods,wi="testcafe|native-dialog-tracker|appeared-dialogs",vi="testcafe|native-dialog-tracker|unexpected-dialog",yi="testcafe|native-dialog-tracker|error-in-handler",_i=mi("window.location.href"),Ei=(Object.defineProperty(Ci.prototype,"appearedDialogs",{get:function(){var t=this.contextStorage.getItem(wi);return t||(t=[],this.appearedDialogs=t),t},set:function(t){this.contextStorage.setItem(wi,t)},enumerable:!1,configurable:!0}),Object.defineProperty(Ci.prototype,"unexpectedDialog",{get:function(){return this.contextStorage.getItem(vi)},set:function(t){this.contextStorage.setItem(vi,t)},enumerable:!1,configurable:!0}),Object.defineProperty(Ci.prototype,"handlerError",{get:function(){return this.contextStorage.getItem(yi)},set:function(t){this.contextStorage.setItem(yi,t)},enumerable:!1,configurable:!0}),Ci._getPageUrl=function(){return gi.eval(_i)},Ci.prototype._initListening=function(){var n=this;pi.on(pi.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message;e.type===di?n._addAppearedDialogs(e.dialogType,e.text,e.url):e.type!==hi||n.unexpectedDialog?e.type!==fi||n.handlerError||n._onHandlerError(e.dialogType,e.message,e.url):n.unexpectedDialog={type:e.dialogType,url:e.url}})},Ci.prototype._init=function(){var e=this;s.on(s.EVENTS.beforeUnload,function(t){t.prevented&&!t.isFakeIEEvent&&(e.dialogHandler?e._createDialogHandler("beforeunload")(t.returnValue||""):e._defaultDialogHandler("beforeunload")),e.contextStorage&&e.contextStorage.save()}),dc.alert=function(){return e._defaultDialogHandler("alert")},dc.confirm=function(){return e._defaultDialogHandler("confirm")},dc.prompt=function(){return e._defaultDialogHandler("prompt")}},Ci.prototype._createDialogHandler=function(i){var o=this;return function(t){var e=Ci._getPageUrl();o._addAppearedDialogs(i,t,e);var n=new ui(o.dialogHandler),r=null;try{r=n.fn.apply(dc,[i,t,e])}catch(t){o._onHandlerError(i,t.message||String(t),e)}return r}},Ci.prototype._defaultDialogHandler=function(t){var e=Ci._getPageUrl();this.unexpectedDialog=this.unexpectedDialog||{type:t,url:e}},Ci.prototype._addAppearedDialogs=function(t,e,n){this.appearedDialogs.splice(0,0,{type:t,text:e,url:n})},Ci.prototype._onHandlerError=function(t,e,n){this.handlerError=this.handlerError||{type:t,message:e,url:n}},Ci.prototype.setHandler=function(t){var e=this;this.dialogHandler=t,["alert","confirm","prompt"].forEach(function(t){dc[t]=e.dialogHandler?e._createDialogHandler(t):function(){return e._defaultDialogHandler(t)}})},Ci.prototype.getUnexpectedDialogError=function(){var t=this.unexpectedDialog,e=this.handlerError;return this.unexpectedDialog=null,this.handlerError=null,t?new Fr(t.type,t.url):e?new Lr(e.type,e.message,e.url):null},Ci);function Ci(t,e){this.contextStorage=t,this.dialogHandler=e,this._init(),this._initListening(),this.dialogHandler&&this.setHandler(e)}function Ii(){return c.nativeMethods.performanceNow().toString()}function Si(t){this.type=t,this.id=Ii()}var bi,Wi="driver|establish-connection",Ti="driver|switch-to-window",Ai="driver|close-window",Ri="driver|close-window-validation",xi="driver|switch-to-window-validation",Ni="driver|get-windows",Di="driver|command-executed",Pi="driver|execute-command",Mi="driver|confirmation",Fi="driver|set-native-dialog-handler",ki="driver|set-as-master",Oi="driver|close-all-child-windows",Li="driver|start-to-restore-child-link",Ui="driver|restore-child-link",Hi="driver|child-window-is-loaded-in-iframe",Bi="driver|child-window-is-opened-in-iframe",Gi="driver|stop-internal-from-iframe",Vi="driver|has-pending-action-flags",qi=(t(zi,bi=Si),zi);function zi(){return bi.call(this,Wi)||this}var ji,Xi=(t(Yi,ji=Si),Yi);function Yi(t){var e=t.windowId,n=ji.call(this,Ri)||this;return n.windowId=e,n}var Ki,Ji=(t($i,Ki=Si),$i);function $i(t){var e=t.windowId,n=t.fn,r=Ki.call(this,xi)||this;return r.windowId=e,r.fn=n,r}var Qi,Zi=(t(to,Qi=Si),to);function to(){return Qi.call(this,Ni)||this}var eo,no=(t(ro,eo=Si),ro);function ro(t){var e=t.windowId,n=t.isCurrentWindow,r=eo.call(this,Ai)||this;return r.windowId=e,r.isCurrentWindow=n,r}var io,oo=(t(so,io=Si),so);function so(t){var e=t.windowId,n=t.fn,r=io.call(this,Ti)||this;return r.windowId=e,r.fn=n,r}var ao,lo=(t(uo,ao=Si),uo);function uo(t){var e=ao.call(this,Di)||this;return e.driverStatus=t,e}var co,ho=(t(fo,co=Si),fo);function fo(t,e){var n=co.call(this,Pi)||this;return n.command=t,n.testSpeed=e,n}var po,mo=(t(go,po=Si),go);function go(t,e){var n=po.call(this,Mi)||this;return n.requestMessageId=t,n.result=e,n}var wo,vo=(t(yo,wo=Si),yo);function yo(t){var e=wo.call(this,Fi)||this;return e.dialogHandler=t,e}var _o,Eo=(t(Co,_o=Si),Co);function Co(t){var e=_o.call(this,ki)||this;return e.finalizePendingCommand=t,e}var Io,So=(t(bo,Io=Si),bo);function bo(){return Io.call(this,Oi)||this}var Wo,To=(t(Ao,Wo=Si),Ao);function Ao(){return Wo.call(this,Li)||this}var Ro,xo=(t(No,Ro=Si),No);function No(t){var e=Ro.call(this,Ui)||this;return e.windowId=t,e}var Do,Po=(t(Mo,Do=Si),Mo);function Mo(t){var e=Do.call(this,Hi)||this;return e.windowId=t,e}var Fo,ko=(t(Oo,Fo=Si),Oo);function Oo(){return Fo.call(this,Bi)||this}var Lo,Uo=(t(Ho,Lo=Si),Ho);function Ho(){return Lo.call(this,Gi)||this}var Bo,Go=(t(Vo,Bo=Si),Vo);function Vo(){return Bo.call(this,Vi)||this}var qo=s.json,zo=s.nativeMethods,jo=(Xo.prototype._createStorageKey=function(t,e){var n="testcafe|driver|"+t;return e?n+"|"+e:n},Xo.prototype._loadFromStorage=function(){var t=zo.storageGetItem.call(this.storage,this.storageKey);t&&(this.data=qo.parse(t),zo.storageRemoveItem.call(this.storage,this.storageKey))},Xo.prototype.save=function(){zo.storageSetItem.call(this.storage,this.storageKey,qo.stringify(this.data))},Xo.prototype.setItem=function(t,e){this.data[t]=e,this.save()},Xo.prototype.getItem=function(t){return this.data[t]},Xo.prototype.dispose=function(){zo.storageRemoveItem.call(this.storage,this.storageKey)},Xo);function Xo(t,e,n){this.storage=zo.winSessionStorageGetter.call(t),this.storageKey=this._createStorageKey(e,n),this.data={},this._loadFromStorage()}var Yo=Object.prototype.toString,Ko=String.prototype.indexOf,Jo=String.prototype.endsWith||function(t,e){var n=Yo.call(this);(void 0===e||e>n.length)&&(e=n.length),e-=t.length;var r=Ko.call(n,t,e);return-1!==r&&r===e},$o=Array.prototype.indexOf,Qo=Array.prototype.map,Zo=Array.prototype.sort,ts=Array.prototype.filter,es=Array.prototype.concat,ns="Command",rs=(is.prototype.getAssignableProperties=function(){return[]},is.prototype.getAllAssignableProperties=function(){for(var t=Object.getPrototypeOf(this),e=[];t&&t.getAssignableProperties;)e=es.call(e,t.getAssignableProperties()),t=Object.getPrototypeOf(t);return e},is.prototype.getNonReportedProperties=function(){return[]},is.prototype.getReportedProperties=function(){var t=Qo.call(this.getAllAssignableProperties(),function(t){return t.name}),e=this.getNonReportedProperties();return ts.call(t,function(t){return!(-1<$o.call(e,t))})},is.prototype._assignFrom=function(t,e,n){if(void 0===n&&(n={}),t){e&&function(t,e){var n,r=e.constructor.name,i=Qo.call(e.getAllAssignableProperties(),function(t){return t.name}),o=Zo.call(e.getReportedProperties());for(n in t)if(!(-1<$o.call(i,n)||n in e))throw new He(r,n,o)}(t,this);for(var r,i,o=this.getAllAssignableProperties(),s=0;s<o.length;s++){var a=o[s],l=a.name,u=a.type,c=a.required,d=a.init,h=a.defaultValue;void 0!==h&&(this[l]=h);var f=t[l];void 0===f&&!c||(e&&u&&u((r=this.constructor.name,i=l,Jo.call(r,ns)?i:"".concat(r,".").concat(i)),f),this[l]=d?d(l,f,n,e):f)}}},is);function is(){}var os,ss=(t(as,os=rs),as.prototype.getAssignableProperties=function(){return[{name:"isCommandResult"},{name:"executionError"},{name:"pageError"},{name:"result"},{name:"consoleMessages"},{name:"isPendingWindowSwitching"},{name:"isObservingFileDownloadingInNewWindow"},{name:"isFirstRequestAfterWindowSwitching"},{name:"warnings"}]},as);function as(t){var e=os.call(this,t)||this;return e.id=Ii(),e.isCommandResult=!1,e.executionError=null,e.pageError=null,e.resent=!1,e.result=null,e.consoleMessages=null,e.isPendingWindowSwitching=!1,e.isObservingFileDownloadingInNewWindow=!1,e.isFirstRequestAfterWindowSwitching=!1,e.debug="",e.warnings=null,e._assignFrom(t,!0),e}function ls(n,t,e,r){var i=null,o=null,s=null;return e=Math.max(e||0,2500),c.Promise.race([_.delay(e),new c.Promise(function(e){s=function(t){t.message.type===Mi&&t.message.requestMessageId===n.id&&e(t.message)},c.eventSandbox.message.on(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,s),i=c.nativeMethods.setInterval.call(dc,function(){return c.eventSandbox.message.sendServiceMsg(n,t)},1e3),c.eventSandbox.message.sendServiceMsg(n,t)})]).then(function(t){if(c.nativeMethods.clearInterval.call(dc,i),c.nativeMethods.clearTimeout.call(dc,o),c.eventSandbox.message.off(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,s),!t)throw new r;return t})}var us=2e4;function cs(t){var e=t.requestMsgId,n=t.result,r=t.window,i=new mo(e,n);c.eventSandbox.message.sendServiceMsg(i,r)}var ds=(Object.defineProperty(hs.prototype,"availabilityTimeout",{set:function(t){this.iframeAvailabilityTimeout=t},enumerable:!1,configurable:!0}),hs.prototype._ensureIframe=function(){var t=this;return _.domUtils.isElementInDocument(this.driverIframe)?_.waitFor(function(){return _.positionUtils.isIframeVisible(t.driverIframe)?t.driverIframe:null},200,this.iframeAvailabilityTimeout).catch(function(){throw new Dr}):c.Promise.reject(new Rr)},hs.prototype._waitForIframeRemovedOrHidden=function(){var e=this;return new c.Promise(function(t){e.checkIframeInterval=c.nativeMethods.setInterval.call(dc,function(){e._ensureIframe().catch(function(){return _.delay(500).then(function(){return t(new ss({isCommandResult:!0}))})})},1e3)})},hs.prototype._waitForCommandResult=function(){var e=this,n=null;return c.Promise.race([this._waitForIframeRemovedOrHidden(),new c.Promise(function(e){n=function(t){t.message.type===Di&&e(t.message.driverStatus)},c.eventSandbox.message.on(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,n)})]).then(function(t){return c.eventSandbox.message.off(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,n),c.nativeMethods.clearInterval.call(dc,e.checkIframeInterval),t})},hs.prototype.sendConfirmationMessage=function(t){cs({requestMsgId:t,result:{id:this.driverId},window:this.driverWindow})},hs.prototype.executeCommand=function(e,n){var r=this;return this._ensureIframe().then(function(){var t=new ho(e,n);return c.Promise.all([ls(t,r.driverWindow,r.iframeAvailabilityTimeout,qn),r._waitForCommandResult()])}).then(function(t){return t[1]})},hs);function hs(t,e){this.driverWindow=t,this.driverIframe=_.domUtils.findIframeByWindow(t),this.driverId=e,this.iframeAvailabilityTimeout=0}var fs=["nodeType","textContent","childNodeCount","hasChildNodes","childElementCount","hasChildElements"],ps=["tagName","attributes"],ms=["tagName","visible","focused","attributes","boundingClientRect","classNames","style","innerText","namespaceURI","id","value","checked","selected","selectedIndex","scrollWidth","scrollHeight","scrollLeft","scrollTop","offsetWidth","offsetHeight","offsetLeft","offsetTop","clientWidth","clientHeight","clientLeft","clientTop"],gs={childNodeCount:function(t){return t.childNodes.length},hasChildNodes:function(t){return!!gs.childNodeCount(t)},childElementCount:function(t){var e=t.children;if(e)return e.length;for(var n=0,r=t.childNodes.length,i=0;i<r;i++)1===t.childNodes[i].nodeType&&n++;return n},hasChildElements:function(t){return!!gs.childElementCount(t)}},ws=(vs.prototype._initializeProperties=function(t,e,n){for(var r=0,i=e;r<i.length;r++){var o=i[r],s=n[o];this[o]=s?s(t):t[o]}},vs);function vs(){}var ys,_s=(t(Es,ys=ws),Es);function Es(t){var e=ys.call(this)||this;return e._initializeProperties(t,fs,gs),e}var Cs,Is={tagName:function(t){return t.tagName.toLowerCase()},visible:function(t){return _.positionUtils.isElementVisible(t)},focused:function(t){return c.utils.dom.getActiveElement()===t},attributes:function(t){for(var e=t.attributes,n={},r=e.length-1;0<=r;r--)n[e[r].name]=e[r].value;return n},boundingClientRect:function(t){var e=t.getBoundingClientRect();return{left:e.left,right:e.right,top:e.top,bottom:e.bottom,width:e.width,height:e.height}},classNames:function(t){var e=t.className;return"string"==typeof e.animVal&&(e=e.animVal),e.replace(/^\s+|\s+$/g,"").split(/\s+/g)},style:function(t){for(var e={},n=dc.getComputedStyle(t),r=0;r<n.length;r++){var i=n[r];e[i]=n[i]}return e},innerText:function(t){return t.innerText}},Ss=(t(bs,Cs=ws),bs);function bs(t){var e=Cs.call(this)||this;return e._initializeProperties(t,ps,Is),e}var Ws,Ts=(t(As,Ws=_s),As);function As(t){var e=Ws.call(this,t)||this;return e._initializeProperties(t,ms,Is),e}var Rs=(xs.prototype._extend=function(t,e){for(var n=0,r=c.nativeMethods.objectKeys(this._customDOMProperties);n<r.length;n++){var i=r[n];try{t[i]=this._customDOMProperties[i](e)}catch(t){throw new Kt(this._instantiationCallsiteName,t,i)}}},xs.prototype.shouldTransform=function(t,e){return e instanceof c.nativeMethods.Node},xs.prototype.toSerializable=function(t){var e=new(1===t.nodeType?Ts:_s)(t);return this._extend(e,t),e},xs.prototype.fromSerializable=function(){},xs);function xs(t,e){void 0===t&&(t={}),this.type="Node",this._customDOMProperties=t,this._instantiationCallsiteName=e}var Ns=(Ds.prototype.on=function(t,e){this._eventsListeners[t]||(this._eventsListeners[t]=[]),this._eventsListeners[t].push(e)},Ds.prototype.once=function(n,r){var i=this;this.on(n,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i.off(n,r),r.apply(void 0,t)})},Ds.prototype.off=function(t,e){var n=this._eventsListeners[t];n&&(this._eventsListeners[t]=c.nativeMethods.arrayFilter.call(n,function(t){return t!==e}))},Ds.prototype.offAll=function(t){t?this._eventsListeners[t]=[]:this._eventsListeners={}},Ds.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._eventsListeners[e];if(r)for(var i=0;i<r.length;i++)try{r[i].apply(this,t)}catch(t){if(!(t.message&&-1<t.message.indexOf("freed script")))throw t;this.off(e,r[i])}},Ds);function Ds(){this._eventsListeners={}}var Ps=s.Promise,Ms=s.nativeMethods;function Fs(e){return new Ps(function(t){return Ms.setTimeout.call(dc,t,e)})}var ks={1:"element",2:"attribute",3:"text",4:"cdata section",5:"entity reference",6:"entity node",7:"processing instruction",8:"comment",9:"document",10:"document type",11:"document fragment",12:"notation"};function Os(t){return t?{name:"ActionAdditionalElementIsInvisibleError",firstArg:t}:"ActionElementIsInvisibleError"}function Ls(t){return t?{name:"ActionAdditionalElementNotFoundError",firstArg:t}:"ActionElementNotFoundError"}function Us(t){var e="string"==typeof t?Hr[t]:Hr[t.name],n="string"==typeof t?null:t.firstArg;return function(t){return new e(n,t)}}var Hs=(Bs.prototype.push=function(t,r){var i=this;this._ensureElementsPromise=this._ensureElementsPromise.then(function(){return i._executeSelectorFn(t,{invisible:Os(r),notFound:Ls(r)},i._ensureElementsStartTime)}).then(function(t){if(!_.domUtils.isDomElement(t)){var e=t.nodeType,n=ks[e];throw r?new ln(r,n):new Ke(n)}i._elements.push(t)})},Bs.prototype.getElements=function(){var t=this;return this._ensureElementsPromise.then(function(){return t._elements})},Bs);function Bs(t,e){this._globalSelectorTimeout=t,this._ensureElementsStartTime=c.nativeMethods.dateNow(),this._ensureElementsPromise=c.Promise.resolve(),this._executeSelectorFn=e,this._elements=[]}var Gs=(Vs.create=function(t){return new Vs(t.top,t.right,t.bottom,t.left)},Vs.prototype.add=function(t){return this.top+=t.top,this.right+=t.right,this.bottom+=t.bottom,this.left+=t.left,this},Vs.prototype.sub=function(t){return"top"in t&&(this.top-=t.top,this.left-=t.left),this.bottom-=t.bottom,this.right-=t.right,this},Vs.prototype.round=function(t,e){return void 0===t&&(t=Math.round),void 0===e&&(e=t),this.top=t(this.top),this.right=e(this.right),this.bottom=e(this.bottom),this.left=t(this.left),this},Vs.prototype.contains=function(t){return t.x>=this.left&&t.x<=this.right&&t.y>=this.top&&t.y<=this.bottom},Vs);function Vs(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.top=t,this.right=e,this.bottom=n,this.left=r}function qs(t){var e="array"+t.charAt(0).toUpperCase()+t.slice(1),n=c.nativeMethods[e];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.call.apply(n,t)}}qs("filter"),qs("map"),qs("slice"),qs("splice"),qs("unshift"),qs("forEach"),qs("indexOf"),qs("some"),qs("reverse"),qs("reduce"),qs("concat"),qs("join"),s.utils.browser,s.nativeMethods,s.utils.style.get,s.utils.dom.getActiveElement,s.utils.dom.findDocument,s.utils.dom.find,s.utils.dom.isElementInDocument;var zs=s.utils.dom.isElementInIframe,js=s.utils.dom.getIframeByElement,Xs=(s.utils.dom.isCrossDomainWindows,s.utils.dom.getSelectParent,s.utils.dom.getChildVisibleIndex,s.utils.dom.getSelectVisibleChildren,s.utils.dom.isElementNode,s.utils.dom.isTextNode,s.utils.dom.isRenderedNode,s.utils.dom.isIframeElement,s.utils.dom.isInputElement,s.utils.dom.isButtonElement,s.utils.dom.isFileInput,s.utils.dom.isTextAreaElement,s.utils.dom.isAnchorElement,s.utils.dom.isImgElement,s.utils.dom.isFormElement,s.utils.dom.isLabelElement,s.utils.dom.isSelectElement,s.utils.dom.isRadioButtonElement,s.utils.dom.isColorInputElement,s.utils.dom.isCheckboxElement,s.utils.dom.isOptionElement,s.utils.dom.isSVGElement,s.utils.dom.isMapElement,s.utils.dom.isBodyElement,s.utils.dom.isHtmlElement),Ys=(s.utils.dom.isDocument,s.utils.dom.isWindow,s.utils.dom.isTextEditableInput,s.utils.dom.isTextEditableElement,s.utils.dom.isTextEditableElementAndEditingAllowed,s.utils.dom.isContentEditableElement,s.utils.dom.isDomElement,s.utils.dom.isShadowUIElement,s.utils.dom.isShadowRoot,s.utils.dom.isElementFocusable,s.utils.dom.isHammerheadAttr,s.utils.dom.isElementReadOnly,s.utils.dom.getScrollbarSize),Ks=(s.utils.dom.getMapContainer,s.utils.dom.getTagName,s.utils.dom.closest,s.utils.dom.getParents,s.utils.dom.findParent,s.utils.dom.getTopSameDomainWindow,s.utils.dom.getParentExceptShadowRoot,s.utils.style,s.utils.style.getBordersWidth),Js=(s.utils.style.getComputedStyle,s.utils.style.getElementMargin,s.utils.style.getElementPadding,s.utils.style.getElementScroll),$s=(s.utils.style.getOptionHeight,s.utils.style.getSelectElementSize,s.utils.style.isElementVisible,s.utils.style.isVisibleChild,s.utils.style.getWidth,s.utils.style.getHeight,s.utils.style.getInnerWidth),Qs=s.utils.style.getInnerHeight,Zs=(s.utils.style.getScrollLeft,s.utils.style.getScrollTop,s.utils.style.setScrollLeft,s.utils.style.setScrollTop,s.utils.style.get,s.shadowUI,s.nativeMethods,ta.create=function(t){return"left"in t?new ta(t.left,t.top):"right"in t?new ta(t.right,t.bottom):new ta(t.x,t.y)},ta.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},ta.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},ta.prototype.round=function(t){return void 0===t&&(t=Math.round),this.x=t(this.x),this.y=t(this.y),this},ta.prototype.eql=function(t){return this.x===t.x&&this.y===t.y},ta.prototype.mul=function(t){return this.x*=t,this.y*=t,this},ta.prototype.distance=function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))},ta);function ta(t,e){this.x=t,this.y=e}var ea=function(t,e,n,r,i,o){this.width=t,this.height=e,this.left=n.x,this.top=n.y,this.right=n.x+t,this.bottom=n.y+e,this.border=r,this.scrollbar=o,this.scroll=i},na=(s.utils.html,s.nativeMethods,s.utils.position.getElementRectangle),ra=s.utils.position.getOffsetPosition,ia=s.utils.position.offsetToClientCoords;function oa(t){var e=t/2;return e<1?0:Math.round(e)}function sa(t,e,n){var r,i={offsetX:oa((r=na(t)).width),offsetY:oa(r.height)};if(e="number"==typeof e?Math.round(e):i.offsetX,n="number"==typeof n?Math.round(n):i.offsetY,0<e&&0<n)return{offsetX:e,offsetY:n};var o=function(t){var e,n,r,i,o=Xs(t),s=o?t.getElementsByTagName("body")[0]:null,a=t.getBoundingClientRect(),l=Gs.create(Ks(t)),u=Js(t),c=zs(t),d="BackCompat"===t.ownerDocument.compatMode,h=o?new Zs(0,0):Zs.create(a),f=a.height,p=a.width;o&&(p=s&&d?(f=s.clientHeight,s.clientWidth):(f=t.clientHeight,t.clientWidth)),!c||(e=js(t))&&(n=ra(e),r=ia(Zs.create(n)),i=Ks(e),h.add(r).add(Zs.create(i)),o&&l.add(i));var m=!o&&$s(t)!==t.clientWidth,g=!o&&Qs(t)!==t.clientHeight,w={right:m?Ys():0,bottom:g?Ys():0};return new ea(p,f,h,l,u,w)}(t),s=Math.round(Math.max(t.scrollWidth,o.width)),a=Math.round(Math.max(t.scrollHeight,o.height)),l=o.scrollbar.right+o.border.left+o.border.right+s,u=o.scrollbar.bottom+o.border.top+o.border.bottom+a;return{offsetX:e<0?l+e:e,offsetY:n<0?u+n:n}}var aa,la=(t(ua,aa=Ns),ua.prototype._delayAfterExecution=function(){return this._command.options&&1!==this._command.options.speed?Fs(2e3*(1-this._command.options.speed)):c.Promise.resolve()},ua.prototype._isExecutionTimeoutExpired=function(){return c.nativeMethods.dateNow()-this._executionStartTime>=this._commandSelectorTimeout},ua.prototype._ensureCommandArguments=function(){var t=ua.ACTIONS_HANDLERS[this._command.type];null!=t&&t.ensureCmdArgs&&t.ensureCmdArgs(this._command)},ua.prototype._ensureCommandElements=function(){var t,e=this,n=new Hs(this._globalSelectorTimeout,this._executeSelectorFn);this._command.selector&&n.push(this._command.selector);var r=null===(t=ua.ACTIONS_HANDLERS[this._command.type])||void 0===t?void 0:t.additionalSelectorProps;if(r)for(var i=0,o=r;i<o.length;i++){var s=o[i];this._command[s]&&n.push(this._command[s],s)}return n.getElements().then(function(t){e._elements=t})},ua.prototype._ensureCommandElementsProperties=function(){var t=ua.ACTIONS_HANDLERS[this._command.type];null!=t&&t.ensureElsProps&&t.ensureElsProps(this._elements)},ua.prototype._ensureCommandOptions=function(){return l(this,void 0,c.Promise,function(){var e,n,r,i;return C(this,function(t){return e=this._command.options,this._elements.length&&e&&"offsetX"in e&&"offsetY"in e&&(n=sa(this._elements[0],e.offsetX,e.offsetY),r=n.offsetX,i=n.offsetY,e.isDefaultOffset=!e.offsetX&&!e.offsetY,e.offsetX=r,e.offsetY=i),[2]})})},ua.prototype._createAutomation=function(){var t=ua.ACTIONS_HANDLERS[this._command.type];if(!t)throw new Error('There is no handler for the "'.concat(this._command.type,'" command.'));return t.create(this._command,this._elements)},ua.prototype._runAction=function(e){var n=this;return this._ensureCommandElements().then(function(){return n._ensureCommandElementsProperties()}).then(function(){return n._ensureCommandOptions()}).then(function(){var t=n._createAutomation();return t.WARNING_EVENT&&t.on(t.WARNING_EVENT,function(t){n.emit(ua.WARNING_EVENT,t)}),t.TARGET_ELEMENT_FOUND_EVENT?t.on(t.TARGET_ELEMENT_FOUND_EVENT,function(t){n._targetElement=t.element,n.emit(ua.EXECUTION_STARTED_EVENT)}):n.emit(ua.EXECUTION_STARTED_EVENT),t.run(e)})},ua.prototype._runRecursively=function(){var e=this,t=!1,n=!0;return function(e,n){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return e()?[4,n()]:[3,2];case 1:return t.sent(),[3,0];case 2:return[2]}})})}(function(){return!t},function(){return e._runAction(n).then(function(){t=!0}).catch(function(t){if(!e._isExecutionTimeoutExpired())return Fs(250);if(t.code===St)return n=!1,c.Promise.resolve();throw t})})},ua.prototype.execute=function(t){var e=this;this._executionStartTime=c.nativeMethods.dateNow();try{this._ensureCommandArguments()}catch(t){return c.Promise.reject(t)}return this.emit(ua.WAITING_FOR_ELEMENT_EVENT,this._commandSelectorTimeout),this._runRecursively().then(function(){return c.Promise.all([e._delayAfterExecution(),t.wait()])}).then(function(){var t=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([],e._elements,!0);return e._targetElement&&(t[0]=e._targetElement),t})},ua.EXECUTION_STARTED_EVENT="execution-started",ua.WAITING_FOR_ELEMENT_EVENT="waiting-for-elements",ua.WARNING_EVENT="warning",ua.ACTIONS_HANDLERS={},ua);function ua(t,e,n,r){var i,o=this;return(o=aa.call(this)||this)._command=t,o._targetElement=null,o._elements=[],o._globalSelectorTimeout=e,o._executionStartTime=0,o._executeSelectorFn=r,t.options&&!t.options.speed&&(t.options.speed=n),o._commandSelectorTimeout="number"==typeof(null===(i=t.selector)||void 0===i?void 0:i.timeout)?t.selector.timeout:e,o}function ca(t,e,n){return Math.min(Math.max(e,t),n)}function da(t,e){var n="number"==typeof t.min,r="number"==typeof t.max,i="number"==typeof t.length;return i&&(t.length=ca(t.length,0,e)),n&&t.min<0&&(t.min+=e),r&&t.max<0&&(t.max+=e),n||(t.min=r&&i?t.max-t.length:0),r||(t.max=i?t.min+t.length:e),t.min=ca(t.min,0,e),t.max=ca(t.max,0,e),t.length=t.max-t.min,t}function ha(t,e,n){return Math.round(t+ca(e-t,0,n)/2)}var fa,pa=(t(ma,fa=ui),ma.prototype._createReplicator=function(){return $r([new oi])},ma.prototype._getTimeoutErrorParams=function(t){return{apiFnIndex:ri.error,apiFnChain:this.command.apiFnChain,reason:_.positionUtils.getHiddenReason(t)}},ma.prototype._getTimeoutError=function(t){return t?this.createIsInvisibleError:this.createNotFoundError},ma.prototype._validateElement=function(s,a){var l=this;return c.Promise.resolve().then(function(){return fa.prototype._executeFn.call(l,s)}).then(function(t){var e=t,n=!!e,r=!l.command.visibilityCheck||e&&_.positionUtils.isElementVisible(e),i=c.nativeMethods.dateNow()-a>=l.timeout;if(n&&(r||c.utils.dom.isShadowRoot(e)))return e;if(!i)return _.delay(200).then(function(){return l._validateElement(s,a)});var o=l.getVisibleValueMode?null:l._getTimeoutError(n);if(o)throw o(l._getTimeoutErrorParams(e));return null})},ma.prototype._executeFn=function(t){return this.counterMode?fa.prototype._executeFn.call(this,t):this._validateElement(t,c.nativeMethods.dateNow())},ma);function ma(t,e,n,r,i){var o,s=fa.call(this,t)||this;s.createNotFoundError=r,s.createIsInvisibleError=i,s.timeout="number"==typeof t.timeout?t.timeout:e,s.counterMode=s.dependencies.filterOptions.counterMode,s.getVisibleValueMode=s.dependencies.filterOptions.getVisibleValueMode,s.dependencies.selectorFilter=ri,n&&(o=c.nativeMethods.dateNow()-n,s.timeout=Math.max(s.timeout-o,0));var a=s.dependencies.customDOMProperties;return s.replicator.addTransforms([new Rs(a,t.instantiationCallsiteName)]),s}var ga=c.nativeMethods.date,wa=(va.prototype._ensureElement=function(t){var e=this,n=t.selector,r=t.createNotFoundError,i=t.createIsInvisibleError,o=t.createHasWrongNodeTypeError;this.ensureElementsPromise=this.ensureElementsPromise.then(function(){return new pa(n,e.globalSelectorTimeout,e.ensureElementsStartTime,r,i).getResult()}).then(function(t){if(!_.domUtils.isDomElement(t))throw o(ks[t.nodeType]);e.elements.push(t)})},va.prototype.getElements=function(){var t=this;return this.ensureElementsPromise.then(function(){return t.elements})},va);function va(t,e){var n=this;this.elements=[],this.globalSelectorTimeout=e,this.ensureElementsPromise=c.Promise.resolve(),this.ensureElementsStartTime=new ga,t.forEach(function(t){return n._ensureElement(t)})}function ya(r){return function(t,e){var n=typeof e;if("number"!=n)throw new r(t,n);if(isNaN(e)||!isFinite(e)||e!==Math.floor(e))throw new r(t,e)}}var _a,Ea,Ca,Ia,Sa,ba,Wa,Ta,Aa,Ra,xa,Na,Da,Pa=ya(ie),Ma=(Ea=ya(_a=ae),function(t,e){if(Ea(t,e),e<0)throw new _a(t,e)}),Fa=(Ca=ce,function(t,e){var n=typeof e;if("boolean"!=n)throw new Ca(t,n)}),ka=(Ia=fe,function(t,e){var n=typeof e;if("number"!=n)throw new Ia(t,n);if(isNaN(e)||e<.01||1<e)throw new Ia(t,e)}),Oa=(Sa=ge,function(t,e){var n=typeof e;if("string"!=n)throw new Sa(t,n)}),La=(ba=ye,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof RegExp))throw new ba(t,n)}),Ua=(Wa=Ce,function(t,e){if(!(e instanceof Date))throw new Wa(t,e)}),Ha=(Ta=be,function(t,e){if(isNaN(Number(e)))throw new Ta(t,typeof e)}),Ba=(Aa=Ae,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof URL))throw new Aa(t,n)}),Ga=(Ra=Ne,function(t,e){var n=typeof e;if("object"!=n&&!(e instanceof URLSearchParams))throw new Ra(t,n)}),Va=(xa=Me,function(t,e){var n=typeof e;if("object"!=n)throw new xa(t,n)}),qa=(Na=Oe,function(t,e){var n=typeof e;if("function"!=n)throw new Na(t,n)}),za=(t(ja,Da=rs),ja.prototype.getAssignableProperties=function(){return[{name:"speed",type:ka}]},ja);function ja(t,e){var n=Da.call(this)||this;return n.speed=null,n._assignFrom(t,e),n}var Xa,Ya=(t(Ka,Xa=za),Ka.prototype.getAssignableProperties=function(){return[{name:"offsetX",type:Pa},{name:"offsetY",type:Pa},{name:"isDefaultOffset",type:Fa}]},Ka);function Ka(t,e){var n=Xa.call(this)||this;return n.offsetX=null,n.offsetY=null,n._assignFrom(t,e),n}var Ja,$a=(t(Qa,Ja=Ya),Qa.prototype.getAssignableProperties=function(){return[{name:"scrollToCenter",type:Fa},{name:"skipParentFrames",type:Fa}]},Qa);function Qa(t,e){var n=Ja.call(this)||this;return n.scrollToCenter=!1,n.skipParentFrames=!1,n._assignFrom(t,e),n}var Za,tl=(t(el,Za=rs),el.prototype.getAssignableProperties=function(){return[{name:"left",type:Pa,defaultValue:null},{name:"right",type:Pa,defaultValue:null},{name:"top",type:Pa,defaultValue:null},{name:"bottom",type:Pa,defaultValue:null}]},el);function el(t,e){var n=Za.call(this)||this;return n._assignFrom(t,e),n}var nl,rl=(t(il,nl=za),il.prototype.getAssignableProperties=function(){return[{name:"scrollTargetX",type:Pa},{name:"scrollTargetY",type:Pa},{name:"crop",type:Va,init:ql},{name:"includeMargins",type:Fa},{name:"includeBorders",type:Fa},{name:"includePaddings",type:Fa}]},il);function il(t,e){var n=nl.call(this)||this;return n.scrollTargetX=null,n.scrollTargetY=null,n.includeMargins=!1,n.includeBorders=!0,n.includePaddings=!0,n.crop={left:null,right:null,top:null,bottom:null},n._assignFrom(t,e),n}var ol,sl=(t(al,ol=rs),al.prototype.getAssignableProperties=function(){return[{name:"ctrl",type:Fa,defaultValue:!1},{name:"alt",type:Fa,defaultValue:!1},{name:"shift",type:Fa,defaultValue:!1},{name:"meta",type:Fa,defaultValue:!1}]},al);function al(t,e){var n=ol.call(this)||this;return n._assignFrom(t,e),n}var ll,ul=(t(cl,ll=Ya),cl.prototype.getAssignableProperties=function(){return[{name:"modifiers",type:Va,init:zl}]},cl);function cl(t,e){var n=ll.call(this)||this;return n.modifiers={ctrl:!1,alt:!1,shift:!1,meta:!1},n._assignFrom(t,e),n}var dl,hl,fl,pl,ml,gl,wl,vl,yl=(t(_l,dl=ul),_l.prototype.getAssignableProperties=function(){return[{name:"caretPos",type:Ma}]},_l);function _l(t,e){var n=dl.call(this)||this;return n.caretPos=null,n._assignFrom(t,e),n}function El(t,e){var n=hl.call(this)||this;return n.speed=null,n.minMovingTime=null,n.holdLeftButton=!1,n.skipScrolling=!1,n.skipDefaultDragBehavior=!1,n._assignFrom(t,e),n}function Cl(t,e){var n=fl.call(this)||this;return n.replace=!1,n.paste=!1,n.confidential=void 0,n._assignFrom(t,e),n}function Il(t,e){var n=pl.call(this,t,e)||this;return n.destinationOffsetX=null,n.destinationOffsetY=null,n._assignFrom(t,e),n}function Sl(t,e){var n=ml.call(this)||this;return n.portraitOrientation=!1,n._assignFrom(t,e),n}function bl(t,e){var n=gl.call(this)||this;return n.timeout=void 0,n.allowUnawaitedPromise=!1,n._assignFrom(t,e),n}function Wl(t,e){var n=wl.call(this)||this;return n.confidential=void 0,n._assignFrom(t,e),n}function Tl(t,e){var n=vl.call(this)||this;return n._assignFrom(t,e),n}t(El,hl=ul),El.prototype.getAssignableProperties=function(){return[{name:"speed"},{name:"minMovingTime"},{name:"holdLeftButton"},{name:"skipScrolling",type:Fa},{name:"skipDefaultDragBehavior",type:Fa}]},t(Cl,fl=yl),Cl.prototype.getAssignableProperties=function(){return[{name:"replace",type:Fa},{name:"paste",type:Fa},{name:"confidential",type:Fa}]},t(Il,pl=ul),Il.prototype.getAssignableProperties=function(){return[{name:"destinationOffsetX",type:Pa},{name:"destinationOffsetY",type:Pa}]},t(Sl,ml=rs),Sl.prototype.getAssignableProperties=function(){return[{name:"portraitOrientation",type:Fa}]},t(bl,gl=rs),bl.prototype.getAssignableProperties=function(){return[{name:"timeout",type:Ma},{name:"allowUnawaitedPromise",type:Fa}]},t(Wl,wl=za),Wl.prototype.getAssignableProperties=function(){return[{name:"confidential",type:Fa}]},t(Tl,vl=rs),Tl.prototype.getAssignableProperties=function(){return[{name:"name",type:Oa},{name:"value",type:Oa},{name:"domain",type:Oa},{name:"path",type:Oa},{name:"expires",type:Ua},{name:"maxAge",type:Ha},{name:"secure",type:Fa},{name:"httpOnly",type:Fa},{name:"sameSite",type:Oa}]};var Al,Rl=(t(xl,Al=rs),xl.prototype.getAssignableProperties=function(){return[{name:"username",type:Oa,required:!0},{name:"password",type:Oa}]},xl);function xl(t,e){var n=Al.call(this)||this;return n._assignFrom(t,e),n}var Nl,Dl,Pl,Ml,Fl,kl=(t(Ol,Nl=rs),Ol.prototype.getAssignableProperties=function(){return[{name:"protocol",type:Oa},{name:"host",type:Oa,required:!0},{name:"port",type:Ha,required:!0},{name:"auth",type:Va,init:Gl}]},Ol);function Ol(t,e){var n=Nl.call(this)||this;return n._assignFrom(t,e),n}function Ll(t,e){var n=Dl.call(this)||this;return n._assignFrom(t,e),n}function Ul(t,e){var n=Pl.call(this)||this;return n._assignFrom(t,e),n}function Hl(t,e){var n=Ml.call(this)||this;return n._assignFrom(t,e),n}function Bl(t,e){var n=Fl.call(this)||this;return n._assignFrom(t,e),n}function Gl(t,e,n,r){return void 0===r&&(r=!0),new Rl(e,r)}function Vl(t,e,n,r){return void 0===r&&(r=!0),new kl(e,r)}function ql(t,e,n,r){return void 0===r&&(r=!0),new tl(e,r)}function zl(t,e,n,r){return void 0===r&&(r=!0),new sl(e,r)}function jl(t){return t.top!==t}t(Ll,Dl=rs),Ll.prototype.getAssignableProperties=function(){return[{name:"url",type:Ba},{name:"method",type:Oa},{name:"headers",type:Va},{name:"params",type:Ga},{name:"body"},{name:"timeout",type:Ha},{name:"withCredentials",type:Fa},{name:"auth",type:Va,init:Gl},{name:"proxy",type:Va,init:Vl},{name:"rawResponse",type:Fa}]},t(Ul,Pl=rs),Ul.prototype.getAssignableProperties=function(){return[{name:"credentials",type:Ha}]},t(Hl,Ml=rs),Hl.prototype.getAssignableProperties=function(){return[{name:"stack",type:La,required:!1},{name:"message",type:La,required:!1},{name:"pageUrl",type:La,required:!1}]},t(Bl,Fl=rs),Bl.prototype.getAssignableProperties=function(){return[{name:"fn",type:qa,required:!0},{name:"dependencies",type:Va,required:!1}]};var Xl=c.eventSandbox.message,Yl="driver|browser-manipulation|request",Kl="driver|browser-manipulation|response";Xl.on(Xl.SERVICE_MSG_RECEIVED_EVENT,function(e){var t,n,r,i,o;e.message.cmd===Yl&&(t=_.domUtils.findIframeByWindow(e.source),r=(n=e.message).command,(i=n.cropDimensions)&&(r.options=new rl({crop:i,includePaddings:!1})),(o=new Jl(r)).element=t,o.execute().then(function(t){return Xl.sendServiceMsg({cmd:Kl,result:t},e.source)}))});var Jl=($l.prototype._getAbsoluteCropValues=function(){var t=this.element.getBoundingClientRect(),e=t.top,n=t.left;n+=this.command.options.originOffset.x,e+=this.command.options.originOffset.y;var r=n+this.command.options.crop.right,i=e+this.command.options.crop.bottom;return{top:e+=this.command.options.crop.top,left:n+=this.command.options.crop.left,bottom:i,right:r}},$l.prototype._createManipulationReadyMessage=function(){var t=dc.devicePixelRatio||1,e={cmd:u.readyForBrowserManipulation,pageDimensions:{dpr:t,innerWidth:dc.innerWidth,innerHeight:dc.innerHeight,documentWidth:hc.documentElement.clientWidth,documentHeight:hc.documentElement.clientHeight,bodyWidth:hc.body.clientWidth,bodyHeight:hc.body.clientHeight},disableResending:!0};return this.command.type===d.takeElementScreenshot&&(e.cropDimensions=this._getAbsoluteCropValues()),e},$l.prototype._runScrollBeforeScreenshot=function(){var i=this;return c.Promise.resolve().then(function(){if(i.element||!i.command.selector)return c.Promise.resolve();var t,e,n=i.command.selector.timeout,r="number"==typeof n?n:i.globalSelectorTimeout;return i.statusBar.showWaitingElementStatus(r),t=[{selector:i.command.selector,createNotFoundError:function(t){return new Ve(null,t)},createIsInvisibleError:function(t){return new je(null,t)},createHasWrongNodeTypeError:function(t){return new Ke(t)}}],e=i.globalSelectorTimeout,new wa(t,e).getElements().then(function(t){i.statusBar.hideWaitingElementStatus(),i.element=t[0]}).catch(function(t){throw i.statusBar.hideWaitingElementStatus(),t})}).then(function(){return function(v,y){return l(this,void 0,void 0,function(){var e,n,r,i,o,s,a,l,u,c,d,h,f,p,m,g,w;return C(this,function(t){if(e=v.getBoundingClientRect(),n={left:e.left,right:e.right,top:e.top,bottom:e.bottom},r=_.styleUtils.getElementMargin(v),i=_.styleUtils.getElementPadding(v),o=_.styleUtils.getBordersWidth(v),y.originOffset={x:0,y:0},s=n.left+v.scrollWidth+o.left+o.right,a=n.top+v.scrollHeight+o.top+o.bottom,n.right=Math.max(n.right,s),n.bottom=Math.max(n.bottom,a),y.includeBorders&&y.includePaddings?y.includeMargins&&(y.originOffset.x-=r.left,y.originOffset.y-=r.top,n.left-=r.left,n.top-=r.top,n.right+=r.right,n.bottom+=r.bottom):(y.originOffset.x+=o.left,y.originOffset.y+=o.top,n.left+=o.left,n.top+=o.top,n.right-=o.right,n.bottom-=o.bottom,y.includePaddings||(y.originOffset.x+=i.left,y.originOffset.y+=i.top,n.left+=i.left,n.top+=i.top,n.right-=i.right,n.bottom-=i.bottom)),n.width=n.right-n.left,n.height=n.bottom-n.top,l=da({min:y.crop.left,max:y.crop.right,length:y.crop.width},n.width),u=da({min:y.crop.top,max:y.crop.bottom,length:y.crop.height},n.height),y.crop.left=l.min,y.crop.right=l.max,y.crop.width=l.length,y.crop.top=u.min,y.crop.bottom=u.max,y.crop.height=u.length,y.crop.width<=0||y.crop.height<=0)throw new Fn(y.crop.width,y.crop.height);if(c=_.styleUtils.getViewportDimensions(),(n.width>c.width||n.height>c.height)&&(y.scrollToCenter=!0),d="number"==typeof y.scrollTargetX,h="number"==typeof y.scrollTargetY,d||(y.scrollTargetX=ha(y.crop.left,y.crop.right,c.width)),h||(y.scrollTargetY=ha(y.crop.top,y.crop.bottom,c.height)),f=E.getOffsetOptions(v,y.scrollTargetX,y.scrollTargetY),p=f.offsetX,m=f.offsetY,y.scrollTargetX=p,y.scrollTargetY=m,g=!d||y.scrollTargetX>=y.crop.left&&y.scrollTargetX<=y.crop.right,w=!h||y.scrollTargetY>=y.crop.top&&y.scrollTargetY<=y.crop.bottom,!g||!w)throw new Dn(g,w);return[2]})})}(i.element,i.command.options)}).then(function(){var t=i.command.options,e=t.scrollTargetX,n=t.scrollTargetY,r=t.scrollToCenter;return new _.ScrollAutomation(i.element,new $a({offsetX:e,offsetY:n,scrollToCenter:r,skipParentFrames:!0})).run()})},$l.prototype._hideUI=function(){return n.hide(),this.command.markData&&n.showScreenshotMark(this.command.markData),_.delay(500)},$l.prototype._showUI=function(){this.command.markData&&n.hideScreenshotMark(),n.show()},$l.prototype._requestManipulation=function(){if(!jl(dc))return c.transport.queuedAsyncServiceMsg(this._createManipulationReadyMessage());var t=this._getAbsoluteCropValues();return _.sendRequestToFrame({cmd:Yl,command:this.command,cropDimensions:t},Kl,dc.parent).then(function(t){if(!t.result)return{result:null};var e=t.result,n=e.result,r=e.executionError;if(r)throw r;return{result:n}})},$l.prototype._runManipulation=function(){var r=this,i=null;return c.Promise.resolve().then(function(){return r.command.type!==d.takeElementScreenshot?c.Promise.resolve():(_.scrollController.stopPropagation(),r._runScrollBeforeScreenshot())}).then(function(){return jl(dc)?c.Promise.resolve():r._hideUI()}).then(function(){return r._requestManipulation()}).then(function(t){var e=t.result,n=t.error;if(n)throw n;return _.scrollController.enablePropagation(),i=e,jl(dc)||r._showUI(),_.delay(200)}).then(function(){return new ss({isCommandResult:!0,result:i})}).catch(function(t){return _.scrollController.enablePropagation(),new ss({isCommandResult:!0,executionError:t})})},$l.prototype.execute=function(){var t=this;return function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=new _.ClientRequestEmitter,i=new _.RequestBarrier(r),o=new _.ScriptExecutionEmitter,s=new _.ScriptExecutionBarrier(o);_.pageUnloadBarrier.watchForPageNavigationTriggers();var a=null,l=t.apply(void 0,e),u=l.then(function(t){return a=t,c.Promise.all([i.wait().then(function(){return s.wait()}),_.pageUnloadBarrier.wait()])}).then(function(){return a});return{actionPromise:l,barriersPromise:u}}(function(){return t._runManipulation()}).barriersPromise},$l);function $l(t,e,n){this.command=t,this.globalSelectorTimeout=e,this.statusBar=n,this.element=null}function Ql(e){return e.getResult().then(function(t){return new ss({isCommandResult:!0,result:e.encodeResult(t)})}).catch(function(t){return new ss({isCommandResult:!0,executionError:t})})}var Zl=s.Promise,tu=(eu.prototype.setAsMaster=function(t){var e=this;return ls(new Eo(t),this.driverWindow,us,Zn).catch(function(t){if(!e._isNonPageWindow)throw t})},eu.prototype.closeAllChildWindows=function(){return ls(new So,this.driverWindow,us,nr)},eu.prototype.findChildWindows=function(t,e){return ls(new e(t),this.driverWindow,us,Zn)},eu.prototype.startToRestore=function(){return ls(new To,this.driverWindow,us,Zn)},eu.prototype.closeFileDownloadingWindow=function(){this._isNonPageWindow=!0,this.driverWindow.close()},eu);function eu(t,e){this._isNonPageWindow=!1,this.driverWindow=t,this.windowId=e}var nu=(ru.prototype._getTopOpenedWindow=function(t){for(var e=t;e.opener;)e=e.opener;return e.top},ru.prototype._setAsMaster=function(t,e){return ls(new Eo(e),t,us,Zn)},ru.prototype.getTopOpenedWindow=function(){return this._getTopOpenedWindow(this.currentDriverWindow)},ru.prototype.setTopOpenedWindowAsMaster=function(){var t=this._getTopOpenedWindow(this.currentDriverWindow);return this._setAsMaster(t)},ru.prototype.setParentWindowAsMaster=function(t){void 0===t&&(t={});var e=this.currentDriverWindow.opener;return this._setAsMaster(e,t.finalizePendingCommand)},ru.prototype.restoreChild=function(r){return l(this,void 0,void 0,function(){var e,n;return C(this,function(t){return e=new xo(r),n=this.currentDriverWindow.opener,ls(e,n,us,Zn),[2]})})},ru);function ru(t){this.currentDriverWindow=t}var iu="master",ou="replica",su=(au.prototype.shouldTransform=function(t,e){return e instanceof c.nativeMethods.Node},au.prototype.toSerializable=function(t){return new Ss(t)},au.prototype.fromSerializable=function(){},au);function au(){this.type="Node"}var lu=(uu.prototype._startListening=function(){var e=this;this._emitter.onRequestSend(function(t){return e._onRequestSend(t)}),this._emitter.onRequestCompleted(function(t){return e._onRequestCompleted(t)}),this._emitter.onRequestError(function(t){return e._onRequestError(t)})},uu.prototype._offListening=function(){this._emitter.offAll()},uu.prototype._onRequestSend=function(t){this._collectingReqs&&this._requests.add(t)},uu.prototype._onRequestCompleted=function(t){var e=this;Fs(this._delays.additionalRequestsCollection).then(function(){return e._onRequestFinished(t)})},uu.prototype._onRequestFinished=function(t){this._requests.has(t)&&(this._requests.delete(t),this._collectingReqs||this._requests.size||!this._watchdog||this._finishWaiting())},uu.prototype._onRequestError=function(t){this._onRequestFinished(t)},uu.prototype._finishWaiting=function(){this._watchdog&&((0,c.nativeMethods.clearTimeout)(this._watchdog),this._watchdog=null),this._requests.clear(),this._offListening(),this._waitResolve()},uu.prototype.wait=function(t){var n=this;return Fs(t?this._delays.pageInitialRequestsCollection:this._delays.requestsCollection).then(function(){return new c.Promise(function(t){var e;n._collectingReqs=!1,n._waitResolve=t,n._requests.size?(e=c.nativeMethods.setTimeout,n._watchdog=e(function(){return n._finishWaiting()},uu.TIMEOUT)):n._finishWaiting()})})},uu.TIMEOUT=3e3,uu);function uu(t,e){var n,r,i;void 0===e&&(e={}),this._delays={requestsCollection:null!==(n=e.requestsCollection)&&void 0!==n?n:50,additionalRequestsCollection:null!==(r=e.additionalRequestsCollection)&&void 0!==r?r:50,pageInitialRequestsCollection:null!==(i=e.pageInitialRequestsCollection)&&void 0!==i?i:50},this._emitter=t,this._waitResolve=null,this._watchdog=null,this._requests=new Set,this._collectingReqs=!0,this._startListening()}var cu=(du.prototype._startListening=function(){var e=this;this._emitter.onScriptAdded(function(t){return e._onScriptElementAdded(t)}),this._emitter.onScriptLoadedOrFailed(function(t){return e._onScriptLoadedOrFailed(t)})},du.prototype._offListening=function(){this._emitter.offAll()},du.prototype._onScriptElementAdded=function(t){var e=this,n=(0,c.nativeMethods.setTimeout)(function(){return e._onScriptLoadedOrFailed(t,!0)},du.LOADING_TIMEOUT);this._scripts.set(t,n)},du.prototype._onScriptLoadedOrFailed=function(t,e){var n=this;void 0===e&&(e=!1),this._scripts.has(t)&&(e||(0,c.nativeMethods.clearTimeout)(this._scripts.get(t)),this._scripts.delete(t),this._scripts.size||Fs(25).then(function(){n._waitResolve&&!n._scripts.size&&n._finishWaiting()}))},du.prototype._finishWaiting=function(){this._watchdog&&((0,c.nativeMethods.clearTimeout)(this._watchdog),this._watchdog=null),this._scripts.clear(),this._offListening(),this._waitResolve(),this._waitResolve=null},du.prototype.wait=function(){var n=this;return new c.Promise(function(t){var e;n._waitResolve=t,n._scripts.size?(e=c.nativeMethods.setTimeout,n._watchdog=e(function(){return n._finishWaiting()},du.TIMEOUT)):n._finishWaiting()})},du.TIMEOUT=3e3,du.LOADING_TIMEOUT=2e3,du);function du(t){this._emitter=t,this._watchdog=null,this._waitResolve=null,this._scripts=new Map,this._startListening()}var hu=(fu.prototype.wait=function(){var t=this;return c.Promise.all([this._requestBarrier.wait().then(function(){return t._scriptExecutionBarrier.wait()}),this._unloadBarrier.wait()]).then()},fu);function fu(t,e,n){this._requestBarrier=new lu(t),this._scriptExecutionBarrier=new cu(e),(this._unloadBarrier=n).watchForPageNavigationTriggers&&n.watchForPageNavigationTriggers()}function pu(t,e){var n=E.calculateSelectTextArguments(e[0],t);return new E.SelectText(e[0],n.startPos,n.endPos,t.options)}function mu(t){if(!_.domUtils.isFileInput(t))throw new Rn}function gu(i,o){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return f(i)?[4,(e=i,r={stack:(n=o).stack,pageUrl:n.pageUrl,message:n.msg},e.args=[[r]],new ui(e).getResult())]:[3,2];case 1:return[2,t.sent()];case 2:return[2,i||!1]}var e,n,r})})}la.ACTIONS_HANDLERS[d.dispatchEvent]={additionalSelectorProps:["relatedTarget"],create:function(t,e){return e[1]&&(t.options.relatedTarget=e[1]),new E.DispatchEvent(e[0],t.eventName,t.options)}},la.ACTIONS_HANDLERS[d.pressKey]={create:function(t){return new E.Press(_.parseKeySequence(t.keys).combinations,t.options)},ensureCmdArgs:function(t){if(_.parseKeySequence(t.keys).error)throw new In("keys")}},la.ACTIONS_HANDLERS[d.click]={create:function(t,e){return/option|optgroup/.test(_.domUtils.getTagName(e[0]))?new E.SelectChildClick(e[0],t.options):new E.Click(e[0],t.options,dc,E.cursor)}},la.ACTIONS_HANDLERS[d.rightClick]={create:function(t,e){return new E.RClick(e[0],t.options)}},la.ACTIONS_HANDLERS[d.doubleClick]={create:function(t,e){return new E.DblClick(e[0],t.options)}},la.ACTIONS_HANDLERS[d.hover]={create:function(t,e){return new E.Hover(e[0],t.options)}},la.ACTIONS_HANDLERS[d.drag]={create:function(t,e){return new E.DragToOffset(e[0],t.dragOffsetX,t.dragOffsetY,t.options)}},la.ACTIONS_HANDLERS[d.dragToElement]={additionalSelectorProps:["destinationSelector"],create:function(t,e){return new E.DragToElement(e[0],e[1],t.options)}},la.ACTIONS_HANDLERS[d.scroll]={create:function(t,e){var n=t.x,r=t.y,i=t.position,o=t.options;return new E.SetScroll(e[0],{x:n,y:r,position:i},o)}},la.ACTIONS_HANDLERS[d.scrollBy]={create:function(t,e){var n=t.byX,r=t.byY,i=t.options;return new E.SetScroll(e[0],{byX:n,byY:r},i)}},la.ACTIONS_HANDLERS[d.scrollIntoView]={create:function(t,e){return new E.ScrollIntoView(e[0],t.options)}},la.ACTIONS_HANDLERS[d.typeText]={create:function(t,e){return new E.Type(e[0],t.text,t.options)}},la.ACTIONS_HANDLERS[d.selectText]={create:pu,ensureElsProps:function(t){if(!_.domUtils.isEditableElement(t[0]))throw new dn}},la.ACTIONS_HANDLERS[d.selectTextAreaContent]={create:pu,ensureElsProps:function(t){if(!_.domUtils.isTextAreaElement(t[0]))throw new pn}},la.ACTIONS_HANDLERS[d.selectEditableContent]={additionalSelectorProps:["startSelector","endSelector"],create:function(t,e){return t.endSelector=t.endSelector||t.startSelector,new E.SelectEditableContent(e[0],e[1],t.options)},ensureElsProps:function(t){if(!_.domUtils.isContentEditableElement(t[0]))throw new wn("startSelector");if(!_.domUtils.isContentEditableElement(t[1]))throw new wn("endSelector");if(!_.contentEditable.getNearestCommonAncestor(t[0],t[1]))throw new _n}},la.ACTIONS_HANDLERS[d.setFilesToUpload]={create:function(t,e){return new E.Upload(e[0],t.filePath,function(t,e){return new Wn(t,e)})},ensureElsProps:function(t){return mu(t[0])}},la.ACTIONS_HANDLERS[d.clearUpload]={create:function(t,e){return new E.Upload(e[0])},ensureElsProps:function(t){return mu(t[0])}};var wu,vu=s.settings,yu=s.transport,_u=s.Promise,Eu=s.eventSandbox.message,Cu=s.storages,Iu=s.nativeMethods,Su=Iu.date,bu=s.eventSandbox.listeners,Wu=s.utils.url,Tu="testcafe|driver|test-done-sent-flag",Au="testcafe|driver|pending-status",Ru="testcafe|driver|executing-client-function-descriptor",xu="testcafe|driver|executing-skip-js-errors-function-flag",Nu="testcafe|driver|selector-execution-start-time",Du="testcafe|driver|pending-page-error",Pu="testcafe|driver|active-iframe-selector",Mu="testcafe|driver|test-speed",Fu="testcafe|driver|assertion-retries-timeout",ku="testcafe|driver|assertion-retries-start-time",Ou="testcafe|driver|console-messages",Lu="testcafe|driver|pending-child-window-count",Uu={NotLoadedError:Bn,NotFoundError:Ve,IsInvisibleError:je},Hu={NotLoadedError:qn,NotFoundError:Rr,IsInvisibleError:Dr},Bu=Math.pow(2,31)-1,Gu="status-with-command-result-event",Vu="empty-command-event",qu="child-window-closed",zu="skip-js-errors-function-execution-complete",ju=(t(Xu,wu=_.serviceUtils.EventEmitter),Xu.prototype._isOpenedInIframe=function(){var t=dc.opener;return t&&t.top&&t.top!==t},Object.defineProperty(Xu.prototype,"speed",{get:function(){return this.contextStorage.getItem(Mu)},set:function(t){this.contextStorage.setItem(Mu,t)},enumerable:!1,configurable:!0}),Object.defineProperty(Xu.prototype,"consoleMessages",{get:function(){return new zr(this.contextStorage.getItem(Ou))},set:function(t){return this.contextStorage.setItem(Ou,t?t.getCopy():null)},enumerable:!1,configurable:!0}),Xu.prototype._getReadyPromise=function(){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,_.eventUtils.documentReady(this.options.pageLoadTimeout)];case 1:return t.sent(),[4,this.pageInitialRequestBarrier.wait(!0)];case 2:return t.sent(),[2]}})})},Xu.prototype._hasPendingActionFlags=function(t){return t.getItem(this.COMMAND_EXECUTING_FLAG)||t.getItem(this.EXECUTING_IN_IFRAME_FLAG)},Xu.prototype._getCurrentWindowId=function(){if(this.options.proxyless)return this.runInfo.activeWindowId;var t=dc.location.toString(),e=s.utils.url.parseProxyUrl(t);return e&&e.windowId||null},Xu.prototype._onJsError=function(n){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:if(this.contextStorage.getItem(Tu))return[2];if(!this.options.skipJsErrors)return[3,6];this.contextStorage.setItem(xu,!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,gu(this.options.skipJsErrors,n)];case 2:return t.sent()||this._setUncaughtErrorOnPage(n),[3,5];case 3:return e=t.sent(),this.contextStorage.getItem(Du)||this.contextStorage.setItem(Du,e),[3,5];case 4:return this.contextStorage.setItem(xu,!1),this.emit(zu),[7];case 5:return[2];case 6:return this._setUncaughtErrorOnPage(n),[2]}})})},Xu.prototype._setUncaughtErrorOnPage=function(t){var e=new Vt(t.stack,t.pageUrl);this.contextStorage.getItem(Du)||this.contextStorage.setItem(Du,e)},Xu.prototype._unlockPageAfterTestIsDone=function(){return _.disableRealEventsPreventing(),_u.resolve()},Xu.prototype._getActiveElement=function(){return l(this,void 0,void 0,function(){var e;return C(this,function(t){return e=_.domUtils.getActiveElement(),[2,this.replicator.encode(e)]})})},Xu.prototype._failIfClientCodeExecutionIsInterrupted=function(){var t=this.contextStorage.getItem(Ru);return!!t&&(this._onReady(new ss({isCommandResult:!0,executionError:new At(t.instantiationCallsiteName)})),!0)},Xu.prototype.onCustomClientScriptError=function(t,e){var n=e?new ee(t,e):new Qt(t);this.contextStorage.getItem(Du)||this.contextStorage.setItem(Du,n)},Xu.prototype._addChildWindowDriverLink=function(t){var e=new tu(t.window,t.windowId);this.childWindowDriverLinks.push(e),this._ensureClosedChildWindowWatcher()},Xu.prototype._ensureClosedChildWindowWatcher=function(){var e=this;this.checkClosedChildWindowIntervalId||(this.checkClosedChildWindowIntervalId=Iu.setInterval.call(dc,function(){var t=_.arrayUtils.find(e.childWindowDriverLinks,function(t){return t.driverWindow.closed});t&&(e.emit(qu),_.arrayUtils.remove(e.childWindowDriverLinks,t),t.ignoreMasterSwitching||e._setCurrentWindowAsMaster(),e.childWindowDriverLinks.length||(Iu.clearInterval.call(dc,e.checkClosedChildWindowIntervalId),delete e.checkClosedChildWindowIntervalId))},200))},Xu.prototype._setAsMasterInProgressOrCompleted=function(){return this.setAsMasterInProgress||this.role===iu},Xu.prototype._setCurrentWindowAsMaster=function(){var t=this;this._setAsMasterInProgressOrCompleted()||(this.setAsMasterInProgress=!0,this._clearActiveChildIframeInfo(),_u.resolve().then(function(){return _.browser.setActiveWindowId(t.communicationUrls.activeWindowId,s.createNativeXHR,t.windowId)}).then(function(){t._startInternal({finalizePendingCommand:!0,isFirstRequestAfterWindowSwitching:!0}),t.setAsMasterInProgress=!1}).catch(function(){t._onReady(new ss({isCommandResult:!0,executionError:new Zn}))}))},Xu.prototype._onChildWindowOpened=function(t){this._addChildWindowDriverLink(t),this._switchToChildWindow(t.windowId)},Xu.prototype._sendStartToRestoreCommand=function(){if(this.contextStorage){this._stopRespondToChildren=!0,this.contextStorage.setItem(Lu,this.childWindowDriverLinks.length);for(var t=0,e=this.childWindowDriverLinks;t<e.length;t++)e[t].startToRestore()}},Xu.prototype._onFormSubmit=function(t){this.contextStorage&&this.contextStorage.getItem(Tu)&&(t.preventSubmit=!0)},Xu.prototype._onConsoleMessage=function(t){var e=t.meth,n=t.line,r=this.consoleMessages;r.addMessage(e,n,this.windowId),this.consoleMessages=r},Xu.prototype._addPendingErrorToStatus=function(t){var e=this.contextStorage.getItem(Du);e&&(this.contextStorage.setItem(Du,null),t.pageError=e)},Xu.prototype._addUnexpectedDialogErrorToStatus=function(t){var e=this.nativeDialogsTracker.getUnexpectedDialogError();t.pageError=t.pageError||e},Xu.prototype._addConsoleMessagesToStatus=function(t){t.consoleMessages=this.consoleMessages,this.consoleMessages=null},Xu.prototype._addPendingWindowSwitchingStateToStatus=function(t){t.isPendingWindowSwitching=this._isPendingSwitchingWindow()},Xu.prototype._sendStatusRequest=function(t){function e(){return _.getTimeLimitedPromise(yu.asyncServiceMsg(r),5e3)}function n(){return _.delay(300).then(e)}for(var r={cmd:u.ready,status:t,disableResending:!0,allowRejecting:!0},i=e(),o=0;o<a;o++)i=i.catch(n);return i},Xu.prototype._sendStatus=function(t){var e=this;t.resent||(this._addPendingErrorToStatus(t),this._addUnexpectedDialogErrorToStatus(t),this._addConsoleMessagesToStatus(t),this._addPendingWindowSwitchingStateToStatus(t)),this.contextStorage.setItem(Au,t);var n=null;return _.pageUnloadBarrier.wait(0).then(function(){return e._sendStatusRequest(t)}).then(function(t){return n=t,_.pageUnloadBarrier.wait(0)}).then(function(){return e.contextStorage.setItem(Au,null),n})},Xu.prototype._addChildIframeDriverLink=function(t,e){var n,r=this._getChildIframeDriverLinkByWindow(e);r||(n="".concat(this.testRunId,"-").concat(Ii()),r=new ds(e,n),this.childIframeDriverLinks.push(r)),r.sendConfirmationMessage(t)},Xu.prototype._getTargetWindowNotFoundResult=function(t,e){return _u.resolve({success:!1,errCode:t,errMsg:e})},Xu.prototype._getChildWindowValidateResult=function(t){var e=t.find(function(t){return t.result.success});if(e)return e.result;var n=t.find(function(t){return t.result.errCode===_.TEST_RUN_ERRORS.cannotCloseWindowWithChildrenError||t.result.errCode===_.TEST_RUN_ERRORS.cannotCloseWindowWithoutParent});return(n=n||t.find(function(t){return!!t.result.errCode}))?{errCode:n.result.errCode}:void 0},Xu.prototype._handleWindowValidation=function(n,r,i,o){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return[4,this._validateWindow(n,r,i,o)];case 1:return e=t.sent(),cs({requestMsgId:n.id,window:r,result:e}),[2]}})})},Xu.prototype._getWindowInfo=function(){var t=s.utils.url.parseProxyUrl(dc.location.toString());return{id:this.windowId,title:hc.title,url:t.destUrl}},Xu.prototype._isTargetWindow=function(t){return t.windowId===this.windowId},Xu.prototype._validateWindow=function(r,t,i,o){return l(this,void 0,void 0,function(){var e,n;return C(this,function(t){switch(t.label){case 0:return this._isTargetWindow(r)?[2,i()]:this.childWindowDriverLinks.length?(e=this.childWindowDriverLinks.map(function(t){return t.findChildWindows(r,o)}),[4,_u.all(e)]):[2,this._getTargetWindowNotFoundResult(_.TEST_RUN_ERRORS.targetWindowNotFoundError)];case 1:return n=t.sent(),[2,this._getChildWindowValidateResult(n)]}})})},Xu._createWindowValidationError=function(t){var e=t.errCode;return new(e===_.TEST_RUN_ERRORS.cannotCloseWindowWithChildrenError?or:e===_.TEST_RUN_ERRORS.cannotCloseWindowWithoutParent?lr:pr)},Xu.prototype._getCloseWindowFoundResult=function(){return this.parentWindowDriverLink?this.childWindowDriverLinks.length?_u.resolve({success:!1,errCode:_.TEST_RUN_ERRORS.cannotCloseWindowWithChildrenError}):_u.resolve({success:!0}):_u.resolve({success:!1,errCode:_.TEST_RUN_ERRORS.cannotCloseWindowWithoutParent})},Xu.prototype._handleCloseWindowValidation=function(t,e){var n=this;return this._handleWindowValidation(t,e,function(){return n._getCloseWindowFoundResult()},Xi)},Xu.prototype._handleSwitchToWindowValidation=function(t,e){return this._handleWindowValidation(t,e,function(){return _u.resolve({success:!0})},Ji)},Xu.prototype._handleCloseWindow=function(e,n){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,this._closeWindow(e,n)];case 1:return t.sent(),cs({requestMsgId:e.id,window:n}),[2]}})})},Xu.prototype._closeWindowAndWait=function(n,r){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return e=this._createWaitForEventPromise(qu,2e3),n.ignoreMasterSwitching=!r.isCurrentWindow,this.closing?[3,2]:(this.closing=!0,[4,_.browser.closeWindow(this.communicationUrls.closeWindow,s.createNativeXHR,this.windowId)]);case 1:t.sent(),t.label=2;case 2:return n.driverWindow.close(),[2,e]}})})},Xu.prototype._closeWindow=function(e){if(!this.childWindowDriverLinks.length)return _u.resolve();var t=this.childWindowDriverLinks.find(function(t){return t.windowId===e.windowId});if(t)return this._closeWindowAndWait(t,e);var n=this.childWindowDriverLinks.map(function(t){return t.findChildWindows(e,no)});return _u.all(n)},Xu.prototype._getWindows=function(){return l(this,void 0,void 0,function(){var e,n,r,i,o,s;return C(this,function(t){switch(t.label){case 0:return this.childWindowDriverLinks.length?(e=this.childWindowDriverLinks.map(function(t){return t.findChildWindows({},Zi)}),[4,_u.all(e)]):[2,[this._getWindowInfo()]];case 1:for(n=t.sent(),r=[this._getWindowInfo()],i=0,o=n;i<o.length;i++)s=o[i],Array.isArray(s.result)&&(r=r.concat(s.result));return[2,r]}})})},Xu.prototype._handleGetWindows=function(n,r){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return[4,this._getWindows(n,r)];case 1:return e=t.sent(),cs({requestMsgId:n.id,window:r,result:e}),[2]}})})},Xu.prototype._handleSwitchToWindow=function(e,n){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,this._switchToWindow(e)];case 1:return t.sent(),cs({requestMsgId:e.id,window:n}),[2]}})})},Xu.prototype._switchToWindow=function(e){var t=this;return this._isTargetWindow(e)?_u.resolve().then(function(){t._setCurrentWindowAsMaster()}):this.childWindowDriverLinks.length?_u.all(this.childWindowDriverLinks.map(function(t){return t.findChildWindows(e,oo)})):_u.resolve()},Xu.prototype._handleSetAsMasterMessage=function(t,e){var n=this;this._setAsMasterInProgressOrCompleted()||(this.setAsMasterInProgress=!0,cs({requestMsgId:t.id,window:e}),_u.resolve().then(function(){return _.browser.setActiveWindowId(n.communicationUrls.activeWindowId,s.createNativeXHR,n.windowId)}).then(function(){n._startInternal({finalizePendingCommand:t.finalizePendingCommand,result:{id:n.windowId}}),n.setAsMasterInProgress=!1}).catch(function(){n._onReady(new ss({isCommandResult:!0,executionError:new Zn}))}))},Xu.prototype._handleCloseAllWindowsMessage=function(t,e){var n=this;this._closeAllChildWindows().then(function(){cs({requestMsgId:t.id,window:e})}).catch(function(){n._onReady(new ss({isCommandResult:!0,executionError:new nr}))})},Xu.prototype._handleStartToRestoreChildLinkMessage=function(){this.parentWindowDriverLink.restoreChild(this._getCurrentWindowId())},Xu.prototype._handleHasPendingActionFlags=function(t,e){var n=this._hasPendingActionFlags(this.contextStorage);cs({requestMsgId:t.id,window:e,result:n})},Xu.prototype._handleRestoreChildLink=function(t,e){this._stopRespondToChildren||(this._addChildWindowDriverLink({window:e,windowId:t.windowId}),this.childWindowDriverLinks.length===this.contextStorage.getItem(Lu)&&this._restoreChildWindowsPromiseResolver&&(this._restoreChildWindowsPromiseResolver(),delete this._restoreChildWindowsPromiseResolver,this.contextStorage.setItem(Lu,0)),cs({requestMsgId:t.id,window:e}))},Xu.prototype._handleChildWindowIsOpenedInIFrame=function(){var e=this;this._pendingChildWindowInIFrame=new _u(function(t){e._resolvePendingChildWindowInIframe=t})},Xu.prototype._handleChildWindowIsLoadedInIFrame=function(e,t){cs({requestMsgId:e.id,window:t}),this._resolvePendingChildWindowInIframe(),this.childWindowDriverLinks.find(function(t){return t.windowId===e.windowId})||this._onChildWindowOpened({window:t,windowId:e.windowId})},Xu.prototype._handleStopInternalFromFrame=function(t,e){cs({requestMsgId:t.id,window:e}),this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1),this._stopInternal()},Xu.prototype._initChildDriverListening=function(){var r=this;Eu.on(Eu.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message,n=t.source;switch(e.type){case Wi:r._addChildIframeDriverLink(e.id,n);break;case Bi:r._handleChildWindowIsOpenedInIFrame(e,n);break;case Hi:r._handleChildWindowIsLoadedInIFrame(e,n);break;case Gi:r._handleStopInternalFromFrame(e,n);break;case ki:r._handleSetAsMasterMessage(e,n);break;case Ti:r._handleSwitchToWindow(e,n);break;case Ai:r._handleCloseWindow(e,n);break;case xi:r._handleSwitchToWindowValidation(e,n);break;case Ri:r._handleCloseWindowValidation(e,n);break;case Ni:r._handleGetWindows(e,n);break;case Oi:r._handleCloseAllWindowsMessage(e,n);break;case Li:r._handleStartToRestoreChildLinkMessage();break;case Vi:r._handleHasPendingActionFlags(e,n);break;case Ui:r._handleRestoreChildLink(e,n)}})},Xu.prototype._getChildIframeDriverLinkByWindow=function(e){return _.arrayUtils.find(this.childIframeDriverLinks,function(t){return t.driverWindow===e})},Xu.prototype._getChildWindowDriverLinkByWindow=function(e){return _.arrayUtils.find(this.childWindowDriverLinks,function(t){return t.driverWindow===e})},Xu.prototype._runInActiveIframe=function(t){var e=this,n=_u.resolve(),r=this.contextStorage.getItem(Pu);!this.activeChildIframeDriverLink&&r&&(n=this._switchToIframe(r,Hu)),n.then(function(){return e.contextStorage.setItem(e.EXECUTING_IN_IFRAME_FLAG,!0),e.activeChildIframeDriverLink.executeCommand(t,e.speed)}).then(function(t){return e._onCommandExecutedInIframe(t)}).catch(function(t){return e._onCommandExecutedInIframe(new ss({isCommandResult:!0,executionError:t}))})},Xu.prototype._onCommandExecutedInIframe=function(t){var e=this;this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1);var n=_u.resolve();this._pendingChildWindowInIFrame&&(n=this._pendingChildWindowInIFrame),n.then(function(){e._onReady(t)})},Xu.prototype._ensureChildIframeDriverLink=function(t,e,n){var r=this;return _.waitFor(function(){return r._getChildIframeDriverLinkByWindow(t)},500,n).catch(function(){throw new e})},Xu.prototype._ensureChildWindowDriverLink=function(t,e,n){var r=this;return _.waitFor(function(){return r._getChildWindowDriverLinkByWindow(t)},500,n).catch(function(){throw new e})},Xu.prototype._switchToIframe=function(e,n){var t,r,i,o,s,a,l,u=this,c="number"==typeof e.timeout,d=c?e.timeout:this.options.selectorTimeout;return t=e,r=d,i=null,o=function(t){return new n.NotFoundError(null,t)},s=function(){return new n.IsInvisibleError},a=this.statusBar,l=new pa(t,r,i,o,s),a.showWaitingElementStatus(l.timeout),l.getResult().then(function(t){return a.hideWaitingElementStatus(!!t).then(function(){return t})}).catch(function(t){return a.hideWaitingElementStatus(!1).then(function(){throw t})}).then(function(t){if(!_.domUtils.isIframeElement(t))throw new Ln;var e=c?d:Math.max(d,5e3);return u._ensureChildIframeDriverLink(Iu.contentWindowGetter.call(t),n.NotLoadedError,e)}).then(function(t){t.availabilityTimeout=d,u.activeChildIframeDriverLink=t,u.contextStorage.setItem(Pu,e)})},Xu.prototype._createWaitForEventPromise=function(e,n){var r=this,i=null,t=new _u(function(t){Iu.setTimeout.call(dc,function(){r.off(e,i),t()},n)}),o=new _u(function(t){i=function(){this.off(e,i),t()},r.on(e,i)});return _u.race([t,o])},Xu.prototype._waitForCurrentCommandCompletion=function(){return this.contextStorage.getItem(this.COMMAND_EXECUTING_FLAG)?this._createWaitForEventPromise(Gu,Bu):_u.resolve()},Xu.prototype._waitForSkipJsErrorFunctionCompletion=function(n){var r=this;return this.contextStorage.getItem(xu)?new _u(function(t){var e=function(){r.off(zu,e),t(n)};r.on(zu,e)}):_u.resolve(n)},Xu.prototype._waitForEmptyCommand=function(){return this._createWaitForEventPromise(Vu,3e4)},Xu.prototype._abortSwitchingToChildWindowIfItClosed=function(){if(this.activeChildWindowDriverLink.driverWindow.closed)throw _.arrayUtils.remove(this.childWindowDriverLinks,this.activeChildWindowDriverLink),this.activeChildWindowDriverLink=null,new Ir},Xu.prototype._switchToChildWindow=function(t){var e=this;this.contextStorage.setItem(this.PENDING_WINDOW_SWITCHING_FLAG,!0);var n=this.contextStorage.getItem(this.WINDOW_COMMAND_API_CALL_FLAG);return function(e,t){if("string"!=typeof e)return Zl.resolve(null);var n=_.arrayUtils.find(t,function(t){return t.windowId===e});if(n)return Zl.resolve(n);var r=new Xn;return Zl.reject(r)}(t,this.childWindowDriverLinks).then(function(t){return e._ensureChildWindowDriverLink(t.driverWindow,Jn,e.options.childWindowReadyTimeout)}).then(function(t){return e.activeChildWindowDriverLink=t,e._waitForCurrentCommandCompletion()}).then(function(){return n?void 0:e._waitForEmptyCommand()}).then(function(){return e._observeFileDownloadingInNewWindow(),e._abortSwitchingToChildWindowIfItClosed(),e._stopInternal(),e.activeChildWindowDriverLink.setAsMaster(n)}).then(function(){e.contextStorage.setItem(e.PENDING_WINDOW_SWITCHING_FLAG,!1)}).catch(function(t){e.contextStorage.setItem(e.PENDING_WINDOW_SWITCHING_FLAG,!1),t instanceof Ir?e._onReady(new ss):e._onReady(new ss({isCommandResult:!0,executionError:new Zn}))})},Xu.prototype._switchToTopParentWindow=function(){var t=this.parentWindowDriverLink.setTopOpenedWindowAsMaster.bind(this.parentWindowDriverLink);this._switchToParentWindowInternal(t)},Xu.prototype._switchToParentWindow=function(t){void 0===t&&(t={});var e=this.parentWindowDriverLink.setParentWindowAsMaster.bind(this.parentWindowDriverLink);this._switchToParentWindowInternal(e,t)},Xu.prototype._switchToParentWindowInternal=function(t,e){var n=this;return void 0===e&&(e={}),this.contextStorage.setItem(this.PENDING_WINDOW_SWITCHING_FLAG,!0),_u.resolve().then(function(){return n._stopInternal(),t(e)}).then(function(){n.contextStorage.setItem(n.PENDING_WINDOW_SWITCHING_FLAG,!1)}).catch(function(){n.contextStorage.setItem(n.PENDING_WINDOW_SWITCHING_FLAG,!1),n._onReady(new ss({isCommandResult:!0,executionError:new Zn}))})},Xu.prototype._switchToMainWindow=function(t){this.activeChildIframeDriverLink&&this.activeChildIframeDriverLink.executeCommand(t),this._clearActiveChildIframeInfo()},Xu.prototype._clearActiveChildIframeInfo=function(){this.contextStorage.setItem(Pu,null),this.activeChildIframeDriverLink=null},Xu.prototype._setNativeDialogHandlerInIframes=function(t){for(var e=new vo(t),n=0;n<this.childIframeDriverLinks.length;n++)Eu.sendServiceMsg(e,this.childIframeDriverLinks[n].driverWindow)},Xu.prototype._onActionCommand=function(t){var o=this,e=new la(t,this.options.selectorTimeout,this.speed,function(t,e,n){var r=Us(e.notFound),i=Us(e.invisible);return new pa(t,o.options.selectorTimeout,n,r,i).getResult()}),n=[];e.on(la.EXECUTION_STARTED_EVENT,function(){o.statusBar.hideWaitingElementStatus(!0),o.contextStorage.setItem(o.COMMAND_EXECUTING_FLAG,!0)}),e.on(la.WAITING_FOR_ELEMENT_EVENT,function(t){o.statusBar.showWaitingElementStatus(t)}),e.on(la.WARNING_EVENT,function(t){n.push(t)});var r=new _.ClientRequestEmitter,i=new _.ScriptExecutionEmitter,s=new hu(r,i,_.pageUnloadBarrier);e.execute(s).then(function(t){return new ss({isCommandResult:!0,result:$r(new su).encode(t),warnings:n})}).catch(function(t){return o.statusBar.hideWaitingElementStatus(!1).then(function(){return new ss({isCommandResult:!0,executionError:t})})}).then(function(t){return o._waitForSkipJsErrorFunctionCompletion(t)}).then(function(t){o.contextStorage.setItem(o.COMMAND_EXECUTING_FLAG,!1),o.contextStorage.setItem(xu,!1),o._onReady(t)})},Xu.prototype._onSetNativeDialogHandlerCommand=function(t){this.nativeDialogsTracker.setHandler(t.dialogHandler),this._setNativeDialogHandlerInIframes(t.dialogHandler),this._onReady(new ss({isCommandResult:!0}))},Xu.prototype._onGetNativeDialogHistoryCommand=function(){this._onReady(new ss({isCommandResult:!0,result:this.nativeDialogsTracker.appearedDialogs}))},Xu.prototype._onGetBrowserConsoleMessagesCommand=function(){this._onReady(new ss({isCommandResult:!0}))},Xu.prototype._onNavigateToCommand=function(t){var e=this;this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!0),function(i){return l(this,void 0,void 0,function(){var e,n,r;return C(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=new _.ClientRequestEmitter,n=new _.RequestBarrier(e),c.navigateTo(i.url,i.forceReload),[4,c.Promise.all([n.wait(),_.pageUnloadBarrier.wait()])];case 1:return t.sent(),[2,new ss({isCommandResult:!0})];case 2:return r=t.sent(),[2,new ss({isCommandResult:!0,executionError:r})];case 3:return[2]}})})}(t).then(function(t){return e.contextStorage.setItem(e.COMMAND_EXECUTING_FLAG,!1),e._onReady(t)})},Xu.prototype._onGetProxyUrlCommand=function(t){this._onReady(new ss({isCommandResult:!0,result:Wu.getProxyUrl(t.url,t.options)}))},Xu.prototype._onSkipJsErrorsCommand=function(t){var e=t.options;this.options.skipJsErrors=e,this._onReady(new ss({isCommandResult:!0}))},Xu.prototype._onExecuteClientFunctionCommand=function(t){var e=this;this.contextStorage.setItem(Ru,{instantiationCallsiteName:t.instantiationCallsiteName}),Ql(new ui(t)).then(function(t){e.contextStorage.setItem(Ru,null),e._onReady(t)})},Xu.prototype._onExecuteSelectorCommand=function(t){var e,n,r,i,o,s,a,l=this,u=this.contextStorage.getItem(Nu)||new Su,c=Us("CannotObtainInfoForElementSpecifiedBySelectorError"),d=t.strictError?Us(Ls()):c,h=t.strictError?Us(Os()):c;e=t,n=this.options.selectorTimeout,r=u,i=t.needError?d:null,o=t.needError?h:null,s=this.statusBar,a=new pa(e,n,r,i,o),s.showWaitingElementStatus(a.timeout),Ql(a).then(function(t){return s.hideWaitingElementStatus(!!t.result).then(function(){return t})}).then(function(t){l.contextStorage.setItem(Nu,null),l._onReady(t)})},Xu.prototype._onSwitchToMainWindowCommand=function(t){this._switchToMainWindow(t),this._onReady(new ss({isCommandResult:!0}))},Xu.prototype._onSwitchToIframeCommand=function(t){var e=this;this._switchToIframe(t.selector,Uu).then(function(){return e._onReady(new ss({isCommandResult:!0}))}).catch(function(t){return e._onReady(new ss({isCommandResult:!0,executionError:t}))})},Xu.prototype._onWindowOpenCommand=function(t){this.contextStorage.setItem(this.WINDOW_COMMAND_API_CALL_FLAG,!0),dc.open(t.url)},Xu.prototype._onWindowCloseCommand=function(a){return l(this,void 0,void 0,function(){var e,n,r,i,o,s;return C(this,function(t){switch(t.label){case 0:e=this._getTopOpenedWindow(),n=a.windowId||this.windowId,r=n===this.windowId,t.label=1;case 1:return t.trys.push([1,4,,5]),[4,this._validateChildWindowCloseCommandExists(n,e)];case 2:if(i=t.sent(),!(o=i.result).success)throw Xu._createWindowValidationError(o);return[4,ls(new no({windowId:n,isCurrentWindow:r}),e,us,Zn)];case 3:return t.sent(),r||this._onReady(new ss({isCommandResult:!0})),[3,5];case 4:return s=t.sent(),this._onReady(new ss({isCommandResult:!0,executionError:s})),[3,5];case 5:return[2]}})})},Xu.prototype._onGetCurrentWindowCommand=function(){this._onReady(new ss({isCommandResult:!0,result:{id:this.windowId}}))},Xu.prototype._onGetWindowsCommand=function(){return l(this,void 0,void 0,function(){var e,n;return C(this,function(t){switch(t.label){case 0:return e=this._getTopOpenedWindow(),[4,ls(new Zi,e,us,Zn)];case 1:return n=t.sent(),this._onReady(new ss({isCommandResult:!0,result:n.result})),[2]}})})},Xu.prototype._validateChildWindowCloseCommandExists=function(t,e){return ls(new Xi({windowId:t}),e,us,Zn)},Xu.prototype._validateChildWindowSwitchToWindowCommandExists=function(t,e){var n=t.windowId,r=t.fn;return ls(new Ji({windowId:n,fn:r}),e,us,Zn)},Xu.prototype._getTopOpenedWindow=function(){var t;return((null===(t=this.parentWindowDriverLink)||void 0===t?void 0:t.getTopOpenedWindow())||dc).top},Xu.prototype._onSwitchToWindow=function(i,o){return l(this,void 0,void 0,function(){var e,n,r;return C(this,function(t){switch(t.label){case 0:return e=this._getTopOpenedWindow(),[4,this._validateChildWindowSwitchToWindowCommandExists({windowId:i.windowId,fn:i.checkWindow},e)];case 1:return n=t.sent(),(r=n.result).success?(this._stopInternal(),ls(new oo({windowId:i.windowId,fn:i.checkWindow}),e,us,Zn)):this._onReady(new ss({isCommandResult:!0,executionError:o||Xu._createWindowValidationError(r)})),[2]}})})},Xu.prototype._restoreChildWindowLinks=function(){return l(this,void 0,void 0,function(){var e,n=this;return C(this,function(t){switch(t.label){case 0:if(!this.contextStorage.getItem(Lu))return[2];e=new _u(function(t){n._restoreChildWindowsPromiseResolver=t}),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,_.getTimeLimitedPromise(e,3e4)];case 2:return t.sent(),[3,4];case 3:return t.sent(),this._onReady(new ss({isCommandResult:!0,executionError:new Wr})),[3,4];case 4:return[2]}})})},Xu.prototype._onSwitchToPreviousWindow=function(t){this._onSwitchToWindow(t,new _r)},Xu.prototype._onSwitchToParentWindow=function(){this.parentWindowDriverLink?this._switchToParentWindow({finalizePendingCommand:!0}):this._onReady(new ss({isCommandResult:!0,executionError:new wr}))},Xu.prototype._onBrowserManipulationCommand=function(t){var e,n,r,i=this;this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!0),e=t,n=this.options.selectorTimeout,r=this.statusBar,new Jl(e,n,r).execute().then(function(t){return i.contextStorage.setItem(i.COMMAND_EXECUTING_FLAG,!1),i._onReady(t)})},Xu.prototype._onSetBreakpointCommand=function(t){var n=this,e=t.isTestError,r=t.inCompilerService,i=this.statusBar.showDebuggingStatus(e);r?(i.then(function(t){n.debug=t}),this._onReady(new ss({isCommandResult:!0,result:!0}))):i.then(function(t){var e=t===v;n._onReady(new ss({isCommandResult:!0,result:e}))})},Xu.prototype._onDisableDebugCommand=function(){this.statusBar._resetState(),this._onReady(new ss({isCommandResult:!0}))},Xu.prototype._onSetTestSpeedCommand=function(t){this.speed=t.speed,this._onReady(new ss({isCommandResult:!0}))},Xu.prototype._onShowAssertionRetriesStatusCommand=function(t){this.contextStorage.setItem(Fu,t.timeout),this.contextStorage.setItem(ku,Iu.dateNow()),this.statusBar.showWaitingAssertionRetriesStatus(t.timeout),this._onReady(new ss({isCommandResult:!0}))},Xu.prototype._onHideAssertionRetriesStatusCommand=function(t){var e=this;this.contextStorage.setItem(Fu,null),this.contextStorage.setItem(ku,null),this.statusBar.hideWaitingAssertionRetriesStatus(t.success).then(function(){return e._onReady(new ss({isCommandResult:!0}))})},Xu.prototype._checkStatus=function(){var n=this,t={statusUrl:this.communicationUrls.statusDone};return _.browser.checkStatus(t,s.createNativeXHR,{manualRedirect:!0,proxyless:this.options.proxyless}).then(function(t){var e=t.command;e.testRunId!==n.testRunId?(Cu.clear(),Cu.lock(),_.browser.redirect(e,s.createNativeXHR,n.communicationUrls.openFileProtocolUrl)):(n.contextStorage.setItem(Tu,!1),n._onReady({isCommandResult:!1}))}).catch(function(){return _.delay(1e3)})},Xu.prototype._onCustomCommand=function(t){var e=this;(0,this.customCommandHandlers[t.type].handler)(t).then(function(t){e._onReady(new ss({isCommandResult:!0,result:t}))})},Xu.prototype._closeAllChildWindows=function(){var t=this;return this.childWindowDriverLinks.length?_u.all(this.childWindowDriverLinks.map(function(t){return t.closeAllChildWindows()})).then(function(){Iu.arrayForEach.call(t.childWindowDriverLinks,function(t){t.driverWindow.close()})}):_u.resolve()},Xu.prototype._onTestDone=function(t){var e=this;this.contextStorage.setItem(Tu,!0),this.parentWindowDriverLink?this._switchToTopParentWindow():this._closeAllChildWindows().then(function(){return e._sendStatus(t)}).then(function(){e._checkStatus()}).catch(function(){e._onReady(new ss({isCommandResult:!0,executionError:nr}))})},Xu.prototype._onBackupStoragesCommand=function(){this._onReady(new ss({isCommandResult:!0,result:Cu.backup()}))},Xu.prototype._isPendingSwitchingWindow=function(){return!!this.contextStorage.getItem(this.PENDING_WINDOW_SWITCHING_FLAG)},Xu.prototype._onPrepareClientEnvironmentInDebugMode=function(t){Iu.objectDefineProperty(dc,t.esmRuntime,{value:{g:dc,c:dc.eval},configurable:!0}),this._onReady(new ss({isCommandResult:!0,result:!0}))},Xu.prototype._isStatusWithCommandResultInPendingWindowSwitchingMode=function(t){return t.isCommandResult&&this._isPendingSwitchingWindow()},Xu.prototype._isEmptyCommandInPendingWindowSwitchingMode=function(t){return!t&&this._isPendingSwitchingWindow()},Xu.prototype._observeFileDownloadingInNewWindow=function(){var e=this,t=new ss({isObservingFileDownloadingInNewWindow:!0});this._isPendingSwitchingWindow()&&this._sendStatus(t).then(function(t){t?e._onCommand(t):e._observeFileDownloadingInNewWindow()})},Xu.prototype._onReady=function(t){var e=this;this.debug&&(t.debug=this.debug,this.debug=null),this._isStatusWithCommandResultInPendingWindowSwitchingMode(t)&&this.emit(Gu),this._sendStatus(t).then(function(t){if(t)e._onCommand(t);else{if(e._isEmptyCommandInPendingWindowSwitchingMode(t))return void e.emit(Vu);e._onReady(new ss)}})},Xu.prototype._executeCommand=function(t){this.contextStorage.setItem(this.WINDOW_COMMAND_API_CALL_FLAG,!1),this.customCommandHandlers[t.type]?this._onCustomCommand(t):t.type===d.testDone?this._onTestDone(new ss({isCommandResult:!0})):t.type===d.setBreakpoint?this._onSetBreakpointCommand(t):t.type===d.disableDebug?this._onDisableDebugCommand():t.type===d.switchToMainWindow?this._onSwitchToMainWindowCommand(t):t.type===d.switchToIframe?this._onSwitchToIframeCommand(t):t.type===d.openWindow?this._onWindowOpenCommand(t):t.type===d.closeWindow?this._onWindowCloseCommand(t):t.type===d.getCurrentWindow?this._onGetCurrentWindowCommand(t):t.type===d.getCurrentWindows?this._onGetWindowsCommand():t.type===d.switchToWindow?this._onSwitchToWindow(t):t.type===d.switchToPreviousWindow?this._onSwitchToPreviousWindow(t):t.type===d.switchToParentWindow?this._onSwitchToParentWindow():m(t)?this._onBrowserManipulationCommand(t):t.type===d.executeClientFunction?this._onExecuteClientFunctionCommand(t):t.type===d.executeSelector?this._onExecuteSelectorCommand(t):t.type===d.navigateTo?this._onNavigateToCommand(t):t.type===d.setNativeDialogHandler?this._onSetNativeDialogHandlerCommand(t):t.type===d.getNativeDialogHistory?this._onGetNativeDialogHistoryCommand(t):t.type===d.getBrowserConsoleMessages?this._onGetBrowserConsoleMessagesCommand(t):t.type===d.setTestSpeed?this._onSetTestSpeedCommand(t):t.type===d.showAssertionRetriesStatus?this._onShowAssertionRetriesStatusCommand(t):t.type===d.hideAssertionRetriesStatus?this._onHideAssertionRetriesStatusCommand(t):t.type===d.backupStorages?this._onBackupStoragesCommand():t.type===d.closeChildWindowOnFileDownloading?this._closeChildWindowOnFileDownloading():t.type===d.prepareClientEnvironmentInDebugMode?this._onPrepareClientEnvironmentInDebugMode(t):t.type===d.getProxyUrl?this._onGetProxyUrlCommand(t):t.type===d.skipJsErrors?this._onSkipJsErrorsCommand(t):this._onActionCommand(t)},Xu.prototype._closeChildWindowOnFileDownloading=function(){this.activeChildWindowDriverLink.closeFileDownloadingWindow(),_.arrayUtils.remove(this.childWindowDriverLinks,this.activeChildWindowDriverLink),E.cursor.show(),this._startInternal()},Xu.prototype._isExecutableInTopWindowOnly=function(t){if((e=t).type===d.testDone||e.type===d.switchToMainWindow||e.type===d.setNativeDialogHandler||e.type===d.getNativeDialogHistory||e.type===d.setTestSpeed||e.type===d.showAssertionRetriesStatus||e.type===d.hideAssertionRetriesStatus||e.type===d.setBreakpoint||m(e)&&e.type!==d.takeElementScreenshot)return!0;var e,n=this.customCommandHandlers[t.type];return t.forceExecutionInTopWindowOnly||n&&n.isExecutableInTopWindowOnly},Xu.prototype._onCommand=function(n){var r=this;this.readyPromise.then(function(){var t,e=h(n);r.contextStorage.getItem(Du)&&e?r._onReady(new ss({isCommandResult:!0})):(t=r.activeChildIframeDriverLink||r.contextStorage.getItem(Pu),r._isExecutableInTopWindowOnly(n)||!t?r._executeCommand(n):r._runInActiveIframe(n))})},Xu.prototype.setCustomCommandHandlers=function(t,e,n){this.customCommandHandlers[t]={isExecutableInTopWindowOnly:n,handler:e}},Xu.prototype._startInternal=function(t){this.role=iu,_.browser.startHeartbeat(this.communicationUrls.heartbeat,s.createNativeXHR),this._setupAssertionRetryIndication(),this._startCommandsProcessing(t)},Xu.prototype._stopInternal=function(){this.role=ou,_.browser.stopHeartbeat(),E.cursor.hide()},Xu.prototype._setupAssertionRetryIndication=function(){var n=this;this.readyPromise.then(function(){n.statusBar.hidePageLoadingStatus();var t,e=n.contextStorage.getItem(Fu);e&&(t=n.contextStorage.getItem(ku),0<e-(new Su-t)&&n.statusBar.showWaitingAssertionRetriesStatus(e,t))})},Xu.prototype._startCommandsProcessing=function(t){void 0===t&&(t={finalizePendingCommand:!1,isFirstRequestAfterWindowSwitching:!1,result:void 0});var e,n,r=this.contextStorage.getItem(Au);r&&(r.resent=!0),this.contextStorage.getItem(Tu)?r?this._onTestDone(r):this._checkStatus():this._failIfClientCodeExecutionIsInterrupted()||(e=t.finalizePendingCommand||this._hasPendingActionFlags(this.contextStorage),n=r||new ss({isCommandResult:e,isFirstRequestAfterWindowSwitching:t.isFirstRequestAfterWindowSwitching,result:t.result}),this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!1),this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1),this.contextStorage.setItem(this.PENDING_WINDOW_SWITCHING_FLAG,!1),this._onReady(n))},Xu.prototype._initParentWindowLink=function(){dc.opener&&dc.opener!==dc&&this.windowId&&(this.parentWindowDriverLink=new nu(dc))},Xu.prototype._initConsoleMessages=function(){var t=this.consoleMessages;t.ensureMessageContainer(this.windowId),this.consoleMessages=t},Xu.prototype._getDriverRole=function(){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return this.windowId?[4,_.browser.getActiveWindowId(this.communicationUrls.activeWindowId,s.createNativeXHR)]:[2,iu];case 1:return[2,t.sent().activeWindowId===this.windowId?iu:ou]}})})},Xu.prototype._init=function(){this.contextStorage=new jo(dc,this.testRunId,this.windowId),this.nativeDialogsTracker=new Ei(this.contextStorage,this.options.dialogHandler),this.statusBar=new n.StatusBar(this.runInfo.userAgent,this.runInfo.fixtureName,this.runInfo.testName,this.contextStorage),this.statusBar.on(this.statusBar.UNLOCK_PAGE_BTN_CLICK,_.disableRealEventsPreventing),this.speed=this.options.speed,this._initConsoleMessages(),this._initParentWindowLink(),this._isOpenedInIframe()&&ls(new Po(this.windowId),dc.opener.top,us,pr)},Xu.prototype._doFirstPageLoadSetup=function(){return l(this,void 0,void 0,function(){return C(this,function(t){return this.isFirstPageLoad&&this.options.canUseDefaultWindowActions,[2]})})},Xu.prototype.start=function(){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return this._init(),[4,this._doFirstPageLoadSetup()];case 1:return t.sent(),[4,this._restoreChildWindowLinks()];case 2:return t.sent(),[4,this._getDriverRole()];case 3:return e=t.sent(),this.role===iu||e===iu&&this._startInternal(),[2]}})})},Xu);function Xu(t,e,n,r){var i=wu.call(this)||this;i.COMMAND_EXECUTING_FLAG="testcafe|driver|command-executing-flag",i.EXECUTING_IN_IFRAME_FLAG="testcafe|driver|executing-in-iframe-flag",i.PENDING_WINDOW_SWITCHING_FLAG="testcafe|driver|pending-window-switching-flag",i.WINDOW_COMMAND_API_CALL_FLAG="testcafe|driver|window-command-api-flag",i.testRunId=t,i.communicationUrls=e,i.runInfo=n,i.options=r,i.isFirstPageLoad=vu.get().isFirstPageLoad,i.customCommandHandlers={},i.contextStorage=null,i.nativeDialogsTracker=null,i.childIframeDriverLinks=[],i.activeChildIframeDriverLink=null,i.childWindowDriverLinks=[],i.parentWindowDriverLink=null,i.statusBar=null,i.windowId=i._getCurrentWindowId(),i.role=ou,i.setAsMasterInProgress=!1,i.checkClosedChildWindowIntervalId=null;var o=new _.ClientRequestEmitter;return i.pageInitialRequestBarrier=new _.RequestBarrier(o),i.readyPromise=i._getReadyPromise(),i._initChildDriverListening(),_.pageUnloadBarrier.init(),_.preventRealEvents(),s.on(s.EVENTS.uncaughtJsError,function(t){return i._onJsError(t)}),s.on(s.EVENTS.unhandledRejection,function(t){return i._onJsError(t)}),s.on(s.EVENTS.consoleMethCalled,function(t){return i._onConsoleMessage(t)}),s.on(s.EVENTS.beforeFormSubmit,function(t){return i._onFormSubmit(t)}),s.on(s.EVENTS.windowOpened,function(t){return i._onChildWindowOpened(t)}),i.setCustomCommandHandlers(d.unlockPage,function(){return i._unlockPageAfterTestIsDone()}),i.setCustomCommandHandlers(d.getActiveElement,function(){return i._getActiveElement()}),bu.addInternalEventBeforeListener(dc,["beforeunload"],function(){i._sendStartToRestoreCommand()}),i.replicator=$r([new Rs]),i}var Yu=(Ku.prototype.establishConnection=function(){return ls(new qi,this.driverWindow,5e3,qn).then(function(t){return t.result.id})},Ku.prototype.sendConfirmationMessage=function(t){cs({requestMsgId:t,window:this.driverWindow})},Ku.prototype.onCommandExecuted=function(t){var e=new lo(t);c.eventSandbox.message.sendServiceMsg(e,this.driverWindow)},Ku.prototype.hasPendingActionFlags=function(){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,ls(new Go,this.driverWindow,5e3,qn)];case 1:return[2,t.sent().result]}})})},Ku);function Ku(t){this.driverWindow=t}var Ju,$u=s.eventSandbox.message,Qu=(t(Zu,Ju=Ei),Zu.prototype._defaultDialogHandler=function(t){$u.sendServiceMsg({type:hi,dialogType:t,url:Ei._getPageUrl()},dc.top)},Zu.prototype._addAppearedDialogs=function(t,e){$u.sendServiceMsg({type:di,dialogType:t,text:e,url:Ei._getPageUrl()},dc.top)},Zu.prototype._onHandlerError=function(t,e){$u.sendServiceMsg({type:fi,dialogType:t,message:e,url:Ei._getPageUrl()},dc.top)},Zu);function Zu(t){return Ju.call(this,null,t)||this}var tc,ec=c.eventSandbox.message,nc=(t(rc,tc=ju),rc.prototype._onJsError=function(){},rc.prototype._onConsoleMessage=function(){},rc.prototype._onChildWindowOpened=function(){ec.sendServiceMsg(new ko,dc.top)},rc.prototype._stopInternal=function(){ec.sendServiceMsg(new Uo,dc.top)},rc.prototype._initParentDriverListening=function(){var n=this;c.eventSandbox.message.on(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message;_.pageUnloadBarrier.wait(0).then(function(){if(e.type===Pi){if(n.lastParentDriverMessageId===e.id)return;n.lastParentDriverMessageId=e.id,n.readyPromise.then(function(){n.speed=e.testSpeed,n.parentDriverLink.sendConfirmationMessage(e.id),n._onCommand(e.command)})}e.type===Fi&&(n.nativeDialogsTracker.setHandler(e.dialogHandler),n._setNativeDialogHandlerInIframes(e.dialogHandler))})})},rc.prototype._onSwitchToMainWindowCommand=function(t){this._switchToMainWindow(t)},rc.prototype._onReady=function(t){this.parentDriverLink.onCommandExecuted(t)},rc.prototype._isInCommandExecution=function(){return l(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return c.utils.dom.isCrossDomainWindows(dc,dc.parent)?[4,this.parentDriverLink.hasPendingActionFlags()]:[3,2];case 1:return[2,t.sent()];case 2:return[2,this._hasPendingActionFlags(this.contextStorage)]}})})},rc.prototype._init=function(){return l(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return[4,this.parentDriverLink.establishConnection()];case 1:return e=t.sent(),this.contextStorage=new jo(dc,e,this.windowId),this._failIfClientCodeExecutionIsInterrupted()?[2]:[4,this._isInCommandExecution()];case 2:return t.sent()&&(this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!1),this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1),this._onReady(new ss({isCommandResult:!0}))),[2]}})})},rc.prototype.start=function(){this.nativeDialogsTracker=new Qu(this.options.dialogHandler),this.statusBar=new n.IframeStatusBar;var t=this._init();this.readyPromise=c.Promise.all([this.readyPromise,t])},rc);function rc(t,e){var n=tc.call(this,t,{},{},e)||this;return n.lastParentDriverMessageId=null,n.parentDriverLink=new Yu(dc.parent),n._initParentDriverListening(),n}var ic={NodeSnapshot:_s,ElementSnapshot:Ts,SelectorExecutor:pa},oc="%testCafeDriver%",sc="%testCafeIframeDriver%",ac="%testCafeEmbeddingUtils%",lc=s.nativeMethods,uc=s.EVENTS.evalIframeScript;lc.objectDefineProperty(dc,oc,{configurable:!0,value:ju}),lc.objectDefineProperty(dc,sc,{configurable:!0,value:nc}),lc.objectDefineProperty(dc,ac,{configurable:!0,value:ic}),s.on(uc,function(t){return cc(lc.contentWindowGetter.call(t.iframe))})}(dc["%hammerhead%"],dc["%hammerhead%"].Promise,dc["%testCafeCore%"],dc["%testCafeAutomation%"],dc["%testCafeUI%"])}(window);
1
+ window["%hammerhead%"].utils.removeInjectedScript(),function Cc(Ic){var Sc=Ic.document;!function(c,e,_,E,n){var l="default"in c?c.default:c;e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var u="default"in n?n.default:n,r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function t(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function s(t,s,a,l){return new(a=a||e)(function(n,e){function r(t){try{o(l.next(t))}catch(t){e(t)}}function i(t){try{o(l.throw(t))}catch(t){e(t)}}function o(t){var e;t.done?n(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(r,i)}o((l=l.apply(t,s||[])).next())})}function C(n,r){var i,o,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},l={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function t(e){return function(t){return function(e){if(i)throw new TypeError("Generator is already executing.");for(;l&&e[l=0]&&(a=0),a;)try{if(i=1,o&&(s=2&e[0]?o.return:e[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,e[1])).done)return s;switch(o=0,s&&(e=[2&e[0],s.value]),e[0]){case 0:case 1:s=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,o=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(s=0<(s=a.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){a.label=e[1];break}if(6===e[0]&&a.label<s[1]){a.label=s[1],s=e;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(e);break}s[2]&&a.ops.pop(),a.trys.pop();continue}e=r.call(n,a)}catch(t){e=[6,t],o=0}finally{i=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var i,o,a=Math.floor(399);(o=i=i||{}).ready="ready",o.readyForBrowserManipulation="ready-for-browser-manipulation",o.waitForFileDownload="wait-for-file-download";var d=i,h={dispatchEvent:"dispatch-event",click:"click",rightClick:"right-click",doubleClick:"double-click",drag:"drag",dragToElement:"drag-to-element",hover:"hover",scroll:"scroll",scrollBy:"scroll-by",scrollIntoView:"scroll-into-view",typeText:"type-text",selectText:"select-text",selectTextAreaContent:"select-text-area-content",selectEditableContent:"select-editable-content",pressKey:"press-key",wait:"wait",navigateTo:"navigate-to",setFilesToUpload:"set-files-to-upload",clearUpload:"clear-upload",executeClientFunction:"execute-client-function",executeSelector:"execute-selector",takeScreenshot:"take-screenshot",takeElementScreenshot:"take-element-screenshot",takeScreenshotOnFail:"take-screenshot-on-fail",prepareBrowserManipulation:"prepare-browser-manipulation",showAssertionRetriesStatus:"show-assertion-retries-status",hideAssertionRetriesStatus:"hide-assertion-retries-status",setBreakpoint:"set-breakpoint",resizeWindow:"resize-window",resizeWindowToFitDevice:"resize-window-to-fit-device",maximizeWindow:"maximize-window",switchToIframe:"switch-to-iframe",switchToMainWindow:"switch-to-main-window",openWindow:"open-window",closeWindow:"close-window",getCurrentWindow:"get-current-window",getCurrentWindows:"get-current-windows",switchToWindow:"switch-to-window",switchToWindowByPredicate:"switch-to-window-by-predicate",switchToParentWindow:"switch-to-parent-window",switchToPreviousWindow:"switch-to-previous-window",setNativeDialogHandler:"set-native-dialog-handler",getNativeDialogHistory:"get-native-dialog-history",getBrowserConsoleMessages:"get-browser-console-messages",getActiveElement:"get-active-element",setTestSpeed:"set-test-speed",setPageLoadTimeout:"set-page-load-timeout",debug:"debug",disableDebug:"disable-debug",assertion:"assertion",useRole:"useRole",testDone:"test-done",backupStorages:"backup-storages",executeExpression:"execute-expression",executeAsyncExpression:"execute-async-expression",unlockPage:"unlock-page",closeChildWindowOnFileDownloading:"close-child-window-on-file-downloading",recorder:"recorder",prepareClientEnvironmentInDebugMode:"prepare-client-environment-in-debug-mode",getCookies:"get-cookies",setCookies:"set-cookies",deleteCookies:"delete-cookies",getProxyUrl:"get-proxy-url",request:"request",skipJsErrors:"skip-js-errors",addRequestHooks:"add-request-hooks",removeRequestHooks:"remove-request-hooks",runCustomAction:"run-custom-action"};function p(t){return!(f(r=t)||r.type===h.wait||r.type===h.assertion||r.type===h.executeExpression||g(t)||(n=t).type===h.testDone||n.type===h.showAssertionRetriesStatus||n.type===h.hideAssertionRetriesStatus||n.type===h.setBreakpoint||n.type===h.takeScreenshotOnFail||n.type===h.recorder||n.type===h.getProxyUrl)||m(t)&&!((e=t).type===h.switchToIframe||e.type===h.switchToMainWindow);var e,n,r}function f(t){return t.type===h.executeClientFunction||t.type===h.executeSelector}function m(t){return t.type===h.resizeWindow||t.type===h.resizeWindowToFitDevice||t.type===h.maximizeWindow}function g(t){return(e=t).type===h.takeScreenshot||e.type===h.takeElementScreenshot||e.type===h.takeScreenshotOnFail||m(t);var e}function v(t,e){this.code=t,this.isTestCafeError=!0,this.callsite=e||null}var w,y="step",I="E1",S="E4",b="E5",T="E9",W="E10",A="E11",x="E12",R="E24",N="E26",P="E27",D="E28",M="E29",F="E30",k="E31",O="E32",L="E33",U="E34",H="E35",B="E36",G="E37",V="E39",q="E40",z="E41",j="E42",X="E43",Y="E44",J="E45",K="E46",$="E49",Q="E50",Z="E51",tt="E52",et="E57",nt="E64",rt="E65",it="E68",ot="E69",st="E70",at="E71",lt="E72",ut="E73",ct="E74",dt="E76",ht="E77",pt="E78",ft="E82",mt="E83",gt="E90",vt="E91",wt="E92",yt="E93",_t="E94",Et="E95",Ct="E97",It="E99",St="E100",bt="E101",Tt=(t(Wt,w=v),Wt);function Wt(t,e,n){var r=w.call(this,t)||this;return r.optionName=e,r.actualValue=n,r}var At,xt=(t(Rt,At=v),Rt);function Rt(t,e){var n=At.call(this,$,e)||this;return n.instantiationCallsiteName=t,n}var Nt,Pt=(t(Dt,Nt=v),Dt);function Dt(t,e){var n=Nt.call(this,Q,e)||this;return n.instantiationCallsiteName=t,n}var Mt,Ft=(t(kt,Mt=v),kt);function kt(t,e,n){var r=void 0===e?{}:e,i=r.apiFnChain,o=r.apiFnIndex,s=r.reason,a=Mt.call(this,t,n)||this;return a.apiFnChain=i,a.apiFnIndex=o,a.reason=s,a}var Ot,Lt=(t(Ut,Ot=v),Ut);function Ut(t){return Ot.call(this,Z,t)||this}var Ht,Bt=(t(Gt,Ht=Ft),Gt);function Gt(t,e){return Ht.call(this,tt,e,t)||this}var Vt,qt=(t(zt,Vt=v),zt);function zt(t,e){var n=Vt.call(this,I)||this;return n.errStack=t,n.pageDestUrl=e,n}var jt,Xt=(t(Yt,jt=v),Yt);function Yt(t,e,n){var r=jt.call(this,S,n)||this;return r.errMsg=String(e),r.instantiationCallsiteName=t,r}var Jt,Kt=(t($t,Jt=v),$t);function $t(t,e,n,r){var i=Jt.call(this,b,r)||this;return i.errMsg=String(e),i.property=n,i.instantiationCallsiteName=t,i}var Qt,Zt=(t(te,Qt=v),te);function te(t){var e=Qt.call(this,nt)||this;return e.errMsg=String(t),e}var ee,ne=(t(re,ee=v),re);function re(t,e){var n=ee.call(this,rt)||this;return n.errMsg=String(t),n.moduleName=e,n}var ie,oe=(t(se,ie=Tt),se);function se(t,e){return ie.call(this,T,t,e)||this}var ae,le=(t(ue,ae=Tt),ue);function ue(t,e){return ae.call(this,W,t,e)||this}var ce,de=(t(he,ce=Tt),he);function he(t,e){return ce.call(this,A,t,e)||this}var pe,fe=(t(me,pe=Tt),me);function me(t,e){return pe.call(this,x,t,e)||this}var ge,ve=(t(we,ge=Tt),we);function we(t,e){return ge.call(this,gt,t,e)||this}var ye,_e=(t(Ee,ye=Tt),Ee);function Ee(t,e){return ye.call(this,Ct,t,e)||this}var Ce,Ie=(t(Se,Ce=Tt),Se);function Se(t,e){return Ce.call(this,vt,t,e)||this}var be,Te=(t(We,be=Tt),We);function We(t,e){return be.call(this,wt,t,e)||this}var Ae,xe=(t(Re,Ae=Tt),Re);function Re(t,e){return Ae.call(this,yt,t,e)||this}var Ne,Pe=(t(De,Ne=Tt),De);function De(t,e){return Ne.call(this,_t,t,e)||this}var Me,Fe=(t(ke,Me=Tt),ke);function ke(t,e){return Me.call(this,Et,t,e)||this}var Oe,Le=(t(Ue,Oe=Tt),Ue);function Ue(t,e){return Oe.call(this,It,t,e)||this}var He,Be=(t(Ge,He=v),Ge);function Ge(t,e,n){var r=He.call(this,St)||this;return r.objectName=t,r.propertyName=e,r.availableProperties=n,r}var Ve,qe=(t(ze,Ve=Ft),ze);function ze(t,e){return Ve.call(this,R,e,t)||this}var je,Xe=(t(Ye,je=Ft),Ye);function Ye(t,e){return je.call(this,N,e,t)||this}var Je,Ke=(t($e,Je=v),$e);function $e(t){var e=Je.call(this,P)||this;return e.nodeDescription=t,e}var Qe,Ze=(t(tn,Qe=Ft),tn);function tn(t,e){var n=Qe.call(this,D,e)||this;return n.argumentName=t,n}var en,nn=(t(rn,en=v),rn);function rn(t){return en.call(this,bt,t)||this}var on,sn=(t(an,on=Ft),an);function an(t,e){var n=on.call(this,M,e)||this;return n.argumentName=t,n}var ln,un=(t(cn,ln=v),cn);function cn(t,e){var n=ln.call(this,F)||this;return n.argumentName=t,n.nodeDescription=e,n}var dn,hn=(t(pn,dn=v),pn);function pn(){return dn.call(this,k)||this}var fn,mn=(t(gn,fn=v),gn);function gn(){return fn.call(this,O)||this}var vn,wn=(t(yn,vn=v),yn);function yn(t){var e=vn.call(this,L)||this;return e.argumentName=t,e}var _n,En=(t(Cn,_n=v),Cn);function Cn(){return _n.call(this,H)||this}var In,Sn=(t(bn,In=v),bn);function bn(t){var e=In.call(this,B)||this;return e.argumentName=t,e}var Tn,Wn=(t(An,Tn=v),An);function An(t,e){var n=Tn.call(this,G)||this;return n.filePaths=t,n.scannedFilePaths=e,n}var xn,Rn=(t(Nn,xn=v),Nn);function Nn(){return xn.call(this,U)||this}var Pn,Dn=(t(Mn,Pn=v),Mn);function Mn(t,e){var n=Pn.call(this,z)||this;return n.properties=t?"scrollTargetY property":e?"scrollTargetX property":"scrollTargetX and scrollTargetY properties",n}var Fn,kn=(t(On,Fn=v),On);function On(t,e){var n=Fn.call(this,et)||this;return t<=0?e<=0?(n.verb="are",n.dimensions="width and height"):(n.verb="is",n.dimensions="width"):(n.verb="is",n.dimensions="height"),n}var Ln,Un=(t(Hn,Ln=v),Hn);function Hn(t){return Ln.call(this,q,t)||this}var Bn,Gn=(t(Vn,Bn=v),Vn);function Vn(){return Bn.call(this,V)||this}var qn,zn=(t(jn,qn=v),jn);function jn(){return qn.call(this,j)||this}var Xn,Yn=(t(Jn,Xn=v),Jn);function Jn(){return Xn.call(this,ot)||this}var Kn,$n=(t(Qn,Kn=v),Qn);function Qn(){return Kn.call(this,it)||this}var Zn,tr=(t(er,Zn=v),er);function er(){return Zn.call(this,st)||this}var nr,rr=(t(ir,nr=v),ir);function ir(){return nr.call(this,at)||this}var or,sr=(t(ar,or=v),ar);function ar(){return or.call(this,ut)||this}var lr,ur=(t(cr,lr=v),cr);function cr(){return lr.call(this,ft)||this}var dr,hr=(t(pr,dr=v),pr);function pr(t){var e=dr.call(this,pt)||this;return e.errMsg=t,e}var fr,mr=(t(gr,fr=v),gr);function gr(){return fr.call(this,ct)||this}var vr,wr=(t(yr,vr=v),yr);function yr(){return vr.call(this,dt)||this}var _r,Er=(t(Cr,_r=v),Cr);function Cr(){return _r.call(this,ht)||this}var Ir,Sr=(t(br,Ir=v),br);function br(){return Ir.call(this,lt)||this}var Tr,Wr=(t(Ar,Tr=v),Ar);function Ar(){return Tr.call(this,mt)||this}var xr,Rr=(t(Nr,xr=v),Nr);function Nr(){return xr.call(this,X)||this}var Pr,Dr=(t(Mr,Pr=v),Mr);function Mr(){return Pr.call(this,Y)||this}var Fr,kr=(t(Or,Fr=v),Or);function Or(t,e){var n=Fr.call(this,J)||this;return n.dialogType=t,n.pageUrl=e,n}var Lr,Ur=(t(Hr,Lr=v),Hr);function Hr(t,e,n){var r=Lr.call(this,K)||this;return r.dialogType=t,r.errMsg=e,r.pageUrl=n,r}var Br=Object.freeze({__proto__:null,TestRunErrorBase:v,ClientFunctionExecutionInterruptionError:xt,DomNodeClientFunctionResultError:Pt,SelectorErrorBase:Ft,InvalidSelectorResultError:Lt,CannotObtainInfoForElementSpecifiedBySelectorError:Bt,UncaughtErrorOnPage:qt,UncaughtErrorInClientFunctionCode:Xt,UncaughtErrorInCustomDOMPropertyCode:Kt,UncaughtErrorInCustomClientScriptCode:Zt,UncaughtErrorInCustomClientScriptLoadedFromModule:ne,ActionIntegerOptionError:oe,ActionPositiveIntegerOptionError:le,ActionBooleanOptionError:de,ActionSpeedOptionError:fe,ActionStringOptionError:ve,ActionStringOrRegexOptionError:_e,ActionDateOptionError:Ie,ActionNumberOptionError:Te,ActionUrlOptionError:xe,ActionUrlSearchParamsOptionError:Pe,ActionObjectOptionError:Fe,ActionFunctionOptionError:Le,ActionInvalidObjectPropertyError:Be,ActionElementNotFoundError:qe,ActionElementIsInvisibleError:Xe,ActionSelectorMatchesWrongNodeTypeError:Ke,ActionAdditionalElementNotFoundError:Ze,ActionElementIsNotTargetError:nn,ActionAdditionalElementIsInvisibleError:sn,ActionAdditionalSelectorMatchesWrongNodeTypeError:un,ActionElementNonEditableError:hn,ActionElementNotTextAreaError:mn,ActionElementNonContentEditableError:wn,ActionRootContainerNotFoundError:En,ActionIncorrectKeysError:Sn,ActionCannotFindFileToUploadError:Wn,ActionElementIsNotFileInputError:Rn,ActionInvalidScrollTargetError:Dn,InvalidElementScreenshotDimensionsError:kn,ActionElementNotIframeError:Un,ActionIframeIsNotLoadedError:Gn,CurrentIframeIsNotLoadedError:zn,ChildWindowNotFoundError:Yn,ChildWindowIsNotLoadedError:$n,CannotSwitchToWindowError:tr,CloseChildWindowError:rr,CannotCloseWindowWithChildrenError:sr,CannotCloseWindowWithoutParentError:ur,SwitchToWindowPredicateError:hr,WindowNotFoundError:mr,ParentWindowNotFoundError:wr,PreviousWindowNotFoundError:Er,ChildWindowClosedBeforeSwitchingError:Sr,CannotRestoreChildWindowError:Wr,CurrentIframeNotFoundError:Rr,CurrentIframeIsInvisibleError:Dr,NativeDialogNotHandledError:kr,UncaughtErrorInNativeDialogHandler:Ur}),Gr="_nativeMethods",Vr=(qr.prototype._ensureNativeMethods=function(t){return t||{objectKeys:Object.keys,arrayForEach:Array.prototype.forEach,arrayConcat:Array.prototype.concat,arraySlice:Array.prototype.slice,objectDefineProperty:Object.defineProperty}},qr.prototype._getWindowIds=function(t){return this[Gr].objectKeys(t)},qr.prototype._copyArray=function(t){return this[Gr].arraySlice.call(t)},qr.prototype._concatArrays=function(t,e){return this[Gr].arrayConcat.call(t,e)},qr.prototype.ensureMessageContainer=function(t){this[t]||(this[t]={log:[],info:[],warn:[],error:[]})},qr.prototype.concat=function(e){var n=this;if(!e)return this;var t=this._getWindowIds(e);return this[Gr].arrayForEach.call(t,function(t){n.ensureMessageContainer(t),n[t].log=n._concatArrays(n[t].log,e[t].log),n[t].info=n._concatArrays(n[t].info,e[t].info),n[t].warn=n._concatArrays(n[t].warn,e[t].warn),n[t].error=n._concatArrays(n[t].error,e[t].error)}),this},qr.prototype.addMessage=function(t,e,n){this.ensureMessageContainer(n),this[n][t].push(e)},qr.prototype.getCopy=function(){var e=this,n={},t=this._getWindowIds(this);return this[Gr].arrayForEach.call(t,function(t){n[t]={log:e._copyArray(e[t].log),info:e._copyArray(e[t].info),warn:e._copyArray(e[t].warn),error:e._copyArray(e[t].error)}}),n},qr);function qr(t,e){var n=this._ensureNativeMethods(e);n.objectDefineProperty(this,Gr,{value:n}),this.concat(t)}var zr,jr=(t(Xr,zr=Vr),Xr);function Xr(t){return zr.call(this,t,c.nativeMethods)||this}var Yr,Jr,Kr=(function(t){function n(t){return!!s[t]}function r(t,e){this.references=t,this.transforms=e,this.circularCandidates=[],this.circularCandidatesDescrs=[],this.circularRefCount=0}var o=/^#*@(t|r)$/,i=(0,eval)("this"),s={Int8Array:"function"==typeof Int8Array?Int8Array:void 0,Uint8Array:"function"==typeof Uint8Array?Uint8Array:void 0,Uint8ClampedArray:"function"==typeof Uint8ClampedArray?Uint8ClampedArray:void 0,Int16Array:"function"==typeof Int16Array?Int16Array:void 0,Uint16Array:"function"==typeof Uint16Array?Uint16Array:void 0,Int32Array:"function"==typeof Int32Array?Int32Array:void 0,Uint32Array:"function"==typeof Uint32Array?Uint32Array:void 0,Float32Array:"function"==typeof Float32Array?Float32Array:void 0,Float64Array:"function"==typeof Float64Array?Float64Array:void 0},a="function"==typeof ArrayBuffer,l="function"==typeof Map,u="function"==typeof Set,c="function"==typeof Buffer,d=Array.prototype.slice,e={serialize:function(t){return JSON.stringify(t)},deserialize:function(t){return JSON.parse(t)}};function h(t,e){this.references=t,this.transformMap=e,this.activeTransformsStack=[],this.visitedRefs=Object.create(null)}r._createRefMark=function(t){var e=Object.create(null);return e["@r"]=t,e},r.prototype._createCircularCandidate=function(t,e,n){this.circularCandidates.push(t),this.circularCandidatesDescrs.push({parent:e,key:n,refIdx:-1})},r.prototype._applyTransform=function(t,e,n,r){var i=Object.create(null),o=r.toSerializable(t);return"object"==typeof o&&this._createCircularCandidate(t,e,n),i["@t"]=r.type,i.data=this._handleValue(o,e,n),i},r.prototype._handleArray=function(t){for(var e=[],n=0;n<t.length;n++)e[n]=this._handleValue(t[n],e,n);return e},r.prototype._handlePlainObject=function(n){var r=this,i=Object.create(null);return Object.getOwnPropertyNames(n).forEach(function(t){var e=o.test(t)?"#"+t:t;i[e]=r._handleValue(n[t],i,e)}),i},r.prototype._handleObject=function(t,e,n){return this._createCircularCandidate(t,e,n),Array.isArray(t)?this._handleArray(t):this._handlePlainObject(t)},r.prototype._ensureCircularReference=function(t){var e=this.circularCandidates.indexOf(t);if(-1<e){var n=this.circularCandidatesDescrs[e];return-1===n.refIdx&&(n.refIdx=n.parent?++this.circularRefCount:0),r._createRefMark(n.refIdx)}return null},r.prototype._handleValue=function(t,e,n){var r=typeof t,i="object"==r&&null!==t;if(i){var o=this._ensureCircularReference(t);if(o)return o}for(var s=0;s<this.transforms.length;s++){var a=this.transforms[s];if(a.shouldTransform(r,t))return this._applyTransform(t,e,n,a)}return i?this._handleObject(t,e,n):t},r.prototype.transform=function(){for(var t=[this._handleValue(this.references,null,null)],e=0;e<this.circularCandidatesDescrs.length;e++){var n=this.circularCandidatesDescrs[e];0<n.refIdx&&(t[n.refIdx]=n.parent[n.key],n.parent[n.key]=r._createRefMark(n.refIdx))}return t},h.prototype._handlePlainObject=function(e){var t,n=this,r=Object.create(null),i=Object.getOwnPropertyNames(e);for(t in i.forEach(function(t){n._handleValue(e[t],e,t),o.test(t)&&(r[t.substring(1)]=e[t],delete e[t])}),r)e[t]=r[t]},h.prototype._handleTransformedObject=function(t,e,n){var r=t["@t"],i=this.transformMap[r];if(!i)throw new Error("Can't find transform for \""+r+'" type.');this.activeTransformsStack.push(t),this._handleValue(t.data,t,"data"),this.activeTransformsStack.pop(),e[n]=i.fromSerializable(t.data)},h.prototype._handleCircularSelfRefDuringTransform=function(t,e,n){var r=this.references,i=void 0;Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:function(){return void 0===i&&(i=r[t]),i},set:function(t){return i=t}})},h.prototype._handleCircularRef=function(t,e,n){-1<this.activeTransformsStack.indexOf(this.references[t])?this._handleCircularSelfRefDuringTransform(t,e,n):(this.visitedRefs[t]||(this.visitedRefs[t]=!0,this._handleValue(this.references[t],this.references,t)),e[n]=this.references[t])},h.prototype._handleValue=function(t,e,n){if("object"==typeof t&&null!==t){var r=t["@r"];if(void 0!==r)this._handleCircularRef(r,e,n);else if(t["@t"])this._handleTransformedObject(t,e,n);else if(Array.isArray(t))for(var i=0;i<t.length;i++)this._handleValue(t[i],t,i);else this._handlePlainObject(t)}},h.prototype.transform=function(){return this.visitedRefs[0]=!0,this._handleValue(this.references[0],this.references,0),this.references[0]};var p=[{type:"[[NaN]]",shouldTransform:function(t,e){return"number"===t&&isNaN(e)},toSerializable:function(){return""},fromSerializable:function(){return NaN}},{type:"[[undefined]]",shouldTransform:function(t){return"undefined"===t},toSerializable:function(){return""},fromSerializable:function(){}},{type:"[[Date]]",shouldTransform:function(t,e){return e instanceof Date},toSerializable:function(t){return t.getTime()},fromSerializable:function(t){var e=new Date;return e.setTime(t),e}},{type:"[[RegExp]]",shouldTransform:function(t,e){return e instanceof RegExp},toSerializable:function(t){var e={src:t.source,flags:""};return t.global&&(e.flags+="g"),t.ignoreCase&&(e.flags+="i"),t.multiline&&(e.flags+="m"),e},fromSerializable:function(t){return new RegExp(t.src,t.flags)}},{type:"[[Error]]",shouldTransform:function(t,e){return e instanceof Error},toSerializable:function(t){return{name:t.name,message:t.message,stack:t.stack}},fromSerializable:function(t){var e=new(i[t.name]||Error)(t.message);return e.stack=t.stack,e}},{type:"[[ArrayBuffer]]",shouldTransform:function(t,e){return a&&e instanceof ArrayBuffer},toSerializable:function(t){var e=new Int8Array(t);return d.call(e)},fromSerializable:function(t){if(a){var e=new ArrayBuffer(t.length);return new Int8Array(e).set(t),e}return t}},{type:"[[Buffer]]",shouldTransform:function(t,e){return c&&e instanceof Buffer},toSerializable:function(t){return d.call(t)},fromSerializable:function(t){return c?Buffer.from(t):t}},{type:"[[TypedArray]]",shouldTransform:function(t,e){return Object.keys(s).some(function(t){return n(t)&&e instanceof s[t]})},toSerializable:function(t){return{ctorName:t.constructor.name,arr:d.call(t)}},fromSerializable:function(t){return n(t.ctorName)?new s[t.ctorName](t.arr):t.arr}},{type:"[[Map]]",shouldTransform:function(t,e){return l&&e instanceof Map},toSerializable:function(t){var n=[];return t.forEach(function(t,e){n.push(e),n.push(t)}),n},fromSerializable:function(t){if(l){for(var e=new Map,n=0;n<t.length;n+=2)e.set(t[n],t[n+1]);return e}for(var r=[],i=0;i<t.length;i+=2)r.push([t[n],t[n+1]]);return r}},{type:"[[Set]]",shouldTransform:function(t,e){return u&&e instanceof Set},toSerializable:function(t){var e=[];return t.forEach(function(t){e.push(t)}),e},fromSerializable:function(t){if(u){for(var e=new Set,n=0;n<t.length;n++)e.add(t[n]);return e}return t}}],f=t.exports=function(t){this.transforms=[],this.transformsMap=Object.create(null),this.serializer=t||e,this.addTransforms(p)};f.prototype.addTransforms=function(t){t=Array.isArray(t)?t:[t];for(var e=0;e<t.length;e++){var n=t[e];if(this.transformsMap[n.type])throw new Error('Transform with type "'+n.type+'" was already added.');this.transforms.push(n),this.transformsMap[n.type]=n}return this},f.prototype.removeTransforms=function(t){t=Array.isArray(t)?t:[t];for(var e=0;e<t.length;e++){var n=t[e],r=this.transforms.indexOf(n);-1<r&&this.transforms.splice(r,1),delete this.transformsMap[n.type]}return this},f.prototype.encode=function(t){var e=new r(t,this.transforms).transform();return this.serializer.serialize(e)},f.prototype.decode=function(t){var e=this.serializer.deserialize(t);return new h(e,this.transformsMap).transform()}}(Yr={exports:{}}),Yr.exports),$r=function(t){return t};function Qr(t){return new Kr({serialize:$r,deserialize:$r}).addTransforms(t)}var Zr=1,ti=2,ei=3,ni=((Jr={})[Zr]=/^\.filterVisible\(\)$/,Jr[ti]=/^\.filterHidden\(\)$/,Jr[ei]=/^\.nth\(\d+\)$/,Jr);function ri(){this._err=null}var ii=(Object.defineProperty(ri.prototype,"error",{get:function(){return this._err},set:function(t){null===this._err&&(this._err=t)},enumerable:!1,configurable:!0}),ri.prototype.filter=function(t,e,n){if(e.filterVisible&&(t=t.filter(_.positionUtils.isElementVisible),this._assertFilterError(t,n,Zr)),e.filterHidden&&(t=t.filter(function(t){return!_.positionUtils.isElementVisible(t)}),this._assertFilterError(t,n,ti)),e.counterMode)return null===e.index?t.length:ri._getNodeByIndex(t,e.index)?1:0;var r;if(e.collectionMode)return null!==e.index&&(t=(r=ri._getNodeByIndex(t,e.index))?[r]:[],this._assertFilterError(t,n,ei)),t;var i=ri._getNodeByIndex(t,e.index||0);return i||(this.error=ri._getErrorItem(n,ei)),i},ri.prototype.cast=function(t){if(null==t)return[];if(t instanceof c.nativeMethods.Node)return[t];if(function(t){if(c.nativeMethods.isArray(t)){for(var e=0;e<t.length;e++)if(!(t[e]instanceof c.nativeMethods.Node))return;return 1}}(t))return t;if((e=t)instanceof c.nativeMethods.HTMLCollection||e instanceof c.nativeMethods.NodeList)return function(t){for(var e=t.length,n=[],r=0;r<e;r++)n.push(t[r]);return n}(t);var e;throw new Lt},ri.prototype._assertFilterError=function(t,e,n){0===t.length&&(this.error=ri._getErrorItem(e,n))},ri._getErrorItem=function(t,e){var n=t.apiFnChain,r=t.apiFnID;if(e)for(var i=r;i<n.length;i++)if(ni[e].test(n[i]))return i;return null},ri._getNodeByIndex=function(t,e){return e<0?t[t.length+e]:t[e]},new ri);function oi(t,e){return new c.nativeMethods.Function("fnCode","__dependencies$","Promise","RegExp",'"use strict"; return eval(fnCode)')(t,e,c.Promise,RegExp)}var si=(ai.prototype.shouldTransform=function(t){return"function"===t},ai.prototype.toSerializable=function(){return""},ai.prototype.fromSerializable=function(t){var e=t.fnCode,n=t.dependencies;return"filterOptions"in n&&(n.selectorFilter=ii),oi(e,n)},ai);function ai(){this.type="Function"}var li=(ui.prototype.shouldTransform=function(t,e){if(e instanceof c.nativeMethods.Node)throw new Pt(this._instantiationCallsiteName);return!1},ui.prototype.toSerializable=function(){},ui.prototype.fromSerializable=function(){},ui);function ui(t){this.type="Node",this._instantiationCallsiteName=t}var ci=(di.prototype.getResult=function(){var e=this;return c.Promise.resolve().then(function(){var t=e.replicator.decode(e.command.args);return e._executeFn(t)}).catch(function(t){throw t.isTestCafeError||(t=new Xt(e.command.instantiationCallsiteName,t)),t})},di.prototype.encodeResult=function(t){return this.replicator.encode(t)},di.prototype._createReplicator=function(){return Qr([new li(this.command.instantiationCallsiteName),new si])},di.prototype._executeFn=function(t){return this.fn.apply(Ic,t)},di);function di(t){this.command=t,this.replicator=this._createReplicator(),this.dependencies=this.replicator.decode(t.dependencies),this.fn=oi(t.fnCode,this.dependencies)}var hi="appeared-dialog",pi="unexpected-dialog",fi="handler-error",mi=l.eventSandbox.message,gi=l.processScript,vi=l.nativeMethods,wi="testcafe|native-dialog-tracker|appeared-dialogs",yi="testcafe|native-dialog-tracker|unexpected-dialog",_i="testcafe|native-dialog-tracker|error-in-handler",Ei=gi("window.location.href"),Ci=(Object.defineProperty(Ii.prototype,"appearedDialogs",{get:function(){var t=this.contextStorage.getItem(wi);return t||(t=[],this.appearedDialogs=t),t},set:function(t){this.contextStorage.setItem(wi,t)},enumerable:!1,configurable:!0}),Object.defineProperty(Ii.prototype,"unexpectedDialog",{get:function(){return this.contextStorage.getItem(yi)},set:function(t){this.contextStorage.setItem(yi,t)},enumerable:!1,configurable:!0}),Object.defineProperty(Ii.prototype,"handlerError",{get:function(){return this.contextStorage.getItem(_i)},set:function(t){this.contextStorage.setItem(_i,t)},enumerable:!1,configurable:!0}),Ii._getPageUrl=function(){return vi.eval(Ei)},Ii.prototype._initListening=function(){var n=this;mi.on(mi.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message;e.type===hi?n._addAppearedDialogs(e.dialogType,e.text,e.url):e.type!==pi||n.unexpectedDialog?e.type!==fi||n.handlerError||n._onHandlerError(e.dialogType,e.message,e.url):n.unexpectedDialog={type:e.dialogType,url:e.url}})},Ii.prototype._init=function(){var e=this;l.on(l.EVENTS.beforeUnload,function(t){t.prevented&&!t.isFakeIEEvent&&(e.dialogHandler?e._createDialogHandler("beforeunload")(t.returnValue||""):e._defaultDialogHandler("beforeunload")),e.contextStorage&&e.contextStorage.save()}),Ic.alert=function(){return e._defaultDialogHandler("alert")},Ic.confirm=function(){return e._defaultDialogHandler("confirm")},Ic.prompt=function(){return e._defaultDialogHandler("prompt")}},Ii.prototype._createDialogHandler=function(i){var o=this;return function(t){var e=Ii._getPageUrl();o._addAppearedDialogs(i,t,e);var n=new ci(o.dialogHandler),r=null;try{r=n.fn.apply(Ic,[i,t,e])}catch(t){o._onHandlerError(i,t.message||String(t),e)}return r}},Ii.prototype._defaultDialogHandler=function(t){var e=Ii._getPageUrl();this.unexpectedDialog=this.unexpectedDialog||{type:t,url:e}},Ii.prototype._addAppearedDialogs=function(t,e,n){this.appearedDialogs.splice(0,0,{type:t,text:e,url:n})},Ii.prototype._onHandlerError=function(t,e,n){this.handlerError=this.handlerError||{type:t,message:e,url:n}},Ii.prototype.setHandler=function(t){var e=this;this.dialogHandler=t,["alert","confirm","prompt"].forEach(function(t){Ic[t]=e.dialogHandler?e._createDialogHandler(t):function(){return e._defaultDialogHandler(t)}})},Ii.prototype.getUnexpectedDialogError=function(){var t=this.unexpectedDialog,e=this.handlerError;return this.unexpectedDialog=null,this.handlerError=null,t?new kr(t.type,t.url):e?new Ur(e.type,e.message,e.url):null},Ii);function Ii(t,e){var n=(void 0===e?{}:e).dialogHandler;this.contextStorage=t,this.dialogHandler=n,this._init(),this._initListening(),this.dialogHandler&&this.setHandler(n)}function Si(){return c.nativeMethods.performanceNow().toString()}function bi(t){this.type=t,this.id=Si()}var Ti,Wi="driver|establish-connection",Ai="driver|switch-to-window",xi="driver|close-window",Ri="driver|close-window-validation",Ni="driver|switch-to-window-validation",Pi="driver|get-windows",Di="driver|command-executed",Mi="driver|execute-command",Fi="driver|confirmation",ki="driver|set-native-dialog-handler",Oi="driver|set-as-master",Li="driver|close-all-child-windows",Ui="driver|start-to-restore-child-link",Hi="driver|restore-child-link",Bi="driver|child-window-is-loaded-in-iframe",Gi="driver|child-window-is-opened-in-iframe",Vi="driver|stop-internal-from-iframe",qi="driver|has-pending-action-flags",zi=(t(ji,Ti=bi),ji);function ji(){return Ti.call(this,Wi)||this}var Xi,Yi=(t(Ji,Xi=bi),Ji);function Ji(t){var e=t.windowId,n=Xi.call(this,Ri)||this;return n.windowId=e,n}var Ki,$i=(t(Qi,Ki=bi),Qi);function Qi(t){var e=t.windowId,n=t.fn,r=Ki.call(this,Ni)||this;return r.windowId=e,r.fn=n,r}var Zi,to=(t(eo,Zi=bi),eo);function eo(){return Zi.call(this,Pi)||this}var no,ro=(t(io,no=bi),io);function io(t){var e=t.windowId,n=t.isCurrentWindow,r=no.call(this,xi)||this;return r.windowId=e,r.isCurrentWindow=n,r}var oo,so=(t(ao,oo=bi),ao);function ao(t){var e=t.windowId,n=t.fn,r=oo.call(this,Ai)||this;return r.windowId=e,r.fn=n,r}var lo,uo=(t(co,lo=bi),co);function co(t){var e=lo.call(this,Di)||this;return e.driverStatus=t,e}var ho,po=(t(fo,ho=bi),fo);function fo(t,e,n){var r=ho.call(this,Mi)||this;return r.command=t,r.testSpeed=e,r.leftTopPoint=n,r}var mo,go=(t(vo,mo=bi),vo);function vo(t,e){var n=mo.call(this,Fi)||this;return n.requestMessageId=t,n.result=e,n}var wo,yo=(t(_o,wo=bi),_o);function _o(t){var e=wo.call(this,ki)||this;return e.dialogHandler=t,e}var Eo,Co=(t(Io,Eo=bi),Io);function Io(t){var e=Eo.call(this,Oi)||this;return e.finalizePendingCommand=t,e}var So,bo=(t(To,So=bi),To);function To(){return So.call(this,Li)||this}var Wo,Ao=(t(xo,Wo=bi),xo);function xo(){return Wo.call(this,Ui)||this}var Ro,No=(t(Po,Ro=bi),Po);function Po(t){var e=Ro.call(this,Hi)||this;return e.windowId=t,e}var Do,Mo=(t(Fo,Do=bi),Fo);function Fo(t){var e=Do.call(this,Bi)||this;return e.windowId=t,e}var ko,Oo=(t(Lo,ko=bi),Lo);function Lo(){return ko.call(this,Gi)||this}var Uo,Ho=(t(Bo,Uo=bi),Bo);function Bo(){return Uo.call(this,Vi)||this}var Go,Vo=(t(qo,Go=bi),qo);function qo(){return Go.call(this,qi)||this}var zo=l.json,jo=l.nativeMethods,Xo="%proxylessContextStorage%",Yo=(Jo.prototype.loadFromStorage=function(){var t={},e=this._getData();return e&&(t=zo.parse(e),this._deleteData()),t},Jo.prototype._getData=function(){throw new Error("Not implemented")},Jo.prototype._deleteData=function(){throw new Error("Not implemented")},Jo.prototype.save=function(){throw new Error("Not implemented")},Jo.prototype.sync=function(){},Jo.prototype.dispose=function(){this._deleteData()},Jo);function Jo(){}var Ko,$o=(t(Qo,Ko=Yo),Qo.prototype._createStorageKey=function(t,e){var n="testcafe|driver|"+t;return e?n+"|"+e:n},Qo.prototype._getData=function(){return jo.storageGetItem.call(this.storage,this.storageKey)},Qo.prototype._deleteData=function(){jo.storageRemoveItem.call(this.storage,this.storageKey)},Qo.prototype.save=function(t){jo.storageSetItem.call(this.storage,this.storageKey,zo.stringify(t))},Qo);function Qo(t,e,n){var r=Ko.call(this)||this;return r.storage=jo.winSessionStorageGetter.call(t),r.storageKey=r._createStorageKey(e,n),r}var Zo,ts=(t(es,Zo=Yo),es.prototype._getData=function(){var t;return null===(t=Ic[Xo])||void 0===t?void 0:t[this.frameId]},es.prototype._deleteData=function(){Ic[Xo]=null},es.prototype.save=function(t){Ic.PROXYLESS_STORAGE_BINDING&&Ic.PROXYLESS_STORAGE_BINDING(zo.stringify({testRunId:this.testRunId,frameDriverId:this.frameId,data:zo.stringify(t)}))},es);function es(t,e){var n=Zo.call(this)||this,r=e.split("-"),i=r[0],o=r[1];return n.testRunId=i,n.frameId=o||"main",n}var ns=(rs.prototype._createStorageStrategy=function(t,e,n,r){return new(t?ts:$o)(e,n,r)},rs.prototype.save=function(){this.strategy.save(this.data)},rs.prototype.setItem=function(t,e){this.data[t]=e,this.save(this.data)},rs.prototype.getItem=function(t){return this.data[t]},rs.prototype.dispose=function(){this.strategy.dispose()},rs);function rs(t,e){var n=e.testRunId,r=e.windowId,i=e.proxyless;this.strategy=this._createStorageStrategy(i,t,n,r),this.data=this.strategy.loadFromStorage(),this.testRunId=n}var is=Object.prototype.toString,os=String.prototype.indexOf,ss=String.prototype.endsWith||function(t,e){var n=is.call(this);(void 0===e||e>n.length)&&(e=n.length),e-=t.length;var r=os.call(n,t,e);return-1!==r&&r===e},as=Array.prototype.indexOf,ls=Array.prototype.map,us=Array.prototype.sort,cs=Array.prototype.filter,ds=Array.prototype.concat,hs="Command",ps=(fs.prototype.getAssignableProperties=function(){return[]},fs.prototype.getAllAssignableProperties=function(){for(var t=Object.getPrototypeOf(this),e=[];t&&t.getAssignableProperties;)e=ds.call(e,t.getAssignableProperties()),t=Object.getPrototypeOf(t);return e},fs.prototype.getNonReportedProperties=function(){return[]},fs.prototype.getReportedProperties=function(){var t=ls.call(this.getAllAssignableProperties(),function(t){return t.name}),e=this.getNonReportedProperties();return cs.call(t,function(t){return!(-1<as.call(e,t))})},fs.prototype._assignFrom=function(t,e,n){if(void 0===n&&(n={}),t){e&&function(t,e){var n,r=e.constructor.name,i=ls.call(e.getAllAssignableProperties(),function(t){return t.name}),o=us.call(e.getReportedProperties());for(n in t)if(!(-1<as.call(i,n)||n in e))throw new Be(r,n,o)}(t,this);for(var r,i,o=this.getAllAssignableProperties(),s=0;s<o.length;s++){var a=o[s],l=a.name,u=a.type,c=a.required,d=a.init,h=a.defaultValue;void 0!==h&&(this[l]=h);var p=t[l];void 0===p&&!c||(e&&u&&u((r=this.constructor.name,i=l,ss.call(r,hs)?i:"".concat(r,".").concat(i)),p),this[l]=d?d(l,p,n,e):p)}}},fs);function fs(){}var ms,gs=(t(vs,ms=ps),vs.prototype.getAssignableProperties=function(){return[{name:"isCommandResult"},{name:"executionError"},{name:"pageError"},{name:"result"},{name:"consoleMessages"},{name:"isPendingWindowSwitching"},{name:"isObservingFileDownloadingInNewWindow"},{name:"isFirstRequestAfterWindowSwitching"},{name:"warnings"}]},vs);function vs(t){var e=ms.call(this,t)||this;return e.id=Si(),e.isCommandResult=!1,e.executionError=null,e.pageError=null,e.resent=!1,e.result=null,e.consoleMessages=null,e.isPendingWindowSwitching=!1,e.isObservingFileDownloadingInNewWindow=!1,e.isFirstRequestAfterWindowSwitching=!1,e.debug="",e.warnings=null,e._assignFrom(t,!0),e}function ws(n,t,e,r){var i=null,o=null,s=null;return e=Math.max(e||0,2500),c.Promise.race([_.delay(e),new c.Promise(function(e){s=function(t){t.message.type===Fi&&t.message.requestMessageId===n.id&&e(t.message)},c.eventSandbox.message.on(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,s),i=c.nativeMethods.setInterval.call(Ic,function(){return c.eventSandbox.message.sendServiceMsg(n,t)},1e3),c.eventSandbox.message.sendServiceMsg(n,t)})]).then(function(t){if(c.nativeMethods.clearInterval.call(Ic,i),c.nativeMethods.clearTimeout.call(Ic,o),c.eventSandbox.message.off(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,s),!t)throw new r;return t})}var ys=2e4;function _s(t){var e=t.requestMsgId,n=t.result,r=t.window,i=new go(e,n);c.eventSandbox.message.sendServiceMsg(i,r)}var Es=(Cs.create=function(t){return new Cs(t.top,t.right,t.bottom,t.left)},Cs.prototype.add=function(t){return this.top+=t.top,this.right+=t.right,this.bottom+=t.bottom,this.left+=t.left,this},Cs.prototype.sub=function(t){return"top"in t&&(this.top-=t.top,this.left-=t.left),this.bottom-=t.bottom,this.right-=t.right,this},Cs.prototype.round=function(t,e){return void 0===t&&(t=Math.round),void 0===e&&(e=t),this.top=t(this.top),this.right=e(this.right),this.bottom=e(this.bottom),this.left=t(this.left),this},Cs.prototype.contains=function(t){return t.x>=this.left&&t.x<=this.right&&t.y>=this.top&&t.y<=this.bottom},Cs);function Cs(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.top=t,this.right=e,this.bottom=n,this.left=r}function Is(t){var e="array"+t.charAt(0).toUpperCase()+t.slice(1),n=c.nativeMethods[e];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.call.apply(n,t)}}Is("filter"),Is("map"),Is("slice"),Is("splice"),Is("unshift"),Is("forEach"),Is("indexOf"),Is("some"),Is("reverse"),Is("reduce"),Is("concat"),Is("join"),l.utils.browser,l.nativeMethods,l.utils.style.get,l.utils.dom.getActiveElement,l.utils.dom.findDocument,l.utils.dom.find,l.utils.dom.isElementInDocument;var Ss=l.utils.dom.isElementInIframe,bs=l.utils.dom.getIframeByElement,Ts=(l.utils.dom.isCrossDomainWindows,l.utils.dom.getSelectParent,l.utils.dom.getChildVisibleIndex,l.utils.dom.getSelectVisibleChildren,l.utils.dom.isElementNode,l.utils.dom.isTextNode,l.utils.dom.isRenderedNode,l.utils.dom.isIframeElement,l.utils.dom.isInputElement,l.utils.dom.isButtonElement,l.utils.dom.isFileInput,l.utils.dom.isTextAreaElement,l.utils.dom.isAnchorElement,l.utils.dom.isImgElement,l.utils.dom.isFormElement,l.utils.dom.isLabelElement,l.utils.dom.isSelectElement,l.utils.dom.isRadioButtonElement,l.utils.dom.isColorInputElement,l.utils.dom.isCheckboxElement,l.utils.dom.isOptionElement,l.utils.dom.isSVGElement,l.utils.dom.isMapElement,l.utils.dom.isBodyElement,l.utils.dom.isHtmlElement),Ws=(l.utils.dom.isDocument,l.utils.dom.isWindow,l.utils.dom.isTextEditableInput,l.utils.dom.isTextEditableElement,l.utils.dom.isTextEditableElementAndEditingAllowed,l.utils.dom.isContentEditableElement,l.utils.dom.isDomElement,l.utils.dom.isShadowUIElement,l.utils.dom.isShadowRoot,l.utils.dom.isElementFocusable,l.utils.dom.isHammerheadAttr,l.utils.dom.isElementReadOnly,l.utils.dom.getScrollbarSize),As=(l.utils.dom.getMapContainer,l.utils.dom.getTagName,l.utils.dom.closest,l.utils.dom.getParents,l.utils.dom.findParent,l.utils.dom.getTopSameDomainWindow,l.utils.dom.getParentExceptShadowRoot,l.utils.style,l.utils.style.getBordersWidth),xs=(l.utils.style.getComputedStyle,l.utils.style.getElementMargin,l.utils.style.getElementPadding,l.utils.style.getElementScroll),Rs=(l.utils.style.getOptionHeight,l.utils.style.getSelectElementSize,l.utils.style.isElementVisible,l.utils.style.isVisibleChild,l.utils.style.getWidth,l.utils.style.getHeight,l.utils.style.getInnerWidth),Ns=l.utils.style.getInnerHeight,Ps=(l.utils.style.getScrollLeft,l.utils.style.getScrollTop,l.utils.style.setScrollLeft,l.utils.style.setScrollTop,l.utils.style.get,l.utils.style.getBordersWidthFloat),Ds=l.utils.style.getElementPaddingFloat,Ms=(Object.defineProperty(Fs.prototype,"availabilityTimeout",{set:function(t){this.iframeAvailabilityTimeout=t},enumerable:!1,configurable:!0}),Fs.prototype._ensureIframe=function(){var t=this;return _.domUtils.isElementInDocument(this.driverIframe)?_.waitFor(function(){return _.positionUtils.isIframeVisible(t.driverIframe)?t.driverIframe:null},200,this.iframeAvailabilityTimeout).catch(function(){throw new Dr}):c.Promise.reject(new Rr)},Fs.prototype._waitForIframeRemovedOrHidden=function(){var e=this;return new c.Promise(function(t){e.checkIframeInterval=c.nativeMethods.setInterval.call(Ic,function(){e._ensureIframe().catch(function(){return _.delay(500).then(function(){return t(new gs({isCommandResult:!0}))})})},1e3)})},Fs.prototype._waitForCommandResult=function(){var e=this,n=null;return c.Promise.race([this._waitForIframeRemovedOrHidden(),new c.Promise(function(e){n=function(t){t.message.type===Di&&e(t.message.driverStatus)},c.eventSandbox.message.on(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,n)})]).then(function(t){return c.eventSandbox.message.off(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,n),c.nativeMethods.clearInterval.call(Ic,e.checkIframeInterval),t})},Fs.prototype._getLeftTopPoint=function(t){if(!t)return null;var e=this.driverIframe.getBoundingClientRect(),n=Ps(this.driverIframe),r=Ds(this.driverIframe);return{x:e.left+n.left+r.left,y:e.top+n.top+r.top}},Fs.prototype.sendConfirmationMessage=function(t){_s({requestMsgId:t,result:{id:this.driverId,dispatchProxylessEventUrl:this.dispatchProxylessEventUrl},window:this.driverWindow})},Fs.prototype.executeCommand=function(n,r,i,o){var s=this;return this._ensureIframe().then(function(){var t=s._getLeftTopPoint(i);o&&(t.x+=o.x,t.y+=o.y);var e=new po(n,r,t);return c.Promise.all([ws(e,s.driverWindow,s.iframeAvailabilityTimeout,zn),s._waitForCommandResult()])}).then(function(t){return t[1]})},Fs);function Fs(t,e,n){this.driverWindow=t,this.driverIframe=_.domUtils.findIframeByWindow(t),this.driverId=e,this.iframeAvailabilityTimeout=0,this.dispatchProxylessEventUrl=n}var ks=["nodeType","textContent","childNodeCount","hasChildNodes","childElementCount","hasChildElements"],Os=["tagName","attributes"],Ls=["tagName","visible","focused","attributes","boundingClientRect","classNames","style","innerText","namespaceURI","id","value","checked","selected","selectedIndex","scrollWidth","scrollHeight","scrollLeft","scrollTop","offsetWidth","offsetHeight","offsetLeft","offsetTop","clientWidth","clientHeight","clientLeft","clientTop"],Us={childNodeCount:function(t){return t.childNodes.length},hasChildNodes:function(t){return!!Us.childNodeCount(t)},childElementCount:function(t){var e=t.children;if(e)return e.length;for(var n=0,r=t.childNodes.length,i=0;i<r;i++)1===t.childNodes[i].nodeType&&n++;return n},hasChildElements:function(t){return!!Us.childElementCount(t)}},Hs=(Bs.prototype._initializeProperties=function(t,e,n){for(var r=0,i=e;r<i.length;r++){var o=i[r],s=n[o];this[o]=s?s(t):t[o]}},Bs);function Bs(){}var Gs,Vs=(t(qs,Gs=Hs),qs);function qs(t){var e=Gs.call(this)||this;return e._initializeProperties(t,ks,Us),e}var zs,js={tagName:function(t){return t.tagName.toLowerCase()},visible:function(t){return _.positionUtils.isElementVisible(t)},focused:function(t){return c.utils.dom.getActiveElement()===t},attributes:function(t){for(var e=t.attributes,n={},r=e.length-1;0<=r;r--)n[e[r].name]=e[r].value;return n},boundingClientRect:function(t){var e=t.getBoundingClientRect();return{left:e.left,right:e.right,top:e.top,bottom:e.bottom,width:e.width,height:e.height}},classNames:function(t){var e=t.className;return"string"==typeof e.animVal&&(e=e.animVal),e.replace(/^\s+|\s+$/g,"").split(/\s+/g)},style:function(t){for(var e={},n=Ic.getComputedStyle(t),r=0;r<n.length;r++){var i=n[r];e[i]=n[i]}return e},innerText:function(t){return t.innerText}},Xs=(t(Ys,zs=Hs),Ys);function Ys(t){var e=zs.call(this)||this;return e._initializeProperties(t,Os,js),e}var Js,Ks=(t($s,Js=Vs),$s);function $s(t){var e=Js.call(this,t)||this;return e._initializeProperties(t,Ls,js),e}var Qs=(Zs.prototype._extend=function(t,e){for(var n=0,r=c.nativeMethods.objectKeys(this._customDOMProperties);n<r.length;n++){var i=r[n];try{t[i]=this._customDOMProperties[i](e)}catch(t){throw new Kt(this._instantiationCallsiteName,t,i)}}},Zs.prototype.shouldTransform=function(t,e){return e instanceof c.nativeMethods.Node},Zs.prototype.toSerializable=function(t){var e=new(1===t.nodeType?Ks:Vs)(t);return this._extend(e,t),e},Zs.prototype.fromSerializable=function(){},Zs);function Zs(t,e){void 0===t&&(t={}),this.type="Node",this._customDOMProperties=t,this._instantiationCallsiteName=e}var ta=(ea.prototype.on=function(t,e){this._eventsListeners[t]||(this._eventsListeners[t]=[]),this._eventsListeners[t].push(e)},ea.prototype.once=function(n,r){var i=this;this.on(n,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i.off(n,r),r.apply(void 0,t)})},ea.prototype.off=function(t,e){var n=this._eventsListeners[t];n&&(this._eventsListeners[t]=c.nativeMethods.arrayFilter.call(n,function(t){return t!==e}))},ea.prototype.offAll=function(t){t?this._eventsListeners[t]=[]:this._eventsListeners={}},ea.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._eventsListeners[e];if(r)for(var i=0;i<r.length;i++)try{r[i].apply(this,t)}catch(t){if(!(t.message&&-1<t.message.indexOf("freed script")))throw t;this.off(e,r[i])}},ea);function ea(){this._eventsListeners={}}var na=l.Promise,ra=l.nativeMethods;function ia(e){return new na(function(t){return ra.setTimeout.call(Ic,t,e)})}var oa={1:"element",2:"attribute",3:"text",4:"cdata section",5:"entity reference",6:"entity node",7:"processing instruction",8:"comment",9:"document",10:"document type",11:"document fragment",12:"notation"};function sa(t){return t?{name:"ActionAdditionalElementIsInvisibleError",firstArg:t}:"ActionElementIsInvisibleError"}function aa(t){return t?{name:"ActionAdditionalElementNotFoundError",firstArg:t}:"ActionElementNotFoundError"}function la(t){var e="string"==typeof t?Br[t]:Br[t.name],n="string"==typeof t?null:t.firstArg;return function(t){return new e(n,t)}}var ua=(ca.prototype.push=function(t,r){var i=this;this._ensureElementsPromise=this._ensureElementsPromise.then(function(){return i._executeSelectorFn(t,{invisible:sa(r),notFound:aa(r)},i._ensureElementsStartTime)}).then(function(t){if(!_.domUtils.isDomElement(t)){var e=t.nodeType,n=oa[e];throw r?new un(r,n):new Ke(n)}i._elements.push(t)})},ca.prototype.getElements=function(){var t=this;return this._ensureElementsPromise.then(function(){return t._elements})},ca);function ca(t,e){this._globalSelectorTimeout=t,this._ensureElementsStartTime=c.nativeMethods.dateNow(),this._ensureElementsPromise=c.Promise.resolve(),this._executeSelectorFn=e,this._elements=[]}l.shadowUI,l.nativeMethods;var da=(ha.create=function(t){return"left"in t?new ha(t.left,t.top):"right"in t?new ha(t.right,t.bottom):new ha(t.x,t.y)},ha.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},ha.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},ha.prototype.round=function(t){return void 0===t&&(t=Math.round),this.x=t(this.x),this.y=t(this.y),this},ha.prototype.eql=function(t){return this.x===t.x&&this.y===t.y},ha.prototype.mul=function(t){return this.x*=t,this.y*=t,this},ha.prototype.distance=function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))},ha);function ha(t,e){this.x=t,this.y=e}var pa=function(t,e,n,r,i,o){this.width=t,this.height=e,this.left=n.x,this.top=n.y,this.right=n.x+t,this.bottom=n.y+e,this.border=r,this.scrollbar=o,this.scroll=i},fa=(l.utils.html,l.nativeMethods,l.utils.position.getElementRectangle),ma=l.utils.position.getOffsetPosition,ga=l.utils.position.offsetToClientCoords;function va(t){var e=t/2;return e<1?0:Math.round(e)}function wa(t,e,n){var r,i={offsetX:va((r=fa(t)).width),offsetY:va(r.height)};if(e="number"==typeof e?Math.round(e):i.offsetX,n="number"==typeof n?Math.round(n):i.offsetY,0<e&&0<n)return{offsetX:e,offsetY:n};var o=function(t){var e,n,r,i,o=Ts(t),s=o?t.getElementsByTagName("body")[0]:null,a=t.getBoundingClientRect(),l=Es.create(As(t)),u=xs(t),c=Ss(t),d="BackCompat"===t.ownerDocument.compatMode,h=o?new da(0,0):da.create(a),p=a.height,f=a.width;o&&(f=s&&d?(p=s.clientHeight,s.clientWidth):(p=t.clientHeight,t.clientWidth)),!c||(e=bs(t))&&(n=ma(e),r=ga(da.create(n)),i=As(e),h.add(r).add(da.create(i)),o&&l.add(i));var m=!o&&Rs(t)!==t.clientWidth,g=!o&&Ns(t)!==t.clientHeight,v={right:m?Ws():0,bottom:g?Ws():0};return new pa(f,p,h,l,u,v)}(t),s=Math.round(Math.max(t.scrollWidth,o.width)),a=Math.round(Math.max(t.scrollHeight,o.height)),l=o.scrollbar.right+o.border.left+o.border.right+s,u=o.scrollbar.bottom+o.border.top+o.border.bottom+a;return{offsetX:e<0?l+e:e,offsetY:n<0?u+n:n}}var ya,_a=(t(Ea,ya=ta),Ea.prototype._prepareCommand=function(t,e){t.options&&!t.options.speed&&(t.options.speed=e.testSpeed)},Ea.prototype._getCommandSelectorTimeout=function(t,e){var n;return"number"==typeof(null===(n=t.selector)||void 0===n?void 0:n.timeout)?t.selector.timeout:e.globalSelectorTimeout},Ea.prototype._delayAfterExecution=function(){return this._command.options&&1!==this._command.options.speed?ia(2e3*(1-this._command.options.speed)):c.Promise.resolve()},Ea.prototype._isExecutionTimeoutExpired=function(){return c.nativeMethods.dateNow()-this._executionStartTime>=this._commandSelectorTimeout},Ea.prototype._ensureCommandArguments=function(){var t=Ea.ACTIONS_HANDLERS[this._command.type];null!=t&&t.ensureCmdArgs&&t.ensureCmdArgs(this._command)},Ea.prototype._ensureCommandElements=function(){var t,e=this,n=new ua(this._options.globalSelectorTimeout,this._options.executeSelectorFn);this._command.selector&&n.push(this._command.selector);var r=null===(t=Ea.ACTIONS_HANDLERS[this._command.type])||void 0===t?void 0:t.additionalSelectorProps;if(r)for(var i=0,o=r;i<o.length;i++){var s=o[i];this._command[s]&&n.push(this._command[s],s)}return n.getElements().then(function(t){e._elements=t})},Ea.prototype._ensureCommandElementsProperties=function(){var t=Ea.ACTIONS_HANDLERS[this._command.type];null!=t&&t.ensureElsProps&&t.ensureElsProps(this._elements)},Ea.prototype._ensureCommandOptions=function(){return s(this,void 0,c.Promise,function(){var e,n,r,i;return C(this,function(t){return e=this._command.options,this._elements.length&&e&&"offsetX"in e&&"offsetY"in e&&(n=wa(this._elements[0],e.offsetX,e.offsetY),r=n.offsetX,i=n.offsetY,e.isDefaultOffset=!e.offsetX&&!e.offsetY,e.offsetX=r,e.offsetY=i),[2]})})},Ea.prototype._createAutomation=function(){var t=Ea.ACTIONS_HANDLERS[this._command.type];if(!t)throw new Error('There is no handler for the "'.concat(this._command.type,'" command.'));return t.create(this._command,this._elements,this._options.dispatchProxylessEventFn,this._options.leftTopPoint)},Ea.prototype._runAction=function(e){var n=this;return this._ensureCommandElements().then(function(){return n._ensureCommandElementsProperties()}).then(function(){return n._ensureCommandOptions()}).then(function(){var t=n._createAutomation();return t.WARNING_EVENT&&t.on(t.WARNING_EVENT,function(t){n.emit(Ea.WARNING_EVENT,t)}),t.TARGET_ELEMENT_FOUND_EVENT?t.on(t.TARGET_ELEMENT_FOUND_EVENT,function(t){n._targetElement=t.element,n.emit(Ea.EXECUTION_STARTED_EVENT)}):n.emit(Ea.EXECUTION_STARTED_EVENT),t.run(e)})},Ea.prototype._runRecursively=function(){var e=this,t=!1,n=!0;return function(e,n){return s(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return e()?[4,n()]:[3,2];case 1:return t.sent(),[3,0];case 2:return[2]}})})}(function(){return!t},function(){return e._runAction(n).then(function(){t=!0}).catch(function(t){if(!e._isExecutionTimeoutExpired())return ia(250);if(t.code===bt)return n=!1,c.Promise.resolve();throw t})})},Ea.prototype.execute=function(t){var e=this;this._executionStartTime=c.nativeMethods.dateNow();try{this._ensureCommandArguments()}catch(t){return c.Promise.reject(t)}return this.emit(Ea.WAITING_FOR_ELEMENT_EVENT,this._commandSelectorTimeout),this._runRecursively().then(function(){return c.Promise.all([e._delayAfterExecution(),t.wait()])}).then(function(){var t=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||((r=r||Array.prototype.slice.call(e,0,i))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}([],e._elements,!0);return e._targetElement&&(t[0]=e._targetElement),t})},Ea.EXECUTION_STARTED_EVENT="execution-started",Ea.WAITING_FOR_ELEMENT_EVENT="waiting-for-elements",Ea.WARNING_EVENT="warning",Ea.ACTIONS_HANDLERS={},Ea);function Ea(t,e){var n=ya.call(this)||this;return n._command=t,n._targetElement=null,n._elements=[],n._options=e,n._executionStartTime=0,n._prepareCommand(t,e),n._commandSelectorTimeout=n._getCommandSelectorTimeout(t,e),n}function Ca(t,e,n){return Math.min(Math.max(e,t),n)}function Ia(t,e){var n="number"==typeof t.min,r="number"==typeof t.max,i="number"==typeof t.length;return i&&(t.length=Ca(t.length,0,e)),n&&t.min<0&&(t.min+=e),r&&t.max<0&&(t.max+=e),n||(t.min=r&&i?t.max-t.length:0),r||(t.max=i?t.min+t.length:e),t.min=Ca(t.min,0,e),t.max=Ca(t.max,0,e),t.length=t.max-t.min,t}function Sa(t,e,n){return Math.round(t+Ca(e-t,0,n)/2)}var ba,Ta=(t(Wa,ba=ci),Wa.prototype._createReplicator=function(){return Qr([new si])},Wa.prototype._getTimeoutErrorParams=function(t){return{apiFnIndex:ii.error,apiFnChain:this.command.apiFnChain,reason:_.positionUtils.getHiddenReason(t)}},Wa.prototype._getTimeoutError=function(t){return t?this.createIsInvisibleError:this.createNotFoundError},Wa.prototype._validateElement=function(s,a){var l=this;return c.Promise.resolve().then(function(){return ba.prototype._executeFn.call(l,s)}).then(function(t){var e=t,n=!!e,r=!l.command.visibilityCheck||e&&_.positionUtils.isElementVisible(e),i=c.nativeMethods.dateNow()-a>=l.timeout;if(n&&(r||c.utils.dom.isShadowRoot(e)))return e;if(!i)return _.delay(200).then(function(){return l._validateElement(s,a)});var o=l.getVisibleValueMode?null:l._getTimeoutError(n);if(o)throw o(l._getTimeoutErrorParams(e));return null})},Wa.prototype._executeFn=function(t){return this.counterMode?ba.prototype._executeFn.call(this,t):this._validateElement(t,c.nativeMethods.dateNow())},Wa);function Wa(t,e,n,r,i){var o,s=ba.call(this,t)||this;s.createNotFoundError=r,s.createIsInvisibleError=i,s.timeout="number"==typeof t.timeout?t.timeout:e,s.counterMode=s.dependencies.filterOptions.counterMode,s.getVisibleValueMode=s.dependencies.filterOptions.getVisibleValueMode,s.dependencies.selectorFilter=ii,n&&(o=c.nativeMethods.dateNow()-n,s.timeout=Math.max(s.timeout-o,0));var a=s.dependencies.customDOMProperties;return s.replicator.addTransforms([new Qs(a,t.instantiationCallsiteName)]),s}var Aa=c.nativeMethods.date,xa=(Ra.prototype._ensureElement=function(t){var e=this,n=t.selector,r=t.createNotFoundError,i=t.createIsInvisibleError,o=t.createHasWrongNodeTypeError;this.ensureElementsPromise=this.ensureElementsPromise.then(function(){return new Ta(n,e.globalSelectorTimeout,e.ensureElementsStartTime,r,i).getResult()}).then(function(t){if(!_.domUtils.isDomElement(t))throw o(oa[t.nodeType]);e.elements.push(t)})},Ra.prototype.getElements=function(){var t=this;return this.ensureElementsPromise.then(function(){return t.elements})},Ra);function Ra(t,e){var n=this;this.elements=[],this.globalSelectorTimeout=e,this.ensureElementsPromise=c.Promise.resolve(),this.ensureElementsStartTime=new Aa,t.forEach(function(t){return n._ensureElement(t)})}function Na(r){return function(t,e){var n=typeof e;if("number"!=n)throw new r(t,n);if(isNaN(e)||!isFinite(e)||e!==Math.floor(e))throw new r(t,e)}}var Pa,Da,Ma,Fa,ka,Oa,La,Ua,Ha,Ba,Ga,Va,qa,za=Na(oe),ja=(Da=Na(Pa=le),function(t,e){if(Da(t,e),e<0)throw new Pa(t,e)}),Xa=(Ma=de,function(t,e){var n=typeof e;if("boolean"!=n)throw new Ma(t,n)}),Ya=(Fa=fe,function(t,e){var n=typeof e;if("number"!=n)throw new Fa(t,n);if(isNaN(e)||e<.01||1<e)throw new Fa(t,e)}),Ja=(ka=ve,function(t,e){var n=typeof e;if("string"!=n)throw new ka(t,n)}),Ka=(Oa=_e,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof RegExp))throw new Oa(t,n)}),$a=(La=Ie,function(t,e){if(!(e instanceof Date))throw new La(t,e)}),Qa=(Ua=Te,function(t,e){if(isNaN(Number(e)))throw new Ua(t,typeof e)}),Za=(Ha=xe,function(t,e){var n=typeof e;if("string"!=n&&!(e instanceof URL))throw new Ha(t,n)}),tl=(Ba=Pe,function(t,e){var n=typeof e;if("object"!=n&&!(e instanceof URLSearchParams))throw new Ba(t,n)}),el=(Ga=Fe,function(t,e){var n=typeof e;if("object"!=n)throw new Ga(t,n)}),nl=(Va=Le,function(t,e){var n=typeof e;if("function"!=n)throw new Va(t,n)}),rl=(t(il,qa=ps),il.prototype.getAssignableProperties=function(){return[{name:"speed",type:Ya}]},il);function il(t,e){var n=qa.call(this)||this;return n.speed=null,n._assignFrom(t,e),n}var ol,sl=(t(al,ol=rl),al.prototype.getAssignableProperties=function(){return[{name:"offsetX",type:za},{name:"offsetY",type:za},{name:"isDefaultOffset",type:Xa}]},al);function al(t,e){var n=ol.call(this)||this;return n.offsetX=null,n.offsetY=null,n._assignFrom(t,e),n}var ll,ul=(t(cl,ll=sl),cl.prototype.getAssignableProperties=function(){return[{name:"scrollToCenter",type:Xa},{name:"skipParentFrames",type:Xa}]},cl);function cl(t,e){var n=ll.call(this)||this;return n.scrollToCenter=!1,n.skipParentFrames=!1,n._assignFrom(t,e),n}var dl,hl=(t(pl,dl=ps),pl.prototype.getAssignableProperties=function(){return[{name:"left",type:za,defaultValue:null},{name:"right",type:za,defaultValue:null},{name:"top",type:za,defaultValue:null},{name:"bottom",type:za,defaultValue:null}]},pl);function pl(t,e){var n=dl.call(this)||this;return n._assignFrom(t,e),n}var fl,ml=(t(gl,fl=rl),gl.prototype.getAssignableProperties=function(){return[{name:"scrollTargetX",type:za},{name:"scrollTargetY",type:za},{name:"crop",type:el,init:nu},{name:"includeMargins",type:Xa},{name:"includeBorders",type:Xa},{name:"includePaddings",type:Xa}]},gl);function gl(t,e){var n=fl.call(this)||this;return n.scrollTargetX=null,n.scrollTargetY=null,n.includeMargins=!1,n.includeBorders=!0,n.includePaddings=!0,n.crop={left:null,right:null,top:null,bottom:null},n._assignFrom(t,e),n}var vl,wl=(t(yl,vl=ps),yl.prototype.getAssignableProperties=function(){return[{name:"ctrl",type:Xa,defaultValue:!1},{name:"alt",type:Xa,defaultValue:!1},{name:"shift",type:Xa,defaultValue:!1},{name:"meta",type:Xa,defaultValue:!1}]},yl);function yl(t,e){var n=vl.call(this)||this;return n._assignFrom(t,e),n}var _l,El=(t(Cl,_l=sl),Cl.prototype.getAssignableProperties=function(){return[{name:"modifiers",type:el,init:ru}]},Cl);function Cl(t,e){var n=_l.call(this)||this;return n.modifiers={ctrl:!1,alt:!1,shift:!1,meta:!1},n._assignFrom(t,e),n}var Il,Sl,bl,Tl,Wl,Al,xl,Rl,Nl=(t(Pl,Il=El),Pl.prototype.getAssignableProperties=function(){return[{name:"caretPos",type:ja}]},Pl);function Pl(t,e){var n=Il.call(this)||this;return n.caretPos=null,n._assignFrom(t,e),n}function Dl(t,e){var n=Sl.call(this)||this;return n.speed=null,n.minMovingTime=null,n.holdLeftButton=!1,n.skipScrolling=!1,n.skipDefaultDragBehavior=!1,n._assignFrom(t,e),n}function Ml(t,e){var n=bl.call(this)||this;return n.replace=!1,n.paste=!1,n.confidential=void 0,n._assignFrom(t,e),n}function Fl(t,e){var n=Tl.call(this,t,e)||this;return n.destinationOffsetX=null,n.destinationOffsetY=null,n._assignFrom(t,e),n}function kl(t,e){var n=Wl.call(this)||this;return n.portraitOrientation=!1,n._assignFrom(t,e),n}function Ol(t,e){var n=Al.call(this)||this;return n.timeout=void 0,n.allowUnawaitedPromise=!1,n._assignFrom(t,e),n}function Ll(t,e){var n=xl.call(this)||this;return n.confidential=void 0,n._assignFrom(t,e),n}function Ul(t,e){var n=Rl.call(this)||this;return n._assignFrom(t,e),n}t(Dl,Sl=El),Dl.prototype.getAssignableProperties=function(){return[{name:"speed"},{name:"minMovingTime"},{name:"holdLeftButton"},{name:"skipScrolling",type:Xa},{name:"skipDefaultDragBehavior",type:Xa}]},t(Ml,bl=Nl),Ml.prototype.getAssignableProperties=function(){return[{name:"replace",type:Xa},{name:"paste",type:Xa},{name:"confidential",type:Xa}]},t(Fl,Tl=El),Fl.prototype.getAssignableProperties=function(){return[{name:"destinationOffsetX",type:za},{name:"destinationOffsetY",type:za}]},t(kl,Wl=ps),kl.prototype.getAssignableProperties=function(){return[{name:"portraitOrientation",type:Xa}]},t(Ol,Al=ps),Ol.prototype.getAssignableProperties=function(){return[{name:"timeout",type:ja},{name:"allowUnawaitedPromise",type:Xa}]},t(Ll,xl=rl),Ll.prototype.getAssignableProperties=function(){return[{name:"confidential",type:Xa}]},t(Ul,Rl=ps),Ul.prototype.getAssignableProperties=function(){return[{name:"name",type:Ja},{name:"value",type:Ja},{name:"domain",type:Ja},{name:"path",type:Ja},{name:"expires",type:$a},{name:"maxAge",type:Qa},{name:"secure",type:Xa},{name:"httpOnly",type:Xa},{name:"sameSite",type:Ja}]};var Hl,Bl=(t(Gl,Hl=ps),Gl.prototype.getAssignableProperties=function(){return[{name:"username",type:Ja,required:!0},{name:"password",type:Ja}]},Gl);function Gl(t,e){var n=Hl.call(this)||this;return n._assignFrom(t,e),n}var Vl,ql,zl,jl,Xl,Yl=(t(Jl,Vl=ps),Jl.prototype.getAssignableProperties=function(){return[{name:"protocol",type:Ja},{name:"host",type:Ja,required:!0},{name:"port",type:Qa,required:!0},{name:"auth",type:el,init:tu}]},Jl);function Jl(t,e){var n=Vl.call(this)||this;return n._assignFrom(t,e),n}function Kl(t,e){var n=ql.call(this)||this;return n._assignFrom(t,e),n}function $l(t,e){var n=zl.call(this)||this;return n._assignFrom(t,e),n}function Ql(t,e){var n=jl.call(this)||this;return n._assignFrom(t,e),n}function Zl(t,e){var n=Xl.call(this)||this;return n._assignFrom(t,e),n}function tu(t,e,n,r){return void 0===r&&(r=!0),new Bl(e,r)}function eu(t,e,n,r){return void 0===r&&(r=!0),new Yl(e,r)}function nu(t,e,n,r){return void 0===r&&(r=!0),new hl(e,r)}function ru(t,e,n,r){return void 0===r&&(r=!0),new wl(e,r)}function iu(t){return t.top!==t}t(Kl,ql=ps),Kl.prototype.getAssignableProperties=function(){return[{name:"url",type:Za},{name:"method",type:Ja},{name:"headers",type:el},{name:"params",type:tl},{name:"body"},{name:"timeout",type:Qa},{name:"withCredentials",type:Xa},{name:"auth",type:el,init:tu},{name:"proxy",type:el,init:eu},{name:"rawResponse",type:Xa}]},t($l,zl=ps),$l.prototype.getAssignableProperties=function(){return[{name:"credentials",type:Qa}]},t(Ql,jl=ps),Ql.prototype.getAssignableProperties=function(){return[{name:"stack",type:Ka,required:!1},{name:"message",type:Ka,required:!1},{name:"pageUrl",type:Ka,required:!1}]},t(Zl,Xl=ps),Zl.prototype.getAssignableProperties=function(){return[{name:"fn",type:nl,required:!0},{name:"dependencies",type:el,required:!1}]};var ou=c.eventSandbox.message,su="driver|browser-manipulation|request",au="driver|browser-manipulation|response";ou.on(ou.SERVICE_MSG_RECEIVED_EVENT,function(e){var t,n,r,i,o;e.message.cmd===su&&(t=_.domUtils.findIframeByWindow(e.source),r=(n=e.message).command,(i=n.cropDimensions)&&(r.options=new ml({crop:i,includePaddings:!1})),(o=new lu(r)).element=t,o.execute().then(function(t){return ou.sendServiceMsg({cmd:au,result:t},e.source)}))});var lu=(uu.prototype._getAbsoluteCropValues=function(){var t=this.element.getBoundingClientRect(),e=t.top,n=t.left;n+=this.command.options.originOffset.x,e+=this.command.options.originOffset.y;var r=n+this.command.options.crop.right,i=e+this.command.options.crop.bottom;return{top:e+=this.command.options.crop.top,left:n+=this.command.options.crop.left,bottom:i,right:r}},uu.prototype._createManipulationReadyMessage=function(){var t=Ic.devicePixelRatio||1,e={cmd:d.readyForBrowserManipulation,pageDimensions:{dpr:t,innerWidth:Ic.innerWidth,innerHeight:Ic.innerHeight,documentWidth:Sc.documentElement.clientWidth,documentHeight:Sc.documentElement.clientHeight,bodyWidth:Sc.body.clientWidth,bodyHeight:Sc.body.clientHeight},disableResending:!0};return this.command.type===h.takeElementScreenshot&&(e.cropDimensions=this._getAbsoluteCropValues()),e},uu.prototype._runScrollBeforeScreenshot=function(){var i=this;return c.Promise.resolve().then(function(){if(i.element||!i.command.selector)return c.Promise.resolve();var t,e,n=i.command.selector.timeout,r="number"==typeof n?n:i.globalSelectorTimeout;return i.statusBar.showWaitingElementStatus(r),t=[{selector:i.command.selector,createNotFoundError:function(t){return new qe(null,t)},createIsInvisibleError:function(t){return new Xe(null,t)},createHasWrongNodeTypeError:function(t){return new Ke(t)}}],e=i.globalSelectorTimeout,new xa(t,e).getElements().then(function(t){i.statusBar.hideWaitingElementStatus(),i.element=t[0]}).catch(function(t){throw i.statusBar.hideWaitingElementStatus(),t})}).then(function(){return function(w,y){return s(this,void 0,void 0,function(){var e,n,r,i,o,s,a,l,u,c,d,h,p,f,m,g,v;return C(this,function(t){if(e=w.getBoundingClientRect(),n={left:e.left,right:e.right,top:e.top,bottom:e.bottom},r=_.styleUtils.getElementMargin(w),i=_.styleUtils.getElementPadding(w),o=_.styleUtils.getBordersWidth(w),y.originOffset={x:0,y:0},s=n.left+w.scrollWidth+o.left+o.right,a=n.top+w.scrollHeight+o.top+o.bottom,n.right=Math.max(n.right,s),n.bottom=Math.max(n.bottom,a),y.includeBorders&&y.includePaddings?y.includeMargins&&(y.originOffset.x-=r.left,y.originOffset.y-=r.top,n.left-=r.left,n.top-=r.top,n.right+=r.right,n.bottom+=r.bottom):(y.originOffset.x+=o.left,y.originOffset.y+=o.top,n.left+=o.left,n.top+=o.top,n.right-=o.right,n.bottom-=o.bottom,y.includePaddings||(y.originOffset.x+=i.left,y.originOffset.y+=i.top,n.left+=i.left,n.top+=i.top,n.right-=i.right,n.bottom-=i.bottom)),n.width=n.right-n.left,n.height=n.bottom-n.top,l=Ia({min:y.crop.left,max:y.crop.right,length:y.crop.width},n.width),u=Ia({min:y.crop.top,max:y.crop.bottom,length:y.crop.height},n.height),y.crop.left=l.min,y.crop.right=l.max,y.crop.width=l.length,y.crop.top=u.min,y.crop.bottom=u.max,y.crop.height=u.length,y.crop.width<=0||y.crop.height<=0)throw new kn(y.crop.width,y.crop.height);if(c=_.styleUtils.getViewportDimensions(),(n.width>c.width||n.height>c.height)&&(y.scrollToCenter=!0),d="number"==typeof y.scrollTargetX,h="number"==typeof y.scrollTargetY,d||(y.scrollTargetX=Sa(y.crop.left,y.crop.right,c.width)),h||(y.scrollTargetY=Sa(y.crop.top,y.crop.bottom,c.height)),p=E.getOffsetOptions(w,y.scrollTargetX,y.scrollTargetY),f=p.offsetX,m=p.offsetY,y.scrollTargetX=f,y.scrollTargetY=m,g=!d||y.scrollTargetX>=y.crop.left&&y.scrollTargetX<=y.crop.right,v=!h||y.scrollTargetY>=y.crop.top&&y.scrollTargetY<=y.crop.bottom,!g||!v)throw new Dn(g,v);return[2]})})}(i.element,i.command.options)}).then(function(){var t=i.command.options,e=t.scrollTargetX,n=t.scrollTargetY,r=t.scrollToCenter;return new _.ScrollAutomation(i.element,new ul({offsetX:e,offsetY:n,scrollToCenter:r,skipParentFrames:!0})).run()})},uu.prototype._hideUI=function(){return n.hide(),this.command.markData&&n.showScreenshotMark(this.command.markData),_.delay(500)},uu.prototype._showUI=function(){this.command.markData&&n.hideScreenshotMark(),n.show()},uu.prototype._requestManipulation=function(){if(!iu(Ic))return c.transport.queuedAsyncServiceMsg(this._createManipulationReadyMessage());var t=this._getAbsoluteCropValues();return _.sendRequestToFrame({cmd:su,command:this.command,cropDimensions:t},au,Ic.parent).then(function(t){if(!t.result)return{result:null};var e=t.result,n=e.result,r=e.executionError;if(r)throw r;return{result:n}})},uu.prototype._runManipulation=function(){var r=this,i=null;return c.Promise.resolve().then(function(){return r.command.type!==h.takeElementScreenshot?c.Promise.resolve():(_.scrollController.stopPropagation(),r._runScrollBeforeScreenshot())}).then(function(){return iu(Ic)?c.Promise.resolve():r._hideUI()}).then(function(){return r._requestManipulation()}).then(function(t){var e=t.result,n=t.error;if(n)throw n;return _.scrollController.enablePropagation(),i=e,iu(Ic)||r._showUI(),_.delay(200)}).then(function(){return new gs({isCommandResult:!0,result:i})}).catch(function(t){return _.scrollController.enablePropagation(),new gs({isCommandResult:!0,executionError:t})})},uu.prototype.execute=function(){var t=this;return function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=new _.ClientRequestEmitter,i=new _.RequestBarrier(r),o=new _.ScriptExecutionEmitter,s=new _.ScriptExecutionBarrier(o);_.pageUnloadBarrier.watchForPageNavigationTriggers();var a=null,l=t.apply(void 0,e),u=l.then(function(t){return a=t,c.Promise.all([i.wait().then(function(){return s.wait()}),_.pageUnloadBarrier.wait()])}).then(function(){return a});return{actionPromise:l,barriersPromise:u}}(function(){return t._runManipulation()}).barriersPromise},uu);function uu(t,e,n){this.command=t,this.globalSelectorTimeout=e,this.statusBar=n,this.element=null}function cu(e){return e.getResult().then(function(t){return new gs({isCommandResult:!0,result:e.encodeResult(t)})}).catch(function(t){return new gs({isCommandResult:!0,executionError:t})})}var du=l.Promise,hu=(pu.prototype.setAsMaster=function(t){var e=this;return ws(new Co(t),this.driverWindow,ys,tr).catch(function(t){if(!e._isNonPageWindow)throw t})},pu.prototype.closeAllChildWindows=function(){return ws(new bo,this.driverWindow,ys,rr)},pu.prototype.findChildWindows=function(t,e){return ws(new e(t),this.driverWindow,ys,tr)},pu.prototype.startToRestore=function(){return ws(new Ao,this.driverWindow,ys,tr)},pu.prototype.closeFileDownloadingWindow=function(){this._isNonPageWindow=!0,this.driverWindow.close()},pu);function pu(t,e){this._isNonPageWindow=!1,this.driverWindow=t,this.windowId=e}var fu=(mu.prototype._getTopOpenedWindow=function(t){for(var e=t;e.opener;)e=e.opener;return e.top},mu.prototype._setAsMaster=function(t,e){return ws(new Co(e),t,ys,tr)},mu.prototype.getTopOpenedWindow=function(){return this._getTopOpenedWindow(this.currentDriverWindow)},mu.prototype.setTopOpenedWindowAsMaster=function(){var t=this._getTopOpenedWindow(this.currentDriverWindow);return this._setAsMaster(t)},mu.prototype.setParentWindowAsMaster=function(t){void 0===t&&(t={});var e=this.currentDriverWindow.opener;return this._setAsMaster(e,t.finalizePendingCommand)},mu.prototype.restoreChild=function(r){return s(this,void 0,void 0,function(){var e,n;return C(this,function(t){return e=new No(r),n=this.currentDriverWindow.opener,ws(e,n,ys,tr),[2]})})},mu);function mu(t){this.currentDriverWindow=t}var gu="master",vu="replica",wu=(yu.prototype.shouldTransform=function(t,e){return e instanceof c.nativeMethods.Node},yu.prototype.toSerializable=function(t){return new Xs(t)},yu.prototype.fromSerializable=function(){},yu);function yu(){this.type="Node"}var _u=(Eu.prototype._startListening=function(){var e=this;this._emitter.onRequestSend(function(t){return e._onRequestSend(t)}),this._emitter.onRequestCompleted(function(t){return e._onRequestCompleted(t)}),this._emitter.onRequestError(function(t){return e._onRequestError(t)})},Eu.prototype._offListening=function(){this._emitter.offAll()},Eu.prototype._onRequestSend=function(t){this._collectingReqs&&this._requests.add(t)},Eu.prototype._onRequestCompleted=function(t){var e=this;ia(this._delays.additionalRequestsCollection).then(function(){return e._onRequestFinished(t)})},Eu.prototype._onRequestFinished=function(t){this._requests.has(t)&&(this._requests.delete(t),this._collectingReqs||this._requests.size||!this._watchdog||this._finishWaiting())},Eu.prototype._onRequestError=function(t){this._onRequestFinished(t)},Eu.prototype._finishWaiting=function(){this._watchdog&&((0,c.nativeMethods.clearTimeout)(this._watchdog),this._watchdog=null),this._requests.clear(),this._offListening(),this._waitResolve()},Eu.prototype.wait=function(t){var n=this;return ia(t?this._delays.pageInitialRequestsCollection:this._delays.requestsCollection).then(function(){return new c.Promise(function(t){var e;n._collectingReqs=!1,n._waitResolve=t,n._requests.size?(e=c.nativeMethods.setTimeout,n._watchdog=e(function(){return n._finishWaiting()},Eu.TIMEOUT)):n._finishWaiting()})})},Eu.TIMEOUT=3e3,Eu);function Eu(t,e){var n,r,i;void 0===e&&(e={}),this._delays={requestsCollection:null!==(n=e.requestsCollection)&&void 0!==n?n:50,additionalRequestsCollection:null!==(r=e.additionalRequestsCollection)&&void 0!==r?r:50,pageInitialRequestsCollection:null!==(i=e.pageInitialRequestsCollection)&&void 0!==i?i:50},this._emitter=t,this._waitResolve=null,this._watchdog=null,this._requests=new Set,this._collectingReqs=!0,this._startListening()}var Cu=(Iu.prototype._startListening=function(){var e=this;this._emitter.onScriptAdded(function(t){return e._onScriptElementAdded(t)}),this._emitter.onScriptLoadedOrFailed(function(t){return e._onScriptLoadedOrFailed(t)})},Iu.prototype._offListening=function(){this._emitter.offAll()},Iu.prototype._onScriptElementAdded=function(t){var e=this,n=(0,c.nativeMethods.setTimeout)(function(){return e._onScriptLoadedOrFailed(t,!0)},Iu.LOADING_TIMEOUT);this._scripts.set(t,n)},Iu.prototype._onScriptLoadedOrFailed=function(t,e){var n=this;void 0===e&&(e=!1),this._scripts.has(t)&&(e||(0,c.nativeMethods.clearTimeout)(this._scripts.get(t)),this._scripts.delete(t),this._scripts.size||ia(25).then(function(){n._waitResolve&&!n._scripts.size&&n._finishWaiting()}))},Iu.prototype._finishWaiting=function(){this._watchdog&&((0,c.nativeMethods.clearTimeout)(this._watchdog),this._watchdog=null),this._scripts.clear(),this._offListening(),this._waitResolve(),this._waitResolve=null},Iu.prototype.wait=function(){var n=this;return new c.Promise(function(t){var e;n._waitResolve=t,n._scripts.size?(e=c.nativeMethods.setTimeout,n._watchdog=e(function(){return n._finishWaiting()},Iu.TIMEOUT)):n._finishWaiting()})},Iu.TIMEOUT=3e3,Iu.LOADING_TIMEOUT=2e3,Iu);function Iu(t){this._emitter=t,this._watchdog=null,this._waitResolve=null,this._scripts=new Map,this._startListening()}var Su=(bu.prototype.wait=function(){var t=this;return c.Promise.all([this._requestBarrier.wait().then(function(){return t._scriptExecutionBarrier.wait()}),this._unloadBarrier.wait()]).then()},bu);function bu(t,e,n){this._requestBarrier=new _u(t),this._scriptExecutionBarrier=new Cu(e),(this._unloadBarrier=n).watchForPageNavigationTriggers&&n.watchForPageNavigationTriggers()}function Tu(t,e){var n=E.calculateSelectTextArguments(e[0],t);return new E.SelectText(e[0],n.startPos,n.endPos,t.options)}function Wu(t){if(!_.domUtils.isFileInput(t))throw new Rn}function Au(i,o){return s(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return f(i)?[4,(e=i,r={stack:(n=o).stack,pageUrl:n.pageUrl,message:n.msg},e.args=[[r]],new ci(e).getResult())]:[3,2];case 1:return[2,t.sent()];case 2:return[2,i||!1]}var e,n,r})})}_a.ACTIONS_HANDLERS[h.dispatchEvent]={additionalSelectorProps:["relatedTarget"],create:function(t,e){return e[1]&&(t.options.relatedTarget=e[1]),new E.DispatchEvent(e[0],t.eventName,t.options)}},_a.ACTIONS_HANDLERS[h.pressKey]={create:function(t){return new E.Press(_.parseKeySequence(t.keys).combinations,t.options)},ensureCmdArgs:function(t){if(_.parseKeySequence(t.keys).error)throw new Sn("keys")}},_a.ACTIONS_HANDLERS[h.click]={create:function(t,e,n,r){return/option|optgroup/.test(_.domUtils.getTagName(e[0]))?new E.SelectChildClick(e[0],t.options):(E.cursor.shouldRender=!n,new E.Click(e[0],t.options,Ic,E.cursor,n,r))}},_a.ACTIONS_HANDLERS[h.rightClick]={create:function(t,e){return new E.RClick(e[0],t.options)}},_a.ACTIONS_HANDLERS[h.doubleClick]={create:function(t,e){return new E.DblClick(e[0],t.options)}},_a.ACTIONS_HANDLERS[h.hover]={create:function(t,e){return new E.Hover(e[0],t.options)}},_a.ACTIONS_HANDLERS[h.drag]={create:function(t,e){return new E.DragToOffset(e[0],t.dragOffsetX,t.dragOffsetY,t.options)}},_a.ACTIONS_HANDLERS[h.dragToElement]={additionalSelectorProps:["destinationSelector"],create:function(t,e){return new E.DragToElement(e[0],e[1],t.options)}},_a.ACTIONS_HANDLERS[h.scroll]={create:function(t,e){var n=t.x,r=t.y,i=t.position,o=t.options;return new E.SetScroll(e[0],{x:n,y:r,position:i},o)}},_a.ACTIONS_HANDLERS[h.scrollBy]={create:function(t,e){var n=t.byX,r=t.byY,i=t.options;return new E.SetScroll(e[0],{byX:n,byY:r},i)}},_a.ACTIONS_HANDLERS[h.scrollIntoView]={create:function(t,e){return new E.ScrollIntoView(e[0],t.options)}},_a.ACTIONS_HANDLERS[h.typeText]={create:function(t,e){return new E.Type(e[0],t.text,t.options)}},_a.ACTIONS_HANDLERS[h.selectText]={create:Tu,ensureElsProps:function(t){if(!_.domUtils.isEditableElement(t[0]))throw new hn}},_a.ACTIONS_HANDLERS[h.selectTextAreaContent]={create:Tu,ensureElsProps:function(t){if(!_.domUtils.isTextAreaElement(t[0]))throw new mn}},_a.ACTIONS_HANDLERS[h.selectEditableContent]={additionalSelectorProps:["startSelector","endSelector"],create:function(t,e){return t.endSelector=t.endSelector||t.startSelector,new E.SelectEditableContent(e[0],e[1],t.options)},ensureElsProps:function(t){if(!_.domUtils.isContentEditableElement(t[0]))throw new wn("startSelector");if(!_.domUtils.isContentEditableElement(t[1]))throw new wn("endSelector");if(!_.contentEditable.getNearestCommonAncestor(t[0],t[1]))throw new En}},_a.ACTIONS_HANDLERS[h.setFilesToUpload]={create:function(t,e){return new E.Upload(e[0],t.filePath,function(t,e){return new Wn(t,e)})},ensureElsProps:function(t){return Wu(t[0])}},_a.ACTIONS_HANDLERS[h.clearUpload]={create:function(t,e){return new E.Upload(e[0])},ensureElsProps:function(t){return Wu(t[0])}};var xu,Ru=l.settings,Nu=l.transport,Pu=l.Promise,Du=l.eventSandbox.message,Mu=l.storages,Fu=l.nativeMethods,ku=Fu.date,Ou=l.eventSandbox.listeners,Lu=l.utils.url,Uu="testcafe|driver|test-done-sent-flag",Hu="testcafe|driver|pending-status",Bu="testcafe|driver|executing-client-function-descriptor",Gu="testcafe|driver|executing-skip-js-errors-function-flag",Vu="testcafe|driver|selector-execution-start-time",qu="testcafe|driver|pending-page-error",zu="testcafe|driver|active-iframe-selector",ju="testcafe|driver|test-speed",Xu="testcafe|driver|assertion-retries-timeout",Yu="testcafe|driver|assertion-retries-start-time",Ju="testcafe|driver|console-messages",Ku="testcafe|driver|pending-child-window-count",$u={NotLoadedError:Gn,NotFoundError:qe,IsInvisibleError:Xe},Qu={NotLoadedError:zn,NotFoundError:Rr,IsInvisibleError:Dr},Zu=Math.pow(2,31)-1,tc="status-with-command-result-event",ec="empty-command-event",nc="child-window-closed",rc="skip-js-errors-function-execution-complete",ic=(t(oc,xu=_.serviceUtils.EventEmitter),oc.prototype._isOpenedInIframe=function(){var t=Ic.opener;return t&&t.top&&t.top!==t},Object.defineProperty(oc.prototype,"speed",{get:function(){return this.contextStorage.getItem(ju)},set:function(t){this.contextStorage.setItem(ju,t)},enumerable:!1,configurable:!0}),Object.defineProperty(oc.prototype,"consoleMessages",{get:function(){return new jr(this.contextStorage.getItem(Ju))},set:function(t){return this.contextStorage.setItem(Ju,t?t.getCopy():null)},enumerable:!1,configurable:!0}),oc.prototype._getReadyPromise=function(){return s(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,_.eventUtils.documentReady(this.options.pageLoadTimeout)];case 1:return t.sent(),[4,this.pageInitialRequestBarrier.wait(!0)];case 2:return t.sent(),[2]}})})},oc.prototype._hasPendingActionFlags=function(t){return t.getItem(this.COMMAND_EXECUTING_FLAG)||t.getItem(this.EXECUTING_IN_IFRAME_FLAG)},oc.prototype._getCurrentWindowId=function(){if(this.options.proxyless)return this.runInfo.activeWindowId;var t=Ic.location.toString(),e=l.utils.url.parseProxyUrl(t);return e&&e.windowId||null},oc.prototype._onJsError=function(n){return s(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:if(this.contextStorage.getItem(Uu))return[2];if(!this.options.skipJsErrors)return[3,6];this.contextStorage.setItem(Gu,!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,Au(this.options.skipJsErrors,n)];case 2:return t.sent()||this._setUncaughtErrorOnPage(n),[3,5];case 3:return e=t.sent(),this.contextStorage.getItem(qu)||this.contextStorage.setItem(qu,e),[3,5];case 4:return this.contextStorage.setItem(Gu,!1),this.emit(rc),[7];case 5:return[2];case 6:return this._setUncaughtErrorOnPage(n),[2]}})})},oc.prototype._setUncaughtErrorOnPage=function(t){var e=new qt(t.stack,t.pageUrl);this.contextStorage.getItem(qu)||this.contextStorage.setItem(qu,e)},oc.prototype._unlockPageAfterTestIsDone=function(){return this.options.proxyless||_.disableRealEventsPreventing(),Pu.resolve()},oc.prototype._getActiveElement=function(){return s(this,void 0,void 0,function(){var e;return C(this,function(t){return e=_.domUtils.getActiveElement(),[2,this.replicator.encode(e)]})})},oc.prototype._failIfClientCodeExecutionIsInterrupted=function(){var t=this.contextStorage.getItem(Bu);return!!t&&(this._onReady(new gs({isCommandResult:!0,executionError:new xt(t.instantiationCallsiteName)})),!0)},oc.prototype.onCustomClientScriptError=function(t,e){var n=e?new ne(t,e):new Zt(t);this.contextStorage.getItem(qu)||this.contextStorage.setItem(qu,n)},oc.prototype._addChildWindowDriverLink=function(t){var e=new hu(t.window,t.windowId);this.childWindowDriverLinks.push(e),this._ensureClosedChildWindowWatcher()},oc.prototype._ensureClosedChildWindowWatcher=function(){var e=this;this.checkClosedChildWindowIntervalId||(this.checkClosedChildWindowIntervalId=Fu.setInterval.call(Ic,function(){var t=_.arrayUtils.find(e.childWindowDriverLinks,function(t){return t.driverWindow.closed});t&&(e.emit(nc),_.arrayUtils.remove(e.childWindowDriverLinks,t),t.ignoreMasterSwitching||e._setCurrentWindowAsMaster(),e.childWindowDriverLinks.length||(Fu.clearInterval.call(Ic,e.checkClosedChildWindowIntervalId),delete e.checkClosedChildWindowIntervalId))},200))},oc.prototype._setAsMasterInProgressOrCompleted=function(){return this.setAsMasterInProgress||this.role===gu},oc.prototype._setCurrentWindowAsMaster=function(){var t=this;this._setAsMasterInProgressOrCompleted()||(this.setAsMasterInProgress=!0,this._clearActiveChildIframeInfo(),Pu.resolve().then(function(){return _.browser.setActiveWindowId(t.communicationUrls.activeWindowId,l.createNativeXHR,t.windowId)}).then(function(){t._startInternal({finalizePendingCommand:!0,isFirstRequestAfterWindowSwitching:!0}),t.setAsMasterInProgress=!1}).catch(function(){t._onReady(new gs({isCommandResult:!0,executionError:new tr}))}))},oc.prototype._onChildWindowOpened=function(t){this._addChildWindowDriverLink(t),this._switchToChildWindow(t.windowId)},oc.prototype._sendStartToRestoreCommand=function(){if(this.contextStorage){this._stopRespondToChildren=!0,this.contextStorage.setItem(Ku,this.childWindowDriverLinks.length);for(var t=0,e=this.childWindowDriverLinks;t<e.length;t++)e[t].startToRestore()}},oc.prototype._onFormSubmit=function(t){this.contextStorage&&this.contextStorage.getItem(Uu)&&(t.preventSubmit=!0)},oc.prototype._onConsoleMessage=function(t){var e=t.meth,n=t.line,r=this.consoleMessages;r.addMessage(e,n,this.windowId),this.consoleMessages=r},oc.prototype._addPendingErrorToStatus=function(t){var e=this.contextStorage.getItem(qu);e&&(this.contextStorage.setItem(qu,null),t.pageError=e)},oc.prototype._addUnexpectedDialogErrorToStatus=function(t){var e=this.nativeDialogsTracker.getUnexpectedDialogError();t.pageError=t.pageError||e},oc.prototype._addConsoleMessagesToStatus=function(t){t.consoleMessages=this.consoleMessages,this.consoleMessages=null},oc.prototype._addPendingWindowSwitchingStateToStatus=function(t){t.isPendingWindowSwitching=this._isPendingSwitchingWindow()},oc.prototype._sendStatusRequest=function(t){function e(){return _.getTimeLimitedPromise(Nu.asyncServiceMsg(r),5e3)}function n(){return _.delay(300).then(e)}for(var r={cmd:d.ready,status:t,disableResending:!0,allowRejecting:!0},i=e(),o=0;o<a;o++)i=i.catch(n);return i},oc.prototype._sendStatus=function(t){var e=this;t.resent||(this._addPendingErrorToStatus(t),this._addUnexpectedDialogErrorToStatus(t),this._addConsoleMessagesToStatus(t),this._addPendingWindowSwitchingStateToStatus(t)),this.contextStorage.setItem(Hu,t);var n=null;return _.pageUnloadBarrier.wait(0).then(function(){return e._sendStatusRequest(t)}).then(function(t){return n=t,_.pageUnloadBarrier.wait(0)}).then(function(){return e.contextStorage.setItem(Hu,null),n})},oc.prototype._addChildIframeDriverLink=function(t,e){var n,r=this._getChildIframeDriverLinkByWindow(e);r||(n="".concat(this.testRunId,"-").concat(Si()),r=new Ms(e,n,this.communicationUrls.dispatchProxylessEvent),this.childIframeDriverLinks.push(r)),r.sendConfirmationMessage(t)},oc.prototype._getTargetWindowNotFoundResult=function(t,e){return Pu.resolve({success:!1,errCode:t,errMsg:e})},oc.prototype._getChildWindowValidateResult=function(t){var e=t.find(function(t){return t.result.success});if(e)return e.result;var n=t.find(function(t){return t.result.errCode===_.TEST_RUN_ERRORS.cannotCloseWindowWithChildrenError||t.result.errCode===_.TEST_RUN_ERRORS.cannotCloseWindowWithoutParent});return(n=n||t.find(function(t){return!!t.result.errCode}))?{errCode:n.result.errCode}:void 0},oc.prototype._handleWindowValidation=function(n,r,i,o){return s(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return[4,this._validateWindow(n,r,i,o)];case 1:return e=t.sent(),_s({requestMsgId:n.id,window:r,result:e}),[2]}})})},oc.prototype._getWindowInfo=function(){var t=l.utils.url.parseProxyUrl(Ic.location.toString());return{id:this.windowId,title:Sc.title,url:t.destUrl}},oc.prototype._isTargetWindow=function(t){return t.windowId===this.windowId},oc.prototype._validateWindow=function(r,t,i,o){return s(this,void 0,void 0,function(){var e,n;return C(this,function(t){switch(t.label){case 0:return this._isTargetWindow(r)?[2,i()]:this.childWindowDriverLinks.length?(e=this.childWindowDriverLinks.map(function(t){return t.findChildWindows(r,o)}),[4,Pu.all(e)]):[2,this._getTargetWindowNotFoundResult(_.TEST_RUN_ERRORS.targetWindowNotFoundError)];case 1:return n=t.sent(),[2,this._getChildWindowValidateResult(n)]}})})},oc._createWindowValidationError=function(t){var e=t.errCode;return new(e===_.TEST_RUN_ERRORS.cannotCloseWindowWithChildrenError?sr:e===_.TEST_RUN_ERRORS.cannotCloseWindowWithoutParent?ur:mr)},oc.prototype._getCloseWindowFoundResult=function(){return this.parentWindowDriverLink?this.childWindowDriverLinks.length?Pu.resolve({success:!1,errCode:_.TEST_RUN_ERRORS.cannotCloseWindowWithChildrenError}):Pu.resolve({success:!0}):Pu.resolve({success:!1,errCode:_.TEST_RUN_ERRORS.cannotCloseWindowWithoutParent})},oc.prototype._handleCloseWindowValidation=function(t,e){var n=this;return this._handleWindowValidation(t,e,function(){return n._getCloseWindowFoundResult()},Yi)},oc.prototype._handleSwitchToWindowValidation=function(t,e){return this._handleWindowValidation(t,e,function(){return Pu.resolve({success:!0})},$i)},oc.prototype._handleCloseWindow=function(e,n){return s(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,this._closeWindow(e,n)];case 1:return t.sent(),_s({requestMsgId:e.id,window:n}),[2]}})})},oc.prototype._closeWindowAndWait=function(n,r){return s(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return e=this._createWaitForEventPromise(nc,2e3),n.ignoreMasterSwitching=!r.isCurrentWindow,this.closing?[3,2]:(this.closing=!0,[4,_.browser.closeWindow(this.communicationUrls.closeWindow,l.createNativeXHR,this.windowId)]);case 1:t.sent(),t.label=2;case 2:return n.driverWindow.close(),[2,e]}})})},oc.prototype._closeWindow=function(e){if(!this.childWindowDriverLinks.length)return Pu.resolve();var t=this.childWindowDriverLinks.find(function(t){return t.windowId===e.windowId});if(t)return this._closeWindowAndWait(t,e);var n=this.childWindowDriverLinks.map(function(t){return t.findChildWindows(e,ro)});return Pu.all(n)},oc.prototype._getWindows=function(){return s(this,void 0,void 0,function(){var e,n,r,i,o,s;return C(this,function(t){switch(t.label){case 0:return this.childWindowDriverLinks.length?(e=this.childWindowDriverLinks.map(function(t){return t.findChildWindows({},to)}),[4,Pu.all(e)]):[2,[this._getWindowInfo()]];case 1:for(n=t.sent(),r=[this._getWindowInfo()],i=0,o=n;i<o.length;i++)s=o[i],Array.isArray(s.result)&&(r=r.concat(s.result));return[2,r]}})})},oc.prototype._handleGetWindows=function(n,r){return s(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return[4,this._getWindows(n,r)];case 1:return e=t.sent(),_s({requestMsgId:n.id,window:r,result:e}),[2]}})})},oc.prototype._handleSwitchToWindow=function(e,n){return s(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,this._switchToWindow(e)];case 1:return t.sent(),_s({requestMsgId:e.id,window:n}),[2]}})})},oc.prototype._switchToWindow=function(e){var t=this;return this._isTargetWindow(e)?Pu.resolve().then(function(){t._setCurrentWindowAsMaster()}):this.childWindowDriverLinks.length?Pu.all(this.childWindowDriverLinks.map(function(t){return t.findChildWindows(e,so)})):Pu.resolve()},oc.prototype._handleSetAsMasterMessage=function(t,e){var n=this;this._setAsMasterInProgressOrCompleted()||(this.setAsMasterInProgress=!0,_s({requestMsgId:t.id,window:e}),Pu.resolve().then(function(){return _.browser.setActiveWindowId(n.communicationUrls.activeWindowId,l.createNativeXHR,n.windowId)}).then(function(){n._startInternal({finalizePendingCommand:t.finalizePendingCommand,result:{id:n.windowId}}),n.setAsMasterInProgress=!1}).catch(function(){n._onReady(new gs({isCommandResult:!0,executionError:new tr}))}))},oc.prototype._handleCloseAllWindowsMessage=function(t,e){var n=this;this._closeAllChildWindows().then(function(){_s({requestMsgId:t.id,window:e})}).catch(function(){n._onReady(new gs({isCommandResult:!0,executionError:new rr}))})},oc.prototype._handleStartToRestoreChildLinkMessage=function(){this.parentWindowDriverLink.restoreChild(this._getCurrentWindowId())},oc.prototype._handleHasPendingActionFlags=function(t,e){var n=this._hasPendingActionFlags(this.contextStorage);_s({requestMsgId:t.id,window:e,result:n})},oc.prototype._handleRestoreChildLink=function(t,e){this._stopRespondToChildren||(this._addChildWindowDriverLink({window:e,windowId:t.windowId}),this.childWindowDriverLinks.length===this.contextStorage.getItem(Ku)&&this._restoreChildWindowsPromiseResolver&&(this._restoreChildWindowsPromiseResolver(),delete this._restoreChildWindowsPromiseResolver,this.contextStorage.setItem(Ku,0)),_s({requestMsgId:t.id,window:e}))},oc.prototype._handleChildWindowIsOpenedInIFrame=function(){var e=this;this._pendingChildWindowInIFrame=new Pu(function(t){e._resolvePendingChildWindowInIframe=t})},oc.prototype._handleChildWindowIsLoadedInIFrame=function(e,t){_s({requestMsgId:e.id,window:t}),this._resolvePendingChildWindowInIframe(),this.childWindowDriverLinks.find(function(t){return t.windowId===e.windowId})||this._onChildWindowOpened({window:t,windowId:e.windowId})},oc.prototype._handleStopInternalFromFrame=function(t,e){_s({requestMsgId:t.id,window:e}),this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1),this._stopInternal()},oc.prototype._initChildDriverListening=function(){var r=this;Du.on(Du.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message,n=t.source;switch(e.type){case Wi:r._addChildIframeDriverLink(e.id,n);break;case Gi:r._handleChildWindowIsOpenedInIFrame(e,n);break;case Bi:r._handleChildWindowIsLoadedInIFrame(e,n);break;case Vi:r._handleStopInternalFromFrame(e,n);break;case Oi:r._handleSetAsMasterMessage(e,n);break;case Ai:r._handleSwitchToWindow(e,n);break;case xi:r._handleCloseWindow(e,n);break;case Ni:r._handleSwitchToWindowValidation(e,n);break;case Ri:r._handleCloseWindowValidation(e,n);break;case Pi:r._handleGetWindows(e,n);break;case Li:r._handleCloseAllWindowsMessage(e,n);break;case Ui:r._handleStartToRestoreChildLinkMessage();break;case qi:r._handleHasPendingActionFlags(e,n);break;case Hi:r._handleRestoreChildLink(e,n)}})},oc.prototype._getChildIframeDriverLinkByWindow=function(e){return _.arrayUtils.find(this.childIframeDriverLinks,function(t){return t.driverWindow===e})},oc.prototype._getChildWindowDriverLinkByWindow=function(e){return _.arrayUtils.find(this.childWindowDriverLinks,function(t){return t.driverWindow===e})},oc.prototype._runInActiveIframe=function(t){var e=this,n=Pu.resolve(),r=this.contextStorage.getItem(zu);!this.activeChildIframeDriverLink&&r&&(n=this._switchToIframe(r,Qu)),n.then(function(){return e.contextStorage.setItem(e.EXECUTING_IN_IFRAME_FLAG,!0),e.activeChildIframeDriverLink.executeCommand(t,e.speed,e.options.proxyless,e.leftTopPoint)}).then(function(t){return e._onCommandExecutedInIframe(t)}).catch(function(t){return e._onCommandExecutedInIframe(new gs({isCommandResult:!0,executionError:t}))})},oc.prototype._onCommandExecutedInIframe=function(t){var e=this;this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1);var n=Pu.resolve();this._pendingChildWindowInIFrame&&(n=this._pendingChildWindowInIFrame),n.then(function(){e._onReady(t)})},oc.prototype._ensureChildIframeDriverLink=function(t,e,n){var r=this;return _.waitFor(function(){return r._getChildIframeDriverLinkByWindow(t)},500,n).catch(function(){throw new e})},oc.prototype._ensureChildWindowDriverLink=function(t,e,n){var r=this;return _.waitFor(function(){return r._getChildWindowDriverLinkByWindow(t)},500,n).catch(function(){throw new e})},oc.prototype._switchToIframe=function(e,n){var t,r,i,o,s,a,l,u=this,c="number"==typeof e.timeout,d=c?e.timeout:this.options.selectorTimeout;return t=e,r=d,i=null,o=function(t){return new n.NotFoundError(null,t)},s=function(){return new n.IsInvisibleError},a=this.statusBar,l=new Ta(t,r,i,o,s),a.showWaitingElementStatus(l.timeout),l.getResult().then(function(t){return a.hideWaitingElementStatus(!!t).then(function(){return t})}).catch(function(t){return a.hideWaitingElementStatus(!1).then(function(){throw t})}).then(function(t){if(!_.domUtils.isIframeElement(t))throw new Un;var e=c?d:Math.max(d,5e3);return u._ensureChildIframeDriverLink(Fu.contentWindowGetter.call(t),n.NotLoadedError,e)}).then(function(t){t.availabilityTimeout=d,u.activeChildIframeDriverLink=t,u.contextStorage.setItem(zu,e)})},oc.prototype._createWaitForEventPromise=function(e,n){var r=this,i=null,t=new Pu(function(t){Fu.setTimeout.call(Ic,function(){r.off(e,i),t()},n)}),o=new Pu(function(t){i=function(){this.off(e,i),t()},r.on(e,i)});return Pu.race([t,o])},oc.prototype._waitForCurrentCommandCompletion=function(){return this.contextStorage.getItem(this.COMMAND_EXECUTING_FLAG)?this._createWaitForEventPromise(tc,Zu):Pu.resolve()},oc.prototype._waitForSkipJsErrorFunctionCompletion=function(n){var r=this;return this.contextStorage.getItem(Gu)?new Pu(function(t){var e=function(){r.off(rc,e),t(n)};r.on(rc,e)}):Pu.resolve(n)},oc.prototype._waitForEmptyCommand=function(){return this._createWaitForEventPromise(ec,3e4)},oc.prototype._abortSwitchingToChildWindowIfItClosed=function(){if(this.activeChildWindowDriverLink.driverWindow.closed)throw _.arrayUtils.remove(this.childWindowDriverLinks,this.activeChildWindowDriverLink),this.activeChildWindowDriverLink=null,new Sr},oc.prototype._switchToChildWindow=function(t){var e=this;this.contextStorage.setItem(this.PENDING_WINDOW_SWITCHING_FLAG,!0);var n=this.contextStorage.getItem(this.WINDOW_COMMAND_API_CALL_FLAG);return function(e,t){if("string"!=typeof e)return du.resolve(null);var n=_.arrayUtils.find(t,function(t){return t.windowId===e});if(n)return du.resolve(n);var r=new Yn;return du.reject(r)}(t,this.childWindowDriverLinks).then(function(t){return e._ensureChildWindowDriverLink(t.driverWindow,$n,e.options.childWindowReadyTimeout)}).then(function(t){return e.activeChildWindowDriverLink=t,e._waitForCurrentCommandCompletion()}).then(function(){return n?void 0:e._waitForEmptyCommand()}).then(function(){return e._observeFileDownloadingInNewWindow(),e._abortSwitchingToChildWindowIfItClosed(),e._stopInternal(),e.activeChildWindowDriverLink.setAsMaster(n)}).then(function(){e.contextStorage.setItem(e.PENDING_WINDOW_SWITCHING_FLAG,!1)}).catch(function(t){e.contextStorage.setItem(e.PENDING_WINDOW_SWITCHING_FLAG,!1),t instanceof Sr?e._onReady(new gs):e._onReady(new gs({isCommandResult:!0,executionError:new tr}))})},oc.prototype._switchToTopParentWindow=function(){var t=this.parentWindowDriverLink.setTopOpenedWindowAsMaster.bind(this.parentWindowDriverLink);this._switchToParentWindowInternal(t)},oc.prototype._switchToParentWindow=function(t){void 0===t&&(t={});var e=this.parentWindowDriverLink.setParentWindowAsMaster.bind(this.parentWindowDriverLink);this._switchToParentWindowInternal(e,t)},oc.prototype._switchToParentWindowInternal=function(t,e){var n=this;return void 0===e&&(e={}),this.contextStorage.setItem(this.PENDING_WINDOW_SWITCHING_FLAG,!0),Pu.resolve().then(function(){return n._stopInternal(),t(e)}).then(function(){n.contextStorage.setItem(n.PENDING_WINDOW_SWITCHING_FLAG,!1)}).catch(function(){n.contextStorage.setItem(n.PENDING_WINDOW_SWITCHING_FLAG,!1),n._onReady(new gs({isCommandResult:!0,executionError:new tr}))})},oc.prototype._switchToMainWindow=function(t){this.activeChildIframeDriverLink&&this.activeChildIframeDriverLink.executeCommand(t),this._clearActiveChildIframeInfo()},oc.prototype._clearActiveChildIframeInfo=function(){this.contextStorage.setItem(zu,null),this.activeChildIframeDriverLink=null},oc.prototype._setNativeDialogHandlerInIframes=function(t){for(var e=new yo(t),n=0;n<this.childIframeDriverLinks.length;n++)Du.sendServiceMsg(e,this.childIframeDriverLinks[n].driverWindow)},oc.prototype._onActionCommand=function(t){var o=this,e=this.options.proxyless?Fu.functionBind.call(_.browser.dispatchProxylessEvent,_.browser.dispatchProxylessEvent,this.communicationUrls.dispatchProxylessEvent,u,l.createNativeXHR):null,n=new _a(t,{globalSelectorTimeout:this.options.selectorTimeout,testSpeed:this.speed,executeSelectorFn:function(t,e,n){var r=la(e.notFound),i=la(e.invisible);return new Ta(t,o.options.selectorTimeout,n,r,i).getResult()},leftTopPoint:this.leftTopPoint,dispatchProxylessEventFn:e}),r=[];n.on(_a.EXECUTION_STARTED_EVENT,function(){o.statusBar.hideWaitingElementStatus(!0),o.contextStorage.setItem(o.COMMAND_EXECUTING_FLAG,!0)}),n.on(_a.WAITING_FOR_ELEMENT_EVENT,function(t){o.statusBar.showWaitingElementStatus(t)}),n.on(_a.WARNING_EVENT,function(t){r.push(t)});var i=new _.ClientRequestEmitter,s=new _.ScriptExecutionEmitter,a=new Su(i,s,_.pageUnloadBarrier);n.execute(a).then(function(t){return new gs({isCommandResult:!0,result:Qr(new wu).encode(t),warnings:r})}).catch(function(t){return o.statusBar.hideWaitingElementStatus(!1).then(function(){return new gs({isCommandResult:!0,executionError:t})})}).then(function(t){return o._waitForSkipJsErrorFunctionCompletion(t)}).then(function(t){o.contextStorage.setItem(o.COMMAND_EXECUTING_FLAG,!1),o.contextStorage.setItem(Gu,!1),o._onReady(t)})},oc.prototype._onSetNativeDialogHandlerCommand=function(t){this.nativeDialogsTracker.setHandler(t.dialogHandler),this._setNativeDialogHandlerInIframes(t.dialogHandler),this._onReady(new gs({isCommandResult:!0}))},oc.prototype._onGetNativeDialogHistoryCommand=function(){this._onReady(new gs({isCommandResult:!0,result:this.nativeDialogsTracker.appearedDialogs}))},oc.prototype._onGetBrowserConsoleMessagesCommand=function(){this._onReady(new gs({isCommandResult:!0}))},oc.prototype._onNavigateToCommand=function(t){var e=this;this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!0),function(i){return s(this,void 0,void 0,function(){var e,n,r;return C(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),e=new _.ClientRequestEmitter,n=new _.RequestBarrier(e),c.navigateTo(i.url,i.forceReload),[4,c.Promise.all([n.wait(),_.pageUnloadBarrier.wait()])];case 1:return t.sent(),[2,new gs({isCommandResult:!0})];case 2:return r=t.sent(),[2,new gs({isCommandResult:!0,executionError:r})];case 3:return[2]}})})}(t).then(function(t){return e.contextStorage.setItem(e.COMMAND_EXECUTING_FLAG,!1),e._onReady(t)})},oc.prototype._onGetProxyUrlCommand=function(t){this._onReady(new gs({isCommandResult:!0,result:Lu.getProxyUrl(t.url,t.options)}))},oc.prototype._onSkipJsErrorsCommand=function(t){var e=t.options;this.options.skipJsErrors=e,this._onReady(new gs({isCommandResult:!0}))},oc.prototype._onExecuteClientFunctionCommand=function(t){var e=this;this.contextStorage.setItem(Bu,{instantiationCallsiteName:t.instantiationCallsiteName}),cu(new ci(t)).then(function(t){e.contextStorage.setItem(Bu,null),e._onReady(t)})},oc.prototype._onExecuteSelectorCommand=function(t){var e,n,r,i,o,s,a,l=this,u=this.contextStorage.getItem(Vu)||new ku,c=la("CannotObtainInfoForElementSpecifiedBySelectorError"),d=t.strictError?la(aa()):c,h=t.strictError?la(sa()):c;e=t,n=this.options.selectorTimeout,r=u,i=t.needError?d:null,o=t.needError?h:null,s=this.statusBar,a=new Ta(e,n,r,i,o),s.showWaitingElementStatus(a.timeout),cu(a).then(function(t){return s.hideWaitingElementStatus(!!t.result).then(function(){return t})}).then(function(t){l.contextStorage.setItem(Vu,null),l._onReady(t)})},oc.prototype._onSwitchToMainWindowCommand=function(t){this._switchToMainWindow(t),this._onReady(new gs({isCommandResult:!0}))},oc.prototype._onSwitchToIframeCommand=function(t){var e=this;this._switchToIframe(t.selector,$u).then(function(){return e._onReady(new gs({isCommandResult:!0}))}).catch(function(t){return e._onReady(new gs({isCommandResult:!0,executionError:t}))})},oc.prototype._onWindowOpenCommand=function(t){this.contextStorage.setItem(this.WINDOW_COMMAND_API_CALL_FLAG,!0),Ic.open(t.url)},oc.prototype._onWindowCloseCommand=function(a){return s(this,void 0,void 0,function(){var e,n,r,i,o,s;return C(this,function(t){switch(t.label){case 0:e=this._getTopOpenedWindow(),n=a.windowId||this.windowId,r=n===this.windowId,t.label=1;case 1:return t.trys.push([1,4,,5]),[4,this._validateChildWindowCloseCommandExists(n,e)];case 2:if(i=t.sent(),!(o=i.result).success)throw oc._createWindowValidationError(o);return[4,ws(new ro({windowId:n,isCurrentWindow:r}),e,ys,tr)];case 3:return t.sent(),r||this._onReady(new gs({isCommandResult:!0})),[3,5];case 4:return s=t.sent(),this._onReady(new gs({isCommandResult:!0,executionError:s})),[3,5];case 5:return[2]}})})},oc.prototype._onGetCurrentWindowCommand=function(){this._onReady(new gs({isCommandResult:!0,result:{id:this.windowId}}))},oc.prototype._onGetWindowsCommand=function(){return s(this,void 0,void 0,function(){var e,n;return C(this,function(t){switch(t.label){case 0:return e=this._getTopOpenedWindow(),[4,ws(new to,e,ys,tr)];case 1:return n=t.sent(),this._onReady(new gs({isCommandResult:!0,result:n.result})),[2]}})})},oc.prototype._validateChildWindowCloseCommandExists=function(t,e){return ws(new Yi({windowId:t}),e,ys,tr)},oc.prototype._validateChildWindowSwitchToWindowCommandExists=function(t,e){var n=t.windowId,r=t.fn;return ws(new $i({windowId:n,fn:r}),e,ys,tr)},oc.prototype._getTopOpenedWindow=function(){var t;return((null===(t=this.parentWindowDriverLink)||void 0===t?void 0:t.getTopOpenedWindow())||Ic).top},oc.prototype._onSwitchToWindow=function(i,o){return s(this,void 0,void 0,function(){var e,n,r;return C(this,function(t){switch(t.label){case 0:return e=this._getTopOpenedWindow(),[4,this._validateChildWindowSwitchToWindowCommandExists({windowId:i.windowId,fn:i.checkWindow},e)];case 1:return n=t.sent(),(r=n.result).success?(this._stopInternal(),ws(new so({windowId:i.windowId,fn:i.checkWindow}),e,ys,tr)):this._onReady(new gs({isCommandResult:!0,executionError:o||oc._createWindowValidationError(r)})),[2]}})})},oc.prototype._restoreChildWindowLinks=function(){return s(this,void 0,void 0,function(){var e,n=this;return C(this,function(t){switch(t.label){case 0:if(!this.contextStorage.getItem(Ku))return[2];e=new Pu(function(t){n._restoreChildWindowsPromiseResolver=t}),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,_.getTimeLimitedPromise(e,3e4)];case 2:return t.sent(),[3,4];case 3:return t.sent(),this._onReady(new gs({isCommandResult:!0,executionError:new Wr})),[3,4];case 4:return[2]}})})},oc.prototype._onSwitchToPreviousWindow=function(t){this._onSwitchToWindow(t,new Er)},oc.prototype._onSwitchToParentWindow=function(){this.parentWindowDriverLink?this._switchToParentWindow({finalizePendingCommand:!0}):this._onReady(new gs({isCommandResult:!0,executionError:new wr}))},oc.prototype._onBrowserManipulationCommand=function(t){var e,n,r,i=this;this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!0),e=t,n=this.options.selectorTimeout,r=this.statusBar,new lu(e,n,r).execute().then(function(t){return i.contextStorage.setItem(i.COMMAND_EXECUTING_FLAG,!1),i._onReady(t)})},oc.prototype._onSetBreakpointCommand=function(t){var n=this,e=t.isTestError,r=t.inCompilerService,i=this.statusBar.showDebuggingStatus(e);r?(i.then(function(t){n.debug=t}),this._onReady(new gs({isCommandResult:!0,result:!0}))):i.then(function(t){var e=t===y;n._onReady(new gs({isCommandResult:!0,result:e}))})},oc.prototype._onDisableDebugCommand=function(){this.statusBar._resetState(),this._onReady(new gs({isCommandResult:!0}))},oc.prototype._onSetTestSpeedCommand=function(t){this.speed=t.speed,this._onReady(new gs({isCommandResult:!0}))},oc.prototype._onShowAssertionRetriesStatusCommand=function(t){this.contextStorage.setItem(Xu,t.timeout),this.contextStorage.setItem(Yu,Fu.dateNow()),this.statusBar.showWaitingAssertionRetriesStatus(t.timeout),this._onReady(new gs({isCommandResult:!0}))},oc.prototype._onHideAssertionRetriesStatusCommand=function(t){var e=this;this.contextStorage.setItem(Xu,null),this.contextStorage.setItem(Yu,null),this.statusBar.hideWaitingAssertionRetriesStatus(t.success).then(function(){return e._onReady(new gs({isCommandResult:!0}))})},oc.prototype._checkStatus=function(){var n=this,t={statusUrl:this.communicationUrls.statusDone};return _.browser.checkStatus(t,l.createNativeXHR,{manualRedirect:!0,proxyless:this.options.proxyless}).then(function(t){var e=t.command;e.testRunId!==n.testRunId?(Mu.clear(),Mu.lock(),_.browser.redirect(e,l.createNativeXHR,n.communicationUrls.openFileProtocolUrl)):(n.contextStorage.setItem(Uu,!1),n._onReady({isCommandResult:!1}))}).catch(function(){return _.delay(1e3)})},oc.prototype._onCustomCommand=function(t){var e=this;(0,this.customCommandHandlers[t.type].handler)(t).then(function(t){e._onReady(new gs({isCommandResult:!0,result:t}))})},oc.prototype._closeAllChildWindows=function(){var t=this;return this.childWindowDriverLinks.length?Pu.all(this.childWindowDriverLinks.map(function(t){return t.closeAllChildWindows()})).then(function(){Fu.arrayForEach.call(t.childWindowDriverLinks,function(t){t.driverWindow.close()})}):Pu.resolve()},oc.prototype._onTestDone=function(t){var e=this;this.contextStorage.setItem(Uu,!0),this.parentWindowDriverLink?this._switchToTopParentWindow():this._closeAllChildWindows().then(function(){return e._sendStatus(t)}).then(function(){e._checkStatus()}).catch(function(){e._onReady(new gs({isCommandResult:!0,executionError:rr}))})},oc.prototype._onBackupStoragesCommand=function(){this._onReady(new gs({isCommandResult:!0,result:Mu.backup()}))},oc.prototype._isPendingSwitchingWindow=function(){return!!this.contextStorage.getItem(this.PENDING_WINDOW_SWITCHING_FLAG)},oc.prototype._onPrepareClientEnvironmentInDebugMode=function(t){Fu.objectDefineProperty(Ic,t.esmRuntime,{value:{g:Ic,c:Ic.eval},configurable:!0}),this._onReady(new gs({isCommandResult:!0,result:!0}))},oc.prototype._isStatusWithCommandResultInPendingWindowSwitchingMode=function(t){return t.isCommandResult&&this._isPendingSwitchingWindow()},oc.prototype._isEmptyCommandInPendingWindowSwitchingMode=function(t){return!t&&this._isPendingSwitchingWindow()},oc.prototype._observeFileDownloadingInNewWindow=function(){var e=this,t=new gs({isObservingFileDownloadingInNewWindow:!0});this._isPendingSwitchingWindow()&&this._sendStatus(t).then(function(t){t?e._onCommand(t):e._observeFileDownloadingInNewWindow()})},oc.prototype._onReady=function(t){var e=this;this.debug&&(t.debug=this.debug,this.debug=null),this._isStatusWithCommandResultInPendingWindowSwitchingMode(t)&&this.emit(tc),this._sendStatus(t).then(function(t){if(t)e._onCommand(t);else{if(e._isEmptyCommandInPendingWindowSwitchingMode(t))return void e.emit(ec);e._onReady(new gs)}})},oc.prototype._executeCommand=function(t){this.contextStorage.setItem(this.WINDOW_COMMAND_API_CALL_FLAG,!1),this.customCommandHandlers[t.type]?this._onCustomCommand(t):t.type===h.testDone?this._onTestDone(new gs({isCommandResult:!0})):t.type===h.setBreakpoint?this._onSetBreakpointCommand(t):t.type===h.disableDebug?this._onDisableDebugCommand():t.type===h.switchToMainWindow?this._onSwitchToMainWindowCommand(t):t.type===h.switchToIframe?this._onSwitchToIframeCommand(t):t.type===h.openWindow?this._onWindowOpenCommand(t):t.type===h.closeWindow?this._onWindowCloseCommand(t):t.type===h.getCurrentWindow?this._onGetCurrentWindowCommand(t):t.type===h.getCurrentWindows?this._onGetWindowsCommand():t.type===h.switchToWindow?this._onSwitchToWindow(t):t.type===h.switchToPreviousWindow?this._onSwitchToPreviousWindow(t):t.type===h.switchToParentWindow?this._onSwitchToParentWindow():g(t)?this._onBrowserManipulationCommand(t):t.type===h.executeClientFunction?this._onExecuteClientFunctionCommand(t):t.type===h.executeSelector?this._onExecuteSelectorCommand(t):t.type===h.navigateTo?this._onNavigateToCommand(t):t.type===h.setNativeDialogHandler?this._onSetNativeDialogHandlerCommand(t):t.type===h.getNativeDialogHistory?this._onGetNativeDialogHistoryCommand(t):t.type===h.getBrowserConsoleMessages?this._onGetBrowserConsoleMessagesCommand(t):t.type===h.setTestSpeed?this._onSetTestSpeedCommand(t):t.type===h.showAssertionRetriesStatus?this._onShowAssertionRetriesStatusCommand(t):t.type===h.hideAssertionRetriesStatus?this._onHideAssertionRetriesStatusCommand(t):t.type===h.backupStorages?this._onBackupStoragesCommand():t.type===h.closeChildWindowOnFileDownloading?this._closeChildWindowOnFileDownloading():t.type===h.prepareClientEnvironmentInDebugMode?this._onPrepareClientEnvironmentInDebugMode(t):t.type===h.getProxyUrl?this._onGetProxyUrlCommand(t):t.type===h.skipJsErrors?this._onSkipJsErrorsCommand(t):this._onActionCommand(t)},oc.prototype._closeChildWindowOnFileDownloading=function(){this.activeChildWindowDriverLink.closeFileDownloadingWindow(),_.arrayUtils.remove(this.childWindowDriverLinks,this.activeChildWindowDriverLink),E.cursor.show(),this._startInternal()},oc.prototype._isExecutableInTopWindowOnly=function(t){if((e=t).type===h.testDone||e.type===h.switchToMainWindow||e.type===h.setNativeDialogHandler||e.type===h.getNativeDialogHistory||e.type===h.setTestSpeed||e.type===h.showAssertionRetriesStatus||e.type===h.hideAssertionRetriesStatus||e.type===h.setBreakpoint||g(e)&&e.type!==h.takeElementScreenshot)return!0;var e,n=this.customCommandHandlers[t.type];return t.forceExecutionInTopWindowOnly||n&&n.isExecutableInTopWindowOnly},oc.prototype._onCommand=function(n){var r=this;this.readyPromise.then(function(){var t,e=p(n);r.contextStorage.getItem(qu)&&e?r._onReady(new gs({isCommandResult:!0})):(t=r.activeChildIframeDriverLink||r.contextStorage.getItem(zu),r._isExecutableInTopWindowOnly(n)||!t?r._executeCommand(n):r._runInActiveIframe(n))})},oc.prototype.setCustomCommandHandlers=function(t,e,n){this.customCommandHandlers[t]={isExecutableInTopWindowOnly:n,handler:e}},oc.prototype._startInternal=function(t){this.role=gu,_.browser.startHeartbeat(this.communicationUrls.heartbeat,l.createNativeXHR),this._setupAssertionRetryIndication(),this._startCommandsProcessing(t)},oc.prototype._stopInternal=function(){this.role=vu,_.browser.stopHeartbeat(),E.cursor.hide()},oc.prototype._setupAssertionRetryIndication=function(){var n=this;this.readyPromise.then(function(){n.statusBar.hidePageLoadingStatus();var t,e=n.contextStorage.getItem(Xu);e&&(t=n.contextStorage.getItem(Yu),0<e-(new ku-t)&&n.statusBar.showWaitingAssertionRetriesStatus(e,t))})},oc.prototype._startCommandsProcessing=function(t){void 0===t&&(t={finalizePendingCommand:!1,isFirstRequestAfterWindowSwitching:!1,result:void 0});var e,n,r=this.contextStorage.getItem(Hu);r&&(r.resent=!0),this.contextStorage.getItem(Uu)?r?this._onTestDone(r):this._checkStatus():this._failIfClientCodeExecutionIsInterrupted()||(e=t.finalizePendingCommand||this._hasPendingActionFlags(this.contextStorage),n=r||new gs({isCommandResult:e,isFirstRequestAfterWindowSwitching:t.isFirstRequestAfterWindowSwitching,result:t.result}),this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!1),this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1),this.contextStorage.setItem(this.PENDING_WINDOW_SWITCHING_FLAG,!1),this._onReady(n))},oc.prototype._initParentWindowLink=function(){Ic.opener&&Ic.opener!==Ic&&this.windowId&&(this.parentWindowDriverLink=new fu(Ic))},oc.prototype._initConsoleMessages=function(){var t=this.consoleMessages;t.ensureMessageContainer(this.windowId),this.consoleMessages=t},oc.prototype._getDriverRole=function(){return s(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return this.windowId?[4,_.browser.getActiveWindowId(this.communicationUrls.activeWindowId,l.createNativeXHR)]:[2,gu];case 1:return[2,t.sent().activeWindowId===this.windowId?gu:vu]}})})},oc.prototype._init=function(){var t=this.options,e=t.proxyless,n=t.dialogHandler,r=t.speed;this.contextStorage=new ns(Ic,{testRunId:this.testRunId,windowId:this.windowId,proxyless:e}),this.nativeDialogsTracker=new Ci(this.contextStorage,{proxyless:e,dialogHandler:n}),this.statusBar=new u.StatusBar(this.runInfo.userAgent,this.runInfo.fixtureName,this.runInfo.testName,this.contextStorage);var i=this;this.statusBar.on(this.statusBar.UNLOCK_PAGE_BTN_CLICK,function(){i.options.proxyless||_.disableRealEventsPreventing()}),this.speed=r,this._initConsoleMessages(),this._initParentWindowLink(),this._isOpenedInIframe()&&ws(new Mo(this.windowId),Ic.opener.top,ys,mr)},oc.prototype._doFirstPageLoadSetup=function(){return s(this,void 0,void 0,function(){return C(this,function(t){return this.isFirstPageLoad&&this.options.canUseDefaultWindowActions,[2]})})},oc.prototype.start=function(){return s(this,void 0,void 0,function(){var e;return C(this,function(t){switch(t.label){case 0:return this._init(),[4,this._doFirstPageLoadSetup()];case 1:return t.sent(),[4,this._restoreChildWindowLinks()];case 2:return t.sent(),[4,this._getDriverRole()];case 3:return e=t.sent(),this.role===gu||e===gu&&this._startInternal(),[2]}})})},oc);function oc(t,e,n,r){var i=xu.call(this)||this;i.COMMAND_EXECUTING_FLAG="testcafe|driver|command-executing-flag",i.EXECUTING_IN_IFRAME_FLAG="testcafe|driver|executing-in-iframe-flag",i.PENDING_WINDOW_SWITCHING_FLAG="testcafe|driver|pending-window-switching-flag",i.WINDOW_COMMAND_API_CALL_FLAG="testcafe|driver|window-command-api-flag",i.testRunId=t,i.communicationUrls=e,i.runInfo=n,i.options=r,i.isFirstPageLoad=Ru.get().isFirstPageLoad,i.customCommandHandlers={},i.contextStorage=null,i.nativeDialogsTracker=null,i.childIframeDriverLinks=[],i.activeChildIframeDriverLink=null,i.childWindowDriverLinks=[],i.parentWindowDriverLink=null,i.statusBar=null,i.windowId=i._getCurrentWindowId(),i.role=vu,i.setAsMasterInProgress=!1,i.checkClosedChildWindowIntervalId=null;var o=new _.ClientRequestEmitter;return i.pageInitialRequestBarrier=new _.RequestBarrier(o),i.readyPromise=i._getReadyPromise(),i._initChildDriverListening(),_.pageUnloadBarrier.init(),i.options.proxyless||_.preventRealEvents(),l.on(l.EVENTS.uncaughtJsError,function(t){return i._onJsError(t)}),l.on(l.EVENTS.unhandledRejection,function(t){return i._onJsError(t)}),l.on(l.EVENTS.consoleMethCalled,function(t){return i._onConsoleMessage(t)}),l.on(l.EVENTS.beforeFormSubmit,function(t){return i._onFormSubmit(t)}),l.on(l.EVENTS.windowOpened,function(t){return i._onChildWindowOpened(t)}),i.setCustomCommandHandlers(h.unlockPage,function(){return i._unlockPageAfterTestIsDone()}),i.setCustomCommandHandlers(h.getActiveElement,function(){return i._getActiveElement()}),Ou.addInternalEventBeforeListener(Ic,["beforeunload"],function(){i._sendStartToRestoreCommand()}),i.replicator=Qr([new Qs]),i}var sc=(ac.prototype.establishConnection=function(){return ws(new zi,this.driverWindow,5e3,zn).then(function(t){return t.result})},ac.prototype.sendConfirmationMessage=function(t){_s({requestMsgId:t,window:this.driverWindow})},ac.prototype.onCommandExecuted=function(t){var e=new uo(t);c.eventSandbox.message.sendServiceMsg(e,this.driverWindow)},ac.prototype.hasPendingActionFlags=function(){return s(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,ws(new Vo,this.driverWindow,5e3,zn)];case 1:return[2,t.sent().result]}})})},ac);function ac(t){this.driverWindow=t}var lc,uc=l.eventSandbox.message,cc=(t(dc,lc=Ci),dc.prototype._defaultDialogHandler=function(t){uc.sendServiceMsg({type:pi,dialogType:t,url:Ci._getPageUrl()},Ic.top)},dc.prototype._addAppearedDialogs=function(t,e){uc.sendServiceMsg({type:hi,dialogType:t,text:e,url:Ci._getPageUrl()},Ic.top)},dc.prototype._onHandlerError=function(t,e){uc.sendServiceMsg({type:fi,dialogType:t,message:e,url:Ci._getPageUrl()},Ic.top)},dc);function dc(t){return lc.call(this,null,t)||this}var hc,pc=c.eventSandbox.message,fc=(t(mc,hc=ic),mc.prototype._onJsError=function(){},mc.prototype._onConsoleMessage=function(){},mc.prototype._onChildWindowOpened=function(){pc.sendServiceMsg(new Oo,Ic.top)},mc.prototype._stopInternal=function(){pc.sendServiceMsg(new Ho,Ic.top)},mc.prototype._initParentDriverListening=function(){var n=this;c.eventSandbox.message.on(c.eventSandbox.message.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message;_.pageUnloadBarrier.wait(0).then(function(){if(e.type===Mi){if(n.lastParentDriverMessageId===e.id)return;n.lastParentDriverMessageId=e.id,n.readyPromise.then(function(){n.speed=e.testSpeed,n.leftTopPoint=e.leftTopPoint,n.parentDriverLink.sendConfirmationMessage(e.id),n._onCommand(e.command)})}e.type===ki&&(n.nativeDialogsTracker.setHandler(e.dialogHandler),n._setNativeDialogHandlerInIframes(e.dialogHandler))})})},mc.prototype._onSwitchToMainWindowCommand=function(t){this._switchToMainWindow(t)},mc.prototype._onReady=function(t){this.parentDriverLink.onCommandExecuted(t)},mc.prototype._isInCommandExecution=function(){return s(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return c.utils.dom.isCrossDomainWindows(Ic,Ic.parent)?[4,this.parentDriverLink.hasPendingActionFlags()]:[3,2];case 1:return[2,t.sent()];case 2:return[2,this._hasPendingActionFlags(this.contextStorage)]}})})},mc.prototype._init=function(){return s(this,void 0,void 0,function(){var e,n,r;return C(this,function(t){switch(t.label){case 0:return[4,this.parentDriverLink.establishConnection()];case 1:return e=t.sent(),n=e.id,r=e.dispatchProxylessEventUrl,this.contextStorage=new ns(Ic,{testRunId:n,windowId:this.windowId,proxyless:this.options.proxyless}),this.communicationUrls.dispatchProxylessEvent=r,this._failIfClientCodeExecutionIsInterrupted()?[2]:[4,this._isInCommandExecution()];case 2:return t.sent()&&(this.contextStorage.setItem(this.COMMAND_EXECUTING_FLAG,!1),this.contextStorage.setItem(this.EXECUTING_IN_IFRAME_FLAG,!1),this._onReady(new gs({isCommandResult:!0}))),[2]}})})},mc.prototype.start=function(){this.nativeDialogsTracker=new cc({dialogHandler:this.options.dialogHandler,proxyless:this.options.proxyless}),this.statusBar=new n.IframeStatusBar;var t=this._init();this.readyPromise=c.Promise.all([this.readyPromise,t])},mc);function mc(t,e){var n=hc.call(this,t,{},{},e)||this;return n.lastParentDriverMessageId=null,n.parentDriverLink=new sc(Ic.parent),n._initParentDriverListening(),n.leftTopPoint=new da(0,0),n}var gc={NodeSnapshot:Vs,ElementSnapshot:Ks,SelectorExecutor:Ta},vc="%testCafeDriver%",wc="%testCafeIframeDriver%",yc="%testCafeEmbeddingUtils%",_c=l.nativeMethods,Ec=l.EVENTS.evalIframeScript;_c.objectDefineProperty(Ic,vc,{configurable:!0,value:ic}),_c.objectDefineProperty(Ic,wc,{configurable:!0,value:fc}),_c.objectDefineProperty(Ic,yc,{configurable:!0,value:gc}),l.on(Ec,function(t){return Cc(_c.contentWindowGetter.call(t.iframe))})}(Ic["%hammerhead%"],Ic["%hammerhead%"].Promise,Ic["%testCafeCore%"],Ic["%testCafeAutomation%"],Ic["%testCafeUI%"])}(window);
@@ -5,7 +5,8 @@
5
5
  pageLoadTimeout: {{{pageLoadTimeout}}},
6
6
  dialogHandler: {{{dialogHandler}}},
7
7
  retryTestPages: {{{retryTestPages}}},
8
- speed: {{{speed}}}
8
+ speed: {{{speed}}},
9
+ proxyless: {{{proxyless}}},
9
10
  });
10
11
 
11
12
  driver.start();