testcafe
Version:
Automated browser testing for the modern web development stack.
1 lines • 69 kB
JavaScript
!function(){function initTestCafeCore(window,isIFrameWithoutSrc){var document=window.document;!function(s){"use strict";var f,m,r,h,p,i={".js":[],".json":[],".css":[],".html":[]},u="function"==typeof require?require:null;return h=function(e){var t=new Error("Could not find module '"+e+"'");return t.code="MODULE_NOT_FOUND",t},p=function(e,t,n){var o,r;if("function"==typeof e[t+n])return t+n;for(o=0;r=i[n][o];++o)if("function"==typeof e[t+r])return t+r;return null},f=function(e,t,n,o,r,i){var l,a,s,u,d,c;for("."!==(l=(n=n.split(/[\\/]/)).pop())&&".."!==l||(n.push(l),l="");null!=(a=n.shift());)if(a&&"."!==a&&(".."===a?(e=t.pop(),i=i.slice(0,i.lastIndexOf("/"))):(t.push(e),e=e[a],i+="/"+a),!e))throw h(o);if(l&&"function"!=typeof e[l]&&((c=(c=(c=(c=p(e,l,".js"))||p(e,l,".json"))||p(e,l,".css"))||p(e,l,".html"))?l=c:2!==r&&"object"==typeof e[l]&&(t.push(e),e=e[l],i+="/"+l,l="")),!l)return 1!==r&&e[":mainpath:"]?f(e,t,e[":mainpath:"],o,1,i):f(e,t,"index",o,2,i);if(!(d=e[l]))throw h(o);return d.hasOwnProperty("module")?d.module.exports:(s={},d.module=u={exports:s,id:i+"/"+l},d.call(s,s,u,m(e,t,i)),u.exports)},r=function(e,t,n,o){var r,i=n,l=n.charAt(0),a=0;if("/"===l){if(i=i.slice(1),!(e=s["/"])){if(u)return u(n);throw h(n)}o="/",t=[]}else if("."!==l){if(r=i.split("/",1)[0],!(e=s[r])){if(u)return u(n);throw h(n)}o=r,t=[],(i=i.slice(r.length+1))||(a=(i=e[":mainpath:"])?1:(i="index",2))}return f(e,t,i,n,a,o)},(m=function(t,n,o){return function(e){return r(t,[].concat(n),e,o)}})(s,[],"")}({pinkie:{"index.js":function(e,t,n){function o(){}var r,i="pending",l="settled",a="fulfilled",s="rejected",u="undefined"!=typeof global&&void 0!==global.process&&"function"==typeof global.process.emit,d="undefined"==typeof setImmediate?setTimeout:setImmediate,c=[];function f(){for(var e=0;e<c.length;e++)c[e][0](c[e][1]);r=!(c=[])}function m(e,t){c.push([e,t]),r||(r=!0,d(f,0))}function h(e){var t=e.owner,n=t._state,o=t._data,r=e[n],i=e.then;if("function"==typeof r){n=a;try{o=r(o)}catch(e){v(i,e)}}p(i,o)||(n===a&&E(i,o),n===s&&v(i,o))}function p(t,n){var o;try{if(t===n)throw new TypeError("A promises callback cannot return that same promise.");if(n&&("function"==typeof n||"object"==typeof n)){var e=n.then;if("function"==typeof e)return e.call(n,function(e){o||(o=!0,n===e?g(t,e):E(t,e))},function(e){o||(o=!0,v(t,e))}),!0}}catch(e){return o||v(t,e),!0}return!1}function E(e,t){e!==t&&p(e,t)||g(e,t)}function g(e,t){e._state===i&&(e._state=l,e._data=t,m(b,e))}function v(e,t){e._state===i&&(e._state=l,e._data=t,m(R,e))}function y(e){e._then=e._then.forEach(h)}function b(e){e._state=a,y(e)}function R(e){e._state=s,y(e),!e._handled&&u&&global.process.emit("unhandledRejection",e._data,e)}function T(e){global.process.emit("rejectionHandled",e)}function w(e){if("function"!=typeof e)throw new TypeError("Promise resolver "+e+" is not a function");if(this instanceof w==!1)throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],function(e,t){function n(e){v(t,e)}try{e(function(e){E(t,e)},n)}catch(e){n(e)}}(e,this)}w.prototype={constructor:w,_state:i,_then:null,_data:void 0,_handled:!1,then:function(e,t){var n={owner:this,then:new this.constructor(o),fulfilled:e,rejected:t};return!t&&!e||this._handled||(this._handled=!0,this._state===s&&u&&m(T,this)),this._state===a||this._state===s?m(h,n):this._then.push(n),n.then},catch:function(e){return this.then(null,e)}},w.all=function(a){if(!Array.isArray(a))throw new TypeError("You must pass an array to Promise.all().");return new w(function(n,e){var o=[],r=0;function t(t){return r++,function(e){o[t]=e,--r||n(o)}}for(var i,l=0;l<a.length;l++)(i=a[l])&&"function"==typeof i.then?i.then(t(l),e):o[l]=i;r||n(o)})},w.race=function(r){if(!Array.isArray(r))throw new TypeError("You must pass an array to Promise.race().");return new w(function(e,t){for(var n,o=0;o<r.length;o++)(n=r[o])&&"function"==typeof n.then?n.then(e,t):e(n)})},w.resolve=function(t){return t&&"object"==typeof t&&t.constructor===w?t:new w(function(e){e(t)})},w.reject=function(n){return new w(function(e,t){t(n)})},t.exports=w}},"testcafe-release":{src:{browser:{connection:{"command.js":function(e,t,n){e.__esModule=!0,e.default={run:"run",idle:"idle"},t.exports=e.default},"status.js":function(e,t,n){e.__esModule=!0,e.default={ok:"ok",closing:"closing"},t.exports=e.default},"unstable-network-mode.js":function(e,t,n){e.__esModule=!0;e.UNSTABLE_NETWORK_MODE_HEADER="x-testcafe-cache-page-request"}}},client:{browser:{"index.js":function(exports,module,require){exports.__esModule=!0,exports.sendXHR=sendXHR,exports.startHeartbeat=startHeartbeat,exports.startInitScriptExecution=startInitScriptExecution,exports.stopInitScriptExecution=stopInitScriptExecution,exports.redirect=redirect,exports.fetchPageToCache=fetchPageToCache,exports.checkStatus=checkStatus,exports.enableRetryingTestPages=enableRetryingTestPages,exports.disableRetryingTestPages=disableRetryingTestPages,exports.isRetryingTestPagesEnabled=isRetryingTestPagesEnabled;var _pinkie=require("pinkie"),_pinkie2=_interopRequireDefault(_pinkie),_command=require("../../browser/connection/command"),_command2=_interopRequireDefault(_command),_status=require("../../browser/connection/status"),_status2=_interopRequireDefault(_status),_unstableNetworkMode=require("../../browser/connection/unstable-network-mode");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var HEARTBEAT_INTERVAL=2e3,allowInitScriptExecution=!1,retryTestPages=!1,noop=function(){},delay=function(t){return new _pinkie2.default(function(e){return setTimeout(e,t)})},FETCH_PAGE_TO_CACHE_RETRY_DELAY=300,FETCH_PAGE_TO_CACHE_RETRY_COUNT=5;function sendXHR(e,r){var t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},n=t.method,i=void 0===n?"GET":n,o=t.data,l=void 0===o?null:o,a=t.parseResponse,s=void 0===a||a;return new _pinkie2.default(function(t,n){var o=r();o.open(i,e,!0),isRetryingTestPagesEnabled()&&(o.setRequestHeader(_unstableNetworkMode.UNSTABLE_NETWORK_MODE_HEADER,"true"),o.setRequestHeader("accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")),o.onreadystatechange=function(){if(4===o.readyState)if(200===o.status){var e=o.responseText||"";e&&s&&(e=JSON.parse(o.responseText)),t(e)}else n("disconnected")},o.send(l)})}function isCurrentLocation(e){return document.location.href.toLowerCase()===e.toLowerCase()}function startHeartbeat(e,t){function n(){sendXHR(e,t).then(function(e){e.code!==_status2.default.closing||isCurrentLocation(e.url)||(stopInitScriptExecution(),document.location=e.url)})}window.setInterval(n,HEARTBEAT_INTERVAL),n()}function executeInitScript(initScriptUrl,createXHR){allowInitScriptExecution&&sendXHR(initScriptUrl,createXHR).then(function(res){return res.code?sendXHR(initScriptUrl,createXHR,{method:"POST",data:JSON.stringify(eval(res.code))}):null}).then(function(){window.setTimeout(function(){return executeInitScript(initScriptUrl,createXHR)},1e3)})}function startInitScriptExecution(e,t){allowInitScriptExecution=!0,executeInitScript(e,t)}function stopInitScriptExecution(){allowInitScriptExecution=!1}function redirect(e){stopInitScriptExecution(),document.location=e.url}function fetchPageToCache(e,t){function n(){return sendXHR(e,t,{parseResponse:!1})}function o(){return delay(FETCH_PAGE_TO_CACHE_RETRY_DELAY).then(n)}for(var r=n(),i=0;i<FETCH_PAGE_TO_CACHE_RETRY_COUNT;i++)r=r.catch(o);return r.catch(noop)}function checkStatus(e,n,t){var o=(t||{}).manualRedirect;return sendXHR(e,n).then(function(e){var t=_pinkie2.default.resolve();return e.url&&isRetryingTestPagesEnabled()&&(t=fetchPageToCache(e.url,n)),t.then(function(){return e})}).then(function(e){var t=(e.cmd===_command2.default.run||e.cmd===_command2.default.idle)&&!isCurrentLocation(e.url);return t&&!o&&redirect(e),{command:e,redirecting:t}})}function enableRetryingTestPages(){retryTestPages=!0}function disableRetryingTestPages(){retryTestPages=!1}function isRetryingTestPagesEnabled(){return retryTestPages}}},core:{deps:{"hammerhead.js":function(e,t,n){e.__esModule=!0,e.default=window["%hammerhead%"],t.exports=e.default}},"index.js":function(e,t,n){var o=P(n("./deps/hammerhead")),r=P(n("./utils/key-maps")),i=P(n("./utils/node-type-descriptions")),l=P(n("./request-barrier")),a=M(n("./page-unload-barrier")),s=n("./prevent-real-events"),u=P(n("./scroll-controller")),d=M(n("./utils/service")),c=M(n("./utils/dom")),f=M(n("./utils/content-editable")),m=M(n("./utils/position")),h=M(n("./utils/style")),p=M(n("./utils/event")),E=M(n("./utils/array")),g=M(n("./utils/promise")),v=M(n("./utils/text-selection")),y=P(n("./utils/wait-for")),b=P(n("./utils/delay")),R=P(n("./utils/get-time-limited-promise")),T=P(n("./utils/noop")),w=P(n("./utils/get-key-array")),S=P(n("./utils/get-sanitized-key")),N=P(n("./utils/parse-key-sequence")),_=P(n("./utils/send-request-to-frame")),I=M(n("../browser")),x=P(n("../../client-functions/selectors/selector-text-filter")),C=P(n("../../client-functions/selectors/selector-attribute-filter"));function M(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function P(e){return e&&e.__esModule?e:{default:e}}e.RequestBarrier=l.default,e.pageUnloadBarrier=a,e.preventRealEvents=s.preventRealEvents,e.disableRealEventsPreventing=s.disableRealEventsPreventing,e.scrollController=u.default,e.serviceUtils=d,e.domUtils=c,e.contentEditable=f,e.positionUtils=m,e.styleUtils=h,e.eventUtils=p,e.arrayUtils=E,e.promiseUtils=g,e.textSelection=v,e.waitFor=y.default,e.delay=b.default,e.getTimeLimitedPromise=R.default,e.noop=T.default,e.getKeyArray=w.default,e.getSanitizedKey=S.default,e.parseKeySequence=N.default,e.sendRequestToFrame=_.default,e.KEY_MAPS=r.default,e.NODE_TYPE_DESCRIPTIONS=i.default,e.browser=I,e.selectorTextFilter=x.default,e.selectorAttributeFilter=C.default,e.get=n;var O=o.default.nativeMethods,A=o.default.EVENTS.evalIframeScript;O.objectDefineProperty(window,"%testCafeCore%",{configurable:!0,value:e}),o.default.on(A,function(e){return initTestCafeCore(O.contentWindowGetter.call(e.iframe),!0)})},"page-unload-barrier.js":function(e,t,n){e.__esModule=!0,e.init=function(){o.default.on(o.default.EVENTS.beforeUnload,w),r.bind(window,"unload",function(){b=!0})},e.watchForPageNavigationTriggers=function(){R=function(){T=!0},o.default.on(o.default.EVENTS.pageNavigationTriggered,R)},e.wait=function(t){var e=new u(function(e){void 0===t&&(t=!R||T?m:0),R&&(o.default.off(o.default.EVENTS.pageNavigationTriggered,R),R=null),(0,i.default)(t).then(function(){b?new u(function(t){c.setTimeout.call(window,function(){f.queuedAsyncServiceMsg({cmd:l.default.waitForFileDownload}).then(function(e){e&&t()})},p)}).then(function(){b=!1,e()}):g?y.push(e):e()})}),n=(0,i.default)(E).then(function(){b=!1});return u.race([e,n])};var o=s(n("./deps/hammerhead")),r=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}}(n("./utils/event")),i=s(n("./utils/delay")),l=s(n("../../test-run/client-messages")),a=n("./utils/dom");function s(e){return e&&e.__esModule?e:{default:e}}var u=o.default.Promise,d=o.default.utils.browser,c=o.default.nativeMethods,f=o.default.transport,m=400,h=30,p=500,E=15e3,g=!1,v=null,y=[],b=!1,R=null,T=!1;function w(){d.isIE?(function(e){v&&c.clearTimeout.call(window,v);g=!0,v=c.setTimeout.call(window,function(){v=null,g=!1,y.forEach(function(e){return e()}),y=[]},e)}(h),(0,i.default)(0).then(function(){if("loading"===document.readyState){var e=c.documentActiveElementGetter.call(document);e&&(0,a.isAnchorElement)(e)&&e.hasAttribute("download")||(b=!0)}})):b=!0}},"prevent-real-events.js":function(e,t,n){e.__esModule=!0,e.preventRealEvents=function(){l.initElementListening(window,a),l.addFirstInternalHandler(window,a,s),i.default.init()},e.disableRealEventsPreventing=function(){l.removeInternalEventListener(window,a,s)};var o,d=n("./deps/hammerhead"),r=n("./scroll-controller"),i=(o=r)&&o.__esModule?o:{default:o},c=n("./utils/style"),f=n("./utils/array"),m=n("./utils/dom");var h=d.utils.browser,l=d.eventSandbox.listeners,p=d.eventSandbox.eventSimulator,a=["click","mousedown","mouseup","dblclick","contextmenu","mousemove","mouseover","mouseout","touchstart","touchmove","touchend","keydown","keypress","input","keyup","change","focus","blur","MSPointerDown","MSPointerMove","MSPointerOver","MSPointerOut","MSPointerUp","pointerdown","pointermove","pointerover","pointerout","pointerup"],E=123;function s(e,t,n,o,r){var i=e.target||e.srcElement;if(!t&&!(0,m.isShadowUIElement)(i)){if(/^key/.test(e.type)&&function(e){return e.shiftKey&&e.ctrlKey||(e.altKey||e.metaKey)&&h.isMacPlatform||e.keyCode===E}(e))return void r();if("blur"===e.type)if(h.isIE&&h.version<12){var l=(0,m.isWindow)(i),a=!l&&"none"===(0,c.get)(i,"display"),s=null,u=!1;l||a||(s=(0,m.getParents)(i),u=(0,f.filter)(s,function(e){return"none"===(0,c.get)(e,"display")})),(a||u.length)&&d.eventSandbox.timers.deferFunction(function(){p.blur(i)})}else if(i!==window&&i!==window.document&&!(0,c.hasDimensions)(i))return;n()}}},"request-barrier.js":function(e,t,n){e.__esModule=!0;var i=a(n("./deps/hammerhead")),o=a(n("./utils/delay")),r=n("./utils/array"),l=n("./utils/service");function a(e){return e&&e.__esModule?e:{default:e}}var s,u=i.default.Promise,d=i.default.nativeMethods,c="requests-finished",f=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(m,s=l.EventEmitter),m.prototype._init=function(){function e(e){return r._onXhrSend(e.xhr)}function t(e){return r._onRequestCompleted(e.xhr)}function n(e){return r._onRequestError(e.xhr,e.err)}function o(e){return r._onFetchSend(e)}var r=this;i.default.on(i.default.EVENTS.beforeXhrSend,e),i.default.on(i.default.EVENTS.xhrCompleted,t),i.default.on(i.default.EVENTS.xhrError,n),i.default.on(i.default.EVENTS.fetchSent,o),this._unbindHandlers=function(){i.default.off(i.default.EVENTS.beforeXhrSend,e),i.default.off(i.default.EVENTS.xhrCompleted,t),i.default.off(i.default.EVENTS.xhrError,n),i.default.off(i.default.EVENTS.fetchSent,o)}},m.prototype._onXhrSend=function(e){this.collectingReqs&&this.requests.push(e)},m.prototype._onRequestCompleted=function(e){var t=this;(0,o.default)(this.delays.additionalRequestsCollection).then(function(){return t._onRequestFinished(e)})},m.prototype._onRequestError=function(e){this._onRequestFinished(e)},m.prototype._onRequestFinished=function(e){-1<(0,r.indexOf)(this.requests,e)&&((0,r.remove)(this.requests,e),this.collectingReqs||this.requests.length||this.emit(c))},m.prototype._onFetchSend=function(e){var t=this;this.collectingReqs&&(this.requests.push(e),e.then(function(){return t._onRequestCompleted(e)}).catch(function(){return t._onRequestError(e)}))},m.prototype.wait=function(e){var n=this;return new u(function(t){(0,o.default)(e?n.delays.pageInitialRequestsCollection:n.delays.requestsCollection).then(function(){function e(){n.watchdog&&d.clearTimeout.call(window,n.watchdog),n._unbindHandlers(),t()}n.collectingReqs=!1,n.requests.length?(n.watchdog=d.setTimeout.call(window,e,n.BARRIER_TIMEOUT),n.on(c,e)):e()})})},m);function m(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,s.call(this));return t.BARRIER_TIMEOUT=3e3,t.delays={requestsCollection:void 0===e.requestsCollection?50:e.requestsCollection,additionalRequestsCollection:void 0===e.additionalRequestsCollection?50:e.additionalRequestsCollection,pageInitialRequestsCollection:void 0===e.pageInitialRequestsCollection?50:e.pageInitialRequestsCollection},t.collectingReqs=!0,t.requests=[],t.watchdog=null,t._unbindHandlers=null,t._init(),t}(e.default=f).GLOBAL_REQUEST_BARRIER_FIELD="testcafe|request-barrier",window[f.GLOBAL_REQUEST_BARRIER_FIELD]=f,t.exports=e.default},"scroll-controller.js":function(e,t,n){e.__esModule=!0;var o=n("./deps/hammerhead"),r=n("./utils/service");var i=o.eventSandbox.listeners,l=(a.prototype._internalListener=function(e,t,n,o,r){this.events.emit("scroll",e),this.stopPropagationFlag&&(o(),r())},a.prototype.init=function(){var e=this;this.initialized||(this.initialized=!0,i.initElementListening(window,["scroll"]),i.addFirstInternalHandler(window,["scroll"],function(){return e._internalListener.apply(e,arguments)}))},a.prototype.waitForScroll=function(){var e=this,t=null,n=new o.Promise(function(e){t=e});return n.cancel=function(){return e.events.off("scroll",t)},this.initialized?this.events.once("scroll",t):t(),n},a.prototype.stopPropagation=function(){this.stopPropagationFlag=!0},a.prototype.enablePropagation=function(){this.stopPropagationFlag=!1},a);function a(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),this.initialized=!1,this.stopPropagationFlag=!1,this.events=new r.EventEmitter}e.default=new l,t.exports=e.default},utils:{"array.js":function(e,t,n){e.__esModule=!0,e.toArray=function(e){for(var t=[],n=e.length,o=0;o<n;o++)t.push(e[o]);return t},e.reverse=function(e){return c.call(e)},e.isArray=function(e){return"[object Array]"===i.default.nativeMethods.objectToString.call(e)},e.find=function(e,t){for(var n=e.length,o=0;o<n;o++)if(t(e[o],o,e))return e[o];return null},e.indexOf=h,e.forEach=function(e,t){a.call(e,t)},e.some=function(e,t){return s.call(e,t)},e.map=function(e,t){return u.call(e,t)},e.filter=function(e,t){return d.call(e,t)},e.reduce=function(e,t,n){return f.call(e,t,n)},e.remove=function(e,t){var n=h(e,t);-1<n&&m.call(e,n,1)},e.equals=function(e,t){if(e.length!==t.length)return!1;for(var n=0,o=e.length;n<o;n++)if(e[n]!==t[n])return!1;return!0},e.getCommonElement=function(e,t){for(var n=0;n<e.length;n++)for(var o=0;o<t.length;o++)if(e[n]===t[o])return e[n];return null};var o,r=n("../deps/hammerhead"),i=(o=r)&&o.__esModule?o:{default:o};var l=Array.prototype.indexOf,a=Array.prototype.forEach,s=Array.prototype.some,u=Array.prototype.map,d=Array.prototype.filter,c=Array.prototype.reverse,f=Array.prototype.reduce,m=Array.prototype.splice;function h(e,t){return l.call(e,t)}},"content-editable.js":function(e,t,n){e.__esModule=!0,e.getFirstVisibleTextNode=y,e.getLastTextNode=b,e.getFirstNonWhitespaceSymbolIndex=r,e.getLastNonWhitespaceSymbolIndex=i,e.isInvisibleTextNode=R,e.findContentEditableParent=N,e.getNearestCommonAncestor=_,e.getSelection=function(e,t,n){return{startPos:x(e,t,n),endPos:C(e,t,n)}},e.getSelectionStartPosition=function(e,t,n){var o=x(e,t,n);return P(e,o)},e.getSelectionEndPosition=function(e,t,n){var o=C(e,t,n);return P(e,o)},e.calculateNodeAndOffsetByPosition=function(i,e){var l={node:null,offset:e};return function e(t){var n=t.childNodes,o=d.getChildNodesLength(n);if(l.node)return l;if(w(t))return l;if(d.isTextNode(t)){if(l.offset<=t.nodeValue.length)return l.node=t,l;t.nodeValue.length&&(!l.node&&g(i,t)&&l.offset--,l.offset-=t.nodeValue.length)}else if(d.isElementNode(t)){if(!f(t))return l;if(0===l.offset&&M(t,!1))return l.node=t,l.offset=function(e){var n=0;return a.find(e.childNodes,function(e,t){return n=t,"br"===d.getTagName(e)})?n:0}(t),l;(l.node||!E(i,t)&&!g(i,t))&&(o||"br"!==d.getTagName(t))||l.offset--}for(var r=0;r<o;r++)l=e(n[r]);return l}(i)},e.calculatePositionByNodeAndOffset=P,e.getElementBySelection=function(e){var t=_(e.anchorNode,e.focusNode);return d.isTextNode(t)?t.parentElement:t},e.getFirstVisiblePosition=function(e){var t=d.isTextNode(e)?e:y(e),n=d.findDocument(e).createRange();if(t)return n.selectNodeContents(t),P(e,{node:t,offset:n.startOffset});return 0},e.getLastVisiblePosition=function(e){var t=d.isTextNode(e)?e:b(e,!0);if(!t||function(e,t){var n=d.isTextNode(t)?t:v(t,!1),o=e===n,r=e.nodeValue===String.fromCharCode(10);return o&&r&&function(e,t){var n=["pre","pre-wrap","pre-line"];for(;e!==t;)if(e=s.nativeMethods.nodeParentNodeGetter.call(e),-1<a.indexOf(n,l.get(e,"white-space")))return!0;return!1}(e,t)}(t,e))return 0;var n=d.findDocument(e).createRange();return n.selectNodeContents(t),P(e,{node:t,offset:n.endOffset})},e.getContentEditableValue=function(e){return a.map(function e(t){var n=[];var o=t.childNodes;var r=d.getChildNodesLength(o);w(t)||r||!d.isTextNode(t)||n.push(t);for(var i=0;i<r;i++)n=n.concat(e(o[i]));return n}(e),function(e){return e.nodeValue}).join("")};var d=o(n("./dom")),a=o(n("./array")),l=o(n("./style")),s=n("../../driver/deps/hammerhead");function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function u(e){var t=e.childNodes;return!d.getChildNodesLength(t)&&T(e)?e:a.find(t,function(e){return T(e)})}function c(e){return a.find(e.childNodes,function(e){return T(e)||!w(e)&&c(e)})}function f(e){return d.isTextNode(e)||d.isElementNode(e)&&l.isElementVisible(e)}function m(e){return a.filter(e.childNodes,f)}function h(e){return a.some(e.childNodes,f)}function p(e){return a.some(e.childNodes,function(e){return M(e,!0)})}function E(e,t){var n=null,o=null;return!d.isShadowUIElement(e)&&!d.isShadowUIElement(t)&&(!(d.isTheSameNode(t,e)||!d.getChildNodesLength(t.childNodes)||!/div|p/.test(d.getTagName(t)))&&(!(!(n=c(e))||d.isTheSameNode(t,n))&&(!(!(o=y(n))||d.isTheSameNode(t,o))&&u(t))))}function g(e,t){var n=d.isRenderedNode(t),o=null,r=null,i=null;if(d.isShadowUIElement(e)||d.isShadowUIElement(t))return!1;if(d.isTheSameNode(t,e)||!(n&&d.isElementNode(t)&&d.getChildNodesLength(t.childNodes)&&!/div|p/.test(d.getTagName(t))||T(t)&&!d.isTheSameNode(t,e)&&t.nodeValue.length))return!1;if(n&&d.isElementNode(t)){if(!(o=c(e))||d.isTheSameNode(t,o))return!1;if(!(r=y(o))||d.isTheSameNode(t,r))return!1}return(i=function(e){for(var t=null,n=e;!t&&(n=n.previousSibling);)if(!w(n)&&!R(n)){t=n;break}return t}(t))&&d.isElementNode(i)&&/div|p/.test(d.getTagName(i))&&u(i)}function v(e,t){var n=e.childNodes,o=d.getChildNodesLength(n),r=null,i=null,l=null,a=t?T:d.isTextNode;if(!o&&a(e))return e;for(var s=0;s<o;s++){if(r=n[s],l=d.isElementNode(r)&&!d.isContentEditableElement(r),a(r))return r;if(d.isRenderedNode(r)&&h(r)&&!l&&(i=v(r,t)))return i}return i}function y(e){return v(e,!0)}function b(e,t){var n=e.childNodes,o=d.getChildNodesLength(n),r=null,i=null,l=null;if(!o&&T(e))return e;for(var a=o-1;0<=a;a--){if(r=n[a],l=d.isElementNode(r)&&!d.isContentEditableElement(r),d.isTextNode(r)&&(!t||!R(r)))return r;if(d.isRenderedNode(r)&&h(r)&&!l&&(i=b(r,!1)))return i}return i}function r(e,t){if(!e||!e.length)return 0;for(var n=e.length,o=t||0,r=o;r<n&&(10===e.charCodeAt(r)||32===e.charCodeAt(r));r++)o++;return o}function i(e){if(!e||!e.length)return 0;for(var t=e.length,n=t,o=t-1;0<=o&&(10===e.charCodeAt(o)||32===e.charCodeAt(o));o--)n--;return n}function R(e){if(!d.isTextNode(e))return!1;var t=e.nodeValue,n=r(t),o=i(t);return n===t.length&&0===o}function T(e){return d.isTextNode(e)&&!R(e)}function w(e){return!d.isRenderedNode(e)||d.isShadowUIElement(e)}function S(e){var t=e.getAttribute?e.getAttribute("contenteditable"):null;return""===t||"true"===t}function N(e){var t=d.getParents(e);if(S(e)&&d.isContentEditableElement(e))return e;var n=d.findDocument(e);return"on"===n.designMode?n.body:a.find(t,function(e){return S(e)&&d.isContentEditableElement(e)})}function _(e,t){if(d.isTheSameNode(e,t))return d.isTheSameNode(t,N(e))?e:s.nativeMethods.nodeParentNodeGetter.call(e);var n=[],o=N(e),r=null;if(!d.isElementContainsNode(o,t))return null;for(r=e;r!==o;r=s.nativeMethods.nodeParentNodeGetter.call(r))n.push(r);for(r=t;r!==o;r=s.nativeMethods.nodeParentNodeGetter.call(r))if(-1!==a.indexOf(n,r))return r;return o}function I(e,t){var n=null,o=null,r=d.getChildNodesLength(e.childNodes),i=r<=t;if(d.isShadowUIElement(e))return{node:e,offset:t};if(i?n=e.childNodes[r-1]:(n=e.childNodes[t],o=0),d.isShadowUIElement(n)){if(r<=1)return{node:e,offset:0};(i=r<=t-1)?n=e.childNodes[r-2]:(n=e.childNodes[t-1],o=0)}for(;!w(n)&&d.isElementNode(n);){var l=m(n);if(!l.length){o=0;break}n=l[i?l.length-1:0]}return 0===o||w(n)||(o=n.nodeValue?n.nodeValue.length:0),{node:n,offset:o}}function x(e,t,n){var o=n?t.focusNode:t.anchorNode,r=n?t.focusOffset:t.anchorOffset,i={node:o,offset:r};return(d.isTheSameNode(e,o)||d.isElementNode(o))&&p(o)&&(i=I(o,r)),{node:i.node,offset:i.offset}}function C(e,t,n){var o=n?t.anchorNode:t.focusNode,r=n?t.anchorOffset:t.focusOffset,i={node:o,offset:r};return(d.isTheSameNode(e,o)||d.isElementNode(o))&&p(o)&&(i=I(o,r)),{node:i.node,offset:i.offset}}function M(e,t){if(l.isNotVisibleNode(e))return!1;if(d.isTextNode(e))return!0;if(!d.isElementNode(e))return!1;if(p(e))return t;var n=s.nativeMethods.nodeParentNodeGetter.call(e),o=!d.isContentEditableElement(n),r=m(e),i=a.some(r,function(e){return"br"===d.getTagName(e)});return o||i}function P(i,e){var l=e.node,a=e.offset,s=0,u=!1;return function e(t){var n=t.childNodes,o=d.getChildNodesLength(n);if(u)return s;if(d.isTheSameNode(l,t))return(E(i,t)||g(i,t))&&s++,u=!0,s+a;if(w(t))return s;!o&&t.nodeValue&&t.nodeValue.length?(!u&&g(i,t)&&s++,s+=t.nodeValue.length):!o&&d.isElementNode(t)&&"br"===d.getTagName(t)?s++:u||!E(i,t)&&!g(i,t)||s++;for(var r=0;r<o;r++)s=e(n[r]);return s}(i)}},"delay.js":function(e,t,n){e.__esModule=!0,e.default=function(t){return new l(function(e){return a.setTimeout.call(window,e,t)})};var o,r=n("../deps/hammerhead"),i=(o=r)&&o.__esModule?o:{default:o};var l=i.default.Promise,a=i.default.nativeMethods;t.exports=e.default},"dom.js":function(e,t,n){e.__esModule=!0,e.getTopSameDomainWindow=e.findParent=e.getParents=e.closest=e.getTagName=e.getMapContainer=e.getScrollbarSize=e.isElementReadOnly=e.isHammerheadAttr=e.isElementFocusable=e.isShadowUIElement=e.isDomElement=e.isContentEditableElement=e.isTextEditableElementAndEditingAllowed=e.isTextEditableElement=e.isTextEditableInput=e.isWindow=e.isDocument=e.isHtmlElement=e.isBodyElement=e.isMapElement=e.isSVGElement=e.isOptionElement=e.isCheckboxElement=e.isColorInputElement=e.isRadioButtonElement=e.isSelectElement=e.isLabelElement=e.isFormElement=e.isImgElement=e.isAnchorElement=e.isTextAreaElement=e.isFileInput=e.isButtonElement=e.isInputElement=e.isIframeElement=e.isRenderedNode=e.isTextNode=e.isElementNode=e.getSelectVisibleChildren=e.getChildVisibleIndex=e.getSelectParent=e.isCrossDomainWindows=e.getIframeByElement=e.isElementInIframe=e.isElementInDocument=e.findDocument=e.getActiveElement=void 0,e.getFocusableElements=C,e.containsElement=P,e.getTextareaIndentInLine=function(e,t){var n=V(e);if(!n)return 0;var o=n.substring(0,t),r=-1===o.lastIndexOf("\n")?0:o.lastIndexOf("\n")+1;return t-r},e.getTextareaLineNumberByPosition=function(e,t){for(var n=V(e).split("\n"),o=0,r=0,i=0;o<=t;i++){if(t<=o+n[i].length){r=i;break}o+=n[i].length+1}return r},e.getTextareaPositionByLineAndOffset=function(e,t,n){for(var o=V(e).split("\n"),r=0,i=0;i<t;i++)r+=o[i].length+1;return r+n},e.blocksImplicitSubmission=function(e){var t=null;t=p.isSafari?/^(text|password|color|date|time|datetime|datetime-local|email|month|number|search|tel|url|week|image)$/i:p.isFirefox?/^(text|password|date|time|datetime|datetime-local|email|month|number|search|tel|url|week|image)$/i:p.isIE?/^(text|password|color|date|time|datetime|datetime-local|email|file|month|number|search|tel|url|week|image)$/i:/^(text|password|datetime|email|number|search|tel|url|image)$/i;return t.test(e.type)},e.isEditableElement=function(e,t){return t?f(e)||y(e):c(e)||y(e)},e.isElementContainsNode=function e(t,n){if(O(n,t))return!0;var o=t.childNodes;var r=A(o);for(var i=0;i<r;i++){var l=o[i];if(!b(l)&&e(l,n))return!0}return!1},e.isOptionGroupElement=function(e){return"[object HTMLOptGroupElement]"===i.default.utils.dom.instanceToString(e)},e.getElementIndexInParent=function(e,t){var n=e.querySelectorAll(T(t));return h.indexOf(n,t)},e.isTheSameNode=O,e.getElementDescription=function(e){var t={id:"id",name:"name",class:"className"},n=[];for(var o in n.push("<"),n.push(T(e)),t)if(t.hasOwnProperty(o)){var r=e[t[o]];r&&n.push(" "+o+'="'+r+'"')}return n.push(">"),n.join("")},e.getFocusableParent=function(e){for(var t=w(e),n=0;n<t.length;n++)if(R(t[n]))return t[n];return null},e.remove=function(e){e&&e.parentElement&&e.parentElement.removeChild(e)},e.isIFrameWindowInDOM=function(t){if(!t.setTimeout)return!1;var e=null;try{e=t.frameElement}catch(e){return!!t.top}return!(!p.isFirefox&&!p.isWebKit||t.top===t||e)||!(!e||!d.contentDocumentGetter.call(e))},e.isTopWindow=function(e){try{return e.top===e}catch(e){return!1}},e.findIframeByWindow=function(e,t){for(var n=(t||window).document.getElementsByTagName("iframe"),o=0;o<n.length;o++)if(d.contentWindowGetter.call(n[o])===e)return n[o];return null},e.isEditableFormElement=function(e){return c(e)||u(e)},e.getCommonAncestor=function(e,t){if(O(e,t))return e;var n=[e].concat(w(e)),o=t;for(;o;){if(-1<h.indexOf(n,o))return o;o=d.nodeParentNodeGetter.call(o)}return o},e.getChildrenLength=function(e){return d.htmlCollectionLengthGetter.call(e)},e.getChildNodesLength=A,e.getInputValue=F,e.getTextAreaValue=V,e.setInputValue=U,e.setTextAreaValue=L,e.getElementValue=function(e){{if(a(e))return F(e);if(s(e))return V(e)}return e.value},e.setElementValue=function(e,t){{if(a(e))return U(e,t);if(s(e))return L(e,t)}return e.value=t};var o,r=n("../deps/hammerhead"),i=(o=r)&&o.__esModule?o:{default:o},m=l(n("./style")),h=l(n("./array"));function l(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}var p=i.default.utils.browser,d=i.default.nativeMethods,E=(e.getActiveElement=i.default.utils.dom.getActiveElement,e.findDocument=i.default.utils.dom.findDocument,e.isElementInDocument=i.default.utils.dom.isElementInDocument,e.isElementInIframe=i.default.utils.dom.isElementInIframe,e.getIframeByElement=i.default.utils.dom.getIframeByElement,e.isCrossDomainWindows=i.default.utils.dom.isCrossDomainWindows,e.getSelectParent=i.default.utils.dom.getSelectParent,e.getChildVisibleIndex=i.default.utils.dom.getChildVisibleIndex,e.getSelectVisibleChildren=i.default.utils.dom.getSelectVisibleChildren,e.isElementNode=i.default.utils.dom.isElementNode,e.isTextNode=i.default.utils.dom.isTextNode,e.isRenderedNode=i.default.utils.dom.isRenderedNode,e.isIframeElement=i.default.utils.dom.isIframeElement),a=e.isInputElement=i.default.utils.dom.isInputElement,s=(e.isButtonElement=i.default.utils.dom.isButtonElement,e.isFileInput=i.default.utils.dom.isFileInput,e.isTextAreaElement=i.default.utils.dom.isTextAreaElement),g=e.isAnchorElement=i.default.utils.dom.isAnchorElement,u=(e.isImgElement=i.default.utils.dom.isImgElement,e.isFormElement=i.default.utils.dom.isFormElement,e.isLabelElement=i.default.utils.dom.isLabelElement,e.isSelectElement=i.default.utils.dom.isSelectElement),v=(e.isRadioButtonElement=i.default.utils.dom.isRadioButtonElement,e.isColorInputElement=i.default.utils.dom.isColorInputElement,e.isCheckboxElement=i.default.utils.dom.isCheckboxElement,e.isOptionElement=i.default.utils.dom.isOptionElement),c=(e.isSVGElement=i.default.utils.dom.isSVGElement,e.isMapElement=i.default.utils.dom.isMapElement,e.isBodyElement=i.default.utils.dom.isBodyElement,e.isHtmlElement=i.default.utils.dom.isHtmlElement,e.isDocument=i.default.utils.dom.isDocument,e.isWindow=i.default.utils.dom.isWindow,e.isTextEditableInput=i.default.utils.dom.isTextEditableInput,e.isTextEditableElement=i.default.utils.dom.isTextEditableElement),f=e.isTextEditableElementAndEditingAllowed=i.default.utils.dom.isTextEditableElementAndEditingAllowed,y=e.isContentEditableElement=i.default.utils.dom.isContentEditableElement,b=(e.isDomElement=i.default.utils.dom.isDomElement,e.isShadowUIElement=i.default.utils.dom.isShadowUIElement),R=e.isElementFocusable=i.default.utils.dom.isElementFocusable,T=(e.isHammerheadAttr=i.default.utils.dom.isHammerheadAttr,e.isElementReadOnly=i.default.utils.dom.isElementReadOnly,e.getScrollbarSize=i.default.utils.dom.getScrollbarSize,e.getMapContainer=i.default.utils.dom.getMapContainer,e.getTagName=i.default.utils.dom.getTagName),w=(e.closest=i.default.utils.dom.closest,e.getParents=i.default.utils.dom.getParents);e.findParent=i.default.utils.dom.findParent,e.getTopSameDomainWindow=i.default.utils.dom.getTopSameDomainWindow;function S(e){return h.filter(e,function(e){return 0<e.tabIndex})}function N(e){return h.filter(e,function(e){return e.tabIndex<=0})}function _(e){if(!e||!e.length)return[];var t=S(e),n=h.filter(e,function(e){return E(e)});if(!t.length)return n.length&&(e=I(e,n)),e;t=t.sort(x("tabIndex"));var o=N(e);return n.length?I(t,n).concat(I(o,n)):t.concat(o)}function I(e,t){var n=function(e){var t=S(e);return t.length?t.sort(x("tabIndex")).concat(N(e)):e}(t),o=[],r=[],i=[],l=0;for(l=0;l<n.length;l++){try{i=C(d.contentDocumentGetter.call(n[l]))}catch(e){i=[]}r.push(_(i))}for(l=0;l<e.length;l++)if(o.push(e[l]),E(e[l]))if(p.isIE){o.pop();var a=r[h.indexOf(t,e[l])],s=S(a),u=N(a);s=s.sort(x("tabIndex")),(o=o.concat(s)).push(e[l]),o=o.concat(u)}else p.isWebKit&&r[h.indexOf(t,e[l])].length&&o.pop(),o=o.concat(r[h.indexOf(t,e[l])]);return o}function x(n){return function(e,t){return e[n]<t[n]?-1:e[n]>t[n]?1:0}}function C(e){for(var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=e.querySelectorAll("*"),o=function(e){for(var t=[],n=0;n<e.length;n++)"none"===m.get(e[n],"display")&&t.push(e[n]);return t}(n),r=/^(input|button|select|textarea)$/,i=[],l=null,a=null,s=null,u=!1,d=0;d<n.length;d++)if(l=n[d],a=T(l),s=M(l),u=!1,!l.disabled&&"none"!==m.get(l,"display")&&"hidden"!==m.get(l,"visibility")&&!((p.isIE||p.isAndroid)&&v(l)||null!==s&&s<0)){r.test(a)?u=!0:p.isIE&&E(l)?i.push(l):g(l)&&l.hasAttribute("href")&&(u=""!==l.getAttribute("href")||!p.isIE||null!==s);var c=l.getAttribute("contenteditable");""!==c&&"true"!==c||(u=!0),null!==s&&(u=!0),u&&i.push(l)}var f=h.filter(i,function(e){return!P(o,e)});return t&&(f=_(f)),f}function M(e){var t=e.getAttribute("tabIndex");return null!==t&&(t=parseInt(t,10),t=isNaN(t)?null:t),t}function P(e,t){return e.contains?e.contains(t):h.some(e,function(e){return e.contains(t)})}function O(e,t){return e&&t&&e.isSameNode?e.isSameNode(t):e===t}function A(e){return d.nodeListLengthGetter.call(e)}function F(e){return d.inputValueGetter.call(e)}function V(e){return d.textAreaValueGetter.call(e)}function U(e,t){return d.inputValueSetter.call(e,t)}function L(e,t){return d.textAreaValueSetter.call(e,t)}},"event.js":function(e,t,n){e.__esModule=!0,e.preventDefault=e.WHICH_PARAMETER=e.DOM_EVENTS=e.BUTTONS_PARAMETER=e.BUTTON=void 0,e.bind=d,e.unbind=c,e.documentReady=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0;return f().then(function(){return u.getEventListeners(window,"load").length?a.race([m(),(0,r.default)(e)]):null})};var o=l(n("../deps/hammerhead")),r=l(n("./delay")),i=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}}(n("./dom"));function l(e){return e&&e.__esModule?e:{default:e}}var a=o.default.Promise,s=o.default.nativeMethods,u=o.default.eventSandbox.listeners;e.BUTTON=o.default.utils.event.BUTTON,e.BUTTONS_PARAMETER=o.default.utils.event.BUTTONS_PARAMETER,e.DOM_EVENTS=o.default.utils.event.DOM_EVENTS,e.WHICH_PARAMETER=o.default.utils.event.WHICH_PARAMETER,e.preventDefault=o.default.utils.event.preventDefault;function d(e,t,n,o){i.isWindow(e)?s.windowAddEventListener.call(e,t,n,o):s.addEventListener.call(e,t,n,o)}function c(e,t,n,o){i.isWindow(e)?s.windowRemoveEventListener.call(e,t,n,o):s.removeEventListener.call(e,t,n,o)}var f=function(){var n=[];var e=!1;function t(){e||(document.body?(e=!0,n.forEach(function(e){return e()})):s.setTimeout.call(window,t,1))}function o(){(i.isIFrameWindowInDOM(window)||i.isTopWindow(window))&&(c(document,"DOMContentLoaded",o),t())}return"complete"===document.readyState?s.setTimeout.call(window,o,1):d(document,"DOMContentLoaded",o),{then:function(e){return function(t){return new a(function(e){return n.push(function(){return e(t())})})}(e)}}},m=function(){return new a(function(e){return d(window,"load",e)})}},"get-key-array.js":function(e,t,n){e.__esModule=!0,e.default=function(e){var t=e.replace(/^\+/g,"plus").replace(/\+\+/g,"+plus").split("+");return(0,o.map)(t,function(e){return e.replace("plus","+")})};var o=n("./array");t.exports=e.default},"get-sanitized-key.js":function(e,t,n){e.__esModule=!0,e.default=function(e){var t=1===e.length||"space"===e?e:e.toLowerCase();i.default.modifiersMap[t]&&(t=i.default.modifiersMap[t]);return t};var o,r=n("./key-maps"),i=(o=r)&&o.__esModule?o:{default:o};t.exports=e.default},"get-time-limited-promise.js":function(e,t,n){e.__esModule=!0,e.default=function(e,t){return o.Promise.race([e,(0,r.default)(t).then(function(){return o.Promise.reject(new u)})])};var o=n("../deps/hammerhead"),r=l(n("./delay")),i=n("../../../errors/types");function l(e){return e&&e.__esModule?e:{default:e}}var a,s=l(n("../../../errors/runtime/templates")).default[i.RUNTIME_ERRORS.timeLimitedPromiseTimeoutExpired],u=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(d,a=Error),d);function d(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,a.call(this,s));return e.code=i.RUNTIME_ERRORS.timeLimitedPromiseTimeoutExpired,e}t.exports=e.default},"key-maps.js":function(e,t,n){e.__esModule=!0;var o,r=n("../deps/hammerhead");var i=((o=r)&&o.__esModule?o:{default:o}).default.utils.browser,l={alt:18,ctrl:17,meta:91,shift:16},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=","{":"[","}":"]",":":";",'"':"'","|":"\\","<":",",">":".","?":"/","±":"§"},s={backspace:8,capslock:20,delete:46,down:40,end:35,enter:13,esc:27,home:36,ins:45,left:37,pagedown:34,pageup:33,right:39,space:32,tab:9,up:38};function u(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}e.default={modifiers:l,shiftMap:a,specialKeys:s,reversedModifiers:u(l),reversedShiftMap:u(a),reversedSpecialKeys:u(s),modifiersMap:{option:"alt"},keyProperty:{left:i.isIE?"Left":"ArrowLeft",down:i.isIE?"Down":"ArrowDown",right:i.isIE?"Right":"ArrowRight",up:i.isIE?"Up":"ArrowUp",backspace:"Backspace",capslock:"CapsLock",delete:"Delete",end:"End",enter:"Enter",esc:"Escape",home:"Home",ins:"Insert",pagedown:"PageDown",pageup:"PageUp",space:" ",tab:"Tab",alt:"Alt",ctrl:"Control",meta:"Meta",shift:"Shift"},symbolCharCodeToKeyCode:{96:192,91:219,93:221,92:220,59:186,39:222,44:188,45:i.isFirefox?173:189,46:190,47:191},symbolKeysCharCodes:{109:45,173:45,186:59,187:61,188:44,189:45,190:46,191:47,192:96,219:91,220:92,221:93,222:39,110:46,96:48,97:49,98:50,99:51,100:52,101:53,102:54,103:55,104:56,105:57,107:43,106:42,111:47}},t.exports=e.default},"node-type-descriptions.js":function(e,t,n){e.__esModule=!0,e.default={1:"element",2:"attribute",3:"text",4:"cdata section",5:"entity reference",6:"entity node",7:"processing instruction",8:"comment",9:"document",10:"document type",11:"document fragment",12:"notation"},t.exports=e.default},"noop.js":function(e,t,n){e.__esModule=!0,e.default=function(){},t.exports=e.default},"parse-key-sequence.js":function(e,t,n){e.__esModule=!0,e.default=function(e){if("string"!=typeof e)return{error:!0};var t=(e=u(e).replace(/\s+/g," ")).length,n=e.charAt(t-1),o=e.charAt(t-2);1<t&&"+"===n&&!/[+ ]/.test(o)&&(e=e.substring(0,e.length-1));var r=e.split(" ");return{combinations:r,error:(0,l.some)(r,function(e){var t=(0,a.default)(e);return(0,l.some)(t,function(e){var t=1===e.length||"space"===e,n=(0,s.default)(e),o=i.default.modifiers[n],r=i.default.specialKeys[n];return!(t||o||r)})}),keys:e}};var o=r(n("../deps/hammerhead")),i=r(n("./key-maps")),l=n("./array"),a=r(n("./get-key-array")),s=r(n("./get-sanitized-key"));function r(e){return e&&e.__esModule?e:{default:e}}var u=o.default.utils.trim;t.exports=e.default},"position.js":function(e,t,n){e.__esModule=!0,e.offsetToClientCoords=e.getOffsetPosition=e.getElementRectangle=void 0,e.getIframeClientCoordinates=function(e){var t=R(e),n=t.left,o=t.top,r=T({x:n,y:o}),i=y.getBordersWidth(e),l=y.getElementPadding(e),a=r.x+i.left+l.left,s=r.y+i.top+l.top;return{left:a,top:s,right:a+y.getWidth(e),bottom:s+y.getHeight(e)}},e.isElementVisible=function e(t){if(b.isTextNode(t))return!y.isNotVisibleNode(t);var n=d(t);if(!b.isContentEditableElement(t)&&(0===n.width||0===n.height))return!1;if(b.isMapElement(t)){var o=b.getMapContainer(b.closest(t,"map"));return!!o&&e(o)}if(y.isSelectVisibleChild(t)){var r=b.getSelectParent(t),i=b.getChildVisibleIndex(r,t),l=y.getSelectElementSize(r),a=Math.max(y.getScrollTop(r)/y.getOptionHeight(r),0),s=a+l-1,u=Math.max(i-a,0);return a<=u&&u<=s}if(b.isSVGElement(t))return"hidden"!==y.get(t,"visibility")&&"none"!==y.get(t,"display");return y.hasDimensions(t)&&"hidden"!==y.get(t,"visibility")},e.getClientDimensions=s,e.containsOffset=function(e,t,n){var o=s(e),r=Math.max(e.scrollWidth,o.width),i=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+i;return(void 0===t||0<=t&&t<=l)&&(void 0===n||0<=n&&n<=a)},e.getEventAbsoluteCoordinates=function(e){var t=e.target||e.srcElement,n=u(e),o=b.findDocument(t),r=0,i=0;if(b.isElementInIframe(o.documentElement)){var l=b.getIframeByElement(o);if(l){var a=R(l),s=y.getBordersWidth(l);r=a.left+s.left,i=a.top+s.top}}return{x:n.x+r,y:n.y+i}},e.getEventPageCoordinates=u,e.getElementFromPoint=function(e,t){var n=null,o=document.getElementFromPoint||document.elementFromPoint;try{n=o.call(document,e,t)}catch(e){return null}null===n&&(n=o.call(document,e-1,t-1));for(;n&&n.shadowRoot&&n.shadowRoot.elementFromPoint;){var r=n.shadowRoot.elementFromPoint(e,t);if(!r||n===r)break;n=r}return n},e.getIframePointRelativeToParentFrame=function(e,t){var n=b.findIframeByWindow(t),o=R(n),r=y.getBordersWidth(n),i=y.getElementPadding(n);return T({x:e.x+o.left+r.left+i.left,y:e.y+o.top+r.top+i.top})},e.clientToOffsetCoord=function(e,t){var n=t||document;return{x:e.x+y.getScrollLeft(n),y:e.y+y.getScrollTop(n)}},e.findCenter=function(e){var t=d(e);return{x:Math.round(t.left+t.width/2),y:Math.round(t.top+t.height/2)}},e.getClientPosition=function(e){var t=R(e),n=t.left,o=t.top,r=T({x:n,y:o});return r.x=Math.round(r.x),r.y=Math.round(r.y),r},e.getElementClientRectangle=function(e){var t=d(e),n=T({x:t.left,y:t.top});return{height:t.height,left:n.x,top:n.y,width:t.width}},e.calcRelativePosition=function(e,t){return{left:Math.ceil(e.left-(t.left+t.border.left)),right:Math.floor(t.right-t.border.right-t.scrollbar.right-e.right),top:Math.ceil(e.top-(t.top+t.border.top)),bottom:Math.floor(t.bottom-t.border.bottom-t.scrollbar.bottom-e.bottom)}},e.isInRectangle=function(e,t){var n=e.x,o=e.y;return n>=t.left&&n<=t.right&&o>=t.top&&o<=t.bottom},e.getLineYByXCoord=function(e,t,n){if(t.x-e.x==0)return null;var o=(t.y-e.y)/(t.x-e.x),r=e.x*(e.y-t.y)/(t.x-e.x)+e.y;return Math.round(o*n+r)},e.getLineXByYCoord=function(e,t,n){if(t.y-e.y==0)return null;var o=(t.x-e.x)/(t.y-e.y),r=e.y*(e.x-t.x)/(t.y-e.y)+e.x;return Math.round(o*n+r)};var o,r=n("../deps/hammerhead"),i=(o=r)&&o.__esModule?o:{default:o},y=l(n("./style")),b=l(n("./dom"));function l(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}var d=e.getElementRectangle=i.default.utils.position.getElementRectangle,R=e.getOffsetPosition=i.default.utils.position.getOffsetPosition,T=e.offsetToClientCoords=i.default.utils.position.offsetToClientCoords;function s(e){if(!b.isDomElement(e)){var t=T(e);return{width:0,height:0,border:{bottom:0,left:0,right:0,top:0},scroll:{left:0,top:0},left:t.x,right:t.x,top:t.y,bottom:t.y}}var n=/html/i.test(e.tagName),o=n?e.getElementsByTagName("body")[0]:null,r=y.getBordersWidth(e),i=e.getBoundingClientRect(),l=y.getElementScroll(e),a=b.isElementInIframe(e),s=n?0:i.left,u=n?0:i.top,d=n?e.clientHeight:i.height,c=n?e.clientWidth:i.width,f="BackCompat"===e.ownerDocument.compatMode;if(n&&o&&("boolean"==typeof isIFrameWithoutSrc&&isIFrameWithoutSrc||f)&&(d=o.clientHeight,c=o.clientWidth),a){var m=b.getIframeByElement(e);if(m){var h=R(m),p=T({x:h.left,y:h.top}),E=y.getBordersWidth(m);s+=p.x+E.left,u+=p.y+E.top,n&&(r.bottom+=E.bottom,r.left+=E.left,r.right+=E.right,r.top+=E.top)}}var g=!n&&y.getInnerWidth(e)!==e.clientWidth?b.getScrollbarSize():0,v=!n&&y.getInnerHeight(e)!==e.clientHeight?b.getScrollbarSize():0;return{width:c,height:d,left:s,top:u,border:r,bottom:u+d,right:s+c,scroll:{left:l.left,top:l.top},scrollbar:{right:g,bottom:v}}}function u(e){var t=/^touch/.test(e.type)&&e.targetTouches?e.targetTouches[0]||e.changedTouches[0]:e,n=0===t.pageX&&0===t.pageY,o=0!==t.clientX||0!==t.clientY;if((null===t.pageX||n&&o)&&null!==t.clientX){var r=b.findDocument(e.target||e.srcElement),i=r.documentElement,l=r.body;return{x:Math.round(t.clientX+(i&&i.scrollLeft||l&&l.scrollLeft||0)-(i.clientLeft||0)),y:Math.round(t.clientY+(i&&i.scrollTop||l&&l.scrollTop||0)-(i.clientTop||0))}}return{x:Math.round(t.pageX),y:Math.round(t.pageY)}}},"promise.js":function(e,t,n){e.__esModule=!0,e.whilst=function(o,r){return new a(function(t,n){return function e(){return o()?r().then(e).catch(function(e){return n(e)}):t()}()})},e.times=function(e,t){function n(e){o=o.then(function(){return t(e)})}for(var o=a.resolve(),r=0;r<e;r++)n(r);return o},e.each=function(e,n){return(0,l.reduce)(e,function(e,t){return e.then(function(){return n(t)})},a.resolve())};var o,r=n("../deps/hammerhead"),i=(o=r)&&o.__esModule?o:{default:o},l=n("./array");var a=i.default.Promise},"send-request-to-frame.js":function(e,t,n){e.__esModule=!0,e.default=function(e,o,t){return new l(function(n){a.on(a.SERVICE_MSG_RECEIVED_EVENT,function e(t){t.message.cmd===o&&(a.off(a.SERVICE_MSG_RECEIVED_EVENT,e),n(t.message))}),a.sendServiceMsg(e,t)})};var o,r=n("../deps/hammerhead"),i=(o=r)&&o.__esModule?o:{default:o};var l=i.default.Promise,a=i.default.eventSandbox.message;t.exports=e.default},"service.js":function(e,t,n){e.__esModule=!0,e.EventEmitter=void 0,e.inherit=function(e,t){function n(){}n.prototype=t.prototype,i.default.utils.extend(e.prototype,new n),(e.prototype.constructor=e).base=t.prototype};var o,r=n("../deps/hammerhead"),i=(o=r)&&o.__esModule?o:{default:o},l=n("./array");var a=e.EventEmitter=function(){this.eventsListeners=[]};a.prototype.emit=function(e){var t=this.eventsListeners[e];if(t)for(var n=0;n<t.length;n++)try{t[n]&&t[n].apply(this,Array.prototype.slice.apply(arguments,[1]))}catch(e){if(!(e.message&&-1<e.message.indexOf("freed script")))throw e;t[n]=null}},a.prototype.off=function(e,t){var n=this.eventsListeners[e];n&&(this.eventsListeners[e]=(0,l.filter)(n,function(e){return e!==t}))},a.prototype.on=function(e,t){this.eventsListeners[e]||(this.eventsListeners[e]=[]),this.eventsListeners[e].push(t)},a.prototype.once=function(e,t){var n=this;this.on(e,function(){return n.off(e,t),t.apply(void 0,arguments)})}},"style.js":function(e,t,n){e.__esModule=!0,e.get=e.setScrollTop=e.setScrollLeft=e.getScrollTop=e.getScrollLeft=e.getInnerHeight=e.getInnerWidth=e.getHeight=e.getWidth=e.isSelectVisibleChild=e.isElementVisible=e.getSelectElementSize=e.getOptionHeight=e.getElementScroll=e.getElementPadding=e.getElementMargin=e.getComputedStyle=e.getBordersWidth=void 0,e.isFixedElement=function(e){return s.isElementNode(e)&&"fixed"===d(e,"position")},e.isNotVisibleNode=function(e){return!s.isRenderedNode(e)||p(e)||h(e)},e.getScrollableParents=function(e){var t=s.getParents(e);if(s.isElementInIframe(e)){var n=s.getParents(s.getIframeByElement(e));t.concat(n)}return(0,l.filter)(t,g)},e.hasScroll=g,e.hasDimensions=function(e){return e&&!(e.offsetHeight<=0&&e.offsetWidth<=0)},e.set=function(e,t,n){"string"==typeof t&&a.set(e,t,n);for(var o in t)t.hasOwnProperty(o)&&a.set(e,o,t[o])},e.getViewportDimensions=function(){return{width:v(window.innerWidth,document.documentElement.clientWidth,document.body.clientWidth),height:v(window.innerHeight,document.documentElement.clientHeight,document.body.clientHeight)}};var o,r=n("../deps/hammerhead"),i=(o=r)&&o.__esModule?o:{default:o},s=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}}(n("./dom")),l=n("./array");var a=i.default.utils.style,u=i.default.utils.browser,d=(e.getBordersWidth=i.default.utils.style.getBordersWidth,e.getComputedStyle=i.default.utils.style.getComputedStyle,e.getElementMargin=i.default.utils.style.getElementMargin,e.getElementPadding=i.default.utils.style.getElementPadding,e.getElementScroll=i.default.utils.style.getElementScroll,e.getOptionHeight=i.default.utils.style.getOptionHeight,e.getSelectElementSize=i.default.utils.style.getSelectElementSize,e.isElementVisible=i.default.utils.style.isElementVisible,e.isSelectVisibleChild=i.default.utils.style.isVisibleChild,e.getWidth=i.default.utils.style.getWidth,e.getHeight=i.default.utils.style.getHeight,e.getInnerWidth=i.default.utils.style.getInnerWidth,e.getInnerHeight=i.default.utils.style.getInnerHeight,e.getScrollLeft=i.default.utils.style.get