mazey-wechat-launch-app
Version:
Launch App in WeChat/Weixin
7 lines (6 loc) • 34.5 kB
JavaScript
/*!
* mazey-wechat-launch-app v2.3.6 https://www.npmjs.com/package/mazey-wechat-launch-app
* (c) 2018-2025 Cheng
* Released under the MIT License.
*/
;var t=require("mazey"),e=require("jquery"),n=require("js-sha1");function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=r(e),i=r(n),a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(t,e){return t(e={exports:{}},e.exports),e.exports}var u,f,s=function(t){return t&&t.Math===Math&&t},l=s("object"==typeof globalThis&&globalThis)||s("object"==typeof window&&window)||s("object"==typeof self&&self)||s("object"==typeof a&&a)||s("object"==typeof a&&a)||function(){return this}()||Function("return this")(),p=function(t){try{return!!t()}catch(t){return!0}},d=!p(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),h=!p(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}),v=Function.prototype.call,y=h?v.bind(v):function(){return v.apply(v,arguments)},g={}.propertyIsEnumerable,m=Object.getOwnPropertyDescriptor,w=m&&!g.call({1:2},1)?function(t){var e=m(this,t);return!!e&&e.enumerable}:g,b={f:w},S=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},O=Function.prototype,A=O.call,E=h&&O.bind.bind(A,A),P=h?E:function(t){return function(){return A.apply(t,arguments)}},T=P({}.toString),_=P("".slice),L=function(t){return _(T(t),8,-1)},j=Object,x=P("".split),C=p(function(){return!j("z").propertyIsEnumerable(0)})?function(t){return"String"===L(t)?x(t,""):j(t)}:j,I=function(t){return null==t},R=TypeError,k=function(t){if(I(t))throw new R("Can't call method on "+t);return t},N=function(t){return C(k(t))},M="object"==typeof document&&document.all,U=void 0===M&&void 0!==M?function(t){return"function"==typeof t||t===M}:function(t){return"function"==typeof t},D=function(t){return"object"==typeof t?null!==t:U(t)},B=function(t,e){return arguments.length<2?(n=l[t],U(n)?n:void 0):l[t]&&l[t][e];var n},H=P({}.isPrototypeOf),W=l.navigator,F=W&&W.userAgent,z=F?String(F):"",G=l.process,q=l.Deno,V=G&&G.versions||q&&q.version,X=V&&V.v8;X&&(f=(u=X.split("."))[0]>0&&u[0]<4?1:+(u[0]+u[1])),!f&&z&&(!(u=z.match(/Edge\/(\d+)/))||u[1]>=74)&&(u=z.match(/Chrome\/(\d+)/))&&(f=+u[1]);var J=f,Y=l.String,K=!!Object.getOwnPropertySymbols&&!p(function(){var t=Symbol("symbol detection");return!Y(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&J&&J<41}),Q=K&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,$=Object,Z=Q?function(t){return"symbol"==typeof t}:function(t){var e=B("Symbol");return U(e)&&H(e.prototype,$(t))},tt=String,et=function(t){try{return tt(t)}catch(t){return"Object"}},nt=TypeError,rt=function(t){if(U(t))return t;throw new nt(et(t)+" is not a function")},ot=function(t,e){var n=t[e];return I(n)?void 0:rt(n)},it=TypeError,at=Object.defineProperty,ct=function(t,e){try{at(l,t,{value:e,configurable:!0,writable:!0})}catch(n){l[t]=e}return e},ut=c(function(t){var e="__core-js_shared__",n=t.exports=l[e]||ct(e,{});(n.versions||(n.versions=[])).push({version:"3.45.0",mode:"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.45.0/LICENSE",source:"https://github.com/zloirock/core-js"})}),ft=function(t,e){return ut[t]||(ut[t]=e||{})},st=Object,lt=function(t){return st(k(t))},pt=P({}.hasOwnProperty),dt=Object.hasOwn||function(t,e){return pt(lt(t),e)},ht=0,vt=Math.random(),yt=P(1.1.toString),gt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+yt(++ht+vt,36)},mt=l.Symbol,wt=ft("wks"),bt=Q?mt.for||mt:mt&&mt.withoutSetter||gt,St=function(t){return dt(wt,t)||(wt[t]=K&&dt(mt,t)?mt[t]:bt("Symbol."+t)),wt[t]},Ot=TypeError,At=St("toPrimitive"),Et=function(t,e){if(!D(t)||Z(t))return t;var n,r=ot(t,At);if(r){if(void 0===e&&(e="default"),n=y(r,t,e),!D(n)||Z(n))return n;throw new Ot("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var n,r;if("string"===e&&U(n=t.toString)&&!D(r=y(n,t)))return r;if(U(n=t.valueOf)&&!D(r=y(n,t)))return r;if("string"!==e&&U(n=t.toString)&&!D(r=y(n,t)))return r;throw new it("Can't convert object to primitive value")}(t,e)},Pt=function(t){var e=Et(t,"string");return Z(e)?e:e+""},Tt=l.document,_t=D(Tt)&&D(Tt.createElement),Lt=function(t){return _t?Tt.createElement(t):{}},jt=!d&&!p(function(){return 7!==Object.defineProperty(Lt("div"),"a",{get:function(){return 7}}).a}),xt=Object.getOwnPropertyDescriptor,Ct={f:d?xt:function(t,e){if(t=N(t),e=Pt(e),jt)try{return xt(t,e)}catch(t){}if(dt(t,e))return S(!y(b.f,t,e),t[e])}},It=d&&p(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),Rt=String,kt=TypeError,Nt=function(t){if(D(t))return t;throw new kt(Rt(t)+" is not an object")},Mt=TypeError,Ut=Object.defineProperty,Dt=Object.getOwnPropertyDescriptor,Bt="enumerable",Ht="configurable",Wt="writable",Ft={f:d?It?function(t,e,n){if(Nt(t),e=Pt(e),Nt(n),"function"==typeof t&&"prototype"===e&&"value"in n&&Wt in n&&!n[Wt]){var r=Dt(t,e);r&&r[Wt]&&(t[e]=n.value,n={configurable:Ht in n?n[Ht]:r[Ht],enumerable:Bt in n?n[Bt]:r[Bt],writable:!1})}return Ut(t,e,n)}:Ut:function(t,e,n){if(Nt(t),e=Pt(e),Nt(n),jt)try{return Ut(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new Mt("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},zt=d?function(t,e,n){return Ft.f(t,e,S(1,n))}:function(t,e,n){return t[e]=n,t},Gt=Function.prototype,qt=d&&Object.getOwnPropertyDescriptor,Vt=dt(Gt,"name"),Xt={EXISTS:Vt,PROPER:Vt&&"something"===function(){}.name,CONFIGURABLE:Vt&&(!d||d&&qt(Gt,"name").configurable)},Jt=P(Function.toString);U(ut.inspectSource)||(ut.inspectSource=function(t){return Jt(t)});var Yt,Kt,Qt,$t=ut.inspectSource,Zt=l.WeakMap,te=U(Zt)&&/native code/.test(String(Zt)),ee=ft("keys"),ne=function(t){return ee[t]||(ee[t]=gt(t))},re={},oe="Object already initialized",ie=l.TypeError,ae=l.WeakMap;if(te||ut.state){var ce=ut.state||(ut.state=new ae);ce.get=ce.get,ce.has=ce.has,ce.set=ce.set,Yt=function(t,e){if(ce.has(t))throw new ie(oe);return e.facade=t,ce.set(t,e),e},Kt=function(t){return ce.get(t)||{}},Qt=function(t){return ce.has(t)}}else{var ue=ne("state");re[ue]=!0,Yt=function(t,e){if(dt(t,ue))throw new ie(oe);return e.facade=t,zt(t,ue,e),e},Kt=function(t){return dt(t,ue)?t[ue]:{}},Qt=function(t){return dt(t,ue)}}var fe={set:Yt,get:Kt,has:Qt,enforce:function(t){return Qt(t)?Kt(t):Yt(t,{})},getterFor:function(t){return function(e){var n;if(!D(e)||(n=Kt(e)).type!==t)throw new ie("Incompatible receiver, "+t+" required");return n}}},se=c(function(t){var e=Xt.CONFIGURABLE,n=fe.enforce,r=fe.get,o=String,i=Object.defineProperty,a=P("".slice),c=P("".replace),u=P([].join),f=d&&!p(function(){return 8!==i(function(){},"length",{value:8}).length}),s=String(String).split("String"),l=t.exports=function(t,r,l){"Symbol("===a(o(r),0,7)&&(r="["+c(o(r),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),l&&l.getter&&(r="get "+r),l&&l.setter&&(r="set "+r),(!dt(t,"name")||e&&t.name!==r)&&(d?i(t,"name",{value:r,configurable:!0}):t.name=r),f&&l&&dt(l,"arity")&&t.length!==l.arity&&i(t,"length",{value:l.arity});try{l&&dt(l,"constructor")&&l.constructor?d&&i(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var p=n(t);return dt(p,"source")||(p.source=u(s,"string"==typeof r?r:"")),t};Function.prototype.toString=l(function(){return U(this)&&r(this).source||$t(this)},"toString")}),le=function(t,e,n,r){r||(r={});var o=r.enumerable,i=void 0!==r.name?r.name:e;if(U(n)&&se(n,i,r),r.global)o?t[e]=n:ct(e,n);else{try{r.unsafe?t[e]&&(o=!0):delete t[e]}catch(t){}o?t[e]=n:Ft.f(t,e,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},pe=Math.ceil,de=Math.floor,he=Math.trunc||function(t){var e=+t;return(e>0?de:pe)(e)},ve=function(t){var e=+t;return e!=e||0===e?0:he(e)},ye=Math.max,ge=Math.min,me=Math.min,we=function(t){return e=t.length,(n=ve(e))>0?me(n,9007199254740991):0;var e,n},be=function(t){return function(e,n,r){var o=N(e),i=we(o);if(0===i)return!t&&-1;var a,c=function(t,e){var n=ve(t);return n<0?ye(n+e,0):ge(n,e)}(r,i);if(t&&n!=n){for(;i>c;)if((a=o[c++])!=a)return!0}else for(;i>c;c++)if((t||c in o)&&o[c]===n)return t||c||0;return!t&&-1}},Se={includes:be(!0),indexOf:be(!1)}.indexOf,Oe=P([].push),Ae=function(t,e){var n,r=N(t),o=0,i=[];for(n in r)!dt(re,n)&&dt(r,n)&&Oe(i,n);for(;e.length>o;)dt(r,n=e[o++])&&(~Se(i,n)||Oe(i,n));return i},Ee=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Pe=Ee.concat("length","prototype"),Te={f:Object.getOwnPropertyNames||function(t){return Ae(t,Pe)}},_e={f:Object.getOwnPropertySymbols},Le=P([].concat),je=B("Reflect","ownKeys")||function(t){var e=Te.f(Nt(t)),n=_e.f;return n?Le(e,n(t)):e},xe=function(t,e,n){for(var r=je(e),o=Ft.f,i=Ct.f,a=0;a<r.length;a++){var c=r[a];dt(t,c)||n&&dt(n,c)||o(t,c,i(e,c))}},Ce=/#|\.prototype\./,Ie=function(t,e){var n=ke[Re(t)];return n===Me||n!==Ne&&(U(e)?p(e):!!e)},Re=Ie.normalize=function(t){return String(t).replace(Ce,".").toLowerCase()},ke=Ie.data={},Ne=Ie.NATIVE="N",Me=Ie.POLYFILL="P",Ue=Ie,De=Ct.f,Be=function(t,e){var n,r,o,i,a,c=t.target,u=t.global,f=t.stat;if(n=u?l:f?l[c]||ct(c,{}):l[c]&&l[c].prototype)for(r in e){if(i=e[r],o=t.dontCallGetSet?(a=De(n,r))&&a.value:n[r],!Ue(u?r:c+(f?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;xe(i,o)}(t.sham||o&&o.sham)&&zt(i,"sham",!0),le(n,r,i,t)}},He=Array.isArray||function(t){return"Array"===L(t)},We=TypeError,Fe=function(t){if(t>9007199254740991)throw We("Maximum allowed index exceeded");return t},ze=function(t,e,n){d?Ft.f(t,e,S(0,n)):t[e]=n},Ge={};Ge[St("toStringTag")]="z";var qe="[object z]"===String(Ge),Ve=St("toStringTag"),Xe=Object,Je="Arguments"===L(function(){return arguments}()),Ye=qe?L:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Xe(t),Ve))?n:Je?L(e):"Object"===(r=L(e))&&U(e.callee)?"Arguments":r},Ke=function(){},Qe=B("Reflect","construct"),$e=/^\s*(?:class|function)\b/,Ze=P($e.exec),tn=!$e.test(Ke),en=function(t){if(!U(t))return!1;try{return Qe(Ke,[],t),!0}catch(t){return!1}},nn=function(t){if(!U(t))return!1;switch(Ye(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return tn||!!Ze($e,$t(t))}catch(t){return!0}};nn.sham=!0;var rn,on=!Qe||p(function(){var t;return en(en.call)||!en(Object)||!en(function(){t=!0})||t})?nn:en,an=St("species"),cn=Array,un=function(t,e){return new(function(t){var e;return He(t)&&(e=t.constructor,(on(e)&&(e===cn||He(e.prototype))||D(e)&&null===(e=e[an]))&&(e=void 0)),void 0===e?cn:e}(t))(0===e?0:e)},fn=St("species"),sn=St("isConcatSpreadable"),ln=J>=51||!p(function(){var t=[];return t[sn]=!1,t.concat()[0]!==t}),pn=function(t){if(!D(t))return!1;var e=t[sn];return void 0!==e?!!e:He(t)},dn=!(ln&&(rn="concat",J>=51||!p(function(){var t=[];return(t.constructor={})[fn]=function(){return{foo:1}},1!==t[rn](Boolean).foo})));Be({target:"Array",proto:!0,arity:1,forced:dn},{concat:function(t){var e,n,r,o,i,a=lt(this),c=un(a,0),u=0;for(e=-1,r=arguments.length;e<r;e++)if(pn(i=-1===e?a:arguments[e]))for(o=we(i),Fe(u+o),n=0;n<o;n++,u++)n in i&&ze(c,u,i[n]);else Fe(u+1),ze(c,u++,i);return c.length=u,c}});var hn,vn=Object.keys||function(t){return Ae(t,Ee)},yn=d&&!It?Object.defineProperties:function(t,e){Nt(t);for(var n,r=N(e),o=vn(e),i=o.length,a=0;i>a;)Ft.f(t,n=o[a++],r[n]);return t},gn={f:yn},mn=B("document","documentElement"),wn="prototype",bn="script",Sn=ne("IE_PROTO"),On=function(){},An=function(t){return"<"+bn+">"+t+"</"+bn+">"},En=function(t){t.write(An("")),t.close();var e=t.parentWindow.Object;return t=null,e},Pn=function(){try{hn=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;Pn="undefined"!=typeof document?document.domain&&hn?En(hn):(e=Lt("iframe"),n="java"+bn+":",e.style.display="none",mn.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(An("document.F=Object")),t.close(),t.F):En(hn);for(var r=Ee.length;r--;)delete Pn[wn][Ee[r]];return Pn()};re[Sn]=!0;var Tn=Object.create||function(t,e){var n;return null!==t?(On[wn]=Nt(t),n=new On,On[wn]=null,n[Sn]=t):n=Pn(),void 0===e?n:gn.f(n,e)},_n=Ft.f,Ln=St("unscopables"),jn=Array.prototype;void 0===jn[Ln]&&_n(jn,Ln,{configurable:!0,value:Tn(null)});var xn,Cn,In,Rn=function(t){jn[Ln][t]=!0},kn={},Nn=!p(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}),Mn=ne("IE_PROTO"),Un=Object,Dn=Un.prototype,Bn=Nn?Un.getPrototypeOf:function(t){var e=lt(t);if(dt(e,Mn))return e[Mn];var n=e.constructor;return U(n)&&e instanceof n?n.prototype:e instanceof Un?Dn:null},Hn=St("iterator"),Wn=!1;[].keys&&("next"in(In=[].keys())?(Cn=Bn(Bn(In)))!==Object.prototype&&(xn=Cn):Wn=!0);var Fn=!D(xn)||p(function(){var t={};return xn[Hn].call(t)!==t});Fn&&(xn={}),U(xn[Hn])||le(xn,Hn,function(){return this});var zn={IteratorPrototype:xn,BUGGY_SAFARI_ITERATORS:Wn},Gn=Ft.f,qn=St("toStringTag"),Vn=function(t,e,n){t&&!n&&(t=t.prototype),t&&!dt(t,qn)&&Gn(t,qn,{configurable:!0,value:e})},Xn=zn.IteratorPrototype,Jn=function(){return this},Yn=String,Kn=TypeError,Qn=function(t){if(function(t){return D(t)||null===t}(t))return t;throw new Kn("Can't set "+Yn(t)+" as a prototype")},$n=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{t=function(t,e,n){try{return P(rt(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}}(Object.prototype,"__proto__","set"),t(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return k(n),Qn(r),D(n)?(e?t(n,r):n.__proto__=r,n):n}}():void 0),Zn=Xt.PROPER,tr=Xt.CONFIGURABLE,er=zn.IteratorPrototype,nr=zn.BUGGY_SAFARI_ITERATORS,rr=St("iterator"),or="keys",ir="values",ar="entries",cr=function(){return this},ur=function(t,e,n,r,o,i,a){!function(t,e,n,r){var o=e+" Iterator";t.prototype=Tn(Xn,{next:S(+!r,n)}),Vn(t,o,!1),kn[o]=Jn}(n,e,r);var c,u,f,s=function(t){if(t===o&&v)return v;if(!nr&&t&&t in d)return d[t];switch(t){case or:case ir:case ar:return function(){return new n(this,t)}}return function(){return new n(this)}},l=e+" Iterator",p=!1,d=t.prototype,h=d[rr]||d["@@iterator"]||o&&d[o],v=!nr&&h||s(o),g="Array"===e&&d.entries||h;if(g&&(c=Bn(g.call(new t)))!==Object.prototype&&c.next&&(Bn(c)!==er&&($n?$n(c,er):U(c[rr])||le(c,rr,cr)),Vn(c,l,!0)),Zn&&o===ir&&h&&h.name!==ir&&(tr?zt(d,"name",ir):(p=!0,v=function(){return y(h,this)})),o)if(u={values:s(ir),keys:i?v:s(or),entries:s(ar)},a)for(f in u)(nr||p||!(f in d))&&le(d,f,u[f]);else Be({target:e,proto:!0,forced:nr||p},u);return d[rr]!==v&&le(d,rr,v,{name:o}),kn[e]=v,u},fr=function(t,e){return{value:t,done:e}},sr=Ft.f,lr="Array Iterator",pr=fe.set,dr=fe.getterFor(lr),hr=ur(Array,"Array",function(t,e){pr(this,{type:lr,target:N(t),index:0,kind:e})},function(){var t=dr(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=null,fr(void 0,!0);switch(t.kind){case"keys":return fr(n,!1);case"values":return fr(e[n],!1)}return fr([n,e[n]],!1)},"values"),vr=kn.Arguments=kn.Array;if(Rn("keys"),Rn("values"),Rn("entries"),d&&"values"!==vr.name)try{sr(vr,"name",{value:"values"})}catch(t){}var yr=Object.assign,gr=Object.defineProperty,mr=P([].concat),wr=!yr||p(function(){if(d&&1!==yr({b:1},yr(gr({},"a",{enumerable:!0,get:function(){gr(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol("assign detection"),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!==yr({},t)[n]||vn(yr({},e)).join("")!==r})?function(t,e){for(var n=lt(t),r=arguments.length,o=1,i=_e.f,a=b.f;r>o;)for(var c,u=C(arguments[o++]),f=i?mr(vn(u),i(u)):vn(u),s=f.length,l=0;s>l;)c=f[l++],d&&!y(a,u,c)||(n[c]=u[c]);return n}:yr;Be({target:"Object",stat:!0,arity:2,forced:Object.assign!==wr},{assign:wr});var br=qe?{}.toString:function(){return"[object "+Ye(this)+"]"};qe||le(Object.prototype,"toString",br,{unsafe:!0});var Sr,Or,Ar,Er,Pr=function(t){return z.slice(0,t.length)===t},Tr=Pr("Bun/")?"BUN":Pr("Cloudflare-Workers")?"CLOUDFLARE":Pr("Deno/")?"DENO":Pr("Node.js/")?"NODE":l.Bun&&"string"==typeof Bun.version?"BUN":l.Deno&&"object"==typeof Deno.version?"DENO":"process"===L(l.process)?"NODE":l.window&&l.document?"BROWSER":"REST",_r="NODE"===Tr,Lr=l,jr=St("species"),xr=TypeError,Cr=TypeError,Ir=St("species"),Rr=function(t,e){var n,r=Nt(t).constructor;return void 0===r||I(n=Nt(r)[Ir])?e:function(t){if(on(t))return t;throw new Cr(et(t)+" is not a constructor")}(n)},kr=Function.prototype,Nr=kr.apply,Mr=kr.call,Ur="object"==typeof Reflect&&Reflect.apply||(h?Mr.bind(Nr):function(){return Mr.apply(Nr,arguments)}),Dr=function(t){if("Function"===L(t))return P(t)},Br=Dr(Dr.bind),Hr=function(t,e){return rt(t),void 0===e?t:h?Br(t,e):function(){return t.apply(e,arguments)}},Wr=P([].slice),Fr=TypeError,zr=/(?:ipad|iphone|ipod).*applewebkit/i.test(z),Gr=l.setImmediate,qr=l.clearImmediate,Vr=l.process,Xr=l.Dispatch,Jr=l.Function,Yr=l.MessageChannel,Kr=l.String,Qr=0,$r={},Zr="onreadystatechange";p(function(){Sr=l.location});var to=function(t){if(dt($r,t)){var e=$r[t];delete $r[t],e()}},eo=function(t){return function(){to(t)}},no=function(t){to(t.data)},ro=function(t){l.postMessage(Kr(t),Sr.protocol+"//"+Sr.host)};Gr&&qr||(Gr=function(t){!function(t,e){if(t<e)throw new Fr("Not enough arguments")}(arguments.length,1);var e=U(t)?t:Jr(t),n=Wr(arguments,1);return $r[++Qr]=function(){Ur(e,void 0,n)},Or(Qr),Qr},qr=function(t){delete $r[t]},_r?Or=function(t){Vr.nextTick(eo(t))}:Xr&&Xr.now?Or=function(t){Xr.now(eo(t))}:Yr&&!zr?(Er=(Ar=new Yr).port2,Ar.port1.onmessage=no,Or=Hr(Er.postMessage,Er)):l.addEventListener&&U(l.postMessage)&&!l.importScripts&&Sr&&"file:"!==Sr.protocol&&!p(ro)?(Or=ro,l.addEventListener("message",no,!1)):Or=Zr in Lt("script")?function(t){mn.appendChild(Lt("script"))[Zr]=function(){mn.removeChild(this),to(t)}}:function(t){setTimeout(eo(t),0)});var oo={set:Gr,clear:qr},io=Object.getOwnPropertyDescriptor,ao=function(){this.head=null,this.tail=null};ao.prototype={add:function(t){var e={item:t,next:null},n=this.tail;n?n.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}};var co,uo,fo,so,lo,po=ao,ho=/ipad|iphone|ipod/i.test(z)&&"undefined"!=typeof Pebble,vo=/web0s(?!.*chrome)/i.test(z),yo=oo.set,go=l.MutationObserver||l.WebKitMutationObserver,mo=l.document,wo=l.process,bo=l.Promise,So=function(t){if(!d)return l[t];var e=io(l,t);return e&&e.value}("queueMicrotask");if(!So){var Oo=new po,Ao=function(){var t,e;for(_r&&(t=wo.domain)&&t.exit();e=Oo.get();)try{e()}catch(t){throw Oo.head&&co(),t}t&&t.enter()};zr||_r||vo||!go||!mo?!ho&&bo&&bo.resolve?((so=bo.resolve(void 0)).constructor=bo,lo=Hr(so.then,so),co=function(){lo(Ao)}):_r?co=function(){wo.nextTick(Ao)}:(yo=Hr(yo,l),co=function(){yo(Ao)}):(uo=!0,fo=mo.createTextNode(""),new go(Ao).observe(fo,{characterData:!0}),co=function(){fo.data=uo=!uo}),So=function(t){Oo.head||co(),Oo.add(t)}}var Eo=So,Po=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},To=l.Promise;To&&To.prototype;var _o,Lo,jo,xo,Co,Io,Ro,ko,No=St("species"),Mo=!1,Uo=U(l.PromiseRejectionEvent),Do=Ue("Promise",function(){var t=$t(To),e=t!==String(To);if(!e&&66===J)return!0;if(!J||J<51||!/native code/.test(t)){var n=new To(function(t){t(1)}),r=function(t){t(function(){},function(){})};if((n.constructor={})[No]=r,!(Mo=n.then(function(){})instanceof r))return!0}return!(e||"BROWSER"!==Tr&&"DENO"!==Tr||Uo)}),Bo={CONSTRUCTOR:Do,REJECTION_EVENT:Uo,SUBCLASSING:Mo},Ho=TypeError,Wo=function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw new Ho("Bad Promise constructor");e=t,n=r}),this.resolve=rt(e),this.reject=rt(n)},Fo={f:function(t){return new Wo(t)}},zo=oo.set,Go="Promise",qo=Bo.CONSTRUCTOR,Vo=Bo.REJECTION_EVENT,Xo=Bo.SUBCLASSING,Jo=fe.getterFor(Go),Yo=fe.set,Ko=To&&To.prototype,Qo=To,$o=Ko,Zo=l.TypeError,ti=l.document,ei=l.process,ni=Fo.f,ri=ni,oi=!!(ti&&ti.createEvent&&l.dispatchEvent),ii="unhandledrejection",ai=function(t){var e;return!(!D(t)||!U(e=t.then))&&e},ci=function(t,e){var n,r,o,i=e.value,a=1===e.state,c=a?t.ok:t.fail,u=t.resolve,f=t.reject,s=t.domain;try{c?(a||(2===e.rejection&&pi(e),e.rejection=1),!0===c?n=i:(s&&s.enter(),n=c(i),s&&(s.exit(),o=!0)),n===t.promise?f(new Zo("Promise-chain cycle")):(r=ai(n))?y(r,n,u,f):u(n)):f(i)}catch(t){s&&!o&&s.exit(),f(t)}},ui=function(t,e){t.notified||(t.notified=!0,Eo(function(){for(var n,r=t.reactions;n=r.get();)ci(n,t);t.notified=!1,e&&!t.rejection&&si(t)}))},fi=function(t,e,n){var r,o;oi?((r=ti.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),l.dispatchEvent(r)):r={promise:e,reason:n},!Vo&&(o=l["on"+t])?o(r):t===ii&&function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(t){}}("Unhandled promise rejection",n)},si=function(t){y(zo,l,function(){var e,n=t.facade,r=t.value;if(li(t)&&(e=Po(function(){_r?ei.emit("unhandledRejection",r,n):fi(ii,n,r)}),t.rejection=_r||li(t)?2:1,e.error))throw e.value})},li=function(t){return 1!==t.rejection&&!t.parent},pi=function(t){y(zo,l,function(){var e=t.facade;_r?ei.emit("rejectionHandled",e):fi("rejectionhandled",e,t.value)})},di=function(t,e,n){return function(r){t(e,r,n)}},hi=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,ui(t,!0))},vi=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw new Zo("Promise can't be resolved itself");var r=ai(e);r?Eo(function(){var n={done:!1};try{y(r,e,di(vi,n,t),di(hi,n,t))}catch(e){hi(n,e,t)}}):(t.value=e,t.state=1,ui(t,!1))}catch(e){hi({done:!1},e,t)}}};if(qo&&($o=(Qo=function(t){!function(t,e){if(H(e,t))return t;throw new xr("Incorrect invocation")}(this,$o),rt(t),y(_o,this);var e=Jo(this);try{t(di(vi,e),di(hi,e))}catch(t){hi(e,t)}}).prototype,(_o=function(t){Yo(this,{type:Go,done:!1,notified:!1,parent:!1,reactions:new po,rejection:!1,state:0,value:null})}).prototype=le($o,"then",function(t,e){var n=Jo(this),r=ni(Rr(this,Qo));return n.parent=!0,r.ok=!U(t)||t,r.fail=U(e)&&e,r.domain=_r?ei.domain:void 0,0===n.state?n.reactions.add(r):Eo(function(){ci(r,n)}),r.promise}),Lo=function(){var t=new _o,e=Jo(t);this.promise=t,this.resolve=di(vi,e),this.reject=di(hi,e)},Fo.f=ni=function(t){return t===Qo||t===jo?new Lo(t):ri(t)},U(To)&&Ko!==Object.prototype)){xo=Ko.then,Xo||le(Ko,"then",function(t,e){var n=this;return new Qo(function(t,e){y(xo,n,t,e)}).then(t,e)},{unsafe:!0});try{delete Ko.constructor}catch(t){}$n&&$n(Ko,$o)}Be({global:!0,constructor:!0,wrap:!0,forced:qo},{Promise:Qo}),jo=Lr.Promise,Vn(Qo,Go,!1),ko=B(Go),d&&ko&&!ko[jr]&&(Co=ko,Io=jr,(Ro={configurable:!0,get:function(){return this}}).get&&se(Ro.get,Io,{getter:!0}),Ro.set&&se(Ro.set,Io,{setter:!0}),Ft.f(Co,Io,Ro));var yi=St("iterator"),gi=Array.prototype,mi=St("iterator"),wi=function(t){if(!I(t))return ot(t,mi)||ot(t,"@@iterator")||kn[Ye(t)]},bi=TypeError,Si=function(t,e,n){var r,o;Nt(t);try{if(!(r=ot(t,"return"))){if("throw"===e)throw n;return n}r=y(r,t)}catch(t){o=!0,r=t}if("throw"===e)throw n;if(o)throw r;return Nt(r),n},Oi=TypeError,Ai=function(t,e){this.stopped=t,this.result=e},Ei=Ai.prototype,Pi=function(t,e,n){var r,o,i,a,c,u,f,s,l=n&&n.that,p=!(!n||!n.AS_ENTRIES),d=!(!n||!n.IS_RECORD),h=!(!n||!n.IS_ITERATOR),v=!(!n||!n.INTERRUPTED),g=Hr(e,l),m=function(t){return r&&Si(r,"normal"),new Ai(!0,t)},w=function(t){return p?(Nt(t),v?g(t[0],t[1],m):g(t[0],t[1])):v?g(t,m):g(t)};if(d)r=t.iterator;else if(h)r=t;else{if(!(o=wi(t)))throw new Oi(et(t)+" is not iterable");if(void 0!==(s=o)&&(kn.Array===s||gi[yi]===s)){for(i=0,a=we(t);a>i;i++)if((c=w(t[i]))&&H(Ei,c))return c;return new Ai(!1)}r=function(t,e){var n=arguments.length<2?wi(t):e;if(rt(n))return Nt(y(n,t));throw new bi(et(t)+" is not iterable")}(t,o)}for(u=d?t.next:r.next;!(f=y(u,r)).done;){try{c=w(f.value)}catch(t){Si(r,"throw",t)}if("object"==typeof c&&c&&H(Ei,c))return c}return new Ai(!1)},Ti=St("iterator"),_i=!1;try{var Li=0,ji={next:function(){return{done:!!Li++}},return:function(){_i=!0}};ji[Ti]=function(){return this},Array.from(ji,function(){throw 2})}catch(t){}var xi=Bo.CONSTRUCTOR||!function(t,e){try{if(!e&&!_i)return!1}catch(t){return!1}var n=!1;try{var r={};r[Ti]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n}(function(t){To.all(t).then(void 0,function(){})});Be({target:"Promise",stat:!0,forced:xi},{all:function(t){var e=this,n=Fo.f(e),r=n.resolve,o=n.reject,i=Po(function(){var n=rt(e.resolve),i=[],a=0,c=1;Pi(t,function(t){var u=a++,f=!1;c++,y(n,e,t).then(function(t){f||(f=!0,i[u]=t,--c||r(i))},o)}),--c||r(i)});return i.error&&o(i.value),n.promise}});var Ci=Bo.CONSTRUCTOR,Ii=To&&To.prototype;if(Be({target:"Promise",proto:!0,forced:Ci,real:!0},{catch:function(t){return this.then(void 0,t)}}),U(To)){var Ri=B("Promise").prototype.catch;Ii.catch!==Ri&&le(Ii,"catch",Ri,{unsafe:!0})}Be({target:"Promise",stat:!0,forced:xi},{race:function(t){var e=this,n=Fo.f(e),r=n.reject,o=Po(function(){var o=rt(e.resolve);Pi(t,function(t){y(o,e,t).then(n.resolve,r)})});return o.error&&r(o.value),n.promise}}),Be({target:"Promise",stat:!0,forced:Bo.CONSTRUCTOR},{reject:function(t){var e=Fo.f(this);return(0,e.reject)(t),e.promise}});var ki=Bo.CONSTRUCTOR;B("Promise"),Be({target:"Promise",stat:!0,forced:ki},{resolve:function(t){return function(t,e){if(Nt(t),D(e)&&e.constructor===t)return e;var n=Fo.f(t);return(0,n.resolve)(e),n.promise}(this,t)}});var Ni=String,Mi=function(t){if("Symbol"===Ye(t))throw new TypeError("Cannot convert a Symbol value to a string");return Ni(t)},Ui=P("".charAt),Di=P("".charCodeAt),Bi=P("".slice),Hi=function(t){return function(e,n){var r,o,i=Mi(k(e)),a=ve(n),c=i.length;return a<0||a>=c?t?"":void 0:(r=Di(i,a))<55296||r>56319||a+1===c||(o=Di(i,a+1))<56320||o>57343?t?Ui(i,a):r:t?Bi(i,a,a+2):o-56320+(r-55296<<10)+65536}},Wi={codeAt:Hi(!1),charAt:Hi(!0)}.charAt,Fi="String Iterator",zi=fe.set,Gi=fe.getterFor(Fi);ur(String,"String",function(t){zi(this,{type:Fi,string:Mi(t),index:0})},function(){var t,e=Gi(this),n=e.string,r=e.index;return r>=n.length?fr(void 0,!0):(t=Wi(n,r),e.index+=t.length,fr(t,!1))});var qi={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Vi=Lt("span").classList,Xi=Vi&&Vi.constructor&&Vi.constructor.prototype,Ji=Xi===Object.prototype?void 0:Xi,Yi=St("iterator"),Ki=hr.values,Qi=function(t,e){if(t){if(t[Yi]!==Ki)try{zt(t,Yi,Ki)}catch(e){t[Yi]=Ki}if(Vn(t,e,!0),qi[e])for(var n in hr)if(t[n]!==hr[n])try{zt(t,n,hr[n])}catch(e){t[n]=hr[n]}}};for(var $i in qi)Qi(l[$i]&&l[$i].prototype,$i);Qi(Ji,"DOMTokenList");var Zi=function(){return Zi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Zi.apply(this,arguments)},ta={weixinJsSdkTicket:"",launchContainerQuery:".mazey-launch-app-selector",launchShowWeixinToBrowserImgUrl:"",canShowWeixinToBrowser:!1,extInfo:"",serviceAccountAppId:"",wexinServiceAccountAppId:"",openPlatformMobileAppId:"",genTagPrefixStr:"mazey-launch-app-btn-prefix-",launchShowWeixinToBrowserClassName:"mazey-launch-app-wx-to-browser",launchBtnClassName:"mazey-launch-app-inner-btn",launchBtnStyle:"",launchBtnText:"Launch App <br /><br /><br />",launchErrorLink:"",canContinuousUpdating:!1,onMenuShareTimelineOptions:void 0,onMenuShareAppMessageOptions:void 0,isConClosed:!0,isWxDebug:!1,openTagList:["wx-open-launch-app"],canLaunchApp:function(){return!0},canFireErrorLinkDirectly:function(){return!1},launchBtnClick:function(){},launchReady:function(){}};module.exports=function(e){void 0===e&&(e=ta);var n=Object.assign(ta,e),r=n.weixinJsSdkTicket,a=n.launchContainerQuery,c=n.genTagPrefixStr,u=n.launchShowWeixinToBrowserImgUrl,f=n.canShowWeixinToBrowser,s=n.launchShowWeixinToBrowserClassName,l=n.launchBtnClassName,p=n.launchBtnStyle,d=n.launchBtnText,h=n.launchErrorLink,v=n.wexinServiceAccountAppId,y=n.openPlatformMobileAppId,g=n.canContinuousUpdating,m=n.onMenuShareTimelineOptions,w=n.onMenuShareAppMessageOptions,b=n.isConClosed,S=n.isWxDebug,O=n.openTagList,A=n.canLaunchApp,E=n.canFireErrorLinkDirectly,P=n.launchBtnClick,T=n.launchReady,_=n.serviceAccountAppId,L=n.extInfo,j=t.genCustomConsole("LaunchCon:",{isClosed:b}),x=window.wx;x||console.error("Launch App: wx is not found");var C=function(){};j.log("Launch App");var I={title:"",link:"",imgUrl:"",success:function(){},cancel:function(){}},R={title:"",desc:"",link:"",imgUrl:"",type:"",dataUrl:"",success:function(){},cancel:function(){}},k={title:document.title,link:location.href};I=Zi(Zi({},I),k),R=Zi(Zi({},R),k);var N=function(t,e,n){return void 0===t&&(t=""),void 0===e&&(e=""),void 0===n&&(n="button"),"<style>.".concat(l,"{")+"opacity: 0;width: 100%;height: 100%;backgroud: transparent;color: #300f54;border: none;box-sizing: border-box;text-align: center;vertical-align: middle;"+p+e+"}</style>"+"<".concat(n,' class="').concat(l,'"')+(t&&"button"===n?' onclick="'.concat(t,'"'):"")+(t&&"a"===n?' target="_self" href="'.concat(t,'"'):"")+">"+d+"</".concat(n,">")},M=N();function U(){t.addStyle('.mazey-launch-app-mask{position:fixed;top:0;right:0;bottom:0;left:0;background-color:rgba(0, 0, 0, .5);text-align:right;font-size:0;white-space:nowrap;overflow:auto;z-index:999;}.mazey-launch-app-img{display:inline-block;vertical-align:middle;text-align:left;font-size:14px;white-space:normal;width:50vw;margin:0.5rem 0.5rem 0 0;}.mazey-launch-app-img:after{content:"";display:inline-block;height:100%;vertical-align:middle;}',{id:"mazey-launch-app-mask-style"}),window.LAUNCH_APP_HIDE_WEIXIN_BROWSER||(window.LAUNCH_APP_HIDE_WEIXIN_BROWSER=function(){o.default(".mazey-launch-app-mask").hide()}),0===o.default(".mazey-launch-app-mask").length?o.default("body").append("<div class='mazey-launch-app-mask' onclick='window.LAUNCH_APP_HIDE_WEIXIN_BROWSER()'><img "+"class='mazey-launch-app-img ".concat(s,"' ")+"src='".concat(u,"' ")+"alt='Launch App' /></div>"):o.default(".mazey-launch-app-mask").show()}function D(){j.log("renderWeixinLaunchTemplate"),!_&&v&&(console.warn("wexinServiceAccountAppId will be deprecated, use serviceAccountAppId instead."),_=v),function(e,n){void 0===e&&(e=""),void 0===n&&(n=""),j.log("renderWXOpenLaunchApp"),Promise.all([Promise.resolve(r||window.LAUNCH_APP_WEIXIN_JS_SDK_TICKET||t.getQueryParam("weixinJsSdkTicket")||""),Promise.resolve(i.default)]).then(function(r){j.log("allRes",r);var i=r[0];if(i){var u=r[1];if(u){var s=t.generateRndNum(7),l=i,p=(new Date).getTime(),d=u("jsapi_ticket="+l+"&noncestr="+s+"×tamp="+p+"&url="+location.href);return x.config({debug:S,appId:e,timestamp:p,nonceStr:s,signature:d,jsApiList:["showOptionMenu","onMenuShareTimeline","onMenuShareAppMessage"],openTagList:O}),x.ready(function(){if(w&&(j.log("onMenuShareAppMessageOptions",w),x.onMenuShareAppMessage(w)),window.LAUNCH_APP_SHARE_APP_MESSAGE=function(t){t=Zi(Zi({},R),t),j.log("window LAUNCH_APP_SHARE_APP_MESSAGE",t),x.onMenuShareAppMessage(t)},m&&(j.log("onMenuShareTimelineOptions",m),x.onMenuShareTimeline(m)),window.LAUNCH_APP_SHARE_TIMELINE=function(t){t=Zi(Zi({},I),t),j.log("window LAUNCH_APP_SHARE_TIMELINE",t),x.onMenuShareTimeline(t)},n){window.LAUNCH_APP_READY=!0,T&&T();var t=function(){var t=o.default(a);j.log("containers",a,t,t.length),t.length>0&&t.each(function(t,e){var r=o.default(e).attr("data-launch-app-key");if(!r){var i=o.default(e).parents("[data-launch-app-key]:eq(0)");i.length>0&&(r=i.attr("data-launch-app-key"),j.log("keyEle",i,r))}r||(r=String(t));var a="mazey-launch-app-tag-".concat(r),u=o.default(".".concat(a," wx-open-launch-app")),s=o.default(e).attr("data-launch-app-ext-info");if(!s){var l=o.default(e).parents("[data-launch-app-ext-info]:eq(0)");l.length>0&&(s=l.attr("data-launch-app-ext-info"),j.log("eleExtInfoEle parents",l,s))}s&&(L=s);var p=o.default(e).attr("data-launch-app-error-link");if(!p){var d=o.default(e).parents("[data-launch-app-error-link]:eq(0)");d.length>0&&(p=d.attr("data-launch-app-error-link"),j.log("eleErrorLinkEle parents",d,p))}var v=h;p&&(v=p),0===u.length&&(o.default(e).addClass(a),j.log("success:",a),function(t){var e=c,r=e+t,i="<wx-open-launch-app id='"+r+"' appid='"+n+"' extinfo='".concat(L)+"' style='z-index:99;position:absolute;width:100%;height:100%;opacity:1;background:transparent;overflow:hidden;left:0;'><script type='text/wxtag-template'>"+M+"<\/script></wx-open-launch-app>";o.default("."+t+":eq(0)").append(i);var a=document.getElementById(r);a&&(a.addEventListener("ready",function(t){j.log("ready event",t)}),a.addEventListener("launch",function(t){j.log("launch event",t),t.detail&&t.detail.extInfo&&j.log("launch extInfo",t.detail.extInfo)}),a.addEventListener("error",function(t){j.error(t.detail),o.default("[id^='"+e+"']").hide(),f&&U(),v&&(j.log("realErrorLink",v),location.href=v)}),a.addEventListener("click",function(t){j.log("click event",t),P&&P()}))}(a))})};t(),C=t}else j.log("openPlatformMobileAppId is required for weixin launch app")}),x.error(function(t){j.error(t)}),"success:launch_app"}j.error("sha1 is required")}else j.error("weixinJsSdkTicket is required")}).catch(function(t){j.error(t)})}(_,y)}function B(t){if(void 0===t&&(t={}),j.log("appUpdated",t),!window.LAUNCH_APP_LOAD&&A(t)&&(D(),window.LAUNCH_APP_LOAD=!0),g&&window.LAUNCH_APP_LOAD&&A(t)&&C(),E()){var e=o.default(a);e.length>0&&e.each(function(t,e){var n=o.default(e).children("."+l);if(!n||!n.length){var r=o.default(e).attr("data-launch-app-error-link");if(!r){var i=o.default(e).parents("[data-launch-app-error-link]:eq(0)");i.length>0&&(r=i.attr("data-launch-app-error-link"))}if(r&&"string"==typeof r&&r.length){var a=N(r,"position:absolute;left:0;z-index:999;","a");o.default(e).append(a)}}})}}function H(){j.log("appBeforeDestroy",H),window.LAUNCH_APP_LOAD=null,window.LAUNCH_APP_HIDE_WEIXIN_BROWSER=null}return window.LAUNCH_APP_UPDATE=B,window.LAUNCH_APP_BEFORE_DESTROY=H,window.LAUNCH_APP_SHOW_WEIXIN_TO_BROWSER=U,{LAUNCH_APP_UPDATE:B,LAUNCH_APP_BEFORE_DESTROY:H,LAUNCH_APP_SHOW_WEIXIN_TO_BROWSER:U,LAUNCH_APP_SHARE_TIMELINE:function(t){j.log("opt",t)},LAUNCH_APP_SHARE_APP_MESSAGE:function(t){j.log("opt",t)},start:B,update:B,destroy:H}};