function__spreadArrays(){for(vars=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;varr=Array(s),k=0;for(i=0;i<il;i++)for(vara=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];returnr}vargetRandomValues="undefined"!=typeofcrypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeofmsCrypto&&"function"==typeofmsCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),rnds8=newUint8Array(16);functionrng(){if(!getRandomValues)thrownewError("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");returngetRandomValues(rnds8)}for(varbyteToHex=[],i=0;i<256;++i)byteToHex[i]=(i+256).toString(16).substr(1);functionv4(options,buf,offset){vari=buf&&offset||0;"string"==typeofoptions&&(buf="binary"===options?newArray(16):null,options=null);varrnds=(options=options||{}).random||(options.rng||rng)();if(rnds[6]=15&rnds[6]|64,rnds[8]=63&rnds[8]|128,buf)for(varii=0;ii<16;++ii)buf[i+ii]=rnds[ii];returnbuf||function(buf,offset){vari=offset||0,bth=byteToHex;return[bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]]].join("")}(rnds)}varhasOwnProperty=Object.prototype.hasOwnProperty,isArray=Array.isArray,PATH_RE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;functiongetPaths(path,data){if(isArray(path))returnpath;if(data&&(val=data,key=path,hasOwnProperty.call(val,key)))return[path];varval,key,res=[];returnpath.replace(PATH_RE,(function(match,p1,offset,string){returnres.push(offset?string.replace(/\\(\\)?/g,"$1"):p1||match),string})),res}functiongetDataByPath(data,path){vardataPath,paths=getPaths(path,data);for(dataPath=paths.shift();null!=dataPath;){if(null==(data=data[dataPath]))return;dataPath=paths.shift()}returndata}functiongetVmNodeId(vm){if(vm._$weex)returnvm._uid;if(vm._$id)returnvm._$id;varparent_1=function(vm){for(varparent=vm.$parent;parent;){if(parent._$id)returnparent;parent=parent.$parent}}(vm);if(!vm.$parent)return"-1";varvnode=vm.$vnode,context=vnode.context;returncontext&&context!==parent_1&&context._$id?context._$id+";"+parent_1._$id+","+vnode.data.attrs._i:parent_1._$id+","+vnode.data.attrs._i}varelementMap=newMap;functiontransEl(el){var_a;if(!function(el){if(el){vartagName=el.tagName;return0===tagName.indexOf("UNI-")||"BODY"===tagName||0===tagName.indexOf("V-UNI-")}return!1}(el))throwError("no such element");varelement,elementId,vm,elem={elementId:(element=el,elementId=element._id,elementId||(elementId=v4(),element._id=elementId,elementMap.set(elementId,{id:elementId,element:element})),elementId),tagName:el.tagName.toLocaleLowerCase().replace("uni-","")};el.__vue__?(vm=el.__vue__)&&(vm.$parent&&vm.$parent.$el===el&&(vm=vm.$parent),vm&&!(null===(_a=vm.$options)||void0===_a?void0:_a.isReserved)&&(elem.nodeId=getVmNodeId(vm))):(vm=el.__vnode)&&(vm.el===el&&(vm=vm.ctx.parent),vm&&(elem.nodeId=getVmNodeId(vm)));return"video"===elem.tagName&&(elem.videoId=elem.nodeId),elem}varFUNCTIONS={input:{input:function(el,value){varvm=el.__vue__;vm.valueSync=value,vm.$triggerInput({},{value:value})}},textarea:{input:function(el,value){varvm=el.__vue__;vm.valueSync=value,vm.$triggerInput({},{value:value})}},"scroll-view":{scrollTo:function(el,x,y){varmain=el.__vue__.$refs.main;main.scrollLeft=x,main.scrollTop=y},scrollTop:function(el){returnel.__vue__.$refs.main.scrollTop},scrollLeft:function(el){returnel.__vue__.$refs.main.scrollLeft},scrollWidth:function(el){returnel.__vue__.$refs.main.scrollWidth},scrollHeight:function(el){returnel.__vue__.$refs.main.scrollHeight}},swiper:{swipeTo:function(el,index){el.__vue__.current=index}},"movable-view":{moveTo:function(el,x,y){el.__vue__._animationTo(x,y)}},switch:{tap:function(el){el.click()}},slider:{slideTo:function(el,value){varvm=el.__vue__,slider=vm.$refs["uni-slider"],offsetWidth=slider.offsetWidth,boxLeft=slider.getBoundingClientRect().left;vm.value=value,vm._onClick({x:(value-vm.min)*offsetWidth/(vm.max-vm.min)+boxLeft})}}};functioncreateTouchList(touchInits){var_a,touches=touchInits.map((function(touch){returnfunction(touch){if(document.createTouch)returndocument.createTouch(window,touch.target,touch.identifier,touch.pageX,touch.pageY,touch.screenX,touch.screenY);returnnewTouch(touch)}(touch)}));returndocument.createTouchList?(_a=document).createTouchList.apply(_a,touches):touches}varWebAdapter={getWindow:function(pageId){returnwindow},getDocument:function(pageId){returndocument},getEl:function(elementId){varelement=elementMap.get(elementId);if(!element)throwError("element destroyed");returnelement.element},getOffset:function(node){varrect=node.getBoundingClientRect();returnPromise.resolve({left:rect.left+window.pageXOffset,top:rect.top+window.pageYOffset})},querySelector:function(context,selector){return"page"===selector&&(selector="body"),Promise.resolve(transEl(context.querySelector(selector)))},querySelectorAll:function(context,selector){varelements=[],nodeList=document.querySelectorAll(selector);return[].forEach.call(nodeList,(function(node){try{elements.push(transEl(node))}catch(e){}})),Promise.resolve({elements:elements})},queryProperties:function(context,names){returnPromise.resolve({properties:names.map((function(name){varvalue=getDataByPath(context,name.replace(/-([a-z])/g,(function(g){returng[1].toUpperCase()})));return"document.documentElement.scrollTop"===name&&0===value&&(value=getDataByPath(context,"document.body.scrollTop")),"innerText"===name?value.replace(/\n/g,""):value}))})},queryAttributes:function(context,names){returnPromise.resolve({attributes:names.map((function(name){returnString(context.getAttribute(name))}))})},queryStyles:function(context,names){varstyle=getComputedStyle(context);returnPromise.resolve({styles:names.map((function(name){returnstyle[name]}))})},queryHTML:function(context,type){returnPromise.resolve({html:(html="outer"===type?context.outerHTML:context.innerHTML,html.replace(/\n/g,"").replace(/(<uni-text[^>]*>)(<span[^>]*>[^<]*<\/span>)(.*?<\/uni-text>)/g,"$1$3").replace(/<\/?[^>]*>/g,(function(replacement){return-1<replacement.indexOf("<body")?"<page>":"</body>"===replacement?"</page>":0!==replacement.indexOf("<uni-")&&0!==replacement.indexOf("</uni-")?"":replacement.replace(/uni-/g,"").replace(/ role=""/g,"").replace(/ aria-label=""/g,"")})))});varhtml},dispatchTapEvent:function(el){returnel.click(),Promise.resolve()},dispatchLongpressEvent:function(el){returnPromise.resolve()},dispatchTouchEvent:function(el,type,eventInitDict){eventInitDict||(eventInitDict={}),eventInitDict.touches||(eventInitDict.touches=[]),eventInitDict.changedTouches||(eventInitDict.changedTouches=[]),eventInitDict.touches.length||eventInitDict.touches.push({identifier:Date.now(),target:el});vartouches=createTouchList(eventInitDict.touches),changedTouches=createTouchList(eventInitDict.changedTouches),targetTouches=createTouchList([]);returnel.dispatchEvent(newTouchEvent(type,{cancelable:!0,bubbles:!0,touches:touches,targetTouches:targetTouches,changedTouches:changedTouches})),Promise.resolve()},callFunction:function(el,functionName,args){varfn=getDataByPath(FUNCTIONS,functionName);returnfn?Promise.resolve({result:fn.apply(null,__spreadArrays([el],args))}):Promise.reject(Error(functionName+" not exists"))},triggerEvent:function(el,type,detail){varvm=el.__vue__;returnvm.$trigger&&vm.$trigger(type,{},detail),Promise.resolve()}};varApi=Object.assign({},function(adapter){return{"Page.getElement":function(params){returnadapter.querySelector(adapter.getDocument(params.pageId),params.selector)},"Page.getElements":function(params){returnadapter.querySelectorAll(adapter.getDocument(params.pageId),params.selector)},"Page.getWindowProperties":function(params){returnadapter.queryProperties(adapter.getWindow(params.pageId),params.names)}}}(WebAdapter),function(adapter){vargetEl=function(params){returnadapter.getEl(params.elementId,params.pageId)};return{"Element.getElement":function(params){returnadapter.querySelector(getEl(params),params.selector)},"Element.getElements":function(params){returnadapter.querySelectorAll(getEl(params),params.selector)},"Element.getDOMProperties":function(params){returnadapter.queryProperties(getEl(params),params.names)},"Element.getProperties":function(params){varel=getEl(params),ctx=el.__vue__||el.attr||{};returnel.__vueParentComponent&&(ctx=Object.assign({},ctx,el.__vueParentComponent.attrs,el.__vueParentComponent.props)),adapter.queryProperties(ctx,params.names)},"Element.getOffset":function(params){returnadapter.getOffset(getEl(params))},"Element.getAttributes":function(params){returnadapter.queryAttributes(getEl(params),params.names)},"Element.getStyles":function(params){returnadapter.queryStyles(getEl(params),params.names)},"Element.getHTML":function(params){returnadapter.queryHTML(getEl(params),params.type)},"Element.tap":function(params){returnadapter.dispatchTapEvent(getEl(params))},"Element.longpress":function(params){returnadapter.dispatchLongpressEvent(getEl(params))},"Element.touchstart":function(params){returnadapter.dispatchTouchEvent(getEl(params),"touchstart",params)},"Element.touchmove":function(params){returnadapter.dispatchTouchEvent(getEl(params),"touchmove",params)},"Element.touchend":function(params){returnadapter.dispatchTouchEvent(getEl(params),"touchend",params)},"Element.callFunction":function(params){returnadapter.callFunction(getEl(params),params.functionName,params.args)},"Element.triggerEvent":function(params){returnadapter.triggerEvent(getEl(params),params.type,params.detail)}}}(WebAdapter));functionsend(data){returnUniViewJSBridge.publishHandler("onAutoMessageReceive",data)}UniViewJSBridge.subscribe("sendAutoMessage",(function(_a){varid=_a.id,method=_a.method,params=_a.params,data={id:id},fn=Api[method];if(!fn)returndata.error={message:method+" unimplemented"},send(data);try{fn(params).then((function(res){res&&(data.result=res)})).catch((function(err){data.error={message:err.message}})).finally((function(){send(data)}))}catch(err){data.error={message:err.message},send(data)}}));
import{__spreadArray}from"tslib";vargetRandomValues="undefined"!=typeofcrypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeofmsCrypto&&"function"==typeofmsCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),rnds8=newUint8Array(16);functionrng(){if(!getRandomValues)thrownewError("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");returngetRandomValues(rnds8)}for(varbyteToHex=[],i=0;i<256;++i)byteToHex[i]=(i+256).toString(16).substr(1);functionv4(options,buf,offset){vari=buf&&offset||0;"string"==typeofoptions&&(buf="binary"===options?newArray(16):null,options=null);varrnds=(options=options||{}).random||(options.rng||rng)();if(rnds[6]=15&rnds[6]|64,rnds[8]=63&rnds[8]|128,buf)for(varii=0;ii<16;++ii)buf[i+ii]=rnds[ii];returnbuf||function(buf,offset){vari=offset||0,bth=byteToHex;return[bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],"-",bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]],bth[buf[i++]]].join("")}(rnds)}varhasOwnProperty=Object.prototype.hasOwnProperty,isArray=Array.isArray,PATH_RE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;functiongetPaths(path,data){if(isArray(path))returnpath;if(data&&(val=data,key=path,hasOwnProperty.call(val,key)))return[path];varval,key,res=[];returnpath.replace(PATH_RE,(function(match,p1,offset,string){returnres.push(offset?string.replace(/\\(\\)?/g,"$1"):p1||match),string})),res}functiongetDataByPath(data,path){vardataPath,paths=getPaths(path,data);for(dataPath=paths.shift();null!=dataPath;){if(null==(data=data[dataPath]))return;dataPath=paths.shift()}returndata}functiongetVmNodeId(vm){if(vm._$weex)returnvm._uid;if(vm._$id)returnvm._$id;varparent_1=function(vm){for(varparent=vm.$parent;parent;){if(parent._$id)returnparent;parent=parent.$parent}}(vm);if(!vm.$parent)return"-1";varvnode=vm.$vnode,context=vnode.context;returncontext&&context!==parent_1&&context._$id?context._$id+";"+parent_1._$id+","+vnode.data.attrs._i:parent_1._$id+","+vnode.data.attrs._i}varelementMap=newMap;functiontransEl(el){var_a,_b;if(!function(el){if(el){vartagName=el.tagName;return0===tagName.indexOf("UNI-")||"BODY"===tagName||0===tagName.indexOf("V-UNI-")}return!1}(el))throwError("no such element");varelement,elementId,vm,elem={elementId:(element=el,elementId=element._id,elementId||(elementId=v4(),element._id=elementId,elementMap.set(elementId,{id:elementId,element:element})),elementId),tagName:el.tagName.toLocaleLowerCase().replace("uni-","")};el.__vue__?(vm=el.__vue__)&&(vm.$parent&&vm.$parent.$el===el&&(vm=vm.$parent),vm&&!(null===(_a=vm.$options)||void0===_a?void0:_a.isReserved)&&(elem.nodeId=getVmNodeId(vm))):(vm=el.__vnode)&&(vm.el===el&&(vm=vm.ctx.parent),vm&&!(null===(_b=vm.type)||void0===_b?void0:_b.__reserved)&&(elem.nodeId=getVmNodeId(vm)));return"video"===elem.tagName&&(elem.videoId=elem.nodeId),elem}varFUNCTIONS={input:{input:function(el,value){varvm=el.__vue__;vm?(vm.valueSync=value,vm.$triggerInput({},{value:value})):(vm=el.__vnode).ctx.exposed.$triggerInput({value:value})}},textarea:{input:function(el,value){varvm=el.__vue__;vm?(vm.valueSync=value,vm.$triggerInput({},{value:value})):(vm=el.__vnode).ctx.exposed.$triggerInput({value:value})}},"scroll-view":{scrollTo:function(el,x,y){varmain=el.__vue__.$refs.main;main.scrollLeft=x,main.scrollTop=y},scrollTop:function(el){returnel.__vue__.$refs.main.scrollTop},scrollLeft:function(el){returnel.__vue__.$refs.main.scrollLeft},scrollWidth:function(el){returnel.__vue__.$refs.main.scrollWidth},scrollHeight:function(el){returnel.__vue__.$refs.main.scrollHeight}},swiper:{swipeTo:function(el,index){el.__vue__.current=index}},"movable-view":{moveTo:function(el,x,y){el.__vue__._animationTo(x,y)}},switch:{tap:function(el){el.click()}},slider:{slideTo:function(el,value){varvm=el.__vue__,slider=vm.$refs["uni-slider"],offsetWidth=slider.offsetWidth,boxLeft=slider.getBoundingClientRect().left;vm.value=value,vm._onClick({x:(value-vm.min)*offsetWidth/(vm.max-vm.min)+boxLeft})}}};functioncreateTouchList(touchInits){var_a,touches=touchInits.map((function(touch){returnfunction(touch){if(document.createTouch)returndocument.createTouch(window,touch.target,touch.identifier,touch.pageX,touch.pageY,touch.screenX,touch.screenY);returnnewTouch(touch)}(touch)}));returndocument.createTouchList?(_a=document).createTouchList.apply(_a,touches):touches}varWebAdapter={getWindow:function(pageId){returnwindow},getDocument:function(pageId){returndocument},getEl:function(elementId){varelement=elementMap.get(elementId);if(!element)throwError("element destroyed");returnelement.element},getOffset:function(node){varrect=node.getBoundingClientRect();returnPromise.resolve({left:rect.left+window.pageXOffset,top:rect.top+window.pageYOffset})},querySelector:function(context,selector){return"page"===selector&&(selector="body"),Promise.resolve(transEl(context.querySelector(selector)))},querySelectorAll:function(context,selector){varelements=[],nodeList=document.querySelectorAll(selector);return[].forEach.call(nodeList,(function(node){try{elements.push(transEl(node))}catch(e){}})),Promise.resolve({elements:elements})},queryProperties:function(context,names){returnPromise.resolve({properties:names.map((function(name){varvalue=getDataByPath(context,name.replace(/-([a-z])/g,(function(g){returng[1].toUpperCase()})));return"document.documentElement.scrollTop"===name&&0===value&&(value=getDataByPath(context,"document.body.scrollTop")),"innerText"===name?value.replace(/\n/g,""):value}))})},queryAttributes:function(context,names){returnPromise.resolve({attributes:names.map((function(name){returnString(context.getAttribute(name))}))})},queryStyles:function(context,names){varstyle=getComputedStyle(context);returnPromise.resolve({styles:names.map((function(name){returnstyle[name]}))})},queryHTML:function(context,type){returnPromise.resolve({html:(html="outer"===type?context.outerHTML:context.innerHTML,html.replace(/\n/g,"").replace(/(<uni-text[^>]*>)(<span[^>]*>[^<]*<\/span>)(.*?<\/uni-text>)/g,"$1$3").replace(/<\/?[^>]*>/g,(function(replacement){return-1<replacement.indexOf("<body")?"<page>":"</body>"===replacement?"</page>":0!==replacement.indexOf("<uni-")&&0!==replacement.indexOf("</uni-")?"":replacement.replace(/uni-/g,"").replace(/ role=""/g,"").replace(/ aria-label=""/g,"")})))});varhtml},dispatchTapEvent:function(el){returnel.click(),Promise.resolve()},dispatchLongpressEvent:function(el){returnPromise.resolve()},dispatchTouchEvent:function(el,type,eventInitDict){eventInitDict||(eventInitDict={}),eventInitDict.touches||(eventInitDict.touches=[]),eventInitDict.changedTouches||(eventInitDict.changedTouches=[]),eventInitDict.touches.length||eventInitDict.touches.push({identifier:Date.now(),target:el});vartouches=createTouchList(eventInitDict.touches),changedTouches=createTouchList(eventInitDict.changedTouches),targetTouches=createTouchList([]);returnel.dispatchEvent(newTouchEvent(type,{cancelable:!0,bubbles:!0,touches:touches,targetTouches:targetTouches,changedTouches:changedTouches})),Promise.resolve()},callFunction:function(el,functionName,args){varfn=getDataByPath(FUNCTIONS,functionName);returnfn?Promise.resolve({result:fn.apply(null,__spreadArray([el],args,!0))}):Promise.reject(Error("".concat(functionName," not exists")))},triggerEvent:function(el,type,detail){varvm=el.__vue__;returnvm.$trigger&&vm.$trigger(type,{},detail),Promise.resolve()}};varApi=Object.assign({},function(adapter){return{"Page.getElement":function(params){returnadapter.querySelector(adapter.getDocument(params.pageId),params.selector)},"Page.getElements":function(params){returnadapter.querySelectorAll(adapter.getDocument(params.pageId),params.selector)},"Page.getWindowProperties":function(params){returnadapter.queryProperties(adapter.getWindow(params.pageId),params.names)}}}(WebAdapter),function(adapter){vargetEl=function(params){returnadapter.getEl(params.elementId,params.pageId)};return{"Element.getElement":function(params){returnadapter.querySelector(getEl(params),params.selector)},"Element.getElements":function(params){returnadapter.querySelectorAll(getEl(params),params.selector)},"Element.getDOMProperties":function(params){returnadapter.queryProperties(getEl(params),params.names)},"Element.getProperties":function(params){varel=getEl(params),ctx=el.__vue__||el.attr||{};returnel.__vueParentComponent&&(ctx=Object.assign({},ctx,el.__vueParentComponent.attrs,el.__vueParentComponent.props)),adapter.queryProperties(ctx,params.names)},"Element.getOffset":function(params){returnadapter.getOffset(getEl(params))},"Element.getAttributes":function(params){returnadapter.queryAttributes(getEl(params),params.names)},"Element.getStyles":function(params){returnadapter.queryStyles(getEl(params),params.names)},"Element.getHTML":function(params){returnadapter.queryHTML(getEl(params),params.type)},"Element.tap":function(params){returnadapter.dispatchTapEvent(getEl(params))},"Element.longpress":function(params){returnadapter.dispatchLongpressEvent(getEl(params))},"Element.touchstart":function(params){returnadapter.dispatchTouchEvent(getEl(params),"touchstart",params)},"Element.touchmove":function(params){returnadapter.dispatchTouchEvent(getEl(params),"touchmove",params)},"Element.touchend":function(params){returnadapter.dispatchTouchEvent(getEl(params),"touchend",params)},"Element.callFunction":function(params){returnadapter.callFunction(getEl(params),params.functionName,params.args)},"Element.triggerEvent":function(params){returnadapter.triggerEvent(getEl(params),params.type,params.detail)}}}(WebAdapter));functionsend(data){returnUniViewJSBridge.publishHandler("onAutoMessageReceive",data)}UniViewJSBridge.subscribe("sendAutoMessage",(function(_a){varid=_a.id,method=_a.method,params=_a.params,data={id:id},fn=Api[method];if(!fn)returndata.error={message:method+" unimplemented"},send(data);try{fn(params).then((function(res){res&&(data.result=res)})).catch((function(err){data.error={message:err.message}})).finally((function(){send(data)}))}catch(err){data.error={message:err.message},send(data)}}));
vare=function(){returne=Object.assign||function(e){for(varn,t=1,r=arguments.length;t<r;t++)for(varoinn=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);returne},e.apply(this,arguments)};functionn(){for(vare=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;varr=Array(e),o=0;for(n=0;n<t;n++)for(vari=arguments[n],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];returnr}vart="undefined"!=typeofcrypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeofmsCrypto&&"function"==typeofmsCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),r=newUint8Array(16);functiono(){if(!t)thrownewError("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");returnt(r)}for(vari=[],u=0;u<256;++u)i[u]=(u+256).toString(16).substr(1);functiona(e,n,t){varr=n&&t||0;"string"==typeofe&&(n="binary"===e?newArray(16):null,e=null);varu=(e=e||{}).random||(e.rng||o)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,n)for(vara=0;a<16;++a)n[r+a]=u[a];returnn||function(e,n){vart=n||0,r=i;return[r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],"-",r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]],r[e[t++]]].join("")}(u)}varc=Object.prototype.hasOwnProperty,s=function(e){returnnull==e},l=Array.isArray,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;functiond(e,n){if(l(e))returne;if(n&&(t=n,r=e,c.call(t,r)))return[e];vart,r,o=[];returne.replace(f,(function(e,n,t,r){returno.push(t?r.replace(/\\(\\)?/g,"$1"):n||e),r})),o}functiong(e,n){vart,r=d(n,e);for(t=r.shift();!s(t);){if(null==(e=e[t]))return;t=r.shift()}returne}functionp(e){returne._uid||e.uid}varm=newMap;functionv(e){varn;if(!function(e){if(e){varn=e.tagName;return0===n.indexOf("UNI-")||"BODY"===n||0===n.indexOf("V-UNI-")}return!1}(e))throwError("no such element");vart,r,o,i={elementId:(t=e,r=t._id,r||(r=a(),t._id=r,m.set(r,{id:r,element:t})),r),tagName:e.tagName.toLocaleLowerCase().replace("uni-","")};e.__vue__?(o=e.__vue__)&&(o.$parent&&o.$parent.$el===e&&(o=o.$parent),o&&!(null===(n=o.$options)||void0===n?void0:n.isReserved)&&(i.nodeId=p(o))):(o=e.__vnode)&&(o.el===e&&(o=o.ctx.parent),o&&(i.nodeId=p(o)));return"video"===i.tagName&&(i.videoId=i.nodeId),i}varh={input:{input:function(e,n){vart=e.__vue__;t.valueSync=n,t.$triggerInput({},{value:n})}},textarea:{input:function(e,n){vart=e.__vue__;t.valueSync=n,t.$triggerInput({},{value:n})}},"scroll-view":{scrollTo:function(e,n,t){varr=e.__vue__.$refs.main;r.scrollLeft=n,r.scrollTop=t},scrollTop:function(e){returne.__vue__.$refs.main.scrollTop},scrollLeft:function(e){returne.__vue__.$refs.main.scrollLeft},scrollWidth:function(e){returne.__vue__.$refs.main.scrollWidth},scrollHeight:function(e){returne.__vue__.$refs.main.scrollHeight}},swiper:{swipeTo:function(e,n){e.__vue__.current=n}},"movable-view":{moveTo:function(e,n,t){e.__vue__._animationTo(n,t)}},switch:{tap:function(e){e.click()}},slider:{slideTo:function(e,n){vart=e.__vue__,r=t.$refs["uni-slider"],o=r.offsetWidth,i=r.getBoundingClientRect().left;t.value=n,t._onClick({x:(n-t.min)*o/(t.max-t.min)+i})}}};function_(e){varn,t=e.map((function(e){returnfunction(e){if(document.createTouch)returndocument.createTouch(window,e.target,e.identifier,e.pageX,e.pageY,e.screenX,e.screenY);returnnewTouch(e)}(e)}));returndocument.createTouchList?(n=document).createTouchList.apply(n,t):t}vary={getWindow:function(e){returnwindow},getDocument:function(e){returndocument},getEl:function(e){varn=m.get(e);if(!n)throwError("element destroyed");returnn.element},getOffset:function(e){varn=e.getBoundingClientRect();returnPromise.resolve({left:n.left+window.pageXOffset,top:n.top+window.pageYOffset})},querySelector:function(e,n){return"page"===n&&(n="body"),Promise.resolve(v(e.querySelector(n)))},querySelectorAll:function(e,n){vart=[],r=document.querySelectorAll(n);return[].forEach.call(r,(function(e){try{t.push(v(e))}catch(e){}})),Promise.resolve({elements:t})},queryProperties:function(e,n){returnPromise.resolve({properties:n.map((function(n){vart=g(e,n.replace(/-([a-z])/g,(function(e){returne[1].toUpperCase()})));return"document.documentElement.scrollTop"===n&&0===t&&(t=g(e,"document.body.scrollTop")),"innerText"===n?t.replace(/\n/g,""):t}))})},queryAttributes:function(e,n){returnPromise.resolve({attributes:n.map((function(n){returnString(e.getAttribute(n))}))})},queryStyles:function(e,n){vart=getComputedStyle(e);returnPromise.resolve({styles:n.map((function(e){returnt[e]}))})},queryHTML:function(e,n){returnPromise.resolve({html:(t="outer"===n?e.outerHTML:e.innerHTML,t.replace(/\n/g,"").replace(/(<uni-text[^>]*>)(<span[^>]*>[^<]*<\/span>)(.*?<\/uni-text>)/g,"$1$3").replace(/<\/?[^>]*>/g,(function(e){return-1<e.indexOf("<body")?"<page>":"</body>"===e?"</page>":0!==e.indexOf("<uni-")&&0!==e.indexOf("</uni-")?"":e.replace(/uni-/g,"").replace(/ role=""/g,"").replace(/ aria-label=""/g,"")})))});vart},dispatchTapEvent:function(e){returne.click(),Promise.resolve()},dispatchLongpressEvent:function(e){returnPromise.resolve()},dispatchTouchEvent:function(e,n,t){t||(t={}),t.touches||(t.touches=[]),t.changedTouches||(t.changedTouches=[]),t.touches.length||t.touches.push({identifier:Date.now(),target:e});varr=_(t.touches),o=_(t.changedTouches),i=_([]);returne.dispatchEvent(newTouchEvent(n,{cancelable:!0,bubbles:!0,touches:r,targetTouches:i,changedTouches:o})),Promise.resolve()},callFunction:function(e,t,r){varo=g(h,t);returno?Promise.resolve({result:o.apply(null,n([e],r))}):Promise.reject(Error(t+" not exists"))},triggerEvent:function(e,n,t){varr=e.__vue__;returnr.$trigger&&r.$trigger(n,{},t),Promise.resolve()}};varS,T=Object.assign({},function(e){return{"Page.getElement":function(n){returne.querySelector(e.getDocument(n.pageId),n.selector)},"Page.getElements":function(n){returne.querySelectorAll(e.getDocument(n.pageId),n.selector)},"Page.getWindowProperties":function(n){returne.queryProperties(e.getWindow(n.pageId),n.names)}}}(y),function(e){varn=function(n){returne.getEl(n.elementId,n.pageId)};return{"Element.getElement":function(t){returne.querySelector(n(t),t.selector)},"Element.getElements":function(t){returne.querySelectorAll(n(t),t.selector)},"Element.getDOMProperties":function(t){returne.queryProperties(n(t),t.names)},"Element.getProperties":function(t){varr=n(t),o=r.__vue__||r.attr||{};returnr.__vueParentComponent&&(o=Object.assign({},o,r.__vueParentComponent.attrs,r.__vueParentComponent.props)),e.queryProperties(o,t.names)},"Element.getOffset":function(t){returne.getOffset(n(t))},"Element.getAttributes":function(t){returne.queryAttributes(n(t),t.names)},"Element.getStyles":function(t){returne.queryStyles(n(t),t.names)},"Element.getHTML":function(t){returne.queryHTML(n(t),t.type)},"Element.tap":function(t){returne.dispatchTapEvent(n(t))},"Element.longpress":function(t){returne.dispatchLongpressEvent(n(t))},"Element.touchstart":function(t){returne.dispatchTouchEvent(n(t),"touchstart",t)},"Element.touchmove":function(t){returne.dispatchTouchEvent(n(t),"touchmove",t)},"Element.touchend":function(t){returne.dispatchTouchEvent(n(t),"touchend",t)},"Element.callFunction":function(t){returne.callFunction(n(t),t.functionName,t.args)},"Element.triggerEvent":function(t){returne.triggerEvent(n(t),t.type,t.detail)}}}(y));functionE(e){returnUniViewJSBridge.publishHandler("onAutoMessageReceive",e)}functionw(e){returne.__wxWebviewId__?e.__wxWebviewId__:e.privateProperties?e.privateProperties.slaveId:e.$page?e.$page.id:void0}functionP(e){returne.route||e.uri}functionO(e){returne.options||e.$page&&e.$page.options||{}}functionb(e){return{id:w(e),path:P(e),query:O(e)}}functionM(e){varn=function(e){returngetCurrentPages().find((function(n){returnw(n)===e}))}(e);returnn&&n.$vm}functionI(e,n){returne._uid===n||e.uid===n}functionC(e,n,t){varr,o,i;if(void0===t&&(t=!1),t)if(e.component&&I(e.component,n))i=e.component;else{varu=[];e.childreninstanceofArray?u=e.children:(null===(o=null===(r=e.component)||void0===r?void0:r.subTree)||void0===o?void0:o.children)&&(u=e.component.subTree.children),u.find((function(e){returni=C(e,n,!0)}))}elsee&&(I(e,n)?i=e:e.$children.find((function(e){returni=C(e,n)})));returni}functionx(e,n){vart=M(e);if(t)returnN(t)?C(t.$.subTree,n,!0):C(t,n)}function$(e,n){vart,r=e.$data||e.data;returne&&(t=n?g(r,n):Object.assign({},r)),Promise.resolve({data:t})}functionk(e,n){if(e){vart=N(e);Object.keys(n).forEach((function(r){t?(e.$data||e.data)[r]=n[r]:e[r]=n[r]}))}returnPromise.resolve()}functionA(e,n,t){returnN(e)&&(e=e.$vm||e.ctx),newPromise((function(r,o){vari,u;if(!e)returno(S.VM_NOT_EXISTS);if(!e[n]&&!(null===(u=e.$.exposed)||void0===u?void0:u[n]))returno(S.METHOD_NOT_EXISTS);vara,c=e[n]?e[n].apply(e,t):(i=e.$.exposed)[n].apply(i,t);!(a=c)||"object"!=typeofa&&"function"!=typeofa||"function"!=typeofa.then?r({result:c}):c.then((function(e){r({result:e})}))}))}functionN(e){return!e.$children}functionW(){returnwindow.__uniapp_x_}UniViewJSBridge.subscribe("sendAutoMessage",(function(e){varn=e.id,t=e.method,r=e.params,o={id:n},i=T[t];if(!i)returno.error={message:t+" unimplemented"},E(o);try{i(r).then((function(e){e&&(o.result=e)})).catch((function(e){o.error={message:e.message}})).finally((function(){E(o)}))}catch(e){o.error={message:e.message},E(o)}})),function(e){e.VM_NOT_EXISTS="VM_NOT_EXISTS",e.METHOD_NOT_EXISTS="METHOD_NOT_EXISTS"}(S||(S={}));varB=1,D={};functionV(e,n){vart=0;n&&(t=B++,D[t]=n);varr={data:{id:t,type:"automator",data:e}};console.log("postMessageToUniXWebView",r),window.__uniapp_x_.postMessage(JSON.stringify(r))}varq=newMap,L=function(n){returnnewPromise((function(t,r){varo=q.values().next().value;if(o){vari=n.method;if("onOpen"===i)returnU(o,t);if(i.startsWith("on"))returno.instance[i]((function(e){t(e)}));"sendMessage"===i&&(i="send"),o.instance[i](e(e({},n),{success:function(e){t({result:e}),"close"===i&&q.delete(q.keys().next().value)},fail:function(e){r(e)}}))}elser({errMsg:"socketTask not exists."})}))};functionU(e,n){if(e.isOpend)n({data:e.openData});else{vart=setInterval((function(){e.isOpend&&(clearInterval(t),n(e.openData))}),200);setTimeout((function(){clearInterval(t)}),2e3)}}varR=["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"],X=newMap,H=["onCompassChange","onThemeChange","onUserCaptureScreen","onWindowResize","onMemoryWarning","onAccelerometerChange","onKeyboardHeightChange","onNetworkStatusChange","onPushMessage","onLocationChange","onGetWifiList","onWifiConnected","onWifiConnectedWithPartialInfo","onSocketOpen","onSocketError","onSocketMessage","onSocketClose"],j={},J=/^\$|Sync$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting|initUTS|requireUTS|registerUTS/,F=/^on|^off/;functionY(e){returnJ.test(e)||-1!==R.indexOf(e)}varz={getPageStack:function(){returnPromise.resolve({pageStack:getCurrentPages().map((function(e){returnb(e)}))})},getCurrentPage:function(){vare=getCurrentPages(),n=e.length;returnnewPromise((function(t,r){n?t(b(e[n-1])):r(Error("getCurrentPages().length=0"))}))},callUniMethod:function(n,t){varr=n.method,o=n.args;returnnewPromise((function(n,i){if("connectSocket"!==r){varu,a;if(H.includes(r)){X.has(r)||X.set(r,newMap);varc=o[0],s=function(e){t({id:c,result:{method:r,data:e}})};returnr.startsWith("onSocket")?L({method:r.replace("Socket","")}).then((function(e){returns(e)})).catch((function(e){returns(e)})):(X.get(r).set(c,s),uni[r](s)),n({result:null})}if(r.startsWith("off")&&H.includes(r.replace("off","on"))){varl=r.replace("off","on");if(X.has(l)){varf=o[0];if(void0!==f){vard=X.get(l).get(f);uni[r](d),X.get(l).delete(f)}else{X.get(l).forEach((function(e){uni[r](e)})),X.delete(l)}}returnn({result:null})}if(r.indexOf("Socket")>0)returnL(e({method:r.replace("Socket","")},o[0])).then((function(e){returnn(e)})).catch((function(e){returni(e)}));if(!uni[r])returni(Error("uni."+r+" not exists"));if(Y(r))returnn({result:uni[r].apply(uni,o)});varg=[Object.assign({},o[0]||{},{success:function(e){setTimeout((function(){n({result:e})}),"pageScrollTo"===r?350:0)},fail:function(e){i(Error(e.errMsg.replace(r+":fail ","")))}})];uni[r].apply(uni,g)}else(u=o[0].id,a=o[0].url,newPromise((function(e,n){vart=uni.connectSocket({url:a,success:function(){e({result:{errMsg:"connectSocket:ok"}})},fail:function(){n({result:{errMsg:"connectSocket:fail"}})}});q.set(u,{instance:t,isOpend:!1}),t.onOpen((function(e){q.get(u).isOpend=!0,q.get(u).openData=e}))}))).then((function(e){returnn(e)})).catch((function(e){returni(e)}))}))},mockUniMethod:function(e){varn=e.method;if(!uni[n])throwError("uni."+n+" not exists");if(!function(e){return!F.test(e)}(n))throwError("You can't mock uni."+n);vart,r=e.result,o=e.functionDeclaration;returns(r)&&s(o)?(j[n]&&(uni[n]=j[n],deletej[n]),Promise.resolve()):(t=s(o)?Y(n)?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)}:function(){for(varn=[],r=0;r<arguments.length;r++)n[r]=arguments[r];returnnewFunction("return "+o)().apply(t,n.concat(e.args))},t.origin=j[n]||uni[n],j[n]||(j[n]=uni[n]),uni[n]=t,Promise.resolve())},captureScreenshot:function(e){returnnewPromise((function(n,t){W()?V({action:"captureScreenshot",args:e},(function(e,r){e?t(Error("captureScreenshot fail: "+e)):n(r)})):t(Error("captureScreenshot fail: supported only on the app platform."))}))},socketEmitter:function(n){returnnewPromise((function(t,r){(function(n){returnnewPromise((function(t,r){if(q.has(n.id)){varo=q.get(n.id),i=o.instance,u=n.method,a=n.id;if("onOpen"==u)returnU(o,t);if(u.startsWith("on"))returni[u]((function(e){t({method:"Socket."+u,id:a,data:e})}));i[u](e(e({},n),{success:function(e){t(e),"close"===u&&q.delete(n.id)},fail:function(e){r(e)}}))}elser({errMsg:"socketTask not exists."})}))})(n).then((function(e){returnt(e)})).catch((function(e){returnr(e)}))}))}},G=z,K={getData:function(e){return$(M(e.pageId),e.path)},setData:function(e){returnk(M(e.pageId),e.data)},callMethod:function(e){varn,t=((n={})[S.VM_NOT_EXISTS]="Page["+e.pageId+"] not exists",n[S.METHOD_NOT_EXISTS]="page."+e.method+" not exists",n);returnnewPromise((function(n,r){A(M(e.pageId),e.method,e.args).then((function(e){returnn(e)})).catch((function(e){r(Error(t[e]))}))}))},callMethodWithCallback:function(e){varn,t=((n={})[S.VM_NOT_EXISTS]="callMethodWithCallback:fail, Page["+e.pageId+"] not exists",n[S.METHOD_NOT_EXISTS]="callMethodWithCallback:fail, page."+e.method+" not exists",n),r=e.args[e.args.length-1];A(M(e.pageId),e.method,e.args).catch((function(e){r({errMsg:t[e]})}))}};functionQ(e){returne.nodeId||e.elementId}varZ={getData:function(e){return$(x(e.pageId,Q(e)),e.path)},setData:function(e){returnk(x(e.pageId,Q(e)),e.data)},callMethod:function(e){varn,t=Q(e),r=((n={})[S.VM_NOT_EXISTS]="Component["+e.pageId+":"+t+"] not exists",n[S.METHOD_NOT_EXISTS]="component."+e.method+" not exists",n);returnnewPromise((function(n,o){A(x(e.pageId,t),e.method,e.args).then((function(e){returnn(e)})).catch((function(e){o(Error(r[e]))}))}))}},ee={};Object.keys(G).forEach((function(e){ee["App."+e]=G[e]})),Object.keys(K).forEach((function(e){ee["Page."+e]=K[e]})),Object.keys(Z).forEach((function(e){ee["Element."+e]=Z[e]}));varne,te,re=process.env.UNI_AUTOMATOR_WS_ENDPOINT;functionoe(e){te.send({data:JSON.stringify(e)})}functionie(e){varn=JSON.parse(e.data),t=n.id,r=n.method,o=n.params,i={id:t},u=ee[r];if(!u){if(ne){vara=ne(t,r,o,i);if(!0===a)return;u=a}if(!u)returni.error={message:r+" unimplemented"},oe(i)}try{u(o,oe).then((function(e){e&&(i.result=e)})).catch((function(e){i.error={message:e.message}})).finally((function(){oe(i)}))}catch(e){i.error={message:e.message},oe(i)}}functionue(e){void0===e&&(e={}),(te=uni.connectSocket({url:e.wsEndpoint||re,complete:function(){}})).onMessage(ie),te.onOpen((function(n){e.success&&e.success(),console.log("已开启自动化测试...")})),te.onError((function(e){console.log("automator.onError",e)})),te.onClose((function(){e.fail&&e.fail({errMsg:"$$initRuntimeAutomator:fail"}),console.log("automator.onClose")}))}ne=function(e,n,t,r){varo=t.pageId,i=function(e){varn=getCurrentPages();if(!e)returnn[n.length-1];returnn.find((function(n){returnn.$page.id===e}))}(o);returni?(i.$page.meta.isNVue,UniServiceJSBridge.publishHandler("sendAutoMessage",{id:e,method:n,params:t},o),!0):(r.error={message:"page["+o+"] not exists"},oe(r),!0)},UniServiceJSBridge.subscribe("onAutoMessageReceive",(function(e){oe(e)})),setTimeout((function(){if(W())V({action:"ready"});else{if(re&&re.endsWith(":0000"))return;ue()}}),500),window.initRuntimeAutomator=ue,window.onPostMessageFromUniXWebView=function(e,n,t){console.log("onPostMessageFromUniXWebView",e,n,t,D);varr=D[e];r&&(deleteD[e],r(t,n))};
import{__spreadArrayase,__assignast}from"tslib";varn="undefined"!=typeofcrypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeofmsCrypto&&"function"==typeofmsCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),r=newUint8Array(16);functiono(){if(!n)thrownewError("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");returnn(r)}for(vari=[],u=0;u<256;++u)i[u]=(u+256).toString(16).substr(1);functiona(e,t,n){varr=t&&n||0;"string"==typeofe&&(t="binary"===e?newArray(16):null,e=null);varu=(e=e||{}).random||(e.rng||o)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,t)for(vara=0;a<16;++a)t[r+a]=u[a];returnt||function(e,t){varn=t||0,r=i;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}(u)}varc=Object.prototype.hasOwnProperty,s=function(e){returnnull==e},l=Array.isArray,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;functiond(e,t){if(l(e))returne;if(t&&(n=t,r=e,c.call(n,r)))return[e];varn,r,o=[];returne.replace(f,(function(e,t,n,r){returno.push(n?r.replace(/\\(\\)?/g,"$1"):t||e),r})),o}functiong(e,t){varn,r=d(t,e);for(n=r.shift();!s(n);){if(null==(e=e[n]))return;n=r.shift()}returne}functionp(e){returne._uid||e.uid}varm=newMap;functionv(e){vart,n;if(!function(e){if(e){vart=e.tagName;return0===t.indexOf("UNI-")||"BODY"===t||0===t.indexOf("V-UNI-")}return!1}(e))throwError("no such element");varr,o,i,u={elementId:(r=e,o=r._id,o||(o=a(),r._id=o,m.set(o,{id:o,element:r})),o),tagName:e.tagName.toLocaleLowerCase().replace("uni-","")};e.__vue__?(i=e.__vue__)&&(i.$parent&&i.$parent.$el===e&&(i=i.$parent),i&&!(null===(t=i.$options)||void0===t?void0:t.isReserved)&&(u.nodeId=p(i))):(i=e.__vnode)&&(i.el===e&&(i=i.ctx.parent),i&&!(null===(n=i.type)||void0===n?void0:n.__reserved)&&(u.nodeId=p(i)));return"video"===u.tagName&&(u.videoId=u.nodeId),u}varh={input:{input:function(e,t){varn=e.__vue__;n?(n.valueSync=t,n.$triggerInput({},{value:t})):(n=e.__vnode).ctx.exposed.$triggerInput({value:t})}},textarea:{input:function(e,t){varn=e.__vue__;n?(n.valueSync=t,n.$triggerInput({},{value:t})):(n=e.__vnode).ctx.exposed.$triggerInput({value:t})}},"scroll-view":{scrollTo:function(e,t,n){varr=e.__vue__.$refs.main;r.scrollLeft=t,r.scrollTop=n},scrollTop:function(e){returne.__vue__.$refs.main.scrollTop},scrollLeft:function(e){returne.__vue__.$refs.main.scrollLeft},scrollWidth:function(e){returne.__vue__.$refs.main.scrollWidth},scrollHeight:function(e){returne.__vue__.$refs.main.scrollHeight}},swiper:{swipeTo:function(e,t){e.__vue__.current=t}},"movable-view":{moveTo:function(e,t,n){e.__vue__._animationTo(t,n)}},switch:{tap:function(e){e.click()}},slider:{slideTo:function(e,t){varn=e.__vue__,r=n.$refs["uni-slider"],o=r.offsetWidth,i=r.getBoundingClientRect().left;n.value=t,n._onClick({x:(t-n.min)*o/(n.max-n.min)+i})}}};function_(e){vart,n=e.map((function(e){returnfunction(e){if(document.createTouch)returndocument.createTouch(window,e.target,e.identifier,e.pageX,e.pageY,e.screenX,e.screenY);returnnewTouch(e)}(e)}));returndocument.createTouchList?(t=document).createTouchList.apply(t,n):n}vary={getWindow:function(e){returnwindow},getDocument:function(e){returndocument},getEl:function(e){vart=m.get(e);if(!t)throwError("element destroyed");returnt.element},getOffset:function(e){vart=e.getBoundingClientRect();returnPromise.resolve({left:t.left+window.pageXOffset,top:t.top+window.pageYOffset})},querySelector:function(e,t){return"page"===t&&(t="body"),Promise.resolve(v(e.querySelector(t)))},querySelectorAll:function(e,t){varn=[],r=document.querySelectorAll(t);return[].forEach.call(r,(function(e){try{n.push(v(e))}catch(e){}})),Promise.resolve({elements:n})},queryProperties:function(e,t){returnPromise.resolve({properties:t.map((function(t){varn=g(e,t.replace(/-([a-z])/g,(function(e){returne[1].toUpperCase()})));return"document.documentElement.scrollTop"===t&&0===n&&(n=g(e,"document.body.scrollTop")),"innerText"===t?n.replace(/\n/g,""):n}))})},queryAttributes:function(e,t){returnPromise.resolve({attributes:t.map((function(t){returnString(e.getAttribute(t))}))})},queryStyles:function(e,t){varn=getComputedStyle(e);returnPromise.resolve({styles:t.map((function(e){returnn[e]}))})},queryHTML:function(e,t){returnPromise.resolve({html:(n="outer"===t?e.outerHTML:e.innerHTML,n.replace(/\n/g,"").replace(/(<uni-text[^>]*>)(<span[^>]*>[^<]*<\/span>)(.*?<\/uni-text>)/g,"$1$3").replace(/<\/?[^>]*>/g,(function(e){return-1<e.indexOf("<body")?"<page>":"</body>"===e?"</page>":0!==e.indexOf("<uni-")&&0!==e.indexOf("</uni-")?"":e.replace(/uni-/g,"").replace(/ role=""/g,"").replace(/ aria-label=""/g,"")})))});varn},dispatchTapEvent:function(e){returne.click(),Promise.resolve()},dispatchLongpressEvent:function(e){returnPromise.resolve()},dispatchTouchEvent:function(e,t,n){n||(n={}),n.touches||(n.touches=[]),n.changedTouches||(n.changedTouches=[]),n.touches.length||n.touches.push({identifier:Date.now(),target:e});varr=_(n.touches),o=_(n.changedTouches),i=_([]);returne.dispatchEvent(newTouchEvent(t,{cancelable:!0,bubbles:!0,touches:r,targetTouches:i,changedTouches:o})),Promise.resolve()},callFunction:function(t,n,r){varo=g(h,n);returno?Promise.resolve({result:o.apply(null,e([t],r,!0))}):Promise.reject(Error("".concat(n," not exists")))},triggerEvent:function(e,t,n){varr=e.__vue__;returnr.$trigger&&r.$trigger(t,{},n),Promise.resolve()}};varS,T=Object.assign({},function(e){return{"Page.getElement":function(t){returne.querySelector(e.getDocument(t.pageId),t.selector)},"Page.getElements":function(t){returne.querySelectorAll(e.getDocument(t.pageId),t.selector)},"Page.getWindowProperties":function(t){returne.queryProperties(e.getWindow(t.pageId),t.names)}}}(y),function(e){vart=function(t){returne.getEl(t.elementId,t.pageId)};return{"Element.getElement":function(n){returne.querySelector(t(n),n.selector)},"Element.getElements":function(n){returne.querySelectorAll(t(n),n.selector)},"Element.getDOMProperties":function(n){returne.queryProperties(t(n),n.names)},"Element.getProperties":function(n){varr=t(n),o=r.__vue__||r.attr||{};returnr.__vueParentComponent&&(o=Object.assign({},o,r.__vueParentComponent.attrs,r.__vueParentComponent.props)),e.queryProperties(o,n.names)},"Element.getOffset":function(n){returne.getOffset(t(n))},"Element.getAttributes":function(n){returne.queryAttributes(t(n),n.names)},"Element.getStyles":function(n){returne.queryStyles(t(n),n.names)},"Element.getHTML":function(n){returne.queryHTML(t(n),n.type)},"Element.tap":function(n){returne.dispatchTapEvent(t(n))},"Element.longpress":function(n){returne.dispatchLongpressEvent(t(n))},"Element.touchstart":function(n){returne.dispatchTouchEvent(t(n),"touchstart",n)},"Element.touchmove":function(n){returne.dispatchTouchEvent(t(n),"touchmove",n)},"Element.touchend":function(n){returne.dispatchTouchEvent(t(n),"touchend",n)},"Element.callFunction":function(n){returne.callFunction(t(n),n.functionName,n.args)},"Element.triggerEvent":function(n){returne.triggerEvent(t(n),n.type,n.detail)}}}(y));functionE(e){returnUniViewJSBridge.publishHandler("onAutoMessageReceive",e)}functionw(e){returne.__wxWebviewId__?e.__wxWebviewId__:e.privateProperties?e.privateProperties.slaveId:e.$page?e.$page.id:void0}functionP(e){returne.route||e.uri}functionb(e){returne.options||e.$page&&e.$page.options||{}}functionI(e){return{id:w(e),path:P(e),query:b(e)}}functionO(e){vart=function(e){returngetCurrentPages().find((function(t){returnw(t)===e}))}(e);returnt&&t.$vm}functionM(e,t){returne._uid===t||e.uid===t}functionC(e,t,n){varr,o,i;if(void0===n&&(n=!1),n)if(e.component&&M(e.component,t))i=e.component;else{varu=[];e.childreninstanceofArray?u=e.children:(null===(o=null===(r=e.component)||void0===r?void0:r.subTree)||void0===o?void0:o.children)&&(u=e.component.subTree.children),u.find((function(e){returni=C(e,t,!0)}))}elsee&&(M(e,t)?i=e:e.$children.find((function(e){returni=C(e,t)})));returni}functionx(e,t){varn=O(e);if(n)returnN(n)?C(n.$.subTree,t,!0):C(n,t)}function$(e,t){varn,r=e.$data||e.data;returne&&(n=t?g(r,t):Object.assign({},r)),Promise.resolve({data:n})}functionk(e,t){if(e){varn=N(e);Object.keys(t).forEach((function(r){n?(e.$data||e.data)[r]=t[r]:e[r]=t[r]}))}returnPromise.resolve()}functionA(e,t,n){returnN(e)&&(e=e.$vm||e.ctx),newPromise((function(r,o){vari,u;if(!e)returno(S.VM_NOT_EXISTS);if(!e[t]&&!(null===(u=e.$.exposed)||void0===u?void0:u[t]))returno(S.METHOD_NOT_EXISTS);vara,c=e[t]?e[t].apply(e,n):(i=e.$.exposed)[t].apply(i,n);!(a=c)||"object"!=typeofa&&"function"!=typeofa||"function"!=typeofa.then?r({result:c}):c.then((function(e){r({result:e})}))}))}functionN(e){return!e.$children}functionW(){returnwindow.__uniapp_x_}UniViewJSBridge.subscribe("sendAutoMessage",(function(e){vart=e.id,n=e.method,r=e.params,o={id:t},i=T[n];if(!i)returno.error={message:n+" unimplemented"},E(o);try{i(r).then((function(e){e&&(o.result=e)})).catch((function(e){o.error={message:e.message}})).finally((function(){E(o)}))}catch(e){o.error={message:e.message},E(o)}})),function(e){e.VM_NOT_EXISTS="VM_NOT_EXISTS",e.METHOD_NOT_EXISTS="METHOD_NOT_EXISTS"}(S||(S={}));varB=1,D={};functionV(e,t){varn=0;t&&(n=B++,D[n]=t);varr={data:{id:n,type:"automator",data:e}};console.log("postMessageToUniXWebView",r),window.__uniapp_x_.postMessage(JSON.stringify(r))}varq=newMap,L=function(e){returnnewPromise((function(n,r){varo=q.values().next().value;if(o){vari=e.method;if("onOpen"===i)returnU(o,n);if(i.startsWith("on"))returno.instance[i]((function(e){n(e)}));"sendMessage"===i&&(i="send"),o.instance[i](t(t({},e),{success:function(e){n({result:e}),"close"===i&&q.delete(q.keys().next().value)},fail:function(e){r(e)}}))}elser({errMsg:"socketTask not exists."})}))};functionU(e,t){if(e.isOpend)t({data:e.openData});else{varn=setInterval((function(){e.isOpend&&(clearInterval(n),t(e.openData))}),200);setTimeout((function(){clearInterval(n)}),2e3)}}varR=["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"],X=newMap,H=["onCompassChange","onThemeChange","onUserCaptureScreen","onWindowResize","onMemoryWarning","onAccelerometerChange","onKeyboardHeightChange","onNetworkStatusChange","onPushMessage","onLocationChange","onGetWifiList","onWifiConnected","onWifiConnectedWithPartialInfo","onSocketOpen","onSocketError","onSocketMessage","onSocketClose"],j={},J=/^\$|Sync$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting|initUTS|requireUTS|registerUTS/,F=/^on|^off/;functionY(e){returnJ.test(e)||-1!==R.indexOf(e)}varz={getPageStack:function(){returnPromise.resolve({pageStack:getCurrentPages().map((function(e){returnI(e)}))})},getCurrentPage:function(){vare=getCurrentPages(),t=e.length;returnnewPromise((function(n,r){t?n(I(e[t-1])):r(Error("getCurrentPages().length=0"))}))},callUniMethod:function(e,n){varr=e.method,o=e.args;returnnewPromise((function(e,i){if("connectSocket"!==r){varu,a;if(H.includes(r)){X.has(r)||X.set(r,newMap);varc=o[0],s=function(e){n({id:c,result:{method:r,data:e}})};returnr.startsWith("onSocket")?L({method:r.replace("Socket","")}).then((function(e){returns(e)})).catch((function(e){returns(e)})):(X.get(r).set(c,s),uni[r](s)),e({result:null})}if(r.startsWith("off")&&H.includes(r.replace("off","on"))){varl=r.replace("off","on");if(X.has(l)){varf=o[0];if(void0!==f){vard=X.get(l).get(f);uni[r](d),X.get(l).delete(f)}else{X.get(l).forEach((function(e){uni[r](e)})),X.delete(l)}}returne({result:null})}if(r.indexOf("Socket")>0)returnL(t({method:r.replace("Socket","")},o[0])).then((function(t){returne(t)})).catch((function(e){returni(e)}));if(!uni[r])returni(Error("uni."+r+" not exists"));if(Y(r))returne({result:uni[r].apply(uni,o)});varg=[Object.assign({},o[0]||{},{success:function(t){setTimeout((function(){e({result:t})}),"pageScrollTo"===r?350:0)},fail:function(e){i(Error(e.errMsg.replace(r+":fail ","")))}})];uni[r].apply(uni,g)}else(u=o[0].id,a=o[0].url,newPromise((function(e,t){varn=uni.connectSocket({url:a,success:function(){e({result:{errMsg:"connectSocket:ok"}})},fail:function(){t({result:{errMsg:"connectSocket:fail"}})}});q.set(u,{instance:n,isOpend:!1}),n.onOpen((function(e){q.get(u).isOpend=!0,q.get(u).openData=e}))}))).then((function(t){returne(t)})).catch((function(e){returni(e)}))}))},mockUniMethod:function(e){vart=e.method;if(!uni[t])throwError("uni.".concat(t," not exists"));if(!function(e){return!F.test(e)}(t))throwError("You can't mock uni.".concat(t));varn,r=e.result,o=e.functionDeclaration;returns(r)&&s(o)?(j[t]&&(uni[t]=j[t],deletej[t]),Promise.resolve()):(n=s(o)?Y(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)}:function(){for(vart=[],r=0;r<arguments.length;r++)t[r]=arguments[r];returnnewFunction("return "+o)().apply(n,t.concat(e.args))},n.origin=j[t]||uni[t],j[t]||(j[t]=uni[t]),uni[t]=n,Promise.resolve())},captureScreenshot:function(e){returnnewPromise((function(t,n){W()?V({action:"captureScreenshot",args:e},(function(e,r){e?n(Error("captureScreenshot fail: ".concat(e))):t(r)})):n(Error("captureScreenshot fail: supported only on the app platform."))}))},socketEmitter:function(e){returnnewPromise((function(n,r){(function(e){returnnewPromise((function(n,r){if(q.has(e.id)){varo=q.get(e.id),i=o.instance,u=e.method,a=e.id;if("onOpen"==u)returnU(o,n);if(u.startsWith("on"))returni[u]((function(e){n({method:"Socket.".concat(u),id:a,data:e})}));i[u](t(t({},e),{success:function(t){n(t),"close"===u&&q.delete(e.id)},fail:function(e){r(e)}}))}elser({errMsg:"socketTask not exists."})}))})(e).then((function(e){returnn(e)})).catch((function(e){returnr(e)}))}))}},G=z,K={getData:function(e){return$(O(e.pageId),e.path)},setData:function(e){returnk(O(e.pageId),e.data)},callMethod:function(e){vart,n=((t={})[S.VM_NOT_EXISTS]="Page[".concat(e.pageId,"] not exists"),t[S.METHOD_NOT_EXISTS]="page.".concat(e.method," not exists"),t);returnnewPromise((function(t,r){A(O(e.pageId),e.method,e.args).then((function(e){returnt(e)})).catch((function(e){r(Error(n[e]))}))}))},callMethodWithCallback:function(e){vart,n=((t={})[S.VM_NOT_EXISTS]="callMethodWithCallback:fail, Page[".concat(e.pageId,"] not exists"),t[S.METHOD_NOT_EXISTS]="callMethodWithCallback:fail, page.".concat(e.method," not exists"),t),r=e.args[e.args.length-1];A(O(e.pageId),e.method,e.args).catch((function(e){r({errMsg:n[e]})}))}};functionQ(e){returne.nodeId||e.elementId}varZ={getData:function(e){return$(x(e.pageId,Q(e)),e.path)},setData:function(e){returnk(x(e.pageId,Q(e)),e.data)},callMethod:function(e){vart,n=Q(e),r=((t={})[S.VM_NOT_EXISTS]="Component[".concat(e.pageId,":").concat(n,"] not exists"),t[S.METHOD_NOT_EXISTS]="component.".concat(e.method," not exists"),t);returnnewPromise((function(t,o){A(x(e.pageId,n),e.method,e.args).then((function(e){returnt(e)})).catch((function(e){o(Error(r[e]))}))}))}},ee={};Object.keys(G).forEach((function(e){ee["App."+e]=G[e]})),Object.keys(K).forEach((function(e){ee["Page."+e]=K[e]})),Object.keys(Z).forEach((function(e){ee["Element."+e]=Z[e]}));varte,ne,re=process.env.UNI_AUTOMATOR_WS_ENDPOINT;functionoe(e){ne.send({data:JSON.stringify(e)})}functionie(e){vart=JSON.parse(e.data),n=t.id,r=t.method,o=t.params,i={id:n},u=ee[r];if(!u){if(te){vara=te(n,r,o,i);if(!0===a)return;u=a}if(!u)returni.error={message:r+" unimplemented"},oe(i)}try{u(o,oe).then((function(e){e&&(i.result=e)})).catch((function(e){i.error={message:e.message}})).finally((function(){oe(i)}))}catch(e){i.error={message:e.message},oe(i)}}functionue(e){void0===e&&(e={}),(ne=uni.connectSocket({url:e.wsEndpoint||re,complete:function(){}})).onMessage(ie),ne.onOpen((function(t){e.success&&e.success(),console.log("已开启自动化测试...")})),ne.onError((function(e){console.log("automator.onError",e)})),ne.onClose((function(){e.fail&&e.fail({errMsg:"$$initRuntimeAutomator:fail"}),console.log("automator.onClose")}))}te=function(e,t,n,r){varo=n.pageId,i=function(e){vart=getCurrentPages();if(!e)returnt[t.length-1];returnt.find((function(t){returnt.$page.id===e}))}(o);returni?(i.$page.meta.isNVue,UniServiceJSBridge.publishHandler("sendAutoMessage",{id:e,method:t,params:n},o),!0):(r.error={message:"page["+o+"] not exists"},oe(r),!0)},UniServiceJSBridge.subscribe("onAutoMessageReceive",(function(e){oe(e)})),setTimeout((function(){if(W())V({action:"ready"});else{if(re&&re.endsWith(":0000"))return;ue()}}),500),window.initRuntimeAutomator=ue,window.onPostMessageFromUniXWebView=function(e,t,n){console.log("onPostMessageFromUniXWebView",e,t,n,D);varr=D[e];r&&(deleteD[e],r(n,t))};