UNPKG

@sideex/api

Version:

This is SideeX JavaScript API for recording and playing web browsing behavior. The API can be embeded in a webpage without installing a browser web extension.

1 lines 293 kB
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=64)}([function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return l}));var n=r(56),o=r.n(n);var i=r(57),a=r.n(i);String.prototype.supplant=function(e,t){return this.replace(/\${([^{}]*)}/g,(r,n)=>{for(let r of[e,t]){let e=r[n.trim()];if("string"==typeof e||"number"==typeof e)return e.toString()}throw new TypeError("Variable "+r+" does not defined")})},String.prototype.lcfirst=function(){return this.charAt(0).toLowerCase()+this.substr(1)},String.prototype.ucfirst=function(){return this.charAt(0).toUpperCase()+this.substr(1)},Array.prototype.remove=function(e){const t=this.indexOf(e);return t>-1&&this.splice(t,1),this},Array.prototype.insert=function(e,t){return this.splice(e,0,t)},Reflect.defineProperty(Array.prototype,"remove",{configurable:!0,writable:!0,value(e){const t=this.indexOf(e);return t>-1&&(this.splice(t,1),!0)}}),Reflect.defineProperty(Array.prototype,"insert",{configurable:!0,writable:!0,value(e,t){return this.splice(e,0,t)}});class s{static lcfirst(e){return e.charAt(0).toLowerCase()+e.substr(1)}static ucfirst(e){return e.charAt(0).toUpperCase()+e.substr(1)}static getText(e){let t=e.innerText;return t=s.normalizeNewlines(t),t=s.normalizeSpaces(t,e),t.trim()}static getTooltip(e){if(s.is(e,e instanceof window.HTMLElement))return s.is(e,"IMG"===e.tagName),e.title;if(e instanceof SVGElement){if(e.children.length>0)for(let t=0;t<e.children.length;t++)if("title"===e.children[t].tagName)return e.children[t].textContent;let t=e.parentNode;for(;t instanceof SVGElement;){for(let e=0;e<t.children.length;e++)if("title"===t.children[e].tagName)return t.children[e].textContent;t=t.parentNode}}return""}static escape(e){return e.replace(/[&"'<>\n\t]/g,e=>({"&":"&amp;",'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","\n":"\\n","\t":"\\t"}[e]))}static unescape(e){return e.replace(/(&amp;)|(&quot;)|(&#39;)|(&lt;)|(&gt;)|(\\n)|(\\t)/g,e=>({"&amp;":"&","&quot;":'"',"&#39;":"'","&lt;":"<","&gt;":">","\\n":"\n","\\t":"\t"}[e]))}static normalizeNewlines(e){return e.replace(/\r\n|\r/g,"\n")}static normalizeSpaces(e,t){return t&&getComputedStyle(t).whiteSpace.match("^(pre|pre-line)$")||(e=e.replace(/ +/g," ")),e.replace(new RegExp(String.fromCharCode(160),"g")," ")}static getElementValue(e){var t;let r=null!==(t=e.getAttribute("value"))&&void 0!==t?t:"";return e instanceof HTMLInputElement&&["checkbox","radio"].includes(e.type)?r=e.checked?"on":"off":(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement)&&(r=e.value),r}static getInputValue(e){try{if(e.type.match("^(checkbox|radio)$"))return e.checked?"on":"off"}catch(e){}return e.value}static getTagName(e){try{return e.tagName.toLowerCase()}catch(e){return null}}static isInShadowDom(e){for(;e;e=e.parentNode)if(e.nodeType==Node.DOCUMENT_FRAGMENT_NODE)return!0;return!1}static extractExceptionMessage(e){if(null==e)return"null exception";if(e instanceof Error)return e.message;try{return e.toString()}catch(e){return null}}static parse_locator(e){if(e.includes("TAC_LOCATOR"))return{type:"tac",string:e};{const t=e.match(/^([A-Za-z]+)=.+/);if(t){const r=t[1].toLowerCase();return{type:r,string:e.substring(r.length+1)}}return{type:"implicit",string:e}}}static exactMatchPattern(e=null){return e&&(e.match(/^\w*:/)||e.match(/\?\*/))?"exact:"+e:e}static xpathGenerator(e){let t="";for(let r=e;null!=r;r=r.parentElement){if(null==r.parentElement){t="//"+r.tagName.toLowerCase()+t;break}{let e=r.tagName.toLowerCase();"[object HTMLUnknownElement]"==document.createElement(e).toString()&&(e="*[name()='"+e+"']");let n=0,o=0,i=!1;for(const e of r.parentElement.children)e.tagName==r.tagName&&(i||n++,o++),e==r&&(i=!0);let a="/"+e;o>1&&(a+="["+n+"]"),t=a+t}}return t}static async delay(e){await new Promise(t=>{setTimeout(t,e)})}static isWebdriver(){return"webdriver"==window.sideex}static getFormatTime(){let e=new Date;return`${""+e.getFullYear()}${(""+(e.getMonth()+1)).padStart(2,"0")}${(""+e.getDate()).padStart(2,"0")} ${(""+e.getHours()).padStart(2,"0")}-${(""+e.getMinutes()).padStart(2,"0")}-${(""+e.getSeconds()).padStart(2,"0")}`}static makeTextFile(e,t){let r="text/plain";switch(t){case"html":r="text/html";break;case"json":r="application/json";break;case"csv":r="text/csv";break;case"zip":r="application/zip"}return URL.createObjectURL(new Blob([e],{type:r}))}static releaseObjectURL(e){URL.revokeObjectURL(e)}static compareTwoArray(e,t){if(!t)return!1;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]instanceof Array&&t[r]instanceof Array){if(!s.compareTwoArray(e,t))return!1}else if(!o()(e[r],t[r]))return!1;return!0}static emptyNode(e){for(;e.firstChild;)e.firstChild.remove()}static async promiseTimeout(e,t,r,n=!1){let o;return o=e instanceof Promise?e:e(),Promise.race([(async()=>{if(await s.delay(t),n)throw r;return r})(),o])}static is(e,t=!0){return t}static stopNativeEvent(e){e.preventDefault(),e.stopPropagation()}static assertSutieCaseNameValid(e){if(e.length<=0)throw new Error("You need to type something");if(e.match(/\/|\\|:|\?|"|\*|<|>|\||\./gi))throw new Error('The name cannot contain . / \\ : * ? " < > |')}static eval_css(e,t){return a()(e,t)}}s.SeleniumError=class extends Error{constructor(e){super(e),this.isSeleniumError=!0}};class l{constructor(e){this.matcher=void 0,this.selectStrategy(e)}selectStrategy(e){let t="glob";if(/^([a-z-]+):(.*)/.test(e)){var r=RegExp.$1,n=RegExp.$2;l.strategies[r]&&(t=r,e=n)}const o=l.strategies[t];if(!o)throw new s.SeleniumError("cannot find PatternMatcher.strategies."+t);this.matcher=new o(e)}matches(e){return this.matcher.matches(e+"")}static matches(e,t){return new l(e).matches(t)}static convertGlobMetaCharsToRegexpMetaChars(e){return e.replace(/([.^$+(){}[\]\\|])/g,"\\$1").replace(/\?/g,"(.|[\r\n])").replace(/\*/g,"(.|[\r\n])*")}static regexpFromGlobContains(e){return l.convertGlobMetaCharsToRegexpMetaChars(e)}}l.strategies=void 0,l.regexpFromGlob=function(e){return"^"+l.convertGlobMetaCharsToRegexpMetaChars(e)+"$"}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));var n=r(21),o=r(32),i=r(2);class a{constructor(e){this.window=e,this.attached=!1,this.locatorBuilders=new n.a(e),this.frameLocation=this.getFrameLocation(),i.a.runtimeSendMessage({frameLocation:this.frameLocation}).catch((function(){})),this.listenerMap={}}initialize(){this.pageLoaded=!0,this.totalNode=0,this.scrollDetector=!1,this.mouseOverElement={},this.mouseOverCache={},this.mouseOverDelayTime=200,this.mouseOverQueue=[],this.mouseOutElements=[],this.lastRecordMouseOver=0,this.deleteTimestamp=[],this.mouseDownDetector=!1,this.typeRecorded=!0,this.typeType="",this.typeTagName="",this.enterWithPress=!1,this.tempEnterPress=!1,this.submitEvent=!1,this.commandTimestamp=0,this.prevCommandTimestamp=0}parseEventKey(e){return e.match(/^C_/)?{eventName:e.substring(2),capture:!0}:{eventName:e,capture:!1}}attach(){if(!this.attached){this.attached=!0,this.initialize(),this.eventListeners={};for(let[n,o]of Object.entries(a.eventHandlers)){var e=this.parseEventKey(n),t=e.eventName,r=e.capture;this.eventListeners[n]=e=>{for(const t of o)t.call(this,e)},this.window.document.addEventListener(t,this.eventListeners[n],r)}if(!this.executeOnce){this.executeOnce=!0;for(let e in a.initialVars)if(a.initialVars[e].ctor){let t=a.initialVars[e].ctor,r=[null].concat(a.initialVars[e].args),n=t.bind.apply(t,r);this[e]=new n}else this[e]=a.initialVars[e].value}}}detach(){if(this.attached){this.attached=!1;for(let n in this.eventListeners){var e=this.parseEventKey(n),t=e.eventName,r=e.capture;this.window.document.removeEventListener(t,this.eventListeners[n],r)}delete this.eventListeners}}getFrameLocation(){let e,t=window,r="";for(;t!==window.top;){e=t.parent;for(let n=0;n<e.frames.length;n++)if(e.frames[n]===t){r=":"+n+r,t=e;break}}return"root"+r}record(e,t,r,n,o){function a(e){let t=[],r={options:[],tac:""};for(let r of e)t.push({type:r[1]?r[1]:"other",value:r[0]});return r.options=t,r}0===t.length&&(t=this.prebuildedTarget,this.prebuildedTarget=null),async function(e,t,r,n,o){try{console.log("-> Record: %c"+e,"color: blue;"),await i.a.runtimeSendMessage({command:e,target:t,value:r,insertBeforeLastCommand:n,frameLocation:null!=o?o:this.frameLocation})}catch(e){console.log(e),this.detach()}}.call(this,e,a(t),function(e){return"string"!=typeof e?a(e):{options:[{type:"other",value:e}],tac:""}}(r),n,o)}static addEventHandlerVar(e,t,...r){this.initialVars[e]={},t instanceof Function?(this.initialVars[e].ctor=t,this.initialVars[e].args=r):this.initialVars[e].value=t}static addEventHandler(e,t,r,n){r.handlerName=e;let o=n?"C_"+t:t;this.eventHandlers[o]||(this.eventHandlers[o]=[]),this.eventHandlers[o].push(r)}}a.eventHandlers={},a.initialVars={},Object(o.a)()},function(e,t,r){"use strict";r.d(t,"a",(function(){return f}));var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),o=new Uint8Array(16);function i(){if(!n)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(o)}for(var a=[],s=0;s<256;++s)a.push((s+256).toString(16).substr(1));var l=function(e,t){var r=t||0;return(a[e[r+0]]+a[e[r+1]]+a[e[r+2]]+a[e[r+3]]+"-"+a[e[r+4]]+a[e[r+5]]+"-"+a[e[r+6]]+a[e[r+7]]+"-"+a[e[r+8]]+a[e[r+9]]+"-"+a[e[r+10]]+a[e[r+11]]+a[e[r+12]]+a[e[r+13]]+a[e[r+14]]+a[e[r+15]]).toLowerCase()};var c=function(e,t,r){var n=(e=e||{}).random||(e.rng||i)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=n[o];return t}return l(n)},u=r(0);class d extends Error{constructor(e){super(e),this.name="TimeoutError"}}const h={};!async function(){"loading"==document.readyState&&await new Promise(e=>{document.addEventListener("DOMContentLoaded",e,{once:!0})}),window.addEventListener("message",async e=>{if(e.data&&e.data._details&&!e.data._details.callbackId&&e.data._details.eventName in h){var t;const r=[];for(const t of h[e.data._details.eventName])r.push(t(e.data,e.source));let n=[];const o={_details:{id:c(),callbackId:e.data._details.id,eventName:e.data._details.eventName}};try{n=(await Promise.all(r)).filter(e=>e),o._details.returnValue=n[0]}catch(e){e instanceof Error?o._details.error=e.message:o._details.error=e instanceof String?e.toString():JSON.stringify(e)}if(u.b.is(e.source,(null==e||null===(t=e.source)||void 0===t?void 0:t.postMessage)instanceof Function)?e.source.postMessage(o,"*"):window.postMessage.call(e.source,o,"*"),n.length>1)throw new Error("More than one onMessage listener send response, eventName="+e.data._details.eventName)}})}(),Reflect.defineProperty(window,"postMessageAsync",{configurable:!0,writable:!0,async value(e,t,r){return await async function(e,t,r,n){const o=Object.assign({targetOrigin:"*",timeout:0},n),i=c();r._details={id:i,eventName:t};const a=async()=>await new Promise((t,n)=>{const a=e=>{var r,o;(null===(r=e.data)||void 0===r||null===(o=r._details)||void 0===o?void 0:o.callbackId)==i&&(window.removeEventListener("message",a),e.data._details.error?n(e.data._details.error):t(e.data._details.returnValue))};window.addEventListener("message",a),(null==e?void 0:e.postMessage)instanceof Function?e.postMessage(r,o.targetOrigin):window.postMessage.call(e,r,o.targetOrigin)});"loading"==document.readyState&&await new Promise(e=>{document.addEventListener("DOMContentLoaded",e,{once:!0})});return o.timeout>0?await u.b.promiseTimeout(a,o.timeout,new d("postMessageAsync timeout, eventName="+t),!0):await a()}(this,e,t,r)}}),Reflect.defineProperty(window,"addAsyncMessageListener",{configurable:!0,writable:!0,value(e,t){null==h[e]&&(h[e]=[]),h[e].includes(t)||h[e].push(t)}}),Reflect.defineProperty(window,"removeAsyncMessageListener",{configurable:!0,writable:!0,value(e,t){h[e]&&h[e].includes(t)&&(h[e].remove(t),0==h[e].length&&(h[e]=void 0))}});class f{static tabSendMessage(e,t,r){return this.isExtension?browser.tabs.sendMessage(t,e,r):window.postMessageAsync("message",e)}static runtimeSendMessage(e,t,r){return this.isExtension?browser.runtime.sendMessage(t,e,r):window.postMessageAsync("message",e)}static addListener(e){return this.isExtension?browser.runtime.onMessage.addListener(e):window.addAsyncMessageListener("message",e)}}f.isExtension=!1},function(e,t,r){"use strict";r.d(t,"c",(function(){return s})),r.d(t,"a",(function(){return l})),r.d(t,"d",(function(){return c})),r.d(t,"b",(function(){return u}));var n=r(1),o=r(10),i=r(62),a=r(21);const s=new n.a(window),l=new o.a,c=new i.a(l),u=new a.a(window)},function(e,t,r){var n=r(36),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},function(e,t,r){"use strict";t.a={ControlKeysMap:{"${KEY_BACKSPACE}":{keyCode:8,which:8,charCode:0,code:"Backspace",key:"Backspace"},"${KEY_TAB}":{keyCode:9,which:9,charCode:0,code:"Tab",key:"Tab"},"${KEY_ENTER}":{keyCode:13,which:13,charCode:13,code:"Enter",key:"Enter",press:!0},"${KEY_ENTER_NOPRESS}":{keyCode:13,which:13,charCode:13,code:"Enter",key:"Enter",press:!1},"${KEY_SHIFTLEFT}":{keyCode:16,which:16,charCode:0,code:"ShiftLeft",key:"Shift"},"${KEY_SHIFTRIGHT}":{keyCode:16,which:16,charCode:0,code:"ShiftRight",key:"Shift"},"${KEY_CONTROLLEFT}":{keyCode:17,which:17,charCode:0,code:"ControlLeft",key:"Control"},"${KEY_CONTROLRIGHT}":{keyCode:17,which:17,charCode:0,code:"ControlRight",key:"Control"},"${KEY_ALTLEFT}":{keyCode:18,which:18,charCode:0,code:"AltLeft",key:"Alt"},"${KEY_ALTRIGHT}":{keyCode:18,which:18,charCode:0,code:"AltRight",key:"Alt"},"${KEY_CAPSLOCK}":{keyCode:20,which:20,charCode:0,code:"CapsLock",key:"CapsLock"},"${KEY_ESC}":{keyCode:27,which:27,charCode:0,code:"Escape",key:"Escape"},"${KEY_PAGEUP}":{keyCode:33,which:33,charCode:0,code:"PageUp",key:"PageUp"},"${KEY_PAGEDOWN}":{keyCode:34,which:34,charCode:0,code:"PageDown",key:"PageDown"},"${KEY_END}":{keyCode:35,which:35,charCode:0,code:"End",key:"End"},"${KEY_HOME}":{keyCode:36,which:36,charCode:0,code:"Home",key:"Home"},"${KEY_LEFT}":{keyCode:37,which:37,charCode:0,code:"ArrowLeft",key:"ArrowLeft"},"${KEY_UP}":{keyCode:38,which:38,charCode:0,code:"ArrowUp",key:"ArrowUp"},"${KEY_RIGHT}":{keyCode:39,which:39,charCode:0,code:"ArrowRight",key:"ArrowRight"},"${KEY_DOWN}":{keyCode:40,which:40,charCode:0,code:"ArrowDown",key:"ArrowDown"},"${KEY_INSERT}":{keyCode:45,which:45,charCode:0,code:"Insert",key:"Insert"},"${KEY_DELETE}":{keyCode:46,which:46,charCode:0,code:"Delete",key:"Delete"},"${KEY_NUMLOCK}":{keyCode:144,which:144,charCode:0,code:"NumLock",key:"NumLock"}},NormalKeyMap:{A:{keyCode:65,which:65,charCode:65,code:"KeyA",key:"A",data:"A"},B:{keyCode:66,which:66,charCode:66,code:"KeyB",key:"B",data:"B"},C:{keyCode:67,which:67,charCode:67,code:"KeyC",key:"C",data:"C"},D:{keyCode:68,which:68,charCode:68,code:"KeyD",key:"D",data:"D"},E:{keyCode:69,which:69,charCode:69,code:"KeyE",key:"E",data:"E"},F:{keyCode:70,which:70,charCode:70,code:"KeyF",key:"F",data:"F"},G:{keyCode:71,which:71,charCode:71,code:"KeyG",key:"G",data:"G"},H:{keyCode:72,which:72,charCode:72,code:"KeyH",key:"H",data:"H"},I:{keyCode:73,which:73,charCode:73,code:"KeyI",key:"I",data:"I"},J:{keyCode:74,which:74,charCode:74,code:"KeyJ",key:"J",data:"J"},K:{keyCode:75,which:75,charCode:75,code:"KeyK",key:"K",data:"K"},L:{keyCode:76,which:76,charCode:76,code:"KeyL",key:"L",data:"L"},M:{keyCode:77,which:77,charCode:77,code:"KeyM",key:"M",data:"M"},N:{keyCode:78,which:78,charCode:78,code:"KeyN",key:"N",data:"N"},O:{keyCode:79,which:79,charCode:79,code:"KeyO",key:"O",data:"O"},P:{keyCode:80,which:80,charCode:80,code:"KeyP",key:"P",data:"P"},Q:{keyCode:81,which:81,charCode:81,code:"KeyQ",key:"Q",data:"Q"},R:{keyCode:82,which:82,charCode:82,code:"KeyR",key:"R",data:"R"},S:{keyCode:83,which:83,charCode:83,code:"KeyS",key:"S",data:"S"},T:{keyCode:84,which:84,charCode:84,code:"KeyT",key:"T",data:"T"},U:{keyCode:85,which:85,charCode:85,code:"KeyU",key:"U",data:"U"},V:{keyCode:86,which:86,charCode:86,code:"KeyV",key:"V",data:"V"},W:{keyCode:87,which:87,charCode:87,code:"KeyW",key:"W",data:"W"},X:{keyCode:88,which:88,charCode:88,code:"KeyX",key:"X",data:"X"},Y:{keyCode:89,which:89,charCode:89,code:"KeyY",key:"Y",data:"Y"},Z:{keyCode:90,which:90,charCode:90,code:"KeyZ",key:"Z",data:"Z"},a:{keyCode:65,which:65,charCode:97,code:"KeyA",key:"a",data:"a"},b:{keyCode:66,which:66,charCode:98,code:"KeyB",key:"b",data:"b"},c:{keyCode:67,which:67,charCode:99,code:"KeyC",key:"c",data:"c"},d:{keyCode:68,which:68,charCode:100,code:"KeyD",key:"d",data:"d"},e:{keyCode:69,which:69,charCode:101,code:"KeyE",key:"e",data:"e"},f:{keyCode:70,which:70,charCode:102,code:"KeyF",key:"f",data:"f"},g:{keyCode:71,which:71,charCode:103,code:"KeyG",key:"g",data:"g"},h:{keyCode:72,which:72,charCode:104,code:"KeyH",key:"h",data:"h"},i:{keyCode:73,which:73,charCode:105,code:"KeyI",key:"i",data:"i"},j:{keyCode:74,which:74,charCode:106,code:"KeyJ",key:"j",data:"j"},k:{keyCode:75,which:75,charCode:107,code:"KeyK",key:"k",data:"k"},l:{keyCode:76,which:76,charCode:108,code:"KeyL",key:"l",data:"l"},m:{keyCode:77,which:77,charCode:109,code:"KeyM",key:"m",data:"m"},n:{keyCode:78,which:78,charCode:110,code:"KeyN",key:"n",data:"n"},o:{keyCode:79,which:79,charCode:111,code:"KeyO",key:"o",data:"o"},p:{keyCode:80,which:80,charCode:112,code:"KeyP",key:"p",data:"p"},q:{keyCode:81,which:81,charCode:113,code:"KeyQ",key:"q",data:"q"},r:{keyCode:82,which:82,charCode:114,code:"KeyR",key:"r",data:"r"},s:{keyCode:83,which:83,charCode:115,code:"KeyS",key:"s",data:"s"},t:{keyCode:84,which:84,charCode:116,code:"KeyT",key:"t",data:"t"},u:{keyCode:85,which:85,charCode:117,code:"KeyU",key:"u",data:"u"},v:{keyCode:86,which:86,charCode:118,code:"KeyV",key:"v",data:"v"},w:{keyCode:87,which:87,charCode:119,code:"KeyW",key:"w",data:"w"},x:{keyCode:88,which:88,charCode:120,code:"KeyX",key:"x",data:"x"},y:{keyCode:89,which:89,charCode:121,code:"KeyY",key:"y",data:"y"},z:{keyCode:90,which:90,charCode:122,code:"KeyZ",key:"z",data:"z"},0:{keyCode:48,which:48,charCode:48,code:"Digit0",key:"0",data:"0"},")":{keyCode:48,which:48,charCode:41,code:"Digit0",key:")",data:")"},1:{keyCode:49,which:49,charCode:49,code:"Digit1",key:"1",data:"1"},"!":{keyCode:49,which:49,charCode:33,code:"Digit1",key:"!",data:"!"},2:{keyCode:50,which:50,charCode:50,code:"Digit2",key:"2",data:"2"},"@":{keyCode:50,which:50,charCode:64,code:"Digit2",key:"@",data:"@"},3:{keyCode:51,which:51,charCode:51,code:"Digit3",key:"3",data:"3"},"#":{keyCode:51,which:51,charCode:35,code:"Digit3",key:"#",data:"#"},4:{keyCode:52,which:52,charCode:52,code:"Digit4",key:"4",data:"4"},$:{keyCode:52,which:52,charCode:36,code:"Digit4",key:"$",data:"$"},5:{keyCode:53,which:53,charCode:53,code:"Digit5",key:"5",data:"5"},"%":{keyCode:53,which:53,charCode:37,code:"Digit5",key:"%",data:"%"},6:{keyCode:54,which:54,charCode:54,code:"Digit6",key:"6",data:"6"},"^":{keyCode:54,which:54,charCode:94,code:"Digit6",key:"^",data:"^"},7:{keyCode:55,which:55,charCode:55,code:"Digit7",key:"7",data:"7"},"&":{keyCode:55,which:55,charCode:38,code:"Digit7",key:"&",data:"&"},8:{keyCode:56,which:56,charCode:56,code:"Digit8",key:"8",data:"8"},"*":{keyCode:56,which:56,charCode:42,code:"Digit8",key:"*",data:"*"},9:{keyCode:57,which:57,charCode:57,code:"Digit9",key:"9",data:"9"},"(":{keyCode:57,which:57,charCode:40,code:"Digit9",key:"(",data:"("},",":{keyCode:186,which:186,charCode:59,code:"Semicolon",key:",",data:","},":":{keyCode:186,which:186,charCode:58,code:"Semicolon",key:":",data:":"},"=":{keyCode:187,which:187,charCode:61,code:"Equal",key:"=",data:"="},"+":{keyCode:187,which:187,charCode:43,code:"Equal",key:"+",data:"+"},";":{keyCode:188,which:188,charCode:44,code:"Comma",key:";",data:";"},"<":{keyCode:188,which:188,charCode:60,code:"Comma",key:"<",data:"<"},"-":{keyCode:189,which:189,charCode:45,code:"Minus",key:"-",data:"-"},_:{keyCode:189,which:189,charCode:95,code:"Minus",key:"_",data:"_"},".":{keyCode:190,which:190,charCode:46,code:"Period",key:".",data:"."},">":{keyCode:190,which:190,charCode:62,code:"Period",key:">",data:">"},"/":{keyCode:191,which:191,charCode:47,code:"Slash",key:"/",data:"/"},"?":{keyCode:191,which:191,charCode:63,code:"Slash",key:"?",data:"?"},"`":{keyCode:192,which:192,charCode:96,code:"Backquote",key:"`",data:"`"},"~":{keyCode:192,which:192,charCode:126,code:"Backquote",key:"~",data:"~"},"[":{keyCode:219,which:219,charCode:91,code:"BracketLeft",key:"[",data:"["},"{":{keyCode:219,which:219,charCode:123,code:"BracketLeft",key:"{",data:"{"},"\\":{keyCode:220,which:220,charCode:92,code:"Backslash",key:"\\",data:"\\"},"|":{keyCode:220,which:220,charCode:124,code:"Backslash",key:"|",data:"|"},"]":{keyCode:221,which:221,charCode:93,code:"BracketRight",key:"]",data:"]"},"}":{keyCode:221,which:221,charCode:125,code:"BracketRight",key:"}",data:"}"},"'":{keyCode:222,which:222,charCode:39,code:"Quote",key:"'",data:"'"},'"':{keyCode:222,which:222,charCode:34,code:"Quote",key:'"',data:'"'}," ":{keyCode:32,which:32,charCode:32,code:"Space",key:"Process",data:" "}},NumpadKeyMap:{0:{keyCode:96,which:96,charCode:48,code:"Numpad0",key:"0",data:"0"},1:{keyCode:97,which:97,charCode:49,code:"Numpad1",key:"1",data:"1"},2:{keyCode:98,which:98,charCode:50,code:"Numpad2",key:"2",data:"2"},3:{keyCode:99,which:99,charCode:51,code:"Numpad3",key:"3",data:"3"},4:{keyCode:100,which:100,charCode:52,code:"Numpad4",key:"4",data:"4"},5:{keyCode:101,which:101,charCode:53,code:"Numpad5",key:"5",data:"5"},6:{keyCode:102,which:102,charCode:54,code:"Numpad6",key:"6",data:"6"},7:{keyCode:103,which:103,charCode:55,code:"Numpad7",key:"7",data:"7"},8:{keyCode:104,which:104,charCode:56,code:"Numpad8",key:"8",data:"8"},9:{keyCode:105,which:105,charCode:57,code:"Numpad9",key:"9",data:"9"},"*":{keyCode:106,which:106,charCode:42,code:"NumpadMultiply",key:"*",data:"*"},"+":{keyCode:107,which:107,charCode:43,code:"NumpadAdd",key:"+",data:"+"},"-":{keyCode:109,which:109,charCode:45,code:"NumpadSubtract",key:"-",data:"-"},".":{keyCode:110,which:110,charCode:46,code:"NumpadDecimal",key:".",data:"."},"/":{keyCode:111,which:111,charCode:47,code:"NumpadDivide",key:"/",data:"/"},"${KEY_NUMENTER}":{keyCode:13,which:13,charCode:13,code:"NumpadEnter",key:"Enter"}},FunctionalKeyMap:{"${KEY_F1}":{keyCode:112,which:112,charCode:0,code:"F1",key:"F1"},"${KEY_F2}":{keyCode:113,which:113,charCode:0,code:"F2",key:"F2"},"${KEY_F3}":{keyCode:114,which:114,charCode:0,code:"F3",key:"F3"},"${KEY_F4}":{keyCode:115,which:115,charCode:0,code:"F4",key:"F4"},"${KEY_F5}":{keyCode:116,which:116,charCode:0,code:"F5",key:"F5"},"${KEY_F6}":{keyCode:117,which:117,charCode:0,code:"F6",key:"F6"},"${KEY_F7}":{keyCode:118,which:118,charCode:0,code:"F7",key:"F7"},"${KEY_F8}":{keyCode:119,which:119,charCode:0,code:"F8",key:"F8"},"${KEY_F9}":{keyCode:120,which:120,charCode:0,code:"F9",key:"F9"},"${KEY_F10}":{keyCode:121,which:121,charCode:0,code:"F10",key:"F10"},"${KEY_F11}":{keyCode:122,which:122,charCode:0,code:"F11",key:"F11"},"${KEY_F12}":{keyCode:123,which:123,charCode:0,code:"F12",key:"F12"}}}},function(e,t,r){var n=r(76),o=r(81);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},function(e,t,r){"use strict";function n(e){return e.replace(/&amp;/gi,"&").replace(/&quot;/gi,'"').replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&#39;/gi,"'")}function o(e){for(var t=0,r=-1,n=e,o="",i="",a="",l=!1;;){if(t=e.indexOf(" "),(r=e.indexOf(" ",t+1))>=0)for(;"'"!=e.charAt(r-1)&&'"'!=e.charAt(r-1)&&!((r=e.indexOf(" ",r+1))<0););if(t>=0&&r>=0)o=e.substring(t+1,r),n=e.substring(0,t+1),e=e.substring(r);else{if(!(t>=0&&r<0)){l?a+=">":a=e;break}o=e.substring(t+1,e.length-1),n=e.substring(0,t+1),e=""}l=!0;var c=o.indexOf("=");if("'"==o.charAt(c+1)&&-1!=o.indexOf("'")){var u=o.indexOf("'"),d=o.lastIndexOf("'");i=o.substring(u+1,d),o=o.substring(0,u+1),o+=(i=s(i))+"'"}if('"'==o.charAt(c+1)&&-1!=o.indexOf('"')){var h=o.indexOf('"'),f=o.lastIndexOf('"');i=o.substring(h+1,f),o=o.substring(0,h+1),o+=(i=s(i))+'"'}a+=n+o}return a}function i(e){return e.replace(/[&"'<>]/g,e=>({"&":"&amp;",'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;"}[e]))}function a(e,t,r){switch(r){case 1:return e+(t+"&amp;");case 2:return e+(t+"&quot;");case 3:return e+(t+"&#39;");case 4:return e+(t+"&lt;");case 5:return e+(t+"&gt;");default:return e}}function s(e){for(var t,r=-1,n="",o="",s=0;;){if(t=0,-1==(r=e.indexOf("&",r+1))){n+=e;break}"&amp;"==e.substring(r,r+5)?(t=1,o=e.substring(0,r),e=e.substring(r+5)):"&quot;"==e.substring(r,r+6)?(t=2,o=e.substring(0,r),e=e.substring(r+6)):"&#39;"==e.substring(r,r+5)?(t=3,o=e.substring(0,r),e=e.substring(r+5)):"&lt;"==e.substring(r,r+4)?(t=4,o=e.substring(0,r),e=e.substring(r+4)):"&gt;"==e.substring(r,r+4)&&(t=5,o=e.substring(0,r),e=e.substring(r+4)),0!=t&&(r=-1,n=a(n,o=i(o),t),s=1)}return 0==s?i(e):n}function l(e){for(var t=e.indexOf("<"),r=e.indexOf(">"),n="",i="",a="",l=0;;){if(!(t>=0)){s(e);break}if(!(r>=0)){s(e);break}do{t+=l,n=e.substring(0,t),l=(i=e.substring(t,r+1)).lastIndexOf("<")}while(0!=l);i=o(i),e=e.substring(r+1),a+=s(n)+i,t=e.indexOf("<"),r=0;do{r=e.indexOf(">",r+1)}while(r<t&&-1!=r)}return""!=e&&(a+=s(e)),a}r.d(t,"c",(function(){return n})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return l}))},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(0);class o{constructor(){this.altKeyDown=!1,this.controlKeyDown=!1,this.shiftKeyDown=!1,this.metaKeyDown=!1,this.window=window}triggerFocusEvent(e){var t=new FocusEvent("focus");e.dispatchEvent(t)}triggerChangeEvent(e){const t=new Event("change",{view:window,bubbles:!0,cancelable:!0});e.dispatchEvent(t)}fireMouseEvent(e,t,r=!0,n=0,o=0,i=0){const a=new MouseEvent(t,{bubbles:r,cancelable:!0,clientX:n,clientY:o,ctrlKey:this.controlKeyDown,shiftKey:this.shiftKeyDown,altKey:this.altKeyDown,metaKey:this.metaKeyDown,button:i});return e.dispatchEvent(a)}triggerDragEvent(e,t){var r=` function simulateDragDrop(sourceNode, destinationNode){ function createCustomEvent(type) { var event = new CustomEvent('CustomEvent'); event.initCustomEvent(type, true, true, null); event.dataTransfer = { data: { }, setData: function(type, val) { this.data[type] = val; }, getData: function(type) { return this.data[type]; } }; return event; } function dispatchEvent(node, type, event) { if (node.dispatchEvent) { return node.dispatchEvent(event); } if (node.fireEvent) { return node.fireEvent('on' + type, event); } } var event = createCustomEvent('dragstart'); dispatchEvent(sourceNode, 'dragstart', event); var dropEvent = createCustomEvent('drop'); dropEvent.dataTransfer = event.dataTransfer; dispatchEvent(destinationNode, 'drop', dropEvent); var dragEndEvent = createCustomEvent('dragend'); dragEndEvent.dataTransfer = event.dataTransfer; dispatchEvent(sourceNode, 'dragend', dragEndEvent); } simulateDragDrop(document.evaluate('${n.b.xpathGenerator(e)}', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue, document.evaluate('${n.b.xpathGenerator(t)}', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue); `;const o=this.getCurrentWindow().document,i=o.createElement("script");i.type="text/javascript",i.text=r,o.body.appendChild(i)}openLocation(e){var t=this.getCurrentWindow();t.location.href===e?t.location.reload():t.location.href=e}getCurrentWindow(){return window}getTitle(){var e=this.getCurrentWindow().document.title;return"string"==typeof e&&(e=e.trim()),e}findElementBy(e,t,r,i){const a=o.locationStrategies[e];if(!a)throw new n.b.SeleniumError("Unrecognised locator type: '"+e+"'");return a.call(this,t,r,i)}findElementRecursive(e,t,r,n){var o=this.findElementBy(e,t,r,n);if(null!=o)return o;for(var i=0;i<n.frames.length;i++)try{if(n.frames[i].document&&null!=(o=this.findElementRecursive(e,t,n.frames[i].document,n.frames[i])))return o}catch(e){return null}}findElementOrNull(e,t,r){e=n.b.parse_locator(e),null==t&&(t=this.getCurrentWindow()),null==r&&(r=t.document);var o=this.findElementBy(e.type,e.string,r,t);return null!=o?o:null}findElement(e,t,r){var n=this.findElementOrNull(e,t,r);return this.checkElementExist(n,e),n}checkElementExist(e,t){if(null==e)throw t.includes("TAC_LOCATOR")?new n.b.SeleniumError("Element located by TAC not found"):"auto-located-by-tac"==t?new this.SeleniumError('The value "auto-located-by-tac" only can be automatically generated when recording a command'):new n.b.SeleniumError("Element "+t+" not found")}selectOption(e,t){this.triggerFocusEvent(e);for(var r=!1,n=0;n<e.options.length;n++){var o=e.options[n];o.selected&&o!=t?(o.selected=!1,r=!0):o.selected||o!=t||(o.selected=!0,r=!0)}r&&this.triggerChangeEvent(e)}addSelection(e,t){this.checkMultiselect(e),this.triggerFocusEvent(e),t.selected||(t.selected=!0,this.triggerChangeEvent(e))}removeSelection(e,t){this.checkMultiselect(e),this.triggerFocusEvent(e),t.selected&&(t.selected=!1,this.triggerChangeEvent(e))}checkMultiselect(e){if(!e.multiple)throw new n.b.SeleniumError("Not a multi-select")}selectElementsBy(e,t,r){var i=o.filterFunctions[e];if(!i)throw new n.b.SeleniumError("Unrecognised element-filter type: '"+e+"'");return i(t,r)}selectElements(e,t,r){var n=r||"value",o=e.match(/^([A-Za-z]+)=(.+)/);return o&&(n=o[1].toLowerCase(),e=o[2]),this.selectElementsBy(n,e,t)}cancelNextPrompt(){return this.setNextPromptResult(null)}postMessageToPageEnv(e={}){e.from="sideex-content-env",window.postMessage(e,"*")}async setNextPromptResult(e){this.promptResponse=!1,this.postMessageToPageEnv({type:"command",args:{commandType:"setNextPromptResult",target:e}});for(let e=0;e<=60;e++){if(this.promptResponse)return void(this.promptResponse=!1);await n.b.delay(500)}throw"No response"}async getPromptMessage(){this.promptResponse=!1,this.promptMessage=null,this.postMessageToPageEnv({type:"command",args:{commandType:"getPromptMessage"}});for(let e=0;e<=60;e++){if(this.promptResponse){const e=this.promptMessage;return this.promptResponse=!1,this.promptMessage=null,e}await n.b.delay(500)}throw"No response"}async setNextConfirmationResult(e){this.confirmationResponse=!1,this.postMessageToPageEnv({type:"command",args:{commandType:"setNextConfirmationResult",target:e}});for(let e=0;e<=60;e++){if(this.confirmationResponse)return void(this.confirmationResponse=!1);await n.b.delay(500)}throw"No response"}async getConfirmationMessage(){this.confirmationResponse=!1,this.confirmationMessage=null,this.postMessageToPageEnv({type:"command",args:{commandType:"getConfirmationMessage"}});for(let e=0;e<=60;e++){if(this.confirmationResponse){const e=this.confirmationMessage;return this.confirmationResponse=!1,this.confirmationMessage=null,e}await n.b.delay(500)}throw"No response"}async getAlertMessage(){for(let e=0;e<=60;e++){if(this.alertResponse){const e=this.alertMessage;return this.alertResponse=!1,this.alertMessage=null,e}await n.b.delay(500)}throw"No response"}async getRunScriptMessage(e){-1==e&&(e=Number.MAX_SAFE_INTEGER);for(let t=0;t<=e;t+=100){if(this.runScriptResponse){const e=this.runScriptMessage;return this.runScriptResponse=!1,this.runScriptMessage=null,e}await n.b.delay(100)}return"No error!!!!"}}o.locationStrategies={implicit:(e,t,r)=>e.startsWith("//")?o.locationStrategies.xpath(e,t,r):e.startsWith("document.")?o.locationStrategies.domtraversal(e,t,r):o.locationStrategies.identifier(e,t,r),identifier:(e,t,r)=>o.locationStrategies.id(e,t,r)||o.locationStrategies.name(e,t,r)||null,id(e,t,r){var n=t.getElementById(e);return n&&n.getAttribute("id")===e?n:null},name(e,t,r){var n=t.getElementsByTagName("*"),o="name="+e;return(n=this.selectElements(o,n,"value")).length>0?n[0]:null},xpath:(e,t,r)=>t.evaluate(e,t,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue,link(e,t,r){for(var o=t.getElementsByTagName("a"),i=0;i<o.length;i++){var a=o[i];if(n.a.matches(e,n.b.getText(a)))return a}return null},tac(e,t,r){var n=t.getElementsByTagName("*");for(let e=0,o=n.length;e<o;e++){if(null==n[e])continue;let o=r.getComputedStyle(n[e]);if("none"==o.display||"hidden"==o.visibility){let r=t.createAttribute("hidden-annotated-by-tac");n[e].setAttributeNode(r)}}let o=t.documentElement.outerHTML;for(let e=0,t=n.length;e<t;e++)null!=n[e]&&n[e].hasAttribute("hidden-annotated-by-tac")&&n[e].removeAttribute("hidden-annotated-by-tac");var i=new Tac("//html","",o);i.testOldXPath()||i.fixOldXPath(),e=e.split("TAC_LOCATOR:")[1];var a=i.locate(e);return null!=a?t.evaluate(a,t,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue:null},css(e,t){var r=n.b.eval_css(e,t);return 0!=r.length?r[0]:null}},o.filterFunctions={name(e,t){for(var r=[],n=0;n<t.length;n++)t[n].name===e&&r.push(t[n]);return r},value(e,t){for(var r=[],n=0;n<t.length;n++)t[n].value===e&&r.push(t[n]);return r},index(e,t){if(e=Number(e),isNaN(e)||e<0)throw new n.b.SeleniumError("Illegal Index: "+e);if(t.length<=e)throw new n.b.SeleniumError("Index out of range: "+e);return[t[e]]}}},function(e,t,r){var n=r(66),o=r(67),i=r(68),a=r(69),s=r(70);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}l.prototype.clear=n,l.prototype.delete=o,l.prototype.get=i,l.prototype.has=a,l.prototype.set=s,e.exports=l},function(e,t,r){var n=r(23);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},function(e,t,r){var n=r(14),o=r(77),i=r(78),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},function(e,t,r){var n=r(4).Symbol;e.exports=n},function(e,t,r){var n=r(6)(Object,"create");e.exports=n},function(e,t,r){var n=r(90);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},function(e,t,r){var n=r(40),o=r(41);e.exports=function(e,t,r,i){var a=!r;r||(r={});for(var s=-1,l=t.length;++s<l;){var c=t[s],u=i?i(r[c],e[c],c,r,e):void 0;void 0===u&&(u=e[c]),a?o(r,c,u):n(r,c,u)}return r}},function(e,t){var r=Array.isArray;e.exports=r},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){var n=r(114),o=r(24),i=r(115),a=r(116),s=r(117),l=r(13),c=r(38),u=c(n),d=c(o),h=c(i),f=c(a),p=c(s),m=l;(n&&"[object DataView]"!=m(new n(new ArrayBuffer(1)))||o&&"[object Map]"!=m(new o)||i&&"[object Promise]"!=m(i.resolve())||a&&"[object Set]"!=m(new a)||s&&"[object WeakMap]"!=m(new s))&&(m=function(e){var t=l(e),r="[object Object]"==t?e.constructor:void 0,n=r?c(r):"";if(n)switch(n){case u:return"[object DataView]";case d:return"[object Map]";case h:return"[object Promise]";case f:return"[object Set]";case p:return"[object WeakMap]"}return t}),e.exports=m},function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(10),o=r(0);class i{constructor(e){this.window=void 0,this._pageBot=null,this.window=e}detach(){this._pageBot&&(this._pageBot=void 0)}get pageBot(){return null==this._pageBot&&(this._pageBot=new n.a,this._pageBot.getCurrentWindow=()=>this.window),this._pageBot}buildWith(e,t,r){return i.builderMap[e].call(this,t,r)}elementEquals(e,t,r){return t==this.findElement(r)}build(e){const t=this.buildAll(e);return t.length>0?t[0][0]:"LOCATOR_DETECTION_FAILED"}buildAll(e,t){const r=[],o=n.a.locationStrategies;for(const n of i.order)try{const i=this.buildWith(n,e,t);i&&("tac"==n||e==this.findElement(i,t)||o[n])&&r.push([i,n])}catch(e){console.error(e)}return r}findElement(e,t){try{return this.pageBot.findElement(e,null,t)}catch(e){return null}}attributeValue(e){const t=[];if(e.match(/.*?(["'])(\1|[^"'])*/g)){for(const r of e.match(/.*?(["'])(\1|[^"'])*/g))r.indexOf("'")>=0?t.push('"'+r+'"'):t.push("'"+r+"'");const r=t.join(",");return t.length>1?"concat("+r+")":r}return e}xpathHtmlElement(e){return"application/xhtml+xml"==this.window.document.contentType?"x:"+e:e}relativeXPathFromParent(e){const t=this.getNodeNumber(e);let r="/"+this.xpathHtmlElement(e.tagName.toLowerCase());return t>0&&(r+="["+t+"]"),r}getNodeNumber(e){const t=e.parentNode.children;let r=0;for(const n of t)if(n.tagName==e.tagName&&(r++,n==e))break;return r}getCSSSubPath(e){let t=["id","name","class","type","alt","title","value"],r=this.getNodeNumber(e),n=e.tagName.toLowerCase();for(let r of t){let t=e.getAttribute(r);if(t){n="id"==r?"#"+t:"class"==r?e.tagName.toLowerCase()+"."+t.replace(/\s+/g,".").replace("..","."):e.tagName.toLowerCase()+"["+r+'="'+t+'"]';break}}let i=o.b.eval_css(n,e.ownerDocument);return r>1&&i.length>1?n+":nth-child("+r+")":n}preciseXPath(e,t){if(this.findElement(e)!=t){const r=t.ownerDocument.evaluate(e,t.ownerDocument,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(let n=0;n<r.snapshotLength;n++){const r="xpath=("+e+")["+(n+1)+"]";if(this.findElement(r)==t)return r}}return e}static add(e,t){this.order.push(e),this.builderMap[e]=t,this._orderChanged()}static _orderChanged(){this._ensureAllPresent(this.order,this._preferredOrder);this._sortByRefOrder(this.order,this._preferredOrder)}static setPreferredOrder(e){this._preferredOrder=e instanceof String?e.split(","):e,this._orderChanged()}static get getPreferredOrder(){return this._preferredOrder}static _sortByRefOrder(e,t){var r=t.length;e.sort((function(e,n){var o=t.indexOf(e),i=t.indexOf(n);return(o>-1?o:r)-(i>-1?i:r)}))}static _ensureAllPresent(e,t){let r=!1;for(const n of e)-1==t.indexOf(n)&&(t.push(n),r=!0);return r}}i.order=void 0,i.builderMap=void 0,i._preferredOrder=void 0,i._preferredOrder=[],i.order=["id","name","xpath:link","xpath:img","xpath:attributes","xpath:idRelative","xpath:href","xpath:position","css","link"],i.builderMap={id:function(e){return e.id?"id="+e.id:null},link:function(e){if("A"==e.tagName){const t=e.textContent;if(!t.match(/^\s*$/))return"link="+o.b.exactMatchPattern(t.replace(/\xA0/g," ").replace(/^\s*(.*?)\s*$/,"$1"))}return null},name:function(e){return e.hasAttribute("name")?"name="+e.getAttribute("name"):null},"xpath:link":function(e){if("A"==e.tagName){const t=e.textContent;if(!t.match(/^\s*$/))return this.preciseXPath(`//${this.xpathHtmlElement("a")}[contains(text(),'${t.trim()}')]`,e)}return null},"xpath:img":function(e){if("IMG"==e.tagName){const t=e;if(""!=t.alt)return this.preciseXPath(`//${this.xpathHtmlElement("img")}[@alt='${this.attributeValue(t.alt)}']`,t);if(""!=t.title)return this.preciseXPath(`//${this.xpathHtmlElement("img")}[@title='${this.attributeValue(t.title)}']`,t);if(""!=t.src)return this.preciseXPath(`//${this.xpathHtmlElement("img")}[contains(@src,'${this.attributeValue(t.src)}')]`,t)}return null},"xpath:attributes":function(e){const t=["id","name","value","type","action","onclick"],r=(t,r,n)=>{let o="//"+this.xpathHtmlElement(t)+"[";for(const[e,t]of r.entries())+e>0&&(o+=" and "),o+="@"+t+"="+this.attributeValue(n[t]);return o+="]",this.preciseXPath(o,e)};if(e.attributes){const n={};for(const t of e.attributes)n[t.name]=t.value;const o=[];for(const i of t)if(null!=n[i]){o.push(i);const t=r(e.tagName.toLowerCase(),o,n);if(e==this.findElement(t))return t}}return null},"xpath:idRelative":function(e){let t="";for(let r=e;null!=r.parentElement;r=r.parentElement){t=this.relativeXPathFromParent(r)+t;const n=r.parentElement;if(n.hasAttribute("id"))return this.preciseXPath(`//${this.xpathHtmlElement(n.tagName.toLowerCase())}[@id='${this.attributeValue(n.getAttribute("id"))}']${t}`,e)}return null},"xpath:href":function(e){if(e.attributes&&e.hasAttribute("href")){const t=e.getAttribute("href");return t.search(/^http?:\/\//)?this.preciseXPath(`//${this.xpathHtmlElement("a")}[@href='${this.attributeValue(t)}']`,e):this.preciseXPath(`//${this.xpathHtmlElement("a")}[contains(@href,'${this.attributeValue(t)}']`,e)}return null},"xpath:position":function(e,t){let r="";for(let n=e;null!=n;n=n.parentElement){let o="";const i=n.tagName.toLowerCase();if(o=null!=n.parentElement?this.relativeXPathFromParent(n):"/"+this.xpathHtmlElement(i),"[object HTMLUnknownElement]"==this.window.document.createElement(i).toString()){const e=o.indexOf("[");o="/*[name()='"+i+"']"+(-1==e?"":o.substring(e))}r=o+r;const a="/"+r;if(e==this.findElement(a,t))return a}return null},css:function(e,t){let r=this.getCSSSubPath(e);for(let n=e;this.findElement("css="+r,t)!=e&&"HTML"!=n.tagName;n=n.parentElement)r=this.getCSSSubPath(n.parentElement)+" > "+r;return"css="+r}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n={open:{isDoSnapshot:!1,type:{record:"window",playback:"content"},isManual:!1,verifyLocator:!1,reference:{name:"open",target:"A URL",value:"X",description:"Open a webpage."}},selectWindow:{isDoSnapshot:!1,type:{record:"window",playback:"extension_select"},isManual:!1,verifyLocator:!1,reference:{name:"selectWindow",target:"Auto-generated",value:"X",description:"Select the target window. This command is intended to be auto-generated while recording."}},selectFrame:{isDoSnapshot:!1,type:{record:"window",playback:"extension_select"},isManual:!1,verifyLocator:!1,reference:{name:"selectFrame",target:"index=0 (Select the first frame of index 0), or relative=parent (Select the parent frame), or relative=top (Select the top frame)",value:"X",description:"Select the target frame. This command is intended to be auto-generated while recording."}},clearCookie:{isDoSnapshot:!1,type:{record:"others",playback:"content"},isManual:!0,verifyLocator:!1,reference:{name:"clearCookie",target:'an URL with "http://" or "https://" prefix included',value:"a cookie name or X",description:"Remove a cookie from the target URL, if value field is empty, all cookies in target URL will be removed."}},close:{isDoSnapshot:!1,type:{record:"window",playback:"extension"},isManual:!1,verifyLocator:!1,reference:{name:"close",target:"Auto-generated",value:"X",description:"Close the target window. This command is intended to be auto-generated while recording."}},clickAt:{isDoSnapshot:!0,type:{record:"mouse",playback:"content"},isManual:!1,verifyLocator:!0,reference:{name:"clickAt",target:"A locator",value:"x,y position of the mouse event relative to the target element. For example: 10,10. Left blank means a simple click.",description:""}},doubleClickAt:{isDoSnapshot:!0,type:{record:"mouse",playback:"content"},isManual:!1,verifyLocator:!0,reference:{name:"doubleClickAt",target:"A locator",value:"x,y position of the mouse event relative to the target element. For example: 10,10. Left blank means a simple double click.",description:""}},mouseDownAt:{isDoSnapshot:!0,type:{record:"mouse",playback:"content"},isManual:!1,verifyLocator:!0,reference:{name:"mouseDownAt",target:"A locator",value:"x,y position of the mouse event relative to the target element. For example: 10,10",description:""}},mouseMoveAt:{isDoSnapshot:!0,type:{record:"mouse",playback:"content"},isManual:!1,verifyLocator:!0,reference:{name:"mouseMoveAt",target:"A locator",value:"A JSON String containing a series of movements.",description:'An example of value: {"Movements":[{"TD":8,"OX":-2,"OY":0},{"TD":16,"OX":-4,"OY":1},{"TD":16,"OX":-5,"OY":1}]}. TD means the time delay to the previous movement. OX and OY mean the offset x and y to the previous movement. Supposely, a sequence of recorded mouseMoveAt commands is preceded by a mouseDownAt command, and the first movement\'s OX and OY of each command is relative to the last movement of the previous command. If a sequence of mouseMoveAt commands is not preceded by a mouseDownAt command, the OX and OY of the first movement of each command is relative to position (0,0) of the page.'}},mouseOut:{isDoSnapshot:!0,type:{record:"mouse",playback:"content"},isManual:!1,verifyLocator:!0,reference:{name:"mouseOut",target:"A locator",value:"X",description:""}},mouseOver:{isDoSnapshot:!0,type:{record:"mouse",playback:"content"},isManual:!1,verifyLocator:!0,reference:{name:"mouseOver",target:"A locator",value:"X",description:""}},setCSS:{isDoSnapshot:!0,type:{record:"mouse",playback:"content"},isManual:!1,verifyLocator:!0,reference:{name:"setCSS",target:"A locator",value:"A CSS style string. ",description:"An example of value: background-color: rgb(237, 238, 238); text-decoration: none solid rgb(102, 0, 51);"}},mouseUpAt:{isDoSnapshot:!0,type:{record:"mouse",playback:"content"},isManual:!1,verifyLocator:!0,reference:{name:"mouseUpAt",target:"A locator",value:"x,y position of the mouse event relative to the target element. For example: 10,10",description:""}},dragAndDrop:{isDoSnapshot:!0,type:{record:"mouse",playback:"content"},isManual:!1,verifyLocator:!0,reference:{name:"dragAndDrop",target:"The locator of the element to be dragged",value:"A JSON String containing start position, and a series of movements.",description:'An example of value: {"StartPoint":{"X":92,"Y":31},"Movements":[{"TD":8,"OX":-2,"OY":0},{"TD":16,"OX":-4,"OY":1},{"TD":16,"OX":-5,"OY":1}]}. TD means the time delay to the previous movement. OX and OY mean the offset x and y to the previous movement.'}},dragAndDropToObject:{isDoSnapshot:!0,type:{record:"mouse",playback:"content"},isManual:!1,verifyLocator:!0,reference:{name:"dragAndDropToObject",target:"The locator of the element to be dragged",value:"The locator of the element on which the target element is dropped",description:""}},sendKeys:{isDoSnapshot:!0,type:{record:"keyboard",playback:"content"},isManual:!1,verifyLocator:!0,reference:{name:"sendKeys",target:"A locator",value:"A string or a special keystroke, e.g., ${KEY_DOWN}",description:" The target input element should be one of the following types: text, password, email, url, search, tel, number. A special keystroke can be one of the followings: ${KEY_BACKSPACE}, ${KEY_TAB}, ${KEY_ENTER}, ${KEY_ENTER_NOPRESS}, ${KEY_SHIFTLEFT}, ${KEY_SHIFTRIGHT}, ${KEY_CONTROLLEFT}, ${KEY_CONTROLRIGHT}, ${KEY_ALTLEFT}, ${KEY_ALTRIGHT}, ${KEY_CAPSLOCK}, ${KEY_ESC}, ${KEY_PAGEUP}, ${KEY_PAGEDOWN}, ${KEY_END}, ${KEY_HOME}, ${KEY_LEFT}, ${KEY_UP}, ${KEY_RIGHT}, ${KEY_DOWN}, ${KEY_INSERT}, ${KEY_DELETE}, ${KEY_NUMLOCK}, ${KEY_NUMENTER}, ${KEY_F1}, ${KEY_F2}, ${KEY_F3}, ${KEY_F4}, ${KEY_F5}, ${KEY_F6}, ${KEY_F7}, ${KEY_F8}, ${KEY_F9}, ${KEY_F10}, ${KEY_F11}, ${KEY_F12}."}},submit:{isDoSnapshot:!0,type:{record:"others",playback:"content"},isManual:!1,verifyLocator:!0,reference:{name:"submit",target:"The locator of the form to be submitted",value:"X",description:""}},onsubmit:{isDoSnapshot:!0,type:{record:"others",playback:"content"},isManual:!1,verifyLocator:!0,reference:{name:"onsubmit",target:"The locator of the form",value:"X",description:""}},type:{isDoSnapshot:!0,type:{record:"keyboard",playback:"content"},isManual:!1,verifyLocator:!0,reference:{name:"type",target:"A locator",value:"The string to be set to the target element",description:"The target input element should be one of the following types: color, date, datetime-local, month, range, time, week."}},editContent:{isDoSnapshot:!0,type:{record:"keyboard",playback:"content"},isManual:!1,verifyLocator:!0,reference:{name:"editContent",target:"A locator",value:'The string to be set to the content of the target element with attribute contenteditable="true"',description:""}},changeSelection:{isDoSnapshot:!0,type:{record:"keyboard",playback:"content"},isManual:!1,verifyLocator:!0,reference:{name:"changeSelection",target:"A locator",value:"A JSON String containing node order, and text offset.",description:'An example of value: {"N":0,"O":5}. N means the order of node to select. O means the