vare,t=Object.prototype.hasOwnProperty,n=function(e){returnnull==e},r=Array.isArray,o=function(e){vart=Object.create(null);returnfunction(n){returnt[n]||(t[n]=e(n))}},a=/-(\w)/g,i=o((function(e){returne.replace(a,(function(e,t){returnt?t.toUpperCase():""}))})),u=o((function(e){returne.charAt(0).toUpperCase()+e.slice(1)})),c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;functions(e,n){if(r(e))returne;if(n&&(o=n,a=e,t.call(o,a)))return[e];varo,a,i=[];returne.replace(c,(function(e,t,n,r){returni.push(n?r.replace(/\\(\\)?/g,"$1"):t||e),r})),i}functionf(e){returne.__wxWebviewId__?e.__wxWebviewId__:e.privateProperties?e.privateProperties.slaveId:e.$page?e.$page.id:void0}functionp(e){returne.route||e.uri}functiond(e){returne.options||e.$page&&e.$page.options||{}}functionl(e){return{id:f(e),path:p(e),query:d(e)}}functiong(e){vart=function(e){returngetCurrentPages().find((function(t){returnf(t)===e}))}(e);returnt&&t.$vm}functionm(e,t){varn=g(e);returnn&&functione(t,n){varr;returnt&&(!function(e,t){returne.$scope&&((n=e.$scope).__wxExparserNodeId__||n.nodeId||n.id)===t;varn}(t,n)?t.$children.find((function(t){returnr=e(t,n)})):r=t),r}(n,t)}functionv(e,t){varr;returne&&(r=t?function(e,t){varr,o=s(t,e);for(r=o.shift();!n(r);){if(null==(e=e[r]))return;r=o.shift()}returne}(e.$data,t):Object.assign({},e.$data)),Promise.resolve({data:r})}functionh(e,t){returne&&Object.keys(t).forEach((function(n){e[n]=t[n]})),Promise.resolve()}functionT(t,n,r){returnnewPromise((function(o,a){if(!t)returna(e.VM_NOT_EXISTS);if(!t[n])returna(e.VM_NOT_EXISTS);vari,u=t[n].apply(t,r);!(i=u)||"object"!=typeofi&&"function"!=typeofi||"function"!=typeofi.then?o({result:u}):u.then((function(e){o({result:e})}))}))}!function(e){e.VM_NOT_EXISTS="VM_NOT_EXISTS",e.METHOD_NOT_EXISTS="METHOD_NOT_EXISTS"}(e||(e={}));var_=["stopRecord","getRecorderManager","pauseVoice","stopVoice","pauseBackgroundAudio","stopBackgroundAudio","getBackgroundAudioManager","createAudioContext","createInnerAudioContext","createVideoContext","createCameraContext","createMapContext","canIUse","startAccelerometer","stopAccelerometer","startCompass","stopCompass","hideToast","hideLoading","showNavigationBarLoading","hideNavigationBarLoading","navigateBack","createAnimation","pageScrollTo","createSelectorQuery","createCanvasContext","createContext","drawCanvas","hideKeyboard","stopPullDownRefresh","arrayBufferToBase64","base64ToArrayBuffer"],y={},O=/Sync$/,S=/^on|^off/;functionE(e){returnO.test(e)||-1!==_.indexOf(e)}varI={getPageStack:function(){returnPromise.resolve({pageStack:getCurrentPages().map((function(e){returnl(e)}))})},getCurrentPage:function(){vare=getCurrentPages(),t=e.length;returnnewPromise((function(n,r){t?n(l(e[t-1])):r(Error("getCurrentPages().length=0"))}))},callUniMethod:function(e){vart=e.method,n=e.args;returnnewPromise((function(e,r){if(!uni[t])returnr(Error("uni."+t+" not exists"));if(E(t))returne({result:uni[t].apply(uni,n)});varo=[Object.assign({},n[0]||{},{success:function(n){setTimeout((function(){e({result:n})}),"pageScrollTo"===t?350:0)},fail:function(e){r(Error(e.errMsg.replace(t+":fail ","")))}})];uni[t].apply(uni,o)}))},mockUniMethod:function(e){vart=e.method;if(!uni[t])throwError("uni."+t+" not exists");if(!function(e){return!S.test(e)}(t))throwError("You can't mock uni."+t);varr=e.result;if(n(r))returny[t]&&(uni[t]=y[t],deletey[t]),Promise.resolve();varo=E(t)?function(){returnr}:function(e){setTimeout((function(){r.errMsg&&-1!==r.errMsg.indexOf(":fail")?e.fail&&e.fail(r):e.success&&e.success(r),e.complete&&e.complete(r)}),4)};returny[t]||(y[t]=uni[t]),uni[t]=o,Promise.resolve()}},C={getData:function(e){returnv(g(e.pageId),e.path)},setData:function(e){returnh(g(e.pageId),e.data)},callMethod:function(t){varn,r=((n={})[e.VM_NOT_EXISTS]="Page["+t.pageId+"] not exists",n[e.METHOD_NOT_EXISTS]="page."+t.method+" not exists",n);returnnewPromise((function(e,n){T(g(t.pageId),t.method,t.args).then((function(t){returne(t)})).catch((function(e){n(Error(r[e]))}))}))}};functionw(e){returne.nodeId||e.elementId}for(varM={getData:function(e){returnv(m(e.pageId,w(e)),e.path)},setData:function(e){returnh(m(e.pageId,w(e)),e.data)},callMethod:function(t){varn,r=w(t),o=((n={})[e.VM_NOT_EXISTS]="Component["+t.pageId+":"+r+"] not exists",n[e.METHOD_NOT_EXISTS]="component."+t.method+" not exists",n);returnnewPromise((function(e,n){T(m(t.pageId,r),t.method,t.args).then((function(t){returne(t)})).catch((function(e){n(Error(o[e]))}))}))}},P=("undefined"!=typeofcrypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeofmsCrypto&&"function"==typeofmsCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),[]),b=0;b<256;++b)P[b]=(b+256).toString(16).substr(1);["movable-view","picker","ad","button","checkbox-group","checkbox","form","icon","label","movable-area","navigator","picker-view-column","picker-view","progress","radio-group","radio","rich-text","u-slider","swiper-item","swiper","switch"].map((function(e){returnu(i(e))}));varx={};Object.keys(I).forEach((function(e){x["App."+e]=I[e]})),Object.keys(C).forEach((function(e){x["Page."+e]=C[e]})),Object.keys(M).forEach((function(e){x["Element."+e]=M[e]}));var$,k=process.env.UNI_AUTOMATOR_WS_ENDPOINT;functionA(e){$.send({data:JSON.stringify(e)})}functionN(e){vart=JSON.parse(e.data),n=t.id,r=t.method,o=t.params,a={id:n},i=x[r];if(!i&&!i)returna.error={message:r+" unimplemented"},A(a);try{i(o).then((function(e){e&&(a.result=e)})).catch((function(e){a.error={message:e.message}})).finally((function(){A(a)}))}catch(e){a.error={message:e.message},A(a)}}swan.$$initRuntimeAutomator=function(e){void0===e&&(e={}),($=uni.connectSocket({url:k,complete:function(){}})).onMessage(N),$.onOpen((function(t){e.success&&e.success(),console.log("已开启自动化测试...")})),$.onError((function(e){console.log("automator.onError",e)})),$.onClose((function(){e.fail&&e.fail({errMsg:"$$initRuntimeAutomator:fail"}),console.log("automator.onClose")}))},setTimeout((function(){swan.$$initRuntimeAutomator()}),500);
vare,t=Object.prototype.hasOwnProperty,n=function(e){returnnull==e},r=Array.isArray,o=function(e){vart=Object.create(null);returnfunction(n){returnt[n]||(t[n]=e(n))}},i=/-(\w)/g,a=o((function(e){returne.replace(i,(function(e,t){returnt?t.toUpperCase():""}))})),u=o((function(e){returne.charAt(0).toUpperCase()+e.slice(1)})),c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;functions(e,n){if(r(e))returne;if(n&&(o=n,i=e,t.call(o,i)))return[e];varo,i,a=[];returne.replace(c,(function(e,t,n,r){returna.push(n?r.replace(/\\(\\)?/g,"$1"):t||e),r})),a}functionf(e){returne.__wxWebviewId__?e.__wxWebviewId__:e.privateProperties?e.privateProperties.slaveId:e.$page?e.$page.id:void0}functionp(e){returne.route||e.uri}functiond(e){returne.options||e.$page&&e.$page.options||{}}functionl(e){return{id:f(e),path:p(e),query:d(e)}}functiong(e){vart=function(e){returngetCurrentPages().find((function(t){returnf(t)===e}))}(e);returnt&&t.$vm}functionm(e,t){varn=g(e);returnn&&functione(t,n){varr;returnt&&(!function(e,t){returne.$scope&&((n=e.$scope).__wxExparserNodeId__||n.nodeId||n.id)===t;varn}(t,n)?t.$children.find((function(t){returnr=e(t,n)})):r=t),r}(n,t)}functionv(e,t){varr;returne&&(r=t?function(e,t){varr,o=s(t,e);for(r=o.shift();!n(r);){if(null==(e=e[r]))return;r=o.shift()}returne}(e.$data,t):Object.assign({},e.$data)),Promise.resolve({data:r})}functionh(e,t){returne&&Object.keys(t).forEach((function(n){e[n]=t[n]})),Promise.resolve()}functiony(t,n,r){returnnewPromise((function(o,i){if(!t)returni(e.VM_NOT_EXISTS);if(!t[n])returni(e.VM_NOT_EXISTS);vara,u=t[n].apply(t,r);!(a=u)||"object"!=typeofa&&"function"!=typeofa||"function"!=typeofa.then?o({result:u}):u.then((function(e){o({result:e})}))}))}!function(e){e.VM_NOT_EXISTS="VM_NOT_EXISTS",e.METHOD_NOT_EXISTS="METHOD_NOT_EXISTS"}(e||(e={}));varT=["stopRecord","getRecorderManager","pauseVoice","stopVoice","pauseBackgroundAudio","stopBackgroundAudio","getBackgroundAudioManager","createAudioContext","createInnerAudioContext","createVideoContext","createCameraContext","createMapContext","canIUse","startAccelerometer","stopAccelerometer","startCompass","stopCompass","hideToast","hideLoading","showNavigationBarLoading","hideNavigationBarLoading","navigateBack","createAnimation","pageScrollTo","createSelectorQuery","createCanvasContext","createContext","drawCanvas","hideKeyboard","stopPullDownRefresh","arrayBufferToBase64","base64ToArrayBuffer"],_={},O=/Sync$/,S=/^on|^off/;functionE(e){returnO.test(e)||-1!==T.indexOf(e)}varI={getPageStack:function(){returnPromise.resolve({pageStack:getCurrentPages().map((function(e){returnl(e)}))})},getCurrentPage:function(){vare=getCurrentPages(),t=e.length;returnnewPromise((function(n,r){t?n(l(e[t-1])):r(Error("getCurrentPages().length=0"))}))},callUniMethod:function(e){vart=e.method,n=e.args;returnnewPromise((function(e,r){if(!uni[t])returnr(Error("uni."+t+" not exists"));if(E(t))returne({result:uni[t].apply(uni,n)});varo=[Object.assign({},n[0]||{},{success:function(n){setTimeout((function(){e({result:n})}),"pageScrollTo"===t?350:0)},fail:function(e){r(Error(e.errMsg.replace(t+":fail ","")))}})];uni[t].apply(uni,o)}))},mockUniMethod:function(e){vart=e.method;if(!uni[t])throwError("uni."+t+" not exists");if(!function(e){return!S.test(e)}(t))throwError("You can't mock uni."+t);varr,o=e.result,i=e.functionDeclaration;returnn(o)&&n(i)?(_[t]&&(uni[t]=_[t],delete_[t]),Promise.resolve()):((r=n(i)?E(t)?function(){returno}:function(e){setTimeout((function(){o.errMsg&&-1!==o.errMsg.indexOf(":fail")?e.fail&&e.fail(o):e.success&&e.success(o),e.complete&&e.complete(o)}),4)}:function(){for(vart=[],n=0;n<arguments.length;n++)t[n]=arguments[n];returnnewFunction("return "+i)().apply(r,t.concat(e.args))}).origin=_[t]||uni[t],_[t]||(_[t]=uni[t]),uni[t]=r,Promise.resolve())}},w={getData:function(e){returnv(g(e.pageId),e.path)},setData:function(e){returnh(g(e.pageId),e.data)},callMethod:function(t){varn,r=((n={})[e.VM_NOT_EXISTS]="Page["+t.pageId+"] not exists",n[e.METHOD_NOT_EXISTS]="page."+t.method+" not exists",n);returnnewPromise((function(e,n){y(g(t.pageId),t.method,t.args).then((function(t){returne(t)})).catch((function(e){n(Error(r[e]))}))}))}};functionC(e){returne.nodeId||e.elementId}for(varM={getData:function(e){returnv(m(e.pageId,C(e)),e.path)},setData:function(e){returnh(m(e.pageId,C(e)),e.data)},callMethod:function(t){varn,r=C(t),o=((n={})[e.VM_NOT_EXISTS]="Component["+t.pageId+":"+r+"] not exists",n[e.METHOD_NOT_EXISTS]="component."+t.method+" not exists",n);returnnewPromise((function(e,n){y(m(t.pageId,r),t.method,t.args).then((function(t){returne(t)})).catch((function(e){n(Error(o[e]))}))}))}},P=("undefined"!=typeofcrypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeofmsCrypto&&"function"==typeofmsCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),[]),b=0;b<256;++b)P[b]=(b+256).toString(16).substr(1);["movable-view","picker","ad","button","checkbox-group","checkbox","form","icon","label","movable-area","navigator","picker-view-column","picker-view","progress","radio-group","radio","rich-text","u-slider","swiper-item","swiper","switch"].map((function(e){returnu(a(e))}));varx={};Object.keys(I).forEach((function(e){x["App."+e]=I[e]})),Object.keys(w).forEach((function(e){x["Page."+e]=w[e]})),Object.keys(M).forEach((function(e){x["Element."+e]=M[e]}));var$,k=process.env.UNI_AUTOMATOR_WS_ENDPOINT;functionA(e){$.send({data:JSON.stringify(e)})}functionN(e){vart=JSON.parse(e.data),n=t.id,r=t.method,o=t.params,i={id:n},a=x[r];if(!a&&!a)returni.error={message:r+" unimplemented"},A(i);try{a(o).then((function(e){e&&(i.result=e)})).catch((function(e){i.error={message:e.message}})).finally((function(){A(i)}))}catch(e){i.error={message:e.message},A(i)}}swan.$$initRuntimeAutomator=function(e){void0===e&&(e={}),($=uni.connectSocket({url:k,complete:function(){}})).onMessage(N),$.onOpen((function(t){e.success&&e.success(),console.log("已开启自动化测试...")})),$.onError((function(e){console.log("automator.onError",e)})),$.onClose((function(){e.fail&&e.fail({errMsg:"$$initRuntimeAutomator:fail"}),console.log("automator.onClose")}))},setTimeout((function(){swan.$$initRuntimeAutomator()}),500);
vare,t=Object.prototype.hasOwnProperty,n=function(e){returnnull==e},r=Array.isArray,o=function(e){vart=Object.create(null);returnfunction(n){returnt[n]||(t[n]=e(n))}},i=/-(\w)/g,a=o((function(e){returne.replace(i,(function(e,t){returnt?t.toUpperCase():""}))})),u=o((function(e){returne.charAt(0).toUpperCase()+e.slice(1)})),c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;functions(e,n){if(r(e))returne;if(n&&(o=n,i=e,t.call(o,i)))return[e];varo,i,a=[];returne.replace(c,(function(e,t,n,r){returna.push(n?r.replace(/\\(\\)?/g,"$1"):t||e),r})),a}functionf(e){returne.__wxWebviewId__?e.__wxWebviewId__:e.privateProperties?e.privateProperties.slaveId:e.$page?e.$page.id:void0}functionp(e){returne.route||e.uri}functiond(e){returne.options||e.$page&&e.$page.options||{}}functionl(e){return{id:f(e),path:p(e),query:d(e)}}functiong(e){vart=function(e){returngetCurrentPages().find((function(t){returnf(t)===e}))}(e);returnt&&t.$vm}functionm(e,t){varn=g(e);returnn&&functione(t,n){varr;returnt&&(!function(e,t){returne.$scope&&((n=e.$scope).__wxExparserNodeId__||n.nodeId||n.id)===t;varn}(t,n)?t.$children.find((function(t){returnr=e(t,n)})):r=t),r}(n,t)}functionv(e,t){varr;returne&&(r=t?function(e,t){varr,o=s(t,e);for(r=o.shift();!n(r);){if(null==(e=e[r]))return;r=o.shift()}returne}(e.$data,t):Object.assign({},e.$data)),Promise.resolve({data:r})}functionh(e,t){returne&&Object.keys(t).forEach((function(n){e[n]=t[n]})),Promise.resolve()}functionT(t,n,r){returnnewPromise((function(o,i){if(!t)returni(e.VM_NOT_EXISTS);if(!t[n])returni(e.VM_NOT_EXISTS);vara,u=t[n].apply(t,r);!(a=u)||"object"!=typeofa&&"function"!=typeofa||"function"!=typeofa.then?o({result:u}):u.then((function(e){o({result:e})}))}))}!function(e){e.VM_NOT_EXISTS="VM_NOT_EXISTS",e.METHOD_NOT_EXISTS="METHOD_NOT_EXISTS"}(e||(e={}));var_=["stopRecord","getRecorderManager","pauseVoice","stopVoice","pauseBackgroundAudio","stopBackgroundAudio","getBackgroundAudioManager","createAudioContext","createInnerAudioContext","createVideoContext","createCameraContext","createMapContext","canIUse","startAccelerometer","stopAccelerometer","startCompass","stopCompass","hideToast","hideLoading","showNavigationBarLoading","hideNavigationBarLoading","navigateBack","createAnimation","pageScrollTo","createSelectorQuery","createCanvasContext","createContext","drawCanvas","hideKeyboard","stopPullDownRefresh","arrayBufferToBase64","base64ToArrayBuffer"],y={},O=/Sync$/,S=/^on|^off/;functionE(e){returnO.test(e)||-1!==_.indexOf(e)}varI={getPageStack:function(){returnPromise.resolve({pageStack:getCurrentPages().map((function(e){returnl(e)}))})},getCurrentPage:function(){vare=getCurrentPages(),t=e.length;returnnewPromise((function(n,r){t?n(l(e[t-1])):r(Error("getCurrentPages().length=0"))}))},callUniMethod:function(e){vart=e.method,n=e.args;returnnewPromise((function(e,r){if(!uni[t])returnr(Error("uni."+t+" not exists"));if(E(t))returne({result:uni[t].apply(uni,n)});varo=[Object.assign({},n[0]||{},{success:function(n){setTimeout((function(){e({result:n})}),"pageScrollTo"===t?350:0)},fail:function(e){r(Error(e.errMsg.replace(t+":fail ","")))}})];uni[t].apply(uni,o)}))},mockUniMethod:function(e){vart=e.method;if(!uni[t])throwError("uni."+t+" not exists");if(!function(e){return!S.test(e)}(t))throwError("You can't mock uni."+t);varr=e.result;if(n(r))returny[t]&&(uni[t]=y[t],deletey[t]),Promise.resolve();varo=E(t)?function(){returnr}:function(e){setTimeout((function(){r.errMsg&&-1!==r.errMsg.indexOf(":fail")?e.fail&&e.fail(r):e.success&&e.success(r),e.complete&&e.complete(r)}),4)};returny[t]||(y[t]=uni[t]),uni[t]=o,Promise.resolve()}},C={getData:function(e){returnv(g(e.pageId),e.path)},setData:function(e){returnh(g(e.pageId),e.data)},callMethod:function(t){varn,r=((n={})[e.VM_NOT_EXISTS]="Page["+t.pageId+"] not exists",n[e.METHOD_NOT_EXISTS]="page."+t.method+" not exists",n);returnnewPromise((function(e,n){T(g(t.pageId),t.method,t.args).then((function(t){returne(t)})).catch((function(e){n(Error(r[e]))}))}))}};functionw(e){returne.nodeId||e.elementId}for(varx={getData:function(e){returnv(m(e.pageId,w(e)),e.path)},setData:function(e){returnh(m(e.pageId,w(e)),e.data)},callMethod:function(t){varn,r=w(t),o=((n={})[e.VM_NOT_EXISTS]="Component["+t.pageId+":"+r+"] not exists",n[e.METHOD_NOT_EXISTS]="component."+t.method+" not exists",n);returnnewPromise((function(e,n){T(m(t.pageId,r),t.method,t.args).then((function(t){returne(t)})).catch((function(e){n(Error(o[e]))}))}))}},M=("undefined"!=typeofcrypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeofmsCrypto&&"function"==typeofmsCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),[]),P=0;P<256;++P)M[P]=(P+256).toString(16).substr(1);["movable-view","picker","ad","button","checkbox-group","checkbox","form","icon","label","movable-area","navigator","picker-view-column","picker-view","progress","radio-group","radio","rich-text","u-slider","swiper-item","swiper","switch"].map((function(e){returnu(a(e))}));varb={};Object.keys(I).forEach((function(e){b["App."+e]=I[e]})),Object.keys(C).forEach((function(e){b["Page."+e]=C[e]})),Object.keys(x).forEach((function(e){b["Element."+e]=x[e]}));var$,k=process.env.UNI_AUTOMATOR_WS_ENDPOINT;functionA(e){$.send({data:JSON.stringify(e)})}functionN(e){vart=JSON.parse(e.data),n=t.id,r=t.method,o=t.params,i={id:n},a=b[r];if(!a&&!a)returni.error={message:r+" unimplemented"},A(i);try{a(o).then((function(e){e&&(i.result=e)})).catch((function(e){i.error={message:e.message}})).finally((function(){A(i)}))}catch(e){i.error={message:e.message},A(i)}}wx.$$initRuntimeAutomator=function(e){void0===e&&(e={}),($=uni.connectSocket({url:k,complete:function(){}})).onMessage(N),$.onOpen((function(t){e.success&&e.success(),console.log("已开启自动化测试...")})),$.onError((function(e){console.log("automator.onError",e)})),$.onClose((function(){e.fail&&e.fail({errMsg:"$$initRuntimeAutomator:fail"}),console.log("automator.onClose")}))},setTimeout((function(){wx.$$initRuntimeAutomator()}),500);
vare,t=Object.prototype.hasOwnProperty,n=function(e){returnnull==e},r=Array.isArray,o=function(e){vart=Object.create(null);returnfunction(n){returnt[n]||(t[n]=e(n))}},i=/-(\w)/g,a=o((function(e){returne.replace(i,(function(e,t){returnt?t.toUpperCase():""}))})),u=o((function(e){returne.charAt(0).toUpperCase()+e.slice(1)})),c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;functions(e,n){if(r(e))returne;if(n&&(o=n,i=e,t.call(o,i)))return[e];varo,i,a=[];returne.replace(c,(function(e,t,n,r){returna.push(n?r.replace(/\\(\\)?/g,"$1"):t||e),r})),a}functionf(e){returne.__wxWebviewId__?e.__wxWebviewId__:e.privateProperties?e.privateProperties.slaveId:e.$page?e.$page.id:void0}functionp(e){returne.route||e.uri}functiond(e){returne.options||e.$page&&e.$page.options||{}}functionl(e){return{id:f(e),path:p(e),query:d(e)}}functiong(e){vart=function(e){returngetCurrentPages().find((function(t){returnf(t)===e}))}(e);returnt&&t.$vm}functionm(e,t){varn=g(e);returnn&&functione(t,n){varr;returnt&&(!function(e,t){returne.$scope&&((n=e.$scope).__wxExparserNodeId__||n.nodeId||n.id)===t;varn}(t,n)?t.$children.find((function(t){returnr=e(t,n)})):r=t),r}(n,t)}functionv(e,t){varr;returne&&(r=t?function(e,t){varr,o=s(t,e);for(r=o.shift();!n(r);){if(null==(e=e[r]))return;r=o.shift()}returne}(e.$data,t):Object.assign({},e.$data)),Promise.resolve({data:r})}functionh(e,t){returne&&Object.keys(t).forEach((function(n){e[n]=t[n]})),Promise.resolve()}functiony(t,n,r){returnnewPromise((function(o,i){if(!t)returni(e.VM_NOT_EXISTS);if(!t[n])returni(e.VM_NOT_EXISTS);vara,u=t[n].apply(t,r);!(a=u)||"object"!=typeofa&&"function"!=typeofa||"function"!=typeofa.then?o({result:u}):u.then((function(e){o({result:e})}))}))}!function(e){e.VM_NOT_EXISTS="VM_NOT_EXISTS",e.METHOD_NOT_EXISTS="METHOD_NOT_EXISTS"}(e||(e={}));varT=["stopRecord","getRecorderManager","pauseVoice","stopVoice","pauseBackgroundAudio","stopBackgroundAudio","getBackgroundAudioManager","createAudioContext","createInnerAudioContext","createVideoContext","createCameraContext","createMapContext","canIUse","startAccelerometer","stopAccelerometer","startCompass","stopCompass","hideToast","hideLoading","showNavigationBarLoading","hideNavigationBarLoading","navigateBack","createAnimation","pageScrollTo","createSelectorQuery","createCanvasContext","createContext","drawCanvas","hideKeyboard","stopPullDownRefresh","arrayBufferToBase64","base64ToArrayBuffer"],_={},O=/Sync$/,S=/^on|^off/;functionE(e){returnO.test(e)||-1!==T.indexOf(e)}varI={getPageStack:function(){returnPromise.resolve({pageStack:getCurrentPages().map((function(e){returnl(e)}))})},getCurrentPage:function(){vare=getCurrentPages(),t=e.length;returnnewPromise((function(n,r){t?n(l(e[t-1])):r(Error("getCurrentPages().length=0"))}))},callUniMethod:function(e){vart=e.method,n=e.args;returnnewPromise((function(e,r){if(!uni[t])returnr(Error("uni."+t+" not exists"));if(E(t))returne({result:uni[t].apply(uni,n)});varo=[Object.assign({},n[0]||{},{success:function(n){setTimeout((function(){e({result:n})}),"pageScrollTo"===t?350:0)},fail:function(e){r(Error(e.errMsg.replace(t+":fail ","")))}})];uni[t].apply(uni,o)}))},mockUniMethod:function(e){vart=e.method;if(!uni[t])throwError("uni."+t+" not exists");if(!function(e){return!S.test(e)}(t))throwError("You can't mock uni."+t);varr,o=e.result,i=e.functionDeclaration;returnn(o)&&n(i)?(_[t]&&(uni[t]=_[t],delete_[t]),Promise.resolve()):((r=n(i)?E(t)?function(){returno}:function(e){setTimeout((function(){o.errMsg&&-1!==o.errMsg.indexOf(":fail")?e.fail&&e.fail(o):e.success&&e.success(o),e.complete&&e.complete(o)}),4)}:function(){for(vart=[],n=0;n<arguments.length;n++)t[n]=arguments[n];returnnewFunction("return "+i)().apply(r,t.concat(e.args))}).origin=_[t]||uni[t],_[t]||(_[t]=uni[t]),uni[t]=r,Promise.resolve())}},w={getData:function(e){returnv(g(e.pageId),e.path)},setData:function(e){returnh(g(e.pageId),e.data)},callMethod:function(t){varn,r=((n={})[e.VM_NOT_EXISTS]="Page["+t.pageId+"] not exists",n[e.METHOD_NOT_EXISTS]="page."+t.method+" not exists",n);returnnewPromise((function(e,n){y(g(t.pageId),t.method,t.args).then((function(t){returne(t)})).catch((function(e){n(Error(r[e]))}))}))}};functionC(e){returne.nodeId||e.elementId}for(varx={getData:function(e){returnv(m(e.pageId,C(e)),e.path)},setData:function(e){returnh(m(e.pageId,C(e)),e.data)},callMethod:function(t){varn,r=C(t),o=((n={})[e.VM_NOT_EXISTS]="Component["+t.pageId+":"+r+"] not exists",n[e.METHOD_NOT_EXISTS]="component."+t.method+" not exists",n);returnnewPromise((function(e,n){y(m(t.pageId,r),t.method,t.args).then((function(t){returne(t)})).catch((function(e){n(Error(o[e]))}))}))}},M=("undefined"!=typeofcrypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeofmsCrypto&&"function"==typeofmsCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),[]),P=0;P<256;++P)M[P]=(P+256).toString(16).substr(1);["movable-view","picker","ad","button","checkbox-group","checkbox","form","icon","label","movable-area","navigator","picker-view-column","picker-view","progress","radio-group","radio","rich-text","u-slider","swiper-item","swiper","switch"].map((function(e){returnu(a(e))}));varb={};Object.keys(I).forEach((function(e){b["App."+e]=I[e]})),Object.keys(w).forEach((function(e){b["Page."+e]=w[e]})),Object.keys(x).forEach((function(e){b["Element."+e]=x[e]}));var$,k=process.env.UNI_AUTOMATOR_WS_ENDPOINT;functionA(e){$.send({data:JSON.stringify(e)})}functionN(e){vart=JSON.parse(e.data),n=t.id,r=t.method,o=t.params,i={id:n},a=b[r];if(!a&&!a)returni.error={message:r+" unimplemented"},A(i);try{a(o).then((function(e){e&&(i.result=e)})).catch((function(e){i.error={message:e.message}})).finally((function(){A(i)}))}catch(e){i.error={message:e.message},A(i)}}wx.$$initRuntimeAutomator=function(e){void0===e&&(e={}),($=uni.connectSocket({url:k,complete:function(){}})).onMessage(N),$.onOpen((function(t){e.success&&e.success(),console.log("已开启自动化测试...")})),$.onError((function(e){console.log("automator.onError",e)})),$.onClose((function(){e.fail&&e.fail({errMsg:"$$initRuntimeAutomator:fail"}),console.log("automator.onClose")}))},setTimeout((function(){wx.$$initRuntimeAutomator()}),500);