(this.nativeLog||function(t){console.log(t)})("### App Framework ### Start: 0.0.6 Build 20191011 HEAD^ c4c438c1");var FRAMEWORK_VERSION="0.0.7",global=this,process={env:{}},setTimeout=global.setTimeout;!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";function t(t,e){if("undefined"==typeof document)return e;t=t||"";var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");return i.type="text/css",n.appendChild(i),i.styleSheet?i.styleSheet.cssText=t:i.appendChild(document.createTextNode(t)),e}var e="0.0.6",n="0.0.5";let i=null;const o=["off","error","warn","info","log","debug","trace"];let r={};function s(t){const e=global.Env&&global.Env.logLevel||"log";return r[e]&&r[e][t]}var a={setNativeConsole:function(){i=global.console,o.forEach(t=>{const e=o.indexOf(t);r[t]={},o.forEach(n=>{o.indexOf(n)<=e&&(r[t][n]=!0)})});{const t=function(t){return!global.Env||!global.Env.logHash||!1!==global.Env.logHash.na||"string"!=typeof t||0!==t.indexOf("### App Framework ###")},{trace:e,debug:n,log:i,info:o,warn:r,error:a,time:l,timeEnd:c}=console,d=console;console._ori={trace:e,debug:n,log:i,info:o,warn:r,error:a,time:l,timeEnd:c},console._ori.trace=console._ori.debug,d.trace=((...t)=>{}),d.debug=((...e)=>{t(e[0])&&s("debug")&&console._ori.debug.apply(console,e)}),d.log=((...e)=>{t(e[0])&&s("log")&&console._ori.log.apply(console,e)}),d.info=((...e)=>{t(e[0])&&s("info")&&console._ori.info.apply(console,e)}),d.warn=((...e)=>{t(e[0])&&s("warn")&&console._ori.warn.apply(console,e)}),d.error=((...e)=>{t(e[0])&&s("error")&&console._ori.error.apply(console,e)}),d.time=((...t)=>{global.Env.enableLogTime&&s("info")&&console._ori.time.apply(console,t)}),d.timeEnd=((...t)=>{global.Env.enableLogTime&&s("info")&&console._ori.timeEnd.apply(console,t)});const h={};["debug","log","info","warn","error","time","timeEnd"].forEach(t=>{h[t]=(()=>{})}),d.curry=function(t){const e=global.Env.logHash;return e[t]&&e[t].off?h:console}}},resetNativeConsole:function(){r={},global.console=i}};let l=null;var c={setNativeRouter:function(){l=global.history},resetNativeRouter:function(){global.history=l}};let d=null,h=null,p=null,u=null,f=null,m=null,g=null,y=null,b=null;var v={setNativeConsole:a.setNativeConsole,resetNativeConsole:a.resetNativeConsole,setNativeTimer:function(){global.setTimeoutNative=function(t,e,n){d(function(){global.setTimeoutCallback(e)},n)},global.setIntervalNative=function(t,e,n){h(function(){global.setIntervalCallback(e)},n)},global.requestAnimationFrameNative=function(t,e,n){p(function(){global.requestAnimationFrameCallback(e)},n)},d=global.setTimeout,h=global.setInterval,p=global.requestAnimationFrame,u=global.clearTimeout,f=global.setTimeoutNative,m=global.clearInterval,g=global.setIntervalNative,y=global.cancelAnimationFrame,b=global.requestAnimationFrameNative;const t={};let e=0;"function"==typeof f&&(global.setTimeoutWrap=function(n,i,o){return t[++e]=i,global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### setTimeoutWrap ${e}----`),f(n,e,o),e},global.setTimeout=function(t,e){return global.setTimeoutWrap(-1,t,e)},global.setTimeoutCallback=function(e){global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### setTimeout 执行回调 ${e}----`),"function"==typeof t[e]&&(t[e](),delete t[e])},global.clearTimeout=global.clearTimeoutWrap=function(e){"function"==typeof u&&u(e),"function"==typeof t[e]?delete t[e]:t[e]=void 0}),"function"==typeof g&&(global.setIntervalWrap=function(n,i,o){return t[++e]=i,global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### setIntervalWrap ${e}----`),g(n,e,o),e},global.setInterval=function(t,e){return global.setIntervalWrap(-1,t,e)},global.setIntervalCallback=function(e){global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### setInterval 执行回调 ${e}----`),"function"==typeof t[e]&&t[e]()},global.clearInterval=global.clearIntervalWrap=function(e){"function"==typeof m&&m(e),"function"==typeof t[e]?delete t[e]:t[e]=void 0}),"function"==typeof b&&(global.requestAnimationFrameWrap=function(n,i){return t[++e]=i,global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### requestAnimationFrame ${e}----`),b(n,e),e},global.requestAnimationFrame=function(t){return global.requestAnimationFrameWrap(-1,t)},global.requestAnimationFrameCallback=function(n){global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### requestAnimationFrame 执行回调 ${e}----`),"function"==typeof t[n]&&t[n]()},global.cancelAnimationFrame=global.cancelAnimationFrameWrap=function(e){"function"==typeof y&&y(e),"function"==typeof t[e]?delete t[e]:t[e]=void 0})},resetNativeTimer:function(){global.setTimeout=d,global.clearTimeout=u,global.clearTimeoutWrap=null,global.setTimeoutCallback=null,global.setTimeoutWrap=null,global.setInterval=h,global.clearInterval=m,global.clearIntervalWrap=null,global.setIntervalCallback=null,global.setIntervalWrap=null,global.requestAnimationFrame=p,global.cancelAnimationFrame=y,global.cancelAnimationFrameWrap=null,global.requestAnimationFrameCallback=null,global.requestAnimationFrameWrap=null},setNativeRouter:c.setNativeRouter,resetNativeRouter:c.resetNativeRouter,freezePrototype:function(){Object.freeze(Object),Object.freeze(Array),Object.freeze(Object.prototype),Object.freeze(Array.prototype),Object.freeze(String.prototype),Object.freeze(Number.prototype),Object.freeze(Boolean.prototype),Object.freeze(Error.prototype),Object.freeze(Date.prototype),Object.freeze(RegExp.prototype)}};function E(t,e,n){return"function"==typeof global.compileAndRunScript?function(t,e,n){let i="(function (";const o=[],r=[];for(const e in t)o.push(e),r.push(t[e]);for(let t=0;t<o.length-1;++t)i+=o[t],i+=",";i+=o[o.length-1],i+=") {",i+=e,i+="} )";const s=global.compileAndRunScript(i,n);return s&&"function"==typeof s?s(...r):s}(t,e,n):function(t,e){const n=[],i=[];for(const e in t)n.push(e),i.push(t[e]);return n.push(e),new Function(...n)(...i)}(t,e)}function w(t){const e=Object.prototype.toString.call(t);return e.substring(8,e.length-1).toLowerCase()}function x(t){const e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}const T=/-(\w)/g,A=x(t=>t.replace(T,k));function k(t,e){return e?e.toUpperCase():""}const _=/([a-z\d])([A-Z])/g,C=x(t=>t.replace(_,"$1-$2").toLowerCase());function S(t,...e){if("function"==typeof Object.assign)Object.assign(t,...e);else{const n=e.shift();for(const e in n)t[e]=n[e];e.length&&S(t,...e)}return t}function M(...t){const e=t.reduce((t,e)=>t.concat(e),[]);return Array.from(new Set(e))}function O(t){return"function"==typeof t}function D(t){return null!==t&&"object"==typeof t}const L=Object.prototype.toString,I="[object Object]";function P(t){return L.call(t)===I}function N(t){const e=(t+"").charCodeAt(0);return 36===e||95===e}const R=/^@(app)-application\//,F=/^@(app)-component\//,B=/^@(app)-module\//,j=t=>!!t.match(R),H=t=>!!t.match(F);function $(t){return t.replace(R,"").replace(F,"").replace(B,"")}let z=0;function Y(){return++z}const W={},V={};let U={};const q={MODE:{SYNC:0,CALLBACK:1,SUBSCRIBE:2},TYPE:{METHOD:0,ATTRIBUTE:1,EVENT:2},NORMALIZE:{RAW:0,JSON:1},RESULT:{MODULE_INST:0},MULTIPLE:{SINGLE:0,MULTI:1}};function G(t,e,n){global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### require模块:${e}`);const i=[e];let o,r={};if(e.indexOf(".")<0){const t=e+".";for(const e in nt())e.startsWith(t)&&i.push(e)}if(i.forEach(i=>{const s=nt()[i];if(!s)return;let a=i.replace(e,"");if("."===a.substr(0,1)&&(a=a.substr(1)),s.instantiable){const t=function(...e){const n=t.__init__(...e);Object.defineProperty(this,"_instId",{enumerable:!1,configurable:!1,writable:!1,value:n&&n.instId})};if(0===a.length)r=t;else{const e=a.split(".");if(e.length>0){const n=e.pop();J(r,e)[n]=t}}}if(i===e)o=r;else if(a.length>0){const t=a.split(".");t.length>0&&(o=J(r,t))}!function(t,e,n,i){const o=n.methods;for(const r in o){const s=o[r],a=s.instanceMethod?e.prototype:e;r in a&&console.warn(`### App Framework ### 模块${n.name}的接口函数${r}---- 重复定义`);const l=function(...e){if(t._isApp&&!t._defined)throw new Error(`请确认Native方法调用[${n.name}.${r}()]发生在应用app的生命周期的创建['onCreate()']之后`);const o=Object.prototype.hasOwnProperty.call(this,"_instId")?this._instId:i;return Z(t,n,s,e,o)};Object.defineProperty(a,r,{configurable:!1,enumerable:!0,get(){return l.bind(this)},set(t){console.warn(`### App Framework ### 接口${n.name}的方法(${r})为可读,不可覆盖`)}}),global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### require---- 模块${n.name}接口函数${r}`)}const r=n.attributes;for(const t in r){const i=r[t],o=i.instanceMethod?e.prototype:e;Object.defineProperty(o,t,{configurable:!1,enumerable:!0,get(){if(i[1]){let e=this[i[1].name]();if(i[1]&&i[1].subAttrs||i[2]&&i[2].subAttrs){const o=this;e||(e={});let r=[];i[1]&&i[1].subAttrs&&(r=r.concat(i[1].subAttrs)),i[2]&&i[2].subAttrs&&(r=r.concat(i[1].subAttrs));const s=new Set(r);r=Array.from(s);for(const s in r){const a=r[s];Object.defineProperty(e,a,{configurable:!0,enumerable:!0,get(){if(i[1]&&i[1].subAttrs&&!(i[1].subAttrs.indexOf(a)<0))return o[i[1].name]()[a];console.warn(`### App Framework ### 模块${n.name}的接口属性(${t})的子属性(${a})不可读`)},set(e){if(!i[2]||!i[2].subAttrs||i[2].subAttrs.indexOf(a)<0)console.warn(`### App Framework ### 模块${n.name}的接口属性(${t})的子属性(${a})不可写`);else{const t={};t[a]=e,o[i[2].name]({value:t})}}})}}return e}console.warn(`### App Framework ### 模块${n.name}的接口属性(${t})不可读`)},set(e){i[2]?this[i[2].name]({value:e}):console.warn(`### App Framework ### 模块${n.name}的接口属性(${t})不可写`)}})}const s=n.events;for(const t in s){const i=s[t];i.cache=i.cache||{};const o=i.instanceMethod?e.prototype:e;Object.defineProperty(o,t,{configurable:!1,enumerable:!0,get(){const t=void 0===this._instId?-1:this._instId;return i.cache[t]},set(e){if("function"!=typeof e&&-1===[null,void 0].indexOf(e))console.warn(`### App Framework ### 模块${n.name}的接口事件(${t})值类型必须是函数或null`);else{const t=void 0===this._instId?-1:this._instId,n="function"==typeof e?e.bind(this):e;this[i.name]({success:n}),i.cache[t]=e}}})}}(t,o,s,n)}),0===Object.keys(r).length)throw new Error(`请确认引入的模块[${e}]:名称正确并且在manifest.json的features中声明`);return r}function J(t,e){if(!t)return;let n=t;return e.forEach(t=>{t in n||(n[t]={}),n=n[t]}),n}const K=["success","cancel","fail","complete"];function Z(t,e,n,i,o){const{name:r,type:s}=e,{name:a,mode:l,type:c,normalize:d,multiple:h}=n;if(!t._callbacks)return console.warn(`### App Framework ### 容器已销毁,接口调用(${r}.${a}())无效`),new Error("invokeNative: 容器已销毁");if("feature"===s&&!global.JsBridge)return new Error("invokeNative: JsBridge没有初始化");if("module"===s&&!global.ModuleManager)return new Error("invokeNative: ModuleManager没有初始化");const p="feature"===s?global.JsBridge:global.ModuleManager;i.length>0&&void 0===i[0]&&console.warn(`### App Framework ### 接口调用${r}.${a}的参数为 undefined`);const u=i.length>0?i[0]:{};u&&u.callback&&(u.success&&console.warn("### App Framework ### invoke函数不能同时出现'success'和'callback'参数"),u.success=u.callback);let f={};const m={};if(D(u))for(const e in u){const n=u[e];K.indexOf(e)>=0?"function"==typeof n?m[e]=n:console.warn(`### App Framework ### invoke函数的回调参数${e}类型不是function`):"callback"!==e&&(d===q.NORMALIZE.JSON?f[e]=X(n,t):f[e]="function"==typeof e?X(n,t):n)}else O(u)?m.success=u:f=u;if(d===q.NORMALIZE.JSON&&(f=JSON.stringify(f)),l===q.MODE.SYNC){let n="-1";if(h===q.MULTIPLE.MULTI&&O(u)&&(n=tt(u).toString(),global.Env&&"trace"===global.Env.logLevel&&console.trace(`${a} 方法的回调函数参数id:${n}`),"-1"===n))return;const i=p.invoke(r,a,f,n,o);return null==i?void console.warn(`### App Framework ### invoke函数 '${r}.${a}' 返回值为null`):(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### invoke函数 '${r}.${a}' 调用成功,返回值为: ${i}`),Q(t,i,e,a).data)}{let n,i,s;c===q.TYPE.METHOD&&l===q.MODE.CALLBACK&&(m.flagCallback=!0);const d=[];if(Object.keys(m).length){const o=global.isRpkMinPlatformVersionGEQ(1040)?void 0:m;let r=-1;h===q.MULTIPLE.MULTI?-1===(r=tt(m.success))&&(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 新增监听实例,id:${r}`),r=Y()):r=Y(),t._callbacks[r]=(r=>{const l=m,c=Q(t,r,e,a),d=c.code,h=c.data;0===d&&l.success?l.success.call(o,h):100===d&&l.cancel?l.cancel.call(o):d>=200&&l.fail&&l.fail.call(o,h,d),l.complete&&l.complete.call(o,h),n&&(0===d?i({data:h}):s({data:h,code:d}))}),W[r]={instance:t.id.toString(),preserved:l===q.MODE.SUBSCRIBE,cbFunc:m.success},d.push(f),d.push(r.toString())}else d.push(f),d.push("-1");if(p.invoke(r,a,...d,o),c===q.TYPE.METHOD&&l===q.MODE.CALLBACK&&1===Object.keys(m).length)return n=new Promise((t,e)=>{i=t,s=e})}}function Q(t,e,n,i){const o="string"==typeof e?JSON.parse(e):e||{},r=o.content;return r&&r._nativeType===q.RESULT.MODULE_INST?(n.instantiable&&"__init__"===i?o.data=r:o.data=G(t,r.name,r.instId),t._nativeInstList&&t._nativeInstList.push(e),o.data.instHandler=r.instHandler):o.data=r,o}function X(t,e){switch(w(t)){case"undefined":case"null":return"";case"regexp":return t.toString();case"date":return t.toISOString();case"number":case"string":case"boolean":case"array":case"object":return t;case"function":const n=Y();return e._callbacks?e._callbacks[n]=t:global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### normalize() inst实例已经销毁,不再注册回调"),W[n]={instance:e.id.toString(),preserved:!1,cbFunc:t},n.toString();default:return JSON.stringify(t)}}function tt(t){let e=-1;for(const n in W)if(W[n]&&W[n].cbFunc&&W[n].cbFunc===t){e=n;break}return e}function et(t,e){V[t]=e}function nt(){return U}class it{constructor(t){this.id=t,this._callbacks={},this._nativeInstList=[],et(t,this)}invoke(t,e,n,i){global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 调用对象(${t.id})的回调(${e}) 参数:`,JSON.stringify(n));const o=t._callbacks[e];if("function"==typeof o){const r=o(n);return void 0!==i&&!1!==i||(t._callbacks[e]=void 0),r}return new Error(`invoke: 无效invoke回调函数Id "${e}"`)}destroy(){this._callbacks=null,this._nativeInstList=null,et(this.id,null)}}let ot={};let rt=null;const st={};class at{constructor(t="message",e={}){this.type=t,this.data=e.data||null,this.timeStamp=Date.now()}}const lt={};function ct(t,e=null){lt[t]=e}var dt={init:function(){v.setNativeConsole(),v.setNativeTimer(),v.setNativeRouter()},exposeToNative:function(t){for(const e in t)global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 注册全局函数----",e),global[e]=((...n)=>{const i=t[e](...n);return i instanceof Error&&console.error(i.toString()),i})},defineBundle:ct,requireBundle:function(t){if(t=t.replace(/\.js$/,""),!lt[t]){let e=global.readResource(`assets:///js/bundles/${t}.js`);"string"==typeof e&&(e=E({},`${e}; return ${t}`,`/bundles/${t}.js`)),ct(t,e)}return lt[t]},loadResource:function(t){return global.readResource(t)},BroadcastChannel:class{constructor(t){if(global.Env.engine===global.ENGINE_TYPE.CARD)throw new Error("BroadcastChannel is not supported.");Object.defineProperty(this,"name",{configurable:!1,enumerable:!0,writable:!1,value:String(t)}),this._closed=!1,this.onmessage=null,st[this.name]||(st[this.name]=[]),st[this.name].push(this)}postMessage(t){if(this._closed)throw new Error(`BroadcastChannel "${this.name}" is closed.`);const e=st[this.name];if(e&&e.length)for(let n=0;n<e.length;++n){const i=e[n];i._closed||i===this||"function"==typeof i.onmessage&&i.onmessage(new at("message",{data:t}))}}close(){if(!this._closed&&(this._closed=!0,st[this.name])){const t=st[this.name].indexOf(this);t>-1?st[this.name].splice(t,1):delete st[this.name]}}},ENGINE_TYPE:{PAGE:"page",CARD:"card"},ModuleHost:it,requireModule:G,exposure:{registerModules:function(t,e="feature"){"string"==typeof t&&(t=JSON.parse(t)),global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### registerModules---- ",JSON.stringify(t)),"object"==typeof(t=t.map(function(t){return t.__type__=e,t}))&&function(t,e=!0){let n=[];Array.isArray(t)?n=t:n.push(t),n.forEach(t=>{const n=t.name;global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 注册模块---- ${n} <${t.__type__}>`);let i=U[n];i||(i={type:t.__type__,name:t.name,methods:{},attributes:{},events:{},instantiable:t.instantiable},U[n]=i),i.methods||(i.methods={});const o=i.methods;t.methods&&t.methods.length&&t.methods.forEach(t=>{const r=t.name;if(void 0===t.mode&&(t.mode=q.MODE.SYNC),void 0===t.type&&(t.type=q.TYPE.METHOD),void 0===t.normalize&&(t.normalize=q.NORMALIZE.JSON),void 0===t.instanceMethod&&(t.instanceMethod=!1),!i.instantiable&&t.instanceMethod)throw new Error(`模块 ${i.name} 配置定义错误`);if(t.type===q.TYPE.ATTRIBUTE){const e=t.alias,n=t.access;i.attributes[e]=i.attributes[e]||{},i.attributes[e][n]=t,i.attributes[e].instanceMethod=t.instanceMethod}else if(t.type===q.TYPE.EVENT){const e=t.alias;i.events[e]=t}r?o[r]&&!e||(o[r]=t,global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 注册模块 ${n} 接口---- ${r}`)):console.warn(`### App Framework ### 模块 ${n} 的接口没有name属性`)})})}(t)},execInvokeCallback:function(t){"string"==typeof t&&(t=JSON.parse(t));const e=function(t){const e=W[t];return e&&!0===e.preserved||(W[t]=void 0),e}(t.callback);if(global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 处理invoke回调----",JSON.stringify(e)),e){const n=function(t){return V[t]}(e.instance);if(n){const i=[n,t.callback,t.data,e.preserved];return n._callbacks?n.invoke(...i):new Error(`execInvokeCallback: 回调函数所属对象已经无效 "${n.id}"`)}}return new Error(`execInvokeCallback: 无效invoke回调Id "${e&&e.instance}"`)},registerManifest:function(t){global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 注册manifest信息:${JSON.stringify(t)}`),"string"==typeof t&&(t=JSON.parse(t)),ot=t||{}},getManifestField:function(t){const e=t.split(".");let n=ot;for(let t=0,i=e.length;t<i&&null!=(n=n[e[t]]);t++);return n},isRpkMinPlatformVersionGEQ:function(t){return ot.minPlatformVersion>=t},isRpkDebugMode:function(){return null!==rt?rt:(rt=!1,ot.config&&!0===ot.config.debug&&(rt=!0),rt)}}};class ht{constructor(t,e={bubbles:!1,cancelable:!1}){if(arguments.length>1&&"object"!=typeof e)throw new Error(`### App Runtime ### addEventListener() 参数2传递的话,必须是对象:${e}`);this._type=t,this._bubbles=e.bubbles,this._cancelable=e.cancelable,this._target=null,this._currentTarget=null,this._eventPhase=ht.NONE,this._defaultPrevented=!1,this._timeStamp=Date.now(),this._supportW3C=!0,this._flagStopPropagation=!1,this._flagStopImmediatePropagation=!1,this._throwError=!0,this._listenNodes={}}get type(){return this._type}get bubbles(){return this._bubbles}get cancelable(){return this._cancelable}get target(){return this._target}get currentTarget(){return this._currentTarget}get eventPhase(){return this._eventPhase}get defaultPrevented(){return this._defaultPrevented}get timeStamp(){return this._timeStamp}stopPropagation(){this._flagStopPropagation=!0}stopImmediatePropagation(){this._flagStopImmediatePropagation=!0,this.stopPropagation()}preventDefault(){throw new Error("### App Runtime ### preventDefault() 暂不支持该方法")}toJSON(){return{type:this._type,target:this._target,currentTarget:this._currentTarget,timeStamp:this._timeStamp}}}ht.NONE=0,ht.CAPTURING_PHASE=1,ht.AT_TARGET=2,ht.BUBBLING_PHASE=3;class pt extends ht{constructor(){super(...arguments),this._touches=null,this._changedTouches=null}get touches(){return this._touches}set touches(t){if(this._touches)throw new Error("### App Framework ### TouchEvent 不支持修改 touches 属性");this._touches=t}get changedTouches(){return this._changedTouches}set changedTouches(t){if(this._changedTouches)throw new Error("### App Framework ### TouchEvent 不支持修改 changedTouches 属性");this._changedTouches=t}toJSON(){const t=super.toJSON();return Object.assign(t,{touches:this._touches,changedTouches:this._changedTouches})}}const ut={HTML_ID:"-1"},ft={UNKNOWN:0,ELEMENT:1,ATTR:2,TEXT:3,COMMENT:8,DOCUMENT:9,DOCUMENT_FRAGMENT:11,FIGMENT:101};let mt=1;class gt{constructor(){this._nodeType=gt.NodeType.UNKNOWN,this._nodeName=null,this._nodeValue=null,this._ownerDocument=null,this._textContent=null,this.ref=(mt++).toString(),this.childNodes=[],this.layoutChildren=[],this.parentNode=null,this.nextSibling=null,this.previousSibling=null,this._docId=null,this._layout=!1,this._render=!1,this._renderCount=null}get nodeType(){return this._nodeType}get nodeName(){return this._nodeName}get nodeValue(){return this._nodeValue}get ownerDocument(){return this._ownerDocument}get textContent(){return this._textContent}set textContent(t){if(this.nodeType!==gt.NodeType.TEXT){const e=this.ownerDocument.createTextNode(t);this.appendChild(e)}else this._textContent=t}}gt.NodeRef=ut,gt.NodeType=ft;const yt={};function bt(t){return yt[t]}function vt(t){const e=bt(t);return e&&e.listener?e.listener:null}function Et(t,e){if(t._docId===e)return;const n=bt(e);if(n){t._docId=e,n._nodeMap[t.ref]=t;for(let e=0,n=t.childNodes.length;e<n;e++)Et(t.childNodes[e],t._docId)}}function wt(t,e){return t._nodeMap[e]}function xt(t,e){t.parentNode=e,e._docId&&(Et(t,e._docId),t._depth=e._depth+1);for(let e=0,n=t.childNodes.length;e<n;e++)xt(t.childNodes[e],t)}function Tt(t,e,n,i){n<0&&(n=0);const o=e[n-1],r=e[n];return e.splice(n,0,t),i&&(o&&(o.nextSibling=t||null),t.previousSibling=o||null,t.nextSibling=r||null,r&&(r.previousSibling=t||null)),n}function At(t,e,n){const i=e.indexOf(t);if(!(i<0)){if(n){const n=e[i-1],o=e[i+1];n&&(n.nextSibling=o||null),o&&(o.previousSibling=n||null),t.previousSibling=null,t.nextSibling=null}e.splice(i,1)}}function kt(t,e,n,i){const o=e.indexOf(t);if(o<0||o===n)return-1;At(t,e,i);let r=n;return o<=n&&(r=n-1),Tt(t,e,r,i),n}let _t=1;const Ct=/^data.+/;function St(t,e){const n=[],i=Object.assign({},e);if(t)for(let e=0,o=t.length;e<o;e++){const o=t[e];i.hasOwnProperty(o.name)?(n.push({name:C(o.name),value:i[o.name],disabled:!1}),delete i[o.name]):o.disabled&&n.push({name:C(o.name),value:o.value,disabled:o.disabled})}for(const t in i)n.push({name:C(t),value:i[t],disabled:!1});return n}function Mt(t){return(t||"").split(/\s+/).filter(t=>""!==t).filter((t,e,n)=>n.indexOf(t)===e)}const Ot={};function Dt(t){"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(t)||(t=[t]),t.forEach(t=>{if(!t)return;t.name||(t.name=t.type,delete t.type),t.methods=t.methods||[],global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Runtime ### 注册组件---- ",JSON.stringify(t));let e=Ot[t.name];e?e.methods=Array.from(new Set(e.methods.concat(t.methods))):(e=Ot[t.name]=JSON.parse(JSON.stringify(t))).def={}})}function Lt(t){return Ot[t]}function It(t){return t._attr}function Pt(t){return t._style}function Nt(t){if(t._classList)return t._classList;const e=It(t);return t._classList=Mt(e.class),t._classList}function Rt(t){return t.mergedStyle}function Ft(t,e=!0,n=!1,i=!1){if(t.nodeType===ft.ELEMENT){const o={ref:t.ref.toString(),type:t._type},r=function(t){if(t._styleObjectId)return t._styleObjectId;let e=t;for(;e&&!e._styleObjectId;)e=e.parentNode;return e&&(t._styleObjectId=e._styleObjectId),t._styleObjectId}(t);r&&(o.prop={_styleObjectId:r}),n&&t._styleObject&&(o.styleObject=t._styleObject),t._useParentStyle&&(o.prop=o.prop||{},o.prop._useParentStyle=!0);const s=It(t);if(s&&Object.keys(s).length){o.attr={};for(const t in s){const e=s[t];o.attr[t]=-1!==[null,void 0].indexOf(e)?"":e}}const a=Pt(t);if(a&&Object.keys(a).length&&(o.inlineStyle=a),i){const e=Rt(t);e&&Object.keys(e).length&&(o.style=e)}const l=Object.keys(t._eventTargetListeners||{});l&&l.length&&(o.event=l);const c=t.layoutChildren||t.childNodes;if(e&&c&&c.length){const t=[];for(let o=0,r=c.length;o<r;o++){const r=c[o],s=Ft(r,e,n,i);jt(r)?t.push(s):t.push.apply(t,s)}o.children=t}return o}if(t.nodeType===ft.FIGMENT){const o=[];if(e&&t.layoutChildren&&t.layoutChildren.length)for(let r=0,s=t.layoutChildren.length;r<s;r++){const s=t.layoutChildren[r],a=Ft(s,e,n,i);s.nodeType===ft.FIGMENT?o.push.apply(o,a):o.push(a)}return o}if(t.nodeType===ft.COMMENT)return[];global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### getNodeAsJSON() 忽略该类型(${t.nodeType})的节点序列化`)}function Bt(t){return t._layout}function jt(t){return t._render}function Ht(t,e=!1){let n=e?t:t.parentNode;for(;n&&!jt(n);)n=n.parentNode;return n}function $t(t){if(null!==t._renderCount)return t._renderCount;let e=jt(t)?1:0;if(Bt(t)&&!jt(t))for(let n=0,i=t.layoutChildren.length;n<i;n++)e+=$t(t.layoutChildren[n]);return t._renderCount=e,e}function zt(t){let e=t;for(;e;)e._renderCount=null,e=e.parentNode}function Yt(t){const e=t.parentNode;if(t.nodeType===ft.DOCUMENT||t.ref===ut.HTML_ID)return 0;if(!e||!Bt(t))return-1;const n=Wt(t,e);let i=0;return jt(e)||(i=Yt(e)),n<0||i<0?-1:n+i}function Wt(t,e){if(!e.layoutChildren||e.layoutChildren.length<=0)return-1;const n=e.layoutChildren.indexOf(t);if(n>0){let t=0;for(let i=0,o=n;i<o;i++)t+=$t(e.layoutChildren[i]);return t}return n}function Vt(t){delete t._depth,delete t._tmpRenderIndexInParent,delete t._eventTargetListeners,delete t._bindWatcherList,delete t._vm,function(t){if(delete t._docId,delete t._layout,delete t._render,delete t._renderCount,delete t.nextSibling,delete t.previousSibling,delete t.parentNode,t.childNodes)for(let e=t.childNodes.length-1;e>=0;e--)Ut(t.childNodes[e]);delete t.layoutChildren,delete t.childNodes,delete t._content,delete t._ownerDocument,global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### 销毁节点:节点(${t.ref})剩余属性有:[${Object.keys(t).join(", ")}]`)}(t)}function Ut(t){global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### 销毁元素:${JSON.stringify(Ft(t,!1,!1,!1))}`),delete t._classList,delete t._styleObject,delete t._styleObjectId,delete t._useParentStyle,delete t._usedCSSPropertyCache,delete t._matchedCssRuleCache,delete t._mergedStyleCache,delete t._ownCssRuleCache,delete t._attr,delete t._style,delete t._dataset,Vt(t)}function qt(t,e,n){n instanceof Object||(n={capture:!!n});const i=e.type,o=t._eventTargetListeners[i],r=n.capture?ht.CAPTURING_PHASE:ht.BUBBLING_PHASE;if(o&&o[r]&&o[r].list){const n=o[r].list;for(let i=0,o=n.length;i<o;i++){const o=n[i];e._target=t,global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### fireTargetEventListener() 事件响应:${e.type},节点:${t.ref}`),o&&o.call(e.target,e)}}}class Gt extends gt{constructor(){super(...arguments),this._eventTargetListeners={}}addEventListener(t,e,n){if(arguments.length<2)throw new Error(`### App Runtime ### addEventListener() 至少需要传递两个参数:${arguments.length}`);if("string"!=typeof t)throw new Error("### App Runtime ### addEventListener() 参数1必须是字符串,事件类型");if("function"!=typeof e)throw new Error("### App Runtime ### addEventListener() 参数2必须是函数,监听事件");global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### addEventListener() 节点(${this.ref})注册事件(${t})`),n instanceof Object||(n={capture:!!n,once:!1,passive:!1});const i=n.capture?ht.CAPTURING_PHASE:ht.BUBBLING_PHASE,o=this._eventTargetListeners[t]=this._eventTargetListeners[t]||{};if(o[i]=o[i]||{},o[i].list=o[i].list||[],o[i].hash=o[i].hash||{},-1===o[i].list.indexOf(e)){const t=o[i].list.push(e);o[i].hash[t-1]={capture:!!n.capture,once:!!n.once,passive:!!n.passive}}const r=vt(this._docId);r&&r.addEvent(this.ref,t)}removeEventListener(t,e,n){if(arguments.length<2)throw new Error(`### App Runtime ### addEventListener() 至少需要传递两个参数:${arguments.length}`);if("string"!=typeof t)throw new Error("### App Runtime ### addEventListener() 参数1必须是字符串,事件类型");if("function"!=typeof e)throw new Error("### App Runtime ### addEventListener() 参数2必须是函数,监听事件");global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### Element ${this.ref} 执行 removeEventListener(${t})---- `),n instanceof Object||(n={capture:!!n});const i=n.capture?ht.CAPTURING_PHASE:ht.BUBBLING_PHASE,o=this._eventTargetListeners[t]=this._eventTargetListeners[t]||{};o[i]=o[i]||{},o[i].list=o[i].list||[],o[i].hash=o[i].hash||{};const r=o[i].list.indexOf(e);-1!==r&&(o[i].list.splice(r,1),o[i].hash[r]=null),0===o[i].list.length&&(o[i]=null)}dispatchEvent(t){if(!(t instanceof ht))throw new Error("### App Runtime ### dispatchEvent() 参数1所属类必须是事件类");if(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### dispatchEvent() 执行事件:${t.type}, 来自节点:${this.ref}`),!t._supportW3C)return qt(this,t);t._target=this;const e=t.type,n=function(t,e=!1){const n=[];let i=Ht(t,e);for(;i;)n.push(i),i=Ht(i);return n}(this,!0),i=n.slice().reverse().concat(n);if(i[0]&&i[0].parentNode===i[0].ownerDocument){const t=i[0].ownerDocument;i.unshift(t),i.push(t)}for(;i.length>0;){const n=i[0],o=i.indexOf(n),r=i.indexOf(this);if(t._eventPhase=o<r?ht.CAPTURING_PHASE:o===r?ht.AT_TARGET:ht.BUBBLING_PHASE,t._currentTarget=n,!t.bubbles&&t.eventPhase===ht.BUBBLING_PHASE)break;global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### dispatchEvent() 执行事件:${e}, 阶段:${t.eventPhase}, Target:${t.target.ref}, CurrentTarget:${t.currentTarget.ref}`);const s=n._eventTargetListeners[e];let a=t.eventPhase;if(t.target===t.currentTarget&&(a=n===i[1]?ht.CAPTURING_PHASE:ht.BUBBLING_PHASE),s&&s[a]&&s[a].list){const e=s[a].hash,i=s[a].list.slice();for(let o=0,r=i.length;o<r&&!t._flagStopImmediatePropagation;o++){const r=i[o];try{global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### dispatchEvent() 事件响应:${t.type},阶段:${t.eventPhase}`),r&&r.call(t.currentTarget,t)}catch(e){console.error(`### App Runtime ### dispatchEvent() 事件响应:${t.type},阶段:${t.eventPhase}, JS报错:`,e.message,r),console.error(e.stack),t._throwError&&global.setTimeout(()=>{throw e},0)}e[o]&&e[o].once&&n.removeEventListener(t.type,r,e[o])}}if(t._flagStopImmediatePropagation||t._flagStopPropagation)break;i.shift()}t._currentTarget=null}}const Jt={TAG:1,CLASS:1e3,ID:1e6,STEP:1e6,INLINE:1e9},Kt={TAG:1,CLASS:2,ID:3,DESC:4,INLINE:5},Zt={name:null,type:null,score:null,order:0,style:null,_sheetId:null,_hitNodeMap:null,_styleFullList:null};function Qt(t){const e=Object.assign({},Zt,{type:Kt.TAG,score:{self:Jt.TAG,depth:1},_hitNodeMap:{}},t);return e.score.sum=e.score.self*Jt.STEP+e.order,e}function Xt(t){const e=Object.assign({},Zt,{type:Kt.CLASS,score:{self:Jt.CLASS,depth:1},_hitNodeMap:{}},t);return e.score.sum=e.score.self*Jt.STEP+e.order,e}function te(t){const e=Object.assign({},Zt,{type:Kt.ID,score:{self:Jt.ID,depth:1},_hitNodeMap:{}},t);return e.score.sum=e.score.self*Jt.STEP+e.order,e}function ee(t){const e=Object.assign({},Zt,{type:Kt.DESC,_hitNodeMap:{}},t);return e.score=function(t,e){const n={id:0,class:0,tag:0,self:0,depth:1};for(let e=0,i=t.length;e<i;e++){const i=t[e];ne(i)?n.tag+=1:oe(i)?n.id+=1:ie(i)?n.class+=1:re(i)&&(n.depth+=1)}return n.self=n.id*Jt.ID+n.class*Jt.CLASS+n.tag*Jt.TAG,{self:n.self,depth:n.depth}}(e.meta.ruleDef,e.order),e.score.sum=e.score.self*Jt.STEP+e.order,e}function ne(t){return"tag"===t.type}function ie(t){return"attribute"===t.type&&"class"===t.name}function oe(t){return"attribute"===t.type&&"id"===t.name}function re(t){return"descendant"===t.type||"child"===t.type}function se(t){return t._render}function ae(t,e=!1){let n=e?t:t.parentNode;for(;n&&!se(n);)n=n.parentNode;return n}function le(t,e=!1){const n=[];let i=ae(t,e);for(;i;)n.push(i),i=ae(i);return n}function ce(t,e){let n;switch(t.type){case Kt.TAG:n={match:t.name===e._type,matchChanged:!1,pathChanged:!1};break;case Kt.CLASS:n={match:-1!==Nt(e).indexOf(t.name.substring(1)),matchChanged:!1,pathChanged:!1};break;case Kt.ID:n={match:It(e).id===t.name.substring(1),matchChanged:!1,pathChanged:!1};break;case Kt.DESC:n=function(t,e){const n=t.meta.ruleDef,i=[];let o=[e];for(let r=n.length-1;r>=0;r--){const s=n[r],a=r===n.length-1;if(0===(o=he(s,o)).length||e._depth<t.score.depth)return de(t,e,!1,[]);a||-1!==["descendant","child"].indexOf(s.type)||i.push(o[0].ref)}return de(t,e,!0,i)}(t,e);break;default:throw new Error(`不支持的CSS规则类型:${t.type}`)}return n.match?function(t,e){t._hitNodeMap[e]=!0}(t,e.ref):function(t,e){delete t._hitNodeMap[e]}(t,e.ref),n}function de(t,e,n,i){const o={match:n,matchChanged:null,pathChanged:null};if(n){const n=e._ownCssRuleCache[t.order];n?n.join(",")===i.join(",")?(o.matchChanged=!1,o.pathChanged=!1):(o.matchChanged=!1,o.pathChanged=!0):(o.matchChanged=!0,o.pathChanged=!0),e._ownCssRuleCache[t.order]=i}else{e._ownCssRuleCache[t.order]?(o.matchChanged=!0,o.pathChanged=!0):(o.matchChanged=!1,o.pathChanged=!1),e._ownCssRuleCache[t.order]=null}return global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### 节点(${e._type}:${e.ref})与后代CSS规则(${t.name})的匹配计算:${JSON.stringify(o)}`),o}function he(t,e){const n=t.type;switch(n){case"attribute":return function(t,e){if(ie(t)){const n=e.find(e=>-1!==Nt(e).indexOf(t.value));return n?[n]:[]}if(oe(t)){const n=e.find(e=>It(e).id===t.value);return n?[n]:[]}return console.warn(`### App Runtime ### 未知的CSS Selector规则:${t.name},当前支持:class, id`),[]}(t,e);case"tag":return function(t,e){const n=e.find(e=>e._type===t.name);return n?[n]:[]}(t,e);case"descendant":return function(t,e){const n=[];for(let t=0,i=e.length;t<i;t++){const i=e[t];n.push.apply(n,le(i))}return n}(0,e);case"child":return function(t,e){const n=[];for(let t=0,i=e.length;t<i;t++){const i=e[t],o=ae(i);o&&n.push(o)}return n}(0,e);default:return console.warn(`### App Runtime ### 未知的CSS Selector规则:${n},当前支持:tag, class, id, 后代, '>'`),[]}}function pe(t,e){const n=bt(t);return n?n._styleSheetHash[e]:null}function ue(t){const e=[];let n=t;const i=t._docId,o=bt(i)._styleSheetHash[0].map(t=>pe(i,t));for(e.push(...o),t._useParentStyle&&(n=t.parentNode);n&&!n._styleObjectId;)n=n.parentNode;if(n&&n._styleObjectId){const t=pe(i,n._styleObjectId);t&&-1===e.indexOf(t)&&e.push(t)}return global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### 获取节点(${t.ref}:${t._type})的样式表:${e.map(t=>t.id).join(",")}`),e}function fe(t,e){if(!bt(t._docId))return void(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### calcNodeStyle() 节点(${t.ref}:${t._type})暂无关联document`));if(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### calcNodeStyle() 节点(${t.ref}:${t._type})计算类型:${e}`),t._mergedStyleCache=null,!e||e===Kt.INLINE){const e=t._matchedCssRuleCache[Kt.INLINE];t._matchedCssRuleCache[Kt.INLINE]=e||[]}let n,i,o,r,s;e&&e!==Kt.TAG||(t._matchedCssRuleCache[Kt.TAG]=[]),e&&e!==Kt.CLASS||(t._matchedCssRuleCache[Kt.CLASS]=[]),e&&e!==Kt.ID||(t._matchedCssRuleCache[Kt.ID]=[]);const a=Pt(t);if((!e||e===Kt.INLINE)&&((n=t._matchedCssRuleCache[Kt.INLINE]).length?n[0].style=a:n.push(function(t){const e=Object.assign({},Zt,{name:"INLINE",type:Kt.INLINE,score:{self:Jt.INLINE},_hitNodeMap:{}},t);return e.score.sum=e.score.self*Jt.STEP+e.order,e}({style:a})),e===Kt.INLINE))return;const l=ue(t);for(let a=0,c=l.length;a<c;a++){const c=l[a],d=(c.id,c.nameHash),h=c.descLast;if(!e||e===Kt.TAG){n=t._matchedCssRuleCache[Kt.TAG];const e=t._type;if(s=!1)n.push.apply(n,s);else{i=o=[],d.hasOwnProperty(e)&&(i=me([d[e]],t));const s=h[e]&&h[e].list||[];s.length>0&&(o=ge(s,t)),r=i.concat(o),n.push.apply(n,r)}}const p=Nt(t);if(p.length>0&&(!e||e===Kt.CLASS)){n=t._matchedCssRuleCache[Kt.CLASS];const e=p.map(t=>`.${t}`);for(let a=0,l=e.length;a<l;a++){const l=e[a];if(s=!1)n.push.apply(n,s);else{if(i=o=[],d.hasOwnProperty(l)&&(i=me([d[l]],t)),h[l]){o=ge(h[l].list||[],t)}r=i.concat(o),n.push.apply(n,r)}}}if(It(t).id&&(!e||e===Kt.ID)){n=t._matchedCssRuleCache[Kt.ID];const e=It(t).id,a=`#${e}`;if(s=!1)n.push.apply(n,s);else{i=o=[],e&&d.hasOwnProperty(a)&&(i=me([d[a]],t));const s=h[a]&&h[a].list||[];e&&s.length>0&&(o=ge(s,t)),r=i.concat(o),n.push.apply(n,r)}}}}function me(t,e){const n=[];for(let i=0,o=t.length;i<o;i++){const o=t[i];ce(o,e).match&&n.push(o)}return n}function ge(t,e){const n=[];for(let i=0;i<t.length;i++){const o=t[i];ce(o,e).match&&n.push(o)}return n}function ye(t,e){const n=function(t,e){const n=ue(t),i=[];for(let t=0,o=n.length;t<o;t++){const o=n[t],r=o.descNotLast;if(r[e]){const t=r[e].list;i.push(...t)}}return i}(t,e),i=[];for(let e=0,o=n.length;e<o;e++){const o=be(n[e],t);i.push(...o)}return M(i)}function be(t,e){const n=[];for(let i=0,o=e.childNodes.length;i<o;i++){const o=e.childNodes[i];if(se(o)){ce(t,o).matchChanged&&n.push(o.ref)}const r=be(t,o);n.push(...r)}return n}function ve(t){if(t.nodeType===gt.NodeType.ELEMENT&&t._docId){fe(t);for(let e=0,n=t.layoutChildren.length;e<n;e++)ve(t.layoutChildren[e])}}function Ee(t,e,n){if(e.nodeType===gt.NodeType.DOCUMENT_FRAGMENT){const i=e.childNodes.slice();for(let o=0,r=i.length;o<r;o++)e.removeChild(i[o]),Ee(t,i[o],n);return e}const i=Ht(t,!0),o=n?t.childNodes.indexOf(n):t.childNodes.length,r=vt(t._docId);if(e.nodeType===gt.NodeType.TEXT)throw new Error(`### App Runtime ### 不支持在非渲染节点中添加文本节点:${e.textContent}`);if(e.parentNode){if(kt(e,t.childNodes,o,!0),Bt(e))if(n){const o=kt(e,t.layoutChildren,t.layoutChildren.indexOf(n));zt(t);const s=Yt(e);if(r&&o>=0)return r.moveNode(e,i,s)}else{const n=kt(e,t.layoutChildren,t.layoutChildren.length);zt(t);const o=Yt(e);if(r&&n>=0)return r.moveNode(e,i,o)}}else if(xt(e,t),Tt(e,t.childNodes,o,!0),ve(e),Bt(e))if(n){Tt(e,t.layoutChildren,t.layoutChildren.indexOf(n)),zt(t);const o=Yt(e);if(r)return r.addNode(e,i,o)}else{Tt(e,t.layoutChildren,t.layoutChildren.length),zt(t);const n=t===i?-1:Yt(e);if(r)return r.addNode(e,i,n)}}class we extends Gt{constructor(){super(...arguments),this._depth=null,this._tmpRenderIndexInParent=null}appendChild(t){if(!(t&&t instanceof gt))throw new Error("### App Runtime ### appendChild() 函数的node参数无效");if(t.parentNode&&t.parentNode!==this)throw new Error("### App Runtime ### appendChild() 参数node的父节点不匹配");return Ee(this,t,null)}insertBefore(t,e){if(!(t&&2===arguments.length&&t instanceof gt))throw new Error("### App Runtime ### insertBefore() 函数的node/before参数无效");if(t.parentNode&&t.parentNode!==this)throw new Error("### App Runtime ### insertBefore() 参数node的父节点不匹配");return t===e||t.nextSibling&&t.nextSibling===e?t:Ee(this,t,e)}removeChild(t){if(!(t&&t instanceof gt))throw new Error("### App Runtime ### removeChild() node参数无效");if(t.parentNode!==this)throw new Error("### App Runtime ### removeChild() 参数node的父节点不匹配");if(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### removeChild() 移除节点:${JSON.stringify(Ft(t,!1,!1,!1))}`),zt(t),t.parentNode=null,Bt(t)){if(jt(t)){const e=vt(t._docId);e&&e.removeElement(t.ref)}else{const e=t.childNodes.slice();for(let n=0;n<e.length;n++)t.removeChild(e[n])}At(t,this.layoutChildren)}return At(t,this.childNodes,!0),function t(e,n){if(e._docId!==n)return;const i=bt(n);if(i){for(let n=0,i=e.childNodes.length;n<i;n++)t(e.childNodes[n],e._docId);e._depth=null,i._nodeMap[e.ref]=null,e._docId=null}}(t,t._docId),t}toJSON(){return Ft(this,!0,!1,!1)}}class xe extends we{constructor(t){super(...arguments),this._nodeType=gt.NodeType.COMMENT,this._nodeName="#comment",this._nodeValue=t,this._layout=!0,this._render=!1,this._data=t}get data(){return this._data}set data(t){const e=""+t;return this._nodeValue=e,this._data=e,this._data}appendChild(t){throw new Error("### App Runtime ### appendChild() 注释节点不支持插入子节点")}insertBefore(t,e){throw new Error("### App Runtime ### insertBefore() 注释节点不支持插入子节点")}toString(){return"\x3c!-- "+this._data+" --\x3e"}}function Te(t,e,n,i){if(!t._ownerDocument||"ref"===e)return;if(!D(n)&&It(t)[e]===n&&!1!==i)return;if("class"===e)t._classList=null;else if(Ct.test(e)){const i=e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase()).replace(/^data-/,"").replace(/-([a-z])/g,(t,e)=>e.toUpperCase());t._dataset[i]=n}const o=It(t)[e];It(t)[e]=n,global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### 元素的属性(${e})更新(${o}=>${n})`),ke(t,i,e,n),function(t,e,n,i,o){const r=vt(t._docId),s=bt(t._docId);if(!r)return;if(!It(t).hasOwnProperty("descRestyling"))return;if(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### 元素的属性(${n})更新(${o}=>${i})`),"class"===n){const e=Mt(o),n=Mt(i),r=function(t,e){const n={};return t.forEach(t=>n[t]=!0),e.forEach(t=>n[t]?delete n[t]:n[t]=!0),Object.keys(n)}(e,n).map(t=>`.${t}`),a=r.map(e=>ye(t,e)),l=M(...a);for(let t=0,e=l.length;t<e;t++){const e=l[t],n=wt(s,e);n&&(fe(n),_e(n))}}else if("id"===n){const e=o?ye(t,`#${o}`):[],n=i?ye(t,`#${i}`):[],r=M(e,n),a=r;for(let t=0,e=a.length;t<e;t++){const e=a[t],n=wt(s,e);n&&(fe(n),_e(n))}}}(t,0,n,o)}function Ae(t,e,n){if(!t._ownerDocument)return;if(e=e||"",Pt(t)===e&&!1!==n)return;!function(t,e){t._style=e||{}}(t,"string"==typeof e?function(t){const e={};return t.split(";").filter(t=>t.trim()).forEach(t=>{const n=t.indexOf(":");let i=t.substring(0,n).trim();i=A(i);const o=t.substring(n+1).trim();e[i]=o}),global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### 元素的样式转换:${t} 为${JSON.stringify(e)}`),e}(e):e),ke(t,n,"style")}function ke(t,e,n,i,o){const r=vt(t._docId);r&&("class"===n?(fe(t,Kt.CLASS),!e&&r.setStyles(t.ref,Rt(t),{class:i})):"id"===n?(fe(t,Kt.ID),!e&&r.setStyles(t.ref,Rt(t),{id:i})):"style"===n?(fe(t,Kt.INLINE),o?!e&&r.setStyle(t.ref,...o):!e&&r.setStyles(t.ref,Pt(t))):!e&&r.setAttr(t.ref,n,i))}function _e(t){const e=vt(t._docId);e&&e.setStyles(t.ref,Rt(t))}class Ce extends we{constructor(t){super(...arguments),this._nodeType=gt.NodeType.ELEMENT,this._nodeName=t.toUpperCase(),this._tagName=t.toUpperCase(),this._type=t,this._attr={},this._style={},this._dataset={},this._layout=!0,this._render=!0,this._classList=null,this._styleObject=null,this._styleObjectId=null,this._useParentStyle=null,this._usedCSSPropertyCache={},this._matchedCssRuleCache={},this._mergedStyleCache=null,this._ownCssRuleCache={}}get style(){return this._style}get type(){return console.warn("### App Runtime ### type属性将被废弃,不推荐使用"),this._type}get id(){console.warn("### App Runtime ### id属性将被废弃,不推荐使用");const t=It(this);return t&&t.id}get dataset(){return this._dataset}get attr(){return console.warn("### App Runtime ### attr属性将被废弃,不推荐使用"),It(this)}get tagName(){return this._tagName}get mergedStyle(){return this._mergedStyleCache||(this._mergedStyleCache=function(t,e){if(!e)return global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Runtime ### 计算节点CSS样式优先级 没有样式缓存对象,不再计算"),{};const n=function(t){const e=[];for(const n in t){const i=t[n];i&&i.length&&e.push.apply(e,i)}return e.sort((t,e)=>t.score.sum-e.score.sum),e}(e),i=n.map(t=>t.style);global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Runtime ### 按照优先级合并节点样式:",n.map(t=>`"${t.name}"`).join(" < "));const o=Object.assign({},...i),r=Object.keys(Object.assign({},t,o));for(let e=0,n=r.length;e<n;e++){const n=r[e];void 0!==o[n]&&void 0===t[n]?t[n]=!0:void 0===o[n]&&void 0!==t[n]&&(o[n]="")}return o}(this._usedCSSPropertyCache,this._matchedCssRuleCache)),this._mergedStyleCache}appendChild(t){return t.nodeType===gt.NodeType.TEXT?(Te(this,"value",t.textContent),xt(t,this),t):super.appendChild(t)}insertBefore(t,e){return t.nodeType===gt.NodeType.TEXT?(Te(this,"value",t.textContent),xt(t,this),t):super.insertBefore(t,e)}hasAttribute(t){const e=It(this);return e&&e.hasOwnProperty(t)}toString(){const t=It(this),e=Pt(this);return"<"+this._type+" attr="+JSON.stringify(t)+" style="+JSON.stringify(e)+">"+this.layoutChildren.map(t=>t.toString()).join("")+"</"+this._type+">"}}class Se extends we{constructor(){super(...arguments),this._nodeType=gt.NodeType.DOCUMENT_FRAGMENT,this._nodeName="#document-fragment",this._layout=!0,this._render=!1}}class Me extends we{constructor(){super(...arguments),this._nodeType=gt.NodeType.FIGMENT,this._nodeName="#figment",this._layout=!0,this._render=!1}toString(){let t="";return this.childNodes.length&&(t=this.childNodes.map(t=>t.toString()).join("")),t}}class Oe extends we{constructor(t){super(...arguments),this._nodeType=gt.NodeType.TEXT,this._nodeName="#text",this._textContent=t,this._wholeText=t,this._layout=!1,this._render=!1}get wholeText(){return this._wholeText}appendChild(t){throw new Error("### App Runtime ### appendChild() 文本节点不支持插入子节点")}insertBefore(t,e){throw new Error("### App Runtime ### insertBefore() 文本节点不支持插入子节点")}}class De extends Ce{constructor(){super(...arguments),this.ref=gt.NodeRef.HTML_ID,this._depth=0}appendChild(t){return function(t,e,n){if(t.layoutChildren.length>0||e.parentNode)return void console.warn("### App Runtime ### Document添加多个Body节点----");const i=bt(t._docId),o=t.childNodes,r=o.indexOf(n);r<0?o.push(e):o.splice(r,0,e),Bt(e)?(Et(e,e._docId),xt(e,t),Tt(e,t.layoutChildren,t.layoutChildren.length),zt(t),ve(e),i.body=e,vt(t._docId).createBody(e)):xt(e,t)}(this,t)}insertBefore(t,e){console.warn("### App Runtime ### 暂不支持nodeHtml.insertBefore()")}}class Le extends Ce{get value(){return this._attr&&this._attr.value}set value(t){this._attr&&(this._attr.value=t)}get checked(){return this._attr&&this._attr.checked}set checked(t){this._attr&&(this._attr.checked=t)}}const Ie=/^(touchstart|touchmove|touchcancel|touchend)$/,Pe=/^(touchstart|touchmove|touchcancel|touchend|click|longpress)$/;function Ne(t,e){let n;return Ie.test(t)?(n=new pt(t,e))._supportW3C=!1:(n=new ht(t,e))._supportW3C=!1,Pe.test(t)&&global.isRpkMinPlatformVersionGEQ(1040)&&(n._supportW3C=!0,n._bubbles=!0),n}function Re(t){const e=new De("html");return e._ownerDocument=t,Et(e,t._docId),e.parentNode=t,t.childNodes.push(e),t.layoutChildren.push(e),e}class Fe extends we{constructor(t,e){var n,i;super(...arguments),this._nodeType=gt.NodeType.DOCUMENT,this._nodeName="#document",this.body=null,t=t?t.toString():"",this._docId=t,this._nodeMap={},this.listener=e,this._styleSheetHash={},this._styleSheetHash[0]=[],this._styleObjectMap=new Map,n=this._docId,i=this,n&&(yt[n]=i),Object.defineProperty(this,"documentElement",{configurable:!0,enumerable:!1,writable:!1,value:Re(this)})}createElement(t){let e;return(e="input"===t||"textarea"===t?new Le(t):new Ce(t))._ownerDocument=this,e}createDocumentFragment(){const t=new Se;return t._ownerDocument=this,t}createTextNode(t){const e=new Oe(t);return e._ownerDocument=this,e}createComment(t){const e=new xe(t);return e._ownerDocument=this,e}createEvent(t,e){return Ne(t,e)}}var Be=function(t,e){var n=[];if(""!==(t=function t(e,n,i){var o,r,s,a,l=[],c=!1;function d(){var t=n.match(je)[0];return n=n.substr(t.length),Je(t)}function h(t){for(;Ke(n.charAt(t));)t++;n=n.substr(t)}function p(t){for(var e=0;"\\"===n.charAt(--t);)e++;return 1==(1&e)}for(h(0);""!==n;)if(Ke(r=n.charAt(0)))c=!0,h(1);else if(r in Ye)l.push({type:Ye[r]}),c=!1,h(1);else if(","===r){if(0===l.length)throw new SyntaxError("empty sub-selector");e.push(l),l=[],c=!1,h(1)}else if(c&&(l.length>0&&l.push({type:"descendant"}),c=!1),"*"===r)n=n.substr(1),l.push({type:"universal"});else if(r in We)n=n.substr(1),l.push({type:"attribute",name:We[r][0],action:We[r][1],value:d(),ignoreCase:!1});else if("["===r){if(n=n.substr(1),!(o=n.match($e)))throw new SyntaxError("Malformed attribute selector: "+n);n=n.substr(o[0].length),s=Je(o[1]),i&&("lowerCaseAttributeNames"in i?!i.lowerCaseAttributeNames:i.xmlMode)||(s=s.toLowerCase()),l.push({type:"attribute",name:s,action:ze[o[2]],value:Je(o[4]||o[5]||""),ignoreCase:!!o[6]})}else if(":"===r){if(":"===n.charAt(1)){n=n.substr(2),l.push({type:"pseudo-element",name:d().toLowerCase()});continue}if(n=n.substr(1),s=d().toLowerCase(),o=null,"("===n.charAt(0))if(s in Ve){var u=(a=n.charAt(1))in qe;if(n=n.substr(u+1),n=t(o=[],n,i),u){if(n.charAt(0)!==a)throw new SyntaxError("unmatched quotes in :"+s);n=n.substr(1)}if(")"!==n.charAt(0))throw new SyntaxError("missing closing parenthesis in :"+s+" "+n);n=n.substr(1)}else{for(var f=1,m=1;m>0&&f<n.length;f++)"("!==n.charAt(f)||p(f)?")"!==n.charAt(f)||p(f)||m--:m++;if(m)throw new SyntaxError("parenthesis not matched");o=n.substr(1,f-2),n=n.substr(f),s in Ue&&((a=o.charAt(0))===o.slice(-1)&&a in qe&&(o=o.slice(1,-1)),o=Je(o))}l.push({type:"pseudo",name:s,data:o})}else{if(!je.test(n))return l.length&&"descendant"===l[l.length-1].type&&l.pop(),Ze(e,l),n;s=d(),i&&("lowerCaseTags"in i?!i.lowerCaseTags:i.xmlMode)||(s=s.toLowerCase()),l.push({type:"tag",name:s})}return Ze(e,l),n}(n,t+"",e)))throw new SyntaxError("Unmatched selector: "+t);return n},je=/^(?:\\.|[\w\-\u00b0-\uFFFF])+/,He=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,$e=/^\s*((?:\\.|[\w\u00b0-\uFFFF\-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF\-])*)|)|)\s*(i)?\]/,ze={__proto__:null,undefined:"exists","":"equals","~":"element","^":"start",$:"end","*":"any","!":"not","|":"hyphen"},Ye={__proto__:null,">":"child","<":"parent","~":"sibling","+":"adjacent"},We={__proto__:null,"#":["id","equals"],".":["class","element"]},Ve={__proto__:null,has:!0,not:!0,matches:!0},Ue={__proto__:null,contains:!0,icontains:!0},qe={__proto__:null,'"':!0,"'":!0};function Ge(t,e,n){var i="0x"+e-65536;return i!=i||n?e:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)}function Je(t){return t.replace(He,Ge)}function Ke(t){return" "===t||"\n"===t||"\t"===t||"\f"===t||"\r"===t}function Ze(t,e){if(t.length>0&&0===e.length)throw new SyntaxError("empty sub-selector");t.push(e)}const Qe=new WeakMap;function Xe(t,e){if(!Qe.has(e)){const n=function(t,e){const n=Object.keys(e||{}),i={id:tn++,name:t,from:0,size:0,nameHash:{},descLast:{},descNotLast:{}};i.from=en,i.size=n.length,en+=n.length;for(let t=0,o=n.length;t<o;t++){const o=n[t],r=e[o];let s;if(!r||"_"===o[0])continue;if(r.animationName){const t=on(r.animationName,e);t&&(r.animationKeyframes=t)}if(r.fontFamily){const t=rn(r.fontFamily,e);t&&(r.fontFamilyDesc=t)}if(!r._meta&&nn.test(o)){try{const t=an(o),e=t[0];e.length>1&&(r._meta={},r._meta.ruleDef=e)}catch(t){console.warn(`### App Runtime ### 编译CSS后代选择器(${o})出错:${t.message}`);continue}global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### 编译CSS后代选择器(${o})`)}if(r._meta&&r._meta.ruleDef){const t=r._meta.ruleDef;for(let e=0,n=t.length;e<n;e++){const n=t[e];ne(n)?n.idtt=n.name:ie(n)?n.idtt=`.${n.value}`:oe(n)&&(n.idtt=`#${n.value}`)}}global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### 遍历样式节点(${i.id})的选择器(${o}):${JSON.stringify(r)}`);const a=Object.assign({},r),l=i.from+t;if(a._meta){const t=a._meta;delete a._meta,i.nameHash[o]=s=ee({name:o,score:null,order:l,style:a,meta:t,_sheetId:i.id});const e=s.meta.ruleDef,n=e[e.length-1];for(let t=0,n=e.length;t<n-1;t++){const n=e[t];if(!re(n)){const t=n.idtt;i.descNotLast[t]=i.descNotLast[t]||{list:[]},i.descNotLast[t].list.push(s)}}if(!re(n)){const t=n.idtt;i.descLast[t]=i.descLast[t]||{list:[]},i.descLast[t].list.push(s)}}else{if("@KEYFRAMES"===o)continue;"#"===o[0]?i.nameHash[o]=s=te({name:o,order:l,style:a,_sheetId:i.id}):"."===o[0]?i.nameHash[o]=s=Xt({name:o,order:l,style:a,_sheetId:i.id}):i.nameHash[o]=s=Qt({name:o,order:l,style:a,_sheetId:i.id})}}return i}(t,e);Qe.set(e,n)}return Qe.get(e)}let tn=1,en=1;const nn=/\s/;function on(t,e){const n=e["@KEYFRAMES"];if(n){const e=n[t];if(e)return JSON.stringify(e)}return null}function rn(t,e){const n=e["@FONT-FACE"],i=t.replace(/["']+/g,"").split(","),o=[];return i.length>0?(i.forEach(t=>{(t=t.trim())&&(n&&n[t]?o.push(n[t]):o.push({fontName:t}))}),JSON.stringify(o)):null}const sn=new Map;function an(t){return sn.has(t)||sn.set(t,Be(t)),sn.get(t)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==global||"undefined"!=typeof self&&self;function ln(t,e){return t(e={exports:{}},e.exports),e.exports}var cn=ln(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),dn=ln(function(t){var e=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=e)}),hn=(dn.version,function(t){return"object"==typeof t?null!==t:"function"==typeof t}),pn=function(t){if(!hn(t))throw TypeError(t+" is not an object!");return t},un=function(t){try{return!!t()}catch(t){return!0}},fn=!un(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),mn=cn.document,gn=hn(mn)&&hn(mn.createElement),yn=!fn&&!un(function(){return 7!=Object.defineProperty((t="div",gn?mn.createElement(t):{}),"a",{get:function(){return 7}}).a;var t}),bn=Object.defineProperty,vn={f:fn?Object.defineProperty:function(t,e,n){if(pn(t),e=function(t,e){if(!hn(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!hn(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!hn(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!hn(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}(e,!0),pn(n),yn)try{return bn(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},En=fn?function(t,e,n){return vn.f(t,e,function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}(1,n))}:function(t,e,n){return t[e]=n,t},wn={}.hasOwnProperty,xn=function(t,e){return wn.call(t,e)},Tn=0,An=Math.random(),kn=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++Tn+An).toString(36))},_n=ln(function(t){var e=cn["__core-js_shared__"]||(cn["__core-js_shared__"]={});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})("versions",[]).push({version:dn.version,mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),Cn=_n("native-function-to-string",Function.toString),Sn=ln(function(t){var e=kn("src"),n=(""+Cn).split("toString");dn.inspectSource=function(t){return Cn.call(t)},(t.exports=function(t,i,o,r){var s="function"==typeof o;s&&(xn(o,"name")||En(o,"name",i)),t[i]!==o&&(s&&(xn(o,e)||En(o,e,t[i]?""+t[i]:n.join(String(i)))),t===cn?t[i]=o:r?t[i]?t[i]=o:En(t,i,o):(delete t[i],En(t,i,o)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[e]||Cn.call(this)})}),Mn=function(t,e,n){if(function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!")}(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,o){return t.call(e,n,i,o)}}return function(){return t.apply(e,arguments)}},On=function(t,e,n){var i,o,r,s,a=t&On.F,l=t&On.G,c=t&On.S,d=t&On.P,h=t&On.B,p=l?cn:c?cn[e]||(cn[e]={}):(cn[e]||{}).prototype,u=l?dn:dn[e]||(dn[e]={}),f=u.prototype||(u.prototype={});for(i in l&&(n=e),n)r=((o=!a&&p&&void 0!==p[i])?p:n)[i],s=h&&o?Mn(r,cn):d&&"function"==typeof r?Mn(Function.call,r):r,p&&Sn(p,i,r,t&On.U),u[i]!=r&&En(u,i,s),d&&f[i]!=r&&(f[i]=r)};cn.core=dn,On.F=1,On.G=2,On.S=4,On.P=8,On.B=16,On.W=32,On.U=64,On.R=128;var Dn,Ln,In=On,Pn={}.toString,Nn=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==function(t){return Pn.call(t).slice(8,-1)}(t)?t.split(""):Object(t)},Rn=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},Fn=function(t){return Nn(Rn(t))},Bn=Math.ceil,jn=Math.floor,Hn=function(t){return isNaN(t=+t)?0:(t>0?jn:Bn)(t)},$n=Math.min,zn=Math.max,Yn=Math.min,Wn=_n("keys"),Vn=(Dn=!1,function(t,e,n){var i,o,r=Fn(t),s=(i=r.length)>0?$n(Hn(i),9007199254740991):0,a=function(t,e){return(t=Hn(t))<0?zn(t+e,0):Yn(t,e)}(n,s);if(Dn&&e!=e){for(;s>a;)if((o=r[a++])!=o)return!0}else for(;s>a;a++)if((Dn||a in r)&&r[a]===e)return Dn||a||0;return!Dn&&-1}),Un=Wn[Ln="IE_PROTO"]||(Wn[Ln]=kn(Ln)),qn="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),Gn=Object.keys||function(t){return function(t,e){var n,i=Fn(t),o=0,r=[];for(n in i)n!=Un&&xn(i,n)&&r.push(n);for(;e.length>o;)xn(i,n=e[o++])&&(~Vn(r,n)||r.push(n));return r}(t,qn)},Jn={f:Object.getOwnPropertySymbols},Kn={f:{}.propertyIsEnumerable},Zn=Object.assign,Qn=!Zn||un(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=Zn({},t)[n]||Object.keys(Zn({},e)).join("")!=i})?function(t,e){for(var n=Object(Rn(t)),i=arguments.length,o=1,r=Jn.f,s=Kn.f;i>o;)for(var a,l=Nn(arguments[o++]),c=r?Gn(l).concat(r(l)):Gn(l),d=c.length,h=0;d>h;)a=c[h++],fn&&!s.call(l,a)||(n[a]=l[a]);return n}:Zn;In(In.S+In.F,"Object",{assign:Qn});dn.Object.assign;function Xn(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}let ti=!1;!function(){try{const t=new Image;t.src="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA",t.onload=function(){2===t.height&&(ti=!0)}}catch(t){}}();const ei=!1;function ni(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function ii(t){("number"!=typeof t||t<=0)&&(t=10);const e=Math.pow(10,t);return Math.floor(Date.now()+Math.random()*e)%e}function oi(t,e){let n,i,o,r=null,s=0;const a=function(){s=Date.now(),r=null,n=t.apply(i,o)};return function(){const l=Date.now(),c=e-(l-s);return i=this,o=Array.prototype.slice.call(arguments),c<=0?(clearTimeout(r),r=null,s=l,n=t.apply(i,o)):r||(r=setTimeout(a,c)),n}}function ri(t){return t?t.replace(/([A-Z])/g,function(t,e){return`-${e.toLowerCase()}`}):""}function si(t){return["default","go","next","search","send"].indexOf(t)>-1?t:"done"}function ai(t){return t.indexOf("px")>-1?t:`${t}px`}var li={isArray:Xn,slice:function(t,e,n){return Xn(t)?t.slice(e,n):Array.prototype.slice.call(t,e,n)},vendors:["ms","moz","webkit","o"],getType:ni,appendStyle:function(t,e,n){let i=document.getElementById(e);i&&n&&(i.parentNode.removeChild(i),i=null),i||((i=document.createElement("style")).type="text/css",e&&(i.id=e),document.getElementsByTagName("head")[0].appendChild(i)),i.appendChild(document.createTextNode(t))},getUniqueFromArray:function(t){if(!Xn(t))return[];const e=[],n={};let i;for(let o=0,r=t.length;o<r;o++)n[i=t[o]]||(n[i]=!0,e.push(i));return e},detectWebp:function(){return ti},detectSticky:function(){return ei},getRandom:ii,getRgb:function(t){let e;return(e=(t+="").match(/#([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2})/))?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:(e=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/))?{r:parseInt(e[1]),g:parseInt(e[2]),b:parseInt(e[3])}:void 0},loopArray:function(t,e,n){if(!Xn(t))return;let i="l"===(n+"").toLowerCase();const o=t.length;if((e%=o)<0&&(e=-e,i=!i),0===e)return t;let r,s;return i?(r=t.slice(0,e),s=t.slice(e)):(r=t.slice(0,o-e),s=t.slice(o-e)),s.concat(r)},throttle:oi,camelToKebab:ri,kebabToCamel:function(t){return t?t.replace(/-([a-z])/g,function(t,e){return console.log(e),`${e.toUpperCase()}`}):""},findEnterKeyType:si,getLength:ai,extend:S,toArray:function(t,e){e=e||0;let n=t.length-e;const i=new Array(n);for(;n--;)i[n]=t[n+e];return i},isObject:D,isPlainObject:P,typof:w};const ci=[];let di=!1,hi=0;function pi(t){const e=t.node.getBoundingClientRect();return e.right>0&&e.left<window.innerWidth&&e.bottom>0&&e.top<window.innerHeight}function ui(t){const e=t.getParentScroller();return e?pi(t)&&(n=t.node.getBoundingClientRect(),i=e.node.getBoundingClientRect(),n.left<i.right&&n.right>i.left&&n.top<i.bottom&&n.bottom>i.top):pi(t);var n,i}function fi(t){let e;if("scrolling"===t.originalType)e=t.direction;else{const t=window.scrollY;e=t>=hi?"up":"down",hi=t}const n=ci.length;for(let t=0;t<n;t++){const n=ci[t],i=ui(n);i?n.dispatchEvent("appear",{direction:e}):i||n.dispatchEvent("disappear",{direction:e})}}var mi={init:function(){window.customElements.define("h-titlebar",class extends window.HTMLElement{constructor(){super();const t=this.attachShadow({mode:"open"}),e=document.createElement("style");e.textContent="\n .title-bar {\n display: flex;\n flex: 0 1 auto;\n width: 100%;\n height: 8.777vh;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background-color: #ffffff;\n color: #ffffff;\n z-index: 100001;\n }\n \n .button {\n display: flex;\n height: 100%;\n width: 8vw;\n flex-shrink: 0;\n }\n \n .back {\n overflow: hidden;\n margin-left: 20px;\n }\n \n .btn-img {\n position: relative;\n width: 100%;\n left: -80px;\n border-right: 80px solid transparent;\n filter: drop-shadow(80px 0 #ffffff);\n }\n \n .menu {\n overflow: hidden;\n margin-right: 20px;\n }\n \n .title-text {\n font-size: 4.8vw;\n width: 100%;\n text-align: left;\n padding-left: 40px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ";const n=document.createElement("div");n.classList.add("title-bar");const i=this.backBtn=document.createElement("div");i.classList.add("back"),i.classList.add("button");const o=document.createElement("img");o.src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTUwOTE0Mzg4MzQ3IiBjbGFzcz0iaWNvbiIgc3R5bGU9IiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjE3ODkiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iNjQiIGhlaWdodD0iNjQiPjxkZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTY3MS4zIDQ4MC4xSDMwMS43TDQ3My44IDMwOGMxMi40LTEyLjQgMTIuNC0zMi44IDAtNDUuMy0xMi40LTEyLjQtMzIuOC0xMi40LTQ1LjMgMEwyMDEuOSA0ODkuNWMtNSA1LTggMTEuMi05IDE3Ljd2MC4xYy0wLjEgMC40LTAuMSAwLjktMC4yIDEuM3YwLjNjMCAwLjQtMC4xIDAuOC0wLjEgMS4ydjRjMCAwLjQgMC4xIDAuOCAwLjEgMS4ydjAuM2MwIDAuNCAwLjEgMC45IDAuMiAxLjN2MC4xYzEgNi41IDQgMTIuNyA5IDE3LjdsMjI2LjcgMjI2LjdjMTIuNCAxMi40IDMyLjggMTIuNCA0NS4zIDAgMTIuNC0xMi40IDEyLjQtMzIuOCAwLTQ1LjNsLTE3Mi4yLTE3MmgzNjkuNmMxNy42IDAgMzItMTQuNCAzMi0zMnMtMTQuNC0zMi0zMi0zMnoiIHAtaWQ9IjE3OTAiIGZpbGw9IiNmZmZmZmYiPjwvcGF0aD48L3N2Zz4=",o.classList.add("btn-img"),i.appendChild(o),n.appendChild(i);const r=document.createElement("div");r.classList.add("title-text"),r.textContent="",n.appendChild(r);const s=this.menuBtn=document.createElement("div");s.classList.add("menu"),s.classList.add("button");const a=document.createElement("img");a.src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTUxMTQ4MzE1NTQ5IiBjbGFzcz0iaWNvbiIgc3R5bGU9IiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjM0NjEiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iNjQiIGhlaWdodD0iNjQiPjxkZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTUxMC41ODMyMzMgMzM2LjU5NTA4NWMzOS42Mzg3ODkgMCA3MS44Mjg5MzItMzIuMTYwNDY3IDcxLjgyODkzMi03MS44MzA5NzlzLTMyLjE5MDE0My03MS44Mjk5NTUtNzEuODI4OTMyLTcxLjgyOTk1NWMtMzkuNzAyMjM0IDAtNzEuODMwOTc5IDMyLjE1OTQ0NC03MS44MzA5NzkgNzEuODI5OTU1UzQ3MC44ODA5OTkgMzM2LjU5NTA4NSA1MTAuNTgzMjMzIDMzNi41OTUwODVNNTEwLjU4MzIzMyA0MDguNDI1MDRjLTM5LjcwMjIzNCAwLTcxLjgzMDk3OSAzMi4xNjA0NjctNzEuODMwOTc5IDcxLjgzMDk3OSAwIDM5LjY2OTQ4OCAzMi4xMjg3NDUgNzEuNzk3MjA5IDcxLjgzMDk3OSA3MS43OTcyMDkgMzkuNjM4Nzg5IDAgNzEuODI4OTMyLTMyLjEyNzcyMSA3MS44Mjg5MzItNzEuNzk3MjA5QzU4Mi40MTIxNjUgNDQwLjU4NTUwNyA1NTAuMjIyMDIxIDQwOC40MjUwNCA1MTAuNTgzMjMzIDQwOC40MjUwNE01MTAuNTgzMjMzIDYyMy44ODUyM2MtMzkuNzAyMjM0IDAtNzEuODMwOTc5IDMyLjE5MTE2Ni03MS44MzA5NzkgNzEuODI4OTMyIDAgMzkuNzAzMjU3IDMyLjEyODc0NSA3MS44MzA5NzkgNzEuODMwOTc5IDcxLjgzMDk3OSAzOS42Mzg3ODkgMCA3MS44Mjg5MzItMzIuMTI3NzIxIDcxLjgyODkzMi03MS44MzA5NzlDNTgyLjQxMjE2NSA2NTYuMDc2Mzk2IDU1MC4yMjIwMjEgNjIzLjg4NTIzIDUxMC41ODMyMzMgNjIzLjg4NTIzIiBwLWlkPSIzNDYyIiBmaWxsPSIjZmZmZmZmIj48L3BhdGg+PC9zdmc+",a.classList.add("btn-img"),s.appendChild(a),n.appendChild(s),t.appendChild(e),t.appendChild(n)}setTitleBarBackgroundColor(t){this.setAttribute("background-color",t),this.shadowRoot.querySelector(".title-bar").style.backgroundColor=t}setTitleBarTextColor(t){this.setAttribute("text-color",t),this.shadowRoot.querySelector(".title-bar").style.color=t,this.shadowRoot.querySelectorAll(".btn-img").forEach(e=>{e.style.filter=`drop-shadow(80px 0 ${t})`})}setTitleBarText(t){this.setAttribute("text",t),this.shadowRoot.querySelector(".title-text").textContent=t}setTitleBarBackgroundOpacity(t){this.setAttribute("opacity",t),this.shadowRoot.querySelector(".title-text").style.backgroundOpacity=t}setMenuBtn(t){this.shadowRoot.querySelector(".menu").style.display=!0===t?"":"none"}setBackBtn(t){this.shadowRoot.querySelector(".back").style.display=!0===t?"":"none"}bindEvents(t){this.backBtn.addEventListener("click",function(){global.backPressPage(t.instanceId)||t.back()}),this.menuBtn.addEventListener("click",function(){global.menuPressPage(t.instanceId)})}})}};const gi={showTitleBar:!1,instance:null,createPageTitleBar(t,e){const n=document.createElement("h-titlebar");this.showTitleBar=!0,this.instance=n,n.bindEvents(e),this.updatePageTitleBar(t),document.body.appendChild(n)},updatePageTitleBar(t){if(t&&this.instance){const e=this.instance;t.text&&e.setTitleBarText(t.text),t.textColor&&e.setTitleBarTextColor(t.textColor),t.backgroundColor&&e.setTitleBarBackgroundColor(t.backgroundColor),t.backgroundOpacity&&e.setTitleBarBackgroundOpacity(t.backgroundOpacity),"boolean"==typeof t.menu&&e.setMenuBtn(t.menu),"boolean"==typeof t.back&&e.setBackBtn(t.back)}},reset(){this.instance=null,this.showTitleBar=!1}},yi={},bi={},vi=["scroller","hscroller","vscroller","list","hlist","vlist"];function Ei(t){this.id=t,this.batched=!1,this.updates=[],this.rootRef=1,this.componentMap={},this.tilebar=gi,yi[this.id]=this}Ei.getInstance=(t=>yi[t]),Ei.registerComponent=((t,e)=>{bi[t]=e}),Ei.getScrollableTypes=(()=>vi),Ei.prototype={getHapInstance(){return this._hapInstance||(this._hapInstance=global.hap?global.hap.getInstance(this.id):null),this._hapInstance},rendering(){function t(){window.dispatchEvent(new Event("renderend")),this._renderingTimer=null}this._renderingTimer?(clearTimeout(this._renderingTimer),this._renderingTimer=setTimeout(t.bind(this),800)):(window.dispatchEvent(new Event("renderbegin")),this._renderingTimer=setTimeout(t.bind(this),800))},getComponent(t){return this.componentMap[t]},removeComponent(t){const e=this;t&&this.componentMap[t]&&function t(n){const i=e.componentMap[n],o=i._listeners,r=i.data.children;if(r&&r.length)for(let e=0,n=r.length;e<n;e++)t(r[e].ref);if(o)for(const t in o)i.node.removeEventListener(t,o[t]);delete i._listeners,delete i.node._listeners,delete e.componentMap[n]}(t)},createFinish(t){global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Runtime ### createFinish---- "),window.dispatchEvent(new Event("createfinish"))},updateFinish(t){global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Runtime ### updateFinish---- "),window.dispatchEvent(new Event("updatefinish"))},refreshFinish(t){global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Runtime ### refreshFinish---- "),window.dispatchEvent(new Event("refreshfinish"))},createElement(t,e){let n=bi[t.type];n||(n=bi.div),t.instanceId=this.id;const i=new n(t,e=e||t.type),o=t.ref;return this.componentMap[o]=i,i.node.setAttribute("ref",o),i},createBody(t){const e=Ft(t,!0,!1,!0),n=e.children;delete e.children,this.rootRef=e.ref;const i=document.createElement("root");i.classList.add("root-container");const o=document.body;this.tilebar.showTitleBar&&(i.style.height=`calc(100% - ${this.tilebar.instance.getBoundingClientRect().height}px)`),o.appendChild(i);const r=this.createElement(e);e.style&&e.style.height||(r.node.style.minHeight="100%"),"canvas"===e.type&&(r.node.width=i.clientWidth,r.node.height=i.clientHeight),i.appendChild(r.node),n&&n.map(t=>{this.addElement(t,e.ref,-1)}),i._appended=!0},addNode(t,e,n){let i;if(e&&jt(e)||console.error(`### App Runtime ### addNode的parent(${e.type})必须是可渲染节点`),n<0&&(n=-1),t.nodeType===gt.NodeType.FIGMENT){let o=n;t.layoutChildren.every(t=>(i=t.nodeType===gt.NodeType.FIGMENT?this.addNode(t,e,o):this.addElement(t,e.ref,o),o+=$t(t),-1!==i))}else i=this.addElement(t,e.ref,n);return i},addElement(t,e,n){const i=this.componentMap[e];if(!i)return;const o=i.data.children;n>=0||(n=-1),o&&o.length&&o.length>n&&-1!==n?this.insertBefore(o[n].ref,Ft(t,!0,!1,!0)):this.appendChild(e,Ft(t,!0,!1,!0))},appendChild(t,e){let n=this.componentMap[t];if(this.componentMap[e.ref]||!n)return;"_root"!==t||n||((n=this.createElement({type:"root",rootId:"hap",ref:"_root"}))._appended=!0),e.props=n.data.props;const i=n.appendChild(e);return i&&(i.parentRef=t),n._appended=!0,i&&n._appended&&this.handleAppend(i),i},handleAppend(t){t._appended=!0,t.onAppend&&t.onAppend();const e=t.data.children;if(e)for(let t=0;t<e.length;t++){const n=this.componentMap[e[t].ref];n&&this.handleAppend(n)}!function(t){if(function(t){const e=t.data.event;return!(!e||-1===e.indexOf("appear")&&-1===e.indexOf("disappear"))}(t)&&(ci.push(t),!di)){di=!0;const t=oi(fi,100);window.addEventListener("scroll",t,!1)}}(t),t.fireLazyload()},removeNode(t){let e;return t.nodeType===gt.nodeType.FIGMENT?t.layoutChildren.every(t=>-1!==(e=t.nodeType===gt.nodeType.FIGMENT?this.removeNode(t):this.removeElement(t.ref))):e=this.removeElement(t.ref),e},removeElement(t){if(Xn(t))return t.map(t=>this.removeElement(t));const e=this.componentMap[t];if(this.rendering(),e&&e.parentRef){const t=this.componentMap[e.parentRef];e.onRemove&&e.onRemove(),t.removeChild(e),t.removeChildHandler()}else e?console.error(`### Web Render ### parent component '${e.parentRef}' does not exist.`):console.error(`### Web Render ### component of ref '${t}' does not exist.`)},moveNode(t,e,n){let i;if(e&&jt(e)||console.error("### App Runtime ### moveNode的parent必须是可渲染节点"),n>=0||(n=-1),t.nodeType===gt.NodeType.FIGMENT){let o=n;t.layoutChildren.every(t=>(i=t.nodeType===gt.NodeType.FIGMENT?this.moveNode(t,e,o):this.moveElement(t.ref,e.ref,o),o+=$t(t),-1!==i))}else i=this.moveElement(t.ref,e.ref,n);return i},moveElement(t,e,n){},insertBefore(t,e){let n,i;const o=this.componentMap[t];n=this.componentMap[e.ref],o&&(i=this.componentMap[o.parentRef]),!n&&i&&o&&(e.props=i.data.props,(n=this.createElement(e))&&(n.parentRef=o.parentRef,i.insertBefore(n,o),this.componentMap[o.parentRef]._appended&&this.handleAppend(n)))},setProp(t,e,n){const i={prop:{}};i.prop[e]=n;const o=this.componentMap[t];if(!o)return console.error(`[h5-render] component of ref '${t}' does not exist.`);o.updateProp(i)},setAttr(t,e,n){const i={};null==n?(console.warn(`### App Runtime ### 组件 ${t} 的属性 ${e} 被修改为 undefined/null, 自动修改为默认值或空值`),i[e]=""):i[e]=n;const o=this.componentMap[t];if(!o)return console.error(`### Web Render ### component of ref '${t}' does not exist.`);o.updateAttrs(i)},setStyle(t,e,n){const i={};null==n?(console.warn(`### App Runtime ### 组件 ${t} 的样式 ${e} 被修改为 undefined/null, 自动修改为默认值或空值`),i[e]=""):i[e]=n;const o=this.componentMap[t];if(!o)return console.error(`### Web Render ### component of ref '${t}' does not exist.`);o.updateStyle(i)},setStyles(t,e,n){const i=this.componentMap[t];if(!i)return console.error(`### Web Render ### component of ref '${t}' does not exist.`);i.updateStyle(e),i.updateAttrs(n)},setStyleObject(t,e,n,i,o){},addEvent(t,e){const n=this.componentMap[t];if(!n)return console.error(`### Web Render ### component of ref '${t}' does not exist.`);n.bindEvents([e])},removeEvent(t,e){const n=this.componentMap[t];if(!n)return console.error(`### Web Render ### component of ref '${t}' does not exist.`);n.unbindEvents([e])},updatePageTitleBar(t){this.tilebar.updatePageTitleBar(t)},exitFullscreen(){window.document.fullscreenElement?window.document.exitFullscreen():console.warn("==尚未进入全屏,无法退出==")},invokeComponentMethod(t,e,n,i){try{return global.callNativeComponent(this.id,e,n,i,{component:t})}catch(t){console.error(t)}},hasActions(){return!!this.actionLen}};const wi=[{newN:"t",oldN:"type",newV:["d","a","t","u","p","pe"],oldV:["descendant","attribute","tag","universal","pseudo","pseudo-element"]},{newN:"n",oldN:"name"},{newN:"i",oldN:"ignoreCase"},{newN:"a",oldN:"action"},{newN:"v",oldN:"value"}];const xi={};var Ti={init:function(){Object.freeze(ht),Object.freeze(ht.prototype),Object.freeze(xe),Object.freeze(xe.prototype),Object.freeze(Fe),Object.freeze(Fe.prototype),Object.freeze(Ce),Object.freeze(Ce.prototype),Object.freeze(Me),Object.freeze(Me.prototype),Object.freeze(Se),Object.freeze(Se.prototype),Object.freeze(De),Object.freeze(De.prototype),Object.freeze(gt),Object.freeze(gt.prototype),Object.freeze(we),Object.freeze(we.prototype),Object.freeze(Gt),Object.freeze(Gt.prototype),Object.freeze(Oe),Object.freeze(Oe.prototype)},Node:gt,Event:ht,TouchEvent:pt,helper:{registerComponents:Dt,getComponentDefaultOptions:Lt,bindComponentMethods:function(t){const e=Lt(t.tagName.toLowerCase());if(e&&e.methods){const n=e.methods.filter(t=>"animate"!==t);return n.forEach(function(n){t[n]||(t[n]=function(...i){const o=vt(t._docId);o?(o.invokeComponentMethod(e.name,t.ref,n,i),global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### 调用组件的方法:${e.name}.${n}()`,JSON.stringify(i))):console.warn(`### App Runtime ### 调用组件的方法无效:${e.name}.${n}(), 组件已销毁`)})}),n}return[]},createDocument:function(t){{const e=new Ei(t),n=new Fe(t,e);return global.Hap&&global.Hap.createInstance({appId:t}),n}},registerStyleObject:function(t,e,n,i){if(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### 基于节点(${i&&i.ref})注册样式节点(${n})`),!i._ownerDocument)return;const o=function(t,e){let n;const i=bt(t);return i&&i._styleObjectMap?(n=i._styleObjectMap.get(e))||(n=_t++,i._styleObjectMap.set(e,n)):(n=_t++,global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### 获取样式对象ID:文档(${t})已销毁,生成无缓存时的ID:${n}`)),n}(i._ownerDocument._docId,e);if(n||(i._styleObject=e,i._styleObjectId=o),e){!function(t){for(const e in t){const n=t[e];if(n&&n._meta&&n._meta.ruleDef){const t=n._meta.ruleDef;for(let e=0,n=t.length;e<n;e++){const n=t[e];for(let t=0,e=wi.length;t<e;t++){const e=wi[t];n.hasOwnProperty(e.newN)&&(n[e.oldN]=n[e.newN],delete n[e.newN],e.newV&&e.newV.indexOf(n[e.oldN])>-1&&(n[e.oldN]=e.oldV[e.newV.indexOf(n[e.oldN])]))}}}}}(e);const r=i._ownerDocument;if(function(t,e,n,i,o){t._styleSheetHash[e]=n,i?t._styleSheetHash[0].push(e):o._styleObjectId=e}(r,o,Xe(t,e),n,i),xi[r._docId]){if(!xi[r._docId]||xi[r._docId][t])return;xi[r._docId][t]=e}else xi[r._docId]={styleSheetName:e};const s=function(t){const e=Object.keys(t||{});let n="";for(let i=0,o=e.length;i<o;i++){const o=e[i],r=t[o];if(r&&"_"!==o[0]&&"@KEYFRAMES"===o)for(const t in r){n+=`@keyframes ${t} {\n`;for(let e=0,i=r[t].length;e<i;e++)n+=` ${r[t][e].time||0}% {\n`,Object.keys(r[t][e]).forEach(i=>{"time"!==i&&(n+=` ${i.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}: ${i.indexOf("transform")>-1?r[t][e][i].replace(/{"/g,"").replace(/":"|":/g,"(").replace(/"}|}/g,")").replace(/","|,"/g,") "):r[t][e][i]};\n`)}),n+=" }\n";n+="}\n"}}return n}(e);if(s){const e=global.document.createElement("style");e.type="text/css",e.innerHTML=s,e.setAttribute(`component-${t}`,""),global.document.head.appendChild(e)}}const r=vt(i._docId);r&&r.setStyleObject(i.ref,n,t,o,e)},createEvent:Ne,createFigment:function(t){const e=new Me;return e._ownerDocument=t,e},updatePageTitleBar:function(t,e){const n=vt(t._docId);n&&n.updatePageTitleBar(e)},updatePageStatusBar:function(t,e){const n=vt(t._docId);n&&n.updatePageStatusBar(e)},exitFullscreen:function(t){const e=vt(t._docId);e&&e.exitFullscreen()},setElementProp:function(t,e,n,i){if(!t._ownerDocument||"ref"===e)return;if(t[e]===n&&!1!==i)return;const o=t[e];t[e]=n,global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### 元素的内部属性(${e})更新(${o}=>${n})`);const r=vt(t._docId);r&&r.setProp(t.ref,e,n)},setElementAttr:Te,setElementStyle:function(t,e,n,i){t._ownerDocument&&(Pt(t)[e]===n&&!1!==i||(Pt(t)[e]=n,ke(t,i,"style",null,[e,n])))},setElementStyles:Ae,getElementMatchedCssRuleList:function(t,e){const n=Pt(t),i=[{editable:!0,styleSheetName:null,style:St(t._inlineStyleFullList,n)}],o=JSON.parse(JSON.stringify(i));return console.warn(`### App Runtime ### 获取样式:该平台版本仅支持获取节点${t.ref}的内联样式`),o},setElementMatchedCssRule:function(t,e,n){const i={},o=[];for(let t=0,e=n.length;t<e;t++){const e=n[t];o.push({name:e.name,value:e.value,disabled:e.disabled}),e.disabled||(i[e.name]=e.value)}"INLINE"===e?(Ae(t,i),t._inlineStyleFullList=o,global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### 更新样式:元素(${t.ref})的内联样式:${e}:${JSON.stringify(i)}`)):console.warn(`### App Runtime ### 更新样式:该平台版本仅支持更新内联样式,不支持:${e}`)},resetNodeChildren:function(t){for(let e=0,n=t.layoutChildren.length;e<n;e++){const n=t.layoutChildren[e];n._tmpRenderIndexInParent=Wt(n,t)}t.childNodes.length=0,t.layoutChildren.length=0},restoreNodeChildren:function(t,e){if(!e.parentNode||e.parentNode!==t)return;t.childNodes.push(e),t.layoutChildren.push(e);const n=Ht(t,!0);if(Bt(e)){const i=vt(t._docId),o=Yt(e),r=o!==e._tmpRenderIndexInParent;if(e._tmpRenderIndexInParent=null,i&&r)return i.moveNode(e,n,o)}},fireTargetEventListener:qt,clearTargetEventListener:function(t,e,n){n instanceof Object||(n={capture:!!n});const i=n.capture?ht.CAPTURING_PHASE:ht.BUBBLING_PHASE;t._eventTargetListeners[e]&&delete t._eventTargetListeners[e][i]},getDocumentNodeByRef:wt,isNodeInDocument:function(t){return!(!t||!t._docId)},recreateDocument:function(t){const e=t.body;e?t.listener.createBody(e):console.error("### App Runtime ### Document没有body节点, 无法重建")},destroyTagNode:function(t){switch(t.nodeType){case ft.DOCUMENT:!function(t){var e;global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Runtime ### 销毁文档"),delete t._nodeMap,delete t.listener,delete t._styleSheetHash,t._styleObjectMap&&t._styleObjectMap.clear(),delete t._styleObjectMap,t.documentElement&&Ut(t.documentElement),delete t.documentElement,delete t.body,delete t.childNodes,delete t.layoutChildren,Vt(t),e=t._docId,yt[e]=null}(t);break;case ft.ELEMENT:Ut(t);break;default:Vt(t)}},getNodeAsJSON:Ft,getNodeDepth:function(t){return t._depth}},exposure:{registerComponents:Dt}};const Ai=new Map([["forall","∀"],["part","∂"],["exists","∃"],["empty","∅"],["nabla","∇"],["isin","∈"],["notin","∉"],["ni","∋"],["prod","∏"],["sum","∑"],["minus","−"],["lowast","∗"],["radic","√"],["prop","∝"],["infin","∞"],["ang","∠"],["and","∧"],["or","∨"],["cap","∩"],["cup","∪"],["int","∫"],["there4","∴"],["sim","∼"],["cong","≅"],["asymp","≈"],["ne","≠"],["le","≤"],["ge","≥"],["sub","⊂"],["sup","⊃"],["nsub","⊄"],["sube","⊆"],["supe","⊇"],["oplus","⊕"],["otimes","⊗"],["perp","⊥"],["sdot","⋅"],["Alpha","Α"],["Beta","Β"],["Gamma","Γ"],["Delta","Δ"],["Epsilon","Ε"],["Zeta","Ζ"],["Eta","Η"],["Theta","Θ"],["Iota","Ι"],["Kappa","Κ"],["Lambda","Λ"],["Mu","Μ"],["Nu","Ν"],["Xi","Ν"],["Omicron","Ο"],["Pi","Π"],["Rho","Ρ"],["Sigma","Σ"],["Tau","Τ"],["Upsilon","Υ"],["Phi","Φ"],["Chi","Χ"],["Psi","Ψ"],["Omega","Ω"],["alpha","α"],["beta","β"],["gamma","γ"],["delta","δ"],["epsilon","ε"],["zeta","ζ"],["eta","η"],["theta","θ"],["iota","ι"],["kappa","κ"],["lambda","λ"],["mu","μ"],["nu","ν"],["xi","ξ"],["omicron","ο"],["pi","π"],["rho","ρ"],["sigmaf","ς"],["sigma","σ"],["tau","τ"],["upsilon","υ"],["phi","φ"],["chi","χ"],["psi","ψ"],["omega","ω"],["thetasym","ϑ"],["upsih","ϒ"],["piv","ϖ"],["middot","·"],["nbsp"," "],["quot","'"],["amp","&"],["lt","<"],["gt",">"],["OElig","Œ"],["oelig","œ"],["Scaron","Š"],["scaron","š"],["Yuml","Ÿ"],["fnof","ƒ"],["circ","ˆ"],["tilde","˜"],["ensp",""],["emsp",""],["thinsp",""],["zwnj",""],["zwj",""],["lrm",""],["rlm",""],["ndash","–"],["mdash","—"],["lsquo","‘"],["rsquo","’"],["sbquo","‚"],["ldquo","“"],["rdquo","”"],["bdquo","„"],["dagger","†"],["Dagger","‡"],["bull","•"],["hellip","…"],["permil","‰"],["prime","′"],["Prime","″"],["lsaquo","‹"],["rsaquo","›"],["oline","‾"],["euro","€"],["trade","™"],["larr","←"],["uarr","↑"],["rarr","→"],["darr","↓"],["harr","↔"],["crarr","↵"],["lceil","⌈"],["rceil","⌉"],["lfloor","⌊"],["rfloor","⌋"],["loz","◊"],["spades","♠"],["clubs","♣"],["hearts","♥"],["diams","♦"],["#8203",""]]);function ki(t){const e=new Map,n=t.split(",");for(let t=0;t<n.length;t++)e.set(n[t],!0);return e}function _i(t){return t.replace(/-([a-z])/g,function(t,e){return e.toUpperCase()})}function Ci(t){return t.replace(/([A-Z])/g,function(t,e){return"-"+e.toLowerCase()})}function Si(t,e){const n=[];if(e)switch(t.forEach((t,e)=>{n[e]={},n[e].n=t}),e.length){case 1:t.forEach((t,i)=>{n[i].v=e[0]});break;case 2:t.forEach((t,i)=>{n[i].v=i%2?e[1]:e[0]});break;case 3:t.forEach((t,i)=>{n[i].v=i%2?e[1]:e[i]});break;default:t.forEach((t,i)=>{n[i].v=e[i]})}return n}function Mi(t){return"number"==typeof t||"string"==typeof t}const Oi=/^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,Di=/^<\/([-A-Za-z0-9_]+)[^>]*>/,Li=/([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,Ii=ki("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"),Pi=ki("br,a,code,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"),Ni=ki("abbr,acronym,applet,b,basefont,bdo,big,button,cite,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"),Ri=ki("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),Fi=ki("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),Bi=ki("script,style,block");const ji=["NOTE","WARNING","ERROR"],Hi=new Map([["aliceblue","#F0F8FF"],["antiquewhite","#FAEBD7"],["aqua","#00FFFF"],["aquamarine","#7FFFD4"],["azure","#F0FFFF"],["beige","#F5F5DC"],["bisque","#FFE4C4"],["black","#000000"],["blanchedalmond","#FFEBCD"],["blue","#0000FF"],["blueviolet","#8A2BE2"],["brown","#A52A2A"],["burlywood","#DEB887"],["cadetblue","#5F9EA0"],["chartreuse","#7FFF00"],["chocolate","#D2691E"],["coral","#FF7F50"],["cornflowerblue","#6495ED"],["cornsilk","#FFF8DC"],["crimson","#DC143C"],["cyan","#00FFFF"],["darkblue","#00008B"],["darkcyan","#008B8B"],["darkgoldenrod","#B8860B"],["darkgray","#A9A9A9"],["darkgreen","#006400"],["darkgrey","#A9A9A9"],["darkkhaki","#BDB76B"],["darkmagenta","#8B008B"],["darkolivegreen","#556B2F"],["darkorange","#FF8C00"],["darkorchid","#9932CC"],["darkred","#8B0000"],["darksalmon","#E9967A"],["darkseagreen","#8FBC8F"],["darkslateblue","#483D8B"],["darkslategray","#2F4F4F"],["darkslategrey","#2F4F4F"],["darkturquoise","#00CED1"],["darkviolet","#9400D3"],["deeppink","#FF1493"],["deepskyblue","#00BFFF"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1E90FF"],["firebrick","#B22222"],["floralwhite","#FFFAF0"],["forestgreen","#228B22"],["fuchsia","#FF00FF"],["gainsboro","#DCDCDC"],["ghostwhite","#F8F8FF"],["gold","#FFD700"],["goldenrod","#DAA520"],["gray","#808080"],["green","#008000"],["greenyellow","#ADFF2F"],["grey","#808080"],["honeydew","#F0FFF0"],["hotpink","#FF69B4"],["indianred","#CD5C5C"],["indigo","#4B0082"],["ivory","#FFFFF0"],["khaki","#F0E68C"],["lavender","#E6E6FA"],["lavenderblush","#FFF0F5"],["lawngreen","#7CFC00"],["lemonchiffon","#FFFACD"],["lightblue","#ADD8E6"],["lightcoral","#F08080"],["lightcyan","#E0FFFF"],["lightgoldenrodyellow","#FAFAD2"],["lightgray","#D3D3D3"],["lightgreen","#90EE90"],["lightgrey","#D3D3D3"],["lightpink","#FFB6C1"],["lightsalmon","#FFA07A"],["lightseagreen","#20B2AA"],["lightskyblue","#87CEFA"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#B0C4DE"],["lightyellow","#FFFFE0"],["lime","#00FF00"],["limegreen","#32CD32"],["linen","#FAF0E6"],["magenta","#FF00FF"],["maroon","#800000"],["mediumaquamarine","#66CDAA"],["mediumblue","#0000CD"],["mediumorchid","#BA55D3"],["mediumpurple","#9370DB"],["mediumseagreen","#3CB371"],["mediumslateblue","#7B68EE"],["mediumspringgreen","#00FA9A"],["mediumturquoise","#48D1CC"],["mediumvioletred","#C71585"],["midnightblue","#191970"],["mintcream","#F5FFFA"],["mistyrose","#FFE4E1"],["moccasin","#FFE4B5"],["navajowhite","#FFDEAD"],["navy","#000080"],["oldlace","#FDF5E6"],["olive","#808000"],["olivedrab","#6B8E23"],["orange","#FFA500"],["orangered","#FF4500"],["orchid","#DA70D6"],["palegoldenrod","#EEE8AA"],["palegreen","#98FB98"],["paleturquoise","#AFEEEE"],["palevioletred","#DB7093"],["papayawhip","#FFEFD5"],["peachpuff","#FFDAB9"],["peru","#CD853F"],["pink","#FFC0CB"],["plum","#DDA0DD"],["powderblue","#B0E0E6"],["purple","#800080"],["red","#FF0000"],["rosybrown","#BC8F8F"],["royalblue","#4169E1"],["saddlebrown","#8B4513"],["salmon","#FA8072"],["sandybrown","#F4A460"],["seagreen","#2E8B57"],["seashell","#FFF5EE"],["sienna","#A0522D"],["silver","#C0C0C0"],["skyblue","#87CEEB"],["slateblue","#6A5ACD"],["slategray","#708090"],["slategrey","#708090"],["snow","#FFFAFA"],["springgreen","#00FF7F"],["steelblue","#4682B4"],["tan","#D2B48C"],["teal","#008080"],["thistle","#D8BFD8"],["tomato","#FF6347"],["turquoise","#40E0D0"],["violet","#EE82EE"],["wheat","#F5DEB3"],["white","#FFFFFF"],["whitesmoke","#F5F5F5"],["yellow","#FFFF00"],["yellowgreen","#9ACD32"]]),$i=["px","%"],zi=/^[-+]?[0-9]*\.?[0-9]+(.*)$/,Yi=/^#[0-9a-fA-F]{6}$/,Wi=/^#[0-9a-fA-F]{3}$/,Vi=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,Ui=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d*\.?\d+)\s*\)$/,qi=/^hsl\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*\)$/,Gi=/^hsla\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d*\.?\d+)\s*\)$/,Ji=/^[-+]?[0-9]+$/,Ki=/^url\(\s*['"]?\s*([^()]+?)\s*['"]?\s*\)$/,Zi=/^[a-zA-Z_][a-zA-Z0-9]*$/,Qi=/^[-+]?[0-9]*\.?[0-9]+$/,Xi={length:function(t,e){const n=(t=(t||"").toString()).match(zi);if(e||(e=$i),n){const i=n[1];return i?e.indexOf(i.toLowerCase())>=0?{value:t}:{value:parseFloat(t)+e[0],reason:function(t,n,o){return"ERROR: 属性 `"+Ci(t)+"` 不支持单位 `"+i+"`, 目前仅支持 `"+JSON.stringify(e)+"`"}}:{value:parseFloat(t)+e[0],reason:function(t,n,i){return"WARNING: 属性 `"+Ci(t)+"` 没有指定单位,默认为 `"+e[0]+"`"}}}return{value:null,reason:function(t,e,n){return"ERROR: 属性 `"+Ci(t)+"` 的值 `"+e+"` 不正确(仅支持数值)"}}},color:function(t){if((t=(t||"").toString()).match(Yi))return{value:t};if(t.match(Wi))return{value:"#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3],reason:function(t,e,n){return"NOTE: 颜色值 `"+e+"` 转换为 `"+n+"`"}};if(Hi.get(t))return{value:Hi.get(t),reason:function(t,e,n){return"NOTE: 颜色值 `"+e+"` 转换为 `"+n+"`"}};let e,n,i,o,r,s,a,l;return(e=Vi.exec(t))&&(n=parseInt(e[1]),i=parseInt(e[2]),o=parseInt(e[3]),n>=0&&n<=255&&i>=0&&i<=255&&o>=0&&o<=255)?{value:"rgb("+[n,i,o].join(",")+")"}:(e=Ui.exec(t))&&(n=parseInt(e[1]),i=parseInt(e[2]),o=parseInt(e[3]),r=parseFloat(e[4]),n>=0&&n<=255&&i>=0&&i<=255&&o>=0&&o<=255&&r>=0&&r<=1)?{value:"rgba("+[n,i,o,r].join(",")+")"}:(e=qi.exec(t)||Gi.exec(t))&&(s=parseInt(e[1]),a=parseInt(e[2]),l=parseInt(e[3]),r=parseFloat(e[4]),s>=0&&s<=360&&a>=0&&a<=100&&l>=0&&l<=100)?r>=0&&r<=1?{value:`hsla(${s},${a}%,${l}%,${r})`}:{value:`hsl(${s},${a}%,${l}%)`}:"transparent"===t?{value:"rgba(0,0,0,0)"}:{value:null,reason:function(t,e,n){return"ERROR: 属性`"+Ci(t)+"` 的颜色值 `"+e+"` 无效`"}}},number:function(t){const e=(t=(t||"").toString()).match(Qi);return e&&!e[1]?{value:parseFloat(t)}:{value:null,reason:function(t,e,n){return"ERROR: 属性`"+Ci(t)+"` 的值 `"+e+"` 无效 ` (仅支持数值)"}}},integer:function(t){return(t=(t||"").toString()).match(Ji)?{value:parseInt(t,10)}:{value:null,reason:function(t,e,n){return"ERROR: 属性`"+Ci(t)+"` 的值 `"+e+"` 无效 ` (仅支持整数)"}}},url:function(t){if((t=(t||"").toString().trim()).match(/^none$/i))return{value:"none"};const e=Ki.exec(t);return e?{value:e[1]}:{value:null,reason:function(t,e,n){return"WARNING: 属性`"+Ci(t)+"` 的值 `"+e+"` 必须是 none 或者 url(...)"}}},name:function(t){return(t=(t||"").toString()).match(Zi)?{value:t}:{value:null,reason:function(t,e,n){return"ERROR: 属性`"+Ci(t)+"` 的值 `"+e+"` 格式不正确"}}},enum:function(t,e){const n=t.indexOf(e);return n>0?{value:e}:0===n?{value:e,reason:function(t,e,n){return"NOTE: 属性`"+Ci(t)+"` 的值 `"+e+"` 是缺省值(可以忽略不写)"}}:{value:null,reason:function(e,n,i){return"ERROR: 属性`"+Ci(e)+"` 的值 `"+n+"` 无效 ` (有效枚举值为: `"+t.join("`|`")+"`)"}}},arraylength:function(t,e,n){const i=(e=(e||"").toString()).split(/\s+/);if(i&&i.length<=4){const e=[];let o;const r=[];let s=0;return i.forEach((t,i)=>{if(Mi((o=Xi.length(t,n)).value)&&e.push(o.value),o.reason){let e=o.reason(i.toString(),t,o.value);const n=e.match(/^([A-Z]+):/);if(n){const t=ji.indexOf(n[1]);s<ji.indexOf(n[1])&&(s=t),e=e.replace(n[0],"").trim()}r.push(e)}}),{value:s<2?Si(t,e):null,reason:r.length>0?function(t,e,n){return ji[s]+": 属性`"+Ci(t)+"` 的值 `"+e+"` 存在问题: \n "+r.join("\n ")}:null}}return{value:null,reason:function(t,e,n){return"ERROR: 属性`"+Ci(t)+"` 的值 `"+e+"` 格式不正确"}}},arraycolor:function(t,e){const n=(e=(e||"").toString()).split(/\s+/);if(n&&n.length<=4){const e=[];let i;const o=[];let r=0;return n.forEach((t,n)=>{if(Mi((i=Xi.color(t)).value)&&e.push(i.value),i.reason){let e=i.reason(n.toString(),t,i.value);const s=e.match(/^([A-Z]+):/);if(s){const t=ji.indexOf(s[1]);r<ji.indexOf(s[1])&&(r=t),e=e.replace(s[0],"").trim()}o.push(e)}}),{value:r<2?Si(t,e):null,reason:o.length>0?function(t,e,n){return ji[r]+": 属性`"+Ci(t)+"` 的值 `"+e+"` 存在问题: \n "+o.join("\n ")}:null}}return{value:null,reason:function(t,e,n){return"ERROR: 属性`"+Ci(t)+"` 的值 `"+e+"` 格式不正确"}}},border:function(t,e){const n=(t=(t||"").toString()).split(/\s+/);if(n&&n.length<=3){let t,i=[];const o=[];let r=0;const s=[];let a=-1;return n.forEach((n,a)=>{if(Mi(Xi.length(n,e).value)?(s.push(0),(t=no.borderWidth(n)).value instanceof Array&&(i=i.concat(t.value))):Mi(no.borderStyle(n).value)?(s.push(1),t=no.borderStyle(n),i.push({n:"borderStyle",v:n})):Mi(Xi.color(n).value)?(s.push(2),(t=no.borderColor(n)).value instanceof Array&&(i=i.concat(t.value))):(t={},r=2,o.push("属性`"+a+"` 的值 `"+n+"` 存在问题: \n 不满足width、style和color的检验标准")),t&&t.reason){let e=t.reason(a.toString(),n,t.value);const i=e.match(/^([A-Z]+):/);if(i){const t=ji.indexOf(i[1]);r<ji.indexOf(i[1])&&(r=t),e=e.replace(i[0],"").trim()}o.push(e)}}),s.forEach(t=>{t>a?a=t:(r=2,o.push("必须按顺序设置属性width style color"))}),{value:r<2?i:null,reason:o.length>0?function(t,e,n){return ji[r]+": 属性`"+Ci(t)+"` 的值 `"+e+"` 存在问题: \n "+o.join("\n ")}:null}}return{value:null,reason:function(t,e,n){return"ERROR: 属性`"+Ci(t)+"` 的值 `"+e+"` 格式不正确"}}},display:function(t){t=(t||"").toString();const e=["flex","none"],n=e.indexOf(t);return n>0?{value:t}:"block"===t?{value:"flex",reason:function(t,n,i){return"ERROR: 属性`"+Ci(t)+"` 的值 `"+n+"` 需修改为flex ` (有效枚举值为: `"+e.join("`|`")+"`)"}}:0===n?{value:t,reason:!1}:{value:null,reason:function(t,n,i){return"ERROR: 属性`"+Ci(t)+"` 的值 `"+n+"` 无效 ` (有效枚举值为: `"+e.join("`|`")+"`)"}}}};function to(t){return Xi.enum.bind(null,t)}function eo(t,e){return Xi[t].bind(null,e)}const no={width:Xi.length,height:Xi.length,padding:eo("arraylength",["paddingTop","paddingRight","paddingBottom","paddingLeft"]),paddingLeft:Xi.length,paddingRight:Xi.length,paddingTop:Xi.length,paddingBottom:Xi.length,margin:eo("arraylength",["marginTop","marginRight","marginBottom","marginLeft"]),marginLeft:Xi.length,marginRight:Xi.length,marginTop:Xi.length,marginBottom:Xi.length,border:Xi.border,borderWidth:eo("arraylength",["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"]),borderLeftWidth:Xi.length,borderTopWidth:Xi.length,borderRightWidth:Xi.length,borderBottomWidth:Xi.length,borderColor:eo("arraycolor",["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),borderLeftColor:Xi.color,borderTopColor:Xi.color,borderRightColor:Xi.color,borderBottomColor:Xi.color,borderStyle:to(["solid","dotted","dashed"]),borderRadius:Xi.length,borderBottomLeftRadius:Xi.length,borderBottomRightRadius:Xi.length,borderTopLeftRadius:Xi.length,borderTopRightRadius:Xi.length,flex:Xi.number,flexGrow:Xi.number,flexShrink:Xi.number,flexBasis:Xi.length,flexDirection:to(["row","column"]),flexWrap:to(["nowrap","wrap","wrap-reverse"]),justifyContent:to(["flex-start","flex-end","center","space-between"]),alignItems:to(["stretch","flex-start","flex-end","center"]),alignContent:to(["stretch","flex-start","flex-end","center","space-between","space-around"]),position:to(["none","fixed"]),top:Xi.length,bottom:Xi.length,left:Xi.length,right:Xi.length,zIndex:Xi.integer,opacity:Xi.number,backgroundColor:Xi.color,backgroundImage:Xi.url,backgroundRepeat:to(["no-repeat","repeat","repeat-x","repeat-y"]),backgroundPosition:Xi.position,display:Xi.display,visibility:to(["visible","hidden"]),lines:Xi.integer,color:Xi.color,fontSize:Xi.length,fontStyle:to(["normal","italic"]),fontWeight:to(["normal","bold"]),textDecoration:to(["none","underline","line-through"]),textAlign:to(["left","center","right"]),lineHeight:Xi.length,textOverflow:to(["clip","ellipsis"]),placeholderColor:Xi.color,selectedColor:Xi.color,textColor:Xi.color,timeColor:Xi.color,textHighlightColor:Xi.color,strokeWidth:Xi.length,progressColor:Xi.color,resizeMode:to(["cover","contain","stretch","center"]),columns:Xi.number,columnSpan:Xi.number};function io(t,e){const n={},i=[],o=function(t,e){let n,i;const o=no[t];return"function"==typeof o?(n="function"!=typeof e?o(e):{value:e}).reason&&(i={reason:n.reason(t,e,n.value)}):(n={value:e},i={reason:"ERROR: 样式名 `"+Ci(t)+"` 不支持"}),{value:n.value instanceof Array?n.value:[{n:t,v:n.value}],log:i}}(_i(t),e);return o.value.forEach(t=>{Mi(t.v)&&i.push(t)}),i&&(n.value=i),o.log&&(n.log=o.log.reason),n}const oo=new Map([["img","image"],["p","text"],["h1","text"],["h2","text"],["h3","text"],["h4","text"],["h5","text"],["h6","text"],["b","span"],["strong","span"],["i","span"],["del","span"],["article","div"],["br","span"]]);function ro(t){const e=oo.get(t);return void 0!==e?e:t}const so={div:{},h1:{fontSize:"60px",fontWeight:"normal"},h2:{fontSize:"45px",fontWeight:"normal"},h3:{fontWeight:"normal",fontSize:"35px"},h4:{fontWeight:"normal",fontSize:"30px"},h5:{fontWeight:"normal",fontSize:"25px"},h6:{fontWeight:"normal",fontSize:"20px"},b:{fontWeight:"bold"},strong:{fontWeight:"bold"},i:{fontStyle:"italic"},a:{color:"#00BFFF"},del:{textDecoration:"line-through"}};function ao(t){let e={};return so[t]&&(e=so[t]),e}const lo={br:{value:"\n"}};function co(t){let e={};return lo[t]&&(e=lo[t]),e}function ho(t,e,n){const i="html"!==e,o="edit"===n;t=function(t){return t.replace(/<\?xml.*\?>\n/,"").replace(/<.*!doctype.*>\n/,"").replace(/<.*!DOCTYPE.*>\n/,"")}(t),t=t.replace(/&([a-zA-Z#0-9]+?);/g,(t,e)=>Ai.get[e]||"&"+e+";").replace(/\r\n?/g,"");const r=[],s={type:"div",children:[],events:{},classList:[],attr:{},style:{flex:1,flexDirection:"column"}};return function(t,e){let n,i,o;const r=[];let s=t;for(r.last=function(){return this[this.length-1]};t;){if(i=!0,r.last()&&Bi.has(r.last()))t=t.replace(new RegExp("([\\s\\S]*?)(</"+r.last()+"[^>]*>)","i"),function(t,n){return n=n.replace(/<!--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1"),e.text&&e.text(n),""}),l(0,r.last());else if(0===t.indexOf("\x3c!--")?(n=t.indexOf("--\x3e"))>=0&&(e.comment&&e.comment(t.substring(4,n)),t=t.substring(n+3),i=!1):0===t.indexOf("</")?(o=t.match(Di))&&(t=t.substring(o[0].length),o[0].replace(Di,l),i=!1):0===t.indexOf("<")&&(o=t.match(Oi))&&(t=t.substring(o[0].length),o[0].replace(Oi,a),i=!1),i){n=t.indexOf("<");let i="";for(;0===n;)i+="<",n=(t=t.substring(1)).indexOf("<");i+=n<0?t:t.substring(0,n),t=n<0?"":t.substring(n),e.text&&e.text(i)}t===s&&console.error("### App Parser ### 解析错误: "+t),s=t}function a(t,n,i,o){if(n=n.toLowerCase(),Pi.has(n))for(;r.last()&&Ni.has(r.last());)l(0,r.last());if(Ri.has(n)&&r.last()===n&&l(0,n),(o=Ii.has(n)||!!o)||r.push(n),e.start){const t=[];i.replace(Li,function(e,n){const i=arguments[2]?arguments[2]:arguments[3]?arguments[3]:arguments[4]?arguments[4]:Fi.has(n)?n:"";t.push({name:n,value:i,escaped:i.replace(/(^|[^\\])"/g,'$1\\"')})}),e.start&&e.start(n,t,o)}}function l(t,n){let i=0;if(n)for(n=n.toLowerCase(),i=r.length-1;i>=0&&r[i]!==n;i--);if(i>=0){for(let t=r.length-1;t>=i;t--)e.end&&e.end(r[t]);r.length=i}}l()}(t,{start:function(t,e,n){const a={type:i?t:ro(t),children:[],events:{},classList:[],attr:i?{}:co(t),style:i?{}:ao(t)};if(0!==e.length&&(a.attr=e.reduce(function(t,e){const n=_i(e.name);let i=e.value;return"class"===n?a.classList=i.split(/\s+/):"style"===n?i.split(";").forEach(function(t){let e,n,i=t.trim().split(":");i.length>2&&(i[1]=i.slice(1).join(":"),i=i.slice(0,2)),2===i.length&&((n=io(e=i[0].trim(),i[1].trim())).value&&n.value.forEach(t=>{Mi(t.v)&&(a.style[t.n]=t.v)}),n.log&&console.warn("### App Parser ###",n.log))}):"id"===n?a.id=i:o?t[n]=i:(i.match(/ /)&&(i=i.split(" ")),t[n]?Array.isArray(t[n])?t[n].push(i):t[n]=[t[n],i]:t[n]=i),t},{})),i||"source"!==a.type||(s.source=a.attr.src),n){const t=r[0]||s;void 0===t.children&&(t.children=[]),t.children.push(a)}else r.unshift(a)},end:function(t){const e=i?t:ro(t),n=r.shift();if(n.type!==e&&console.error("### App Parser ### 结束标签不匹配:",t),!i&&"video"===n.type&&s.source&&(n.attr.src=s.source,delete s.source),0===r.length)s.children.push(n);else{const t=r[0];void 0===t.children&&(t.children=[]),t.children.push(n)}},text:function(t){if(""!==t.slice().replace(/\s*/,"")){const e=r[0];if(!o||e&&-1!==["text","a","span"].indexOf(e.type)){if(e)if(-1!==["text","a"].indexOf(e.type)){const n={type:"span",children:[],events:{},classList:[],attr:{value:t},style:{},polyfill:!0};void 0===e.children&&(e.children=[]),e.children.push(n)}else e.attr.value=t}else{const n={type:"text",children:[],events:{},classList:[],attr:{value:t},style:{}};(e||s).children.push(n)}}},comment:function(t){}}),global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Parser ### 解析${e}文本成功:${JSON.stringify(s)}`),s}var po={compile:ho,parseHTML:function(t){const e=ho(t,"","edit");return function t(e){if(e.children){-1!==["text","a"].indexOf(e.type)&&(e.children.length>0&&delete e.attr.value,1===e.children.length&&e.children[0].polyfill&&(e.attr=Object.assign(e.attr,e.children[0].attr),e.children=[]));for(let n=0,i=e.children.length;n<i;n++){const i=e.children[n];t(i)}}}(e),e.children||[]}};var uo={compile:function(t,e){return""===(t=t.trim())&&(t="<div></div>"),po.compile(t,e)},validateStyle:io,parseHTML:po.parseHTML};const fo={initApp:"quickapp.app.initApp",initPage:"quickapp.page.initPage",destroyPage:"quickapp.page.destroyPage",fireEvent:"quickapp.page.fireEvent",onShow:"quickapp.page.onShow",onHide:"quickapp.page.onHide",onBackPress:"quickapp.page.onBackPress",onMenuPress:"quickapp.page.onMenuPress",onOrientationChange:"quickapp.page.onOrientationChange",onRefresh:"quickapp.page.onRefresh",callbackDone:"quickapp.page.callbackDone"};class mo{constructor(t,e){if(e instanceof mo)return e;this.timestamp=Date.now(),this.detail=e,this.type=t;let n=!1;this.stop=function(){n=!0},this.hasStopped=function(){return n}}}const go=["onCreate","onInit","onReady","onShow","onHide","onDestroy","onBackPress","onMenuPress","onOrientationChange"];mo.reserveEvents=go,mo.isReservedEvent=function(t){return go.indexOf(t)>=0};const yo=750,bo=320;const vo={};Object.setPrototypeOf(vo,new class{constructor(){this.eventMap={}}subscribe(t,e,n){if(n&&n.once){const n=i=>{e(i),this.remove(t,n)};return this.subscribe(t,n)}if(this.eventMap[t]=this.eventMap[t]||[],"function"==typeof e){const n=this.eventMap[t];-1===n.indexOf(e)&&n.push(e)}}publish(t,e,n){let i=null;const o=this.eventMap[t]||[];for(let t=0,n=o.length;t<n;t++)i=o[t](e,i);return i}remove(t,e){if(!this.eventMap[t])return;const n=this.eventMap[t],i=n.indexOf(e);i>-1&&n.splice(i,1)}});let Eo=null;class wo extends it{constructor(t,e,n){super(...arguments),this._isApp=!0,this.options=e||{},this.name="",this.entry="",this.customComponentMap={},this.designWidth=yo,this._def=null,this._data={},this._events={},this._status=null,this._shareDocStyle=!1,this._css=n}$clear(){this.options={},this.name="",this.customComponentMap={},this.designWidth=yo,this._def=null,this._data={},this._events={},this.destroy()}get $data(){return D(this._data)||(this._data={}),this._data}set $data(t){const e="function"==typeof t?t():t;e?(this._data=this._data||{},Object.keys(e).forEach(t=>{N(t)?console.error(`### App Framework ### 页面数据属性名 '${t}' 非法, 属性名不能以$或_开头`):(t in this._data&&console.warn(`### App Framework ### App 全局数据 (${t}) 被覆盖`),this._data[t]=e[t])})):(this._data={},console.warn("### App Framework ### App 全局数据被清空"))}get $def(){return this._def}set $def(t){global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### App 元数据初始化----"),this._def=t,t.plugins||(t.plugins=[]),this._def&&(this._def.style=this._def.style||this._css);const e=t.manifest;if(global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### App 元数据manifest----",JSON.stringify(e)),e){this.name=e.name;const t=e.config;global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### App 元数据config----",JSON.stringify(t)),t&&(this.$data=t.data,this.designWidth=t.designWidth||yo,this.designWidth<bo&&(this.designWidth=bo),this._shareDocStyle=!!t.shareDocStyle);const n=e.router;global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### App 元数据router----",JSON.stringify(n)),n&&(this.entry=n.entry||"")}for(const e in t){"function"!=typeof t[e]||mo.isReservedEvent(e)||(this[e]=t[e])}this.$on("applc:onCreate",function(t){this._status=t.type.toLowerCase().replace(/.*:on/,"")}),this.$on("applc:onDestroy",function(t){this._status=t.type.toLowerCase().replace(/.*:on/,"")}),mo.reserveEvents.forEach(e=>{this.$on(`applc:${e}`,t[e])}),this._defined=!0}get $status(){return this._status}get $valid(){return"create"===this._status}$emit(t,e){const n=this._events[t];if(n)for(let i=0;i<n.length;i++){const o=new mo(t,e);n[i].call(this,o)}}$on(t,e){if(!t||"function"!=typeof e)return;const n=this._events;n[t]=n[t]||[],n[t].push(e)}$off(t){if(!t)return;delete this._events[t]}exit(){null===Eo&&(Eo=vo.platform.requireModule(this,"system.app")),Eo.exit(this.id)}}Object.freeze(wo),Object.freeze(wo.prototype);class xo extends it{constructor(t,e,n,i,o,r){super(...arguments),this._isPage=!0,this.app=e,this.name=null,this.vm=null,this.intent=n,this.doc=vo.runtime.helper.createDocument(t),this.doc.designWidth=this.app.designWidth,this._valid=!0,this._visible=!1,this._meta=Object.assign({query:o},n,i),this._orientation=n.orientation,e.$def&&e.$def.style&&this._registerAppCss(e.$def.style),r&&this._registerPageCss(r)}_registerAppCss(t){const e=t&&t.list||[];for(let t=0,n=e.length;t<n;t++)vo.runtime.helper.registerStyleObject("app",e[t],!0,this.doc.documentElement)}_registerPageCss(t){const e=t&&t.list||[];for(let t=0,n=e.length;t<n;t++)vo.runtime.helper.registerStyleObject("index",e[t],!0,this.doc.documentElement)}get $valid(){return this._valid}get $visible(){return this._valid&&this._visible}get orientation(){return this._orientation}get pageName(){return this._meta.name}get pageComponent(){return this._meta.component}get query(){return this._meta.query}invoke(...t){super.invoke(...t),this.$valid&&vo.publish(fo.callbackDone,[this])}}function To(t,e,n=[],i){if(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 调用页面(${t.id})的回调(${e}) 参数:`,JSON.stringify(n)),!t._callbacks)return new Error(`invoke: 回调函数 "${e}" 没有注册`);if(!t.$valid)return void console.error(`invoke: 回调函数所属对象(${t.id})已经无效, 终止回调执行`);const o=t._callbacks[e];if("function"==typeof o){const r=o(...n);return void 0!==i&&!1!==i||(t._callbacks[e]=void 0),t.doc&&vo.publish(fo.callbackDone,[t]),r}return new Error(`callback: 无效回调函数Id "${e}"`)}function Ao(t,e){switch(w(t)){case"undefined":case"null":return"";case"regexp":return t.toString();case"date":return t.toISOString();case"number":case"string":case"boolean":case"array":return t;case"object":if(t.nodeType)return t.ref;const n={};for(const i in t)n[i]=Ao(t[i],e);return n;case"function":const i=Y();return e._callbacks?e._callbacks[i]=t:global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### normalize() 页面已经销毁,不再注册回调"),i.toString();default:return JSON.stringify(t)}}let ko={};const _o={},Co={},So={};function Mo(t){So[t]=function(...e){for(const n in ko){const i=ko[n];i&&i[t]&&i[t](...e)}}}function Oo(t){So[t]="createApplication"===t?function(e,n,i){let o=_o[e];return o?new Error(`Runtime ${t}:无效应用id "${e}"`):(o={framework:"xFramework",created:Date.now()},_o[e]=o,console.log(`### App Framework ### 创建应用 ${e}---- 框架: ${o.framework} 版本: ${global.frameworkVersion}`),ko[o.framework].createApplication(e,n,i))}:"destroyApplication"===t?function(e){const n=_o[e];if(n&&ko[n.framework]){const t=ko[n.framework].destroyApplication(e);return _o[e]=null,t}return new Error(`Runtime ${t}:无效应用Id: "${e}"`)}:function(...e){const n=e[0],i=_o[n];return i&&ko[i.framework]?ko[i.framework][t](...e):new Error(`Runtime ${t}:无效应用Id: "${n}"`)}}function Do(t){let e,n;"string"==typeof t?e=t:t.length&&t.length>1&&(e=t[0],n=t[1]),"createPage"===e?So[e]=function(t,n,i,o,r,s,a){const l=_o[n];if(!l)return new Error(`Runtime ${e}:无效应用id "${n}"`);let c=Co[t];return c?new Error(`Runtime ${e}:无效页面id "${t}"`):(c={appId:n,created:Date.now()},Co[t]=c,console.log(`### App Framework ### 创建页面 ${t}----应用Id: ${n}`),ko[l.framework].createPage(t,n,i,o,r,s,a))}:(So[e]=function(...n){const i=n[0],o=Co[i];if(o){const r=_o[o.appId];if(r&&ko[r.framework]){const o=ko[r.framework][e](...n);return"destroyPage"===t&&(Co[i]=null),o}return new Error(`Runtime ${e}:无效应用Id: "${o.appId}"`)}return"backPressPage"===t?(console.error(`### App Framework ### backPressPage 无效页面Id: "${i}"`),!1):new Error(`Runtime ${e}:无效页面Id: "${i}"`)},n&&(So[n]=function(...t){const n=t[0],i=Co[n];if(i){const o=_o[i.appId];return o&&ko[o.framework]?ko[o.framework][e](...t):new Error(`Runtime ${e}:无效页面Id: "${n}"`)}}))}const Lo=["registerDsl","locateDsl"],Io=["createApplication","getAppConfig","notifyAppError","destroyApplication"],Po=["createPage","destroyPage","recreatePage","changeVisiblePage","backPressPage","menuPressPage","orientationChangePage","refreshPage",["processCallbacks","execJSBatch"],"getPage","getPageRoot","getPageElementStyles","setPageElementStyles","setPageElementAttrs","replacePageElementWithHtml"];const No={},Ro={};function Fo(t){let e=t;"string"==typeof t&&(e=E({},`${t}; return dsl;`)),function(t){t.init(vo)}(e)}const Bo={1:(t,...e)=>(function t(e,n,i,o,r){if(!e.$valid)return new Error("fireEvent: 只有Page才能发送Dom事件");if(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 向页面(${e.id}) 的节点(${n})发送事件 "${i}"---- ${JSON.stringify(r)}`),Array.isArray(n))return void n.some(n=>!1!==t(e,n,i,o));return vo.publish(fo.fireEvent,[e,n,i,o,r])})(t,...e),2:(t,...e)=>To(t,...e)};const jo={config:vo,init:function(t){vo.platform=t.platform,vo.runtime=t.runtime,vo.dock=t.dock,function(t){ko={xFramework:t.dock},Lo.forEach(Mo),Io.forEach(Oo),Po.forEach(Do)}(t)},locateDsl:function(){let t=global.getManifestField("config.dsl.name");t||(global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 无法从manifest找到对应的dsl名称"),t="xvm");let e=vo.platform.loadResource("dsl.js");e?global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 从安装包中获取dsl"):(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 从平台中获取dsl-${t}`),e=vo.platform.loadResource(`assets:///js/dsls/dsl-${t}.js`)),Fo(e)},registerDsl:Fo,createApplication:function(t,e,n){let i,o=No[t];return n=JSON.parse(n||null),o?i=new Error(`createApplication: 无效应用Id "${t}"`):(global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 平台配置信息:",JSON.stringify(global.Env)),o=new wo(t,{},n),No[t]=o,i=vo.publish(fo.initApp,[o,e])),i},notifyAppError:function(t,e){const n=No[t];if(n){if(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### notifyAppError 应用(${t})响应`),n.$def&&"function"==typeof n.$def.onError)try{n.$def.onError.call(n,e)}catch(t){throw t.message=`$INTERRUPTION$:${t.message}`,t}}else console.error(`### App Framework ### notifyAppError 应用(${t})无效`)},destroyApplication:function(t){const e=No[t];return e?(function(t){t.$emit("applc:onDestroy"),t.$clear(),global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 成功销毁应用(${t.id})----`)}(e),No):new Error(`destroyApplication: 无效应用Id "${t}"`)},createPage:function(t,e,n,i,o,r,s){const a=No[e];if(!a)return new Error(`createPage: 无效应用Id "${e}"`);i=i||{},s=JSON.parse(s||null);let l,c=Ro[t];if(c)l=new Error(`createPage: 无效页面Id "${t}"`);else{global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 创建页面(${t})---- `,JSON.stringify(o)),c=new xo(t,a,o,r,i,s),Ro[t]=c;const e=function(t,e,n){const i=t,o={};return{setTimeout:function(t,r){const s=n(t,i),a=global.setTimeoutWrap(i.id,function(){e(i,s)},r||0);return o[a.toString()]=s,a.toString()},setInterval:function(t,r){const s=n(t,i),a=global.setIntervalWrap(i.id,function(){e(i,s,[],!0)},r||0);return o[a.toString()]=s,a.toString()},clearTimeout:function(t){global.clearTimeoutWrap(t),o[t]=void 0},clearInterval:function(t){global.clearIntervalWrap(t),o[t]=void 0},requestAnimationFrame:function(t){const r=n(t,i),s=global.requestAnimationFrameWrap(i.id,function(){e(i,r)});return o[s.toString()]=r,s.toString()},cancelAnimationFrame:function(t){global.cancelAnimationFrameWrap(t),o[t]=void 0}}}(c,To,Ao);l=vo.publish(fo.initPage,[c,n,i,e])}return l},recreatePage:function(t){const e=Ro[t];let n;return n=e?function(t){if(console.log(`### App Framework ### 重建页面(${t.id})----`),!t.$valid)return console.error(`### App Framework ### 页面(${t.id})缺少dom数据`),new Error("recreatePage: 无效数据");vo.runtime.helper.recreateDocument(t.doc),t.doc.listener.createFinish()}(e):new Error(`recreatePage: 无效页面Id "${t}"`)},destroyPage:function(t){const e=Ro[t];return e?(vo.publish(fo.destroyPage,[e]),function(t){console.log(`### App Framework ### 销毁页面(${t.id})----`),t.intent=null,t.name=null,vo.runtime.helper.destroyTagNode(t.doc),t.doc=null,t._valid=!1,t._visible=!1,t.destroy(),global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 成功销毁页面(${t.id})----`)}(e),delete Ro[t],Ro):new Error(`destroyPage: 无效页面Id "${t}"`)},changeVisiblePage:function(t,e){const n=Ro[t];if(n){global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### changeVisiblePage 页面(${t})响应:${e}`),n._visible=e;const i=e?fo.onShow:fo.onHide;vo.publish(i,[n])}else console.error(`### App Framework ### changeVisiblePage 页面(${t})无效`)},backPressPage:function(t){const e=Ro[t];let n=!1;return e?(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### backPressOnPage 页面(${t})响应`),n=vo.publish(fo.onBackPress,[e])):console.error(`### App Framework ### backPressOnPage 页面(${t})无效`),!0!==n&&(n=!1),n},menuPressPage:function(t){const e=Ro[t];let n=!1;return e?(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### menuPressOnPage 页面(${t})响应`),n=vo.publish(fo.onMenuPress,[e])):console.error(`### App Framework ### menuPressOnPage 页面(${t})无效`),n},orientationChangePage:function(t,e){const n=Ro[t];n?(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### orientationChangePage 页面(${t})响应:${JSON.stringify(e)}`),vo.publish(fo.onOrientationChange,[n,e])):console.error(`### App Framework ### orientationChangePage 页面(${t})无效`)},refreshPage:function(t,e,n){e=e||{};const i=Ro[t];i?(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### refreshPage 页面(${t})响应:${JSON.stringify(e)}`),vo.publish(fo.onRefresh,[i,e,n])):console.error(`### App Framework ### refreshPage 页面(${t})无效`)},processCallbacks:function(t,e){if(!Array.isArray(e))return new Error(`processCallbacks: 无效任务回调数据 "${t}"`);let n=Ro[t];if(n||(n=No[t]),n){const t=[];return e.forEach(e=>{const i=Bo[e.action],o=[...e.args];"function"==typeof i?(o.unshift(n),t.push(i(...o))):(console.error(`### App Framework ### 无法识别的回调函数类型 (${e.action})`),t.push("invalid"))}),t}return new Error(`processCallbacks: 无效回调来源Id "${t}"`)},getAppConfig:function(t){const e=No[t];let n;return n=e?e.$def:new Error(`getAppConfig: 无效应用Id "${t}"`)},getPageRoot:function(t){const e=Ro[t];let n;return n=e?function(t){const e=(t.doc||{}).body||{};return vo.runtime.helper.getNodeAsJSON(e)}(e):new Error(`getPageRoot: 无效页面Id "${t}"`)},getPage:function(t){return Ro[t]},getPageElementStyles:function(t,e){const n=Ro[t];let i;return i=n&&n.doc?function(t,e){let n;const i=vo.runtime.helper.getDocumentNodeByRef(t.doc,e);if(i){const t=vo.runtime.helper.getElementMatchedCssRuleList(i);return n={inlineStyle:t.shift(),matchedCSSRules:t}}return n=new Error(`getElementStyles: 无效节点ref "${e}"`)}(n,e):new Error(`getPageElementStyles: 无效页面Id "${t}"`)},setPageElementStyles:function(t,e,n,i){const o=Ro[t];let r;return o&&o.doc?(global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 更新页面元素样式: ",JSON.stringify(arguments)),r=function(t,e,n,i){let o;const r=vo.runtime.helper.getDocumentNodeByRef(t.doc,e);if(r){for(let t=0,e=i.length;t<e;t++){const e=i[t];e.name=A(e.name)}o=vo.runtime.helper.setElementMatchedCssRule(r,n,i),t.doc.listener.updateFinish()}else o=new Error(`setPageElementStyles: 无效节点ref "${e}"`);return o}(o,e,n,i)):r=new Error(`setPageElementStyles: 无效页面Id "${t}"`),r},setPageElementAttrs:function(t,e,n){const i=Ro[t];let o;return i&&i.doc?(global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 更新页面元素的属性: ",JSON.stringify(arguments)),o=function(t,e,n){let i;const o=vo.runtime.helper.getDocumentNodeByRef(t.doc,e);if(o){for(let t=0,e=n.length;t<e;t++){const e=n[t];if(e.name=A(e.name.trim()),""===e.name);else if("style"===e.name){const t=e.value.split(";").map(t=>{const e=t.split(":");return{name:A(e[0].trim()),value:e[1]}}).filter(t=>""!==t.name),n={},i=[];for(let e=0,o=t.length;e<o;e++){const o=t[e];i.push({name:o.name,value:o.value,disabled:o.disabled}),o.disabled||(n[o.name]=o.value)}vo.runtime.helper.setElementStyles(o,n)}else vo.runtime.helper.setElementAttr(o,e.name,e.value)}t.doc.listener.updateFinish()}else i=new Error(`setElementAttrs: 无效节点ref "${e}"`);return i}(i,e,n)):o=new Error(`setPageElementAttrs: 无效页面Id "${t}"`),o},replacePageElementWithHtml:function(t,e,n){const i=Ro[t];let o;if(i&&i.doc){const t=vo.runtime.helper.getDocumentNodeByRef(i.doc,e),r=t.parentNode,s=r.layoutChildren.indexOf(t);try{const e=uo.parseHTML(n),a=function t(e,n){if(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Runtime ### 编译节点:${JSON.stringify(e)}`),e.hasOwnProperty("length")){const i=[];for(let o=0,r=e.length;o<r;o++){const r=t(e[o],n);r&&i.push(r)}return i}if(!e.nodeType||e.nodeType===n.NodeType.ELEMENT){const i=n.createElement(e.type);for(const t in e.attr)vo.runtime.helper.setElementAttr(i,t,e.attr[t]);e.classList&&e.classList.length&&vo.runtime.helper.setElementAttr(i,"class",e.classList.join(" "));for(const t in e.style)vo.runtime.helper.setElementStyle(i,t,e.style[t]);if(e.children)for(let o=0,r=e.children.length;o<r;o++){const r=t(e.children[o],n);r&&i.appendChild(r)}return i}console.warn(`### App Runtime ### 不支持插入的节点类型:${e.nodeType}`)}(e,i.doc);if(a){r.removeChild(t);const e=a.hasOwnProperty("length")?a:[a];for(let t=0,n=e.length;t<n;t++){const n=e[t];r.insertBefore(n,r.layoutChildren[s+t])}i.doc.listener.updateFinish(),global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 使用HTML替换元素:",JSON.stringify(arguments),JSON.stringify(e))}else o=new Error(`replacePageElementWithHtml: 使用HTML替换元素,编译出错:${JSON.stringify(e)}`)}catch(t){o=new Error(`replacePageElementWithHtml: 使用HTML替换元素:${t}`)}}else o=new Error(`replacePageElementWithHtml: 无效页面Id "${t}"`);return o},bindComponentMethods:function(t,e){if(e&&!e._hasBind){const n=e.tagName.toLowerCase();e.animate=function(t,e){return(n,i)=>{const o={keyframes:n,options:i},r=vo.platform.requireBundle("animation.js"),s=vo.platform.requireModule(e.app,"system.animation"),a=new r(e,t,o,s);return Object.freeze(a)}}(e,t),vo.runtime.helper.bindComponentMethods(e).forEach(function(n){const i=e[n];e[n]=function(...o){if(t&&t.doc&&t.$valid){vo.publish(fo.callbackDone,[t]);const r=o.map(e=>Ao(e,t));i.apply(e[n],r)}}}),e.getViewId=function(){return global.getPageElementViewId(e.ref)},"canvas"===n&&function(t,e){t.getContext=function(n){const i=["canvas",t.ref,"getContext",[n]];return e.doc.listener.invokeComponentMethod.apply(e.doc.listener,i)}}(e,t),e._hasBind=!0}return e},exposure:So};t("*{margin:0;padding:0;border-width:0;text-size-adjust:none}div::-webkit-scrollbar,root::-webkit-scrollbar{width:0!important;height:0!important}#hap,body,html{width:100%;height:100%;background-color:#fff;font-size:4vw;font-family:sans-serif,PingFang SC}ol,ul{list-style:none}input:focus{outline:none}.root-container{height:100%;width:100%;overflow-x:hidden;overflow-y:scroll;display:block}.root-container>div{margin:0 auto;pointer-events:auto}.hap-container{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:flex;flex:0 1 auto;z-index:0;max-width:100%}.hap-div{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:flex;flex:0 1 auto;z-index:0;max-width:100%;pointer-events:none;overflow:hidden}.hap-a{pointer-events:auto;overflow:hidden}.hap-richtext{pointer-events:auto;width:-webkit-fill-available;text-size-adjust:200%;padding-bottom:20px}.hap-container-bak{-webkit-box-orient:vertical;-webkit-flex-direction:column;flex-direction:column;-webkit-flex-grow:0;flex-grow:0;-webkit-flex-basis:auto;flex-basis:auto;align-items:stretch;box-align:stretch;align-content:flex-start;position:relative;border:0 solid #000;margin:0;padding:0;min-width:0}.hap-element{box-sizing:border-box;position:relative;-webkit-flex-shrink:0;flex-shrink:0;-webkit-flex-grow:0;flex-grow:0;-webkit-flex-basis:auto;flex-basis:auto;border:0 solid #000;margin:0;padding:0;min-width:0;width:auto;white-space:normal;pointer-events:auto}.hap-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-pack:center;word-break:break-word;box-sizing:border-box;line-height:normal;z-index:0;text-align:left;width:fit-content;white-space:pre-line}.hap-stack{display:block;position:relative;width:-webkit-fill-available}.hap-stack-wrap{display:flex;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;flex-direction:inherit;justify-content:inherit;align-items:inherit}.hap-web{flex:1}",void 0);const Ho={version:"0.5.0",debug:!1,validRoots:["div","list","vlist","scroller"],downgrade:{},componentList:[{name:"list",methods:["scrollTo"]},{name:"swiper",methods:["swipeTo"]},{name:"input",methods:["focus","select","setSelectionRange","getSelectionRange"]},{name:"picker",methods:["show"]},{name:"textarea",methods:["focus","select","setSelectionRange","getSelectionRange"]},{name:"video",methods:["start","pause","setCurrentTime","requestFullscreen","exitFullscreen"]},{name:"canvas",methods:["getContext","toTempFilePath"]},{name:"stack",methods:["requestFullscreen"]},{name:"web",methods:["reload","forward","back","canForward","canBack","postMessage"]},{name:"map",methods:["getCenterLocation","translateMarker","moveToMyLocation","includePoints","getRegion","getScale","getSupportedCoordTypes","getCoordType","convertCoord"]}]};var $o={_instances:{},_meta:{},apiModule:{},getApiModuleMeta:function(t){const e={};return e[t]=this._meta[t],e},setApiModuleMeta:function(t){let e;for(const n in t)t.hasOwnProperty(n)&&(e=n);const n=this._meta[e];if(n){const i={};t[e].forEach(function(t){i[t.name]=t}),n.forEach(function(t,e){i[t.name]&&(n[e]=i[t.name],delete i[t.name])});for(const e in t)t.hasOwnProperty(e)&&n.push(t[e])}else this._meta[e]=t[e];this._meta[e]=t[e]},setApiMeta:function(t,e){const n=this._meta[t];if(n){let t=-1;n.forEach(function(n,i){void 0===e.name&&(t=i)}),-1!==t?n[t]=e:n.push(e)}else this._meta[t]=[e]}};const zo={};function Yo(t){if(!(this instanceof Yo))return new Yo(t);this.instanceId=t.instanceId,this.hapInstance=t,zo[this.instanceId]=this}function Wo(t,e){processCallbacks(t,[e])}Yo.getSender=function(t){return zo[t]},Yo.prototype={performCallback:function(t,e,n){const i=[t];e&&i.push(e),n&&i.push(n),Wo(this.instanceId,{action:"2",method:"callback",args:i})},fireEvent:function(t,e,n,i){n.extra&&S(i,n.extra()),Wo(this.instanceId,{action:"1",method:"fireEvent",args:[t,e,i,n.updator&&n.updator()]})}};const Vo={invokeCallback(t,e,n){global.execInvokeCallback({callback:t,data:{code:n||0,content:e}})},callbackSuccess(t,e){global.execInvokeCallback({callback:t,data:{code:0,content:e}})},callbackFail(t,e,n){global.execInvokeCallback({callback:t,data:{code:n||999,content:e}})},callbackCancel(t,e){global.execInvokeCallback({callback:t,data:{code:100,content:e}})},syncResult:t=>null!==t?{code:0,content:t}:{code:0,content:""},polyfillPrompt(t,e,n){console.warn(`### Web Render ### ${t} => ${e}:${JSON.stringify(n)||""}\n\n==可能返回模拟数据,请使用真机调试体验完整功能==`)},errorTip(t,e,n){console.error(`### Web Render ### ${t} => ${e}:${n||"是必填项"}`)},MODE:{SYNC:0,CALLBACK:1,SUBSCRIBE:2},TYPE:{METHOD:0,ATTRIBUTE:1,EVENT:2},ACCESS:{NONE:0,READ:1,WRITE:2},NORMALIZE:{RAW:0,JSON:1},RESULT:{MODULE_INST:0}};function Uo(t,e){const n=document.head,i=document.createElement("script");i.type="text/javascript",i.charset="utf-8",i.async=!0,i.timeout=12e4,i.src=t;const o=setTimeout(r,12e4);function r(t){i.onerror=i.onload=null,clearTimeout(o);const n="error"===t.type?new Error("ScriptError"):void 0;e(n)}i.onerror=i.onload=r,n.appendChild(i)}var qo=!1,Go=window.requestAnimationFrame||window.webkitRequestAnimationFrame;Go||(qo=!0,Go=function(t){return Xo(t,16)});var Jo=window.cancelAnimationFrame||window.webkitCancelAnimationFrame;!Jo&&qo?Jo=function(t){return tr(t)}:Jo||(Jo=function(){});var Ko=(Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1)-1,Zo={},Qo=0;function Xo(t,e){var n=function t(){return Zo[Qo=(Qo+1)%Ko]?t():Qo}(),i=Date.now();return Zo[n]=Go(function o(){(Zo[n]||0===Zo[n])&&(Date.now()-i<e?Zo[n]=Go(o):(delete Zo[n],t()))}),n}function tr(t){var e=Zo[t];e&&Jo(e),delete Zo[t]}var er=function(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})},nr=Object.getOwnPropertySymbols,ir=Object.prototype.hasOwnProperty,or=Object.prototype.propertyIsEnumerable;var rr=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,i,o=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),r=1;r<arguments.length;r++){for(var s in n=Object(arguments[r]))ir.call(n,s)&&(o[s]=n[s]);if(nr){i=nr(n);for(var a=0;a<i.length;a++)or.call(n,i[a])&&(o[i[a]]=n[i[a]])}}return o};function sr(t,e){return e.encode?e.strict?er(t):encodeURIComponent(t):t}var ar={extract:function(t){return t.split("?")[1]||""},parse:function(t,e){var n=function(t){var e;switch(t.arrayFormat){case"index":return function(t,n,i){e=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,""),e?(void 0===i[t]&&(i[t]={}),i[t][e[1]]=n):i[t]=n};case"bracket":return function(t,n,i){e=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,""),e?void 0!==i[t]?i[t]=[].concat(i[t],n):i[t]=[n]:i[t]=n};default:return function(t,e,n){void 0!==n[t]?n[t]=[].concat(n[t],e):n[t]=e}}}(e=rr({arrayFormat:"none"},e)),i=Object.create(null);return"string"!=typeof t?i:(t=t.trim().replace(/^(\?|#|&)/,""))?(t.split("&").forEach(function(t){var e=t.replace(/\+/g," ").split("="),o=e.shift(),r=e.length>0?e.join("="):void 0;r=void 0===r?null:decodeURIComponent(r),n(decodeURIComponent(o),r,i)}),Object.keys(i).sort().reduce(function(t,e){var n=i[e];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?t[e]=function t(e){return Array.isArray(e)?e.sort():"object"==typeof e?t(Object.keys(e)).sort(function(t,e){return Number(t)-Number(e)}).map(function(t){return e[t]}):e}(n):t[e]=n,t},Object.create(null))):i},stringify:function(t,e){var n=function(t){switch(t.arrayFormat){case"index":return function(e,n,i){return null===n?[sr(e,t),"[",i,"]"].join(""):[sr(e,t),"[",sr(i,t),"]=",sr(n,t)].join("")};case"bracket":return function(e,n){return null===n?sr(e,t):[sr(e,t),"[]=",sr(n,t)].join("")};default:return function(e,n){return null===n?sr(e,t):[sr(e,t),"=",sr(n,t)].join("")}}}(e=rr({encode:!0,strict:!0,arrayFormat:"none"},e));return t?Object.keys(t).sort().map(function(i){var o=t[i];if(void 0===o)return"";if(null===o)return sr(i,e);if(Array.isArray(o)){var r=[];return o.slice().forEach(function(t){void 0!==t&&r.push(n(i,t,r.length))}),r.join("&")}return sr(i,e)+"="+sr(o,e)}).filter(function(t){return t.length>0}).join("&"):""}};const lr="system.router.params",cr={type:"app",instanceId:1,basePath:"",currentPath:"",index:0,scriptIndex:0,entry:"",routes:[],pages:{},display:{},init(t){window.addEventListener("popstate",()=>{global.history.state?this.navigateTo(global.history.state,"back"):this.back()},!1),this.scriptIndex=document.head.children.length-1,this.basePath=t.base;const e=global.manifest&&global.manifest.router||{};this.entry=e.entry||"",this.type=t.type||"app",this.pages="card"===this.type?e.widgets||{}:e.pages||{},this.display=global.manifest&&global.manifest.display;const n=global.sessionStorage.getItem("routes");try{this.routes=JSON.parse(n)||[],this.index=Math.max(this.routes.length-1,0)}catch(t){console.log(t)}this.reload()},navigateTo(t,e){const n=t&&t.uri,i=n&&n.split(":")[0];if(i&&i.indexOf("http")>-1)window.location.href=n;else if(i&&i.indexOf("hap")>-1)document.body.innerHTML="正试图打开hap链接,请使用真机调试该路由";else{const i=n&&function(t){let e="",n="",i={};if("string"==typeof t){const o=t.split("?");o.length>1&&(t=o[0],i=ar.parse(o[1])),"/"===t[0]?(e=t.slice(1),n=t):(e=t,n="/"+t)}return{name:e,path:n,params:i}}(n);let o="",r="index";if(this.pages[i.name])o=i.name,r=this.pages[i.name].component||r;else if(this.pages[i.path])o=i.path,r=this.pages[i.path].component||r;else for(const t in this.pages)if(this.pages[t].path===i.path){o=t,r=this.pages[t].component||r;break}if("/"!==n&&!o)return console.error(`### Web Render ### 找不到该路由:${n}`),void(document.body.innerHTML=`找不到该路由:${n}`);o="/"===(o="/"===o[o.length-1]?o.slice(0,o.length-1):o)[0]?o:`/${o}`;const s=this.basePath+o,a=t&&t.params||i.params;Object.keys(a).forEach(t=>{try{"object"==typeof a[t]&&(a[t]=JSON.stringify(a[t]))}catch(t){global.Env&&"trace"===global.Env.logLevel&&console.trace(`### Web Render ### navigateTo error:${t}`)}});const l=JSON.stringify(a);global.sessionStorage.setItem(lr,l);const c={name:i.name,path:i.path,component:r,uri:"hap://app/com.hap.quickapp",action:"view",currentPageName:i.name,fromExternal:!1,orientation:"portrait",windowWidth:document.body.clientWidth,windowHeight:document.body.clientHeight,statusBarHeight:84};global.Env&&"trace"===global.Env.logLevel&&console.trace(`### Web Render ### 路由跳转至${s}, 当前id:${this.instanceId}, 传参:${l}`);const d=this.instanceId++,h=this.instanceId,p=function(){Uo(`${s}/${r}.js`,function(o){if(o)n===this.entry?(console.error("### Web Render ### 文件加载错误"),document.body.innerHTML="文件加载错误"):(global.Env&&"trace"===global.Env.logLevel&&console.trace("### Web Render ### 文件加载错误,将返回首页"),this.navigateTo({uri:this.entry},"push"));else{switch(e){case"push":global.history.pushState(t,i.path,`${s}/`),this.routes.push({index:++this.index,name:i.name,path:i.path,document:""});break;case"replace":global.history.replaceState(t,i.path,`${s}/`),this.routes.pop(),this.routes.push({index:this.index,name:i.name,path:i.path,document:""});break;case"back":this.routes.pop(),this.index--}global.sessionStorage.setItem("routes",JSON.stringify(this.routes)),d>1&&(global.changeVisiblePage(d,!1),global.destroyPage(d)),Object.keys(Zo).forEach(t=>{tr(t)}),h===this.instanceId&&(!function(t){gi.reset(),document.body.innerHTML="";const e=t?t+1:document.head.children.length;for(let t=document.head.children.length-1;t>=e;t--)document.head.removeChild(document.head.children[t])}(this.scriptIndex),"app"===this.type&&function(t,e,n){if(!e)return;const i=global.manifest||{},o=e.pages||{},r=o[t.name]||o[t.path]||{};if("boolean"==typeof r.titleBar?r.titleBar:"boolean"!=typeof e.titleBar||e.titleBar){const t=r.titleBarText||e.titleBarText||i.name||"",o=r.titleBarTextColor||e.titleBarTextColor,s=r.titleBarBackgroundColor||e.titleBarBackgroundColor,a="boolean"==typeof r.menu?r.menu:"boolean"==typeof e.menu&&e.menu,l=n.routes&&n.routes.length>1;gi.createPageTitleBar({text:t,textColor:o,backgroundColor:s,menu:a,back:l},n)}}(i,this.display,this),global.createPageHandler(),global.changeVisiblePage(h,!0))}}.bind(this))}.bind(this);global.createPage(h,"1",p,a,c)}},reload(){const t=window.location.pathname;this.currentPath=t.length>1&&"/"===t[t.length-1]?t.slice(0,t.length-1):t;const e=this.currentPath.replace(this.basePath,""),n=global.sessionStorage.getItem(lr),i=n?JSON.parse(n):{};this.navigateTo({uri:e||this.entry,params:i},"replace")},push(t){this.navigateTo(t,"push")},replace(t){this.navigateTo(t,"replace")},back(t){t?this.navigateTo(t,"back"):global.history.back()}};const dr={name:"system.router",methods:[{name:"push",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"replace",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"back",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"clear",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"getLength",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"getState",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC}]},hr={push:t=>(cr.push(t),"success"),replace:t=>(cr.replace(t),"success"),back:()=>(cr.back(),"success"),clear:()=>"success",getLength:()=>cr.routes.length,getState(){const t=cr.routes[cr.routes.length-1];return{index:t&&t.index||0,name:t&&t.name||"",path:t&&t.path||""}}};global.history.push=function(t){cr.push(t,"push")},global.history.replace=function(t){cr.push(t,"replace")},global.history.clear=hr.clear,global.history.getLength=hr.getLength,global.history.getState=hr.getState;var pr={module:hr,config:dr};var ur={module:{fetch(t={}){fr(t);global.fetch(...fr(t)).then(e=>(function(t,e=""){const n=t.status,i={};t.headers.forEach((t,e)=>{i[e]=t});const o={code:n,headers:i};return"json"===e?t.json().then(t=>Promise.resolve(Object.assign(o,{data:t}))):"file"===e?t.blob().then(t=>Promise.resolve(Object.assign(o,{data:t}))):"arraybuffer"===e?t.arrayBuffer().then(t=>Promise.resolve(Object.assign(o,{data:t}))):t.text().then(t=>Promise.resolve(Object.assign(o,{data:t})))})(e,t.responseType||"")).then(e=>{t.success(e)}).catch(e=>{t.fail(e)})}},config:{name:"system.fetch",methods:[{name:"fetch",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}};function fr(t){let e=t.url,n=t.data;const i=t.method||"GET",o=t.header||{},r=new global.URL(e);o.Referer||(o.Referer=r.origin),o["User-Agent"]="Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Mobile Safari/537.36",e.indexOf("http://")<0&&e.indexOf("https://")<0&&(e=e.replace("http:","http://")),"string"!=typeof n||o["Content-Type"]?n instanceof ArrayBuffer&&!o["Content-Type"]?Object.assign(o,{"Content-Type":"application/octet-stream"}):"object"==typeof n&&(o["Content-Type"]?n=o["Content-Type"].indexOf("application/x-www-form-urlencoded")>-1||"GET"===i.toUpperCase()||"HEAD"===i.toUpperCase()?mr(n):JSON.stringify(n):(Object.assign(o,{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"}),n=mr(n))):Object.assign(o,{"Content-Type":"text/plain; charset=utf-8"});const s={headers:o,method:i,credentials:"include"};return"GET"===i.toUpperCase()||"HEAD"===i.toUpperCase()?(n&&(e+=e.indexOf("?")>-1?"&"+n:"?"+n),[e,s]):(s.body=n,[e,s])}function mr(t){try{const e=[];for(const n in t){const i=encodeURIComponent(n);let o=t[n];"object"==typeof t[n]&&(o=JSON.stringify(t[n]));const r=encodeURIComponent(o);e.push(i+"="+r)}return e.join("&")}catch(t){return""}}t(".hap-prompt-mask{position:fixed;z-index:999;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.3)}.hap-prompt-content{width:86%;max-height:70%;background-color:#fff;word-break:break-all}.hap-prompt-footer{position:relative;display:flex;padding:20px 0 50px;color:#009688;font-size:28px}",void 0);let gr=0;class yr{constructor(t){const e=document.createElement("div"),n=document.getElementsByTagName("body")[0];return this._node=e,this._options=t,this._uid=`hap-prompt-box${gr++}`,this._container=n,this._btns=[],e.classList.add("hap-prompt-box"),e.setAttribute("id",this._uid),this.createMask(),this}createMask(){const t=this._options,e=document.createElement("div"),n=document.createElement("div");e.classList.add("hap-prompt-mask"),n.classList.add("hap-prompt-content"),e.appendChild(n),this._node.appendChild(e),this._content=n,this._mask=e,"dialog"===t.type?this.createDialog(t):this.createMenu(t)}createDialog(t){const e=document.createElement("div");let n=null;if(e.style.padding="32px",e.classList.add("hap-prompt-body"),t.title){const n=document.createElement("h2");n.style.cssText="font-size: 40px;color: #000;margin-bottom: 20px;font-weight: 400;",n.innerText=t.title,e.appendChild(n)}if(t.message){const n=document.createElement("p");n.style.cssText="font-size: 32px;color: #000;",n.innerText=t.message,e.appendChild(n)}t.buttons&&Array.isArray(t.buttons)&&((n=document.createElement("div")).classList.add("hap-prompt-footer"),n.style.flexDirection="row-reverse",n.style.justifyContent="flex-start",t.buttons.slice(0,3).forEach((t,e)=>{const i=document.createElement("span");i.style.paddingRight="38px",i.style.paddingLeft="38px",i.dataset.index=e,t.text&&(i.innerText=t.text),t.color&&(i.style.color=t.color),2===e&&(i.style.position="absolute",i.style.left="0"),this._btns.push(i),n.appendChild(i)}),this._content.appendChild(n)),this._content.insertBefore(e,n),this._container.appendChild(this._node),this.bindAction()}createMenu(t){const e=document.createElement("ul");e.style.padding="10px 32px",t.itemColor&&(e.style.color=t.itemColor),e.classList.add("hap-prompt-body");const n=document.createDocumentFragment();t.itemList.forEach((t,e)=>{const i=document.createElement("li");i.innerText=t,i.dataset.index=e,i.style.paddingTop="15px",i.style.paddingBottom="15px",n.appendChild(i),this._btns.push(i)}),e.appendChild(n),this._content.appendChild(e),this._container.appendChild(this._node),this.bindAction()}close(){const t=this._container,e=document.getElementById(this._uid);t.removeChild(e),this._btns=null,this._container=null,this._content=null,this._mask=null,this._node=null,this._options=null,this._uid=null}bindAction(){const t=this,e=t._btns,n=t._mask,i=t._content,o=t._options,r=function(e){e.preventDefault(),e.stopPropagation();const n=this.dataset.index;o.success&&o.success({index:n}),t.close()};i.addEventListener("click",function(t){t.preventDefault(),t.stopPropagation()}),n.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),o.cancel&&o.cancel(),t.close()},!1);for(let t=0,n=e.length;t<n;t++)e[t].addEventListener("click",r,!1)}}const br=[];let vr,Er=!1;const wr="hap-prompt-toast";const xr={push:function(t,e){e=0===e?1.5:2.5,br.push({msg:t,duration:e}),this.show()},show:function(){const t=this;if(Er)return;Er=!0;const e=br.shift();var n,i;n=e,i=function(){Er=!1,br.length?t.show():function(t){const e=function(){vr.removeEventListener("transitionend",e),vr.removeEventListener("webkitTransitionEnd",e),t&&t()};vr&&(vr.addEventListener("transitionend",e),vr.addEventListener("webkitTransitionEnd",e),vr.style.opacity=0)}(function(){Er||(vr&&vr.parentNode.removeChild(vr),vr=null)})},vr||((vr=document.createElement("div")).style.cssText="position: fixed;bottom: 2rem;left: 50%;padding: 10px;transform: translate(-50%, -2rem);color: #fff;background-color: #555;transition: opacity .4s ease-out;font-size: 28px;",vr.classList.add(wr),document.body.appendChild(vr)),vr.textContent=n.msg,vr.style.opacity=.8,setTimeout(function(){i&&i()},1e3*n.duration)}};var Tr={module:{showToast(t){t.message||console.warn("### Web Render ### prompt.showToast message 是必填项");let e=0;return t.duration&&(e=parseInt(t.duration)),xr.push(t.message,e),"success"},showDialog:t=>(t.type="dialog",new yr(t)),showContextMenu(t){if(t.itemList&&Array.isArray(t.itemList))return new yr(t)}},config:{name:"system.prompt",methods:[{name:"showToast",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"showDialog",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"showContextMenu",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}};var Ar={module:{_getLength:()=>global.localStorage.length,get(t={}){const e=global.localStorage.getItem(t.key);setTimeout(()=>{t.success(e||JSON.stringify(t.default)||"")},0)},set(t={}){""===t.value?global.localStorage.removeItem(t.key):global.localStorage.setItem(t.key,"string"==typeof t.value?t.value:JSON.stringify(t.value)),t.success({})},clear(t={}){global.localStorage.clear(),t.success({})},delete(t={}){global.localStorage.removeItem(t.key),t.success({})},key(t={}){const e=global.localStorage.key(t.index);t.success(e)}},config:{name:"system.storage",methods:[{name:"get",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"set",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"clear",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"delete",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"key",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"_getLength",mode:Vo.MODE.SYNC,type:Vo.TYPE.ATTRIBUTE,access:Vo.ACCESS.READ,alias:"length"}]}};const kr={name:"system.network",methods:[{name:"getType",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"subscribe",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"unsubscribe",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC}]};var _r={module:{getType(t={}){Vo.polyfillPrompt("system.network","getType",t);const e={metered:!1,type:"wifi"};setTimeout(()=>{t.success(e)},100)},subscribe(t={}){Vo.polyfillPrompt(kr.name,"subscribe",t);const e=navigator.connection;e?(e.onchange=(e=>{t.success({metered:!1,type:"wifi"})}),setTimeout(()=>{this.getType(t)},100)):t.fail("error")},unsubscribe(t={}){Vo.polyfillPrompt(kr.name,"unsubscribe",t);const e=navigator.connection;return e&&(e.onchange=null),"success"}},config:kr};const Cr={name:"system.app",methods:[{name:"getInfo",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC}]};var Sr={module:{getInfo(){Vo.polyfillPrompt(Cr.name,"getInfo");const t=global.manifest;return t?{name:t.name,versionName:t.versionName,versionCode:t.versionCode,logLevel:t.config&&t.config.logLevel,packageName:t.package,source:{packageName:t.package,type:"shortcut",extra:{scene:"web",original:""}},icon:t.icon}:{}}},config:Cr};const Mr={name:"system.share",methods:[{name:"share",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]};var Or={module:{share(t={}){Vo.polyfillPrompt(Mr.name,"share",t),t.success({})}},config:Mr};const Dr={name:"system.barcode",methods:[{name:"scan",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]};var Lr={module:{scan(t={}){Vo.polyfillPrompt(Dr.name,"scan",t),t.success({result:"https://doc.quickapp.cn"})}},config:Dr};var Ir={module:{set(t={}){Vo.polyfillPrompt("system.clipboard","set",t),t.success({})},get(t={}){Vo.polyfillPrompt("system.clipboard","get",t),t.success({})}},config:{name:"system.clipboard",methods:[{name:"set",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"get",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}};const Pr={name:"system.image",methods:[{name:"getImageInfo",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"compressImage",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"applyOperations",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"editImage",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"compress",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getInfo",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"edit",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]};var Nr={module:{getImageInfo(t={}){Vo.polyfillPrompt(Pr.name,"getImageInfo",t),t.success({})},compressImage(t={}){Vo.polyfillPrompt(Pr.name,"compressImage",t),t.success({})},applyOperations(t={}){Vo.polyfillPrompt(Pr.name,"applyOperations",t),t.success({})},editImage(t={}){Vo.polyfillPrompt(Pr.name,"editImage",t),t.success({})}},config:Pr};let Rr=1;const Fr=[],Br={},jr="internal://mass/download/",Hr=["POST","PUT"],$r={name:"system.request",methods:[{name:"upload",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"download",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"onDownloadComplete",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]};class zr{constructor(t){const e=t.filename||this.getFileName(t.url);return this.getBlob(t).then(t=>this.saveAs(t,e))}getFileName(t){const e=t.split("/");return e[e.length-1]}saveAs(t,e){const n=jr+e;if(window.navigator.msSaveOrOpenBlob)navigator.msSaveBlob(t,e);else{const n=document.createElement("a"),i=document.querySelector("body");n.href=window.URL.createObjectURL(t),n.download=e,n.style.display="none",i.appendChild(n),n.click(),i.removeChild(n),window.URL.revokeObjectURL(n.href)}return Fr[Rr]={uri:n,blob:t},Br[n]=t,Rr++}getBlob(t){return new Promise(e=>{const n=new XMLHttpRequest,i=t.url,o=t.header;o&&Object.keys(o).forEach(t=>{"useragent"!==t.toLowerCase()&&n.setRequestHeader(t,o[t])}),n.open("GET",i,!0),n.responseType="blob",n.onload=(()=>{200===n.status&&e(n.response)}),n.send()})}}class Yr{constructor(t){const e={headers:{}};e.method=this.getUploadMethod(t.method);const n=t.data,i=t.header,o=t.files;if(!(Array.isArray(o)&&o.length>0))return Vo.errorTip("request.upload","files"),Promise.reject();const r=new FormData;return o.forEach(t=>{const e=t.name||"file",n=Br[t.uri];r.append(e,n,t.filename)}),Array.isArray(n)&&n.length>0&&n.forEach(t=>{r.append(t.name,t.value)}),i&&Object.keys(i).forEach(t=>{const n=t.toLowerCase();"useragent"!==n&&"content-type"!==n&&(e.header.item=i[t])}),e.body=r,this.upload(t.url,e)}getUploadMethod(t){if(!t)return"POST";const e=Hr.indexOf(t.toUpperCase());return e>-1?Hr[e]:(Vo.errorTip("request.upload","medhod",`method仅支持-- ${JSON.stringify(Hr)}`),"POST")}upload(t,e){return fetch(t,e)}}var Wr={module:{upload(t={}){let e,n;Vo.polyfillPrompt($r.name,"upload",t),new Yr(t).then(t=>(n=t.headers,e=t.status,t.text())).then(i=>{t.success&&t.success({code:e,headers:n,data:i})}).catch(()=>{t.fail&&t.fail("upload fail",1e3)}).finally(()=>{t.complete&&t.complete()})},download(t={}){Vo.polyfillPrompt($r.name,"download",t),new zr(t).then(e=>{t.success&&t.success({token:e})}).catch(()=>{t.fail&&t.fail("download fail",1e3)}).finally(()=>{t.complete&&t.complete()})},onDownloadComplete(t={}){Vo.polyfillPrompt($r.name,"onDownloadComplete",t);const e=t.token;if(e){const n=Fr[e];n?t.success&&t.success({uri:n.uri}):Vo.errorTip("request.onDownloadComplete","token","token 无效")}else t.fail("token is null",202)}},config:$r};const Vr={name:"system.media",methods:[{name:"takePhoto",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"takeVideo",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"pickImage",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"pickVideo",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"pickFile",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"saveToPhotosAlbum",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]};var Ur={module:{takePhoto(t={}){Vo.polyfillPrompt(Vr.name,"takePhoto",t),t.success({})},takeVideo(t={}){Vo.polyfillPrompt(Vr.name,"takeVideo",t),t.success({})},pickImage(t={}){Vo.polyfillPrompt(Vr.name,"pickImage",t),t.success({})},pickVideo(t={}){Vo.polyfillPrompt(Vr.name,"pickVideo",t),t.success({})},pickFile(t={}){Vo.polyfillPrompt(Vr.name,"pickFile",t),t.success({})},saveToPhotosAlbum(t={}){Vo.polyfillPrompt(Vr.name,"saveToPhotosAlbum",t),t.success({})}},config:Vr};const qr={name:"system.device",methods:[{name:"getInfo",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getId",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getDeviceId",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getUserId",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getAdvertisingId",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getTotalStorage",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getAvailableStorage",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getCpuInfo",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getSerial",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"__getPlatform",mode:Vo.MODE.SYNC,type:Vo.TYPE.ATTRIBUTE,access:Vo.ACCESS.READ,alias:"platform"}]};var Gr={module:{getInfo(t={}){Vo.polyfillPrompt(qr.name,"getInfo",t);const e={brand:"vivo",manufacturer:"vivo",model:"X23",product:"X23",osType:"android",osVersionName:"",osVersionCode:"0",platformVersionName:"",platformVersionCode:"0",language:"en",region:"china",screenWidth:window.outerWidth,screenHeight:window.outerHeight,windowWidth:document.body.clientWidth,windowHeight:document.body.clientHeight,statusBarHeight:120};t.success(e)},getId(t={}){Vo.polyfillPrompt("system.device","getId",t);const e=t.type,n={};e&&Array.isArray(e)&&e.forEach(t=>{switch(t){case"device":n.device="283258220100012";break;case"mac":n.mac="02:00:00:00:00:21:21";break;case"user":n.user="36cecec57756f3d27";break;case"advertising":n.advertising="91ce1536-8953-4be9-864a-7ac53481ff97"}}),t.success(n)},getDeviceId(t={}){Vo.polyfillPrompt("system.device","getDeviceId",t),t.success({deviceId:"283258220100012"})},getUserId(t={}){Vo.polyfillPrompt("system.device","getUserId",t),t.success({userId:"36cecec57756f3d27"})},getAdvertisingId(t={}){Vo.polyfillPrompt("system.device","getAdvertisingId",t);t.success({advertisingId:"91ce1536-8953-4be9-864a-7ac53481ff97"})},getTotalStorage(t={}){Vo.polyfillPrompt("system.device","getTotalStorage",t),t.success({totalStorage:"54496026624"})},getAvailableStorage(t={}){Vo.polyfillPrompt("system.device","getAvailableStorage",t),t.success({availableStorage:"2471679595904"})},getCpuInfo(t={}){Vo.polyfillPrompt("system.device","getCpuInfo",t),t.success({cpuIf:"Processor: AArch64"})},getSerial(t={}){Vo.polyfillPrompt("system.device","getSerial",t),t.success({serial:"866063029145927"})},__getPlatform:()=>({versionName:global.manifest&&global.manifest.versionName,versionCode:global.manifest&&global.manifest.versionCode})},config:qr};const Jr={name:"system.geolocation",methods:[{name:"getLocation",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getLocationType",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"subscribe",type:Vo.TYPE.METHOD,mode:Vo.MODE.SUBSCRIBE},{name:"unsubscribe",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"getSupportedCoordTypes",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC}]},Kr={PERMISSION_DENIED:201,POSITION_UNAVAILABLE:204,TIMEOUT:1e3};var Zr={module:{_watchId:void 0,getLocation(t={}){"geolocation"in navigator?navigator.geolocation.getCurrentPosition(e=>{t.success({longitude:e.coords.longitude,latitude:e.coords.latitude,accuracy:e.coords.accuracy,time:e.timestamp})},e=>{t.fail(e.message,Kr[e.code]||204)},{timeout:t.timeout||3e4}):t.fail("浏览器不支持定位",1e3)},getLocationType(t={}){Vo.polyfillPrompt(Jr.name,"getLocationType",t),t.success({types:["gps","network"]})},subscribe(t={}){"geolocation"in navigator?(this._watchId&&navigator.geolocation.clearWatch(this._watchId),this._watchId=navigator.geolocation.watchPosition(e=>{t.callback({longitude:e.coords.longitude,latitude:e.coords.latitude,accuracy:e.coords.accuracy,time:e.timestamp})},e=>{t.fail(e.message,Kr[e.code]||204)})):t.fail("浏览器不支持定位",1e3)},unsubscribe(){return this._watchId&&(navigator.geolocation.clearWatch(this._watchId),this._watchId=void 0),"success"},getSupportedCoordTypes:()=>"wgs84,gcj02"},config:Jr};var Qr={module:{},config:{name:"system.file",methods:[{name:"move",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"copy",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"list",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"get",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"delete",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"writeText",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"readText",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"writeArrayBuffer",type:Vo.TYPE.METHOD,normalize:Vo.NORMALIZE.RAW,mode:Vo.MODE.CALLBACK},{name:"readArrayBuffer",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}};var Xr={module:{},config:{name:"system.wifi",methods:[{name:"connect",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"scan",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getConnectedWifi",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"__onscanned",type:Vo.TYPE.EVENT,mode:Vo.MODE.CALLBACK,alias:"onscanned"},{name:"__onstatechanged",type:Vo.TYPE.EVENT,mode:Vo.MODE.CALLBACK,alias:"onstatechanged"}]}};const ts={name:"system.audio",methods:[{name:"play",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"pause",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"stop",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getPlayState",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK,alias:"state"},{name:"__getSrc",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.READ,alias:"src"},{name:"__setSrc",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.WRITE,alias:"src"},{name:"__getAutoplay",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.READ,alias:"autoplay"},{name:"__setAutoplay",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.WRITE,alias:"autoplay"},{name:"__getCurrentTime",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.READ,alias:"currentTime"},{name:"__setCurrentTime",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.WRITE,alias:"currentTime"},{name:"__getDuration",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.READ,alias:"duration"},{name:"__getLoop",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.READ,alias:"loop"},{name:"__setLoop",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.WRITE,alias:"loop"},{name:"__getVolume",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.READ,alias:"volume"},{name:"__setVolume",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.WRITE,alias:"volume"},{name:"__getMuted",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.READ,alias:"muted"},{name:"__setMuted",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.WRITE,alias:"muted"},{name:"__getNotificationVisible",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.READ,alias:"notificationVisible"},{name:"__setNotificationVisible",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.WRITE,alias:"notificationVisible"},{name:"__getTitle",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.READ,alias:"title"},{name:"__setTitle",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.WRITE,alias:"title"},{name:"__getArtist",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.READ,alias:"artist"},{name:"__setArtist",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.WRITE,alias:"artist"},{name:"__onplay",type:Vo.TYPE.EVENT,mode:Vo.MODE.SUBSCRIBE,alias:"onplay"},{name:"__onpause",type:Vo.TYPE.EVENT,mode:Vo.MODE.SUBSCRIBE,alias:"onpause"},{name:"__onloadeddata",type:Vo.TYPE.EVENT,mode:Vo.MODE.SUBSCRIBE,alias:"onloadeddata"},{name:"__onended",type:Vo.TYPE.EVENT,mode:Vo.MODE.SUBSCRIBE,alias:"onended"},{name:"__ondurationchange",type:Vo.TYPE.EVENT,mode:Vo.MODE.SUBSCRIBE,alias:"ondurationchange"},{name:"__onerror",type:Vo.TYPE.EVENT,mode:Vo.MODE.SUBSCRIBE,alias:"onerror"},{name:"__ontimeupdate",type:Vo.TYPE.EVENT,mode:Vo.MODE.SUBSCRIBE,alias:"ontimeupdate"},{name:"__onstop",type:Vo.TYPE.EVENT,mode:Vo.MODE.SUBSCRIBE,alias:"onstop"},{name:"__onprevious",type:Vo.TYPE.EVENT,mode:Vo.MODE.SUBSCRIBE,alias:"onprevious"},{name:"__onnext",type:Vo.TYPE.EVENT,mode:Vo.MODE.SUBSCRIBE,alias:"onnext"},{name:"__getStreamType",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.READ,alias:"streamType"},{name:"__setStreamType",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.WRITE,alias:"streamType"}]},es={src:"",notificationVisible:!1,streamType:"music",evtType:"pause"},ns="HapAudioDomId"+Date.now();function is(t,e){let n=document.getElementById(ns);n?n[t]=e:((n=document.createElement("audio")).id=ns,n.style.display="none",document.body.appendChild(n),n[t]=e)}function os(t){const e=document.getElementById(ns);return!!e&&!!e[t]}function rs(t,e){document.getElementById(ns)[t]=e}function ss(t){const e=document.getElementById(ns);return e?""!==e[t]&&e[t]?e[t]:e.paused?"暂停播放":"正在播放":"暂停播放"}function as(t,e,n){let i=document.getElementById(t);i||((i=document.createElement("audio")).id=t,document.body.appendChild(i)),"function"==typeof n&&i.addEventListener(e,n)}var ls={module:{__onplay(t){as(ns,"play",t.callback)},__onpause(t){as(ns,"pause",e=>{"pause"===es.evtType&&"function"==typeof t.callback&&t.callback(e)})},__onstop(t){as(ns,"pause",e=>{"stop"===es.evtType&&"function"==typeof t.callback&&t.callback(e)})},__onloadeddata(t){as(ns,"loadeddata",t.callback)},__onended(t){as(ns,"ended",t.callback)},__ondurationchange(t){as(ns,"durationchange",t.callback)},__onerror(t){as(ns,"error",t.callback)},__ontimeupdate(t){as(ns,"timeupdate",t.callback)},__onprevious(t){console.warn("==h5暂时不支持 onprevious 事件=="),as(ns,"previous",t.callback)},__onnext(t){console.warn("==h5暂时不支持 onnext 事件=="),as(ns,"nex",t.callback)},play(){es.evtType="play";let t=document.getElementById(ns);t||(this.__setSrc({value:es.src}),t=document.getElementById(ns)),t.play()},pause(){es.evtType="pause";const t=document.getElementById(ns);t&&t.pause()},stop(){es.evtType="stop";const t=document.getElementById(ns);t&&(t.pause(),this.__setCurrentTime({value:0}))},getPlayState(t={}){const e={};e.state=es.evtType,e.src=this.__getSrc().content,e.currentTime=this.__getCurrentTime().content,e.autoplay=this.__getAutoplay().content,e.loop=this.__getLoop().content,e.volume=this.__getVolume().content,e.muted=this.__getMuted().content,e.notificationVisible=this.__getNotificationVisible().content,t.success(e)},__getSrc:()=>es.src,__setSrc(t){es.src=t.value;let e=document.getElementById(ns);return e||((e=document.createElement("audio")).id=ns,e.style.display="none",document.body.appendChild(e)),t.value&&t.value.toLowerCase().startsWith("http")?e.src=es.src:e.src=global.Hap.basePath+es.src,t},__getCurrentTime(){const t=document.getElementById(ns);return t?t.currentTime:0},__setCurrentTime(t){const e=document.getElementById(ns);return e&&(e.currentTime=t.value),t},__getDuration(){const t=document.getElementById(ns);return t?t.duration:0},__getAutoplay:()=>(console.warn("==目前h5暂不支持自动播放,请使用真机调试体验完整功能=="),os("autoplay")),__setAutoplay:t=>(is("autoplay",t.value),t),__getLoop:()=>os("loop"),__setLoop:t=>(is("loop",t.value),t),__getVolume(){const t=document.getElementById(ns);return t?t.volume:1},__setVolume(t){const e=document.getElementById(ns);return e&&(e.volume=t.value),t},__getMuted:()=>os("muted"),__setMuted:t=>(is("muted",t.value),t),__getNotificationVisible:()=>es.notificationVisible,__setNotificationVisible:t=>(es.notificationVisible=t.value,t),__getTitle:()=>ss("title"),__setTitle:t=>(rs("title",t.value),t),__getArtist:()=>ss("artist"),__setArtist:t=>(rs("artist",t.value),t),__getStreamType:()=>es.streamType,__setStreamType:t=>(es.streamType=t.value,t)},config:ts};var cs={module:{},config:{name:"system.battery",methods:[{name:"getStatus",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}};var ds={module:{},config:{name:"system.brightness",methods:[{name:"getValue",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"setValue",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getMode",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"setMode",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}};var hs,ps={module:{},config:{name:"system.calendar",methods:[{name:"insert",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}},us=ln(function(t,e){!function(t){var e="0123456789abcdefghijklmnopqrstuvwxyz";function n(t){return e.charAt(t)}function i(t,e){return t&e}function o(t,e){return t|e}function r(t,e){return t^e}function s(t,e){return t&~e}function a(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function l(t){for(var e=0;0!=t;)t&=t-1,++e;return e}var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d="=";function h(t){var e,n,i="";for(e=0;e+3<=t.length;e+=3)n=parseInt(t.substring(e,e+3),16),i+=c.charAt(n>>6)+c.charAt(63&n);for(e+1==t.length?(n=parseInt(t.substring(e,e+1),16),i+=c.charAt(n<<2)):e+2==t.length&&(n=parseInt(t.substring(e,e+2),16),i+=c.charAt(n>>2)+c.charAt((3&n)<<4));(3&i.length)>0;)i+=d;return i}function p(t){var e,i="",o=0,r=0;for(e=0;e<t.length&&t.charAt(e)!=d;++e){var s=c.indexOf(t.charAt(e));s<0||(0==o?(i+=n(s>>2),r=3&s,o=1):1==o?(i+=n(r<<2|s>>4),r=15&s,o=2):2==o?(i+=n(r),i+=n(s>>2),r=3&s,o=3):(i+=n(r<<2|s>>4),i+=n(15&s),o=0))}return 1==o&&(i+=n(r<<2)),i}var u,f,m=function(t,e){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},g={decode:function(t){var e;if(void 0===u){var n="0123456789ABCDEF",i=" \f\n\r\t \u2028\u2029";for(u={},e=0;e<16;++e)u[n.charAt(e)]=e;for(n=n.toLowerCase(),e=10;e<16;++e)u[n.charAt(e)]=e;for(e=0;e<i.length;++e)u[i.charAt(e)]=-1}var o=[],r=0,s=0;for(e=0;e<t.length;++e){var a=t.charAt(e);if("="==a)break;if(-1!=(a=u[a])){if(void 0===a)throw new Error("Illegal character at offset "+e);r|=a,++s>=2?(o[o.length]=r,r=0,s=0):r<<=4}}if(s)throw new Error("Hex encoding incomplete: 4 bits missing");return o}},y={decode:function(t){var e;if(void 0===f){var n="= \f\n\r\t \u2028\u2029";for(f=Object.create(null),e=0;e<64;++e)f["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)]=e;for(e=0;e<n.length;++e)f[n.charAt(e)]=-1}var i=[],o=0,r=0;for(e=0;e<t.length;++e){var s=t.charAt(e);if("="==s)break;if(-1!=(s=f[s])){if(void 0===s)throw new Error("Illegal character at offset "+e);o|=s,++r>=4?(i[i.length]=o>>16,i[i.length]=o>>8&255,i[i.length]=255&o,o=0,r=0):o<<=6}}switch(r){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:i[i.length]=o>>10;break;case 3:i[i.length]=o>>16,i[i.length]=o>>8&255}return i},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=y.re.exec(t);if(e)if(e[1])t=e[1];else{if(!e[2])throw new Error("RegExp out of sync");t=e[2]}return y.decode(t)}},b=function(){function t(t){this.buf=[+t||0]}return t.prototype.mulAdd=function(t,e){var n,i,o=this.buf,r=o.length;for(n=0;n<r;++n)(i=o[n]*t+e)<1e13?e=0:i-=1e13*(e=0|i/1e13),o[n]=i;e>0&&(o[n]=e)},t.prototype.sub=function(t){var e,n,i=this.buf,o=i.length;for(e=0;e<o;++e)(n=i[e]-t)<0?(n+=1e13,t=1):t=0,i[e]=n;for(;0===i[i.length-1];)i.pop()},t.prototype.toString=function(t){if(10!=(t||10))throw new Error("only base 10 is supported");for(var e=this.buf,n=e[e.length-1].toString(),i=e.length-2;i>=0;--i)n+=(1e13+e[i]).toString().substring(1);return n},t.prototype.valueOf=function(){for(var t=this.buf,e=0,n=t.length-1;n>=0;--n)e=1e13*e+t[n];return e},t.prototype.simplify=function(){var t=this.buf;return 1==t.length?t[0]:this},t}(),v="…",E=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,w=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function x(t,e){return t.length>e&&(t=t.substring(0,e)+v),t}var T,A=function(){function t(e,n){this.hexDigits="0123456789ABCDEF",e instanceof t?(this.enc=e.enc,this.pos=e.pos):(this.enc=e,this.pos=n)}return t.prototype.get=function(t){if(void 0===t&&(t=this.pos++),t>=this.enc.length)throw new Error("Requesting byte offset "+t+" on a stream of length "+this.enc.length);return"string"==typeof this.enc?this.enc.charCodeAt(t):this.enc[t]},t.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)},t.prototype.hexDump=function(t,e,n){for(var i="",o=t;o<e;++o)if(i+=this.hexByte(this.get(o)),!0!==n)switch(15&o){case 7:i+=" ";break;case 15:i+="\n";break;default:i+=" "}return i},t.prototype.isASCII=function(t,e){for(var n=t;n<e;++n){var i=this.get(n);if(i<32||i>176)return!1}return!0},t.prototype.parseStringISO=function(t,e){for(var n="",i=t;i<e;++i)n+=String.fromCharCode(this.get(i));return n},t.prototype.parseStringUTF=function(t,e){for(var n="",i=t;i<e;){var o=this.get(i++);n+=o<128?String.fromCharCode(o):o>191&&o<224?String.fromCharCode((31&o)<<6|63&this.get(i++)):String.fromCharCode((15&o)<<12|(63&this.get(i++))<<6|63&this.get(i++))}return n},t.prototype.parseStringBMP=function(t,e){for(var n,i,o="",r=t;r<e;)n=this.get(r++),i=this.get(r++),o+=String.fromCharCode(n<<8|i);return o},t.prototype.parseTime=function(t,e,n){var i=this.parseStringISO(t,e),o=(n?E:w).exec(i);return o?(n&&(o[1]=+o[1],o[1]+=+o[1]<70?2e3:1900),i=o[1]+"-"+o[2]+"-"+o[3]+" "+o[4],o[5]&&(i+=":"+o[5],o[6]&&(i+=":"+o[6],o[7]&&(i+="."+o[7]))),o[8]&&(i+=" UTC","Z"!=o[8]&&(i+=o[8],o[9]&&(i+=":"+o[9]))),i):"Unrecognized time: "+i},t.prototype.parseInteger=function(t,e){for(var n,i=this.get(t),o=i>127,r=o?255:0,s="";i==r&&++t<e;)i=this.get(t);if(0==(n=e-t))return o?-1:0;if(n>4){for(s=i,n<<=3;0==(128&(+s^r));)s=+s<<1,--n;s="("+n+" bit)\n"}o&&(i-=256);for(var a=new b(i),l=t+1;l<e;++l)a.mulAdd(256,this.get(l));return s+a.toString()},t.prototype.parseBitString=function(t,e,n){for(var i=this.get(t),o=(e-t-1<<3)-i,r="("+o+" bit)\n",s="",a=t+1;a<e;++a){for(var l=this.get(a),c=a==e-1?i:0,d=7;d>=c;--d)s+=l>>d&1?"1":"0";if(s.length>n)return r+x(s,n)}return r+s},t.prototype.parseOctetString=function(t,e,n){if(this.isASCII(t,e))return x(this.parseStringISO(t,e),n);var i=e-t,o="("+i+" byte)\n";i>(n/=2)&&(e=t+n);for(var r=t;r<e;++r)o+=this.hexByte(this.get(r));return i>n&&(o+=v),o},t.prototype.parseOID=function(t,e,n){for(var i="",o=new b,r=0,s=t;s<e;++s){var a=this.get(s);if(o.mulAdd(128,127&a),r+=7,!(128&a)){if(""===i)if((o=o.simplify())instanceof b)o.sub(80),i="2."+o.toString();else{var l=o<80?o<40?0:1:2;i=l+"."+(o-40*l)}else i+="."+o.toString();if(i.length>n)return x(i,n);o=new b,r=0}}return r>0&&(i+=".incomplete"),i},t}(),k=function(){function t(t,e,n,i,o){if(!(i instanceof _))throw new Error("Invalid tag value.");this.stream=t,this.header=e,this.length=n,this.tag=i,this.sub=o}return t.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},t.prototype.content=function(t){if(void 0===this.tag)return null;void 0===t&&(t=1/0);var e=this.posContent(),n=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+n,t);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(e)?"false":"true";case 2:return this.stream.parseInteger(e,e+n);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+n,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+n,t);case 6:return this.stream.parseOID(e,e+n,t);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return x(this.stream.parseStringUTF(e,e+n),t);case 18:case 19:case 20:case 21:case 22:case 26:return x(this.stream.parseStringISO(e,e+n),t);case 30:return x(this.stream.parseStringBMP(e,e+n),t);case 23:case 24:return this.stream.parseTime(e,e+n,23==this.tag.tagNumber)}return null},t.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},t.prototype.toPrettyString=function(t){void 0===t&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,this.tag.tagConstructed?e+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(e+=" (encapsulates)"),e+="\n",null!==this.sub){t+=" ";for(var n=0,i=this.sub.length;n<i;++n)e+=this.sub[n].toPrettyString(t)}return e},t.prototype.posStart=function(){return this.stream.pos},t.prototype.posContent=function(){return this.stream.pos+this.header},t.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},t.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},t.decodeLength=function(t){var e=t.get(),n=127&e;if(n==e)return n;if(n>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(0===n)return null;e=0;for(var i=0;i<n;++i)e=256*e+t.get();return e},t.prototype.getHexStringValue=function(){var t=this.toHexString(),e=2*this.header,n=2*this.length;return t.substr(e,n)},t.decode=function(e){var n;n=e instanceof A?e:new A(e,0);var i=new A(n),o=new _(n),r=t.decodeLength(n),s=n.pos,a=s-i.pos,l=null,c=function(){var e=[];if(null!==r){for(var i=s+r;n.pos<i;)e[e.length]=t.decode(n);if(n.pos!=i)throw new Error("Content size is not correct for container starting at offset "+s)}else try{for(;;){var o=t.decode(n);if(o.tag.isEOC())break;e[e.length]=o}r=s-n.pos}catch(t){throw new Error("Exception while decoding undefined length content: "+t)}return e};if(o.tagConstructed)l=c();else if(o.isUniversal()&&(3==o.tagNumber||4==o.tagNumber))try{if(3==o.tagNumber&&0!=n.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");l=c();for(var d=0;d<l.length;++d)if(l[d].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(t){l=null}if(null===l){if(null===r)throw new Error("We can't skip over an invalid tag with undefined length at offset "+s);n.pos=s+Math.abs(r)}return new t(i,a,r,o,l)},t}(),_=function(){function t(t){var e=t.get();if(this.tagClass=e>>6,this.tagConstructed=0!=(32&e),this.tagNumber=31&e,31==this.tagNumber){var n=new b;do{e=t.get(),n.mulAdd(128,127&e)}while(128&e);this.tagNumber=n.simplify()}}return t.prototype.isUniversal=function(){return 0===this.tagClass},t.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},t}(),C=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],S=(1<<26)/C[C.length-1],M=function(){function t(t,e,n){null!=t&&("number"==typeof t?this.fromNumber(t,e,n):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}return t.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var i,o=(1<<e)-1,r=!1,s="",a=this.t,l=this.DB-a*this.DB%e;if(a-- >0)for(l<this.DB&&(i=this[a]>>l)>0&&(r=!0,s=n(i));a>=0;)l<e?(i=(this[a]&(1<<l)-1)<<e-l,i|=this[--a]>>(l+=this.DB-e)):(i=this[a]>>(l-=e)&o,l<=0&&(l+=this.DB,--a)),i>0&&(r=!0),r&&(s+=n(i));return r?s:"0"},t.prototype.negate=function(){var e=P();return t.ZERO.subTo(this,e),e},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(0!=(e=n-t.t))return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+$(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var n=P();return this.abs().divRemTo(e,null,n),this.s<0&&n.compareTo(t.ZERO)>0&&e.subTo(n,n),n},t.prototype.modPowInt=function(t,e){var n;return n=t<256||e.isEven()?new D(e):new L(e),this.exp(t,n)},t.prototype.clone=function(){var t=P();return this.copyTo(t),t},t.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},t.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},t.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},t.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},t.prototype.toByteArray=function(){var t=this.t,e=[];e[0]=this.s;var n,i=this.DB-t*this.DB%8,o=0;if(t-- >0)for(i<this.DB&&(n=this[t]>>i)!=(this.s&this.DM)>>i&&(e[o++]=n|this.s<<this.DB-i);t>=0;)i<8?(n=(this[t]&(1<<i)-1)<<8-i,n|=this[--t]>>(i+=this.DB-8)):(n=this[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),0!=(128&n)&&(n|=-256),0==o&&(128&this.s)!=(128&n)&&++o,(o>0||n!=this.s)&&(e[o++]=n);return e},t.prototype.equals=function(t){return 0==this.compareTo(t)},t.prototype.min=function(t){return this.compareTo(t)<0?this:t},t.prototype.max=function(t){return this.compareTo(t)>0?this:t},t.prototype.and=function(t){var e=P();return this.bitwiseTo(t,i,e),e},t.prototype.or=function(t){var e=P();return this.bitwiseTo(t,o,e),e},t.prototype.xor=function(t){var e=P();return this.bitwiseTo(t,r,e),e},t.prototype.andNot=function(t){var e=P();return this.bitwiseTo(t,s,e),e},t.prototype.not=function(){for(var t=P(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},t.prototype.shiftLeft=function(t){var e=P();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},t.prototype.shiftRight=function(t){var e=P();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},t.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+a(this[t]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,n=0;n<this.t;++n)t+=l(this[n]^e);return t},t.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},t.prototype.setBit=function(t){return this.changeBit(t,o)},t.prototype.clearBit=function(t){return this.changeBit(t,s)},t.prototype.flipBit=function(t){return this.changeBit(t,r)},t.prototype.add=function(t){var e=P();return this.addTo(t,e),e},t.prototype.subtract=function(t){var e=P();return this.subTo(t,e),e},t.prototype.multiply=function(t){var e=P();return this.multiplyTo(t,e),e},t.prototype.divide=function(t){var e=P();return this.divRemTo(t,e,null),e},t.prototype.remainder=function(t){var e=P();return this.divRemTo(t,null,e),e},t.prototype.divideAndRemainder=function(t){var e=P(),n=P();return this.divRemTo(t,e,n),[e,n]},t.prototype.modPow=function(t,e){var n,i,o=t.bitLength(),r=H(1);if(o<=0)return r;n=o<18?1:o<48?3:o<144?4:o<768?5:6,i=o<8?new D(e):e.isEven()?new I(e):new L(e);var s=[],a=3,l=n-1,c=(1<<n)-1;if(s[1]=i.convert(this),n>1){var d=P();for(i.sqrTo(s[1],d);a<=c;)s[a]=P(),i.mulTo(d,s[a-2],s[a]),a+=2}var h,p,u=t.t-1,f=!0,m=P();for(o=$(t[u])-1;u>=0;){for(o>=l?h=t[u]>>o-l&c:(h=(t[u]&(1<<o+1)-1)<<l-o,u>0&&(h|=t[u-1]>>this.DB+o-l)),a=n;0==(1&h);)h>>=1,--a;if((o-=a)<0&&(o+=this.DB,--u),f)s[h].copyTo(r),f=!1;else{for(;a>1;)i.sqrTo(r,m),i.sqrTo(m,r),a-=2;a>0?i.sqrTo(r,m):(p=r,r=m,m=p),i.mulTo(m,s[h],r)}for(;u>=0&&0==(t[u]&1<<o);)i.sqrTo(r,m),p=r,r=m,m=p,--o<0&&(o=this.DB-1,--u)}return i.revert(r)},t.prototype.modInverse=function(e){var n=e.isEven();if(this.isEven()&&n||0==e.signum())return t.ZERO;for(var i=e.clone(),o=this.clone(),r=H(1),s=H(0),a=H(0),l=H(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),n?(r.isEven()&&s.isEven()||(r.addTo(this,r),s.subTo(e,s)),r.rShiftTo(1,r)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);for(;o.isEven();)o.rShiftTo(1,o),n?(a.isEven()&&l.isEven()||(a.addTo(this,a),l.subTo(e,l)),a.rShiftTo(1,a)):l.isEven()||l.subTo(e,l),l.rShiftTo(1,l);i.compareTo(o)>=0?(i.subTo(o,i),n&&r.subTo(a,r),s.subTo(l,s)):(o.subTo(i,o),n&&a.subTo(r,a),l.subTo(s,l))}return 0!=o.compareTo(t.ONE)?t.ZERO:l.compareTo(e)>=0?l.subtract(e):l.signum()<0?(l.addTo(e,l),l.signum()<0?l.add(e):l):l},t.prototype.pow=function(t){return this.exp(t,new O)},t.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(e.compareTo(n)<0){var i=e;e=n,n=i}var o=e.getLowestSetBit(),r=n.getLowestSetBit();if(r<0)return e;for(o<r&&(r=o),r>0&&(e.rShiftTo(r,e),n.rShiftTo(r,n));e.signum()>0;)(o=e.getLowestSetBit())>0&&e.rShiftTo(o,e),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return r>0&&n.lShiftTo(r,n),n},t.prototype.isProbablePrime=function(t){var e,n=this.abs();if(1==n.t&&n[0]<=C[C.length-1]){for(e=0;e<C.length;++e)if(n[0]==C[e])return!0;return!1}if(n.isEven())return!1;for(e=1;e<C.length;){for(var i=C[e],o=e+1;o<C.length&&i<S;)i*=C[o++];for(i=n.modInt(i);e<o;)if(i%C[e++]==0)return!1}return n.millerRabin(t)},t.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},t.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},t.prototype.fromString=function(e,n){var i;if(16==n)i=4;else if(8==n)i=3;else if(256==n)i=8;else if(2==n)i=1;else if(32==n)i=5;else{if(4!=n)return void this.fromRadix(e,n);i=2}this.t=0,this.s=0;for(var o=e.length,r=!1,s=0;--o>=0;){var a=8==i?255&+e[o]:j(e,o);a<0?"-"==e.charAt(o)&&(r=!0):(r=!1,0==s?this[this.t++]=a:s+i>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,(s+=i)>=this.DB&&(s-=this.DB))}8==i&&0!=(128&+e[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),r&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},t.prototype.dlShiftTo=function(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s},t.prototype.drShiftTo=function(t,e){for(var n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s},t.prototype.lShiftTo=function(t,e){for(var n=t%this.DB,i=this.DB-n,o=(1<<i)-1,r=Math.floor(t/this.DB),s=this.s<<n&this.DM,a=this.t-1;a>=0;--a)e[a+r+1]=this[a]>>i|s,s=(this[a]&o)<<n;for(var a=r-1;a>=0;--a)e[a]=0;e[r]=s,e.t=this.t+r+1,e.s=this.s,e.clamp()},t.prototype.rShiftTo=function(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)e.t=0;else{var i=t%this.DB,o=this.DB-i,r=(1<<i)-1;e[0]=this[n]>>i;for(var s=n+1;s<this.t;++s)e[s-n-1]|=(this[s]&r)<<o,e[s-n]=this[s]>>i;i>0&&(e[this.t-n-1]|=(this.s&r)<<o),e.t=this.t-n,e.clamp()}},t.prototype.subTo=function(t,e){for(var n=0,i=0,o=Math.min(t.t,this.t);n<o;)i+=this[n]-t[n],e[n++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i-=t.s;n<this.t;)i+=this[n],e[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<t.t;)i-=t[n],e[n++]=i&this.DM,i>>=this.DB;i-=t.s}e.s=i<0?-1:0,i<-1?e[n++]=this.DV+i:i>0&&(e[n++]=i),e.t=n,e.clamp()},t.prototype.multiplyTo=function(e,n){var i=this.abs(),o=e.abs(),r=i.t;for(n.t=r+o.t;--r>=0;)n[r]=0;for(r=0;r<o.t;++r)n[r+i.t]=i.am(0,o[r],n,r,0,i.t);n.s=0,n.clamp(),this.s!=e.s&&t.ZERO.subTo(n,n)},t.prototype.squareTo=function(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){var i=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,i,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()},t.prototype.divRemTo=function(e,n,i){var o=e.abs();if(!(o.t<=0)){var r=this.abs();if(r.t<o.t)return null!=n&&n.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=P());var s=P(),a=this.s,l=e.s,c=this.DB-$(o[o.t-1]);c>0?(o.lShiftTo(c,s),r.lShiftTo(c,i)):(o.copyTo(s),r.copyTo(i));var d=s.t,h=s[d-1];if(0!=h){var p=h*(1<<this.F1)+(d>1?s[d-2]>>this.F2:0),u=this.FV/p,f=(1<<this.F1)/p,m=1<<this.F2,g=i.t,y=g-d,b=null==n?P():n;for(s.dlShiftTo(y,b),i.compareTo(b)>=0&&(i[i.t++]=1,i.subTo(b,i)),t.ONE.dlShiftTo(d,b),b.subTo(s,s);s.t<d;)s[s.t++]=0;for(;--y>=0;){var v=i[--g]==h?this.DM:Math.floor(i[g]*u+(i[g-1]+m)*f);if((i[g]+=s.am(0,v,i,y,0,d))<v)for(s.dlShiftTo(y,b),i.subTo(b,i);i[g]<--v;)i.subTo(b,i)}null!=n&&(i.drShiftTo(d,n),a!=l&&t.ZERO.subTo(n,n)),i.t=d,i.clamp(),c>0&&i.rShiftTo(c,i),a<0&&t.ZERO.subTo(i,i)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},t.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},t.prototype.exp=function(e,n){if(e>4294967295||e<1)return t.ONE;var i=P(),o=P(),r=n.convert(this),s=$(e)-1;for(r.copyTo(i);--s>=0;)if(n.sqrTo(i,o),(e&1<<s)>0)n.mulTo(o,r,i);else{var a=i;i=o,o=a}return n.revert(i)},t.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},t.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),i=H(n),o=P(),r=P(),s="";for(this.divRemTo(i,o,r);o.signum()>0;)s=(n+r.intValue()).toString(t).substr(1)+s,o.divRemTo(i,o,r);return r.intValue().toString(t)+s},t.prototype.fromRadix=function(e,n){this.fromInt(0),null==n&&(n=10);for(var i=this.chunkSize(n),o=Math.pow(n,i),r=!1,s=0,a=0,l=0;l<e.length;++l){var c=j(e,l);c<0?"-"==e.charAt(l)&&0==this.signum()&&(r=!0):(a=n*a+c,++s>=i&&(this.dMultiply(o),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(n,s)),this.dAddOffset(a,0)),r&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,n,i){if("number"==typeof n)if(e<2)this.fromInt(1);else for(this.fromNumber(e,i),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),o,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(n);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(t.ONE.shiftLeft(e-1),this);else{var r=[],s=7&e;r.length=1+(e>>3),n.nextBytes(r),s>0?r[0]&=(1<<s)-1:r[0]=0,this.fromString(r,256)}},t.prototype.bitwiseTo=function(t,e,n){var i,o,r=Math.min(t.t,this.t);for(i=0;i<r;++i)n[i]=e(this[i],t[i]);if(t.t<this.t){for(o=t.s&this.DM,i=r;i<this.t;++i)n[i]=e(this[i],o);n.t=this.t}else{for(o=this.s&this.DM,i=r;i<t.t;++i)n[i]=e(o,t[i]);n.t=t.t}n.s=e(this.s,t.s),n.clamp()},t.prototype.changeBit=function(e,n){var i=t.ONE.shiftLeft(e);return this.bitwiseTo(i,n,i),i},t.prototype.addTo=function(t,e){for(var n=0,i=0,o=Math.min(t.t,this.t);n<o;)i+=this[n]+t[n],e[n++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i+=t.s;n<this.t;)i+=this[n],e[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<t.t;)i+=t[n],e[n++]=i&this.DM,i>>=this.DB;i+=t.s}e.s=i<0?-1:0,i>0?e[n++]=i:i<-1&&(e[n++]=this.DV+i),e.t=n,e.clamp()},t.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},t.prototype.multiplyLowerTo=function(t,e,n){var i=Math.min(this.t+t.t,e);for(n.s=0,n.t=i;i>0;)n[--i]=0;for(var o=n.t-this.t;i<o;++i)n[i+this.t]=this.am(0,t[i],n,i,0,this.t);for(var o=Math.min(t.t,e);i<o;++i)this.am(0,t[i],n,i,0,e-i);n.clamp()},t.prototype.multiplyUpperTo=function(t,e,n){--e;var i=n.t=this.t+t.t-e;for(n.s=0;--i>=0;)n[i]=0;for(i=Math.max(e-this.t,0);i<t.t;++i)n[this.t+i-e]=this.am(e-i,t[i],n,0,0,this.t+i-e);n.clamp(),n.drShiftTo(1,n)},t.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,n=this.s<0?t-1:0;if(this.t>0)if(0==e)n=this[0]%t;else for(var i=this.t-1;i>=0;--i)n=(e*n+this[i])%t;return n},t.prototype.millerRabin=function(e){var n=this.subtract(t.ONE),i=n.getLowestSetBit();if(i<=0)return!1;var o=n.shiftRight(i);(e=e+1>>1)>C.length&&(e=C.length);for(var r=P(),s=0;s<e;++s){r.fromInt(C[Math.floor(Math.random()*C.length)]);var a=r.modPow(o,this);if(0!=a.compareTo(t.ONE)&&0!=a.compareTo(n)){for(var l=1;l++<i&&0!=a.compareTo(n);)if(0==(a=a.modPowInt(2,this)).compareTo(t.ONE))return!1;if(0!=a.compareTo(n))return!1}}return!0},t.prototype.square=function(){var t=P();return this.squareTo(t),t},t.prototype.gcda=function(t,e){var n=this.s<0?this.negate():this.clone(),i=t.s<0?t.negate():t.clone();if(n.compareTo(i)<0){var o=n;n=i,i=o}var r=n.getLowestSetBit(),s=i.getLowestSetBit();if(s<0)e(n);else{r<s&&(s=r),s>0&&(n.rShiftTo(s,n),i.rShiftTo(s,i));var a=function(){(r=n.getLowestSetBit())>0&&n.rShiftTo(r,n),(r=i.getLowestSetBit())>0&&i.rShiftTo(r,i),n.compareTo(i)>=0?(n.subTo(i,n),n.rShiftTo(1,n)):(i.subTo(n,i),i.rShiftTo(1,i)),n.signum()>0?setTimeout(a,0):(s>0&&i.lShiftTo(s,i),setTimeout(function(){e(i)},0))};setTimeout(a,10)}},t.prototype.fromNumberAsync=function(e,n,i,r){if("number"==typeof n)if(e<2)this.fromInt(1);else{this.fromNumber(e,i),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),o,this),this.isEven()&&this.dAddOffset(1,0);var s=this,a=function(){s.dAddOffset(2,0),s.bitLength()>e&&s.subTo(t.ONE.shiftLeft(e-1),s),s.isProbablePrime(n)?setTimeout(function(){r()},0):setTimeout(a,0)};setTimeout(a,0)}else{var l=[],c=7&e;l.length=1+(e>>3),n.nextBytes(l),c>0?l[0]&=(1<<c)-1:l[0]=0,this.fromString(l,256)}},t}(),O=function(){function t(){}return t.prototype.convert=function(t){return t},t.prototype.revert=function(t){return t},t.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},t.prototype.sqrTo=function(t,e){t.squareTo(e)},t}(),D=function(){function t(t){this.m=t}return t.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},t.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),L=function(){function t(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}return t.prototype.convert=function(t){var e=P();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(M.ZERO)>0&&this.m.subTo(e,e),e},t.prototype.revert=function(t){var e=P();return t.copyTo(e),this.reduce(e),e},t.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=32767&t[e],i=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t[n]+=this.m.am(0,i,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),I=function(){function t(t){this.m=t,this.r2=P(),this.q3=P(),M.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return t.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=P();return t.copyTo(e),this.reduce(e),e},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}();function P(){return new M(null)}function N(t,e){return new M(t,e)}"Microsoft Internet Explorer"==navigator.appName?(M.prototype.am=function(t,e,n,i,o,r){for(var s=32767&e,a=e>>15;--r>=0;){var l=32767&this[t],c=this[t++]>>15,d=a*l+c*s;l=s*l+((32767&d)<<15)+n[i]+(1073741823&o),o=(l>>>30)+(d>>>15)+a*c+(o>>>30),n[i++]=1073741823&l}return o},T=30):"Netscape"!=navigator.appName?(M.prototype.am=function(t,e,n,i,o,r){for(;--r>=0;){var s=e*this[t++]+n[i]+o;o=Math.floor(s/67108864),n[i++]=67108863&s}return o},T=26):(M.prototype.am=function(t,e,n,i,o,r){for(var s=16383&e,a=e>>14;--r>=0;){var l=16383&this[t],c=this[t++]>>14,d=a*l+c*s;l=s*l+((16383&d)<<14)+n[i]+o,o=(l>>28)+(d>>14)+a*c,n[i++]=268435455&l}return o},T=28),M.prototype.DB=T,M.prototype.DM=(1<<T)-1,M.prototype.DV=1<<T,M.prototype.FV=Math.pow(2,52),M.prototype.F1=52-T,M.prototype.F2=2*T-52;var R,F,B=[];for(R="0".charCodeAt(0),F=0;F<=9;++F)B[R++]=F;for(R="a".charCodeAt(0),F=10;F<36;++F)B[R++]=F;for(R="A".charCodeAt(0),F=10;F<36;++F)B[R++]=F;function j(t,e){var n=B[t.charCodeAt(e)];return null==n?-1:n}function H(t){var e=P();return e.fromInt(t),e}function $(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}M.ZERO=H(0),M.ONE=H(1);var z,Y,W=function(){function t(){this.i=0,this.j=0,this.S=[]}return t.prototype.init=function(t){var e,n,i;for(e=0;e<256;++e)this.S[e]=e;for(n=0,e=0;e<256;++e)n=n+this.S[e]+t[e%t.length]&255,i=this.S[e],this.S[e]=this.S[n],this.S[n]=i;this.i=0,this.j=0},t.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},t}(),V=256,U=null;if(null==U){U=[],Y=0;var q=void 0;if(window.crypto&&window.crypto.getRandomValues){var G=new Uint32Array(256);for(window.crypto.getRandomValues(G),q=0;q<G.length;++q)U[Y++]=255&G[q]}var J=function(t){if(this.count=this.count||0,this.count>=256||Y>=V)window.removeEventListener?window.removeEventListener("mousemove",J,!1):window.detachEvent&&window.detachEvent("onmousemove",J);else try{var e=t.x+t.y;U[Y++]=255&e,this.count+=1}catch(t){}};window.addEventListener?window.addEventListener("mousemove",J,!1):window.attachEvent&&window.attachEvent("onmousemove",J)}function K(){if(null==z){for(z=new W;Y<V;){var t=Math.floor(65536*Math.random());U[Y++]=255&t}for(z.init(U),Y=0;Y<U.length;++Y)U[Y]=0;Y=0}return z.next()}var Z=function(){function t(){}return t.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=K()},t}(),Q=function(){function t(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return t.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},t.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),n=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(n)<0;)e=e.add(this.p);return e.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)},t.prototype.setPublic=function(t,e){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=N(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},t.prototype.encrypt=function(t){var e=function(t,e){if(e<t.length+11)return console.error("Message too long for RSA"),null;for(var n=[],i=t.length-1;i>=0&&e>0;){var o=t.charCodeAt(i--);o<128?n[--e]=o:o>127&&o<2048?(n[--e]=63&o|128,n[--e]=o>>6|192):(n[--e]=63&o|128,n[--e]=o>>6&63|128,n[--e]=o>>12|224)}n[--e]=0;for(var r=new Z,s=[];e>2;){for(s[0]=0;0==s[0];)r.nextBytes(s);n[--e]=s[0]}return n[--e]=2,n[--e]=0,new M(n)}(t,this.n.bitLength()+7>>3);if(null==e)return null;var n=this.doPublic(e);if(null==n)return null;var i=n.toString(16);return 0==(1&i.length)?i:"0"+i},t.prototype.setPrivate=function(t,e,n){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=N(t,16),this.e=parseInt(e,16),this.d=N(n,16)):console.error("Invalid RSA private key")},t.prototype.setPrivateEx=function(t,e,n,i,o,r,s,a){null!=t&&null!=e&&t.length>0&&e.length>0?(this.n=N(t,16),this.e=parseInt(e,16),this.d=N(n,16),this.p=N(i,16),this.q=N(o,16),this.dmp1=N(r,16),this.dmq1=N(s,16),this.coeff=N(a,16)):console.error("Invalid RSA private key")},t.prototype.generate=function(t,e){var n=new Z,i=t>>1;this.e=parseInt(e,16);for(var o=new M(e,16);;){for(;this.p=new M(t-i,1,n),0!=this.p.subtract(M.ONE).gcd(o).compareTo(M.ONE)||!this.p.isProbablePrime(10););for(;this.q=new M(i,1,n),0!=this.q.subtract(M.ONE).gcd(o).compareTo(M.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var r=this.p;this.p=this.q,this.q=r}var s=this.p.subtract(M.ONE),a=this.q.subtract(M.ONE),l=s.multiply(a);if(0==l.gcd(o).compareTo(M.ONE)){this.n=this.p.multiply(this.q),this.d=o.modInverse(l),this.dmp1=this.d.mod(s),this.dmq1=this.d.mod(a),this.coeff=this.q.modInverse(this.p);break}}},t.prototype.decrypt=function(t){var e=N(t,16),n=this.doPrivate(e);return null==n?null:function(t,e){for(var n=t.toByteArray(),i=0;i<n.length&&0==n[i];)++i;if(n.length-i!=e-1||2!=n[i])return null;for(++i;0!=n[i];)if(++i>=n.length)return null;for(var o="";++i<n.length;){var r=255&n[i];r<128?o+=String.fromCharCode(r):r>191&&r<224?(o+=String.fromCharCode((31&r)<<6|63&n[i+1]),++i):(o+=String.fromCharCode((15&r)<<12|(63&n[i+1])<<6|63&n[i+2]),i+=2)}return o}(n,this.n.bitLength()+7>>3)},t.prototype.generateAsync=function(t,e,n){var i=new Z,o=t>>1;this.e=parseInt(e,16);var r=new M(e,16),s=this,a=function(){var e=function(){if(s.p.compareTo(s.q)<=0){var t=s.p;s.p=s.q,s.q=t}var e=s.p.subtract(M.ONE),i=s.q.subtract(M.ONE),o=e.multiply(i);0==o.gcd(r).compareTo(M.ONE)?(s.n=s.p.multiply(s.q),s.d=r.modInverse(o),s.dmp1=s.d.mod(e),s.dmq1=s.d.mod(i),s.coeff=s.q.modInverse(s.p),setTimeout(function(){n()},0)):setTimeout(a,0)},l=function(){s.q=P(),s.q.fromNumberAsync(o,1,i,function(){s.q.subtract(M.ONE).gcda(r,function(t){0==t.compareTo(M.ONE)&&s.q.isProbablePrime(10)?setTimeout(e,0):setTimeout(l,0)})})},c=function(){s.p=P(),s.p.fromNumberAsync(t-o,1,i,function(){s.p.subtract(M.ONE).gcda(r,function(t){0==t.compareTo(M.ONE)&&s.p.isProbablePrime(10)?setTimeout(l,0):setTimeout(c,0)})})};setTimeout(c,0)};setTimeout(a,0)},t.prototype.sign=function(t,e,n){var i=X[n]||"",o=i+e(t).toString(),r=function(t,e){if(e<t.length+22)return console.error("Message too long for RSA"),null;for(var n=e-t.length-6,i="",o=0;o<n;o+=2)i+="ff";return N("0001"+i+"00"+t,16)}(o,this.n.bitLength()/4);if(null==r)return null;var s=this.doPrivate(r);if(null==s)return null;var a=s.toString(16);return 0==(1&a.length)?a:"0"+a},t.prototype.verify=function(t,e,n){var i=N(e,16),o=this.doPublic(i);if(null==o)return null;var r=o.toString(16).replace(/^1f+00/,""),s=function(t){for(var e in X)if(X.hasOwnProperty(e)){var n=X[e],i=n.length;if(t.substr(0,i)==n)return t.substr(i)}return t}(r);return s==n(t).toString()},t}(),X={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"},tt={};tt.lang={extend:function(t,e,n){if(!e||!t)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var i=function(){};if(i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e),n){var o;for(o in n)t.prototype[o]=n[o];var r=function(){},s=["toString","valueOf"];try{/MSIE/.test(navigator.userAgent)&&(r=function(t,e){for(o=0;o<s.length;o+=1){var n=s[o],i=e[n];"function"==typeof i&&i!=Object.prototype[n]&&(t[n]=i)}})}catch(t){}r(t.prototype,n)}}};var et={};void 0!==et.asn1&&et.asn1||(et.asn1={}),et.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var n=e.substr(1),i=n.length;i%2==1?i+=1:e.match(/^[0-7]/)||(i+=2);for(var o="",r=0;r<i;r++)o+="f";var s=new M(o,16),a=s.xor(t).add(M.ONE);e=a.toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return hextopem(t,e)},this.newObject=function(t){var e=et,n=e.asn1,i=n.DERBoolean,o=n.DERInteger,r=n.DERBitString,s=n.DEROctetString,a=n.DERNull,l=n.DERObjectIdentifier,c=n.DEREnumerated,d=n.DERUTF8String,h=n.DERNumericString,p=n.DERPrintableString,u=n.DERTeletexString,f=n.DERIA5String,m=n.DERUTCTime,g=n.DERGeneralizedTime,y=n.DERSequence,b=n.DERSet,v=n.DERTaggedObject,E=n.ASN1Util.newObject,w=Object.keys(t);if(1!=w.length)throw"key of param shall be only one.";var x=w[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+x+":"))throw"undefined key: "+x;if("bool"==x)return new i(t[x]);if("int"==x)return new o(t[x]);if("bitstr"==x)return new r(t[x]);if("octstr"==x)return new s(t[x]);if("null"==x)return new a(t[x]);if("oid"==x)return new l(t[x]);if("enum"==x)return new c(t[x]);if("utf8str"==x)return new d(t[x]);if("numstr"==x)return new h(t[x]);if("prnstr"==x)return new p(t[x]);if("telstr"==x)return new u(t[x]);if("ia5str"==x)return new f(t[x]);if("utctime"==x)return new m(t[x]);if("gentime"==x)return new g(t[x]);if("seq"==x){for(var T=t[x],A=[],k=0;k<T.length;k++){var _=E(T[k]);A.push(_)}return new y({array:A})}if("set"==x){for(var T=t[x],A=[],k=0;k<T.length;k++){var _=E(T[k]);A.push(_)}return new b({array:A})}if("tag"==x){var C=t[x];if("[object Array]"===Object.prototype.toString.call(C)&&3==C.length){var S=E(C[2]);return new v({tag:C[0],explicit:C[1],obj:S})}var M={};if(void 0!==C.explicit&&(M.explicit=C.explicit),void 0!==C.tag&&(M.tag=C.tag),void 0===C.obj)throw"obj shall be specified for 'tag'.";return M.obj=E(C.obj),new v(M)}},this.jsonToASN1HEX=function(t){var e=this.newObject(t);return e.getEncodedHex()}},et.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",n=parseInt(t.substr(0,2),16),i=Math.floor(n/40),o=n%40,e=i+"."+o,r="",s=2;s<t.length;s+=2){var a=parseInt(t.substr(s,2),16),l=("00000000"+a.toString(2)).slice(-8);if(r+=l.substr(1,7),"0"==l.substr(0,1)){var c=new M(r,2);e=e+"."+c.toString(10),r=""}}return e},et.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},n=function(t){var n="",i=new M(t,10),o=i.toString(2),r=7-o.length%7;7==r&&(r=0);for(var s="",a=0;a<r;a++)s+="0";o=s+o;for(var a=0;a<o.length-1;a+=7){var l=o.substr(a,7);a!=o.length-7&&(l="1"+l),n+=e(parseInt(l,2))}return n};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var i="",o=t.split("."),r=40*parseInt(o[0])+parseInt(o[1]);i+=e(r),o.splice(0,2);for(var s=0;s<o.length;s++)i+=n(o[s]);return i},et.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+"".length+",v="+this.hV;var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var n=e.length/2;if(n>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);var i=128+n;return i.toString(16)+e},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},et.asn1.DERAbstractString=function(t){et.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},tt.lang.extend(et.asn1.DERAbstractString,et.asn1.ASN1Object),et.asn1.DERAbstractTime=function(t){et.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){utc=t.getTime()+6e4*t.getTimezoneOffset();var e=new Date(utc);return e},this.formatDate=function(t,e,n){var i=this.zeroPadding,o=this.localDateToUTC(t),r=String(o.getFullYear());"utc"==e&&(r=r.substr(2,2));var s=i(String(o.getMonth()+1),2),a=i(String(o.getDate()),2),l=i(String(o.getHours()),2),c=i(String(o.getMinutes()),2),d=i(String(o.getSeconds()),2),h=r+s+a+l+c+d;if(!0===n){var p=o.getMilliseconds();if(0!=p){var u=i(String(p),3);u=u.replace(/[0]+$/,""),h=h+"."+u}}return h+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(t)},this.setByDateValue=function(t,e,n,i,o,r){var s=new Date(Date.UTC(t,e-1,n,i,o,r,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},tt.lang.extend(et.asn1.DERAbstractTime,et.asn1.ASN1Object),et.asn1.DERAbstractStructured=function(t){et.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},tt.lang.extend(et.asn1.DERAbstractStructured,et.asn1.ASN1Object),et.asn1.DERBoolean=function(){et.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},tt.lang.extend(et.asn1.DERBoolean,et.asn1.ASN1Object),et.asn1.DERInteger=function(t){et.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=et.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new M(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},tt.lang.extend(et.asn1.DERInteger,et.asn1.ASN1Object),et.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=et.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}et.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var n="0"+t;this.hTLV=null,this.isModified=!0,this.hV=n+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0);for(var n=0;n<=e;n++)t+="0";for(var i="",n=0;n<t.length-1;n+=8){var o=t.substr(n,8),r=parseInt(o,2).toString(16);1==r.length&&(r="0"+r),i+=r}this.hTLV=null,this.isModified=!0,this.hV="0"+e+i},this.setByBooleanArray=function(t){for(var e="",n=0;n<t.length;n++)1==t[n]?e+="1":e+="0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},tt.lang.extend(et.asn1.DERBitString,et.asn1.ASN1Object),et.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=et.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}et.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},tt.lang.extend(et.asn1.DEROctetString,et.asn1.DERAbstractString),et.asn1.DERNull=function(){et.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},tt.lang.extend(et.asn1.DERNull,et.asn1.ASN1Object),et.asn1.DERObjectIdentifier=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},n=function(t){var n="",i=new M(t,10),o=i.toString(2),r=7-o.length%7;7==r&&(r=0);for(var s="",a=0;a<r;a++)s+="0";o=s+o;for(var a=0;a<o.length-1;a+=7){var l=o.substr(a,7);a!=o.length-7&&(l="1"+l),n+=e(parseInt(l,2))}return n};et.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var i="",o=t.split("."),r=40*parseInt(o[0])+parseInt(o[1]);i+=e(r),o.splice(0,2);for(var s=0;s<o.length;s++)i+=n(o[s]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=i},this.setValueName=function(t){var e=et.asn1.x509.OID.name2oid(t);if(""===e)throw"DERObjectIdentifier oidName undefined: "+t;this.setValueOidString(e)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t):void 0!==t.oid?this.setValueOidString(t.oid):void 0!==t.hex?this.setValueHex(t.hex):void 0!==t.name&&this.setValueName(t.name))},tt.lang.extend(et.asn1.DERObjectIdentifier,et.asn1.ASN1Object),et.asn1.DEREnumerated=function(t){et.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=et.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new M(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},tt.lang.extend(et.asn1.DEREnumerated,et.asn1.ASN1Object),et.asn1.DERUTF8String=function(t){et.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},tt.lang.extend(et.asn1.DERUTF8String,et.asn1.DERAbstractString),et.asn1.DERNumericString=function(t){et.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},tt.lang.extend(et.asn1.DERNumericString,et.asn1.DERAbstractString),et.asn1.DERPrintableString=function(t){et.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},tt.lang.extend(et.asn1.DERPrintableString,et.asn1.DERAbstractString),et.asn1.DERTeletexString=function(t){et.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},tt.lang.extend(et.asn1.DERTeletexString,et.asn1.DERAbstractString),et.asn1.DERIA5String=function(t){et.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},tt.lang.extend(et.asn1.DERIA5String,et.asn1.DERAbstractString),et.asn1.DERUTCTime=function(t){et.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{12}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date))},tt.lang.extend(et.asn1.DERUTCTime,et.asn1.DERAbstractTime),et.asn1.DERGeneralizedTime=function(t){et.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{14}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date),!0===t.millis&&(this.withMillis=!0))},tt.lang.extend(et.asn1.DERGeneralizedTime,et.asn1.DERAbstractTime),et.asn1.DERSequence=function(t){et.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++){var n=this.asn1Array[e];t+=n.getEncodedHex()}return this.hV=t,this.hV}},tt.lang.extend(et.asn1.DERSequence,et.asn1.DERAbstractStructured),et.asn1.DERSet=function(t){et.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var n=this.asn1Array[e];t.push(n.getEncodedHex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},tt.lang.extend(et.asn1.DERSet,et.asn1.DERAbstractStructured),et.asn1.DERTaggedObject=function(t){et.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,n){this.hT=e,this.isExplicit=t,this.asn1Object=n,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=n.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,e),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.tag&&(this.hT=t.tag),void 0!==t.explicit&&(this.isExplicit=t.explicit),void 0!==t.obj&&(this.asn1Object=t.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},tt.lang.extend(et.asn1.DERTaggedObject,et.asn1.ASN1Object);var nt=function(t){function e(n){var i=t.call(this)||this;return n&&("string"==typeof n?i.parseKey(n):(e.hasPrivateKeyProperty(n)||e.hasPublicKeyProperty(n))&&i.parsePropertiesFrom(n)),i}return function(t,e){function n(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.parseKey=function(t){try{var e=0,n=0,i=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(t)?g.decode(t):y.unarmor(t),o=k.decode(i);if(3===o.sub.length&&(o=o.sub[2].sub[0]),9===o.sub.length){e=o.sub[1].getHexStringValue(),this.n=N(e,16),n=o.sub[2].getHexStringValue(),this.e=parseInt(n,16);var r=o.sub[3].getHexStringValue();this.d=N(r,16);var s=o.sub[4].getHexStringValue();this.p=N(s,16);var a=o.sub[5].getHexStringValue();this.q=N(a,16);var l=o.sub[6].getHexStringValue();this.dmp1=N(l,16);var c=o.sub[7].getHexStringValue();this.dmq1=N(c,16);var d=o.sub[8].getHexStringValue();this.coeff=N(d,16)}else{if(2!==o.sub.length)return!1;var h=o.sub[1],p=h.sub[0];e=p.sub[0].getHexStringValue(),this.n=N(e,16),n=p.sub[1].getHexStringValue(),this.e=parseInt(n,16)}return!0}catch(t){return!1}},e.prototype.getPrivateBaseKey=function(){var t={array:[new et.asn1.DERInteger({int:0}),new et.asn1.DERInteger({bigint:this.n}),new et.asn1.DERInteger({int:this.e}),new et.asn1.DERInteger({bigint:this.d}),new et.asn1.DERInteger({bigint:this.p}),new et.asn1.DERInteger({bigint:this.q}),new et.asn1.DERInteger({bigint:this.dmp1}),new et.asn1.DERInteger({bigint:this.dmq1}),new et.asn1.DERInteger({bigint:this.coeff})]},e=new et.asn1.DERSequence(t);return e.getEncodedHex()},e.prototype.getPrivateBaseKeyB64=function(){return h(this.getPrivateBaseKey())},e.prototype.getPublicBaseKey=function(){var t=new et.asn1.DERSequence({array:[new et.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new et.asn1.DERNull]}),e=new et.asn1.DERSequence({array:[new et.asn1.DERInteger({bigint:this.n}),new et.asn1.DERInteger({int:this.e})]}),n=new et.asn1.DERBitString({hex:"00"+e.getEncodedHex()}),i=new et.asn1.DERSequence({array:[t,n]});return i.getEncodedHex()},e.prototype.getPublicBaseKeyB64=function(){return h(this.getPublicBaseKey())},e.wordwrap=function(t,e){if(e=e||64,!t)return t;var n="(.{1,"+e+"})( +|$\n?)|(.{1,"+e+"})";return t.match(RegExp(n,"g")).join("\n")},e.prototype.getPrivateKey=function(){var t="-----BEGIN RSA PRIVATE KEY-----\n";return t+=e.wordwrap(this.getPrivateBaseKeyB64())+"\n",t+="-----END RSA PRIVATE KEY-----"},e.prototype.getPublicKey=function(){var t="-----BEGIN PUBLIC KEY-----\n";return t+=e.wordwrap(this.getPublicBaseKeyB64())+"\n",t+="-----END PUBLIC KEY-----"},e.hasPublicKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")},e.hasPrivateKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")},e.prototype.parsePropertiesFrom=function(t){this.n=t.n,this.e=t.e,t.hasOwnProperty("d")&&(this.d=t.d,this.p=t.p,this.q=t.q,this.dmp1=t.dmp1,this.dmq1=t.dmq1,this.coeff=t.coeff)},e}(Q),it=function(){function t(t){t=t||{},this.default_key_size=parseInt(t.default_key_size,10)||1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=null}return t.prototype.setKey=function(t){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new nt(t)},t.prototype.setPrivateKey=function(t){this.setKey(t)},t.prototype.setPublicKey=function(t){this.setKey(t)},t.prototype.decrypt=function(t){try{return this.getKey().decrypt(p(t))}catch(t){return!1}},t.prototype.encrypt=function(t){try{return h(this.getKey().encrypt(t))}catch(t){return!1}},t.prototype.sign=function(t,e,n){try{return h(this.getKey().sign(t,e,n))}catch(t){return!1}},t.prototype.verify=function(t,e,n){try{return this.getKey().verify(t,p(e),n)}catch(t){return!1}},t.prototype.getKey=function(t){if(!this.key){if(this.key=new nt,t&&"[object Function]"==={}.toString.call(t))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},t.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},t.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},t.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},t.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},t.version="3.0.0-rc.1",t}();window.JSEncrypt=it,t.JSEncrypt=it,t.default=it,Object.defineProperty(t,"__esModule",{value:!0})}(e)}),fs=(hs=us)&&hs.__esModule&&Object.prototype.hasOwnProperty.call(hs,"default")?hs.default:hs;function ms(t,e,n){"function"==typeof t&&("fail"===n?t("h5 RSA 错误, 请以真机调试结果为准!!",200):t({text:e}))}var gs={module:{rsa:function(t){let e;console.warn("== system.cipher接口 ,请以真机调试为准 =="),t.transformation&&console.warn("== web预览system.cipher接口,参数暂时不支持 transformation ,请以真机调试为准 =="),"encrypt"===t.action?e=function(t,e){const n=new fs;return n.setPublicKey(t),n.encrypt(e)}(t.key,t.text):"decrypt"===t.action?e=function(t,e){const n=new fs;return n.setPrivateKey(t),n.decrypt(e)}(t.key,t.text):console.error(`action:${t.action}. action 只支持 encrypt, decrypt!!`),e?ms(t.success,e):ms(t.fail,e,"fail"),ms(t.complete,e)}},config:{name:"system.cipher",methods:[{name:"rsa",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}};var ys={module:{list(t={}){console.warn("==contact.list()返回为模拟数据,请使用真机调试体验完整功能==");const e={contactList:[]};e.contactList.push({displayName:"Tom",number:"136784374738"}),e.contactList.push({displayName:"Jerry",number:"132334453434"}),e.contactList.push({displayName:"Host",number:"135343637567"}),t.success(e)}},config:{name:"system.contact",methods:[{name:"pick",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"list",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}};var bs={module:{},config:{name:"system.notification",methods:[{name:"show",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC}]}};var vs={module:{},config:{name:"system.package",methods:[{name:"hasInstalled",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"install",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}};var Es={module:{},config:{name:"system.record",methods:[{name:"start",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"stop",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}};var ws={module:{},config:{name:"system.sensor",methods:[{name:"subscribeAccelerometer",type:Vo.TYPE.METHOD,mode:Vo.MODE.SUBSCRIBE},{name:"unsubscribeAccelerometer",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"subscribeCompass",type:Vo.TYPE.METHOD,mode:Vo.MODE.SUBSCRIBE},{name:"unsubscribeCompass",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"subscribeProximity",type:Vo.TYPE.METHOD,mode:Vo.MODE.SUBSCRIBE},{name:"unsubscribeProximity",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"subscribeLight",type:Vo.TYPE.METHOD,mode:Vo.MODE.SUBSCRIBE},{name:"unsubscribeLight",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"subscribeStepCounter",type:Vo.TYPE.METHOD,mode:Vo.MODE.SUBSCRIBE},{name:"unsubscribeStepCounter",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC}]}};var xs={module:{},config:{name:"system.shortcut",methods:[{name:"install",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"hasInstalled",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"__getSystemPromptEnabled",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.READ,alias:"systemPromptEnabled"},{name:"__setSystemPromptEnabled",type:Vo.TYPE.ATTRIBUTE,mode:Vo.MODE.SYNC,access:Vo.ACCESS.WRITE,alias:"systemPromptEnabled"}]}};var Ts={module:{readSafely(t={}){console.warn("==sms.readSafely()返回为模拟数据,请使用真机调试体验完整功能==");const e={message:"456342"};t.success(e)}},config:{name:"system.sms",methods:[{name:"send",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"readSafely",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}};var As={module:{},config:{name:"system.vibrator",methods:[{name:"vibrate",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC}]}};var ks={module:{},config:{name:"system.volume",methods:[{name:"setMediaValue",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getMediaValue",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}};class _s{constructor(t,e=["protocol"]){const n=new WebSocket(t);this._init(n),this.instance=n}_init(t){t.onopen=(()=>{this.onopen()}),t.onmessage=(t=>{this.onmessage(t)}),t.onclose=(()=>{this.onclose({code:0,reason:"",wasClean:!0})}),t.onerror=(t=>{console.log(t.data),this.onerror(t.data)})}send(t){this.instance.send(t.data),t.success&&t.success()}close(t){this.instance.close(t.code,t.reason),t.success&&t.success()}onopen(){}onmessage(){}onclose(){}onerror(){}}Object.defineProperty(_s.prototype,"send",{writable:!1,configurable:!1}),Object.defineProperty(_s.prototype,"close",{writable:!1,configurable:!1});var Cs={module:{create:(t={})=>(Vo.polyfillPrompt("system.websocketfactory","create",t),t.header&&console.warn("### Web Render ### system.websocketfactory => create: 预览不支持设置header属性,你设置的header属性不会生效,请使用真机调试"),t.protocols&&console.warn("### Web Render ### system.websocketfactory => create: 预览不支持设置protocols属性,你设置的protocols属性不会生效,请使用真机调试"),new _s(t.url,t.protocols))},config:{name:"system.websocketfactory",methods:[{name:"create",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC}]}};var Ss={module:{loadUrl:t=>(cr.push({uri:t.url,allowthirdpartycookies:t.allowthirdpartycookies}),"success")},config:{name:"system.webview",methods:[{name:"loadUrl",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC}]}};var Ms={module:{},config:{name:"system.resident",methods:[{name:"start",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"stop",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC}]}};var Os={module:{},config:{name:"system.bluetooth",methods:[{name:"openAdapter",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"closeAdapter",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getAdapterState",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"onadapterstatechange",type:Vo.TYPE.METHOD,mode:Vo.MODE.SUBSCRIBE},{name:"startDevicesDiscovery",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"stopDevicesDiscovery",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getDevices",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"ondevicefound",type:Vo.TYPE.METHOD,mode:Vo.MODE.SUBSCRIBE},{name:"getConnectedDevices",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"createBLEConnection",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"closeBLEConnection",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getBLEDeviceServices",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getBLEDeviceCharacteristics",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"readBLECharacteristicValue",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"writeBLECharacteristicValue",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"notifyBLECharacteristicValueChange",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"onblecharacteristicvaluechange",type:Vo.TYPE.METHOD,mode:Vo.MODE.SUBSCRIBE},{name:"onbleconnectionstatechange",type:Vo.TYPE.METHOD,mode:Vo.MODE.SUBSCRIBE}]}};var Ds={module:{},config:{name:"system.hostconnection",methods:[{name:"send",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"onregistercallback",type:Vo.TYPE.METHOD,mode:Vo.MODE.SUBSCRIBE}]}};const Ls={name:"hap.io.MessageChannel",instantiable:!0,methods:[{name:"__init__",instanceMethod:!1,type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC,alias:"init"},{name:"send",instanceMethod:!0,type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"close",instanceMethod:!0,type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC}]};var Is={module:{__init__:function(){return Vo.polyfillPrompt(Ls.name,"new MessageChannel"),""},send:function(t){return Vo.polyfillPrompt(Ls.name,"send"),""},close:function(t){return Vo.polyfillPrompt(Ls.name,"close"),""}},config:Ls};var Ps={module:{},config:{name:"service.account",methods:[{name:"getProvider",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"authorize",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getProfile",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}};var Ns={module:{},config:{name:"service.alipay",methods:[{name:"pay",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getVersion",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getType",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC}]}};var Rs={module:{},config:{name:"service.pay",methods:[{name:"pay",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getProvider",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC}]}};var Fs={module:{hasStepsOfDay(t={}){const e={support:!0};t.success(e)},getTodaySteps(t={}){console.warn("==health.getTodaySteps()返回为模拟数据,请使用真机调试体验完整功能==");const e={steps:1690};t.success(e)},getLastWeekSteps(t={}){console.warn("==health.getLastWeekSteps()返回为模拟数据,请使用真机调试体验完整功能==");const e={stepsList:[]};e.stepsList.push({date:"2019-10-11",steps:8690}),e.stepsList.push({date:"2019-10-12",steps:9490}),e.stepsList.push({date:"2019-10-13",steps:12490}),t.success(e)}},config:{name:"service.health",methods:[{name:"hasStepsOfDay",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getTodaySteps",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getLastWeekSteps",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}};const Bs={name:"service.push",methods:[{name:"getProvider",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"subscribe",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"unsubscribe",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"on",type:Vo.TYPE.METHOD,mode:Vo.MODE.SUBSCRIBE},{name:"off",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC}]};const js=[pr,ur,Tr,Ar,_r,Sr,Or,Lr,Ir,Nr,Wr,Ur,Gr,Zr,Qr,Xr,Ss,bs,ls,cs,ds,ps,gs,ys,bs,vs,Es,ws,xs,Ts,As,ks,Cs,Ss,Ps,Ns,Rs,Fs,{module:{getProvider:(t={})=>(Vo.polyfillPrompt(Bs.name,"getProvider",t),""),subscribe(t={}){Vo.polyfillPrompt(Bs.name,"subscribe",t),t.success({regId:"test_id"})},unsubscribe(t={}){Vo.polyfillPrompt(Bs.name,"unsubscribe",t),t.success({})},on(t={}){Vo.polyfillPrompt(Bs.name,"on",t),t.success({})},off(t={}){Vo.polyfillPrompt(Bs.name,"off",t),t.success({})}},config:Bs},{module:{},config:{name:"service.qqaccount",methods:[{name:"getType",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"authorize",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}},{module:{},config:{name:"service.share",methods:[{name:"share",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getProvider",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getAvailablePlatforms",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}},{module:{},config:{name:"service.stats",methods:[{name:"getProvider",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"recordCountEvent",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"recordCalculateEvent",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}},{module:{},config:{name:"service.wbaccount",methods:[{name:"getType",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"authorize",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}},{module:{},config:{name:"service.wxaccount",methods:[{name:"authorize",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getType",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC}]}},{module:{},config:{name:"service.wxpay",methods:[{name:"pay",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"getType",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC}]}},{module:{},config:{name:"service.iot",methods:[{name:"getProvider",type:Vo.TYPE.METHOD,mode:Vo.MODE.SYNC},{name:"send",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}},Ms,{module:{},config:{name:"service.ad",methods:[{name:"getProvider",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}},{module:{},config:{name:"service.exchange",methods:[{name:"get",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"set",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"remove",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"clear",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"grantPermission",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK},{name:"revokePermission",type:Vo.TYPE.METHOD,mode:Vo.MODE.CALLBACK}]}},Os,Ds,Is],Hs=[],$s={};for(let t=0;t<js.length;t++)Hs.push(js[t].config),$s[js[t].config.name]=zs(js[t]);function zs(t){const e=t.module;if("object"==typeof e){const n={apply:function(t,e,n){"object"==typeof n[0]&&n[1]&&"-1"!==n[1]&&(n[0].callback=n[0].success=(t=>{Vo.callbackSuccess(n[1],t)}),n[0].fail=((t,e)=>{Vo.callbackFail(n[1],t,e)}),n[0].cancel=(t=>{Vo.callbackCancel(n[1],t)}));const i=t.apply(e,n);return void 0!==i?Vo.syncResult(i):void 0}},i=t.config.methods;Array.isArray(i)&&i.forEach(t=>{const i=t.name;if("function"==typeof e[i]){const t=e[i];e[i]=new Proxy(t,n)}})}return new Proxy(e,{get:function(e,n,i){if(n in e)return e[n];{const e=t.config.name;return(...t)=>{console.warn(`### Web Render ### ${e} => ${n}:${JSON.stringify(t[0])||""}\n==暂时不支持该接口,请使用真机调试体验完整功能==`)}}}})}function Ys(t,e,n,i,o){return Us(t,{component:o.component,ref:e,method:n,args:i})}function Ws(t,e,n,i,o){return Us(t,{module:e,method:n,args:i})}function Vs(t,e,n){let i=[],o=[];if("string"==typeof e)try{i=JSON.parse(e)}catch(t){console.error("invalid tasks:",e)}else Xn(e)&&(i=e);const r=i.length;if(i[r-1].callbackId=n||0===n?n:-1,1===r)o=Us(t,i[0]);else for(let e=0;e<r;e++)o.push(Us(t,i[e]));return o}function Us(t,e){return void 0===e.module?function(t,e){const n=e.component,i=e.ref,o=e.method,r=e.args||e.arguments||[],s=global.hap.getInstance(t).getComponentManager().getComponent(i);if(!s)return console.error(`### Web Render ### component of ref ${i} doesn't exist.`);let a;if(!(a=s[o]))return console.error(`### Web Render ### component ${n} doesn't have a method named ${o}.`);return r.push(function(e,n){!e&&0!==e&&"0"!==e||"-1"===e||-1===e||function(t,e,n){Yo.getSender(t).performCallback(e,n)}(t,e,n)}),a.apply(s,r)}(t,e):function(t,e){const n=e.module,i=e.method;let o,r;const s=e.args||e.arguments||[];if(!(o=$o.apiModule[n]))return;if(!(r=o[i]))return;return r.apply(global.hap.getInstance(t),s)}(t,e)}function qs(){if(Ho.debug){if(arguments[0].match(/^perf/))return void console.info.apply(console,arguments);console.debug.apply(console,arguments)}}var Gs=function(){global.callNative=Vs,global.callNativeComponent=Ys,global.callNativeModule=Ws,global.nativeLog=qs,global.JsBridge=global.ModuleManager={invoke(t,e,n,i,o){if("string"==typeof n&&(n=JSON.parse(n)),$s[t]&&$s[t][e])return $s[t][e](n,i,o);throw new Error(`ERROR: Unknown moduleName:${t}, methodName:${e}`)}}};const Js={};function Ks(t,e,n){"globalEvent"!==t&&(e.addEventListener=function(e,n,i){return function(t,e,n,i){const o=i&&!!i.once;let r=Js[t];r||(r=Js[t]={});let s=r[e];s||(s=r[e]=[]),s.push(t=>this.sender.performCallback(n,t,!o))}.call(this,t,e,n,i)},e.removeAllEventListeners=function(e){return function(t,e){try{delete Js[t][e]}catch(t){}}.call(this,t,e)},[{name:"addEventListener",args:["string","function","object"]},{name:"removeAllEventListeners",args:["string"]}].forEach(e=>n[t].push(e)))}window.addEventListener("moduleevent",t=>{const e=t.detail||{},n=e.module,i=e.type;try{Js[n][i].forEach(t=>t(e))}catch(t){console.warn(`### Web Render ### no such event ${i} for module ${n}.`)}});const Zs={registerComponent(t,e){Ei.registerComponent(t,e)},registerApiModule(t,e,n){if(Ks(t,e,n),$o.apiModule[t])for(const n in e)e.hasOwnProperty(n)&&($o.apiModule[t][n]=e[n]);else $o.apiModule[t]=e;n&&($o.setApiModuleMeta(n),global.registerModules($o.getApiModuleMeta(t),!0))},registerApi(t,e,n,i){"function"==typeof n&&($o.apiModule[t]||($o.apiModule[t]={},$o._meta[t]=[]),$o.apiModule[t][e]=n,i&&($o.setApiMeta(t,{name:e,args:i}),global.registerModules($o.getApiModuleMeta(t),!0)))},registerLoader(t,e){}};const Qs=["flex","opacity","zIndex","fontWeight"];function Xs(t){return-1!==Qs.indexOf(t)?{}:{number:function(t){return t},string:function(e){const n=e.match(/^([+-]?\d.*)+([p,w]x)$/);if(n&&3===n.length){if("px"===n[2])return parseFloat(n[1])+"px";if("wx"===n[2])return parseFloat(n[1])*global.HapEnvironment.devicePixelRatio+"px"}if(t.match(/transform/))try{const t=global.eval("("+e+")");let n="";for(const e in t)n+=e+"("+t[e]+") ";return n}catch(t){return e}if(t.match(/transform/)&&e.match(/translate/)){let t=e.replace(/\d*\.?\d+px/g,function(t){return parseInt(parseFloat(t))+"px"});return t.match(/wx/)&&(t=t.replace(/\d*\.?\d+wx/g,function(t){return parseInt(parseFloat(t))*global.HapEnvironment.devicePixelRatio+"px"})),t}return t.match(/^border$/)&&e.match(/^\d+(?:[w,p]x)?\s+/)&&(e=e.replace(/^(\d+(?:[w,p]x)?)/,function(t,n){return parseFloat(n)*(e.match(/^\d+(?:wx)+/)?global.HapEnvironment.devicePixelRatio:1)+"px"})),e}}}const ta=new Set(["flexDirection","flexWrap","justifyContent","alignItems","alignContent","columnSpan"]),ea=new Set(["lines","color","fontSize","fontStyle","fontWeight","fontFamily","fontFamilyDesc","textDecoration","textAlign","textIndent","lineHeight","textOverflow"]),na={general:new Set(["width","height","padding","paddingLeft","paddingRight","paddingTop","paddingBottom","margin","marginLeft","marginRight","marginTop","marginBottom","border","borderStyle","borderWidth","borderLeftWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderColor","borderLeftColor","borderTopColor","borderRightColor","borderBottomColor","borderRadius","borderBottomLeftRadius","borderBottomRightRadiush","borderTopLeftRadius","borderTopRightRadius","background","backgroundColor","backgroundImage","backgroundSize","backgroundRepeat","backgroundPosition","opacity","display","visibility","objectFit","flex","flexGrow","flexShrink","flexBasis","alignSelf","position","top","bottom","left","right","zIndex","transform","transformOrigin","animationName","animationDuration","animationTimingFunction","animationDelay","animationIterationCount","animationFillMode","animationKeyframes"]),div:ta,stack:ta,richtext:ta,list:new Set(["flexDirection","columns"]),"list-item":ta,popup:new Set(["maskColor"]),refresh:new Set(["backgroundColor","progressColor","flexDirection","flexWrap","justifyContent","alignItems","alignContent"]),swiper:new Set(["indicatorColor","indicatorSelectedColor","indicatorSize","indicatorTop","indicatorRight","indicatorBottom","indicatorLeft"]),image:new Set(["resizeMode","objectFit"]),progress:new Set(["color","strokeWidth"]),rating:new Set(["starBackground","starForeground","starSecondary"]),span:new Set(["color","fontSize","fontStyle","fontWeight","fontFamily","fontFamilyDesc","textDecoration"]),a:ea,text:ea,label:ea,select:ea,option:ea,input:new Set([["color","fontSize","placeholderColor"],...ea]),slider:new Set(["color","selectedColor","blockColor"]),textarea:new Set(["color","fontSize","placeholderColor"]),video:new Set(["objectFit"]),map:new Set(["mylocation","mylocationFillColor","mylocationStrokeColor","mylocationIconPath"])};var ia={validate:function(t,e){const n=na[t];return!!(na.general.has(e)||n&&n.has(e))}};let oa=0;function ra(){return""+oa++}var sa={create:function(t){return document.createElement(t||"div")},createChildren:function(){const t=this.data.children,e=this.data.ref,n=this.getComponentManager();if(t&&t.length){const i=document.createDocumentFragment();let o=!1;for(let r=0;r<t.length;r++){t[r].props=this.data.props,t[r].instanceId=this.data.instanceId;const s=n.createElement(t[r]);i.appendChild(s.node),s.parentRef=e,!o&&s.data.style&&s.data.style.hasOwnProperty("flex")&&(o=!0)}this.node.appendChild(i)}},appendChild:function(t){const e=this.data.children,n=this.getComponentManager().createElement(t);return this.node.appendChild(n.node),e&&e.length?e.push(t):this.data.children=[t],n},insertBefore:function(t,e){const n=this.data.children;let i,o=0,r=!1;if(n&&n.length&&e){for(i=n.length;o<i&&n[o].ref!==e.data.ref;o++);o===i&&(r=!0)}else r=!0;r?(this.node.appendChild(t.node),n.push(t.data)):(e.fixedPlaceholder?this.node.insertBefore(t.node,e.fixedPlaceholder):e.stickyPlaceholder?this.node.insertBefore(t.node,e.stickyPlaceholder):this.node.insertBefore(t.node,e.node),n.splice(o,0,t.data))},removeChild:function(t){const e=this.data.children;let n=0;const i=this.getComponentManager();if(e&&e.length){let i;for(i=e.length;n<i&&e[n].ref!==t.data.ref;n++);n<i&&e.splice(n,1)}i.removeComponent(t.data.ref),t.unsetPosition(),t.node.parentNode.removeChild(t.node)},updateProp:function(t){this.node.prop||(this.node.prop={});const e=t.prop||{};for(const t in e){const n=e[t];this.node.setAttribute(t,n)}},updateAttrs:function(t){this.node.attr||(this.node.attr={});for(const e in t){const n=t[e],i=this.attr[e],o=this.style[e];this.data&&this.data.attr&&(this.data.attr[e]=n),"function"==typeof i?i.call(this,n):"function"==typeof o?o.call(this,n):("boolean"==typeof n?this.node[e]=n:"class"===e&&this.node.getAttribute("class")?this.node.setAttribute("class",this.node.getAttribute("class")+" "+n):this.node.setAttribute(e,n),this.node.attr[e]=n)}},updateStyle:function(t){const e={};for(const n in t){let i=t[n];const o=/^([^:]+)((?::[^:]+)+)/,r=n.match(o);let s,a;if(r?(s=r[1],a=r[2]):s=n,ia.validate(this.data&&this.data.type,s)){const t=Xs(s)[typeof i];if("function"==typeof t&&(i=t(i)),!r){"function"==typeof this.style[s]?this.style[s].call(this,i):this.node.style[s]=i;continue}e[a]?e[a][s]=i:e[a]={[s]:i}}}Object.keys(e).length>0&&function(t,e,n){let i=t.node.getAttribute("data-pseudo-id");function o(t,e){let n=!1,i=!1,o=Object.keys(e).map(t=>(i=!!/^border(\S*)Width/.test(t)||i,n=!!/^border(\S*)Style/.test(t)||n,`${ri(t)}:${e[t]}!important;`)).join("");return i&&!n&&(o+="border-style:solid!important;"),`${t}{${o}}`}if(!i){const e=`hap-stysheet-pseudo-id-${t.data.instanceId}`;let r=document.getElementById(e);r||((r=document.createElement("style")).id=e,r.type="text/css",document.getElementsByTagName("head")[0].appendChild(r)),i=ra(),t.node.setAttribute("data-pseudo-id",i);const s=Object.keys(n).map(t=>{const e=n[t];let r=o(`[data-pseudo-id="${i}"]${t}`,e);return/:|::(active|disabled)/.test(t)&&(r=o(`\n [data-pseudo-id="${i}"]${t}, \n ${t.replace(/:|::/g,".hap-")}[data-pseudo-id="${i}"], \n ${t.replace(/:|::/g,".hap-")} [data-pseudo-id="${i}"]`,e)),r}).join("");return r.appendChild(document.createTextNode(s))}const r=Array.prototype.slice.call(document.styleSheets||[]).filter(t=>t.ownerNode.getAttribute("data-pseudo-id")===i);if(!r||r.length<=0)return;const s=r[0],a=s.cssRules||s.rules;Object.keys(n).forEach(t=>{const e=n[t],r=`[data-pseudo-id="${i}"]${t}`,l=Array.prototype.slice.call(a).reduce((t,e,n)=>(e.selectorText===r&&(t.idx=n),t),{idx:-1}),{idx:c}=l;if(-1!==c){const t=a[c],n=t.cssText.match(/^[^{]+\{([^}]+)\}/);if(n&&n[1]){const t=n[1].split(";").reduce((t,e)=>{const n=e.match(/(\S+)\s*:\s*(\S+)/);return n&&n[1]&&n[2]&&(t[n[1]]=n[2]),t},{});S(t,e),Object.keys(t).forEach(e=>{t[e]||delete t[e]}),s.deleteRule(c),s.insertRule(o(r,t),a.length-1)}}else s.insertRule(o(r,e),a.length)})}(this,0,e)},bindEvents:function(t){const e=this,n=this.getHapInstance();t.map(function(t){("click"===t||"longpress"===t||"swipe"===t||t.indexOf("touch")>-1)&&(e.node.style.pointerEvents="auto");const i=n.sender;if("resize"!==t){const n=e.event[t]||{},o=n.setter;if(o)return void e.node.addEventListener(t,o);const r=function(o){if(o._alreadyTriggered)return;o._alreadyTriggered=!0;const r=S({},o);r._target=e.data,r._touches=o.touches,r._changedTouches=o.changedTouches,Object.assign(r,{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY,offsetX:o.offsetX,offsetY:o.offsetY}),i.fireEvent(e.data.ref,t,{extra:n.extra&&n.extra.bind(e),updator:n.updator&&n.updator.bind(e)},r)};e.node.addEventListener(t,r,!1,!1);let s=e._listeners;s||(s=e._listeners={},e.node._listeners={}),s[t]=r,e.node._listeners[t]=r}else{const n={_target:e.data},o=new ResizeObserver(o=>{const r=o[0].target;Object.assign(n,{offsetWidth:r.offsetWidth,offsetHeight:r.offsetHeight,offsetLeft:r.offsetLeft,offsetTop:r.offsetTop}),i.fireEvent(e.data.ref,t,{},n)});o.observe(e.node);let r=e._observers;r||(r=e._observers={},e.node._observers={}),r[t]=o,e.node._observers[t]=o}})},unbindEvents:function(t){const e=this;t.map(function(t){const n=this._listeners,i=this._observers;n&&e._listeners[t]&&(e.node.removeEventListener(t,n),e._listeners[t]=null,e.node._listeners[t]=null),i&&e._observers[t]&&(e._observers[t].unobserve(e.node),e._observers[t]=null,e.node._observers[t]=null)})}};const aa=navigator.userAgent,la=!!aa.match(/Firefox/i),ca=!!aa.match(/IEMobile/i),da=la?"-moz-":ca?"-ms-":"-webkit-",ha=la?"Moz":ca?"ms":"webkit";function pa(t,e){const n=t.component,i=t.element;if(e=e?e+"":t.prePosition,i.style.position=e,i.style.marginTop=t.preMarginTop||"",i.style.top=t.preTop||"",i.classList.remove("hap-sticky"),n.stickyPlaceholder){const t=n.stickyPlaceholder.parentNode;t.insertBefore(i,n.stickyPlaceholder),t.removeChild(n.stickyPlaceholder),n.stickyPlaceholder=null}}function ua(t,e){e=e||{},this.component=t,this.element=t.node,this.prePosition=this.element.style.position,this.withinParent=e.withinParent||!1,this.parent=null,this.init()}ua.prototype={constructor:ua,init(){const t=this.element.style;t[ha+"Transform"]="translateZ(0)",t.transform="translateZ(0)",function(t){if(!(t instanceof ua))return;const e=t.component.getParentScroller();let n;e?(n=t.parent=e,t.parentElement=n.node):(n=t.parent=t.component.getRootContainer(),t.parentElement=n)}(this),this._simulateSticky(),this._bindResize()},_bindResize(){const t=this,e=/android/gi.test(navigator.appVersion),n=t._resizeEvent="onorientationchange"in window?"orientationchange":"resize",i=t._resizeHandler=function(){setTimeout(function(){t.refresh()},e?200:0)};window.addEventListener(n,i,!1)},refresh(){this._detach(),this._simulateSticky()},_simulateSticky(){const t=this,e=this.isInScrollable();this.offset=(e?this.getParentScroller().offset:window.pageYOffset)||0;const n=this.element.getBoundingClientRect().top;let i=0;e&&(i=this.parentElement.getBoundingClientRect().top);const o=this.withinParent,r=n-i+this.offset;this.curState=1;const s=this._scrollHandler=oi(function(e){const n=r,i=t.isInScrollable()?e.offset:window.pageYOffset;t.offset=i,i<n?1!==t.curState&&(pa(t),t.curState=1):(!o&&i>=n||o&&i>=n)&&2!==t.curState&&(!function(t){const e=t.component,n=t.element;let i;e.stickyPlaceholder=t.element.cloneNode(!0),e.stickyPlaceholder.removeAttribute("data-ref"),e.stickyPlaceholder.classList.add("hap-sticky-placeholder"),n.classList.add("hap-sticky"),t.preMarginTop=n.style.marginTop,t.preTop=n.style.top,n.style.marginTop=t.top||"0px",n.parentNode.insertBefore(e.stickyPlaceholder,n),n.style.position="fixed",i=t.parent instanceof HTMLElement?0:t.parentElement.getBoundingClientRect().top,n.style.top=i+"px",t.parentElement.appendChild(n)}(t),t.curState=2)},100);if(window.addEventListener("scroll",s,!1),this.offset>=r){const t=document.createEvent("HTMLEvents");t.initEvent("scroll",!0,!0),window.dispatchEvent(t)}},_detach(t){2===this.curState&&pa(this),window.removeEventListener("scroll",this._scrollHandler,!1)},isInScrollable(){if(!this._isInScrollable)try{this._isInScrollable=this.component.isInScrollable()}catch(t){console.error("isInScrollable is not yet available to call",t)}return this._isInScrollable},getParentScroller(){return this.component.getParentScroller()},destroy(t){this._detach(t);const e=this.element.style;e.removeProperty(da+"transform"),e.removeProperty("transform"),window.removeEventListener(this._resizeEvent,this._resizeHandler,!1)}};var fa={setFixed:function(){setTimeout(function(){this.node.style.position="fixed",this.node.style.zIndex="1";const t=this.getComponentManager().tilebar,e=this.data.style&&this.data.style.top;if(e&&e.indexOf("px")>-1)if(this._getProps("_isInTabContent")&&this._getProps("tabwrap")){const t=this._getProps("tabwrap").parentNode.getBoundingClientRect().top,n=parseFloat(e)-t;this.node.style.top=`${n}px`}else if(t&&t.showTitleBar){const n=parseFloat(e)+t.instance.getBoundingClientRect().height;this.node.style.top=`${n}px`}const n=this.data.style&&this.data.style.bottom;if(n&&n.indexOf("px")>-1&&this._getProps("_isInTabContent")&&this._getProps("tabwrap")){const t=this._getProps("tabwrap").parentNode,e=document.body.offsetHeight-t.getBoundingClientRect().bottom,i=parseFloat(n)-e;this.node.style.bottom=`${i}px`}const i=this.data.style&&this.data.style.width,o=this.data.style&&this.data.style.right,r=this.data.style&&this.data.style.left,s=this.data.style&&this.data.style.flex;if(i||(o||r)&&!s||(this.node.style.width="-webkit-fill-available"),!this.isInScrollable())return;const a=this.node.parentNode;a&&(this.fixedPlaceholder=document.createElement("div"),this.fixedPlaceholder.classList.add("hap-fixed-placeholder"),this.fixedPlaceholder.style.cssText=["display:none;","width:0px;","height:0px;"].join(""),a.insertBefore(this.fixedPlaceholder,this.node),this.getRootContainer().appendChild(this.node))}.bind(this),0)},unsetFixed:function(t){if(t=t?t+"":"relative",this.fixedPlaceholder){const e=this.fixedPlaceholder.parentNode;e.insertBefore(this.node,this.fixedPlaceholder),e.removeChild(this.fixedPlaceholder),this.fixedPlaceholder=null,this.node.style.position=t}},setSticky:function(){this.node.style.zIndex=100,setTimeout(function(){this.sticky=new ua(this)}.bind(this),0)},unsetSticky:function(){this.sticky&&(this.sticky.destroy(),this.sticky=null)},unsetPosition:function(t){this.style.position.call(this,t)}};const ma={stretch:"stretch","flex-start":"start","flex-end":"end",center:"center"},ga={row:"horizontal",column:"vertical"},ya={"flex-start":"start","flex-end":"end",center:"center","space-between":"justify","space-around":"justify"};var ba={style:{flex(t){this.node.style.webkitBoxFlex=t,this.node.style.webkitFlex=t,this.node.style.flex=t},alignItems(t){this.node.style.webkitBoxAlign=ma[t],this.node.style.webkitAlignItems=t,this.node.style.alignItems=t},alignContent(t){this.node.style.alignContent=t,this.data.style&&this.data.style.alignItems||(this.node.style.webkitAlignItems=t,this.node.style.alignItems=t)},alignSelf(t){this.node.style.webkitAlignSelf=t,this.node.style.alignSelf=t},flexDirection(t){this.node.style.webkitBoxOrient=ga[t],this.node.style.webkitFlexDirection=t,this.node.style.flexDirection=t},justifyContent(t){this.node.style.webkitBoxPack=ya[t],this.node.style.webkitJustifyContent=t,this.node.style.justifyContent=t}}};let va;function Ea(){setTimeout(()=>lib.img.fire(),0)}function wa(t){if("object"!=typeof t||t instanceof HTMLElement||(t=t.node),t){if("image"!==t.tagName.toLowerCase())return function(t){const e=t.querySelectorAll("[img-src]"),n=t.querySelectorAll("[i-lazy-src]");(e.length>0||n.length>0)&&Ea()}(t);va||(va=setTimeout(function(){Ea(),clearTimeout(va),va=null},16))}}function xa(t){const e=t.getParent();if(!e||t.isRoot())return!1;const n=e.data.style&&e.data.style.width;return!(Ta(t)||function(t){if(t.data&&("stack"===t.data.type&&"row"===t._getProps("_listDirection")||"list-item"===t.data.type))return!0;return!1}(e)||n&&"100%"!==n||parseInt(n)>=document.body.clientWidth)}function Ta(t){return!!t.data&&(t.data.style&&"none"===t.data.style.display||t.data.attr&&!1===t.data.attr.show)}global.lib={img:{defaultSrc:"data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==",fire(){console.debug("lazyimg fire")}}};var Aa={fixWidth:function t(e){const n=e.getParent();xa(e)&&(n._fixWidth=!0,n.node.style.width=n.data.ref===n.getComponentManager().rootRef?"100%":"-webkit-fill-available",delete n._needSetWidth,n.node.clientWidth>=document.body.clientWidth||t(n))},resetWidth:function t(e){const n=e.getParent();if(!n||!n._fixWidth)return;const i=n.data&&n.data.children||[];if(i.length>1)for(let t=0;t<i.length;t++)if(i[t]!==e.data&&!Ta(i[t]))return;n.node.style.width=n.data.style&&n.data.style.width||"",t(n)},needFixWidth:xa,needResetWidth:function(t){return(t._needFixWidth||t._fixWidth)&&Ta(t)},fixStackSize:function(t,e){const n=t.getParent();n&&"list-item"===n.data.type&&"row"!==t._getProps("_listDirection")&&(t._needSetWidth=!1),t._needSetHeight&&t._resizeHeight(e),t._needSetWidth&&t._resizeWidth(e)}};const ka=["appear","disappear"],_a={linearGradient:"linear-gradient",repeatingLinearGradient:"repeating-linear-gradient"};function Ca(t,e){this.data=t,this.node=this.create(e),this.createChildren(),this.updateAttrs(this.data.attr||{}),this.data.classStyle&&this.updateStyle(this.data.classStyle),this.updateStyle(this.data.style||{}),this.bindEvents(this.data.event||[])}function Sa(t){Ca.call(this,t)}Ca.prototype={getComponentManager(){return Ei.getInstance(this.data.instanceId)},getHapInstance(){return this.getComponentManager().getHapInstance()},getParent(){return this.getComponentManager().componentMap[this.parentRef]},getParentScroller(){return this.isInScrollable()?this._parentScroller:null},getRootScroller(){if(this.isInScrollable()){let t=this._parentScroller,e=t._parentScroller;for(;e;)e=(t=e)._parentScroller;return t}return null},getRootContainer(){return this.getHapInstance().getRoot()||document.body},isScrollable(){const t=this.data.type;return-1!==Ei.getScrollableTypes().indexOf(t)},isRoot(){return this.ref===this.getComponentManager().rootRef},isInScrollable(){if("boolean"==typeof this._isInScrollable)return this._isInScrollable;const t=this.getParent();return t&&"boolean"!=typeof t._isInScrollable&&!t.isScrollable()?"_root"===t.data.ref?(this._isInScrollable=!1,!1):(this._isInScrollable=t.isInScrollable(),this._parentScroller=t._parentScroller,this._isInScrollable):t&&"boolean"==typeof t._isInScrollable?(this._isInScrollable=t._isInScrollable,this._parentScroller=t._parentScroller,this._isInScrollable):t&&t.isScrollable()?(this._isInScrollable=!0,this._parentScroller=t,!0):void 0},dispatchEvent(t,e,n){if(!function(t,e){if(ka.indexOf(e)<=-1)return!0;if(void 0===t._appear&&"disappear"===e)return!1;let n;return(n=void 0===t._appear&&"appear"===e||e!==t._appear)&&(t._appear=e),n}(this,t))return;const i=document.createEvent("HTMLEvents");n=n||{},i.initEvent(t,n.bubbles||!1,n.cancelable||!1),!e&&(e={}),i.data=S({},e),S(i,e),this.node.dispatchEvent(i)},onAppend:function(){this._fixStyles();const t=this.data.event;if(!t||!t.length)return;let e=!1;for(let n=0,i=t.length;n<i;n++)if("appear"===t[n]){e=!0;break}e&&setTimeout(()=>{ui(this)&&this.dispatchEvent("appear",{direction:""})},0)},onRemove:function(){const t=this.getParent();t&&t._fixWidth&&1===t.data.children.length&&(t.node.style.width=t.data.style&&t.data.style.width||"")},removeChildHandler(){this._resetRootHeight();const t=this._getProps("stack");t&&t._needSetHeight&&(t.maxHeight=0,t.node.style.height=""),this._fixStyles()},addAppendHandler(t){let e;this.onAppend&&(e=this.onAppend.bind(this)),this.onAppend=function(){e&&e.call(this),t&&t.call(this)}.bind(this)},enableLazyload(t){this.node?function(t,e){t.removeAttribute("img-src"),t.removeAttribute("i-lazy-src"),t.removeAttribute("src"),t.setAttribute("img-src",e),Ea()}(this.node,t):console.error("### Web Render ### this.node does not exist.")},fireLazyload(t){!t&&(t=this),wa(t)},_fixStyles(){this._setAvailableWidth(),(this._needFixWidth||this._fixWidth)&&(Aa.needResetWidth(this)&&Aa.resetWidth(this),Aa.needFixWidth(this)?Aa.fixWidth(this):delete this._needFixWidth);const t=this.data.props;t&&t._isInStack&&t.stackwrap&&(this.data.style&&"fixed"===this.data.style.position?this._setProps(this.data,{_isInStack:!1}):Aa.fixStackSize(t.stack,t.stackwrap))},_resetRootHeight(){if("div"===this.data.type||"stack"===this.data.type||"list"===this.data.type){let t=!0;const e=document.querySelectorAll("list"),n=this.getComponentManager();for(let i=0;i<e.length;i++){const o=e[i];if(o.clientHeight>0&&"row"!==o.getAttribute("direction")&&!(o.style.height&&o.style.height.indexOf("px")>0)){t=!1;const e=o.getAttribute("ref");if(e){const t=n.getComponent(e);t&&t.refresh&&t.refresh()}break}}if(t){const t=n.getComponent(n.rootRef);t.node.style.height=t.data.style&&t.data.style.height||"",t.node.style.overflow=""}}},_setProps(t,e){if(e)if(t.props){const n={};Object.assign(n,t.props,e),t.props=n}else t.props=e},_getProps(t){if(t&&this.data&&this.data.props)return this.data.props[t]},_setAvailableWidth(){const t=this.data.style;let e=this.node.clientWidth;if(t&&t.width){if(t.width.indexOf("px")>-1)e=parseInt(t.width);else if(t.width.indexOf("%")>-1){const n=parseFloat(parseInt(t.width.replace("%",""))/100);this._getProps("availableWidth")>0?e=parseInt(this._getProps("availableWidth")*n):this.getParent()&&(e=parseInt(this.getParent().node.clientWidth*n))}}else this._getProps("availableWidth")||(e=document.body.clientWidth);t&&t.paddingLeft&&t.paddingLeft.indexOf("px")>-1&&(e-=parseInt(t.paddingLeft)),t&&t.paddingRight&&t.paddingRight.indexOf("px")>-1&&(e-=parseInt(t.paddingRight)),e>0&&this._setProps(this.data,{availableWidth:e})},attr:{show:function(t){t?(this.node.style.display="",this.node.setAttribute("show",!0)):(this.node.style.display="none",this.node.setAttribute("show",!1)),this._resetRootHeight(),this._fixStyles()},disabled:function(t){!0===t||"true"===t?(this.node.setAttribute("disabled",!0),this.node.classList.add("hap-disabled")):(this.node.setAttribute("disabled",!1),this.node.classList.remove("hap-disabled"))}},style:{borderBottomWidth:function(t){this.node.style.borderBottomWidth=t,this.node.style.borderBottomStyle=this.data.style&&(this.data.style.borderBottomStyle||this.data.style.borderStyle)||"solid"},borderTopWidth:function(t){this.node.style.borderTopWidth=t,this.node.style.borderTopStyle=this.data.style&&(this.data.style.borderTopStyle||this.data.style.borderStyle)||"solid"},borderLeftWidth:function(t){this.node.style.borderLeftWidth=t,this.node.style.borderLeftStyle=this.data.style&&(this.data.style.borderLeftStyle||this.data.style.borderStyle)||"solid"},borderRightWidth:function(t){this.node.style.borderRightWidth=t,this.node.style.borderRightStyle=this.data.style&&(this.data.style.borderRightStyle||this.data.style.borderStyle)||"solid"},backgroundImage:function(t){const e="/"===t[0]&&Hap.basePath?`${Hap.basePath}${t}`:t;this.node.style.backgroundImage="url("+e+")",(!this.data.style||this.data.style&&!this.data.style.backgroundRepeat)&&(this.node.style.backgroundRepeat="no-repeat"),(!this.data.style||this.data.style&&!this.data.style.backgroundSize)&&(this.node.style.backgroundSize="100% 100%")},background:function(t){try{const e=JSON.parse(t).values,n=e[e.length-1],i=`${_a[n.type]}(${n.directions.join(" ")}, ${n.values.join(",")})`;this.node.style.background=i}catch(e){this.node.style.background=t}},width:function(t){const e=this.data&&this.data.style||{};t.indexOf("px")>-1&&e.backgroundImage?this.node.style.flexShrink="0":t.indexOf("%")>-1&&"fixed"!==e.position&&!this._getProps("_isInTabBar")&&(this._needFixWidth=!0),this.node.style.width=t},position(t){return"fixed"!==t&&this.unsetFixed(),"sticky"!==t&&this.unsetSticky(),"fixed"===t?this.setFixed():"sticky"===t?this.setSticky():void(this.node.style.position=t)}},event:{},clearAttr(){},clearStyle(){this.node.cssText=""}},S(Ca.prototype,sa),S(Ca.prototype,fa),S(Ca.prototype.style,ba.style),Sa.prototype=Object.create(Ca.prototype),Sa.prototype.createChildren=function(t){},Sa.prototype.appendChild=function(t){},Sa.prototype.insertBefore=function(t,e){},Sa.prototype.removeChild=function(t){};var Ma=!1,Oa=window.document,Da=Oa.documentElement,La=Array.prototype.slice,Ia={},Pa=null;function Na(t,e){for(var n=t;n;){if(n.contains(e)||n==e)return n;n=n.parentNode}return null}function Ra(t,e,n){var i=Oa.createEvent("HTMLEvents");if(i.initEvent(e,!0,!0),"object"==typeof n)for(var o in n)i[o]=n[o];t.dispatchEvent(i)}function Fa(t){for(var e=0;e<t.changedTouches.length;e++){var n=t.changedTouches[e];if(!(g=Ia[n.identifier]))return;g.lastTouch||(g.lastTouch=g.startTouch),g.lastTime||(g.lastTime=g.startTime),g.velocityX||(g.velocityX=0),g.velocityY||(g.velocityY=0),g.duration||(g.duration=0);var i=Date.now()-g.lastTime,o=(n.clientX-g.lastTouch.clientX)/i,r=(n.clientY-g.lastTouch.clientY)/i;for(var s in i>70&&(i=70),g.duration+i>70&&(g.duration=70-i),g.velocityX=(g.velocityX*g.duration+o*i)/(g.duration+i),g.velocityY=(g.velocityY*g.duration+r*i)/(g.duration+i),g.duration+=i,g.lastTouch={},n)g.lastTouch[s]=n[s];g.lastTime=Date.now();var a=n.clientX-g.startTouch.clientX,l=n.clientY-g.startTouch.clientY,c=Math.sqrt(Math.pow(a,2)+Math.pow(l,2)),d=!(Math.abs(a)>Math.abs(l)),h=d?l>=0?"down":"up":a>=0?"right":"left";("tapping"===g.status||"pressing"===g.status)&&c>10&&(g.status="panning",g.isVertical=d,g.direction=h,Ra(g.element,"panstart",{touch:n,touches:t.touches,changedTouches:t.changedTouches,touchEvent:t,isVertical:g.isVertical,direction:h})),"panning"===g.status&&(g.panTime=Date.now(),Ra(g.element,"panmove",{displacementX:a,displacementY:l,touch:n,touches:t.touches,changedTouches:t.changedTouches,touchEvent:t,isVertical:g.isVertical,direction:h}))}if(2==Object.keys(Ia).length){var p,u=[],f=[],m=[];for(e=0;e<t.touches.length;e++){n=t.touches[e];var g=Ia[n.identifier];u.push([g.startTouch.clientX,g.startTouch.clientY]),f.push([n.clientX,n.clientY])}for(var s in Ia)m.push(Ia[s].element);y=u[0][0],b=u[0][1],v=u[1][0],E=u[1][1],w=f[0][0],x=f[0][1],T=f[1][0],A=f[1][1],k=Math.atan2(A-x,T-w)-Math.atan2(E-b,v-y),_=Math.sqrt((Math.pow(A-x,2)+Math.pow(T-w,2))/(Math.pow(E-b,2)+Math.pow(v-y,2))),C=[w-_*y*Math.cos(k)+_*b*Math.sin(k),x-_*b*Math.cos(k)-_*y*Math.sin(k)],p={rotate:k,scale:_,translate:C,matrix:[[_*Math.cos(k),-_*Math.sin(k),C[0]],[_*Math.sin(k),_*Math.cos(k),C[1]],[0,0,1]]},Ra(Na(m[0],m[1]),"dualtouch",{transform:p,touches:t.touches,touchEvent:t})}var y,b,v,E,w,x,T,A,k,_,C}function Ba(t){if(2==Object.keys(Ia).length){var e=[];for(var n in Ia)e.push(Ia[n].element);Ra(Na(e[0],e[1]),"dualtouchend",{touches:La.call(t.touches),touchEvent:t})}for(var i=0;i<t.changedTouches.length;i++){var o=t.changedTouches[i],r=o.identifier,s=Ia[r];if(s){if(s.pressingHandler&&(clearTimeout(s.pressingHandler),s.pressingHandler=null),"tapping"===s.status&&(s.timestamp=Date.now(),Ra(s.element,"tap",{touch:o,touchEvent:t}),Pa&&s.timestamp-Pa.timestamp<300&&Ra(s.element,"doubletap",{touch:o,touchEvent:t}),Pa=s),"panning"===s.status){var a=Date.now(),l=a-s.startTime,c=o.clientX-s.startTouch.clientX,d=o.clientY-s.startTouch.clientY,h=Math.sqrt(s.velocityY*s.velocityY+s.velocityX*s.velocityX)>.5&&a-s.lastTime<100,p={duration:l,isSwipe:h,velocityX:s.velocityX,velocityY:s.velocityY,displacementX:c,displacementY:d,touch:o,touches:t.touches,changedTouches:t.changedTouches,touchEvent:t,isVertical:s.isVertical,direction:s.direction};Ra(s.element,"panend",p),h&&Ra(s.element,"swipe",p)}"pressing"===s.status&&Ra(s.element,"pressend",{touch:o,touchEvent:t}),delete Ia[r]}}0===Object.keys(Ia).length&&(Da.removeEventListener("touchmove",Fa,!1),Da.removeEventListener("touchend",Ba,!1),Da.removeEventListener("touchcancel",ja,!1))}function ja(t){if(2==Object.keys(Ia).length){var e=[];for(var n in Ia)e.push(Ia[n].element);Ra(Na(e[0],e[1]),"dualtouchend",{touches:La.call(t.touches),touchEvent:t})}for(var i=0;i<t.changedTouches.length;i++){var o=t.changedTouches[i],r=o.identifier,s=Ia[r];s&&(s.pressingHandler&&(clearTimeout(s.pressingHandler),s.pressingHandler=null),"panning"===s.status&&Ra(s.element,"panend",{touch:o,touches:t.touches,changedTouches:t.changedTouches,touchEvent:t}),"pressing"===s.status&&Ra(s.element,"pressend",{touch:o,touchEvent:t}),delete Ia[r])}0===Object.keys(Ia).length&&(Da.removeEventListener("touchmove",Fa,!1),Da.removeEventListener("touchend",Ba,!1),Da.removeEventListener("touchcancel",ja,!1))}Ma||(Da.addEventListener("touchstart",function(t){0===Object.keys(Ia).length&&(Da.addEventListener("touchmove",Fa,!1),Da.addEventListener("touchend",Ba,!1),Da.addEventListener("touchcancel",ja,!1));for(var e=0;e<t.changedTouches.length;e++){var n=t.changedTouches[e],i={};for(var o in n)i[o]=n[o];var r={startTouch:i,startTime:Date.now(),status:"tapping",element:t.srcElement||t.target,pressingHandler:setTimeout(function(e,n){return function(){"tapping"===r.status&&(r.status="pressing",console.warn("==预览中longpress暂不支持offsetX/offsetY,返回为模拟数据,请使用真机调试体验完整功能=="),Ra(e,"longpress",{touch:n,touches:t.touches,changedTouches:t.changedTouches,touchEvent:t,clientX:n.clientX,clientY:n.clientY,pageX:n.pageX,pageY:n.pageY,offsetX:0,offsetY:0})),clearTimeout(r.pressingHandler),r.pressingHandler=null}}(t.srcElement||t.target,t.changedTouches[e]),500)};Ia[n.identifier]=r}if(2==Object.keys(Ia).length){var s=[];for(var o in Ia)s.push(Ia[o].element);Ra(Na(s[0],s[1]),"dualtouchstart",{touches:La.call(t.touches),touchEvent:t})}},!1),Ma=!0),Gs();const Ha=750,$a="hap";global.HapEnvironment={version:Ho.version,platform:"Web",deviceWidth:window.innerWidth,deviceHeight:window.innerHeight,devicePixelRatio:window.devicePixelRatio?window.devicePixelRatio:window.screen.width>=1440?3.5:window.screen.width>=1080?3:window.screen.width>=800?2.5:window.screen.width>=640?2:window.screen.width>=480?1.5:1};const za={};function Ya(t){document.querySelector("meta[name=viewport]").setAttribute("content",`width=${t}, user-scalable=no`)}function Wa(t){if(!(this instanceof Wa))return new Wa(t);this.width=t.width||window.innerWidth,this.bundleUrl=t.bundleUrl||window.location.href,this.instanceId=t.appId,this.rootId=t.rootId||$a+ii(10),this.jsonpCallback=t.jsonpCallback,this.source=t.source,this.loader=t.loader,this.data=t.data,this.sender=new Yo(this),za[this.instanceId]=this}function Va(t){global.registerComponents(Ho.componentList),global.registerModules(Hs,"feature"),global.registerModules([],"modules"),Ya(t.config&&t.config.designWidth||Ha),document.body.style.backgroundColor=t.display&&t.display.backgroundColor||"#ffffff"}Ya(Ha),Wa.init=function(t){const e=t&&t.base||window.location.pathname.split("/")[1],n=t.type||"app";this.basePath="/"===e[0]?e:"/"+e,global.Env={platform:"h5",osVersion:null,osVersionInt:null,appVersionName:null,appVersionCode:null,appName:null,logLevel:"log",density:null,densityDpi:null,deviceWidth:1080,deviceHeight:1280,engine:"page"};global.createApplication("1",()=>{"app"===n?function(t){Uo(t+"/app.js",e=>{e||(Va(global.manifest),global.createAppHandler(),cr.init({base:t}))})}(this.basePath):function(t){!function(t,e){const n=new global.XMLHttpRequest;n.onreadystatechange=function(){4===n.readyState&&200===n.status&&"function"==typeof e&&e(n.responseText,null)},n.onerror=function(t){e(null,t)},n.open("GET",t,!0),n.send()}(t+"/manifest.json",(e,n)=>{n||(global.manifest=JSON.parse(e),Va(global.manifest),cr.init({type:"card",base:t}))})}(this.basePath)})},Wa.createInstance=function(t){Xn(t)?t.forEach(function(t){new Wa(t)}):"object"===ni(t)&&new Wa(t)},Wa.getInstance=function(t){return za[t]||this.createInstance({appId:t}),za[t]},Wa.prototype={createApp:function(t,e){let n=document.querySelector("#"+this.rootId);n||((n=document.createElement("div")).id=this.rootId,document.body.appendChild(n));const i=global.createApplication(this.instanceId,e,{bundleUrl:this.bundleUrl,debug:t.debug},this.data);if(i instanceof Error)return console.error("### Web Render ### ",i)},getComponentManager:function(){return this._componentManager||(this._componentManager=Ei.getInstance(this.instanceId)),this._componentManager},getRoot:function(){return document.querySelector("#"+this.rootId)}},Wa.stopTheWorld=function(t){if(!t)return Object.keys(za).map(function(t){Wa.stopTheWorld(t)});window.destroyInstance(t)},function(t){t.install=function(t){t.init(this)}.bind(t),S(t,Zs)}(Wa),S(Wa,{Component:Ca,Atomic:Sa,ComponentManager:Ei,utils:li,config:Ho}),global.Hap=global.hap=Wa;var Ua={init:function(t){const e=t.Component;function n(t,n){e.call(this,t,n),"_root"===t.ref||"root"===n?this.node.classList.add("root-container"):this.node.classList.add("hap-div")}n.prototype=Object.create(e.prototype),t.registerComponent("div",n),t.registerComponent("container",n)}};t(".hap-img{display:flex;flex:0 1 auto;box-sizing:border-box;position:relative;border:0 solid #000;margin:0;padding:0;min-width:0;white-space:normal;overflow:hidden}",void 0);const qa=["stretch","cover","contain","center"];let Ga;const Ja={create(){const t=document.createElement("image");return t.classList.add("hap-img"),t.style.height=t.style.width="auto",t.style.overflow="hidden",this.imgElement=document.createElement("img"),this.imgElement.style.height="100%",this.imgElement.style.width="100%",this.imgElement.style.objectFit="cover",t.appendChild(this.imgElement),t},_resize(){const t=this.data.style,e=this.getParent();if(t&&(t.height||t.width)){if(t.height&&t.height.indexOf("px")>-1&&!t.width)if(e&&"swiper"===e.data.type)this.node.style.width="100%";else{const e=parseInt(t.height)/this.naturalHeight*this.naturalWidth;this.node.style.width=e+"px"}else if(t.width&&t.width.indexOf("px")>-1&&!t.height){const e=parseInt(t.width)/this.naturalWidth*this.naturalHeight;this.node.style.height=e+"px"}}else t&&(!t||t.height||t.width)||e&&"stack"===e.data.type&&(this.node.style.height=this.node.style.width="100%");this._appended&&(this.node.clientHeight/this.node.clientWidth!=this.naturalHeight/this.naturalWidth&&("auto"===this.node.style.height&&this.node.clientHeight<this.naturalHeight||"auto"===this.node.style.width&&this.node.clientWidth<this.naturalWidth)&&(this.imgElement.style.objectFit="contain"),e&&e.data.style&&"string"==typeof e.data.style.height&&e.data.style.height.indexOf("px")>-1&&"column"===e.data.style.flexDirection&&"auto"===this.node.style.height&&(this.imgElement.style.height="inherit"))}},Ka={src:function(t){if(t){new global.URL(global.location.href).origin;this.node.style.opacity="0";const e=new window.Image,n="/"===t[0]&&Hap.basePath?`${Hap.basePath}${t}`:t;e.src=n,e.onload=(()=>{this.node.style.opacity=this.data.style&&this.data.style.opacity||"",this.naturalWidth=e.width,this.naturalHeight=e.height,this._resize(),this.imgElement.src=n,this._fixStyles(),this.dispatchEvent("complete",{width:this.naturalWidth,height:this.naturalHeight})}),e.onerror=(()=>{this.dispatchEvent("error")})}else this.src=lib.img.defaultSrc,this.imgElement.src=this.src},placeholder:function(t){this.imgElement.dataset.placeholder=t},placeHolder:function(t){return this.attr.placeholder.call(this,t)}},Za={width:function(t){t.indexOf("px")>-1?(((t=parseFloat(t))<0||isNaN(t))&&(t=200),this.node.style.width=t+"px"):t.indexOf("%")>-1?(this._needFixWidth=!0,this.node.style.width=t):this.node.style.width=t},height:function(t){t.indexOf("px")>-1?(((t=parseFloat(t))<0||isNaN(t))&&(t=200),this.node.style.height=t+"px"):this.node.style.height=t},resizeMode:function(t){-1===qa.indexOf(t)&&(t="cover"),this.imgElement.style.objectFit="stretch"===t?"fill":"center"===t?"none":t},paddingTop:function(t){-1===t.indexOf("%")&&(this.node.style.paddingTop=t)},paddingBottom:function(t){-1===t.indexOf("%")&&(this.node.style.paddingBottom=t)},paddingLeft:function(t){-1===t.indexOf("%")&&(this.node.style.paddingLeft=t)},paddingRight:function(t){-1===t.indexOf("%")&&(this.node.style.paddingRight=t)}},Qa={load:{extra:function(){const{naturalWidth:t,naturalHeight:e}=this.imgElement;return{naturalWidth:t,naturalHeight:e}}}};var Xa={init:function(t){Ga=t.Atomic;const e=t.utils.extend;function n(t){Ga.call(this,t)}n.prototype=Object.create(Ga.prototype),e(n.prototype,Ja),e(n.prototype,{attr:e(Object.create(Ga.prototype.attr),Ka)}),e(n.prototype,{style:e(Object.create(Ga.prototype.style),Za)}),e(n.prototype,{event:Qa}),t.registerComponent("image",n)}};const tl={};var el={fontFamilyDesc(t){const e=Hap.basePath||`/${window.location.pathname.split("/")[1]}`,n=this.data.instanceId;tl[n]||(tl[n]={});const i=JSON.parse(t);Array.isArray(i)&&i.forEach(t=>{if(tl[n][t.fontName]||!t.fontSrc)return;const i=t.fontSrc[0].indexOf("http")>-1?t.fontSrc[0]:e+t.fontSrc[0],o=`@font-face {\n font-family: ${t.fontName};\n src: url('${i}')\n }`;tl[n][t.fontName]=t,function(t,e){const n=`hap-font-style-${e}`;let i=document.getElementById(n);i||((i=document.createElement("style")).id=n,document.head.appendChild(i));const o=i.textContent+"\n"+t;i.textContent=o}(o,n)})}};let nl;const il={create(){const t=document.createElement("text");return t.classList.add("hap-text"),this.textNode=document.createElement("span"),this.textNode.classList.add("default-text"),t.appendChild(this.textNode),this._setProps(this.data,{_isInText:!0}),t},clearAttr(){this.node.firstChild.textContent=""},onAppend(){const t=this.getParent().data.style,e=this.data.style||{};t&&"column"===t.flexDirection&&!t.alignItems&&(this.node.style.width||e.alignSelf||(this.node.style.width="-webkit-fill-available")),this.node.style.whiteSpace="nowrap",this.node.scrollWidth>this._getProps("availableWidth")&&(this.node.style.whiteSpace=""),nl.prototype.onAppend.call(this),this.node.style.whiteSpace=""}},ol={value:function(t){const e=this.node.firstChild;if(e.innerHTML="",null==t||""===t)return;const n=typeof t;t="string"===n?t:JSON.stringify(t),"number"===n&&(e.style.wordBreak="keep-all"),e.innerHTML=t,this.node.style.whiteSpace="nowrap",this.node.scrollWidth>this._getProps("availableWidth")&&(this.node.style.whiteSpace=""),this._fixStyles(),this.node.style.whiteSpace=""}},rl={lines:function(t){if(t=parseInt(t),!isNaN(t))if(t<=0)this.node.style.textOverflow="",this.node.style.overflow="visible",this.node.style.webkitLineClamp="";else{const e=this.data?this.data.style:null;this.node.style.overflow="hidden",this.node.style.textOverflow=e?e.textOverflow:"ellipsis",this.node.style.webkitLineClamp=t,setTimeout(()=>{const e=this.node.offsetHeight;if(this.node.scrollHeight>1.2*e){const n=global.getComputedStyle(this.node),i=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom),o=parseFloat(n.paddingTop),r=parseFloat(n.paddingBottom),s=parseFloat(n.marginTop),a=parseFloat(n.marginBottom),l=(e-i)/t;this.node.style.lineHeight=l+"px",this.node.style.paddingTop="0px",this.node.style.paddingBottom="0px",this.node.style.marginTop=o+s+"px",this.node.style.marginBottom=r+a+"px"}})}},textOverflow:function(t){this.node.style.textOverflow=t}};var sl={init:function(t){nl=t.Component;const e=t.utils.extend;function n(t,e){nl.call(this,t,e)}n.prototype=Object.create(nl.prototype),e(n.prototype,il),e(n.prototype,{attr:e(Object.create(nl.prototype.attr),ol)}),e(n.prototype,{style:e(Object.create(nl.prototype.style),el,rl)}),t.registerComponent("text",n)}};function al(t){if(this.v=t.v||0,this.a=t.a||0,void 0!==t.t&&(this.t=t.t),void 0!==t.s&&(this.s=t.s),void 0===this.t)if(void 0===this.s)this.t=-this.v/this.a;else{const t=(Math.sqrt(this.v*this.v+2*this.a*this.s)-this.v)/this.a,e=(-Math.sqrt(this.v*this.v+2*this.a*this.s)-this.v)/this.a;this.t=Math.min(t,e)}void 0===this.s&&(this.s=this.a*this.t*this.t/2+this.v*this.t)}t(".scrollable-wrap{display:block;overflow:hidden;height:100%;width:-webkit-fill-available;flex:0 999999 auto;pointer-events:auto}.scrollable-element.horizontal{-webkit-box-orient:horizontal;-webkit-flex-direction:row;flex-direction:row}.scrollable-element.vertical{-webkit-box-orient:vertical;-webkit-flex-direction:column;flex-direction:column}.hap-list-item.row{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:flex;z-index:0;overflow:hidden;max-width:100%;flex-shrink:0}.hap-list-item.column{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:flex;z-index:0;overflow:hidden;height:fit-content;max-width:100vw}",void 0),al.prototype.generateCubicBezier=function(){return t=this.v/this.a,e=this.t+this.v/this.a,[[(t/3+(t+e)/3-t)/(e-t),(t*t/3+t*e*2/3-t*t)/(e*e-t*t)],[(e/3+(t+e)/3-t)/(e-t),(e*e/3+t*e*2/3-t*t)/(e*e-t*t)]];var t,e},!lib&&(lib={}),lib.motion=al;var ll=window.document,cl=window.navigator.userAgent,dl={},hl={},pl=window.dpr||(window.navigator.userAgent.match(/iPhone|iPad|iPod/)?document.documentElement.clientWidth/window.screen.availWidth:1),ul={normal:[2*pl,.0015*pl],slow:[1.5*pl,.003*pl],veryslow:[1.5*pl,.005*pl]},fl=!!cl.match(/Firefox/i),ml=!!cl.match(/IEMobile/i),gl=fl?"-moz-":ml?"-ms-":"-webkit-",yl=fl?"Moz":ml?"ms":"webkit";function bl(){lib.scroll.outputDebugLog&&console.log.apply(console,arguments)}function vl(t){var e=t.getBoundingClientRect();if(!e){(e={}).width=t.offsetWidth,e.height=t.offsetHeight,e.left=t.offsetLeft,e.top=t.offsetTop;for(var n=t.offsetParent;n;)e.left+=n.offsetLeft,e.top+=n.offsetTop,n=n.offsetParent;e.right=e.left+e.width,e.bottom=e.top+e.height}return e}function El(t){return 0-t.options[t.axis+"PaddingTop"]}function wl(t){var e=vl(t.element),n=vl(t.viewport),i=El(t);if("y"===t.axis)var o=0-e.height+n.height;else o=0-e.width+n.width;return Math.min(o+t.options[t.axis+"PaddingBottom"],i)}function xl(t,e){return e>t.minScrollOffset?e-t.minScrollOffset:e<t.maxScrollOffset?e-t.maxScrollOffset:void 0}function Tl(t,e){return e>t.minScrollOffset?e=t.minScrollOffset:e<t.maxScrollOffset&&(e=t.maxScrollOffset),e}function Al(t,e,n){bl(t.element.scrollId,e,n);var i=ll.createEvent("HTMLEvents");if(i.initEvent(e,!1,!0),i.scrollObj=t,n)for(var o in n)i[o]=n[o];t.element.dispatchEvent(i),t.viewport.dispatchEvent(i)}function kl(t){var e,n={x:0,y:0},i=getComputedStyle(t.element)[yl+"Transform"],o=new RegExp("^matrix3d\\((?:[-\\d.]+,\\s*){12}([-\\d.]+),\\s*([-\\d.]+)(?:,\\s*[-\\d.]+){2}\\)"),r=new RegExp("^matrix\\((?:[-\\d.]+,\\s*){4}([-\\d.]+),\\s*([-\\d.]+)\\)$");return"none"!==i&&(e=i.match(o)||i.match(r))&&(n.x=parseFloat(e[1])||0,n.y=parseFloat(e[2])||0),n}var _l=ml?"MSCSSMatrix":"WebKitCSSMatrix",Cl=!!fl||_l in window&&"m11"in new window[_l];function Sl(t,e,n){t.element.style[yl+"Transition"]=""===e&&""===n?"":gl+"transform "+e+" "+n+" 0s"}function Ml(t,e){var n=0,i=0;"object"==typeof e?(n=e.x,i=e.y):"y"===t.axis?i=e:n=e,t.element.style[yl+"Transform"]=function(t,e){return 0!=(t=parseFloat(t))&&(t+="px"),0!=(e=parseFloat(e))&&(e+="px"),Cl?"translate3d("+t+", "+e+", 0)":"translate("+t+", "+e+")"}(n,i)}var Ol=!1;function Dl(t,e){var n,i,o,r,s,a=this;if((e=e||{}).noBounce=!!e.noBounce,e.padding=e.padding||{},null==e.isPrevent?e.isPrevent=!0:e.isPrevent=!!e.isPrevent,null==e.isFixScrollendClick?e.isFixScrollendClick=!0:e.isFixScrollendClick=!!e.isFixScrollendClick,e.padding?(e.yPaddingTop=-e.padding.top||0,e.yPaddingBottom=-e.padding.bottom||0,e.xPaddingTop=-e.padding.left||0,e.xPaddingBottom=-e.padding.right||0):(e.yPaddingTop=0,e.yPaddingBottom=0,e.xPaddingTop=0,e.xPaddingBottom=0),e.direction=e.direction||"y",e.inertia=e.inertia||"normal",this.options=e,a.axis=e.direction,this.element=t,this.viewport=t.parentNode,this.plugins={},this.element.scrollId=setTimeout(function(){dl[a.element.scrollId+""]=a},1),this.viewport.addEventListener("touchstart",function(t){if(!f(t))return;i&&g();if(e.useFrameAnimation)h&&h.stop(),h=null;else{var n=kl(a);Ml(a,n),Sl(a,"",""),p=null,clearTimeout(u)}},!1),this.viewport.addEventListener("touchend",m,!1),this.viewport.addEventListener("touchcancel",m,!1),this.viewport.addEventListener("panstart",function(t){if(!f(t))return;a.transformOffset=kl(a),a.minScrollOffset=El(a),a.maxScrollOffset=wl(a),n=2.5,r=!0,i=!0,o=!1,Al(a,"scrollstart"),s=t["displacement"+a.axis.toUpperCase()]},!1),this.viewport.addEventListener("panmove",function(t){if(!f(t))return;var e=t["displacement"+a.axis.toUpperCase()];if(Math.abs(e-s)<5)return void t.stopPropagation();s=e;var i=a.transformOffset[a.axis]+e;i>a.minScrollOffset?(i=a.minScrollOffset+(i-a.minScrollOffset)/n,n*=1.003):i<a.maxScrollOffset&&(i=a.maxScrollOffset-(a.maxScrollOffset-i)/n,n*=1.003);n>4&&(n=4);var o=xl(a,i);o&&(Al(a,o>0?"y"===a.axis?"pulldown":"pullright":"y"===a.axis?"pullup":"pullleft",{boundaryOffset:Math.abs(o)}),a.options.noBounce&&(i=Tl(a,i)));Ml(a,i.toFixed(2)),Al(a,"scrolling")},!1),this.viewport.addEventListener("panend",function(t){if(!f(t))return;t.isSwipe&&function(t){var n,s,l,c,p,u,f,m,y,b,v,E,w,x,T,A,k;if(r=!0,c=kl(a)[a.axis],!xl(a,c)){n=t["velocity"+a.axis.toUpperCase()];var _=2,C=.0015;e.inertia&&ul[e.inertia]&&(_=ul[e.inertia][0],C=ul[e.inertia][1]),n>_&&(n=_),n<-_&&(n=-_),s=C*(n/Math.abs(n)),u=new lib.motion({v:n,a:-s}),l=u.t,p=c+u.s;var S=xl(a,p);if(S){bl("inertial calculation has exceeded the boundary",S),f=n,m=s,S>0?(b=a.minScrollOffset,E=1):(b=a.maxScrollOffset,E=-1),v=new lib.motion({v:E*f,a:-E*m,s:Math.abs(b-c)}),y=v.t;var M=v.generateCubicBezier();x=(w=f-m*y)/Math.abs(w)*.03,k=new lib.motion({v:w,a:-x}),T=k.t,A=b+k.s;k.generateCubicBezier();if(e.noBounce)if(bl("no bounce effect"),c!==b)if(e.useFrameAnimation){var O=b-c,D=lib.cubicbezier(M[0][0],M[0][1],M[1][0],M[1][1]);(h=new lib.animation(y.toFixed(0),D,0,function(t,e){var n=c+O*e;kl(a,n.toFixed(2)),Al(a,"scrolling",{afterFlick:!0})})).onend(g),h.play()}else{var L=b.toFixed(0);d(g,1e3*(y/1e3).toFixed(2)),Sl(a,(y/1e3).toFixed(2)+"s","cubic-bezier("+M+")"),Ml(a,L)}else g();else if(c!==A)if(bl("scroll for inertia","s="+A.toFixed(0),"t="+((y+T)/1e3).toFixed(2)),e.useFrameAnimation){var O=A-c,D=lib.cubicbezier.easeOut;(h=new lib.animation((y+T).toFixed(0),D,0,function(t,e){var n=c+O*e;Ml(a,n.toFixed(2)),Al(a,"scrolling",{afterFlick:!0})})).onend(function(){if(a.enabled){var t=b-A,e=lib.cubicbezier.ease;(h=new lib.animation(400,e,0,function(e,n){var i=A+t*n;Ml(a,i.toFixed(2)),Al(a,"scrolling",{afterFlick:!0})})).onend(g),h.play()}}),h.play()}else{var L=A.toFixed(0);d(function(t){if(a.enabled)if(bl("inertial bounce","s="+b.toFixed(0),"t=400"),A!==b){var e=b.toFixed(0);Sl(a,"0.4s","ease"),Ml(a,e),d(g,400)}else g()},1e3*((y+T)/1e3).toFixed(2)),Sl(a,((y+T)/1e3).toFixed(2)+"s","ease-out"),Ml(a,L)}else g()}else{bl("inertial calculation hasn't exceeded the boundary");var I=u.generateCubicBezier();if(e.useFrameAnimation){var O=p-c,D=lib.cubicbezier(I[0][0],I[0][1],I[1][0],I[1][1]);(h=new lib.animation(l.toFixed(0),D,0,function(t,e){var n=(c+O*e).toFixed(2);Ml(a,n),Al(a,"scrolling",{afterFlick:!0})})).onend(g),h.play()}else{var L=p.toFixed(0);d(g,1e3*(l/1e3).toFixed(2)),Sl(a,(l/1e3).toFixed(2)+"s","cubic-bezier("+I+")"),Ml(a,L)}}o=!0,e.useFrameAnimation||lib.animation.requestFrame(function t(){i&&o&&a.enabled&&(Al(a,"scrolling",{afterFlick:!0}),lib.animation.requestFrame(t))})}}(t)},!1),e.isPrevent&&(this.viewport.addEventListener("touchstart",function(t){Ol=!0},!1),a.viewport.addEventListener("touchend",function(t){Ol=!1},!1)),e.isFixScrollendClick){var l,c;this.viewport.addEventListener("scrolling",function(){l=!0,c&&clearTimeout(c),c=setTimeout(function(t){l=!1},400)},!1),this.viewport.addEventListener("click",function(t){return!l&&!i||(t.preventDefault(),t.stopPropagation(),!1)}),this.viewport.addEventListener("tap",function(t){l||i||setTimeout(function(){var e=document.createEvent("HTMLEvents");e.initEvent("niceclick",!0,!0),t.target.dispatchEvent(e)},300)})}function d(t,n){e.useFrameAnimation||(p=null,clearTimeout(u),u=setTimeout(function(){p&&(p=null,lib.animation.requestFrame(t))},n||400),p=t)}if(e.useFrameAnimation){var h;Object.defineProperty(this,"animation",{get:function(){return h}})}else{var p,u=0;t.addEventListener(fl?"transitionend":yl+"TransitionEnd",function(t){if(p){var e=p;p=null,clearTimeout(u),lib.animation.requestFrame(function(){e(t)})}},!1)}function f(t){if(!a.enabled)return!1;if(void 0!==t.isVertical){if(!("y"===a.axis&&t.isVertical||"x"===a.axis&&!t.isVertical))return!1;t.stopPropagation()}return!0}function m(t){if(f(t)){var n=kl(a)[a.axis],o=xl(a,n);if(o){var r=Tl(a,n);if(e.useFrameAnimation){var s=r-n;(h=new lib.animation(400,lib.cubicbezier.ease,0,function(t,e){var i=(n+s*e).toFixed(2);Ml(a,i),Al(a,"scrolling")})).onend(g),h.play()}else{var l=r.toFixed(0);d(g,400),Sl(a,"0.4s","ease"),Ml(a,l),lib.animation.requestFrame(function t(){i&&a.enabled&&(Al(a,"scrolling"),lib.animation.requestFrame(t))})}o>0?Al(a,"y"===a.axis?"pulldownend":"pullrightend"):o<0&&Al(a,"y"===a.axis?"pullupend":"pullleftend")}else i&&g()}}function g(){a.enabled&&(r=!1,setTimeout(function(){!r&&i&&(i=!1,o=!1,e.useFrameAnimation?(h&&h.stop(),h=null):Sl(a,"",""),Al(a,"scrollend"))},50))}Object.defineProperty(this,"isScrolling",{get:function(){return!!i}});var y={init:function(){return this.enable(),this.refresh(),this.scrollTo(0),this},enable:function(){return this.enabled=!0,this},disable:function(){var t=this.element;return this.enabled=!1,this.options.useFrameAnimation?h&&h.stop():lib.animation.requestFrame(function(){t.style[yl+"Transform"]=getComputedStyle(t)[yl+"Transform"]}),this},getScrollWidth:function(){return vl(this.element).width},getScrollHeight:function(){return vl(this.element).height},getScrollLeft:function(){return-kl(this).x-this.options.xPaddingTop},getScrollTop:function(){return-kl(this).y-this.options.yPaddingTop},getMaxScrollLeft:function(){return-a.maxScrollOffset-this.options.xPaddingTop},getMaxScrollTop:function(){return-a.maxScrollOffset-this.options.yPaddingTop},getBoundaryOffset:function(){return Math.abs(xl(this,kl(this)[this.axis])||0)},refresh:function(){var t=this.element,e="y"===this.axis,n=e?"height":"width";function i(t,e){var n=e?["top","bottom"]:["left","right"];return parseFloat(getComputedStyle(t.firstElementChild)["margin-"+n[0]])+parseFloat(getComputedStyle(t.lastElementChild)["margin-"+n[1]])}if(null!=this.options[n])this.options[n];else if(t.childElementCount<=0)t.style[n]="auto",null;else if(this.options.useElementRect)t.style[n]="auto",(r=vl(t))[n],i(t,e);else{var o,r,s=t.firstElementChild,a=t.lastElementChild;if(document.createRange&&!this.options.ignoreOverflow&&((o=document.createRange()).selectNodeContents(t),r=vl(o)),r)r[n];else{for(;s&&0===vl(s)[n]&&s.nextElementSibling;)s=s.nextElementSibling;for(;a&&a!==s&&0===vl(a)[n]&&a.previousElementSibling;)a=a.previousElementSibling;vl(a)[e?"bottom":"right"]-vl(s)[e?"top":"left"]}i(t,e)}return t.style[n]="width"===n?"fit-content":"auto",this.transformOffset=kl(this),this.minScrollOffset=El(this),this.maxScrollOffset=wl(this),this.scrollTo(-this.transformOffset[this.axis]-this.options[this.axis+"PaddingTop"]),Al(this,"contentrefresh"),this},offset:function(t){var e,n=vl(this.element),i=vl(t);"y"===this.axis?(e={top:i.top-n.top-this.options.yPaddingTop,left:i.left-n.left,right:n.right-i.right,width:i.width,height:i.height}).bottom=e.top+e.height:(e={top:i.top-n.top,bottom:n.bottom-i.bottom,left:i.left-n.left-this.options.xPaddingTop,width:i.width,height:i.height}).right=e.left+e.width;return e},getRect:function(t){var e,n=vl(this.viewport),i=vl(t);"y"===this.axis?(e={top:i.top-n.top,left:i.left-n.left,right:n.right-i.right,width:i.width,height:i.height}).bottom=e.top+e.height:(e={top:i.top-n.top,bottom:n.bottom-i.bottom,left:i.left-n.left,width:i.width,height:i.height}).right=e.left+e.width;return e},isInView:function(t){var e=this.getRect(this.viewport),n=this.getRect(t);return"y"===this.axis?e.top<n.bottom&&e.bottom>n.top:e.left<n.right&&e.right>n.left},scrollTo:function(t,e){var n=this;this.element;if(t=Tl(this,t=-t-this.options[this.axis+"PaddingTop"]),i=!0,!0===e)if(this.options.useFrameAnimation){var o=kl(n)[this.axis],r=t-o;(h=new lib.animation(400,lib.cubicbezier.easeInOut,0,function(t,e){var i=(o+r*e).toFixed(2);Ml(n,i),Al(n,"scrolling")})).onend(g),h.play()}else{d(g,400),Sl(n,"0.4s","ease-in-out"),Ml(n,t),lib.animation.requestFrame(function t(){i&&n.enabled&&(Al(n,"scrolling"),lib.animation.requestFrame(t))})}else this.options.useFrameAnimation||Sl(n,"",""),Ml(n,t),g();return this},scrollToElement:function(t,e,n){var i=this.offset(t);return i=i["y"===this.axis?"top":"left"],n&&(i+=n),this.scrollTo(i,e)},getViewWidth:function(){return vl(this.viewport).width},getViewHeight:function(){return vl(this.viewport).height},addPulldownHandler:function(t){var e=this;return this.element.addEventListener("pulldownend",function(n){e.disable(),t.call(e,n,function(){e.scrollTo(0,!0),e.refresh(),e.enable()})},!1),this},addPullupHandler:function(t){var e=this;return this.element.addEventListener("pullupend",function(n){e.disable(),t.call(e,n,function(){e.scrollTo(e.getScrollHeight(),!0),e.refresh(),e.enable()})},!1),this},addScrollstartHandler:function(t){var e=this;return this.element.addEventListener("scrollstart",function(n){t.call(e,n)},!1),this},addScrollingHandler:function(t){var e=this;return this.element.addEventListener("scrolling",function(n){t.call(e,n)},!1),this},addScrollendHandler:function(t){var e=this;return this.element.addEventListener("scrollend",function(n){t.call(e,n)},!1),this},addContentrenfreshHandler:function(t){var e=this;this.element.addEventListener("contentrefresh",function(n){t.call(e,n)},!1)},addEventListener:function(t,e,n){var i=this;this.element.addEventListener(t,function(t){e.call(i,t)},!!n)},removeEventListener:function(t,e){var n=this;this.element.removeEventListener(t,function(t){e.call(n,t)})},enablePlugin:function(t,e){var n=hl[t];return n&&!this.plugins[t]&&(this.plugins[t]=!0,e=e||{},n.call(this,t,e)),this}};for(var b in y)this[b]=y[b]}ll.addEventListener("touchmove",function(t){return!Ol},!1),lib.scroll=function(t,e){if(1===arguments.length&&!(arguments[0]instanceof HTMLElement))if((e=arguments[0]).scrollElement)t=e.scrollElement;else{if(!e.scrollWrap)throw new Error("no scroll element");t=e.scrollWrap.firstElementChild}if(!t.parentNode)throw new Error("wrong dom tree");if(e&&e.direction&&["x","y"].indexOf(e.direction)<0)throw new Error("wrong direction");return!0===e.downgrade&&lib.scroll.downgrade?lib.scroll.downgrade(t,e):t.scrollId?dl[t.scrollId]:new Dl(t,e)},lib.scroll.plugin=function(t,e){if(!e)return hl[t];(t=t.split(",")).forEach(function(t){hl[t]=e})};const Ll={h:["row","horizontal","h","x","column wrap"],v:["column","vertical","v","y","row wrap"]},Il="column",Pl=0;function Nl(t){const e=t.Component;return{create:function(t){const n=lib.scroll,i=e.prototype.create.call(this,t);return i.classList.add("hap-container"),i.classList.add("scrollable-wrap"),this.scrollElement=document.createElement("div"),this.scrollElement.classList.add("scrollable-element"),this.scrollElement.classList.add("dir-"+this.direction),this.scrollElement.style.webkitBoxOrient=Ll[this.direction][1],this.scrollElement.style.webkitFlexDirection=Ll[this.direction][0],this.scrollElement.style.flexDirection=Ll[this.direction][0],this.scrollElement.style.display="grid",this.scrollElement.style.flex=1,i.appendChild(this.scrollElement),this.scroller=new n({useElementRect:"v"===this.direction,scrollElement:this.scrollElement,direction:"h"===this.direction?"x":"y",noBounce:!0}),this.scroller.init(),this.offset=0,i},createChildren:function(){const t=this.data.children,e=this.data.ref,n=this.getComponentManager();if(t&&t.length){const i=document.createDocumentFragment();let o=!1;for(let r=0;r<t.length;r++){t[r].instanceId=this.data.instanceId;const s=n.createElement(t[r]);i.appendChild(s.node),s.parentRef=e,!o&&s.data.style&&s.data.style.hasOwnProperty("flex")&&(o=!0)}this.scrollElement.appendChild(i)}setTimeout(function(){this.scroller.refresh()}.bind(this),0)},appendChild:function(t){const e=this.data.children,n=this.getComponentManager().createElement(t);return this.scrollElement.appendChild(n.node),setTimeout(function(){this.scroller.refresh()}.bind(this),0),e&&e.length?e.push(t):this.data.children=[t],n},insertBefore:function(t,e){const n=this.data.children;let i=0,o=!1;if(n&&n.length&&e){let t;for(t=n.length;i<t&&n[i].ref!==e.data.ref;i++);i===t&&(o=!0)}else o=!0;if(o)this.scrollElement.appendChild(t.node),n.push(t.data);else{const o=e.refreshPlaceholder||e.loadingPlaceholder;o?this.scrollElement.insertBefore(t.node,o):e.fixedPlaceholder?this.scrollElement.insertBefore(t.node,e.fixedPlaceholder):e.stickyPlaceholder?this.scrollElement.insertBefore(t.node,e.stickyPlaceholder):this.scrollElement.insertBefore(t.node,e.node),n.splice(i,0,t.data)}setTimeout(function(){this.scroller.refresh()}.bind(this),0)},removeChild:function(t){const e=this.data.children;let n=0;const i=this.getComponentManager();if(e&&e.length){let i;for(i=e.length;n<i&&e[n].ref!==t.data.ref;n++);n<i&&e.splice(n,1)}i.removeComponent(t.data.ref);const o=t.refreshPlaceholder||t.loadingPlaceholder;t.unsetPosition(),o&&this.scrollElement.removeChild(o),t.node.parentNode.removeChild(t.node),setTimeout(function(){this.scroller.refresh()}.bind(this),0)},bindEvents:function(t){e.prototype.bindEvents.call(this,t),this.scroller.addEventListener("scrolling",function(t){if(this.scrollpage);else{const e=t.scrollObj,n=e.getScrollTop(),i=e.getScrollLeft(),o="v"===this.direction?n:i,r=o-this.offset;this.dispatchEvent("scroll",{scrollY:"v"===this.direction?r:0,scrollX:"v"===this.direction?0:r,scrollState:0},{bubbles:!0}),this.offset=o;const s=Math.abs(e.maxScrollOffset)-this.offset;s<=this.loadmoreoffset&&this.isAvailableToFireloadmore?(this.isAvailableToFireloadmore=!1,this.dispatchEvent("loadmore"),this.dispatchEvent("scrollbottom")):s>this.loadmoreoffset&&!this.isAvailableToFireloadmore&&(this.isAvailableToFireloadmore=!0),this.offset<=0&&this.dispatchEvent("scrolltop")}}.bind(this))},onAppend:function(){var t;(t=this).renderendHandler||(t.renderendHandler=function(){t.scroller.refresh()}),window.addEventListener("renderend",t.renderendHandler),e.prototype.onAppend.call(this)},onRemove:function(){var t;(t=this).renderendHandler&&window.removeEventListener("renderend",t.renderendHandler)}}}const Rl={loadmoreoffset:function(t){(t=parseFloat(t))<0||isNaN(t)?console.warn("### Web Render ### invalid"):this.loadmoreoffset=t}};var Fl={init:function(t){const e=t.Component,n=t.utils.extend;function i(t,n){this.loadmoreoffset=Pl,this.isAvailableToFireloadmore=!0;const i=t.attr||{},o=(t.style||{}).flexDirection||i.scrollDirection||i.direction||i.flexDirection||Il;this.direction=-1===Ll.h.indexOf(o)?"v":"h",this.showScrollbar=i.showScrollbar||!1,e.call(this,t,n)}return i.prototype=Object.create(e.prototype),n(i.prototype,Nl(t)),n(i.prototype,{attr:n(Object.create(e.prototype.attr),Rl)}),i}};const Bl=["list-item","cell","loading","refresh"];const jl={columns:function(t){this.scrollElement.style.gridTemplateColumns=`repeat(${t}, 1fr)`},flexDirection:function(t){const e="row"===t;this.flexDirection=t,this._setProps(this.data,{_listDirection:t}),this.scrollElement.style.display=e?"flex":"grid",this.scrollElement.style.overflow=e?"auto hidden":"",this.scrollElement.style.height=e?"-webkit-fill-available":"",this.node.style.flexShrink=e?"0":"",this.node.setAttribute("direction",t)},display(t){}},Hl={scrollpage:function(t){this._appended&&zl(this,t)}};var $l={init:function(t){const e=Fl.init(t);function n(t,n){e.call(this,t,n)}const i=t.utils.extend;return n.prototype=Object.create(e.prototype),i(n.prototype,function(t){return{create(e){const n=t.prototype.create.call(this,e);n.classList.add("list-wrap"),this.scrollElement.classList.add("list-element");const i=this.data.style&&"row"===this.data.style.flexDirection;return this.data.props&&this.data.props._isInTabContent&&this.data.props.tabwrap&&(i||this.data.style&&(!this.data.style||this.data.style.height&&"100%"!==this.data.style.height)||(this.data.props.tabwrap.style.display="flex"),this._setProps(this.data,{_isInTabContent:!1,_isInList:!0})),i||this.data.style&&this.data.style.width||(this._needFixWidth=!0),n},createChildren(){return(this.data.children||[]).forEach(function(t){const e=t.type;-1===Bl.indexOf(e)&&console.warn('### Web Render ### invalid child type "'+e+'" for list.')}),t.prototype.createChildren.call(this)},appendChild(e){const n=e.type;return-1===Bl.indexOf(n)&&console.warn('### Web Render ### invalid child type "'+n+'" for list.'),t.prototype.appendChild.call(this,e)},insertBefore(e,n){const i=e.data.type;return-1===Bl.indexOf(i)&&console.warn('### Web Render ### invalid child type "'+i+'" for list.'),t.prototype.insertBefore.call(this,e,n)},onAppend(){this.refresh(),t.prototype.onAppend.call(this)},refresh(){var t;zl(this),(t=this)._getProps("_isInRefresh")&&t._getProps("refreshComp")&&t._getProps("refreshComp").updateScrollable(t)},scrollTo(t){if(void 0!==t.index){const e=this.scrollElement.children[t.index];e&&this.scroller.scrollToElement(e,!0)}}}}(e)),i(n.prototype,{style:i(Object.create(e.prototype.style),jl)}),i(n.prototype,{attr:i(Object.create(e.prototype.attr),Hl)}),n}};function zl(t,e){const n=t.getComponentManager(),i=n.getComponent(n.rootRef),o=t.getParent(),r="boolean"==typeof e?e:t.data.attr&&(!0===t.data.attr.scrollpage||"true"===t.data.attr.scrollpage);if(t.scrollpage=r,!0===r)console.warn("### Web Render ### 暂不支持scrollpage属性,请使用手机调试");else{t.node.classList.add("scrollable-wrap"),o.node.style.overflowY="";const e=o&&o.data.style,n=t.data.style;"row"===t.flexDirection||e&&e.height||n&&"fixed"===n.position||(o.node.style.height="100%",i.node.style.height=i.data.style&&i.data.style.height||"100%",i.data&&"stack"===i.data.type&&(i._needSetHeight=!1),i.node.style.overflow="hidden","100%"===t.node.style.height&&"column"!==o.node.style.flexDirection&&(o.node.style.height="-webkit-fill-available",t.node.style.height="auto"))}t.data.attr&&(t.data.attr.scrollpage=r,t.node.setAttribute("scrollpage",r))}var Yl={init:function(t){const e=$l.init(t);function n(t,n){e.call(this,t,n)}n.prototype=Object.create(e.prototype),t.registerComponent("list",n),t.registerComponent("vlist",n)}};var Wl={init:function(t){const e=$l.init(t);function n(t,n){t.attr.direction="h",e.call(this,t,n)}n.prototype=Object.create(e.prototype),t.registerComponent("hlist",n)}};const Vl={create(t){const e=document.createElement(t);return e.classList.add("hap-list-item"),"row"===this._getProps("_listDirection")?e.classList.add("row"):e.classList.add("column"),e}},Ul={columnSpan:function(t){this.node.style.gridColumnEnd=`span ${t}`},width:function(t){this.node.style.width="100%"===t?"-webkit-fill-available":t},position:function(t){}};var ql={init:function(t){const e=t.Component;function n(t,n){e.call(this,t,n)}const i=t.utils.extend;n.prototype=Object.create(e.prototype),i(n.prototype,Vl),i(n.prototype,{style:i(Object.create(e.prototype.style),Ul)}),t.registerComponent("list-item",n)}};var Gl={init:function(t){t.install(Yl),t.install(Wl),t.install(ql)}};var Jl={init:function(t){const e=Fl.init(t);function n(t,n){e.call(this,t,n)}const i=t.utils.extend;n.prototype=Object.create(e.prototype),i(n.prototype,{create(){const t=e.prototype.create.call(this);return t.classList.add("scroller-wrap"),this.scrollElement.classList.add("scroller-element"),t}}),t.registerComponent("scroller",n)}};t('.hap-refresh{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:flex;flex:0 1 auto;z-index:0;width:100%;height:100%;max-width:100%;pointer-events:auto}.mui-refresh-main{position:fixed;top:0;opacity:0;-webkit-transform:scale(0);left:50%;margin-left:-34px;padding:9px;z-index:10001;background-color:#fff;overflow:hidden;border-radius:999px;box-shadow:0 3px 8px 0 rgba(0,0,0,.19),0 6px 13px 0 rgba(0,0,0,.24);-webkit-box-shadow:0 3px 8px 0 rgba(0,0,0,.19),0 6px 13px 0 rgba(0,0,0,.24)}.mui-refresh-main-animat{-webkit-transition:all .43s cubic-bezier(.08,.55,.81,1.8)}.mui-refresh-nav{-webkit-transform:scale(1)}.mui-refresh-noshow{opacity:0;-webkit-transform:scale(.01)!important;-webkit-transition:all .25s ease-in-out!important}.mui-refresh-wrapper{width:50px;height:50px}.mui-arrow-wrapper{-webkit-transition:all .2s ease}.mui-arrow-main,.mui-half-circle{position:absolute;top:0;width:50px;height:50px;box-sizing:border-box;border:3px solid;border-color:#000 #000 transparent;border-radius:999px}.mui-arrow-main{margin-top:10px;-webkit-transform:rotate(-37deg)}.mui-arrow-main:before{content:"";display:block;position:relative;top:30px;left:0;width:0;height:0;border-width:6px;border-style:solid;transform:rotate(-56deg);-webkit-transform:rotate(-56deg)}.mui-spinner-main{width:50px;height:50px;position:relative}.mui-spinner-main .mui-spinner-left,.mui-spinner-main .mui-spinner-right{position:absolute;top:0;height:50px;width:26px;overflow:hidden}.mui-spinner-main .mui-spinner-left{left:0}.mui-spinner-main .mui-spinner-left .mui-half-circle{left:0;border-right-color:transparent}.mui-spinner-main .mui-spinner-right{right:0}.mui-spinner-main .mui-spinner-right .mui-half-circle{right:0;border-left-color:transparent}.mui-black-theme .mui-arrow-main{border-color:#000 #000 transparent}.mui-black-theme .mui-arrow-main:before{border-color:#000 #fff #fff}.mui-black-theme .mui-spinner-main .mui-spinner-left .mui-half-circle,.mui-black-theme .mui-spinner-main .mui-spinner-right .mui-half-circle{border-top-color:#000}.mui-black-theme .mui-spinner-main .mui-spinner-left .mui-half-circle{border-left-color:#000}.mui-black-theme .mui-spinner-main .mui-spinner-right .mui-half-circle{border-right-color:#000}.mui-spinner-wrapper{-webkit-animation:outer-rotate 2.91667s linear infinite;animation:outer-rotate 2.91667s linear infinite}.mui-spinner-main{-webkit-animation:sporadic-rotate 5.25s cubic-bezier(.35,0,.25,1) infinite;animation:sporadic-rotate 5.25s cubic-bezier(.35,0,.25,1) infinite}.mui-spinner-main .mui-spinner-left .mui-half-circle,.mui-spinner-main .mui-spinner-right .mui-half-circle{-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-duration:1.3125s;animation-duration:1.3125s;-webkit-animation-timing-function:cubic-bezier(.35,0,.25,1);animation-timing-function:cubic-bezier(.35,0,.25,1)}.mui-spinner-main .mui-spinner-left .mui-half-circle{-webkit-animation-name:left-wobble;animation-name:left-wobble}.mui-spinner-main .mui-spinner-right .mui-half-circle{-webkit-animation-name:right-wobble;animation-name:right-wobble}@-moz-keyframes outer-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes outer-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-o-keyframes outer-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes outer-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-moz-keyframes left-wobble{0%,to{-webkit-transform:rotate(130deg);transform:rotate(130deg)}50%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}}@-webkit-keyframes left-wobble{0%,to{-webkit-transform:rotate(130deg);transform:rotate(130deg)}50%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}}@-o-keyframes left-wobble{0%,to{-webkit-transform:rotate(130deg);transform:rotate(130deg)}50%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}}@keyframes left-wobble{0%,to{-webkit-transform:rotate(130deg);transform:rotate(130deg)}50%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}}@-moz-keyframes right-wobble{0%,to{-webkit-transform:rotate(-130deg);transform:rotate(-130deg)}50%{-webkit-transform:rotate(5deg);transform:rotate(5deg)}}@-webkit-keyframes right-wobble{0%,to{-webkit-transform:rotate(-130deg);transform:rotate(-130deg)}50%{-webkit-transform:rotate(5deg);transform:rotate(5deg)}}@-o-keyframes right-wobble{0%,to{-webkit-transform:rotate(-130deg);transform:rotate(-130deg)}50%{-webkit-transform:rotate(5deg);transform:rotate(5deg)}}@keyframes right-wobble{0%,to{-webkit-transform:rotate(-130deg);transform:rotate(-130deg)}50%{-webkit-transform:rotate(5deg);transform:rotate(5deg)}}@-moz-keyframes sporadic-rotate{12.5%{-webkit-transform:rotate(135deg);transform:rotate(135deg)}25%{-webkit-transform:rotate(270deg);transform:rotate(270deg)}37.5%{-webkit-transform:rotate(405deg);transform:rotate(405deg)}50%{-webkit-transform:rotate(540deg);transform:rotate(540deg)}62.5%{-webkit-transform:rotate(675deg);transform:rotate(675deg)}75%{-webkit-transform:rotate(810deg);transform:rotate(810deg)}87.5%{-webkit-transform:rotate(945deg);transform:rotate(945deg)}to{-webkit-transform:rotate(3turn);transform:rotate(3turn)}}@-webkit-keyframes sporadic-rotate{12.5%{-webkit-transform:rotate(135deg);transform:rotate(135deg)}25%{-webkit-transform:rotate(270deg);transform:rotate(270deg)}37.5%{-webkit-transform:rotate(405deg);transform:rotate(405deg)}50%{-webkit-transform:rotate(540deg);transform:rotate(540deg)}62.5%{-webkit-transform:rotate(675deg);transform:rotate(675deg)}75%{-webkit-transform:rotate(810deg);transform:rotate(810deg)}87.5%{-webkit-transform:rotate(945deg);transform:rotate(945deg)}to{-webkit-transform:rotate(3turn);transform:rotate(3turn)}}@-o-keyframes sporadic-rotate{12.5%{-webkit-transform:rotate(135deg);transform:rotate(135deg)}25%{-webkit-transform:rotate(270deg);transform:rotate(270deg)}37.5%{-webkit-transform:rotate(405deg);transform:rotate(405deg)}50%{-webkit-transform:rotate(540deg);transform:rotate(540deg)}62.5%{-webkit-transform:rotate(675deg);transform:rotate(675deg)}75%{-webkit-transform:rotate(810deg);transform:rotate(810deg)}87.5%{-webkit-transform:rotate(945deg);transform:rotate(945deg)}to{-webkit-transform:rotate(3turn);transform:rotate(3turn)}}@keyframes sporadic-rotate{12.5%{-webkit-transform:rotate(135deg);transform:rotate(135deg)}25%{-webkit-transform:rotate(270deg);transform:rotate(270deg)}37.5%{-webkit-transform:rotate(405deg);transform:rotate(405deg)}50%{-webkit-transform:rotate(540deg);transform:rotate(540deg)}62.5%{-webkit-transform:rotate(675deg);transform:rotate(675deg)}75%{-webkit-transform:rotate(810deg);transform:rotate(810deg)}87.5%{-webkit-transform:rotate(945deg);transform:rotate(945deg)}to{-webkit-transform:rotate(3turn);transform:rotate(3turn)}}',void 0);const Kl="mui-refresh-noshow",Zl="mui-refresh-main-animat",Ql="mui-black-theme",Xl=-85,tc=0,ec=60,nc=!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),ic={top:0,x1:0,x2:0,y1:0,y2:0};class oc{constructor(t){t=t||{},function(){this.scrollEl=document.body,this.scrollableList=[],this.isShowLoading=!1,this.isStoping=!1,this.isBtnAction=!1,this.isTouching=!1,this.NUM_POS_TARGET_Y=12,this.NUM_POS_MAX_Y=160,this.touchCurrentY=0,this.touchStartY=0,this.circlePosY=0,this.maxRotateTime=6e4,this.onBtnBegin=null,this.onBtnEnd=null,this.stopAnimatTimeout=null}.call(this),this.scrollEl=t.scrollEl?t.scrollEl:nc?this.scrollEl:document,this.onBegin=t.onBegin,this.onEnd=t.onEnd,this.maxRotateTime=t.maxTime||this.maxRotateTime,this.refreshNav=t.nav||"",this.$refreshMain=t.refreshEl,this.$spinnerWrapper=this.$refreshMain.querySelector(".mui-spinner-wrapper"),this.$arrowWrapper=this.$refreshMain.querySelector(".mui-arrow-wrapper"),this.$arrowMain=this.$refreshMain.querySelector(".mui-arrow-main"),t.index&&(this.$refreshMain.style.zIndex=~~t.index),t.top&&(this.$refreshMain.style.top=t.top),t.theme?this.$refreshMain.classList.add(t.theme):this.$refreshMain.classList.add(Ql),t.tabIndex&&(this.$refreshMain.style.left=`${100*t.tabIndex+50}%`),this.$refreshMain.classList.add(Zl),t.freeze||pc.call(this)}resolve(){!this.isStoping&&this.stopAnimatTimeout&&(clearTimeout(this.stopAnimatTimeout),this.stopAnimatTimeout=null,hc.call(this))}destroy(){uc.call(this),this.$refreshMain="",this.scrollableList=[]}refresh(t){if(!this.isShowLoading){const e=ec+this.NUM_POS_TARGET_Y;this.isShowLoading=!0,this.isBtnAction=!0,t=t||{},this.onBtnBegin=t.onBegin,this.onBtnEnd=t.onEnd,this.$refreshMain.style.display="",this.$refreshMain.classList.remove(Zl),this.$refreshMain.style.top=e+"px",this.$refreshMain.style.webkitTransform="scale(0.01)",setTimeout(dc.bind(this),60)}}updateScrollable(t){"list"===t.data.type&&this.scrollableList.push(t.node.children[0])}setBackGroundColor(t){this.$refreshMain.style.backgroundColor=t;const e=document.styleSheets[4].cssRules[16];".mui-black-theme .mui-arrow-main:before"===e.selectorText&&(e.style.borderRightColor=e.style.borderLeftColor=e.style.borderBottomColor=t)}setProgressColor(t){const e=document.styleSheets[4].cssRules;".mui-black-theme .mui-arrow-main"===e[15].selectorText&&(e[15].style.borderRightColor=e[15].style.borderLeftColor=e[15].style.borderTopColor=t),".mui-black-theme .mui-arrow-main::before"===e[16].selectorText&&(e[16].style.borderTopColor=t),".mui-black-theme .mui-spinner-main .mui-spinner-left .mui-half-circle, .mui-black-theme .mui-spinner-main .mui-spinner-right .mui-half-circle"===e[17].selectorText&&(e[17].style.borderTopColor=t),".mui-black-theme .mui-spinner-main .mui-spinner-left .mui-half-circle"===e[18].selectorText&&(e[18].style.borderLeftColor=t),".mui-black-theme .mui-spinner-main .mui-spinner-right .mui-half-circle"===e[19].selectorText&&(e[19].style.borderRightColor=t)}unbindEvents(){uc.call(this)}bindEvents(){pc.call(this)}changeOffest(t){this.NUM_POS_TARGET_Y=12+parseInt(t||0),this.NUM_POS_MAX_Y=160+parseInt(t||0)}}function rc(t){this.isTouching=!0,nc&&this.scrollEl===document.body?ic.top=window.scrollY:this.scrollEl!==document?ic.top=this.scrollEl.scrollTop:ic.top=(document.documentElement||document.body.parentNode||document.body).scrollTop,ic.top>0||this.isShowLoading||(this.circlePosY=ec+Xl,this.$refreshMain.style.display="",this.$spinnerWrapper.style.display="none",(t=t.originalEvent||t).touches[0]&&(this.touchCurrentY=this.touchStartY=t.touches[0].pageY))}function sc(t){if(t=t.originalEvent||t,ic.top>0||this.isShowLoading||!t.touches||1!==t.touches.length)return;if(this.scrollableList.length>0)for(let t=0;t<this.scrollableList.length;t++){const e=this.scrollableList[t].style.transform,n=parseInt(e.split(",")[1]);if(n&&n<0)return}const e=t.touches[0];this.touchCurrentY=e.pageY;const n=this.touchCurrentY-this.touchStartY;this.circlePosY=ec+Xl+n,n<ec-tc+this.NUM_POS_MAX_Y?cc.call(this,n):cc.call(this,ec-tc+this.NUM_POS_MAX_Y)}function ac(t){this.isTouching=!1,ic.top>0||this.isShowLoading||(this.circlePosY>ec-tc+this.NUM_POS_TARGET_Y?dc.call(this):lc.call(this))}function lc(){const t=ec+Xl;this.$refreshMain.style.top=t+"px",this.$refreshMain.style.webkitTransform="scale(0)",setTimeout(function(){this.isShowLoading||this.isTouching||(this.$refreshMain.style.opacity=0,this.$refreshMain.style.display="none")}.bind(this),300)}function cc(t){const e=t/100>1?1:t/100<0?0:t/100,n=ec+Xl+t;this.$refreshMain.style.webkitTransform="scale(1)",this.$refreshMain.style.opacity=e,this.$refreshMain.style.top=n+"px",this.$arrowMain.style.webkitTransform="rotate("+-2*t+"deg)"}function dc(){if(this.isShowLoading=!0,this.isBtnAction&&"function"==typeof this.onBtnBegin?this.onBtnBegin():"function"==typeof this.onBegin&&this.onBegin(),this.$refreshMain.style.opacity=1,this.isBtnAction)this.$refreshMain.classList.add(Zl),this.$refreshMain.style.webkitTransform="scale(1)";else{const t=ec+this.NUM_POS_TARGET_Y;this.$refreshMain.style.top=t+"px"}this.$arrowWrapper.style.display="none",this.$spinnerWrapper.style.display="",this.stopAnimatTimeout=setTimeout(hc.bind(this),this.maxRotateTime)}function hc(){this.isStoping=!0,this.$refreshMain.classList.add(Kl),this.$spinnerWrapper.style.diplay="none",setTimeout(function(){this.$refreshMain.classList.remove(Kl),this.$refreshMain.style.display="none",lc.call(this),this.$arrowWrapper.style.display="",this.isShowLoading=!1,this.isStoping=!1,this.isBtnAction&&"function"==typeof this.onBtnEnd?this.onBtnEnd():"function"==typeof this.onEnd&&this.onEnd(),this.isBtnAction=!1}.bind(this),300)}function pc(){this.scrollEl.addEventListener("touchstart",rc.bind(this)),this.scrollEl.addEventListener("touchmove",sc.bind(this)),this.scrollEl.addEventListener("touchend",ac.bind(this))}function uc(){this.scrollEl.removeEventListener("touchstart",rc.bind(this)),this.scrollEl.removeEventListener("touchmove",sc.bind(this)),this.scrollEl.removeEventListener("touchend",ac.bind(this))}const fc={create(){const t=document.createElement("refresh");t.classList.add("hap-refresh"),this.muiRefresh=document.createElement("div"),this.muiRefresh.classList.add("mui-refresh-main");this.muiRefresh.innerHTML='<div class="mui-refresh-wrapper">\n <div class="mui-arrow-wrapper">\n <div class="mui-arrow-main"></div>\n </div>\n <div class="mui-spinner-wrapper" style="display:none;">\n <div class="mui-spinner-main" >\n <div class="mui-spinner-left">\n <div class="mui-half-circle"></div>\n </div>\n <div class="mui-spinner-right">\n <div class="mui-half-circle"></div>\n </div>\n </div>\n </div>\n </div>';const e=function(){this.dispatchEvent("refresh",{refreshing:!0})}.bind(this);return this.refresh=new oc({scrollEl:t,refreshEl:this.muiRefresh,onBegin:e,tabIndex:this._getProps("_isInTabContent")&&this._getProps("tabIndex")}),t.appendChild(this.muiRefresh),this._setProps(this.data,{_isInRefresh:!0,refreshComp:this}),this._needFixWidth=!0,t},updateScrollable(t){this.refresh.updateScrollable(t)}},mc={refreshing:function(t){!1!==t&&"false"!==t||this.refresh.resolve(),this.isRefreshing=t,this.node.setAttribute("refreshing",t)},offset:function(t){this.refresh.changeOffest(t),this.node.setAttribute("offset",t)}},gc={backgroundColor:function(t){t&&this.refresh.setBackGroundColor(t)},progressColor:function(t){t&&this.refresh.setProgressColor(t)}};var yc={init:function(t){const e=t.Component,n=t.utils.extend;function i(t){this.isRefreshing=!1,e.call(this,t)}i.prototype=Object.create(e.prototype),n(i.prototype,fc),n(i.prototype,{attr:n(Object.create(e.prototype.attr),mc)}),n(i.prototype,{style:n(Object.create(e.prototype.style),gc)}),t.registerComponent("refresh",i)}};t(".hap-loading{overflow:hidden;position:absolute;bottom:0;left:0;width:100%;height:0}",void 0);const bc=["scroller","list","vlist"],vc=130,Ec="center",wc="center";function xc(t){t.display=!0,t.node.style.display="-webkit-box",t.node.style.display="-webkit-flex",t.node.style.display="flex"}const Tc={create(){const t=document.createElement("div");return t.classList.add("hap-container"),t.classList.add("hap-loading"),t},onAppend(){const t=this.getParent(),e=this,n=t.node.getBoundingClientRect().height;-1!==bc.indexOf(t.data.type)&&(this.loadingPlaceholder=document.createElement("div"),this.loadingPlaceholder.classList.add("hap-loading-placeholder"),this.loadingPlaceholder.style.display="none",this.loadingPlaceholder.style.width="0px",this.loadingPlaceholder.style.height="0px",(t.scrollElement||t.listElement).insertBefore(this.loadingPlaceholder,this.node),t.node.appendChild(this.node),t.scroller.addEventListener("pullup",function(t){if(e.isLoading)return;const i=t.scrollObj;var o,r;o=e,r=Math.abs(i.getScrollHeight()-i.getScrollTop()-n),o.node.style.height=r+"px",e.display||xc(e)}),t.scroller.addEventListener("pullupend",function(t){var n;e.isLoading||((n=e).node.style.height=n.clamp+"px",n.dispatchEvent("loading"),n.isLoading=!0)}))}},Ac={display:function(t){"show"===t?setTimeout(function(){xc(this)}.bind(this),0):"hide"===t?setTimeout(function(){var t;(t=this).display=!1,t.node.style.display="none",t.isLoading=!1}.bind(this),0):console.error("### Web Render ### attr 'display' of <refresh>': value "+t+" is invalid. Should be 'show' or 'hide'")}},kc={height:function(t){if(t=parseFloat(t),Number.isNaN(t)||t<0)return console.warn("### Web Render ### <loading>'s height ("+t+") is invalid.");this.clamp=t}};var _c={init:function(t){const e=t.Component,n=t.utils.extend;function i(t){this.clamp=t.style.height||vc,!t.style.alignItems&&(t.style.alignItems=Ec),!t.style.justifyContent&&(t.style.justifyContent=wc),e.call(this,t)}i.prototype=Object.create(e.prototype),n(i.prototype,Tc),n(i.prototype,{attr:Ac}),n(i.prototype,{style:n(Object.create(e.prototype.style),kc)}),t.registerComponent("loading",i)}},Cc={init:function(t){t.install(Gl),t.install(Jl),t.install(yc),t.install(_c)}};let Sc,Mc;t(".hap-slider-container{position:relative;width:-webkit-fill-available;align-self:center;pointer-events:auto;height:37px;align-items:center}.hap-slider-container .range-bar{position:relative;width:100%;box-sizing:border-box;height:8px;border-radius:10px}.hap-slider-container .value-bar{position:absolute;left:0;top:0;height:100%;border-radius:10px}.hap-slider-container .block{position:absolute;width:27px;height:27px;top:-9px;left:0;border-radius:50%}",void 0);const Oc={create(){const t=document.createElement("div");return t.classList.add("hap-slider-container"),t.classList.add("hap-container"),t},createChildren(){const t=this.node,e=document.createElement("div"),n=document.createElement("div"),i=document.createElement("span");e.classList.add("range-bar"),n.classList.add("value-bar"),i.classList.add("block"),e.appendChild(n),e.appendChild(i),t.appendChild(e),this.rangeBar=e,this.valueBar=n,this.block=i},onAppend(){this.setBackground(),this.updateContainer();const t=this;let e;this.block.addEventListener("panstart",function(e){const n=t.sliderStyle;e.preventDefault(),e.stopPropagation(),Mc=parseInt(window.getComputedStyle(t.node).width)-parseInt(n.paddingLeft)+parseInt(n.paddingRight)}),this.block.addEventListener("panmove",function(n){t.isMoving=!0;const i=t.sliderAttrs;n.preventDefault(),n.stopPropagation();const o=parseInt(n.displacementX/Mc*100),r=t.startX;e=Math.floor((o+parseInt(r))/i.step)*i.step,i.value=i.min+Math.floor(e/100*(i.max-i.min)),t.setSlider()}),this.block.addEventListener("panend",function(n){t.isMoving=!1,t.startX=e}),Sc.prototype.onAppend.call(this)},setSlider(){const t=this.valueBar,e=this.block,n=this.sliderAttrs;let i=Math.ceil(n.value/n.step)*n.step;i=i>n.max?n.max:i<n.min?n.min:i;let o=Math.round((i-n.min)/(n.max-n.min)*100);o=o>100?100:o<0?0:o,t.style.width=`calc(${o}% + 10px)`,e.style.left=`${o}%`,n.value=i,this.dispatchEvent("change"),this.isMoving||(this.startX=o)},setBackground(){const t=this.rangeBar,e=this.valueBar,n=this.block;t.style.backgroundColor=this.sliderStyle.color,e.style.backgroundColor=this.sliderStyle.selectedColor,n.style.backgroundColor=this.sliderStyle.blockColor},updateContainer(){const t=this.node;t.style.paddingLeft=this.sliderStyle.paddingLeft,t.style.paddingRight=this.sliderStyle.paddingRight,this.setSlider()}},Dc={min:function(t){this.sliderAttrs.min=parseInt(t),t>this.sliderAttrs.value&&(this.sliderAttrs.value=t),this.setSlider()},max:function(t){this.sliderAttrs.max=t,this.setSlider()},value:function(t){this.isMoving||(this.sliderAttrs.value=t,this.setSlider())},step:function(t){this.sliderAttrs.step=t,this.setSlider()}},Lc={blockColor:function(t){this.sliderStyle.blockColor=t,this.setBackground()},selectedColor:function(t){this.sliderStyle.selectedColor=t,this.setBackground()},color:function(t){this.sliderStyle.color=t,this.setBackground()},paddingLeft:function(t){this.sliderStyle.paddingLeft=t,this.updateContainer()},paddingRight:function(t){this.sliderStyle.paddingRight=t,this.updateContainer()}},Ic={change:{updator(){return{attrs:{value:this.sliderAttrs.value}}},extra(){return{progress:this.sliderAttrs.value}}}};var Pc={init:function(t){Sc=t.Atomic;const e=t.utils.extend;function n(t){this.isMoving=!1;const e=t.attr||{},n=t.style||{};this.sliderAttrs={min:e.min||0,max:e.max||100,step:e.step||1,value:e.value||0},this.sliderStyle={blockColor:n.blockColor||"rgb(0, 150, 136)",selectedColor:n.selectedColor||"rgb(0, 150, 136)",color:n.color||"rgb(240, 240, 240)",paddingLeft:n.paddingLeft||"32px",paddingRight:n.paddingRight||"32px"},Sc.call(this,t)}n.prototype=Object.create(Sc.prototype),e(n.prototype,Oc),e(n.prototype,{attr:e(Object.create(Sc.prototype.attr),Dc)}),e(n.prototype,{style:Lc}),e(n.prototype,{event:Ic}),t.registerComponent("slider",n)}};t(".progress-container{position:relative}.progress-container .range-bar{border-radius:10px;overflow:hidden}.progress-container .circle-container .circle{box-sizing:border-box;position:absolute;border-style:solid;border-radius:50%;animation:rotateCircle 1s cubic-bezier(.5,0,.5,1) infinite}.progress-container .circle-container div:first-child{animation-delay:-.375s}.progress-container .circle-container div:nth-child(2){animation-delay:-.25s}.progress-container .circle-container div:nth-child(3){animation-delay:-.125s}@keyframes rotateCircle{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}",void 0);const Nc={create(){const t=this.type,e=document.createElement("div");return e.classList.add("hap-container"),e.classList.add("progress-container"),this.node=e,"horizontal"===t?this.setHorizontal():this.setCircular(),e},setHorizontal(){const t=this.node,e=document.createElement("div"),n=document.createElement("div");e.classList.add("range-bar"),n.classList.add("value-bar"),t.style.width="100%",e.style.backgroundColor="#f0f0f0",e.style.width="100%",e.appendChild(n),n.style.height="100%",this.rangeBar=e,this.valueBar=n,t.appendChild(e),this.updateHorizontalStyle()},setCircular(){const t=this.node,e=document.createElement("div"),n=document.createElement("div");e.classList.add("circle-container"),n.classList.add("circle"),e.appendChild(n),e.appendChild(n.cloneNode()),e.appendChild(n.cloneNode()),e.appendChild(n.cloneNode()),t.appendChild(e),this.circles=e.childNodes,this.circleContainer=e,this.updateCircleStyle()},updateHorizontalStyle(){const t=this.valueBar;t&&(t.style.backgroundColor=this.color,t.style.width=`${this.percent}%`,this.rangeBar.style.height=`${this.strokeWidth}`)},updateCircleStyle(){const t=this.circles,e=this.circleSize,n=this.color,i=Math.round(e/8);t&&(this.circleContainer.style.width=`${Math.round(e+i)}px`,this.circleContainer.style.height=`${Math.round(e+i)}px`,Array.prototype.forEach.call(t,function(t){t.style.width=`${e}px`,t.style.height=`${e}px`,t.style.borderWidth=`${i}px`,t.style.borderColor=`${n} transparent transparent transparent`}))}},Rc={percent:function(t){this.percent=t,this.updateHorizontalStyle()}},Fc={width:function(t){t=parseInt(t),this.circleWidth=t,this.hackCircleSize||(!this.circleHeight||t<this.circleHeight)&&(this.circleSize=t,this.updateCircleStyle())},height:function(t){t=parseInt(t),this.circleHeight=t,this.hackCircleSize||(!this.circleWidth||t<this.circleWidth)&&(this.circleSize=t,this.updateCircleStyle())},color:function(t){this.color=t,"horizontal"===this.type?this.updateHorizontalStyle():this.updateCircleStyle()},strokeWidth:function(t){this.strokeWidth=t,this.updateHorizontalStyle(),this.hackCircleSize=this.circleSize=parseInt(t),this.updateCircleStyle()}};var Bc={init:function(t){const e=t.Atomic,n=t.utils.extend;function i(t){const n=t.attr||{},i=t.style||{};this.type=n.type||"horizontal",this.strokeWidth=i.strokeWidth||"32px",this.circleSize=32,this.color=i.color||"#33b4ff",this.data=t,e.call(this,t)}i.prototype=Object.create(e.prototype),n(i.prototype,Nc),n(i.prototype,{attr:n(Object.create(e.prototype.attr),Rc)}),n(i.prototype,{style:n(Object.create(e.prototype.style),Fc)}),t.registerComponent("progress",i)}};"undefined"==typeof window&&(window={ctrl:{},lib:{}}),!window.ctrl&&(window.ctrl={}),!window.lib&&(window.lib={}),function(t,e){function n(t,e,n,i){function o(t){return(3*a*t+2*l)*t+c}function r(t){return((a*t+l)*t+c)*t}var s=1e-6,a=3*t-3*n+1,l=3*n-6*t,c=3*t,d=3*e-3*i+1,h=3*i-6*e,p=3*e;return function(t){return function(t){return((d*t+h)*t+p)*t}(function(t){for(var e,n,i=t,a=0;8>a;a++){if(n=r(i)-t,Math.abs(n)<s)return i;if(e=o(i),Math.abs(e)<s)break;i-=n/e}var l=1,c=0;for(i=t;l>c;){if(n=r(i)-t,Math.abs(n)<s)return i;n>0?l=i:c=i,i=(l+c)/2}return i}(t))}}e.cubicbezier=n,e.cubicbezier.linear=n(0,0,1,1),e.cubicbezier.ease=n(.25,.1,.25,1),e.cubicbezier.easeIn=n(.42,0,1,1),e.cubicbezier.easeOut=n(0,0,.58,1),e.cubicbezier.easeInOut=n(.42,0,.58,1)}(window,window.lib||(window.lib={}));window.lib.cubicbezier;"undefined"==typeof window&&(window={ctrl:{},lib:{}}),!window.ctrl&&(window.ctrl={}),!window.lib&&(window.lib={}),function(t,e){function n(t){return setTimeout(t,d)}function i(t){clearTimeout(t)}function o(){var t={},e=new h(function(e,n){t.resolve=e,t.reject=n});return t.promise=e,t}function r(t,e){return["then","catch"].forEach(function(n){e[n]=function(){return t[n].apply(t,arguments)}}),e}function s(e){var n,i,a=!1;this.request=function(){a=!1;var s=arguments;return r((n=o()).promise,this),i=p(function(){a||n&&n.resolve(e.apply(t,s))}),this},this.cancel=function(){return i&&(a=!0,u(i),n&&n.reject("CANCEL")),this},this.clone=function(){return new s(e)}}function a(t,e){"function"==typeof e&&(e={0:e});for(var n=t/d,i=1/n,o=[],r=Object.keys(e).map(function(t){return parseInt(t)}),a=0;n>a;a++){var l=r[0];if(null!=l&&100*(i*a)>=l){var c=e[""+l];c instanceof s||(c=new s(c)),o.push(c),r.shift()}else o.length&&o.push(o[o.length-1].clone())}return o}function l(t){var n;return"string"==typeof t||t instanceof Array?e.cubicbezier?"string"==typeof t?e.cubicbezier[t]&&(n=e.cubicbezier[t]):t instanceof Array&&4===t.length&&(n=e.cubicbezier.apply(e.cubicbezier,t)):console.error("require lib.cubicbezier"):"function"==typeof t&&(n=t),n}function c(t,e,n){var i,s=a(t,n),c=1/(t/d),h=0;if(!l(e))throw new Error("unexcept timing function");var p=!1;this.play=function(){if(!p)return p=!0,i||r((i=o()).promise,this),function t(){var n=c*(h+1).toFixed(10);s[h].request(n.toFixed(10),e(n).toFixed(10)).then(function(){p&&(h===s.length-1?(p=!1,i&&i.resolve("FINISH"),i=null):(h++,t()))},function(){})}(),this},this.stop=function(){return p?(p=!1,s[h]&&s[h].cancel(),this):void 0}}var d=1e3/60,h=t.Promise||e.promise&&e.promise.ES6Promise,p=window.requestAnimationFrame||window.msRequestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||n,u=window.cancelAnimationFrame||window.msCancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||i;(p===n||u===i)&&(p=n,u=i),e.animation=function(t,e,n){return new c(t,e,n)},e.animation.frame=function(t){return new s(t)},e.animation.requestFrame=function(t){return new s(t).request()}}(window,window.lib||(window.lib={}));window.lib.animation;t("[data-ctrl-name=carrousel]{position:relative;-webkit-transform:translateZ(1px);-ms-transform:translateZ(1px);transform:translateZ(1px)}",void 0);var jc=window.document,Hc=window.navigator.userAgent,$c=!!Hc.match(/Firefox/i),zc=!!Hc.match(/IEMobile/i),Yc=$c?"Moz":zc?"ms":"webkit",Wc=Xo,Vc=tr,Uc=zc?"MSCSSMatrix":"WebKitCSSMatrix",qc=!!$c||Uc in window&&"m11"in new window[Uc];function Gc(t,e){return 0!=(t=parseFloat(t))&&(t+="%"),0!=(e=parseFloat(e))&&(e+="%"),qc?"translate3d("+t+", "+e+", 0)":"translate("+t+", "+e+")"}var Jc=Array.prototype.slice;var Kc=0;!lib&&(lib={}),lib.carrousel=function(t,e){var n=this,i=Date.now()+"-"+ ++Kc,o=document.createDocumentFragment();1!==arguments.length||arguments[0]instanceof HTMLElement||(e=arguments[0],t=null),t||(t=document.createElement("ul"),o.appendChild(t)),e=e||{},t.setAttribute("data-ctrl-name","carrousel"),t.setAttribute("data-ctrl-id",i),t.style.position="relative",t.style.width="100%",t.style.height="100%",t.style[Yc+"Transform"]=Gc(0,0);var r,s=0,a=0,l={},c=0,d=100,h=0;function p(t){for(;t<0;)t+=c;for(;t>=c;)t-=c;return t}function u(t){if(0!==c){var e,n,i=l.get(t);h=i.index,c>1&&(e=l.get(t-1),n=2===c?l.getCloned(t+1):l.get(t+1),i.style.left=-a+"%",e.style.left=-a-d+"%",n.style.left=-a+d+"%"),function(t,e){var n=jc.createEvent("HTMLEvents");if(n.initEvent(t,!1,!1),e)for(var i in e)n[i]=e[i];o.dispatchEvent(n)}("change",{prevItem:e,curItem:i,nextItem:n})}}(r=t.children,Jc.call(r)).forEach(function(t){t.style.position="absolute",t.style.top="0",t.style.left=c*d+"%",t.style.float="left",t.index=c,Object.defineProperty(l,c+"",{get:function(){return t}}),c++}),l.add=function(e){var n=document.createElement("li");return n.style.display="none",n.style.float="left",n.style.width="100%",n.index=c,"string"==typeof e?n.innerHTML=e:e instanceof HTMLElement&&n.appendChild(e),t.appendChild(n),Object.defineProperty(l,c+"",{get:function(){return n}}),c++,n},l.get=function(t){return l[p(t)]},l.getCloned=function(e){e=p(e);var n=t.querySelector('[cloned="cloned-'+e+'"]'),i=l[e];return n||(n=i.cloneNode(!0),function t(e,n,i){var o=e._listeners;if(o)for(var r in n._listeners=o,o)n.addEventListener(r,o[r]);if(i&&e.children&&e.children.length)for(var s=0,a=e.children.length;s<a;s++)t(e.children[s],n.children[s],i)}(i,n,!0),t.appendChild(n),n.setAttribute("cloned","cloned-"+e),n.index=e),n},l.slide=function(e,i=!0){const o=h+e;if(0!==c){if(1===c&&(e=0),n.isBoundary(e))return!1;var r=a+s,l=a+d*-e,p=l-r;0!==p&&(i?new lib.animation(400,lib.cubicbezier.ease,function(e,n){t.style[Yc+"Transform"]=Gc(r+p*n,0)}).play().then(function(){a=l,t.style[Yc+"Transform"]=Gc(l,0),e&&u(o)}):(a=l,t.style[Yc+"Transform"]=Gc(l,0),e&&u(o)))}},l.next=function(){l.slide(1)},l.prev=function(){l.slide(-1)},Object.defineProperty(this,"items",{get:function(){return l}}),Object.defineProperty(l,"length",{get:function(){return c}}),Object.defineProperty(l,"index",{get:function(){return h}});var f=!1,m=!1;this.play=function(){f||(f=Wc(function t(){m=!0,l.next(),Wc(function(){m=!1},500),f=Wc(t,b)},b))},this.stop=function(){y&&(Vc(y),y=!1),f&&(Vc(f),f=!1)};var g=!1,y=!1;Object.defineProperty(this,"autoplay",{get:function(){return g},set:function(t){g=!!t,y&&(Vc(y),y=!1),g?y=Wc(function(){n.play()},2e3):n.stop()}}),this.autoplay=!!e.autoplay;var b=1500;if(Object.defineProperty(this,"playInterval",{get:function(){return b},set:function(t){b=t}}),this.playInterval=!!e.playInterval||1500,this.isBoundary=function(t){if(this.loop)return!1;const e=h+t;return e===c||e<0},e.useGesture){var v=!1;t.addEventListener("panstart",function(t){const e="left"===t.direction?1:-1;if(n.isBoundary(e))return!1;t.isVertical||v&&m||(t.preventDefault(),t.stopPropagation(),g&&n.stop(),s=0,v=!0)}),t.addEventListener("panmove",function(e){var n;!e.isVertical&&v&&(e.preventDefault(),e.stopPropagation(),n=e.displacementX,s=n/t.getBoundingClientRect().width*100,t.style[Yc+"Transform"]=Gc(a+s,0))}),t.addEventListener("panend",function(t){!t.isVertical&&v&&(t.preventDefault(),t.stopPropagation(),v=!1,t.isSwipe?s<0?l.next():l.prev():Math.abs(s)<d/3?l.slide(0):l.slide(s<0?1:-1),s=0,g&&Wc(function(){n.play()},2e3))},!1),t.addEventListener("swipe",function(t){t.isVertical||(t.preventDefault(),t.stopPropagation())})}this.addEventListener=function(t,e){this.root.addEventListener(t,e,!1)},this.removeEventListener=function(t,e){this.root.removeEventListener(t,e,!1)},this.root=o,this.element=t},t(".swiper{position:relative;width:-webkit-fill-available}.swiper .indicator-container{position:absolute;bottom:10px;width:100%;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;box-pack:center;-webkit-justify-content:center;justify-content:center;font-size:0}.swiper .indicator-container .indicator{margin-left:10px;margin-right:10px;border-radius:50%}.swiper .indicator-container.row{-webkit-box-orient:horizontal;box-orient:horizontal;-webkit-flex-direction:row;flex-direction:row}.swiper .indicator-container.column{-webkit-box-orient:vertical;box-orient:vertical;-webkit-flex-direction:column;flex-direction:column}",void 0);const Zc=3e3,Qc={"indicator-color":"rgba(0, 0, 0, 0.5)","indicator-selected-color":"rgb(51, 180, 255)","indicator-size":"20px"};let Xc,td;function ed(t){if(!t.indicator)return!1;const e=t.indicator.children,n=t.currentIndex;Array.prototype.forEach.call(e,(e,i)=>{e.style.width=e.style.height=t.indicatorStyle["indicator-size"],e.classList.remove("current"),i===n?(e.classList.add("current"),e.style.backgroundColor=t.indicatorStyle["indicator-selected-color"]):e.style.backgroundColor=t.indicatorStyle["indicator-color"]})}function nd(t){return t._sliderChangeHandler||(t._sliderChangeHandler=function(t){const e=this.carrousel.items.index;this.currentIndex=e,ed(this),this.dispatchEvent("change",{index:e})}.bind(t)),t._sliderChangeHandler}function id(t){t.createChildren(),t.onAppend()}const od={create(){const t=document.createElement("swiper");return t.classList.add("swiper"),t.style.position="relative",t.style.overflow="hidden",this._needFixWidth=!0,this.hasIndicator=!0,t},createChildren(){const t=this.getComponentManager();this.sliderContainer&&this.node.removeChild(this.sliderContainer),this.indicator&&this.indicator.parentNode.removeChild(this.indicator),this.children=[];const e=document.createElement("div");e.style.listStyle="none",this.node.appendChild(e),this.sliderContainer=e;const n=this.data.children,i=document.createDocumentFragment();let o,r;if(n&&n.length){for(let e=0;e<n.length;e++){const s=t.createElement(n[e]);s.node.style.pointerEvents="auto",n[e].instanceId=this.data.instanceId,this.children.push(s),i.appendChild(s.node),o=s.data.style&&s.data.style.width||"100%",r=s.data.style&&s.data.style.height||"100%",s.node.style.width=o,s.node.style.height=r,s.parentRef=this.data.ref}e.style.height=this.data.style&&this.data.style.height||`${this.node.clientHeight}px`,e.appendChild(i)}},createIndicator(){if(!this.hasIndicator)return;if(!this.data.children||0===this.data.children.length)return;const t=this.data.children.length,e=document.createElement("ul");e.style.listStyle="none",e.classList.add("indicator-container");for(let n=0;n<t;n++){const t=document.createElement("li");t.classList.add("indicator"),e.appendChild(t)}this.node.appendChild(e),this.indicator=e,ed(this)},setIndicatorStyle(){this.indicator||(this.hasIndicator=!0,this.createIndicator()),ed(this)},appendChild(t){if((this.data.children||(this.data.children=[])).push(t),id(this),this.children.length>0)return this.children[this.children.length-1]},insertBefore(t,e){const n=this.data.children;let i=-1;for(let t=0,o=n.length;t<o;t++)if(n[t].ref===e.data.ref){i=t;break}if(n.splice(i,0,t.data),id(this),this.children.length>0)return this.children[this.children.length-1]},removeChild(t){const e=this.data.children;if(e)for(let n=0;n<e.length;n++)if(t.data.ref===e[n].ref){e.splice(n,1);break}id(this)},onAppend(){this.carrousel&&(this.carrousel.removeEventListener("change",nd(this)),this.carrousel.stop(),this.carrousel=null);const t=lib.carrousel;this.carrousel=new t(this.sliderContainer,{autoplay:this.autoplay,useGesture:!0}),this.createIndicator(),this.carrousel.playInterval=this.interval,this.carrousel.loop=this.loop,this.carrousel.addEventListener("change",nd(this)),this.currentIndex=0,this.preloadImgsTimer&&clearTimeout(this.preloadImgsTimer);this.preloadImgsTimer=setTimeout(function(){const t=this.carrousel.element.querySelectorAll(".hap-img");for(let e=0,n=t.length;e<n;e++){const n=t[e],i=n.getAttribute("i-lazy-src"),o=n.getAttribute("img-src");i?n.style.backgroundImage="url("+i+")":o&&(n.style.backgroundImage="url("+o+")"),n.removeAttribute("i-lazy-src"),n.removeAttribute("img-src")}this.dispatchEvent("change",{index:this.currentIndex})}.bind(this),800);let e=!1;this.carrousel.element.addEventListener("panstart",function(t){t.isVertical||(e=!0)}),this.carrousel.element.addEventListener("panend",function(t){t.isVertical||(e=!1)}),document.addEventListener("touchmove",function(t){return!e||(t.preventDefault(),!1)},{passive:!1}),""===this.node.style.height&&(this.node.style.height="inherit"),td.prototype.onAppend.call(this)},play(){this.carrousel.play()},stop(){this.carrousel.stop()},slideTo(t,e){const n=t-this.currentIndex;this.carrousel&&this.carrousel.items.slide(n,e)},swipeTo({index:t}){this.slideTo(t,!1)}},rd={interval:function(t){this.interval=parseInt(t)||Zc,this.carrousel&&(this.carrousel.playInterval=this.interval)},index:function(t){const e=this;function n(t){if((t=parseInt(t))<0||isNaN(t))return console.error("### Web Render ### invalid index ",t);e.slideTo(t),e._updateIndex&&window.removeEventListener("renderend",e._updateIndex)}if(this.isDomRendering){const i=!!this._updateIndex;this._updateIndex=function(){e.autoplay&&e.isPageShow&&e.play(),n(t)},!i&&window.addEventListener("renderend",this._updateIndex)}else n(t)},playstatus:function(t){this.playstatus=t&&"false"!==t,this.autoplay=this.playstatus,this.carrousel&&(this.carrousel.autoplay=this.playstatus,this.playstatus?this.play():this.stop())},autoplay:function(t){this.attr.playstatus.call(this,t)},loop:function(t){this.loop=t&&"false"!==t,this.carrousel&&(this.carrousel.loop=this.loop)},indicator:function(t){this.hasIndicator=t&&"false"!==t,this.hasIndicator?this.createIndicator():this.indicator&&(this.node.removeChild(this.indicator),this.indicator=null)}},sd={change:{updator:function(){return{attrs:{index:this.currentIndex}}}}},ad={indicatorColor:function(t){this.indicatorStyle["indicator-color"]=t,this.setIndicatorStyle()},indicatorSelectedColor:function(t){this.indicatorStyle["indicator-selected-color"]=t,this.setIndicatorStyle()},indicatorSize:function(t){this.indicatorStyle["indicator-size"]=t,this.setIndicatorStyle()}};var ld={init:function(t){function e(t){this.indicatorStyle=Object.assign({},Qc),this.autoplay=!1,this.loop=!1,this.interval=Zc,this.direction="row",this.children=[],this.isPageShow=!0,this.isDomRendering=!0,td.call(this,t)}td=t.Component,Xc=t.utils.extend,e.prototype=Object.create(td.prototype),Xc(e.prototype,od),Xc(e.prototype,{attr:Xc(Object.create(td.prototype.attr),rd)}),Xc(e.prototype,{event:sd}),Xc(e.prototype,{style:Xc(Object.create(td.prototype.style),ad)}),t.registerComponent("swiper",e)}};const cd=["tab-bar","tab-content"];let dd,hd;const pd={create(){const t=document.createElement("tabs");return t.classList.add("hap-tabs"),t.classList.add("hap-container"),this.data.props&&this.data.props._isInTabContent&&this.data.props.tabwrap&&(this.data.props.tabwrap.style.display="flex"),this._setProps(this.data,{_isInStack:!1,stack:null,stackwrap:null}),t},appendChild(t){const e=t.type;let n="top";if(-1===cd.indexOf(e))console.warn('### Web Render ### invalid child type "'+e+'" for tabs.');else{if(!this.childNode[e]){this.childNode["tab-content"]&&(n="bottom");const i=dd(t,{extra:{index:this.index,position:n}});(this.data.children||(this.data.children=[])).push(t);const o=this.getComponentManager().createElement(i);return this.childNode[e]=o,this.node.appendChild(o.node),o}console.warn('### Web Render ### child "'+e+'" can not more than one for tabs.')}},updateIndex(t){t>=0&&(this.index=t,this.dispatchEvent("change",{index:this.index}))},onAppend(){setTimeout(()=>{const t=this.childNode["tab-content"],e=this.childNode["tab-bar"],n=parseInt(this.index);this.updateIndex(n),e&&e.updateIndex(n),t&&t.updateIndex(n)},300),hd.prototype.onAppend.call(this)}},ud={index(t){const e=this.childNode["tab-content"],n=this.childNode["tab-bar"],i=parseInt(t);this.updateIndex(i),n&&n.updateIndex(i),e&&e.updateIndex(i)}};var fd={init:function(t){function e(t){const e=t.attr||{};this.childNode={"tab-bar":!1,"tab-content":!1},this.index=e.index||0,hd.call(this,t)}hd=t.Component,dd=t.utils.extend,e.prototype=Object.create(hd.prototype),dd(e.prototype,pd),dd(e.prototype,{attr:dd(Object.create(hd.prototype.attr),ud)}),t.registerComponent("tabs",e)}};let md;const gd=["fixed","scrollable"],yd={create(){const t=document.createElement("tab-bar");return t.classList.add("hap-container"),t.classList.add("hap-tab-bar"),t.style[this.position]="0",t},appendChild(t){(this.data.children||(this.data.children=[])).push(t),this._setProps(t,{_isInTabBar:!0});const e=this.getComponentManager().createElement(t),n=e.node,i=this.childrenComponents||(this.childrenComponents=[]);return n.dataset.index=i.length,i.length===parseInt(this.index)?n.classList.add("hap-active"):n.classList.remove("hap-active"),i.push(e),n.style.maxHeight="100%",this.node.appendChild(n),n.style.pointerEvents="auto",n.addEventListener("click",function(t){t.childEvent||(t.childEvent=function(){const e=parseInt(this.dataset.index),n=t.getParent().childNode["tab-content"];t&&t.updateIndex(e),n&&n.updateIndex(e),t.getParent().updateIndex(e)});return t.childEvent}(this)),e},onAppend(){const t=this.node,e=this.getParent(),n=this.position;this.node.style.height=this.height,e&&(e.node.style.minHeight=this.height,"top"===n?e.node.style.paddingTop=this.height:e.node.style.paddingBottom=this.height),this.updateMode(),t.addEventListener("panmove",function(t){t.preventDefault(),t.stopPropagation()}),md.prototype.onAppend.call(this)},updateMode(){const t=this.node,e=gd.indexOf(this.mode),n=this.data.style;0===e?(t.style.lineHeight="",t.classList.add("fixed-mode"),t.classList.remove("scrollable-mode")):1===e&&(n&&(n.paddingTop||n.paddingBottom)||(t.style.lineHeight=this.height),t.classList.remove("fixed-mode"),t.classList.add("scrollable-mode"))},updateIndex(t){const e=this.childrenComponents,n=this.node;if(e&&e.length>0){if(1===gd.indexOf(this.mode)){const i=n.scrollWidth,o=n.scrollLeft,r=n.clientWidth,s=i-r,a=e[t].node,l=parseInt(r/2)-a.clientWidth/2;let c=a.offsetLeft-o-l,d=o+c;c=(d=d<0?0:d>s?s:d)-o,new lib.animation(400,lib.cubicbezier.ease,function(t,e){n.scrollLeft=o+c*e}).play()}e.forEach((e,n)=>{t===n?e.node.classList.add("hap-active"):e.node.classList.remove("hap-active")}),this.index=t}}},bd={mode(t){this.mode=t,this.updateMode()}},vd={height(t){this.height=t,this.node.style.height=t;const e=this.getParent();t.indexOf("px")>-1&&(this.node.style.flexShrink="0"),e&&(e.node.style.minHeight=t,"top"===this.position?e.node.style.paddingTop=t:e.node.style.paddingBottom=t)},display(){},position(){},flexDirection(){},top(){},bottom(t){this.node.style.top="",this.node.style.bottom=t,this.position="bottom";const e=this.getParent();e&&(e.node.style.paddingTop="")},justifyContent(){},overflowX(){},overflowY(){},whiteSpace(){}};var Ed={init:function(t){md=t.Component;const e=t.utils.extend;function n(t){const e=t.attr||{};this.mode=e.mode||"fixed",this.height="100px",this.index=t.extra.index,this.position=t.extra.position,md.call(this,t)}n.prototype=Object.create(md.prototype),e(n.prototype,yd),e(n.prototype,{attr:e(Object.create(md.prototype.attr),bd)}),e(n.prototype,{style:e(Object.create(md.prototype.style),vd)}),t.registerComponent("tab-bar",n)}};let wd;const xd=window.navigator.userAgent,Td=!!xd.match(/Firefox/i),Ad=!!xd.match(/IEMobile/i)?"MSCSSMatrix":"WebKitCSSMatrix",kd=!!Td||Ad in window&&"m11"in new window[Ad];function _d(t,e){return 0!==(t=parseFloat(t))&&(t+="%"),0!==(e=parseFloat(e))&&(e+="%"),kd?"translate3d("+t+", "+e+", 0)":"translate("+t+", "+e+")"}const Cd={create(){const t=document.createElement("tab-content"),e=document.createElement("div");return t.classList.add("hap-tab-content"),t.classList.add("hap-container"),e.classList.add("hap-container"),e.setAttribute("data-ctrl-name","tab-carousel"),e.style.transform="translate3d(0px, 0px, 0px)",t.appendChild(e),this.carousel=e,t},appendChild(t){const e=this.data.children||(this.data.children=[]);e.push(t);const n=document.createElement("div");n.setAttribute("data-ctrl-name","tab-carousel-item"),n.style.width="100%";const i=this.getComponentManager();this._setProps(t,{_isInTabContent:!0,tabwrap:n,tabIndex:e.length-1});const o=i.createElement(t),r=this.childrenComponents||(this.childrenComponents=[]);r.push(o),this.carousel.appendChild(n).appendChild(o.node);const s=this.childrenLengh=r.length;return 0!==this.index&&s>this.index&&this.updateIndex(this.index),o},onAppend(){const t=this.getParent();(!t.data.props||t.data.props&&!t.data.props._isInTabContent)&&this.registerEvent(),wd.prototype.onAppend.call(this)},registerEvent(){const t=this.node,e=this,n=this.carousel;t.addEventListener("panstart",function(t){const n="left"===t.direction?1:-1;if(e.isBoundary(n))return!1;t.isVertical||e.panning||(t.preventDefault(),t.stopPropagation(),e.panning=!0,e.diffOffset=0)}),t.addEventListener("panmove",function(i){!i.isVertical&&e.panning&&e.childrenLengh>1&&(i.preventDefault(),i.stopPropagation(),e.diffOffset=function(t,e){return t/e.getBoundingClientRect().width*100}(i.displacementX,t),n.style.transform=_d(e.startOffset+e.diffOffset,0))}),t.addEventListener("panend",function(t){if(!t.isVertical&&e.panning&&e.childrenLengh>1){t.preventDefault(),t.stopPropagation(),e.panning=!1;const n=e.diffOffset;Math.abs(n)<e.itemStep/2?e.slide(0):e.slide(n<0?1:-1)}})},isBoundary(t){const e=parseInt(this.index)+t;return e===this.childrenLengh||e<0},slide(t){const e=this;let n=!0;e.isBoundary(t)&&(t=0,n=!1);const i=e.getParent().childNode["tab-bar"],o=e.carousel,r=parseInt(e.index)+t,s=e.startOffset+e.diffOffset,a=-e.itemStep*r-s;new lib.animation(400,lib.cubicbezier.ease,function(t,e){o.style.transform=_d(s+a*e,0)}).play().then(function(){if(!n)return!1;e.updateIndex(r),i&&i.updateIndex(r),e.getParent().updateIndex(r)})},updateIndex(t){(this.childrenComponents||[]).forEach((e,n)=>{if(t===n){const e=-this.itemStep*t;this.carousel.style.transform=_d(e,0),this.startOffset=e}}),this.index=t}},Sd={display(){},flex(){},paddingBottom(t){const e=this.getParent();e&&(e.node.style.paddingBottom=t)}};var Md={init:function(t){wd=t.Component;const e=t.utils.extend;function n(t){this.index=parseInt(t.extra.index),this.startOffset=0,this.diffOffset=0,this.itemStep=100,this.panning=!1,wd.call(this,t)}n.prototype=Object.create(wd.prototype),e(n.prototype,Cd),e(n.prototype,{style:e(Object.create(wd.prototype.style),Sd)}),t.registerComponent("tab-content",n)}};t(".hap-tabs{position:relative;flex-direction:column;height:-webkit-fill-available;width:-webkit-fill-available;max-width:100vw;overflow-x:hidden;flex-grow:1;flex-shrink:999999;pointer-events:auto}.hap-tab-bar{position:absolute;z-index:1;left:0;width:100%;align-items:center;background-color:#fff}.hap-tab-bar.fixed-mode{display:flex;justify-content:space-around}.hap-tab-bar.scrollable-mode{display:block;overflow-x:auto;overflow-y:hidden;white-space:nowrap}.hap-tab-bar.scrollable-mode>*{display:inline-flex!important;justify-content:center;align-items:center;line-height:normal;vertical-align:middle}.hap-tabs .hap-tab-content{position:relative;width:100%;display:flex;flex:1;margin-left:0!important;margin-right:0!important}.hap-tabs .hap-tab-content [data-ctrl-name=tab-carousel]{position:relative;display:flex;flex:1;max-width:100%;max-height:100%}.hap-tabs .hap-tab-content [data-ctrl-name=tab-carousel] [data-ctrl-name=tab-carousel-item]{flex:1 0 auto;overflow-y:auto;overflow-x:hidden}.hap-tabs .hap-tab-content [data-ctrl-name=tab-carousel] [data-ctrl-name=tab-carousel-item]>*{flex:1}",void 0);var Od={init:function(t){t.install(fd),t.install(Ed),t.install(Md)}};const Dd={create(){const t=document.createElement("stack");t.style.width="0px";const e=this.data.style;return e&&(!e||e.width||e.flex)||(this._needSetWidth=!0,this.maxWidth=0),(!e||e&&!e.height)&&(this._needSetHeight=!0,this.maxHeight=0),this._setProps(this.data,{_isInStack:!0}),t},appendChild(t){this.node.classList.add("hap-stack"),t.style&&"fixed"!==t.style.position&&"0px"===this.node.style.width&&(this.node.style.width="");const e=this.data.children,n=this.getComponentManager().createElement(t);return this._addWrap(n),e&&e.length?e.push(t):this.data.children=[t],n},insertBefore(t,e){const n=this.data.children;let i,o=0,r=!1;if(n&&n.length&&e){for(i=n.length;o<i&&n[o].ref!==e.data.ref;o++);o===i&&(r=!0)}else r=!0;const s=this._addWrap(t);r?(this.node.appendChild(s),n.push(t.data)):(this.node.insertBefore(s,e.data.stackwrap),n.splice(o,0,t.data))},createChildren(){const t=this.data.children,e=this.data.ref,n=this.getComponentManager();if(t&&t.length){const i=document.createDocumentFragment();let o=!1;for(let r=0;r<t.length;r++){t[r].instanceId=this.data.instanceId;const s=n.createElement(t[r]);i.appendChild(this._addWrap(s)),s.parentRef=e,!o&&s.data.style&&s.data.style.hasOwnProperty("flex")&&(o=!0)}this.node.appendChild(i)}},removeChild(t){const e=this.data.children;let n=0;const i=this.getComponentManager();if(e&&e.length){let i;for(i=e.length;n<i&&e[n].ref!==t.data.ref;n++);n<i&&e.splice(n,1)}i.removeComponent(t.data.ref),t.unsetPosition();const o=t.node.parentNode,r=o._height;if(o.parentNode.removeChild(o),this.maxHeight===r){this.maxHeight=0;const t=this.node.children;for(let e=0;e<t.length;e++)this.maxHeight=Math.max(this.maxHeight,t[e]._height);this.node.style.height=`${this.maxHeight}px`}},requestFullscreen(t){this.node.requestFullscreen(),console.warn("==目前预览不区分横向/竖向全屏,请使用真机调试体验完整功能==")},_addWrap(t){const e=t.node,n=document.createElement("div");return n.classList.add("hap-stack-wrap"),n.style.padding=this.data.style&&this.data.style.padding||"",n.style.paddingRight=this.data.style&&this.data.style.paddingRight||"",n.style.paddingLeft=this.data.style&&this.data.style.paddingLeft||"",n.style.paddingTop=this.data.style&&this.data.style.paddingTop||"",n.style.paddingBottom=this.data.style&&this.data.style.paddingBottom||"",this.node.appendChild(n).appendChild(e),t.data.stackwrap=n,this._setProps(t.data,{stack:this,stackwrap:n}),"tabs"!==t.data.type&&"list"!==t.data.type||(this._needSetWidth=this._needSetHeight=!1),"video"===t.data.type&&(this._needSetWidth=!1),n},_resizeHeight(t){if(t){let e=0,n=0;const i=t.firstChild.style.height||"";if(i.indexOf("px")>-1)e=i;else if(i.indexOf("%")>-1)e=t.firstChild.clientHeight;else{const i=t.firstChild.style.height;t.firstChild.style.height="fit-content",t.style.height="fit-content",e=t.firstChild.clientHeight,n=t.clientHeight,t.firstChild.style.height=i,t.style.height=""}const o=Math.max(e&&parseInt(e),n);t._height=o,this.maxHeight=Math.max(o,t.clientHeight,this.maxHeight),this.maxHeight>0&&(this.node.style.height=`${this.maxHeight}px`),""===this.node.style.height&&(this.node.style.height="inherit")}},_resizeWidth(t){if(t){let e;t.style.width="fit-content",t.firstChild.style.flex&&(e=t.firstChild.style.flex,t.firstChild.style.flex="");const n=t.clientWidth;t.style.width="",t.firstChild.style.flex=e;const i=t.firstChild.style.width||"",o=i.indexOf("px")>-1&&i||t.firstChild.clientWidth,r=n>0?n:o&&parseInt(o);if(this.maxWidth=Math.max(r,this.maxWidth),this.maxWidth>0&&this.maxWidth<=this._getProps("availableWidth")){const t=this.getParent(),e=t&&t.data.style;e&&"column"===e.flexDirection&&!e.alignItems?this.node.style.minWidth=`${this.maxWidth}px`:this.node.style.width=`${this.maxWidth+.5}px`}}}},Ld={paddingRight(t){const e=this.node.children;for(let n=0;n<e.length;n++)e[n].style.paddingRight=t},paddingLeft(t){const e=this.node.children;for(let n=0;n<e.length;n++)e[n].style.paddingLeft=t},paddingTop(t){const e=this.node.children;for(let n=0;n<e.length;n++)e[n].style.paddingTop=t},paddingBottom(t){const e=this.node.children;for(let n=0;n<e.length;n++)e[n].style.paddingBottom=t},padding(t){const e=this.node.children;for(let n=0;n<e.length;n++)e[n].style.padding=t}};var Id={init:function(t){const e=t.Component,n=t.utils.extend;function i(t){e.call(this,t)}i.prototype=Object.create(e.prototype),n(i.prototype,Dd),n(i.prototype,{style:n(Object.create(e.prototype.style),Ld)}),t.registerComponent("stack",i)}};let Pd;t(".hap-popup-container{position:fixed;top:0;left:0;right:0;bottom:0;display:none;z-index:999}.hap-popup-container .hap-popup-mask{position:absolute;top:0;left:0;right:0;bottom:0;background-color:transparent}.hap-popup-container .hap-popup-content{position:absolute;display:inline-block;background:#fff;border-radius:5px}.hap-popup-container .hap-popup-content.active{animation:scaleIn .3s cubic-bezier(.04,1.27,.96,.94)}@keyframes scaleIn{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}",void 0);const Nd=["bottom","top","left","right","bottomLeft","bottomRight","topLeft","topRight"],Rd=[],Fd={create(){const t=document.createElement("popup");t.classList.add("hap-container"),t.classList.add("hap-popup-container");const e=document.createElement("div"),n=document.createElement("div");return e.classList.add("hap-popup-mask"),n.classList.add("hap-popup-content"),n.style.boxShadow="rgb(101, 79, 79) 0px 9px 23px",n.style.margin="20px",t.appendChild(e),t.appendChild(n),this.mask=e,this.content=n,this.updateMask(),t},appendChild(t){const e=this.data.children;e&&e.length?e.push(t):this.data.children=[t];const n=this.getComponentManager().createElement(t);return this.content.appendChild(n.node),n},onAppend(){const t=this.targetDom,e=this.mask,n=this.node;t.style.pointerEvents="auto",e.style.pointerEvents="auto",t.addEventListener("click",e=>{e.stopPropagation(),e.preventDefault(),Rd.forEach(t=>{t.style.display="none"}),Rd.push(n),n.style.display="block",this.setPosition(t,this.placement),this.content.classList.add("active"),this.dispatchEvent("visibilitychange",{visibility:!0})}),e.addEventListener("click",t=>{t.stopPropagation(),t.preventDefault(),n.style.display="none",this.content.classList.remove("active"),this.dispatchEvent("visibilitychange",{visibility:!1})}),Pd.prototype.onAppend.call(this)},setPosition(t,e){const n=this.content,i=Nd.slice(0);let o;i.unshift(e),i.some(e=>(o=this.adjustPosition(t,e)).success);let r=o.targetX+o.offsetX,s=o.targetY+o.offsetY;(r=r<0?-r:r)+o.nodeW>o.screenW&&(r=o.screenW-o.nodeW),s+o.nodeH>o.screenH&&(s=o.screenH-o.nodeH),n.style.left=`${r}px`,n.style.top=`${s}px`},adjustPosition(t,e){const n=t.getBoundingClientRect(),i=this.content.getBoundingClientRect();let o,r,s=!1;const a=n.width,l=n.height,c=n.x,d=n.y+l,h=i.width+40,p=i.height+40,u=document.body.clientWidth,f=document.body.clientHeight;switch(e){case"left":c>=h&&(o=-h,r=-(p+l)/2,r=Math.min(r,-p),s=!0);break;case"right":u-c-a>=h&&(o=a,r=-(p+l)/2,r=Math.min(r,-p),s=!0);break;case"top":d>=p&&(o=(a-h)/2,r=-(p+l),s=!0);break;case"bottom":f-d-l>=p&&(o=(a-h)/2,r=0,s=!0);break;case"topLeft":c>h&&d>=p&&(o=-h,r=-(p+l),s=!0);break;case"topRight":d>=p&&u-c-a>=h&&(o=a,r=-(p+l),s=!0);break;case"bottomLeft":c>=h&&f-d-l>=p&&(o=-h,r=0,s=!0);break;case"bottomRight":u-c-a>=h&&f-d-l>=p&&(o=a,r=0,s=!0)}return{offsetX:o,offsetY:r,targetX:c,targetY:d,targetH:l,targetW:a,nodeW:h,nodeH:p,screenH:f,screenW:u,success:s}},updateMask(){this.mask&&(this.mask.style.backgroundColor=this.maskColor,this.mask.style.opacity=this.maskOpacity)}},Bd={target(t){this.targetDom=document.getElementById(t)},placement(t){Nd.indexOf(t)>-1&&(this.placement=t)}},jd=/^#[0-9a-fA-F]{6}$/,Hd=/^#[0-9a-fA-F]{3}$/,$d=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/,zd=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d*\.?\d+)\s*\)$/,Yd=/^hsl\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*\)$/,Wd=/^hsla\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d*\.?\d+)\s*\)$/,Vd={maskColor(t){this.maskOpacity=1,jd.test(t)||Hd.test(t)||$d.test(t)||Yd.test(t)?(this.maskColor=t,this.maskOpacity=".3"):(zd.test(t)||Wd.test(t))&&(this.maskColor=t),this.mask&&this.updateMask()}};var Ud={init:function(t){Pd=t.Component;const e=t.utils.extend;function n(t){const e=t.attr||{};this.placement=e.placement||"bottom",this.maskColor="rgba(0,0,0,0)",Pd.call(this,t)}n.prototype=Object.create(Pd.prototype),e(n.prototype,Fd),e(n.prototype,{attr:e(Object.create(Pd.prototype.attr),Bd)}),e(n.prototype,{style:e(Object.create(Pd.prototype.style),Vd)}),t.registerComponent("popup",n)}};let qd;t('.hap-radio-container{display:inline-block;margin-left:5px;margin-right:5px}.hap-radio-container input[type=radio]+i:before{content:"\\a0";display:inline-block;vertical-align:middle;font-size:18px;width:20px;height:20px;padding:5px;border-radius:50%;border:4px solid #736f73;line-height:1}.hap-radio-container input[type=radio]{position:absolute;width:40px;height:45px;opacity:0;z-index:1}.hap-radio-container input[type=radio]:checked+i:before{background-color:#44948b;border-color:#44948b;background-clip:content-box}.hap-checkbox-container{display:inline-block;margin-left:5px;margin-right:5px}.hap-checkbox-container input[type=checkbox]+i{display:inline-block;font-size:18px;width:45px;height:45px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAABVElEQVRoQ+1ZS0oDQRB9lWFyADViwBt4guBZFDciCOMMaXKHQOgw40IJWcW7iGsPIVH87ZVJSTYi4kDazsxk4PW6q+u9qtdVTbWg4Usajh8kUHcGmYGNzsDgfLCXh/lUVHoQbFcKVvGqonfBZ3A6uho9FvkulFAURZ2wFd4LpFsp8F/OFDpvf7QPhtfD979wFBIwF+YGgqM6wX/7VszspT1xIxCbZwA7G0EAeLGZ7bgQEBObxU8Dm9lKK5aJja7ivwgUCfhKjxngHfDUECVECVFCbGR8SnjdApZRllEvAQGUECVECbETsxN73QKWUZZRLwGxE6Pxk7nlY+oJwK6nEtZirtCHcTbedxnuoh/3ZwI5XgsC30P+M15v/AfHMmhJknSDRTBR0UOBbPkG0sVeoW+icpu38rM0TefOX0wuzurcW+mnRRlESaCMqLqcyQy4RKuMvV/CqCdAkQM1dgAAAABJRU5ErkJggg==)}.hap-checkbox-container input[type=checkbox]{position:absolute;width:40px;height:45px;opacity:0;z-index:1}.hap-checkbox-container input[type=checkbox]:checked+i{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAACuklEQVRoQ+2ZTWsTURSG35M0H4ZaUaxf+A9cVBCRBouhDCiKC5eCWw2YD7A4wbiKG1uS0EXSiMW1/gWRTkugWhERquBP0CBVIlqrSZM5MtbIGGaaZHKTTHWyHHLufZ/3PTc3dy5hh39oh+uHAzDoBJ0EbJ1AqJA+NMR0H8A4gAN9Fcu8xsCzKteuLcdvr5nNbdpCofns/qEqvwHhcF+FN0/GKFV4c8wMwhRAyqcfgejyQMX/npzBDxejiStGWswB5jIf+t42Jm4x8G4xKh9tH4CZpEJWtYP7DQ1KVDY02zgBB0B8drZPgMFviWkFhKtG+LYG0MRXXPWJp9eTZSmfyYMQbYawMQCv/nDVJzXxDdFGEDYF4NWvqv/Mi3j8i95xKZ+eBtEt/TPbATDwcl31Se2I10BsBaCJr1NgshiJrLdy3nb7gBXxtkmAgZU6Bc524rz4BBgPmDhIoGOdbFea+I2qW3o+NfW93bYRv4gZc0pMjp2+N73Xp7qXO4Aofqu6z1sVL6aFGFklJssNVzQIv+peAuh4iySKHtV37nE8XrHivLgWYp5RYomkXsSpXG5k2FVRCDhpAiFEvJgEtFEMIEKFwrCbN5aaIRi84FX9F7t1XlwCjZHMIZ4QEPzFCV747Nlz4VU4vNlN24hfxNtAjM/O7gp46woxymXvyCWR4sW1kN4SQkqJyHf0j07MpwK7S6gWU6maKOfFt5BeGXNSiSVmtvsVMvpj1sn+0VuArYVtCiFKfG9aqEUSIsX3HqApCdHi+wOwlcgNMB9sPoxY6fnmGludB6wAOQBWXBNZ858lAEDKZz6BsE+ki5bHYpSUmHzEqP7ffb0+kbs76iPP68FfcPD7mtc1Vgzf/NhRAtqX/1wxMQdBNGq5BawUdnvFZGXOQdQ416yDcP3vY8mgFXQ5v9NCXRrYdflPVuDOQErpu6wAAAAASUVORK5CYII=)}.hap-input{box-sizing:border-box;position:relative;-webkit-flex-shrink:1;flex-shrink:1;-webkit-flex-grow:0;flex-grow:0;-webkit-flex-basis:auto;flex-basis:auto;border:0 solid #000;margin:0;padding:0;min-width:0;width:auto;white-space:normal;pointer-events:auto}',void 0);const Gd=["text","password","tel","email","url","date","time","button","radio","checkbox"],Jd=["button","radio","checkbox"],Kd={input:function(){const t=document.createElement("input"),e=Math.floor(1e13*Math.random())+Date.now();return this.className="hap-ipt-"+e,this.styleId="hap-style-"+e,t.classList.add(this.className),t.classList.add("hap-input"),this.data.attr&&"button"===this.data.attr.type?(t.style.padding="8px 0",t.style.backgroundSize="contain",t.style.backgroundRepeat="no-repeat",this.data.attr.value||(t.style.backgroundColor="inherit")):(t.style.backgroundColor="inherit",t.style.outline="none"),t.style.fontSize="26px",this.placeholder&&(t.placeholder=this.placeholder),this.createKeybordEvent(t),t},radio:function(){const t=document.createElement("span");return this.innerInput=document.createElement("input"),this.innerLabel=document.createElement("i"),t.appendChild(this.innerInput),t.appendChild(this.innerLabel),t.classList.add("hap-input"),t.classList.add("hap-radio-container"),this.innerInput.setAttribute("type","radio"),this.nodeType="radio",t},checkbox:function(){const t=document.createElement("span");return this.innerInput=document.createElement("input"),this.innerLabel=document.createElement("i"),t.appendChild(this.innerInput),t.appendChild(this.innerLabel),t.classList.add("hap-input"),t.classList.add("hap-checkbox-container"),this.innerInput.setAttribute("type","checkbox"),this.nodeType="checkbox",t}};const Zd={create(){return this.data.attr&&"radio"===this.data.attr.type?Kd.radio.call(this):this.data.attr&&"checkbox"===this.data.attr.type?Kd.checkbox.call(this):Kd.input.call(this)},createKeybordEvent(t){Array.isArray(this.data.event)&&(this.data.event.indexOf("selectionchange")>-1&&console.warn("### Web Render ### 请使用手机调试 “selectionchange” 事件"),this.data.event.indexOf("enterkeyclick")>-1&&t.addEventListener("keyup",e=>{13===e.keyCode&&this.dispatchEvent("enterkeyclick",{value:t.value})},!1))},focus(){this.node.focus()},blur(){this.node.blur()},select:function(){this.node.select()},setSelectionRange({start:t,end:e}){const n=this.node;n.focus(),n.setSelectionRange(t,e)},getSelectionRange({callback:t},e){const n=this.node.selectionStart,i=this.node.selectionEnd;e&&e(t,[n,i])}},Qd={disabled(t){this.node.disabled=!!t},placeholder(t){this.node.placeholder=t||""},value(t){this.node.value=t||""},autofocus(t){this.node.autofocus=!!t},type(t){this.node.type=-1!==Gd.indexOf(t)?t:"text",-1===Jd.indexOf(t)&&(this.node.style.borderStyle="none")},returnKeyType(t){this.node.returnKeyType=t||""},name(t){null!=t&&""!==t&&("radio"===this.nodeType||"checkbox"===this.nodeType?this.innerInput.setAttribute("name",t):this.node.setAttribute("name",t),this.name=t)},id(t){null!=t&&""!==t&&("radio"===this.nodeType||"checkbox"===this.nodeType?this.innerInput.setAttribute("id",t):this.node.setAttribute("id",t))},checked(t){"radio"===this.nodeType||"checkbox"===this.nodeType?this.innerInput.checked=t:this.node.checked=t,this.checked=t}},Xd={placeholderColor:function(t){!function(t,e){if(!e)return;const n=["::-webkit-input-placeholder",":-moz-placeholder","::-moz-placeholder",":-ms-input-placeholder",":placeholder-shown"];let i="";const o="color: "+e+";";for(let e=0,r=n.length;e<r;e++)i+="."+t.className+n[e]+"{"+o+"}";qd(i,t.styleId,!0)}(this,t)},backgroundImage:function(t){const e="/"===t[0]&&Hap.basePath?`${Hap.basePath}${t}`:t;this.node.style.backgroundImage="url("+e+")"},display:function(t){}},th={input:{updator(){return{attrs:{value:this.node.value}}},extra(){return{value:this.node.value,timestamp:Date.now()}}},change:{updator:function(){return{attrs:{value:this.node.value}}},extra:function(){return this.checked=!this.checked,{name:this.name,checked:this.checked,value:this.node.value,text:this.node.value,timestamp:Date.now()}}}};var eh={init:function(t){const e=t.Atomic,n=t.utils.extend;function i(t){e.call(this,t)}qd=t.utils.appendStyle,i.prototype=Object.create(e.prototype),n(i.prototype,Zd),n(i.prototype,{attr:n(Object.create(e.prototype.attr),Qd)}),n(i.prototype,{style:n(Object.create(e.prototype.style),Xd)}),n(i.prototype,{event:th}),t.registerComponent("input",i)}};const nh={create(){const t=document.createElement("textarea");return t.classList.add("hap-element"),t.classList.add("hap-textarea"),t.style.fontSize="32px",t.style.backgroundColor="inherit",this.createKeyboardEvent(t),t},createKeyboardEvent(t){Array.isArray(this.data.event)&&this.data.event.indexOf("return")>-1&&t.addEventListener("keyup",t=>{const e=t.keyCode;let n=t.key;if(13===e){"tab"===n.toLowerCase()&&(n="next");const t=si(this.data.attr.returnKeyType);this.dispatchEvent("return",{returnKeyType:t})}},!1)},focus(){this.node.focus()},blur(){this.node.blur()},select:function(){this.node.select()},setSelectionRange({start:t,end:e}){const n=this.node;n.focus(),n.setSelectionRange(t,e)},getSelectionRange({callback:t},e){const n=this.node.selectionStart,i=this.node.selectionEnd;e&&e(t,[n,i])}},ih={rows(t){this.node.rows=t||2},disabled(t){this.node.disabled=!!t},placeholder(t){this.node.placeholder=t||""},value(t){this.node.value=t||""},autofocus(t){this.node.autofocus=!!t},returnKeyType(t){this.node.returnKeyType=t||""}},oh={input:{updator(){return{attrs:{value:this.node.value}}},extra(){return{value:this.node.value,timestamp:Date.now()}}},change:{updator:function(){return{attrs:{value:this.node.value}}},extra:function(){return{value:this.node.value,timestamp:Date.now()}}},return:{updator:function(t){return{attrs:{value:this.node.value}}}}};var rh={init:function(t){const e=t.Atomic,n=t.utils.extend;function i(t){e.call(this,t)}i.prototype=Object.create(e.prototype),n(i.prototype,nh),n(i.prototype,{attr:n(Object.create(e.prototype.attr),ih)}),n(i.prototype,{event:oh}),t.registerComponent("textarea",i)}};t(".hap-dialog-mask{position:fixed;z-index:1;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.3)}.hap-dialog-content{width:86%;max-height:70%;background-color:#fff}.hap-dialog-footer{display:flex;justify-content:flex-end;padding:50px 0}.hap-dialog-footer a{padding:0 45px;color:#009688;font-size:30px;text-decoration:none}",void 0);class sh{constructor(t){const e=document.createElement("div"),n=document.getElementsByTagName("body")[0];return this._node=e,this._uid=`hap-dialog-box${t}`,this._container=n,this.added=!1,e.classList.add("hap-dialog-box"),e.setAttribute("id",this._uid),this.createMask(),this}createMask(){const t=document.createElement("div"),e=document.createElement("div");t.classList.add("hap-dialog-mask"),e.classList.add("hap-dialog-content"),t.appendChild(e),this._content=e,this._mask=t,this._node.appendChild(t)}addContent(t,e){if(!t||this.added)return;this.clearContent(),this.picker=e;const n=document.createElement("div");n.classList.add("hap-dialog-body"),"string"==typeof t?n.innerHTML=t:t.length>0?Array.prototype.forEach.call(t,t=>{n.appendChild(t)}):n.appendChild(t),this._content.appendChild(n),this.addFooter(),this.bindAction()}addFooter(){const t=document.createElement("div");t.classList.add("hap-dialog-footer");t.innerHTML='<a href=\'javascript:;\' type="0">取消</a><a href="javascript:;" type="1">确认</a>',this._footer=t,this._content.appendChild(t)}clearContent(){const t=this._content,e=t.childNodes;for(let n=0,i=e.length;n<i;n++)t.removeChild(e[n])}show(){this._container.appendChild(this._node),this.afterShow()}close(){const t=this._container,e=document.getElementById(this._uid);t.removeChild(e),this.afterClose()}bindAction(){const t=this,e=this.picker,n=this._footer.childNodes,i=this._mask,o=function(n){n.preventDefault(),n.stopPropagation(),"0"===this.getAttribute("type")?(e.cancel&&e.cancel(),t.close()):(e.yes&&e.yes(),t.close())};this._content.addEventListener("click",function(t){t.preventDefault(),t.stopPropagation()}),i.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),t.close()},!1);for(let t=0,e=n.length;t<e;t++)n[t].addEventListener("click",o,!1)}afterShow(){}afterClose(){}}const ah=Date.now||function(){return+new Date};let lh={},ch=1;"undefined"!=typeof window&&function(){let t=0;const e=["ms","moz","webkit","o"];for(let t=0;t<e.length&&!window.requestAnimationFrame;++t)window.requestAnimationFrame=window[e[t]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[t]+"CancelAnimationFrame"]||window[e[t]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e,n){const i=(new Date).getTime(),o=Math.max(0,16-(i-t)),r=window.setTimeout(function(){e(i+o)},o);return t=i+o,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})}();var dh={requestAnimationFrame:function(){if("undefined"!=typeof window){const t=window.requestAnimationFrame;return function(e,n){t(e,n)}}}(),stop(t){const e=null!=lh[t];return e&&(lh[t]=null),e},isRunning:t=>null!=lh[t],start(t,e,n,i,o,r){const s=this,a=ah();let l=a,c=0,d=0;const h=ch++;if(r||(r=document.body),h%20==0){const t={};for(const e in lh)t[e]=!0;lh=t}const p=function(u){const f=!0!==u,m=ah();if(!lh[h]||e&&!e(h))return lh[h]=null,void(n&&n(60-d/((m-a)/1e3),h,!1));if(f){const t=Math.round((m-l)/(1e3/60))-1;for(let e=0;e<Math.min(t,4);e++)p(!0),d++}i&&(c=(m-a)/i)>1&&(c=1);const g=o?o(c):c;!1!==t(g,m,f)&&1!==c||!f?f&&(l=m,s.requestAnimationFrame(p,r)):(lh[h]=null,n&&n(60-d/((m-a)/1e3),h,1===c||null==i))};return lh[h]=!0,s.requestAnimationFrame(p,r),h}};function hh(t,e){return window.getComputedStyle(t)[e]||""}function ph(t){return Math.pow(t-1,3)+1}function uh(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)}const fh="object"==typeof window;let mh=!1;try{let t=Object.defineProperty({},"passive",{get:function(){mh=!0}});window.addEventListener("test",null,t)}catch(t){}const gh=function(t,e){const n=this;n.dpr=function(){let t=1;return fh&&window.VUX_CONFIG&&window.VUX_CONFIG.$picker&&window.VUX_CONFIG.$picker.respectHtmlDataDpr&&(t=document.documentElement.getAttribute("data-dpr")||1),t}(),e=e||{},n.options={itemClass:"scroller-item",onSelect(){},defaultValue:0,data:[]};for(const t in e)void 0!==e[t]&&(n.options[t]=e[t]);var i;n.__container="string"==typeof(i=t)?document.querySelector(i):i;const o=document.createElement("div");o.innerHTML=e.template||'\n<div class="scroller-component" data-role="component">\n <div class="scroller-mask" data-role="mask"></div>\n <div class="scroller-indicator" data-role="indicator"></div>\n <div class="scroller-content" data-role="content"></div>\n</div>\n';const r=n.__component=o.querySelector("[data-role=component]"),s=n.__content=r.querySelector("[data-role=content]"),a=r.querySelector("[data-role=indicator]"),l=n.options.data;let c="";l.length&&l[0].constructor===Object?l.forEach(function(t){c+='<div class="'+n.options.itemClass+'" data-value='+JSON.stringify({value:encodeURI(t.value)})+">"+t.name+"</div>"}):l.forEach(function(t){c+='<div class="'+n.options.itemClass+'" data-value='+JSON.stringify({value:encodeURI(t)})+">"+t+"</div>"}),s.innerHTML=c,n.__container.appendChild(r),n.__itemHeight=parseFloat(hh(a,"height"),10),n.__callback=e.callback||function(t){const e=-t*n.dpr;s.style.webkitTransform="translate3d(0, "+e+"px, 0)",s.style.transform="translate3d(0, "+e+"px, 0)"};const d=r.getBoundingClientRect();n.__clientTop=d.top+r.clientTop||0,n.__setDimensions(r.clientHeight,s.offsetHeight),0===r.clientHeight&&n.__setDimensions(parseFloat(hh(r,"height"),10),204),n.select(n.options.defaultValue,!1);const h=function(t){t.target.tagName.match(/input|textarea|select/i)||(t.preventDefault(),n.__doTouchStart(t,t.timeStamp))},p=function(t){n.__doTouchMove(t,t.timeStamp)},u=function(t){n.__doTouchEnd(t.timeStamp)},f=!!mh&&{passive:!1},m=!!mh&&{passive:!0};r.addEventListener("touchstart",h,f),r.addEventListener("mousedown",h,f),r.addEventListener("touchmove",p,m),r.addEventListener("mousemove",p,m),r.addEventListener("touchend",u,m),r.addEventListener("mouseup",u,m)},yh={value:null,__prevValue:null,__isSingleTouch:!1,__isTracking:!1,__didDecelerationComplete:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientTop:0,__clientHeight:0,__contentHeight:0,__itemHeight:0,__scrollTop:0,__minScrollTop:0,__maxScrollTop:0,__scheduledTop:0,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollTop:null,__maxDecelerationScrollTop:null,__decelerationVelocityY:null,__setDimensions(t,e){this.__clientHeight=t,this.__contentHeight=e;const n=this.options.data.length,i=Math.round(this.__clientHeight/this.__itemHeight);this.__minScrollTop=-this.__itemHeight*(i/2),this.__maxScrollTop=this.__minScrollTop+n*this.__itemHeight-.1},selectByIndex(t,e){t<0||t>this.__content.childElementCount-1||(this.__scrollTop=this.__minScrollTop+t*this.__itemHeight,this.scrollTo(this.__scrollTop,e),this.__selectItem(this.__content.children[t]))},select(t,e){const n=this,i=n.__content.children;for(let o=0,r=i.length;o<r;o++)if(decodeURI(JSON.parse(i[o].dataset.value).value)===t)return void n.selectByIndex(o,e);n.selectByIndex(0,e)},getValue(){return this.value},scrollTo(t,e){const n=this;if(e=void 0===e||e,n.__isDecelerating&&(dh.stop(n.__isDecelerating),n.__isDecelerating=!1),t=Math.round((t/n.__itemHeight).toFixed(5))*n.__itemHeight,(t=Math.max(Math.min(n.__maxScrollTop,t),n.__minScrollTop))===n.__scrollTop||!e)return n.__publish(t),void n.__scrollingComplete();n.__publish(t,250)},destroy(){this.__component.parentNode&&this.__component.parentNode.removeChild(this.__component)},__selectItem(t){const e=this,n=e.options.itemClass+"-selected",i=e.__content.querySelector("."+n);i&&i.classList.remove(n),t.classList.add(n),null!==e.value&&(e.__prevValue=e.value),e.value=decodeURI(JSON.parse(t.dataset.value).value)},__scrollingComplete(){const t=this,e=Math.round((t.__scrollTop-t.__minScrollTop-t.__itemHeight/2)/t.__itemHeight);t.__selectItem(t.__content.children[e]),null!==t.__prevValue&&t.__prevValue!==t.value&&t.options.onSelect({value:t.value,index:e})},__doTouchStart(t,e){const n=t.touches,i=this,o=t.touches?t.touches[0]:t,r=!!t.touches;if(t.touches&&null==n.length)throw new Error("Invalid touch list: "+n);if(e instanceof Date&&(e=e.valueOf()),"number"!=typeof e)throw new Error("Invalid timestamp value: "+e);let s;i.__interruptedAnimation=!0,i.__isDecelerating&&(dh.stop(i.__isDecelerating),i.__isDecelerating=!1,i.__interruptedAnimation=!0),i.__isAnimating&&(dh.stop(i.__isAnimating),i.__isAnimating=!1,i.__interruptedAnimation=!0);const a=r&&1===n.length||!r;s=a?o.pageY:Math.abs(o.pageY+n[1].pageY)/2,i.__initialTouchTop=s,i.__lastTouchTop=s,i.__lastTouchMove=e,i.__lastScale=1,i.__enableScrollY=!a,i.__isTracking=!0,i.__didDecelerationComplete=!1,i.__isDragging=!a,i.__isSingleTouch=a,i.__positions=[]},__doTouchMove(t,e,n){const i=this,o=t.touches,r=t.touches?t.touches[0]:t,s=!!t.touches;if(o&&null==o.length)throw new Error("Invalid touch list: "+o);if(e instanceof Date&&(e=e.valueOf()),"number"!=typeof e)throw new Error("Invalid timestamp value: "+e);if(!i.__isTracking)return;let a;a=s&&2===o.length?Math.abs(r.pageY+o[1].pageY)/2:r.pageY;const l=i.__positions;if(i.__isDragging){const t=a-i.__lastTouchTop;let n=i.__scrollTop;if(i.__enableScrollY){n-=t;const e=i.__minScrollTop,o=i.__maxScrollTop;(n>o||n<e)&&(n=n>o?o:e)}l.length>40&&l.splice(0,20),l.push(n,e),i.__publish(n)}else{const t=0,n=5,o=Math.abs(a-i.__initialTouchTop);i.__enableScrollY=o>=t,l.push(i.__scrollTop,e),i.__isDragging=i.__enableScrollY&&o>=n,i.__isDragging&&(i.__interruptedAnimation=!1)}i.__lastTouchTop=a,i.__lastTouchMove=e,i.__lastScale=n},__doTouchEnd(t){const e=this;if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);if(e.__isTracking){if(e.__isTracking=!1,e.__isDragging&&(e.__isDragging=!1,e.__isSingleTouch&&t-e.__lastTouchMove<=100)){const n=e.__positions,i=n.length-1;let o=i;for(let t=i;t>0&&n[t]>e.__lastTouchMove-100;t-=2)o=t;if(o!==i){const r=n[i]-n[o],s=e.__scrollTop-n[o-1];e.__decelerationVelocityY=s/r*(1e3/60);const a=4;Math.abs(e.__decelerationVelocityY)>a&&e.__startDeceleration(t)}}e.__isDecelerating||e.scrollTo(e.__scrollTop),e.__positions.length=0}},__publish(t,e){const n=this,i=n.__isAnimating;if(i&&(dh.stop(i),n.__isAnimating=!1),e){n.__scheduledTop=t;const o=n.__scrollTop,r=t-o,s=function(t,e,i){n.__scrollTop=o+r*t,n.__callback&&n.__callback(n.__scrollTop)},a=function(t){return n.__isAnimating===t},l=function(t,e,i){e===n.__isAnimating&&(n.__isAnimating=!1),(n.__didDecelerationComplete||i)&&n.__scrollingComplete()};n.__isAnimating=dh.start(s,a,l,e,i?ph:uh)}else n.__scheduledTop=n.__scrollTop=t,n.__callback&&n.__callback(t)},__startDeceleration(t){const e=this;e.__minDecelerationScrollTop=e.__minScrollTop,e.__maxDecelerationScrollTop=e.__maxScrollTop;e.__isDecelerating=dh.start(function(t,n,i){e.__stepThroughDeceleration(i)},function(){const t=Math.abs(e.__decelerationVelocityY)>=.5;return t||(e.__didDecelerationComplete=!0),t},function(t,n,i){e.__isDecelerating=!1,e.__scrollTop<=e.__minScrollTop||e.__scrollTop>=e.__maxScrollTop?e.scrollTo(e.__scrollTop):e.__didDecelerationComplete&&e.__scrollingComplete()})},__stepThroughDeceleration(t){const e=this;let n=e.__scrollTop+e.__decelerationVelocityY;const i=Math.max(Math.min(e.__maxDecelerationScrollTop,n),e.__minDecelerationScrollTop);i!==n&&(n=i,e.__decelerationVelocityY=0),Math.abs(e.__decelerationVelocityY)<=1?Math.abs(n%e.__itemHeight)<1&&(e.__decelerationVelocityY=0):e.__decelerationVelocityY*=.95,e.__publish(n)}};for(const t in yh)gh.prototype[t]=yh[t];t(".scroller-component{display:block;position:relative;height:284px;overflow:hidden;width:100%}.scroller-content{position:absolute;left:0;top:0;width:100%;z-index:1}.scroller-mask{position:absolute;left:0;top:0;height:100%;margin:0 auto;width:100%;z-index:3;transform:translateZ(0);background-image:-webkit-linear-gradient(top,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6)),-webkit-linear-gradient(bottom,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6));background-image:linear-gradient(180deg,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6)),linear-gradient(0deg,hsla(0,0%,100%,.95),hsla(0,0%,100%,.6));background-position:top,bottom;background-size:100% 102px;background-repeat:no-repeat}.scroller-item{text-align:center;font-size:32px;height:84px;line-height:84px;color:#000}.scroller-indicator{width:100%;height:84px;position:absolute;left:0;top:84px;z-index:3;background-image:-webkit-linear-gradient(top,#ccc,#ccc,transparent,transparent),-webkit-linear-gradient(bottom,#ccc,#ccc,transparent,transparent);background-image:linear-gradient(180deg,#ccc,#ccc,transparent,transparent),linear-gradient(0deg,#ccc,#ccc,transparent,transparent);background-position:top,bottom;background-size:100% 6px;background-repeat:no-repeat}.scroller-item{line-clamp:1;-webkit-line-clamp:1;overflow:hidden;text-overflow:ellipsis}",void 0);class bh{constructor(t){this.range=t.range||[],this._default=t,this.uid=t.uid,this.DomUid=`flex-item-${t.uid}`,this.scroller=[],this.columns=null,this.init()}init(){const t=document.createElement("div");t.classList.add("flex-box"),t.style.display="flex",t.style.justifyContent="center",t.style.alignItems="center",t.style.width="100%",this.pickerContainer=t;const e=new sh(this.uid);e.addContent(t,this),this.dealArray(this._default),this.extendDialog(e),this.dialog=e}getId(t){return`#${this.DomUid}-${t}`}getColumn(t){document.getElementById(this.getId(t))}removeColumn(t){this.pickerContainer.removeChild(document.getElementById(this.getId(t)))}dealArray(t){const e=t.range;if(e.some(t=>"[object Array]"!==Object.prototype.toString.call(t)))this.columns=[],this.columns.push(e.map(t=>"string"!=typeof t?JSON.stringify(t):t)),this.selected=this.selected||t.selected||0,this.scrollerResult={value:this.columns[0][this.selected],index:this.selected},this.selectedValue=t.value||this.columns[0][this.selected];else{this.columns=e;const n=this.columns.length;let i;if(this.scrollerResult){if((i=this.scrollerResult.index.map((t,e)=>e>this.lastChangeColumn?0:t)).length>n)i.splice(n),this.scrollerResult.value.splice(n),this.scrollerResult.index.splice(n);else if(i.length<n){const t=Array(n-i.length).fill(0);i=i.concat(t)}}else this.scrollerResult={value:[],index:[]};this.selected=i||t.selected||Array(n).fill(0);const o=this.selected;this.selectedValue=[],e.forEach((t,e)=>{this.scrollerResult.value[e]=t[o[e]],this.scrollerResult.index[e]=o[e],this.selectedValue[e]=t[o[e]]})}this.createColumns()}createColumns(){const t=this.columns;let e=0;const n=document.createDocumentFragment();for(let i=0,o=t.length;i<o;i++){const t=document.createElement("div");t.style.flex="1",t.setAttribute("id",`${this.DomUid}-${e++}`),n.appendChild(t)}this.pickerContainer.innerHTML="",this.pickerContainer.appendChild(n)}extendDialog(t){const e=this,n=e.columns.length;t.afterShow=function(){e.initScroll()},t.afterClose=function(){for(let t=0;t<n;t++)e.scroller[t]&&e.scroller[t].destroy(),e.scroller[t]=null}}updateData(t){this.dealArray(t),this.initScroll()}initScroll(){const t=this,e=t.columns,n=t.columns.length;if(1===n){const n=0;if(!document.querySelector(t.getId(n)))return;t.scroller[n]&&t.scroller[n].destroy(),t.scroller[n]=new gh(t.getId(n),{data:e[n],defaultValue:t.selectedValue,onSelect(e){t.scrollerResult=e,t.selectedValue=e.value}})}else for(let i=0;i<n;i++){if(!document.querySelector(t.getId(i)))return;t.scroller[i]&&t.scroller[i].destroy(),t.scroller[i]=new gh(t.getId(i),{data:e[i],defaultValue:t.selectedValue[i],onSelect(e){t.scrollerResult.value[i]=e.value,t.scrollerResult.index[i]=e.index,t.selectedValue[i]=e.value,t.scrollerResult.lastChangeColumn=i,t.onSelect({column:i,value:e.value,index:e.index})}})}}show(){this.dialog.show()}yes(){}cancel(){}}t('.hap-picker{position:fixed;z-index:1000;top:0;left:0;width:100%;height:100%}.hap-picker .picker-mask{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,.46)}@-webkit-keyframes pickerShow{0%{opacity:0}to{opacity:1}}@keyframes pickerShow{0%{opacity:0}to{opacity:1}}.hap-picker.time-picker-ani{-webkit-animation:pickerShow .2s linear;animation:pickerShow .2s linear}.picker-container{position:absolute;top:12%;left:12%;-webkit-transform:translate(-6%,-6%);transform:translate(-6%,-6%);width:86%;opacity:1;font-family:PingFang SC,HanHei SC,Helvetica Neue,Helvetica,sans-serif;line-height:1.5;background-color:#fff;box-shadow:0 5px 18px rgba(101,83,83,.8);-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.picker-container i{font-style:normal}.picker-container [data-active]{position:relative}.picker-container .picker-disabled.active:after,.picker-container [data-active]:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background-image:-webkit-radial-gradient(circle,#000 10%,transparent 10.01%);background-image:-o-radial-gradient(circle,#000 10%,transparent 10.01%);background-image:radial-gradient(circle,#000 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;pointer-events:none;-webkit-background-size:0 0;background-size:0 0;opacity:0;-webkit-transition:background .5s,opacity 1s;transition:background .5s,opacity 1s}.picker-container .active:after{-webkit-background-size:1000% 1000%;background-size:1000% 1000%;opacity:.2}.picker-container .picker-disabled{color:#d6d6d6}.picker-head{padding:26px 42px;line-height:1.5;color:#ececec;background-color:#429488}.picker-head-active{color:#fff}.picker-year{font-size:37px;width:4em;color:#b4e4e0}.picker-date{font-size:63px;text-indent:-2px}.picker-content{box-sizing:border-box;position:relative;overflow:hidden;height:635px;margin:26px 42px;font-size:26px;color:rgba(0,0,0,.8)}.picker-content li,.picker-content ul{list-style:none;margin:0;padding:0}.date-picker-main{width:100%;-webkit-transform:translateX(-100%) translateZ(0);transform:translateX(-100%) translateZ(0)}.date-picker-main:after{content:"";display:table;clear:both}.scroller-picker-main{position:relative;text-align:center}.scroller-picker-main li{padding:10px 0;overflow:hidden}.scroller-picker-main .picker-active{color:#4b968d}.scroller-picker-midd{position:absolute;top:50%;width:100%;height:40px;margin-top:-20px;-webkit-box-sizing:border-box;box-sizing:border-box}.scroller-picker-midd:after,.scroller-picker-midd:before{content:"";position:absolute;left:0;width:100%;border-top:1px solid #e2e3e5}.scroller-picker-midd:before{top:0;-webkit-transform:scaleY(.5) translateZ(0);-webkit-transform-origin:left top;transform-origin:left top;transform:scaleY(.5) translateZ(0)}.scroller-picker-midd:after{bottom:0;-webkit-transform:scaleY(.5) translateZ(0);-webkit-transform-origin:left bottom;transform-origin:left bottom;transform:scaleY(.5) translateZ(0)}.picker-actions-arrow{z-index:1;position:absolute;top:0;left:8px;right:8px;font-size:37px;line-height:84px}.picker-actions-arrow i{cursor:pointer;float:left;padding:16px 14px}.picker-actions-arrow i:last-child{float:right}.picker-actions-arrow i[data-active]:after{height:42px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);border-radius:50%}.picker-bdy{float:left;width:100%;padding:0 8px;margin-right:-100%;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box}.picker-bdy-curr{left:100%}.picker-bdy-next{left:200%}.date-picker-title{text-align:center;padding:46px 16px;font-size:28px;line-height:28px}.date-picker-days i{position:relative;width:14.28%;height:28px;padding:21px 0;text-align:center;display:inline-block;line-height:1;vertical-align:top;cursor:pointer;overflow:hidden}.date-picker-days i[data-active]:after{width:24px;left:50%;-webkit-transform:translate(-50%);transform:translate(-50%);border-radius:50%}.date-picker-days-bdy i span{position:relative}.date-picker-days-bdy i:before{content:"";left:50%;top:50%;width:0;height:0;position:absolute;border-radius:50%;background-color:#429488;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.picker-bdy-curr .date-picker-days-bdy i.picker-active{color:#fff}.picker-bdy-curr .date-picker-days-bdy i.picker-active:before{width:64px;height:64px}.date-picker-days-bdy .picker-now{color:#4b968d}.date-picker-days-title{font-size:28px;color:#626262}.date-picker-days-bdy i[data-val="0"]{color:transparent}.date-picker-days-bdy i[data-val="0"]:before{content:none}.picker-foot{padding:26px 42px;text-align:right;color:#393939}.picker-act{padding:5px 25px;margin-left:10px;text-decoration:none;display:inline-block;font-size:28px;color:#4b968d;background-color:transparent;border-radius:2px;-webkit-transition:background-color .2s linear;transition:background-color .2s linear}.picker-act:hover{background-color:hsla(0,0%,60%,.2)}.picker-act-clear{margin-left:0;float:left}.time-picker-container{top:18%;transform:translate(-6%,-9%)}.time-picker-container .picker-content{height:500px}.time-picker-container .picker-head{text-align:center;font-size:99px;font-weight:300;padding-top:6px;padding-bottom:6px}.time-picker-container .picker-cell{margin-left:-20px}.time-picker-container .picker-cell[data-active]:after{width:30px;height:30px;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);border-radius:50%}.time-picker-container .picker-active{z-index:1;color:#fff;pointer-events:none}.time-picker-container .picker-active b{position:absolute;left:50%;top:50%;margin-top:-1px;margin-left:-1px;width:2px;height:2px;background-color:#fff;border-radius:50%}.time-picker-main{position:absolute;top:50%;left:50%;height:485px;width:485px;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);border-radius:50%;background-color:rgba(0,0,0,.05)}.time-picker-main>ul{position:absolute;top:1px;right:1px;bottom:1px;left:1px}.time-picker-main:before{content:"";position:absolute;top:50%;left:50%;width:13px;height:13px;border-radius:50%;background-color:#007467;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.time-picker-minutes-1 .picker-cell{width:6px;margin-left:-3px;-webkit-transform-origin:50% 226px;transform-origin:50% 226px}.time-picker-minutes-1 .picker-cell i{margin-top:-3px}.time-picker-minutes-1 .picker-active b{margin-top:-4px}.time-picker-minutes-10 .picker-cell{width:80px;margin-left:-40px}.picker-hour,.picker-minute{display:inline-block;font-weight:400}.picker-hour[data-active]:after,.picker-minute[data-active]:after{height:46px;top:5px}.picker-hour{text-align:right}.picker-minute{text-align:left}.picker-cell{position:absolute!important;top:12px;left:50%;width:36px;height:59px;-webkit-transform-origin:20px 226px;transform-origin:20px 226px;-webkit-transition:all .2s;transition:all .2s}.picker-cell i{position:absolute;top:50%;left:50%;pointer-events:none}.picker-cell-inner{top:104px;width:42px;height:42px;-webkit-transform-origin:20px 135px;transform-origin:20px 135px;color:#676767}.time-picker-line{position:absolute;top:50%;left:50%;width:157px;height:3px;margin-top:-2px;pointer-events:none;background-color:#007467;-webkit-transform-origin:0 50%;transform-origin:0 50%}.time-picker-line:before{content:"";position:absolute;left:100%;top:0;margin-top:-39px;width:80px;height:80px;background-color:#007467;border-radius:50%}.time-picker-line-inner{width:77px}',void 0);var vh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Eh=Object.prototype;function wh(t,e){return Eh.toString.call(t)==="[object "+e+"]"}function xh(t){return wh(t,"Function")}function Th(t){return wh(t,"Object")}function Ah(t){return Array.isArray?Array.isArray(t):wh(t,"Array")}function kh(t){return!(!t||!Th(t))&&"isPrototypeOf"in t}var _h=Object.freeze({isFn:xh,isStr:function(t){return wh(t,"String")},isNum:function(t){return wh(t,"Number")},isObj:Th,isArray:Ah,isDate:function(t){return wh(t,"Date")},isUndefined:function(t){return void 0===t},each:function(t,e,n){if(t&&xh(e))if(n=n||t,t.length){for(var i=0,o=t.length;i<o;i++)if(!1===e.call(n,t[i],i,t))return}else if(Th(t))for(var r in t)if(!1===e.call(n,t[r],r,t))return},noop:function(){},extend:function t(){var e,n,i,o,r=arguments[0]||{},s=1,a=arguments.length,l=!1;for("boolean"==typeof arguments[0]&&(l=r,r=arguments[1]||{},s=2),"object"===(void 0===r?"undefined":vh(r))||xh(r)||(r={});s<a;s++)if(null!=(e=arguments[s]))for(n in e)if(i=r[n],r!==(o=e[n]))if(l&&o&&(kh(o)||Ah(o))){var c=i&&(kh(i)||Ah(i))?i:Ah(o)?[]:{};r[n]=t(l,c,o)}else void 0!==o&&(r[n]=o);return r},pad:function(t,e,n){if(e<1)return"";void 0===n&&(n=!0),t=""+t;for(var i=0;i<e;)t="0"+t,i+=1;return i=t.length-e,t.substring(n?i:i>0?e:i)},set2Null:function(t,e){t.forEach(function(t){e[t]=null})}}),Ch=_h.pad,Sh=/(?:\b|%)([dDMyHhaAmsz]+|ap|AP)(?:\b|%)/g,Mh={d:"([0-9][0-9]?)",dd:"([0-9][0-9])",M:"([0-9][0-9]?)",MM:"([0-9][0-9])",yyyy:"([0-9][0-9][0-9][0-9])",yyy:"([0-9][0-9])[y]",yy:"([0-9][0-9])",H:"([0-9][0-9]?)",hh:"([0-9][0-9])",h:"([0-9][0-9]?)",HH:"([0-9][0-9])",m:"([0-9][0-9]?)",mm:"([0-9][0-9])",s:"([0-9][0-9]?)",ss:"([0-9][0-9])",z:"([0-9][0-9]?[0-9]?)",zz:"([0-9][0-9]?[0-9]?)[z]",zzz:"([0-9][0-9][0-9])",ap:"([ap][m])",a:"([ap][m])",AP:"([AP][M])",A:"([AP][M])","%":""};var Oh={format:function(t,e){var n,i={},o=-1!==e.indexOf("a")||-1!==e.indexOf("A");return i.d=t.getDate(),i.dd=Ch(i.d,2),n=t.getDay(),i.D=n,i.DD=n,i.M=t.getMonth()+1,n=i.M,i.MM=Ch(n,2),i.yyyy=t.getFullYear(),n=i.yyyy,i.yyy=Ch(n,2)+"y",i.yy=Ch(n,2),i.y="y",i.H=t.getHours(),n=i.H,i.hh=Ch(o?Dh(n):n,2),i.h=o?Dh(n):n,i.HH=Ch(n,2),n=i.H<12,i.ap=n?"am":"pm",i.a=n?"am":"pm",i.AP=n?"AM":"PM",i.A=n?"AM":"PM",i.m=t.getMinutes(),i.mm=Ch(i.m,2),i.s=t.getSeconds(),i.ss=Ch(i.s,2),i.z=t.getMilliseconds(),n=i.z,i.zz=n+"z",i.zzz=Ch(n,3),e.replace(Sh,function(t,e){var n=i[e];return void 0===n?e:n})},parse:function(t,e){for(var n,i=Mh,o="",r=0,s=[""],a="",l=new Date;r<e.length;){for(a=e.charAt(r);r+1<e.length&&void 0!==i[a+e.charAt(r+1)];)a+=e.charAt(++r);void 0!==(n=i[a])?""!==n&&(o+=i[a],s.push(a)):o+=a,r++}o=new RegExp(o);var c=t.match(o),d=s.length;if(!c||c.length!==d)return null;for(r=0;r<d;r++)if(""!==(a=s[r]))switch(n=parseInt(c[r],10),a){case"yyyy":case"yyy":l.setYear(n);break;case"yy":l.setYear(2e3+n);break;case"MM":case"M":l.setMonth(n-1);break;case"dd":case"d":l.setDate(n);break;case"hh":case"h":case"HH":case"H":l.setHours(n);break;case"mm":case"m":l.setMinutes(n);break;case"ss":case"s":l.setSeconds(n);break;case"zzz":case"zz":case"z":l.setMilliseconds(n);break;case"AP":case"A":case"ap":case"a":l.setHours(Lh(l.getHours(),c[r]))}return l}};function Dh(t){return t%12==0?12:t%12}function Lh(t,e){return e=e.toLowerCase(),t=parseInt(t,10),"pm"===e?t<12?t+12:t:12===t?0:t}function Ih(t){return t instanceof Date?new Date(t.getTime()):(t=new Date(t),isNaN(t.getTime())?null:t)}var Ph="yyyy-MM-dd";function Nh(t,e){return~[3,5,8,10].indexOf(e)?30:1===e?t%4==0&&t%100!=0||t%400==0?29:28:31}var Rh=864e5;for(var Fh={toDate:Ih,date2Details:function(t){return{year:t.getFullYear(),month:t.getMonth(),date:t.getDate(),day:t.getDay(),hours:t.getHours(),minutes:t.getMinutes()}},formatDate:function(t,e){return(t=Ih(t))?Oh.format(t,e||Ph):""},parseDate:function(t,e){return Oh.parse(t,e||Ph)},getDaysInMonth:Nh,getDaysInMonthOfDate:function(t){return t.getDaysInMonth?t.getDaysInMonth():Nh(t.getFullYear(),t.getMonth())},getFirstDayOfMonth:function(t){return(t=new Date(t.getTime())).setDate(1),t.getDay()},getStartDateOfMonth:function(t,e){var n=new Date(t,e,1),i=n.getDay();return 0===i?n.setTime(n.getTime()-7*Rh):n.setTime(n.getTime()-Rh*i),n},getStartDateOfWeek:function(t,e,n){var i=(n=new Date(t,e,n)).getDay();return n.setTime(n.getTime()-Rh*i),n},getWeekNumber:function(t){(t=new Date(t.getTime())).setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var e=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-e.getTime())/Rh-3+(e.getDay()+6)%7)/7)},prevMonth:function(t){var e=(t=new Date(t.getTime())).getFullYear(),n=t.getMonth(),i=t.getDate(),o=0===n?e-1:e,r=0===n?11:n-1,s=Nh(o,r);return s<i&&t.setDate(s),t.setMonth(r),t.setFullYear(o),t},nextMonth:function(t){var e=(t=new Date(t.getTime())).getFullYear(),n=t.getMonth(),i=t.getDate(),o=11===n?e+1:e,r=11===n?0:n+1,s=Nh(o,r);return s<i&&t.setDate(s),t.setMonth(r),t.setFullYear(o),t},prevDate:function(t){var e=t.getTime();return(t=new Date(e)).setTime(e-Rh),t},nextDate:function(t){var e=t.getTime();return(t=new Date(e)).setTime(e+Rh),t}},Bh={aniEnd:"animationend",transform:"transform"},jh=document.createElement("div").style,Hh=["a","webkitA","MozA","OA","msA"],$h=["animationend","webkitAnimationEnd","animationend","oAnimationEnd","MSAnimationEnd"],zh=["transform","webkitTransform","MozTransform","OTransform","msTransform"],Yh=0,Wh=Hh.length;Yh<Wh;Yh++)Hh[Yh]+"nimation"in jh&&(Bh.aniEnd=$h[Yh],Bh.transform=zh[Yh]);Bh.transitionEnd=Bh.aniEnd.replace("AnimationEnd","TransitionEnd").replace("animationend","transitionend");var Vh={prefixNames:Bh},Uh=_h.each,qh=document;var Gh={createElement:function(t,e,n){var i=qh.createElement(t);return e&&Uh(e,function(t,e){i[e]=t}),n&&Uh(n,function(t,e){i.setAttribute(e,t)}),i}},Jh=_h.extend({},_h,Fh,Vh,Gh),Kh={on:function(t,e){this._eventData||(this._eventData={}),this._eventData[t]||(this._eventData[t]=[]);var n=!1;return Jh.each(this._eventData[t],function(t){if(t===e)return n=!0,!1}),n||this._eventData[t].push(e),this},once:function(t,e){var n=this;return this.on(t,function i(){e.apply(this,arguments),n.off(t,i)}),this},off:function(t,e){return this._eventData||(this._eventData={}),this._eventData[t]&&this._eventData[t].length?(e?Jh.each(this._eventData[t],function(n,i){if(n===e)return this._eventData[t].splice(i,1),!1}):this._eventData[t]=[],this):this},trigger:function(t){if(this._eventData||(this._eventData={}),!this._eventData[t])return this;var e=this._eventData[t].slice.call(arguments,1);return Jh.each(this._eventData[t],function(t){t.apply(null,e)}),this}},Zh={C:{value:"year",rows:function(t){for(var e=[],n=t.options.min.getFullYear(),i=t.options.max.getFullYear(),o=n;o<=i;)e.push([o++]);return e},input:"setFullYear"},Y:{value:"month",rows:function(t){var e=[],n=t.now.getFullYear(),i=t.options.min.getFullYear(),o=t.options.min.getMonth(),r=t.options.max.getFullYear(),s=t.options.max.getMonth();n>i&&(o=0),r>n&&(s=11);for(var a=o;a<=s;)e.push([a++]);return e},input:"setMonth"},M:{value:"date",rows:function(t){for(var e=[],n=t.now,i=Jh.getDaysInMonthOfDate(n),o=0,r=1,s=Jh.getFirstDayOfMonth(t.now),a=null;r<=i;)o%7==0&&(a=[],e.push(a)),a.push(o<s?0:r++),o++;return e},input:"setDate"},W:{value:"date",rows:function(t){for(var e=[],n=t.parsedNow,i=Jh.getStartDateOfWeek(n.year,n.month,n.date),o=1,r=[];o++<=7;)r.push(i.getDate()),i=Jh.nextDate(i);return e.push(r),e},input:function(t,e){var n=e.now,i=e.parsedNow,o=Jh.toDate(n),r=i.date;return Math.abs(t-r)<7?o.setDate(t):t>r?(o.setDate(t),o=Jh.nextMonth(o)):(o.setDate(t),o=Jh.prevMonth(o)),o}},D:{value:"hours",rows:function(t){for(var e=[],n=0;n<=23;)e.push([n++]);return e},input:"setHours"},H:{value:"minutes",rows:function(t){for(var e=[],n=0;n<=59;)e.push([n++]);return e},input:"setMinutes"}};function Qh(t){this.options=Jh.extend({default:new Date,type:"M"},t||{});var e=Jh.toDate(this.options.default);e||(e=new Date),this.updateNow(e)}Jh.each(Zh,function(t){var e=t.input;Jh.isStr(e)&&(t.input=function(t,n){var i=n.now,o=Jh.toDate(i);return o[e](t),o})}),Jh.extend(Qh.prototype,{updateNow:function(t){t<this.options.min&&(t=this.options.min),t>this.options.max&&(t=this.options.max),this.now=new Date(t.getTime()),this.parsedNow=Jh.date2Details(this.now)},_getConf:function(){return Zh[this.options.type]||Zh.M},getRows:function(){return this._getConf().rows(this)},getInputValue:function(t){return this._getConf().input(t,this)},getLevelValue:function(){var t=this._getConf();return this.parsedNow[t.value]},destroy:function(){this.now=null,this.parsedNow=null,this.options=null}},Kh);var Xh=Qh,tp={Core:{DateTime:Xh,events:Kh,utils:Jh}},ep={"zh-CN":{day:["周日","周一","周二","周三","周四","周五","周六"],shortDay:["日","一","二","三","四","五","六"],MDW:"M月d日D",YM:"yyyy年M月",OK:"确定",CANCEL:"取消",CLEAR:"清除"},EN:{day:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortDay:["S","M","T","W","T","F","S"],MDW:"D, MM-d",YM:"yyyy-M",OK:"OK",CANCEL:"CANCEL",CLEAR:"CLEAR"}},np={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},ip="ontouchstart"in window,op=ip?"touchstart":"mousedown",rp=ip?"touchmove":"mousemove",sp=ip?"touchend":"mouseup",ap=ip?"touchcancel":"mouseup";function lp(t,e){this.container=document.body,t||(t={}),this.lang=t.lang||"EN",this.lang=t.lang,this.destroyed=!1;var n=ep[this.lang];n||(n=ep.EN),this.config=Jh.extend(n,e||{}),this.options=t,this.needDefFormat=!this.options.format,this.init(),this._setOptions(),this._init()}var cp=lp.prototype;lp.extend=function(t,e){var n=function(){};return n.prototype=cp,t.prototype=new n,t.prototype.super=cp,t.prototype.constructor=t,Jh.extend(t.prototype,e||{}),t},Jh.extend(cp,{_setOptions:function(){var t=this,e={min:new Date(1900,0,1,0,0,0,0),max:new Date(2100,11,31,23,59,59,999)};["default","min","max"].forEach(function(n){t.options.format&&t.options[n]&&Jh.isStr(t.options[n])?t.options[n]=Jh.parseDate(t.options[n],t.options.format):e[n]&&(t.options[n]=e[n])})},setDateTime:function(t){this.dateTime=new Xh(this.options),this._setDateTime(t),t?this.selfChange():(this.render(),this.afterRender())},setNow:function(t){this.options.default=t,this.setDateTime()},_setDateTime:Jh.noop,init:Jh.noop,_init:function(){this._initEle(),this.bindEvts(),this.setDateTime()},_initEle:function(){var t=Jh.createElement("div",{className:"hap-picker"}),e=Jh.createElement("div",{className:"picker-mask"});e.dataset.click="cancel";var n=Jh.createElement("div",{className:"picker-container"});this.rootEle=t,this.ele=n,this._initHead(),this._initContent(),this._initFoot(),this.initEle(),this._handleAni(),t.appendChild(e),t.appendChild(n),this.container.appendChild(t)},initEle:Jh.noop,_initHead:function(){this.head=Jh.createElement("div",{className:"picker-head"}),this.ele.appendChild(this.head)},_initContent:function(){this.content=Jh.createElement("div",{className:"picker-content"},{"data-touchstart":"_start"}),this.ele.appendChild(this.content)},_initFoot:function(){this.foot=Jh.createElement("div",{className:"picker-foot",innerHTML:'<a href="javascript:;" class="picker-act picker-act-cancel" data-active="active" data-click="cancel">'+this.config.CANCEL+'</a><a href="javascript:;" class="picker-act picker-act-ok" data-active="active" data-click="ok">'+this.config.OK+"</a>"}),this.ele.appendChild(this.foot)},_handleAni:function(){var t=this.rootEle;t.classList.add("time-picker-ani"),t.addEventListener(Jh.prefixNames.aniEnd,function e(){t.classList.remove("time-picker-ani"),t.removeEventListener(Jh.prefixNames.aniEnd,e,!1)},!1)},_addEvt:function(t){this.rootEle.addEventListener(t,this,!1)},_removeEvt:function(t){this.rootEle.removeEventListener(t,this,!1)},_stop:function(t){t.preventDefault(),t.stopPropagation()},bindEvts:function(){this._addEvt(op),this._addEvt(rp),this._addEvt(sp),this._addEvt(ap)},changeTo:function(t,e){this.options.default=this.dateTime.getInputValue(t),this.setDateTime(e)},selV:function(t){var e=t.realTarget,n=e.getAttribute("data-val")-0;!e.classList.contains("picker-disabled")&&this.shouldSet(n)&&this._selV(n)},_selV:function(t){this.changeTo(t,!0)},shouldSet:function(t){return!0},clear:function(){this.setNow(),this.trigger("cleared"),this.hide()},cancel:function(){this.trigger("canceled"),this.hide()},ok:function(){var t=this.dateTime.now,e=this.options.format;e&&(t=Jh.formatDate(t,e)),this.trigger("selected",t,this.dateTime.now),this.hide()},__activeStart:function(t){this.__activeEnd();var e=this._getTargetAction(t,"active");e.action&&(this.activeTA=e,e.target.classList.add(e.action))},__activeEnd:function(){this.activeTA&&this.activeTA.target.classList.remove(this.activeTA.action),this.activeTA=null},__touchstart:function(t){this.__activeStart(t),this.__start(t);var e=t.target,n=t.targetTouches[0];this.__s_x=n.pageX,this.__s_y=n.pageY,this.__startTime=t.timeStamp,this.__target=e},__touchmove:function(t){if(this.__move(t),this.__target){var e=t.changedTouches[0];(this.__target!==t.target||Math.abs(e.pageX-this.__s_x)>10||Math.abs(e.pageY-this.__s_y)>10)&&(this.__target=null)}},__touchend:function(t){if(this.__activeEnd(t),this.__end(t),this.__target){var e=t.timeStamp;if(!(e-this.__lastTime<200||e-this.__startTime>700)){var n=this.__target;this.__lastTime=e,this.__target=null,t.__target=n,t.__type="click"}}},__touchcancel:function(t){this.__activeEnd(t),this.__end(t),this.__target=null},handleEvent:function(t){this._stop(t);var e=t.type;np[e]&&(e=np[e],t.__type=e,t.touches=t.changedTouches=t.targetTouches=[t]),this["__"+e](t),this._handleEvent(t)},_getTargetAction:function(t,e){for(var n=t.__target||t.target,i="data-"+(e||t.__type||t.type),o="";n&&n!==this.rootEle&&!(o=n.getAttribute(i));)n=n.parentNode;return{target:n,action:o}},_handleEvent:function(t){var e=this._getTargetAction(t);e.action&&(t.realTarget=e.target,this.panel&&this.panel[e.action]?this.panel[e.action](t):this[e.action]&&this[e.action](t))},show:function(){this.rootEle&&(this.rootEle.style.display="block",this._handleAni())},hide:function(){this.rootEle&&(this.rootEle.style.display="none")},desEvts:function(){this._removeEvt(op),this._removeEvt(rp),this._removeEvt(sp),this._removeEvt(ap)},destroy:function(){this.destroyed||(this.trigger("destroy"),this.hide(),this.desEvts(),this.container.removeChild(this.rootEle),this.dateTime.destroy(),this.panel&&this.panel.destroy(),Jh.set2Null(["container","rootEle","ele","head","content","foot","dateTime","panel","config","lang"],this),this.destroyed=!0)}},Kh);["selfChange","render","afterRender","__start","__move","__end"].forEach(function(t){cp[t]=function(){this.panel&&this.panel[t]&&this.panel[t].apply(this.panel,arguments)}});var dp=lp;function hp(t){this.picker=t,this.main=null,this.mainStyle=null,this.arrow=null,this.arrowStyle=null}Jh.extend(hp.prototype,{render:function(){this.main||this._init(),this._renderHead(),this.main.innerHTML=up(this.picker.prevDateTime,this.picker.config,"prev")+up(this.picker.dateTime,this.picker.config,"curr")+up(this.picker.nextDateTime,this.picker.config,"next")},_renderHead:function(){this.picker.head.innerHTML='<div class="picker-year" data-click="toYears" data-active="active">'+this.picker.dateTime.parsedNow.year+'</div><div class="picker-date picker-head-active" data-active="active">'+Jh.formatDate(this.picker.dateTime.now,this.picker.config.MDW.replace("D","#")).replace("#",this.picker.config.day[this.picker.dateTime.parsedNow.day])+"</div>"},afterRender:function(){this.activeDateEle=this.main.querySelector(".picker-bdy-curr .picker-active")},selfChange:function(){this._renderHead(),this.activeDateEle&&this.activeDateEle.classList.remove("picker-active");var t=this.picker.dateTime.getLevelValue(),e=this.main.querySelector('.picker-bdy-curr i[data-val="'+t+'"]');e.classList.add("picker-active"),this.activeDateEle=e},_init:function(){this._initMain(),this._initArrow()},_initMain:function(){this.main=Jh.createElement("div",{className:"date-picker-main"}),this.mainStyle=this.main.style,this.picker.content.appendChild(this.main),this.mainWidth=this.main.offsetWidth},_initArrow:function(){this.arrow=Jh.createElement("div",{className:"picker-actions-arrow"}),this.arrow.innerHTML='<i data-click="prevMonth" data-active="active">←</i><i data-click="nextMonth" data-active="active">→</i>',this.arrowStyle=this.arrow.style,this.picker.content.appendChild(this.arrow)},show:function(){this.mainStyle.display="block",this.arrowStyle.display="block"},hide:function(){this.mainStyle.display="none",this.arrowStyle.display="none"},_slideTo:function(t,e,n){var i=this,o=3*Math.abs(t-e),r=function t(){i._slideEndFn&&(window.clearTimeout(i._slideEndFn.tid),i._slideEndFn=null,i.main.removeEventListener(Jh.prefixNames.transitionEnd,t,!1),i.mainStyle.webkitTransition="none 0ms",i.mainStyle.transition="none 0ms",i.mainStyle[Jh.prefixNames.transform]="translateX(-100%) translateZ(0)",n&&n.call(i))};this._slideEndFn&&this._slideEndFn(),this._slideEndFn=r,this.mainStyle[Jh.prefixNames.transform]="translateX("+t+"%) translateZ(0)",o>0?(this._slideEndFn.tid=window.setTimeout(r,o),o+="ms",this.mainStyle.webkitTransition=o,this.mainStyle.transition=o):r(),this.main.addEventListener(Jh.prefixNames.transitionEnd,r,!1)},_befChange:function(t){return Jh.isNum(t)||(t=-100),this._slideEndFn&&this._slideEndFn(),t},prevMonth:function(t){t=this._befChange(t),this._slideTo(0,t,function(){this.picker.setNowToPrev()})},nextMonth:function(t){t=this._befChange(t),this._slideTo(-200,t,function(){this.picker.setNowToNext()})},_start:function(t){var e=t.touches[0].pageX,n=this,i=-100,o=!1;this.__move=function(t){var r=t.touches[0].pageX-e;r=100*r/n.mainWidth;var s=Math.abs(r);s>100&&(r=r>0?100:-100),o=s>55,i=-100+r,n.arrowStyle.opacity=(100-.9*s)/100,n.mainStyle[Jh.prefixNames.transform]="translateX("+i+"%) translateZ(0)"},this.__end=function(t){this.__move=null,this.__end=null,n.arrowStyle.opacity=1,o?n[i>-100?"prevMonth":"nextMonth"](i):n._slideTo(-100,i)},this._slideEndFn&&this._slideEndFn()},destroy:function(){this._slideEndFn&&this._slideEndFn(),this.picker.content.removeChild(this.main),this.picker.content.removeChild(this.arrow),Jh.set2Null(["picker","main","mainStyle","arrow","arrowStyle","activeDateEle","__move","__end"],this)}});var pp=hp;function up(t,e,n){if(!t)return"";var i=new Date,o=i.getFullYear(),r=i.getMonth(),s=i.getDate(),a=t.parsedNow,l=Jh.date2Details(t.options.min),c=Jh.date2Details(t.options.max),d=function(t,e,n){var i=!1;t.year>e.year?i=!0:t.year===e.year&&(i=t.month>=e.month);i&&(t.year<n.year?i=!0:t.year===n.year&&(i=t.month<=n.month));return i}(a,l,c);return'<div class="picker-bdy'+(n=" picker-bdy-"+n)+'"><div class="date-picker-title">'+Jh.formatDate(t.now,e.YM)+'</div><div class="date-picker-days"><div class="date-picker-days-title">'+e.shortDay.map(function(t){return"<i>"+t+"</i>"}).join("")+'</div><div class="date-picker-days-bdy">'+t.getRows().map(function(t){return'<div class="picker-row">'+t.map(function(t){var e=a.year===o&&a.month===r&&t===s?"picker-now":"";t===a.date&&(e=e?e+" picker-active":"picker-active"),d&&!function(t,e,n,i){if(e.year===n.year&&e.month===n.month)return t<n.date;if(e.year===i.year&&e.month===i.month)return t>i.date;return!1}(t,a,l,c)||(e=e?e+" picker-disabled":"picker-disabled"),e&&(e=' class="'+e+'"');var n=' data-val="'+t+'" ';return t&&(n+='data-active="active" data-click="selV" data-val="'+t+'"'),"<i"+n+e+"><span>"+t+"</span></i>"}).join("")+"</div>"}).join("")+"</div></div></div>"}var fp={C:yp("year"),Y:yp("month",function(t){return t+1})};function mp(t){this.picker=t,this.main=null,this.mainStyle=null,this.posY=0,this.type=t.options.type}Jh.extend(mp.prototype,{render:function(){this.rows=this.picker.dateTime.getRows(),this.main||this._init(),this._renderHead(),this.main.innerHTML=fp[this.type](this.picker.dateTime,this.rows)},_renderHead:function(){var t="C"===this.type;this.picker.head.innerHTML='<div class="picker-year'+(t?" picker-head-active":"")+'"'+(t?"":' data-click="toYears" data-active="active"')+">"+this.picker.dateTime.parsedNow.year+'</div><div class="picker-date" data-click="toDays" data-active="active">'+Jh.formatDate(this.picker.dateTime.now,this.picker.config.MDW.replace("D","#")).replace("#",this.picker.config.day[this.picker.dateTime.parsedNow.day])+"</div>"},afterRender:function(){var t=this.main.querySelector(".picker-active");if(t){this.itemHeight=t.offsetHeight,this.activeEle=t;var e=t.offsetTop-(this.contentHeight-this.itemHeight)/2;this._slideTo(-e,0)}},_init:function(){this._initMain(),this._initMidd()},_initMain:function(){this.main=Jh.createElement("div",{className:"scroller-picker-main"}),this.mainStyle=this.main.style,this.picker.content.appendChild(this.main),this.contentHeight=this.picker.content.offsetHeight},_initMidd:function(){this.midd=Jh.createElement("div",{className:"scroller-picker-midd"}),this.middStyle=this.midd.style,this.picker.content.appendChild(this.midd)},show:function(){this.mainStyle.display="block",this.middStyle.display="block"},hide:function(){this.mainStyle.display="none",this.middStyle.display="none"},selfChange:function(){if(!this.__ani){var t=this;this._renderHead(),this.activeEle.classList.remove("picker-active");var e=this.picker.dateTime.getLevelValue(),n=this.main.querySelector('.picker-row[data-val="'+e+'"]'),i=(this.activeEle.dataset.val-e)*this.itemHeight+this.posY;t._slideTo(i,0,function(){n.classList.add("picker-active"),t.activeEle=n})}},_slideTo:function(t,e,n){var i=this,o=function t(e){i._slideEndFn&&(window.clearTimeout(i._slideEndFn.tid),i._slideEndFn=null,i.main.removeEventListener(Jh.prefixNames.transitionEnd,t,!1),n&&n.call(i,e),i.mainStyle.webkitTransition="none 0ms",i.mainStyle.transition="none 0ms")};this._slideEndFn&&this._slideEndFn(),this._slideEndFn=o,this.posY=t,this.mainStyle[Jh.prefixNames.transform]="translateY("+this.posY+"px) translateZ(0)";var r=" cubic-bezier(0.25, 0.46, 0.45, 0.94)";e>0?(this._slideEndFn.tid=window.setTimeout(function(){o({})},e+20),e+="ms",this.mainStyle.webkitTransition=e+r,this.mainStyle.transition=e+r,this.main.addEventListener(Jh.prefixNames.transitionEnd,o,!1)):o()},_start:function(t){this._slideEndFn&&this._slideEndFn();var e=t.touches[0].pageY,n=this,i=this.posY,o=i,r=t.timeStamp,s=i;this.__move=function(t){var a=t.touches[0].pageY-e;o=i+a;var l=t.timeStamp;l-r>300&&(r=l,s=o),n.mainStyle[Jh.prefixNames.transform]="translateY("+o+"px) translateZ(0)"};var a=function(t){var e,o=t-i,r=Math.round(o/n.itemHeight),s=n.picker.dateTime.getLevelValue(),a=s-r,l=n.rows[0][0],c=n.rows[n.rows.length-1][0];return a<l?(a=l,e=(r=s-l)*n.itemHeight+i):a>c?(a=c,e=(r=s-c)*n.itemHeight+i):e=r*n.itemHeight+i,{realTo:e,targetV:a}};this.__end=function(t){this.__move=null,this.__end=null;var e,i=t.timeStamp-r;if(i<300){var l=-n.rows.length*n.itemHeight,c=n.contentHeight;s<l?s=l:s>c&&(s=c);var d=function(t,e,n){var i=t-e,o=Math.abs(i)/n;return{destination:t+o*o/.0012*(i<0?-1:1),speed:o}}(o,s,i);o=d.destination,e=d.speed}var h=a(o),p=h.realTo,u=h.targetV;void 0===e?(e=100*Math.abs(p-o)/n.itemHeight)>50&&(e=20):e=Math.abs(p-s)/e,n._slideTo(p,e,function(t){if(t||!e)n.picker.changeTo(u);else{var i=(r=n.main,+((s=(s=window.getComputedStyle(r,null))[Jh.prefixNames.transform].split(")")[0].split(", "))[13]||s[5])),o=a(i);n._slideTo(o.realTo,0,function(){n.__ani=!0,n.picker.changeTo(o.targetV,!0),n.__ani=!1})}var r,s})}},destroy:function(){this._slideEndFn&&this._slideEndFn(),this.picker.content.removeChild(this.main),this.picker.content.removeChild(this.midd),Jh.set2Null(["picker","main","mainStyle","midd","middStyle","activeEle","__move","__end"],this)}});var gp=mp;function yp(t,e){return e||(e=function(t){return t}),function(n,i){var o=n.parsedNow[t];return"<ul>"+i.map(function(t){var n=t[0],i="";return n===o&&(i=" picker-active"),'<li class="picker-row'+i+'" data-click="selV" data-val="'+n+'">'+e(n)+"</li>"}).join("")+"</ul>"}}function bp(){dp.apply(this,arguments)}dp.extend(bp,{init:function(){this.needDefFormat&&(this.options.format="yyyy-MM-dd"),Jh.extend(this.options,{type:"M"}),this.panel=this.daysPanel=new pp(this)},_setDateTime:function(){var t=Jh.prevMonth(this.dateTime.now),e=Jh.nextMonth(this.dateTime.now);this.prevDateTime=new Xh(Jh.extend({},this.options,{default:t})),this.prevDateTime.parsedNow.month!==t.getMonth()&&(this.prevDateTime.destroy(),this.prevDateTime=null),this.nextDateTime=new Xh(Jh.extend({},this.options,{default:e})),this.nextDateTime.parsedNow.month!==e.getMonth()&&(this.nextDateTime.destroy(),this.nextDateTime=null)},initEle:function(){this.ele.classList.add("date-picker-container")},shouldSet:function(t){return!!t},setNowToPrev:function(){this.prevDateTime&&this.setNow(this.prevDateTime.now)},setNowToNext:function(){this.nextDateTime&&this.setNow(this.nextDateTime.now)},_to:function(t,e){Jh.extend(this.options,{type:t}),this.panel.hide(),this[e]?this[e].show():this[e]=new gp(this),this.panel=this[e],this.setDateTime()},toYears:function(){this._to("C","yearsPanel")},toMonths:function(){this._to("Y","monthsPanel")},toDays:function(){this._to("M","daysPanel")}});var vp=bp,Ep={D:Tp("hours",null,function(t){return t.length/2}),H:Tp("minutes",function(t,e,n){return e%5==0?'<i style="'+n(e,!0)+'">'+Jh.pad(t,2)+"</i>":"<b></b>"})};function wp(t){this.picker=t,this.main=null,this.mainStyle=null,this.headActiveEle=null,this.activeEle=null,this.pickerLineEle=null,this.type=t.options.type}Jh.extend(wp.prototype,{render:function(){this.rows=this.picker.dateTime.getRows(),this.main||this._init();var t="D"===this.type;this.picker.head.innerHTML='<div class="picker-hour'+(t?" picker-head-active":"")+'"'+(t?"":' data-click="toHours" data-active="active"')+">"+Jh.formatDate(this.picker.dateTime.now,"HH")+'</div>:<div class="picker-minute'+(t?"":" picker-head-active")+'"'+(t?' data-click="toMinutes" data-active="active"':"")+">"+Jh.formatDate(this.picker.dateTime.now,"mm")+"</div>",this.main.innerHTML=Ep[this.type](this.picker.dateTime,this.rows)},afterRender:function(){this.headHourEle=this.picker.head.querySelector(".picker-hour"),this.headMinuteEle=this.picker.head.querySelector(".picker-minute"),this.headActiveEle=this.picker.head.querySelector(".picker-head-active"),this.activeEle=this.main.querySelector(".picker-active"),this.pickerLineEle=this.main.querySelector(".time-picker-line")},_init:function(){this._initMain()},_initMain:function(){this.main=Jh.createElement("div",{className:"time-picker-main "+("D"===this.type?"time-picker-main-hours":"time-picker-main-minutes")}),this.mainStyle=this.main.style,this.picker.content.appendChild(this.main)},show:function(){this.mainStyle.display="block"},hide:function(){this.mainStyle.display="none"},selfChange:function(){var t=Jh.formatDate(this.picker.dateTime.now,"HH"),e=Jh.formatDate(this.picker.dateTime.now,"mm");this.headHourEle.innerHTML=t,this.headMinuteEle.innerHTML=e;var n=this.picker.dateTime.getLevelValue(),i=this.main.querySelector('.picker-cell[data-val="'+n+'"]');this.activeEle&&this.activeEle.classList.remove("picker-active"),i.classList.add("picker-active"),this.activeEle=i;var o=+i.style[Jh.prefixNames.transform].match(/rotate\((-?\d+)deg\)/)[1];o-=90,this.pickerLineEle.style[Jh.prefixNames.transform]="rotate("+o+"deg)",this.pickerLineEle.classList[i.classList.contains("picker-cell-inner")?"add":"remove"]("time-picker-line-inner")},_start:function(t){var e=this,n=null,i=function(t){var i=document.elementFromPoint(t.pageX,t.pageY);i&&(i.classList.contains("picker-cell")||(i=i.parentElement)&&i.classList.contains("picker-cell"))&&(n=i,e.picker.changeTo(i.getAttribute("data-val"),!0))};i(t.touches[0]),this.__move=function(t){i(t.touches[0])},this.__end=function(t){this.__move=null,this.__end=null,n&&e.picker.selV({realTarget:n})}},destroy:function(){this.picker.content.removeChild(this.main),Jh.set2Null(["picker","main","mainStyle","headHourEle","headMinuteEle","headActiveEle","activeEle","pickerLineEle","__move","__end"],this)}});var xp=wp;function Tp(t,e,n){return e||(e=function(t,e,n){return'<i style="'+n(e,!0)+'">'+t+"</i>"}),n||(n=function(t){return t.length}),function(i,o){var r=o.length,s=n(o),a=s!==r,l=360/s,c="",d=1,h="minutes"===t;h&&(c+="time-picker-minutes-"+(d=i.options.minuteStep||5));var p=function(t,e){var n=l*t,i="";return e&&(n=-n,i="translate(-50%, -50%) "),"-webkit-transform:"+(i+="rotate("+n+"deg)")+";transform:"+i+";"},u=Jh.date2Details(i.options.min),f=Jh.date2Details(i.options.max),m=i.parsedNow[t],g="",y="";return'<ul class="'+c+'">'+o.map(function(t,n){var o=t[0],r="";if(o===m){r=" picker-active";var s="rotate("+(l*n-90)+"deg)";g="-webkit-transform:"+s+";transform:"+s,a&&(!o||o>12)&&(y+=" time-picker-line-inner")}return d>1&&n%d!=0?"":(function(t){if(h){var e=i.parsedNow.hours;return e===u.hours?t<u.minutes:e===f.hours&&t>f.minutes}return t<u.hours||t>f.hours}(o)&&(r+=" picker-disabled"),a&&(!o||o>12)&&(r+=" picker-cell-inner"),'<li class="picker-cell'+r+'" data-click="selV" data-val="'+o+'" style="'+p(n)+'">'+e(o,n,p)+"</li>")}).join("")+'</ul><div class="time-picker-line'+y+'" style="'+g+'"></div>'}}function Ap(){dp.apply(this,arguments)}dp.extend(Ap,{init:function(){this.needDefFormat&&(this.options.format="HH:mm");var t=this.options.minuteStep;t||(t=5),1!==t&&5!==t&&10!==t&&(t=5),Jh.extend(this.options,{type:"D",minuteStep:t}),this.panel=this.hoursPanel=new xp(this)},initEle:function(){this.ele.classList.add("time-picker-container")},_selV:function(t){var e=this;this.super._selV.call(this,t),setTimeout(function(){e.toMinutes()})},_to:function(t,e){this.options.type!==t&&(Jh.extend(this.options,{type:t}),this.panel.hide(),this[e]?this[e].show():this[e]=new xp(this),this.panel=this[e],this.setDateTime())},toHours:function(){this._to("D","hoursPanel")},toMinutes:function(){this._to("H","minutesPanel")}});var kp=Ap;tp.Date=vp,tp.Time=kp;var _p=tp;let Cp;const Sp=["text","date","time","multi-text"],Mp=new Date,Op={lang:"zh-CN",format:"yyyy-MM-dd",default:`${Mp.getFullYear()}-${Mp.getMonth()+1}-${Mp.getDate()}`,min:"1970-01-01",max:"2100-12-31"};let Dp=0;const Lp={create(){const t=document.createElement("span"),e=this.type;this.className="hap-ipt-"+Dp,this.styleId="hap-style-"+Dp,t.classList.add("hap-element"),t.style.fontSize="32px",t.style.alignSelf="center";const n=this.data.attr;let i;switch(this.textPickerData={range:n.range,seleted:n.seleted,value:n.value,uid:Dp},-1===Sp.indexOf(e)&&console.log(`使用了${e}, picker 组件支持的type类型为:${JSON.stringify(Sp)}`),e){case"text":case"multi-text":i=new bh(this.textPickerData),this.extendHandler(i),t.setAttribute("data-type","text");break;case"date":this.dateOptions=Ip("date",n),t.setAttribute("data-type","date");break;case"time":this.timeOptions=Ip("time",n),t.setAttribute("data-type","date")}return this.processHandler=i,t},onAppend(){this.node.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),this.show()}),Cp.prototype.onAppend.call(this)},extendHandler(t){const e=this;t.yes=function(){e.result=this.scrollerResult,e.dispatchEvent("change")},t.cancel=function(){e.dispatchEvent("cancel")},t.onSelect=function(t){e.columnsResult=t,e.dispatchEvent("columnchange",{column:t.column,newValue:t.value,newSelected:t.index})}},extendDateTimeHandler(t,e){t.on("selected",(n,i)=>{let o;o="date"===e?{year:i.getFullYear(),month:i.getMonth(),day:i.getDate()}:{hour:i.getHours(),minute:i.getMinutes()},this.dispatchEvent("change",o),t.destroy()}).on("canceled",()=>{this.dispatchEvent("cancel"),t.destroy()})},show(){let t=this.processHandler;t?t.show():"date"===this.type?(t=new _p.Date(this.dateOptions),this.extendDateTimeHandler(t,"date")):"time"===this.type&&(t=new _p.Time(this.timeOptions),this.extendDateTimeHandler(t,"time"))}};function Ip(t,e){if("date"===t){const t=Pp(e.start)||Op.start,n=Pp(e.end)||Op.end;return{default:Pp(e.selected)||Op.default,min:t,max:n,lang:Op.lang}}if("time"===t)return{default:Np(e.selected),minuteStep:1,lang:Op.lang}}function Pp(t){if(void 0===t||""===t)return null;const e=new Date(t);return isNaN(e.getTime())?(console.warn(`### Web Render ### 日期值(${t})不正确,日期格式应当为“yyyy-MM-dd”, 请检查!`),null):`${e.getFullYear()}-${Rp(e.getMonth()+1)}-${Rp(e.getDate())}`}function Np(t){if(void 0===t||""===t){const t=new Date;return`${t.getHours()}:${t.getMinutes()}`}const e=t.match(/^(\d{2}):(\d{2})$/);return null===e||e[1]>23||t[2]>59?(console.warn(`### Web Render ### 时间值(${t})不正确,时间格式应当为“hh:mm”, 请检查!`),null):t}function Rp(t){return t<10&&(t="0"+t),t}const Fp={value:function(t){if("multi-text"!==this.type)this.node.innerHTML=t;else{const e="string"==typeof(t=t||"[]")?JSON.parse(t).join(" "):t.join(" ");this.node.innerHTML=e}},range:function(t){this.processHandler&&"[object Array]"===Object.prototype.toString.call(t)&&(this.textPickerData.range=t,this.processHandler.updateData(this.textPickerData))},seleted:function(t){this.processHandler&&(this.textPickerData.selected=t,this.processHandler.updateData(this.textPickerData))}},Bp={change:{extra(){const t=this.type,e=this.result,n={newValue:e.value,newSelected:e.index};switch(t){case"text":return n;case"multi-text":return{newValue:Array.prototype.slice.call(e.value,0),newSelected:Array.prototype.slice.call(e.index,0)};default:return n}}}};var jp={init:function(t){Cp=t.Atomic;const e=t.utils.extend;function n(t){Dp++,this.type=t.attr.type,this.result={},Cp.call(this,t)}n.prototype=Object.create(Cp.prototype),e(n.prototype,Lp),e(n.prototype,{attr:e(Object.create(Cp.prototype.attr),Fp)}),e(n.prototype,{event:Bp}),t.registerComponent("picker",n)}};t(".mdui-select{position:relative;display:inline-block;max-width:100%;height:36px;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;padding-right:24px;padding-left:0;font-family:Roboto,Noto,Helvetica,Arial,sans-serif;font-size:16px;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Cpath d='M-.003 2.5l5 5 5-5h-10z' opacity='.54'/%3E%3C/svg%3E\");background-repeat:no-repeat;background-size:24px;background-position:100%;border:none;outline:none;-webkit-transition-timing-function:cubic-bezier(.4,0,.2,1);transition-timing-function:cubic-bezier(.4,0,.2,1);-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-property:background-color,background-position-x,-webkit-box-shadow;transition-property:background-color,background-position-x,-webkit-box-shadow;transition-property:background-color,box-shadow,background-position-x;transition-property:background-color,box-shadow,background-position-x,-webkit-box-shadow;-moz-appearance:none;appearance:none;will-change:background-color,box-shadow,background-position-x;pointer-events:auto}.mdui-select.mdui-select-open{border-bottom:none}.mdui-select-position-top{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Cpath d='M10.003 7.5l-5-5-5 5h10z' opacity='.54'/%3E%3C/svg%3E\")}.mdui-select-open.mdui-select-position-bottom,.mdui-select-open.mdui-select-position-top{z-index:99999;border-radius:2px}.mdui-select-open.mdui-select-position-top{border-top:1px solid rgba(0,0,0,.12);border-bottom:2px solid transparent;border-top-left-radius:0;border-top-right-radius:0;-webkit-box-shadow:0 10px 10px -3px rgba(0,0,0,.2),0 0 14px 1px rgba(0,0,0,.14),0 -7px 24px 2px rgba(0,0,0,.12);box-shadow:0 10px 10px -3px rgba(0,0,0,.2),0 0 14px 1px rgba(0,0,0,.14),0 -7px 24px 2px rgba(0,0,0,.12)}.mdui-select-open.mdui-select-position-top .mdui-select-menu{border-bottom-right-radius:0;border-bottom-left-radius:0;-webkit-box-shadow:0 -4px 4px -2px rgba(0,0,0,.06),8px 0 8px -4px rgba(0,0,0,.12),-8px 0 8px -4px rgba(0,0,0,.12);box-shadow:0 -4px 4px -2px rgba(0,0,0,.06),8px 0 8px -4px rgba(0,0,0,.12),-8px 0 8px -4px rgba(0,0,0,.12)}.mdui-select-open.mdui-select-position-bottom{border-bottom-right-radius:0;border-bottom-left-radius:0}.mdui-select-open.mdui-select-position-bottom .mdui-select-menu{border-top-left-radius:0;border-top-right-radius:0}.mdui-select-selected{position:absolute;top:50%;right:24px;left:0;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-transition:left .2s cubic-bezier(0,0,.2,1);transition:left .2s cubic-bezier(0,0,.2,1);-webkit-transform:translateY(-50%);transform:translateY(-50%)}.mdui-select-open.mdui-select-position-auto .mdui-select-selected{visibility:hidden}.mdui-select-menu{position:relative;z-index:99999;height:36px;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 -24px 0 0;overflow-y:scroll;-webkit-overflow-scrolling:touch;color:rgba(0,0,0,.87);cursor:default;visibility:hidden;background-color:#fff;border-radius:2px;-webkit-box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);box-shadow:0 5px 5px -3px rgba(0,0,0,.2),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12);opacity:0;-webkit-transition-timing-function:cubic-bezier(0,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1);-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-property:opacity,visibility,-webkit-transform;transition-property:opacity,visibility,-webkit-transform;transition-property:transform,opacity,visibility;transition-property:transform,opacity,visibility,-webkit-transform;-webkit-transform:scaleY(0);transform:scaleY(0);will-change:transform,opacity,visibility}.mdui-select-open .mdui-select-menu{overflow-y:hidden;visibility:visible;opacity:1;-webkit-transform:scale(1);transform:scale(1)}.mdui-select-closing .mdui-select-menu{overflow-y:hidden;visibility:visible;-webkit-box-shadow:none;box-shadow:none;opacity:0;-webkit-transform:scale(1);transform:scale(1)}.mdui-select-menu-item{height:48px;overflow:hidden;line-height:48px;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.mdui-select-menu-item:hover{background-color:#eee}.mdui-select-menu-item[disabled]{color:rgba(0,0,0,.38)!important;cursor:default}.mdui-select-menu-item[disabled]:hover{background-color:inherit!important}select.mdui-select{background-color:transparent}select.mdui-select option{color:rgba(0,0,0,.87)}select.mdui-select::-ms-expand{display:none}",void 0);const Hp=function(){const t={position:"bottom",gutter:16};function e(e,n){const i=this;(i.$selectNative=e).style.display="none",i.options=Object.assign(t,n||{}),i.uniqueID=Math.floor(1e13*Math.random())+Date.now(),i.state="closed",i.handleUpdate();const o=function(t){const e=t.target;"opening"!==i.state&&"opened"!==i.state||e===i.$select||i.$select.contains(e)||i.close()};document.addEventListener("click",o),document.addEventListener("touchstart",o)}e.prototype.handleUpdate=function(){const t=this;"opening"!==t.state&&"opened"!==t.state||t.close();const e=t.$selectNative;t.value=e.value,t.text="",t.$menu=document.createElement("div"),t.$menu.classList.add("mdui-select-menu");const n=function(n){if("closing"===t.state)return;const i=n.target;if(i.disabled)return;t.$selected.innerText=i.text,e.value=i.value,t.$items[t.selectedIndex].removeAttribute("selected"),i.setAttribute("selected",""),t.selectedIndex=i.index,t.value=i.value,t.text=i.text;const o=document.createEvent("HTMLEvents");o.initEvent("change",!0,!0),e.dispatchEvent(o),t.close()};for(let i=0;i<e.options.length;i++){const o=e.options[i],r={value:o.value,text:o.textContent,disabled:o.disabled,selected:t.value===o.value,index:i};t.value===r.value&&(t.text=r.text,t.selectedIndex=i);const s=document.createElement("div");s.classList.add("mdui-select-menu-item"),s.classList.add("mdui-ripple"),s.innerText=r.text,r.disabled?s.setAttribute("disabled",""):s.removeAttribute("disabled"),r.selected?s.setAttribute("selected",""):s.removeAttribute("selected"),Object.assign(s,r),s.addEventListener("click",n),t.$menu.appendChild(s)}t.$items=t.$menu.children,t.$selected=document.createElement("span"),t.$selected.classList.add("mdui-select-selected"),t.$selected.innerText=t.text,t.$select=document.createElement("div"),t.$select.classList.add("mdui-select"),t.$select.classList.add("mdui-select-position-"+t.options.position),t.$select.setAttribute("style",t.$selectNative.getAttribute("style")),t.$select.setAttribute("id",t.uniqueID),t.$select.style.display="",t.$select.appendChild(t.$selected),t.$select.appendChild(t.$menu);const i=document.getElementById(t.uniqueID);i&&i.parentNode&&i.parentNode.removeChild(i),e.parentNode&&e.parentNode.insertBefore(t.$select,null),t.size=parseInt(e.options.length),(!t.size||t.size<0)&&(t.size=t.$items.length,t.size>8&&(t.size=8)),t.$select.addEventListener("click",function(e){const n=e.target;n.classList.contains("mdui-select-menu")||n.classList.contains("mdui-select-menu-item")||t.toggle()})};const n=function(t){t.$select.classList.remove("mdui-select-closing"),"opening"===t.state&&(t.state="opened",t.$menu.style.overflowY="auto"),"closing"===t.state&&(t.state="closed",t.$menu.style.marginTop="",t.$menu.style.height="",t.$menu.style.width="")};function i(t){const e=["webkitTransitionEnd","transitionend"];let n;const i=this;function o(r){if(r.target===this)for(t.call(this,r),n=0;n<e.length;n++)i.removeEventListener(e[n],o)}if(t)for(n=0;n<e.length;n++)i.addEventListener(e[n],o);return this}return e.prototype.open=function(){const t=this;"opening"!==t.state&&"opened"!==t.state&&(t.state="opening",function(t){const e=t.options.position,n=parseInt(t.$select.clientHeight),i=t.$items.item(0),o=parseInt(i.clientHeight),r=parseInt(i.style.marginTop||0),s=parseFloat(t.$select.clientWidth+.01),a=o*t.size+2*r;let l,c;"bottom"===e&&(c=n,l="0px"),t.$select.style.width=s+"px",t.$menu.style.width=s+"px",t.$menu.style.height=a+"px",t.$menu.style.marginTop=c+"px",t.$menu.style.transformOrigin="center "+l+" 0"}(t),t.$select.classList.add("mdui-select-open"),i.call(t.$menu,function(){n(t)}))},e.prototype.close=function(){const t=this;"closing"!==t.state&&"closed"!==t.state&&(t.state="closing",t.$menu.style.overflowY="",t.$select.classList.remove("mdui-select-open"),t.$select.classList.add("mdui-select-closing"),i.call(t.$menu,function(){n(t)}))},e.prototype.toggle=function(){const t=this;"opening"===t.state||"opened"===t.state?t.close():"closing"!==t.state&&"closed"!==t.state||t.open()},e}();function $p(t){const e=t.Component;return{create:()=>document.createElement("select"),appendChild(t){const n=t.type;if("option"!==n)return void console.warn('### Web Render ### invalid child type "'+n+'" for select.');const i=e.prototype.appendChild.call(this,t),o=this.data.children;return t.ref===o[o.length-1].ref&&(this.select.handleUpdate(),this.initialized=!0),i},removeChild(t){e.prototype.removeChild.call(this,t),this.select.handleUpdate()},insertBefore(t,n){const i=t.data.type;"option"===i?(e.prototype.insertBefore.call(this,t,n),this.select.handleUpdate()):console.warn('### Web Render ### invalid child type "'+i+'" for select.')},onAppend(){this.select=new Hp(this.node);const t=this.getParent();t&&("0"===global.getComputedStyle(t.node).getPropertyValue("z-index")&&(t.node.style.zIndex="1"),t.node.classList.contains("hap-div")&&(t.node.style.overflow="unset"))}}}const zp={disabled:function(t){this.node.disabled=t&&"false"!==t,this.select&&this.select.handleUpdate()}},Yp={change:{extra:function(){return{newValue:this.node.value,timestamp:Date.now()}}}};var Wp={init:function(t){const e=t.Component,n=t.utils.extend;function i(t){e.call(this,t)}i.prototype=Object.create(e.prototype),n(i.prototype,$p(t)),n(i.prototype,{attr:n(Object.create(e.prototype.attr),zp)}),n(i.prototype,{event:Yp}),t.registerComponent("select",i)}};const Vp={create(){const t=document.createElement("option");return t.style.pointerEvents="auto",t}},Up={disabled:function(t){this.node.disabled=t&&"false"!==t,this.getParent()&&this.getParent().initialized&&this.getParent().select&&this.getParent().select.handleUpdate()},value:function(t){this.node.setAttribute("value",t),this.getParent()&&this.getParent().initialized&&this.getParent().select&&this.getParent().select.handleUpdate()},selected:function(t){this.node.selected=t&&"false"!==t,this.getParent()&&this.getParent().initialized&&this.getParent().select&&this.getParent().select.handleUpdate()},content:function(t){this.node.innerText=t,this.node.setAttribute("content",t),this.getParent()&&this.getParent().initialized&&this.getParent().select&&this.getParent().select.handleUpdate()}};var qp={init:function(t){const e=t.Component,n=t.utils.extend;function i(t){this.options=[],this.selectedIndex=0,e.call(this,t)}i.prototype=Object.create(e.prototype),n(i.prototype,Vp),n(i.prototype,{attr:n(Object.create(e.prototype.attr),Up)}),t.registerComponent("option",i)}};t(".hap-video{background-color:#000;height:100%}",void 0);const Gp={playStatus(t){"play"!==t&&"stop"!==t&&"pause"!==t&&(t="pause"),this.playStatus!==t&&(this.playStatus=t,this.node.setAttribute("play-status",t),this[this.playStatus]())},autoplay(t){},muted(t){this.node.setAttribute("muted",t),this.node.muted=t}};var Jp={init:function(t){const e=t.Atomic,n=t.utils.extend;function i(t){const n=t.attr.autoplay,i=t.attr.playStatus;this.autoPlay=!0===n||"true"===n,this.playStatus="play"!==i&&"stop"!==i&&"pause"!==i?"pause":i,e.call(this,t)}i.prototype=Object.create(e.prototype),n(i.prototype,function(t){const e=t.Atomic;return{create(){const t=document.createElement("video");return t.classList.add("hap-video"),t.classList.add("hap-element"),t.controls=!0,t.autoplay=this.autoPlay,t.setAttribute("playsinline",""),t.setAttribute("webkit-playsinline",""),t.setAttribute("play-status",this.playStatus),this.node=t,this.autoPlay&&"play"===this.playStatus&&setTimeout(()=>{this.play()},0),t},bindEvents(t){e.prototype.bindEvents.call(this,t);const n={prepared:"loadedmetadata",finish:"ended"};for(const t in n)this.node.addEventListener(n[t],function(t,e){this.dispatchEvent(t,e.data)}.bind(this,t))},start(){let t=this.node.getAttribute("src");t||(t=this.node.getAttribute("data-src"))&&this.node.setAttribute("src",t);try{this.node.play()}catch(t){}},pause(){this.node.pause()},stop(){this.node.pause(),this.node.autoplay=!1,this.node.setAttribute("data-src",this.node.src),this.node.src=""},setCurrentTime({currenttime:t}){this.node.currentTime=t},requestFullscreen(){this.node.requestFullscreen()},exitFullscreen(){try{(document.IsFullScreen||document.webkitIsFullScreen)&&document.exitFullscreen()}catch(t){console.error(t)}}}}(t)),n(i.prototype,{attr:n(Object.create(e.prototype.attr),Gp)}),t.registerComponent("video",i)}};let Kp;t(".hap-switch-container{display:flex;align-items:center;align-self:center;height:42px}.hap-switch{background-color:#bcbabd;cursor:pointer;display:inline-block;border-radius:17px;position:relative;align-self:center;vertical-align:middle;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;box-sizing:content-box;background-clip:content-box;pointer-events:auto}.hap-switch-inner{width:40px;height:40px;background:#ececec;border-radius:100%;-webkit-box-shadow:0 .013333rem .04rem rgba(0,0,0,.4);box-shadow:0 .013333rem .04rem rgba(0,0,0,.4);position:absolute;top:-5px;left:0;-webkit-transition:background-color .4s,left .2s;transition:background-color .4s,left .2s}",void 0);const Zp={color:"#C4E2DE",secondaryColor:"#BCBABD",jackColor:"#439286",jackSecondaryColor:"#ECECEC",className:"hap-switch",disabledOpacity:.5,speed:"0.4s",width:100,height:60,scalable:!1};function Qp(t,e){const n=[];for(const t in e)n.push(t+" "+e[t]);t.style.transition=n.join(", "),t.style.webkitTransition=n.join(", ")}function Xp(t,e){let n=t.checked;const i=t.switchWrap,o=t.jack;e&&n?n=!1:e&&!n&&(n=!0),!0===n?(t.checked=!0,window.getComputedStyle?o.style.left=parseInt(window.getComputedStyle(i).width)-parseInt(window.getComputedStyle(o).width)+"px":o.style.left=parseInt(i.currentStyle.width)-parseInt(o.currentStyle.width)+"px",t.options.color&&function(t){const e=t.switchWrap.offsetHeight/2;t.switchWrap.style.backgroundColor=t.options.color,t.switchWrap.style.borderColor=t.options.color,t.switchWrap.style.boxShadow="inset 0 0 0 "+e+"px "+t.options.color,t.jack.style.backgroundColor=t.options.jackColor}(t),tu(t)):(t.checked=!1,o.style.left=0,i.style.boxShadow="inset 0 0 0 0 "+t.options.secondaryColor,i.style.borderColor=t.options.secondaryColor,i.style.backgroundColor=t.options.secondaryColor!==Zp.secondaryColor?t.options.secondaryColor:Zp.secondaryColor,o.style.backgroundColor=t.options.jackSecondaryColor!==t.options.jackColor?t.options.jackSecondaryColor:t.options.jackColor,tu(t))}function tu(t){let e={};const n={"background-color":t.options.speed,left:t.options.speed.replace(/[a-z]/,"")/2+"s"};e=t.checked?{border:t.options.speed,"box-shadow":t.options.speed,"background-color":3*t.options.speed.replace(/[a-z]/,"")+"s"}:{border:t.options.speed,"box-shadow":t.options.speed},Qp(t.switchWrap,e),Qp(t.jack,n)}function eu(t){return t._clickHandler||(t._clickHandler=function(){Xp(t,!0),t.dispatchEvent("change",{value:t.checked})}),t._clickHandler}const nu={create(){const t=document.createElement("div"),e=document.createElement("span");return this.jack=document.createElement("small"),this.jack.className="hap-switch-inner",this.switchWrap=e,e.appendChild(this.jack),t.appendChild(e),t.classList.add("hap-switch-container"),e.className=this.options.className,e.style.width="70px",e.style.height="30px",e.style.marginLeft="50px",this.attr.disabled.call(this,this.data.attr&&this.data.attr.disabled),t},onAppend(){Xp(this),Kp.prototype.onAppend.call(this)},enable(){this.disabled&&(this.disabled=!1),this.switchWrap.style.opacity=1,this.switchWrap.addEventListener("click",eu(this))},disable(){!this.disabled&&(this.disabled=!0),this.switchWrap.style.opacity=Zp.disabledOpacity,this.switchWrap.removeEventListener("click",eu(this))}},iu={disabled:function(t){this.disabled=t&&"false"!==t,this.disabled?this.disable():this.enable()},checked(t){this.checked=!0===t||"true"===t,Xp(this)}},ou={width:function(t){return!1},height:function(t){return!1}},ru={change:{updator(){return{attrs:{checked:this.checked}}},extra(){return{checked:this.checked}}}};var su={init:function(t){Kp=t.Atomic;const e=t.utils.extend;function n(t){this.options=e({},Zp),this.checked=!1,this.data=t,this.width=this.options.width,this.height=this.options.height,Kp.call(this,t)}n.prototype=Object.create(Kp.prototype),e(n.prototype,nu),e(n.prototype,{attr:e(Object.create(Kp.prototype.attr),iu)}),e(n.prototype,{style:e(Object.create(Kp.prototype.style),ou)}),e(n.prototype,{event:ru}),t.registerComponent("switch",n)}};const au={href:function(t){if(!t)return console.warn("[web-render] href of <a> should not be a null value.");this.href=t,this.node.setAttribute("href",t);const e=t.split("?");if(-1===t.indexOf("http")&&e.length>1){this.uri=e[0];const t=e[1]&&e[1].split("&"),n={};for(let e=0;e<t.length;e++){const i=t[e].split("=");i.length>1&&(n[i[0]]=i[1])}this.params=n}else this.uri=t,this.params={}},value:function(t){this.node.innerHTML="",null!=t&&""!==t&&(this.node.textContent=t)}},lu={lines:function(t){if(t=parseInt(t),!isNaN(t))if(t<=0)this.node.style.textOverflow="",this.node.style.overflow="visible",this.node.style.webkitLineClamp="";else{const e=this.data?this.data.style:null;this.node.style.overflow="hidden",this.node.style.textOverflow=e?e.textOverflow:"clip",this.node.style.webkitLineClamp=t}}};var cu={init:function(t){const e=t.Component,n=t.utils.extend;function i(t){e.call(this,t)}i.prototype=Object.create(e.prototype),n(i.prototype,function(t){const e=t.Component;return{create(){const t=document.createElement("a");return t.classList.add("hap-a"),this._getProps("_isInText")||t.classList.add("hap-text"),t.style.color="grey",t.style.textDecoration="none",t},bindEvents(t){e.prototype.bindEvents.call(this,t),this.node.addEventListener("click",function(t){t._alreadyFired&&t.target!==this.node||(t._alreadyFired=!0,t.preventDefault(),this.uri&&cr.navigateTo({uri:this.uri,params:this.params},"push"))}.bind(this))}}}(t)),n(i.prototype,{attr:n(Object.create(e.prototype.attr),au)}),n(i.prototype,{style:n(Object.create(e.prototype.style),el,lu)}),t.registerComponent("a",i)}};let du;function hu(t){const e=t.Atomic;return{create(){const t=document.createElement("web");return t.classList.add("hap-web"),this.web=document.createElement("iframe"),t.appendChild(this.web),this.web.classList.add("hap-element"),this.web.style.border="none",this.web.style.width="-webkit-fill-available",this.web.style.height="-webkit-fill-available",t.style.width="-webkit-fill-available",t.style.height="-webkit-fill-available",t},bindEvents(t){e.prototype.bindEvents.call(this,t);const n=this;this.web.addEventListener("load",function(t){n.dispatchEvent("pagefinish",{url:n.web.src})}),window.addEventListener("message",function(t,e){let n=e.data;if("string"==typeof n)try{n=JSON.parse(n)}catch(t){}if(n&&"hap"===n.type){if(!du(n.content))return console.error("### Web Render ### hap msg received by web component. msg.content should be a array:",n.content);callNative(t.getComponentManager().instanceId,n.content)}}.bind(null,this))},reload(){this.web.contentWindow.location.reload()},forward(){this.web.contentWindow.history.forward()},back(){this.web.contentWindow.history.back()},canForward:({callback:t},e)=>(e&&e(t),[!0]),canBack:({callback:t},e)=>(e&&e(t),[!0]),postMessage({message:t}){this.web.contentWindow.postMessage(t,"*")}}}const pu={src:function(t){this.web.src=t,setTimeout(function(){this.dispatchEvent("pagestart",{url:t})}.bind(this),0)}};var uu={init:function(t){const e=t.Atomic,n=t.utils.extend;function i(t){e.call(this,t)}du=t.utils.isArray,i.prototype=Object.create(e.prototype),n(i.prototype,hu(t)),n(i.prototype,{attr:n(Object.create(e.prototype.attr),pu)}),t.registerComponent("web",i)}};const fu={create(){const t=document.createElement("rich-text");return t.classList.add("hap-richtext"),t}},mu={value(t){this.value=t,this.node.setContent(t)}};var gu={init:function(t){const e=t.Atomic,n=t.utils.extend;function i(t){e.call(this,t)}i.prototype=Object.create(e.prototype),n(i.prototype,fu),n(i.prototype,{attr:mu}),t.registerComponent("richtext",i),window.customElements.define("rich-text",class extends window.HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}setContent(t){this.shadowRoot.innerHTML=t}})}};const yu={value:function(t){this.node.innerHTML="",null!=t&&""!==t&&(this.node.textContent=t)}};var bu={init:function(t){const e=t.Component,n=t.utils.extend;function i(t,n){e.call(this,t,n)}i.prototype=Object.create(e.prototype),n(i.prototype,{attr:n(Object.create(e.prototype.attr),yu)}),n(i.prototype,{style:n(Object.create(e.prototype.style),el)}),t.registerComponent("span",i)}};const vu={create(){const t=document.createElement("label");return t.classList.add("hap-text"),t.style.fontSize="32px",t}},Eu={value:function(t){this.node.innerHTML="",null!=t&&""!==t&&(this.node.textContent=t)},target:function(t){null!=t&&""!==t&&this.node.setAttribute("for",t)}};var wu={init:function(t){const e=t.Component,n=t.utils.extend;function i(t,n){e.call(this,t,n)}i.prototype=Object.create(e.prototype),n(i.prototype,vu),n(i.prototype,{attr:n(Object.create(e.prototype.attr),Eu)}),t.registerComponent("label",i)}};const xu={},Tu={height:function(t){t&&t.indexOf("px")>-1&&(this.node.height=parseInt(t)),this.node.style.height=t},width:function(t){t&&t.indexOf("px")>-1&&(this.node.width=parseInt(t)),this.node.style.width=t}};var Au={init:function(t){const e=t.Atomic,n=t.utils.extend,i=global.CanvasRenderingContext2D.prototype.drawImage;function o(t){e.call(this,t)}global.CanvasRenderingContext2D.prototype.drawImage=function(...t){if("image"===t[0].type&&t[0].attr.id){const e=global.document.getElementById(t[0].attr.id).children[0];t[0]=e,e.onload=function(){i.apply(this,t)}.bind(this)}else i.apply(this,t)},o.prototype=Object.create(e.prototype),n(o.prototype,{create:()=>document.createElement("canvas"),getContext(t){return this.node.getContext(t)},toTempFilePath(t={}){console.warn("### Web Render ### canvas => toTempFilePath() ==目前预览暂不支持该功能,请使用真机调试体验完整功能==")},onAppend(){this.data.style&&this.data.style.width||(this.node.width=this.node.parentNode.clientWidth),this.data.style&&this.data.style.height||(this.node.height=this.node.parentNode.clientHeight)}}),n(o.prototype,{attr:n(Object.create(e.prototype.attr),xu)}),n(o.prototype,{style:n(Object.create(e.prototype.style),Tu)}),t.registerComponent("canvas",o)}};let ku;t(".BMap_Marker img{max-width:100%}",void 0);let _u=0,Cu=!1,Su=[],Mu=[];const Ou="A8r1WFB2FfrBYzfUE5PYz3pB6mKYiohn",Du={latitude:39.90886,longitude:116.39739,scale:11,rotate:0,showmylocation:!1},Lu={textAlign:"center",display:"byclick",backgroundColor:"#fff",color:"#000",border:"nonoe"},Iu={strokeColor:"#666",strokeWeight:50,strokeStyle:"solid",strokeOpacity:1},Pu={strokeColor:"#666",strokeWeight:5,fillColor:"#666"},Nu={strokeColor:"#666",fillColor:"#666",strokeWeight:0,fillOpacity:1,strokeOpacity:1};function Ru(t){return t-1}Su.push(function(){global.CustomControl=class extends BMap.Control{constructor(t,e){super(),this.defaultAnchor=BMAP_ANCHOR_TOP_RIGHT,this.defaultOffset=new BMap.Size(10,10),this.opt=t,this.hapInstance=e}initialize(t){const e=this.opt,n=this.hapInstance,i=document.createElement("div"),o=document.createElement("img");return o.style.position="fixed",o.classList.add("hap-map-customcontrol"),o.src=e.iconPath,e.position&&this.setPosition(o,e.position),e.clickable&&(o.style.cursor="pointer",o.onclick=function(t){e.id&&n.dispatchEvent("controltap",{controlId:e.id})}),i.appendChild(o),t.getContainer().appendChild(i),i}setPosition(t,e){e.left?t.style.left=`${ai(e.left)}`:e.right&&(t.style.right=`${ai(e.right)}`),e.top?t.style.top=`${ai(e.top)}`:e.bottom&&(t.style.bottom=`${ai(e.bottom)}`),e.width&&(t.style.width=`${ai(e.width)}`),e.height&&(t.style.height=`${ai(e.height)}`)}}});const Fu={create:function(){const t=document.createElement("map");return t.setAttribute("data-id",this.id),t.style.pointerEvents="auto",t},onAppend(){this.initMap(),ku.prototype.onAppend.call(this)},initMap(){this.bridge(()=>{const t=this.options,e=new BMap.Map(this.id),n=new BMap.Convertor;this.convertor=n,this.translate(new BMap.Point(t.longitude,t.latitude),this.coordType).then(n=>{const i=n[0];e.centerAndZoom(i,Ru(t.scale)),e.enableScrollWheelZoom(),this.mapInstance=e,this.markers=[],this.polylines=[],this.polygons=[],this.groundoverlays=[],e.addEventListener("click",t=>{this.dispatchEvent("tap",[{latitude:t.point.lat,longitude:t.point.lng}])}),e.addEventListener("dragend",t=>{this.dispatchEvent("regionchange",[{coordType:"gcj02",latitude:t.point.lat,longitude:t.point.lng}])}),e.addEventListener("zoomend",t=>{console.log("### Web Render ### web预览的缩放不支持获取坐标参数"),this.dispatchEvent("regionchange",[{coordType:"gcj02",latitude:void 0,longitude:void 0}])}),Mu.forEach(t=>{t.call(this)})})})},bridge(t){Cu?t.call(this):Su.push(t)},afterInit(t){this.mapInstance?t.call(this):Mu.push(t)},translate(t,e,n){return new Promise((i,o)=>{const r=this.convertor;let s=5;const a=e?"GCJ02"===e.toUpperCase()?3:1:3;n&&("GCJ02"===(n=n.toUpperCase())?s=3:"WGS84"===n&&(s=1));const l=Xn(t)?t:[t];r.translate(l,a,s,t=>{0===t.status?i(t.points):(console.log("### Web Render ### 坐标系转化失败"),o())})})},translateArray(t){return new Promise((e,n)=>{const i=this.convertor,o=[];let r=0;const s=t.length;t.forEach((t,a)=>{const l=new BMap.Point(t.longitude,t.latitude),c=t.coordType?"GCJ02"===t.coordType.toUpperCase()?3:1:3;i.translate([l],c,5,t=>{0===t.status?(o[a]=t.points[0],++r===s&&e(o)):(console.log("### Web Render ### 坐标系转化失败"),n())})})})}},Bu={convertCoord(t,e){let n="GCJ02";t.from&&"wgs84"!==t.from&&console.log("### Web Render ### convertCoord from 属性只支持wgs84"),t.to&&("wgs84"===t.to||"gcj02"===t.to?n=t.to:console.log("### Web Render ### convertCoord to 属性只支持wgs84, gcj02")),this.afterInit(()=>{this.translate(new BMap.Point(t.longitude,t.latitude),"wgs84",n).then(n=>{const i=n[0];e(t.success,[{latitude:i.lat,longitude:i.lng}]),e(t.complete)}).catch(()=>{e(t.fail)})})},getCenterLocation({success:t,fail:e,complete:n},i){this.afterInit(()=>{const e=this.mapInstance.getCenter();i(t,[{latitude:e.lat,longitude:e.lng}]),i(n)})},getCoordType({success:t,fail:e,complete:n},i){i(t,[{coordType:"gcj02"}]),i(n)},translateMarker(){},moveToMyLocation(){this.afterInit(()=>{const t=new BMap.Geolocation,e=this.mapInstance;t.getCurrentPosition(n=>{t.getStatus()===BMAP_STATUS_SUCCESS&&e.panTo(n.point)},{enableHighAccuracy:!0})})},includePoints(){},getRegion(){},getScale({success:t,fail:e,complete:n},i){i(t,[{scale:this.options.scale}]),i(n)},getSupportedCoordTypes({success:t,fail:e,complete:n},i){i(t,[["wgs84","gcj02"]]),i(n)}},ju={latitude(t){t&&(this.options.latitude=t,this.tempPoint?(this.mapInstance&&this.translate(new BMap.Point(this.tempPoint,t),this.coordType).then(t=>{this.mapInstance.panTo(t[0])}),this.tempPoint=null):this.tempPoint=t)},longitude(t){t&&(this.options.longitude=t,this.tempPoint?(this.mapInstance&&this.translate(new BMap.Point(t,this.tempPoint),this.coordType).then(t=>{this.mapInstance.panTo(t[0])}),this.tempPoint=null):this.tempPoint=t)},coordtype(t){-1===["wgs84","gcj02"].indexOf(t)?console.warn('### Web Render ### coordtype only support ["wgs84", "gcj02"]'):(this.coordType=t,this.mapInstance&&this.translate(new BMap.Point(this.options.longitude,this.options.latitude),this.coordType).then(t=>{this.mapInstance.panTo(t[0])}))},showmylocation(t){t?this.afterInit(()=>{const t=new BMap.Geolocation,e=this.mapInstance;t.getCurrentPosition(n=>{t.getStatus()===BMAP_STATUS_SUCCESS?(this.mk=new BMap.Marker(n.point),e.addOverlay(this.mk),e.panTo(n.point)):(console.log("failed showmylocation"+this.getStatus()),e.removeOverlay(this.mk))},{enableHighAccuracy:!0})}):this.afterInit(()=>{this.mapInstance.removeOverlay(this.mk)})},scale(t){try{const e=parseFloat(t);if(e>=4&&e<=20&&(this.options.scale=t,this.mapInstance)){this.mapInstance.setZoom(Ru(t))}}catch(t){throw new Error(t)}},rotate(t){},markers(t){const e=this.mapInstance;t&&(Xn(t)?(this.markers.forEach(t=>{e.removeOverlay(t)}),t.forEach(t=>{const n=Object.create(null);this.translate(new BMap.Point(t.longitude,t.latitude),t.coordType).then(i=>{const o=i[0];if(t.offsetX&&t.offsetY&&console.warn("### Web Render ### offsetX, offsetY 在预览效果中不可用,请在移动设备上调试"),t.iconPath){let e;e=t.width&&t.height?new BMap.Icon(t.iconPath,new BMap.Size(t.width,t.height)):new BMap.Icon(t.iconPath,new BMap.Size(48,48)),n.icon=e}else console.wran("### Web Render ### marker 的 iconPath 是必填项");t.rotate&&(n.rotation=-t.rotate),t.title&&(n.title=t.title);const r=new BMap.Marker(o,n);if(D(t.callout)){const n=t.callout,i=Object.assign({},Lu,{content:n.content});n.fontSize&&(i.fontSize=`${n.fontSize}px`),n.borderRadius&&(i.borderRadius=`${n.borderRadius}px`),n.padding&&(i.padding=`${n.padding}px`),n.textAlign&&(i.textAlign=n.textAlign),n.display&&(i.display=n.display);const o=new BMap.Label(n.content,i);e.addOverlay(o),"byclick"===i.display&&(o.hide(),r.addEventListener("click",()=>{o.show()})),o.addEventListener("click",()=>{this.dispatchEvent("callouttap",{markerId:t.id})}),r.setLabel(o)}t.zIndex&&r.setZindex(t.zIndex),r.addEventListener("click",()=>{this.dispatchEvent("markertap",{markerId:t.id})}),e.addOverlay(r),this.markers.push(r)})})):console.warn("### Web Render ### 属性markers必须为一个数组"))},polylines(t){const e=this.mapInstance;t&&(Xn(t)?(this.polylines.forEach(t=>{e.removeOverlay(t)}),t.forEach(t=>{const n=Object.assign({},Iu);t.color&&(n.strokeColor=t.color),t.width&&(n.strokeWeight=parseFloat(t.width)),!0!==t.dotted&&"true"!==t.dotted||(n.strokeStyle="dashed"),(t.arrowLine||t.arrowIconPath||t.zIndex)&&console.warn("### Web Render ### web预览阶段不支持 polylines 的 arrowLine,zIndex,arrowIconPath 属性"),this.translateArray(t.points).then(t=>{const i=new BMap.Polyline(t,n);this.polylines.push(i),e.addOverlay(i)})})):console.warn("### Web Render ### 属性polylines必须为一个数组"))},circles(t){const e=this.mapInstance;t&&(Xn(t)?t.forEach(t=>{const n=Object.assign({},Nu);t.borderColor&&(n.strokeColor=t.borderColor),t.borderWidth&&(n.strokeWeight=t.borderWidth),t.fillColor&&(n.fillColor=t.fillColor),t.zIndex&&console.warn("### Web Render ### web预览阶段不支持 circles 的zIndex 属性"),this.translate(new BMap.Point(t.longitude,t.latitude),t.coordType).then(i=>{const o=new BMap.Circle(i[0],t.radius,n);e.addOverlay(o)})}):console.warn("### Web Render ### 属性circles必须为一个数组"))},groundoverlays(t){const e=this.mapInstance;t&&(Xn(t)?(this.groundoverlays.forEach(t=>{e.removeOverlay(t)}),t.forEach(t=>{const n=Object.create(null);n.imageURL="/samples/common/logo.png",t.opacity&&(n.opacity=t.opacity),t.zIndex&&console.warn("### Web Render ### web预览阶段不支持 groundoverlays 的zIndex 属性"),!1!==t.visible&&"false"!==t.visible&&this.translateArray([t.southWest,t.northEast]).then(t=>{const i=new BMap.Bounds(t[0],t[1]),o=new BMap.GroundOverlay(i,n);o.setImageURL("/samples/common/logo.png"),this.groundoverlays.push(o),e.addOverlay(o)})})):console.warn("### Web Render ### 属性 groundoverlays 必须为一个数组"))},controls(t){const e=this.mapInstance;t&&(Xn(t)?t.forEach(t=>{const n=Object.assign({},Iu);n.clickable=!0;const i=t.iconPath.replace(".","/samples/component/thirdParty/map");n.iconPath=i,t.id&&(n.id=t.id),D(t.position)&&(n.position=t.position),!1!==t.clickable&&"false"!==t.clickable||(n.clickable=!1);const o=new CustomControl(n,this);e.addControl(o)}):console.warn("### Web Render ### 属性 controls 必须为一个数组"))},polygons(t){const e=this.mapInstance;t&&(Xn(t)?(this.polygons.forEach(t=>{e.removeOverlay(t)}),t.forEach(t=>{const n=Object.assign({},Pu);t.strokeColor&&(n.strokeColor=t.strokeColor),t.strokeWidth&&(n.strokeWeight=parseFloat(t.strokeWidth)),t.fillColor&&(n.fillColor=t.fillColor),t.zIndex&&console.warn("### Web Render ### web预览阶段不支持 polygons 的zIndex 属性"),this.translateArray(t.points).then(t=>{const i=new BMap.Polygon(t,n);this.polygons.push(i),e.addOverlay(i)})})):console.warn("### Web Render ### 属性polygons必须为一个数组"))}},Hu={mylocation(t){console.log('### Web Render ### "mylocation" 在预览中不可用,需要使用移动设备调试')},mylocationFillColor(t){console.log('### Web Render ### "mylocation-fill-color" 在预览中不可用,需要使用移动设备调试')},mylocationStrokeColor(t){console.log('### Web Render ### "mylocation-stroke-color" 在预览中不可用,需要使用移动设备调试')},mylocationIconPath(t){console.log('### Web Render ### "mylocation-icon-path" 在预览中不可用,需要使用移动设备调试')}},$u={};var zu={init:function(t){ku=t.Atomic;const e=t.utils.extend;function n(t){!function(t){if(Cu)return;window.BMap_loadScriptTime=(new Date).getTime();const e=document.createElement("script");e.src=`http://api.map.baidu.com/getscript?v=3.0&ak=${Ou}`,e.async="async",e.onload=function(){Cu=!0,Su.forEach(e=>{e(t)}),t.dispatchEvent("loaded"),console.log("### Web Render ### 百度地图api已经准备就绪")},e.onerror=function(){console.log("### Web Render ### 百度地图api加载失败")},document.getElementsByTagName("head")[0].appendChild(e)}(this);const e=t.attr||{};this.id=e.id||`hap-map-id-${_u++}`,this.options=Object.assign({},Du),ku.call(this,t)}n.prototype=Object.create(ku.prototype),e(n.prototype,Object.assign({},Bu,Fu)),e(n.prototype,{attr:e(Object.create(ku.prototype.attr),ju)}),e(n.prototype,{style:e(Object.create(ku.prototype.style),Hu)}),e(n.prototype,{event:$u}),t.registerComponent("map",n)}};let Yu;t(".hap-rating{display:flex;position:relative;width:500px;height:100px;justify-content:space-around;overflow:hidden}.hap-rating>div{position:absolute;top:0;left:0;width:100%;height:100%;background-repeat:repeat-x}",void 0);const Wu={width:500,numstars:5,rating:0,stepsize:.5,indicator:!1,starBackground:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAACXBIWXMAAAsTAAALEwEAmpwYAAAF42lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDAgNzkuMTYwNDUxLCAyMDE3LzA1LzA2LTAxOjA4OjIxICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgKE1hY2ludG9zaCkiIHhtcDpDcmVhdGVEYXRlPSIyMDE4LTAxLTAzVDE1OjI1OjIyKzA4OjAwIiB4bXA6TW9kaWZ5RGF0ZT0iMjAxOC0wMS0wNVQxMDozMTowMSswODowMCIgeG1wOk1ldGFkYXRhRGF0ZT0iMjAxOC0wMS0wNVQxMDozMTowMSswODowMCIgZGM6Zm9ybWF0PSJpbWFnZS9wbmciIHBob3Rvc2hvcDpDb2xvck1vZGU9IjMiIHBob3Rvc2hvcDpJQ0NQcm9maWxlPSJzUkdCIElFQzYxOTY2LTIuMSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowZjg1NzEzOS1mYWY1LTQ5MTgtODFiNC1jNWI1OTRjNTRiYjMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6YmM3ZDZjOTMtMmEwNS00Zjk4LTk3NzMtMDYwZjVmNGM0YTZhIiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6YmM3ZDZjOTMtMmEwNS00Zjk4LTk3NzMtMDYwZjVmNGM0YTZhIj4gPHhtcE1NOkhpc3Rvcnk+IDxyZGY6U2VxPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0iY3JlYXRlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDpiYzdkNmM5My0yYTA1LTRmOTgtOTc3My0wNjBmNWY0YzRhNmEiIHN0RXZ0OndoZW49IjIwMTgtMDEtMDNUMTU6MjU6MjIrMDg6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDQyAoTWFjaW50b3NoKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6MGY4NTcxMzktZmFmNS00OTE4LTgxYjQtYzViNTk0YzU0YmIzIiBzdEV2dDp3aGVuPSIyMDE4LTAxLTA1VDEwOjMxOjAxKzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgQ0MgKE1hY2ludG9zaCkiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPC9yZGY6U2VxPiA8L3htcE1NOkhpc3Rvcnk+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+fv/GbgAADLVJREFUeJztnXuwVVUdxz8Xr4igCCqYoKloXbWAzBOKmpqPctQiTSs1wUcSiqRZjowzTE1jjTJlLyPKScK0otFSy0bNcnxCegwpVPKROkqYylseyoXTH799uofLPef81mOfs/be6zOz595zzlp7/+6+37PW2mv9fr/VUalUiERs6dduAyLZJgoo4kQUUMSJKKCIE1FAESeigCJORAFFnIgCijgRBRRxIgoo4kQUUMSJTtcTlMtlH3aEyrjk5+NttSJFSqWSU31nAeWcaUAFmNhuQ0IldmH1GQ58NjmGt9mWYIkCqs9koD+wA3BRm20JliigvukEptS8vpjY3fdJFFDfnA6MrHk9EjitTbYETRRQ31yqfK/wRAFty1jgo328fzQwpsW2BE8U0LZMs/yskEQBbc2uwNkNPj8bGNoiWzJBFNDWXAjs2ODzgUmZSEIUUA/9gEsU5S4h3rf/E29ED6cC+yrK7Qeckq4p2SEKqAeTAXIcTCdEAQkHAscblD8hqVN4ooCES4EOg/IdwNSUbMkUUUAwGJhkUW8SsLNnWzJHFJAIYSeLejsD5/k1JXsUXUAduK1xTcWs68sdRRfQx4H3O9TvAk70ZEsmKbqAfKywF/qRvsgCGgWc7OE8JyOTi4WkyAKaip+/vx8FfqQvqoAGAud7PN8FyTkLR1EF9AV0bhkbk6MZQ4FznCzKKEUVkHbw/Ovk0FDIwXQRBXQMMFpZ9kfJoWF0cu5CUUQBaVuKx4CFyTFfWadwjvdFE9BewARl2Rtqfte2Qp9OrlEYiiYgbYDg68BtNa9vS95rRmdyjcJQJAGZhCj/DNhU83pT8p6Gi5JrFYIiCehzwDBFuU3A7D7en83WoqrHsORahaBIAtIOnn8PLOvj/WXA7zxfK/MURUCHA9pMSjdYflZLCThMWTbTFEVA2sfrRcDDDT5/BHhKea5CtEJFENAewJnKsj9WlNG2Qmcm1841RRBQNVFUM1YCtyrK/QpYoSjXP7l2rsm7gLZn60RRjZgDrFeU2wDcpDznlMSG3JJ3AZ0OjFCU2wLMMjjvrKROM0YkNuSWPAqoE9gTyfNzubLOPcCLBtd4CbhbWfYK4AjgACSEKFdkIe9fB5J2ZXivY1id94ZiHimhHRj3rvNJRblxwKM1rzcCbwJvNDn+m/zUTF62jXYJaDCNRVD7ejfStfMFpAUy5c/Av5DIDBMGAHsnh4ZVNBdb9ViB5LVuGb7+MQPQtQ7VnwM8XdcHs7C76ZWk7g/8mrMNQ5JDE37Uja51q7ZwG1yN6zDd9rtcLl+KxELVisMmsjME1iEZWFdb1h8MLCXbf3+tqO4rlUpG3bnNIHoustp8OBIak9WbB3AL9uIBWAPc7MmWdjAICUk6DJlumGt6AuMWCKBcLncizXfWM7iPBhY7nuMg4BkPtrSTG4FLSqVSt2lFKwFVKZfL04Fvk8348AeBYz2d637M8guFQgW4ulQqXWt7Aqd5oOTCZwHvuJynTdg8urfiXK3iHeAsF/GAn4nEeci3b7mHc6XNBuAV4AHgDo/n/QOwAHnkzgLLkSxr81xP5Osx/lFgPPAnZMa1VWxB5j5qJ956T8TVHmtTsmMz8veDLKL2nsLYo857w9At9PrkRSSe/zkfJ/M5Qfc8chPvRKbubVlP/VnZ3q/fQv55IfEu8FpyaBhCY5HVvnZNcj4f+BRy37zge4b3LaQ7m4ts1GbKa8AnyP5TjQmrkkPTIuyHDNhHWVznNuBcdKHaatJYTN0IfB6YaVF3L6Q7/JhXi/LBWMRb0kY830G+0F7FA+mtxleAqxB/GNMuZgiyNnWuZ5uyzEmIeEY2K9iLzUhm/StJaY0sbXeOnyIZ4E0Hr/2RGd6ve7coe1yEPOWZZoRdh0Th/sS7RTW0wh/oHmT/raUWdb8B/IKce/XVoQO4FgloNB2rLkP2N9P6LFnTKoeyRch6yyKLupMQEe7i1aKw2QFJK3OVRd3FyL3+u1eL6tBKj8SlSEtk43tzHDK43serRWGyG/KkZRPdej9wJPCqV4sa0GqX1rWIF582zryWDyCzvYd6tSgs9kfSyhxlUXcOMkG4xqtFTWiHT3Q38CVgOuZPBu9BFkE1rqRZYzzyBbHJWz0DydPYcvfXdjrVX4fMF5nOTQxC1rHylMzpDOCvwO6G9d5F8j1e490iJe2OyvgtsqhnuhDbD0n69D3a/ze4ciVyH0zdfFcimfY1wZCpEcLNry7EvmBR93Jkir7RPqehsh3ilDcTc3+ql5D1xgd9G2VKCAICWYg9nK3DX7SchrhnDPdqUbrsBNyFXTazx5F7tcSrRZaEIiCQbux47HxUDkNWmk1DbNrBCOAh7LZZuAPxonzDoz1OhCQgSLzkkAG2KaMQER3t1SK/jEaetA6xqPt94DN4CMXxSWgCAnm0n45ktjB18h6KBPyFmDX+RCS/kDagsMoW4MvAV9DF47eUEAVU5UbsF2JvQeZGQuECxFvTNDZ+PTLG06YZbjkhCwjgXmRW1mYh9puEkRnjOODnmC+Ivo5kvr/Lu0UeCV1AAP/AfiH2Wc+22PCyRZ1nkCetsl9T/JMFAYHdQuxywnjU/TfwH4PyDyALoq+kY45fsiIg6FmInaMs/xgtzlTRAO381jzEJ3xVeqb4JUsCAnkqe0JZ9pE0DTFEK6AygecD6k3WBAR6V4eQBKS15chUrUiBvApoI2ENQJ8C3laUiwJKmb2B9yrKlRFXh1DYjMxAN2MYbvvYt5ysCUj7DQ2p+6qSy24sawLK4vininYgbePO2jbyKKAKdm4habMA3dpebIFSYjC6zXKfJsx5lLfRzaZ3Ye7a2jayJKDx6Oz12fpMQLJZ+CJ346AsCaiV459RwB8RB647kdDi/TycVyvuKKAUaIWABiDh1E8Dp9S8f2ry3gzc9kPV2paZgXRWBNSJbBnQjNewW/0GcTFdjCR06CtCYkfERWQxsl5lwzJkcbUZh9axITiyIqAPAwMV5WzGP/sgXdXdSGRoMw5AvAJux9y7EHStUH/0W3S2lawISNukmwioP3A14nszwdgicVZ7FkmAYJI9JFfdWN4EpP3nnAj8E/gWupatHoOQFCyL0OecztVAOisC0tzMNYj3YiNGIlGg9+F3zekgxBHsViR+vxHPoovEPYIMJHDPgoDehy5ocAH10+ltj4QQL0G/Aa8NZyNbQF2GRJ72RQVxdmvGrogwgyYLAnLtvo5F3Clm0pqNYQYjMVxPUj/dcW4mFPMkoN5jiz2RHZYfAA72apGOsYhQ5iBuGrVEAbUQzU3spsffphMJwluCRLm68DL280ogY5jzkG7tYnrudxldWpvgn8RCF9Du6OLdFyJBeEchXcf1uG1w+w6Sc+fg5LgGtw1lhiKZOP4GfARxdtN4TO6PZKsPltAFpP0GPodkx38IGON4zXuRVf8ZSBz6huT30cjTmwslpKWcjSyNaAi6G8uLgM4BJuL22PsqkinsJCTdTG+eR5YwzsAtiWU/JMXfZGX5oLux0AXUim/fJiQbyEHI8kQzbk/KXodbCI5W7LEFsmRHZA0sTf6CdHnTkczuWtYldcYguQ3T5BACzsAWsoDGkd5eWkuRBJ8n4Bb+vARJinUWZuHLJmyP5AYIkpAFlEbT3Q18FzgQD7v11fCb5JzXY57TSEOw3VjIAvI9eHwQ+BDwNXRBfqasBb6KdDkPeT53sAPpUAXUj54tJF15Hdk66lj0j84uLEby+kxEdlb0gdYfvOUEaRTwQWTfMBc2Az9EupZbXA2y4JfIJOgNuG/LuQuy1UNwhCog1z7/McQt9DJgtbs51qwGpiGzz/MdzxVkNxaqgGxv1pvA+Ul9m4xmabEQ+VJciP2Gt0EOpPMioC3IWlMXskFdKImlaqkANyGObLMxz7gaBaREm4GjSnWBciqyf0TorERW5k1zIO6L+Z6pqROigLTftOXIetJ4WrQ7n2eeQCYIpwArlHWCa4VCFFCz7quC5JDuSn6G2F1p2YJsTNyFpAJu9rdEASloJKAnkaZ/MuZbRIXMW8AXERfYhQ3KBfckFpqA6mXgWInsfz4O2a0mryxAxnPT6DvDyFha49etJjQB9Z5xrSBPVV3I/ufB7RWRApuRyccu4OZen21HYAuroQmotolehCQXPx+Z3ykabyBbnh+NBEFWCaobC1FAa5AZ5EMJM9NYq3kY8Yu6AlmwDWogHZKAOhHf5i5kDct1/ShPdCP7w3Yh2T2C+b91VCpZfgqOtJtglBzJJlFAESeigCJORAFFnIgCijgRBRRxIgoo4kQUUMSJKKCIE1FAESeigCJORAFFnIgCijgRBRRxIgoo4kQUUMSJKKCIE/8D51pQ3VVFNAQAAAAASUVORK5CYII=",starSecondary:null,starForeground:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAACXBIWXMAAAsTAAALEwEAmpwYAAAFFmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDAgNzkuMTYwNDUxLCAyMDE3LzA1LzA2LTAxOjA4OjIxICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgKE1hY2ludG9zaCkiIHhtcDpDcmVhdGVEYXRlPSIyMDE4LTAxLTAzVDE1OjI1OjIyKzA4OjAwIiB4bXA6TW9kaWZ5RGF0ZT0iMjAxOC0wMS0wM1QxNjo0Mjo0NiswODowMCIgeG1wOk1ldGFkYXRhRGF0ZT0iMjAxOC0wMS0wM1QxNjo0Mjo0NiswODowMCIgZGM6Zm9ybWF0PSJpbWFnZS9wbmciIHBob3Rvc2hvcDpDb2xvck1vZGU9IjMiIHBob3Rvc2hvcDpJQ0NQcm9maWxlPSJzUkdCIElFQzYxOTY2LTIuMSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxZjNkMzAxYy0xZjc4LTQyNzktYmU4Ny1jYjQ2YTkyZjllZjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MWYzZDMwMWMtMWY3OC00Mjc5LWJlODctY2I0NmE5MmY5ZWY2IiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6MWYzZDMwMWMtMWY3OC00Mjc5LWJlODctY2I0NmE5MmY5ZWY2Ij4gPHhtcE1NOkhpc3Rvcnk+IDxyZGY6U2VxPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0iY3JlYXRlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDoxZjNkMzAxYy0xZjc4LTQyNzktYmU4Ny1jYjQ2YTkyZjllZjYiIHN0RXZ0OndoZW49IjIwMTgtMDEtMDNUMTU6MjU6MjIrMDg6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDQyAoTWFjaW50b3NoKSIvPiA8L3JkZjpTZXE+IDwveG1wTU06SGlzdG9yeT4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz41FN+KAAAI80lEQVR4nO2da2xcxRWAP8emhLREJoQEFWgRCMz7FTc4pYWqUEC8hShpKCVKoRBIolZA1SCVf7QiFQWpQn3wfgkBgn8I8RBIUJUWMEShVEKlQghIHwkhJgERhM32x7nGa7Ne37szc+fMzvmkle313bnn7n47d+7M3DM9jUYDw+iUWbEDMNLGBDKcMIEMJ0wgwwkTyHDCBDKcMIEMJ0wgwwkTyHDCBDKcMIEMJ/pcCxgb7vcQhloWFz9fjBpFQHoHR5xe7yxQl7MGaAAXxQ5EK3YKm54FwPnFY0HkWNRiAk3PpcCXgJ2Bn0SORS0mUGv6gJVNf6/ETvctMYFacy6wV9PfewPnxAlFNyZQa1a3eG5N7VEkgAn0RY4Evt3i+eOBw2uORT0m0BdpV9NYLTQFE2gy84AL2vz/h8BuNcWSBCbQZC4Gdmnz/znAj2uKJQlMoAlmAVeU2O4K7H37HHsjJjgD2LfEdvsBp4UNJR1MoAmqNJBbXeZniQkkHAScWGH7k4EDA8WSFCaQsBroqbB9D1YLASYQwFxgeQevWw58xXMsyWECdS5Cp+J1FbkL5HoqWuUrkFTJXSDXxvDBwEmeYkmS3AXy0RDOujGds0C+OgTPBL7uoZwkyVmgVfg5/rJDIF1JrgLNAVZ4LO8S2g/Cdi25CnQhfqdlzAOWeSwvGXIVKETDN8vGdI4CnUCYqalHA8cFKFc1OQoUclpqdlNecxNob+DsgOWfC3w1YPnqyE2gywl7g+BOwGUBy1dHTgLVdYvyZcgt0VmQk0BLgT1q2M9C4Lwa9qOCnASqs4GbTWM6F4GGgMGa97eoxv1FIxeBYnTyZVEL5SDQQuD7Efa7FJgfYb+1koNA44mi6mY2GSSm6naBdmJyoqi6WQn0Rtx/cLpdoNg9w18jbM93dLoxbVsf0t+zAPhZ3FAAuBL4F7C5eIzGDccvKQjUg8y3WTDlscc0z+1GtZsEQ3McsKH4vQFsBTYVj81Nv7d67v3iNWqJJdBc2kvQ/PfupCF6Gca/DPOQ26lnYhTYQnvJmp/b5j/k9vj6YGZTrnYY/znb0367nT6kG2Jhye13MCHXTLXbpmJ7J3qqLvs9Nty/Gvgek+XI/hbfRNnOZKme6h0cublKAZ1chd2NjGwPIbfGmDzpsivyGQ4hfWV3Vy2gskC9gyPbkWRMt1Z9raGWW4Azi8+2EpVPYc2MDfevBX6NrqseozwN4JrewZF1nRbgJBDA2HD/UiZOa0Y67ACW9w6OPORSiI+e6AeR7F5bPJRl1MN7yGfmJA/4G8r4C7AE6XE1dPMG8lk976Mwn2NhXgMzguD9i+57MNVb1Wh45wECNDVCjMbvAH4A/CZA2UZnXI8s4fCJ74JDTedoAL9A5sOMBdqHMTOjyKS2awg0KBt6PtCfkE7Hyh1UhjPbgNOB20LupI4JZY8j629trGFfhvAu8p4/GXpHdc1I3AAcy8S8GCMc65H3+tU6dlbnlNaNyLfi8Rr3mRuPISsr/ruuHdY9J3o7kpTylpr3mwN/AM4CPqxzpzEm1Y8iCQjWony6ZiI0gJ8jiT5rv+KNeVfGOqS/yHlWXMbsAM4HbogVQOzbeh5CMr3bQGx1NgPfBR6OGURsgcAGYjvhn8gswr/GDkSDQCADsUOITEZ7/ox84d6MHQjoEQjkNHYiMr/IaM39yA0N78cOZBxNAoEM9i1DGtjGZH6FJEj3PiDqgjaBQC5L1yJZNbrqNuAOGUXWs/8lCrs9NAo0zq3YQOw2ZEWhO2IHMh2aBQJ4AvgWeQ7Evo3cV/9U7EDaoV0gkEHB3AZiX0GuSl+LHchMpCAQ5DUQ+ygyIPqf2IGUIRWBYGIg9s7YgQTkNuAc4KPIcZQmJYFArkheih1EQF4gsSnAqQkE0qjuVpI7NhNIF8kdW2oC7YMkruxW9gf2jB1EFVITKIcVAZM6xtQESq6K74CkjtEE0kdSx5iSQHMJs1iuNo4Cvhw7iLKkJNAS0oq3U/qQoZskSOkDSapqdySZYzWBdJLMsaYiUB+wOHYQNTJEIqv8pCLQMcCc2EHUyK7AEbGDKEMqAiVTpXskiWM2gfSSxDGnIlBS3fueSOKYUxDoAGRBl9zYC9g3dhAzkYJASVTlgVB/7CaQbtQfewoCxWwLvFU8YqG+HaRdoPnAQIT9fgJcBxxSPK4jzi3FhwL9EfZbGu0CxajCn0BG/a8FPi4e1xbPBc96OoUelNdCJtAE7wDnAaci6Wam8gZwSrHNOzXGpbodpF2gOr59nyLZQA4GHimx/SPFtuuK14bGaqAO2QUZAwvJ08iY01qq3cz3UfGaI4BnAsTVzDeQ9UxVolmgxYR74zYiCT5PAl53KOd1JCnWMsLlZp4NDAYq2xnNAoWoukeB3wIH4TcT2gNFmTcSJqeR2naQZoF8v2nPIvONryZMMu7twFXA0cBznstW2w7SKtAsZA60D/4L/Aj4DvAPT2W24zXgBOAi4H+eyvwmSlfG1irQYbh3oI0Bv0NOLfe5BtQB9yKdoDfjnjBhPnIc6tAqkGuV/TywCPgp8IF7OB3zAbAGuZJyzems8jSmVaBO2z+bgRXF6zVlNFuPCHAxsq5sJ6hsSHeLQJ8Bv0dOGXehMJspEtMdwIHAH5GYq2AClaRqBo4XkFPEKmBrkIj8shW4HLnzYrjC61Rm7tAoUNlz/RYkl/QSJCllaryE3IG6kvKZ59W1gzQKNFNV3UBySA8UPzWersryGbIw8QBwOzMfi7rTWGoCvYxU/ZfSXUtEvQdcgvT3rG+znQk0A9Nl4NiKrMi3GHix1ojq5W9Ie24NMNLi/0ehLHOHNoGmZuBoIFdVA8iaoFWvXFJkDOl8HADumfI/dZk7tAnUXEVvQJKLr0D6d3JjE7AcSTr+96bnVZ3GNAq0DelBXoQtQAeywNwxwJXIgK0JNA19yFKOA8gYVlIJtwMzCtyEvDdvouhz62k0Ur4KNmKjxmQjTUwgwwkTyHDCBDKcMIEMJ0wgwwkTyHDCBDKcMIEMJ0wgwwkTyHDCBDKcMIEMJ0wgwwkTyHDCBDKcMIEMJ/4PN4Zi1rcUs0gAAAAASUVORK5CYII="};function Vu(t,e){let n;return n=!1===e?parseFloat(t):parseFloat(t).toFixed(1)}const Uu={create(){const t=document.createElement("rating");t.classList.add("hap-element"),t.classList.add("hap-rating");const e=document.createElement("div"),n=document.createElement("div"),i=document.createElement("div");return e.classList.add("hap-rating-back"),n.classList.add("hap-rating-second"),i.classList.add("hap-rating-fore"),this.back=e,this.second=n,this.fore=i,t.appendChild(e),t.appendChild(n),t.appendChild(i),this.setBackgroundImage(),t},onAppend(){this.initEvent(),Yu.prototype.onAppend.call(this)},getImgSize(t){const e=t||this.options.starBackground;return new Promise((t,n)=>{const i=new Image;i.style.opacity=0,i.onload=(()=>{const e={width:i.naturalWidth,height:i.naturalHeight,ratio:parseFloat(i.naturalWidth/i.naturalHeight).toFixed(2)};document.body.removeChild(i),this.size=e,this.getSizeCallbak.forEach(t=>{t.call(this)}),this.getSizeCallbak.length=0,t(e)}),i.onerror=(()=>{n(new Error("img error"))}),document.body.appendChild(i),i.src=e})},bridge(t){this.size?t.call(this):this.getSizeCallbak.push(t)},setBackgroundImage(t){this.getImgSize(t).then(()=>{const t=this.options;this.back.style.backgroundImage=`url(${t.starBackground})`,t.starSecondary&&(this.second.style.backgroundImage=`url(${t.starSecondary})`),this.fore.style.backgroundImage=`url(${t.starForeground})`,this.setNumberStar()})},setNumberStar(){const t=this.options,e=this.size,n=t.numstars,i=t.width,o=this.node.childNodes,r=parseInt(i/n);let s;s=t.height?t.height:r*e.ratio,Array.prototype.forEach.call(o,t=>{t.style.backgroundSize=`${r}px ${s}px`}),this.node.style.height=`${s}px`,this.setRating()},setRating(){const t=this.options,e=this.second;this.fore.style.width=`${this.getWidth(t.rating,"fore")}px`,t.starSecondary&&(e.style.width=`${this.getWidth(t.rating,"second")}px`)},getWidth(t,e){const n=this.options.width,i=this.options.numstars;"second"===e&&(t=Math.ceil(t));const o=Vu(t/i,!1);return Vu(n*o,!1)},rating(t){const e=this.options.width,n=this.options.numstars,i=this.options.stepsize,o=Vu(t/e);let r=Math.round(Vu(n*o)/i)*i;return r>n&&(r=n),r<0&&(r=0),this.options.rating=r,this.setRating(),r},initEvent(){const t=this.node,e=t.getBoundingClientRect();t.addEventListener("click",t=>{if(this.options.indicator)return;const e=t.offsetX,n=this.rating(e);this.dispatchEvent("change",{rating:n})}),t.addEventListener("panstart",t=>{if(this.options.indicator)return;const n=t.touch.pageX-e.left;this.rating(n)}),t.addEventListener("panmove",t=>{if(this.options.indicator)return;const n=t.touch.pageX-e.left;this.rating(n)}),t.addEventListener("panend",t=>{this.options.indicator||this.dispatchEvent("change",{rating:this.options.rating})})}},qu={numstars(t){this.options.numstars=t,this.bridge(()=>{this.setNumberStar()})},rating(t){t>this.options.numstars&&(t=this.options.numstars),this.options.rating=t,this.bridge(()=>{this.setRating()})},stepsize(t){this.options.stepsize=Vu(t)},indicator(t){this.options.indicator="false"!==t&&!1!==t}},Gu={starBackground:function(t){t="/"===t[0]&&Hap.basePath?`${Hap.basePath}${t}`:t,this.options.starBackground=t,this.setBackgroundImage(t)},starSecondary:function(t){t="/"===t[0]&&Hap.basePath?`${Hap.basePath}${t}`:t,this.options.starSecondary=t,this.setBackgroundImage(t)},starForeground:function(t){t="/"===t[0]&&Hap.basePath?`${Hap.basePath}${t}`:t,this.options.starForeground=t,this.setBackgroundImage(t)}};var Ju={Image:Xa,Text:sl,Scrollable:Cc,Slider:Pc,Progress:Bc,Swiper:ld,Tabs:Od,Stack:Id,Popup:Ud,Input:eh,Textarea:rh,Picker:jp,Select:Wp,Option:qp,Video:Jp,Switch:su,A:cu,Web:uu,Richtext:gu,Span:bu,Label:wu,Canvas:Au,Map:zu,Rating:{init:function(t){Yu=t.Atomic;const e=t.utils.extend;function n(t){const e=t.style||{};this.options=Object.assign({},Wu),e.width&&(this.options.width=parseInt(e.width)),e.height&&(this.options.height=parseInt(e.height)),this.size=null,this.getSizeCallbak=[],Yu.call(this,t)}n.prototype=Object.create(Yu.prototype),e(n.prototype,Uu),e(n.prototype,{attr:e(Object.create(Yu.prototype.attr),qu)}),e(n.prototype,{style:e(Object.create(Yu.prototype.style),Gu)}),t.registerComponent("rating",n)}}},Ku={init(t){if("object"==typeof Ju)for(const e in Ju)t.install(Ju[e])}};var Zu={init:function(){Wa.install(Ua),Wa.install(Ku),Wa.install(mi),console.warn("### Web Render ### 该预览仅供界面开发参考,实际效果请以真机调试为准")},Hap:Wa};global.frameworkVersion=e,global.packagerVersion=n;const Qu={};function Xu(t,e,n,i){Object.defineProperty(t,e,{value:n,enumerable:!!i,writable:!0,configurable:!0})}function tf(t,e){if(t.length){const n=t.indexOf(e);if(n>-1)return t.splice(n,1)}}Qu.platform=dt,dt.init(),Qu.platform.exposeToNative(dt.exposure),global.BroadcastChannel=dt.BroadcastChannel,global.ENGINE_TYPE=dt.ENGINE_TYPE,Qu.runtime=Ti,Ti.init(),Qu.platform.exposeToNative(Ti.exposure),Qu.dock=jo,jo.init(Qu),Qu.platform.exposeToNative(jo.exposure),Zu.init(),Qu.platform.defineBundle("parser"),Qu.platform.defineBundle("canvas"),Qu.platform.defineBundle("animation");const ef=Object.prototype.hasOwnProperty;function nf(t,e){return ef.call(t,e)}function of(t,e){return function(n){const i=arguments.length;return i?i>1?t.apply(e,arguments):t.call(e,n):t.call(e)}}const rf=["$idx","$item","$evt"];function sf(t,e,n){rf.indexOf(n)>-1||!N(n)?Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:function(){return t[e]?t[e][n]:null},set:function(i){t[e]&&(t[e][n]=i)}}):console.error(`### App Framework ### 页面数据属性名 '${n}' 非法, 属性名不能以$或_开头`)}function af(t,e){!N(e)&&t&&delete t[e]}const lf="__proto__"in{},cf=Array.prototype,df=Object.create(cf);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(t){const e=cf[t];Xu(df,t,function(){let n=arguments.length;const i=new Array(n);for(;n--;)i[n]=arguments[n];const o=e.apply(this,i),r=this.__ob__;let s;switch(t){case"push":case"unshift":s=i;break;case"splice":s=i.slice(2)}return s&&r.observeArray(s),r.dep.notify(),o})}),Xu(cf,"$set",function(t,e){return t>=this.length&&(this.length=t+1),this.splice(t,1,e)[0]}),Xu(cf,"$remove",function(t){this.length&&("number"!=typeof t&&(t=this.indexOf(t)),t>-1&&this.splice(t,1))});const hf=["manifest","config","router","data","props","style","template","computed"];const pf=["if","for","show","tid"];function uf(t){return pf.indexOf(t)>=0}function ff(t){const e=t&&t.toString().match(/^\s*function (\w+)/);return e?e[1]:""}function mf(t,e){return ff(t)===ff(e)}function gf(t,e){if(!Array.isArray(e))return mf(e,t)?0:-1;for(let n=0,i=e.length;n<i;n++)if(mf(e[n],t))return n;return-1}const yf=/^(String|Number|Boolean|Function|Symbol)$/;function bf(t,e){let n;global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 参数类型验证 ----",t,e);const i=ff(e);if(yf.test(i)){const o=typeof t;(n=o===i.toLowerCase())||"object"!==o||(n=t instanceof e)}else n="Object"===i?P(t):"Array"===i?Array.isArray(t):t instanceof e;return{valid:n,expectedType:i}}var vf={};function Ef(t,e){return t._page.doc.createElement(e)}function wf(t,e){const n=t._page.doc,i=vf.quickapp.runtime.helper.createFigment(n);return e.appendChild(i),i}function xf(t,e){return t.appendChild(e)}function Tf(t,...e){t.addEventListener(...e)}function Af(t,e,n,i){if(!t)return;const o=vf.quickapp.runtime.helper.createEvent(e);if(Object.assign(o,n),i){const e=i.attr||{};for(const n in e)vf.quickapp.runtime.helper.setElementAttr(t,n,e[n],!0);const n=i.style||{};for(const e in n)vf.quickapp.runtime.helper.setElementStyle(t,e,n[e],!0)}return t.dispatchEvent(o)}function kf(t,e,...n){switch(e){case"prop":vf.quickapp.runtime.helper.setElementProp(t,...n);break;case"attr":vf.quickapp.runtime.helper.setElementAttr(t,...n);break;case"style":vf.quickapp.runtime.helper.setElementStyle(t,...n);break;case"styles":vf.quickapp.runtime.helper.setElementStyles(t,...n);break;default:console.warn(`### App Framework ### updateNodeProperties() 未知的更新项:${e}`)}}function _f(t,e){const{customComponentMap:n}=t;return n[e]=n[e]||{},n[e]}function Cf(t,e,n,i){if(!t||!e)return void console.warn("### App Framework ### defineCustomComponent() app或inst不存在");const o=_f(t,e.id);o[n]&&console.warn(`### App Framework ### 组件 (${n}) 被重复注册`),o[n]=i}function Sf(t,e,n){if(!t||!e)return void console.warn("### App Framework ### requireCustomComponent() app或inst不存在");return _f(t,e.id)[n]}function Mf(t,e,n,i,o){const r=function(t,e){return vf.quickapp.runtime.helper.getDocumentNodeByRef(t,e)}(t.doc,e);if(r){return Af(r,n,i,{attr:o})}return new Error(`fireEvent: 无效element索引 "${e}"`)}function Of(t){(function(t){let e=!1;return t.doc&&t.$valid&&(e=t.executor.exec()),e})(t)&&t.doc.listener.updateFinish()}function Df(t){t.vm&&Lf(t.vm),function(t,e,n){if(!t||!e)return void console.warn("### App Framework ### removeCustomComponent() app或inst不存在");const i=_f(t,e.id);if(n)global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### removeCustomComponent() 删除id=${e.id}上注册的自定义组件(${n}):${!!i[n]}`),delete i[n];else for(const t in i)global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### removeCustomComponent() 删除id=${e.id}上注册的自定义组件(${t}):${!!i[t]}`),delete i[t]}(t.app,t),t.executor&&t.executor.reset(),t.executor=null,t.vm=null,t.differ=null}function Lf(t){if(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 销毁VM(${t.__id__}:${t._type})`),!t._destroyed){if(t._root.$on("xlc:onDestroy",function(){delete t._props,delete t._data,delete t._ids}),t.$emit("xlc:onDestroy"),t._parent&&t._parent._childrenVms){const e=t._parent._childrenVms,n=e.indexOf(t);-1!==n&&e.splice(n,1)}if(delete t._page,delete t._methods,delete t._options,delete t._parent,delete t._root,delete t._parentContext,delete t._attrs,delete t._parentElement,delete t._rootElement,delete t._slot,t._parentWatchers){let e=t._parentWatchers.length;for(;e--;)t._parentWatchers[e].close();delete t._parentWatchers}if(t._watchers){let e=t._watchers.length;for(;e--;)t._watchers[e].close();delete t._watchers}if(t._childrenVms){let e=t._childrenVms.length;for(;e--;)Lf(t._childrenVms[e])}delete t._vmEvents,t._destroyed=!0}}let If=0,Pf=[];class Nf{constructor(){this.id=If++,this.subs=[]}addSub(t){this.subs.push(t)}removeSub(t){tf(this.subs,t)}depend(){Nf.target&&Nf.target.addLink(this)}notify(){const t=this.subs.slice();for(let e=0,n=t.length;e<n;e++)t[e].update()}}Nf.target=null,Nf.pushTarget=function(t){Nf.target&&Pf.push(Nf.target),Nf.target=t},Nf.popTarget=function(){Nf.target=Pf.pop()},Nf.resetTarget=function(){Nf.target=null,Pf=[]};const Rf=Object.getOwnPropertyNames(df);function Ff(t,e){t.__proto__=e}function Bf(t,e,n){for(let i=0,o=n.length;i<o;i++){const o=n[i];Xu(t,o,e[o])}}class jf{constructor(t){if(this.value=t,this.dep=new Nf,Xu(t,"__ob__",this),Array.isArray(t)){(lf?Ff:Bf)(t,df,Rf),this.observeArray(t)}else this.walk(t)}walk(t){for(const e in t)this.convert(e,t[e])}observeArray(t){for(let e=0,n=t.length;e<n;e++)jf.$ob(t[e])}convert(t,e){Hf(this.value,t,e)}addVm(t){(this.vms||(this.vms=[])).push(t)}removeVm(t){tf(this.vms,t)}}function Hf(t,e,n,i){const o=new Nf,r=Object.getOwnPropertyDescriptor(t,e);if(r&&!1===r.configurable)return;const s=r&&r.get,a=r&&r.set;let l=jf.$ob(n);Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){const e=s?s.call(t):n;if(Nf.target&&(o.depend(),l&&l.dep.depend(),Array.isArray(e)))for(let t,n=0,i=e.length;n<i;n++)(t=e[n])&&t.__ob__&&t.__ob__.dep.depend();return e},set:function(e){e!==(s?s.call(t):n)&&(i&&i(),a?a.call(t,e):n=e,l=jf.$ob(e),o.notify())}})}jf.$ob=function(t,e){if(!D(t))return;let n;return nf(t,"__ob__")&&t.__ob__ instanceof jf?n=t.__ob__:(Array.isArray(t)||P(t))&&Object.isExtensible(t)&&(n=new jf(t)),n&&e&&n.addVm(e),n};let $f=0;class zf{constructor(t,e,n,i){i&&S(this,i),this.sync=!!this.sync,this.lazy=!!this.lazy,this.dirty=this.lazy,this.vm=t,this.vmGetter=global.isRpkDebugMode()?this.proxy(t):t,t._watchers.push(this),this.expression=e,this.cb=n,this.id=++$f,global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 创建 XWatcher ${this.id} ${this.expression.toString()}`),this.active=!0,this.links=[],this.linkIds=new Set,this.newLinks=[],this.newLinkIds=new Set,"function"==typeof e&&(this.getter=e),this.value=this.lazy?void 0:this.get()}proxy(t){return new Proxy(t,{get(t,e){const n=e in t,i=Object.getOwnPropertyDescriptor(t,e);return n&&i&&i.get||i&&i.value&&"function"==typeof i.value||n&&!Object.hasOwnProperty.call(t,e)||"symbol"!=typeof e&&console.warn(`请确认VM的data/public/protected/private中定义了属性:${e}`),t[e]}})}get(){Nf.pushTarget(this);const t=this.getter.call(this.vmGetter,this.vm);return Nf.popTarget(),this.clearLink(),t}addLink(t){const e=t.id;this.newLinkIds.has(e)||(this.newLinkIds.add(e),this.newLinks.push(t),this.linkIds.has(e)||t.addSub(this))}clearLink(){let t=this.links.length;for(;t--;){const e=this.links[t];this.newLinkIds.has(e.id)||e.removeSub(this)}let e=this.linkIds;this.linkIds=this.newLinkIds,this.newLinkIds=e,this.newLinkIds.clear(),e=this.links,this.links=this.newLinks,this.newLinks=e,this.newLinks.length=0}update(){if(this.lazy)this.dirty=!0;else if(this.sync)this.run();else if(this.vm&&this.vm._page&&this.vm._page.$valid){this.vm._page.executor.join(this)}}evaluate(){this.value=this.get(),this.dirty=!1}run(){if(this.active){const t=this.get();if(t!==this.value||D(t)){const e=this.value;this.value=t,this.cb.call(this.vm,t,e)}}}depend(){let t=this.links.length;for(;t--;)this.links[t].depend()}close(){if(this.active){tf(this.vm._watchers,this);let t=this.links.length;for(;t--;)this.links[t].removeSub(this);this.active=!1,this.vm=this.vmGetter=this.cb=this.value=null}}}function Yf(t,e,n){Gf(t,e,n.attr.id,t),function(t,e,n){Jf(t,e,"attr",n)}(t,e,n.attr),function(t,e,n){if("function"!=typeof n&&!Array.isArray(n))return;if(Array.isArray(n)&&!n.length)return;if("function"==typeof n){const i=Zf(t,n,t=>{kf(e,"attr","class",t.join(" "))},e),o=i.value;kf(e,"attr","class",o.join(" "))}else kf(e,"attr","class",n.join(" "))}(t,e,n.classList),function(t,e,n){Jf(t,e,"function"==typeof n?"styles":"style",n)}(t,e,n.style),function(t,e,n){if(!n)return;const i=Object.keys(n);let o=i.length;for(;o--;){const r=i[o];let s=n[r];"string"==typeof s&&((s=t[s])||console.warn(`### App Framework ### 没有找到回调事件 "${r}".`)),"function"==typeof s?(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 绑定回调事件---- ${r}`),Tf(e,r,of(s,t),!1)):console.warn(`### App Framework ### 回调事件 "${r}" 必须是函数`)}}(t,e,n.events)}function Wf(t,e,n,i){global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 处理自定义组件 ----",JSON.stringify(n)),n=n||{};const o=(e=e||{})._options||{};!function(t,e,n){for(const i in t){const o=t[i];n.$on(A(i),function(...t){e&&e[o]&&"function"==typeof e[o]?e[o](...t):"function"==typeof o?o.apply(e,t):console.warn(`### App Framework ### 组件Vm 子组件绑定了父组件不存在的方法:'${o}'`)})}}(n.events,t,e);const r=P(i)?i:{};Object.assign(e._attrs,n.attr||{},r),function(t,e,n,i){if(!t)return;if(t&&!e){console.warn(`### App Framework ### 组件${i._type} 中无props属性,放弃属性校验;推荐增加props属性`);for(const e in t)Uf(e,t[e],n,i,!1)}else{for(const o in e){const r=!t.hasOwnProperty(o);Uf(o,t[o],n,i,r,e[o])}for(const n in t){const t=["id","tid"];void 0===e[n]&&-1===t.indexOf(n)&&console.error(`### App Framework ### 组件${i._type} 属性'${n}'未定义,放弃属性 `)}}}(e._attrs,o.props,t,e)}function Vf(t,e,n,i={}){!function(t,e,n){(function(t,e,n){if(!n._rootElement)return;if(!t)return;const i=n._rootElement;if("function"==typeof t){const o=Zf(e,t,t=>{kf(i,"attr","class",t.join(" "))});n._parentWatchers.push(o);const r=o.value;console.warn(`### App Framework ### 自定义组件,设置了class属性:${JSON.stringify(t)},使用父组件样式`),kf(i,"prop","_useParentStyle",!0),kf(i,"attr","class",r.join(" "))}else if(null!=t){if("array"!==w(t))return new Error("mergeClassStyle: classList的类型不是数组----",t);console.warn(`### App Framework ### 自定义组件,设置了class属性:${JSON.stringify(t)},使用父组件样式`),kf(i,"prop","_useParentStyle",!0),kf(i,"attr","class",t.join(" "))}})(t.classList,e,n),function(t,e,n){if(n._rootElement)return;for(const i in t){const o=t[i];if("function"==typeof o){const t=Zf(e,o,function(t){n._rootElement&&kf(n._rootElement,"style",i,t)});n._parentWatchers.push(t);const r=t.value;kf(n._rootElement,"style",i,r)}else kf(n._rootElement,"style",i,o)}}(t.style,e,n)}(n,t,e),n.attr&&n.attr.hasOwnProperty("show")&&e._rootElement&&Jf(t,e._rootElement,"attr",{show:n.attr.show}),i.childNodes?i.childNodes[i.childNodes.length-1]._vm=e:i._vm=e}function Uf(t,e,n,i,o,r){const s=i._props;uf(t)&&console.warn(`### App Framework ### 组件${i._type}中属性 '${t}' 是保留字, 可能会导致应用运行异常`),"function"==typeof e?function(){let a=!1;const l=Zf(n,e,function(e){a=!0,s[t]=qf(t,e,o,r,i),a=!1});i._parentWatchers.push(l);const c=qf(t,l.value,o,r,i);Hf(s,t,c,()=>{a||console.error(`### App Framework ### 组件${i._type} 禁止修改props中的:${t}!如需改变,请额外在data中使用另一个名称声明`)})}():(e=qf(t,e,o,r,i),Hf(s,t,e,()=>{console.error(`### App Framework ### 组件${i._type} 禁止修改props中的:${t}!如需改变,请额外在data中使用另一个名称声明`)})),sf(i,"_props",t)}function qf(t,e,n,i,o){if(void 0===i)return e;const r=gf(Boolean,i.type);if(r>-1)if(n&&!i.hasOwnProperty("default"))e=!1;else if(""===e||e===C(t)){const t=gf(String,i.type);(t<0||r<t)&&(e=!0)}return void 0===e&&i.hasOwnProperty("default")&&(e="function"==typeof i.default&&"Function"!==ff(i.type)?i.default.call(o):i.default),function(t,e,n,i,o){if(!i.required&&null==e)return;if(i.required&&n)return void console.error(`### App Framework ### 组件${o._type} props中的:${t} 是必填字段`);let r=i.type,s=!r;const a=[];if(r){Array.isArray(r)||(r=[r]);for(let t=0;t<r.length&&!s;t++){const n=bf(e,r[t]);a.push(n.expectedType),s=n.valid}}if(!s)return void console.error(`### App Framework ### 组件${o._type} props中的:${t} type类型验证失败,期望类型为${a.join(", ")}`);const l=i.validator;l&&"function"==typeof l&&!l(e)&&console.error(`### App Framework ### 组件${o._type} props中的:${t} validator验证失败`)}(t,e,n,i,o),e}function Gf(t,e,n,i){if(!n)return;const o=Object.create(null);if(Object.defineProperties(o,{vm:{value:i,writable:!1,configurable:!1},element:{get:()=>e||i._rootElement,configurable:!1}}),"function"==typeof n){const r=n;(n=r.call(t))&&(t._ids[n]=o);const s=Zf(t,r,e=>{e&&(t._ids[e]=o)},e);t!==i&&i._parentWatchers&&i._parentWatchers.push(s)}else"string"==typeof n&&(t._ids[n]=o)}function Jf(t,e,n,i){if(!i)return;if("function"==typeof i)return void function(t,e,n,i){const o=Zf(t,i,t=>{kf(e,n,t)},e).value;kf(e,n,o)}(t,e,n,i);const o=Object.keys(i);let r=o.length;for(;r--;){const s=o[r],a=i[s];"function"==typeof a?Kf(t,e,n,s,a):kf(e,n,s,a)}}function Kf(t,e,n,i,o){const r=Zf(t,o,t=>{kf(e,n,i,t)},e).value;kf(e,n,i,r)}function Zf(t,e,n,i){const o=new zf(t,e,function(t,e){"object"!=typeof t&&t===e||n(t)});return function(t,e){t&&(t._bindWatcherList=t._bindWatcherList||[],t._bindWatcherList.push(e))}(i,o),o}function Qf(t,e,n,i){const o=t._page||{},r=o.doc||{};if(-1===o.lastSignal)return;if(e.id&&(e.attr.id=e.attr.id||e.id),i=i||{},function(t){return Array.isArray(t)}(e))return global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 编译 fragment 节点 ----",JSON.stringify(e)),void function(t,e,n,i){const o=wf(t,n);e.forEach(e=>{Qf(t,e,o,i)})}(t,e,n,i);if(function(t){return"slot"===t.type}(e))return global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 编译 slot 节点----",JSON.stringify(e)),void function(t,e,n){const i=wf(t,n);if(e.attr&&e.attr.content){const n=e.attr.content;let o=null;"string"==typeof n?"function"!=typeof(o=t[n])&&(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### slot的 content属性 ${n} 有误, 找不到对应的render函数 `),o=null):"function"==typeof n?o=n:global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### slot的 content属性 ${n} 无效`),o&&(e.children=[],e.__render=o,function(t,e,n){const i=sm(t,n,e.__render,"render",e=>{global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### Slot 节点 (${n.ref})内容更新 ----`),function(t,e,n){n?(am(e,!0),Qf(t,n,e)):am(e,!0)}(t,n,e),n.content=e});n.content=i,i&&Qf(t,i,n)}(t,e,i))}else if(t._slot){const n=t._parentContext,o=e.attr&&null!=e.attr.name&&e.attr.name||"default",r=Object.assign({},t._slot.template,{children:t._slot.namedSlotCache[o]||[]}),s={fragment:i,defaultContent:e,dynamicContent:r};global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 自定义组件${t._type}, 校验 slot 的内容`),function(t,e,n,i){const o=i.fragment,r=i.dynamicContent,s=i.defaultContent,a=r&&r.children||[];if(a.some(t=>!t.shown&&!t.repeat))global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 自定义组件 ${n} 编译动态内容 - ${JSON.stringify(r)}`),e&&e._rootElement&&(o._styleObjectId=e._rootElement._styleObjectId),rm(e,r,o);else if(0===a.length)global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 自定义组件 ${n} 编译默认内容 - ${JSON.stringify(s)}`),rm(t,s,o);else{const o=[];a.forEach((t,e)=>{o[e]=Object.create(null),t.repeat&&(o[e].for=t.repeat.exp||t.repeat),t.shown&&(o[e].if=t.shown)});const r=function(){const t=o.some(t=>{let n=!0,i=!0;return t.if&&(n=!!t.if.call(e)),t.for&&(i=!(i=t.for.call(e))||i.length>0),n&&i});return t};!function(t,e,n,i,o){const r=o.fragment;let s=sm(e,r,n,"slot",n=>{r&&nm(t,e,i,s=n,o)});nm(t,e,i,s,o)}(t,e,r,n,i)}}(t,n,t._type,s)}}(t,e,n);if(function(t){return"block"===t.type}(e))return global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 编译 block 节点 ----",JSON.stringify(e)),void function(t,e,n,i){if(Xf(e,i=i||{}))return global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 编译 block 节点 ---- for"),void im(t,e,n);if(tm(e,i))return global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 编译 block 节点 ---- if"),void om(t,e,n,i);const o=wf(t,n);rm(t,e,o)}(t,e,n,i);if(Xf(e,i))return global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 编译 for 节点----",JSON.stringify(e)),void(n===r.documentElement?global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 根节点不支持 `for` 指令!"):im(t,e,n));if(tm(e,i))return global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 编译 If 节点----",JSON.stringify(e)),void(n===r.documentElement?global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 根节点不支持 'if' 指令!"):om(t,e,n,i));const s=i.type||e.type,a=function(t,e){let n;t._page&&t._page.app&&t._page.app.customComponentMap&&"function"==typeof(n=Sf(t._page.app,t._page,e))&&(n(),n=Sf(t._page.app,t._page,e));return n}(t,s);a?function(t,e,n,i,o,r){["public","protected","private"].forEach(t=>{e.hasOwnProperty(t)&&D(e[t])&&!e.hasOwnProperty("data")&&console.warn(`### App Framework ### 自定义组件 ${o} 不支持 ${t} 数据模型,请使用 data 代替!`)}),e&&e.props&&!e._hasnormalizeProps&&(e._hasnormalizeProps=!0,function(t,e){const n=t.props,i={};let o;if(Array.isArray(n))n.forEach(t=>{"string"==typeof t?(o=A(t),i[o]={type:null}):console.warn(`### App Framework ### 组件${e} props为数组时,数组元素必须为字符串`)});else if(P(n))for(const t in n){const e=n[t];o=A(t),i[o]=P(e)?e:{type:e}}else console.warn(`### App Framework ### 组件${e} props属性值无效,必须为数组或对象`);t.props=i}(e,o),global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 格式化自定义组件 ${o} props`,JSON.stringify(e)));const s=t.constructor;global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 编译自定义组件 ${o} ----`,JSON.stringify(n));const a=new s(o,e,t,i,void 0,{"xlc:onCreate":function(){t._static&&(this._static=t._static),Gf(t,null,n.attr.id,this),this._externalBinding={parent:t,template:n},Wf(t,this,n,r.repeat)},"xlc:onInit":function(){},"xlc:onReady":function(){}},n);Vf(t,a,n,i)}(t,a,e,n,s,i):function(t,e,n,i){const o=t._page||{},r=o.doc||{},s=o.app||{};let a;global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 编译原生组件----",JSON.stringify(e)),function(t){const{type:e}=t,n=vf.quickapp.runtime.helper.getComponentDefaultOptions(e);if("object"==typeof n)for(const e in n)if(null==t[e])t[e]=n[e];else if("object"===w(t[e])&&"object"===w(n[e]))for(const i in n[e])null==t[e][i]&&(t[e][i]=n[e][i])}(e),n===r.documentElement?(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 编译Body组件 ${i}`),(a=Ef(t,i))._vm=t):(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 编译原生组件 ${i}`),a=Ef(t,i));if(e.attr=e.attr||{},!t._rootElement){t._rootElement=a;const e=s._shareDocStyle&&n===r.documentElement;vf.quickapp.runtime.helper.registerStyleObject(t._type,t._options.style,e,t._rootElement);const i=t._externalBinding||{},o=i.template,l=i.parent;if(o&&o.events&&l&&a)for(const t in o.events){const e=o.events[t],n="string"==typeof e?l[e]:e;n?Tf(a,t,of(n,l),!1):console.warn(`### App Framework ### 忽略使用自定义组件时的DOM事件绑定:${t}`)}}em(e)&&(e.content=e.attr.value,e.contentType=e.attr.type);Yf(t,a,e),e.attr&&e.attr.append&&(e.append=e.attr.append);const l="tree"===e.append;-1===o.lastSignal||l||(global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 编译单个节点----",a),o.lastSignal=xf(n,a));-1!==o.lastSignal&&(em(e)?function(t,e,n){const i=uo,o=e.contentType,r=wf(t,n);let s;s="function"==typeof e.content?sm(t,r,e.content,"html",e=>{if(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### Html 节点 (${r.ref})数据改变----`,e),am(r,!0),e&&"html"!==o){const n=i.compile(e,o);Qf(t,n,r)}}):e.content;if(s&&"html"!==o){const e=i.compile(s,o);Qf(t,e,r)}}(t,e,a):rm(t,e,a));-1!==o.lastSignal&&l&&(global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 编译整个树----",a),o.lastSignal=xf(n,a))}(t,e,n,s)}function Xf(t,e){return!e.hasOwnProperty("repeat")&&t.repeat}function tm(t,e){return!e.hasOwnProperty("shown")&&t.shown}function em(t){return"richtext"===t.type}function nm(t,e,n,i,o){const r=o.fragment,s=o.dynamicContent,a=o.defaultContent;i?(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### ${n} 组件 (${r.ref}) 编译动态内容 - ${JSON.stringify(s)}`),am(r,!0),e&&e._rootElement&&(r._styleObjectId=e._rootElement._styleObjectId),rm(e,s,r)):(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### ${n} 组件 (${r.ref}) 编译默认内容 - ${JSON.stringify(a)}`),am(r,!0),delete r._styleObjectId,rm(t,a,r))}function im(t,e,n){const i=e.repeat;let o=i.exp||i;"function"!=typeof o&&(o=function(){return[]});const r=i.key||"$idx",s=i.value||"$item",a=e.attr&&e.attr.tid,l=wf(t,n);l.data=[],l.vms=[],function(t,e,n,i){const o=n.vms,{getter:r,tid:s}=i,a=i.key,l=i.value;function c(t,i,r){const s={};s[a]=i,s[l]=t;const c=function(t,e){const n=Object.create(t);n._data=e,function(t){t._watchers=[];let e=t._data;P(e)||(e={});const n=Object.keys(e),i=["$idx","$item","$evt"];let o=n.length;for(;o--;){const e=n[o];i.indexOf(e)>-1||!N(e)?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){return t._data[e]},set:function(n){t._data[e]=n}}):console.error(`### App Framework ### 页面数据属性名 '${e}' 非法, 属性名不能以$或_开头`)}jf.$ob(e,t)}(n),n._realParent=t,t._static&&(n._static=t._static);return n}(r,s);o.push(c),Qf(c,e,n,{repeat:t})}const d=sm(t,n,r,"for",e=>{if(!n||!e)return;global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### For 节点被改变----",e);const i=n.layoutChildren.slice(),r=o.slice(),d=n.data.slice(),h={},p={};e.forEach((t,e)=>{const n="@"+(s?t[s]:e);null!=n&&"@"!==n?(h[n]||(h[n]=[]),h[n].push(t),h[n].length>1&&console.warn(`### App Framework ### for 循环数据的tid 属性 '${n} 不唯一, 可能导致性能问题`)):console.error("### App Framework ### for 循环数据的tid 属性不存在或为空")}),d.forEach((t,e)=>{const n="@"+(s?t[s]:e),o=h[n];o&&o.length>0?(p[n]||(p[n]=[]),p[n].push({item:t,index:e,key:n,target:i[e],vm:r[e]})):am(i[e])}),vf.quickapp.runtime.helper.resetNodeChildren(n),o.length=0,n.data=e.slice(),e.forEach((e,i)=>{const r="@"+(s?e[s]:i),d=p[r];if("object"==typeof d&&d.length>0){const t=d.shift(),r=t.target;vf.quickapp.runtime.helper.restoreNodeChildren(n,r),o.push(t.vm),t.vm[l]=e,t.vm[a]=i}else c(e,i,t)}),Object.keys(p).forEach(t=>{for(;p[t].length;){const e=p[t].shift();am(e.target)}})});d&&d.length>0?(n.data=d.slice(0),d.forEach((e,n)=>{c(e,n,t)})):n.data=[]}(t,e,l,{getter:o,key:r,value:s,tid:a})}function om(t,e,n,i){const o={shown:!0},r=wf(t,n);i.hasOwnProperty("repeat")&&(o.repeat=i.repeat),function(t,e,n,i){let o=!!sm(t,n,e.shown,"if",r=>{global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### If 节点 (${n.ref})状态改变----`,r),n&&o!==!!r&&(o=!!r,r?Qf(t,e,n,i):am(n,!0))});o&&Qf(t,e,n,i)}(t,e,r,o)}function rm(t,e,n){const i=t._page||{},o=e.children;if(o&&o.length)for(let e=0,r=o.length;e<r&&-1!==i.lastSignal;e++)global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 编译孩子节点----",o[e].type),Qf(t,o[e],n)}function sm(t,e,n,i,o){return Zf(t,n,n=>{t.$valid?!function(t){return vf.quickapp.runtime.helper.isNodeInDocument(t)}(e)?global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 节点(${e.ref})已删除:${JSON.stringify(e)}`):o(n):console.error("### App Framework ### 试图更新已销毁页面")},e).value}function am(t,e=!1){t&&(function t(e,n=!1){const i=(e.childNodes||[]).slice();for(let e=0,n=i.length;e<n;e++)t(i[e],!1);n||(function(t){if(t._bindWatcherList){const e=t._bindWatcherList;for(let t=0,n=e.length;t<n;t++)e[t].close();delete t._bindWatcherList}}(e),e._vm&&(Lf(e._vm),delete e._vm))}(t,e),function(t,e=!1){const n=t.parentNode;if(n)if(e){const e=(t.childNodes||[]).slice();for(let n=0,i=e.length;n<i;n++)t.removeChild(e[n])}else n.removeChild(t)}(t,e))}class lm{constructor(t,e){if(e instanceof lm)return e;this.timestamp=Date.now(),this.detail=e,this.type=t;let n=!1;this.stop=function(){n=!0},this.hasStopped=function(){return n}}}const cm=["onCreate","onInit","onReady","onShow","onHide","onDestroy","onBackPress","onMenuPress","onOrientationChange","onRefresh"];lm.reserveEvents=cm,lm.isReservedEvent=function(t){return cm.indexOf(t)>=0};const dm=["public","protected","private"];let hm=null;function pm(t){t._watchers=[];let e=t._data;P(e)||(e={});const n=Object.keys(e);let i=n.length;for(;i--;){const e=n[i];uf(e)&&console.warn(`### App Framework ### data 属性 '${e}' 是保留字, 可能会导致应用运行异常`),nf(t._props,e)&&(console.warn(`### App Framework ### data 请在data中使用另一个名称声明:${e},不要与props重复`),t._attrs.hasOwnProperty(e))||sf(t,"_data",n[i])}jf.$ob(e,t);const o=t._methods;if(o)for(const n in o)e.hasOwnProperty(n)&&console.warn(`### App Framework ### 检测到同名数据属性和方法:${n},可能导致异常`),t._options&&t._options.computed&&t._options.computed.hasOwnProperty(n)?console.warn(`### App Framework ### 检测到同名计算属性和方法:${n},方法定义无效`):t[n]=o[n];!function(t){let e=t._options.computed;e=P(e)?e:{};for(const n in e){let i=e[n];if(uf(n)&&console.warn(`### App Framework ### computed 属性 ${n} 是保留字, 可能会导致应用运行异常`),t.hasOwnProperty(n)){console.warn(`### App Framework ### computed 实例已定义 ${n} 属性,不可重复设置`);continue}const o={enumerable:!0,configurable:!0,get:function(){},set:function(){console.warn(`### App Framework ### computed 计算属性:${n} 未设置setter函数`)}};if("function"==typeof i&&(o.get=um(i,t),Object.defineProperty(t,n,o)),"object"==typeof i){if("function"!=typeof(i=i||{}).get){console.warn(`### App Framework ### computed 请设置计算属性:${n} 的getter函数`);continue}o.get=um(i.get,t),"function"==typeof i.set&&(o.set=i.set),Object.defineProperty(t,n,o)}"function"!=typeof i&&"object"!=typeof i&&console.warn(`### App Framework ### computed 请正确设置计算属性:${n}`)}}(t)}function um(t,e){const n=new zf(e,t,function(){},{lazy:!0});return function(){return n.dirty&&n.evaluate(),Nf.target&&n.depend(),n.value}}let fm=1;class mm{constructor(t,e,n,i,o,r,s){const a=(n=n||{})instanceof mm?n:void 0,l=n._page;this.__id__=fm++,this._type=t,this._page=l||{},this._parent=n._realParent?n._realParent:a,this._root=this._parent?this._parent._root:this,this._parentContext=a,this._attrs={},this._destroyed=!1,Object.defineProperties(this,{$valid:{get:()=>!!l&&l._valid,configurable:!1},$visible:{get:()=>!!l&&l._valid&&l._visible,configurable:!1},$destroyed:{get:()=>this._destroyed,configurable:!1}}),s&&function(t,e){const n={};(e.children||[]).forEach(t=>{if(n.default=n.default||[],null==t.attr.slot)n.default.push(t);else{const e=t.attr.slot;n[e]=n[e]||[],n[e].push(t)}}),t._slot={template:e,namedSlotCache:n}}(this,s),n&&n._childrenVms&&n._childrenVms.push(this),this._parentElement=i||this._page.doc.documentElement,!e&&this._page.app&&this._page.app.customComponentMap&&(e=Sf(this._page.app,this._page,t));const c=(e=e||{}).data||{};var d;(this._options=e,this._methods={},Object.keys(e).forEach(t=>{if(function(t){return hf.indexOf(t)>=0}(t)&&"computed"!==t||lm.isReservedEvent(t)&&"onRefresh"!==t)return;if("onRefresh"===t){if(global.isRpkMinPlatformVersionGEQ(1050))return;console.warn("### App Framework ### onRefresh()为1050版本中新增的Vm生命周期,不再当做Vm方法"),console.warn("### App Framework ### 如果用于方法调用或组件事件响应,请使用其它名称,后续版本不再兼容")}if("computed"===t){if(global.isRpkMinPlatformVersionGEQ(1050))return;console.warn("### App Framework ### computed为1050版本中新增的计算属性,不再当做Vm方法"),console.warn("### App Framework ### 如果用于方法调用或组件事件响应,请使用其它名称,后续版本不再兼容")}const n=e[t];"function"==typeof n&&(this._methods[t]=n)}),this._ids={},this._vmEvents={},this._childrenVms=[],this._props={},this._parentWatchers=[],function(t,e){const n=t._options||{},i=n.events||{};for(const e in i)t.$on(e,i[e]);for(const n in e)t.$on(n,e[n]);lm.reserveEvents.forEach(e=>{t.$on(`xlc:${e}`,n[e])})}(this,r),global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 组件Vm(${this._type})初始化完成`),this.$emit("xlc:onCreate"),this._created=!0,"function"==typeof c?this._data=c.call(this)||{}:(this._data={},S(this._data,c)),this._page&&this._page.app&&S(this._data,this._page.app.$data),function(t,e){if(t._parent)return;if(!e)return;if(!t._options._descriptor)return void S(t._data,e);let n=t._page.intent&&t._page.intent.fromExternal;t._page.intent&&void 0!==t._page.intent.fromExternal||(n=!0),global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 页面VM中声明的权限定义:${JSON.stringify(t._options._descriptor)}`),t._options.props&&!function(t){for(const e in t)return!1;return!0}(e)&&console.warn("### App Framework ### 页面VM中不支持props,推荐在public或protected中声明参数");for(const i in e){const o=t._options._descriptor[i];if(!o){global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 传递外部数据${i}在VM中未声明,放弃更新`);continue}const r=n&&dm.indexOf(o.access)>0,s=!n&&dm.indexOf(o.access)>1;r||s?console.warn(`### App Framework ### 传递外部数据${i}在VM中声明为${o.access},放弃更新`):(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 传递外部数据${i},原值为:${JSON.stringify(t._data[i])}`),global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 传递外部数据${i},新值为:${JSON.stringify(e[i])}`),t._data[i]=e[i])}}(this,o),pm(this),global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 组件Vm(${this._type})创建成功`),this._emit("xlc:onInit",this._root===this?this._page._meta.query:void 0),this._inited=!0,this._page.doc)&&(Qf(d=this,(d._options||{}).template||{},d._parentElement),global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 组件Vm (${d._type}) UI准备就绪`),d.$emit("xlc:onReady"),d._ready=!0)}_isVmDestroyed(){return this._destroyed&&console.warn(`### App Framework ### 组件Vm(${this._type})已销毁,中断Vm方法的调用`),this._destroyed}get $app(){return global.Env.engine===global.ENGINE_TYPE.CARD?null:this._isVmDestroyed()?void 0:this._page.app}get $page(){if(global.Env.engine===global.ENGINE_TYPE.CARD)return null;if(this._isVmDestroyed())return;const t=this._page,e=t.app;return Object.assign({setTitleBar:function(e){t&&t.doc&&(console.log(`### App Framework ### 页面 ${t.id} 调用 setTitleBar ----`),vf.quickapp.runtime.helper.updatePageTitleBar(t.doc,e))},setStatusBar:function(e){t&&t.doc&&(console.log(`### App Framework ### 页面 ${t.id} 调用 setStatusBar ----`),vf.quickapp.runtime.helper.updatePageStatusBar(t.doc,e))},exitFullscreen:function(){t&&t.doc&&(console.log(`### App Framework ### 页面 ${t.id} 调用 exitFullscreen ----`),vf.quickapp.runtime.helper.exitFullscreen(t.doc))},finish:function(){t&&t.doc&&(null===hm&&(hm=vf.quickapp.platform.requireModule(e,"system.page")),hm.finishPage(t.id))}},t&&t._meta)}$parent(){return this._parent}$root(){return this._root}$emit(t,e){if(this._isVmDestroyed())return;const n=this._vmEvents[t];if(n){const i=new lm(t,e),o=[];return n.forEach(t=>{o.push(t.call(this,i))}),o.length>0&&o[0]}return!1}_emit(t,e,...n){if(this._isVmDestroyed())return;const i=this._vmEvents[t];if(i){const t=[];return i.forEach(i=>{t.push(i.call(this,e,...n))}),t.length>0&&t[0]}return!1}$emitElement(t,e,n=-1){if(this._isVmDestroyed())return;if(-1===n||void 0===n)n=void 0;else if("string"!=typeof n)return void console.error("### App Framework ### emitElement的参数id不合法");const i=this.$element(n);if(i)return Af(i,t,{detail:e});console.error(`### App Framework ### emitElement执行失败: 找不到id为 '${n}' 的组件`)}$dispatch(t,e){if(this._isVmDestroyed())return;const n=new lm(t,e);this.$emit(t,n),!n.hasStopped()&&this._parent&&this._parent.$dispatch&&this._parent.$dispatch(t,n)}$broadcast(t,e){if(this._isVmDestroyed())return;const n=new lm(t,e);this.$emit(t,n),!n.hasStopped()&&this._childrenVms&&this._childrenVms.forEach(e=>{e.$broadcast(t,n)})}$on(t,e){if(this._isVmDestroyed())return;if(!t||"function"!=typeof e)return;const n=this._vmEvents,i=n[t]||[];i.push(e),n[t]=i}$off(t,e){if(this._isVmDestroyed())return;if(!t)return;const n=this._vmEvents;if(!e)return void delete n[t];const i=n[t];i&&i.$remove(e)}$forceUpdate(){if(this._isVmDestroyed())return;const t=this._page;t&&t.doc&&(console.log(`### App Framework ### 强制更新页面 ---- ${t.id}`),Of(t))}$set(t,e){if(this._isVmDestroyed())return;mm.parseExpression(t).set.call(this,this,e)}$delete(t){if(this._isVmDestroyed())return;const e=this._data;mm.delete(e,t)}$watch(t,e){if(this._isVmDestroyed())return;const n=this;if("string"!=typeof t||"string"!=typeof e)return void console.error("### App Framework ### $watch调用异常: 参数的数据类型非法, 必须是字符串");if(!this._methods[e])return void console.warn(`### App Framework ### $watch调用异常: 句柄函数名 '${e}' 没有定义`);return new zf(n,function(){return mm.getPath(n,t)},function(t,i){"object"!=typeof t&&t===i||n[e](t,i)}).value}_digest(){const t=this._watchers.length;for(let e=0;e<t;e++)this._watchers[e].update(!0)}}mm.parseExpression=function(t){return{exp:t,get:function(e){return mm.getPath(e,t)},set:function(e,n){mm.setPath(e,t,n)}}},mm.getPath=function(t,e){if(/[^\w.$]/.test(e))return void console.warn(`### App Framework ### getPath调用: 观察对象 '${e}' 不合法`);const n=e.split("."),i=n.pop(),o=n.length;for(let i=0;i<o;i++){const o=n[i];if(N(o))return void console.warn(`### App Framework ### getPath调用: 属性名 '${o}' 不能以 $ 或 _ 开头`);if(!t[o])return void console.warn(`### App Framework ### getPath调用: 属性名 '${o}' 在 '${e}' 中值为:${t[o]}`);t=t[o]}return t[i]},mm.setPath=function(t,e,n){if(/[^\w.$]/.test(e))return void console.warn(`### App Framework ### setPath调用: 观察对象 '${e}' 不合法`);const i=e.split("."),o=i.pop(),r=i.length;for(let n=0;n<r;n++){const o=i[n];if(N(o))return void console.warn(`### App Framework ### setPath调用: 属性名 '${o}' 不能以 $ 或 _ 开头`);if(!t[o])return void console.warn(`### App Framework ### setPath调用: 属性名 '${o}' 在 '${e}' 中值为:${t[o]}`);t=t[o]}mm.set(t,o,n)},mm.set=function(t,e,n){if(null==t)return;if(t instanceof mm)return void mm.set(t._data,e,n);if(Array.isArray(t))return t.splice(e,1,n);if(nf(t,e))return void(t[e]=n);const i=t.__ob__;if(i){if(i.convert(e,n),i.dep.notify(),i.vms){let t=i.vms.length;for(;t--;){const n=i.vms[t];sf(n,"_data",e),n._digest()}}return n}t[e]=n},mm.delete=function(t,e){if(null==t)return;if(!nf(t,e))return;delete t[e];const n=t.__ob__;if(n&&(n.dep.notify(),n.vms)){let t=n.vms.length;for(;t--;){const i=n.vms[t];af(i,e),i._digest()}}},mm.initVmMethods=function(t){const e=mm.prototype;for(const n in t)e.hasOwnProperty(n)||(e[n]=t[n])},mm.registerMethods=function(t){"string"==typeof t&&(t=JSON.parse(t)),"object"==typeof t&&mm.initVmMethods(t)};const gm=function(t,e,n){let i;if(console.log(`### App Framework ### 启动App---- ${e}`),!j(e))return new Error(`bootstrap: 错误App名: ${e}`);i=$(e),n=P(n)?n:{},t.name=i,global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 调用App(${i})生命周期---- onCreate`),t.$emit("applc:onCreate")},ym=function(t,e,...n){let i,o;if(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 定义App---- ${e}`),"function"==typeof(o=n.length>1?n[1]:n[0])&&(i=o,o=null),!j(e))return new Error(`define: 无效应用名 ${e}`);if(i){const e={exports:{}};i(e=>vf.quickapp.platform.requireModule(t,$(e)),e.exports,e),o=e.exports}t.$def=o};let bm=1;class vm{constructor(t,e){this.id=t,this.inst=e,this.taskList=[],this.taskHash=new Set,this.needSort=!1,this.nextTick=0,this.warnSize=1e4,this.execMode=vm.MODE.SYNC}join(t){Array.isArray(t)||(t=[t]);for(let e=0,n=t.length;e<n;e++){const n=t[e];this.taskHash.has(n)?global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### XExecutor.join() 过滤重复task:${n.getter||n}`):(this.taskList.push(n),this.taskHash.add(n),!this.needSort&&(this.needSort=!0),global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### XExecutor.join() 添加单个task:${n.getter||n}`))}this._defineNextTick()}exec(){let t;switch(this.execMode){case vm.MODE.SYNC:t=this._execSync(),global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### XExecutor.exec() 执行:${this.id}:${bm}`),bm++}if(this.taskList.length>0||this.taskHash.size>0)throw new Error("### App Framework ### XExecutor.exec() 异常:存在未执行的任务");return t}reset(){this.taskList.length=0,this.taskHash.clear(),this.needSort&&(this.needSort=!1)}_execSync(){global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### XExecutor._execSync() 开始:${this.taskList.length}`);let t=0;for(;this._hasTask();){this.needSort&&this._sort();const e=this.taskList.shift();this.taskHash.delete(e);try{e.id?e.run():e()}catch(t){throw this.reset(),t}++t>this.warnSize&&console.warn(`### App Framework ### XExecutor._execSync() 循环次数已达:${t}`)}return global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### XExecutor._execSync() 结束:${this.taskList.length}`),this.inst.doc.listener.hasActions()}_sort(){const t=[],e=this.taskList.length;for(let n=0;n<=e;n++){const e=this.taskList[n];e&&e.id?t.push(e):t.length>0&&(t.sort((t,e)=>t.id-e.id),this.taskList.splice.apply(this.taskList,[n-t.length,t.length].concat(t)),t.splice(0))}this.needSort=!1}_hasTask(){return this.taskList.length>0}_defineNextTick(){this.nextTick||(this.nextTick=Promise.resolve().then(()=>{this.nextTick=null,this.inst&&this.inst.$valid&&(global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### XExecutor._defineNextTick() Actions尝试轮询"),Of(this.inst))}))}}vm.MODE={SYNC:1};const Em=function(t,e,n,i){let o;if(console.log(`### App Framework ### 启动页面---- ${e}`),!H(e))return new Error(`bootstrap: 错误页面名: ${e}`);o=$(e),n=P(n)?n:{},t.name=o,global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 创建页面VM---- ${o}`),t.vm=new mm(o,null,{_page:t},null,i,{})},wm=function(t,e,...n){let i,o;if(global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 定义组件---- ${e}`),"function"==typeof(o=n.length>1?n[1]:n[0])&&(i=o,o=null),!H(e))return new Error(`define: 非法组件名 ${e}, 必须是"@app-component/XXXX"格式`);if(i){const e={exports:{}};i(e=>vf.quickapp.platform.requireModule(t,$(e)),e.exports,e,e.exports),o=e.exports,global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 初始化组件配置----",JSON.stringify(o))}const r=$(e);global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 注册自定义组件---- ${r}`),Cf(t.app,t,r,o)},xm=function(t,e,n){const i=$(e);global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 注册自定义组件的包装函数---- ${i}`),Cf(t.app,t,i,n)};function Tm(t,e,n,...i){let o=!1;return e.vm&&e.vm._ready?(o=e.vm._emit(`xlc:${t}`,n,...i),Of(e),global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 页面(${e.id})触发事件(${t})完毕`)):global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 页面(${e.id})触发事件(${t})失败`),!!o}const Am={onShow:"onShow",onHide:"onHide",onBackPress:"onBackPress",onMenuPress:"onMenuPress",onOrientationChange:"onOrientationChange",onRefresh:"onRefresh"};var km={init:function(t){vf.quickapp=t,t.subscribe(fo.initApp,t=>(function(t,e){let n;global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 开始初始化App(${t.id})`);const i=(...e)=>ym(t,...e),o=(e,i)=>{n=gm(t,e,i),console.log(`### App Framework ### 完成App初始化(${t.id})----`)},r=e=>vf.quickapp.platform.requireModule(t,$(e));let s;return"function"==typeof e?s=e:e&&(s=`(function(global){"use strict"; ${s=e.toString()} \n })(Object.create(this))`),global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 开始编译代码----"),global.$app_define$=i,global.$app_bootstrap$=o,global.$app_require$=r,s(),n})(...t)),t.subscribe(fo.initPage,t=>(Nf.resetTarget(),function(t,e,n,i){let o;global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 开始初始化页面(${t.id})---- `,JSON.stringify(n)),t.executor=new vm(t.id,t);const r=(...e)=>wm(t,...e),s=(e,i)=>{o=Em(t,e,i,n),t.doc.listener.createFinish(),global.Env&&"trace"===global.Env.logLevel&&console.trace(`### App Framework ### 完成实例初始化(${t.id})----`)},a=(e,n)=>xm(t,e,n);let l;return t.doc,"function"==typeof e?l=e:e&&(l=`(function(global){"use strict"; ${l=e.toString()} \n })(Object.create(this))`),global.Env&&"trace"===global.Env.logLevel&&console.trace("### App Framework ### 开始编译代码----"),global.$app_define$=r,global.$app_bootstrap$=s,global.$app_require$=(t.doc,e=>vf.quickapp.platform.requireModule(t,$(e))),global.$app_define_wrap$=a,global.setTimeout=i.setTimeout,global.setInterval=i.setInterval,global.clearTimeout=i.clearTimeout,global.clearInterval=i.clearInterval,global.requestAnimationFrame=i.requestAnimationFrame,global.cancelAnimationFrame=i.cancelAnimationFrame,l(),o}(...t))),t.subscribe(fo.destroyPage,t=>{Nf.resetTarget(),Df(...t)}),t.subscribe(fo.fireEvent,t=>{const e=Mf(...t);return Of(t[0]),e}),t.subscribe(fo.callbackDone,t=>{Of(t[0])}),t.subscribe(fo.onShow,t=>Tm(Am.onShow,...t)),t.subscribe(fo.onHide,t=>Tm(Am.onHide,...t)),t.subscribe(fo.onBackPress,t=>Tm(Am.onBackPress,...t)),t.subscribe(fo.onMenuPress,t=>{const e=function(t){let e=!1;if(t.vm&&t.vm._ready){const n=t.vm._vmEvents,i=n&&n["xlc:onMenuPress"];i&&i.length&&(e=!0)}return e}(...t);return Tm(Am.onMenuPress,...t),e}),t.subscribe(fo.onOrientationChange,t=>Tm(Am.onOrientationChange,...t)),t.subscribe(fo.onRefresh,t=>Tm(Am.onRefresh,...t))}};function _m(t){switch(w(t)){case"undefined":case"null":return"";case"number":case"boolean":case"function":case"regexp":return t.toString();case"date":return t.toISOString();case"string":return t;default:return JSON.stringify(t)}}const Cm={$child:function(t){const e=this._ids[t];if(e)return e.vm._destroyed&&console.warn(`### App Framework ### 组件Vm(${e.vm._type})已销毁`),e.vm},$vm:function(t){const e=this._ids[t];if(e)return e.vm},$element:function(t){if(void 0===t)return"function"==typeof this.$rootElement&&this.$rootElement();const e=this._ids[t];return e?(vf.quickapp.dock.bindComponentMethods(e.vm._page||{},e.element),e.element):void 0},$rootElement:function(){if(this._rootElement)return vf.quickapp.dock.bindComponentMethods(this._page||{},this._rootElement),this._rootElement},$config:function(){if(this._destroyed&&console.error(`### App Framework ### 组件Vm(${this._type})已销毁`),this._page&&this._page.app&&this._page.app.options)return this._page.app.options;console.error("### App Framework ### 获取配置失败!")},$createElement:function(t,e,n){const i=uo,o={__jsx__:!0,type:t,attr:{},events:{},style:{},classList:[],children:[]};function r(t,e){return{type:"text"===t?"span":"text",attr:{value:_m(e)}}}function s(t){return"object"===w(t)&&t.__jsx__}return e&&Object.keys(e).forEach(t=>{const n=e[t];if("style"===t)n.split(";").forEach(function(t){let e,n,r=t.trim().split(":");r.length>2&&(r[1]=r.slice(1).join(":"),r=r.slice(0,2)),2===r.length&&(e=r[0].trim(),(n=i.validateStyle(e,r[1].trim())).value&&n.value.forEach(t=>{o.style[t.n]=t.v}),n.log&&console.error("### App Parser ###",n.log))});else if("class"===t)o.classList=n.split(/\s+/);else if("id"===t)o.id=n;else if(t.match(/^(on|@)/)){const e=t.replace(/^(on|@)/,"");e&&(o.events[e]=n)}else o.attr[t]=n}),n&&n.length&&n.forEach(e=>{Array.isArray(e)?function e(n,i){n.forEach(n=>{Array.isArray(n)?e(n,i):"span"===t||"a"===t?i.attr.value=n:i.children.push(s(n)?n:r(t,n))})}(e,o):null!=e&&("span"===t||"a"===t?o.attr.value=_m(e):o.children.push(s(e)?e:r(t,e)))}),o},$extend:Object.assign||function(t){for(let e=1;e<arguments.length;e++){const n=arguments[e];for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t},$stringify:_m};mm.registerMethods(Cm),Object.freeze(mm),global.registerDsl(km)});
|