UNPKG

testcafe

Version:

Automated browser testing for the modern web development stack.

1 lines 79.2 kB
window["%hammerhead%"].utils.removeInjectedScript(),function nu(iu){var ru=iu.document;!function(u,c,t){function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=e(u),i=e(c),r=e(t),h={uiRoot:null,container:null,element:function(){return this.uiRoot||(this.uiRoot=ru.createElement("div"),u.shadowUI.getRoot().appendChild(this.uiRoot)),this.uiRoot},panelsContainer:function(){return this.container||(this.container=ru.createElement("div"),u.shadowUI.addClass(this.container,"panels-container"),this.element().appendChild(this.container)),this.container},insertFirstChildToPanelsContainer:function(t){var e=this.panelsContainer(),n=u.nativeMethods.nodeFirstChildGetter.call(e);e.insertBefore(t,n)},hide:function(){this.uiRoot&&(this.uiRoot.style.visibility="hidden")},show:function(){this.uiRoot&&(this.uiRoot.style.visibility="")},remove:function(){var t=u.shadowUI.getRoot();u.nativeMethods.nodeParentNodeGetter.call(t).removeChild(t)}},d=n.default.shadowUI,p=n.default.utils.browser,o=n.default.utils.featureDetection,f=n.default.nativeMethods,m=n.default.eventSandbox.eventSimulator,v=n.default.eventSandbox.listeners,g=i.default.positionUtils,y=i.default.domUtils,_=i.default.styleUtils,C=i.default.eventUtils,b=i.default.arrayUtils,E=i.default.selectController,w="tcOptionList",a="disabled";function S(t){var e=f.eventTargetGetter.call(t),n=E.currentEl;(e||t.srcElement)===n||y.containsElement(n,e)||y.containsElement(E.optionList,e)||x()}function T(t,e,n){var i,r=f.eventTargetGetter.call(t),s=b.indexOf(E.options,r);s<0||(n(),(i=-1<r.className.indexOf(a))&&p.isWebKit||function(t,e){var n=E.currentEl,i=n.selectedIndex,r=n.getElementsByTagName("option")[t],s=!e&&t!==i;s&&(n.selectedIndex=t),!p.isFirefox&&s&&(m.input(n),m.change(n)),p.isFirefox&&m.mousedown(p.isFirefox?r:n),o.isTouchDevice||m.mouseup(p.isFirefox?r:n),p.isFirefox&&s&&(m.input(n),m.change(n)),o.isTouchDevice||m.click(p.isFirefox?r:n),e||x()}(s,i))}function x(){y.remove(E.optionList),C.unbind(ru,"mousedown",S),E.clear()}var s=Object.freeze({__proto__:null,expandOptionList:function(t){var e=t.children;if(e.length&&!t.disabled){if(E.currentEl){var n=t===E.currentEl;if(x(),n)return}var i=E.currentEl=t,r=E.optionList=ru.createElement("div");h.element().appendChild(r),d.addClass(r,w),E.createChildren(e,r),v.addInternalEventBeforeListener(iu,["click"],T),f.setTimeout.call(iu,function(){C.bind(ru,"mousedown",S)},0),_.set(r,{position:"absolute",fontSize:_.get(i,"fontSize"),fontFamily:_.get(i,"fontFamily"),minWidth:_.getWidth(i)+"px",left:g.getOffsetPosition(i).left+"px",height:20<y.getSelectVisibleChildren(t).length?20*_.getOptionHeight(t):""});var s,o=g.getOffsetPosition(i).top,a=_.getHeight(r),l=o+_.getHeight(i)+2;l+a>_.getScrollTop(iu)+_.getHeight(iu)&&(s=o-3-a)>=_.getScrollTop(iu)&&(l=s),_.set(r,"top",l+"px")}},collapseOptionList:x,scrollOptionListByChild:function(t){var e,n,i,r,s,o,a=y.getSelectParent(t);a&&(e=_.getSelectElementSize(a),n=_.getOptionHeight(a),i=0,s=(r=Math.max(_.getScrollTop(a)/n,0))+e-1,(o=y.getChildVisibleIndex(a,t))<r?(i=n*(r-o),_.setScrollTop(a,Math.max(_.getScrollTop(a)-i,0))):s<o&&(i=n*(o-s),_.setScrollTop(a,_.getScrollTop(a)+i)))},getSelectChildCenter:function(t){var e=y.getSelectParent(t);if(!e)return{x:0,y:0};var n=_.getOptionHeight(e),i=g.getElementRectangle(t);return{x:Math.round(i.left+i.width/2),y:Math.round(i.top+n/2)}},switchOptionsByKeys:function(t,e){var n=_.getSelectElementSize(t),i=!_.hasDimensions(d.select("."+w)[0]);if(/down|up/.test(e)||(n<=1||p.isFirefox)&&(i||p.isFirefox)&&/left|right/.test(e)){for(var r=t.querySelectorAll("option"),s=[],o=0;o<r.length;o++){var a=r[o].parentElement;r[o].disabled||"optgroup"===y.getTagName(a)&&a.disabled||s.push(r[o])}var l=b.indexOf(s,r[t.selectedIndex])+(/down|right/.test(e)?1:-1);0<=l&&l<s.length&&(t.selectedIndex=b.indexOf(r,s[l]),m.input(t),m.change(t))}}}),l="Loading page...",I="modal-background",A="loading-text",M="loading-icon",B=null,N=null,U=null,R=!1;function D(){function t(){var t=c.styleUtils.getHeight(iu),e=c.styleUtils.getWidth(iu);c.styleUtils.set(B,"width",e+"px"),c.styleUtils.set(B,"height",t+"px"),c.styleUtils.set(U,{left:Math.round((e-c.styleUtils.getWidth(U))/2)+"px",top:Math.round((t-c.styleUtils.getHeight(U))/2)+"px"})}t(),c.eventUtils.bind(iu,"resize",t)}function k(){var t,e,n,i;t=h.element(),B=ru.createElement("div"),t.appendChild(B),u.shadowUI.addClass(B,I),N=ru.createElement("div"),u.nativeMethods.nodeTextContentSetter.call(N,l),t.appendChild(N),u.shadowUI.addClass(N,A),U=ru.createElement("div"),c.styleUtils.set(U,"visibility","hidden"),t.appendChild(U),u.shadowUI.addClass(U,M),D(),e=c.styleUtils.getHeight(iu),n=c.styleUtils.getWidth(iu),(i=!c.styleUtils.hasDimensions(N))&&(c.styleUtils.set(N,"visibility","hidden"),c.styleUtils.set(N,"display","block")),c.styleUtils.set(N,{left:Math.max((n-c.styleUtils.getWidth(N))/2,0)+"px",top:Math.max((e-c.styleUtils.getHeight(N))/2,0)+"px"}),i&&(c.styleUtils.set(N,"display","none"),c.styleUtils.set(N,"visibility","")),R=!0}var V=Object.freeze({__proto__:null,initAndShowLoadingText:function(){function t(){k(),c.styleUtils.set(B,"opacity",.8),c.styleUtils.set(B,"display","block"),c.styleUtils.set(N,"display","block"),e=!0}var e=!1,n=function(){e||(ru.body?t():u.nativeMethods.setTimeout.call(iu,n,0))};n(),c.eventUtils.documentReady().then(function(){e||t()})},show:function(t){R||k(),c.styleUtils.set(B,"opacity",t?0:.7),c.styleUtils.set(B,"display","block")},hide:function(){R&&(c.styleUtils.set(N,"display","none"),c.styleUtils.set(B,"display","none"))},showLoadingIcon:function(){c.styleUtils.set(U,"visibility","visible")},hideLoadingIcon:function(){c.styleUtils.set(U,"visibility","hidden")}}),O=n.default.shadowUI,P=i.default.styleUtils,F="success",$=(L.prototype.setValue=function(t){t="number"!=typeof t?0:Math.min(Math.max(t,0),100),P.set(this.valueElement,"width",t+"%")},L.prototype.setSuccess=function(t){t?O.addClass(this.containerElement,F):O.removeClass(this.containerElement,F)},L);function L(t){this.containerElement=ru.createElement("div"),this.valueElement=ru.createElement("div"),t.appendChild(this.containerElement),this.containerElement.appendChild(this.valueElement),O.addClass(this.containerElement,"progress-bar"),O.addClass(this.valueElement,"value")}var z=n.default.shadowUI,H=n.default.nativeMethods,W=i.default.eventUtils,j=i.default.styleUtils,G="progress-panel",q="title",Y="content",X=(K._getInvisibleElementProperty=function(t,e){var n="none"===j.get(t,"display");n&&j.set(t,"display","block");var i=t[e];return n&&j.set(t,"display","none"),i},K._showAtWindowCenter=function(t){var e=K._getInvisibleElementProperty(t,"offsetHeight"),n=K._getInvisibleElementProperty(t,"offsetWidth"),i=Math.round(j.getHeight(iu)/2-e/2),r=Math.round(j.getWidth(iu)/2-n/2);j.set(t,{left:r+"px",top:i+"px"})},K.prototype._setCurrentProgress=function(){var t=Math.round((H.dateNow()-this.startTime)/this.maxTimeout*100);this.progressBar.setValue(t)},K.prototype._setSuccess=function(t){this.progressBar.setSuccess(t)},K.prototype._stopAnimation=function(){H.clearInterval.call(iu,this.animationInterval)},K.prototype._animate=function(t,e,n,i){var r,s,o,a=this,l=H.dateNow(),u=n?0:1;n&&(j.set(t,"opacity",u),j.set(t,"display","block")),this._stopAnimation(),this.animationInterval=H.setInterval.call(iu,function(){r=H.dateNow()-l,s=Math.min(r/e,1),o=.5-Math.cos(s*Math.PI)/2,j.set(t,"opacity",u+(n?o:-o)),1===s&&(a._stopAnimation(),i&&i())},10)},K.prototype._showPanel=function(){W.bind(iu,"resize",this.disposePanel),this._animate(this.panelDiv,200,!0)},K.prototype._hidePanel=function(t){var e=this;this.startTime=null,W.unbind(iu,"resize",this.disposePanel),this._animate(this.panelDiv,t?0:600,!1,function(){return j.set(e.panelDiv,"display","none")})},K.prototype.show=function(t,e){var n=this;this.startTime=H.dateNow(),this.maxTimeout=e,H.nodeTextContentSetter.call(this.titleDiv,t),this._setSuccess(!1),this.openingTimeout=H.setTimeout.call(iu,function(){n.openingTimeout=null,n._setCurrentProgress(),n._showPanel(),n.updateInterval=H.setInterval.call(iu,function(){return n._setCurrentProgress()},100)},300)},K.prototype.close=function(t){var e=this;t&&this._setSuccess(!0),this.openingTimeout&&(H.clearTimeout.call(iu,this.openingTimeout),this.openingTimeout=null),this.updateInterval&&(H.clearInterval.call(iu,this.updateInterval),this.updateInterval=null),t?this.startTime&&H.dateNow()-this.startTime<1e3?H.setTimeout.call(iu,function(){H.setTimeout.call(iu,function(){return e._hidePanel(!1)},200)},100):H.setTimeout.call(iu,function(){return e._hidePanel(!1)},200):this._hidePanel(!0)},K);function K(){var t=this;this.startTime=null,this.openingTimeout=null,this.updateInterval=null,this.animationInterval=null,this.panelDiv=ru.createElement("div"),h.element().appendChild(this.panelDiv),this.titleDiv=ru.createElement("div"),this.panelDiv.appendChild(this.titleDiv),this.contentDiv=ru.createElement("div"),this.panelDiv.appendChild(this.contentDiv),z.addClass(this.panelDiv,G),z.addClass(this.titleDiv,q),z.addClass(this.contentDiv,Y),K._showAtWindowCenter(this.panelDiv),this.progressBar=new $(this.contentDiv),this.disposePanel=function(){return K._showAtWindowCenter(t.panelDiv)}}var J=function(t,e){return(J=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 Q(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}J(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Z(t,o,a,l){return new(a=a||r.default)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function r(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof a?e:new a(function(t){t(e)})).then(i,r)}s((l=l.apply(t,o||[])).next())})}function tt(n,i){var r,s,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return l.next=t(0),l.throw=t(1),l.return=t(2),"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function t(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;l&&e[l=0]&&(a=0),a;)try{if(r=1,s&&(o=2&e[0]?s.return:e[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,e[1])).done)return o;switch(s=0,o&&(e=[2&e[0],o.value]),e[0]){case 0:case 1:o=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,s=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(o=0<(o=a.trys).length&&o[o.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!o||e[1]>o[0]&&e[1]<o[3])){a.label=e[1];break}if(6===e[0]&&a.label<o[1]){a.label=o[1],o=e;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(e);break}o[2]&&a.ops.pop(),a.trys.pop();continue}e=i.call(n,a)}catch(t){e=[6,t],s=0}finally{r=o=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var et=n.default.shadowUI,nt=n.default.nativeMethods,it=i.default.styleUtils,rt="determinate",st=(ot.prototype._setCurrentProgress=function(){var t=(nt.dateNow()-this.startTime)/this.maxTimeout,e=Math.min(Math.max(t,0),1),n=it.getWidth(this.progressBar),i=Math.round(n*e);it.set(this.firstValueElement,"width",i+"px")},ot.prototype.start=function(t,e){var n=this;et.addClass(this.progressBar,rt),this.maxTimeout=t,this.startTime=e||nt.dateNow(),this._setCurrentProgress(),this.animationInterval=nt.setInterval.call(iu,function(){return n._setCurrentProgress()},10)},ot.prototype.stop=function(){this.animationInterval&&(nt.clearInterval.call(iu,this.animationInterval),this.animationInterval=null)},ot.prototype.reset=function(){it.set(this.firstValueElement,"width",0),et.removeClass(this.progressBar,rt)},ot);function ot(t,e){this.progressBar=t,this.firstValueElement=e,this.maxTimeout=null,this.startTime=null,this.animationInterval=null}function at(t,e,n){if(e.x===t.x)return 0;var i=(e.y-t.y)/(e.x-t.x),r=t.x*(t.y-e.y)/(e.x-t.x)+t.y;return Math.round(i*n+r)}var lt=n.default.shadowUI,ut=n.default.nativeMethods,ct=i.default.styleUtils,ht={time:2800,points:[.815,.395],positionByCompletePercent:{0:{left:-35,right:100},.6:{left:100,right:-90},1:{left:100,right:-90}}},dt={time:3e3,points:[.84,1],positionByCompletePercent:{0:{left:-200,right:100},.6:{left:107,right:-8},1:{left:107,right:-8}}},pt=0,ft=.6,mt=1,vt="indeterminate",gt=(yt._updateValueAnimation=function(t,e,n){var i,r,s,o,a,l,u,c,h,d,p=n.time,f=n.points,m=n.positionByCompletePercent,v=ut.dateNow()-t,g=(i=v/p,r=f[0],s=f[1],3*Math.pow(1-i,2)*i*r+3*(1-i)*i*i*s+i*i*i),y=(c=(l=(o=g)<ft)?ft:mt,h=(a=m)[u=l?pt:ft],d=a[c],{left:at({x:u,y:h.left},{x:c,y:d.left},o),right:at({x:u,y:h.right},{x:c,y:d.right},o)}),_=y.left,C=y.right;ct.set(e,"left",Math.round(_)+"%"),ct.set(e,"right",Math.round(C)+"%")},yt.prototype._clearFirstValueAnimation=function(){this.animationInterval&&(ut.clearInterval.call(iu,this.animationInterval),this.animationInterval=null),ct.set(this.firstValue,"left","-35%"),ct.set(this.firstValue,"right","100%")},yt.prototype._clearSecondValueAnimation=function(){this.secondValueAnimationInterval&&(ut.clearInterval.call(iu,this.secondValueAnimationInterval),this.secondValueAnimationInterval=null),ct.set(this.secondValue,"left","-200%"),ct.set(this.secondValue,"right","100%")},yt.prototype._startFirstValueAnimation=function(){var t=this;this._clearFirstValueAnimation();var e=ut.dateNow();this.animationInterval=ut.setInterval.call(iu,function(){yt._updateValueAnimation(e,t.firstValue,ht)},10)},yt.prototype._startSecondValueAnimation=function(){var t=this;this._clearSecondValueAnimation();var e=ut.dateNow();this.secondValueAnimationInterval=ut.setInterval.call(iu,function(){yt._updateValueAnimation(e,t.secondValue,dt)},10)},yt.prototype._startAnimation=function(){var t=this;this._startFirstValueAnimation(),this.secondValueAnimationTimeout=ut.setTimeout.call(iu,function(){return t._startSecondValueAnimation()},1e3),this.restartAnimationTimeout=ut.setTimeout.call(iu,function(){return t._startAnimation()},1950)},yt.prototype._stopAnimation=function(){this._clearFirstValueAnimation(),this._clearSecondValueAnimation(),this.secondValueAnimationTimeout&&(ut.clearInterval.call(iu,this.secondValueAnimationTimeout),this.secondValueAnimationTimeout=null),this.restartAnimationTimeout&&(ut.clearInterval.call(iu,this.restartAnimationTimeout),this.restartAnimationTimeout=null)},yt.prototype.start=function(){lt.addClass(this.progressBar,vt),this._startAnimation()},yt.prototype.stop=function(){lt.removeClass(this.progressBar,vt),this._stopAnimation()},yt);function yt(t,e,n){this.progressBar=t,this.firstValue=e,this.secondValue=n,this.animationInterval=null,this.secondValueAnimationInterval=null,this.secondValueAnimationTimeout=null,this.restartAnimationTimeout=null}var _t=n.default.shadowUI,Ct=i.default.styleUtils,bt=(Et.prototype._create=function(t){this.progressBar=ru.createElement("div"),_t.addClass(this.progressBar,"progress-bar"),t.appendChild(this.progressBar);var e=ru.createElement("div");_t.addClass(e,"value-container"),this.progressBar.appendChild(e),this.firstValueElement=ru.createElement("div"),_t.addClass(this.firstValueElement,"value"),e.appendChild(this.firstValueElement),this.secondValueElement=ru.createElement("div"),_t.addClass(this.secondValueElement,"value"),e.appendChild(this.secondValueElement)},Et.prototype.show=function(){Ct.set(this.progressBar,"visibility","visible")},Et.prototype.hide=function(){Ct.set(this.progressBar,"visibility","hidden")},Et);function Et(t){this.progressBar=null,this.firstValueElement=null,this.secondValueElement=null,this._create(t),this.determinateIndicator=new st(this.progressBar,this.firstValueElement),this.indeterminateIndicator=new gt(this.progressBar,this.firstValueElement,this.secondValueElement)}var wt,St="start-waiting-element",Tt="end-waiting-element-request",xt="end-waiting-element-response",It="start-waiting-assertion-retries",At="end-waiting-assertion-retries-request",Mt="end-waiting-assertion-retries-response",Bt="step",Nt="resume",Ut=n.default.Promise,Rt=n.default.shadowUI,Dt=n.default.nativeMethods,kt=n.default.eventSandbox.message,Vt=n.default.utils.browser,Ot=n.default.utils.featureDetection,Pt=n.default.eventSandbox.listeners,Ft=i.default.styleUtils,$t=i.default.eventUtils,Lt=i.default.domUtils,zt=i.default.serviceUtils,Ht=i.default.arrayUtils,Wt="status-bar-debugging",jt="waiting-element-failed",Gt="waiting-element-success",qt="%testCafeStatusPrefix%",Yt=(Q(Xt,wt=zt.EventEmitter),Object.defineProperty(Xt.prototype,"visibleHeight",{get:function(){return this.maxHeight=Math.max(this.maxHeight,Ft.getHeight(this.statusBar)),this.maxHeight},enumerable:!1,configurable:!0}),Xt.prototype._createButton=function(t,e){var n=ru.createElement("div"),i=ru.createElement("div"),r=ru.createElement("span");return Dt.nodeTextContentSetter.call(r,t),Rt.addClass(n,"button"),Rt.addClass(n,e),Rt.addClass(i,"button-icon"),Vt.isSafari&&(r.style.position="relative",r.style.top="1px"),n.appendChild(i),n.appendChild(r),n},Xt.prototype._createIconArea=function(){this.icon=ru.createElement("div"),Rt.addClass(this.icon,"icon"),this.statusBar.appendChild(this.icon)},Xt.prototype._createInformationArea=function(){this.infoContainer=ru.createElement("div"),Rt.addClass(this.infoContainer,"info-container"),this.statusBar.appendChild(this.infoContainer);var t=ru.createElement("div");Rt.addClass(t,"info-text-container"),this.infoContainer.appendChild(t);var e=ru.createElement("div");Rt.addClass(e,"status-container"),t.appendChild(e),this.statusDiv=ru.createElement("div"),this.statusDiv=ru.createElement("div"),Dt.nodeTextContentSetter.call(this.statusDiv,this._getFullStatusText("Loading Web Page...")),Rt.addClass(this.statusDiv,"status"),Rt.addClass(this.statusDiv,"info"),e.appendChild(this.statusDiv);var n=ru.createElement("div");Dt.nodeTextContentSetter.call(n,"".concat(this.fixtureName," - ").concat(this.testName)),Rt.addClass(n,"fixture"),Rt.addClass(n,"info"),e.appendChild(n);var i=ru.createElement("div");Dt.nodeTextContentSetter.call(i,this.userAgent),Rt.addClass(i,"user-agent"),t.appendChild(i)},Xt.prototype._createActionsArea=function(){var t=this;this.actionsContainer=ru.createElement("div"),Rt.addClass(this.actionsContainer,"actions-container"),this.statusBar.appendChild(this.actionsContainer),this.buttons=ru.createElement("div"),Rt.addClass(this.buttons,"buttons"),this.actionsContainer.appendChild(this.buttons),this.unlockButton=this._createButton("Unlock Page","locked"),this.resumeButton=this._createButton("Resume","resume"),this.nextButton=this._createButton("Next Action","step"),this.finishButton=this._createButton("Finish","finish"),this.buttons.appendChild(this.unlockButton),this.buttons.appendChild(this.resumeButton),this.buttons.appendChild(this.nextButton),this.actionsContainer.style.display="none",this._bindClickOnce([this.unlockButton],function(){Rt.removeClass(t.unlockButton,"locked"),Rt.addClass(t.unlockButton,"unlocked"),Dt.nodeTextContentSetter.call(t.unlockButton.querySelector("span"),"Page unlocked"),t.state.locked=!1,t.emit(t.UNLOCK_PAGE_BTN_CLICK,{})}),this.unlockButton.style.display="none"},Xt.prototype._create=function(){this.statusBar=ru.createElement("div"),Rt.addClass(this.statusBar,"status-bar"),this._createIconArea(),this._createInformationArea(),this._createActionsArea(),this.progressBar=new bt(this.infoContainer),this.progressBar.indeterminateIndicator.start(),this.progressBar.show(),h.panelsContainer().appendChild(this.statusBar),this._bindHandlers(),this.state.created=!0},Xt.prototype._createBeforeReady=function(){var t,e=this;this.state.created||(t=iu).top!==t||(ru.body?this._create():Dt.setTimeout.call(iu,function(){return e._createBeforeReady()},0))},Xt.prototype._animate=function(t){var e,n,i,r=this,s=Dt.dateNow(),o=parseInt(Ft.get(this.statusBar,"opacity"),10)||0;this._stopAnimation(),t&&(Ft.set(this.statusBar,"visibility",""),this.state.hidden=!1),this.animationInterval=Dt.setInterval.call(iu,function(){e=Dt.dateNow()-s,n=Math.min(e/500,1),i=.5-Math.cos(n*Math.PI)/2,Ft.set(r.statusBar,"opacity",o+(t?i:-i)),1===n&&(r._stopAnimation(),t||(Ft.set(r.statusBar,"visibility","hidden"),r.state.hidden=!0),r.state.showing=!1,r.state.hiding=!1)},10)},Xt.prototype._stopAnimation=function(){this.animationInterval&&(Dt.clearInterval.call(iu,this.animationInterval),this.animationInterval=null)},Xt.prototype._fadeOut=function(){this.state.hiding||this.state.debugging||(this.state.showing=!1,this.state.hiding=!0,this._animate())},Xt.prototype._fadeIn=function(){this.state.showing||this.state.debugging||(this.state.hiding=!1,this.state.showing=!0,this._animate(!0))},Xt.prototype._bindHandlers=function(){var e=this;Pt.initElementListening(iu,["resize"]),Pt.addInternalEventBeforeListener(iu,["resize"],function(){e.windowHeight=iu.innerHeight}),Pt.addFirstInternalEventBeforeListener(iu,["mousemove","mouseout","touchmove"],function(t){"mouseout"!==t.type||t.relatedTarget?"mousemove"!==t.type&&"touchmove"!==t.type||(t.clientY>e.windowHeight-e.visibleHeight?e._fadeOut(t):e.state.hidden&&e._fadeIn(t)):e._fadeIn(t)})},Xt.prototype._bindClickOnce=function(n,i){var r=this,s=!this.nativeAutomation&&Ot.isTouchDevice?"touchstart":"mousedown",o=function(t){var e=Dt.eventTargetGetter.call(t);Ht.find(n,function(t){return Lt.containsElement(t,e)})?($t.preventDefault(t),Pt.removeInternalEventBeforeListener(iu,[s],o),i(t)):Lt.containsElement(r.statusBar,e)&&$t.preventDefault(t)};Pt.addInternalEventBeforeListener(iu,[s],o)},Xt.prototype._initChildListening=function(){var n=this;kt.on(kt.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message;e.cmd===St?n.showWaitingElementStatus(e.timeout):e.cmd===Tt?n.hideWaitingElementStatus(e.waitingSuccess).then(function(){return kt.sendServiceMsg({cmd:xt},t.source)}):e.cmd===It?n.showWaitingAssertionRetriesStatus(e.timeout):e.cmd===At&&n.hideWaitingAssertionRetriesStatus(e.waitingSuccess).then(function(){return kt.sendServiceMsg({cmd:Mt},t.source)})})},Xt.prototype._resetState=function(){this.state.debugging=!1,Rt.removeClass(h.panelsContainer(),Wt),this.actionsContainer.style.display="none",this.unlockButton.style.display="none",Dt.nodeTextContentSetter.call(this.statusDiv,this._getFullStatusText("")),this.progressBar.hide()},Xt.prototype._getFullStatusText=function(t){var e=this.contextStorage.getItem(qt)||"";return e+(e&&t?". ":"")+t},Xt.prototype._showWaitingStatus=function(){var t=this.state.assertionRetries?"Waiting for assertion execution...":"Waiting for element to appear...";Dt.nodeTextContentSetter.call(this.statusDiv,this._getFullStatusText(t)),this.progressBar.show()},Xt.prototype._hideWaitingStatus=function(e){var n=this;return new Ut(function(t){Dt.setTimeout.call(iu,function(){n.state.waiting||n.state.debugging||(Rt.removeClass(n.statusBar,Gt),Rt.removeClass(n.statusBar,jt),n.progressBar.determinateIndicator.reset(),n._resetState()),t()},e?0:500)})},Xt.prototype._showDebuggingStatus=function(t){var r=this;return new Ut(function(i){r.state.debugging=!0,r.state.locked=!0,Rt.addClass(h.panelsContainer(),Wt),t?(r.buttons.removeChild(r.nextButton),r.buttons.removeChild(r.resumeButton),r.buttons.appendChild(r.finishButton),Dt.nodeTextContentSetter.call(r.statusDiv,r._getFullStatusText("Test failed")),Rt.removeClass(r.statusBar,Gt),Rt.addClass(r.statusBar,jt)):Dt.nodeTextContentSetter.call(r.statusDiv,r._getFullStatusText("Debugging test...")),r.actionsContainer.style.display="",r.unlockButton.style.display="",r._bindClickOnce([r.resumeButton,r.nextButton,r.finishButton],function(t){var e=Dt.eventTargetGetter.call(t),n=Lt.containsElement(r.nextButton,e);r._resetState(),i(n?Bt:Nt)})})},Xt.prototype._setWaitingStatus=function(t,e){var n=this;this.state.waiting=!0,this.progressBar.determinateIndicator.start(t,e),this.showingTimeout=Dt.setTimeout.call(iu,function(){n.showingTimeout=null,n._showWaitingStatus()},300)},Xt.prototype._resetWaitingStatus=function(t){this.state.waiting=!1,this.progressBar.determinateIndicator.stop(),t?Rt.addClass(this.statusBar,Gt):Rt.addClass(this.statusBar,jt);var e=this.showingTimeout&&t;return this.showingTimeout&&(Dt.clearTimeout.call(iu,this.showingTimeout),this.showingTimeout=null,t||this._showWaitingStatus()),this._hideWaitingStatus(e)},Xt.prototype.hidePageLoadingStatus=function(){this.state.created||this._create(),this.progressBar.indeterminateIndicator.stop(),this._resetState()},Xt.prototype.showDebuggingStatus=function(t){return this._stopAnimation(),Ft.set(this.statusBar,"opacity",1),Ft.set(this.statusBar,"visibility",""),this.state.hiden=!1,this._showDebuggingStatus(t)},Xt.prototype.showWaitingElementStatus=function(t){this.state.assertionRetries||this._setWaitingStatus(t)},Xt.prototype.hideWaitingElementStatus=function(t){return this.state.assertionRetries?Ut.resolve():this._resetWaitingStatus(t)},Xt.prototype.showWaitingAssertionRetriesStatus=function(t,e){this.state.assertionRetries=!0,this._setWaitingStatus(t,e)},Xt.prototype.hideWaitingAssertionRetriesStatus=function(t){var e=this;return this._resetWaitingStatus(t).then(function(){e.state.assertionRetries=!1})},Xt.prototype.setStatusPrefix=function(t){this.contextStorage.setItem(qt,t),Dt.nodeTextContentSetter.call(this.statusDiv,this._getFullStatusText(""))},Xt);function Xt(t,e,n,i,r){var s=wt.call(this)||this;return s.UNLOCK_PAGE_BTN_CLICK="testcafe|ui|status-bar|unlock-page-btn-click",s.userAgent=t,s.fixtureName=e,s.testName=n,s.contextStorage=i,s.nativeAutomation=r,s.statusBar=null,s.infoContainer=null,s.actionsContainer=null,s.icon=null,s.resumeButton=null,s.finishButton=null,s.nextButton=null,s.statusDiv=null,s.buttons=null,s.progressBar=null,s.animationInterval=null,s.showingTimeout=null,s.windowHeight=ru.documentElement?Ft.getHeight(iu):iu.innerHeight,s.maxHeight=0,s.state={created:!1,showing:!1,hiding:!1,debugging:!1,waiting:!1,assertionRetries:!1,hidden:!1},s.currentView=null,s._createBeforeReady(),s._initChildListening(),s}var Kt,Jt=i.default.sendRequestToFrame,Qt=n.default.eventSandbox.message,Zt=(Q(te,Kt=Yt),te.prototype.showWaitingElementStatus=function(t){Qt.sendServiceMsg({cmd:St,timeout:t},iu.top)},te.prototype.hideWaitingElementStatus=function(t){return Jt({cmd:Tt,waitingSuccess:t},xt,iu.top)},te.prototype.showWaitingAssertionRetriesStatus=function(t){Qt.sendServiceMsg({cmd:It,timeout:t},iu.top)},te.prototype.hideWaitingAssertionRetriesStatus=function(t){return Jt({cmd:At,waitingSuccess:t},Mt,iu.top)},te);function te(){return Kt.call(this)||this}var ee="ui|cursor|move|request",ne="ui|cursor|leftbuttondown|request",ie="ui|cursor|rightbuttondown|request",re="ui|cursor|buttonup|request",se="ui|cursor|move|response",oe="ui|cursor|leftbuttondown|response",ae="ui|cursor|rightbuttondown|response",le="ui|cursor|buttonup|response",ue=n.default.Promise,ce=n.default.shadowUI,he=n.default.utils.featureDetection,de=n.default.eventSandbox.message,pe=i.default.styleUtils,fe=i.default.positionUtils,me="l-mouse-down",ve="r-mouse-down",ge=[me,ve].join(" ");de.on(de.SERVICE_MSG_RECEIVED_EVENT,function(t){var e=t.message;switch(e.cmd){case ee:ye.move(fe.getIframePointRelativeToParentFrame({x:e.x,y:e.y},t.source)).then(function(){return de.sendServiceMsg({cmd:se},t.source)});break;case ne:ye.leftButtonDown().then(function(){return de.sendServiceMsg({cmd:oe},t.source)});break;case ie:ye.rightButtonDown().then(function(){return de.sendServiceMsg({cmd:ae},t.source)});break;case re:ye.buttonUp().then(function(){return de.sendServiceMsg({cmd:le},t.source)})}});var ye={cursorElement:null,x:50,y:50,pointerOffsetX:0,pointerOffsetY:0,_createElement:function(){this.cursorElement=ru.createElement("div"),ce.addClass(this.cursorElement,"cursor"),he.isTouchDevice&&(ce.addClass(this.cursorElement,"touch"),this.pointerOffsetX=Math.ceil(pe.getWidth(this.cursorElement)/2),this.pointerOffsetY=Math.ceil(pe.getHeight(this.cursorElement)/2)),h.element().appendChild(this.cursorElement)},_ensureCursorElement:function(){return this.cursorElement||this._createElement(),!0},isVisible:function(){return this.cursorElement&&"hidden"!==pe.get(this.cursorElement,"visibility")},hide:function(){this._ensureCursorElement()&&this.isVisible()&&pe.set(this.cursorElement,"visibility","hidden")},show:function(){this._ensureCursorElement()&&pe.set(this.cursorElement,"visibility","")},move:function(t){return this._ensureCursorElement()&&(this.x=t.x,this.y=t.y,pe.set(this.cursorElement,{left:this.x-this.pointerOffsetX+"px",top:this.y-this.pointerOffsetY+"px"})),ue.resolve()},leftButtonDown:function(){return this._ensureCursorElement()&&(ce.removeClass(this.cursorElement,ge),ce.addClass(this.cursorElement,me)),ue.resolve()},rightButtonDown:function(){return this._ensureCursorElement()&&(ce.removeClass(this.cursorElement,ge),ce.addClass(this.cursorElement,ve)),ue.resolve()},buttonUp:function(){return this._ensureCursorElement()&&ce.removeClass(this.cursorElement,ge),ue.resolve()}},_e={move:function(t){var e={cmd:ee,x:t.x,y:t.y};return c.sendRequestToFrame(e,se,iu.parent)},leftButtonDown:function(){return c.sendRequestToFrame({cmd:ne},oe,iu.parent)},rightButtonDown:function(){return c.sendRequestToFrame({cmd:ie},ae,iu.parent)},buttonUp:function(){return c.sendRequestToFrame({cmd:re},le,iu.parent)}},Ce={screenshotMark:null,_createMark:function(){this.screenshotMark=ru.createElement("img"),u.shadowUI.addClass(this.screenshotMark,"screenshot-mark"),this.screenshotMark.style.right=25/iu.devicePixelRatio+"px",this.screenshotMark.style.width=32/iu.devicePixelRatio+"px",this.screenshotMark.style.height=10/iu.devicePixelRatio+"px",this.hide(),u.shadowUI.getRoot().appendChild(this.screenshotMark)},hide:function(){this.screenshotMark&&(this.screenshotMark.style.visibility="hidden")},show:function(t){this.screenshotMark||this._createMark(),u.nativeMethods.imageSrcSetter.call(this.screenshotMark,t),this.screenshotMark.style.visibility=""}},be=n.default.shadowUI,Ee=n.default.nativeMethods;function we(t){var e=t.tag,n=void 0===e?"div":e,i=t.class,r=t.src,s=t.text,o=t.type,a=t.value,l=ru.createElement(n);return o&&Ee.setAttribute.call(l,"type",o),a&&Ee.inputValueSetter.call(l,a),r&&Ee.setAttribute.call(l,"src",r),i&&be.addClass(l,i),s&&Ee.nodeTextContentSetter.call(l,s),l}var Se=i.default.styleUtils;function Te(t,e){for(var n in e)Se.set(t,n,e[n])}var xe={tag:"input",type:"button",value:"Pick",class:"pick-button"},Ie={tag:"input",type:"text",class:"selector-input"},Ae={class:"match-indicator",text:"No Matching Elements"},Me={class:"expand-selector-list"},Be={class:"selector-input-container"},Ne={tag:"input",type:"button",value:"Copy"},Ue={class:"selector-panel-toggle-button-container"},Re={tag:"input",type:"button",class:"selector-panel-toggle-button"},De={class:"selectors-list"},ke={tag:"span"},Ve={class:"selector-inspector-panel"},Oe={class:"selector-inspector-panel-container"},Pe={class:"element-frame"},Fe={class:"tooltip"},$e={class:"arrow"},Le={tag:"input",type:"text",class:"auxiliary-input"};function ze(t){var e;t.parentElement||(e=h.panelsContainer(),h.element().insertBefore(t,e))}function He(t){t.parentElement&&h.element().removeChild(t)}var We,je=iu["%testCafeCore%"],Ge=function(t,e){void 0===e&&(e=!1),this.type=t,this.editable=e,this.disabled=void 0},qe=(Q(Ye,We=Ge),Ye);function Ye(t){return We.call(this,t.toLowerCase(),!0)||this}var Xe={edited:"$edited$",byTagName:"$tagName$",byId:"id",byText:"$text$",byClassAttr:"class",byAttr:"$attr$",byTagTree:"$dom$"},Ke=[new Ge(Xe.byTagName),new Ge(Xe.byId),new Ge(Xe.byText),new Ge(Xe.byClassAttr),new Ge(Xe.byAttr),new Ge(Xe.byTagTree)],Je=Xe.byTagTree,Qe=Object.freeze({__proto__:null,CustomSelectorRule:qe,DEFAULT_SELECTOR_RULES:Ke,RULE_TYPE:Xe,SelectorRule:Ge,UNSWITCHABLE_RULE_TYPE:Je}),Ze=(tn.prototype.concat=function(t){return t.type===this.type?new tn(this.type,this.filter.concat(" ",t.filter)):null},tn);function tn(t,e){this.type=t,this.filter=e}var en="index",nn="tag",rn="attr",sn=je.domUtils,on=je.arrayUtils;function an(t,e){var n=sn.getElementIndexInParent(e,t),i=new Ze(nn,sn.getTagName(t));return 0===n?[i]:[i,new Ze(en,n)]}function ln(t,e){for(var n=t.parentElement,i=[];n;){if(n===e)return i;i.push(n),n=n.parentElement}return i}var un=je.domUtils,cn=je.arrayUtils,hn=(Object.defineProperty(dn.prototype,"isCustom",{get:function(){return this.ancestorSelectorDescriptor?this.isCustomRule||this.ancestorSelectorDescriptor.isCustomRule:this.isCustomRule},enumerable:!1,configurable:!0}),dn.prototype._getStringArrayRepresentation=function(){return function(t){for(var e=[],n=0,i=t;n<i.length;n++){var r,s=i[n];0===cn.indexOf(t,s)?e.push("Selector('".concat(s.filter,"')")):"text"===s.type?e.push(".withText('".concat(s.filter,"')")):s.type===en?e.push(".nth(".concat(s.filter,")")):s.type===nn?e.push(".find('".concat(s.filter,"')")):s.type===rn&&(r=s.filter.attrValueRe?", ".concat(s.filter.attrValueRe):"",e.push(".withAttribute('".concat(s.filter.attrName,"'").concat(r,")")))}return e}(this._concatFilterOptions())},dn.prototype._addFilterByIndex=function(t){var e;1<t.length&&0!==(e=cn.indexOf(t,this.element))&&this.filterOptions.push(new Ze(en,e))},dn.prototype._concatFilterOptions=function(){var t=this.ancestorSelectorDescriptor,e=[];t&&(e=t._concatFilterOptions()),this.cssSelector&&e.push(new Ze(nn,this.cssSelector));var n=cn.concat(e,this.filterOptions);return cn.reduce(n,function(t,e){if(e.type===nn&&t.length){var n=t[t.length-1];if(n.type===nn)return t[t.length-1]=n.concat(e),t}return t.push(e),t},[])},dn.prototype._getElements=function(){if(this.ruleType===Xe.byTagTree)return[this.element];var t=this.ancestorSelectorDescriptor?this.ancestorSelectorDescriptor.element:un.findDocument(this.element),e=null;if(this.cssSelector)try{var n=iu.eval("(function(){return '".concat(this.cssSelector,"';})();")),e=cn.from(t.querySelectorAll(n))}catch(t){return null}else e=[t];return 0===(e=e.length&&this.filter?this.filter(e):e).length||-1===cn.indexOf(e,this.element)?[]:e},dn.createFromInstance=function(t,e){return new dn({ancestorSelectorDescriptor:e,cssSelector:t.cssSelector,element:t.element,filter:t.filter,filterOptions:[].concat(t.filterOptions||[]),isCustomRule:t.isCustomRule,ruleType:t.ruleType})},dn.prototype.makeUnique=function(){var t=this.ancestorSelectorDescriptor,e=t?t._getElements():[],n=!t||e?this._getElements():null;n&&(t&&t._addFilterByIndex(e),this._addFilterByIndex(n),this.stringArray=this._getStringArrayRepresentation())},dn);function dn(t){this.ruleType=t.ruleType,this.isCustomRule=t.isCustomRule,this.element=t.element,this.ancestorSelectorDescriptor=t.ancestorSelectorDescriptor,this.cssSelector=t.cssSelector,this.filterOptions=cn.concat([],t.filterOptions||[]),this.filter=t.filter,this.stringArray=this._getStringArrayRepresentation()}var pn=(fn.prototype._init=function(){},fn.prototype._shouldCreate=function(){throw new Error("Not implemented")},fn.prototype._getDescriptor=function(){throw new Error("Not implemented")},fn.prototype.create=function(t,e){return this.element=t,this._init(),this._shouldCreate(e)?this._getDescriptor(e):null},fn);function fn(t){this.type=t,this.element=null}var mn,vn=je.domUtils,gn=/html|body/,yn=/header|footer|main/,_n=(Q(Cn,mn=pn),Cn.prototype._init=function(){this.tagName=vn.getTagName(this.element)},Cn.prototype._shouldCreate=function(){return this.useTopLevelParents&&gn.test(this.tagName)||yn.test(this.tagName)},Cn.prototype._getDescriptor=function(){return new hn({ruleType:this.type,element:this.element,cssSelector:this.tagName})},Cn);function Cn(t){void 0===t&&(t=!0);var e=mn.call(this,Xe.byTagName)||this;return e.tagName="",e.useTopLevelParents=t,e}function bn(t){return t.replace(/\\/g,"\\\\\\$&").replace(/'/g,"\\\\\\$&").replace(/(\!|#|"|\$|%|&|\(|\||\)|\*|\+|,|\.|\/|:|;|<|=|>|\?|@|\[|\]|\^|`|{|\||}|~)/g,"\\\\$&")}function En(t){return t.replace(/'|"|\\|\||\-|\*|\?|\+|\^|\$|\[|\]/g,"\\$&").replace(/\(|\)/g,"\\S")}var wn=iu["%hammerhead%"],Sn=/[\\^$*+?.()|[\]{}]/g,Tn=je.selectorAttributeFilter,xn=je.arrayUtils,In=wn.nativeMethods;function An(t){return"string"==typeof t?new RegExp(t.replace(Sn,"\\$&")):t}var Mn=je.domUtils,Bn=je.arrayUtils,Nn=/\$ctl\d+|ctl\d+\$|_ctl\d+|ctl\d+_|^ctl\d+$/g,Un="!!!!!separator!!!!!",Rn="!!!!!anyNumber!!!!!",Dn=new RegExp(Un,"g"),kn=new RegExp(Rn,"g"),Vn=/\s{2,}/g,On="class";function Pn(t,e,n,i,r){return new hn({ancestorSelectorDescriptor:r,cssSelector:n,element:e,filter:(o=(s=i).attrName,a=s.attrValueRe,function(t){return xn.filter(t,function(t){return Tn(t,0,void 0,An(o),An(a))})}),filterOptions:new Ze(rn,i),ruleType:t});var s,o,a}function Fn(t,e,n,i){var r=Mn.getTagName(e),s="",o=null;return Bn.forEach(n,function(t){var e=t.name,n=t.value,i=!1,r=!1;50<n.replace(Vn," ").length&&(n=n.substr(0,50),i=!0),Nn.test(n)&&(r=!0,n=n.replace(Nn,function(t){return t.replace(/\d+/,Rn)})),Vn.test(n)&&(r=!0,n=n.replace(Vn,Un)),r?o||(n=(n=En(n)).replace(kn,"\\d+").replace(Dn,"\\s+"),o={attrName:e,attrValueRe:new RegExp(n)}):(n=e===On?bn(n).trimEnd():n.replace(/\\/g,"\\\\\\$&").replace(/'/g,"\\\\\\$&").replace(/"/g,"\\\\$&"),s+=e!==On||i?"[".concat(e).concat(i?"^":"").concat(n?'="'.concat(n,'"'):"","]"):(" "+n).replace(/\s+/g,"."))}),o?Pn(t,e,s||r,o,i):new hn({ruleType:t,element:e,ancestorSelectorDescriptor:i,cssSelector:s})}var $n,Ln=je.domUtils,zn=/_ctl\d+|ctl\d+_|^ctl\d+$/g,Hn=(Q(Wn,$n=pn),Wn.prototype._init=function(){this.idAttr=this.element.getAttribute("id")},Wn.prototype._shouldCreate=function(){return!!this.idAttr},Wn.prototype._getDescriptor=function(){if(zn.test(this.idAttr)){var t=(t=En(this.idAttr)).replace(zn,function(t){return t.replace(/\d+/,"\\d+")}),e=Ln.getTagName(this.element),n={attrName:"id",attrValueRe:new RegExp(t)};return Pn(Xe.byId,this.element,e,n)}return new hn({ruleType:Xe.byId,element:this.element,cssSelector:"#"+bn(this.idAttr).replace(/\s/g,"\\\\ ")})},Wn);function Wn(){var t=$n.call(this,Xe.byId)||this;return t.idAttr=null,t}var jn=je.domUtils,Gn=wn.utils.trim,qn=wn.nativeMethods,Yn=/^i$|^b$|^big$|^small$|^em$|^strong$|^dfn$|^code$|^samp$|^kbd$|^var$|^cite$|^abbr$|^acronym$|^sub$|^sup$|span$|^bdo$|^address$|^div$|^a$|^object$|^p$|^h\d$|^pre$|^q$|^ins$|^del$|^dt$|^dd$|^li$|^label$|^option$|^fieldset$|^legend$|^button$|^caption$|^td$|^th$|^title$/,Xn=50,Kn=/['"\\]/g,Jn=/\r?\n|\r/i;function Qn(t){t=t.trim().replace(Kn,"\\$&");var e=Jn.exec(t),n=e?e.index:t.length;return Gn(t.substring(0,Math.min(n,Xn)))}var Zn,ti=je.domUtils,ei=(Q(ni,Zn=pn),ni.prototype._init=function(){this.elementText=function(t){var e=jn.isHtmlElement(t)?qn.htmlElementInnerTextGetter.call(t):t.innerText;if(e)return Qn(e);if(jn.isOptionElement(t)){var n=qn.nodeTextContentGetter.call(t);return n?Qn(n):""}return""}(this.element)},ni.prototype._shouldCreate=function(){return t=this.element,e=this.elementText,Yn.test(jn.getTagName(t))?(e=Gn(e.replace(/\s+/g," ")),/\S/.test(e)):"";var t,e},ni.prototype._getDescriptor=function(){return new hn({ruleType:this.type,element:this.element,cssSelector:ti.getTagName(this.element),filterOptions:new Ze("text",this.elementText),filter:(e=this.elementText,function(t){return xn.filter(t,function(t){return-1<(In.htmlElementInnerTextGetter.call(t)||In.nodeTextContentGetter.call(t)).indexOf(e)})})});var e},ni);function ni(){var t=Zn.call(this,Xe.byText)||this;return t.elementText="",t}var ii=je.domUtils,ri=je.arrayUtils,si=wn.nativeMethods,oi="%testcafe-stored-attributes%",ai=/(^alt$|^name$|^class$|^title$|^data-\S+)/,li=/^data-ga\S+/;function ui(t,e){void 0===e&&(e=[]);var n=t[oi];if(n)return ri.filter(n,function(t){return t.name!==On});for(var i,r=si.elementAttributesGetter.call(t),s=[],o=0;o<r.length;o++)(i=r[o]).nodeName!==On&&function(t,e){void 0===e&&(e=[]);var n=t.nodeName;return t.nodeValue&&ai.test(n)&&-1===ri.indexOf(e,n)&&!li.test(n)&&!ii.isHammerheadAttr(n)}(i,e)&&s.push({name:i.nodeName,value:i.nodeValue});return s}var ci,hi=(Q(di,ci=pn),di.prototype._init=function(){this.elementAttributes=ui(this.element,this.customAttrNames)},di.prototype._shouldCreate=function(){return!!this.elementAttributes.length},di.prototype._getDescriptor=function(){return Fn(this.type,this.element,this.elementAttributes)},di);function di(t){void 0===t&&(t=[]);var e=ci.call(this,Xe.byAttr)||this;return e.customAttrNames=t,e.elementAttributes=[],e}var pi,fi=(Q(mi,pi=pn),mi.prototype._init=function(){this.className=function(t,e){for(var n,i=t[oi]||si.elementAttributesGetter.call(t),r=0;r<i.length;r++)if((n=i[r]).name===e&&n.value)return n.value;return null}(this.element,On)},mi.prototype._shouldCreate=function(){return!!this.className},mi.prototype._getDescriptor=function(){return Fn(this.type,this.element,[{name:On,value:this.className}])},mi);function mi(){var t=pi.call(this,Xe.byClassAttr)||this;return t.className="",t}var vi,gi,yi=je.domUtils,_i=je.arrayUtils,Ci=(Q(bi,vi=pn),bi.prototype._shouldCreate=function(t){var e=t?t.element:yi.findDocument(this.element).body;return this.parents=ln(this.element,e),this.parents.push(e),this.parents.length},bi.prototype._getDescriptor=function(t){var e,n="",i=[];return e=this.element,/html|body/.test(sn.getTagName(e).toLowerCase())?i.push(new Ze(nn,yi.getTagName(this.element))):i=function(t,e){for(var n=on.reverse(an(t,e[0])),i=e.length,r=0;r<i-1;r++){var s=an(e[r],e[r+1]),o=s[0],a=s[1];a&&n.push(a),n.push(o)}return on.reverse(n)}(this.element,this.parents),t?new hn({ruleType:this.type,element:this.element,ancestorSelectorDescriptor:t,filterOptions:i}):(i.length&&(n=i[0].filter,_i.splice(i,0,1)),new hn({ruleType:this.type,element:this.element,cssSelector:n,filterOptions:i}))},bi);function bi(){var t=vi.call(this,Xe.byTagTree)||this;return t.parents=[],t}var Ei,wi=((gi={})[Xe.byTagName]=new _n,gi[Xe.byId]=new Hn,gi[Xe.byText]=new ei,gi[Xe.byClassAttr]=new fi,gi[Xe.byAttr]=new hi,gi[Xe.byTagTree]=new Ci,gi),Si=(Q(Ti,Ei=pn),Ti.prototype._init=function(){var t=function(t,e){var n=t["%testcafe-custom-stored-attributes%"];if(n){var i=ri.find(n,function(t){return t.name===e});return i||null}return t.hasAttribute(e)?{name:e,value:t.getAttribute(e)}:null}(this.element,this.attrName);this.elementAttributes=t?[t]:[]},Ti.prototype._shouldCreate=function(){return!!this.elementAttributes.length},Ti.prototype._getDescriptor=function(){var t=Fn(this.type,this.element,this.elementAttributes);return t.isCustomRule=!0,t},Ti);function Ti(t){var e=Ei.call(this,t)||this;return e.attrName=t,e.elementAttributes=[],e}var xi=je.arrayUtils,Ii=[Xe.byTagName,Xe.byId,Xe.byClassAttr,Xe.byAttr],Ai=[Xe.byText,Xe.byClassAttr,Xe.byAttr,Xe.byTagTree];function Mi(t){return t.isCustomRule||-1!==xi.indexOf(Ai,t.ruleType)&&t.ruleType!==Xe.byTagTree}function Bi(t){return t.editable||-1!==xi.indexOf(Ii,t.type)}var Ni=" > ";function Ui(t,e){return e?e+Ni+t:t}var Ri=1;function Di(t){for(var e,n={},i=Ri,r=0,s=t;r<s.length;r++){var o=s[r];if(n[o.type]=i++,Bi(o))for(var a=0,l=t;a<l.length;a++){var u=l[a];!(e=u).editable&&-1===xi.indexOf(Ai,e.type)||(n[Ui(u.type,o.type)]=i++)}}return n}var ki=je.domUtils,Vi=je.arrayUtils;function Oi(t,e,n){for(var i=[],r=0,s=e;r<s.length;r++){var o=s[r].create(t,n);o&&i.push(o)}return i}function Pi(t,e){for(var n=[],i=0,r=e;i<r.length;i++){var s=function(t,e){for(var n=0,i=t;n<i.length;n++){var r=i[n],s=e.create(r);if(s)return s}return null}(t,r[i]);s&&n.push(s)}return n}function Fi(t){for(var n=[],e=0,i=t;e<i.length;e++){var r=i[e],s=function(e){return function(t,e){for(var n=t.length,i=0;i<n;i++)if(e(t[i]))return i;return-1}(n,function(t){return Vi.join(t.stringArray,"")===Vi.join(e.stringArray,"")})}(r);-1===s?n.push(r):n[s].priority>r.priority&&Vi.splice(n,s,1,r)}return n}function $i(t){function e(t){return t&&t.ancestorSelectorDescriptor?t.ancestorSelectorDescriptor.ruleType:null}for(var n=Vi.filter(t,function(t){return!t.isCustom}),i=Vi.filter(n,function(t){return t.ancestorSelectorDescriptor}),r=i.length,s=10-(n.length-r),o=r-1;s<r;){for(var a=e(i[o]);e(i[o-1])===a&&(Vi.remove(t,i[o]),!(--r<=s));)o--;o--}}function Li(t){void 0===t&&(t=Ke),this.rules=Vi.filter(t,function(t){return!t.disabled});var e=Li._processRules(this.rules),n=e.customRules,i=e.defaultRules;this.customRules=n,this.defaultRules=i,this.customAttrNames=[],this.customSelectorCreators=[],this.elementSelectorCreators=[],this.ancestorSelectorCreators=[],this._createCustomSelectorCreators(),this._createElementSelectorCreators(),this._createAncestorSelectorCreators(),this.rulePriority=Di(this.rules)}var zi=(Li._priorityComparator=function(t,e){return t.priority-e.priority},Li._getSelectorType=function(t){var e=t.ancestorSelectorDescriptor,n=e?e.ruleType:"";return Ui(t.ruleType,n)},Li._processRules=function(t){var e=[],n=[];return Vi.filter(t,function(t){t.editable?n.push(t):e.push(t)}),{customRules:n,defaultRules:e}},Li.prototype._createCustomSelectorCreators=function(){var e=this;Vi.forEach(this.customRules,function(t){e.customAttrNames.push(t.type),e.customSelectorCreators.push(new Si(t.type))})},Li.prototype._createElementSelectorCreators=function(){var n=this,i=[];Vi.forEach(this.defaultRules,function(t){var e=t.type===Xe.byAttr?new hi(n.customAttrNames):wi[t.type];i.push(e)}),this.elementSelectorCreators=Vi.concat(i,this.customSelectorCreators)},Li.prototype._createAncestorSelectorCreators=function(){for(var t=0,e=this.customRules;t<e.length;t++){var n=e[t];this.ancestorSelectorCreators.push(new Si(n.type))}for(var i=0,r=this.defaultRules;i<r.length;i++)Bi(n=r[i])&&(n.type===Xe.byTagName?this.ancestorSelectorCreators.push(new _n(!1)):this.ancestorSelectorCreators.push(wi[n.type]))},Li.prototype._generateCompoundSelectorDescriptor=function(t,e,n){for(var i=Vi.filter(n,Mi),r=[],s=null,o=null,a=0,l=Pi(e,this.ancestorSelectorCreators);a<l.length;a++){for(var u=l[a],c=0,h=i;c<h.length;c++){var d=h[c],o=hn.createFromInstance(u),s=hn.createFromInstance(d,o);r.push(s)}o=hn.createFromInstance(u),s=Oi(t,[wi[Xe.byTagTree]],u),r=Vi.concat(r,s)}return r},Li.prototype._cleanAndSortDescriptors=function(t){for(var e=[],n=0,i=t;n<i.length;n++){var r=i[n];r.makeUnique();var s=Li._getSelectorType(r),o=this.rulePriority[s];null!==o&&(r.priority=o,e.push(r))}return $i(e=(e=Fi(e)).sort(Li._priorityComparator)),e},Li.prototype._generateDescriptors=function(t){var e=Oi(t,this.elementSelectorCreators),n=ln(t,ki.findDocument(t).body),i=this._generateCompoundSelectorDescriptor(t,n,e),r=Vi.concat(e,i);return this._cleanAndSortDescriptors(r)},Li.prototype.generate=function(t){var e=this._generateDescriptors(t);return Vi.map(e,function(t){var e=t.stringArray,n=t.ruleType,i=t.ancestorSelectorDescriptor,r={value:Vi.join(e,""),rules:[n]};return i&&r.rules.push(i.ruleType),r})},Li.RULES=Qe,new Li);function Hi(){this.targets=new Map}var Wi=(Hi.prototype._remove=function(t,e){this.targets.delete(t),He(e)},Hi.prototype._setPosition=function(t,e){for(var n,i,r,s=(n=t.getBoundingClientRect(),i=iu.pageYOffset||ru.documentElement.scrollTop,r=iu.pageXOffset||ru.documentElement.scrollLeft,{top:n.top+i,left:n.left+r,height:n.height,width:n.width,bottom:n.bottom+i,right:n.right+r}),o={},a=0,l=["top","left","width","height"];a<l.length;a++){var u=l[a];o[u]=s[u]+"px"}Te(e,o)},Hi.prototype.highlight=function(t){var e;t&&!this.targets.has(t)&&(e=we(Pe),this.targets.set(t,e),this._setPosition(t,e),ze(e))},Hi.prototype.stopHighlighting=function(){var n=this;this.targets.forEach(function(t,e){return n._remove(e,t)})},new Hi),ji=n.default.nativeMethods;function Gi(){this._createElements()}var qi,Yi=(Gi.prototype._createElements=function(){this.tooltip=we(Fe),this.arrow=we($e)},Gi.prototype._setTooltipText=function(t){ji.nodeTextContentSetter.call(this.tooltip,t)},Gi.prototype._getTooltipLeft=function(t,e,n,i){return n<=t?i:n-e<=t?n+i-t:e+i},Gi.prototype._getArrowLeft=function(t,e,n,i){return n-e<=t+12?n+i-t:e+i+12},Gi.prototype._getVerticalPostionStyles=function(t,e,n,i){var r={},s={},o=ru.documentElement.scrollTop,a=t.height+e.height;return n.top>=a?(r.top=n.top+o-a+"px",s.top=n.top+o-e.height+"px",s.transform="none",s.visibility="visible"):i.height-n.bottom>=a?(r.top=n.bottom+o+e.height+"px",s.top=n.bottom+o+"px",s.transform="rotate(180deg)",s.visibility="visible"):(r.top=i.height+o-t.height+"px",s.top=o+"px",s.transform="node",s.visibility="hidden"),{tooltip:r,arrow:s}},Gi.prototype._getElementsStyles=function(t){var e=this.tooltip.getBoundingClientRect(),n=this.arrow.getBoundingClientRect(),i=t.getBoundingClientRect(),r={width:ru.documentElement.clientWidth,height:ru.documentElement.clientHeight},s=this._getVerticalPostionStyles(e,n,i,r),o=ru.documentElement.scrollLeft;return s.tooltip.left=this._getTooltipLeft(e.width,i.left,r.width,o)+"px",s.arrow.left=this._getArrowLeft(n.width,i.left,r.width,o)+"px",s},Gi.prototype._placeElements=function(t){var e=this._getElementsStyles(t);Te(this.tooltip,e.tooltip),Te(this.arrow,e.arrow)},Gi.prototype.show=function(t,e){this._setTooltipText(t),this._placeElements(e),ze(this.tooltip),ze(this.arrow)},Gi.prototype.hide=function(){He(this.tooltip),He(this.arrow)},new Gi),Xi=n.default.eventSandbox.listeners,Ki=i.default.styleUtils,Ji=i.default.serviceUtils,Qi="element-piked";function Zi(){var t=qi.call(this)||this;return t.hiddenTestCafeElements=new Map,t.handlers={onClick:t._getClickHandler(),onMouseMove:t._getMouseMoveHandler()},t}var tr=(Q(Zi,qi=Ji.EventEmitter),Zi.prototype._hideTestCafeElements=function(){for(var t=0,e=h.element().children;t<e.length;t++){var n=e[t],i=Ki.get(n,"visibility");this.hiddenTestCafeElements.set(n,i),Ki.set(n,"visibility","hidden")}},Zi.prototype._showTestCafeElements=function(){this.hiddenTestCafeElements.forEach(function(t,e){Ki.set(e,"visibility",t)}),this.hiddenTestCafeElements.clear()},Zi.prototype._getClickHandler=function(){var t=this;return function(){t._showTestCafeElements(),Xi.removeInternalEventBeforeListener(iu,["mousemove"],t.handlers.onMouseMove),Xi.removeInternalEventBeforeListener(iu,["click"],t.handlers.onClick),t.emit(Qi,t.actualSelectors),Yi.hide()}},Zi.prototype