testcafe 1.18.3 → 1.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/lib/browser/provider/built-in/dedicated/chrome/cdp-client/automations/click/create-mouse-click-strategy.js +59 -0
- package/lib/browser/provider/built-in/dedicated/chrome/cdp-client/shared-adapter-initializer.js +15 -1
- package/lib/browser/provider/built-in/dedicated/chrome/cdp-client/utils/dom-utils.js +94 -3
- package/lib/browser/provider/built-in/dedicated/chrome/cdp-client/utils/position-utils.js +38 -7
- package/lib/browser/provider/built-in/dedicated/chrome/cdp-client/utils/style-utils.js +8 -15
- package/lib/client/automation/index.js +1699 -1380
- package/lib/client/automation/index.min.js +1 -1
- package/lib/client/core/index.js +33 -4
- package/lib/client/core/index.min.js +1 -1
- package/lib/client/core/scroll/index.js +2 -2
- package/lib/client/core/utils/shared/position.js +2 -2
- package/lib/client/driver/index.js +143 -94
- package/lib/client/driver/index.min.js +1 -1
- package/lib/client/proxyless/index.js +5 -3
- package/lib/shared/actions/action-executor.js +4 -4
- package/lib/shared/actions/automations/click/index.js +53 -0
- package/lib/shared/actions/automations/click/mouse-click-strategy-base.js +21 -0
- package/lib/shared/actions/automations/move.js +4 -4
- package/lib/shared/actions/automations/visible-element-automation.js +162 -0
- package/lib/shared/actions/get-element.js +68 -0
- package/lib/shared/actions/utils/is-window-iframe.js +8 -0
- package/lib/shared/actions/utils/offsets.js +33 -0
- package/lib/shared/actions/utils/screen-point-to-client.js +15 -0
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
window["%hammerhead%"].utils.removeInjectedScript(),function cu(hu){var fu=hu.document;!function(e,g,i,u){var m="default"in e?e.default:e,y="default"in g?g.default:g;i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i,u=u&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u;var c={},o=y.positionUtils,r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function h(e,s,l,a){return new(l=l||u)(function(n,t){function i(e){try{r(a.next(e))}catch(e){t(e)}}function o(e){try{r(a.throw(e))}catch(e){t(e)}}function r(e){var t;e.done?n(e.value):((t=e.value)instanceof l?t:new l(function(e){e(t)})).then(i,o)}r((a=a.apply(e,s||[])).next())})}function S(n,i){var o,r,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,r&&(s=2&t[0]?r.return:t[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,t[1])).done)return s;switch(r=0,s&&(t=[2&t[0],s.value]),t[0]){case 0:case 1:s=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,r=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){l.label=t[1];break}if(6===t[0]&&l.label<s[1]){l.label=s[1],s=t;break}if(s&&l.label<s[2]){l.label=s[2],l.ops.push(t);break}s[2]&&l.ops.pop(),l.trys.pop();continue}t=i.call(n,l)}catch(e){t=[6,e],r=0}finally{o=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}var f=m.utils.browser,n=(s.prototype.setup=function(){this.dragAndDropMode=!1,this.dropAllowed=!1},s.prototype.leaveElement=function(){},s.prototype.move=function(){},s.prototype.enterElement=function(){},s.prototype.dragAndDrop=function(){},s.prototype.teardown=function(){},s.prototype.run=function(e,t,n,i,o){var r=t&&g.domUtils.isElementInDocument(t),s=t&&g.domUtils.isElementInIframe(t)&&!g.domUtils.getIframeByElement(t);r&&!s||(t=null);var l=e!==t,a=l?g.domUtils.getCommonAncestor(e,t):null;this.setup(),l&&t&&this.leaveElement(e,t,a,n),f.isIE&&this.move(e,n),l&&g.domUtils.isElementInDocument(e)&&this.enterElement(e,t,a,n),f.isIE||this.move(e,n),this.dragAndDrop(i,e,t,n,o),this.teardown(e,n,t);var u=this.dragAndDropMode,c=this.dropAllowed;return this.dragAndDropMode=!1,this.dropAllowed=!1,{dragAndDropMode:u,dropAllowed:c}},s);function s(e){var t=e.moveEvent;this.dragAndDropMode=!1,this.dropAllowed=!1,this.moveEvent=t}var l=m.eventSandbox.eventSimulator,a=m.utils.extend,d=m.nativeMethods,p=(v.leaveElement=function(e,t,n,i){l.mouseout(t,a({relatedTarget:e},i));for(var o=t;o&&o!==n;)l.mouseleave(o,a({relatedTarget:e},i)),o=d.nodeParentNodeGetter.call(o)},v.enterElement=function(e,t,n,i){l.mouseover(e,a({relatedTarget:t},i));for(var o=e,r=[];o&&o!==n;)r.push(o),o=g.domUtils.getParentExceptShadowRoot(o);for(var s=r.length-1;-1<s;s--)l.mouseenter(r[s],a({relatedTarget:t},i))},v.move=function(e,t,n){l[e](t,n)},v);function v(){}var E=(b.dragAndDrop=function(e,t,n,i){return l.drag(e,i),t!==n&&(g.domUtils.isElementInDocument(t)&&(i.relatedTarget=n,l.dragenter(t,i)),n&&(i.relatedTarget=t,l.dragleave(n,i))),!l.dragover(t,i)},b);function b(){}var _,w=m.eventSandbox.eventSimulator,P=(t(C,_=n),C.prototype.leaveElement=function(e,t,n,i){p.leaveElement(e,t,n,i)},C.prototype.enterElement=function(e,t,n,i){p.enterElement(e,t,n,i)},C.prototype.move=function(e,t){this._needEmulateMoveEvent()&&p.move(this.moveEvent,e,t)},C.prototype.teardown=function(e,t,n){this._needEmulateMoveEvent()&&g.domUtils.isElementInDocument(e)&&e!==n&&w[this.moveEvent](e,t)},C.prototype._needEmulateMoveEvent=function(){return"touchmove"!==this.moveEvent||this.holdLeftButton},C);function C(e){var t=_.call(this,e)||this;return t.holdLeftButton=e.holdLeftButton,t}var A,x=(t(T,A=n),T.prototype.setup=function(){A.prototype.setup.call(this),this.dragAndDropMode=!0},T.prototype.dragAndDrop=function(e,t,n,i){this.dropAllowed=E.dragAndDrop(e,t,n,i)},T);function T(){return null!==A&&A.apply(this,arguments)||this}var U,M=m.eventSandbox.eventSimulator,D=(t(I,U=n),I.prototype.setup=function(){U.prototype.setup.call(this),this.dragAndDropMode=!0},I.prototype.leaveElement=function(e,t,n,i){p.leaveElement(e,t,n,i)},I.prototype.move=function(e,t){p.move(this.moveEvent,e,t)},I.prototype.enterElement=function(e,t,n,i){p.enterElement(e,t,n,i)},I.prototype.dragAndDrop=function(e,t,n,i,o){var r=M.dragstart(e,i);o.setReadOnlyMode(),r?this.dropAllowed=E.dragAndDrop(e,t,n,i):this.dragAndDropMode=!1},I.prototype.run=function(e,t,n,i,o){return U.prototype.run.call(this,e,null,n,i,o)},I);function I(){return null!==U&&U.apply(this,arguments)||this}function k(e,t,n){return new(e?t?x:D:P)(n)}var B=m.nativeMethods,O=m.Promise,N=m.utils,F=N.browser,K=N.featureDetection,Y=y.domUtils,L=y.positionUtils,V=y.ScrollAutomation;!function(e){for(var t=0,n=Object.keys(e);t<n.length;t++){var i=n[t];c[i]=e[i]}}({PromiseCtor:O,nativeMethods:B,scroll:function(e,t){return new V(e,t).run()},getElementExceptUI:function(t,n){return void 0===n&&(n=!1),i.hide(n).then(function(){var e=o.getElementFromPoint(t.x,t.y);return i.show(n).then(function(){return e})})},dom:Y,position:L,style:y.styleUtils,event:y.eventUtils,browser:F,featureDetection:K,createEventSequence:k,sendRequestToFrame:y.sendRequestToFrame});var X=m.nativeMethods,R=/^((mouse\w+)|((dbl)?click)|(contextmenu))$/,W=/^((drag\w*)|(drop))$/,H=/^key\w+$/,G=/^(before)?input$/,q=/^(blur|(focus(in|out)?))$/,z=/^pointer\w+/,j={click:1,dblclick:2,mousedown:1,mouseup:1},$="MouseEvent",Z="PointerEvent",J="KeyboardEvent",Q="InputEvent",ee="FocusEvent",te=(ne.prototype.run=function(){var e=this.options,t=e.bubbles,n=e.cancelable,i=e.detail,o=(e.view,e.buttons),t=!1!==t,n=!1!==n,i=i||j[this.eventName],o=void 0===o?1:o;Object.assign(this.options,{bubbles:t,cancelable:n,detail:i,view:hu,buttons:o});var r,s=ne._getEventCtorByEventType(this.eventName,this.options.eventConstructor);s&&(r=new s(this.eventName,this.options),this.element.dispatchEvent(r))},ne._getEventCtorByEventType=function(e,t){if(t&&"function"==typeof ne._getEventCtorFromWindow(t)){var n=ne._getEventCtorFromNativeMethods(t);if(n&&"function"==typeof n)return n}return R.test(e)||W.test(e)?ne._getEventCtorFromNativeMethods($):z.test(e)?ne._getEventCtorFromNativeMethods(Z):H.test(e)?ne._getEventCtorFromNativeMethods(J):G.test(e)?ne._getEventCtorFromNativeMethods(Q):q.test(e)?ne._getEventCtorFromNativeMethods(ee):ne._getEventCtorFromNativeMethods("CustomEvent")},ne._getEventCtorFromNativeMethods=function(e){return X["Window"+e]||ne._getEventCtorFromWindow(e)},ne._getEventCtorFromWindow=function(e){return hu[e]},ne);function ne(e,t,n){this.element=e,this.eventName=t,this.options=n}var ie=m.utils.browser;function oe(e,t,n){var i=ie.isFirefox?Math.ceil:Math.round,o=g.positionUtils.getOffsetPosition(e,i);return{x:(e===fu.documentElement?0:o.left)+t,y:(e===fu.documentElement?0:o.top)+n}}function re(e){if(!e)return null;var t=hu.screenLeft||hu.screenX,n=hu.screenTop||hu.screenY;return{x:t+e.x,y:n+e.y}}function se(e){var t=e/2;return t<1?0:Math.round(t)}function le(e){var t=g.positionUtils.getElementRectangle(e);return{offsetX:se(t.width),offsetY:se(t.height)}}function ae(e,t,n){var i=le(e);if(t="number"==typeof t?Math.round(t):i.offsetX,n="number"==typeof n?Math.round(n):i.offsetY,0<t&&0<n)return{offsetX:t,offsetY:n};var o=g.positionUtils.getClientDimensions(e),r=Math.round(Math.max(e.scrollWidth,o.width)),s=Math.round(Math.max(e.scrollHeight,o.height)),l=o.scrollbar.right+o.border.left+o.border.right+r,a=o.scrollbar.bottom+o.border.top+o.border.bottom+s;return{offsetX:t<0?l+t:t,offsetY:n<0?a+n:n}}function ue(e){return e.top!==e}var ce=m.utils.browser,he=m.Promise,fe=m.nativeMethods,de=y.positionUtils,me=y.domUtils;function pe(e,t){var n=null;return i.hide(t).then(function(){return n=de.getElementFromPoint(e.x,e.y),i.show(t)}).then(function(){return n})}function ve(e,t,n){var i=de.getElementFromPoint(e,t),o=me.containsElement(n,i)&&fe.nodeTextContentGetter.call(i).length;return i&&i===n||o?i:null}function ge(e,t){if(!t||!me.isDomElement(t)||!e||e===t)return e;if("tref"===me.getTagName(t))return t;var n,i,o,r="area"===me.getTagName(t)&&me.isImgElement(e);if(ce.isFirefox&&r)return n=e,i=t,(o=me.closest(i,"map"))&&o.name===n.useMap.substring(1)?i:n;var s=me.isAnchorElement(t)||me.getParents(t,"a").length,l=s&&me.containsElement(t,e)&&fe.nodeTextContentGetter.call(e).length;if(!s||l||!fe.nodeTextContentGetter.call(t).length)return e;var a=t.getBoundingClientRect();return ve(a.right-1,a.top+1,t)||ve(a.left+1,a.bottom-1,t)||e}function Ee(i,o){return pe(i).then(function(e){var t=e,n=he.resolve(e);return!t&&ue(hu)&&0<i.x&&0<i.y&&(n=n.then(function(){return pe(i,!0)}).then(function(e){return e})),n.then(function(e){return ge(e,o)})})}var ye={elementIsInvisibleError:"elementIsInvisibleError",foundElementIsNotTarget:"foundElementIsNotTarget"},Se=(Object.defineProperty(be.prototype,"mouseActionStepDelay",{get:function(){return 1===this._speedFactor?10:400*(1-this._speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(be.prototype,"keyActionStepDelay",{get:function(){return 1===this._speedFactor?10:200*(1-this._speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(be.prototype,"cursorSpeed",{get:function(){return Math.pow(400,this._speedFactor)/4},enumerable:!1,configurable:!0}),Object.defineProperty(be.prototype,"draggingSpeed",{get:function(){return Math.pow(16,this._speedFactor)/4},enumerable:!1,configurable:!0}),be);function be(e){this._speedFactor=e||1}var _e=(we.prototype._getAssignableProperties=function(){throw new Error("Not implemented")},we.prototype._assignFrom=function(e,t,n){if(void 0===n&&(n={}),e)for(var i=this._getAssignableProperties(),o=0;o<i.length;o++){for(var r,s=i[o],l=s.name,a=s.type,u=s.required,c=s.init,h=s.defaultValue,f=l.split("."),d=f.length-1,m=f[d],p=e,v=this,g=0;g<d&&p&&v;g++)p=p[f[g]],v=v[f[g]];v&&"defaultValue"in i[o]&&(v[l]=h),p&&v&&(void 0===(r=p[m])&&!u||(t&&a&&a(l,r),v[m]=c?c(l,r,n,t):r))}},we);function we(){}function Pe(i){return function(e,t){var n=typeof t;if("number"!=n)throw new i(e,n);if(isNaN(t)||!isFinite(t)||t!==Math.floor(t))throw new i(e,t)}}function Ce(e,t){this.code=e,this.isTestCafeError=!0,this.callsite=t||null}var Ae,xe,Te,Ue="E1",Me="E4",De="E5",Ie="E9",ke="E10",Be="E11",Oe="E12",Ne="E24",Fe="E26",Ke="E27",Ye="E28",Le="E29",Ve="E30",Xe="E31",Re="E32",We="E33",He="E34",Ge="E35",qe="E36",ze="E37",je="E39",$e="E40",Ze="E41",Je="E42",Qe="E43",et="E44",tt="E45",nt="E46",it="E49",ot="E50",rt="E51",st="E52",lt="E57",at="E64",ut="E65",ct="E68",ht="E69",ft="E70",dt="E71",mt="E72",pt="E73",vt="E74",gt="E76",Et="E77",yt="E78",St="E82",bt="E83",_t=(t(wt,Ae=Ce),wt);function wt(e,t,n){var i=Ae.call(this,e)||this;return i.optionName=t,i.actualValue=n,i}function Pt(e,t){var n=xe.call(this,it,t)||this;return n.instantiationCallsiteName=e,n}function Ct(e,t){var n=Te.call(this,ot,t)||this;return n.instantiationCallsiteName=e,n}t(Pt,xe=Ce),t(Ct,Te=Ce);var At,xt,Tt,Ut,Mt,Dt,It,kt,Bt=(t(Ot,At=Ce),Ot);function Ot(e,t,n){var i=t.apiFnChain,o=t.apiFnIndex,r=At.call(this,e,n)||this;return r.apiFnChain=i,r.apiFnIndex=o,r}function Nt(e){return xt.call(this,rt,e)||this}function Ft(e,t){return Tt.call(this,st,t,e)||this}function Kt(e,t){var n=Ut.call(this,Ue)||this;return n.errStack=e,n.pageDestUrl=t,n}function Yt(e,t,n){var i=Mt.call(this,Me,n)||this;return i.errMsg=String(t),i.instantiationCallsiteName=e,i}function Lt(e,t,n,i){var o=Dt.call(this,De,i)||this;return o.errMsg=String(t),o.property=n,o.instantiationCallsiteName=e,o}function Vt(e){var t=It.call(this,at)||this;return t.errMsg=String(e),t}function Xt(e,t){var n=kt.call(this,ut)||this;return n.errMsg=String(e),n.moduleName=t,n}t(Nt,xt=Ce),t(Ft,Tt=Bt),t(Kt,Ut=Ce),t(Yt,Mt=Ce),t(Lt,Dt=Ce),t(Vt,It=Ce),t(Xt,kt=Ce);var Rt,Wt=(t(Ht,Rt=_t),Ht);function Ht(e,t){return Rt.call(this,Ie,e,t)||this}var Gt,qt=(t(zt,Gt=_t),zt);function zt(e,t){return Gt.call(this,ke,e,t)||this}var jt,$t=(t(Zt,jt=_t),Zt);function Zt(e,t){return jt.call(this,Be,e,t)||this}var Jt,Qt,en,tn,nn,on,rn,sn,ln,an,un,cn,hn,fn,dn,mn,pn,vn,gn,En,yn,Sn,bn,_n,wn,Pn,Cn,An,xn,Tn,Un,Mn,Dn,In,kn,Bn=(t(On,Jt=_t),On);function On(e,t){return Jt.call(this,Oe,e,t)||this}function Nn(e,t){return Qt.call(this,Ne,t,e)||this}function Fn(e){return en.call(this,Fe,e)||this}function Kn(e){var t=tn.call(this,Ke)||this;return t.nodeDescription=e,t}function Yn(e,t){var n=nn.call(this,Ye,t)||this;return n.argumentName=e,n}function Ln(e){var t=on.call(this,Le)||this;return t.argumentName=e,t}function Vn(e,t){var n=rn.call(this,Ve)||this;return n.argumentName=e,n.nodeDescription=t,n}function Xn(){return sn.call(this,Xe)||this}function Rn(){return ln.call(this,Re)||this}function Wn(e){var t=an.call(this,We)||this;return t.argumentName=e,t}function Hn(){return un.call(this,Ge)||this}function Gn(e){var t=cn.call(this,qe)||this;return t.argumentName=e,t}function qn(e,t){var n=hn.call(this,ze)||this;return n.filePaths=e,n.scannedFilePaths=t,n}function zn(){return fn.call(this,He)||this}function jn(e,t){var n=dn.call(this,Ze)||this;return n.properties=e?"scrollTargetY property":t?"scrollTargetX property":"scrollTargetX and scrollTargetY properties",n}function $n(e,t){var n=mn.call(this,lt)||this;return e<=0?t<=0?(n.verb="are",n.dimensions="width and height"):(n.verb="is",n.dimensions="width"):(n.verb="is",n.dimensions="height"),n}function Zn(e){return pn.call(this,$e,e)||this}function Jn(){return vn.call(this,je)||this}function Qn(){return gn.call(this,Je)||this}function ei(){return En.call(this,ht)||this}function ti(){return yn.call(this,ct)||this}function ni(){return Sn.call(this,ft)||this}function ii(){return bn.call(this,dt)||this}function oi(){return _n.call(this,pt)||this}function ri(){return wn.call(this,St)||this}function si(e){var t=Pn.call(this,yt)||this;return t.errMsg=e,t}function li(){return Cn.call(this,vt)||this}function ai(){return An.call(this,gt)||this}function ui(){return xn.call(this,Et)||this}function ci(){return Tn.call(this,mt)||this}function hi(){return Un.call(this,bt)||this}function fi(){return Mn.call(this,Qe)||this}function di(){return Dn.call(this,et)||this}function mi(e,t){var n=In.call(this,tt)||this;return n.dialogType=e,n.pageUrl=t,n}function pi(e,t,n){var i=kn.call(this,nt)||this;return i.dialogType=e,i.errMsg=t,i.pageUrl=n,i}t(Nn,Qt=Bt),t(Fn,en=Ce),t(Kn,tn=Ce),t(Yn,nn=Bt),t(Ln,on=Ce),t(Vn,rn=Ce),t(Xn,sn=Ce),t(Rn,ln=Ce),t(Wn,an=Ce),t(Hn,un=Ce),t(Gn,cn=Ce),t(qn,hn=Ce),t(zn,fn=Ce),t(jn,dn=Ce),t($n,mn=Ce),t(Zn,pn=Ce),t(Jn,vn=Ce),t(Qn,gn=Ce),t(ei,En=Ce),t(ti,yn=Ce),t(ni,Sn=Ce),t(ii,bn=Ce),t(oi,_n=Ce),t(ri,wn=Ce),t(si,Pn=Ce),t(li,Cn=Ce),t(ai,An=Ce),t(ui,xn=Ce),t(ci,Tn=Ce),t(hi,Un=Ce),t(fi,Mn=Ce),t(di,Dn=Ce),t(mi,In=Ce),t(pi,kn=Ce);var vi,gi,Ei,yi,Si,bi=Pe(Wt),_i=(gi=Pe(vi=qt),function(e,t){if(gi(e,t),t<0)throw new vi(e,t)}),wi=(Ei=$t,function(e,t){var n=typeof t;if("boolean"!=n)throw new Ei(e,n)}),Pi=(yi=Bn,function(e,t){var n=typeof t;if("number"!=n)throw new yi(e,n);if(isNaN(t)||t<.01||1<t)throw new yi(e,t)}),Ci=(t(Ai,Si=_e),Ai.prototype._getAssignableProperties=function(){return[{name:"speed",type:Pi}]},Ai);function Ai(e,t){var n=Si.call(this)||this;return n.speed=null,n._assignFrom(e,t),n}var xi,Ti=(t(Ui,xi=Ci),Ui.prototype._getAssignableProperties=function(){return xi.prototype._getAssignableProperties.call(this).concat([{name:"offsetX",type:bi},{name:"offsetY",type:bi}])},Ui);function Ui(e,t){var n=xi.call(this)||this;return n.offsetX=null,n.offsetY=null,n._assignFrom(e,t),n}var Mi,Di,Ii=(t(ki,Mi=Ti),ki.prototype._getAssignableProperties=function(){return Mi.prototype._getAssignableProperties.call(this).concat([{name:"scrollToCenter",type:wi},{name:"skipParentFrames",type:wi}])},ki);function ki(e,t){var n=Mi.call(this)||this;return n.scrollToCenter=!1,n.skipParentFrames=!1,n._assignFrom(e,t),n}function Bi(e,t){var n=Di.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(e,t),n}t(Bi,Di=Ci),Bi.prototype._getAssignableProperties=function(){return Di.prototype._getAssignableProperties.call(this).concat([{name:"scrollTargetX",type:bi},{name:"scrollTargetY",type:bi},{name:"crop.left",type:bi},{name:"crop.right",type:bi},{name:"crop.top",type:bi},{name:"crop.bottom",type:bi},{name:"includeMargins",type:wi},{name:"includeBorders",type:wi},{name:"includePaddings",type:wi}])};var Oi,Ni=(t(Fi,Oi=Ti),Fi.prototype._getAssignableProperties=function(){return Oi.prototype._getAssignableProperties.call(this).concat([{name:"modifiers.ctrl",type:wi},{name:"modifiers.alt",type:wi},{name:"modifiers.shift",type:wi},{name:"modifiers.meta",type:wi}])},Fi);function Fi(e,t){var n=Oi.call(this)||this;return n.modifiers={ctrl:!1,alt:!1,shift:!1,meta:!1},n._assignFrom(e,t),n}var Ki,Yi=(t(Li,Ki=Ni),Li.prototype._getAssignableProperties=function(){return Ki.prototype._getAssignableProperties.call(this).concat([{name:"caretPos",type:_i}])},Li);function Li(e,t){var n=Ki.call(this)||this;return n.caretPos=null,n._assignFrom(e,t),n}var Vi,Xi=(t(Ri,Vi=Ni),Ri.prototype._getAssignableProperties=function(){return Vi.prototype._getAssignableProperties.call(this).concat([{name:"speed"},{name:"minMovingTime"},{name:"holdLeftButton"},{name:"skipScrolling",type:wi},{name:"skipDefaultDragBehavior",type:wi}])},Ri);function Ri(e,t){var n=Vi.call(this)||this;return n.speed=null,n.minMovingTime=null,n.holdLeftButton=!1,n.skipScrolling=!1,n.skipDefaultDragBehavior=!1,n._assignFrom(e,t),n}var Wi,Hi,Gi,qi,zi,ji=(t($i,Wi=Yi),$i.prototype._getAssignableProperties=function(){return Wi.prototype._getAssignableProperties.call(this).concat([{name:"replace",type:wi},{name:"paste",type:wi},{name:"confidential",type:wi}])},$i);function $i(e,t){var n=Wi.call(this)||this;return n.replace=!1,n.paste=!1,n.confidential=void 0,n._assignFrom(e,t),n}function Zi(e,t){var n=Hi.call(this,e,t)||this;return n.destinationOffsetX=null,n.destinationOffsetY=null,n._assignFrom(e,t),n}function Ji(e,t){var n=Gi.call(this)||this;return n.portraitOrientation=!1,n._assignFrom(e,t),n}function Qi(e,t){var n=qi.call(this)||this;return n.timeout=void 0,n.allowUnawaitedPromise=!1,n._assignFrom(e,t),n}function eo(e,t){var n=zi.call(this)||this;return n.confidential=void 0,n._assignFrom(e,t),n}t(Zi,Hi=Ni),Zi.prototype._getAssignableProperties=function(){return Hi.prototype._getAssignableProperties.call(this).concat([{name:"destinationOffsetX",type:bi},{name:"destinationOffsetY",type:bi}])},t(Ji,Gi=_e),Ji.prototype._getAssignableProperties=function(){return[{name:"portraitOrientation",type:wi}]},t(Qi,qi=_e),Qi.prototype._getAssignableProperties=function(){return[{name:"timeout",type:_i},{name:"allowUnawaitedPromise",type:wi}]},t(eo,zi=Ci),eo.prototype._getAssignableProperties=function(){return zi.prototype._getAssignableProperties.call(this).concat([{name:"confidential",type:wi}])};var to=(no.create=function(e){return"left"in e?new no(e.left,e.top):"right"in e?new no(e.right,e.bottom):new no(e.x,e.y)},no.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},no.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},no.prototype.round=function(e){return void 0===e&&(e=Math.round),this.x=e(this.x),this.y=e(this.y),this},no.prototype.eql=function(e){return this.x===e.x&&this.y===e.y},no.prototype.mul=function(e){return this.x*=e,this.y*=e,this},no.prototype.distance=function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))},no);function no(e,t){this.x=e,this.y=t}var io=(oo.prototype._ensureActiveWindow=function(e){this._activeWindow!==e&&this._activeWindow!==e.parent&&this._activeWindow.parent!==e&&(this._activeWindow=e)},oo.prototype.isActive=function(e){return this._ensureActiveWindow(e),this._activeWindow===e},oo.prototype.setActiveWindow=function(e){this._activeWindow=e},oo.prototype.getActiveWindow=function(e){return this._ensureActiveWindow(e),this._activeWindow},oo.prototype.getPosition=function(){return new to(this._x,this._y)},oo.prototype.move=function(e){return this._x=e.x,this._y=e.y,this._ui.move(e)},oo.prototype.hide=function(){return this._ui.hide?this._ui.hide():c.PromiseCtor.resolve()},oo.prototype.show=function(){return this._ui.show?this._ui.show():c.PromiseCtor.resolve()},oo.prototype.leftButtonDown=function(){return this._ui.leftButtonDown()},oo.prototype.rightButtonDown=function(){return this._ui.rightButtonDown()},oo.prototype.buttonUp=function(){return this._ui.buttonUp()},oo);function oo(e,t){this._ui=t,this._x=-1,this._y=-1,this._activeWindow=e}var ro=ue(hu)?i.iframeCursorUI:i.cursorUI,so=new io(hu.top,ro);function lo(e,t,n){var i=function(e,t,n){if(t.y-e.y==0)return 0;var i=(t.x-e.x)/(t.y-e.y),o=e.y*(e.x-t.x)/(t.y-e.y)+e.x;return Math.round(i*n+o)}(e,t,n.top);return i&&i>=n.left&&i<=n.right?new to(i,n.top):null}function ao(e,t,n){var i=function(e,t,n){if(t.x===e.x)return 0;var i=(t.y-e.y)/(t.x-e.x),o=e.x*(e.y-t.y)/(t.x-e.x)+e.y;return Math.round(i*n+o)}(e,t,n.left);return i&&i>=n.top&&i<=n.bottom?new to(n.left,i):null}function uo(e,t,n){for(var i=[],o=0,r=[{left:n.left,top:n.top,right:n.left,bottom:n.bottom,isHorizontal:!1},{left:n.right,top:n.top,right:n.right,bottom:n.bottom,isHorizontal:!1},{left:n.left,top:n.top,right:n.right,bottom:n.top,isHorizontal:!0},{left:n.left,top:n.bottom,right:n.right,bottom:n.bottom,isHorizontal:!0}];o<r.length;o++){var s=r[o],l=(s.isHorizontal?lo:ao)(e,t,s);l&&i.push(l)}return i.length?1===i.length||i[0].distance(e)<i[1].distance(e)?i[0]:i[1]:null}var co=null,ho=function(){return co},fo=function(e){co=e};function mo(){return t=0,n=c.nativeMethods.setTimeout,new c.PromiseCtor(function(e){return n(e,t)});var t,n}var po=(vo.create=function(o,r,s,l){return h(this,void 0,void 0,function(){var t,n,i;return S(this,function(e){switch(e.label){case 0:return[4,vo.getTarget(o,r,new to(l.offsetX,l.offsetY))];case 1:return t=e.sent(),n=t.element,i=t.offset,[2,new vo(n,i,r,s,l)]}})})},vo.getTarget=function(i,o,r){return c.PromiseCtor.resolve(c.position.containsOffset(i,r.x,r.y)).then(function(e){return e?{element:i,offset:r}:u.all([(n=i,t=r,c.PromiseCtor.resolve(c.dom.isDocumentElement(n)).then(function(e){if(e)return new to(0,0);var t=c.browser.isFirefox?Math.ceil:Math.round;return c.PromiseCtor.resolve(c.position.getOffsetPosition(n,t)).then(function(e){return to.create(e)})}).then(function(e){return e.add(t)})),c.dom.getDocumentElement(o)]).then(function(e){var t=e[0];return{element:e[1],offset:t}});var n,t})},vo.prototype._getCursorSpeed=function(){return this.automationSettings.cursorSpeed},vo.prototype._getTargetClientPoint=function(){var o=this;return c.PromiseCtor.resolve(c.style.getElementScroll(this.element)).then(function(i){return c.dom.isHtmlElement(o.element)?to.create(o.offset).sub(to.create(i)):c.PromiseCtor.resolve(c.position.getClientPosition(o.element)).then(function(e){var t=c.dom.isBodyElement(o.element),n=to.create(e).add(o.offset);return t||n.sub(to.create(i)),n.round(Math.floor)})})},vo.prototype._getEventSequenceOptions=function(t){var n=this,i=c.event.BUTTONS_PARAMETER.noButton;return function(r){return h(this,void 0,void 0,function(){return S(this,function(e){return r?[2,c.PromiseCtor.resolve(c.position.getWindowPosition()).then(function(e){var t=e.x,n=e.y,i=t+r.x,o=n+r.y;return new to(i,o)})]:[2,null]})})}(t).then(function(e){return{eventOptions:{clientX:t.x,clientY:t.y,screenX:null==e?void 0:e.x,screenY:null==e?void 0:e.y,buttons:i,ctrl:n.modifiers.ctrl,alt:n.modifiers.alt,shift:n.modifiers.shift,meta:n.modifiers.meta},eventSequenceOptions:{moveEvent:n.moveEvent}}})},vo.prototype._runEventSequence=function(t,e){var n=e.eventOptions,i=e.eventSequenceOptions;return h(this,void 0,void 0,function(){return S(this,function(e){switch(e.label){case 0:return[4,c.createEventSequence(!1,this.firstMovingStepOccured,i)];case 1:return[2,e.sent().run(t,ho(),n,null,null)]}})})},vo.prototype._emulateEvents=function(t,e){var n=this;return this._getEventSequenceOptions(e).then(function(e){return n._runEventSequence(t,e)}).then(function(){n.firstMovingStepOccured=!0,fo(t)})},vo.prototype._movingStep=function(n){var i=this;return this.cursor.move(n).then(function(){return c.getElementExceptUI(i.cursor.getPosition())}).then(function(e){var t=i._getCorrectedTopElement(e);return t?i._emulateEvents(t,n):null}).then(mo)},vo.prototype._getCorrectedTopElement=function(e){return e},vo.prototype._move=function(t){var n=this,i=this.cursor.getPosition(),o=to.create(t).sub(i),r=c.nativeMethods.dateNow(),s=Math.max(Math.max(Math.abs(o.x),Math.abs(o.y))/this.cursorSpeed,this.minMovingTime),l=to.create(i),a=!0;return function(t,n){return h(this,void 0,void 0,function(){return S(this,function(e){switch(e.label){case 0:return t()?[4,n()]:[3,2];case 1:return e.sent(),[3,0];case 2:return[2]}})})}(function(){return!l.eql(t)},function(){var e;return n._needMoveCursorImmediately()?l=to.create(t):a?(a=!1,l.add({x:0<o.x?1:-1,y:0<o.y?1:-1})):(e=Math.min((c.nativeMethods.dateNow()-r)/s,1),l=to.create(o).mul(e).add(i).round(Math.floor)),n._movingStep(l)})},vo.prototype._needMoveCursorImmediately=function(){return this.touchMode},vo.prototype._scroll=function(){if(this.skipScrolling)return c.PromiseCtor.resolve(!1);var e=new Ii({offsetX:this.offset.x,offsetY:this.offset.y},!1);return c.scroll(this.element,e)},vo.prototype._moveToCurrentFrame=function(e){var t=this;if(this.cursor.isActive(this.window))return c.PromiseCtor.resolve();var n=this.cursor.getPosition(),i=n.x,o=n.y,r=this.cursor.getActiveWindow(this.window),s=null,l=null,a={cmd:"automation|move|request",startX:i,startY:o,endX:e.x,endY:e.y,modifiers:this.modifiers,speed:this.speed};return c.PromiseCtor.resolve().then(function(){if(r.parent===t.window)return c.PromiseCtor.resolve(c.dom.findIframeByWindow(r)).then(function(e){return s=e,c.PromiseCtor.resolve(c.position.getIframeClientCoordinates(e)).then(function(e){a.left=e.left,a.top=e.top,a.right=e.right,a.bottom=e.bottom})})}).then(function(){return c.getElementExceptUI(t.cursor.getPosition())}).then(function(e){return l=e===s,r.parent===t.window&&(a.iframeUnderCursor=l),c.sendRequestToFrame(a,"automation|move|response",r)}).then(function(e){if(t.cursor.setActiveWindow(t.window),l||c.dom.isIframeWindow(t.window))return t.cursor.move(e)})},vo.prototype.run=function(){var n=this;return this._scroll().then(function(){return u.all([n._getTargetClientPoint(),c.style.getWindowDimensions(n.window)])}).then(function(e){var t=e[0];if(e[1].contains(t))return n._moveToCurrentFrame(t).then(function(){return n._move(t)})})},vo);function vo(e,t,n,i,o){this.touchMode=c.featureDetection.isTouchDevice,this.moveEvent=this.touchMode?"touchmove":"mousemove",this.automationSettings=new Se(o.speed),this.cursorSpeed=this._getCursorSpeed(),this.element=e,this.window=n,this.offset=t,this.cursor=i,this.minMovingTime=o.minMovingTime||0,this.modifiers=o.modifiers||{},this.skipScrolling=o.skipScrolling,this.skipDefaultDragBehavior=o.skipDefaultDragBehavior,this.speed=o.speed,this.firstMovingStepOccured=!1}var go=m.eventSandbox.eventSimulator,Eo=m.eventSandbox.message,yo=y.positionUtils,So=y.domUtils,bo=y.styleUtils,_o="automation|move|response";Eo.on(Eo.SERVICE_MSG_RECEIVED_EVENT,function(e){var t,n,i,o,r,s,l,a,u,c,h,f,d;"automation|move|request"===e.message.cmd&&(e.source.parent===hu?(n=new to((t=e).message.endX,t.message.endY),i=t.source,o=So.findIframeByWindow(i),r=bo.getBordersWidth(o),s=bo.getElementPadding(o),l=yo.getIframeClientCoordinates(o),a=yo.getIframePointRelativeToParentFrame(n,i),u=so.getPosition(),c=yo.isInRectangle(u,l)?u:uo(u,a,l),h={x:c.x-l.left,y:c.y-l.top},f=new Xi({modifiers:t.message.modifiers,offsetX:h.x+r.left+s.left,offsetY:h.y+r.top+s.top,speed:t.message.speed,skipScrolling:!0},!1),d={cmd:_o,x:h.x,y:h.y},so.getActiveWindow(hu)!==i?po.create(o,hu,so,f).then(function(e){return e.run()}).then(function(){so.setActiveWindow(i),Eo.sendServiceMsg(d,i)}):Eo.sendServiceMsg(d,i)):(m.on(m.EVENTS.beforeUnload,function(){return Eo.sendServiceMsg({cmd:_o},e.source)}),function(e){var t=e.source,n={left:e.message.left,right:e.message.right,top:e.message.top,bottom:e.message.bottom};if(!e.message.iframeUnderCursor){var i=e.message,o=i.startX,r=i.startY,s=o-n.left,l=r-n.top,a=ho();return a&&(go.mouseout(a,{clientX:s,clientY:l,relatedTarget:null}),go.mouseleave(a,{clientX:s,clientY:l,relatedTarget:null})),Eo.sendServiceMsg({cmd:_o},t)}var u,c=so.getPosition(),h=uo(to.create(n).add(c),new to(e.message.endX,e.message.endY),n);h?(u=new Xi({modifiers:e.message.modifiers,offsetX:h.x-n.left,offsetY:h.y-n.top,speed:e.message.speed,skipScrolling:!0},!1),po.create(fu.documentElement,hu,so,u).then(function(e){return e.run()}).then(function(){var e={cmd:_o,x:h.x,y:h.y};so.setActiveWindow(t),Eo.sendServiceMsg(e,t)})):Eo.sendServiceMsg({cmd:_o,x:n.left,y:n.top},t)}(e)))});var wo,Po=m.utils.extend,Co=function(e){var t=e.element,n=void 0===t?null:t,i=e.clientPoint,o=void 0===i?null:i,r=e.screenPoint,s=void 0===r?null:r,l=e.isTarget,a=void 0!==l&&l,u=e.inMoving,c=void 0!==u&&u;this.element=n,this.clientPoint=o,this.screenPoint=s,this.isTarget=a,this.inMoving=c,this.devicePoint=re(o)},Ao=(t(xo,wo=g.serviceUtils.EventEmitter),xo.prototype._getElementForEvent=function(e){var t=g.positionUtils.containsOffset(this.element,this.options.offsetX,this.options.offsetY)?this.element:null;return Ee(e.point,t)},xo.prototype._moveToElement=function(){return h(this,void 0,void 0,function(){var t,n=this;return S(this,function(e){switch(e.label){case 0:return t=new Xi(Po({skipScrolling:!0},this.options),!1),[4,po.create(this.element,hu,so,t)];case 1:return[2,e.sent().run().then(function(){return g.delay(n.automationSettings.mouseActionStepDelay)})]}})})},xo.prototype._scrollToElement=function(){var s=this,e=new Ii(this.options),t=new g.ScrollAutomation(this.element,e),l=!1;return t.run().then(function(e){return l=e,g.delay(s.automationSettings.mouseActionStepDelay)}).then(function(){return Ee(so.getPosition())}).then(function(e){if(!e||!g.domUtils.contains(s.element,e)||!l)return null;var t=ho(),n=g.domUtils.getCommonAncestor(e,t),i=g.positionUtils.getClientPosition(e),o=re({x:i.x,y:i.y}),r={clientX:i.x,clientY:i.y,screenX:o.x,screenY:o.y,ctrl:!1,alt:!1,shift:!1,meta:!1,buttons:g.eventUtils.BUTTONS_PARAMETER.leftButton};return p.leaveElement(e,t,n,r),p.enterElement(e,t,n,r),fo(e),l})},xo.prototype._getElementOffset=function(){var e=ae(this.element),t=this.options,n=t.offsetX,i=t.offsetY;return{offsetX:n=n||0===n?n:e.offsetX,offsetY:i=i||0===i?i:e.offsetY}},xo.prototype._wrapAction=function(e){var a=this,t=this._getElementOffset(),i=t.offsetX,u=t.offsetY,c=oe(this.element,i,u),h=g.positionUtils.getClientPosition(this.element);return e().then(function(){var e,t,n,o=oe(a.element,i,u),r=g.positionUtils.getClientPosition(a.element),s=(e=a.element,t=o,n=g.styleUtils.getElementScroll(e),!/html/i.test(e.tagName)&&g.styleUtils.hasScroll(e)&&(t.x-=n.left,t.y-=n.top),g.positionUtils.offsetToClientCoords(t)),l=g.positionUtils.containsOffset(a.element,i,u)?a.element:null;return Ee(s,l).then(function(e){if(!e)return new Co({});var t=(t=!l||e===l||e===a.element)||-1<g.arrayUtils.indexOf(g.domUtils.getParents(e),a.element),n=c.x!==o.x||c.y!==o.y,i=h.x!==r.x||h.y!==r.y;return new Co({element:e,clientPoint:s,screenPoint:o,isTarget:t,inMoving:n&&i})})})},xo._checkElementState=function(e,t){if(!e.element)throw new Error(ye.elementIsInvisibleError);if(t&&(!e.isTarget||e.inMoving))throw new Error(ye.foundElementIsNotTarget);return e},xo.prototype._ensureElement=function(t,n,i){var o=this;return this._wrapAction(function(){return o._scrollToElement()}).then(function(e){return xo._checkElementState(e,t)}).then(function(e){return i?e:o._wrapAction(function(){return o._moveToElement()})}).then(function(e){return n||xo._checkElementState(e,t),e}).then(function(e){return o.emit(o.TARGET_ELEMENT_FOUND_EVENT,{element:e.element}),{element:e.element,clientPoint:e.clientPoint,screenPoint:e.screenPoint,devicePoint:e.devicePoint}})},xo);function xo(e,t){var n=wo.call(this)||this;return n.TARGET_ELEMENT_FOUND_EVENT="automation|target-element-found-event",n.element=e,n.options=t,n.automationSettings=new Se(t.speed),n}var To,Uo=m.Promise,Mo=(t(Do,To=Ao),Do.prototype.run=function(e){var t=this,n=Uo.resolve();return this.element!==fu.scrollingElement&&this.element!==fu.documentElement&&(n=this._ensureElement(e,!0,!0)),n.then(function(){t.element.scrollLeft=t.scrollLeft,t.element.scrollTop=t.scrollTop})},Do);function Do(e,t,n){var i,o,r,s,l,a=t.x,u=t.y,c=t.position,h=t.byX,f=t.byY,d=To.call(this,e,n)||this;return c&&(o=e,r=c,s=Math.floor(o.scrollWidth/2-o.clientWidth/2),l=Math.floor(o.scrollHeight/2-o.clientHeight/2),a=(i={top:[s,0],right:[o.scrollWidth,l],bottom:[s,o.scrollHeight],left:[0,l],topRight:[o.scrollWidth,0],topLeft:[0,0],bottomRight:[o.scrollWidth,o.scrollHeight],bottomLeft:[0,o.scrollHeight],center:[s,l]}[r])[0],u=i[1]),d.scrollLeft="number"==typeof a?a:e.scrollLeft,d.scrollTop="number"==typeof u?u:e.scrollTop,h&&(d.scrollLeft+=h),f&&(d.scrollTop+=f),d}var Io,ko=(t(Bo,Io=Ao),Bo.prototype.run=function(e){return this._ensureElement(e,!0,!0)},Bo);function Bo(e,t){return Io.call(this,e,t)||this}var Oo=m.Promise,No=m.eventSandbox.message;function Fo(e,i,t){return new Oo(function(n){No.on(No.SERVICE_MSG_RECEIVED_EVENT,function e(t){t.message.cmd===i&&(No.off(No.SERVICE_MSG_RECEIVED_EVENT,e),n(t.message))}),No.sendServiceMsg(e,t)})}var Ko=m.Promise,Yo=m.nativeMethods,Lo=m.utils.browser,Vo=m.eventSandbox.focusBlur,Xo=y.contentEditable,Ro=y.textSelection,Wo=y.domUtils,Ho=y.styleUtils,Go=m.eventSandbox.message,qo="automation|iframe|request",zo="automation|iframe|response";function jo(v,g,E){var e=this;return new Ko(function(p){return h(e,void 0,void 0,function(){var s,n,i,o,r,l,a,u,c,h,f,d,m;return S(this,function(e){switch(e.label){case 0:return ue(hu)?[4,Fo({cmd:qo},zo,hu.parent)]:[3,2];case 1:e.sent(),e.label=2;case 2:if(s=Wo.getActiveElement(),n=Wo.isTextEditableElement(v),i=Wo.closest(v,"label[for]"),o=Wo.isElementFocusable(v),r=!o&&i,l=Wo.isContentEditableElement(v),a=l?Xo.findContentEditableParent(v):v,g&&Lo.isWebKit&&n&&Ro.select(v,0,0),r)return g&&(t=i,Wo.isElementFocusable(t)?Vo.focus(t,y.noop,!1,!0):Zo(t)),p(),[2];if(u=!g,c=!1,!o&&!l){if(h=Wo.findDocument(a),f=Yo.documentActiveElementGetter.call(h),d=Wo.isBodyElement(f),m=Wo.isBodyElement(a)?a:Wo.getFocusableParent(a),f&&!d&&Wo.containsElement(f,a)||d&&Wo.isBodyElement(m))return p(),[2];a=m||h.body,c=!0}return Vo.focus(a,function(){var e,t,n,i,o,r;!g||l||v===Wo.getActiveElement()?(e=v,t=E,o=Wo.isTextEditableElement(e),r=Wo.isContentEditableElement(e),o||r?r&&isNaN(parseInt(t,10))?Ro.setCursorToLastVisiblePosition(e):(n=isNaN(parseInt(t,10))?Wo.getElementValue(e).length:t,Ro.select(e,n,n)):(i=Xo.findContentEditableParent(e))&&Ro.setCursorToLastVisiblePosition(Xo.findContentEditableParent(i)),g||Wo.getActiveElement()===s?p():Vo.focus(s,p,!0,!0)):p()},u,!0,!1,c),[2]}var t})})})}function $o(e){var t=Wo.closest(e,"label[for]"),n=t&&(t.control||fu.getElementById(t.htmlFor));return n&&Ho.isElementVisible(n)?n:null}function Zo(e){var t=$o(e);t&&Wo.getActiveElement()!==t&&Vo.focus(t,y.noop,!1,!0)}Go.on(Go.SERVICE_MSG_RECEIVED_EVENT,function(e){var t;e.message.cmd===qo&&(t=Wo.findIframeByWindow(e.source),Vo.focus(t,function(){Go.sendServiceMsg({cmd:zo},e.source)},!1))});var Jo=m.Promise,Qo=m.nativeMethods;function er(){return new Jo(function(e){return Qo.setTimeout.call(hu,e,0)})}var tr=m.utils.browser,nr=m.eventSandbox.eventSimulator,ir=m.eventSandbox.listeners,or=m.nativeMethods,rr=y.domUtils,sr=y.styleUtils,lr=i.selectElement,ar=(ur.prototype.run=function(){this.eventState.clickElement&&nr.click(this.eventState.clickElement,this.eventArgs.options),rr.isElementFocusable(this.eventArgs.element)||Zo(this.eventArgs.element)},ur);function ur(e,t){this.eventState=e,this.eventArgs=t}var cr,hr=(t(fr,cr=ar),fr.prototype.run=function(){function e(e){n=or.eventTargetGetter.call(e)===t.input}var t=this,n=!1;ir.addInternalEventBeforeListener(hu,["focus"],e),cr.prototype.run.call(this),ir.removeInternalEventBeforeListener(hu,["focus"],e),rr.isElementFocusable(this.label)&&!n&&this._ensureBoundElementFocusRaised()},fr.prototype._ensureBoundElementFocusRaised=function(){nr.focus(this.input)},fr);function fr(e,t){var n=cr.call(this,e,t)||this;return n.label=n.eventArgs.element,n.input=$o(n.eventArgs.element),n}var dr,mr=(t(pr,dr=ar),pr.prototype.run=function(){dr.prototype.run.call(this),this._toggleSelectOptionList()},pr.prototype._toggleSelectOptionList=function(){var e=this.eventArgs.element;1===sr.getSelectElementSize(e)&&!1!==this.eventState.simulateDefaultBehavior&&(lr.isOptionListExpanded(e)?lr.collapseOptionList():lr.expandOptionList(e))},pr);function pr(e,t){return dr.call(this,e,t)||this}var vr,gr=(t(Er,vr=ar),Er.prototype.run=function(){return this.eventArgs.element},Er);function Er(e,t){return vr.call(this,e,t)||this}var yr,Sr=(t(br,yr=hr),br.prototype.run=function(){function e(){t=!0}var t=!1;ir.addInternalEventBeforeListener(hu,["change"],e),yr.prototype.run.call(this),ir.removeInternalEventBeforeListener(hu,["change"],e),tr.isChrome&&!t&&this._ensureCheckboxStateChanged()},br.prototype._ensureCheckboxStateChanged=function(){this.checkbox.checked=!this.checkbox.checked,nr.change(this.checkbox)},br);function br(e,t){var n=yr.call(this,e,t)||this;return n.checkbox=n.input,n}var _r,wr=m.Promise,Pr=m.utils.extend,Cr=m.utils.browser,Ar=m.utils.featureDetection,xr=m.eventSandbox.eventSimulator,Tr=m.eventSandbox.listeners,Ur=y.domUtils,Mr=y.eventUtils,Dr=y.arrayUtils,Ir=y.delay,kr=(t(Br,_r=Ao),Br.prototype._bindMousedownHandler=function(){var t=this,n=function(e){t.eventState.mousedownPrevented=e.defaultPrevented,Mr.preventDefault(e),Mr.unbind(t.element,"mousedown",n)};Mr.bind(this.element,"mousedown",n)},Br.prototype._bindBlurHandler=function(e){var t=this,n=function(){t.eventState.blurRaised=!0,Mr.unbind(e,"blur",n,!0)};Mr.bind(e,"blur",n,!0)},Br.prototype._isTouchEventWasCancelled=function(){return this.eventState.touchStartCancelled||this.eventState.touchEndCancelled},Br.prototype._raiseTouchEvents=function(e){Ar.isTouchDevice&&(this.eventState.touchStartCancelled=!xr.touchstart(e.element,e.options),this.eventState.touchEndCancelled=!xr.touchend(e.element,e.options))},Br.prototype._mousedown=function(n){var i=this;return this.targetElementParentNodes=Ur.getParents(n.element),this.mouseDownElement=n.element,so.leftButtonDown().then(function(){i._raiseTouchEvents(n);var e=Ur.getActiveElement();i.activeElementBeforeMouseDown=e;var t=(Cr.isWebKit||Cr.isIE)&&Ur.isSelectElement(i.mouseDownElement);return t&&i._bindMousedownHandler(),i._bindBlurHandler(e),i._isTouchEventWasCancelled()||(i.eventState.simulateDefaultBehavior=xr.mousedown(n.element,n.options)),!1===i.eventState.simulateDefaultBehavior&&(i.eventState.simulateDefaultBehavior=t&&!i.eventState.mousedownPrevented),i._ensureActiveElementBlur(e)}).then(function(){return i._focus(n)})},Br.prototype._ensureActiveElementBlur=function(t){var n=this;return new wr(function(e){Ur.getActiveElement()===t||n.eventState.blurRaised?e():Cr.isIE&&Cr.version<12?er().then(function(){n.eventState.blurRaised||xr.blur(t),e()}):(xr.blur(t),e())})},Br.prototype._focus=function(e){return!1===this.eventState.simulateDefaultBehavior?wr.resolve():jo(Ur.isContentEditableElement(this.element)?this.element:e.element,!Cr.isIE||this.activeElementBeforeMouseDown===Ur.getActiveElement(),this.caretPos)},Br._getElementForClick=function(e,t,n){var i=Ur.getParents(t),o=Ur.isTheSameNode(t,e);return Cr.isFirefox?o?e:null:o?Dr.equals(n,i)?e:null:e.contains(t)&&!Ur.isEditableFormElement(t)?e:t.contains(e)?t:Dr.getCommonElement(i,n)},Br.prototype._mouseup=function(i){var o=this;return so.buttonUp().then(function(){return o._getElementForEvent(i)}).then(function(e){i.element=e,o.eventState.clickElement=Br._getElementForClick(o.mouseDownElement,e,o.targetElementParentNodes);var t={},n=function(e){t=e.timeStamp,Tr.removeInternalEventBeforeListener(hu,["mouseup"],n)};return Cr.isIE||Tr.addInternalEventBeforeListener(hu,["mouseup"],n),o._isTouchEventWasCancelled()||xr.mouseup(e,i.options),{timeStamp:t}})},Br.prototype._click=function(e){var t,n,i,o,r,s,l,a=(t=this.eventState,i=$o((n=e).element),o=rr.isSelectElement(n.element),r=rr.isOptionElement(n.element),s=rr.isLabelElement(n.element)&&i,l=i&&rr.isCheckboxElement(i),new(o?mr:r?gr:l?Sr:s?hr:ar)(t,n));return this._isTouchEventWasCancelled()||a.run(),e},Br.prototype.run=function(e){var r=this,s=null;return this._ensureElement(e).then(function(e){var t=e.element,n=e.clientPoint,i=e.screenPoint,o=e.devicePoint;return s={point:n,screenPoint:i,element:t,options:Pr({clientX:n.x,clientY:n.y,screenX:o.x,screenY:o.y},r.modifiers)},wr.all([Ir(r.automationSettings.mouseActionStepDelay),r._mousedown(s)])}).then(function(){return r._mouseup(s)}).then(function(e){var t=e.timeStamp;return s.options.timeStamp=t,r._click(s)})},Br);function Br(e,t){var n=_r.call(this,e,t)||this;return n.modifiers=t.modifiers,n.caretPos=t.caretPos,n.targetElementParentNodes=[],n.activeElementBeforeMouseDown=null,n.mouseDownElement=null,n.eventState={mousedownPrevented:!1,blurRaised:!1,simulateDefaultBehavior:!0,clickElement:null,touchStartCancelled:!1,touchEndCancelled:!1},n}var Or=m.Promise,Nr=m.utils.browser,Fr=m.utils.featureDetection,Kr=m.eventSandbox.eventSimulator,Yr=m.eventSandbox.focusBlur,Lr=m.nativeMethods,Vr=y.domUtils,Xr=y.styleUtils,Rr=y.delay,Wr=i.selectElement,Hr=Fr.isTouchDevice?0:160,Gr=(qr.prototype._calculateEventArguments=function(){var e=this.optionListExpanded?Wr.getEmulatedChildElement(this.element):this.element,t=1<Xr.getSelectElementSize(this.parentSelect);return{options:this.modifiers,element:Nr.isIE&&t?this.parentSelect:e}},qr.prototype._getMoveArguments=function(){var e,t,n=null,i=null,o=null;return o=this.optionListExpanded?(i=(e=le(n=Wr.getEmulatedChildElement(this.element))).offsetX,e.offsetY):(n=fu.documentElement,i=(t=Wr.getSelectChildCenter(this.element)).x,t.y),{element:n,offsetX:i,offsetY:o,speed:this.speed}},qr.prototype._move=function(e){var t=this,n=e.element,i=e.offsetX,o=e.offsetY,r=e.speed,s=new Xi({offsetX:i,offsetY:o,speed:r,modifiers:this.modifiers},!1);return po.create(n,hu,so,s).then(function(e){return e.run()}).then(function(){return Rr(t.automationSettings.mouseActionStepDelay)})},qr.prototype._mousedown=function(){var e=this;return Nr.isFirefox?(Kr.mousedown(this.eventsArgs.element,this.eventsArgs.options),this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex),this._focus()):Nr.isIE?(Kr.mousedown(this.eventsArgs.element,this.eventsArgs.options),this._focus()):this._focus().then(function(){return Rr(Hr)}).then(function(){Kr.mousedown(e.eventsArgs.element,e.eventsArgs.options),e.clickCausesChange&&(e.parentSelect.selectedIndex=e.childIndex)})},qr.prototype._focus=function(){var t=this;return new Or(function(e){Yr.focus(t.parentSelect,e,!1,!0)})},qr.prototype._mouseup=function(){var e=Nr.isIE?this.parentSelect:this.eventsArgs.element;Kr.mouseup(e,this.eventsArgs.options),Nr.isIE&&this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex);var t=Nr.isFirefox||Nr.isSafari||Nr.isChrome&&53<=Nr.version,n=t||Nr.isIE;return t&&this.clickCausesChange&&Kr.input(this.parentSelect),n&&this.clickCausesChange&&Kr.change(this.parentSelect),Or.resolve()},qr.prototype._click=function(){Kr.click(this.eventsArgs.element,this.eventsArgs.options)},qr.prototype.run=function(){var e=this;if(!this.parentSelect)return Kr.click(this.eventsArgs.element,this.eventsArgs.options),Or.resolve();this.optionListExpanded||Wr.scrollOptionListByChild(this.element);var t=this._getMoveArguments();return this.eventsArgs=this._calculateEventArguments(),Xr.getSelectElementSize(this.parentSelect)<=1?this._move(t).then(function(){return e._click()}):this._move(t).then(function(){return e._mousedown()}).then(function(){return e._mouseup()}).then(function(){return e._click()})},qr);function qr(e,t){var n,i,o,r,s;this.element=e,this.modifiers=t.modifiers,this.caretPos=t.caretPos,this.offsetX=t.offsetX,this.offsetY=t.offsetY,this.speed=t.speed,this.automationSettings=new Se(t.speed),this.parentSelect=Vr.getSelectParent(this.element),this.optionListExpanded=!!this.parentSelect&&Wr.isOptionListExpanded(this.parentSelect),this.childIndex=null,this.clickCausesChange=!1,this.parentSelect&&(n=Vr.isOptionElement(this.element),i=this.parentSelect.selectedIndex,this.childIndex=Vr.getElementIndexInParent(this.parentSelect,this.element),o=Lr.nodeParentNodeGetter.call(this.element),r=Vr.isOptionGroupElement(o)?o:null,s=this.element.disabled||r&&r.disabled,this.clickCausesChange=n&&!s&&this.childIndex!==i),this.eventsArgs={options:this.modifiers,element:this.element}}var zr,jr=m.utils.featureDetection,$r=m.utils.browser,Zr=m.eventSandbox.eventSimulator,Jr=y.eventUtils,Qr=y.delay,es=jr.isTouchDevice?0:160,ts=(t(ns,zr=Ao),ns.prototype._firstClick=function(e){var t=this,n=new Yi(this.options);n.speed=1;var i=new kr(this.element,n);return i.on(i.TARGET_ELEMENT_FOUND_EVENT,function(e){return t.emit(t.TARGET_ELEMENT_FOUND_EVENT,e)}),i.run(e).then(function(e){return Qr(es).then(function(){return e})})},ns.prototype._secondClick=function(e){var t=this;$r.isIE&&Jr.bind(fu,"focus",Jr.preventDefault,!0);var n=new Yi({offsetX:e.screenPoint.x,offsetY:e.screenPoint.y,caretPos:this.caretPos,modifiers:this.modifiers,speed:1}),i=new kr(fu.documentElement,n);return i.run().then(function(e){return t.eventState.dblClickElement=i.eventState.clickElement,$r.isIE&&Jr.unbind(fu,"focus",Jr.preventDefault,!0),e})},ns.prototype._dblClick=function(e){this.eventState.dblClickElement&&Zr.dblclick(this.eventState.dblClickElement,e.options)},ns.prototype.run=function(e){var t=this;return this._firstClick(e).then(function(e){return t._secondClick(e)}).then(function(e){return t._dblClick(e)})},ns);function ns(e,t){var n=zr.call(this,e,t)||this;return n.modifiers=t.modifiers,n.caretPos=t.caretPos,n.speed=t.speed,n.automationSettings=new Se(n.speed),n.offsetX=t.offsetX,n.offsetY=t.offsetY,n.eventArgs=null,n.eventState={dblClickElement:null},n}var is,os=function(){this.enabled=!1,this.dropAllowed=!1,this.element=null,this.dataTransfer=null,this.dataStore=null},rs=m.nativeMethods,ss=m.utils.featureDetection,ls=m.utils.html,as=m.utils.url,us=m.eventSandbox.DataTransfer,cs=m.eventSandbox.DragDataStore,hs=y.eventUtils,fs=y.domUtils,ds=(t(ms,is=po),ms.create=function(o,r,s,l){return h(this,void 0,void 0,function(){var t,n,i;return S(this,function(e){switch(e.label){case 0:return[4,po.getTarget(o,r,new to(l.offsetX,l.offsetY))];case 1:return t=e.sent(),n=t.element,i=t.offset,[2,new ms(n,i,r,s,l)]}})})},ms.prototype._getCursorSpeed=function(){return this.automationSettings.draggingSpeed},ms.prototype._getEventSequenceOptions=function(e){var i=this;return is.prototype._getEventSequenceOptions.call(this,e).then(function(e){var t=e.eventOptions,n=e.eventSequenceOptions;return t.dataTransfer=i.dragAndDropState.dataTransfer,t.buttons=hs.BUTTONS_PARAMETER.leftButton,n.holdLeftButton=!0,{eventOptions:t,eventSequenceOptions:n}})},ms.prototype._getCorrectedTopElement=function(e){return this.touchMode?this.dragElement:e},ms.prototype._runEventSequence=function(e,t){var n=t.eventOptions,i=t.eventSequenceOptions,o=k(this.dragAndDropState.enabled,this.firstMovingStepOccured,i).run(e,ho(),n,this.dragElement,this.dragAndDropState.dataStore),r=o.dragAndDropMode,s=o.dropAllowed;this.dragAndDropState.enabled=r,this.dragAndDropState.dropAllowed=s},ms.prototype._needMoveCursorImmediately=function(){return!1},ms.prototype.run=function(){var l=this;return Ee(this.cursor.getPosition()).then(function(e){l.dragElement=e;var t,n,i,o,r,s=function(e){for(var t=e;t;){if(t.draggable)return t;t=rs.nodeParentNodeGetter.call(t)}return null}(l.dragElement);return s&&ss.hasDataTransfer&&!l.skipDefaultDragBehavior&&(l.dragAndDropState.enabled=!0,l.dragElement=s,l.dragAndDropState.element=l.dragElement,l.dragAndDropState.dataStore=new cs,l.dragAndDropState.dataTransfer=new us(l.dragAndDropState.dataStore),((t=fs.isAnchorElement(l.dragElement))||fs.isImgElement(l.dragElement))&&(n=t?"href":"src",o=(i=as.parseProxyUrl(l.dragElement[n]))?i.destUrl:l.dragElement[n],r=ls.cleanUpHtml(rs.elementOuterHTMLGetter.call(l.dragElement)),l.dragAndDropState.dataTransfer.setData("text/plain",o),l.dragAndDropState.dataTransfer.setData("text/uri-list",o),l.dragAndDropState.dataTransfer.setData("text/html",r))),is.prototype.run.call(l).then(function(){return l.dragAndDropState})})},ms);function ms(e,t,n,i,o){var r=is.call(this,e,t,n,i,o)||this;return r.dragElement=null,r.dragAndDropState=new os,r}var ps,vs=m.Promise,gs=m.utils.extend,Es=m.utils.featureDetection,ys=m.eventSandbox.eventSimulator,Ss=m.eventSandbox.focusBlur,bs=(t(_s,ps=Ao),_s.prototype._getEndPoint=function(){throw new Error("Not implemented")},_s.prototype._mousedown=function(e){var t=this;return so.leftButtonDown().then(function(){return t.simulateDefaultBehavior=ys[t.downEvent](e.element,e.options),t._focus(e)})},_s.prototype._focus=function(n){var i=this;return new vs(function(e){var t=g.domUtils.isContentEditableElement(i.element)?g.contentEditable.findContentEditableParent(i.element):n.element;Ss.focus(t,e,!1,!0)})},_s.prototype._getDestination=function(){throw new Error("Not implemented")},_s.prototype._drag=function(){var t=this,e=this._getDestination(),n=e.element,i=e.offsets,o=e.endPoint;this.endPoint=o;var r=new Xi({offsetX:i.offsetX,offsetY:i.offsetY,modifiers:this.modifiers,speed:this.speed,minMovingTime:25,skipDefaultDragBehavior:!1===this.simulateDefaultBehavior},!1);return ds.create(n,hu,so,r).then(function(e){return e.run()}).then(function(e){return t.dragAndDropState=e,g.delay(t.automationSettings.mouseActionStepDelay)})},_s.prototype._mouseup=function(){var o=this;return so.buttonUp().then(function(){var t=g.positionUtils.offsetToClientCoords(o.endPoint),n=null,i=gs({clientX:t.x,clientY:t.y},o.modifiers);return Ee(t).then(function(e){return(n=e)?(o.dragAndDropState.enabled?(i.dataTransfer=o.dragAndDropState.dataTransfer,o.dragAndDropState.dropAllowed&&ys.drop(n,i),ys.dragend(o.dragAndDropState.element,i),o.dragAndDropState.dataStore.setProtectedMode()):ys[o.upEvent](n,i),Ee(t)):n}).then(function(e){n&&e===n&&!o.dragAndDropState.enabled&&ys.click(n,i)})})},_s.prototype.run=function(e){var i,o=this;return this._ensureElement(e).then(function(e){var t=e.element,n=e.clientPoint;return i={point:n,element:t,options:gs({clientX:n.x,clientY:n.y},o.modifiers)},vs.all([g.delay(o.automationSettings.mouseActionStepDelay),o._mousedown(i)])}).then(function(){return o._drag()}).then(function(){return o._mouseup()})},_s);function _s(e,t){var n=ps.call(this,e,t)||this;return n.modifiers=t.modifiers,n.speed=t.speed,n.offsetX=t.offsetX,n.offsetY=t.offsetY,n.endPoint=null,n.simulateDefaultBehavior=!0,n.downEvent=Es.isTouchDevice?"touchstart":"mousedown",n.upEvent=Es.isTouchDevice?"touchend":"mouseup",n.dragAndDropState=null,n}var ws,Ps=y.styleUtils,Cs=(t(As,ws=bs),As.prototype._getDestination=function(){var e=oe(this.element,this.offsetX,this.offsetY),t=Ps.getWidth(fu),n=Ps.getHeight(fu),i={x:e.x+this.dragOffsetX,y:e.y+this.dragOffsetY},i={x:Math.min(Math.max(0,i.x),t),y:Math.min(Math.max(0,i.y),n)};return{element:fu.documentElement,offsets:{offsetX:i.x,offsetY:i.y},endPoint:i}},As);function As(e,t,n,i){var o=ws.call(this,e,i)||this;return o.dragOffsetX=t,o.dragOffsetY=n,o}var xs,Ts=y.positionUtils,Us=(t(Ms,xs=bs),Ms.prototype._getDestination=function(){var e=this.destinationElement,t=Ts.getElementRectangle(e),n=ae(e,this.destinationOffsetX,this.destinationOffsetY);return{element:e,offsets:n,endPoint:{x:t.left+n.offsetX,y:t.top+n.offsetY}}},Ms);function Ms(e,t,n){var i=xs.call(this,e,n)||this;return i.destinationElement=t,i.destinationOffsetX=n.destinationOffsetX,i.destinationOffsetY=n.destinationOffsetY,i}var Ds,Is=(t(ks,Ds=Ao),ks.prototype.run=function(e){return this._ensureElement(e,!0)},ks);function ks(e,t){return Ds.call(this,e,t)||this}var Bs=m.utils.browser,Os=m.sandbox.event,Ns=m.eventSandbox.eventSimulator,Fs=m.eventSandbox.listeners,Ks=m.nativeMethods,Ys=y.domUtils,Ls=y.contentEditable,Vs=y.textSelection,Xs=/ /g;function Rs(e){var t=Vs.getSelectionByElement(e),n=Vs.hasInverseSelectionContentEditable(e);return Vs.hasElementContainsSelection(e)?Ls.getSelection(e,t,n):{startPos:Ls.calculateNodeAndOffsetByPosition(e,0),endPos:Ls.calculateNodeAndOffsetByPosition(e,0)}}function Ws(e){var t=e.startPos.node,n=e.startPos.offset,i=e.endPos.offset,o=Ls.getFirstNonWhitespaceSymbolIndex(t.nodeValue),r=Ls.getLastNonWhitespaceSymbolIndex(t.nodeValue);return n<o&&0!==n?(e.startPos.offset=o,e.endPos.offset=i+o-n):r<i&&i!==t.nodeValue.length&&(e.startPos.offset=t.nodeValue.length,e.endPos.offset=i+t.nodeValue.length-n),e}function Hs(e,t,n){return!n||Ns.beforeInput(e,t)}function Gs(e,t){var n;function i(e){e.preventDefault(),n=!0}function o(e){"textInput"===e.type&&(n=!1)}Bs.isSafari&&(Fs.addInternalEventBeforeListener(hu,["textInput"],i),Os.on(Os.EVENT_PREVENTED_EVENT,o));var r=Bs.isFirefox||Ns.textInput(e,t)||n;return Bs.isSafari&&(Fs.removeInternalEventBeforeListener(hu,["textInput"],i),Os.off(Os.EVENT_PREVENTED_EVENT,o)),r||Bs.isIE11}function qs(e,t){var n,i,o,r,s,l,a,u,c,h,f,d=Rs(e),m=d.startPos.node,p=d.endPos.node,v=!0,g=!0,E=t;function y(){g=!1}function S(e,t,n){n()}t=t.replace(Xs,String.fromCharCode(160)),m&&p&&Ys.isContentEditableElement(m)&&Ys.isContentEditableElement(p)&&(Ys.isTheSameNode(m,p)||(Vs.deleteSelectionContents(e),n=e,o=(i=d).startPos.node,r=Ks.nodeParentNodeGetter.call(o)&&o.parentElement,!(Bs.isChrome&&Bs.version<58||Bs.isSafari)&&r&&Ys.isElementContainsNode(n,o)||(i=Rs(n),Vs.hasInverseSelectionContentEditable(n)&&(i={startPos:i.endPos,endPos:i.startPos})),i.endPos.offset=i.startPos.offset,m=(d=i).startPos.node),m&&Ys.isContentEditableElement(m)&&Ys.isRenderedNode(m)&&Hs(e,t,Bs.isChrome||Bs.isFirefox)&&(v=Gs(e,E),g=v&&!Bs.isIE11,Fs.addInternalEventBeforeListener(hu,["input"],y),Fs.addInternalEventBeforeListener(hu,["textinput"],S),(v=v&&Hs(e,t,Bs.isSafari))&&(Ys.isElementNode(m)?(s=m,l=t,c=fu.createTextNode(l),h={node:c,offset:l.length},f=Ks.nodeParentNodeGetter.call(s),"br"===Ys.getTagName(s)?f.insertBefore(c,s):0<a?(u=Ks.nodeChildNodesGetter.call(s),s.insertBefore(c,u[a])):s.appendChild(c),Vs.selectByNodesAndOffsets(h,h)):function(e,t,n){var i=t.startPos.node;Ys.isElementContainsNode(e,i)||(i=(t=Ws(Rs(e))).startPos.node);var o=t.startPos.offset,r=t.endPos.offset,s=i.nodeValue,l={node:i,offset:o+n.length};i.nodeValue=s.substring(0,o)+n+s.substring(r,s.length),Vs.selectByNodesAndOffsets(l,l)}(e,Ws(d),t)),er().then(function(){g&&Ns.input(e,t),Fs.removeInternalEventBeforeListener(hu,["input"],y),Fs.removeInternalEventBeforeListener(hu,["textinput"],S)})))}function zs(e,t,n){var i,o,r,s,l,a,u,c,h,f,d,m,p;Ys.isContentEditableElement(e)&&qs(e,t),Ys.isElementReadOnly(e)||(Ys.isTextEditableElement(e)?(l=e,a=t,h=Ys.getElementValue(l),f=a.length,d=Vs.getSelectionStart(l),m=Vs.getSelectionEnd(l),p=Ys.isInputElement(l)&&"number"===l.type,Hs(l,a,Bs.isChrome||Bs.isFirefox)&&Gs(l,a)&&Hs(l,a,Bs.isSafari)&&((u=!Bs.isIE&&p?null:parseInt(l.maxLength,10))<0&&(u=Bs.isIE&&Bs.version<17?0:null),c=h.substring(0,d)+a+h.substring(m,h.length),(null===u||isNaN(u)||c.length<=u)&&(p&&Bs.isIOS&&"."===h[h.length-1]&&(d+=1),Ys.setElementValue(l,c),Vs.select(l,d+f,d+f)),Ns.input(l,a))):Ys.isInputElement(e)&&(i=e,o=t,null!==(r=n)?(s=Ys.getElementValue(i),Ys.setElementValue(i,s.substr(0,r)+o+s.substr(r+o.length))):Ys.setElementValue(i,o),Ns.change(i),Ns.input(i,o)))}function js(e){return 1===e.length&&("a"<=e&&e<="z"||"A"<=e&&e<="Z")}var $s=m.nativeMethods,Zs=m.utils.browser,Js=m.eventSandbox.focusBlur,Qs=m.Promise,el=g.domUtils.isRadioButtonElement,tl=g.domUtils.getActiveElement,nl=g.domUtils.getTabIndexAttributeIntValue;function il(e){return e===e.toLowerCase()?e.toUpperCase():e.toLowerCase()}function ol(e){var t=tl(e||fu),n=null;if(t&&g.domUtils.isIframeElement(t)&&$s.contentDocumentGetter.call(t))try{n=ol($s.contentDocumentGetter.call(t))}catch(e){}return n||t}function rl(e,t,n){if(!el(t))return e;if(!n&&!t.name&&!Zs.isChrome)return[t];var i,o,r=(i=t,o=null,n?""===i.name||Zs.isFirefox||(o=function(e){return!e.name||e===i||e.name!==i.name}):""!==i.name?o=function(e){return el(e)&&e.name===i.name}:Zs.isChrome&&(o=function(e){return el(e)&&!e.name}),o);return r&&(e=g.arrayUtils.filter(e,r)),e}function sl(e,t,n){var i,o,r,s,l,a,u,c,h=t?-1:1,f=g.domUtils.getTopSameDomainWindow(hu).document,d=(i=f,o=$s.documentActiveElementGetter.call(i),r=o&&nl(o),!(o&&r<0)),m=rl(m=g.domUtils.getFocusableElements(f,d),e,n),p=el(e),v=g.arrayUtils.indexOf(m,e);return(t?0===v:v===m.length-1)?!t&&e.tabIndex<0?g.arrayUtils.find(m,function(e){return 0===e.tabIndex}):n||!p?fu.body:m[m.length-1-v]:t&&-1===v?m[m.length-1]:(l=(s=m)[v+h],a=n,u=el(l)&&l.name&&!l.checked,c=null,a&&u&&(c=g.arrayUtils.find(s,function(e){return el(e)&&e.name===l.name&&e.checked})),c||l)}function ll(e){if(js(e))return e.toUpperCase().charCodeAt(0);var t=g.KEY_MAPS.shiftMap[e]?g.KEY_MAPS.shiftMap[e].charCodeAt(0):e.charCodeAt(0);return g.KEY_MAPS.symbolCharCodeToKeyCode[t]||t}var al={SPECIAL_KEYS:{capslock:"CapsLock",delete:"U+007F",end:"End",enter:"Enter",esc:"U+001B",home:"Home",ins:"Insert",pagedown:"PageDown",pageup:"PageUp",space:"U+0020",tab:"Tab",alt:"Alt",ctrl:"Control",meta:"Meta",shift:"Shift"},LETTERS:{a:"U+0041",b:"U+0042",c:"U+0043",d:"U+0044",e:"U+0045",f:"U+0046",g:"U+0047",h:"U+0048",i:"U+0049",j:"U+004A",k:"U+004B",l:"U+004C",m:"U+004D",n:"U+004E",o:"U+004F",p:"U+0050",q:"U+0051",r:"U+0052",s:"U+0053",t:"U+0054",u:"U+0055",v:"U+0056",w:"U+0057",x:"U+0058",y:"U+0059",z:"U+005A"},SYMBOLS:{0:"U+0030",1:"U+0031",2:"U+0032",3:"U+0033",4:"U+0034",5:"U+0035",6:"U+0036",7:"U+0037",8:"U+0038",9:"U+0039"," ":"U+0020","!":"U+0021","@":"U+0040","#":"U+0023",$:"U+0024","%":"U+0025","^":"U+005E","*":"U+002A","(":"U+0028",")":"U+0029",_:"U+005F","|":"U+007C","\\":"U+005C","/":"U+002F","?":"U+003F",".":"U+002E",",":"U+002C","<":"U+003C",">":"U+003E","[":"U+005B","]":"U+005D","{":"U+007B","}":"U+007D","§":"U+00A7","±":"U+00B1","'":"U+0027",'"':"U+0022",":":"U+003A",";":"U+003B","`":"U+0060","~":"U+007E"}};function ul(e){return js(e)?al.LETTERS[e.toLowerCase()]:al.SYMBOLS[e]||al.SPECIAL_KEYS[e]||e}function cl(e,t,n){var i={};return"keyIdentifier"in KeyboardEvent.prototype&&(i.keyIdentifier=e?"":n),"key"in KeyboardEvent.prototype&&(i.key=t),i}var hl=m.utils.browser,fl=m.utils.extend,dl=m.eventSandbox.eventSimulator,ml=(pl._isKeyActivatedInputElement=function(e){return g.domUtils.isInputElement(e)&&/button|submit|reset|radio|checkbox/.test(e.type)},pl.prototype._type=function(e,t){var n,i=e!==this.storedActiveElement,o=!i,r=e,s=g.domUtils.isEditableElement(e),l=g.domUtils.isEditableElement(this.storedActiveElement);try{i&&(n=g.domUtils.isElementInIframe(e)===g.domUtils.isElementInIframe(this.storedActiveElement)||l,o=(!hl.isFirefox||l)&&(!hl.isWebKit||n))}catch(e){}o&&(!hl.isIE&&i&&l&&s&&(r=this.storedActiveElement),zs(r,t))},pl.prototype._addKeyPropertyToEventOptions=function(e){return fl(e,cl("keypress"===e.type,this.keyProperty,this.keyIdentifierProperty)),e},pl.prototype.down=function(e){this.storedActiveElement=ol(this.topSameDomainDocument),this.modifierKeyCode&&(e[this.sanitizedKey]=!0),e.shift&&this.isLetter&&(this.keyProperty=il(this.keyProperty));var t={keyCode:this.keyCode,type:"keydown"};return this._addKeyPropertyToEventOptions(t),dl.keydown(this.storedActiveElement,fl(t,e))},pl.prototype.press=function(e){if(!this.isChar&&!this.specialKeyCode)return!0;var t=ol(this.topSameDomainDocument),n=this.isChar?function(e,t){if("space"===e)return" ";if(t){if(js(e))return il(e);if(g.KEY_MAPS.reversedShiftMap[e])return g.KEY_MAPS.reversedShiftMap[e]}return e}(this.sanitizedKey,e.shift):null,i=this.specialKeyCode||n.charCodeAt(0),o=t!==this.storedActiveElement;if(hl.isWebKit&&o&&g.domUtils.isElementInIframe(t)!==g.domUtils.isElementInIframe(this.storedActiveElement))return!0;this.storedActiveElement=t;var r={keyCode:i,charCode:i,type:"keypress"};this._addKeyPropertyToEventOptions(r);var s=hl.isAndroid||dl.keypress(t,fl(r,e));if(!s)return s;t=ol(this.topSameDomainDocument),!n||e.ctrl||e.alt||this._type(t,n);var l=pl._isKeyActivatedInputElement(t),a=g.domUtils.isButtonElement(t),u=hl.isSafari&&0<=hl.compareVersions([hl.webkitVersion,"603.1.30"]);return hl.isFirefox||u||!l&&!a||"enter"!==this.sanitizedKey||t.click(),s},pl.prototype.up=function(e){this.modifierKeyCode&&(e[this.sanitizedKey]=!1);var t={keyCode:this.keyCode,type:"keyup"};this._addKeyPropertyToEventOptions(t);var n=dl.keyup(ol(this.topSameDomainDocument),fl(t,e)),i=ol(this.topSameDomainDocument);return!hl.isFirefox&&!hl.isSafari&&(!hl.isChrome||53<=hl.version)&&n&&"space"===this.sanitizedKey&&pl._isKeyActivatedInputElement(i)&&i.click(),n},Object.defineProperty(pl.prototype,"key",{get:function(){return this.sanitizedKey},enumerable:!1,configurable:!0}),pl);function pl(e,t){this.isLetter=js(e),this.isChar=1===e.length||"space"===e,this.sanitizedKey=g.getSanitizedKey(e),this.modifierKeyCode=g.KEY_MAPS.modifiers[this.sanitizedKey],this.specialKeyCode=g.KEY_MAPS.specialKeys[this.sanitizedKey],this.keyCode=null,this.keyIdentifierProperty=ul(t),this.topSameDomainDocument=g.domUtils.getTopSameDomainWindow(hu).document,this.keyProperty=g.KEY_MAPS.keyProperty[t]||t,this.isChar&&"space"!==e?this.keyCode=ll(this.sanitizedKey):this.modifierKeyCode?this.keyCode=this.modifierKeyCode:this.specialKeyCode&&(this.keyCode=this.specialKeyCode),this.storedActiveElement=null}var vl,gl={ctrlA:"ctrl+a",backspace:"backspace",delete:"delete",left:"left",right:"right",up:"up",down:"down",shiftLeft:"shift+left",shiftRight:"shift+right",shiftUp:"shift+up",shiftDown:"shift+down",shiftHome:"shift+home",shiftEnd:"shift+end",home:"home",end:"end",enter:"enter",tab:"tab",shiftTab:"shift+tab",esc:"esc"},El=m.Promise,yl=m.utils.browser,Sl=m.eventSandbox.eventSimulator,bl=m.eventSandbox.elementEditingWatcher,_l=y.textSelection,wl=y.eventUtils,Pl=y.domUtils,Cl=i.selectElement,Al=null,xl=null;function Tl(){xl=Al=null,wl.unbind(this,"blur",Tl,!0)}function Ul(e){var t,n,i,o;Pl.isTextAreaElement(e)&&(Al!==e&&(wl.bind(e,"blur",Tl,!0),Al=e),t=e,n=_l.hasInverseSelection(t),i=Pl.getTextAreaValue(t),o=n?_l.getSelectionStart(t):_l.getSelectionEnd(t),xl=i&&o?Pl.getTextareaIndentInLine(t,o):0)}function Ml(e,t){var n,i,o,r,s,l,a=Pl.getTextAreaValue(e);a&&(n=_l.getSelectionStart(e),i=_l.getSelectionEnd(e),o=_l.hasInverseSelection(e),s=(r=a.substring(0,o?n:i)).lastIndexOf("\n"),l=r.substring(0,s),null!==xl&&Al===e||Ul(e),s=l.lastIndexOf("\n"),Il(e,n,i,o,Math.min(s+1+xl,l.length),t))}function Dl(e,t){var n,i,o,r,s,l,a,u,c,h,f=Pl.getTextAreaValue(e);f&&(n=_l.getSelectionStart(e),i=_l.getSelectionEnd(e),u=(r=(o=_l.hasInverseSelection(e))?n:i)+(l=-1===(c=(s=f.substring(r)).indexOf("\n"))?s.length:c+1),h=-1===(c=(a=s.substring(l)).indexOf("\n"))?a.length:c,null!==xl&&Al===e||Ul(e),Il(e,n,i,o,u=Math.min(u+xl,u+h),t))}function Il(e,t,n,i,o,r){var s=null,l=null,l=r?(s=t!==n&&i?n:t,o):s=o;_l.select(e,s,l)}function kl(e,t,n){Pl.isInputElement(e)&&"number"===e.type&&("-"===t.charAt(0)&&"."===t.charAt(1)&&(t=t.substring(1)),"."===t.charAt(t.length-1)&&(t=t.substring(0,t.length-1))),Pl.setElementValue(e,t),_l.select(e,n,n),Sl.input(e)}function Bl(e,t){var n,i,o,r,s,l,a,u;return Pl.isTextEditableElement(e)&&(n=_l.getSelectionStart(e),i=_l.getSelectionEnd(e),o=_l.hasInverseSelection(e),s=null,s=(r=!Pl.isTextAreaElement(e)||Pl.getTextareaLineNumberByPosition(e,n)===Pl.getTextareaLineNumberByPosition(e,i))?o?i:n:o?n:i,a=-1===(l=Pl.getElementValue(e).substring(0,s).lastIndexOf("\n"))?0:l+1,u=null,r?(u=t?s:a,_l.select(e,u,a)):o?_l.select(e,i,a):_l.select(e,n,a)),El.resolve()}function Ol(e,t){var n,i,o,r,s,l,a,u,c;return Pl.isTextEditableElement(e)&&(n=_l.getSelectionStart(e),i=_l.getSelectionEnd(e),o=_l.hasInverseSelection(e),s=null,u=s=(r=!Pl.isTextAreaElement(e)||Pl.getTextareaLineNumberByPosition(e,n)===Pl.getTextareaLineNumberByPosition(e,i))?o?i:n:o?n:i,c=null,u+=-1===(a=(l=Pl.getElementValue(e).substring(s)).indexOf("\n"))?l.length:a,r?(c=t?s:u,_l.select(e,c,u)):o?_l.select(e,i,u):_l.select(e,n,u)),El.resolve()}function Nl(e){return Bl(e,!0)}function Fl(e){return Ol(e,!0)}function Kl(e){return Pl.isRadioButtonElement(e)&&!yl.isFirefox}function Yl(e,t){return Ll(e,t,!1).then(function(e){e&&(e.checked=!0)})}function Ll(e,t,n){return void 0===n&&(n=!0),e?(Pl.isSelectElement(e)&&Cl.collapseOptionList(),i=e,o=t,r=n,new Qs(function(e){var t=sl(i,o,r);t?Js.focus(t,function(){return e(t)}):e()}).then(function(e){return e&&Pl.isTextEditableInput(e)&&_l.select(e),e})):El.resolve();var i,o,r}var Vl=((vl={})[gl.ctrlA]=function(e){return Pl.isEditableElement(e)&&_l.select(e),El.resolve()},vl[gl.backspace]=function(e){var t,n,i;return Pl.isTextEditableElementAndEditingAllowed(e)&&(t=_l.getSelectionStart(e),n=_l.getSelectionEnd(e),i=Pl.getElementValue(e).replace(/\r\n/g,"\n"),n===t?0<t&&kl(e,i.substring(0,t-1)+i.substring(n,i.length),t-1):kl(e,i.substring(0,t)+i.substring(n,i.length),t)),Pl.isContentEditableElement(e)&&_l.deleteSelectionContents(e),El.resolve()},vl[gl.delete]=function(e){var t,n,i;return Pl.isTextEditableElementAndEditingAllowed(e)&&(t=_l.getSelectionStart(e),n=_l.getSelectionEnd(e),i=Pl.getElementValue(e).replace(/\r\n/g,"\n"),n===t?t<i.length&&kl(e,i.substring(0,t)+i.substring(n+1,i.length),t):kl(e,i.substring(0,t)+i.substring(n,i.length),t)),Pl.isContentEditableElement(e)&&_l.deleteSelectionContents(e),El.resolve()},vl[gl.left]=function(e){var t,n,i,o,r=null;return Pl.isSelectElement(e)&&Cl.switchOptionsByKeys(e,"left"),Kl(e)?Yl(e,!0):(Pl.isTextEditableElement(e)&&(t=(r=_l.getSelectionStart(e)||0)===_l.getSelectionEnd(e)?r-1:r,_l.select(e,t,t),Ul(e)),Pl.isContentEditableElement(e)&&(r=_l.getSelectionStart(e))!==_l.getSelectionEnd(e)&&(n=_l.getSelectionByElement(e),o={node:(i=_l.hasInverseSelectionContentEditable(e))?n.focusNode:n.anchorNode,offset:i?n.focusOffset:n.anchorOffset},_l.selectByNodesAndOffsets(o,o,!0)),El.resolve())},vl[gl.right]=function(e){var t,n,i,o,r=null,s=null;return Pl.isSelectElement(e)&&Cl.switchOptionsByKeys(e,"right"),Kl(e)?Yl(e,!1):(Pl.isTextEditableElement(e)&&(t=(r=_l.getSelectionStart(e))===(s=_l.getSelectionEnd(e))?s+1:s,r===Pl.getElementValue(e).length&&(t=r),_l.select(e,t,t),Ul(e)),Pl.isContentEditableElement(e)&&(r=_l.getSelectionStart(e))!==(s=_l.getSelectionEnd(e))&&(n=_l.getSelectionByElement(e),o={node:(i=_l.hasInverseSelectionContentEditable(e))?n.anchorNode:n.focusNode,offset:i?n.anchorOffset:n.focusOffset},_l.selectByNodesAndOffsets(o,o,!0)),El.resolve())},vl[gl.up]=function(e){return Pl.isSelectElement(e)&&Cl.switchOptionsByKeys(e,"up"),Kl(e)?Yl(e,!0):yl.isWebKit&&Pl.isInputElement(e)?Bl(e):(Pl.isTextAreaElement(e)&&Ml(e,!1),El.resolve())},vl[gl.down]=function(e){return Pl.isSelectElement(e)&&Cl.switchOptionsByKeys(e,"down"),Kl(e)?Yl(e,!1):yl.isWebKit&&Pl.isInputElement(e)?Ol(e):(Pl.isTextAreaElement(e)&&Dl(e,!1),El.resolve())},vl[gl.shiftLeft]=function(e){var t,n;return Pl.isTextEditableElement(e)&&((t=_l.getSelectionStart(e))===(n=_l.getSelectionEnd(e))||_l.hasInverseSelection(e)?_l.select(e,n,Math.max(t-1,0)):_l.select(e,t,Math.max(n-1,0)),Ul(e)),El.resolve()},vl[gl.shiftRight]=function(e){var t,n,i;return Pl.isTextEditableElement(e)&&(t=_l.getSelectionStart(e),n=_l.getSelectionEnd(e),i=Pl.getElementValue(e).length,t!==n&&_l.hasInverseSelection(e)?_l.select(e,n,Math.min(t+1,i)):_l.select(e,t,Math.min(n+1,i)),Ul(e)),El.resolve()},vl[gl.shiftUp]=function(e){return yl.isWebKit&&Pl.isInputElement(e)?Nl(e):(Pl.isTextAreaElement(e)&&Ml(e,!0),El.resolve())},vl[gl.shiftDown]=function(e){return yl.isWebKit&&Pl.isInputElement(e)?Fl(e):(Pl.isTextAreaElement(e)&&Dl(e,!0),El.resolve())},vl[gl.shiftHome]=Nl,vl[gl.shiftEnd]=Fl,vl[gl.home]=Bl,vl[gl.end]=Ol,vl[gl.enter]=function(e){var t,n,i,o,r,s;return Pl.isSelectElement(e)&&Cl.collapseOptionList(),Pl.isInputElement(e)?(yl.isIE||bl.processElementChanging(e),(t=Pl.getParents(e,"form")[0])&&function(e,t){var n=e.querySelectorAll("input, button"),i=null,o=null;for(o=0;o<n.length;o++)if(!i&&"submit"===n[o].type&&!n[o].disabled){i=n[o];break}if(i)Sl.click(i);else if(Pl.blocksImplicitSubmission(t)){for(var r=e.getElementsByTagName("input"),s=[],o=0;o<r.length;o++)Pl.blocksImplicitSubmission(r[o])&&s.push(r[o]);1===s.length&&s[0]===t&&t.validity.valid&&Sl.submit(e)&&e.submit()}}(t,e)):Pl.isTextAreaElement(e)?(n=_l.getSelectionStart(e),o=(i=Pl.getTextAreaValue(e)).substring(0,n),r=i.substring(n),s=n+1,kl(e,o+String.fromCharCode(10)+r,s)):e.tagName&&Pl.isAnchorElement(e)&&Sl.click(e),El.resolve()},vl[gl.tab]=function(e){return Ll(e,!1)},vl[gl.shiftTab]=function(e){return Ll(e,!0)},vl[gl.esc]=function(e){return Pl.isSelectElement(e)&&Cl.collapseOptionList(),El.resolve()},vl),Xl=m.Promise,Rl=m.utils.browser,Wl=m.eventSandbox.message,Hl=m.nativeMethods,Gl="automation|press|request",ql="automation|press|response";Wl.on(Wl.SERVICE_MSG_RECEIVED_EVENT,function(e){e.message.cmd===Gl&&(m.on(m.EVENTS.beforeUnload,function(){return Wl.sendServiceMsg({cmd:ql},e.source)}),new zl(e.message.keyCombinations,e.message.options).run().then(function(){return Wl.sendServiceMsg({cmd:ql},e.source)}))});var zl=(jl._getKeyPressSimulators=function(e){var t=function(e){for(var t=e.slice(),n=0;n<e.length;n++){var i=e[n];if("shift"===i.toLowerCase()){var o=e[n+1];if(!o)continue;g.KEY_MAPS.shiftMap[o]?e[n+1]=g.KEY_MAPS.shiftMap[o]:g.KEY_MAPS.reversedShiftMap[o]&&(t[n+1]=g.KEY_MAPS.reversedShiftMap[o])}!g.KEY_MAPS.shiftMap[i]||e[n-1]&&"shift"===e[n-1].toLowerCase()||(e[n]=g.KEY_MAPS.shiftMap[i],e.splice(n,0,"shift"),t.splice(n,0,"shift"),n++)}return{actualKeys:e,eventKeyProperties:t}}(g.getKeyArray(e)),n=t.actualKeys,i=t.eventKeyProperties;return g.arrayUtils.map(n,function(e,t){return new ml(e,i[t])})},jl._getShortcuts=function(e){for(var t=g.getKeyArray(e.toLowerCase()),n=[],i=[],o=[],r=0;r<t.length;r++)for(i.push(t[r]),o=i.slice();o.length;){var s=o.join("+");Vl[s]?(n.push(s),i=o=[]):o.shift()}return n},jl._getShortcutHandlers=function(e){for(var t,n,i,o=jl._getShortcuts(e.toLowerCase()),r={},s="",l=0;l<o.length;l++)t=o[l],n=e.indexOf(t),i=t.length,r[s+=e.substring(0,n+i)]=Vl[t],e=e.substring(n+i);return r},jl.prototype._down=function(e){this.pressedKeyString+=(this.pressedKeyString?"+":"")+e.key;var t=!e.down(this.modifiersState);return Xl.resolve(t)},jl.prototype._press=function(e,t){var n=this;if(t&&!this.isSelectElement)return g.delay(this.automationSettings.keyActionStepDelay);var i=this.shortcutHandlers[this.pressedKeyString],o=!1;return i&&!Rl.isFirefox&&"enter"!==e.key||(o=!e.press(this.modifiersState)),o&&!this.isSelectElement||!i?g.delay(this.automationSettings.keyActionStepDelay):i(ol(this.topSameDomainDocument)).then(function(){return g.delay(n.automationSettings.keyActionStepDelay)})},jl.prototype._up=function(e){return e.up(this.modifiersState),g.delay(this.automationSettings.keyActionStepDelay)},jl.prototype._runCombination=function(e){var n=this;this.modifiersState={ctrl:!1,alt:!1,shift:!1,meta:!1},this.isSelectElement=g.domUtils.isSelectElement(ol(this.topSameDomainDocument)),this.pressedKeyString="",this.shortcutHandlers=jl._getShortcutHandlers(e);var t=jl._getKeyPressSimulators(e);return g.promiseUtils.each(t,function(t){return n._down(t).then(function(e){return n._press(t,e)})}).then(function(){return g.arrayUtils.reverse(t),g.promiseUtils.each(t,function(e){return n._up(e)})})},jl.prototype.run=function(){var t=this,e=g.domUtils.getActiveElement(),n=g.domUtils.isIframeElement(e);if(!ue(hu)&&n&&Hl.contentWindowGetter.call(e)){var i={cmd:Gl,keyCombinations:this.keyCombinations,options:this.options};return g.sendRequestToFrame(i,ql,Hl.contentWindowGetter.call(e))}return g.promiseUtils.each(this.keyCombinations,function(e){return t._runCombination(e).then(function(){return g.delay(t.automationSettings.keyActionStepDelay)})})},jl);function jl(e,t){this.keyCombinations=e,this.isSelectElement=!1,this.pressedKeyString="",this.modifiersState=null,this.shortcutHandlers=null,this.topSameDomainDocument=g.domUtils.getTopSameDomainWindow(hu).document,this.automationSettings=new Se(t.speed),this.options=t}var $l,Zl=m.Promise,Jl=m.utils.extend,Ql=m.utils.browser,ea=m.eventSandbox.eventSimulator,ta=y.domUtils,na=y.eventUtils,ia=y.delay,oa=(t(ra,$l=Ao),ra.prototype._mousedown=function(e){var t=this;return so.rightButtonDown().then(function(){return t.eventState.activeElementBeforeMouseDown=ta.getActiveElement(),t.eventState.simulateDefaultBehavior=ea.mousedown(e.element,e.options),t._focus(e)})},ra.prototype._focus=function(e){return!1===this.simulateDefaultBehavior?er():jo(ta.isContentEditableElement(this.element)?this.element:e.element,!Ql.isIE||this.eventState.activeElementBeforeMouseDown===ta.getActiveElement(),this.caretPos).then(er)},ra.prototype._mouseup=function(t){var e=this;return so.buttonUp().then(function(){return e._getElementForEvent(t)}).then(function(e){return ea.mouseup(e,t.options)})},ra.prototype._contextmenu=function(t){return this._getElementForEvent(t).then(function(e){ea.contextmenu(e,t.options),ta.isElementFocusable(e)||Zo(e)})},ra.prototype.run=function(e){var o=this,r=null;return this._ensureElement(e).then(function(e){var t=e.element,n=e.clientPoint,i=e.devicePoint;return r={point:n,element:t,options:Jl({clientX:n.x,clientY:n.y,screenX:i.x,screenY:i.y,button:na.BUTTON.right},o.modifiers)},Zl.all([ia(o.automationSettings.mouseActionStepDelay),o._mousedown(r)])}).then(function(){return o._mouseup(r)}).then(function(){return o._contextmenu(r)})},ra);function ra(e,t){var n=$l.call(this,e,t)||this;return n.modifiers=t.modifiers,n.caretPos=t.caretPos,n.eventState={simulateDefaultBehavior:!0,activeElementBeforeMouseDown:null},n}var sa=m.utils.browser,la=y.domUtils,aa=y.positionUtils,ua=y.styleUtils,ca=y.contentEditable,ha=y.arrayUtils,fa=["direction","font-family","font-size","font-size-adjust","font-variant","font-weight","font-style","letter-spacing","line-height","text-align","text-indent","text-transform","word-wrap","word-spacing","padding-top","padding-left","padding-right","padding-bottom","margin-top","margin-left","margin-right","margin-bottom","border-top-width","border-left-width","border-right-width","border-bottom-width"];function da(e,t){var n,i,o,r,s,l=ua.getBordersWidth(e),a=aa.getOffsetPosition(e),u=e.scrollHeight||e.getBoundingClientRect().height,c=Math.ceil(t.left),h=Math.ceil(t.top),f=Math.floor(t.bottom);return la.isTextAreaElement(e)||(i=(n=aa.offsetToClientCoords({x:a.left,y:a.top})).x+l.left+1,o=n.y+l.top+1,r=n.y+l.top+l.bottom+u,s=n.y+l.top+u-1,c=Math.ceil(c<=n.x?i:t.left),h=Math.ceil(h<=n.y?o:t.top),f=Math.floor(r<=f?s:t.bottom)),{left:c,top:h,bottom:f}}function ma(e){var t=ua.getElementScroll(fu);return{left:e.left+t.left,top:e.top+t.top,bottom:e.bottom+t.top}}function pa(e,t){var n=e.getBoundingClientRect(),i=function(t){var e,n,i,o=fu.body,r=aa.getOffsetPosition(t),s=ua.getElementMargin(t),l=r.top-s.top,a=r.left-s.left,u=fu.createElement("div"),c="white-space:pre-wrap;border-style:solid;";return"absolute"===ua.get(o,"position")&&(e=ua.getElementMargin(o),n=ua.get(o,"left"),i=ua.get(o,"top"),a-=e.left+(parseInt(n.replace("px",""),10)||0),l-=e.top+(parseInt(i.replace("px",""),10)||0)),ha.forEach(fa,function(e){c+=e+":"+ua.get(t,e)+";"}),ua.set(u,{cssText:c,position:"absolute",left:a+"px",top:l+"px",width:t.scrollWidth+"px",height:t.scrollHeight+"px"}),m.nativeMethods.nodeTextContentSetter.call(u,la.getElementValue(t)+" "),o.appendChild(u),u}(e),o=null,r=e.getBoundingClientRect(),s=r.top-n.top,l=r.left-n.left,a=la.getElementValue(e).length;try{var u=fu.createRange();u.setStart(m.nativeMethods.nodeFirstChildGetter.call(i),Math.min(t,a)),u.setEnd(m.nativeMethods.nodeFirstChildGetter.call(i),Math.min(t+1,a+1)),la.isTextAreaElement(e)&&(0!==(o=u.getBoundingClientRect()).width||0!==o.height)||(o=u.getClientRects()[0])}catch(e){o=null}return la.remove(i),o?{width:o.width,height:o.height,top:o.top-s,bottom:o.bottom-s,left:o.left-l,right:o.right-l}:null}function va(e,t){var n,i,o,r,s,l,a=null;return(a=la.isContentEditableElement(e)?(o=e,r=t,s=la.findDocument(o).createRange(),l=ca.calculateNodeAndOffsetByPosition(o,r),s.setStart(l.node,Math.min(l.offset,l.node.length)),s.setEnd(l.node,Math.min(l.offset,l.node.length)),s.getClientRects()[0]):"function"==typeof e.createTextRange?(n=t,(i=e.createTextRange()).collapse(!0),i.moveStart("character",n),i.moveEnd("character",n),i.collapse(!0),i.getBoundingClientRect()):pa(e,t))?{x:(a=ma(a=da(e,a))).left,y:Math.floor(a.top+(a.bottom-a.top)/2)}:null}function ga(e,t){var n=la.isTextEditableElement(e),i=la.isContentEditableElement(e);return n&&0<la.getElementValue(e).length||i&&ca.getContentEditableValue(e).length?va(e,t):aa.findCenter(e)}function Ea(e,t,n){var i=la.findDocument(e).createRange();i.setStart(t,Math.min(n,t.length)),i.setEnd(t,Math.min(n,t.length));var o=i.getClientRects()[0];return o?{x:(o=ma(da(e,o))).left,y:Math.floor(o.top+(o.bottom-o.top)/2)}:null}var ya,Sa=m.Promise,ba=m.utils.browser,_a=m.utils.featureDetection,wa=m.eventSandbox.eventSimulator,Pa=m.eventSandbox.focusBlur,Ca=y.contentEditable,Aa=y.domUtils,xa=y.positionUtils,Ta=y.eventUtils,Ua=y.delay,Ma=(t(Da,ya=Ao),Da._calculateEventArguments=function(e){var t=xa.offsetToClientCoords(e);return Ee(t).then(function(e){if(!e)throw new Error(ye.elementIsInvisibleError);return{element:e,options:{clientX:t.x,clientY:t.y}}})},Da.prototype._move=function(e){var t=this,n=e.element,i=e.offsetX,o=e.offsetY,r=e.speed,s=new Xi({offsetX:i,offsetY:o,speed:r},!1);return po.create(n,hu,so,s).then(function(e){return e.run()}).then(function(){return Ua(t.automationSettings.mouseActionStepDelay)})},Da.prototype._bindMousedownHandler=function(){var t=this,n=function(e){t.eventState.mousedownPrevented=e.defaultPrevented,Ta.preventDefault(e),Ta.unbind(t.element,"mousedown",n)};Ta.bind(this.element,"mousedown",n)},Da.prototype._calculateAbsoluteStartPoint=function(){throw new Error("Not implemented")},Da.prototype._calculateAbsoluteEndPoint=function(){throw new Error("Not implemented")},Da.prototype._moveToPoint=function(e){!function(e,t){if(la.isEditableElement(e)){var n=la.isTextAreaElement(e);if(!la.isInputElement(e)||!(sa.isFirefox||sa.isIE&&10<sa.version)){var i=aa.getOffsetPosition(e),o=ua.getBordersWidth(e),r=ua.getElementScroll(e),s=t.x-i.left-o.left,l=t.y-i.top-o.top,a=null;if(n)return l<r.top&&(a=l),l>e.clientHeight+r.top&&(a=l-e.clientHeight),null!==a&&ua.setScrollTop(e,Math.round(a));s<r.left&&(a=s),s>e.clientWidth+r.left&&(a=s-e.clientWidth),null!==a&&ua.setScrollLeft(e,Math.round(a))}}}(this.element,e),this.clientPoint=function(e,t){var n=la.isTextEditableElement(e),i=la.isInputElement(e);if(!n&&!la.isContentEditableElement(e))return t;var o=aa.getOffsetPosition(e),r=ua.getBordersWidth(e),s=ua.getElementScroll(e),l=o.left+r.left+e.clientWidth;return i&&n&&(sa.isFirefox||sa.isIE&&10<sa.version)?{x:Math.min(t.x,l),y:t.y}:{x:t.x-s.left,y:t.y-s.top}}(this.element,e);var t={element:fu.documentElement,offsetX:this.clientPoint.x,offsetY:this.clientPoint.y,speed:this.speed};return this._move(t)},Da.prototype._mousedown=function(){var n=this;return so.leftButtonDown().then(function(){return Da._calculateEventArguments(n.clientPoint)}).then(function(e){n.eventArgs=e;var t=(ba.isWebKit||ba.isIE)&&Aa.isSelectElement(n.element);return t&&n._bindMousedownHandler(),n.eventState.simulateDefaultBehavior=wa[n.downEvent](n.eventArgs.element,n.eventArgs.options),!1===n.eventState.simulateDefaultBehavior&&(n.eventState.simulateDefaultBehavior=t&&!n.eventState.mousedownPrevented),n._focus()})},Da.prototype._focus=function(){var n=this;return new Sa(function(e){var t=Aa.isContentEditableElement(n.element)?Ca.findContentEditableParent(n.element):n.element;Pa.focus(t,e,!1,!0)})},Da.prototype._setSelection=function(){throw new Error("Not implemented")},Da.prototype._mouseup=function(){var t=this;return so.buttonUp().then(function(){return t._setSelection(),Da._calculateEventArguments(t.clientPoint)}).then(function(e){t.eventArgs=e,wa[t.upEvent](t.eventArgs.element,t.eventArgs.options)})},Da.prototype.run=function(){var e=this;return this.absoluteStartPoint=this._calculateAbsoluteStartPoint(),this.absoluteEndPoint=this._calculateAbsoluteEndPoint(),this._moveToPoint(this.absoluteStartPoint).then(function(){return e._mousedown()}).then(function(){return e._moveToPoint(e.absoluteEndPoint)}).then(function(){return e._mouseup()})},Da);function Da(e,t){var n=ya.call(this,e,t)||this;return n.absoluteStartPoint=null,n.absoluteEndPoint=null,n.clientPoint=null,n.speed=t.speed,n.downEvent=_a.isTouchDevice?"touchstart":"mousedown",n.upEvent=_a.isTouchDevice?"touchend":"mouseup",n.eventArgs={options:null,element:null},n.eventState={mousedownPrevented:!1,simulateDefaultBehavior:!0},n}var Ia,ka=y.textSelection,Ba=y.domUtils,Oa=y.positionUtils,Na=(t(Fa,Ia=Ma),Fa.prototype._calculateAbsoluteStartPoint=function(){return ga(this.element,this.startPos)||Oa.findCenter(this.element)},Fa.prototype._calculateAbsoluteEndPoint=function(){var e=ga(this.element,this.endPos);return e||(Ba.isContentEditableElement(this.element)?function(e,t,n){for(var i=n<t?1:-1,o=n,r=null;o!==t&&!(r=va(e,o+=i)););return r=r||va(e,t)||aa.findCenter(e)}(this.element,this.startPos,this.endPos):Oa.findCenter(this.element))},Fa.prototype._setSelection=function(){var e=Ba.isTextEditableElement(this.element),t=Ba.isContentEditableElement(this.element);(e||t)&&!1!==this.eventState.simulateDefaultBehavior&&ka.select(this.element,this.startPos,this.endPos)},Fa.prototype.run=function(e){var t=this;return this._ensureElement(e).then(function(){return Ia.prototype.run.call(t)})},Fa);function Fa(e,t,n,i){var o=Ia.call(this,e,i)||this;return o.startPos=t,o.endPos=n,o}var Ka,Ya=y.textSelection,La=y.contentEditable,Va=y.positionUtils,Xa=(t(Ra,Ka=Ma),Ra.prototype._calculateAbsoluteStartPoint=function(){return Ea(this.element,this.startNode,this.startOffset)||Va.findCenter(this.element)},Ra.prototype._calculateAbsoluteEndPoint=function(){return Ea(this.element,this.endNode,this.endOffset)||Va.findCenter(this.element)},Ra.prototype._setSelection=function(){var e,t;!1!==this.eventState.simulateDefaultBehavior&&(e={node:this.startNode,offset:this.startOffset},t={node:this.endNode,offset:this.endOffset},Ya.selectByNodesAndOffsets(e,t,!0))},Ra);function Ra(e,t,n){var i=Ka.call(this,La.getNearestCommonAncestor(e,t),n)||this,o=La.getFirstVisiblePosition(e),r=La.getLastVisiblePosition(t),s={node:e,offset:o},l={node:t,offset:r},a=La.calculatePositionByNodeAndOffset(i.element,s);return La.calculatePositionByNodeAndOffset(i.element,l)<a&&(o=La.getLastVisiblePosition(e),r=La.getFirstVisiblePosition(t)),s=La.calculateNodeAndOffsetByPosition(e,o),l=La.calculateNodeAndOffsetByPosition(t,r),i.startNode=s.node,i.startOffset=s.offset,i.endNode=l.node,i.endOffset=l.offset,i}var Wa=m.Promise,Ha=m.utils.extend,Ga=m.utils.browser,qa=m.eventSandbox.eventSimulator,za=m.eventSandbox.elementEditingWatcher,ja=y.domUtils,$a=y.promiseUtils,Za=y.contentEditable,Ja=y.textSelection,Qa=y.delay,eu=y.KEY_MAPS.specialKeys,tu=(nu.findTextEditableChild=function(e){var t=null;if(!ja.isEditableElement(e))for(var n=e.querySelectorAll("*"),i=0;i<n.length;i++)if(ja.isTextEditableElementAndEditingAllowed(n[i])){t=n[i];break}return t},nu.prototype._calculateEventArguments=function(e){var t=ja.getActiveElement(),n=ja.isContentEditableElement(this.element),i=this.eventArgs.element||this.element;n||t===i||(i=nu.findTextEditableChild(t)||t);var o=Ha({keyCode:e?this.currentCharCode:this.currentKeyCode},this.modifiers);return e&&(o.charCode=this.currentCharCode),Ha(o,cl(e,this.currentKey,this.currentKeyIdentifier)),{element:i,options:o}},nu.prototype._calculateTargetElement=function(){var e=ja.getActiveElement(),t=ja.isContentEditableElement(this.element);if(t){if(e!==Za.findContentEditableParent(this.element))return void(this.eventState.skipType=!0)}else if(e!==this.element)return void(this.eventState.skipType=!0);this.element=t?this.element:e},nu.prototype._click=function(e){var t,n=this,i=ja.getActiveElement(),o=ja.isTextEditableElementAndEditingAllowed(this.element),r=ja.isContentEditableElement(this.element);if(i===this.element)return o&&za.watchElementEditing(this.element),(o||r)&&(t=Ja.getSelectionStart(this.element),isNaN(parseInt(this.caretPos,10))||this.caretPos===t||Ja.select(this.element,this.caretPos,this.caretPos)),Wa.resolve();var s=le(this.element),l=s.offsetX,a=s.offsetY,u=new Yi({offsetX:this.elementChanged?l:this.offsetX,offsetY:this.elementChanged?a:this.offsetY,speed:this.speed,caretPos:this.caretPos,modifiers:this.modifiers});return new kr(this.element,u).run(e).then(function(){return Qa(n.automationSettings.mouseActionStepDelay)})},nu.prototype._type=function(){var e=this;if(this.eventState.skipType)return Wa.resolve();var t=ja.isContentEditableElement(this.element);return this.replace&&(ja.isTextEditableElementAndEditingAllowed(this.element)?Ja.select(this.element):t&&Ja.deleteSelectionContents(this.element,!0)),$a.whilst(function(){return!e._isTypingFinished()},function(){return e._typingStep()})},nu.prototype._isTypingFinished=function(){return this.currentPos===this.typingText.length},nu.prototype._typingStep=function(){var e=this.typingText.charAt(this.currentPos);return this.currentKeyCode=ll(e),this.currentCharCode=this.typingText.charCodeAt(this.currentPos),this.currentKey=this.currentKeyCode===eu.enter?"Enter":e,this.currentKeyIdentifier=ul(this.currentKey),this.ignoreChangeEvent=ja.getElementValue(this.element)===za.getElementSavedValue(this.element),this._keydown(),this._keypress(),this._keyup()},nu.prototype._keydown=function(){this.eventArgs=this._calculateEventArguments(),this.eventState.simulateKeypress=qa.keydown(this.eventArgs.element,this.eventArgs.options)},nu.prototype._keypress=function(){!1!==this.eventState.simulateKeypress&&(this.eventArgs=this._calculateEventArguments(!0),this.eventState.simulateTypeChar=Ga.isAndroid||qa.keypress(this.eventArgs.element,this.eventArgs.options))},nu.prototype._keyup=function(){var e=this,t=this.eventArgs.element;this.eventArgs=this._calculateEventArguments();var n=ja.isTextEditableElement(this.element),i=ja.isContentEditableElement(this.element),o=this.paste||!n&&!i;return Wa.resolve().then(function(){return o?e._typeAllText(t):e._typeChar(t)}).then(function(){qa.keyup(e.eventArgs.element,e.eventArgs.options),o?e.currentPos=e.typingText.length:e.currentPos++})},nu.prototype._typeChar=function(e){if(!1===this.eventState.simulateKeypress||!1===this.eventState.simulateTypeChar)return this.ignoreChangeEvent&&za.restartWatchingElementEditing(e),Qa(this.automationSettings.keyActionStepDelay);var t=this.typingText.charAt(this.currentPos),n=/^\d$/.test(t),i=0===this.currentPos?null:this.typingText.charAt(this.currentPos-1);if(ja.isInputElement(e)&&"number"===e.type){var o=Ja.getSelectionStart(e),r=ja.getInputValue(e).length,s=/^\d/.test(this.typingText);if(!n&&(s||!("."===t||"-"===t&&r)||0!==o))return Qa(this.automationSettings.keyActionStepDelay);n&&("."===i||"-"===i&&!r)&&(t=i+t)}return zs(e,t,null),Qa(this.automationSettings.keyActionStepDelay)},nu.prototype._typeAllText=function(e){return zs(e,this.typingText,this.caretPos),Qa(this.automationSettings.keyActionStepDelay)},nu.prototype.run=function(e){var t=this;return this._click(e).then(function(){return t._calculateTargetElement()}).then(function(){return t._type()})},nu);function nu(e,t,n){this.element=nu.findTextEditableChild(e)||e,this.typingText=t.toString(),this.modifiers=n.modifiers,this.caretPos=n.caretPos,this.replace=n.replace,this.paste=n.paste,this.offsetX=n.offsetX,this.offsetY=n.offsetY,this.speed=n.speed,this.automationSettings=new Se(this.speed),this.elementChanged=e!==this.element,this.currentPos=0,this.currentKeyCode=null,this.currentCharCode=null,this.currentKey=null,this.currentKeyIdentifier=null,this.ignoreChangeEvent=!0,this.eventArgs={options:null,element:null},this.eventState={skipType:!1,simulateKeypress:!0,simulateTypeChar:!0}}var iu=(ou.prototype.run=function(){var i=this;return e.doUpload(this.element,this.paths).then(function(e){if(e.length){var t=g.arrayUtils.map(e,function(e){return e.path}),n=g.arrayUtils.reduce(e,function(e,t){return e.concat(t.resolvedPaths)},[]);throw i.createError(t,n)}})},ou);function ou(e,t,n){this.element=e,this.paths=t,this.createError=n}var ru=y.domUtils,su=y.contentEditable,lu={};lu.DispatchEvent=te,lu.SetScroll=Mo,lu.ScrollIntoView=ko,lu.Click=kr,lu.SelectChildClick=Gr,lu.DblClick=ts,lu.DragToOffset=Cs,lu.DragToElement=Us,lu.Hover=Is,lu.Press=zl,lu.RClick=oa,lu.SelectText=Na,lu.SelectEditableContent=Xa,lu.Type=tu,lu.Upload=iu,lu.MouseOptions=Ni,lu.ClickOptions=Yi,lu.TypeOptions=ji,lu.ERROR_TYPES=ye,lu.AutomationSettings=Se,lu.getOffsetOptions=ae,lu.calculateSelectTextArguments=function(e,t){void 0===t&&(t={});var n,i,o,r,s,l,a,u,c,h,f,d=ru.isTextEditableElement(e),m=d?0:su.getFirstVisiblePosition(e),p=d?ru.getElementValue(e).length:su.getLastVisiblePosition(e),v=t.startPos?Math.min(t.startPos,p):m,g=void 0===t.endPos||null===t.endPos?p:Math.min(t.endPos,p);return void 0!==t.offset?(g=0<=t.offset?Math.min(t.offset,g):(v=g,Math.max(0,g+t.offset)),{startPos:v,endPos:g}):void 0!==t.startLine?(n=e,i=t,o=ru.getTextAreaValue(n),r=o&&o.length?o.split("\n"):[],s=r.length-1,l=i.startLine?Math.min(i.startLine,s):0,a=r[l]?r[l].length:0,u=i.startPos?Math.min(i.startPos,a):0,c=void 0===i.endLine||null===i.endLine?s:Math.min(i.endLine,s),h=r[c]?r[c].length:0,f=void 0===i.endPos||null===i.endPos?h:Math.min(i.endPos,h),{startPos:ru.getTextareaPositionByLineAndOffset(n,l,0)+u,endPos:ru.getTextareaPositionByLineAndOffset(n,c,0)+f}):{startPos:v,endPos:g}},lu.cursor=so,lu.getNextFocusableElement=sl,lu.SHORTCUT_TYPE=gl,lu.getSelectionCoordinatesByPosition=ga,lu.getElementFromPoint=Ee;var au=m.nativeMethods,uu=m.EVENTS.evalIframeScript;au.objectDefineProperty(hu,"%testCafeAutomation%",{configurable:!0,value:lu}),m.on(uu,function(e){return cu(au.contentWindowGetter.call(e.iframe))})}(hu["%hammerhead%"],hu["%testCafeCore%"],hu["%testCafeUI%"],hu["%hammerhead%"].Promise)}(window);
|
|
1
|
+
window["%hammerhead%"].utils.removeInjectedScript(),function Pu(Cu){var xu=Cu.document;!function(t,g,i,u){var m="default"in t?t.default:t,y="default"in g?g.default:g;i=i&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i,u=u&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u;var v={},o=y.positionUtils,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)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function e(t,e){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,l,a){return new(l=l||u)(function(n,e){function i(t){try{r(a.next(t))}catch(t){e(t)}}function o(t){try{r(a.throw(t))}catch(t){e(t)}}function r(t){var e;t.done?n(t.value):((e=t.value)instanceof l?e:new l(function(t){t(e)})).then(i,o)}r((a=a.apply(t,s||[])).next())})}function b(n,i){var o,r,s,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,r&&(s=2&e[0]?r.return:e[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,e[1])).done)return s;switch(r=0,s&&(e=[2&e[0],s.value]),e[0]){case 0:case 1:s=e;break;case 4:return l.label++,{value:e[1],done:!1};case 5:l.label++,r=e[1],e=[0];continue;case 7:e=l.ops.pop(),l.trys.pop();continue;default:if(!(s=0<(s=l.trys).length&&s[s.length-1])&&(6===e[0]||2===e[0])){l=0;continue}if(3===e[0]&&(!s||e[1]>s[0]&&e[1]<s[3])){l.label=e[1];break}if(6===e[0]&&l.label<s[1]){l.label=s[1],s=e;break}if(s&&l.label<s[2]){l.label=s[2],l.ops.push(e);break}s[2]&&l.ops.pop(),l.trys.pop();continue}e=i.call(n,l)}catch(t){e=[6,t],r=0}finally{o=s=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}var n=null,p=function(){return n},c=function(t){n=t},E=(s.create=function(t){return"left"in t?new s(t.left,t.top):"right"in t?new s(t.right,t.bottom):new s(t.x,t.y)},s.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},s.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},s.prototype.round=function(t){return void 0===t&&(t=Math.round),this.x=t(this.x),this.y=t(this.y),this},s.prototype.eql=function(t){return this.x===t.x&&this.y===t.y},s.prototype.mul=function(t){return this.x*=t,this.y*=t,this},s.prototype.distance=function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))},s);function s(t,e){this.x=t,this.y=e}function h(r){return S(this,void 0,void 0,function(){return b(this,function(t){return r?[2,v.PromiseCtor.resolve(v.position.getWindowPosition()).then(function(t){var e=t.x,n=t.y,i=e+r.x,o=n+r.y;return new E(i,o)})]:[2,null]})})}var l=m.eventSandbox.eventSimulator,a=m.utils.extend,f=m.nativeMethods,d=(w.leaveElement=function(t,e,n,i){l.mouseout(e,a({relatedTarget:t},i));for(var o=e;o&&o!==n;)l.mouseleave(o,a({relatedTarget:t},i)),o=f.nodeParentNodeGetter.call(o)},w.enterElement=function(t,e,n,i){l.mouseover(t,a({relatedTarget:e},i));for(var o=t,r=[];o&&o!==n;)r.push(o),o=g.domUtils.getParentExceptShadowRoot(o);for(var s=r.length-1;-1<s;s--)l.mouseenter(r[s],a({relatedTarget:e},i))},w.move=function(t,e,n){l[t](e,n)},w);function w(){}var _=(P.dragAndDrop=function(t,e,n,i){return l.drag(t,i),e!==n&&(g.domUtils.isElementInDocument(e)&&(i.relatedTarget=n,l.dragenter(e,i)),n&&(i.relatedTarget=e,l.dragleave(n,i))),!l.dragover(e,i)},P);function P(){}var C=y.positionUtils,x=y.domUtils,A=y.eventUtils,T=m.utils.browser,M=(D.prototype.setup=function(){this.dragAndDropMode=!1,this.dropAllowed=!1},D.prototype.leaveElement=function(){},D.prototype.move=function(){},D.prototype.enterElement=function(){},D.prototype.dragAndDrop=function(){},D.prototype.teardown=function(){},D.prototype.run=function(t,e,n,i,o){var r=e&&g.domUtils.isElementInDocument(e),s=e&&g.domUtils.isElementInIframe(e)&&!g.domUtils.getIframeByElement(e);r&&!s||(e=null);var l=t!==e,a=l?g.domUtils.getCommonAncestor(t,e):null;this.setup(),l&&e&&this.leaveElement(t,e,a,n),T.isIE&&this.move(t,n),l&&g.domUtils.isElementInDocument(t)&&this.enterElement(t,e,a,n),T.isIE||this.move(t,n),this.dragAndDrop(i,t,e,n,o),this.teardown(t,n,e);var u=this.dragAndDropMode,c=this.dropAllowed;return this.dragAndDropMode=!1,this.dropAllowed=!1,{dragAndDropMode:u,dropAllowed:c}},D);function D(t){var e=t.moveEvent;this.dragAndDropMode=!1,this.dropAllowed=!1,this.moveEvent=e}var U,I=m.eventSandbox.eventSimulator,k=(e(B,U=M),B.prototype.leaveElement=function(t,e,n,i){d.leaveElement(t,e,n,i)},B.prototype.enterElement=function(t,e,n,i){d.enterElement(t,e,n,i)},B.prototype.move=function(t,e){this._needEmulateMoveEvent()&&d.move(this.moveEvent,t,e)},B.prototype.teardown=function(t,e,n){this._needEmulateMoveEvent()&&g.domUtils.isElementInDocument(t)&&t!==n&&I[this.moveEvent](t,e)},B.prototype._needEmulateMoveEvent=function(){return"touchmove"!==this.moveEvent||this.holdLeftButton},B);function B(t){var e=U.call(this,t)||this;return e.holdLeftButton=t.holdLeftButton,e}var N,O=(e(F,N=M),F.prototype.setup=function(){N.prototype.setup.call(this),this.dragAndDropMode=!0},F.prototype.dragAndDrop=function(t,e,n,i){this.dropAllowed=_.dragAndDrop(t,e,n,i)},F);function F(){return null!==N&&N.apply(this,arguments)||this}var L,K=m.eventSandbox.eventSimulator,Y=(e(V,L=M),V.prototype.setup=function(){L.prototype.setup.call(this),this.dragAndDropMode=!0},V.prototype.leaveElement=function(t,e,n,i){d.leaveElement(t,e,n,i)},V.prototype.move=function(t,e){d.move(this.moveEvent,t,e)},V.prototype.enterElement=function(t,e,n,i){d.enterElement(t,e,n,i)},V.prototype.dragAndDrop=function(t,e,n,i,o){var r=K.dragstart(t,i);o.setReadOnlyMode(),r?this.dropAllowed=_.dragAndDrop(t,e,n,i):this.dragAndDropMode=!1},V.prototype.run=function(t,e,n,i,o){return L.prototype.run.call(this,t,null,n,i,o)},V);function V(){return null!==L&&L.apply(this,arguments)||this}function X(t,e,n){return new(t?e?O:Y:k)(n)}var W=m.Promise,R=m.eventSandbox.message;function H(t,i,e){return new W(function(n){R.on(R.SERVICE_MSG_RECEIVED_EVENT,function t(e){e.message.cmd===i&&(R.off(R.SERVICE_MSG_RECEIVED_EVENT,t),n(e.message))}),R.sendServiceMsg(t,e)})}function q(t){return t.top!==t}var G=m.Promise,z=m.nativeMethods,j=m.utils.browser,$=m.eventSandbox.focusBlur,Z=y.contentEditable,J=y.textSelection,Q=y.domUtils,tt=y.styleUtils,et=m.eventSandbox.message,nt="automation|iframe|request",it="automation|iframe|response";function ot(v,g,E){var t=this;return new G(function(p){return S(t,void 0,void 0,function(){var s,n,i,o,r,l,a,u,c,h,f,d,m;return b(this,function(t){switch(t.label){case 0:return q(Cu)?[4,H({cmd:nt},it,Cu.parent)]:[3,2];case 1:t.sent(),t.label=2;case 2:if(s=Q.getActiveElement(),n=Q.isTextEditableElement(v),i=Q.closest(v,"label[for]"),o=Q.isElementFocusable(v),r=!o&&i,l=Q.isContentEditableElement(v),a=l?Z.findContentEditableParent(v):v,g&&j.isWebKit&&n&&J.select(v,0,0),r)return g&&(e=i,Q.isElementFocusable(e)?$.focus(e,y.noop,!1,!0):st(e)),p(),[2];if(u=!g,c=!1,!o&&!l){if(h=Q.findDocument(a),f=z.documentActiveElementGetter.call(h),d=Q.isBodyElement(f),m=Q.isBodyElement(a)?a:Q.getFocusableParent(a),f&&!d&&Q.containsElement(f,a)||d&&Q.isBodyElement(m))return p(),[2];a=m||h.body,c=!0}return $.focus(a,function(){var t,e,n,i,o,r;!g||l||v===Q.getActiveElement()?(t=v,e=E,o=Q.isTextEditableElement(t),r=Q.isContentEditableElement(t),o||r?r&&isNaN(parseInt(e,10))?J.setCursorToLastVisiblePosition(t):(n=isNaN(parseInt(e,10))?Q.getElementValue(t).length:e,J.select(t,n,n)):(i=Z.findContentEditableParent(t))&&J.setCursorToLastVisiblePosition(Z.findContentEditableParent(i)),g||Q.getActiveElement()===s?p():$.focus(s,p,!0,!0)):p()},u,!0,!1,c),[2]}var e})})})}function rt(t){var e=Q.closest(t,"label[for]"),n=e&&(e.control||xu.getElementById(e.htmlFor));return n&&tt.isElementVisible(n)?n:null}function st(t){var e=rt(t);e&&Q.getActiveElement()!==e&&$.focus(e,y.noop,!1,!0)}et.on(et.SERVICE_MSG_RECEIVED_EVENT,function(t){var e;t.message.cmd===nt&&(e=Q.findIframeByWindow(t.source),$.focus(e,function(){et.sendServiceMsg({cmd:it},t.source)},!1))});var lt=m.Promise,at=m.nativeMethods;function ut(){return new lt(function(t){return at.setTimeout.call(Cu,t,0)})}var ct=m.utils.browser,ht=m.eventSandbox.eventSimulator,ft=m.eventSandbox.listeners,dt=m.nativeMethods,mt=y.domUtils,pt=y.styleUtils,vt=i.selectElement,gt=(Et.prototype.run=function(){this.eventState.clickElement&&ht.click(this.eventState.clickElement,this.eventArgs.options),mt.isElementFocusable(this.eventArgs.element)||st(this.eventArgs.element)},Et);function Et(t,e){this.eventState=t,this.eventArgs=e}var yt,St=(e(bt,yt=gt),bt.prototype.run=function(){function t(t){n=dt.eventTargetGetter.call(t)===e.input}var e=this,n=!1;ft.addInternalEventBeforeListener(Cu,["focus"],t),yt.prototype.run.call(this),ft.removeInternalEventBeforeListener(Cu,["focus"],t),mt.isElementFocusable(this.label)&&!n&&this._ensureBoundElementFocusRaised()},bt.prototype._ensureBoundElementFocusRaised=function(){ht.focus(this.input)},bt);function bt(t,e){var n=yt.call(this,t,e)||this;return n.label=n.eventArgs.element,n.input=rt(n.eventArgs.element),n}var wt,_t=(e(Pt,wt=gt),Pt.prototype.run=function(){wt.prototype.run.call(this),this._toggleSelectOptionList()},Pt.prototype._toggleSelectOptionList=function(){var t=this.eventArgs.element;1===pt.getSelectElementSize(t)&&!1!==this.eventState.simulateDefaultBehavior&&(vt.isOptionListExpanded(t)?vt.collapseOptionList():vt.expandOptionList(t))},Pt);function Pt(t,e){return wt.call(this,t,e)||this}var Ct,xt=(e(At,Ct=gt),At.prototype.run=function(){return this.eventArgs.element},At);function At(t,e){return Ct.call(this,t,e)||this}var Tt,Mt,Dt=(e(Ut,Tt=St),Ut.prototype.run=function(){function t(){e=!0}var e=!1;ft.addInternalEventBeforeListener(Cu,["change"],t),Tt.prototype.run.call(this),ft.removeInternalEventBeforeListener(Cu,["change"],t),ct.isChrome&&!e&&this._ensureCheckboxStateChanged()},Ut.prototype._ensureCheckboxStateChanged=function(){this.checkbox.checked=!this.checkbox.checked,ht.change(this.checkbox)},Ut);function Ut(t,e){var n=Tt.call(this,t,e)||this;return n.checkbox=n.input,n}function It(){}function kt(){return Mt.call(this)||this}e(kt,Mt=It),kt.prototype.mousedown=function(){throw new Error("not implemented")},kt.prototype.mouseup=function(){throw new Error("not implemented")};var Bt,Nt=m.Promise,Ot=m.utils.browser,Ft=m.utils.featureDetection,Lt=m.eventSandbox.eventSimulator,Kt=m.eventSandbox.listeners,Yt=y.domUtils,Vt=y.eventUtils,Xt=y.arrayUtils,Wt=(e(Rt,Bt=It),Rt.prototype.mousedown=function(t){var e=this;this.targetElementParentNodes=Yt.getParents(t.element),this.mouseDownElement=t.element,this._raiseTouchEvents(t);var n=Yt.getActiveElement();this.activeElementBeforeMouseDown=n;var i=(Ot.isWebKit||Ot.isIE)&&Yt.isSelectElement(this.mouseDownElement);return i&&this._bindMousedownHandler(),this._bindBlurHandler(n),this._isTouchEventWasCancelled()||(this.eventState.simulateDefaultBehavior=Lt.mousedown(t.element,t.options)),!1===this.eventState.simulateDefaultBehavior&&(this.eventState.simulateDefaultBehavior=i&&!this.eventState.mousedownPrevented),this._ensureActiveElementBlur(n).then(function(){return e._focus(t)})},Rt.prototype.mouseup=function(t,e){var n,i,o,r,s;e.element=t,this.eventState.clickElement=(n=this.mouseDownElement,i=t,o=this.targetElementParentNodes,r=Yt.getParents(i),s=Yt.isTheSameNode(i,n),Ot.isFirefox?s?n:null:s?Xt.equals(o,r)?n:null:n.contains(i)&&!Yt.isEditableFormElement(i)?n:i.contains(n)?i:Xt.getCommonElement(r,o));var l={},a=function(t){l=t.timeStamp,Kt.removeInternalEventBeforeListener(Cu,["mouseup"],a)};return Ot.isIE||Kt.addInternalEventBeforeListener(Cu,["mouseup"],a),this._isTouchEventWasCancelled()||Lt.mouseup(t,e.options),e.options&&(e.options.timeStamp=l),this._click(e)},Rt.prototype._click=function(u){return S(this,void 0,m.Promise,function(){var a;return b(this,function(t){var e,n,i,o,r,s,l;return e=this.eventState,i=rt((n=u).element),o=mt.isSelectElement(n.element),r=mt.isOptionElement(n.element),s=mt.isLabelElement(n.element)&&i,l=i&&mt.isCheckboxElement(i),a=new(o?_t:r?xt:l?Dt:s?St:gt)(e,n),this._isTouchEventWasCancelled()||a.run(),[2,u]})})},Rt.prototype._isTouchEventWasCancelled=function(){return this.eventState.touchStartCancelled||this.eventState.touchEndCancelled},Rt.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,Vt.preventDefault(t),Vt.unbind(e.element,"mousedown",n)};Vt.bind(this.element,"mousedown",n)},Rt.prototype._bindBlurHandler=function(t){var e=this,n=function(){e.eventState.blurRaised=!0,Vt.unbind(t,"blur",n,!0)};Vt.bind(t,"blur",n,!0)},Rt.prototype._ensureActiveElementBlur=function(e){var n=this;return new Nt(function(t){Yt.getActiveElement()===e||n.eventState.blurRaised?t():Ot.isIE&&Ot.version<12?ut().then(function(){n.eventState.blurRaised||Lt.blur(e),t()}):(Lt.blur(e),t())})},Rt.prototype._focus=function(t){return!1===this.eventState.simulateDefaultBehavior?Nt.resolve():ot(Yt.isContentEditableElement(this.element)?this.element:t.element,!Ot.isIE||this.activeElementBeforeMouseDown===Yt.getActiveElement(),this.caretPos)},Rt.prototype._raiseTouchEvents=function(t){Ft.isTouchDevice&&(this.eventState.touchStartCancelled=!Lt.touchstart(t.element,t.options),this.eventState.touchEndCancelled=!Lt.touchend(t.element,t.options))},Rt);function Rt(t,e){var n=Bt.call(this)||this;return n.element=t,n.caretPos=e,n.targetElementParentNodes=[],n.activeElementBeforeMouseDown=null,n.mouseDownElement=null,n.eventState={mousedownPrevented:!1,blurRaised:!1,simulateDefaultBehavior:!0,clickElement:null,touchStartCancelled:!1,touchEndCancelled:!1},n}var Ht=(qt.prototype._ensureActiveWindow=function(t){this._activeWindow!==t&&this._activeWindow!==t.parent&&this._activeWindow.parent!==t&&(this._activeWindow=t)},qt.prototype.isActive=function(t){return this._ensureActiveWindow(t),this._activeWindow===t},qt.prototype.setActiveWindow=function(t){this._activeWindow=t},qt.prototype.getActiveWindow=function(t){return this._ensureActiveWindow(t),this._activeWindow},qt.prototype.getPosition=function(){return new E(this._x,this._y)},qt.prototype.move=function(t){return this._x=t.x,this._y=t.y,this._ui.move(t)},qt.prototype.hide=function(){return this._ui.hide?this._ui.hide():v.PromiseCtor.resolve()},qt.prototype.show=function(){return this._ui.show?this._ui.show():v.PromiseCtor.resolve()},qt.prototype.leftButtonDown=function(){return this._ui.leftButtonDown()},qt.prototype.rightButtonDown=function(){return this._ui.rightButtonDown()},qt.prototype.buttonUp=function(){return this._ui.buttonUp()},qt);function qt(t,e){this._ui=e,this._x=-1,this._y=-1,this._activeWindow=t}var Gt=q(Cu)?i.iframeCursorUI:i.cursorUI,zt=new Ht(Cu.top,Gt),jt=m.nativeMethods,$t=m.Promise,Zt=m.utils,Jt=Zt.browser,Qt=Zt.featureDetection,te=Zt.extend,ee=y.domUtils,ne=y.positionUtils,ie=y.ScrollAutomation;!function(t){for(var e=0,n=Object.keys(t);e<n.length;e++){var i=n[e];v[i]=t[i]}}({PromiseCtor:$t,nativeMethods:jt,scroll:function(t,e){return new ie(t,e).run()},getElementExceptUI:function(e,n){return void 0===n&&(n=!1),i.hide(n).then(function(){var t=o.getElementFromPoint(e);return i.show(n).then(function(){return t})})},dom:ee,position:ne,style:y.styleUtils,event:y.eventUtils,browser:Jt,featureDetection:Qt,utils:{extend:te},createEventSequence:X,sendRequestToFrame:y.sendRequestToFrame,ensureMouseEventAfterScroll:function(s,l,a){return S(this,void 0,m.Promise,function(){var e,n,i,o,r;return b(this,function(t){switch(t.label){case 0:return s&&x.contains(l,s)&&a?(e=p(),n=x.getCommonAncestor(s,e),[4,C.getClientPosition(s)]):[2];case 1:return[4,h(i=t.sent())];case 2:return(o=t.sent())&&(r={clientX:i.x,clientY:i.y,screenX:o.x,screenY:o.y,ctrl:!1,alt:!1,shift:!1,meta:!1,buttons:A.BUTTONS_PARAMETER.leftButton},d.leaveElement(s,e,n,r),d.enterElement(s,e,n,r),c(s)),[2]}})})},automations:{click:{createMouseClickStrategy:function(t,e){return new Wt(t,e)}},_ensureWindowAndCursorForLegacyTests:function(t){t.window=t.window||Cu,t.cursor=zt}}});var oe=m.nativeMethods,re=/^((mouse\w+)|((dbl)?click)|(contextmenu))$/,se=/^((drag\w*)|(drop))$/,le=/^key\w+$/,ae=/^(before)?input$/,ue=/^(blur|(focus(in|out)?))$/,ce=/^pointer\w+/,he={click:1,dblclick:2,mousedown:1,mouseup:1},fe="MouseEvent",de="PointerEvent",me="KeyboardEvent",pe="InputEvent",ve="FocusEvent",ge=(Ee.prototype.run=function(){var t=this.options,e=t.bubbles,n=t.cancelable,i=t.detail,o=(t.view,t.buttons),e=!1!==e,n=!1!==n,i=i||he[this.eventName],o=void 0===o?1:o;Object.assign(this.options,{bubbles:e,cancelable:n,detail:i,view:Cu,buttons:o});var r,s=Ee._getEventCtorByEventType(this.eventName,this.options.eventConstructor);s&&(r=new s(this.eventName,this.options),this.element.dispatchEvent(r))},Ee._getEventCtorByEventType=function(t,e){if(e&&"function"==typeof Ee._getEventCtorFromWindow(e)){var n=Ee._getEventCtorFromNativeMethods(e);if(n&&"function"==typeof n)return n}return re.test(t)||se.test(t)?Ee._getEventCtorFromNativeMethods(fe):ce.test(t)?Ee._getEventCtorFromNativeMethods(de):le.test(t)?Ee._getEventCtorFromNativeMethods(me):ae.test(t)?Ee._getEventCtorFromNativeMethods(pe):ue.test(t)?Ee._getEventCtorFromNativeMethods(ve):Ee._getEventCtorFromNativeMethods("CustomEvent")},Ee._getEventCtorFromNativeMethods=function(t){return oe["Window"+t]||Ee._getEventCtorFromWindow(t)},Ee._getEventCtorFromWindow=function(t){return Cu[t]},Ee);function Ee(t,e,n){this.element=t,this.eventName=e,this.options=n}function ye(n,e){return v.PromiseCtor.resolve(v.dom.isDocumentElement(n)).then(function(t){if(t)return new E(0,0);var e=v.browser.isFirefox?Math.ceil:Math.round;return v.PromiseCtor.resolve(v.position.getOffsetPosition(n,e)).then(function(t){return E.create(t)})}).then(function(t){return t.add(e)})}function Se(t){var e=t/2;return e<1?0:Math.round(e)}function be(o){return S(this,void 0,void 0,function(){var e,n,i;return b(this,function(t){switch(t.label){case 0:return[4,v.position.getElementRectangle(o)];case 1:return e=t.sent(),n=Se(e.width),i=Se(e.height),[2,{offsetX:n,offsetY:i}]}})})}function we(l,a,u){return S(this,void 0,void 0,function(){var e,n,i,o,r,s;return b(this,function(t){switch(t.label){case 0:return[4,be(l)];case 1:return e=t.sent(),a="number"==typeof a?Math.round(a):e.offsetX,u="number"==typeof u?Math.round(u):e.offsetY,0<a&&0<u?[2,{offsetX:a,offsetY:u}]:[4,v.position.getClientDimensions(l)];case 2:return n=t.sent(),i=Math.round(Math.max(l.scrollWidth,n.width)),o=Math.round(Math.max(l.scrollHeight,n.height)),r=n.scrollbar.right+n.border.left+n.border.right+i,s=n.scrollbar.bottom+n.border.top+n.border.bottom+o,[2,{offsetX:a<0?r+a:a,offsetY:u<0?s+u:u}]}})})}function _e(t,n){return v.PromiseCtor.resolve(v.position.getElementFromPoint(t)).then(function(e){return v.PromiseCtor.resolve(v.dom.containsElement(n,e)).then(function(t){return t&&v.dom.getNodeText(e)}).then(function(t){return t||e&&v.dom.isNodeEqual(e,n)?e:null})})}function Pe(n,i){if(!i||!n||v.dom.isNodeEqual(n,i))return n;if("tref"===v.dom.getTagName(i))return i;var e,o,t="area"===v.dom.getTagName(i)&&v.dom.isImgElement(n);return v.browser.isFirefox&&t?(e=n,o=i,v.PromiseCtor.resolve(v.dom.closest(o,"map")).then(function(t){return t&&t.name===v.dom.getImgMapName(e)?o:e})):v.PromiseCtor.resolve(v.dom.closest(i,"a")).then(function(t){return!!t}).then(function(t){return!!t&&v.PromiseCtor.resolve(v.dom.containsElement(i,n)).then(function(t){return t&&v.dom.getNodeText(n)}).then(function(t){return!t&&v.dom.getNodeText(i)})}).then(function(t){return t?v.PromiseCtor.resolve(v.position.getClientDimensions(i)).then(function(e){return _e({x:e.right-1,y:e.top+1},i).then(function(t){return t||_e({x:e.left+1,y:e.bottom-1},i)}).then(function(t){return t||n})}):n})}function Ce(i,o,r){return v.getElementExceptUI(i).then(function(t){var e,n=v.PromiseCtor.resolve(t);return!t&&(!(e=o).parent||e.parent!==e)&&0<i.x&&0<i.y&&(n=n.then(function(){return v.getElementExceptUI(i,!0)})),n.then(function(t){return Pe(t,r)})})}var xe={elementIsInvisibleError:"elementIsInvisibleError",foundElementIsNotTarget:"foundElementIsNotTarget"},Ae=(Object.defineProperty(Te.prototype,"mouseActionStepDelay",{get:function(){return 1===this._speedFactor?10:400*(1-this._speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(Te.prototype,"keyActionStepDelay",{get:function(){return 1===this._speedFactor?10:200*(1-this._speedFactor)},enumerable:!1,configurable:!0}),Object.defineProperty(Te.prototype,"cursorSpeed",{get:function(){return Math.pow(400,this._speedFactor)/4},enumerable:!1,configurable:!0}),Object.defineProperty(Te.prototype,"draggingSpeed",{get:function(){return Math.pow(16,this._speedFactor)/4},enumerable:!1,configurable:!0}),Te);function Te(t){this._speedFactor=t||1}function Me(e){var n=v.nativeMethods.setTimeout;return new v.PromiseCtor(function(t){return n(t,e)})}function De(){return Me(0)}var Ue=(Ie.prototype._getAssignableProperties=function(){throw new Error("Not implemented")},Ie.prototype._assignFrom=function(t,e,n){if(void 0===n&&(n={}),t)for(var i=this._getAssignableProperties(),o=0;o<i.length;o++){for(var r,s=i[o],l=s.name,a=s.type,u=s.required,c=s.init,h=s.defaultValue,f=l.split("."),d=f.length-1,m=f[d],p=t,v=this,g=0;g<d&&p&&v;g++)p=p[f[g]],v=v[f[g]];v&&"defaultValue"in i[o]&&(v[l]=h),p&&v&&(void 0===(r=p[m])&&!u||(e&&a&&a(l,r),v[m]=c?c(l,r,n,e):r))}},Ie);function Ie(){}function ke(i){return function(t,e){var n=typeof e;if("number"!=n)throw new i(t,n);if(isNaN(e)||!isFinite(e)||e!==Math.floor(e))throw new i(t,e)}}function Be(t,e){this.code=t,this.isTestCafeError=!0,this.callsite=e||null}var Ne,Oe,Fe,Le="E1",Ke="E4",Ye="E5",Ve="E9",Xe="E10",We="E11",Re="E12",He="E24",qe="E26",Ge="E27",ze="E28",je="E29",$e="E30",Ze="E31",Je="E32",Qe="E33",tn="E34",en="E35",nn="E36",on="E37",rn="E39",sn="E40",ln="E41",an="E42",un="E43",cn="E44",hn="E45",fn="E46",dn="E49",mn="E50",pn="E51",vn="E52",gn="E57",En="E64",yn="E65",Sn="E68",bn="E69",wn="E70",_n="E71",Pn="E72",Cn="E73",xn="E74",An="E76",Tn="E77",Mn="E78",Dn="E82",Un="E83",In=(e(kn,Ne=Be),kn);function kn(t,e,n){var i=Ne.call(this,t)||this;return i.optionName=e,i.actualValue=n,i}function Bn(t,e){var n=Oe.call(this,dn,e)||this;return n.instantiationCallsiteName=t,n}function Nn(t,e){var n=Fe.call(this,mn,e)||this;return n.instantiationCallsiteName=t,n}e(Bn,Oe=Be),e(Nn,Fe=Be);var On,Fn,Ln,Kn,Yn,Vn,Xn,Wn,Rn=(e(Hn,On=Be),Hn);function Hn(t,e,n){var i=e.apiFnChain,o=e.apiFnIndex,r=On.call(this,t,n)||this;return r.apiFnChain=i,r.apiFnIndex=o,r}function qn(t){return Fn.call(this,pn,t)||this}function Gn(t,e){return Ln.call(this,vn,e,t)||this}function zn(t,e){var n=Kn.call(this,Le)||this;return n.errStack=t,n.pageDestUrl=e,n}function jn(t,e,n){var i=Yn.call(this,Ke,n)||this;return i.errMsg=String(e),i.instantiationCallsiteName=t,i}function $n(t,e,n,i){var o=Vn.call(this,Ye,i)||this;return o.errMsg=String(e),o.property=n,o.instantiationCallsiteName=t,o}function Zn(t){var e=Xn.call(this,En)||this;return e.errMsg=String(t),e}function Jn(t,e){var n=Wn.call(this,yn)||this;return n.errMsg=String(t),n.moduleName=e,n}e(qn,Fn=Be),e(Gn,Ln=Rn),e(zn,Kn=Be),e(jn,Yn=Be),e($n,Vn=Be),e(Zn,Xn=Be),e(Jn,Wn=Be);var Qn,ti=(e(ei,Qn=In),ei);function ei(t,e){return Qn.call(this,Ve,t,e)||this}var ni,ii=(e(oi,ni=In),oi);function oi(t,e){return ni.call(this,Xe,t,e)||this}var ri,si=(e(li,ri=In),li);function li(t,e){return ri.call(this,We,t,e)||this}var ai,ui,ci,hi,fi,di,mi,pi,vi,gi,Ei,yi,Si,bi,wi,_i,Pi,Ci,xi,Ai,Ti,Mi,Di,Ui,Ii,ki,Bi,Ni,Oi,Fi,Li,Ki,Yi,Vi,Xi,Wi=(e(Ri,ai=In),Ri);function Ri(t,e){return ai.call(this,Re,t,e)||this}function Hi(t,e){return ui.call(this,He,e,t)||this}function qi(t){return ci.call(this,qe,t)||this}function Gi(t){var e=hi.call(this,Ge)||this;return e.nodeDescription=t,e}function zi(t,e){var n=fi.call(this,ze,e)||this;return n.argumentName=t,n}function ji(t){var e=di.call(this,je)||this;return e.argumentName=t,e}function $i(t,e){var n=mi.call(this,$e)||this;return n.argumentName=t,n.nodeDescription=e,n}function Zi(){return pi.call(this,Ze)||this}function Ji(){return vi.call(this,Je)||this}function Qi(t){var e=gi.call(this,Qe)||this;return e.argumentName=t,e}function to(){return Ei.call(this,en)||this}function eo(t){var e=yi.call(this,nn)||this;return e.argumentName=t,e}function no(t,e){var n=Si.call(this,on)||this;return n.filePaths=t,n.scannedFilePaths=e,n}function io(){return bi.call(this,tn)||this}function oo(t,e){var n=wi.call(this,ln)||this;return n.properties=t?"scrollTargetY property":e?"scrollTargetX property":"scrollTargetX and scrollTargetY properties",n}function ro(t,e){var n=_i.call(this,gn)||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}function so(t){return Pi.call(this,sn,t)||this}function lo(){return Ci.call(this,rn)||this}function ao(){return xi.call(this,an)||this}function uo(){return Ai.call(this,bn)||this}function co(){return Ti.call(this,Sn)||this}function ho(){return Mi.call(this,wn)||this}function fo(){return Di.call(this,_n)||this}function mo(){return Ui.call(this,Cn)||this}function po(){return Ii.call(this,Dn)||this}function vo(t){var e=ki.call(this,Mn)||this;return e.errMsg=t,e}function go(){return Bi.call(this,xn)||this}function Eo(){return Ni.call(this,An)||this}function yo(){return Oi.call(this,Tn)||this}function So(){return Fi.call(this,Pn)||this}function bo(){return Li.call(this,Un)||this}function wo(){return Ki.call(this,un)||this}function _o(){return Yi.call(this,cn)||this}function Po(t,e){var n=Vi.call(this,hn)||this;return n.dialogType=t,n.pageUrl=e,n}function Co(t,e,n){var i=Xi.call(this,fn)||this;return i.dialogType=t,i.errMsg=e,i.pageUrl=n,i}e(Hi,ui=Rn),e(qi,ci=Be),e(Gi,hi=Be),e(zi,fi=Rn),e(ji,di=Be),e($i,mi=Be),e(Zi,pi=Be),e(Ji,vi=Be),e(Qi,gi=Be),e(to,Ei=Be),e(eo,yi=Be),e(no,Si=Be),e(io,bi=Be),e(oo,wi=Be),e(ro,_i=Be),e(so,Pi=Be),e(lo,Ci=Be),e(ao,xi=Be),e(uo,Ai=Be),e(co,Ti=Be),e(ho,Mi=Be),e(fo,Di=Be),e(mo,Ui=Be),e(po,Ii=Be),e(vo,ki=Be),e(go,Bi=Be),e(Eo,Ni=Be),e(yo,Oi=Be),e(So,Fi=Be),e(bo,Li=Be),e(wo,Ki=Be),e(_o,Yi=Be),e(Po,Vi=Be),e(Co,Xi=Be);var xo,Ao,To,Mo,Do,Uo=ke(ti),Io=(Ao=ke(xo=ii),function(t,e){if(Ao(t,e),e<0)throw new xo(t,e)}),ko=(To=si,function(t,e){var n=typeof e;if("boolean"!=n)throw new To(t,n)}),Bo=(Mo=Wi,function(t,e){var n=typeof e;if("number"!=n)throw new Mo(t,n);if(isNaN(e)||e<.01||1<e)throw new Mo(t,e)}),No=(e(Oo,Do=Ue),Oo.prototype._getAssignableProperties=function(){return[{name:"speed",type:Bo}]},Oo);function Oo(t,e){var n=Do.call(this)||this;return n.speed=null,n._assignFrom(t,e),n}var Fo,Lo=(e(Ko,Fo=No),Ko.prototype._getAssignableProperties=function(){return Fo.prototype._getAssignableProperties.call(this).concat([{name:"offsetX",type:Uo},{name:"offsetY",type:Uo}])},Ko);function Ko(t,e){var n=Fo.call(this)||this;return n.offsetX=null,n.offsetY=null,n._assignFrom(t,e),n}var Yo,Vo,Xo=(e(Wo,Yo=Lo),Wo.prototype._getAssignableProperties=function(){return Yo.prototype._getAssignableProperties.call(this).concat([{name:"scrollToCenter",type:ko},{name:"skipParentFrames",type:ko}])},Wo);function Wo(t,e){var n=Yo.call(this)||this;return n.scrollToCenter=!1,n.skipParentFrames=!1,n._assignFrom(t,e),n}function Ro(t,e){var n=Vo.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}e(Ro,Vo=No),Ro.prototype._getAssignableProperties=function(){return Vo.prototype._getAssignableProperties.call(this).concat([{name:"scrollTargetX",type:Uo},{name:"scrollTargetY",type:Uo},{name:"crop.left",type:Uo},{name:"crop.right",type:Uo},{name:"crop.top",type:Uo},{name:"crop.bottom",type:Uo},{name:"includeMargins",type:ko},{name:"includeBorders",type:ko},{name:"includePaddings",type:ko}])};var Ho,qo=(e(Go,Ho=Lo),Go.prototype._getAssignableProperties=function(){return Ho.prototype._getAssignableProperties.call(this).concat([{name:"modifiers.ctrl",type:ko},{name:"modifiers.alt",type:ko},{name:"modifiers.shift",type:ko},{name:"modifiers.meta",type:ko}])},Go);function Go(t,e){var n=Ho.call(this)||this;return n.modifiers={ctrl:!1,alt:!1,shift:!1,meta:!1},n._assignFrom(t,e),n}var zo,jo=(e($o,zo=qo),$o.prototype._getAssignableProperties=function(){return zo.prototype._getAssignableProperties.call(this).concat([{name:"caretPos",type:Io}])},$o);function $o(t,e){var n=zo.call(this)||this;return n.caretPos=null,n._assignFrom(t,e),n}var Zo,Jo=(e(Qo,Zo=qo),Qo.prototype._getAssignableProperties=function(){return Zo.prototype._getAssignableProperties.call(this).concat([{name:"speed"},{name:"minMovingTime"},{name:"holdLeftButton"},{name:"skipScrolling",type:ko},{name:"skipDefaultDragBehavior",type:ko}])},Qo);function Qo(t,e){var n=Zo.call(this)||this;return n.speed=null,n.minMovingTime=null,n.holdLeftButton=!1,n.skipScrolling=!1,n.skipDefaultDragBehavior=!1,n._assignFrom(t,e),n}var tr,er,nr,ir,or,rr=(e(sr,tr=jo),sr.prototype._getAssignableProperties=function(){return tr.prototype._getAssignableProperties.call(this).concat([{name:"replace",type:ko},{name:"paste",type:ko},{name:"confidential",type:ko}])},sr);function sr(t,e){var n=tr.call(this)||this;return n.replace=!1,n.paste=!1,n.confidential=void 0,n._assignFrom(t,e),n}function lr(t,e){var n=er.call(this,t,e)||this;return n.destinationOffsetX=null,n.destinationOffsetY=null,n._assignFrom(t,e),n}function ar(t,e){var n=nr.call(this)||this;return n.portraitOrientation=!1,n._assignFrom(t,e),n}function ur(t,e){var n=ir.call(this)||this;return n.timeout=void 0,n.allowUnawaitedPromise=!1,n._assignFrom(t,e),n}function cr(t,e){var n=or.call(this)||this;return n.confidential=void 0,n._assignFrom(t,e),n}e(lr,er=qo),lr.prototype._getAssignableProperties=function(){return er.prototype._getAssignableProperties.call(this).concat([{name:"destinationOffsetX",type:Uo},{name:"destinationOffsetY",type:Uo}])},e(ar,nr=Ue),ar.prototype._getAssignableProperties=function(){return[{name:"portraitOrientation",type:ko}]},e(ur,ir=Ue),ur.prototype._getAssignableProperties=function(){return[{name:"timeout",type:Io},{name:"allowUnawaitedPromise",type:ko}]},e(cr,or=No),cr.prototype._getAssignableProperties=function(){return or.prototype._getAssignableProperties.call(this).concat([{name:"confidential",type:ko}])};var hr=(fr.create=function(o,r,s,l){return S(this,void 0,void 0,function(){var e,n,i;return b(this,function(t){switch(t.label){case 0:return[4,fr.getTarget(o,s,new E(r.offsetX,r.offsetY))];case 1:return e=t.sent(),n=e.element,i=e.offset,[2,new fr(n,i,r,s,l)]}})})},fr.getTarget=function(e,n,i){return v.PromiseCtor.resolve(v.position.containsOffset(e,i.x,i.y)).then(function(t){return t?{element:e,offset:i}:u.all([ye(e,i),v.dom.getDocumentElement(n)]).then(function(t){var e=t[0];return{element:t[1],offset:e}})})},fr.prototype._getCursorSpeed=function(){return this.automationSettings.cursorSpeed},fr.prototype._getTargetClientPoint=function(){var o=this;return v.PromiseCtor.resolve(v.style.getElementScroll(this.element)).then(function(i){return v.dom.isHtmlElement(o.element)?E.create(o.offset).sub(E.create(i)):v.PromiseCtor.resolve(v.position.getClientPosition(o.element)).then(function(t){var e=v.dom.isBodyElement(o.element),n=E.create(t).add(o.offset);return e||n.sub(E.create(i)),n.round(Math.floor)})})},fr.prototype._getEventSequenceOptions=function(e){var n=this,i=v.event.BUTTONS_PARAMETER.noButton;return h(e).then(function(t){return{eventOptions:{clientX:e.x,clientY:e.y,screenX:null==t?void 0:t.x,screenY:null==t?void 0:t.y,buttons:i,ctrl:n.modifiers.ctrl,alt:n.modifiers.alt,shift:n.modifiers.shift,meta:n.modifiers.meta},eventSequenceOptions:{moveEvent:n.moveEvent}}})},fr.prototype._runEventSequence=function(e,t){var n=t.eventOptions,i=t.eventSequenceOptions;return S(this,void 0,void 0,function(){return b(this,function(t){switch(t.label){case 0:return[4,v.createEventSequence(!1,this.firstMovingStepOccured,i)];case 1:return[2,t.sent().run(e,p(),n,null,null)]}})})},fr.prototype._emulateEvents=function(e,t){var n=this;return this._getEventSequenceOptions(t).then(function(t){return n._runEventSequence(e,t)}).then(function(){n.firstMovingStepOccured=!0,c(e)})},fr.prototype._movingStep=function(n){var i=this;return this.cursor.move(n).then(function(){return v.getElementExceptUI(i.cursor.getPosition())}).then(function(t){var e=i._getCorrectedTopElement(t);return e?i._emulateEvents(e,n):null}).then(De)},fr.prototype._getCorrectedTopElement=function(t){return t},fr.prototype._move=function(e){var n=this,i=this.cursor.getPosition(),o=E.create(e).sub(i),r=v.nativeMethods.dateNow(),s=Math.max(Math.max(Math.abs(o.x),Math.abs(o.y))/this.cursorSpeed,this.minMovingTime),l=E.create(i),a=!0;return function(e,n){return S(this,void 0,void 0,function(){return b(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!l.eql(e)},function(){var t;return n._needMoveCursorImmediately()?l=E.create(e):a?(a=!1,l.add({x:0<o.x?1:-1,y:0<o.y?1:-1})):(t=Math.min((v.nativeMethods.dateNow()-r)/s,1),l=E.create(o).mul(t).add(i).round(Math.floor)),n._movingStep(l)})},fr.prototype._needMoveCursorImmediately=function(){return this.touchMode},fr.prototype._scroll=function(){if(this.skipScrolling)return v.PromiseCtor.resolve(!1);var t=new Xo({offsetX:this.offset.x,offsetY:this.offset.y},!1);return v.scroll(this.element,t)},fr.prototype._moveToCurrentFrame=function(t){var e=this;if(this.cursor.isActive(this.window))return v.PromiseCtor.resolve();var n=this.cursor.getPosition(),i=n.x,o=n.y,r=this.cursor.getActiveWindow(this.window),s=null,l=null,a={cmd:"automation|move|request",startX:i,startY:o,endX:t.x,endY:t.y,modifiers:this.modifiers,speed:this.speed};return v.PromiseCtor.resolve().then(function(){if(r.parent===e.window)return v.PromiseCtor.resolve(v.dom.findIframeByWindow(r)).then(function(t){return s=t,v.PromiseCtor.resolve(v.position.getIframeClientCoordinates(t)).then(function(t){a.left=t.left,a.top=t.top,a.right=t.right,a.bottom=t.bottom})})}).then(function(){return v.getElementExceptUI(e.cursor.getPosition())}).then(function(t){return l=t===s,r.parent===e.window&&(a.iframeUnderCursor=l),v.sendRequestToFrame(a,"automation|move|response",r)}).then(function(t){if(e.cursor.setActiveWindow(e.window),l||v.dom.isIframeWindow(e.window))return e.cursor.move(t)})},fr.prototype.run=function(){var n=this;return this._scroll().then(function(){return u.all([n._getTargetClientPoint(),v.style.getWindowDimensions(n.window)])}).then(function(t){var e=t[0];if(t[1].contains(e))return n._moveToCurrentFrame(e).then(function(){return n._move(e)})})},fr);function fr(t,e,n,i,o){this.touchMode=v.featureDetection.isTouchDevice,this.moveEvent=this.touchMode?"touchmove":"mousemove",this.automationSettings=new Ae(n.speed),this.cursorSpeed=this._getCursorSpeed(),this.element=t,this.window=i,this.offset=e,this.cursor=o,this.minMovingTime=n.minMovingTime||0,this.modifiers=n.modifiers||{},this.skipScrolling=n.skipScrolling,this.skipDefaultDragBehavior=n.skipDefaultDragBehavior,this.speed=n.speed,this.firstMovingStepOccured=!1}var dr=(mr.prototype.on=function(t,e){this._eventsListeners[t]||(this._eventsListeners[t]=[]),this._eventsListeners[t].push(e)},mr.prototype.once=function(n,i){var o=this;this.on(n,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o.off(n,i),i.apply(void 0,t)})},mr.prototype.off=function(t,e){var n=this._eventsListeners[t];n&&(this._eventsListeners[t]=v.nativeMethods.arrayFilter.call(n,function(t){return t!==e}))},mr.prototype.offAll=function(t){t?this._eventsListeners[t]=[]:this._eventsListeners={}},mr.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i=this._eventsListeners[e];if(i)for(var o=0;o<i.length;o++)try{i[o].apply(this,t)}catch(t){if(!(t.message&&-1<t.message.indexOf("freed script")))throw t;this.off(e,i[o])}},mr);function mr(){this._eventsListeners={}}var pr=(vr.create=function(t){var n=t.element,i=t.clientPoint,o=t.screenPoint,r=t.isTarget,s=t.inMoving;return S(this,void 0,void 0,function(){var e;return b(this,function(t){switch(t.label){case 0:return e=null,i?[4,h(i)]:[3,2];case 1:e=t.sent(),t.label=2;case 2:return[2,new vr({element:n,clientPoint:i,screenPoint:o,isTarget:r,inMoving:s,devicePoint:e})]}})})},vr);function vr(t){var e=t.element,n=void 0===e?null:e,i=t.clientPoint,o=void 0===i?null:i,r=t.screenPoint,s=void 0===r?null:r,l=t.isTarget,a=void 0!==l&&l,u=t.inMoving,c=void 0!==u&&u,h=t.devicePoint,f=void 0===h?null:h;this.element=n,this.clientPoint=o,this.screenPoint=s,this.devicePoint=f,this.isTarget=a,this.inMoving=c}var gr,Er=(e(yr,gr=dr),yr.prototype._getElementForEvent=function(n){return S(this,void 0,void 0,function(){var e;return b(this,function(t){switch(t.label){case 0:return[4,v.position.containsOffset(this.element,this.options.offsetX,this.options.offsetY)];case 1:return e=t.sent()?this.element:null,[2,Ce(n.point,this.window,e)]}})})},yr.prototype._moveToElement=function(){return S(this,void 0,void 0,function(){var e,n=this;return b(this,function(t){switch(t.label){case 0:return e=new Jo(v.utils.extend({skipScrolling:!0},this.options),!1),[4,hr.create(this.element,e,this.window,this.cursor)];case 1:return[2,t.sent().run().then(function(){return Me(n.automationSettings.mouseActionStepDelay)})]}})})},yr.prototype._scrollToElement=function(){var e=this,n=!1,t=new Xo(this.options,!1);return v.scroll(this.element,t).then(function(t){return n=t,Me(e.automationSettings.mouseActionStepDelay)}).then(function(){return Ce(e.cursor.getPosition(),e.window)}).then(function(t){return v.ensureMouseEventAfterScroll(t,e.element,n)}).then(function(){return n})},yr.prototype._getElementOffset=function(){return S(this,void 0,void 0,function(){var e,n,i,o;return b(this,function(t){switch(t.label){case 0:return[4,we(this.element)];case 1:return e=t.sent(),n=this.options,i=n.offsetX,o=n.offsetY,i=i||0===i?i:e.offsetX,o=o||0===o?o:e.offsetY,[2,{offsetX:i,offsetY:o}]}})})},yr.prototype._wrapAction=function(p){return S(this,void 0,void 0,function(){var e,n,i,o,r,s,l,a,u,c,h,f,d,m;return b(this,function(t){switch(t.label){case 0:return[4,this._getElementOffset()];case 1:return e=t.sent(),n=e.offsetX,i=e.offsetY,[4,ye(this.element,{x:n,y:i})];case 2:return o=t.sent(),[4,v.position.getClientPosition(this.element)];case 3:return r=t.sent(),[4,p()];case 4:return t.sent(),[4,ye(this.element,{x:n,y:i})];case 5:return s=t.sent(),[4,v.position.getClientPosition(this.element)];case 6:return l=t.sent(),[4,function(i,o){return S(this,void 0,void 0,function(){var e,n;return b(this,function(t){switch(t.label){case 0:return[4,v.style.getElementScroll(i)];case 1:return e=t.sent(),[4,v.style.hasScroll(i)];case 2:return n=t.sent(),!/html/i.test(i.tagName)&&n&&(o.x-=e.left,o.y-=e.top),[2,v.position.offsetToClientCoords(o)]}})})}(this.element,s)];case 7:return a=t.sent(),[4,v.position.containsOffset(this.element,n,i)];case 8:return u=t.sent()?this.element:null,[4,Ce(a,this.window,u)];case 9:return(c=t.sent())?(h=!u||c===u||c===this.element)?[3,11]:[4,this._contains(this.element,c)]:[2,pr.create({element:null,clientPoint:null,screenPoint:null,isTarget:!1,inMoving:!1})];case 10:h=t.sent(),t.label=11;case 11:return f=o.x!==s.x||o.y!==s.y,d=r.x!==l.x||r.y!==l.y,m=f&&d,[2,pr.create({element:c,clientPoint:a,screenPoint:s,isTarget:h,inMoving:m})]}})})},yr._checkElementState=function(t,e){if(!t.element)throw new Error(xe.elementIsInvisibleError);if(e&&(!t.isTarget||t.inMoving))throw new Error(xe.foundElementIsNotTarget);return t},yr.prototype._ensureElement=function(e,n,i){var o=this;return void 0===n&&(n=!1),void 0===i&&(i=!1),this._wrapAction(function(){return o._scrollToElement()}).then(function(t){return yr._checkElementState(t,e)}).then(function(t){return i?t:o._wrapAction(function(){return o._moveToElement()})}).then(function(t){return n||yr._checkElementState(t,e),t}).then(function(t){return o.emit(o.TARGET_ELEMENT_FOUND_EVENT,{element:(null==t?void 0:t.element)||null}),{element:(null==t?void 0:t.element)||null,clientPoint:(null==t?void 0:t.clientPoint)||null,screenPoint:(null==t?void 0:t.screenPoint)||null,devicePoint:(null==t?void 0:t.devicePoint)||null}})},yr.prototype._contains=function(o,r){return S(this,void 0,void 0,function(){var e,n,i;return b(this,function(t){switch(t.label){case 0:return[4,v.dom.getParents(r)];case 1:for(e=t.sent(),n=0,i=e;n<i.length;n++)if(i[n]===o)return[2,!0];return[2,!1]}})})},yr);function yr(t,e,n,i){var o=gr.call(this)||this;return o.TARGET_ELEMENT_FOUND_EVENT="automation|target-element-found-event",o.element=t,o.options=e,o.automationSettings=new Ae(e.speed||1),o.window=n,o.cursor=i,v.automations._ensureWindowAndCursorForLegacyTests(o),o}var Sr,br=m.Promise,wr=(e(_r,Sr=Er),_r.prototype.run=function(t){var e=this,n=br.resolve();return this.element!==xu.scrollingElement&&this.element!==xu.documentElement&&(n=this._ensureElement(t,!0,!0)),n.then(function(){e.element.scrollLeft=e.scrollLeft,e.element.scrollTop=e.scrollTop})},_r);function _r(t,e,n){var i,o,r,s,l,a=e.x,u=e.y,c=e.position,h=e.byX,f=e.byY,d=Sr.call(this,t,n,Cu,zt)||this;return c&&(o=t,r=c,s=Math.floor(o.scrollWidth/2-o.clientWidth/2),l=Math.floor(o.scrollHeight/2-o.clientHeight/2),a=(i={top:[s,0],right:[o.scrollWidth,l],bottom:[s,o.scrollHeight],left:[0,l],topRight:[o.scrollWidth,0],topLeft:[0,0],bottomRight:[o.scrollWidth,o.scrollHeight],bottomLeft:[0,o.scrollHeight],center:[s,l]}[r])[0],u=i[1]),d.scrollLeft="number"==typeof a?a:t.scrollLeft,d.scrollTop="number"==typeof u?u:t.scrollTop,h&&(d.scrollLeft+=h),f&&(d.scrollTop+=f),d}var Pr,Cr=(e(xr,Pr=Er),xr.prototype.run=function(t){return this._ensureElement(t,!0,!0)},xr);function xr(t,e){return Pr.call(this,t,e,Cu,zt)||this}var Ar,Tr=(e(Mr,Ar=Er),Mr.prototype._mousedown=function(t){return this.strategy.mousedown(t)},Mr.prototype._mouseup=function(t,e){return this.strategy.mouseup(t,e)},Mr.prototype.run=function(t){var r,s=this;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint,i=t.screenPoint,o=t.devicePoint;return r={point:n,screenPoint:i,element:e,options:v.utils.extend({clientX:null==n?void 0:n.x,clientY:null==n?void 0:n.y,screenX:null==o?void 0:o.x,screenY:null==o?void 0:o.y},s.modifiers)},u.all([Me(s.automationSettings.mouseActionStepDelay),s.cursor.leftButtonDown().then(function(){return s._mousedown(r)})])}).then(function(){return s.cursor.buttonUp()}).then(function(){return s._getElementForEvent(r)}).then(function(t){return t?s._mouseup(t,r):null})},Mr);function Mr(t,e,n,i){var o=Ar.call(this,t,e,n,i)||this;return o.modifiers=e.modifiers,o.strategy=v.automations.click.createMouseClickStrategy(o.element,e.caretPos),o}function Dr(t,e,n){var i=function(t,e,n){if(e.y-t.y==0)return 0;var i=(e.x-t.x)/(e.y-t.y),o=t.y*(t.x-e.x)/(e.y-t.y)+t.x;return Math.round(i*n+o)}(t,e,n.top);return i&&i>=n.left&&i<=n.right?new E(i,n.top):null}function Ur(t,e,n){var i=function(t,e,n){if(e.x===t.x)return 0;var i=(e.y-t.y)/(e.x-t.x),o=t.x*(t.y-e.y)/(e.x-t.x)+t.y;return Math.round(i*n+o)}(t,e,n.left);return i&&i>=n.top&&i<=n.bottom?new E(n.left,i):null}function Ir(t,e,n){for(var i=[],o=0,r=[{left:n.left,top:n.top,right:n.left,bottom:n.bottom,isHorizontal:!1},{left:n.right,top:n.top,right:n.right,bottom:n.bottom,isHorizontal:!1},{left:n.left,top:n.top,right:n.right,bottom:n.top,isHorizontal:!0},{left:n.left,top:n.bottom,right:n.right,bottom:n.bottom,isHorizontal:!0}];o<r.length;o++){var s=r[o],l=(s.isHorizontal?Dr:Ur)(t,e,s);l&&i.push(l)}return i.length?1===i.length||i[0].distance(t)<i[1].distance(t)?i[0]:i[1]:null}var kr=m.eventSandbox.eventSimulator,Br=m.eventSandbox.message,Nr=y.positionUtils,Or=y.domUtils,Fr=y.styleUtils,Lr="automation|move|response";Br.on(Br.SERVICE_MSG_RECEIVED_EVENT,function(t){var e,n,i,o,r,s,l,a,u,c,h,f,d;"automation|move|request"===t.message.cmd&&(t.source.parent===Cu?(n=new E((e=t).message.endX,e.message.endY),i=e.source,o=Or.findIframeByWindow(i),r=Fr.getBordersWidth(o),s=Fr.getElementPadding(o),l=Nr.getIframeClientCoordinates(o),a=Nr.getIframePointRelativeToParentFrame(n,i),u=zt.getPosition(),c=Nr.isInRectangle(u,l)?u:Ir(u,a,l),h={x:c.x-l.left,y:c.y-l.top},f=new Jo({modifiers:e.message.modifiers,offsetX:h.x+r.left+s.left,offsetY:h.y+r.top+s.top,speed:e.message.speed,skipScrolling:!0},!1),d={cmd:Lr,x:h.x,y:h.y},zt.getActiveWindow(Cu)!==i?hr.create(o,f,Cu,zt).then(function(t){return t.run()}).then(function(){zt.setActiveWindow(i),Br.sendServiceMsg(d,i)}):Br.sendServiceMsg(d,i)):(m.on(m.EVENTS.beforeUnload,function(){return Br.sendServiceMsg({cmd:Lr},t.source)}),function(t){var e=t.source,n={left:t.message.left,right:t.message.right,top:t.message.top,bottom:t.message.bottom};if(!t.message.iframeUnderCursor){var i=t.message,o=i.startX,r=i.startY,s=o-n.left,l=r-n.top,a=p();return a&&(kr.mouseout(a,{clientX:s,clientY:l,relatedTarget:null}),kr.mouseleave(a,{clientX:s,clientY:l,relatedTarget:null})),Br.sendServiceMsg({cmd:Lr},e)}var u,c=zt.getPosition(),h=Ir(E.create(n).add(c),new E(t.message.endX,t.message.endY),n);h?(u=new Jo({modifiers:t.message.modifiers,offsetX:h.x-n.left,offsetY:h.y-n.top,speed:t.message.speed,skipScrolling:!0},!1),hr.create(xu.documentElement,u,Cu,zt).then(function(t){return t.run()}).then(function(){var t={cmd:Lr,x:h.x,y:h.y};zt.setActiveWindow(e),Br.sendServiceMsg(t,e)})):Br.sendServiceMsg({cmd:Lr,x:n.left,y:n.top},e)}(t)))});var Kr=m.Promise,Yr=m.utils.browser,Vr=m.utils.featureDetection,Xr=m.eventSandbox.eventSimulator,Wr=m.eventSandbox.focusBlur,Rr=m.nativeMethods,Hr=y.domUtils,qr=y.styleUtils,Gr=y.delay,zr=i.selectElement,jr=Vr.isTouchDevice?0:160,$r=(Zr.prototype._calculateEventArguments=function(){var t=this.optionListExpanded?zr.getEmulatedChildElement(this.element):this.element,e=1<qr.getSelectElementSize(this.parentSelect);return{options:this.modifiers,element:Yr.isIE&&e?this.parentSelect:t}},Zr.prototype._getMoveArguments=function(){var t,e,n=null,i=null,o=null;return o=this.optionListExpanded?(i=(t=be(n=zr.getEmulatedChildElement(this.element))).offsetX,t.offsetY):(n=xu.documentElement,i=(e=zr.getSelectChildCenter(this.element)).x,e.y),{element:n,offsetX:i,offsetY:o,speed:this.speed}},Zr.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Jo({offsetX:i,offsetY:o,speed:r,modifiers:this.modifiers},!1);return hr.create(n,s,Cu,zt).then(function(t){return t.run()}).then(function(){return Gr(e.automationSettings.mouseActionStepDelay)})},Zr.prototype._mousedown=function(){var t=this;return Yr.isFirefox?(Xr.mousedown(this.eventsArgs.element,this.eventsArgs.options),this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex),this._focus()):Yr.isIE?(Xr.mousedown(this.eventsArgs.element,this.eventsArgs.options),this._focus()):this._focus().then(function(){return Gr(jr)}).then(function(){Xr.mousedown(t.eventsArgs.element,t.eventsArgs.options),t.clickCausesChange&&(t.parentSelect.selectedIndex=t.childIndex)})},Zr.prototype._focus=function(){var e=this;return new Kr(function(t){Wr.focus(e.parentSelect,t,!1,!0)})},Zr.prototype._mouseup=function(){var t=Yr.isIE?this.parentSelect:this.eventsArgs.element;Xr.mouseup(t,this.eventsArgs.options),Yr.isIE&&this.clickCausesChange&&(this.parentSelect.selectedIndex=this.childIndex);var e=Yr.isFirefox||Yr.isSafari||Yr.isChrome&&53<=Yr.version,n=e||Yr.isIE;return e&&this.clickCausesChange&&Xr.input(this.parentSelect),n&&this.clickCausesChange&&Xr.change(this.parentSelect),Kr.resolve()},Zr.prototype._click=function(){Xr.click(this.eventsArgs.element,this.eventsArgs.options)},Zr.prototype.run=function(){var t=this;if(!this.parentSelect)return Xr.click(this.eventsArgs.element,this.eventsArgs.options),Kr.resolve();this.optionListExpanded||zr.scrollOptionListByChild(this.element);var e=this._getMoveArguments();return this.eventsArgs=this._calculateEventArguments(),qr.getSelectElementSize(this.parentSelect)<=1?this._move(e).then(function(){return t._click()}):this._move(e).then(function(){return t._mousedown()}).then(function(){return t._mouseup()}).then(function(){return t._click()})},Zr);function Zr(t,e){var n,i,o,r,s;this.element=t,this.modifiers=e.modifiers,this.caretPos=e.caretPos,this.offsetX=e.offsetX,this.offsetY=e.offsetY,this.speed=e.speed,this.automationSettings=new Ae(e.speed),this.parentSelect=Hr.getSelectParent(this.element),this.optionListExpanded=!!this.parentSelect&&zr.isOptionListExpanded(this.parentSelect),this.childIndex=null,this.clickCausesChange=!1,this.parentSelect&&(n=Hr.isOptionElement(this.element),i=this.parentSelect.selectedIndex,this.childIndex=Hr.getElementIndexInParent(this.parentSelect,this.element),o=Rr.nodeParentNodeGetter.call(this.element),r=Hr.isOptionGroupElement(o)?o:null,s=this.element.disabled||r&&r.disabled,this.clickCausesChange=n&&!s&&this.childIndex!==i),this.eventsArgs={options:this.modifiers,element:this.element}}var Jr,Qr=m.utils.featureDetection,ts=m.utils.browser,es=m.eventSandbox.eventSimulator,ns=y.eventUtils,is=y.delay,os=Qr.isTouchDevice?0:160,rs=(e(ss,Jr=Er),ss.prototype._firstClick=function(t){var e=this,n=new jo(this.options);n.speed=1;var i=new Tr(this.element,n,Cu,zt);return i.on(i.TARGET_ELEMENT_FOUND_EVENT,function(t){return e.emit(e.TARGET_ELEMENT_FOUND_EVENT,t)}),i.run(t).then(function(t){return is(os).then(function(){return t})})},ss.prototype._secondClick=function(t){var e=this;ts.isIE&&ns.bind(xu,"focus",ns.preventDefault,!0);var n=new jo({offsetX:t.screenPoint.x,offsetY:t.screenPoint.y,caretPos:this.caretPos,modifiers:this.modifiers,speed:1}),i=new Tr(xu.documentElement,n,Cu,zt);return i.run().then(function(t){return e.eventState.dblClickElement=i.strategy.eventState.clickElement,ts.isIE&&ns.unbind(xu,"focus",ns.preventDefault,!0),t})},ss.prototype._dblClick=function(t){this.eventState.dblClickElement&&es.dblclick(this.eventState.dblClickElement,t.options)},ss.prototype.run=function(t){var e=this;return this._firstClick(t).then(function(t){return e._secondClick(t)}).then(function(t){return e._dblClick(t)})},ss);function ss(t,e){var n=Jr.call(this,t,e,Cu,zt)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.speed=e.speed,n.automationSettings=new Ae(n.speed),n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.eventArgs=null,n.eventState={dblClickElement:null},n}var ls=m.utils.browser,as=m.Promise,us=m.nativeMethods,cs=y.positionUtils,hs=y.domUtils;function fs(t,e){var n=null;return i.hide(e).then(function(){return cs.getElementFromPoint(t)}).then(function(t){return n=t,i.show(e)}).then(function(){return n})}function ds(t,e,n){var i=cs.getElementFromPoint(t,e),o=hs.containsElement(n,i)&&us.nodeTextContentGetter.call(i).length;return i&&i===n||o?i:null}function ms(t,e){if(!e||!hs.isDomElement(e)||!t||t===e)return t;if("tref"===hs.getTagName(e))return e;var n,i,o,r="area"===hs.getTagName(e)&&hs.isImgElement(t);if(ls.isFirefox&&r)return n=t,i=e,(o=hs.closest(i,"map"))&&o.name===n.useMap.substring(1)?i:n;var s=hs.isAnchorElement(e)||hs.getParents(e,"a").length,l=s&&hs.containsElement(e,t)&&us.nodeTextContentGetter.call(t).length;if(!s||l||!us.nodeTextContentGetter.call(e).length)return t;var a=e.getBoundingClientRect();return ds(a.right-1,a.top+1,e)||ds(a.left+1,a.bottom-1,e)||t}function ps(i,o){return fs(i).then(function(t){var e=t,n=as.resolve(t);return!e&&q(Cu)&&0<i.x&&0<i.y&&(n=n.then(function(){return fs(i,!0)}).then(function(t){return t})),n.then(function(t){return ms(t,o)})})}var vs,gs=function(){this.enabled=!1,this.dropAllowed=!1,this.element=null,this.dataTransfer=null,this.dataStore=null},Es=m.nativeMethods,ys=m.utils.featureDetection,Ss=m.utils.html,bs=m.utils.url,ws=m.eventSandbox.DataTransfer,_s=m.eventSandbox.DragDataStore,Ps=y.eventUtils,Cs=y.domUtils,xs=(e(As,vs=hr),As.create=function(o,r,s,l){return S(this,void 0,void 0,function(){var e,n,i;return b(this,function(t){switch(t.label){case 0:return[4,hr.getTarget(o,s,new E(r.offsetX,r.offsetY))];case 1:return e=t.sent(),n=e.element,i=e.offset,[2,new As(n,i,r,s,l)]}})})},As.prototype._getCursorSpeed=function(){return this.automationSettings.draggingSpeed},As.prototype._getEventSequenceOptions=function(t){var i=this;return vs.prototype._getEventSequenceOptions.call(this,t).then(function(t){var e=t.eventOptions,n=t.eventSequenceOptions;return e.dataTransfer=i.dragAndDropState.dataTransfer,e.buttons=Ps.BUTTONS_PARAMETER.leftButton,n.holdLeftButton=!0,{eventOptions:e,eventSequenceOptions:n}})},As.prototype._getCorrectedTopElement=function(t){return this.touchMode?this.dragElement:t},As.prototype._runEventSequence=function(t,e){var n=e.eventOptions,i=e.eventSequenceOptions,o=X(this.dragAndDropState.enabled,this.firstMovingStepOccured,i).run(t,p(),n,this.dragElement,this.dragAndDropState.dataStore),r=o.dragAndDropMode,s=o.dropAllowed;this.dragAndDropState.enabled=r,this.dragAndDropState.dropAllowed=s},As.prototype._needMoveCursorImmediately=function(){return!1},As.prototype.run=function(){var l=this;return ps(this.cursor.getPosition()).then(function(t){l.dragElement=t;var e,n,i,o,r,s=function(t){for(var e=t;e;){if(e.draggable)return e;e=Es.nodeParentNodeGetter.call(e)}return null}(l.dragElement);return s&&ys.hasDataTransfer&&!l.skipDefaultDragBehavior&&(l.dragAndDropState.enabled=!0,l.dragElement=s,l.dragAndDropState.element=l.dragElement,l.dragAndDropState.dataStore=new _s,l.dragAndDropState.dataTransfer=new ws(l.dragAndDropState.dataStore),((e=Cs.isAnchorElement(l.dragElement))||Cs.isImgElement(l.dragElement))&&(n=e?"href":"src",o=(i=bs.parseProxyUrl(l.dragElement[n]))?i.destUrl:l.dragElement[n],r=Ss.cleanUpHtml(Es.elementOuterHTMLGetter.call(l.dragElement)),l.dragAndDropState.dataTransfer.setData("text/plain",o),l.dragAndDropState.dataTransfer.setData("text/uri-list",o),l.dragAndDropState.dataTransfer.setData("text/html",r))),vs.prototype.run.call(l).then(function(){return l.dragAndDropState})})},As);function As(t,e,n,i,o){var r=vs.call(this,t,e,n,i,o)||this;return r.dragElement=null,r.dragAndDropState=new gs,r}var Ts,Ms=m.Promise,Ds=m.utils.extend,Us=m.utils.featureDetection,Is=m.eventSandbox.eventSimulator,ks=m.eventSandbox.focusBlur,Bs=(e(Ns,Ts=Er),Ns.prototype._getEndPoint=function(){throw new Error("Not implemented")},Ns.prototype._mousedown=function(t){var e=this;return zt.leftButtonDown().then(function(){return e.simulateDefaultBehavior=Is[e.downEvent](t.element,t.options),e._focus(t)})},Ns.prototype._focus=function(n){var i=this;return new Ms(function(t){var e=g.domUtils.isContentEditableElement(i.element)?g.contentEditable.findContentEditableParent(i.element):n.element;ks.focus(e,t,!1,!0)})},Ns.prototype._getDestination=function(){throw new Error("Not implemented")},Ns.prototype._drag=function(){return S(this,void 0,void 0,function(){var e,n,i,o,r,s=this;return b(this,function(t){switch(t.label){case 0:return[4,this._getDestination()];case 1:return e=t.sent(),n=e.element,i=e.offsets,o=e.endPoint,this.endPoint=o,r=new Jo({offsetX:i.offsetX,offsetY:i.offsetY,modifiers:this.modifiers,speed:this.speed,minMovingTime:25,skipDefaultDragBehavior:!1===this.simulateDefaultBehavior},!1),[2,xs.create(n,r,Cu,zt).then(function(t){return t.run()}).then(function(t){return s.dragAndDropState=t,g.delay(s.automationSettings.mouseActionStepDelay)})]}})})},Ns.prototype._mouseup=function(){var o=this;return zt.buttonUp().then(function(){var e=g.positionUtils.offsetToClientCoords(o.endPoint),n=null,i=Ds({clientX:e.x,clientY:e.y},o.modifiers);return ps(e).then(function(t){return(n=t)?(o.dragAndDropState.enabled?(i.dataTransfer=o.dragAndDropState.dataTransfer,o.dragAndDropState.dropAllowed&&Is.drop(n,i),Is.dragend(o.dragAndDropState.element,i),o.dragAndDropState.dataStore.setProtectedMode()):Is[o.upEvent](n,i),ps(e)):n}).then(function(t){n&&t===n&&!o.dragAndDropState.enabled&&Is.click(n,i)})})},Ns.prototype.run=function(t){var i,o=this;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint;return i={point:n,element:e,options:Ds({clientX:n.x,clientY:n.y},o.modifiers)},Ms.all([g.delay(o.automationSettings.mouseActionStepDelay),o._mousedown(i)])}).then(function(){return o._drag()}).then(function(){return o._mouseup()})},Ns);function Ns(t,e){var n=Ts.call(this,t,e,Cu,zt)||this;return n.modifiers=e.modifiers,n.speed=e.speed,n.offsetX=e.offsetX,n.offsetY=e.offsetY,n.endPoint=null,n.simulateDefaultBehavior=!0,n.downEvent=Us.isTouchDevice?"touchstart":"mousedown",n.upEvent=Us.isTouchDevice?"touchend":"mouseup",n.dragAndDropState=null,n}var Os,Fs=m.utils.browser,Ls=y.styleUtils,Ks=(e(Ys,Os=Bs),Ys.prototype._getDestination=function(){var t,e,n,i,o,r=(t=this.element,e=this.offsetX,n=this.offsetY,i=Fs.isFirefox?Math.ceil:Math.round,o=g.positionUtils.getOffsetPosition(t,i),{x:(t===xu.documentElement?0:o.left)+e,y:(t===xu.documentElement?0:o.top)+n}),s=Ls.getWidth(xu),l=Ls.getHeight(xu),a={x:r.x+this.dragOffsetX,y:r.y+this.dragOffsetY},a={x:Math.min(Math.max(0,a.x),s),y:Math.min(Math.max(0,a.y),l)};return{element:xu.documentElement,offsets:{offsetX:a.x,offsetY:a.y},endPoint:a}},Ys);function Ys(t,e,n,i){var o=Os.call(this,t,i)||this;return o.dragOffsetX=e,o.dragOffsetY=n,o}var Vs,Xs=y.positionUtils,Ws=(e(Rs,Vs=Bs),Rs.prototype._getDestination=function(){return S(this,void 0,void 0,function(){var e,n,i,o;return b(this,function(t){switch(t.label){case 0:return e=this.destinationElement,n=Xs.getElementRectangle(e),[4,we(e,this.destinationOffsetX,this.destinationOffsetY)];case 1:return i=t.sent(),o={x:n.left+i.offsetX,y:n.top+i.offsetY},[2,{element:e,offsets:i,endPoint:o}]}})})},Rs);function Rs(t,e,n){var i=Vs.call(this,t,n)||this;return i.destinationElement=e,i.destinationOffsetX=n.destinationOffsetX,i.destinationOffsetY=n.destinationOffsetY,i}var Hs,qs=(e(Gs,Hs=Er),Gs.prototype.run=function(t){return this._ensureElement(t,!0)},Gs);function Gs(t,e){return Hs.call(this,t,e,Cu,zt)||this}var zs=m.utils.browser,js=m.sandbox.event,$s=m.eventSandbox.eventSimulator,Zs=m.eventSandbox.listeners,Js=m.nativeMethods,Qs=y.domUtils,tl=y.contentEditable,el=y.textSelection,nl=/ /g;function il(t){var e=el.getSelectionByElement(t),n=el.hasInverseSelectionContentEditable(t);return el.hasElementContainsSelection(t)?tl.getSelection(t,e,n):{startPos:tl.calculateNodeAndOffsetByPosition(t,0),endPos:tl.calculateNodeAndOffsetByPosition(t,0)}}function ol(t){var e=t.startPos.node,n=t.startPos.offset,i=t.endPos.offset,o=tl.getFirstNonWhitespaceSymbolIndex(e.nodeValue),r=tl.getLastNonWhitespaceSymbolIndex(e.nodeValue);return n<o&&0!==n?(t.startPos.offset=o,t.endPos.offset=i+o-n):r<i&&i!==e.nodeValue.length&&(t.startPos.offset=e.nodeValue.length,t.endPos.offset=i+e.nodeValue.length-n),t}function rl(t,e,n){return!n||$s.beforeInput(t,e)}function sl(t,e){var n;function i(t){t.preventDefault(),n=!0}function o(t){"textInput"===t.type&&(n=!1)}zs.isSafari&&(Zs.addInternalEventBeforeListener(Cu,["textInput"],i),js.on(js.EVENT_PREVENTED_EVENT,o));var r=zs.isFirefox||$s.textInput(t,e)||n;return zs.isSafari&&(Zs.removeInternalEventBeforeListener(Cu,["textInput"],i),js.off(js.EVENT_PREVENTED_EVENT,o)),r||zs.isIE11}function ll(t,e){var n,i,o,r,s,l,a,u,c,h,f,d=il(t),m=d.startPos.node,p=d.endPos.node,v=!0,g=!0,E=e;function y(){g=!1}function S(t,e,n){n()}e=e.replace(nl,String.fromCharCode(160)),m&&p&&Qs.isContentEditableElement(m)&&Qs.isContentEditableElement(p)&&(Qs.isTheSameNode(m,p)||(el.deleteSelectionContents(t),n=t,o=(i=d).startPos.node,r=Js.nodeParentNodeGetter.call(o)&&o.parentElement,!(zs.isChrome&&zs.version<58||zs.isSafari)&&r&&Qs.isElementContainsNode(n,o)||(i=il(n),el.hasInverseSelectionContentEditable(n)&&(i={startPos:i.endPos,endPos:i.startPos})),i.endPos.offset=i.startPos.offset,m=(d=i).startPos.node),m&&Qs.isContentEditableElement(m)&&Qs.isRenderedNode(m)&&rl(t,e,zs.isChrome||zs.isFirefox)&&(v=sl(t,E),g=v&&!zs.isIE11,Zs.addInternalEventBeforeListener(Cu,["input"],y),Zs.addInternalEventBeforeListener(Cu,["textinput"],S),(v=v&&rl(t,e,zs.isSafari))&&(Qs.isElementNode(m)?(s=m,l=e,c=xu.createTextNode(l),h={node:c,offset:l.length},f=Js.nodeParentNodeGetter.call(s),"br"===Qs.getTagName(s)?f.insertBefore(c,s):0<a?(u=Js.nodeChildNodesGetter.call(s),s.insertBefore(c,u[a])):s.appendChild(c),el.selectByNodesAndOffsets(h,h)):function(t,e,n){var i=e.startPos.node;Qs.isElementContainsNode(t,i)||(i=(e=ol(il(t))).startPos.node);var o=e.startPos.offset,r=e.endPos.offset,s=i.nodeValue,l={node:i,offset:o+n.length};i.nodeValue=s.substring(0,o)+n+s.substring(r,s.length),el.selectByNodesAndOffsets(l,l)}(t,ol(d),e)),ut().then(function(){g&&$s.input(t,e),Zs.removeInternalEventBeforeListener(Cu,["input"],y),Zs.removeInternalEventBeforeListener(Cu,["textinput"],S)})))}function al(t,e,n){var i,o,r,s,l,a,u,c,h,f,d,m,p;Qs.isContentEditableElement(t)&&ll(t,e),Qs.isElementReadOnly(t)||(Qs.isTextEditableElement(t)?(l=t,a=e,h=Qs.getElementValue(l),f=a.length,d=el.getSelectionStart(l),m=el.getSelectionEnd(l),p=Qs.isInputElement(l)&&"number"===l.type,rl(l,a,zs.isChrome||zs.isFirefox)&&sl(l,a)&&rl(l,a,zs.isSafari)&&((u=!zs.isIE&&p?null:parseInt(l.maxLength,10))<0&&(u=zs.isIE&&zs.version<17?0:null),c=h.substring(0,d)+a+h.substring(m,h.length),(null===u||isNaN(u)||c.length<=u)&&(p&&zs.isIOS&&"."===h[h.length-1]&&(d+=1),Qs.setElementValue(l,c),el.select(l,d+f,d+f)),$s.input(l,a))):Qs.isInputElement(t)&&(i=t,o=e,null!==(r=n)?(s=Qs.getElementValue(i),Qs.setElementValue(i,s.substr(0,r)+o+s.substr(r+o.length))):Qs.setElementValue(i,o),$s.change(i),$s.input(i,o)))}function ul(t){return 1===t.length&&("a"<=t&&t<="z"||"A"<=t&&t<="Z")}var cl=m.nativeMethods,hl=m.utils.browser,fl=m.eventSandbox.focusBlur,dl=m.Promise,ml=g.domUtils.isRadioButtonElement,pl=g.domUtils.getActiveElement,vl=g.domUtils.getTabIndexAttributeIntValue;function gl(t){return t===t.toLowerCase()?t.toUpperCase():t.toLowerCase()}function El(t){var e=pl(t||xu),n=null;if(e&&g.domUtils.isIframeElement(e)&&cl.contentDocumentGetter.call(e))try{n=El(cl.contentDocumentGetter.call(e))}catch(t){}return n||e}function yl(t,e,n){if(!ml(e))return t;if(!n&&!e.name&&!hl.isChrome)return[e];var i,o,r=(i=e,o=null,n?""===i.name||hl.isFirefox||(o=function(t){return!t.name||t===i||t.name!==i.name}):""!==i.name?o=function(t){return ml(t)&&t.name===i.name}:hl.isChrome&&(o=function(t){return ml(t)&&!t.name}),o);return r&&(t=g.arrayUtils.filter(t,r)),t}function Sl(t,e,n){var i,o,r,s,l,a,u,c,h=e?-1:1,f=g.domUtils.getTopSameDomainWindow(Cu).document,d=(i=f,o=cl.documentActiveElementGetter.call(i),r=o&&vl(o),!(o&&r<0)),m=yl(m=g.domUtils.getFocusableElements(f,d),t,n),p=ml(t),v=g.arrayUtils.indexOf(m,t);return(e?0===v:v===m.length-1)?!e&&t.tabIndex<0?g.arrayUtils.find(m,function(t){return 0===t.tabIndex}):n||!p?xu.body:m[m.length-1-v]:e&&-1===v?m[m.length-1]:(l=(s=m)[v+h],a=n,u=ml(l)&&l.name&&!l.checked,c=null,a&&u&&(c=g.arrayUtils.find(s,function(t){return ml(t)&&t.name===l.name&&t.checked})),c||l)}function bl(t){if(ul(t))return t.toUpperCase().charCodeAt(0);var e=g.KEY_MAPS.shiftMap[t]?g.KEY_MAPS.shiftMap[t].charCodeAt(0):t.charCodeAt(0);return g.KEY_MAPS.symbolCharCodeToKeyCode[e]||e}var wl={SPECIAL_KEYS:{capslock:"CapsLock",delete:"U+007F",end:"End",enter:"Enter",esc:"U+001B",home:"Home",ins:"Insert",pagedown:"PageDown",pageup:"PageUp",space:"U+0020",tab:"Tab",alt:"Alt",ctrl:"Control",meta:"Meta",shift:"Shift"},LETTERS:{a:"U+0041",b:"U+0042",c:"U+0043",d:"U+0044",e:"U+0045",f:"U+0046",g:"U+0047",h:"U+0048",i:"U+0049",j:"U+004A",k:"U+004B",l:"U+004C",m:"U+004D",n:"U+004E",o:"U+004F",p:"U+0050",q:"U+0051",r:"U+0052",s:"U+0053",t:"U+0054",u:"U+0055",v:"U+0056",w:"U+0057",x:"U+0058",y:"U+0059",z:"U+005A"},SYMBOLS:{0:"U+0030",1:"U+0031",2:"U+0032",3:"U+0033",4:"U+0034",5:"U+0035",6:"U+0036",7:"U+0037",8:"U+0038",9:"U+0039"," ":"U+0020","!":"U+0021","@":"U+0040","#":"U+0023",$:"U+0024","%":"U+0025","^":"U+005E","*":"U+002A","(":"U+0028",")":"U+0029",_:"U+005F","|":"U+007C","\\":"U+005C","/":"U+002F","?":"U+003F",".":"U+002E",",":"U+002C","<":"U+003C",">":"U+003E","[":"U+005B","]":"U+005D","{":"U+007B","}":"U+007D","§":"U+00A7","±":"U+00B1","'":"U+0027",'"':"U+0022",":":"U+003A",";":"U+003B","`":"U+0060","~":"U+007E"}};function _l(t){return ul(t)?wl.LETTERS[t.toLowerCase()]:wl.SYMBOLS[t]||wl.SPECIAL_KEYS[t]||t}function Pl(t,e,n){var i={};return"keyIdentifier"in KeyboardEvent.prototype&&(i.keyIdentifier=t?"":n),"key"in KeyboardEvent.prototype&&(i.key=e),i}var Cl=m.utils.browser,xl=m.utils.extend,Al=m.eventSandbox.eventSimulator,Tl=(Ml._isKeyActivatedInputElement=function(t){return g.domUtils.isInputElement(t)&&/button|submit|reset|radio|checkbox/.test(t.type)},Ml.prototype._type=function(t,e){var n,i=t!==this.storedActiveElement,o=!i,r=t,s=g.domUtils.isEditableElement(t),l=g.domUtils.isEditableElement(this.storedActiveElement);try{i&&(n=g.domUtils.isElementInIframe(t)===g.domUtils.isElementInIframe(this.storedActiveElement)||l,o=(!Cl.isFirefox||l)&&(!Cl.isWebKit||n))}catch(t){}o&&(!Cl.isIE&&i&&l&&s&&(r=this.storedActiveElement),al(r,e))},Ml.prototype._addKeyPropertyToEventOptions=function(t){return xl(t,Pl("keypress"===t.type,this.keyProperty,this.keyIdentifierProperty)),t},Ml.prototype.down=function(t){this.storedActiveElement=El(this.topSameDomainDocument),this.modifierKeyCode&&(t[this.sanitizedKey]=!0),t.shift&&this.isLetter&&(this.keyProperty=gl(this.keyProperty));var e={keyCode:this.keyCode,type:"keydown"};return this._addKeyPropertyToEventOptions(e),Al.keydown(this.storedActiveElement,xl(e,t))},Ml.prototype.press=function(t){if(!this.isChar&&!this.specialKeyCode)return!0;var e=El(this.topSameDomainDocument),n=this.isChar?function(t,e){if("space"===t)return" ";if(e){if(ul(t))return gl(t);if(g.KEY_MAPS.reversedShiftMap[t])return g.KEY_MAPS.reversedShiftMap[t]}return t}(this.sanitizedKey,t.shift):null,i=this.specialKeyCode||n.charCodeAt(0),o=e!==this.storedActiveElement;if(Cl.isWebKit&&o&&g.domUtils.isElementInIframe(e)!==g.domUtils.isElementInIframe(this.storedActiveElement))return!0;this.storedActiveElement=e;var r={keyCode:i,charCode:i,type:"keypress"};this._addKeyPropertyToEventOptions(r);var s=Cl.isAndroid||Al.keypress(e,xl(r,t));if(!s)return s;e=El(this.topSameDomainDocument),!n||t.ctrl||t.alt||this._type(e,n);var l=Ml._isKeyActivatedInputElement(e),a=g.domUtils.isButtonElement(e),u=Cl.isSafari&&0<=Cl.compareVersions([Cl.webkitVersion,"603.1.30"]);return Cl.isFirefox||u||!l&&!a||"enter"!==this.sanitizedKey||e.click(),s},Ml.prototype.up=function(t){this.modifierKeyCode&&(t[this.sanitizedKey]=!1);var e={keyCode:this.keyCode,type:"keyup"};this._addKeyPropertyToEventOptions(e);var n=Al.keyup(El(this.topSameDomainDocument),xl(e,t)),i=El(this.topSameDomainDocument);return!Cl.isFirefox&&!Cl.isSafari&&(!Cl.isChrome||53<=Cl.version)&&n&&"space"===this.sanitizedKey&&Ml._isKeyActivatedInputElement(i)&&i.click(),n},Object.defineProperty(Ml.prototype,"key",{get:function(){return this.sanitizedKey},enumerable:!1,configurable:!0}),Ml);function Ml(t,e){this.isLetter=ul(t),this.isChar=1===t.length||"space"===t,this.sanitizedKey=g.getSanitizedKey(t),this.modifierKeyCode=g.KEY_MAPS.modifiers[this.sanitizedKey],this.specialKeyCode=g.KEY_MAPS.specialKeys[this.sanitizedKey],this.keyCode=null,this.keyIdentifierProperty=_l(e),this.topSameDomainDocument=g.domUtils.getTopSameDomainWindow(Cu).document,this.keyProperty=g.KEY_MAPS.keyProperty[e]||e,this.isChar&&"space"!==t?this.keyCode=bl(this.sanitizedKey):this.modifierKeyCode?this.keyCode=this.modifierKeyCode:this.specialKeyCode&&(this.keyCode=this.specialKeyCode),this.storedActiveElement=null}var Dl,Ul={ctrlA:"ctrl+a",backspace:"backspace",delete:"delete",left:"left",right:"right",up:"up",down:"down",shiftLeft:"shift+left",shiftRight:"shift+right",shiftUp:"shift+up",shiftDown:"shift+down",shiftHome:"shift+home",shiftEnd:"shift+end",home:"home",end:"end",enter:"enter",tab:"tab",shiftTab:"shift+tab",esc:"esc"},Il=m.Promise,kl=m.utils.browser,Bl=m.eventSandbox.eventSimulator,Nl=m.eventSandbox.elementEditingWatcher,Ol=y.textSelection,Fl=y.eventUtils,Ll=y.domUtils,Kl=i.selectElement,Yl=null,Vl=null;function Xl(){Vl=Yl=null,Fl.unbind(this,"blur",Xl,!0)}function Wl(t){var e,n,i,o;Ll.isTextAreaElement(t)&&(Yl!==t&&(Fl.bind(t,"blur",Xl,!0),Yl=t),e=t,n=Ol.hasInverseSelection(e),i=Ll.getTextAreaValue(e),o=n?Ol.getSelectionStart(e):Ol.getSelectionEnd(e),Vl=i&&o?Ll.getTextareaIndentInLine(e,o):0)}function Rl(t,e){var n,i,o,r,s,l,a=Ll.getTextAreaValue(t);a&&(n=Ol.getSelectionStart(t),i=Ol.getSelectionEnd(t),o=Ol.hasInverseSelection(t),s=(r=a.substring(0,o?n:i)).lastIndexOf("\n"),l=r.substring(0,s),null!==Vl&&Yl===t||Wl(t),s=l.lastIndexOf("\n"),ql(t,n,i,o,Math.min(s+1+Vl,l.length),e))}function Hl(t,e){var n,i,o,r,s,l,a,u,c,h,f=Ll.getTextAreaValue(t);f&&(n=Ol.getSelectionStart(t),i=Ol.getSelectionEnd(t),u=(r=(o=Ol.hasInverseSelection(t))?n:i)+(l=-1===(c=(s=f.substring(r)).indexOf("\n"))?s.length:c+1),h=-1===(c=(a=s.substring(l)).indexOf("\n"))?a.length:c,null!==Vl&&Yl===t||Wl(t),ql(t,n,i,o,u=Math.min(u+Vl,u+h),e))}function ql(t,e,n,i,o,r){var s=null,l=null,l=r?(s=e!==n&&i?n:e,o):s=o;Ol.select(t,s,l)}function Gl(t,e,n){Ll.isInputElement(t)&&"number"===t.type&&("-"===e.charAt(0)&&"."===e.charAt(1)&&(e=e.substring(1)),"."===e.charAt(e.length-1)&&(e=e.substring(0,e.length-1))),Ll.setElementValue(t,e),Ol.select(t,n,n),Bl.input(t)}function zl(t,e){var n,i,o,r,s,l,a,u;return Ll.isTextEditableElement(t)&&(n=Ol.getSelectionStart(t),i=Ol.getSelectionEnd(t),o=Ol.hasInverseSelection(t),s=null,s=(r=!Ll.isTextAreaElement(t)||Ll.getTextareaLineNumberByPosition(t,n)===Ll.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,a=-1===(l=Ll.getElementValue(t).substring(0,s).lastIndexOf("\n"))?0:l+1,u=null,r?(u=e?s:a,Ol.select(t,u,a)):o?Ol.select(t,i,a):Ol.select(t,n,a)),Il.resolve()}function jl(t,e){var n,i,o,r,s,l,a,u,c;return Ll.isTextEditableElement(t)&&(n=Ol.getSelectionStart(t),i=Ol.getSelectionEnd(t),o=Ol.hasInverseSelection(t),s=null,u=s=(r=!Ll.isTextAreaElement(t)||Ll.getTextareaLineNumberByPosition(t,n)===Ll.getTextareaLineNumberByPosition(t,i))?o?i:n:o?n:i,c=null,u+=-1===(a=(l=Ll.getElementValue(t).substring(s)).indexOf("\n"))?l.length:a,r?(c=e?s:u,Ol.select(t,c,u)):o?Ol.select(t,i,u):Ol.select(t,n,u)),Il.resolve()}function $l(t){return zl(t,!0)}function Zl(t){return jl(t,!0)}function Jl(t){return Ll.isRadioButtonElement(t)&&!kl.isFirefox}function Ql(t,e){return ta(t,e,!1).then(function(t){t&&(t.checked=!0)})}function ta(t,e,n){return void 0===n&&(n=!0),t?(Ll.isSelectElement(t)&&Kl.collapseOptionList(),i=t,o=e,r=n,new dl(function(t){var e=Sl(i,o,r);e?fl.focus(e,function(){return t(e)}):t()}).then(function(t){return t&&Ll.isTextEditableInput(t)&&Ol.select(t),t})):Il.resolve();var i,o,r}var ea=((Dl={})[Ul.ctrlA]=function(t){return Ll.isEditableElement(t)&&Ol.select(t),Il.resolve()},Dl[Ul.backspace]=function(t){var e,n,i;return Ll.isTextEditableElementAndEditingAllowed(t)&&(e=Ol.getSelectionStart(t),n=Ol.getSelectionEnd(t),i=Ll.getElementValue(t).replace(/\r\n/g,"\n"),n===e?0<e&&Gl(t,i.substring(0,e-1)+i.substring(n,i.length),e-1):Gl(t,i.substring(0,e)+i.substring(n,i.length),e)),Ll.isContentEditableElement(t)&&Ol.deleteSelectionContents(t),Il.resolve()},Dl[Ul.delete]=function(t){var e,n,i;return Ll.isTextEditableElementAndEditingAllowed(t)&&(e=Ol.getSelectionStart(t),n=Ol.getSelectionEnd(t),i=Ll.getElementValue(t).replace(/\r\n/g,"\n"),n===e?e<i.length&&Gl(t,i.substring(0,e)+i.substring(n+1,i.length),e):Gl(t,i.substring(0,e)+i.substring(n,i.length),e)),Ll.isContentEditableElement(t)&&Ol.deleteSelectionContents(t),Il.resolve()},Dl[Ul.left]=function(t){var e,n,i,o,r=null;return Ll.isSelectElement(t)&&Kl.switchOptionsByKeys(t,"left"),Jl(t)?Ql(t,!0):(Ll.isTextEditableElement(t)&&(e=(r=Ol.getSelectionStart(t)||0)===Ol.getSelectionEnd(t)?r-1:r,Ol.select(t,e,e),Wl(t)),Ll.isContentEditableElement(t)&&(r=Ol.getSelectionStart(t))!==Ol.getSelectionEnd(t)&&(n=Ol.getSelectionByElement(t),o={node:(i=Ol.hasInverseSelectionContentEditable(t))?n.focusNode:n.anchorNode,offset:i?n.focusOffset:n.anchorOffset},Ol.selectByNodesAndOffsets(o,o,!0)),Il.resolve())},Dl[Ul.right]=function(t){var e,n,i,o,r=null,s=null;return Ll.isSelectElement(t)&&Kl.switchOptionsByKeys(t,"right"),Jl(t)?Ql(t,!1):(Ll.isTextEditableElement(t)&&(e=(r=Ol.getSelectionStart(t))===(s=Ol.getSelectionEnd(t))?s+1:s,r===Ll.getElementValue(t).length&&(e=r),Ol.select(t,e,e),Wl(t)),Ll.isContentEditableElement(t)&&(r=Ol.getSelectionStart(t))!==(s=Ol.getSelectionEnd(t))&&(n=Ol.getSelectionByElement(t),o={node:(i=Ol.hasInverseSelectionContentEditable(t))?n.anchorNode:n.focusNode,offset:i?n.anchorOffset:n.focusOffset},Ol.selectByNodesAndOffsets(o,o,!0)),Il.resolve())},Dl[Ul.up]=function(t){return Ll.isSelectElement(t)&&Kl.switchOptionsByKeys(t,"up"),Jl(t)?Ql(t,!0):kl.isWebKit&&Ll.isInputElement(t)?zl(t):(Ll.isTextAreaElement(t)&&Rl(t,!1),Il.resolve())},Dl[Ul.down]=function(t){return Ll.isSelectElement(t)&&Kl.switchOptionsByKeys(t,"down"),Jl(t)?Ql(t,!1):kl.isWebKit&&Ll.isInputElement(t)?jl(t):(Ll.isTextAreaElement(t)&&Hl(t,!1),Il.resolve())},Dl[Ul.shiftLeft]=function(t){var e,n;return Ll.isTextEditableElement(t)&&((e=Ol.getSelectionStart(t))===(n=Ol.getSelectionEnd(t))||Ol.hasInverseSelection(t)?Ol.select(t,n,Math.max(e-1,0)):Ol.select(t,e,Math.max(n-1,0)),Wl(t)),Il.resolve()},Dl[Ul.shiftRight]=function(t){var e,n,i;return Ll.isTextEditableElement(t)&&(e=Ol.getSelectionStart(t),n=Ol.getSelectionEnd(t),i=Ll.getElementValue(t).length,e!==n&&Ol.hasInverseSelection(t)?Ol.select(t,n,Math.min(e+1,i)):Ol.select(t,e,Math.min(n+1,i)),Wl(t)),Il.resolve()},Dl[Ul.shiftUp]=function(t){return kl.isWebKit&&Ll.isInputElement(t)?$l(t):(Ll.isTextAreaElement(t)&&Rl(t,!0),Il.resolve())},Dl[Ul.shiftDown]=function(t){return kl.isWebKit&&Ll.isInputElement(t)?Zl(t):(Ll.isTextAreaElement(t)&&Hl(t,!0),Il.resolve())},Dl[Ul.shiftHome]=$l,Dl[Ul.shiftEnd]=Zl,Dl[Ul.home]=zl,Dl[Ul.end]=jl,Dl[Ul.enter]=function(t){var e,n,i,o,r,s;return Ll.isSelectElement(t)&&Kl.collapseOptionList(),Ll.isInputElement(t)?(kl.isIE||Nl.processElementChanging(t),(e=Ll.getParents(t,"form")[0])&&function(t,e){var n=t.querySelectorAll("input, button"),i=null,o=null;for(o=0;o<n.length;o++)if(!i&&"submit"===n[o].type&&!n[o].disabled){i=n[o];break}if(i)Bl.click(i);else if(Ll.blocksImplicitSubmission(e)){for(var r=t.getElementsByTagName("input"),s=[],o=0;o<r.length;o++)Ll.blocksImplicitSubmission(r[o])&&s.push(r[o]);1===s.length&&s[0]===e&&e.validity.valid&&Bl.submit(t)&&t.submit()}}(e,t)):Ll.isTextAreaElement(t)?(n=Ol.getSelectionStart(t),o=(i=Ll.getTextAreaValue(t)).substring(0,n),r=i.substring(n),s=n+1,Gl(t,o+String.fromCharCode(10)+r,s)):t.tagName&&Ll.isAnchorElement(t)&&Bl.click(t),Il.resolve()},Dl[Ul.tab]=function(t){return ta(t,!1)},Dl[Ul.shiftTab]=function(t){return ta(t,!0)},Dl[Ul.esc]=function(t){return Ll.isSelectElement(t)&&Kl.collapseOptionList(),Il.resolve()},Dl),na=m.Promise,ia=m.utils.browser,oa=m.eventSandbox.message,ra=m.nativeMethods,sa="automation|press|request",la="automation|press|response";oa.on(oa.SERVICE_MSG_RECEIVED_EVENT,function(t){t.message.cmd===sa&&(m.on(m.EVENTS.beforeUnload,function(){return oa.sendServiceMsg({cmd:la},t.source)}),new aa(t.message.keyCombinations,t.message.options).run().then(function(){return oa.sendServiceMsg({cmd:la},t.source)}))});var aa=(ua._getKeyPressSimulators=function(t){var e=function(t){for(var e=t.slice(),n=0;n<t.length;n++){var i=t[n];if("shift"===i.toLowerCase()){var o=t[n+1];if(!o)continue;g.KEY_MAPS.shiftMap[o]?t[n+1]=g.KEY_MAPS.shiftMap[o]:g.KEY_MAPS.reversedShiftMap[o]&&(e[n+1]=g.KEY_MAPS.reversedShiftMap[o])}!g.KEY_MAPS.shiftMap[i]||t[n-1]&&"shift"===t[n-1].toLowerCase()||(t[n]=g.KEY_MAPS.shiftMap[i],t.splice(n,0,"shift"),e.splice(n,0,"shift"),n++)}return{actualKeys:t,eventKeyProperties:e}}(g.getKeyArray(t)),n=e.actualKeys,i=e.eventKeyProperties;return g.arrayUtils.map(n,function(t,e){return new Tl(t,i[e])})},ua._getShortcuts=function(t){for(var e=g.getKeyArray(t.toLowerCase()),n=[],i=[],o=[],r=0;r<e.length;r++)for(i.push(e[r]),o=i.slice();o.length;){var s=o.join("+");ea[s]?(n.push(s),i=o=[]):o.shift()}return n},ua._getShortcutHandlers=function(t){for(var e,n,i,o=ua._getShortcuts(t.toLowerCase()),r={},s="",l=0;l<o.length;l++)e=o[l],n=t.indexOf(e),i=e.length,r[s+=t.substring(0,n+i)]=ea[e],t=t.substring(n+i);return r},ua.prototype._down=function(t){this.pressedKeyString+=(this.pressedKeyString?"+":"")+t.key;var e=!t.down(this.modifiersState);return na.resolve(e)},ua.prototype._press=function(t,e){var n=this;if(e&&!this.isSelectElement)return g.delay(this.automationSettings.keyActionStepDelay);var i=this.shortcutHandlers[this.pressedKeyString],o=!1;return i&&!ia.isFirefox&&"enter"!==t.key||(o=!t.press(this.modifiersState)),o&&!this.isSelectElement||!i?g.delay(this.automationSettings.keyActionStepDelay):i(El(this.topSameDomainDocument)).then(function(){return g.delay(n.automationSettings.keyActionStepDelay)})},ua.prototype._up=function(t){return t.up(this.modifiersState),g.delay(this.automationSettings.keyActionStepDelay)},ua.prototype._runCombination=function(t){var n=this;this.modifiersState={ctrl:!1,alt:!1,shift:!1,meta:!1},this.isSelectElement=g.domUtils.isSelectElement(El(this.topSameDomainDocument)),this.pressedKeyString="",this.shortcutHandlers=ua._getShortcutHandlers(t);var e=ua._getKeyPressSimulators(t);return g.promiseUtils.each(e,function(e){return n._down(e).then(function(t){return n._press(e,t)})}).then(function(){return g.arrayUtils.reverse(e),g.promiseUtils.each(e,function(t){return n._up(t)})})},ua.prototype.run=function(){var e=this,t=g.domUtils.getActiveElement(),n=g.domUtils.isIframeElement(t);if(!q(Cu)&&n&&ra.contentWindowGetter.call(t)){var i={cmd:sa,keyCombinations:this.keyCombinations,options:this.options};return g.sendRequestToFrame(i,la,ra.contentWindowGetter.call(t))}return g.promiseUtils.each(this.keyCombinations,function(t){return e._runCombination(t).then(function(){return g.delay(e.automationSettings.keyActionStepDelay)})})},ua);function ua(t,e){this.keyCombinations=t,this.isSelectElement=!1,this.pressedKeyString="",this.modifiersState=null,this.shortcutHandlers=null,this.topSameDomainDocument=g.domUtils.getTopSameDomainWindow(Cu).document,this.automationSettings=new Ae(e.speed),this.options=e}var ca,ha=m.Promise,fa=m.utils.extend,da=m.utils.browser,ma=m.eventSandbox.eventSimulator,pa=y.domUtils,va=y.eventUtils,ga=y.delay,Ea=(e(ya,ca=Er),ya.prototype._mousedown=function(t){var e=this;return zt.rightButtonDown().then(function(){return e.eventState.activeElementBeforeMouseDown=pa.getActiveElement(),e.eventState.simulateDefaultBehavior=ma.mousedown(t.element,t.options),e._focus(t)})},ya.prototype._focus=function(t){return!1===this.simulateDefaultBehavior?ut():ot(pa.isContentEditableElement(this.element)?this.element:t.element,!da.isIE||this.eventState.activeElementBeforeMouseDown===pa.getActiveElement(),this.caretPos).then(ut)},ya.prototype._mouseup=function(e){var t=this;return zt.buttonUp().then(function(){return t._getElementForEvent(e)}).then(function(t){return ma.mouseup(t,e.options)})},ya.prototype._contextmenu=function(e){return this._getElementForEvent(e).then(function(t){ma.contextmenu(t,e.options),pa.isElementFocusable(t)||st(t)})},ya.prototype.run=function(t){var o=this,r=null;return this._ensureElement(t).then(function(t){var e=t.element,n=t.clientPoint,i=t.devicePoint;return r={point:n,element:e,options:fa({clientX:n.x,clientY:n.y,screenX:i.x,screenY:i.y,button:va.BUTTON.right},o.modifiers)},ha.all([ga(o.automationSettings.mouseActionStepDelay),o._mousedown(r)])}).then(function(){return o._mouseup(r)}).then(function(){return o._contextmenu(r)})},ya);function ya(t,e){var n=ca.call(this,t,e,Cu,zt)||this;return n.modifiers=e.modifiers,n.caretPos=e.caretPos,n.eventState={simulateDefaultBehavior:!0,activeElementBeforeMouseDown:null},n}var Sa=m.utils.browser,ba=y.domUtils,wa=y.positionUtils,_a=y.styleUtils,Pa=y.contentEditable,Ca=y.arrayUtils,xa=["direction","font-family","font-size","font-size-adjust","font-variant","font-weight","font-style","letter-spacing","line-height","text-align","text-indent","text-transform","word-wrap","word-spacing","padding-top","padding-left","padding-right","padding-bottom","margin-top","margin-left","margin-right","margin-bottom","border-top-width","border-left-width","border-right-width","border-bottom-width"];function Aa(t,e){var n,i,o,r,s,l=_a.getBordersWidth(t),a=wa.getOffsetPosition(t),u=t.scrollHeight||t.getBoundingClientRect().height,c=Math.ceil(e.left),h=Math.ceil(e.top),f=Math.floor(e.bottom);return ba.isTextAreaElement(t)||(i=(n=wa.offsetToClientCoords({x:a.left,y:a.top})).x+l.left+1,o=n.y+l.top+1,r=n.y+l.top+l.bottom+u,s=n.y+l.top+u-1,c=Math.ceil(c<=n.x?i:e.left),h=Math.ceil(h<=n.y?o:e.top),f=Math.floor(r<=f?s:e.bottom)),{left:c,top:h,bottom:f}}function Ta(t){var e=_a.getElementScroll(xu);return{left:t.left+e.left,top:t.top+e.top,bottom:t.bottom+e.top}}function Ma(t,e){var n=t.getBoundingClientRect(),i=function(e){var t,n,i,o=xu.body,r=wa.getOffsetPosition(e),s=_a.getElementMargin(e),l=r.top-s.top,a=r.left-s.left,u=xu.createElement("div"),c="white-space:pre-wrap;border-style:solid;";return"absolute"===_a.get(o,"position")&&(t=_a.getElementMargin(o),n=_a.get(o,"left"),i=_a.get(o,"top"),a-=t.left+(parseInt(n.replace("px",""),10)||0),l-=t.top+(parseInt(i.replace("px",""),10)||0)),Ca.forEach(xa,function(t){c+=t+":"+_a.get(e,t)+";"}),_a.set(u,{cssText:c,position:"absolute",left:a+"px",top:l+"px",width:e.scrollWidth+"px",height:e.scrollHeight+"px"}),m.nativeMethods.nodeTextContentSetter.call(u,ba.getElementValue(e)+" "),o.appendChild(u),u}(t),o=null,r=t.getBoundingClientRect(),s=r.top-n.top,l=r.left-n.left,a=ba.getElementValue(t).length;try{var u=xu.createRange();u.setStart(m.nativeMethods.nodeFirstChildGetter.call(i),Math.min(e,a)),u.setEnd(m.nativeMethods.nodeFirstChildGetter.call(i),Math.min(e+1,a+1)),ba.isTextAreaElement(t)&&(0!==(o=u.getBoundingClientRect()).width||0!==o.height)||(o=u.getClientRects()[0])}catch(t){o=null}return ba.remove(i),o?{width:o.width,height:o.height,top:o.top-s,bottom:o.bottom-s,left:o.left-l,right:o.right-l}:null}function Da(t,e){var n,i,o,r,s,l,a=null;return(a=ba.isContentEditableElement(t)?(o=t,r=e,s=ba.findDocument(o).createRange(),l=Pa.calculateNodeAndOffsetByPosition(o,r),s.setStart(l.node,Math.min(l.offset,l.node.length)),s.setEnd(l.node,Math.min(l.offset,l.node.length)),s.getClientRects()[0]):"function"==typeof t.createTextRange?(n=e,(i=t.createTextRange()).collapse(!0),i.moveStart("character",n),i.moveEnd("character",n),i.collapse(!0),i.getBoundingClientRect()):Ma(t,e))?{x:(a=Ta(a=Aa(t,a))).left,y:Math.floor(a.top+(a.bottom-a.top)/2)}:null}function Ua(t,e){var n=ba.isTextEditableElement(t),i=ba.isContentEditableElement(t);return n&&0<ba.getElementValue(t).length||i&&Pa.getContentEditableValue(t).length?Da(t,e):wa.findCenter(t)}function Ia(t,e,n){var i=ba.findDocument(t).createRange();i.setStart(e,Math.min(n,e.length)),i.setEnd(e,Math.min(n,e.length));var o=i.getClientRects()[0];return o?{x:(o=Ta(Aa(t,o))).left,y:Math.floor(o.top+(o.bottom-o.top)/2)}:null}var ka,Ba=m.Promise,Na=m.utils.browser,Oa=m.utils.featureDetection,Fa=m.eventSandbox.eventSimulator,La=m.eventSandbox.focusBlur,Ka=y.contentEditable,Ya=y.domUtils,Va=y.positionUtils,Xa=y.eventUtils,Wa=y.delay,Ra=(e(Ha,ka=Er),Ha._calculateEventArguments=function(t){var e=Va.offsetToClientCoords(t);return ps(e).then(function(t){if(!t)throw new Error(xe.elementIsInvisibleError);return{element:t,options:{clientX:e.x,clientY:e.y}}})},Ha.prototype._move=function(t){var e=this,n=t.element,i=t.offsetX,o=t.offsetY,r=t.speed,s=new Jo({offsetX:i,offsetY:o,speed:r},!1);return hr.create(n,s,Cu,zt).then(function(t){return t.run()}).then(function(){return Wa(e.automationSettings.mouseActionStepDelay)})},Ha.prototype._bindMousedownHandler=function(){var e=this,n=function(t){e.eventState.mousedownPrevented=t.defaultPrevented,Xa.preventDefault(t),Xa.unbind(e.element,"mousedown",n)};Xa.bind(this.element,"mousedown",n)},Ha.prototype._calculateAbsoluteStartPoint=function(){throw new Error("Not implemented")},Ha.prototype._calculateAbsoluteEndPoint=function(){throw new Error("Not implemented")},Ha.prototype._moveToPoint=function(t){!function(t,e){if(ba.isEditableElement(t)){var n=ba.isTextAreaElement(t);if(!ba.isInputElement(t)||!(Sa.isFirefox||Sa.isIE&&10<Sa.version)){var i=wa.getOffsetPosition(t),o=_a.getBordersWidth(t),r=_a.getElementScroll(t),s=e.x-i.left-o.left,l=e.y-i.top-o.top,a=null;if(n)return l<r.top&&(a=l),l>t.clientHeight+r.top&&(a=l-t.clientHeight),null!==a&&_a.setScrollTop(t,Math.round(a));s<r.left&&(a=s),s>t.clientWidth+r.left&&(a=s-t.clientWidth),null!==a&&_a.setScrollLeft(t,Math.round(a))}}}(this.element,t),this.clientPoint=function(t,e){var n=ba.isTextEditableElement(t),i=ba.isInputElement(t);if(!n&&!ba.isContentEditableElement(t))return e;var o=wa.getOffsetPosition(t),r=_a.getBordersWidth(t),s=_a.getElementScroll(t),l=o.left+r.left+t.clientWidth;return i&&n&&(Sa.isFirefox||Sa.isIE&&10<Sa.version)?{x:Math.min(e.x,l),y:e.y}:{x:e.x-s.left,y:e.y-s.top}}(this.element,t);var e={element:xu.documentElement,offsetX:this.clientPoint.x,offsetY:this.clientPoint.y,speed:this.speed};return this._move(e)},Ha.prototype._mousedown=function(){var n=this;return zt.leftButtonDown().then(function(){return Ha._calculateEventArguments(n.clientPoint)}).then(function(t){n.eventArgs=t;var e=(Na.isWebKit||Na.isIE)&&Ya.isSelectElement(n.element);return e&&n._bindMousedownHandler(),n.eventState.simulateDefaultBehavior=Fa[n.downEvent](n.eventArgs.element,n.eventArgs.options),!1===n.eventState.simulateDefaultBehavior&&(n.eventState.simulateDefaultBehavior=e&&!n.eventState.mousedownPrevented),n._focus()})},Ha.prototype._focus=function(){var n=this;return new Ba(function(t){var e=Ya.isContentEditableElement(n.element)?Ka.findContentEditableParent(n.element):n.element;La.focus(e,t,!1,!0)})},Ha.prototype._setSelection=function(){throw new Error("Not implemented")},Ha.prototype._mouseup=function(){var e=this;return zt.buttonUp().then(function(){return e._setSelection(),Ha._calculateEventArguments(e.clientPoint)}).then(function(t){e.eventArgs=t,Fa[e.upEvent](e.eventArgs.element,e.eventArgs.options)})},Ha.prototype.run=function(){var t=this;return this.absoluteStartPoint=this._calculateAbsoluteStartPoint(),this.absoluteEndPoint=this._calculateAbsoluteEndPoint(),this._moveToPoint(this.absoluteStartPoint).then(function(){return t._mousedown()}).then(function(){return t._moveToPoint(t.absoluteEndPoint)}).then(function(){return t._mouseup()})},Ha);function Ha(t,e){var n=ka.call(this,t,e,Cu,zt)||this;return n.absoluteStartPoint=null,n.absoluteEndPoint=null,n.clientPoint=null,n.speed=e.speed,n.downEvent=Oa.isTouchDevice?"touchstart":"mousedown",n.upEvent=Oa.isTouchDevice?"touchend":"mouseup",n.eventArgs={options:null,element:null},n.eventState={mousedownPrevented:!1,simulateDefaultBehavior:!0},n}var qa,Ga=y.textSelection,za=y.domUtils,ja=y.positionUtils,$a=(e(Za,qa=Ra),Za.prototype._calculateAbsoluteStartPoint=function(){return Ua(this.element,this.startPos)||ja.findCenter(this.element)},Za.prototype._calculateAbsoluteEndPoint=function(){var t=Ua(this.element,this.endPos);return t||(za.isContentEditableElement(this.element)?function(t,e,n){for(var i=n<e?1:-1,o=n,r=null;o!==e&&!(r=Da(t,o+=i)););return r=r||Da(t,e)||wa.findCenter(t)}(this.element,this.startPos,this.endPos):ja.findCenter(this.element))},Za.prototype._setSelection=function(){var t=za.isTextEditableElement(this.element),e=za.isContentEditableElement(this.element);(t||e)&&!1!==this.eventState.simulateDefaultBehavior&&Ga.select(this.element,this.startPos,this.endPos)},Za.prototype.run=function(t){var e=this;return this._ensureElement(t).then(function(){return qa.prototype.run.call(e)})},Za);function Za(t,e,n,i){var o=qa.call(this,t,i)||this;return o.startPos=e,o.endPos=n,o}var Ja,Qa=y.textSelection,tu=y.contentEditable,eu=y.positionUtils,nu=(e(iu,Ja=Ra),iu.prototype._calculateAbsoluteStartPoint=function(){return Ia(this.element,this.startNode,this.startOffset)||eu.findCenter(this.element)},iu.prototype._calculateAbsoluteEndPoint=function(){return Ia(this.element,this.endNode,this.endOffset)||eu.findCenter(this.element)},iu.prototype._setSelection=function(){var t,e;!1!==this.eventState.simulateDefaultBehavior&&(t={node:this.startNode,offset:this.startOffset},e={node:this.endNode,offset:this.endOffset},Qa.selectByNodesAndOffsets(t,e,!0))},iu);function iu(t,e,n){var i=Ja.call(this,tu.getNearestCommonAncestor(t,e),n)||this,o=tu.getFirstVisiblePosition(t),r=tu.getLastVisiblePosition(e),s={node:t,offset:o},l={node:e,offset:r},a=tu.calculatePositionByNodeAndOffset(i.element,s);return tu.calculatePositionByNodeAndOffset(i.element,l)<a&&(o=tu.getLastVisiblePosition(t),r=tu.getFirstVisiblePosition(e)),s=tu.calculateNodeAndOffsetByPosition(t,o),l=tu.calculateNodeAndOffsetByPosition(e,r),i.startNode=s.node,i.startOffset=s.offset,i.endNode=l.node,i.endOffset=l.offset,i}var ou=m.Promise,ru=m.utils.extend,su=m.utils.browser,lu=m.eventSandbox.eventSimulator,au=m.eventSandbox.elementEditingWatcher,uu=y.domUtils,cu=y.promiseUtils,hu=y.contentEditable,fu=y.textSelection,du=y.delay,mu=y.KEY_MAPS.specialKeys,pu=(vu.findTextEditableChild=function(t){var e=null;if(!uu.isEditableElement(t))for(var n=t.querySelectorAll("*"),i=0;i<n.length;i++)if(uu.isTextEditableElementAndEditingAllowed(n[i])){e=n[i];break}return e},vu.prototype._calculateEventArguments=function(t){var e=uu.getActiveElement(),n=uu.isContentEditableElement(this.element),i=this.eventArgs.element||this.element;n||e===i||(i=vu.findTextEditableChild(e)||e);var o=ru({keyCode:t?this.currentCharCode:this.currentKeyCode},this.modifiers);return t&&(o.charCode=this.currentCharCode),ru(o,Pl(t,this.currentKey,this.currentKeyIdentifier)),{element:i,options:o}},vu.prototype._calculateTargetElement=function(){var t=uu.getActiveElement(),e=uu.isContentEditableElement(this.element);if(e){if(t!==hu.findContentEditableParent(this.element))return void(this.eventState.skipType=!0)}else if(t!==this.element)return void(this.eventState.skipType=!0);this.element=e?this.element:t},vu.prototype._click=function(t){var e,n=this,i=uu.getActiveElement(),o=uu.isTextEditableElementAndEditingAllowed(this.element),r=uu.isContentEditableElement(this.element);if(i===this.element)return o&&au.watchElementEditing(this.element),(o||r)&&(e=fu.getSelectionStart(this.element),isNaN(parseInt(this.caretPos,10))||this.caretPos===e||fu.select(this.element,this.caretPos,this.caretPos)),ou.resolve();var s=be(this.element),l=s.offsetX,a=s.offsetY,u=new jo({offsetX:this.elementChanged?l:this.offsetX,offsetY:this.elementChanged?a:this.offsetY,speed:this.speed,caretPos:this.caretPos,modifiers:this.modifiers});return new Tr(this.element,u,Cu,zt).run(t).then(function(){return du(n.automationSettings.mouseActionStepDelay)})},vu.prototype._type=function(){var t=this;if(this.eventState.skipType)return ou.resolve();var e=uu.isContentEditableElement(this.element);return this.replace&&(uu.isTextEditableElementAndEditingAllowed(this.element)?fu.select(this.element):e&&fu.deleteSelectionContents(this.element,!0)),cu.whilst(function(){return!t._isTypingFinished()},function(){return t._typingStep()})},vu.prototype._isTypingFinished=function(){return this.currentPos===this.typingText.length},vu.prototype._typingStep=function(){var t=this.typingText.charAt(this.currentPos);return this.currentKeyCode=bl(t),this.currentCharCode=this.typingText.charCodeAt(this.currentPos),this.currentKey=this.currentKeyCode===mu.enter?"Enter":t,this.currentKeyIdentifier=_l(this.currentKey),this.ignoreChangeEvent=uu.getElementValue(this.element)===au.getElementSavedValue(this.element),this._keydown(),this._keypress(),this._keyup()},vu.prototype._keydown=function(){this.eventArgs=this._calculateEventArguments(),this.eventState.simulateKeypress=lu.keydown(this.eventArgs.element,this.eventArgs.options)},vu.prototype._keypress=function(){!1!==this.eventState.simulateKeypress&&(this.eventArgs=this._calculateEventArguments(!0),this.eventState.simulateTypeChar=su.isAndroid||lu.keypress(this.eventArgs.element,this.eventArgs.options))},vu.prototype._keyup=function(){var t=this,e=this.eventArgs.element;this.eventArgs=this._calculateEventArguments();var n=uu.isTextEditableElement(this.element),i=uu.isContentEditableElement(this.element),o=this.paste||!n&&!i;return ou.resolve().then(function(){return o?t._typeAllText(e):t._typeChar(e)}).then(function(){lu.keyup(t.eventArgs.element,t.eventArgs.options),o?t.currentPos=t.typingText.length:t.currentPos++})},vu.prototype._typeChar=function(t){if(!1===this.eventState.simulateKeypress||!1===this.eventState.simulateTypeChar)return this.ignoreChangeEvent&&au.restartWatchingElementEditing(t),du(this.automationSettings.keyActionStepDelay);var e=this.typingText.charAt(this.currentPos),n=/^\d$/.test(e),i=0===this.currentPos?null:this.typingText.charAt(this.currentPos-1);if(uu.isInputElement(t)&&"number"===t.type){var o=fu.getSelectionStart(t),r=uu.getInputValue(t).length,s=/^\d/.test(this.typingText);if(!n&&(s||!("."===e||"-"===e&&r)||0!==o))return du(this.automationSettings.keyActionStepDelay);n&&("."===i||"-"===i&&!r)&&(e=i+e)}return al(t,e,null),du(this.automationSettings.keyActionStepDelay)},vu.prototype._typeAllText=function(t){return al(t,this.typingText,this.caretPos),du(this.automationSettings.keyActionStepDelay)},vu.prototype.run=function(t){var e=this;return this._click(t).then(function(){return e._calculateTargetElement()}).then(function(){return e._type()})},vu);function vu(t,e,n){this.element=vu.findTextEditableChild(t)||t,this.typingText=e.toString(),this.modifiers=n.modifiers,this.caretPos=n.caretPos,this.replace=n.replace,this.paste=n.paste,this.offsetX=n.offsetX,this.offsetY=n.offsetY,this.speed=n.speed,this.automationSettings=new Ae(this.speed),this.elementChanged=t!==this.element,this.currentPos=0,this.currentKeyCode=null,this.currentCharCode=null,this.currentKey=null,this.currentKeyIdentifier=null,this.ignoreChangeEvent=!0,this.eventArgs={options:null,element:null},this.eventState={skipType:!1,simulateKeypress:!0,simulateTypeChar:!0}}var gu=(Eu.prototype.run=function(){var i=this;return t.doUpload(this.element,this.paths).then(function(t){if(t.length){var e=g.arrayUtils.map(t,function(t){return t.path}),n=g.arrayUtils.reduce(t,function(t,e){return t.concat(e.resolvedPaths)},[]);throw i.createError(e,n)}})},Eu);function Eu(t,e,n){this.element=t,this.paths=e,this.createError=n}var yu=y.domUtils,Su=y.contentEditable,bu={};bu.DispatchEvent=ge,bu.SetScroll=wr,bu.ScrollIntoView=Cr,bu.Click=Tr,bu.SelectChildClick=$r,bu.DblClick=rs,bu.DragToOffset=Ks,bu.DragToElement=Ws,bu.Hover=qs,bu.Press=aa,bu.RClick=Ea,bu.SelectText=$a,bu.SelectEditableContent=nu,bu.Type=pu,bu.Upload=gu,bu.MouseOptions=qo,bu.ClickOptions=jo,bu.TypeOptions=rr,bu.ERROR_TYPES=xe,bu.AutomationSettings=Ae,bu.getOffsetOptions=we,bu.calculateSelectTextArguments=function(t,e){void 0===e&&(e={});var n,i,o,r,s,l,a,u,c,h,f,d=yu.isTextEditableElement(t),m=d?0:Su.getFirstVisiblePosition(t),p=d?yu.getElementValue(t).length:Su.getLastVisiblePosition(t),v=e.startPos?Math.min(e.startPos,p):m,g=void 0===e.endPos||null===e.endPos?p:Math.min(e.endPos,p);return void 0!==e.offset?(g=0<=e.offset?Math.min(e.offset,g):(v=g,Math.max(0,g+e.offset)),{startPos:v,endPos:g}):void 0!==e.startLine?(n=t,i=e,o=yu.getTextAreaValue(n),r=o&&o.length?o.split("\n"):[],s=r.length-1,l=i.startLine?Math.min(i.startLine,s):0,a=r[l]?r[l].length:0,u=i.startPos?Math.min(i.startPos,a):0,c=void 0===i.endLine||null===i.endLine?s:Math.min(i.endLine,s),h=r[c]?r[c].length:0,f=void 0===i.endPos||null===i.endPos?h:Math.min(i.endPos,h),{startPos:yu.getTextareaPositionByLineAndOffset(n,l,0)+u,endPos:yu.getTextareaPositionByLineAndOffset(n,c,0)+f}):{startPos:v,endPos:g}},bu.cursor=zt,bu.getNextFocusableElement=Sl,bu.SHORTCUT_TYPE=Ul,bu.getSelectionCoordinatesByPosition=Ua,bu.getElementFromPoint=ps;var wu=m.nativeMethods,_u=m.EVENTS.evalIframeScript;wu.objectDefineProperty(Cu,"%testCafeAutomation%",{configurable:!0,value:bu}),m.on(_u,function(t){return Pu(wu.contentWindowGetter.call(t.iframe))})}(Cu["%hammerhead%"],Cu["%testCafeCore%"],Cu["%testCafeUI%"],Cu["%hammerhead%"].Promise)}(window);
|
package/lib/client/core/index.js
CHANGED
|
@@ -1179,7 +1179,8 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
1179
1179
|
};
|
|
1180
1180
|
return new Dimensions(elWidth, elHeight, elPosition, elBorders, elScroll, scrollbar);
|
|
1181
1181
|
}
|
|
1182
|
-
function getElementFromPoint(
|
|
1182
|
+
function getElementFromPoint(_a) {
|
|
1183
|
+
var x = _a.x, y = _a.y;
|
|
1183
1184
|
// @ts-ignore
|
|
1184
1185
|
var ieFn = document.getElementFromPoint;
|
|
1185
1186
|
var func = ieFn || document.elementFromPoint;
|
|
@@ -1188,7 +1189,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
1188
1189
|
// Permission denied to access property 'getElementFromPoint' error in iframe
|
|
1189
1190
|
el = func.call(document, x, y);
|
|
1190
1191
|
}
|
|
1191
|
-
catch (
|
|
1192
|
+
catch (_b) {
|
|
1192
1193
|
return null;
|
|
1193
1194
|
}
|
|
1194
1195
|
//NOTE: elementFromPoint returns null when is's a border of an iframe
|
|
@@ -1470,17 +1471,45 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
1470
1471
|
documentReady: documentReady
|
|
1471
1472
|
});
|
|
1472
1473
|
|
|
1474
|
+
var MouseClickStrategyBase = /** @class */ (function () {
|
|
1475
|
+
function MouseClickStrategyBase() {
|
|
1476
|
+
}
|
|
1477
|
+
return MouseClickStrategyBase;
|
|
1478
|
+
}());
|
|
1479
|
+
var MouseClickStrategyEmpty = /** @class */ (function (_super) {
|
|
1480
|
+
__extends(MouseClickStrategyEmpty, _super);
|
|
1481
|
+
function MouseClickStrategyEmpty() {
|
|
1482
|
+
return _super.call(this) || this;
|
|
1483
|
+
}
|
|
1484
|
+
MouseClickStrategyEmpty.prototype.mousedown = function () {
|
|
1485
|
+
throw new Error('not implemented');
|
|
1486
|
+
};
|
|
1487
|
+
MouseClickStrategyEmpty.prototype.mouseup = function () {
|
|
1488
|
+
throw new Error('not implemented');
|
|
1489
|
+
};
|
|
1490
|
+
return MouseClickStrategyEmpty;
|
|
1491
|
+
}(MouseClickStrategyBase));
|
|
1492
|
+
|
|
1473
1493
|
// @ts-ignore
|
|
1474
|
-
var nativeMethods$3 = hammerhead__default.nativeMethods, Promise$2 = hammerhead__default.Promise, _a = hammerhead__default.utils, browser = _a.browser, featureDetection = _a.featureDetection;
|
|
1494
|
+
var nativeMethods$3 = hammerhead__default.nativeMethods, Promise$2 = hammerhead__default.Promise, _a = hammerhead__default.utils, browser = _a.browser, featureDetection = _a.featureDetection, extend = _a.extend;
|
|
1475
1495
|
initializeAdapter$1({
|
|
1476
1496
|
PromiseCtor: Promise$2,
|
|
1477
1497
|
nativeMethods: nativeMethods$3,
|
|
1478
1498
|
dom: domUtils, position: positionUtils, style: styleUtils$1, event: eventUtils, browser: browser, featureDetection: featureDetection,
|
|
1499
|
+
utils: { extend: extend },
|
|
1479
1500
|
// NOTE: this functions are unnecessary in the core
|
|
1480
1501
|
getElementExceptUI: function () { return Promise$2.resolve(); },
|
|
1481
1502
|
scroll: function () { return Promise$2.resolve(); },
|
|
1482
1503
|
createEventSequence: function () { },
|
|
1483
1504
|
sendRequestToFrame: function () { return Promise$2.resolve(); },
|
|
1505
|
+
ensureMouseEventAfterScroll: function () { return Promise$2.resolve(); },
|
|
1506
|
+
automations: {
|
|
1507
|
+
click: {
|
|
1508
|
+
createMouseClickStrategy: function () { return new MouseClickStrategyEmpty(); },
|
|
1509
|
+
},
|
|
1510
|
+
_ensureWindowAndCursorForLegacyTests: function () {
|
|
1511
|
+
},
|
|
1512
|
+
},
|
|
1484
1513
|
});
|
|
1485
1514
|
|
|
1486
1515
|
var browserUtils$2 = hammerhead__default.utils.browser;
|
|
@@ -2258,7 +2287,7 @@ window['%hammerhead%'].utils.removeInjectedScript();
|
|
|
2258
2287
|
return adapter$1.dom.findParent(element, true, isFixedElement);
|
|
2259
2288
|
};
|
|
2260
2289
|
ScrollAutomation.prototype._isTargetElementObscuredInPoint = function (point) {
|
|
2261
|
-
var elementInPoint = getElementFromPoint(point
|
|
2290
|
+
var elementInPoint = getElementFromPoint(point);
|
|
2262
2291
|
if (!elementInPoint)
|
|
2263
2292
|
return false;
|
|
2264
2293
|
var fixedElement = ScrollAutomation._getFixedAncestorOrSelf(elementInPoint);
|