@bi-nova/services 1.3.2-beta.202605161224 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";var Ue=Object.defineProperty,hn=Object.defineProperties,dn=Object.getOwnPropertyDescriptor,pn=Object.getOwnPropertyDescriptors,yn=Object.getOwnPropertyNames,Dr=Object.getOwnPropertySymbols;var Rr=Object.prototype.hasOwnProperty,gn=Object.prototype.propertyIsEnumerable;var We=(i,a,u)=>a in i?Ue(i,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[a]=u,bt=(i,a)=>{for(var u in a||(a={}))Rr.call(a,u)&&We(i,u,a[u]);if(Dr)for(var u of Dr(a))gn.call(a,u)&&We(i,u,a[u]);return i},ne=(i,a)=>hn(i,pn(a));var mn=(i,a)=>()=>(a||i((a={exports:{}}).exports,a),a.exports),Me=(i,a)=>{for(var u in a)Ue(i,u,{get:a[u],enumerable:!0})},_n=(i,a,u,_)=>{if(a&&typeof a=="object"||typeof a=="function")for(let g of yn(a))!Rr.call(i,g)&&g!==u&&Ue(i,g,{get:()=>a[g],enumerable:!(_=dn(a,g))||_.enumerable});return i};var vn=i=>_n(Ue({},"__esModule",{value:!0}),i);var je=(i,a,u)=>We(i,typeof a!="symbol"?a+"":a,u);var jr=mn((bo,Mr)=>{"use strict";(()=>{var i={737:(g,D,S)=>{"use strict";S.r(D),S.d(D,{default:()=>P,getJrCommand:()=>I});var J=S(307),$=S.n(J);function at(){at=function(){return V};var m,V={},_t=Object.prototype,st=_t.hasOwnProperty,vt=Object.defineProperty||function(h,l,y){h[l]=y.value},ut=typeof Symbol=="function"?Symbol:{},yt=ut.iterator||"@@iterator",At=ut.asyncIterator||"@@asyncIterator",Dt=ut.toStringTag||"@@toStringTag";function ft(h,l,y){return Object.defineProperty(h,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),h[l]}try{ft({},"")}catch(h){ft=function(l,y,x){return l[y]=x}}function Yt(h,l,y,x){var A=l&&l.prototype instanceof oe?l:oe,M=Object.create(A.prototype),rt=new le(x||[]);return vt(M,"_invoke",{value:Ot(h,y,rt)}),M}function Vt(h,l,y){try{return{type:"normal",arg:h.call(l,y)}}catch(x){return{type:"throw",arg:x}}}V.wrap=Yt;var kt="suspendedStart",zt="suspendedYield",Ht="executing",wt="completed",Pt={};function oe(){}function ee(){}function jt(){}var ie={};ft(ie,yt,(function(){return this}));var re=Object.getPrototypeOf,Lt=re&&re(re(te([])));Lt&&Lt!==_t&&st.call(Lt,yt)&&(ie=Lt);var Jt=jt.prototype=oe.prototype=Object.create(ie);function pe(h){["next","throw","return"].forEach((function(l){ft(h,l,(function(y){return this._invoke(l,y)}))}))}function $t(h,l){function y(A,M,rt,mt){var pt=Vt(h[A],h,M);if(pt.type!=="throw"){var Gt=pt.arg,Qt=Gt.value;return Qt&&ht(Qt)=="object"&&st.call(Qt,"__await")?l.resolve(Qt.__await).then((function(Et){y("next",Et,rt,mt)}),(function(Et){y("throw",Et,rt,mt)})):l.resolve(Qt).then((function(Et){Gt.value=Et,rt(Gt)}),(function(Et){return y("throw",Et,rt,mt)}))}mt(pt.arg)}var x;vt(this,"_invoke",{value:function(A,M){function rt(){return new l((function(mt,pt){y(A,M,mt,pt)}))}return x=x?x.then(rt,rt):rt()}})}function Ot(h,l,y){var x=kt;return function(A,M){if(x===Ht)throw Error("Generator is already running");if(x===wt){if(A==="throw")throw M;return{value:m,done:!0}}for(y.method=A,y.arg=M;;){var rt=y.delegate;if(rt){var mt=Ut(rt,y);if(mt){if(mt===Pt)continue;return mt}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(x===kt)throw x=wt,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);x=Ht;var pt=Vt(h,l,y);if(pt.type==="normal"){if(x=y.done?wt:zt,pt.arg===Pt)continue;return{value:pt.arg,done:y.done}}pt.type==="throw"&&(x=wt,y.method="throw",y.arg=pt.arg)}}}function Ut(h,l){var y=l.method,x=h.iterator[y];if(x===m)return l.delegate=null,y==="throw"&&h.iterator.return&&(l.method="return",l.arg=m,Ut(h,l),l.method==="throw")||y!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+y+"' method")),Pt;var A=Vt(x,h.iterator,l.arg);if(A.type==="throw")return l.method="throw",l.arg=A.arg,l.delegate=null,Pt;var M=A.arg;return M?M.done?(l[h.resultName]=M.value,l.next=h.nextLoc,l.method!=="return"&&(l.method="next",l.arg=m),l.delegate=null,Pt):M:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,Pt)}function Zt(h){var l={tryLoc:h[0]};1 in h&&(l.catchLoc=h[1]),2 in h&&(l.finallyLoc=h[2],l.afterLoc=h[3]),this.tryEntries.push(l)}function ce(h){var l=h.completion||{};l.type="normal",delete l.arg,h.completion=l}function le(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(Zt,this),this.reset(!0)}function te(h){if(h||h===""){var l=h[yt];if(l)return l.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var y=-1,x=function A(){for(;++y<h.length;)if(st.call(h,y))return A.value=h[y],A.done=!1,A;return A.value=m,A.done=!0,A};return x.next=x}}throw new TypeError(ht(h)+" is not iterable")}return ee.prototype=jt,vt(Jt,"constructor",{value:jt,configurable:!0}),vt(jt,"constructor",{value:ee,configurable:!0}),ee.displayName=ft(jt,Dt,"GeneratorFunction"),V.isGeneratorFunction=function(h){var l=typeof h=="function"&&h.constructor;return!!l&&(l===ee||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,jt):(h.__proto__=jt,ft(h,Dt,"GeneratorFunction")),h.prototype=Object.create(Jt),h},V.awrap=function(h){return{__await:h}},pe($t.prototype),ft($t.prototype,At,(function(){return this})),V.AsyncIterator=$t,V.async=function(h,l,y,x,A){A===void 0&&(A=Promise);var M=new $t(Yt(h,l,y,x),A);return V.isGeneratorFunction(l)?M:M.next().then((function(rt){return rt.done?rt.value:M.next()}))},pe(Jt),ft(Jt,Dt,"Generator"),ft(Jt,yt,(function(){return this})),ft(Jt,"toString",(function(){return"[object Generator]"})),V.keys=function(h){var l=Object(h),y=[];for(var x in l)y.push(x);return y.reverse(),function A(){for(;y.length;){var M=y.pop();if(M in l)return A.value=M,A.done=!1,A}return A.done=!0,A}},V.values=te,le.prototype={constructor:le,reset:function(h){if(this.prev=0,this.next=0,this.sent=this._sent=m,this.done=!1,this.delegate=null,this.method="next",this.arg=m,this.tryEntries.forEach(ce),!h)for(var l in this)l.charAt(0)==="t"&&st.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=m)},stop:function(){this.done=!0;var h=this.tryEntries[0].completion;if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(h){if(this.done)throw h;var l=this;function y(pt,Gt){return M.type="throw",M.arg=h,l.next=pt,Gt&&(l.method="next",l.arg=m),!!Gt}for(var x=this.tryEntries.length-1;x>=0;--x){var A=this.tryEntries[x],M=A.completion;if(A.tryLoc==="root")return y("end");if(A.tryLoc<=this.prev){var rt=st.call(A,"catchLoc"),mt=st.call(A,"finallyLoc");if(rt&&mt){if(this.prev<A.catchLoc)return y(A.catchLoc,!0);if(this.prev<A.finallyLoc)return y(A.finallyLoc)}else if(rt){if(this.prev<A.catchLoc)return y(A.catchLoc,!0)}else{if(!mt)throw Error("try statement without catch or finally");if(this.prev<A.finallyLoc)return y(A.finallyLoc)}}}},abrupt:function(h,l){for(var y=this.tryEntries.length-1;y>=0;--y){var x=this.tryEntries[y];if(x.tryLoc<=this.prev&&st.call(x,"finallyLoc")&&this.prev<x.finallyLoc){var A=x;break}}A&&(h==="break"||h==="continue")&&A.tryLoc<=l&&l<=A.finallyLoc&&(A=null);var M=A?A.completion:{};return M.type=h,M.arg=l,A?(this.method="next",this.next=A.finallyLoc,Pt):this.complete(M)},complete:function(h,l){if(h.type==="throw")throw h.arg;return h.type==="break"||h.type==="continue"?this.next=h.arg:h.type==="return"?(this.rval=this.arg=h.arg,this.method="return",this.next="end"):h.type==="normal"&&l&&(this.next=l),Pt},finish:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===h)return this.complete(y.completion,y.afterLoc),ce(y),Pt}},catch:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===h){var x=y.completion;if(x.type==="throw"){var A=x.arg;ce(y)}return A}}throw Error("illegal catch attempt")},delegateYield:function(h,l,y){return this.delegate={iterator:te(h),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=m),Pt}},V}function Rt(m,V,_t,st,vt,ut,yt){try{var At=m[ut](yt),Dt=At.value}catch(ft){return void _t(ft)}At.done?V(Dt):Promise.resolve(Dt).then(st,vt)}function ht(m){return ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},ht(m)}var Q="https://ms.jr.jd.com";function ve(m){var V=m.host,_t=m.type,st=_t===void 0?"post":_t,vt=m.data,ut=m.path,yt=ut===void 0?"":ut,At=m.config,Dt=At===void 0?{}:At,ft=(Dt.withCredentials,Dt.isWG),Yt=ft===void 0||ft,Vt=Dt.contentType,kt=Vt===void 0?"application/x-www-form-urlencoded":Vt;return new Promise((function(zt,Ht){wx.request({url:(V||Q)+yt,method:st.toUpperCase(),data:Yt?R({reqData:JSON.stringify(vt)}):vt,header:{"content-type":kt},success:function(wt){wt.statusCode===200?zt(wt.data):Ht({statusCode:wt.statusCode,errMsg:wt.errMsg,data:wt.data})},fail:function(wt){Ht(wt)}})}))}function R(m){var V="";return ht(m)==="object"&&m!==null&&(Object.keys(m).map((function(_t){var st=m[_t];return V+=_t+"="+encodeURIComponent(st)+"&",""})),V.length>0&&(V=V.substr(0,V.length-1))),V}function Z(m){return dt.apply(this,arguments)}function dt(){var m;return m=at().mark((function V(_t){var st,vt,ut,yt,At,Dt,ft,Yt,Vt,kt;return at().wrap((function(zt){for(;;)switch(zt.prev=zt.next){case 0:return st=_t.url,vt=_t.channel,ut=_t.callback,$().init(),yt=new($()),At=yt.nonce(),Dt=yt.sign(JSON.stringify({t:"".concat(new Date().getTime())}),At),ft="/gw/generic/app/h5/m/execute1/ug-service-orchestrator".concat(""),Yt="",Vt={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:st,channel:vt,clientCode:"0",antiRushInfo:Dt}},zt.next=12,ve({host:"https://ms.jr.jd.com",type:"post",path:ft,config:{withCredentials:!0},data:Vt});case 12:(kt=zt.sent).resultCode===0&&kt.resultData&&kt.resultData.code==="00000"&&kt.resultData.data&&(Yt=kt.resultData.data.goldenKeyText),ut&&ut(Yt?{code:"0",msg:"command success",data:Yt}:{code:"-1",msg:"command empty"});case 15:case"end":return zt.stop()}}),V)})),dt=function(){var V=this,_t=arguments;return new Promise((function(st,vt){var ut=m.apply(V,_t);function yt(Dt){Rt(ut,st,vt,yt,At,"next",Dt)}function At(Dt){Rt(ut,st,vt,yt,At,"throw",Dt)}yt(void 0)}))},dt.apply(this,arguments)}function F(m){return F=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},F(m)}function k(){k=function(){return V};var m,V={},_t=Object.prototype,st=_t.hasOwnProperty,vt=Object.defineProperty||function(h,l,y){h[l]=y.value},ut=typeof Symbol=="function"?Symbol:{},yt=ut.iterator||"@@iterator",At=ut.asyncIterator||"@@asyncIterator",Dt=ut.toStringTag||"@@toStringTag";function ft(h,l,y){return Object.defineProperty(h,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),h[l]}try{ft({},"")}catch(h){ft=function(l,y,x){return l[y]=x}}function Yt(h,l,y,x){var A=l&&l.prototype instanceof oe?l:oe,M=Object.create(A.prototype),rt=new le(x||[]);return vt(M,"_invoke",{value:Ot(h,y,rt)}),M}function Vt(h,l,y){try{return{type:"normal",arg:h.call(l,y)}}catch(x){return{type:"throw",arg:x}}}V.wrap=Yt;var kt="suspendedStart",zt="suspendedYield",Ht="executing",wt="completed",Pt={};function oe(){}function ee(){}function jt(){}var ie={};ft(ie,yt,(function(){return this}));var re=Object.getPrototypeOf,Lt=re&&re(re(te([])));Lt&&Lt!==_t&&st.call(Lt,yt)&&(ie=Lt);var Jt=jt.prototype=oe.prototype=Object.create(ie);function pe(h){["next","throw","return"].forEach((function(l){ft(h,l,(function(y){return this._invoke(l,y)}))}))}function $t(h,l){function y(A,M,rt,mt){var pt=Vt(h[A],h,M);if(pt.type!=="throw"){var Gt=pt.arg,Qt=Gt.value;return Qt&&F(Qt)=="object"&&st.call(Qt,"__await")?l.resolve(Qt.__await).then((function(Et){y("next",Et,rt,mt)}),(function(Et){y("throw",Et,rt,mt)})):l.resolve(Qt).then((function(Et){Gt.value=Et,rt(Gt)}),(function(Et){return y("throw",Et,rt,mt)}))}mt(pt.arg)}var x;vt(this,"_invoke",{value:function(A,M){function rt(){return new l((function(mt,pt){y(A,M,mt,pt)}))}return x=x?x.then(rt,rt):rt()}})}function Ot(h,l,y){var x=kt;return function(A,M){if(x===Ht)throw Error("Generator is already running");if(x===wt){if(A==="throw")throw M;return{value:m,done:!0}}for(y.method=A,y.arg=M;;){var rt=y.delegate;if(rt){var mt=Ut(rt,y);if(mt){if(mt===Pt)continue;return mt}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(x===kt)throw x=wt,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);x=Ht;var pt=Vt(h,l,y);if(pt.type==="normal"){if(x=y.done?wt:zt,pt.arg===Pt)continue;return{value:pt.arg,done:y.done}}pt.type==="throw"&&(x=wt,y.method="throw",y.arg=pt.arg)}}}function Ut(h,l){var y=l.method,x=h.iterator[y];if(x===m)return l.delegate=null,y==="throw"&&h.iterator.return&&(l.method="return",l.arg=m,Ut(h,l),l.method==="throw")||y!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+y+"' method")),Pt;var A=Vt(x,h.iterator,l.arg);if(A.type==="throw")return l.method="throw",l.arg=A.arg,l.delegate=null,Pt;var M=A.arg;return M?M.done?(l[h.resultName]=M.value,l.next=h.nextLoc,l.method!=="return"&&(l.method="next",l.arg=m),l.delegate=null,Pt):M:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,Pt)}function Zt(h){var l={tryLoc:h[0]};1 in h&&(l.catchLoc=h[1]),2 in h&&(l.finallyLoc=h[2],l.afterLoc=h[3]),this.tryEntries.push(l)}function ce(h){var l=h.completion||{};l.type="normal",delete l.arg,h.completion=l}function le(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(Zt,this),this.reset(!0)}function te(h){if(h||h===""){var l=h[yt];if(l)return l.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var y=-1,x=function A(){for(;++y<h.length;)if(st.call(h,y))return A.value=h[y],A.done=!1,A;return A.value=m,A.done=!0,A};return x.next=x}}throw new TypeError(F(h)+" is not iterable")}return ee.prototype=jt,vt(Jt,"constructor",{value:jt,configurable:!0}),vt(jt,"constructor",{value:ee,configurable:!0}),ee.displayName=ft(jt,Dt,"GeneratorFunction"),V.isGeneratorFunction=function(h){var l=typeof h=="function"&&h.constructor;return!!l&&(l===ee||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,jt):(h.__proto__=jt,ft(h,Dt,"GeneratorFunction")),h.prototype=Object.create(Jt),h},V.awrap=function(h){return{__await:h}},pe($t.prototype),ft($t.prototype,At,(function(){return this})),V.AsyncIterator=$t,V.async=function(h,l,y,x,A){A===void 0&&(A=Promise);var M=new $t(Yt(h,l,y,x),A);return V.isGeneratorFunction(l)?M:M.next().then((function(rt){return rt.done?rt.value:M.next()}))},pe(Jt),ft(Jt,Dt,"Generator"),ft(Jt,yt,(function(){return this})),ft(Jt,"toString",(function(){return"[object Generator]"})),V.keys=function(h){var l=Object(h),y=[];for(var x in l)y.push(x);return y.reverse(),function A(){for(;y.length;){var M=y.pop();if(M in l)return A.value=M,A.done=!1,A}return A.done=!0,A}},V.values=te,le.prototype={constructor:le,reset:function(h){if(this.prev=0,this.next=0,this.sent=this._sent=m,this.done=!1,this.delegate=null,this.method="next",this.arg=m,this.tryEntries.forEach(ce),!h)for(var l in this)l.charAt(0)==="t"&&st.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=m)},stop:function(){this.done=!0;var h=this.tryEntries[0].completion;if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(h){if(this.done)throw h;var l=this;function y(pt,Gt){return M.type="throw",M.arg=h,l.next=pt,Gt&&(l.method="next",l.arg=m),!!Gt}for(var x=this.tryEntries.length-1;x>=0;--x){var A=this.tryEntries[x],M=A.completion;if(A.tryLoc==="root")return y("end");if(A.tryLoc<=this.prev){var rt=st.call(A,"catchLoc"),mt=st.call(A,"finallyLoc");if(rt&&mt){if(this.prev<A.catchLoc)return y(A.catchLoc,!0);if(this.prev<A.finallyLoc)return y(A.finallyLoc)}else if(rt){if(this.prev<A.catchLoc)return y(A.catchLoc,!0)}else{if(!mt)throw Error("try statement without catch or finally");if(this.prev<A.finallyLoc)return y(A.finallyLoc)}}}},abrupt:function(h,l){for(var y=this.tryEntries.length-1;y>=0;--y){var x=this.tryEntries[y];if(x.tryLoc<=this.prev&&st.call(x,"finallyLoc")&&this.prev<x.finallyLoc){var A=x;break}}A&&(h==="break"||h==="continue")&&A.tryLoc<=l&&l<=A.finallyLoc&&(A=null);var M=A?A.completion:{};return M.type=h,M.arg=l,A?(this.method="next",this.next=A.finallyLoc,Pt):this.complete(M)},complete:function(h,l){if(h.type==="throw")throw h.arg;return h.type==="break"||h.type==="continue"?this.next=h.arg:h.type==="return"?(this.rval=this.arg=h.arg,this.method="return",this.next="end"):h.type==="normal"&&l&&(this.next=l),Pt},finish:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===h)return this.complete(y.completion,y.afterLoc),ce(y),Pt}},catch:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===h){var x=y.completion;if(x.type==="throw"){var A=x.arg;ce(y)}return A}}throw Error("illegal catch attempt")},delegateYield:function(h,l,y){return this.delegate={iterator:te(h),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=m),Pt}},V}function St(m,V,_t,st,vt,ut,yt){try{var At=m[ut](yt),Dt=At.value}catch(ft){return void _t(ft)}At.done?V(Dt):Promise.resolve(Dt).then(st,vt)}function I(m){return T.apply(this,arguments)}function T(){var m;return m=k().mark((function V(_t){var st,vt,ut;return k().wrap((function(yt){for(;;)switch(yt.prev=yt.next){case 0:return st=_t.url,vt=_t.channel,ut=_t.callback,yt.next=3,Z({url:st,channel:vt,callback:ut});case 3:case"end":return yt.stop()}}),V)})),T=function(){var V=this,_t=arguments;return new Promise((function(st,vt){var ut=m.apply(V,_t);function yt(Dt){St(ut,st,vt,yt,At,"next",Dt)}function At(Dt){St(ut,st,vt,yt,At,"throw",Dt)}yt(void 0)}))},T.apply(this,arguments)}var O={getJrCommand:I};(g=S.hmd(g)).exports&&(g.exports=O,g.exports.getJrCommand=I),typeof window!="undefined"&&(window.LyyGetCommandSDK=O);let P=O},307:function(g,D,S){var J,$,at;function Rt(ht){return Rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Q){return typeof Q}:function(Q){return Q&&typeof Symbol=="function"&&Q.constructor===Symbol&&Q!==Symbol.prototype?"symbol":typeof Q},Rt(ht)}at=function(){"use strict";function ht(t){return(ht=typeof Symbol=="function"&&Rt(Symbol.iterator)=="symbol"?function(r){return Rt(r)}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":Rt(r)})(t)}function Q(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function ve(t,r){for(var s=0;s<r.length;s++){var c=r[s];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}function R(t,r,s){return r&&ve(t.prototype,r),s&&ve(t,s),t}function Z(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&F(t,r)}function dt(t){return(dt=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(t)}function F(t,r){return(F=Object.setPrototypeOf||function(s,c){return s.__proto__=c,s})(t,r)}function k(t){var r=(function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(s){return!1}})();return function(){var s,c=dt(t);return(function(d,p){if(p&&(Rt(p)=="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E})(d)})(this,r?(s=dt(this).constructor,Reflect.construct(c,arguments,s)):c.apply(this,arguments))}}function St(t){return(function(r){if(Array.isArray(r))return I(r)})(t)||(function(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)})(t)||(function(r,s){if(r){if(typeof r=="string")return I(r,s);var c=Object.prototype.toString.call(r).slice(8,-1);return(c=c==="Object"&&r.constructor?r.constructor.name:c)==="Map"||c==="Set"?Array.from(r):c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?I(r,s):void 0}})(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function I(t,r){(r==null||r>t.length)&&(r=t.length);for(var s=0,c=new Array(r);s<r;s++)c[s]=t[s];return c}var T=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:S.g!==void 0?S.g:typeof self!="undefined"?self:{},O=!1,P=!1,m={console:!0,focus:!1,time:!1,length:!0,infinite:!1,time_interval:500,time_threshold:100,length_threshold:300},V=function(){typeof document!="undefined"&&document.hasFocus&&!document.hasFocus()&&(P=!0)},_t=function(){var t=Date.now();Date.now()-t>m.time_threshold&&(P=!0)},st=function(){var t=T.outerWidth,r=T.outerHeight,s=T.innerWidth,c=T.innerHeight;t&&r&&s&&c&&typeof t=="number"&&typeof r=="number"&&typeof s=="number"&&typeof c=="number"&&(t-s>m.length_threshold||r-c>m.length_threshold)&&(P=!0)};(Ot={}).start=function(t){if(!O){if(t&&ht(t)==="object")for(var r in t)m[r]=t[r];var s;m.infinite&&(typeof window!="undefined"&&Object.prototype.toString.call(window)==="[object Window]"?typeof Function!="undefined"&&Function.constructor!==void 0&&/Function[^]*\[native code\]/.test(""+Function.constructor)&&typeof setInterval!="undefined"&&/setInterval[^]*\[native code\]/.test(""+setInterval)?new Function('setInterval(function(){!/Function[^]*[native code]/.test("" + Function.constructor) ? function(){while(1);}() : new Function("debugger")(); }, 100);')():P=!0:setInterval((function(){}),100)),m.console&&(function(){var c=new Date;c.toString=function(){for(var d=Date.now();;)if(10<Date.now()-d)return Date.now()},console.log(c),c.toString=function(){return P=!0,Date.now()}})(),m.focus&&V(),m.time&&_t(),m.length&&st(),s=setInterval((function(){s&&P&&clearInterval(s),m.focus&&V(),m.time&&_t(),m.length&&st()}),m.time_interval),O=!0}},Ot.isDebug=function(){return P};var vt=Ot,ut=".123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-!",yt={my_b4_encode:function(t){var r=0,s=(j=0)<t.length%3?3-t.length%3:0;for(r=0;r<s;r++)t[t.length]=0;var c="";for(j=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
3
- `),c+=ut[t[j]>>2]+ut[(3&t[j])<<4|t[j+1]>>4]+ut[(15&t[j+1])<<2|t[j+2]>>6]+ut[63&t[j+2]];for(r=0;r<s;r++)c+=ut[64];return c},my_b4_decode:function(t){var r=0,s=0,c=(t=t.replace(/[^A-Za-z0-9\+\-\!\.]/g,"")).length%4;if(2<c)return null;for(r=0;r<c;r++)if(t.charAt(t.length-r-1)!=ut[64])return null;var d,p,E,C,w=new Array(3*(t.length-c)/4);for(r=0,s=0;s<w.length;)d=ut.indexOf(t.charAt(r++)),p=ut.indexOf(t.charAt(r++)),E=ut.indexOf(t.charAt(r++)),C=ut.indexOf(t.charAt(r++)),w[s++]=d<<2|p>>4,w[s++]=(15&p)<<4|E>>2,w[s++]=(3&E)<<6|C;for(r=0;r<c;r++)if(w.pop()!=0)return null;return w}},At="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Dt={b4_encode:function(t){var r=0,s=(j=0)<t.length%3?3-t.length%3:0;for(r=0;r<s;r++)t[t.length]=0;var c="";for(r=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
4
- `),c+=At[t[j]>>2]+At[(3&t[j])<<4|t[j+1]>>4]+At[(15&t[j+1])<<2|t[j+2]>>6]+At[63&t[j+2]];for(r=0;r<s;r++)c+="=";return c},b4_decode:function(t){var r=0,s=0,c=(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length%4;if(2<c)return null;for(r=0;r<c;r++)if(t.charAt(t.length-r-1)!="=")return null;var d,p,E,C,w=new Array(3*(t.length-c)/4);for(r=0,s=0;s<w.length;)d=At.indexOf(t.charAt(r++)),p=At.indexOf(t.charAt(r++)),E=At.indexOf(t.charAt(r++)),C=At.indexOf(t.charAt(r++)),w[s++]=d<<2|p>>4,w[s++]=(15&p)<<4|E>>2,w[s++]=(3&E)<<6|C;for(r=0;r<c;r++)if(w.pop()!=0)return null;return w}};function ft(){}ft.encode=function(t,r,s){for(var c=new Array(2*s),d=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),p=r,E=0;p<s+r;p++,E++)c[E]=d[(255&t[p])>>4],c[++E]=d[15&t[p]];return c.join("")},ft.decode=function(t){if(t==null||t==""||t.length%2!=0)return null;for(var r=t.length/2,s=ft.toCharCodeArray(t),c=new Array(r),d=0;d<r;d++){if(48<=s[2*d]&&s[2*d]<=57)c[d]=s[2*d]-48<<4;else if(65<=s[2*d]&&s[2*d]<=70)c[d]=s[2*d]-65+10<<4;else{if(!(97<=s[2*d]&&s[2*d]<=102))return null;c[d]=s[2*d]-97+10<<4}if(48<=s[2*d+1]&&s[2*d+1]<=57)c[d]=c[d]|s[2*d+1]-48;else if(65<=s[2*d+1]&&s[2*d+1]<=70)c[d]=c[d]|s[2*d+1]-65+10;else{if(!(97<=s[2*d+1]&&s[2*d+1]<=102))return null;c[d]=c[d]|s[2*d+1]-97+10}}return c},ft.toCharCodeArray=function(t){for(var r=new Array(t.length),s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return r};var Yt=ft,Vt=Yt;(Ut=function(){}).utf8StrToh6=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],d=0;d<s;d++)c[d]=r.charCodeAt(d).toString(16);return c.join("")},Ut.utf8StrToBytes=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],d=0;d<s;d++)c[d]=r.charCodeAt(d);return c},Ut.hexToUtf8Str=function(t){for(var r=Vt.decode(t),s=[],c=0;c<r.length;c++)s.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(s.join("")))},Ut.bytesToUtf8Str=function(t){for(var r=t,s=[],c=0;c<r.length;c++)s.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(s.join("")))},Ut.intToByte=function(t){return new Array(t>>24&255,t>>16&255,t>>8&255,255&t)},Ut.byteToInt=function(t,r){return r+3<t.length?t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]:r+2<t.length?t[r+1]<<16|t[r+2]<<8|t[r+3]:r+1<t.length?t[r]<<8|t[r+1]:t[r]};var kt,zt=Ut,Ht={exports:{}};kt=Ht,function(){function t(e,n,o){e!=null&&(typeof e=="number"?this.fromNumber(e,n,o):n==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,n))}function r(){return new t(null)}var s=(s=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(t.prototype.am=function(e,n,o,f,v,N){for(var B=32767&n,L=n>>15;0<=--N;){var xt=32767&this[e],Kt=this[e++]>>15,ae=L*xt+Kt*B;v=((xt=B*xt+((32767&ae)<<15)+o[f]+(1073741823&v))>>>30)+(ae>>>15)+L*Kt+(v>>>30),o[f++]=1073741823&xt}return v},30):s&&navigator.appName!="Netscape"?(t.prototype.am=function(e,n,o,f,v,N){for(;0<=--N;){var B=n*this[e++]+o[f]+v;v=Math.floor(B/67108864),o[f++]=67108863&B}return v},26):(t.prototype.am=function(e,n,o,f,v,N){for(var B=16383&n,L=n>>14;0<=--N;){var xt=16383&this[e],Kt=this[e++]>>14,ae=L*xt+Kt*B;v=((xt=B*xt+((16383&ae)<<14)+o[f]+v)>>28)+(ae>>14)+L*Kt,o[f++]=268435455&xt}return v},28);t.prototype.DB=s,t.prototype.DM=(1<<s)-1,t.prototype.DV=1<<s,t.prototype.FV=Math.pow(2,52),t.prototype.F1=52-s,t.prototype.F2=2*s-52;for(var c=new Array,d=48,p=0;p<=9;++p)c[d++]=p;for(d=97,p=10;p<36;++p)c[d++]=p;for(d=65,p=10;p<36;++p)c[d++]=p;function E(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function C(e,n){return(e=c[e.charCodeAt(n)])==null?-1:e}function w(e){var n=r();return n.fromInt(e),n}function nt(e){var n,o=1;return(n=e>>>16)!=0&&(e=n,o+=16),(n=e>>8)!=0&&(e=n,o+=8),(n=e>>4)!=0&&(e=n,o+=4),(n=e>>2)!=0&&(e=n,o+=2),(n=e>>1)!=0&&(e=n,o+=1),o}function ot(e){this.m=e}function b(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function H(e,n){return e&n}function tt(e,n){return e|n}function W(e,n){return e^n}function it(e,n){return e&~n}function lt(){}function Ct(e){return e}function q(e){this.r2=r(),this.q3=r(),t.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}ot.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},ot.prototype.revert=function(e){return e},ot.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},ot.prototype.mulTo=function(e,n,o){e.multiplyTo(n,o),this.reduce(o)},ot.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)},b.prototype.convert=function(e){var n=r();return e.abs().dlShiftTo(this.m.t,n),n.divRemTo(this.m,null,n),e.s<0&&0<n.compareTo(t.ZERO)&&this.m.subTo(n,n),n},b.prototype.revert=function(e){var n=r();return e.copyTo(n),this.reduce(n),n},b.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var n=0;n<this.m.t;++n){var o=32767&e[n],f=o*this.mpl+((o*this.mph+(e[n]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[o=n+this.m.t]+=this.m.am(0,f,e,n,0,this.m.t);e[o]>=e.DV;)e[o]-=e.DV,e[++o]++}e.clamp(),e.drShiftTo(this.m.t,e),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,n,o){e.multiplyTo(n,o),this.reduce(o)},b.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)},t.prototype.copyTo=function(e){for(var n=this.t-1;0<=n;--n)e[n]=this[n];e.t=this.t,e.s=this.s},t.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0<e?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},t.prototype.fromString=function(e,n){var o;if(n==16)o=4;else if(n==8)o=3;else if(n==256)o=8;else if(n==2)o=1;else if(n==32)o=5;else{if(n!=4)return void this.fromRadix(e,n);o=2}this.t=0,this.s=0;for(var f=e.length,v=!1,N=0;0<=--f;){var B=o==8?255&e[f]:C(e,f);B<0?e.charAt(f)=="-"&&(v=!0):(v=!1,N==0?this[this.t++]=B:N+o>this.DB?(this[this.t-1]|=(B&(1<<this.DB-N)-1)<<N,this[this.t++]=B>>this.DB-N):this[this.t-1]|=B<<N,(N+=o)>=this.DB&&(N-=this.DB))}o==8&&128&e[0]&&(this.s=-1,0<N&&(this[this.t-1]|=(1<<this.DB-N)-1<<N)),this.clamp(),v&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var e=this.s&this.DM;0<this.t&&this[this.t-1]==e;)--this.t},t.prototype.dlShiftTo=function(e,n){for(var o=this.t-1;0<=o;--o)n[o+e]=this[o];for(o=e-1;0<=o;--o)n[o]=0;n.t=this.t+e,n.s=this.s},t.prototype.drShiftTo=function(e,n){for(var o=e;o<this.t;++o)n[o-e]=this[o];n.t=Math.max(this.t-e,0),n.s=this.s},t.prototype.lShiftTo=function(e,n){for(var o=e%this.DB,f=this.DB-o,v=(1<<f)-1,N=Math.floor(e/this.DB),B=this.s<<o&this.DM,L=this.t-1;0<=L;--L)n[L+N+1]=this[L]>>f|B,B=(this[L]&v)<<o;for(L=N-1;0<=L;--L)n[L]=0;n[N]=B,n.t=this.t+N+1,n.s=this.s,n.clamp()},t.prototype.rShiftTo=function(e,n){n.s=this.s;var o=Math.floor(e/this.DB);if(o>=this.t)n.t=0;else{var f=e%this.DB,v=this.DB-f,N=(1<<f)-1;n[0]=this[o]>>f;for(var B=o+1;B<this.t;++B)n[B-o-1]|=(this[B]&N)<<v,n[B-o]=this[B]>>f;0<f&&(n[this.t-o-1]|=(this.s&N)<<v),n.t=this.t-o,n.clamp()}},t.prototype.subTo=function(e,n){for(var o=0,f=0,v=Math.min(e.t,this.t);o<v;)f+=this[o]-e[o],n[o++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f-=e.s;o<this.t;)f+=this[o],n[o++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;o<e.t;)f-=e[o],n[o++]=f&this.DM,f>>=this.DB;f-=e.s}n.s=f<0?-1:0,f<-1?n[o++]=this.DV+f:0<f&&(n[o++]=f),n.t=o,n.clamp()},t.prototype.multiplyTo=function(e,n){var o=this.abs(),f=e.abs(),v=o.t;for(n.t=v+f.t;0<=--v;)n[v]=0;for(v=0;v<f.t;++v)n[v+o.t]=o.am(0,f[v],n,v,0,o.t);n.s=0,n.clamp(),this.s!=e.s&&t.ZERO.subTo(n,n)},t.prototype.squareTo=function(e){for(var n=this.abs(),o=e.t=2*n.t;0<=--o;)e[o]=0;for(o=0;o<n.t-1;++o){var f=n.am(o,n[o],e,2*o,0,1);(e[o+n.t]+=n.am(o+1,2*n[o],e,2*o+1,f,n.t-o-1))>=n.DV&&(e[o+n.t]-=n.DV,e[o+n.t+1]=1)}0<e.t&&(e[e.t-1]+=n.am(o,n[o],e,2*o,0,1)),e.s=0,e.clamp()},t.prototype.divRemTo=function(e,n,o){var f=e.abs();if(!(f.t<=0)){if((Kt=this.abs()).t<f.t)return n!=null&&n.fromInt(0),void(o!=null&&this.copyTo(o));o==null&&(o=r());var v=r(),N=this.s,B=e.s;0<(e=this.DB-nt(f[f.t-1]))?(f.lShiftTo(e,v),Kt.lShiftTo(e,o)):(f.copyTo(v),Kt.copyTo(o));var L=v.t,xt=v[L-1];if(xt!=0){var Kt=xt*(1<<this.F1)+(1<L?v[L-2]>>this.F2:0),ae=this.FV/Kt,fe=(1<<this.F1)/Kt,Ie=1<<this.F2,Bt=o.t,ge=Bt-L,qt=n==null?r():n;for(v.dlShiftTo(ge,qt),0<=o.compareTo(qt)&&(o[o.t++]=1,o.subTo(qt,o)),t.ONE.dlShiftTo(L,qt),qt.subTo(v,v);v.t<L;)v[v.t++]=0;for(;0<=--ge;){var Ke=o[--Bt]==xt?this.DM:Math.floor(o[Bt]*ae+(o[Bt-1]+Ie)*fe);if((o[Bt]+=v.am(0,Ke,o,ge,0,L))<Ke)for(v.dlShiftTo(ge,qt),o.subTo(qt,o);o[Bt]<--Ke;)o.subTo(qt,o)}n!=null&&(o.drShiftTo(L,n),N!=B&&t.ZERO.subTo(n,n)),o.t=L,o.clamp(),0<e&&o.rShiftTo(e,o),N<0&&t.ZERO.subTo(o,o)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var n=3&e;return 0<(n=(n=(n=(n=n*(2-(15&e)*n)&15)*(2-(255&e)*n)&255)*(2-((65535&e)*n&65535))&65535)*(2-e*n%this.DV)%this.DV)?this.DV-n:-n},t.prototype.isEven=function(){return(0<this.t?1&this[0]:this.s)==0},t.prototype.exp=function(e,n){if(4294967295<e||e<1)return t.ONE;var o,f=r(),v=r(),N=n.convert(this),B=nt(e)-1;for(N.copyTo(f);0<=--B;)n.sqrTo(f,v),0<(e&1<<B)?n.mulTo(v,N,f):(o=f,f=v,v=o);return n.revert(f)},t.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var n;if(e==16)n=4;else if(e==8)n=3;else if(e==2)n=1;else if(e==32)n=5;else{if(e!=4)return this.toRadix(e);n=2}var o,f=(1<<n)-1,v=!1,N="",B=this.t,L=this.DB-B*this.DB%n;if(0<B--)for(L<this.DB&&0<(o=this[B]>>L)&&(v=!0,N=E(o));0<=B;)L<n?(o=(this[B]&(1<<L)-1)<<n-L,o|=this[--B]>>(L+=this.DB-n)):(o=this[B]>>(L-=n)&f,L<=0&&(L+=this.DB,--B)),(v=0<o||v)&&(N+=E(o));return v?N:"0"},t.prototype.negate=function(){var e=r();return t.ZERO.subTo(this,e),e},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(e){var n=this.s-e.s;if(n!=0)return n;var o=this.t;if((n=o-e.t)!=0)return this.s<0?-n:n;for(;0<=--o;)if((n=this[o]-e[o])!=0)return n;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+nt(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var n=r();return this.abs().divRemTo(e,null,n),this.s<0&&0<n.compareTo(t.ZERO)&&e.subTo(n,n),n},t.prototype.modPowInt=function(e,n){return n=new(e<256||n.isEven()?ot:b)(n),this.exp(e,n)},t.ZERO=w(0),t.ONE=w(1),lt.prototype.convert=Ct,lt.prototype.revert=Ct,lt.prototype.mulTo=function(e,n,o){e.multiplyTo(n,o)},lt.prototype.sqrTo=function(e,n){e.squareTo(n)},q.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var n=r();return e.copyTo(n),this.reduce(n),n},q.prototype.revert=function(e){return e},q.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);0<=e.compareTo(this.m);)e.subTo(this.m,e)},q.prototype.mulTo=function(e,n,o){e.multiplyTo(n,o),this.reduce(o)},q.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)};var X,Y=[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],G=(1<<26)/Y[Y.length-1];function K(){var e;e=new Date().getTime(),gt[et++]^=255&e,gt[et++]^=e>>8&255,gt[et++]^=e>>16&255,gt[et++]^=e>>24&255,Xe<=et&&(et-=Xe)}if(t.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},t.prototype.toRadix=function(e){if(e==null&&(e=10),this.signum()==0||e<2||36<e)return"0";var n=this.chunkSize(e),o=Math.pow(e,n),f=w(o),v=r(),N=r(),B="";for(this.divRemTo(f,v,N);0<v.signum();)B=(o+N.intValue()).toString(e).substr(1)+B,v.divRemTo(f,v,N);return N.intValue().toString(e)+B},t.prototype.fromRadix=function(e,n){this.fromInt(0);for(var o=this.chunkSize(n=n==null?10:n),f=Math.pow(n,o),v=!1,N=0,B=0,L=0;L<e.length;++L){var xt=C(e,L);xt<0?e.charAt(L)=="-"&&this.signum()==0&&(v=!0):(B=n*B+xt,++N>=o&&(this.dMultiply(f),this.dAddOffset(B,0),B=N=0))}0<N&&(this.dMultiply(Math.pow(n,N)),this.dAddOffset(B,0)),v&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,n,o){if(typeof n=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,o),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),tt,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 f=new Array;o=7&e,f.length=1+(e>>3),n.nextBytes(f),0<o?f[0]&=(1<<o)-1:f[0]=0,this.fromString(f,256)}},t.prototype.bitwiseTo=function(e,n,o){for(var f,v=Math.min(e.t,this.t),N=0;N<v;++N)o[N]=n(this[N],e[N]);if(e.t<this.t){for(f=e.s&this.DM,N=v;N<this.t;++N)o[N]=n(this[N],f);o.t=this.t}else{for(f=this.s&this.DM,N=v;N<e.t;++N)o[N]=n(f,e[N]);o.t=e.t}o.s=n(this.s,e.s),o.clamp()},t.prototype.changeBit=function(e,n){return e=t.ONE.shiftLeft(e),this.bitwiseTo(e,n,e),e},t.prototype.addTo=function(e,n){for(var o=0,f=0,v=Math.min(e.t,this.t);o<v;)f+=this[o]+e[o],n[o++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f+=e.s;o<this.t;)f+=this[o],n[o++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;o<e.t;)f+=e[o],n[o++]=f&this.DM,f>>=this.DB;f+=e.s}n.s=f<0?-1:0,0<f?n[o++]=f:f<-1&&(n[o++]=this.DV+f),n.t=o,n.clamp()},t.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(e,n){if(e!=0){for(;this.t<=n;)this[this.t++]=0;for(this[n]+=e;this[n]>=this.DV;)this[n]-=this.DV,++n>=this.t&&(this[this.t++]=0),++this[n]}},t.prototype.multiplyLowerTo=function(e,n,o){var f,v=Math.min(this.t+e.t,n);for(o.s=0,o.t=v;0<v;)o[--v]=0;for(f=o.t-this.t;v<f;++v)o[v+this.t]=this.am(0,e[v],o,v,0,this.t);for(f=Math.min(e.t,n);v<f;++v)this.am(0,e[v],o,v,0,n-v);o.clamp()},t.prototype.multiplyUpperTo=function(e,n,o){var f=o.t=this.t+e.t- --n;for(o.s=0;0<=--f;)o[f]=0;for(f=Math.max(n-this.t,0);f<e.t;++f)o[this.t+f-n]=this.am(n-f,e[f],o,0,0,this.t+f-n);o.clamp(),o.drShiftTo(1,o)},t.prototype.modInt=function(e){if(e<=0)return 0;var n=this.DV%e,o=this.s<0?e-1:0;if(0<this.t)if(n==0)o=this[0]%e;else for(var f=this.t-1;0<=f;--f)o=(n*o+this[f])%e;return o},t.prototype.millerRabin=function(e){var n=this.subtract(t.ONE),o=n.getLowestSetBit();if(o<=0)return!1;var f=n.shiftRight(o);Y.length<(e=e+1>>1)&&(e=Y.length);for(var v=r(),N=0;N<e;++N){v.fromInt(Y[Math.floor(Math.random()*Y.length)]);var B=v.modPow(f,this);if(B.compareTo(t.ONE)!=0&&B.compareTo(n)!=0){for(var L=1;L++<o&&B.compareTo(n)!=0;)if((B=B.modPowInt(2,this)).compareTo(t.ONE)==0)return!1;if(B.compareTo(n)!=0)return!1}}return!0},t.prototype.clone=function(){var e=r();return this.copyTo(e),e},t.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},t.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},t.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},t.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},t.prototype.toByteArray=function(){var e=this.t,n=new Array;n[0]=this.s;var o,f=this.DB-e*this.DB%8,v=0;if(0<e--)for(f<this.DB&&(o=this[e]>>f)!=(this.s&this.DM)>>f&&(n[v++]=o|this.s<<this.DB-f);0<=e;)f<8?(o=(this[e]&(1<<f)-1)<<8-f,o|=this[--e]>>(f+=this.DB-8)):(o=this[e]>>(f-=8)&255,f<=0&&(f+=this.DB,--e)),128&o&&(o|=-256),v==0&&(128&this.s)!=(128&o)&&++v,(0<v||o!=this.s)&&(n[v++]=o);return n},t.prototype.equals=function(e){return this.compareTo(e)==0},t.prototype.min=function(e){return this.compareTo(e)<0?this:e},t.prototype.max=function(e){return 0<this.compareTo(e)?this:e},t.prototype.and=function(e){var n=r();return this.bitwiseTo(e,H,n),n},t.prototype.or=function(e){var n=r();return this.bitwiseTo(e,tt,n),n},t.prototype.xor=function(e){var n=r();return this.bitwiseTo(e,W,n),n},t.prototype.andNot=function(e){var n=r();return this.bitwiseTo(e,it,n),n},t.prototype.not=function(){for(var e=r(),n=0;n<this.t;++n)e[n]=this.DM&~this[n];return e.t=this.t,e.s=~this.s,e},t.prototype.shiftLeft=function(e){var n=r();return e<0?this.rShiftTo(-e,n):this.lShiftTo(e,n),n},t.prototype.shiftRight=function(e){var n=r();return e<0?this.lShiftTo(-e,n):this.rShiftTo(e,n),n},t.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+(function(n){if(n==0)return-1;var o=0;return!(65535&n)&&(n>>=16,o+=16),!(255&n)&&(n>>=8,o+=8),!(15&n)&&(n>>=4,o+=4),!(3&n)&&(n>>=2,o+=2),!(1&n)&&++o,o})(this[e]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var e=0,n=this.s&this.DM,o=0;o<this.t;++o)e+=(function(f){for(var v=0;f!=0;)f&=f-1,++v;return v})(this[o]^n);return e},t.prototype.testBit=function(e){var n=Math.floor(e/this.DB);return n>=this.t?this.s!=0:!!(this[n]&1<<e%this.DB)},t.prototype.setBit=function(e){return this.changeBit(e,tt)},t.prototype.clearBit=function(e){return this.changeBit(e,it)},t.prototype.flipBit=function(e){return this.changeBit(e,W)},t.prototype.add=function(e){var n=r();return this.addTo(e,n),n},t.prototype.subtract=function(e){var n=r();return this.subTo(e,n),n},t.prototype.multiply=function(e){var n=r();return this.multiplyTo(e,n),n},t.prototype.divide=function(e){var n=r();return this.divRemTo(e,n,null),n},t.prototype.remainder=function(e){var n=r();return this.divRemTo(e,null,n),n},t.prototype.divideAndRemainder=function(e){var n=r(),o=r();return this.divRemTo(e,n,o),new Array(n,o)},t.prototype.modPow=function(e,n){var o=e.bitLength(),f=w(1);if(o<=0)return f;var v=o<18?1:o<48?3:o<144?4:o<768?5:6,N=new(o<8?ot:n.isEven()?q:b)(n),B=new Array,L=3,xt=v-1,Kt=(1<<v)-1;if(B[1]=N.convert(this),1<v){var ae=r();for(N.sqrTo(B[1],ae);L<=Kt;)B[L]=r(),N.mulTo(ae,B[L-2],B[L]),L+=2}var fe,Ie,Bt=e.t-1,ge=!0,qt=r();for(o=nt(e[Bt])-1;0<=Bt;){for(xt<=o?fe=e[Bt]>>o-xt&Kt:(fe=(e[Bt]&(1<<o+1)-1)<<xt-o,0<Bt&&(fe|=e[Bt-1]>>this.DB+o-xt)),L=v;!(1&fe);)fe>>=1,--L;if((o-=L)<0&&(o+=this.DB,--Bt),ge)B[fe].copyTo(f),ge=!1;else{for(;1<L;)N.sqrTo(f,qt),N.sqrTo(qt,f),L-=2;0<L?N.sqrTo(f,qt):(Ie=f,f=qt,qt=Ie),N.mulTo(qt,B[fe],f)}for(;0<=Bt&&!(e[Bt]&1<<o);)N.sqrTo(f,qt),Ie=f,f=qt,qt=Ie,--o<0&&(o=this.DB-1,--Bt)}return N.revert(f)},t.prototype.modInverse=function(e){var n=e.isEven();if(this.isEven()&&n||e.signum()==0)return t.ZERO;for(var o=e.clone(),f=this.clone(),v=w(1),N=w(0),B=w(0),L=w(1);o.signum()!=0;){for(;o.isEven();)o.rShiftTo(1,o),n?(v.isEven()&&N.isEven()||(v.addTo(this,v),N.subTo(e,N)),v.rShiftTo(1,v)):N.isEven()||N.subTo(e,N),N.rShiftTo(1,N);for(;f.isEven();)f.rShiftTo(1,f),n?(B.isEven()&&L.isEven()||(B.addTo(this,B),L.subTo(e,L)),B.rShiftTo(1,B)):L.isEven()||L.subTo(e,L),L.rShiftTo(1,L);0<=o.compareTo(f)?(o.subTo(f,o),n&&v.subTo(B,v),N.subTo(L,N)):(f.subTo(o,f),n&&B.subTo(v,B),L.subTo(N,L))}return f.compareTo(t.ONE)!=0?t.ZERO:0<=L.compareTo(e)?L.subtract(e):L.signum()<0?(L.addTo(e,L),L.signum()<0?L.add(e):L):L},t.prototype.pow=function(e){return this.exp(e,new lt)},t.prototype.gcd=function(e){var n=this.s<0?this.negate():this.clone(),o=e.s<0?e.negate():e.clone();n.compareTo(o)<0&&(v=n,n=o,o=v);var f=n.getLowestSetBit(),v=o.getLowestSetBit();if(v<0)return n;for(0<(v=f<v?f:v)&&(n.rShiftTo(v,n),o.rShiftTo(v,o));0<n.signum();)0<(f=n.getLowestSetBit())&&n.rShiftTo(f,n),0<(f=o.getLowestSetBit())&&o.rShiftTo(f,o),0<=n.compareTo(o)?(n.subTo(o,n),n.rShiftTo(1,n)):(o.subTo(n,o),o.rShiftTo(1,o));return 0<v&&o.lShiftTo(v,o),o},t.prototype.isProbablePrime=function(e){var n,o=this.abs();if(o.t==1&&o[0]<=Y[Y.length-1]){for(n=0;n<Y.length;++n)if(o[0]==Y[n])return!0;return!1}if(o.isEven())return!1;for(n=1;n<Y.length;){for(var f=Y[n],v=n+1;v<Y.length&&f<G;)f*=Y[v++];for(f=o.modInt(f);n<v;)if(f%Y[n++]==0)return!1}return o.millerRabin(e)},t.prototype.square=function(){var e=r();return this.squareTo(e),e},t.prototype.Barrett=q,gt==null){var gt=new Array,et=0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var It=new Uint8Array(32);for(window.crypto.getRandomValues(It),Mt=0;Mt<32;++Mt)gt[et++]=It[Mt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var Nt=window.crypto.random(32),Mt=0;Mt<Nt.length;++Mt)gt[et++]=255&Nt.charCodeAt(Mt)}for(;et<Xe;)Mt=Math.floor(65536*Math.random()),gt[et++]=Mt>>>8,gt[et++]=255&Mt;et=0,K()}function He(){if(X==null){for(K(),(X=new Ge).init(gt),et=0;et<gt.length;++et)gt[et]=0;et=0}return X.next()}function Ar(){}function Ge(){this.i=0,this.j=0,this.S=new Array}Ar.prototype.nextBytes=function(e){for(var n=0;n<e.length;++n)e[n]=He()},Ge.prototype.init=function(e){for(var n,o,f=0;f<256;++f)this.S[f]=f;for(f=n=0;f<256;++f)n=n+this.S[f]+e[f%e.length]&255,o=this.S[f],this.S[f]=this.S[n],this.S[n]=o;this.i=0,this.j=0},Ge.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var Xe=256;kt.exports={default:t,BigInteger:t,SecureRandom:Ar}}.call(T);var wt=Ht.exports.BigInteger,Pt=(function(){function t(){Q(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return R(t,[{key:"getEncodedHex",value:function(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}},{key:"getLength",value:function(){var r=this.v.length/2,s=r.toString(16);return s.length%2==1&&(s="0"+s),r<128?s:(128+s.length/2).toString(16)+s}},{key:"getValue",value:function(){return""}}]),t})(),oe=(function(){Z(r,Pt);var t=k(r);function r(s){var c;return Q(this,r),(c=t.call(this)).t="02",s&&(c.v=(function(d){if((p=d.toString(16))[0]!=="-")p.length%2==1?p="0"+p:p.match(/^[0-7]/)||(p="00"+p);else{var p,E=(p=p.substr(1)).length;E%2==1?E+=1:p.match(/^[0-7]/)||(E+=2);for(var C="",w=0;w<E;w++)C+="f";p=(p=(C=new wt(C,16)).xor(d).add(wt.ONE)).toString(16).replace(/^-/,"")}return p})(s)),c}return R(r,[{key:"getValue",value:function(){return this.v}}]),r})(),ee=(function(){Z(r,Pt);var t=k(r);function r(s){var c;return Q(this,r),(c=t.call(this)).t="30",c.asn1Array=s,c}return R(r,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(s){return s.getEncodedHex()})).join(""),this.v}}]),r})();function jt(t,r){return+t[r+2]<8?1:128&+t.substr(r+2,2)}function ie(t,r){var s=jt(t,r);return(t=t.substr(r+2,2*s))?(+t[0]<8?new wt(t,16):new wt(t.substr(2),16)).intValue():-1}function re(t,r){return r+2*(jt(t,r)+1)}var Lt=Ht.exports.BigInteger,Jt=new Lt("3"),pe=(function(){function t(r,s){Q(this,t),this.x=s,this.q=r}return R(t,[{key:"equals",value:function(r){return r===this||this.q.equals(r.q)&&this.x.equals(r.x)}},{key:"toBigInteger",value:function(){return this.x}},{key:"negate",value:function(){return new t(this.q,this.x.negate().mod(this.q))}},{key:"add",value:function(r){return new t(this.q,this.x.add(r.toBigInteger()).mod(this.q))}},{key:"subtract",value:function(r){return new t(this.q,this.x.subtract(r.toBigInteger()).mod(this.q))}},{key:"multiply",value:function(r){return new t(this.q,this.x.multiply(r.toBigInteger()).mod(this.q))}},{key:"divide",value:function(r){return new t(this.q,this.x.multiply(r.toBigInteger().modInverse(this.q)).mod(this.q))}},{key:"square",value:function(){return new t(this.q,this.x.square().mod(this.q))}}]),t})(),$t=(function(){function t(r,s,c,d){Q(this,t),this.curve=r,this.x=s,this.y=c,this.z=d==null?Lt.ONE:d,this.zinv=null}return R(t,[{key:"getX",value:function(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"getY",value:function(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"equals",value:function(r){return r===this||(this.isInfinity()?r.isInfinity():r.isInfinity()?this.isInfinity():!!r.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(r.z)).mod(this.curve.q).equals(Lt.ZERO)&&r.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(r.z)).mod(this.curve.q).equals(Lt.ZERO))}},{key:"isInfinity",value:function(){return this.x===null&&this.y===null||this.z.equals(Lt.ZERO)&&!this.y.toBigInteger().equals(Lt.ZERO)}},{key:"negate",value:function(){return new t(this.curve,this.x,this.y.negate(),this.z)}},{key:"add",value:function(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var s=this.x.toBigInteger(),c=this.y.toBigInteger(),d=this.z,p=r.x.toBigInteger(),E=r.y.toBigInteger(),C=r.z,w=this.curve.q,nt=s.multiply(C).mod(w);return r=p.multiply(d).mod(w),s=nt.subtract(r),p=c.multiply(C).mod(w),c=E.multiply(d).mod(w),E=p.subtract(c),Lt.ZERO.equals(s)?Lt.ZERO.equals(E)?this.twice():this.curve.infinity:(c=nt.add(r),r=d.multiply(C).mod(w),C=s.square().mod(w),d=s.multiply(C).mod(w),c=r.multiply(E.square()).subtract(c.multiply(C)).mod(w),s=s.multiply(c).mod(w),p=E.multiply(C.multiply(nt).subtract(c)).subtract(p.multiply(d)).mod(w),w=d.multiply(r).mod(w),new t(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(p),w))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var r=this.x.toBigInteger(),s=this.y.toBigInteger(),c=this.z,d=this.curve.q,p=this.curve.a.toBigInteger(),E=r.square().multiply(Jt).add(p.multiply(c.square())).mod(d),C=s.shiftLeft(1).multiply(c).mod(d),w=(p=(w=s.square().mod(d)).multiply(r).multiply(c).mod(d),s=C.square().mod(d),r=E.square().subtract(p.shiftLeft(3)).mod(d),c=C.multiply(r).mod(d),E.multiply(p.shiftLeft(2).subtract(r)).subtract(s.shiftLeft(1).multiply(w)).mod(d));return d=C.multiply(s).mod(d),new t(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(w),d)}},{key:"multiply",value:function(r){if(this.isInfinity())return this;if(!r.signum())return this.curve.infinity;for(var s=r.multiply(Jt),c=this.negate(),d=this,p=s.bitLength()-2;0<p;p--){d=d.twice();var E=s.testBit(p);E!==r.testBit(p)&&(d=d.add(E?this:c))}return d}}]),t})(),Ot=(function(){function t(r,s,c){Q(this,t),this.q=r,this.a=this.fromBigInteger(s),this.b=this.fromBigInteger(c),this.infinity=new $t(this,null,null)}return R(t,[{key:"equals",value:function(r){return r===this||this.q.equals(r.q)&&this.a.equals(r.a)&&this.b.equals(r.b)}},{key:"fromBigInteger",value:function(r){return new pe(this.q,r)}},{key:"decodePointHex",value:function(r){switch(parseInt(r.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:default:return null;case 4:case 6:case 7:var s=(r.length-2)/2,c=r.substr(2,s);return s=r.substr(2+s,s),new $t(this,this.fromBigInteger(new Lt(c,16)),this.fromBigInteger(new Lt(s,16)))}}}]),t})(),Ut={ECPointFp:$t,ECCurveFp:Ot},Zt=Ht.exports.BigInteger,ce=(Ot=Ht.exports.SecureRandom,Ut.ECCurveFp),le=new Ot,te=(Ut=y()).curve,h=Ut.G,l=Ut.n;function y(){var t=new Zt("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),r=new Zt("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),s=new Zt("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return s=(r=new ce(t,r,s)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:r,G:s,n:new Zt("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function x(t,r){return t.length>=r?t:new Array(r-t.length+1).join("0")+t}function A(t,r){for(var s=[],c=~~(r/8),d=r%8,p=0,E=t.length;p<E;p++)s[p]=(t[(p+c)%E]<<d&255)+(t[(p+c+1)%E]>>>8-d&255);return s}function M(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=255&(t[c]^r[c]);return s}function rt(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=t[c]&r[c]&255;return s}function mt(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=255&(t[c]|r[c]);return s}function pt(t,r){for(var s=[],c=0,d=t.length-1;0<=d;d--){var p=t[d]+r[d]+c;c=255<p?1:0,s[d]=255&p}return s}function Gt(t,r,s,c){return 0<=c&&c<=15?M(M(t,r),s):mt(rt(t,r),rt((function(d){for(var p=[],E=d.length-1;0<=E;E--)p[E]=255&~d[E];return p})(t),s))}function Qt(t,r){for(var s=[],c=[],d=0;d<16;d++){var p=4*d;s.push(r.slice(p,4+p))}for(var E,C=16;C<68;C++)s.push(M(M((E=M(M(s[C-16],s[C-9]),A(s[C-3],15)),M(M(E,A(E,15)),A(E,23))),A(s[C-13],7)),s[C-6]));for(var w=0;w<64;w++)c.push(M(s[w],s[w+4]));for(var nt,ot,b,H=[121,204,69,25],tt=[122,135,157,138],W=t.slice(0,4),it=t.slice(4,8),lt=t.slice(8,12),Ct=t.slice(12,16),q=t.slice(16,20),X=t.slice(20,24),Y=t.slice(24,28),G=t.slice(28,32),K=0;K<64;K++){var gt=0<=K&&K<=15?H:tt,et=M(It=A(pt(pt(A(W,12),q),A(gt,K)),7),A(W,12)),It=(et=pt(pt(pt((nt=W,ot=it,b=lt,0<=(gt=K)&&gt<=15?M(M(nt,ot),b):mt(mt(rt(nt,ot),rt(nt,b)),rt(ot,b))),Ct),et),c[K]),pt(pt(pt(Gt(q,X,Y,K),G),It),s[K]));Ct=lt,lt=A(it,9),it=W,W=et,G=Y,Y=A(X,19),X=q,q=M(M(It,A(It,9)),A(It,17))}return M([].concat(W,it,lt,Ct,q,X,Y,G),t)}Ot={getGlobalCurve:function(){return te},generateEcparam:y,generateKeyPairHex:function(t,r,s){return{privateKey:s=x((r=(t?new Zt(t,r,s):new Zt(l.bitLength(),le)).mod(l.subtract(Zt.ONE)).add(Zt.ONE)).toString(16),64),publicKey:"04"+x((r=h.multiply(r)).getX().toBigInteger().toString(16),64)+x(r.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(t){for(var r=(t=unescape(encodeURIComponent(t))).length,s=[],c=0;c<r;c++)s[c>>>2]|=(255&t.charCodeAt(c))<<24-c%4*8;for(var d=[],p=0;p<r;p++){var E=s[p>>>2]>>>24-p%4*8&255;d.push((E>>>4).toString(16)),d.push((15&E).toString(16))}return d.join("")},leftPad:x,arrayToHex:function(t){return t.map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},arrayToUtf8:function(t){for(var r=[],s=0,c=0;c<2*t.length;c+=2)r[c>>>3]|=parseInt(t[s],10)<<24-c%8*4,s++;try{for(var d=[],p=0;p<t.length;p++){var E=r[p>>>2]>>>24-p%4*8&255;d.push(String.fromCharCode(E))}return decodeURIComponent(escape(d.join("")))}catch(C){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){for(var r=[],s=(t=(s=t.length)%2!=0?x(t,s+1):t).length,c=0;c<s;c+=2)r.push(parseInt(t.substr(c,2),16));return r},verifyPublicKey:function(t){var r=te.decodePointHex(t);return!!r&&(t=r.getX(),r.getY().square().equals(t.multiply(t.square()).add(t.multiply(te.a)).add(te.b)))}},Ut=function(t){for(var r=448<=(r=(C=8*t.length)%512)?512-r%448-1:448-r-1,s=new Array((r-7)/8),c=0,d=s.length;c<d;c++)s[c]=0;for(var p,E=[],C=C.toString(2),w=7;0<=w;w--)8<C.length?(p=C.length-8,E[w]=parseInt(C.substr(p),2),C=C.substr(0,p)):0<C.length?(E[w]=parseInt(C,2),C=""):E[w]=0;for(var nt=[].concat(t,[128],s,E),ot=nt.length/64,b=[115,128,22,111,73,20,178,185,23,36,66,215,218,138,6,0,169,111,48,188,22,49,56,170,227,141,238,77,176,251,14,78],H=0;H<ot;H++){var tt=64*H;b=Qt(b,nt.slice(tt,64+tt))}return b};var Et=Ht.exports.BigInteger,Qr=function(t,r){return t=new oe(t),r=new oe(r),new ee([t,r]).getEncodedHex()},Zr=function(t){var r=re(t,0),s=re(t,r),c=ie(t,r);return r=t.substr(s,2*c),s=re(t,c=s+r.length),c=ie(t,c),t=t.substr(s,2*c),{r:new wt(r,16),s:new wt(t,16)}},ct=Ot,Ae=Ut,De=(Ot=ct.generateEcparam()).G,yr=Ot.curve,Re=Ot.n;function gr(t,r,s){var c=2<arguments.length&&s!==void 0?s:"1234567812345678",d=(c=ct.utf8ToHex(c),ct.leftPad(De.curve.a.toBigInteger().toRadix(16),64)),p=ct.leftPad(De.curve.b.toBigInteger().toRadix(16),64),E=ct.leftPad(De.getX().toBigInteger().toRadix(16),64),C=ct.leftPad(De.getY().toBigInteger().toRadix(16),64);return s=(r=128<r.length?r.substr(2,128):r).substr(0,64),r=r.substr(64,64),r=ct.hexToArray(c+d+p+E+C+s+r),c=4*c.length,r.unshift(255&c),r.unshift(c>>8&255),r=Ae(r),ct.arrayToHex(Ae(r.concat(ct.hexToArray(t))))}function mr(){var t=ct.generateKeyPairHex(),r=yr.decodePointHex(t.publicKey);return t.k=new Et(t.privateKey,16),t.x1=r.getX().toBigInteger(),t}Ot={generateKeyPairHex:ct.generateKeyPairHex,doEncrypt:function(t,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;t=typeof t=="string"?ct.hexToArray(ct.utf8ToHex(t)):Array.prototype.slice.call(t),r=ct.getGlobalCurve().decodePointHex(r);var c=ct.generateKeyPairHex(),d=new Et(c.privateKey,16),p=c.publicKey;128<p.length&&(p=p.substr(p.length-128)),c=r.multiply(d),d=ct.hexToArray(ct.leftPad(c.getX().toBigInteger().toRadix(16),64)),r=ct.hexToArray(ct.leftPad(c.getY().toBigInteger().toRadix(16),64)),c=ct.arrayToHex(Ae([].concat(d,t,r)));var E,C=1,w=0,nt=[],ot=[].concat(d,r);(E=function(){nt=Ae([].concat(St(ot),[C>>24&255,C>>16&255,C>>8&255,255&C])),C++,w=0})();for(var b=0,H=t.length;b<H;b++)w===nt.length&&E(),t[b]^=255&nt[w++];return r=ct.arrayToHex(t),s===0?p+r+c:p+c+r},doDecrypt:function(t,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,c=(p=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":p;r=new Et(r,16);var d=t.substr(128,64),p=t.substr(192);s===0&&(d=t.substr(t.length-64),p=t.substr(128,t.length-128-64));var E,C=ct.hexToArray(p),w=(t=ct.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(r),r=ct.hexToArray(ct.leftPad(t.getX().toBigInteger().toRadix(16),64)),t=ct.hexToArray(ct.leftPad(t.getY().toBigInteger().toRadix(16),64)),1),nt=0,ot=[],b=[].concat(r,t);(E=function(){ot=Ae([].concat(St(b),[w>>24&255,w>>16&255,w>>8&255,255&w])),w++,nt=0})();for(var H=0,tt=C.length;H<tt;H++)nt===ot.length&&E(),C[H]^=255&ot[nt++];return ct.arrayToHex(Ae([].concat(r,C,t)))===d?c==="array"?C:ct.arrayToUtf8(C):c==="array"?[]:""},doSignature:function(t,r){var s=(C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,c=C.der,d=C.hash,p=C.publicKey,E=C.userId,C=typeof t=="string"?ct.utf8ToHex(t):ct.arrayToHex(t);d&&(C=gr(C,p||(t=r,d=De.multiply(new Et(t,16)),"04"+(t=ct.leftPad(d.getX().toBigInteger().toString(16),64))+(d=ct.leftPad(d.getY().toBigInteger().toString(16),64))),E));var w=new Et(r,16),nt=new Et(C,16),ot=null,b=null,H=null;do do{var tt;ot=(tt=s&&s.length?s.pop():mr()).k,b=nt.add(tt.x1).mod(Re)}while(b.equals(Et.ZERO)||b.add(ot).equals(Re));while((H=w.add(Et.ONE).modInverse(Re).multiply(ot.subtract(b.multiply(w))).mod(Re)).equals(Et.ZERO));return c?Qr(b,H):ct.leftPad(b.toString(16),64)+ct.leftPad(H.toString(16),64)},doVerifySignature:function(t,r,s){var c,d,p=(C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,E=C.hash,C=C.userId;return t=typeof t=="string"?ct.utf8ToHex(t):ct.arrayToHex(t),E&&(t=gr(t,s,C)),d=p?(c=(d=Zr(r)).r,d.s):(c=new Et(r.substring(0,64),16),new Et(r.substring(64),16)),r=yr.decodePointHex(s),s=new Et(t,16),!(t=c.add(d).mod(Re)).equals(Et.ZERO)&&(r=De.multiply(d).add(r.multiply(t)),s=s.add(r.getX().toBigInteger()).mod(Re),c.equals(s))},getPoint:mr,verifyPublicKey:ct.verifyPublicKey};var tn=Ut,Ne=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],xe=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function Ve(t){for(var r=[],s=0,c=t.length;s<c;s+=2)r.push(parseInt(t.substr(s,2),16));return r}function Ee(t,r){return t<<r|t>>>32-r}function he(t){return(255&Ne[t>>>24&255])<<24|(255&Ne[t>>>16&255])<<16|(255&Ne[t>>>8&255])<<8|255&Ne[255&t]}function Fe(t){return t^Ee(t,2)^Ee(t,10)^Ee(t,18)^Ee(t,24)}function Le(t){return t^Ee(t,13)^Ee(t,23)}function _r(t,r,s,c){c=(p=(E=3<arguments.length&&c!==void 0?c:{}).padding)===void 0?"pkcs#5":p;var d=E.mode,p=(p=E.iv)===void 0?[]:p,E=(E=E.output)===void 0?"string":E;if(d==="cbc"&&(p=typeof p=="string"?Ve(p):p).length!==16)throw new Error("iv is invalid");if((r=typeof r=="string"?Ve(r):r).length!==16)throw new Error("key is invalid");if(t=(typeof t=="string"?s!==0?function(q){for(var X=[],Y=0,G=q.length;Y<G;Y++){var K=q.codePointAt(Y);if(K<=127)X.push(K);else if(K<=2047)X.push(192|K>>>6),X.push(128|63&K);else if(K<=55295||57344<=K&&K<=65535)X.push(224|K>>>12),X.push(128|K>>>6&63),X.push(128|63&K);else{if(!(65536<=K&&K<=1114111))throw X.push(K),new Error("input is not supported");Y++,X.push(240|K>>>18&28),X.push(128|K>>>12&63),X.push(128|K>>>6&63),X.push(128|63&K)}}return X}:Ve:St)(t),c==="pkcs#5"&&s!==0)for(var C=16-t.length%16,w=0;w<C;w++)t.push(C);var nt=new Array(32);(function(q,X,Y){for(var G=new Array(4),K=new Array(4),gt=0;gt<4;gt++)K[0]=255&q[0+4*gt],K[1]=255&q[1+4*gt],K[2]=255&q[2+4*gt],K[3]=255&q[3+4*gt],G[gt]=K[0]<<24|K[1]<<16|K[2]<<8|K[3];G[0]^=2746333894,G[1]^=1453994832,G[2]^=1736282519,G[3]^=2993693404;for(var et,It=0;It<32;It+=4)et=G[1]^G[2]^G[3]^xe[It+0],X[It+0]=G[0]^=Le(he(et)),et=G[2]^G[3]^G[0]^xe[It+1],X[It+1]=G[1]^=Le(he(et)),et=G[3]^G[0]^G[1]^xe[It+2],X[It+2]=G[2]^=Le(he(et)),et=G[0]^G[1]^G[2]^xe[It+3],X[It+3]=G[3]^=Le(he(et));if(Y===0)for(var Nt,Mt=0;Mt<16;Mt++)Nt=X[Mt],X[Mt]=X[31-Mt],X[31-Mt]=Nt})(r,nt,s);for(var ot=[],b=p,H=t.length,tt=0;16<=H;){var W=t.slice(tt,tt+16),it=new Array(16);if(d==="cbc")for(var lt=0;lt<16;lt++)s!==0&&(W[lt]^=b[lt]);(function(q,X,Y){for(var G=new Array(4),K=new Array(4),gt=0;gt<4;gt++)K[0]=255&q[4*gt],K[1]=255&q[4*gt+1],K[2]=255&q[4*gt+2],K[3]=255&q[4*gt+3],G[gt]=K[0]<<24|K[1]<<16|K[2]<<8|K[3];for(var et,It=0;It<32;It+=4)et=G[1]^G[2]^G[3]^Y[It+0],G[0]^=Fe(he(et)),et=G[2]^G[3]^G[0]^Y[It+1],G[1]^=Fe(he(et)),et=G[3]^G[0]^G[1]^Y[It+2],G[2]^=Fe(he(et)),et=G[0]^G[1]^G[2]^Y[It+3],G[3]^=Fe(he(et));for(var Nt=0;Nt<16;Nt+=4)X[Nt]=G[3-Nt/4]>>>24&255,X[Nt+1]=G[3-Nt/4]>>>16&255,X[Nt+2]=G[3-Nt/4]>>>8&255,X[Nt+3]=255&G[3-Nt/4]})(W,it,nt);for(var Ct=0;Ct<16;Ct++)d==="cbc"&&s===0&&(it[Ct]^=b[Ct]),ot[tt+Ct]=it[Ct];d==="cbc"&&(b=s!==0?it:W),H-=16,tt+=16}return c==="pkcs#5"&&s===0&&(c=ot[ot.length-1],ot.splice(ot.length-c,c)),E!=="array"?s!==0?ot.map((function(q){return(q=q.toString(16)).length===1?"0"+q:q})).join(""):(function(q){for(var X=[],Y=0,G=q.length;Y<G;Y++)240<=q[Y]&&q[Y]<=247?(X.push(String.fromCodePoint(((7&q[Y])<<18)+((63&q[Y+1])<<12)+((63&q[Y+2])<<6)+(63&q[Y+3]))),Y+=3):224<=q[Y]&&q[Y]<=239?(X.push(String.fromCodePoint(((15&q[Y])<<12)+((63&q[Y+1])<<6)+(63&q[Y+2]))),Y+=2):192<=q[Y]&&q[Y]<=223?(X.push(String.fromCodePoint(((31&q[Y])<<6)+(63&q[Y+1]))),Y++):X.push(String.fromCodePoint(q[Y]));return X.join("")})(ot):ot}var en=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],ye=[],rn=function(t,r,s){for(var c=t[0],d=t[1],p=t[2],E=t[3],C=t[4],w=t[5],nt=t[6],ot=t[7],b=0;b<64;b++){b<16?ye[b]=0|r[s+b]:(H=ye[b-15],tt=ye[b-2],ye[b]=((H<<25|H>>>7)^(H<<14|H>>>18)^H>>>3)+ye[b-7]+((tt<<15|tt>>>17)^(tt<<13|tt>>>19)^tt>>>10)+ye[b-16]);var H=c&d^c&p^d&p,tt=ot+((C<<26|C>>>6)^(C<<21|C>>>11)^(C<<7|C>>>25))+(C&w^~C&nt)+en[b]+ye[b];ot=nt,nt=w,w=C,C=E+tt|0,E=p,p=d,d=c,c=tt+(((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+H)|0}t[0]=t[0]+c|0,t[1]=t[1]+d|0,t[2]=t[2]+p|0,t[3]=t[3]+E|0,t[4]=t[4]+C|0,t[5]=t[5]+w|0,t[6]=t[6]+nt|0,t[7]=t[7]+ot|0},vr=(Ot={c2:Ot,c3:function(t){return t=typeof t=="string"?(function(r){for(var s=[],c=0,d=r.length;c<d;c++){var p=r.codePointAt(c);if(p<=127)s.push(p);else if(p<=2047)s.push(192|p>>>6),s.push(128|63&p);else if(p<=55295||57344<=p&&p<=65535)s.push(224|p>>>12),s.push(128|p>>>6&63),s.push(128|63&p);else{if(!(65536<=p&&p<=1114111))throw s.push(p),new Error("input is not supported");c++,s.push(240|p>>>18&28),s.push(128|p>>>12&63),s.push(128|p>>>6&63),s.push(128|63&p)}}return s})(t):Array.prototype.slice.call(t),tn(t).map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},c4:{encrypt:function(t,r,s){return _r(t,r,1,s)},decrypt:function(t,r,s){return _r(t,r,0,s)}},s2:function(t){var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],s=(function(d){for(var p=[],E=0;E<Math.ceil(d.length/4);E++)p[E]=d[4*E]<<24|(255&d[4*E+1])<<16|(255&d[4*E+2])<<8|255&d[4*E+3];return p})(t);s[(t=8*t.length)>>5]|=128<<24-t%32,s[15+(64+t>>9<<4)]=t;for(var c=0;c<s.length;c+=16)rn(r,s,c);return(function(d){for(var p=[],E=0;E<d.length;E++)p[4*E]=d[E]>>24&255,p[4*E+1]=d[E]>>16&255,p[4*E+2]=d[E]>>8&255,p[4*E+3]=255&d[E];return p})(r).map((function(d){return(d=d.toString(16)).length===1?"0"+d:d})).join("")}},vt),nn=yt,on=Dt,an=Yt,sn=zt,un=Ot.c2,cn=Ot.c3,ln=Ot.c4,fn=Ot.s2;return(function(){var t;(t=function(){}).VERSION="2.1.0";var r=T;if(r.AAR2)return r.AAR2.VERSION!==t.VERSION&&console.log(r.AAR2.VERSION),r.AAR2;var s="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",c=!1,d=!1,p=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,E=p!==void 0&&!!p.request&&!!p.login,C=function(b,H){return typeof b=="string"&&typeof H=="string"&&b!=null&&H!=null&&b.substring(0,H.length)===H},w={SUCCESS:0,ALREADY_SUCCESS:1,ERROR_XHR_TIMEOUT:-1,ERROR_XHR_ERROR:-2,ERROR_XXX_REQUEST_TIMEOUT:-3,ERROR_XXX_REQUEST_FAIL:-4,ERROR_SIGN_CHECK:-5,ERROR_UNKNOWN_ERROR:-6,ERROR_DATA_FORMAT:-7},nt=function(b){for(var H in w)if(w[H]===b)return H},ot=function(b,H,tt){var W=Date.now(),it=new t;try{if(!b||b.length<=75)return console.error("error format 1:",b),w.ERROR_DATA_FORMAT;if(!C(b,"eyJ"))return console.error("error format 2:",b),w.ERROR_DATA_FORMAT;b=b.substring(3,b.length);var lt=nn.my_b4_decode(b);if(!lt)return console.error("error format 3:",b),w.ERROR_DATA_FORMAT;var Ct,q=it.cc.u8.byteToInt(lt.slice(0,4),0),X=lt.slice(4,4+q),Y=it.cc.u8.byteToInt(lt.slice(4+q,4+q+4),0),G=lt.slice(4+q+4,4+q+4+Y),K=it.cc.u8.byteToInt(lt.slice(4+q+4+Y,4+q+4+Y+4),0),gt=lt.slice(4+q+4+Y+4,4+q+4+Y+4+K),et=it.cc.u8.bytesToUtf8Str(X);if(it.cc.h6.encode(G,0,Y),H||(tt!==void 0&&tt==="sm2"?(Ct=it.cc.h6.encode(G,0,Y),it.co.c2.doVerifySignature(et,Ct,s,{der:!0,hash:!0})):it.co.c3(et+"8890012345678890").toLowerCase()===it.cc.h6.encode(gt,0,K).toLowerCase())){if(et.length%2==0){t.prototype.__v=function(){return et.slice(0,2)};for(var It=[],Nt=2;Nt<66;Nt+=2)It.push(parseInt("0x"+et.slice(Nt,Nt+2)));t.prototype.__i=function(){return It};var Mt=parseInt("0x"+et.slice(66,82))-W;t.prototype.__o=function(){return Mt}}return E||T.AAR2||(T.AAR2=t),w.SUCCESS}}catch(He){return console.error(He),w.ERROR_UNKNOWN_ERROR}return w.ERROR_SIGN_CHECK};return t.init=function(b,H){var tt,W={debug:!1,url:"https://aks.jdpay.com/aar2/getJS",callback:function(){}};typeof b=="string"?(C(b,"https")||C(b,"https")?W.url=b:C(b,"eyJ")&&(W.code=b),typeof H=="string"&&(W.publicKey=H)):ht(b)==="object"&&(b.debug&&(W.debug=b.debug),b.url&&(W.url=b.url),b.code&&(W.code=b.code),b.publicKey&&(W.publicKey=b.publicKey),b.skipVerify&&(W.skipVerify=b.skipVerify),b.alg&&(W.alg=b.alg),b.callback&&typeof b.callback=="function"&&(W.callback=b.callback)),d?W.callback&&W.callback(!0,{errorNo:tt=w.ALREADY_SUCCESS,errorMsg:nt(tt)}):c?setTimeout((function(){t.init(b,H)}),50):(c=!0,W.debug&&vr.start(W.debug),W.publicKey&&(s=W.publicKey),W.code?(tt=ot(W.code,W.skipVerify))===w.SUCCESS?(c=!(d=!0),W.callback(!0,{errorNo:tt,errorMsg:nt(tt)})):W.callback(!1,{errorNo:tt,errorMsg:nt(tt)}):W.url&&(function(it,lt,Ct){try{if(it=it+"?version="+t.VERSION+(E?"&name=wechat":"&name=browser")+"&t="+Date.now(),E)p.request({url:it,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function(X){X.statusCode===200?lt(X.data):Ct(w.ERROR_XXX_REQUEST_FAIL)},fail:function(X){X&&X.errMsg&&X.errMsg.indexOf("timeout")!==-1?Ct(w.ERROR_XXX_REQUEST_TIMEOUT):Ct(w.ERROR_XXX_REQUEST_FAIL)}});else{var q;if(window.XMLHttpRequest)q=new XMLHttpRequest;else if(window.ActiveXObject)try{q=new ActiveXObject("Msxml2.XMLHTTP")}catch(X){try{q=new ActiveXObject("Microsoft.XMLHTTP")}catch(Y){}}q&&(q.onload=function(){q.readyState===4&&(q.status===200?lt(q.responseText):Ct(w.ERROR_XHR_ERROR))},q.ontimeout=function(){Ct(w.ERROR_XHR_TIMEOUT)},q.onerror=function(){Ct(w.ERROR_XHR_ERROR)},q.open("POST",it,!0),q.timeout=5e3,q.send(null))}}catch(X){console.error(X),Ct(w.ERROR_UNKNOWN_ERROR)}})(W.url,(function(it){(it=ot(it,W.skipVerify,W.alg))===w.SUCCESS?(c=!(d=!0),W.callback(!0,{errorNo:it,errorMsg:nt(it)})):(c=!1,W.callback(!1,{errorNo:it,errorMsg:nt(it)}))}),(function(it){c=!1,W.callback(!1,{errorNo:it,errorMsg:nt(it)})})))},t.prototype={cc:{b4:on,h6:an,u8:sn},co:{c2:un,c3:cn,c4:ln,s2:fn},nonce:function(){var b="0000000000"+Math.ceil(2147483647*Math.random())+Math.floor((Date.now()+this.__o())/1e3);return b.substring(b.length-20)},sign:function(b,H){return this.__s(b,H)},__s:function(b,H){var tt=this.cc.u8.utf8StrToBytes(b),W=this.__i();return b=this.cc.u8.utf8StrToBytes(H),H=this.cc.u8.utf8StrToBytes(this.__c()),b=[].concat(tt,W,b,H),H=parseInt("0x"+this.__v()),this.__f(H)(b)+this.__v()},__f:function(b){var H=this.co.s2,tt=this.co.c3,W=this.cc.h6.decode,it=[function(lt){return H(lt)},function(lt){return tt(lt)},function(lt){return tt(W(H(lt)))},function(lt){return H(W(tt(lt)))},function(lt){return tt(W(tt(lt)))},function(lt){return H(W(H(lt)))}];return it[(128<b?b-128:b)%it.length]},__i:function(){return[115,128,22,111,73,20,178,185,23,36,66,215,218,138,6,0,169,111,48,188,22,49,56,170,227,141,238,77,176,251,14,78]},__v:function(){return"00"},__c:function(){if(this.__d())return"debug";if(typeof phantom!="undefined"&&phantom.exit&&phantom.injectJs)return"phantom";if(typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]"&&process.version&&process.pid&&process.argv)return"require";if(p!==void 0&&p.env&&p.request&&p.getStorage){if(typeof window!="undefined"&&window.document&&window.alert&&window.atob&&typeof window.setTimeout=="function")return"window"}else{if(!(typeof window!="undefined"&&window.document&&window.alert&&window.atob&&typeof window.setTimeout=="function"))return"window";if(!window.navigator||typeof window.navigator.vendor!="string")return"navigator";if(window.navigator.webdriver)return"webdriver"}return""},__o:function(){return 0},__d:function(){return vr.isDebug()},version:function(){return t.VERSION}},t})()},Rt(D)=="object"?g.exports=at():($=typeof(J=at)=="function"?J.call(D,S,D,g):J)===void 0||(g.exports=$)}},a={};function u(g){var D=a[g];if(D!==void 0)return D.exports;var S=a[g]={id:g,loaded:!1,exports:{}};return i[g].call(S.exports,S,S.exports,u),S.loaded=!0,S.exports}u.n=g=>{var D=g&&g.__esModule?()=>g.default:()=>g;return u.d(D,{a:D}),D},u.d=(g,D)=>{for(var S in D)u.o(D,S)&&!u.o(g,S)&&Object.defineProperty(g,S,{enumerable:!0,get:D[S]})},u.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(g){if(typeof window=="object")return window}})(),u.hmd=g=>((g=Object.create(g)).children||(g.children=[]),Object.defineProperty(g,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+g.id)}}),g),u.o=(g,D)=>Object.prototype.hasOwnProperty.call(g,D),u.r=g=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(g,"__esModule",{value:!0})};var _=u(737);Mr.exports.LyyGetCommandSDK=_})()});var Kn={};Me(Kn,{DyErrorCode:()=>_e,DyErrorMessage:()=>Wt,ENV_TYPE:()=>Xt,EXTERNAL_ENV_TYPE:()=>se,JdErrorCode:()=>Je,JdErrorMessage:()=>Tt,createServices:()=>$r,getDisplayAdConfig:()=>dr,getDyPayRtaData:()=>cr,handleDyPayFlow:()=>ur,handleJdInsurance:()=>or,handleJdInsuranceExt:()=>ir,handleJdjrCashLoanExt:()=>nr,handleJdjrCashLoanFlow:()=>rr,normalizeDisplayAdData:()=>Ye});module.exports=vn(Kn);var Xt={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},se={SIT:"sit",RELEASE:"release",PROD:"prod"},qe={[Xt.DEV]:"https://dm.leyaoyao.com",[Xt.SIT]:"https://sm.leyaoyao.com",[Xt.UAT]:"https://um.leyaoyao.com",[Xt.PROD]:"https://m.leyaoyao.com"},Er={[Xt.DEV]:"https://dad2.leyaoyao.com",[Xt.SIT]:"https://sad2.leyaoyao.com",[Xt.UAT]:"https://uad2.leyaoyao.com",[Xt.PROD]:"https://nad.ehuoke.com"},we={[se.SIT]:"https://sopenapi.leyaoyao.com",[se.RELEASE]:"https://uopen-api.leyaoyao.com",[se.PROD]:"https://api-gateway.leyaoyao.com"};function Be(i,a){return`${qe[i]||qe[Xt.PROD]}${a}`}function Ir(i){return Er[i]||Er[Xt.PROD]}var be={debug:!1,env:Xt.PROD,externalEnv:se.PROD,apiDomain:""},br=bt({},be);function Sr(i){br=bt(bt({},be),i)}function de(){return br}var An=Object.defineProperty,Dn=(i,a,u)=>a in i?An(i,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[a]=u,Rn=(i,a,u)=>Dn(i,typeof a!="symbol"?a+"":a,u);function ue(){return typeof Taro!="undefined"&&Taro.getEnv?"taro":typeof uni!="undefined"&&uni.request?"uni":typeof wx!="undefined"&&wx.request?"wechat":typeof my!="undefined"&&my.request?"alipay":typeof window!="undefined"?"web":"unknown"}var En=class{constructor(i=!1){Rn(this,"enable"),this.enable=i}setEnable(i){this.enable=i}info(...i){this.enable&&console.info("[BI Info]",...i)}warn(...i){this.enable&&console.warn("[BI Warn]",...i)}error(...i){this.enable&&console.error("[BI Error]",...i)}debug(...i){this.enable&&console.log("[BI Debug]",...i)}},U=new En;function ze(i){let a=ue();return a==="taro"?Taro.setClipboardData({data:i}).then(()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):a==="uni"?new Promise((u,_)=>{uni.setClipboardData({data:i,success:()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{U.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),_(g)}})}):a==="wechat"?new Promise((u,_)=>{wx.setClipboardData({data:i,success:()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{U.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),_(g)}})}):a==="alipay"?new Promise((u,_)=>{my.setClipboardData({text:i,success:()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{U.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),_(g)}})}):navigator.clipboard.writeText(i).then(()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function $e(i,a=2e3){let u=ue();if(u==="taro"){Taro.showToast({title:i,icon:"none",mask:!0,duration:a});return}if(u==="uni"){uni.showToast({title:i,icon:"none",mask:!0,duration:a});return}if(u==="wechat"){wx.showToast({title:i,icon:"none",mask:!0,duration:a});return}if(u==="alipay"){my.showToast({content:i,duration:a});return}typeof console!="undefined"&&console.log(`[Toast] ${i}`)}async function me(){var i,a,u,_,g;let D=ue();try{if(D==="taro")return((i=(await Taro.getSystemInfo()).platform)==null?void 0:i.toLowerCase())==="ios"?"ios":"android";if(D==="uni")return((a=uni.getSystemInfoSync().platform)==null?void 0:a.toLowerCase())==="ios"?"ios":"android";if(D==="wechat")return wx.getDeviceInfo?((u=(await wx.getDeviceInfo()).platform)==null?void 0:u.toLowerCase())==="ios"?"ios":"android":((_=wx.getSystemInfoSync().platform)==null?void 0:_.toLowerCase())==="ios"?"ios":"android";if(D==="alipay")return((g=my.getSystemInfoSync().platform)==null?void 0:g.toLowerCase())==="ios"?"ios":"android";if(typeof navigator!="undefined"){let S=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(S))return"ios";if(/android/.test(S))return"android"}return"unknown"}catch(S){return U.error("\u83B7\u53D6\u5E73\u53F0\u4FE1\u606F\u5931\u8D25",S),"unknown"}}var Ft={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function z(i,a,u=null){return{code:i,message:a,data:u}}function ke(i,a){return i==null?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof i=="string"&&i.trim().length===0?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function Pe(i,a){for(let u of a){let _=ke(i[u],u);if(!_.valid)return _}return{valid:!0}}var ar={};Me(ar,{handleJdInsurance:()=>or,handleJdInsuranceExt:()=>ir,handleJdjrCashLoanExt:()=>nr,handleJdjrCashLoanFlow:()=>rr});var Je=(k=>(k[k.JD_CASH_LOAN__MISSING_PHONE=2001]="JD_CASH_LOAN__MISSING_PHONE",k[k.JD_CASH_LOAN__MISSING_DEVICE_ID=2002]="JD_CASH_LOAN__MISSING_DEVICE_ID",k[k.JD_CASH_LOAN__RTA_FAILED=2003]="JD_CASH_LOAN__RTA_FAILED",k[k.JD_CASH_LOAN__GET_CONFIG_FAILED=2004]="JD_CASH_LOAN__GET_CONFIG_FAILED",k[k.JD_CASH_LOAN__INVALID_CONFIG=2005]="JD_CASH_LOAN__INVALID_CONFIG",k[k.JD_CASH_LOAN__EXT_NOT_ELIGIBLE=2006]="JD_CASH_LOAN__EXT_NOT_ELIGIBLE",k[k.JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS=2007]="JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS",k[k.JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM=2008]="JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM",k[k.JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID=2009]="JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID",k[k.JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE=2010]="JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE",k[k.JD_INSURANCE__USER_NOT_ELIGIBLE=2101]="JD_INSURANCE__USER_NOT_ELIGIBLE",k[k.JD_INSURANCE__H5_NOT_SUPPORTED=2102]="JD_INSURANCE__H5_NOT_SUPPORTED",k[k.JD_INSURANCE__INVALID_JUMP_PARAMS=2103]="JD_INSURANCE__INVALID_JUMP_PARAMS",k[k.JD_INSURANCE__GET_CONFIG_FAILED=2104]="JD_INSURANCE__GET_CONFIG_FAILED",k[k.JD_INSURANCE__COPY_FAILED=2105]="JD_INSURANCE__COPY_FAILED",k[k.JD_INSURANCE__TASK_COMPLETED=2106]="JD_INSURANCE__TASK_COMPLETED",k[k.JD_INSURANCE__UNKNOWN_JUMP_MODE=2107]="JD_INSURANCE__UNKNOWN_JUMP_MODE",k[k.JD_INSURANCE__RTA_FAILED=2108]="JD_INSURANCE__RTA_FAILED",k))(Je||{}),Tt={2001:"\u7F3A\u5C11\u624B\u673A\u53F7\u53C2\u6570",2002:"\u7F3A\u5C11\u8BBE\u5907ID",2003:"\u672A\u6EE1\u8DB3\u6D3B\u52A8\u8D44\u683C",2004:"\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E\u5931\u8D25",2005:"\u8DF3\u8F6C\u914D\u7F6E\u53C2\u6570\u5F02\u5E38",2006:"\u7528\u6237\u4E0D\u7B26\u5408\u6D3B\u52A8\u53C2\u4E0E\u6761\u4EF6",2007:"\u8DF3\u8F6C\u53C2\u6570\u5F02\u5E38",2008:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u5E73\u53F0\u53C2\u6570",2009:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u7528\u6237ID",2010:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u8BBE\u5907\u503C",2101:"\u7528\u6237\u4E0D\u7B26\u5408\u6D3B\u52A8\u53C2\u4E0E\u6761\u4EF6",2102:"H5\u6A21\u5F0F\u6682\u4E0D\u652F\u6301",2103:"\u8DF3\u8F6C\u53C2\u6570\u5F02\u5E38",2104:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u5931\u8D25",2105:"\u590D\u5236\u53E3\u4EE4\u5931\u8D25",2106:"\u7528\u6237\u5DF2\u5B8C\u6210\u4EFB\u52A1",2107:"\u672A\u77E5\u8DF3\u8F6C\u6A21\u5F0F",2108:"RTA\u6821\u9A8C\u5931\u8D25"},_e=(F=>(F[F.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",F[F.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",F[F.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",F[F.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",F[F.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",F[F.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",F[F.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",F[F.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",F[F.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",F[F.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",F[F.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",F[F.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",F[F.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",F[F.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",F[F.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",F[F.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",F[F.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",F))(_e||{}),Wt={3001:"\u7F3A\u5C11\u624B\u673A\u53F7\u53C2\u6570",3002:"\u7F3A\u5C11\u8BBE\u5907ID\u53C2\u6570",3003:"\u7F3A\u5C11\u5957\u9910\u91D1\u989D\u53C2\u6570",3004:"\u65E0\u6548\u7684\u5BA2\u6237\u7AEF\u7C7B\u578B",3005:"\u4E1A\u52A1\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E",3006:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u5931\u8D25",3007:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u8BF7\u6C42\u5931\u8D25",3008:"\u7EDF\u4E00\u4E0B\u5355\u5931\u8D25",3009:"\u7EDF\u4E00\u4E0B\u5355\u8BF7\u6C42\u5931\u8D25",3010:"\u83B7\u53D6\u8DF3\u8F6C\u5730\u5740\u5931\u8D25",3011:"\u7F51\u7EDC\u8BF7\u6C42\u5F02\u5E38",3012:"\u4E0B\u5355\u6D41\u7A0B\u5F02\u5E38",3013:"\u83B7\u53D6RTA\u4FE1\u606F\u5931\u8D25",3014:"\u83B7\u53D6RTA\u4FE1\u606F\u8BF7\u6C42\u5931\u8D25",3015:"\u83B7\u53D6RTA\u4FE1\u606F\u5F02\u5E38",3016:"\u65E0\u6548\u7684\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u65B9\u5F0F",3017:"\u7F3A\u5C11\u4E1A\u52A1\u7C7B\u578B\u53C2\u6570"};var In=(i,a,u,_)=>{let g=ue();if(g==="taro")return Taro.request({url:i,method:a,data:u,header:_}).then(J=>J);if(g==="uni")return new Promise((J,$)=>{uni.request({url:i,method:a,data:u,header:_,success:at=>J(at),fail:at=>$(at)})});if(g==="wechat")return new Promise((J,$)=>{wx.request({url:i,method:a,data:u,header:_,success:at=>J(at),fail:at=>$(at)})});if(g==="alipay")return new Promise((J,$)=>{my.request({url:i,method:a,data:u,headers:_,success:at=>J(at),fail:at=>$(at)})});let D=a.toUpperCase()==="GET",S=D&&u&&Object.keys(u).length?`${i}?${new URLSearchParams(u).toString()}`:i;return fetch(S,{method:a,headers:_,body:D?void 0:JSON.stringify(u)}).then(async J=>({statusCode:J.status,data:await J.json()}))},Qe=class{constructor(a=null){je(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||de()||be}async getAuthToken(){let a=this.getCurrentConfig();if(a.getAuthToken&&typeof a.getAuthToken=="function")try{let u=await a.getAuthToken();return u?(U.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),u):(U.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(u){return U.error("\u83B7\u53D6Token\u5931\u8D25",u),null}return null}async buildHeader(a={},u=!0){let _=bt({"content-type":"application/json"},a);if(!u)return _;let g=await this.getAuthToken();if(!g)throw{code:"AUTH_TOKEN_REQUIRED",message:"\u5F53\u524D\u63A5\u53E3\u9700\u8981 token\uFF0C\u8BF7\u5728\u7528\u6237\u767B\u5F55\u6210\u529F\u540E\u8C03\u7528 nova.setToken(token) \u6216 \u76F4\u63A5createServices\u65F6\u4F20\u5165getAuthToken"};return _.Authorization_bar=g,_}async request(a){let{path:u,method:_="POST",data:g={},header:D={},authRequired:S=!0,baseDomain:J,beforeRequest:$,afterResponse:at}=a,Rt=J?`${J}${u}`:Be(this.getCurrentConfig().env||"prod",u),ht=await this.buildHeader(D,S);$&&typeof $=="function"&&await $({url:Rt,method:_,data:g,header:ht}),U.info(`\u53D1\u8D77${_}\u8BF7\u6C42:`,{path:u,method:_});try{let Q=await In(Rt,_,g,ht);return U.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:Q.statusCode}),at&&typeof at=="function"&&await at(Q.data),Q.data}catch(Q){throw U.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:Q}),Q}}get(a,u={},_={}){return this.request(bt({path:a,method:"GET",data:u},_))}post(a,u={},_={}){return this.request(bt({path:a,method:"POST",data:u},_))}},Se=(i=null)=>new Qe(i);var bn=(function(){"use strict";function i(R,Z){var dt=(65535&R)+(65535&Z);return(R>>16)+(Z>>16)+(dt>>16)<<16|65535&dt}function a(R,Z,dt,F,k,St){return i((St=i(i(Z,R),i(F,St)))<<k|St>>>32-k,dt)}function u(R,Z,dt,F,k,St,I){return a(Z&dt|~Z&F,R,Z,k,St,I)}function _(R,Z,dt,F,k,St,I){return a(Z&F|dt&~F,R,Z,k,St,I)}function g(R,Z,dt,F,k,St,I){return a(Z^dt^F,R,Z,k,St,I)}function D(R,Z,dt,F,k,St,I){return a(dt^(Z|~F),R,Z,k,St,I)}function S(R,Z){var dt,F,k,St;R[Z>>5]|=128<<Z%32,R[14+(Z+64>>>9<<4)]=Z;for(var I=1732584193,T=-271733879,O=-1732584194,P=271733878,m=0;m<R.length;m+=16)I=u(dt=I,F=T,k=O,St=P,R[m],7,-680876936),P=u(P,I,T,O,R[m+1],12,-389564586),O=u(O,P,I,T,R[m+2],17,606105819),T=u(T,O,P,I,R[m+3],22,-1044525330),I=u(I,T,O,P,R[m+4],7,-176418897),P=u(P,I,T,O,R[m+5],12,1200080426),O=u(O,P,I,T,R[m+6],17,-1473231341),T=u(T,O,P,I,R[m+7],22,-45705983),I=u(I,T,O,P,R[m+8],7,1770035416),P=u(P,I,T,O,R[m+9],12,-1958414417),O=u(O,P,I,T,R[m+10],17,-42063),T=u(T,O,P,I,R[m+11],22,-1990404162),I=u(I,T,O,P,R[m+12],7,1804603682),P=u(P,I,T,O,R[m+13],12,-40341101),O=u(O,P,I,T,R[m+14],17,-1502002290),I=_(I,T=u(T,O,P,I,R[m+15],22,1236535329),O,P,R[m+1],5,-165796510),P=_(P,I,T,O,R[m+6],9,-1069501632),O=_(O,P,I,T,R[m+11],14,643717713),T=_(T,O,P,I,R[m],20,-373897302),I=_(I,T,O,P,R[m+5],5,-701558691),P=_(P,I,T,O,R[m+10],9,38016083),O=_(O,P,I,T,R[m+15],14,-660478335),T=_(T,O,P,I,R[m+4],20,-405537848),I=_(I,T,O,P,R[m+9],5,568446438),P=_(P,I,T,O,R[m+14],9,-1019803690),O=_(O,P,I,T,R[m+3],14,-187363961),T=_(T,O,P,I,R[m+8],20,1163531501),I=_(I,T,O,P,R[m+13],5,-1444681467),P=_(P,I,T,O,R[m+2],9,-51403784),O=_(O,P,I,T,R[m+7],14,1735328473),I=g(I,T=_(T,O,P,I,R[m+12],20,-1926607734),O,P,R[m+5],4,-378558),P=g(P,I,T,O,R[m+8],11,-2022574463),O=g(O,P,I,T,R[m+11],16,1839030562),T=g(T,O,P,I,R[m+14],23,-35309556),I=g(I,T,O,P,R[m+1],4,-1530992060),P=g(P,I,T,O,R[m+4],11,1272893353),O=g(O,P,I,T,R[m+7],16,-155497632),T=g(T,O,P,I,R[m+10],23,-1094730640),I=g(I,T,O,P,R[m+13],4,681279174),P=g(P,I,T,O,R[m],11,-358537222),O=g(O,P,I,T,R[m+3],16,-722521979),T=g(T,O,P,I,R[m+6],23,76029189),I=g(I,T,O,P,R[m+9],4,-640364487),P=g(P,I,T,O,R[m+12],11,-421815835),O=g(O,P,I,T,R[m+15],16,530742520),I=D(I,T=g(T,O,P,I,R[m+2],23,-995338651),O,P,R[m],6,-198630844),P=D(P,I,T,O,R[m+7],10,1126891415),O=D(O,P,I,T,R[m+14],15,-1416354905),T=D(T,O,P,I,R[m+5],21,-57434055),I=D(I,T,O,P,R[m+12],6,1700485571),P=D(P,I,T,O,R[m+3],10,-1894986606),O=D(O,P,I,T,R[m+10],15,-1051523),T=D(T,O,P,I,R[m+1],21,-2054922799),I=D(I,T,O,P,R[m+8],6,1873313359),P=D(P,I,T,O,R[m+15],10,-30611744),O=D(O,P,I,T,R[m+6],15,-1560198380),T=D(T,O,P,I,R[m+13],21,1309151649),I=D(I,T,O,P,R[m+4],6,-145523070),P=D(P,I,T,O,R[m+11],10,-1120210379),O=D(O,P,I,T,R[m+2],15,718787259),T=D(T,O,P,I,R[m+9],21,-343485551),I=i(I,dt),T=i(T,F),O=i(O,k),P=i(P,St);return[I,T,O,P]}function J(R){for(var Z="",dt=32*R.length,F=0;F<dt;F+=8)Z+=String.fromCharCode(R[F>>5]>>>F%32&255);return Z}function $(R){var Z=[];for(Z[(R.length>>2)-1]=void 0,F=0;F<Z.length;F+=1)Z[F]=0;for(var dt=8*R.length,F=0;F<dt;F+=8)Z[F>>5]|=(255&R.charCodeAt(F/8))<<F%32;return Z}function at(R){for(var Z,dt="0123456789abcdef",F="",k=0;k<R.length;k+=1)Z=R.charCodeAt(k),F+=dt.charAt(Z>>>4&15)+dt.charAt(15&Z);return F}function Rt(R){return unescape(encodeURIComponent(R))}function ht(R){return J(S($(R=Rt(R)),8*R.length))}function Q(R,Z){return(function(dt,F){var k,St=$(dt),I=[],T=[];for(I[15]=T[15]=void 0,16<St.length&&(St=S(St,8*dt.length)),k=0;k<16;k+=1)I[k]=909522486^St[k],T[k]=1549556828^St[k];return F=S(I.concat($(F)),512+8*F.length),J(S(T.concat(F),640))})(Rt(R),Rt(Z))}function ve(R,Z,dt){return Z?dt?Q(Z,R):at(Q(Z,R)):dt?ht(R):at(ht(R))}return ve})(),Ce=bn;function Tr(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function wr(i){if(typeof i!="object"||i===null)return i;let a=Object.keys(i).sort(),u={};for(let _ of a)u[_]=i[_];return JSON.stringify(u)}function Pr(i,a){let u={appId:i.appId,randomStr:i.randomStr,data:i.data},_=Object.keys(u).sort(),g="";for(let[D,S]of _.entries())g+=`${S}=${u[S]}`,D<_.length-1&&(g+="&");return g+=`&secretKey=${a}`,Ce(g)}var Sn=(i,a,u,_)=>{let g=ue();return g==="taro"?Taro.request({url:i,method:a,data:u,header:_}).then(D=>D):g==="uni"?new Promise((D,S)=>{uni.request({url:i,method:a,data:u,header:_,success:J=>D(J),fail:J=>S(J)})}):g==="wechat"?new Promise((D,S)=>{wx.request({url:i,method:a,data:u,header:_,success:J=>D(J),fail:J=>S(J)})}):g==="alipay"?new Promise((D,S)=>{my.request({url:i,method:a,data:u,headers:_,success:J=>D(J),fail:J=>S(J)})}):fetch(i,{method:a,headers:_,body:JSON.stringify(u)}).then(async D=>({statusCode:D.status,data:await D.json()}))},Ze=class{constructor(a=null){je(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||de()||{}}getExternalEnv(){var a;return((a=this.getCurrentConfig())==null?void 0:a.externalEnv)||se.PROD}getExternalHost(){let a=this.getExternalEnv();return we[a]||we.prod}generateSign(a={}){let u=this.getCurrentConfig(),{externalAppId:_,externalAppSecret:g}=u;if(!_||!g)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let D=Tr(),S=wr(a),J=Pr({appId:_,randomStr:D,data:S},g);return{appId:_,randomStr:D,sign:J}}buildRequestBody(a={}){let u=this.generateSign(a);return ne(bt({},u),{data:a})}buildUrl(a){return`${this.getExternalHost()}${a}`}async request(a){let{path:u,method:_="POST",data:g={},header:D={},needSign:S=!0,beforeRequest:J,afterResponse:$}=a,at=this.buildUrl(u),Rt=bt({"content-type":"application/json"},D),ht=S?this.buildRequestBody(g):g;J&&typeof J=="function"&&await J({url:at,method:_,data:ht,header:Rt}),U.info(`\u53D1\u8D77${_}\u8BF7\u6C42:`,{path:u,method:_});try{let Q=await Sn(at,_,ht,Rt);if(U.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:Q.statusCode}),$&&typeof $=="function"&&await $(Q.data),Q.statusCode===200&&Q.data.code===200)return Q.data.data;throw{code:Q.data.code,msg:Q.data.data||"\u8BF7\u6C42\u4E1A\u52A1\u5F02\u5E38",original:Q.data}}catch(Q){throw(Q==null?void 0:Q.code)!==void 0?Q:(U.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:Q}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:Q})}}get(a,u={},_={}){return this.request(bt({path:a,method:"GET",data:u},_))}post(a,u={},_={}){return this.request(bt({path:a,method:"POST",data:u},_))}},Cr=(i=null)=>new Ze(i);var tr=Se(),er=Cr();function Or(i){let a=ke(i==null?void 0:i.equipmentValue,"equipmentValue");return a.valid?tr.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",i):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Nr(i){let a=Pe(i,["idMd5Value","rtaStrategy"]);return a.valid?er.post("/open/rest/cpa/jd/rta-check",i):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function xr(i){try{let a={thirdPlatform:i.thirdPlatform,thirdPlatformUserId:i.thirdPlatformUserId,thirdPlatformEquipmentValue:i.thirdPlatformEquipmentValue,os:i.os,client:"wxMini"};i.phone&&(a.mobileMd5=Ce(i.phone)),i.extendData&&(Object.prototype.toString.call(i.extendData)==="[object Object]"?a.extendData=i.extendData:U.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let u=await er.post("/open/rest/cpa/jd/insurance/get",a);return u?u.jumpMode==1?{jumpMode:1,appId:u.appId,url:u.url}:{jumpMode:2,url:u.url,channel:u.channelId}:void 0}catch(a){throw U.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",a),a}}function Fr(i){let a=ke(i==null?void 0:i.equipmentValue,"equipmentValue");return a.valid?tr.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",i):Promise.reject({code:"PARAM_ERROR",message:a.message})}function Lr(i){let a=Pe(i,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return a.valid?tr.post("/gw/advert/customer/cpa-activity/jd/rta/validate",i):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Ur(i){let a=await me(),u={thirdPlatform:i.thirdPlatform,thirdPlatformUserId:i.thirdPlatformUserId,thirdPlatformEquipmentValue:i.thirdPlatformEquipmentValue,os:a,client:i.client};return i.phone&&(u.mobileMd5=Ce(i.phone)),i.extendData&&(Object.prototype.toString.call(i.extendData)==="[object Object]"?u.extendData=i.extendData:U.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),er.post("/open/rest/cpa/jd/cash-loan/get",u)}async function rr(i){let{phone:a,rtaId:u,equipmentId:_,lyyUserId:g,entrance:D}=i;if(!a)return z(Ft.INVALID_PARAM,Tt[2001]);if(!_)return z(Ft.INVALID_PARAM,Tt[2002]);try{if(u){U.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let ht=await Lr({phone:a,lyyEquipmentValue:_,lyyUserId:g||"",rtaId:u});if(ht.code!=="0000000"||!ht.body||ht.body.state!=1)return U.error("RTA\u9A8C\u8BC1\u5931\u8D25",ht),z(2003,Tt[2003]);U.info("RTA\u9A8C\u8BC1\u6210\u529F",ht.body)}U.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:a});let S=await me(),J=await Fr({phone:a,equipmentValue:_,os:S,entrance:D});if(J.code!=="0000000"||!J.body)return U.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",J),z(2004,Tt[2004]);let{appId:$,targetUrl:at}=J.body;if(!$||!at)return U.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:$,targetUrl:at}),z(2005,Tt[2005]);let Rt=z(Ft.SUCCESS,"\u6210\u529F",{appId:$,targetUrl:at});return U.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",Rt),Rt}catch(S){return U.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",S),z(Ft.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function nr(i){let{phone:a,rtaId:u,thirdPlatform:_,thirdPlatformUserId:g,thirdPlatformEquipmentValue:D}=i;if(!a)return z(Ft.INVALID_PARAM,Tt[2001]);if(!_)return z(2008,Tt[2008]);if(!g)return z(2009,Tt[2009]);if(!D)return z(2010,Tt[2010]);try{if(u){U.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let Q=await Nr({idMd5Value:a,rtaStrategy:u});if(Q.status!=1)return U.error("RTA\u9A8C\u8BC1\u5931\u8D25",Q),z(2003,Tt[2003]);U.info("RTA\u9A8C\u8BC1\u6210\u529F",Q)}let S=await Ur(i),{url:J,channelId:$,matchFlag:at,jumpMode:Rt,appId:ht}=S||{};return at?Rt===3?!ht||!J?z(2007,Tt[2007]):z(Ft.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:ht,url:J}):z(2007,Tt[2007]):z(2006,Tt[2006])}catch(S){return U.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",S),z(Ft.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var Te=null,Oe=null;try{Oe=jr()}catch(i){}function qr(){return Te||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(Te=globalThis.LyyGetCommandSDK,Te):Oe?(Te=Oe.LyyGetCommandSDK||Oe.default||Oe,Te):null)}function Br(i){var u;U.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",i);let a=qr();a!=null&&a.getJrCommand?a.getJrCommand(i):(u=a==null?void 0:a.default)!=null&&u.getJrCommand?a.default.getJrCommand(i):(U.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),i.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function Tn(i,a){return new Promise((u,_)=>{try{Br({url:i,channel:a,callback:g=>{g.code==="0"?u(g.data):_({msg:g.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(g){_(g)}})}async function or(i){try{let a=await me(),u=bt({os:a},i);U.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",u);let{code:_,body:g}=await Or(u);if(_==="0000000"&&g){let{url:D,channelId:S,matchFlag:J,jumpMode:$,appId:at}=g;if(!J)return z(2101,Tt[2101]);if($===1)return U.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),z(2102,Tt[2102]);if($===2)return ue()==="web"&&U.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:D}),!D||!S?z(2103,Tt[2103]):new Promise(Rt=>{Br({url:D,channel:S,callback:async ht=>{if((ht==null?void 0:ht.code)==="0")try{await ze(ht==null?void 0:ht.data),Rt(z(Ft.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch(Q){Rt(z(2105,Tt[2105]))}else Rt(z(2105,Tt[2105]))}})});if($===3)return!at||!D?z(2103,Tt[2103]):z(Ft.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:at,path:D})}return z(2104,Tt[2104])}catch(a){return U.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",a),z(Ft.NETWORK_ERROR,"\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5")}}async function ir(i){U.info("\u5F00\u59CB\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4...");try{let a=await xr(ne(bt({},i),{os:await me()}));if(!a)return U.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),z(2106,Tt[2106]);if(a.jumpMode===1)return U.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{appId:a.appId,url:a.url}),z(Ft.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:a.appId,path:a.url});if(a.jumpMode===2){if(ue()==="web")return U.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:a.url}),z(Ft.SUCCESS,"\u6210\u529F",{type:"h5",url:a.url});try{let u=await Tn(a.url,a.channel);return await ze(u),U.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),z(Ft.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(u){return U.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",u),$e("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),z(2105,Tt[2105])}}return U.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",a.jumpMode),z(2107,Tt[2107])}catch(a){let u=typeof a=="string"?a:(a==null?void 0:a.msg)||(a==null?void 0:a.message)||"\u672A\u77E5\u9519\u8BEF";return U.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",u),$e("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),u.includes("RTA")||u.includes("\u8D44\u683C")?z(2108,Tt[2108]):z(Ft.NETWORK_ERROR,u)}}var lr={};Me(lr,{DyErrorCode:()=>_e,getDyPayRtaData:()=>cr,handleDyPayFlow:()=>ur});var wn=["weapp","h5"];function Pn(i){return wn.includes(i)}var Cn=["switchTab","reLaunch","redirectTo","navigateTo"];function On(i){return Cn.includes(i)}function kr(i){return i.telephone?i.price?i.equipmentValue?i.businessType?i.client&&!Pn(i.client)?{valid:!1,errorCode:3004}:i.douyinOrderExtendData&&typeof i.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:i.backWay&&i.client==="weapp"&&!On(i.backWay)?{valid:!1,errorCode:3016}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}:{valid:!1,errorCode:3001}}function Jr(i){return i.equipmentValue?i.telephone?{valid:!0,errorCode:0}:{valid:!1,errorCode:3001}:{valid:!1,errorCode:3002}}var sr=Se();async function Yr(i){let{price:a,equipmentValue:u,douyinOrderExtendData:_,businessType:g}=i,D={businessType:g,equipmentValue:u,payInfoBusinessType:"commonDouyinPayment",platformActivities:{douyinCommodityPrice:a,douyinOrderExtendData:_||""}};try{let S=await sr.post("/gw/advert/customer/payment/pay-info",D);return S.code!=="0000000"||!(S!=null&&S.body)?Promise.reject({code:3006,message:S.message||Wt[3006]}):S}catch(S){return U.error("getDyOrderAmountFn error:",S),Promise.reject({code:3007,message:Wt[3007]})}}async function Vr(i){try{let a=i.commodityList.map(D=>({commodity:D.commodityId,quantity:1,categoryCode:D.categoryCode||"",supportMarketing:D.supportMarketing})),u=i.advertExtendInfo&&Object.keys(i.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:i.advertExtendInfo}):"",_={businessType:i.businessType,fixedClientType:21,channelCode:null,douyinData:{loginMobile:i.telephone||""},equipmentUseFlag:!0,payEquipmentDTO:{equipmentValue:i.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:u,transType:5,actualFee:i.totalFee,totalFee:i.totalFee,commodityList:a},g=await sr.post("/gw/payment-bff/unified/order",_);return g.code!=="0000000"||!(g!=null&&g.body)?Promise.reject({code:3008,message:g.message||Wt[3008]}):g}catch(a){return U.error("dyUnifiedOrderFn error:",a),Promise.reject({code:3009,message:Wt[3009]})}}async function Hr(i){let a={equipmentValue:i.equipmentValue,phone:i.telephone||""};i.price&&(a.orderAmount=i.price);try{let u=await sr.post("/gw/advert/customer/douyin/pay/check",a);return u.code!=="0000000"||!(u!=null&&u.body)?Promise.reject({code:3013,message:u.message||Wt[3013]}):u}catch(u){return U.error("getDyPayRtaData error:",u),Promise.reject({code:3014,message:(u==null?void 0:u.message)||Wt[3014]})}}async function ur(i){var u,_,g;let a=kr(i);if(!a.valid)return z(a.errorCode,Wt[a.errorCode]);try{let D=await Yr({price:i.price,equipmentValue:i.equipmentValue,businessType:i.businessType,douyinOrderExtendData:(i==null?void 0:i.douyinOrderExtendData)||""}),S=await Vr(ne(bt({},D.body),{telephone:i.telephone,equipmentValue:i.equipmentValue,businessType:i.businessType})),J=(u=S==null?void 0:S.body)!=null&&u.h5Url?await Nn(ne(bt({},i),{dyUrl:S.body.h5Url})):"",$=((_=S==null?void 0:S.body)==null?void 0:_.outTradeNo)||"";return J?z(0,"success",{h5Url:J,outTradeNo:$}):z(3010,Wt[3010])}catch(D){U.error("handleDyPayFlow error:",D);let S=(g=D==null?void 0:D.code)!=null?g:3012,J=(D==null?void 0:D.message)||Wt[3012];return z(S,J)}}async function Nn(i){let a=de(),u=Be(a.env||"prod",""),_=typeof a.getAuthToken=="function"?await a.getAuthToken():"",g=i.client||"weapp";return`${u}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${g}&equipmentId=${i.equipmentValue}&dyUrl=${i.dyUrl}&fromUrl=${encodeURIComponent(i.fromUrl||"")}&backUrl=${encodeURIComponent(i.backUrl||"")}&backWay=${i.backWay||""}&url_token=${_}`}async function cr(i){var u;let a=Jr(i);if(!a.valid)return z(a.errorCode,Wt[a.errorCode]);try{let _=await Hr({price:(i==null?void 0:i.price)||"",equipmentValue:i.equipmentValue,telephone:(i==null?void 0:i.telephone)||""});return z(0,"success",_.body)}catch(_){U.error("getDyPayRtaData error:",_);let g=(u=_==null?void 0:_.code)!=null?u:3015,D=(_==null?void 0:_.message)||Wt[3015];return z(g,D)}}var pr={};Me(pr,{getDisplayAdConfig:()=>dr,normalizeDisplayAdData:()=>Ye});var xn=Se();function Gr(i){let a=Pe(i,["placementId"]);if(!a.valid)return Promise.reject({code:"PARAM_ERROR",message:a.message});let u=de().env||"prod";return xn.get(`/gw/advert-plugin/api/v1/config/list/valid/${i.placementId}`,{},{authRequired:!1,baseDomain:Ir(u)})}var Xr=30*1e3,Fn="__",hr=new Map,fr=new Map;function Ln(i,a){return[i.appId||"",a,i.type||""].join(Fn)}function Un(i){let a=hr.get(i);return a?a.expireAt<=Date.now()?(hr.delete(i),U.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:i}),null):a.data:null}function Mn(i,a){hr.set(i,{data:a,expireAt:Date.now()+Xr})}function jn(i){return Array.isArray(i==null?void 0:i.body)?i.body:[]}function qn(i){return String(i==null?void 0:i.code)!=="200"}function Bn(i,a){let u=String(i||a||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(u)?u:a||"banner"}function Kr(i){return String(i||"").trim().toLowerCase()}function kn(i){var a;return!!i&&i.status!==0&&((a=i.platformConfig)==null?void 0:a.valid)!==!1}function Jn(i){return[...i].sort((a,u)=>{var D,S,J,$;let _=Number((D=a.priority)!=null?D:9999),g=Number((S=u.priority)!=null?S:9999);return _!==g?_-g:Number((J=u.weight)!=null?J:0)-Number(($=a.weight)!=null?$:0)})}function Wr(i){return i.find(a=>Kr(a.advertPlatform)==="gdt")||null}function zr(i){return i.find(a=>Kr(a.advertPlatform)!=="gdt")||null}function Yn(i,a){return i&&a?"mixed":i?"wechat":a?"custom":"none"}function Vn(i,a){var g,D;let u=Wr(i),_=zr(i);return u&&_?Number((g=u.priority)!=null?g:9999)<=Number((D=_.priority)!=null?D:9999)?"wechat-first":"custom-first":a==="custom"?"custom-only":a==="wechat"?"wechat-only":"wechat-first"}function Hn(i){var u;let a=Wr(i);return((u=a==null?void 0:a.platformConfig)==null?void 0:u.adId)||""}function Gn(i){let a=zr(i),u=a==null?void 0:a.platformConfig;if(!u)return null;let _=u.image||u.imageUrl||"",g=u.video||u.videoUrl||"",D=u.poster||_||"",S=u.jumpUrl||u.url||u.webUrl||"";return!_&&!g?null:{image:_||void 0,video:g||void 0,poster:D||void 0,title:u.title,description:u.description,buttonText:u.buttonText,badgeText:u.badgeText,jumpSeconds:u.jumpSeconds,loadTimeout:u.loadTimeout||u.timeout,muted:u.muted,adSpec:u.adSpec,url:S||void 0,action:S?{type:"web",url:S}:void 0}}function Ye(i,a){let u=Jn(i.filter(kn)),_=Gn(u),g=Hn(u),D=Bn(void 0,a),S=Yn(g,_),J=Vn(u,S);return{show:!!(g||_),adId:"",type:D,provider:S,priority:J,unitId:g,customAd:_,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:i}}async function dr(i){let a=i.placementId||i.adId||"",u=Ln(i,a),_=Un(u);if(_)return U.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:u,placementId:a}),z(Ft.SUCCESS,"\u6210\u529F",_);let g=fr.get(u);if(g)return U.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:u,placementId:a}),g;let D=(async()=>{try{U.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",i);let S=await Gr({placementId:a}),J=jn(S);if(U.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:u,placementId:a,response:S,body:J}),qn(S)||!J)return U.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",S),z(Ft.UNKNOWN_ERROR,(S==null?void 0:S.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");let $=Ye(J,i.type);return $.adId=a,$.cache=ne(bt({},$.cache),{enable:!0,ttl:Xr}),Mn(u,$),U.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:u,placementId:a,provider:$.provider,priority:$.priority,hasUnitId:!!$.unitId,hasCustomAd:!!$.customAd}),z(Ft.SUCCESS,"\u6210\u529F",$)}catch(S){return U.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:u,placementId:a,error:S}),z(Ft.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{fr.delete(u)}})();return fr.set(u,D),D}function Xn(i={}){U.info("\u670D\u52A1\u521D\u59CB\u5316",i);let a=bt(bt({},be),i);a.env&&!qe[a.env]&&(U.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${a.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),a.env=Xt.PROD),a.externalEnv&&!we[a.externalEnv]&&(U.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${a.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),a.externalEnv=se.PROD),a.debug!==void 0&&U.setEnable(a.debug),Sr(a),U.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",a)}function $r(i={}){let a="",u=null;async function _(){if(typeof i.getAuthToken=="function"){let D=await i.getAuthToken();if(D)return D}return u&&typeof u.getStorage=="function"&&u.getStorage("auth_token")||""}let g={name:"services",setToken(D){return a=D||"",u&&typeof u.setStorage=="function"&&u.setStorage("auth_token",a),g},async getAuthToken(){return a||_()},clearToken(){return a="",u&&typeof u.setStorage=="function"&&u.setStorage("auth_token",""),g},install(D){u=D;let S=ne(bt({},i),{getAuthToken:()=>g.getAuthToken()});Xn(S),U.info("services installed via nova.use()"),Object.assign(D,{jd:bt({},ar),dy:bt({},lr),ads:bt({},pr),setToken:g.setToken,clearToken:g.clearToken})}};return g}0&&(module.exports={DyErrorCode,DyErrorMessage,ENV_TYPE,EXTERNAL_ENV_TYPE,JdErrorCode,JdErrorMessage,createServices,getDisplayAdConfig,getDyPayRtaData,handleDyPayFlow,handleJdInsurance,handleJdInsuranceExt,handleJdjrCashLoanExt,handleJdjrCashLoanFlow,normalizeDisplayAdData});
1
+ "use strict";var Ue=Object.defineProperty,hn=Object.defineProperties,dn=Object.getOwnPropertyDescriptor,pn=Object.getOwnPropertyDescriptors,yn=Object.getOwnPropertyNames,Dr=Object.getOwnPropertySymbols;var Rr=Object.prototype.hasOwnProperty,gn=Object.prototype.propertyIsEnumerable;var We=(i,a,u)=>a in i?Ue(i,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[a]=u,bt=(i,a)=>{for(var u in a||(a={}))Rr.call(a,u)&&We(i,u,a[u]);if(Dr)for(var u of Dr(a))gn.call(a,u)&&We(i,u,a[u]);return i},oe=(i,a)=>hn(i,pn(a));var mn=(i,a)=>()=>(a||i((a={exports:{}}).exports,a),a.exports),Me=(i,a)=>{for(var u in a)Ue(i,u,{get:a[u],enumerable:!0})},_n=(i,a,u,_)=>{if(a&&typeof a=="object"||typeof a=="function")for(let g of yn(a))!Rr.call(i,g)&&g!==u&&Ue(i,g,{get:()=>a[g],enumerable:!(_=dn(a,g))||_.enumerable});return i};var vn=i=>_n(Ue({},"__esModule",{value:!0}),i);var je=(i,a,u)=>We(i,typeof a!="symbol"?a+"":a,u);var jr=mn((bo,Mr)=>{"use strict";(()=>{var i={737:(g,R,E)=>{"use strict";E.r(R),E.d(R,{default:()=>P,getJrCommand:()=>b});var k=E(307),$=E.n(k);function at(){at=function(){return V};var m,V={},_t=Object.prototype,st=_t.hasOwnProperty,vt=Object.defineProperty||function(h,l,y){h[l]=y.value},ut=typeof Symbol=="function"?Symbol:{},yt=ut.iterator||"@@iterator",At=ut.asyncIterator||"@@asyncIterator",Dt=ut.toStringTag||"@@toStringTag";function ft(h,l,y){return Object.defineProperty(h,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),h[l]}try{ft({},"")}catch(h){ft=function(l,y,x){return l[y]=x}}function Yt(h,l,y,x){var A=l&&l.prototype instanceof ie?l:ie,M=Object.create(A.prototype),rt=new le(x||[]);return vt(M,"_invoke",{value:Ot(h,y,rt)}),M}function Vt(h,l,y){try{return{type:"normal",arg:h.call(l,y)}}catch(x){return{type:"throw",arg:x}}}V.wrap=Yt;var kt="suspendedStart",zt="suspendedYield",Ht="executing",wt="completed",Pt={};function ie(){}function re(){}function jt(){}var ae={};ft(ae,yt,(function(){return this}));var ne=Object.getPrototypeOf,Lt=ne&&ne(ne(te([])));Lt&&Lt!==_t&&st.call(Lt,yt)&&(ae=Lt);var Jt=jt.prototype=ie.prototype=Object.create(ae);function pe(h){["next","throw","return"].forEach((function(l){ft(h,l,(function(y){return this._invoke(l,y)}))}))}function $t(h,l){function y(A,M,rt,mt){var pt=Vt(h[A],h,M);if(pt.type!=="throw"){var Gt=pt.arg,Qt=Gt.value;return Qt&&ht(Qt)=="object"&&st.call(Qt,"__await")?l.resolve(Qt.__await).then((function(Et){y("next",Et,rt,mt)}),(function(Et){y("throw",Et,rt,mt)})):l.resolve(Qt).then((function(Et){Gt.value=Et,rt(Gt)}),(function(Et){return y("throw",Et,rt,mt)}))}mt(pt.arg)}var x;vt(this,"_invoke",{value:function(A,M){function rt(){return new l((function(mt,pt){y(A,M,mt,pt)}))}return x=x?x.then(rt,rt):rt()}})}function Ot(h,l,y){var x=kt;return function(A,M){if(x===Ht)throw Error("Generator is already running");if(x===wt){if(A==="throw")throw M;return{value:m,done:!0}}for(y.method=A,y.arg=M;;){var rt=y.delegate;if(rt){var mt=Ut(rt,y);if(mt){if(mt===Pt)continue;return mt}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(x===kt)throw x=wt,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);x=Ht;var pt=Vt(h,l,y);if(pt.type==="normal"){if(x=y.done?wt:zt,pt.arg===Pt)continue;return{value:pt.arg,done:y.done}}pt.type==="throw"&&(x=wt,y.method="throw",y.arg=pt.arg)}}}function Ut(h,l){var y=l.method,x=h.iterator[y];if(x===m)return l.delegate=null,y==="throw"&&h.iterator.return&&(l.method="return",l.arg=m,Ut(h,l),l.method==="throw")||y!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+y+"' method")),Pt;var A=Vt(x,h.iterator,l.arg);if(A.type==="throw")return l.method="throw",l.arg=A.arg,l.delegate=null,Pt;var M=A.arg;return M?M.done?(l[h.resultName]=M.value,l.next=h.nextLoc,l.method!=="return"&&(l.method="next",l.arg=m),l.delegate=null,Pt):M:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,Pt)}function Zt(h){var l={tryLoc:h[0]};1 in h&&(l.catchLoc=h[1]),2 in h&&(l.finallyLoc=h[2],l.afterLoc=h[3]),this.tryEntries.push(l)}function ce(h){var l=h.completion||{};l.type="normal",delete l.arg,h.completion=l}function le(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(Zt,this),this.reset(!0)}function te(h){if(h||h===""){var l=h[yt];if(l)return l.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var y=-1,x=function A(){for(;++y<h.length;)if(st.call(h,y))return A.value=h[y],A.done=!1,A;return A.value=m,A.done=!0,A};return x.next=x}}throw new TypeError(ht(h)+" is not iterable")}return re.prototype=jt,vt(Jt,"constructor",{value:jt,configurable:!0}),vt(jt,"constructor",{value:re,configurable:!0}),re.displayName=ft(jt,Dt,"GeneratorFunction"),V.isGeneratorFunction=function(h){var l=typeof h=="function"&&h.constructor;return!!l&&(l===re||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,jt):(h.__proto__=jt,ft(h,Dt,"GeneratorFunction")),h.prototype=Object.create(Jt),h},V.awrap=function(h){return{__await:h}},pe($t.prototype),ft($t.prototype,At,(function(){return this})),V.AsyncIterator=$t,V.async=function(h,l,y,x,A){A===void 0&&(A=Promise);var M=new $t(Yt(h,l,y,x),A);return V.isGeneratorFunction(l)?M:M.next().then((function(rt){return rt.done?rt.value:M.next()}))},pe(Jt),ft(Jt,Dt,"Generator"),ft(Jt,yt,(function(){return this})),ft(Jt,"toString",(function(){return"[object Generator]"})),V.keys=function(h){var l=Object(h),y=[];for(var x in l)y.push(x);return y.reverse(),function A(){for(;y.length;){var M=y.pop();if(M in l)return A.value=M,A.done=!1,A}return A.done=!0,A}},V.values=te,le.prototype={constructor:le,reset:function(h){if(this.prev=0,this.next=0,this.sent=this._sent=m,this.done=!1,this.delegate=null,this.method="next",this.arg=m,this.tryEntries.forEach(ce),!h)for(var l in this)l.charAt(0)==="t"&&st.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=m)},stop:function(){this.done=!0;var h=this.tryEntries[0].completion;if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(h){if(this.done)throw h;var l=this;function y(pt,Gt){return M.type="throw",M.arg=h,l.next=pt,Gt&&(l.method="next",l.arg=m),!!Gt}for(var x=this.tryEntries.length-1;x>=0;--x){var A=this.tryEntries[x],M=A.completion;if(A.tryLoc==="root")return y("end");if(A.tryLoc<=this.prev){var rt=st.call(A,"catchLoc"),mt=st.call(A,"finallyLoc");if(rt&&mt){if(this.prev<A.catchLoc)return y(A.catchLoc,!0);if(this.prev<A.finallyLoc)return y(A.finallyLoc)}else if(rt){if(this.prev<A.catchLoc)return y(A.catchLoc,!0)}else{if(!mt)throw Error("try statement without catch or finally");if(this.prev<A.finallyLoc)return y(A.finallyLoc)}}}},abrupt:function(h,l){for(var y=this.tryEntries.length-1;y>=0;--y){var x=this.tryEntries[y];if(x.tryLoc<=this.prev&&st.call(x,"finallyLoc")&&this.prev<x.finallyLoc){var A=x;break}}A&&(h==="break"||h==="continue")&&A.tryLoc<=l&&l<=A.finallyLoc&&(A=null);var M=A?A.completion:{};return M.type=h,M.arg=l,A?(this.method="next",this.next=A.finallyLoc,Pt):this.complete(M)},complete:function(h,l){if(h.type==="throw")throw h.arg;return h.type==="break"||h.type==="continue"?this.next=h.arg:h.type==="return"?(this.rval=this.arg=h.arg,this.method="return",this.next="end"):h.type==="normal"&&l&&(this.next=l),Pt},finish:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===h)return this.complete(y.completion,y.afterLoc),ce(y),Pt}},catch:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===h){var x=y.completion;if(x.type==="throw"){var A=x.arg;ce(y)}return A}}throw Error("illegal catch attempt")},delegateYield:function(h,l,y){return this.delegate={iterator:te(h),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=m),Pt}},V}function Rt(m,V,_t,st,vt,ut,yt){try{var At=m[ut](yt),Dt=At.value}catch(ft){return void _t(ft)}At.done?V(Dt):Promise.resolve(Dt).then(st,vt)}function ht(m){return ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},ht(m)}var Q="https://ms.jr.jd.com";function ve(m){var V=m.host,_t=m.type,st=_t===void 0?"post":_t,vt=m.data,ut=m.path,yt=ut===void 0?"":ut,At=m.config,Dt=At===void 0?{}:At,ft=(Dt.withCredentials,Dt.isWG),Yt=ft===void 0||ft,Vt=Dt.contentType,kt=Vt===void 0?"application/x-www-form-urlencoded":Vt;return new Promise((function(zt,Ht){wx.request({url:(V||Q)+yt,method:st.toUpperCase(),data:Yt?D({reqData:JSON.stringify(vt)}):vt,header:{"content-type":kt},success:function(wt){wt.statusCode===200?zt(wt.data):Ht({statusCode:wt.statusCode,errMsg:wt.errMsg,data:wt.data})},fail:function(wt){Ht(wt)}})}))}function D(m){var V="";return ht(m)==="object"&&m!==null&&(Object.keys(m).map((function(_t){var st=m[_t];return V+=_t+"="+encodeURIComponent(st)+"&",""})),V.length>0&&(V=V.substr(0,V.length-1))),V}function Z(m){return dt.apply(this,arguments)}function dt(){var m;return m=at().mark((function V(_t){var st,vt,ut,yt,At,Dt,ft,Yt,Vt,kt;return at().wrap((function(zt){for(;;)switch(zt.prev=zt.next){case 0:return st=_t.url,vt=_t.channel,ut=_t.callback,$().init(),yt=new($()),At=yt.nonce(),Dt=yt.sign(JSON.stringify({t:"".concat(new Date().getTime())}),At),ft="/gw/generic/app/h5/m/execute1/ug-service-orchestrator".concat(""),Yt="",Vt={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:st,channel:vt,clientCode:"0",antiRushInfo:Dt}},zt.next=12,ve({host:"https://ms.jr.jd.com",type:"post",path:ft,config:{withCredentials:!0},data:Vt});case 12:(kt=zt.sent).resultCode===0&&kt.resultData&&kt.resultData.code==="00000"&&kt.resultData.data&&(Yt=kt.resultData.data.goldenKeyText),ut&&ut(Yt?{code:"0",msg:"command success",data:Yt}:{code:"-1",msg:"command empty"});case 15:case"end":return zt.stop()}}),V)})),dt=function(){var V=this,_t=arguments;return new Promise((function(st,vt){var ut=m.apply(V,_t);function yt(Dt){Rt(ut,st,vt,yt,At,"next",Dt)}function At(Dt){Rt(ut,st,vt,yt,At,"throw",Dt)}yt(void 0)}))},dt.apply(this,arguments)}function F(m){return F=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},F(m)}function J(){J=function(){return V};var m,V={},_t=Object.prototype,st=_t.hasOwnProperty,vt=Object.defineProperty||function(h,l,y){h[l]=y.value},ut=typeof Symbol=="function"?Symbol:{},yt=ut.iterator||"@@iterator",At=ut.asyncIterator||"@@asyncIterator",Dt=ut.toStringTag||"@@toStringTag";function ft(h,l,y){return Object.defineProperty(h,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),h[l]}try{ft({},"")}catch(h){ft=function(l,y,x){return l[y]=x}}function Yt(h,l,y,x){var A=l&&l.prototype instanceof ie?l:ie,M=Object.create(A.prototype),rt=new le(x||[]);return vt(M,"_invoke",{value:Ot(h,y,rt)}),M}function Vt(h,l,y){try{return{type:"normal",arg:h.call(l,y)}}catch(x){return{type:"throw",arg:x}}}V.wrap=Yt;var kt="suspendedStart",zt="suspendedYield",Ht="executing",wt="completed",Pt={};function ie(){}function re(){}function jt(){}var ae={};ft(ae,yt,(function(){return this}));var ne=Object.getPrototypeOf,Lt=ne&&ne(ne(te([])));Lt&&Lt!==_t&&st.call(Lt,yt)&&(ae=Lt);var Jt=jt.prototype=ie.prototype=Object.create(ae);function pe(h){["next","throw","return"].forEach((function(l){ft(h,l,(function(y){return this._invoke(l,y)}))}))}function $t(h,l){function y(A,M,rt,mt){var pt=Vt(h[A],h,M);if(pt.type!=="throw"){var Gt=pt.arg,Qt=Gt.value;return Qt&&F(Qt)=="object"&&st.call(Qt,"__await")?l.resolve(Qt.__await).then((function(Et){y("next",Et,rt,mt)}),(function(Et){y("throw",Et,rt,mt)})):l.resolve(Qt).then((function(Et){Gt.value=Et,rt(Gt)}),(function(Et){return y("throw",Et,rt,mt)}))}mt(pt.arg)}var x;vt(this,"_invoke",{value:function(A,M){function rt(){return new l((function(mt,pt){y(A,M,mt,pt)}))}return x=x?x.then(rt,rt):rt()}})}function Ot(h,l,y){var x=kt;return function(A,M){if(x===Ht)throw Error("Generator is already running");if(x===wt){if(A==="throw")throw M;return{value:m,done:!0}}for(y.method=A,y.arg=M;;){var rt=y.delegate;if(rt){var mt=Ut(rt,y);if(mt){if(mt===Pt)continue;return mt}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(x===kt)throw x=wt,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);x=Ht;var pt=Vt(h,l,y);if(pt.type==="normal"){if(x=y.done?wt:zt,pt.arg===Pt)continue;return{value:pt.arg,done:y.done}}pt.type==="throw"&&(x=wt,y.method="throw",y.arg=pt.arg)}}}function Ut(h,l){var y=l.method,x=h.iterator[y];if(x===m)return l.delegate=null,y==="throw"&&h.iterator.return&&(l.method="return",l.arg=m,Ut(h,l),l.method==="throw")||y!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+y+"' method")),Pt;var A=Vt(x,h.iterator,l.arg);if(A.type==="throw")return l.method="throw",l.arg=A.arg,l.delegate=null,Pt;var M=A.arg;return M?M.done?(l[h.resultName]=M.value,l.next=h.nextLoc,l.method!=="return"&&(l.method="next",l.arg=m),l.delegate=null,Pt):M:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,Pt)}function Zt(h){var l={tryLoc:h[0]};1 in h&&(l.catchLoc=h[1]),2 in h&&(l.finallyLoc=h[2],l.afterLoc=h[3]),this.tryEntries.push(l)}function ce(h){var l=h.completion||{};l.type="normal",delete l.arg,h.completion=l}function le(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(Zt,this),this.reset(!0)}function te(h){if(h||h===""){var l=h[yt];if(l)return l.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var y=-1,x=function A(){for(;++y<h.length;)if(st.call(h,y))return A.value=h[y],A.done=!1,A;return A.value=m,A.done=!0,A};return x.next=x}}throw new TypeError(F(h)+" is not iterable")}return re.prototype=jt,vt(Jt,"constructor",{value:jt,configurable:!0}),vt(jt,"constructor",{value:re,configurable:!0}),re.displayName=ft(jt,Dt,"GeneratorFunction"),V.isGeneratorFunction=function(h){var l=typeof h=="function"&&h.constructor;return!!l&&(l===re||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,jt):(h.__proto__=jt,ft(h,Dt,"GeneratorFunction")),h.prototype=Object.create(Jt),h},V.awrap=function(h){return{__await:h}},pe($t.prototype),ft($t.prototype,At,(function(){return this})),V.AsyncIterator=$t,V.async=function(h,l,y,x,A){A===void 0&&(A=Promise);var M=new $t(Yt(h,l,y,x),A);return V.isGeneratorFunction(l)?M:M.next().then((function(rt){return rt.done?rt.value:M.next()}))},pe(Jt),ft(Jt,Dt,"Generator"),ft(Jt,yt,(function(){return this})),ft(Jt,"toString",(function(){return"[object Generator]"})),V.keys=function(h){var l=Object(h),y=[];for(var x in l)y.push(x);return y.reverse(),function A(){for(;y.length;){var M=y.pop();if(M in l)return A.value=M,A.done=!1,A}return A.done=!0,A}},V.values=te,le.prototype={constructor:le,reset:function(h){if(this.prev=0,this.next=0,this.sent=this._sent=m,this.done=!1,this.delegate=null,this.method="next",this.arg=m,this.tryEntries.forEach(ce),!h)for(var l in this)l.charAt(0)==="t"&&st.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=m)},stop:function(){this.done=!0;var h=this.tryEntries[0].completion;if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(h){if(this.done)throw h;var l=this;function y(pt,Gt){return M.type="throw",M.arg=h,l.next=pt,Gt&&(l.method="next",l.arg=m),!!Gt}for(var x=this.tryEntries.length-1;x>=0;--x){var A=this.tryEntries[x],M=A.completion;if(A.tryLoc==="root")return y("end");if(A.tryLoc<=this.prev){var rt=st.call(A,"catchLoc"),mt=st.call(A,"finallyLoc");if(rt&&mt){if(this.prev<A.catchLoc)return y(A.catchLoc,!0);if(this.prev<A.finallyLoc)return y(A.finallyLoc)}else if(rt){if(this.prev<A.catchLoc)return y(A.catchLoc,!0)}else{if(!mt)throw Error("try statement without catch or finally");if(this.prev<A.finallyLoc)return y(A.finallyLoc)}}}},abrupt:function(h,l){for(var y=this.tryEntries.length-1;y>=0;--y){var x=this.tryEntries[y];if(x.tryLoc<=this.prev&&st.call(x,"finallyLoc")&&this.prev<x.finallyLoc){var A=x;break}}A&&(h==="break"||h==="continue")&&A.tryLoc<=l&&l<=A.finallyLoc&&(A=null);var M=A?A.completion:{};return M.type=h,M.arg=l,A?(this.method="next",this.next=A.finallyLoc,Pt):this.complete(M)},complete:function(h,l){if(h.type==="throw")throw h.arg;return h.type==="break"||h.type==="continue"?this.next=h.arg:h.type==="return"?(this.rval=this.arg=h.arg,this.method="return",this.next="end"):h.type==="normal"&&l&&(this.next=l),Pt},finish:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===h)return this.complete(y.completion,y.afterLoc),ce(y),Pt}},catch:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===h){var x=y.completion;if(x.type==="throw"){var A=x.arg;ce(y)}return A}}throw Error("illegal catch attempt")},delegateYield:function(h,l,y){return this.delegate={iterator:te(h),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=m),Pt}},V}function St(m,V,_t,st,vt,ut,yt){try{var At=m[ut](yt),Dt=At.value}catch(ft){return void _t(ft)}At.done?V(Dt):Promise.resolve(Dt).then(st,vt)}function b(m){return T.apply(this,arguments)}function T(){var m;return m=J().mark((function V(_t){var st,vt,ut;return J().wrap((function(yt){for(;;)switch(yt.prev=yt.next){case 0:return st=_t.url,vt=_t.channel,ut=_t.callback,yt.next=3,Z({url:st,channel:vt,callback:ut});case 3:case"end":return yt.stop()}}),V)})),T=function(){var V=this,_t=arguments;return new Promise((function(st,vt){var ut=m.apply(V,_t);function yt(Dt){St(ut,st,vt,yt,At,"next",Dt)}function At(Dt){St(ut,st,vt,yt,At,"throw",Dt)}yt(void 0)}))},T.apply(this,arguments)}var O={getJrCommand:b};(g=E.hmd(g)).exports&&(g.exports=O,g.exports.getJrCommand=b),typeof window!="undefined"&&(window.LyyGetCommandSDK=O);let P=O},307:function(g,R,E){var k,$,at;function Rt(ht){return Rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Q){return typeof Q}:function(Q){return Q&&typeof Symbol=="function"&&Q.constructor===Symbol&&Q!==Symbol.prototype?"symbol":typeof Q},Rt(ht)}at=function(){"use strict";function ht(t){return(ht=typeof Symbol=="function"&&Rt(Symbol.iterator)=="symbol"?function(r){return Rt(r)}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":Rt(r)})(t)}function Q(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function ve(t,r){for(var s=0;s<r.length;s++){var c=r[s];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}function D(t,r,s){return r&&ve(t.prototype,r),s&&ve(t,s),t}function Z(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&F(t,r)}function dt(t){return(dt=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(t)}function F(t,r){return(F=Object.setPrototypeOf||function(s,c){return s.__proto__=c,s})(t,r)}function J(t){var r=(function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(s){return!1}})();return function(){var s,c=dt(t);return(function(d,p){if(p&&(Rt(p)=="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I})(d)})(this,r?(s=dt(this).constructor,Reflect.construct(c,arguments,s)):c.apply(this,arguments))}}function St(t){return(function(r){if(Array.isArray(r))return b(r)})(t)||(function(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)})(t)||(function(r,s){if(r){if(typeof r=="string")return b(r,s);var c=Object.prototype.toString.call(r).slice(8,-1);return(c=c==="Object"&&r.constructor?r.constructor.name:c)==="Map"||c==="Set"?Array.from(r):c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?b(r,s):void 0}})(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function b(t,r){(r==null||r>t.length)&&(r=t.length);for(var s=0,c=new Array(r);s<r;s++)c[s]=t[s];return c}var T=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:E.g!==void 0?E.g:typeof self!="undefined"?self:{},O=!1,P=!1,m={console:!0,focus:!1,time:!1,length:!0,infinite:!1,time_interval:500,time_threshold:100,length_threshold:300},V=function(){typeof document!="undefined"&&document.hasFocus&&!document.hasFocus()&&(P=!0)},_t=function(){var t=Date.now();Date.now()-t>m.time_threshold&&(P=!0)},st=function(){var t=T.outerWidth,r=T.outerHeight,s=T.innerWidth,c=T.innerHeight;t&&r&&s&&c&&typeof t=="number"&&typeof r=="number"&&typeof s=="number"&&typeof c=="number"&&(t-s>m.length_threshold||r-c>m.length_threshold)&&(P=!0)};(Ot={}).start=function(t){if(!O){if(t&&ht(t)==="object")for(var r in t)m[r]=t[r];var s;m.infinite&&(typeof window!="undefined"&&Object.prototype.toString.call(window)==="[object Window]"?typeof Function!="undefined"&&Function.constructor!==void 0&&/Function[^]*\[native code\]/.test(""+Function.constructor)&&typeof setInterval!="undefined"&&/setInterval[^]*\[native code\]/.test(""+setInterval)?new Function('setInterval(function(){!/Function[^]*[native code]/.test("" + Function.constructor) ? function(){while(1);}() : new Function("debugger")(); }, 100);')():P=!0:setInterval((function(){}),100)),m.console&&(function(){var c=new Date;c.toString=function(){for(var d=Date.now();;)if(10<Date.now()-d)return Date.now()},console.log(c),c.toString=function(){return P=!0,Date.now()}})(),m.focus&&V(),m.time&&_t(),m.length&&st(),s=setInterval((function(){s&&P&&clearInterval(s),m.focus&&V(),m.time&&_t(),m.length&&st()}),m.time_interval),O=!0}},Ot.isDebug=function(){return P};var vt=Ot,ut=".123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-!",yt={my_b4_encode:function(t){var r=0,s=(j=0)<t.length%3?3-t.length%3:0;for(r=0;r<s;r++)t[t.length]=0;var c="";for(j=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
3
+ `),c+=ut[t[j]>>2]+ut[(3&t[j])<<4|t[j+1]>>4]+ut[(15&t[j+1])<<2|t[j+2]>>6]+ut[63&t[j+2]];for(r=0;r<s;r++)c+=ut[64];return c},my_b4_decode:function(t){var r=0,s=0,c=(t=t.replace(/[^A-Za-z0-9\+\-\!\.]/g,"")).length%4;if(2<c)return null;for(r=0;r<c;r++)if(t.charAt(t.length-r-1)!=ut[64])return null;var d,p,I,C,w=new Array(3*(t.length-c)/4);for(r=0,s=0;s<w.length;)d=ut.indexOf(t.charAt(r++)),p=ut.indexOf(t.charAt(r++)),I=ut.indexOf(t.charAt(r++)),C=ut.indexOf(t.charAt(r++)),w[s++]=d<<2|p>>4,w[s++]=(15&p)<<4|I>>2,w[s++]=(3&I)<<6|C;for(r=0;r<c;r++)if(w.pop()!=0)return null;return w}},At="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Dt={b4_encode:function(t){var r=0,s=(j=0)<t.length%3?3-t.length%3:0;for(r=0;r<s;r++)t[t.length]=0;var c="";for(r=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
4
+ `),c+=At[t[j]>>2]+At[(3&t[j])<<4|t[j+1]>>4]+At[(15&t[j+1])<<2|t[j+2]>>6]+At[63&t[j+2]];for(r=0;r<s;r++)c+="=";return c},b4_decode:function(t){var r=0,s=0,c=(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length%4;if(2<c)return null;for(r=0;r<c;r++)if(t.charAt(t.length-r-1)!="=")return null;var d,p,I,C,w=new Array(3*(t.length-c)/4);for(r=0,s=0;s<w.length;)d=At.indexOf(t.charAt(r++)),p=At.indexOf(t.charAt(r++)),I=At.indexOf(t.charAt(r++)),C=At.indexOf(t.charAt(r++)),w[s++]=d<<2|p>>4,w[s++]=(15&p)<<4|I>>2,w[s++]=(3&I)<<6|C;for(r=0;r<c;r++)if(w.pop()!=0)return null;return w}};function ft(){}ft.encode=function(t,r,s){for(var c=new Array(2*s),d=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),p=r,I=0;p<s+r;p++,I++)c[I]=d[(255&t[p])>>4],c[++I]=d[15&t[p]];return c.join("")},ft.decode=function(t){if(t==null||t==""||t.length%2!=0)return null;for(var r=t.length/2,s=ft.toCharCodeArray(t),c=new Array(r),d=0;d<r;d++){if(48<=s[2*d]&&s[2*d]<=57)c[d]=s[2*d]-48<<4;else if(65<=s[2*d]&&s[2*d]<=70)c[d]=s[2*d]-65+10<<4;else{if(!(97<=s[2*d]&&s[2*d]<=102))return null;c[d]=s[2*d]-97+10<<4}if(48<=s[2*d+1]&&s[2*d+1]<=57)c[d]=c[d]|s[2*d+1]-48;else if(65<=s[2*d+1]&&s[2*d+1]<=70)c[d]=c[d]|s[2*d+1]-65+10;else{if(!(97<=s[2*d+1]&&s[2*d+1]<=102))return null;c[d]=c[d]|s[2*d+1]-97+10}}return c},ft.toCharCodeArray=function(t){for(var r=new Array(t.length),s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return r};var Yt=ft,Vt=Yt;(Ut=function(){}).utf8StrToh6=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],d=0;d<s;d++)c[d]=r.charCodeAt(d).toString(16);return c.join("")},Ut.utf8StrToBytes=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],d=0;d<s;d++)c[d]=r.charCodeAt(d);return c},Ut.hexToUtf8Str=function(t){for(var r=Vt.decode(t),s=[],c=0;c<r.length;c++)s.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(s.join("")))},Ut.bytesToUtf8Str=function(t){for(var r=t,s=[],c=0;c<r.length;c++)s.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(s.join("")))},Ut.intToByte=function(t){return new Array(t>>24&255,t>>16&255,t>>8&255,255&t)},Ut.byteToInt=function(t,r){return r+3<t.length?t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]:r+2<t.length?t[r+1]<<16|t[r+2]<<8|t[r+3]:r+1<t.length?t[r]<<8|t[r+1]:t[r]};var kt,zt=Ut,Ht={exports:{}};kt=Ht,function(){function t(e,n,o){e!=null&&(typeof e=="number"?this.fromNumber(e,n,o):n==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,n))}function r(){return new t(null)}var s=(s=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(t.prototype.am=function(e,n,o,f,v,N){for(var B=32767&n,L=n>>15;0<=--N;){var xt=32767&this[e],Kt=this[e++]>>15,se=L*xt+Kt*B;v=((xt=B*xt+((32767&se)<<15)+o[f]+(1073741823&v))>>>30)+(se>>>15)+L*Kt+(v>>>30),o[f++]=1073741823&xt}return v},30):s&&navigator.appName!="Netscape"?(t.prototype.am=function(e,n,o,f,v,N){for(;0<=--N;){var B=n*this[e++]+o[f]+v;v=Math.floor(B/67108864),o[f++]=67108863&B}return v},26):(t.prototype.am=function(e,n,o,f,v,N){for(var B=16383&n,L=n>>14;0<=--N;){var xt=16383&this[e],Kt=this[e++]>>14,se=L*xt+Kt*B;v=((xt=B*xt+((16383&se)<<14)+o[f]+v)>>28)+(se>>14)+L*Kt,o[f++]=268435455&xt}return v},28);t.prototype.DB=s,t.prototype.DM=(1<<s)-1,t.prototype.DV=1<<s,t.prototype.FV=Math.pow(2,52),t.prototype.F1=52-s,t.prototype.F2=2*s-52;for(var c=new Array,d=48,p=0;p<=9;++p)c[d++]=p;for(d=97,p=10;p<36;++p)c[d++]=p;for(d=65,p=10;p<36;++p)c[d++]=p;function I(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function C(e,n){return(e=c[e.charCodeAt(n)])==null?-1:e}function w(e){var n=r();return n.fromInt(e),n}function nt(e){var n,o=1;return(n=e>>>16)!=0&&(e=n,o+=16),(n=e>>8)!=0&&(e=n,o+=8),(n=e>>4)!=0&&(e=n,o+=4),(n=e>>2)!=0&&(e=n,o+=2),(n=e>>1)!=0&&(e=n,o+=1),o}function ot(e){this.m=e}function S(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function H(e,n){return e&n}function tt(e,n){return e|n}function W(e,n){return e^n}function it(e,n){return e&~n}function lt(){}function Ct(e){return e}function q(e){this.r2=r(),this.q3=r(),t.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}ot.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},ot.prototype.revert=function(e){return e},ot.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},ot.prototype.mulTo=function(e,n,o){e.multiplyTo(n,o),this.reduce(o)},ot.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)},S.prototype.convert=function(e){var n=r();return e.abs().dlShiftTo(this.m.t,n),n.divRemTo(this.m,null,n),e.s<0&&0<n.compareTo(t.ZERO)&&this.m.subTo(n,n),n},S.prototype.revert=function(e){var n=r();return e.copyTo(n),this.reduce(n),n},S.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var n=0;n<this.m.t;++n){var o=32767&e[n],f=o*this.mpl+((o*this.mph+(e[n]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[o=n+this.m.t]+=this.m.am(0,f,e,n,0,this.m.t);e[o]>=e.DV;)e[o]-=e.DV,e[++o]++}e.clamp(),e.drShiftTo(this.m.t,e),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},S.prototype.mulTo=function(e,n,o){e.multiplyTo(n,o),this.reduce(o)},S.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)},t.prototype.copyTo=function(e){for(var n=this.t-1;0<=n;--n)e[n]=this[n];e.t=this.t,e.s=this.s},t.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0<e?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},t.prototype.fromString=function(e,n){var o;if(n==16)o=4;else if(n==8)o=3;else if(n==256)o=8;else if(n==2)o=1;else if(n==32)o=5;else{if(n!=4)return void this.fromRadix(e,n);o=2}this.t=0,this.s=0;for(var f=e.length,v=!1,N=0;0<=--f;){var B=o==8?255&e[f]:C(e,f);B<0?e.charAt(f)=="-"&&(v=!0):(v=!1,N==0?this[this.t++]=B:N+o>this.DB?(this[this.t-1]|=(B&(1<<this.DB-N)-1)<<N,this[this.t++]=B>>this.DB-N):this[this.t-1]|=B<<N,(N+=o)>=this.DB&&(N-=this.DB))}o==8&&128&e[0]&&(this.s=-1,0<N&&(this[this.t-1]|=(1<<this.DB-N)-1<<N)),this.clamp(),v&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var e=this.s&this.DM;0<this.t&&this[this.t-1]==e;)--this.t},t.prototype.dlShiftTo=function(e,n){for(var o=this.t-1;0<=o;--o)n[o+e]=this[o];for(o=e-1;0<=o;--o)n[o]=0;n.t=this.t+e,n.s=this.s},t.prototype.drShiftTo=function(e,n){for(var o=e;o<this.t;++o)n[o-e]=this[o];n.t=Math.max(this.t-e,0),n.s=this.s},t.prototype.lShiftTo=function(e,n){for(var o=e%this.DB,f=this.DB-o,v=(1<<f)-1,N=Math.floor(e/this.DB),B=this.s<<o&this.DM,L=this.t-1;0<=L;--L)n[L+N+1]=this[L]>>f|B,B=(this[L]&v)<<o;for(L=N-1;0<=L;--L)n[L]=0;n[N]=B,n.t=this.t+N+1,n.s=this.s,n.clamp()},t.prototype.rShiftTo=function(e,n){n.s=this.s;var o=Math.floor(e/this.DB);if(o>=this.t)n.t=0;else{var f=e%this.DB,v=this.DB-f,N=(1<<f)-1;n[0]=this[o]>>f;for(var B=o+1;B<this.t;++B)n[B-o-1]|=(this[B]&N)<<v,n[B-o]=this[B]>>f;0<f&&(n[this.t-o-1]|=(this.s&N)<<v),n.t=this.t-o,n.clamp()}},t.prototype.subTo=function(e,n){for(var o=0,f=0,v=Math.min(e.t,this.t);o<v;)f+=this[o]-e[o],n[o++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f-=e.s;o<this.t;)f+=this[o],n[o++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;o<e.t;)f-=e[o],n[o++]=f&this.DM,f>>=this.DB;f-=e.s}n.s=f<0?-1:0,f<-1?n[o++]=this.DV+f:0<f&&(n[o++]=f),n.t=o,n.clamp()},t.prototype.multiplyTo=function(e,n){var o=this.abs(),f=e.abs(),v=o.t;for(n.t=v+f.t;0<=--v;)n[v]=0;for(v=0;v<f.t;++v)n[v+o.t]=o.am(0,f[v],n,v,0,o.t);n.s=0,n.clamp(),this.s!=e.s&&t.ZERO.subTo(n,n)},t.prototype.squareTo=function(e){for(var n=this.abs(),o=e.t=2*n.t;0<=--o;)e[o]=0;for(o=0;o<n.t-1;++o){var f=n.am(o,n[o],e,2*o,0,1);(e[o+n.t]+=n.am(o+1,2*n[o],e,2*o+1,f,n.t-o-1))>=n.DV&&(e[o+n.t]-=n.DV,e[o+n.t+1]=1)}0<e.t&&(e[e.t-1]+=n.am(o,n[o],e,2*o,0,1)),e.s=0,e.clamp()},t.prototype.divRemTo=function(e,n,o){var f=e.abs();if(!(f.t<=0)){if((Kt=this.abs()).t<f.t)return n!=null&&n.fromInt(0),void(o!=null&&this.copyTo(o));o==null&&(o=r());var v=r(),N=this.s,B=e.s;0<(e=this.DB-nt(f[f.t-1]))?(f.lShiftTo(e,v),Kt.lShiftTo(e,o)):(f.copyTo(v),Kt.copyTo(o));var L=v.t,xt=v[L-1];if(xt!=0){var Kt=xt*(1<<this.F1)+(1<L?v[L-2]>>this.F2:0),se=this.FV/Kt,fe=(1<<this.F1)/Kt,Ie=1<<this.F2,Bt=o.t,ge=Bt-L,qt=n==null?r():n;for(v.dlShiftTo(ge,qt),0<=o.compareTo(qt)&&(o[o.t++]=1,o.subTo(qt,o)),t.ONE.dlShiftTo(L,qt),qt.subTo(v,v);v.t<L;)v[v.t++]=0;for(;0<=--ge;){var Ke=o[--Bt]==xt?this.DM:Math.floor(o[Bt]*se+(o[Bt-1]+Ie)*fe);if((o[Bt]+=v.am(0,Ke,o,ge,0,L))<Ke)for(v.dlShiftTo(ge,qt),o.subTo(qt,o);o[Bt]<--Ke;)o.subTo(qt,o)}n!=null&&(o.drShiftTo(L,n),N!=B&&t.ZERO.subTo(n,n)),o.t=L,o.clamp(),0<e&&o.rShiftTo(e,o),N<0&&t.ZERO.subTo(o,o)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var n=3&e;return 0<(n=(n=(n=(n=n*(2-(15&e)*n)&15)*(2-(255&e)*n)&255)*(2-((65535&e)*n&65535))&65535)*(2-e*n%this.DV)%this.DV)?this.DV-n:-n},t.prototype.isEven=function(){return(0<this.t?1&this[0]:this.s)==0},t.prototype.exp=function(e,n){if(4294967295<e||e<1)return t.ONE;var o,f=r(),v=r(),N=n.convert(this),B=nt(e)-1;for(N.copyTo(f);0<=--B;)n.sqrTo(f,v),0<(e&1<<B)?n.mulTo(v,N,f):(o=f,f=v,v=o);return n.revert(f)},t.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var n;if(e==16)n=4;else if(e==8)n=3;else if(e==2)n=1;else if(e==32)n=5;else{if(e!=4)return this.toRadix(e);n=2}var o,f=(1<<n)-1,v=!1,N="",B=this.t,L=this.DB-B*this.DB%n;if(0<B--)for(L<this.DB&&0<(o=this[B]>>L)&&(v=!0,N=I(o));0<=B;)L<n?(o=(this[B]&(1<<L)-1)<<n-L,o|=this[--B]>>(L+=this.DB-n)):(o=this[B]>>(L-=n)&f,L<=0&&(L+=this.DB,--B)),(v=0<o||v)&&(N+=I(o));return v?N:"0"},t.prototype.negate=function(){var e=r();return t.ZERO.subTo(this,e),e},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(e){var n=this.s-e.s;if(n!=0)return n;var o=this.t;if((n=o-e.t)!=0)return this.s<0?-n:n;for(;0<=--o;)if((n=this[o]-e[o])!=0)return n;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+nt(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var n=r();return this.abs().divRemTo(e,null,n),this.s<0&&0<n.compareTo(t.ZERO)&&e.subTo(n,n),n},t.prototype.modPowInt=function(e,n){return n=new(e<256||n.isEven()?ot:S)(n),this.exp(e,n)},t.ZERO=w(0),t.ONE=w(1),lt.prototype.convert=Ct,lt.prototype.revert=Ct,lt.prototype.mulTo=function(e,n,o){e.multiplyTo(n,o)},lt.prototype.sqrTo=function(e,n){e.squareTo(n)},q.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var n=r();return e.copyTo(n),this.reduce(n),n},q.prototype.revert=function(e){return e},q.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);0<=e.compareTo(this.m);)e.subTo(this.m,e)},q.prototype.mulTo=function(e,n,o){e.multiplyTo(n,o),this.reduce(o)},q.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)};var X,Y=[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],G=(1<<26)/Y[Y.length-1];function K(){var e;e=new Date().getTime(),gt[et++]^=255&e,gt[et++]^=e>>8&255,gt[et++]^=e>>16&255,gt[et++]^=e>>24&255,Xe<=et&&(et-=Xe)}if(t.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},t.prototype.toRadix=function(e){if(e==null&&(e=10),this.signum()==0||e<2||36<e)return"0";var n=this.chunkSize(e),o=Math.pow(e,n),f=w(o),v=r(),N=r(),B="";for(this.divRemTo(f,v,N);0<v.signum();)B=(o+N.intValue()).toString(e).substr(1)+B,v.divRemTo(f,v,N);return N.intValue().toString(e)+B},t.prototype.fromRadix=function(e,n){this.fromInt(0);for(var o=this.chunkSize(n=n==null?10:n),f=Math.pow(n,o),v=!1,N=0,B=0,L=0;L<e.length;++L){var xt=C(e,L);xt<0?e.charAt(L)=="-"&&this.signum()==0&&(v=!0):(B=n*B+xt,++N>=o&&(this.dMultiply(f),this.dAddOffset(B,0),B=N=0))}0<N&&(this.dMultiply(Math.pow(n,N)),this.dAddOffset(B,0)),v&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,n,o){if(typeof n=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,o),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),tt,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 f=new Array;o=7&e,f.length=1+(e>>3),n.nextBytes(f),0<o?f[0]&=(1<<o)-1:f[0]=0,this.fromString(f,256)}},t.prototype.bitwiseTo=function(e,n,o){for(var f,v=Math.min(e.t,this.t),N=0;N<v;++N)o[N]=n(this[N],e[N]);if(e.t<this.t){for(f=e.s&this.DM,N=v;N<this.t;++N)o[N]=n(this[N],f);o.t=this.t}else{for(f=this.s&this.DM,N=v;N<e.t;++N)o[N]=n(f,e[N]);o.t=e.t}o.s=n(this.s,e.s),o.clamp()},t.prototype.changeBit=function(e,n){return e=t.ONE.shiftLeft(e),this.bitwiseTo(e,n,e),e},t.prototype.addTo=function(e,n){for(var o=0,f=0,v=Math.min(e.t,this.t);o<v;)f+=this[o]+e[o],n[o++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f+=e.s;o<this.t;)f+=this[o],n[o++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;o<e.t;)f+=e[o],n[o++]=f&this.DM,f>>=this.DB;f+=e.s}n.s=f<0?-1:0,0<f?n[o++]=f:f<-1&&(n[o++]=this.DV+f),n.t=o,n.clamp()},t.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(e,n){if(e!=0){for(;this.t<=n;)this[this.t++]=0;for(this[n]+=e;this[n]>=this.DV;)this[n]-=this.DV,++n>=this.t&&(this[this.t++]=0),++this[n]}},t.prototype.multiplyLowerTo=function(e,n,o){var f,v=Math.min(this.t+e.t,n);for(o.s=0,o.t=v;0<v;)o[--v]=0;for(f=o.t-this.t;v<f;++v)o[v+this.t]=this.am(0,e[v],o,v,0,this.t);for(f=Math.min(e.t,n);v<f;++v)this.am(0,e[v],o,v,0,n-v);o.clamp()},t.prototype.multiplyUpperTo=function(e,n,o){var f=o.t=this.t+e.t- --n;for(o.s=0;0<=--f;)o[f]=0;for(f=Math.max(n-this.t,0);f<e.t;++f)o[this.t+f-n]=this.am(n-f,e[f],o,0,0,this.t+f-n);o.clamp(),o.drShiftTo(1,o)},t.prototype.modInt=function(e){if(e<=0)return 0;var n=this.DV%e,o=this.s<0?e-1:0;if(0<this.t)if(n==0)o=this[0]%e;else for(var f=this.t-1;0<=f;--f)o=(n*o+this[f])%e;return o},t.prototype.millerRabin=function(e){var n=this.subtract(t.ONE),o=n.getLowestSetBit();if(o<=0)return!1;var f=n.shiftRight(o);Y.length<(e=e+1>>1)&&(e=Y.length);for(var v=r(),N=0;N<e;++N){v.fromInt(Y[Math.floor(Math.random()*Y.length)]);var B=v.modPow(f,this);if(B.compareTo(t.ONE)!=0&&B.compareTo(n)!=0){for(var L=1;L++<o&&B.compareTo(n)!=0;)if((B=B.modPowInt(2,this)).compareTo(t.ONE)==0)return!1;if(B.compareTo(n)!=0)return!1}}return!0},t.prototype.clone=function(){var e=r();return this.copyTo(e),e},t.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},t.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},t.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},t.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},t.prototype.toByteArray=function(){var e=this.t,n=new Array;n[0]=this.s;var o,f=this.DB-e*this.DB%8,v=0;if(0<e--)for(f<this.DB&&(o=this[e]>>f)!=(this.s&this.DM)>>f&&(n[v++]=o|this.s<<this.DB-f);0<=e;)f<8?(o=(this[e]&(1<<f)-1)<<8-f,o|=this[--e]>>(f+=this.DB-8)):(o=this[e]>>(f-=8)&255,f<=0&&(f+=this.DB,--e)),128&o&&(o|=-256),v==0&&(128&this.s)!=(128&o)&&++v,(0<v||o!=this.s)&&(n[v++]=o);return n},t.prototype.equals=function(e){return this.compareTo(e)==0},t.prototype.min=function(e){return this.compareTo(e)<0?this:e},t.prototype.max=function(e){return 0<this.compareTo(e)?this:e},t.prototype.and=function(e){var n=r();return this.bitwiseTo(e,H,n),n},t.prototype.or=function(e){var n=r();return this.bitwiseTo(e,tt,n),n},t.prototype.xor=function(e){var n=r();return this.bitwiseTo(e,W,n),n},t.prototype.andNot=function(e){var n=r();return this.bitwiseTo(e,it,n),n},t.prototype.not=function(){for(var e=r(),n=0;n<this.t;++n)e[n]=this.DM&~this[n];return e.t=this.t,e.s=~this.s,e},t.prototype.shiftLeft=function(e){var n=r();return e<0?this.rShiftTo(-e,n):this.lShiftTo(e,n),n},t.prototype.shiftRight=function(e){var n=r();return e<0?this.lShiftTo(-e,n):this.rShiftTo(e,n),n},t.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+(function(n){if(n==0)return-1;var o=0;return!(65535&n)&&(n>>=16,o+=16),!(255&n)&&(n>>=8,o+=8),!(15&n)&&(n>>=4,o+=4),!(3&n)&&(n>>=2,o+=2),!(1&n)&&++o,o})(this[e]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var e=0,n=this.s&this.DM,o=0;o<this.t;++o)e+=(function(f){for(var v=0;f!=0;)f&=f-1,++v;return v})(this[o]^n);return e},t.prototype.testBit=function(e){var n=Math.floor(e/this.DB);return n>=this.t?this.s!=0:!!(this[n]&1<<e%this.DB)},t.prototype.setBit=function(e){return this.changeBit(e,tt)},t.prototype.clearBit=function(e){return this.changeBit(e,it)},t.prototype.flipBit=function(e){return this.changeBit(e,W)},t.prototype.add=function(e){var n=r();return this.addTo(e,n),n},t.prototype.subtract=function(e){var n=r();return this.subTo(e,n),n},t.prototype.multiply=function(e){var n=r();return this.multiplyTo(e,n),n},t.prototype.divide=function(e){var n=r();return this.divRemTo(e,n,null),n},t.prototype.remainder=function(e){var n=r();return this.divRemTo(e,null,n),n},t.prototype.divideAndRemainder=function(e){var n=r(),o=r();return this.divRemTo(e,n,o),new Array(n,o)},t.prototype.modPow=function(e,n){var o=e.bitLength(),f=w(1);if(o<=0)return f;var v=o<18?1:o<48?3:o<144?4:o<768?5:6,N=new(o<8?ot:n.isEven()?q:S)(n),B=new Array,L=3,xt=v-1,Kt=(1<<v)-1;if(B[1]=N.convert(this),1<v){var se=r();for(N.sqrTo(B[1],se);L<=Kt;)B[L]=r(),N.mulTo(se,B[L-2],B[L]),L+=2}var fe,Ie,Bt=e.t-1,ge=!0,qt=r();for(o=nt(e[Bt])-1;0<=Bt;){for(xt<=o?fe=e[Bt]>>o-xt&Kt:(fe=(e[Bt]&(1<<o+1)-1)<<xt-o,0<Bt&&(fe|=e[Bt-1]>>this.DB+o-xt)),L=v;!(1&fe);)fe>>=1,--L;if((o-=L)<0&&(o+=this.DB,--Bt),ge)B[fe].copyTo(f),ge=!1;else{for(;1<L;)N.sqrTo(f,qt),N.sqrTo(qt,f),L-=2;0<L?N.sqrTo(f,qt):(Ie=f,f=qt,qt=Ie),N.mulTo(qt,B[fe],f)}for(;0<=Bt&&!(e[Bt]&1<<o);)N.sqrTo(f,qt),Ie=f,f=qt,qt=Ie,--o<0&&(o=this.DB-1,--Bt)}return N.revert(f)},t.prototype.modInverse=function(e){var n=e.isEven();if(this.isEven()&&n||e.signum()==0)return t.ZERO;for(var o=e.clone(),f=this.clone(),v=w(1),N=w(0),B=w(0),L=w(1);o.signum()!=0;){for(;o.isEven();)o.rShiftTo(1,o),n?(v.isEven()&&N.isEven()||(v.addTo(this,v),N.subTo(e,N)),v.rShiftTo(1,v)):N.isEven()||N.subTo(e,N),N.rShiftTo(1,N);for(;f.isEven();)f.rShiftTo(1,f),n?(B.isEven()&&L.isEven()||(B.addTo(this,B),L.subTo(e,L)),B.rShiftTo(1,B)):L.isEven()||L.subTo(e,L),L.rShiftTo(1,L);0<=o.compareTo(f)?(o.subTo(f,o),n&&v.subTo(B,v),N.subTo(L,N)):(f.subTo(o,f),n&&B.subTo(v,B),L.subTo(N,L))}return f.compareTo(t.ONE)!=0?t.ZERO:0<=L.compareTo(e)?L.subtract(e):L.signum()<0?(L.addTo(e,L),L.signum()<0?L.add(e):L):L},t.prototype.pow=function(e){return this.exp(e,new lt)},t.prototype.gcd=function(e){var n=this.s<0?this.negate():this.clone(),o=e.s<0?e.negate():e.clone();n.compareTo(o)<0&&(v=n,n=o,o=v);var f=n.getLowestSetBit(),v=o.getLowestSetBit();if(v<0)return n;for(0<(v=f<v?f:v)&&(n.rShiftTo(v,n),o.rShiftTo(v,o));0<n.signum();)0<(f=n.getLowestSetBit())&&n.rShiftTo(f,n),0<(f=o.getLowestSetBit())&&o.rShiftTo(f,o),0<=n.compareTo(o)?(n.subTo(o,n),n.rShiftTo(1,n)):(o.subTo(n,o),o.rShiftTo(1,o));return 0<v&&o.lShiftTo(v,o),o},t.prototype.isProbablePrime=function(e){var n,o=this.abs();if(o.t==1&&o[0]<=Y[Y.length-1]){for(n=0;n<Y.length;++n)if(o[0]==Y[n])return!0;return!1}if(o.isEven())return!1;for(n=1;n<Y.length;){for(var f=Y[n],v=n+1;v<Y.length&&f<G;)f*=Y[v++];for(f=o.modInt(f);n<v;)if(f%Y[n++]==0)return!1}return o.millerRabin(e)},t.prototype.square=function(){var e=r();return this.squareTo(e),e},t.prototype.Barrett=q,gt==null){var gt=new Array,et=0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var It=new Uint8Array(32);for(window.crypto.getRandomValues(It),Mt=0;Mt<32;++Mt)gt[et++]=It[Mt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var Nt=window.crypto.random(32),Mt=0;Mt<Nt.length;++Mt)gt[et++]=255&Nt.charCodeAt(Mt)}for(;et<Xe;)Mt=Math.floor(65536*Math.random()),gt[et++]=Mt>>>8,gt[et++]=255&Mt;et=0,K()}function He(){if(X==null){for(K(),(X=new Ge).init(gt),et=0;et<gt.length;++et)gt[et]=0;et=0}return X.next()}function Ar(){}function Ge(){this.i=0,this.j=0,this.S=new Array}Ar.prototype.nextBytes=function(e){for(var n=0;n<e.length;++n)e[n]=He()},Ge.prototype.init=function(e){for(var n,o,f=0;f<256;++f)this.S[f]=f;for(f=n=0;f<256;++f)n=n+this.S[f]+e[f%e.length]&255,o=this.S[f],this.S[f]=this.S[n],this.S[n]=o;this.i=0,this.j=0},Ge.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var Xe=256;kt.exports={default:t,BigInteger:t,SecureRandom:Ar}}.call(T);var wt=Ht.exports.BigInteger,Pt=(function(){function t(){Q(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return D(t,[{key:"getEncodedHex",value:function(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}},{key:"getLength",value:function(){var r=this.v.length/2,s=r.toString(16);return s.length%2==1&&(s="0"+s),r<128?s:(128+s.length/2).toString(16)+s}},{key:"getValue",value:function(){return""}}]),t})(),ie=(function(){Z(r,Pt);var t=J(r);function r(s){var c;return Q(this,r),(c=t.call(this)).t="02",s&&(c.v=(function(d){if((p=d.toString(16))[0]!=="-")p.length%2==1?p="0"+p:p.match(/^[0-7]/)||(p="00"+p);else{var p,I=(p=p.substr(1)).length;I%2==1?I+=1:p.match(/^[0-7]/)||(I+=2);for(var C="",w=0;w<I;w++)C+="f";p=(p=(C=new wt(C,16)).xor(d).add(wt.ONE)).toString(16).replace(/^-/,"")}return p})(s)),c}return D(r,[{key:"getValue",value:function(){return this.v}}]),r})(),re=(function(){Z(r,Pt);var t=J(r);function r(s){var c;return Q(this,r),(c=t.call(this)).t="30",c.asn1Array=s,c}return D(r,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(s){return s.getEncodedHex()})).join(""),this.v}}]),r})();function jt(t,r){return+t[r+2]<8?1:128&+t.substr(r+2,2)}function ae(t,r){var s=jt(t,r);return(t=t.substr(r+2,2*s))?(+t[0]<8?new wt(t,16):new wt(t.substr(2),16)).intValue():-1}function ne(t,r){return r+2*(jt(t,r)+1)}var Lt=Ht.exports.BigInteger,Jt=new Lt("3"),pe=(function(){function t(r,s){Q(this,t),this.x=s,this.q=r}return D(t,[{key:"equals",value:function(r){return r===this||this.q.equals(r.q)&&this.x.equals(r.x)}},{key:"toBigInteger",value:function(){return this.x}},{key:"negate",value:function(){return new t(this.q,this.x.negate().mod(this.q))}},{key:"add",value:function(r){return new t(this.q,this.x.add(r.toBigInteger()).mod(this.q))}},{key:"subtract",value:function(r){return new t(this.q,this.x.subtract(r.toBigInteger()).mod(this.q))}},{key:"multiply",value:function(r){return new t(this.q,this.x.multiply(r.toBigInteger()).mod(this.q))}},{key:"divide",value:function(r){return new t(this.q,this.x.multiply(r.toBigInteger().modInverse(this.q)).mod(this.q))}},{key:"square",value:function(){return new t(this.q,this.x.square().mod(this.q))}}]),t})(),$t=(function(){function t(r,s,c,d){Q(this,t),this.curve=r,this.x=s,this.y=c,this.z=d==null?Lt.ONE:d,this.zinv=null}return D(t,[{key:"getX",value:function(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"getY",value:function(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"equals",value:function(r){return r===this||(this.isInfinity()?r.isInfinity():r.isInfinity()?this.isInfinity():!!r.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(r.z)).mod(this.curve.q).equals(Lt.ZERO)&&r.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(r.z)).mod(this.curve.q).equals(Lt.ZERO))}},{key:"isInfinity",value:function(){return this.x===null&&this.y===null||this.z.equals(Lt.ZERO)&&!this.y.toBigInteger().equals(Lt.ZERO)}},{key:"negate",value:function(){return new t(this.curve,this.x,this.y.negate(),this.z)}},{key:"add",value:function(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var s=this.x.toBigInteger(),c=this.y.toBigInteger(),d=this.z,p=r.x.toBigInteger(),I=r.y.toBigInteger(),C=r.z,w=this.curve.q,nt=s.multiply(C).mod(w);return r=p.multiply(d).mod(w),s=nt.subtract(r),p=c.multiply(C).mod(w),c=I.multiply(d).mod(w),I=p.subtract(c),Lt.ZERO.equals(s)?Lt.ZERO.equals(I)?this.twice():this.curve.infinity:(c=nt.add(r),r=d.multiply(C).mod(w),C=s.square().mod(w),d=s.multiply(C).mod(w),c=r.multiply(I.square()).subtract(c.multiply(C)).mod(w),s=s.multiply(c).mod(w),p=I.multiply(C.multiply(nt).subtract(c)).subtract(p.multiply(d)).mod(w),w=d.multiply(r).mod(w),new t(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(p),w))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var r=this.x.toBigInteger(),s=this.y.toBigInteger(),c=this.z,d=this.curve.q,p=this.curve.a.toBigInteger(),I=r.square().multiply(Jt).add(p.multiply(c.square())).mod(d),C=s.shiftLeft(1).multiply(c).mod(d),w=(p=(w=s.square().mod(d)).multiply(r).multiply(c).mod(d),s=C.square().mod(d),r=I.square().subtract(p.shiftLeft(3)).mod(d),c=C.multiply(r).mod(d),I.multiply(p.shiftLeft(2).subtract(r)).subtract(s.shiftLeft(1).multiply(w)).mod(d));return d=C.multiply(s).mod(d),new t(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(w),d)}},{key:"multiply",value:function(r){if(this.isInfinity())return this;if(!r.signum())return this.curve.infinity;for(var s=r.multiply(Jt),c=this.negate(),d=this,p=s.bitLength()-2;0<p;p--){d=d.twice();var I=s.testBit(p);I!==r.testBit(p)&&(d=d.add(I?this:c))}return d}}]),t})(),Ot=(function(){function t(r,s,c){Q(this,t),this.q=r,this.a=this.fromBigInteger(s),this.b=this.fromBigInteger(c),this.infinity=new $t(this,null,null)}return D(t,[{key:"equals",value:function(r){return r===this||this.q.equals(r.q)&&this.a.equals(r.a)&&this.b.equals(r.b)}},{key:"fromBigInteger",value:function(r){return new pe(this.q,r)}},{key:"decodePointHex",value:function(r){switch(parseInt(r.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:default:return null;case 4:case 6:case 7:var s=(r.length-2)/2,c=r.substr(2,s);return s=r.substr(2+s,s),new $t(this,this.fromBigInteger(new Lt(c,16)),this.fromBigInteger(new Lt(s,16)))}}}]),t})(),Ut={ECPointFp:$t,ECCurveFp:Ot},Zt=Ht.exports.BigInteger,ce=(Ot=Ht.exports.SecureRandom,Ut.ECCurveFp),le=new Ot,te=(Ut=y()).curve,h=Ut.G,l=Ut.n;function y(){var t=new Zt("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),r=new Zt("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),s=new Zt("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return s=(r=new ce(t,r,s)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:r,G:s,n:new Zt("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function x(t,r){return t.length>=r?t:new Array(r-t.length+1).join("0")+t}function A(t,r){for(var s=[],c=~~(r/8),d=r%8,p=0,I=t.length;p<I;p++)s[p]=(t[(p+c)%I]<<d&255)+(t[(p+c+1)%I]>>>8-d&255);return s}function M(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=255&(t[c]^r[c]);return s}function rt(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=t[c]&r[c]&255;return s}function mt(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=255&(t[c]|r[c]);return s}function pt(t,r){for(var s=[],c=0,d=t.length-1;0<=d;d--){var p=t[d]+r[d]+c;c=255<p?1:0,s[d]=255&p}return s}function Gt(t,r,s,c){return 0<=c&&c<=15?M(M(t,r),s):mt(rt(t,r),rt((function(d){for(var p=[],I=d.length-1;0<=I;I--)p[I]=255&~d[I];return p})(t),s))}function Qt(t,r){for(var s=[],c=[],d=0;d<16;d++){var p=4*d;s.push(r.slice(p,4+p))}for(var I,C=16;C<68;C++)s.push(M(M((I=M(M(s[C-16],s[C-9]),A(s[C-3],15)),M(M(I,A(I,15)),A(I,23))),A(s[C-13],7)),s[C-6]));for(var w=0;w<64;w++)c.push(M(s[w],s[w+4]));for(var nt,ot,S,H=[121,204,69,25],tt=[122,135,157,138],W=t.slice(0,4),it=t.slice(4,8),lt=t.slice(8,12),Ct=t.slice(12,16),q=t.slice(16,20),X=t.slice(20,24),Y=t.slice(24,28),G=t.slice(28,32),K=0;K<64;K++){var gt=0<=K&&K<=15?H:tt,et=M(It=A(pt(pt(A(W,12),q),A(gt,K)),7),A(W,12)),It=(et=pt(pt(pt((nt=W,ot=it,S=lt,0<=(gt=K)&&gt<=15?M(M(nt,ot),S):mt(mt(rt(nt,ot),rt(nt,S)),rt(ot,S))),Ct),et),c[K]),pt(pt(pt(Gt(q,X,Y,K),G),It),s[K]));Ct=lt,lt=A(it,9),it=W,W=et,G=Y,Y=A(X,19),X=q,q=M(M(It,A(It,9)),A(It,17))}return M([].concat(W,it,lt,Ct,q,X,Y,G),t)}Ot={getGlobalCurve:function(){return te},generateEcparam:y,generateKeyPairHex:function(t,r,s){return{privateKey:s=x((r=(t?new Zt(t,r,s):new Zt(l.bitLength(),le)).mod(l.subtract(Zt.ONE)).add(Zt.ONE)).toString(16),64),publicKey:"04"+x((r=h.multiply(r)).getX().toBigInteger().toString(16),64)+x(r.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(t){for(var r=(t=unescape(encodeURIComponent(t))).length,s=[],c=0;c<r;c++)s[c>>>2]|=(255&t.charCodeAt(c))<<24-c%4*8;for(var d=[],p=0;p<r;p++){var I=s[p>>>2]>>>24-p%4*8&255;d.push((I>>>4).toString(16)),d.push((15&I).toString(16))}return d.join("")},leftPad:x,arrayToHex:function(t){return t.map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},arrayToUtf8:function(t){for(var r=[],s=0,c=0;c<2*t.length;c+=2)r[c>>>3]|=parseInt(t[s],10)<<24-c%8*4,s++;try{for(var d=[],p=0;p<t.length;p++){var I=r[p>>>2]>>>24-p%4*8&255;d.push(String.fromCharCode(I))}return decodeURIComponent(escape(d.join("")))}catch(C){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){for(var r=[],s=(t=(s=t.length)%2!=0?x(t,s+1):t).length,c=0;c<s;c+=2)r.push(parseInt(t.substr(c,2),16));return r},verifyPublicKey:function(t){var r=te.decodePointHex(t);return!!r&&(t=r.getX(),r.getY().square().equals(t.multiply(t.square()).add(t.multiply(te.a)).add(te.b)))}},Ut=function(t){for(var r=448<=(r=(C=8*t.length)%512)?512-r%448-1:448-r-1,s=new Array((r-7)/8),c=0,d=s.length;c<d;c++)s[c]=0;for(var p,I=[],C=C.toString(2),w=7;0<=w;w--)8<C.length?(p=C.length-8,I[w]=parseInt(C.substr(p),2),C=C.substr(0,p)):0<C.length?(I[w]=parseInt(C,2),C=""):I[w]=0;for(var nt=[].concat(t,[128],s,I),ot=nt.length/64,S=[115,128,22,111,73,20,178,185,23,36,66,215,218,138,6,0,169,111,48,188,22,49,56,170,227,141,238,77,176,251,14,78],H=0;H<ot;H++){var tt=64*H;S=Qt(S,nt.slice(tt,64+tt))}return S};var Et=Ht.exports.BigInteger,Qr=function(t,r){return t=new ie(t),r=new ie(r),new re([t,r]).getEncodedHex()},Zr=function(t){var r=ne(t,0),s=ne(t,r),c=ae(t,r);return r=t.substr(s,2*c),s=ne(t,c=s+r.length),c=ae(t,c),t=t.substr(s,2*c),{r:new wt(r,16),s:new wt(t,16)}},ct=Ot,Ae=Ut,De=(Ot=ct.generateEcparam()).G,yr=Ot.curve,Re=Ot.n;function gr(t,r,s){var c=2<arguments.length&&s!==void 0?s:"1234567812345678",d=(c=ct.utf8ToHex(c),ct.leftPad(De.curve.a.toBigInteger().toRadix(16),64)),p=ct.leftPad(De.curve.b.toBigInteger().toRadix(16),64),I=ct.leftPad(De.getX().toBigInteger().toRadix(16),64),C=ct.leftPad(De.getY().toBigInteger().toRadix(16),64);return s=(r=128<r.length?r.substr(2,128):r).substr(0,64),r=r.substr(64,64),r=ct.hexToArray(c+d+p+I+C+s+r),c=4*c.length,r.unshift(255&c),r.unshift(c>>8&255),r=Ae(r),ct.arrayToHex(Ae(r.concat(ct.hexToArray(t))))}function mr(){var t=ct.generateKeyPairHex(),r=yr.decodePointHex(t.publicKey);return t.k=new Et(t.privateKey,16),t.x1=r.getX().toBigInteger(),t}Ot={generateKeyPairHex:ct.generateKeyPairHex,doEncrypt:function(t,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;t=typeof t=="string"?ct.hexToArray(ct.utf8ToHex(t)):Array.prototype.slice.call(t),r=ct.getGlobalCurve().decodePointHex(r);var c=ct.generateKeyPairHex(),d=new Et(c.privateKey,16),p=c.publicKey;128<p.length&&(p=p.substr(p.length-128)),c=r.multiply(d),d=ct.hexToArray(ct.leftPad(c.getX().toBigInteger().toRadix(16),64)),r=ct.hexToArray(ct.leftPad(c.getY().toBigInteger().toRadix(16),64)),c=ct.arrayToHex(Ae([].concat(d,t,r)));var I,C=1,w=0,nt=[],ot=[].concat(d,r);(I=function(){nt=Ae([].concat(St(ot),[C>>24&255,C>>16&255,C>>8&255,255&C])),C++,w=0})();for(var S=0,H=t.length;S<H;S++)w===nt.length&&I(),t[S]^=255&nt[w++];return r=ct.arrayToHex(t),s===0?p+r+c:p+c+r},doDecrypt:function(t,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,c=(p=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":p;r=new Et(r,16);var d=t.substr(128,64),p=t.substr(192);s===0&&(d=t.substr(t.length-64),p=t.substr(128,t.length-128-64));var I,C=ct.hexToArray(p),w=(t=ct.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(r),r=ct.hexToArray(ct.leftPad(t.getX().toBigInteger().toRadix(16),64)),t=ct.hexToArray(ct.leftPad(t.getY().toBigInteger().toRadix(16),64)),1),nt=0,ot=[],S=[].concat(r,t);(I=function(){ot=Ae([].concat(St(S),[w>>24&255,w>>16&255,w>>8&255,255&w])),w++,nt=0})();for(var H=0,tt=C.length;H<tt;H++)nt===ot.length&&I(),C[H]^=255&ot[nt++];return ct.arrayToHex(Ae([].concat(r,C,t)))===d?c==="array"?C:ct.arrayToUtf8(C):c==="array"?[]:""},doSignature:function(t,r){var s=(C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,c=C.der,d=C.hash,p=C.publicKey,I=C.userId,C=typeof t=="string"?ct.utf8ToHex(t):ct.arrayToHex(t);d&&(C=gr(C,p||(t=r,d=De.multiply(new Et(t,16)),"04"+(t=ct.leftPad(d.getX().toBigInteger().toString(16),64))+(d=ct.leftPad(d.getY().toBigInteger().toString(16),64))),I));var w=new Et(r,16),nt=new Et(C,16),ot=null,S=null,H=null;do do{var tt;ot=(tt=s&&s.length?s.pop():mr()).k,S=nt.add(tt.x1).mod(Re)}while(S.equals(Et.ZERO)||S.add(ot).equals(Re));while((H=w.add(Et.ONE).modInverse(Re).multiply(ot.subtract(S.multiply(w))).mod(Re)).equals(Et.ZERO));return c?Qr(S,H):ct.leftPad(S.toString(16),64)+ct.leftPad(H.toString(16),64)},doVerifySignature:function(t,r,s){var c,d,p=(C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,I=C.hash,C=C.userId;return t=typeof t=="string"?ct.utf8ToHex(t):ct.arrayToHex(t),I&&(t=gr(t,s,C)),d=p?(c=(d=Zr(r)).r,d.s):(c=new Et(r.substring(0,64),16),new Et(r.substring(64),16)),r=yr.decodePointHex(s),s=new Et(t,16),!(t=c.add(d).mod(Re)).equals(Et.ZERO)&&(r=De.multiply(d).add(r.multiply(t)),s=s.add(r.getX().toBigInteger()).mod(Re),c.equals(s))},getPoint:mr,verifyPublicKey:ct.verifyPublicKey};var tn=Ut,Ne=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],xe=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function Ve(t){for(var r=[],s=0,c=t.length;s<c;s+=2)r.push(parseInt(t.substr(s,2),16));return r}function Ee(t,r){return t<<r|t>>>32-r}function he(t){return(255&Ne[t>>>24&255])<<24|(255&Ne[t>>>16&255])<<16|(255&Ne[t>>>8&255])<<8|255&Ne[255&t]}function Fe(t){return t^Ee(t,2)^Ee(t,10)^Ee(t,18)^Ee(t,24)}function Le(t){return t^Ee(t,13)^Ee(t,23)}function _r(t,r,s,c){c=(p=(I=3<arguments.length&&c!==void 0?c:{}).padding)===void 0?"pkcs#5":p;var d=I.mode,p=(p=I.iv)===void 0?[]:p,I=(I=I.output)===void 0?"string":I;if(d==="cbc"&&(p=typeof p=="string"?Ve(p):p).length!==16)throw new Error("iv is invalid");if((r=typeof r=="string"?Ve(r):r).length!==16)throw new Error("key is invalid");if(t=(typeof t=="string"?s!==0?function(q){for(var X=[],Y=0,G=q.length;Y<G;Y++){var K=q.codePointAt(Y);if(K<=127)X.push(K);else if(K<=2047)X.push(192|K>>>6),X.push(128|63&K);else if(K<=55295||57344<=K&&K<=65535)X.push(224|K>>>12),X.push(128|K>>>6&63),X.push(128|63&K);else{if(!(65536<=K&&K<=1114111))throw X.push(K),new Error("input is not supported");Y++,X.push(240|K>>>18&28),X.push(128|K>>>12&63),X.push(128|K>>>6&63),X.push(128|63&K)}}return X}:Ve:St)(t),c==="pkcs#5"&&s!==0)for(var C=16-t.length%16,w=0;w<C;w++)t.push(C);var nt=new Array(32);(function(q,X,Y){for(var G=new Array(4),K=new Array(4),gt=0;gt<4;gt++)K[0]=255&q[0+4*gt],K[1]=255&q[1+4*gt],K[2]=255&q[2+4*gt],K[3]=255&q[3+4*gt],G[gt]=K[0]<<24|K[1]<<16|K[2]<<8|K[3];G[0]^=2746333894,G[1]^=1453994832,G[2]^=1736282519,G[3]^=2993693404;for(var et,It=0;It<32;It+=4)et=G[1]^G[2]^G[3]^xe[It+0],X[It+0]=G[0]^=Le(he(et)),et=G[2]^G[3]^G[0]^xe[It+1],X[It+1]=G[1]^=Le(he(et)),et=G[3]^G[0]^G[1]^xe[It+2],X[It+2]=G[2]^=Le(he(et)),et=G[0]^G[1]^G[2]^xe[It+3],X[It+3]=G[3]^=Le(he(et));if(Y===0)for(var Nt,Mt=0;Mt<16;Mt++)Nt=X[Mt],X[Mt]=X[31-Mt],X[31-Mt]=Nt})(r,nt,s);for(var ot=[],S=p,H=t.length,tt=0;16<=H;){var W=t.slice(tt,tt+16),it=new Array(16);if(d==="cbc")for(var lt=0;lt<16;lt++)s!==0&&(W[lt]^=S[lt]);(function(q,X,Y){for(var G=new Array(4),K=new Array(4),gt=0;gt<4;gt++)K[0]=255&q[4*gt],K[1]=255&q[4*gt+1],K[2]=255&q[4*gt+2],K[3]=255&q[4*gt+3],G[gt]=K[0]<<24|K[1]<<16|K[2]<<8|K[3];for(var et,It=0;It<32;It+=4)et=G[1]^G[2]^G[3]^Y[It+0],G[0]^=Fe(he(et)),et=G[2]^G[3]^G[0]^Y[It+1],G[1]^=Fe(he(et)),et=G[3]^G[0]^G[1]^Y[It+2],G[2]^=Fe(he(et)),et=G[0]^G[1]^G[2]^Y[It+3],G[3]^=Fe(he(et));for(var Nt=0;Nt<16;Nt+=4)X[Nt]=G[3-Nt/4]>>>24&255,X[Nt+1]=G[3-Nt/4]>>>16&255,X[Nt+2]=G[3-Nt/4]>>>8&255,X[Nt+3]=255&G[3-Nt/4]})(W,it,nt);for(var Ct=0;Ct<16;Ct++)d==="cbc"&&s===0&&(it[Ct]^=S[Ct]),ot[tt+Ct]=it[Ct];d==="cbc"&&(S=s!==0?it:W),H-=16,tt+=16}return c==="pkcs#5"&&s===0&&(c=ot[ot.length-1],ot.splice(ot.length-c,c)),I!=="array"?s!==0?ot.map((function(q){return(q=q.toString(16)).length===1?"0"+q:q})).join(""):(function(q){for(var X=[],Y=0,G=q.length;Y<G;Y++)240<=q[Y]&&q[Y]<=247?(X.push(String.fromCodePoint(((7&q[Y])<<18)+((63&q[Y+1])<<12)+((63&q[Y+2])<<6)+(63&q[Y+3]))),Y+=3):224<=q[Y]&&q[Y]<=239?(X.push(String.fromCodePoint(((15&q[Y])<<12)+((63&q[Y+1])<<6)+(63&q[Y+2]))),Y+=2):192<=q[Y]&&q[Y]<=223?(X.push(String.fromCodePoint(((31&q[Y])<<6)+(63&q[Y+1]))),Y++):X.push(String.fromCodePoint(q[Y]));return X.join("")})(ot):ot}var en=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],ye=[],rn=function(t,r,s){for(var c=t[0],d=t[1],p=t[2],I=t[3],C=t[4],w=t[5],nt=t[6],ot=t[7],S=0;S<64;S++){S<16?ye[S]=0|r[s+S]:(H=ye[S-15],tt=ye[S-2],ye[S]=((H<<25|H>>>7)^(H<<14|H>>>18)^H>>>3)+ye[S-7]+((tt<<15|tt>>>17)^(tt<<13|tt>>>19)^tt>>>10)+ye[S-16]);var H=c&d^c&p^d&p,tt=ot+((C<<26|C>>>6)^(C<<21|C>>>11)^(C<<7|C>>>25))+(C&w^~C&nt)+en[S]+ye[S];ot=nt,nt=w,w=C,C=I+tt|0,I=p,p=d,d=c,c=tt+(((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+H)|0}t[0]=t[0]+c|0,t[1]=t[1]+d|0,t[2]=t[2]+p|0,t[3]=t[3]+I|0,t[4]=t[4]+C|0,t[5]=t[5]+w|0,t[6]=t[6]+nt|0,t[7]=t[7]+ot|0},vr=(Ot={c2:Ot,c3:function(t){return t=typeof t=="string"?(function(r){for(var s=[],c=0,d=r.length;c<d;c++){var p=r.codePointAt(c);if(p<=127)s.push(p);else if(p<=2047)s.push(192|p>>>6),s.push(128|63&p);else if(p<=55295||57344<=p&&p<=65535)s.push(224|p>>>12),s.push(128|p>>>6&63),s.push(128|63&p);else{if(!(65536<=p&&p<=1114111))throw s.push(p),new Error("input is not supported");c++,s.push(240|p>>>18&28),s.push(128|p>>>12&63),s.push(128|p>>>6&63),s.push(128|63&p)}}return s})(t):Array.prototype.slice.call(t),tn(t).map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},c4:{encrypt:function(t,r,s){return _r(t,r,1,s)},decrypt:function(t,r,s){return _r(t,r,0,s)}},s2:function(t){var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],s=(function(d){for(var p=[],I=0;I<Math.ceil(d.length/4);I++)p[I]=d[4*I]<<24|(255&d[4*I+1])<<16|(255&d[4*I+2])<<8|255&d[4*I+3];return p})(t);s[(t=8*t.length)>>5]|=128<<24-t%32,s[15+(64+t>>9<<4)]=t;for(var c=0;c<s.length;c+=16)rn(r,s,c);return(function(d){for(var p=[],I=0;I<d.length;I++)p[4*I]=d[I]>>24&255,p[4*I+1]=d[I]>>16&255,p[4*I+2]=d[I]>>8&255,p[4*I+3]=255&d[I];return p})(r).map((function(d){return(d=d.toString(16)).length===1?"0"+d:d})).join("")}},vt),nn=yt,on=Dt,an=Yt,sn=zt,un=Ot.c2,cn=Ot.c3,ln=Ot.c4,fn=Ot.s2;return(function(){var t;(t=function(){}).VERSION="2.1.0";var r=T;if(r.AAR2)return r.AAR2.VERSION!==t.VERSION&&console.log(r.AAR2.VERSION),r.AAR2;var s="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",c=!1,d=!1,p=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,I=p!==void 0&&!!p.request&&!!p.login,C=function(S,H){return typeof S=="string"&&typeof H=="string"&&S!=null&&H!=null&&S.substring(0,H.length)===H},w={SUCCESS:0,ALREADY_SUCCESS:1,ERROR_XHR_TIMEOUT:-1,ERROR_XHR_ERROR:-2,ERROR_XXX_REQUEST_TIMEOUT:-3,ERROR_XXX_REQUEST_FAIL:-4,ERROR_SIGN_CHECK:-5,ERROR_UNKNOWN_ERROR:-6,ERROR_DATA_FORMAT:-7},nt=function(S){for(var H in w)if(w[H]===S)return H},ot=function(S,H,tt){var W=Date.now(),it=new t;try{if(!S||S.length<=75)return console.error("error format 1:",S),w.ERROR_DATA_FORMAT;if(!C(S,"eyJ"))return console.error("error format 2:",S),w.ERROR_DATA_FORMAT;S=S.substring(3,S.length);var lt=nn.my_b4_decode(S);if(!lt)return console.error("error format 3:",S),w.ERROR_DATA_FORMAT;var Ct,q=it.cc.u8.byteToInt(lt.slice(0,4),0),X=lt.slice(4,4+q),Y=it.cc.u8.byteToInt(lt.slice(4+q,4+q+4),0),G=lt.slice(4+q+4,4+q+4+Y),K=it.cc.u8.byteToInt(lt.slice(4+q+4+Y,4+q+4+Y+4),0),gt=lt.slice(4+q+4+Y+4,4+q+4+Y+4+K),et=it.cc.u8.bytesToUtf8Str(X);if(it.cc.h6.encode(G,0,Y),H||(tt!==void 0&&tt==="sm2"?(Ct=it.cc.h6.encode(G,0,Y),it.co.c2.doVerifySignature(et,Ct,s,{der:!0,hash:!0})):it.co.c3(et+"8890012345678890").toLowerCase()===it.cc.h6.encode(gt,0,K).toLowerCase())){if(et.length%2==0){t.prototype.__v=function(){return et.slice(0,2)};for(var It=[],Nt=2;Nt<66;Nt+=2)It.push(parseInt("0x"+et.slice(Nt,Nt+2)));t.prototype.__i=function(){return It};var Mt=parseInt("0x"+et.slice(66,82))-W;t.prototype.__o=function(){return Mt}}return I||T.AAR2||(T.AAR2=t),w.SUCCESS}}catch(He){return console.error(He),w.ERROR_UNKNOWN_ERROR}return w.ERROR_SIGN_CHECK};return t.init=function(S,H){var tt,W={debug:!1,url:"https://aks.jdpay.com/aar2/getJS",callback:function(){}};typeof S=="string"?(C(S,"https")||C(S,"https")?W.url=S:C(S,"eyJ")&&(W.code=S),typeof H=="string"&&(W.publicKey=H)):ht(S)==="object"&&(S.debug&&(W.debug=S.debug),S.url&&(W.url=S.url),S.code&&(W.code=S.code),S.publicKey&&(W.publicKey=S.publicKey),S.skipVerify&&(W.skipVerify=S.skipVerify),S.alg&&(W.alg=S.alg),S.callback&&typeof S.callback=="function"&&(W.callback=S.callback)),d?W.callback&&W.callback(!0,{errorNo:tt=w.ALREADY_SUCCESS,errorMsg:nt(tt)}):c?setTimeout((function(){t.init(S,H)}),50):(c=!0,W.debug&&vr.start(W.debug),W.publicKey&&(s=W.publicKey),W.code?(tt=ot(W.code,W.skipVerify))===w.SUCCESS?(c=!(d=!0),W.callback(!0,{errorNo:tt,errorMsg:nt(tt)})):W.callback(!1,{errorNo:tt,errorMsg:nt(tt)}):W.url&&(function(it,lt,Ct){try{if(it=it+"?version="+t.VERSION+(I?"&name=wechat":"&name=browser")+"&t="+Date.now(),I)p.request({url:it,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function(X){X.statusCode===200?lt(X.data):Ct(w.ERROR_XXX_REQUEST_FAIL)},fail:function(X){X&&X.errMsg&&X.errMsg.indexOf("timeout")!==-1?Ct(w.ERROR_XXX_REQUEST_TIMEOUT):Ct(w.ERROR_XXX_REQUEST_FAIL)}});else{var q;if(window.XMLHttpRequest)q=new XMLHttpRequest;else if(window.ActiveXObject)try{q=new ActiveXObject("Msxml2.XMLHTTP")}catch(X){try{q=new ActiveXObject("Microsoft.XMLHTTP")}catch(Y){}}q&&(q.onload=function(){q.readyState===4&&(q.status===200?lt(q.responseText):Ct(w.ERROR_XHR_ERROR))},q.ontimeout=function(){Ct(w.ERROR_XHR_TIMEOUT)},q.onerror=function(){Ct(w.ERROR_XHR_ERROR)},q.open("POST",it,!0),q.timeout=5e3,q.send(null))}}catch(X){console.error(X),Ct(w.ERROR_UNKNOWN_ERROR)}})(W.url,(function(it){(it=ot(it,W.skipVerify,W.alg))===w.SUCCESS?(c=!(d=!0),W.callback(!0,{errorNo:it,errorMsg:nt(it)})):(c=!1,W.callback(!1,{errorNo:it,errorMsg:nt(it)}))}),(function(it){c=!1,W.callback(!1,{errorNo:it,errorMsg:nt(it)})})))},t.prototype={cc:{b4:on,h6:an,u8:sn},co:{c2:un,c3:cn,c4:ln,s2:fn},nonce:function(){var S="0000000000"+Math.ceil(2147483647*Math.random())+Math.floor((Date.now()+this.__o())/1e3);return S.substring(S.length-20)},sign:function(S,H){return this.__s(S,H)},__s:function(S,H){var tt=this.cc.u8.utf8StrToBytes(S),W=this.__i();return S=this.cc.u8.utf8StrToBytes(H),H=this.cc.u8.utf8StrToBytes(this.__c()),S=[].concat(tt,W,S,H),H=parseInt("0x"+this.__v()),this.__f(H)(S)+this.__v()},__f:function(S){var H=this.co.s2,tt=this.co.c3,W=this.cc.h6.decode,it=[function(lt){return H(lt)},function(lt){return tt(lt)},function(lt){return tt(W(H(lt)))},function(lt){return H(W(tt(lt)))},function(lt){return tt(W(tt(lt)))},function(lt){return H(W(H(lt)))}];return it[(128<S?S-128:S)%it.length]},__i:function(){return[115,128,22,111,73,20,178,185,23,36,66,215,218,138,6,0,169,111,48,188,22,49,56,170,227,141,238,77,176,251,14,78]},__v:function(){return"00"},__c:function(){if(this.__d())return"debug";if(typeof phantom!="undefined"&&phantom.exit&&phantom.injectJs)return"phantom";if(typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]"&&process.version&&process.pid&&process.argv)return"require";if(p!==void 0&&p.env&&p.request&&p.getStorage){if(typeof window!="undefined"&&window.document&&window.alert&&window.atob&&typeof window.setTimeout=="function")return"window"}else{if(!(typeof window!="undefined"&&window.document&&window.alert&&window.atob&&typeof window.setTimeout=="function"))return"window";if(!window.navigator||typeof window.navigator.vendor!="string")return"navigator";if(window.navigator.webdriver)return"webdriver"}return""},__o:function(){return 0},__d:function(){return vr.isDebug()},version:function(){return t.VERSION}},t})()},Rt(R)=="object"?g.exports=at():($=typeof(k=at)=="function"?k.call(R,E,R,g):k)===void 0||(g.exports=$)}},a={};function u(g){var R=a[g];if(R!==void 0)return R.exports;var E=a[g]={id:g,loaded:!1,exports:{}};return i[g].call(E.exports,E,E.exports,u),E.loaded=!0,E.exports}u.n=g=>{var R=g&&g.__esModule?()=>g.default:()=>g;return u.d(R,{a:R}),R},u.d=(g,R)=>{for(var E in R)u.o(R,E)&&!u.o(g,E)&&Object.defineProperty(g,E,{enumerable:!0,get:R[E]})},u.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(g){if(typeof window=="object")return window}})(),u.hmd=g=>((g=Object.create(g)).children||(g.children=[]),Object.defineProperty(g,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+g.id)}}),g),u.o=(g,R)=>Object.prototype.hasOwnProperty.call(g,R),u.r=g=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(g,"__esModule",{value:!0})};var _=u(737);Mr.exports.LyyGetCommandSDK=_})()});var Kn={};Me(Kn,{DyErrorCode:()=>_e,DyErrorMessage:()=>Wt,ENV_TYPE:()=>Xt,EXTERNAL_ENV_TYPE:()=>ue,JdErrorCode:()=>Je,JdErrorMessage:()=>Tt,createServices:()=>$r,getDisplayAdConfig:()=>dr,getDyPayRtaData:()=>cr,handleDyPayFlow:()=>ur,handleJdInsurance:()=>or,handleJdInsuranceExt:()=>ir,handleJdjrCashLoanExt:()=>nr,handleJdjrCashLoanFlow:()=>rr,normalizeDisplayAdData:()=>Ye});module.exports=vn(Kn);var Xt={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},ue={SIT:"sit",RELEASE:"release",PROD:"prod"},qe={[Xt.DEV]:"https://dm.leyaoyao.com",[Xt.SIT]:"https://sm.leyaoyao.com",[Xt.UAT]:"https://um.leyaoyao.com",[Xt.PROD]:"https://m.leyaoyao.com"},Er={[Xt.DEV]:"https://dad2.leyaoyao.com",[Xt.SIT]:"https://sad2.leyaoyao.com",[Xt.UAT]:"https://uad2.leyaoyao.com",[Xt.PROD]:"https://nad.ehuoke.com"},we={[ue.SIT]:"https://sopenapi.leyaoyao.com",[ue.RELEASE]:"https://uopen-api.leyaoyao.com",[ue.PROD]:"https://api-gateway.leyaoyao.com"};function Be(i,a){return`${qe[i]||qe[Xt.PROD]}${a}`}function Ir(i){return Er[i]||Er[Xt.PROD]}var be={debug:!1,env:Xt.PROD,externalEnv:ue.PROD,apiDomain:""},br=bt({},be);function Sr(i){br=bt(bt({},be),i)}function de(){return br}var An=Object.defineProperty,Dn=(i,a,u)=>a in i?An(i,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[a]=u,Rn=(i,a,u)=>Dn(i,typeof a!="symbol"?a+"":a,u);function ee(){return typeof Taro!="undefined"&&Taro.getEnv?"taro":typeof uni!="undefined"&&uni.request?"uni":typeof wx!="undefined"&&wx.request?"wechat":typeof my!="undefined"&&my.request?"alipay":typeof window!="undefined"?"web":"unknown"}var En=class{constructor(i=!1){Rn(this,"enable"),this.enable=i}setEnable(i){this.enable=i}info(...i){this.enable&&console.info("[BI Info]",...i)}warn(...i){this.enable&&console.warn("[BI Warn]",...i)}error(...i){this.enable&&console.error("[BI Error]",...i)}debug(...i){this.enable&&console.log("[BI Debug]",...i)}},U=new En;function ze(i){let a=ee();return a==="taro"?Taro.setClipboardData({data:i}).then(()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):a==="uni"?new Promise((u,_)=>{uni.setClipboardData({data:i,success:()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{U.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),_(g)}})}):a==="wechat"?new Promise((u,_)=>{wx.setClipboardData({data:i,success:()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{U.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),_(g)}})}):a==="alipay"?new Promise((u,_)=>{my.setClipboardData({text:i,success:()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{U.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),_(g)}})}):navigator.clipboard.writeText(i).then(()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function $e(i,a=2e3){let u=ee();if(u==="taro"){Taro.showToast({title:i,icon:"none",mask:!0,duration:a});return}if(u==="uni"){uni.showToast({title:i,icon:"none",mask:!0,duration:a});return}if(u==="wechat"){wx.showToast({title:i,icon:"none",mask:!0,duration:a});return}if(u==="alipay"){my.showToast({content:i,duration:a});return}typeof console!="undefined"&&console.log(`[Toast] ${i}`)}async function me(){var i,a,u,_,g;let R=ee();try{if(R==="taro")return((i=(await Taro.getSystemInfo()).platform)==null?void 0:i.toLowerCase())==="ios"?"ios":"android";if(R==="uni")return((a=uni.getSystemInfoSync().platform)==null?void 0:a.toLowerCase())==="ios"?"ios":"android";if(R==="wechat")return wx.getDeviceInfo?((u=(await wx.getDeviceInfo()).platform)==null?void 0:u.toLowerCase())==="ios"?"ios":"android":((_=wx.getSystemInfoSync().platform)==null?void 0:_.toLowerCase())==="ios"?"ios":"android";if(R==="alipay")return((g=my.getSystemInfoSync().platform)==null?void 0:g.toLowerCase())==="ios"?"ios":"android";if(typeof navigator!="undefined"){let E=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(E))return"ios";if(/android/.test(E))return"android"}return"unknown"}catch(E){return U.error("\u83B7\u53D6\u5E73\u53F0\u4FE1\u606F\u5931\u8D25",E),"unknown"}}var Ft={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function z(i,a,u=null){return{code:i,message:a,data:u}}function ke(i,a){return i==null?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof i=="string"&&i.trim().length===0?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function Pe(i,a){for(let u of a){let _=ke(i[u],u);if(!_.valid)return _}return{valid:!0}}var ar={};Me(ar,{handleJdInsurance:()=>or,handleJdInsuranceExt:()=>ir,handleJdjrCashLoanExt:()=>nr,handleJdjrCashLoanFlow:()=>rr});var Je=(J=>(J[J.JD_CASH_LOAN__MISSING_PHONE=2001]="JD_CASH_LOAN__MISSING_PHONE",J[J.JD_CASH_LOAN__MISSING_DEVICE_ID=2002]="JD_CASH_LOAN__MISSING_DEVICE_ID",J[J.JD_CASH_LOAN__RTA_FAILED=2003]="JD_CASH_LOAN__RTA_FAILED",J[J.JD_CASH_LOAN__GET_CONFIG_FAILED=2004]="JD_CASH_LOAN__GET_CONFIG_FAILED",J[J.JD_CASH_LOAN__INVALID_CONFIG=2005]="JD_CASH_LOAN__INVALID_CONFIG",J[J.JD_CASH_LOAN__EXT_NOT_ELIGIBLE=2006]="JD_CASH_LOAN__EXT_NOT_ELIGIBLE",J[J.JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS=2007]="JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS",J[J.JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM=2008]="JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM",J[J.JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID=2009]="JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID",J[J.JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE=2010]="JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE",J[J.JD_INSURANCE__USER_NOT_ELIGIBLE=2101]="JD_INSURANCE__USER_NOT_ELIGIBLE",J[J.JD_INSURANCE__H5_NOT_SUPPORTED=2102]="JD_INSURANCE__H5_NOT_SUPPORTED",J[J.JD_INSURANCE__INVALID_JUMP_PARAMS=2103]="JD_INSURANCE__INVALID_JUMP_PARAMS",J[J.JD_INSURANCE__GET_CONFIG_FAILED=2104]="JD_INSURANCE__GET_CONFIG_FAILED",J[J.JD_INSURANCE__COPY_FAILED=2105]="JD_INSURANCE__COPY_FAILED",J[J.JD_INSURANCE__TASK_COMPLETED=2106]="JD_INSURANCE__TASK_COMPLETED",J[J.JD_INSURANCE__UNKNOWN_JUMP_MODE=2107]="JD_INSURANCE__UNKNOWN_JUMP_MODE",J[J.JD_INSURANCE__RTA_FAILED=2108]="JD_INSURANCE__RTA_FAILED",J))(Je||{}),Tt={2001:"\u7F3A\u5C11\u624B\u673A\u53F7\u53C2\u6570",2002:"\u7F3A\u5C11\u8BBE\u5907ID",2003:"\u672A\u6EE1\u8DB3\u6D3B\u52A8\u8D44\u683C",2004:"\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E\u5931\u8D25",2005:"\u8DF3\u8F6C\u914D\u7F6E\u53C2\u6570\u5F02\u5E38",2006:"\u7528\u6237\u4E0D\u7B26\u5408\u6D3B\u52A8\u53C2\u4E0E\u6761\u4EF6",2007:"\u8DF3\u8F6C\u53C2\u6570\u5F02\u5E38",2008:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u5E73\u53F0\u53C2\u6570",2009:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u7528\u6237ID",2010:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u8BBE\u5907\u503C",2101:"\u7528\u6237\u4E0D\u7B26\u5408\u6D3B\u52A8\u53C2\u4E0E\u6761\u4EF6",2102:"H5\u6A21\u5F0F\u6682\u4E0D\u652F\u6301",2103:"\u8DF3\u8F6C\u53C2\u6570\u5F02\u5E38",2104:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u5931\u8D25",2105:"\u590D\u5236\u53E3\u4EE4\u5931\u8D25",2106:"\u7528\u6237\u5DF2\u5B8C\u6210\u4EFB\u52A1",2107:"\u672A\u77E5\u8DF3\u8F6C\u6A21\u5F0F",2108:"RTA\u6821\u9A8C\u5931\u8D25"},_e=(F=>(F[F.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",F[F.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",F[F.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",F[F.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",F[F.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",F[F.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",F[F.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",F[F.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",F[F.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",F[F.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",F[F.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",F[F.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",F[F.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",F[F.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",F[F.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",F[F.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",F[F.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",F))(_e||{}),Wt={3001:"\u7F3A\u5C11\u624B\u673A\u53F7\u53C2\u6570",3002:"\u7F3A\u5C11\u8BBE\u5907ID\u53C2\u6570",3003:"\u7F3A\u5C11\u5957\u9910\u91D1\u989D\u53C2\u6570",3004:"\u65E0\u6548\u7684\u5BA2\u6237\u7AEF\u7C7B\u578B",3005:"\u4E1A\u52A1\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E",3006:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u5931\u8D25",3007:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u8BF7\u6C42\u5931\u8D25",3008:"\u7EDF\u4E00\u4E0B\u5355\u5931\u8D25",3009:"\u7EDF\u4E00\u4E0B\u5355\u8BF7\u6C42\u5931\u8D25",3010:"\u83B7\u53D6\u8DF3\u8F6C\u5730\u5740\u5931\u8D25",3011:"\u7F51\u7EDC\u8BF7\u6C42\u5F02\u5E38",3012:"\u4E0B\u5355\u6D41\u7A0B\u5F02\u5E38",3013:"\u83B7\u53D6RTA\u4FE1\u606F\u5931\u8D25",3014:"\u83B7\u53D6RTA\u4FE1\u606F\u8BF7\u6C42\u5931\u8D25",3015:"\u83B7\u53D6RTA\u4FE1\u606F\u5F02\u5E38",3016:"\u65E0\u6548\u7684\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u65B9\u5F0F",3017:"\u7F3A\u5C11\u4E1A\u52A1\u7C7B\u578B\u53C2\u6570"};var In=(i,a,u,_)=>{let g=ee();if(g==="taro")return Taro.request({url:i,method:a,data:u,header:_}).then(k=>k);if(g==="uni")return new Promise((k,$)=>{uni.request({url:i,method:a,data:u,header:_,success:at=>k(at),fail:at=>$(at)})});if(g==="wechat")return new Promise((k,$)=>{wx.request({url:i,method:a,data:u,header:_,success:at=>k(at),fail:at=>$(at)})});if(g==="alipay")return new Promise((k,$)=>{my.request({url:i,method:a,data:u,headers:_,success:at=>k(at),fail:at=>$(at)})});let R=a.toUpperCase()==="GET",E=R&&u&&Object.keys(u).length?`${i}?${new URLSearchParams(u).toString()}`:i;return fetch(E,{method:a,headers:_,body:R?void 0:JSON.stringify(u)}).then(async k=>({statusCode:k.status,data:await k.json()}))},Qe=class{constructor(a=null){je(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||de()||be}async getAuthToken(){let a=this.getCurrentConfig();if(a.getAuthToken&&typeof a.getAuthToken=="function")try{let u=await a.getAuthToken();return u?(U.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),u):(U.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(u){return U.error("\u83B7\u53D6Token\u5931\u8D25",u),null}return null}async buildHeader(a={},u=!0){let _=bt({"content-type":"application/json"},a);if(!u)return _;let g=await this.getAuthToken();if(!g)throw{code:"AUTH_TOKEN_REQUIRED",message:"\u5F53\u524D\u63A5\u53E3\u9700\u8981 token\uFF0C\u8BF7\u5728\u7528\u6237\u767B\u5F55\u6210\u529F\u540E\u8C03\u7528 nova.setToken(token) \u6216 \u76F4\u63A5createServices\u65F6\u4F20\u5165getAuthToken"};return _.Authorization_bar=g,_}async request(a){let{path:u,method:_="POST",data:g={},header:R={},authRequired:E=!0,baseDomain:k,beforeRequest:$,afterResponse:at}=a,Rt=k?`${k}${u}`:Be(this.getCurrentConfig().env||"prod",u),ht=await this.buildHeader(R,E);$&&typeof $=="function"&&await $({url:Rt,method:_,data:g,header:ht}),U.info(`\u53D1\u8D77${_}\u8BF7\u6C42:`,{path:u,method:_});try{let Q=await In(Rt,_,g,ht);return U.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:Q.statusCode}),at&&typeof at=="function"&&await at(Q.data),Q.data}catch(Q){throw U.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:Q}),Q}}get(a,u={},_={}){return this.request(bt({path:a,method:"GET",data:u},_))}post(a,u={},_={}){return this.request(bt({path:a,method:"POST",data:u},_))}},Se=(i=null)=>new Qe(i);var bn=(function(){"use strict";function i(D,Z){var dt=(65535&D)+(65535&Z);return(D>>16)+(Z>>16)+(dt>>16)<<16|65535&dt}function a(D,Z,dt,F,J,St){return i((St=i(i(Z,D),i(F,St)))<<J|St>>>32-J,dt)}function u(D,Z,dt,F,J,St,b){return a(Z&dt|~Z&F,D,Z,J,St,b)}function _(D,Z,dt,F,J,St,b){return a(Z&F|dt&~F,D,Z,J,St,b)}function g(D,Z,dt,F,J,St,b){return a(Z^dt^F,D,Z,J,St,b)}function R(D,Z,dt,F,J,St,b){return a(dt^(Z|~F),D,Z,J,St,b)}function E(D,Z){var dt,F,J,St;D[Z>>5]|=128<<Z%32,D[14+(Z+64>>>9<<4)]=Z;for(var b=1732584193,T=-271733879,O=-1732584194,P=271733878,m=0;m<D.length;m+=16)b=u(dt=b,F=T,J=O,St=P,D[m],7,-680876936),P=u(P,b,T,O,D[m+1],12,-389564586),O=u(O,P,b,T,D[m+2],17,606105819),T=u(T,O,P,b,D[m+3],22,-1044525330),b=u(b,T,O,P,D[m+4],7,-176418897),P=u(P,b,T,O,D[m+5],12,1200080426),O=u(O,P,b,T,D[m+6],17,-1473231341),T=u(T,O,P,b,D[m+7],22,-45705983),b=u(b,T,O,P,D[m+8],7,1770035416),P=u(P,b,T,O,D[m+9],12,-1958414417),O=u(O,P,b,T,D[m+10],17,-42063),T=u(T,O,P,b,D[m+11],22,-1990404162),b=u(b,T,O,P,D[m+12],7,1804603682),P=u(P,b,T,O,D[m+13],12,-40341101),O=u(O,P,b,T,D[m+14],17,-1502002290),b=_(b,T=u(T,O,P,b,D[m+15],22,1236535329),O,P,D[m+1],5,-165796510),P=_(P,b,T,O,D[m+6],9,-1069501632),O=_(O,P,b,T,D[m+11],14,643717713),T=_(T,O,P,b,D[m],20,-373897302),b=_(b,T,O,P,D[m+5],5,-701558691),P=_(P,b,T,O,D[m+10],9,38016083),O=_(O,P,b,T,D[m+15],14,-660478335),T=_(T,O,P,b,D[m+4],20,-405537848),b=_(b,T,O,P,D[m+9],5,568446438),P=_(P,b,T,O,D[m+14],9,-1019803690),O=_(O,P,b,T,D[m+3],14,-187363961),T=_(T,O,P,b,D[m+8],20,1163531501),b=_(b,T,O,P,D[m+13],5,-1444681467),P=_(P,b,T,O,D[m+2],9,-51403784),O=_(O,P,b,T,D[m+7],14,1735328473),b=g(b,T=_(T,O,P,b,D[m+12],20,-1926607734),O,P,D[m+5],4,-378558),P=g(P,b,T,O,D[m+8],11,-2022574463),O=g(O,P,b,T,D[m+11],16,1839030562),T=g(T,O,P,b,D[m+14],23,-35309556),b=g(b,T,O,P,D[m+1],4,-1530992060),P=g(P,b,T,O,D[m+4],11,1272893353),O=g(O,P,b,T,D[m+7],16,-155497632),T=g(T,O,P,b,D[m+10],23,-1094730640),b=g(b,T,O,P,D[m+13],4,681279174),P=g(P,b,T,O,D[m],11,-358537222),O=g(O,P,b,T,D[m+3],16,-722521979),T=g(T,O,P,b,D[m+6],23,76029189),b=g(b,T,O,P,D[m+9],4,-640364487),P=g(P,b,T,O,D[m+12],11,-421815835),O=g(O,P,b,T,D[m+15],16,530742520),b=R(b,T=g(T,O,P,b,D[m+2],23,-995338651),O,P,D[m],6,-198630844),P=R(P,b,T,O,D[m+7],10,1126891415),O=R(O,P,b,T,D[m+14],15,-1416354905),T=R(T,O,P,b,D[m+5],21,-57434055),b=R(b,T,O,P,D[m+12],6,1700485571),P=R(P,b,T,O,D[m+3],10,-1894986606),O=R(O,P,b,T,D[m+10],15,-1051523),T=R(T,O,P,b,D[m+1],21,-2054922799),b=R(b,T,O,P,D[m+8],6,1873313359),P=R(P,b,T,O,D[m+15],10,-30611744),O=R(O,P,b,T,D[m+6],15,-1560198380),T=R(T,O,P,b,D[m+13],21,1309151649),b=R(b,T,O,P,D[m+4],6,-145523070),P=R(P,b,T,O,D[m+11],10,-1120210379),O=R(O,P,b,T,D[m+2],15,718787259),T=R(T,O,P,b,D[m+9],21,-343485551),b=i(b,dt),T=i(T,F),O=i(O,J),P=i(P,St);return[b,T,O,P]}function k(D){for(var Z="",dt=32*D.length,F=0;F<dt;F+=8)Z+=String.fromCharCode(D[F>>5]>>>F%32&255);return Z}function $(D){var Z=[];for(Z[(D.length>>2)-1]=void 0,F=0;F<Z.length;F+=1)Z[F]=0;for(var dt=8*D.length,F=0;F<dt;F+=8)Z[F>>5]|=(255&D.charCodeAt(F/8))<<F%32;return Z}function at(D){for(var Z,dt="0123456789abcdef",F="",J=0;J<D.length;J+=1)Z=D.charCodeAt(J),F+=dt.charAt(Z>>>4&15)+dt.charAt(15&Z);return F}function Rt(D){return unescape(encodeURIComponent(D))}function ht(D){return k(E($(D=Rt(D)),8*D.length))}function Q(D,Z){return(function(dt,F){var J,St=$(dt),b=[],T=[];for(b[15]=T[15]=void 0,16<St.length&&(St=E(St,8*dt.length)),J=0;J<16;J+=1)b[J]=909522486^St[J],T[J]=1549556828^St[J];return F=E(b.concat($(F)),512+8*F.length),k(E(T.concat(F),640))})(Rt(D),Rt(Z))}function ve(D,Z,dt){return Z?dt?Q(Z,D):at(Q(Z,D)):dt?ht(D):at(ht(D))}return ve})(),Ce=bn;function Tr(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function wr(i){if(typeof i!="object"||i===null)return i;let a=Object.keys(i).sort(),u={};for(let _ of a)u[_]=i[_];return JSON.stringify(u)}function Pr(i,a){let u={appId:i.appId,randomStr:i.randomStr,data:i.data},_=Object.keys(u).sort(),g="";for(let[R,E]of _.entries())g+=`${E}=${u[E]}`,R<_.length-1&&(g+="&");return g+=`&secretKey=${a}`,Ce(g)}var Sn=(i,a,u,_)=>{let g=ee();return g==="taro"?Taro.request({url:i,method:a,data:u,header:_}).then(R=>R):g==="uni"?new Promise((R,E)=>{uni.request({url:i,method:a,data:u,header:_,success:k=>R(k),fail:k=>E(k)})}):g==="wechat"?new Promise((R,E)=>{wx.request({url:i,method:a,data:u,header:_,success:k=>R(k),fail:k=>E(k)})}):g==="alipay"?new Promise((R,E)=>{my.request({url:i,method:a,data:u,headers:_,success:k=>R(k),fail:k=>E(k)})}):fetch(i,{method:a,headers:_,body:JSON.stringify(u)}).then(async R=>({statusCode:R.status,data:await R.json()}))},Ze=class{constructor(a=null){je(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||de()||{}}getExternalEnv(){var a;return((a=this.getCurrentConfig())==null?void 0:a.externalEnv)||ue.PROD}getExternalHost(){let a=this.getExternalEnv();return we[a]||we.prod}generateSign(a={}){let u=this.getCurrentConfig(),{externalAppId:_,externalAppSecret:g}=u;if(!_||!g)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let R=Tr(),E=wr(a),k=Pr({appId:_,randomStr:R,data:E},g);return{appId:_,randomStr:R,sign:k}}buildRequestBody(a={}){let u=this.generateSign(a);return oe(bt({},u),{data:a})}buildUrl(a){return`${this.getExternalHost()}${a}`}async request(a){let{path:u,method:_="POST",data:g={},header:R={},needSign:E=!0,beforeRequest:k,afterResponse:$}=a,at=this.buildUrl(u),Rt=bt({"content-type":"application/json"},R),ht=E?this.buildRequestBody(g):g;k&&typeof k=="function"&&await k({url:at,method:_,data:ht,header:Rt}),U.info(`\u53D1\u8D77${_}\u8BF7\u6C42:`,{path:u,method:_});try{let Q=await Sn(at,_,ht,Rt);if(U.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:Q.statusCode}),$&&typeof $=="function"&&await $(Q.data),Q.statusCode===200&&Q.data.code===200)return Q.data.data;throw{code:Q.data.code,msg:Q.data.data||"\u8BF7\u6C42\u4E1A\u52A1\u5F02\u5E38",original:Q.data}}catch(Q){throw(Q==null?void 0:Q.code)!==void 0?Q:(U.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:Q}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:Q})}}get(a,u={},_={}){return this.request(bt({path:a,method:"GET",data:u},_))}post(a,u={},_={}){return this.request(bt({path:a,method:"POST",data:u},_))}},Cr=(i=null)=>new Ze(i);var tr=Se(),er=Cr();function Or(i){let a=ke(i==null?void 0:i.equipmentValue,"equipmentValue");return a.valid?tr.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",i):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Nr(i){let a=Pe(i,["idMd5Value","rtaStrategy"]);return a.valid?er.post("/open/rest/cpa/jd/rta-check",i):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function xr(i){try{let a={thirdPlatform:i.thirdPlatform,thirdPlatformUserId:i.thirdPlatformUserId,thirdPlatformEquipmentValue:i.thirdPlatformEquipmentValue,os:i.os,client:"wxMini"};i.phone&&(a.mobileMd5=Ce(i.phone)),i.extendData&&(Object.prototype.toString.call(i.extendData)==="[object Object]"?a.extendData=i.extendData:U.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let u=await er.post("/open/rest/cpa/jd/insurance/get",a);return u?u.jumpMode==1?{jumpMode:1,appId:u.appId,url:u.url}:{jumpMode:2,url:u.url,channel:u.channelId}:void 0}catch(a){throw U.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",a),a}}function Fr(i){let a=ke(i==null?void 0:i.equipmentValue,"equipmentValue");return a.valid?tr.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",i):Promise.reject({code:"PARAM_ERROR",message:a.message})}function Lr(i){let a=Pe(i,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return a.valid?tr.post("/gw/advert/customer/cpa-activity/jd/rta/validate",i):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Ur(i){let a=await me(),u={thirdPlatform:i.thirdPlatform,thirdPlatformUserId:i.thirdPlatformUserId,thirdPlatformEquipmentValue:i.thirdPlatformEquipmentValue,os:a,client:i.client};return i.phone&&(u.mobileMd5=Ce(i.phone)),i.extendData&&(Object.prototype.toString.call(i.extendData)==="[object Object]"?u.extendData=i.extendData:U.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),er.post("/open/rest/cpa/jd/cash-loan/get",u)}async function rr(i){let{phone:a,rtaId:u,equipmentId:_,lyyUserId:g,entrance:R}=i;if(!a)return z(Ft.INVALID_PARAM,Tt[2001]);if(!_)return z(Ft.INVALID_PARAM,Tt[2002]);try{if(u){U.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let ht=await Lr({phone:a,lyyEquipmentValue:_,lyyUserId:g||"",rtaId:u});if(ht.code!=="0000000"||!ht.body||ht.body.state!=1)return U.error("RTA\u9A8C\u8BC1\u5931\u8D25",ht),z(2003,Tt[2003]);U.info("RTA\u9A8C\u8BC1\u6210\u529F",ht.body)}U.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:a});let E=await me(),k=await Fr({phone:a,equipmentValue:_,os:E,entrance:R});if(k.code!=="0000000"||!k.body)return U.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",k),z(2004,Tt[2004]);let{appId:$,targetUrl:at}=k.body;if(!$||!at)return U.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:$,targetUrl:at}),z(2005,Tt[2005]);let Rt=z(Ft.SUCCESS,"\u6210\u529F",{appId:$,targetUrl:at});return U.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",Rt),Rt}catch(E){return U.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",E),z(Ft.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function nr(i){let{phone:a,rtaId:u,thirdPlatform:_,thirdPlatformUserId:g,thirdPlatformEquipmentValue:R}=i;if(!a)return z(Ft.INVALID_PARAM,Tt[2001]);if(!_)return z(2008,Tt[2008]);if(!g)return z(2009,Tt[2009]);if(!R)return z(2010,Tt[2010]);try{if(u){U.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let Q=await Nr({idMd5Value:a,rtaStrategy:u});if(Q.status!=1)return U.error("RTA\u9A8C\u8BC1\u5931\u8D25",Q),z(2003,Tt[2003]);U.info("RTA\u9A8C\u8BC1\u6210\u529F",Q)}let E=await Ur(i),{url:k,channelId:$,matchFlag:at,jumpMode:Rt,appId:ht}=E||{};return at?Rt===3?!ht||!k?z(2007,Tt[2007]):z(Ft.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:ht,url:k}):z(2007,Tt[2007]):z(2006,Tt[2006])}catch(E){return U.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",E),z(Ft.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var Te=null,Oe=null;try{Oe=jr()}catch(i){}function qr(){return Te||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(Te=globalThis.LyyGetCommandSDK,Te):Oe?(Te=Oe.LyyGetCommandSDK||Oe.default||Oe,Te):null)}function Br(i){var u;U.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",i);let a=qr();a!=null&&a.getJrCommand?a.getJrCommand(i):(u=a==null?void 0:a.default)!=null&&u.getJrCommand?a.default.getJrCommand(i):(U.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),i.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function Tn(i,a){return new Promise((u,_)=>{try{Br({url:i,channel:a,callback:g=>{g.code==="0"?u(g.data):_({msg:g.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(g){_(g)}})}async function or(i){try{let a=await me(),u=bt({os:a},i);U.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",u);let{code:_,body:g}=await Or(u);if(_==="0000000"&&g){let{url:R,channelId:E,matchFlag:k,jumpMode:$,appId:at}=g;if(!k)return z(2101,Tt[2101]);if($===1)return U.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),z(2102,Tt[2102]);if($===2)return ee()==="web"&&U.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:R}),!R||!E?z(2103,Tt[2103]):new Promise(Rt=>{Br({url:R,channel:E,callback:async ht=>{if((ht==null?void 0:ht.code)==="0")try{await ze(ht==null?void 0:ht.data),Rt(z(Ft.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch(Q){Rt(z(2105,Tt[2105]))}else Rt(z(2105,Tt[2105]))}})});if($===3)return!at||!R?z(2103,Tt[2103]):z(Ft.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:at,path:R})}return z(2104,Tt[2104])}catch(a){return U.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",a),z(Ft.NETWORK_ERROR,"\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5")}}async function ir(i){U.info("\u5F00\u59CB\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4...");try{let a=await xr(oe(bt({},i),{os:await me()}));if(!a)return U.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),z(2106,Tt[2106]);if(a.jumpMode===1)return U.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{appId:a.appId,url:a.url}),z(Ft.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:a.appId,path:a.url});if(a.jumpMode===2){if(ee()==="web")return U.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:a.url}),z(Ft.SUCCESS,"\u6210\u529F",{type:"h5",url:a.url});try{let u=await Tn(a.url,a.channel);return await ze(u),U.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),z(Ft.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(u){return U.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",u),$e("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),z(2105,Tt[2105])}}return U.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",a.jumpMode),z(2107,Tt[2107])}catch(a){let u=typeof a=="string"?a:(a==null?void 0:a.msg)||(a==null?void 0:a.message)||"\u672A\u77E5\u9519\u8BEF";return U.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",u),$e("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),u.includes("RTA")||u.includes("\u8D44\u683C")?z(2108,Tt[2108]):z(Ft.NETWORK_ERROR,u)}}var lr={};Me(lr,{DyErrorCode:()=>_e,getDyPayRtaData:()=>cr,handleDyPayFlow:()=>ur});var wn=["weapp","h5"];function Pn(i){return wn.includes(i)}var Cn=["switchTab","reLaunch","redirectTo","navigateTo"];function On(i){return Cn.includes(i)}function kr(i){return i.telephone?i.price?i.equipmentValue?i.businessType?i.client&&!Pn(i.client)?{valid:!1,errorCode:3004}:i.douyinOrderExtendData&&typeof i.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:i.backWay&&i.client==="weapp"&&!On(i.backWay)?{valid:!1,errorCode:3016}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}:{valid:!1,errorCode:3001}}function Jr(i){return i.equipmentValue?i.telephone?{valid:!0,errorCode:0}:{valid:!1,errorCode:3001}:{valid:!1,errorCode:3002}}var sr=Se();async function Yr(i){let{price:a,equipmentValue:u,douyinOrderExtendData:_,businessType:g}=i,R={businessType:g,equipmentValue:u,payInfoBusinessType:"commonDouyinPayment",platformActivities:{douyinCommodityPrice:a,douyinOrderExtendData:_||""}};try{let E=await sr.post("/gw/advert/customer/payment/pay-info",R);return E.code!=="0000000"||!(E!=null&&E.body)?Promise.reject({code:3006,message:E.message||Wt[3006]}):E}catch(E){return U.error("getDyOrderAmountFn error:",E),Promise.reject({code:3007,message:Wt[3007]})}}async function Vr(i){try{let a=i.commodityList.map(k=>({commodity:k.commodityId,quantity:1,categoryCode:k.categoryCode||"",supportMarketing:k.supportMarketing})),u=i.advertExtendInfo&&Object.keys(i.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:i.advertExtendInfo}):"",_=ee(),g="";_==="wechat"?g="wechatMini":_==="web"&&navigator.userAgent.toLowerCase().includes("micromessenger")&&(g="wechatHtml");let R={businessType:i.businessType,fixedClientType:21,channelCode:null,douyinData:{loginMobile:i.telephone||""},equipmentUseFlag:!0,payEquipmentDTO:{equipmentValue:i.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:u,transType:5,actualFee:i.totalFee,totalFee:i.totalFee,commodityList:a,clientSourceDetailType:g},E=await sr.post("/gw/payment-bff/unified/order",R);return E.code!=="0000000"||!(E!=null&&E.body)?Promise.reject({code:3008,message:E.message||Wt[3008]}):E}catch(a){return U.error("dyUnifiedOrderFn error:",a),Promise.reject({code:3009,message:Wt[3009]})}}async function Hr(i){let a={equipmentValue:i.equipmentValue,phone:i.telephone||""};i.price&&(a.orderAmount=i.price);try{let u=await sr.post("/gw/advert/customer/douyin/pay/check",a);return u.code!=="0000000"||!(u!=null&&u.body)?Promise.reject({code:3013,message:u.message||Wt[3013]}):u}catch(u){return U.error("getDyPayRtaData error:",u),Promise.reject({code:3014,message:(u==null?void 0:u.message)||Wt[3014]})}}async function ur(i){var u,_,g;let a=kr(i);if(!a.valid)return z(a.errorCode,Wt[a.errorCode]);try{let R=await Yr({price:i.price,equipmentValue:i.equipmentValue,businessType:i.businessType,douyinOrderExtendData:(i==null?void 0:i.douyinOrderExtendData)||""}),E=await Vr(oe(bt({},R.body),{telephone:i.telephone,equipmentValue:i.equipmentValue,businessType:i.businessType})),k=(u=E==null?void 0:E.body)!=null&&u.h5Url?await Nn(oe(bt({},i),{dyUrl:E.body.h5Url})):"",$=((_=E==null?void 0:E.body)==null?void 0:_.outTradeNo)||"";return k?z(0,"success",{h5Url:k,outTradeNo:$}):z(3010,Wt[3010])}catch(R){U.error("handleDyPayFlow error:",R);let E=(g=R==null?void 0:R.code)!=null?g:3012,k=(R==null?void 0:R.message)||Wt[3012];return z(E,k)}}async function Nn(i){let a=de(),u=Be(a.env||"prod",""),_=typeof a.getAuthToken=="function"?await a.getAuthToken():"",g=i.client||"weapp";return`${u}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${g}&equipmentId=${i.equipmentValue}&dyUrl=${i.dyUrl}&fromUrl=${encodeURIComponent(i.fromUrl||"")}&backUrl=${encodeURIComponent(i.backUrl||"")}&backWay=${i.backWay||""}&url_token=${_}`}async function cr(i){var u;let a=Jr(i);if(!a.valid)return z(a.errorCode,Wt[a.errorCode]);try{let _=await Hr({price:(i==null?void 0:i.price)||"",equipmentValue:i.equipmentValue,telephone:(i==null?void 0:i.telephone)||""});return z(0,"success",_.body)}catch(_){U.error("getDyPayRtaData error:",_);let g=(u=_==null?void 0:_.code)!=null?u:3015,R=(_==null?void 0:_.message)||Wt[3015];return z(g,R)}}var pr={};Me(pr,{getDisplayAdConfig:()=>dr,normalizeDisplayAdData:()=>Ye});var xn=Se();function Gr(i){let a=Pe(i,["placementId"]);if(!a.valid)return Promise.reject({code:"PARAM_ERROR",message:a.message});let u=de().env||"prod";return xn.get(`/gw/advert-plugin/api/v1/config/list/valid/${i.placementId}`,{},{authRequired:!1,baseDomain:Ir(u)})}var Xr=30*1e3,Fn="__",hr=new Map,fr=new Map;function Ln(i,a){return[i.appId||"",a,i.type||""].join(Fn)}function Un(i){let a=hr.get(i);return a?a.expireAt<=Date.now()?(hr.delete(i),U.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:i}),null):a.data:null}function Mn(i,a){hr.set(i,{data:a,expireAt:Date.now()+Xr})}function jn(i){return Array.isArray(i==null?void 0:i.body)?i.body:[]}function qn(i){return String(i==null?void 0:i.code)!=="200"}function Bn(i,a){let u=String(i||a||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(u)?u:a||"banner"}function Kr(i){return String(i||"").trim().toLowerCase()}function kn(i){var a;return!!i&&i.status!==0&&((a=i.platformConfig)==null?void 0:a.valid)!==!1}function Jn(i){return[...i].sort((a,u)=>{var R,E,k,$;let _=Number((R=a.priority)!=null?R:9999),g=Number((E=u.priority)!=null?E:9999);return _!==g?_-g:Number((k=u.weight)!=null?k:0)-Number(($=a.weight)!=null?$:0)})}function Wr(i){return i.find(a=>Kr(a.advertPlatform)==="gdt")||null}function zr(i){return i.find(a=>Kr(a.advertPlatform)!=="gdt")||null}function Yn(i,a){return i&&a?"mixed":i?"wechat":a?"custom":"none"}function Vn(i,a){var g,R;let u=Wr(i),_=zr(i);return u&&_?Number((g=u.priority)!=null?g:9999)<=Number((R=_.priority)!=null?R:9999)?"wechat-first":"custom-first":a==="custom"?"custom-only":a==="wechat"?"wechat-only":"wechat-first"}function Hn(i){var u;let a=Wr(i);return((u=a==null?void 0:a.platformConfig)==null?void 0:u.adId)||""}function Gn(i){let a=zr(i),u=a==null?void 0:a.platformConfig;if(!u)return null;let _=u.image||u.imageUrl||"",g=u.video||u.videoUrl||"",R=u.poster||_||"",E=u.jumpUrl||u.url||u.webUrl||"";return!_&&!g?null:{image:_||void 0,video:g||void 0,poster:R||void 0,title:u.title,description:u.description,buttonText:u.buttonText,badgeText:u.badgeText,jumpSeconds:u.jumpSeconds,loadTimeout:u.loadTimeout||u.timeout,muted:u.muted,adSpec:u.adSpec,url:E||void 0,action:E?{type:"web",url:E}:void 0}}function Ye(i,a){let u=Jn(i.filter(kn)),_=Gn(u),g=Hn(u),R=Bn(void 0,a),E=Yn(g,_),k=Vn(u,E);return{show:!!(g||_),adId:"",type:R,provider:E,priority:k,unitId:g,customAd:_,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:i}}async function dr(i){let a=i.placementId||i.adId||"",u=Ln(i,a),_=Un(u);if(_)return U.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:u,placementId:a}),z(Ft.SUCCESS,"\u6210\u529F",_);let g=fr.get(u);if(g)return U.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:u,placementId:a}),g;let R=(async()=>{try{U.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",i);let E=await Gr({placementId:a}),k=jn(E);if(U.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:u,placementId:a,response:E,body:k}),qn(E)||!k)return U.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",E),z(Ft.UNKNOWN_ERROR,(E==null?void 0:E.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");let $=Ye(k,i.type);return $.adId=a,$.cache=oe(bt({},$.cache),{enable:!0,ttl:Xr}),Mn(u,$),U.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:u,placementId:a,provider:$.provider,priority:$.priority,hasUnitId:!!$.unitId,hasCustomAd:!!$.customAd}),z(Ft.SUCCESS,"\u6210\u529F",$)}catch(E){return U.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:u,placementId:a,error:E}),z(Ft.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{fr.delete(u)}})();return fr.set(u,R),R}function Xn(i={}){U.info("\u670D\u52A1\u521D\u59CB\u5316",i);let a=bt(bt({},be),i);a.env&&!qe[a.env]&&(U.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${a.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),a.env=Xt.PROD),a.externalEnv&&!we[a.externalEnv]&&(U.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${a.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),a.externalEnv=ue.PROD),a.debug!==void 0&&U.setEnable(a.debug),Sr(a),U.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",a)}function $r(i={}){let a="",u=null;async function _(){if(typeof i.getAuthToken=="function"){let R=await i.getAuthToken();if(R)return R}return u&&typeof u.getStorage=="function"&&u.getStorage("auth_token")||""}let g={name:"services",setToken(R){return a=R||"",u&&typeof u.setStorage=="function"&&u.setStorage("auth_token",a),g},async getAuthToken(){return a||_()},clearToken(){return a="",u&&typeof u.setStorage=="function"&&u.setStorage("auth_token",""),g},install(R){u=R;let E=oe(bt({},i),{getAuthToken:()=>g.getAuthToken()});Xn(E),U.info("services installed via nova.use()"),Object.assign(R,{jd:bt({},ar),dy:bt({},lr),ads:bt({},pr),setToken:g.setToken,clearToken:g.clearToken})}};return g}0&&(module.exports={DyErrorCode,DyErrorMessage,ENV_TYPE,EXTERNAL_ENV_TYPE,JdErrorCode,JdErrorMessage,createServices,getDisplayAdConfig,getDyPayRtaData,handleDyPayFlow,handleJdInsurance,handleJdInsuranceExt,handleJdjrCashLoanExt,handleJdjrCashLoanFlow,normalizeDisplayAdData});
5
5
  /*! For license information please see LyyGetCommandSDK.min.js.LICENSE.txt */
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- var pr=Object.defineProperty,ln=Object.defineProperties;var fn=Object.getOwnPropertyDescriptors;var dr=Object.getOwnPropertySymbols;var hn=Object.prototype.hasOwnProperty,dn=Object.prototype.propertyIsEnumerable;var He=(i,a,u)=>a in i?pr(i,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[a]=u,bt=(i,a)=>{for(var u in a||(a={}))hn.call(a,u)&&He(i,u,a[u]);if(dr)for(var u of dr(a))dn.call(a,u)&&He(i,u,a[u]);return i},ne=(i,a)=>ln(i,fn(a));var pn=(i,a)=>()=>(a||i((a={exports:{}}).exports,a),a.exports),Ge=(i,a)=>{for(var u in a)pr(i,u,{get:a[u],enumerable:!0})};var Ue=(i,a,u)=>He(i,typeof a!="symbol"?a+"":a,u);var Nr=pn((Ao,Or)=>{"use strict";(()=>{var i={737:(g,D,S)=>{"use strict";S.r(D),S.d(D,{default:()=>P,getJrCommand:()=>I});var J=S(307),$=S.n(J);function at(){at=function(){return V};var m,V={},_t=Object.prototype,st=_t.hasOwnProperty,vt=Object.defineProperty||function(h,l,y){h[l]=y.value},ut=typeof Symbol=="function"?Symbol:{},yt=ut.iterator||"@@iterator",At=ut.asyncIterator||"@@asyncIterator",Dt=ut.toStringTag||"@@toStringTag";function ft(h,l,y){return Object.defineProperty(h,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),h[l]}try{ft({},"")}catch(h){ft=function(l,y,x){return l[y]=x}}function Yt(h,l,y,x){var A=l&&l.prototype instanceof oe?l:oe,M=Object.create(A.prototype),rt=new ce(x||[]);return vt(M,"_invoke",{value:Ot(h,y,rt)}),M}function Vt(h,l,y){try{return{type:"normal",arg:h.call(l,y)}}catch(x){return{type:"throw",arg:x}}}V.wrap=Yt;var kt="suspendedStart",Wt="suspendedYield",Ht="executing",wt="completed",Pt={};function oe(){}function ee(){}function jt(){}var ie={};ft(ie,yt,(function(){return this}));var re=Object.getPrototypeOf,Lt=re&&re(re(te([])));Lt&&Lt!==_t&&st.call(Lt,yt)&&(ie=Lt);var Jt=jt.prototype=oe.prototype=Object.create(ie);function pe(h){["next","throw","return"].forEach((function(l){ft(h,l,(function(y){return this._invoke(l,y)}))}))}function zt(h,l){function y(A,M,rt,mt){var pt=Vt(h[A],h,M);if(pt.type!=="throw"){var Gt=pt.arg,$t=Gt.value;return $t&&ht($t)=="object"&&st.call($t,"__await")?l.resolve($t.__await).then((function(Et){y("next",Et,rt,mt)}),(function(Et){y("throw",Et,rt,mt)})):l.resolve($t).then((function(Et){Gt.value=Et,rt(Gt)}),(function(Et){return y("throw",Et,rt,mt)}))}mt(pt.arg)}var x;vt(this,"_invoke",{value:function(A,M){function rt(){return new l((function(mt,pt){y(A,M,mt,pt)}))}return x=x?x.then(rt,rt):rt()}})}function Ot(h,l,y){var x=kt;return function(A,M){if(x===Ht)throw Error("Generator is already running");if(x===wt){if(A==="throw")throw M;return{value:m,done:!0}}for(y.method=A,y.arg=M;;){var rt=y.delegate;if(rt){var mt=Ut(rt,y);if(mt){if(mt===Pt)continue;return mt}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(x===kt)throw x=wt,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);x=Ht;var pt=Vt(h,l,y);if(pt.type==="normal"){if(x=y.done?wt:Wt,pt.arg===Pt)continue;return{value:pt.arg,done:y.done}}pt.type==="throw"&&(x=wt,y.method="throw",y.arg=pt.arg)}}}function Ut(h,l){var y=l.method,x=h.iterator[y];if(x===m)return l.delegate=null,y==="throw"&&h.iterator.return&&(l.method="return",l.arg=m,Ut(h,l),l.method==="throw")||y!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+y+"' method")),Pt;var A=Vt(x,h.iterator,l.arg);if(A.type==="throw")return l.method="throw",l.arg=A.arg,l.delegate=null,Pt;var M=A.arg;return M?M.done?(l[h.resultName]=M.value,l.next=h.nextLoc,l.method!=="return"&&(l.method="next",l.arg=m),l.delegate=null,Pt):M:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,Pt)}function Zt(h){var l={tryLoc:h[0]};1 in h&&(l.catchLoc=h[1]),2 in h&&(l.finallyLoc=h[2],l.afterLoc=h[3]),this.tryEntries.push(l)}function ue(h){var l=h.completion||{};l.type="normal",delete l.arg,h.completion=l}function ce(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(Zt,this),this.reset(!0)}function te(h){if(h||h===""){var l=h[yt];if(l)return l.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var y=-1,x=function A(){for(;++y<h.length;)if(st.call(h,y))return A.value=h[y],A.done=!1,A;return A.value=m,A.done=!0,A};return x.next=x}}throw new TypeError(ht(h)+" is not iterable")}return ee.prototype=jt,vt(Jt,"constructor",{value:jt,configurable:!0}),vt(jt,"constructor",{value:ee,configurable:!0}),ee.displayName=ft(jt,Dt,"GeneratorFunction"),V.isGeneratorFunction=function(h){var l=typeof h=="function"&&h.constructor;return!!l&&(l===ee||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,jt):(h.__proto__=jt,ft(h,Dt,"GeneratorFunction")),h.prototype=Object.create(Jt),h},V.awrap=function(h){return{__await:h}},pe(zt.prototype),ft(zt.prototype,At,(function(){return this})),V.AsyncIterator=zt,V.async=function(h,l,y,x,A){A===void 0&&(A=Promise);var M=new zt(Yt(h,l,y,x),A);return V.isGeneratorFunction(l)?M:M.next().then((function(rt){return rt.done?rt.value:M.next()}))},pe(Jt),ft(Jt,Dt,"Generator"),ft(Jt,yt,(function(){return this})),ft(Jt,"toString",(function(){return"[object Generator]"})),V.keys=function(h){var l=Object(h),y=[];for(var x in l)y.push(x);return y.reverse(),function A(){for(;y.length;){var M=y.pop();if(M in l)return A.value=M,A.done=!1,A}return A.done=!0,A}},V.values=te,ce.prototype={constructor:ce,reset:function(h){if(this.prev=0,this.next=0,this.sent=this._sent=m,this.done=!1,this.delegate=null,this.method="next",this.arg=m,this.tryEntries.forEach(ue),!h)for(var l in this)l.charAt(0)==="t"&&st.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=m)},stop:function(){this.done=!0;var h=this.tryEntries[0].completion;if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(h){if(this.done)throw h;var l=this;function y(pt,Gt){return M.type="throw",M.arg=h,l.next=pt,Gt&&(l.method="next",l.arg=m),!!Gt}for(var x=this.tryEntries.length-1;x>=0;--x){var A=this.tryEntries[x],M=A.completion;if(A.tryLoc==="root")return y("end");if(A.tryLoc<=this.prev){var rt=st.call(A,"catchLoc"),mt=st.call(A,"finallyLoc");if(rt&&mt){if(this.prev<A.catchLoc)return y(A.catchLoc,!0);if(this.prev<A.finallyLoc)return y(A.finallyLoc)}else if(rt){if(this.prev<A.catchLoc)return y(A.catchLoc,!0)}else{if(!mt)throw Error("try statement without catch or finally");if(this.prev<A.finallyLoc)return y(A.finallyLoc)}}}},abrupt:function(h,l){for(var y=this.tryEntries.length-1;y>=0;--y){var x=this.tryEntries[y];if(x.tryLoc<=this.prev&&st.call(x,"finallyLoc")&&this.prev<x.finallyLoc){var A=x;break}}A&&(h==="break"||h==="continue")&&A.tryLoc<=l&&l<=A.finallyLoc&&(A=null);var M=A?A.completion:{};return M.type=h,M.arg=l,A?(this.method="next",this.next=A.finallyLoc,Pt):this.complete(M)},complete:function(h,l){if(h.type==="throw")throw h.arg;return h.type==="break"||h.type==="continue"?this.next=h.arg:h.type==="return"?(this.rval=this.arg=h.arg,this.method="return",this.next="end"):h.type==="normal"&&l&&(this.next=l),Pt},finish:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===h)return this.complete(y.completion,y.afterLoc),ue(y),Pt}},catch:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===h){var x=y.completion;if(x.type==="throw"){var A=x.arg;ue(y)}return A}}throw Error("illegal catch attempt")},delegateYield:function(h,l,y){return this.delegate={iterator:te(h),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=m),Pt}},V}function Rt(m,V,_t,st,vt,ut,yt){try{var At=m[ut](yt),Dt=At.value}catch(ft){return void _t(ft)}At.done?V(Dt):Promise.resolve(Dt).then(st,vt)}function ht(m){return ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},ht(m)}var Q="https://ms.jr.jd.com";function _e(m){var V=m.host,_t=m.type,st=_t===void 0?"post":_t,vt=m.data,ut=m.path,yt=ut===void 0?"":ut,At=m.config,Dt=At===void 0?{}:At,ft=(Dt.withCredentials,Dt.isWG),Yt=ft===void 0||ft,Vt=Dt.contentType,kt=Vt===void 0?"application/x-www-form-urlencoded":Vt;return new Promise((function(Wt,Ht){wx.request({url:(V||Q)+yt,method:st.toUpperCase(),data:Yt?R({reqData:JSON.stringify(vt)}):vt,header:{"content-type":kt},success:function(wt){wt.statusCode===200?Wt(wt.data):Ht({statusCode:wt.statusCode,errMsg:wt.errMsg,data:wt.data})},fail:function(wt){Ht(wt)}})}))}function R(m){var V="";return ht(m)==="object"&&m!==null&&(Object.keys(m).map((function(_t){var st=m[_t];return V+=_t+"="+encodeURIComponent(st)+"&",""})),V.length>0&&(V=V.substr(0,V.length-1))),V}function Z(m){return dt.apply(this,arguments)}function dt(){var m;return m=at().mark((function V(_t){var st,vt,ut,yt,At,Dt,ft,Yt,Vt,kt;return at().wrap((function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return st=_t.url,vt=_t.channel,ut=_t.callback,$().init(),yt=new($()),At=yt.nonce(),Dt=yt.sign(JSON.stringify({t:"".concat(new Date().getTime())}),At),ft="/gw/generic/app/h5/m/execute1/ug-service-orchestrator".concat(""),Yt="",Vt={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:st,channel:vt,clientCode:"0",antiRushInfo:Dt}},Wt.next=12,_e({host:"https://ms.jr.jd.com",type:"post",path:ft,config:{withCredentials:!0},data:Vt});case 12:(kt=Wt.sent).resultCode===0&&kt.resultData&&kt.resultData.code==="00000"&&kt.resultData.data&&(Yt=kt.resultData.data.goldenKeyText),ut&&ut(Yt?{code:"0",msg:"command success",data:Yt}:{code:"-1",msg:"command empty"});case 15:case"end":return Wt.stop()}}),V)})),dt=function(){var V=this,_t=arguments;return new Promise((function(st,vt){var ut=m.apply(V,_t);function yt(Dt){Rt(ut,st,vt,yt,At,"next",Dt)}function At(Dt){Rt(ut,st,vt,yt,At,"throw",Dt)}yt(void 0)}))},dt.apply(this,arguments)}function F(m){return F=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},F(m)}function k(){k=function(){return V};var m,V={},_t=Object.prototype,st=_t.hasOwnProperty,vt=Object.defineProperty||function(h,l,y){h[l]=y.value},ut=typeof Symbol=="function"?Symbol:{},yt=ut.iterator||"@@iterator",At=ut.asyncIterator||"@@asyncIterator",Dt=ut.toStringTag||"@@toStringTag";function ft(h,l,y){return Object.defineProperty(h,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),h[l]}try{ft({},"")}catch(h){ft=function(l,y,x){return l[y]=x}}function Yt(h,l,y,x){var A=l&&l.prototype instanceof oe?l:oe,M=Object.create(A.prototype),rt=new ce(x||[]);return vt(M,"_invoke",{value:Ot(h,y,rt)}),M}function Vt(h,l,y){try{return{type:"normal",arg:h.call(l,y)}}catch(x){return{type:"throw",arg:x}}}V.wrap=Yt;var kt="suspendedStart",Wt="suspendedYield",Ht="executing",wt="completed",Pt={};function oe(){}function ee(){}function jt(){}var ie={};ft(ie,yt,(function(){return this}));var re=Object.getPrototypeOf,Lt=re&&re(re(te([])));Lt&&Lt!==_t&&st.call(Lt,yt)&&(ie=Lt);var Jt=jt.prototype=oe.prototype=Object.create(ie);function pe(h){["next","throw","return"].forEach((function(l){ft(h,l,(function(y){return this._invoke(l,y)}))}))}function zt(h,l){function y(A,M,rt,mt){var pt=Vt(h[A],h,M);if(pt.type!=="throw"){var Gt=pt.arg,$t=Gt.value;return $t&&F($t)=="object"&&st.call($t,"__await")?l.resolve($t.__await).then((function(Et){y("next",Et,rt,mt)}),(function(Et){y("throw",Et,rt,mt)})):l.resolve($t).then((function(Et){Gt.value=Et,rt(Gt)}),(function(Et){return y("throw",Et,rt,mt)}))}mt(pt.arg)}var x;vt(this,"_invoke",{value:function(A,M){function rt(){return new l((function(mt,pt){y(A,M,mt,pt)}))}return x=x?x.then(rt,rt):rt()}})}function Ot(h,l,y){var x=kt;return function(A,M){if(x===Ht)throw Error("Generator is already running");if(x===wt){if(A==="throw")throw M;return{value:m,done:!0}}for(y.method=A,y.arg=M;;){var rt=y.delegate;if(rt){var mt=Ut(rt,y);if(mt){if(mt===Pt)continue;return mt}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(x===kt)throw x=wt,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);x=Ht;var pt=Vt(h,l,y);if(pt.type==="normal"){if(x=y.done?wt:Wt,pt.arg===Pt)continue;return{value:pt.arg,done:y.done}}pt.type==="throw"&&(x=wt,y.method="throw",y.arg=pt.arg)}}}function Ut(h,l){var y=l.method,x=h.iterator[y];if(x===m)return l.delegate=null,y==="throw"&&h.iterator.return&&(l.method="return",l.arg=m,Ut(h,l),l.method==="throw")||y!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+y+"' method")),Pt;var A=Vt(x,h.iterator,l.arg);if(A.type==="throw")return l.method="throw",l.arg=A.arg,l.delegate=null,Pt;var M=A.arg;return M?M.done?(l[h.resultName]=M.value,l.next=h.nextLoc,l.method!=="return"&&(l.method="next",l.arg=m),l.delegate=null,Pt):M:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,Pt)}function Zt(h){var l={tryLoc:h[0]};1 in h&&(l.catchLoc=h[1]),2 in h&&(l.finallyLoc=h[2],l.afterLoc=h[3]),this.tryEntries.push(l)}function ue(h){var l=h.completion||{};l.type="normal",delete l.arg,h.completion=l}function ce(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(Zt,this),this.reset(!0)}function te(h){if(h||h===""){var l=h[yt];if(l)return l.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var y=-1,x=function A(){for(;++y<h.length;)if(st.call(h,y))return A.value=h[y],A.done=!1,A;return A.value=m,A.done=!0,A};return x.next=x}}throw new TypeError(F(h)+" is not iterable")}return ee.prototype=jt,vt(Jt,"constructor",{value:jt,configurable:!0}),vt(jt,"constructor",{value:ee,configurable:!0}),ee.displayName=ft(jt,Dt,"GeneratorFunction"),V.isGeneratorFunction=function(h){var l=typeof h=="function"&&h.constructor;return!!l&&(l===ee||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,jt):(h.__proto__=jt,ft(h,Dt,"GeneratorFunction")),h.prototype=Object.create(Jt),h},V.awrap=function(h){return{__await:h}},pe(zt.prototype),ft(zt.prototype,At,(function(){return this})),V.AsyncIterator=zt,V.async=function(h,l,y,x,A){A===void 0&&(A=Promise);var M=new zt(Yt(h,l,y,x),A);return V.isGeneratorFunction(l)?M:M.next().then((function(rt){return rt.done?rt.value:M.next()}))},pe(Jt),ft(Jt,Dt,"Generator"),ft(Jt,yt,(function(){return this})),ft(Jt,"toString",(function(){return"[object Generator]"})),V.keys=function(h){var l=Object(h),y=[];for(var x in l)y.push(x);return y.reverse(),function A(){for(;y.length;){var M=y.pop();if(M in l)return A.value=M,A.done=!1,A}return A.done=!0,A}},V.values=te,ce.prototype={constructor:ce,reset:function(h){if(this.prev=0,this.next=0,this.sent=this._sent=m,this.done=!1,this.delegate=null,this.method="next",this.arg=m,this.tryEntries.forEach(ue),!h)for(var l in this)l.charAt(0)==="t"&&st.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=m)},stop:function(){this.done=!0;var h=this.tryEntries[0].completion;if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(h){if(this.done)throw h;var l=this;function y(pt,Gt){return M.type="throw",M.arg=h,l.next=pt,Gt&&(l.method="next",l.arg=m),!!Gt}for(var x=this.tryEntries.length-1;x>=0;--x){var A=this.tryEntries[x],M=A.completion;if(A.tryLoc==="root")return y("end");if(A.tryLoc<=this.prev){var rt=st.call(A,"catchLoc"),mt=st.call(A,"finallyLoc");if(rt&&mt){if(this.prev<A.catchLoc)return y(A.catchLoc,!0);if(this.prev<A.finallyLoc)return y(A.finallyLoc)}else if(rt){if(this.prev<A.catchLoc)return y(A.catchLoc,!0)}else{if(!mt)throw Error("try statement without catch or finally");if(this.prev<A.finallyLoc)return y(A.finallyLoc)}}}},abrupt:function(h,l){for(var y=this.tryEntries.length-1;y>=0;--y){var x=this.tryEntries[y];if(x.tryLoc<=this.prev&&st.call(x,"finallyLoc")&&this.prev<x.finallyLoc){var A=x;break}}A&&(h==="break"||h==="continue")&&A.tryLoc<=l&&l<=A.finallyLoc&&(A=null);var M=A?A.completion:{};return M.type=h,M.arg=l,A?(this.method="next",this.next=A.finallyLoc,Pt):this.complete(M)},complete:function(h,l){if(h.type==="throw")throw h.arg;return h.type==="break"||h.type==="continue"?this.next=h.arg:h.type==="return"?(this.rval=this.arg=h.arg,this.method="return",this.next="end"):h.type==="normal"&&l&&(this.next=l),Pt},finish:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===h)return this.complete(y.completion,y.afterLoc),ue(y),Pt}},catch:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===h){var x=y.completion;if(x.type==="throw"){var A=x.arg;ue(y)}return A}}throw Error("illegal catch attempt")},delegateYield:function(h,l,y){return this.delegate={iterator:te(h),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=m),Pt}},V}function St(m,V,_t,st,vt,ut,yt){try{var At=m[ut](yt),Dt=At.value}catch(ft){return void _t(ft)}At.done?V(Dt):Promise.resolve(Dt).then(st,vt)}function I(m){return T.apply(this,arguments)}function T(){var m;return m=k().mark((function V(_t){var st,vt,ut;return k().wrap((function(yt){for(;;)switch(yt.prev=yt.next){case 0:return st=_t.url,vt=_t.channel,ut=_t.callback,yt.next=3,Z({url:st,channel:vt,callback:ut});case 3:case"end":return yt.stop()}}),V)})),T=function(){var V=this,_t=arguments;return new Promise((function(st,vt){var ut=m.apply(V,_t);function yt(Dt){St(ut,st,vt,yt,At,"next",Dt)}function At(Dt){St(ut,st,vt,yt,At,"throw",Dt)}yt(void 0)}))},T.apply(this,arguments)}var O={getJrCommand:I};(g=S.hmd(g)).exports&&(g.exports=O,g.exports.getJrCommand=I),typeof window!="undefined"&&(window.LyyGetCommandSDK=O);let P=O},307:function(g,D,S){var J,$,at;function Rt(ht){return Rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Q){return typeof Q}:function(Q){return Q&&typeof Symbol=="function"&&Q.constructor===Symbol&&Q!==Symbol.prototype?"symbol":typeof Q},Rt(ht)}at=function(){"use strict";function ht(t){return(ht=typeof Symbol=="function"&&Rt(Symbol.iterator)=="symbol"?function(r){return Rt(r)}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":Rt(r)})(t)}function Q(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _e(t,r){for(var s=0;s<r.length;s++){var c=r[s];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}function R(t,r,s){return r&&_e(t.prototype,r),s&&_e(t,s),t}function Z(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&F(t,r)}function dt(t){return(dt=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(t)}function F(t,r){return(F=Object.setPrototypeOf||function(s,c){return s.__proto__=c,s})(t,r)}function k(t){var r=(function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(s){return!1}})();return function(){var s,c=dt(t);return(function(d,p){if(p&&(Rt(p)=="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(E){if(E===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return E})(d)})(this,r?(s=dt(this).constructor,Reflect.construct(c,arguments,s)):c.apply(this,arguments))}}function St(t){return(function(r){if(Array.isArray(r))return I(r)})(t)||(function(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)})(t)||(function(r,s){if(r){if(typeof r=="string")return I(r,s);var c=Object.prototype.toString.call(r).slice(8,-1);return(c=c==="Object"&&r.constructor?r.constructor.name:c)==="Map"||c==="Set"?Array.from(r):c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?I(r,s):void 0}})(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function I(t,r){(r==null||r>t.length)&&(r=t.length);for(var s=0,c=new Array(r);s<r;s++)c[s]=t[s];return c}var T=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:S.g!==void 0?S.g:typeof self!="undefined"?self:{},O=!1,P=!1,m={console:!0,focus:!1,time:!1,length:!0,infinite:!1,time_interval:500,time_threshold:100,length_threshold:300},V=function(){typeof document!="undefined"&&document.hasFocus&&!document.hasFocus()&&(P=!0)},_t=function(){var t=Date.now();Date.now()-t>m.time_threshold&&(P=!0)},st=function(){var t=T.outerWidth,r=T.outerHeight,s=T.innerWidth,c=T.innerHeight;t&&r&&s&&c&&typeof t=="number"&&typeof r=="number"&&typeof s=="number"&&typeof c=="number"&&(t-s>m.length_threshold||r-c>m.length_threshold)&&(P=!0)};(Ot={}).start=function(t){if(!O){if(t&&ht(t)==="object")for(var r in t)m[r]=t[r];var s;m.infinite&&(typeof window!="undefined"&&Object.prototype.toString.call(window)==="[object Window]"?typeof Function!="undefined"&&Function.constructor!==void 0&&/Function[^]*\[native code\]/.test(""+Function.constructor)&&typeof setInterval!="undefined"&&/setInterval[^]*\[native code\]/.test(""+setInterval)?new Function('setInterval(function(){!/Function[^]*[native code]/.test("" + Function.constructor) ? function(){while(1);}() : new Function("debugger")(); }, 100);')():P=!0:setInterval((function(){}),100)),m.console&&(function(){var c=new Date;c.toString=function(){for(var d=Date.now();;)if(10<Date.now()-d)return Date.now()},console.log(c),c.toString=function(){return P=!0,Date.now()}})(),m.focus&&V(),m.time&&_t(),m.length&&st(),s=setInterval((function(){s&&P&&clearInterval(s),m.focus&&V(),m.time&&_t(),m.length&&st()}),m.time_interval),O=!0}},Ot.isDebug=function(){return P};var vt=Ot,ut=".123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-!",yt={my_b4_encode:function(t){var r=0,s=(j=0)<t.length%3?3-t.length%3:0;for(r=0;r<s;r++)t[t.length]=0;var c="";for(j=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
3
- `),c+=ut[t[j]>>2]+ut[(3&t[j])<<4|t[j+1]>>4]+ut[(15&t[j+1])<<2|t[j+2]>>6]+ut[63&t[j+2]];for(r=0;r<s;r++)c+=ut[64];return c},my_b4_decode:function(t){var r=0,s=0,c=(t=t.replace(/[^A-Za-z0-9\+\-\!\.]/g,"")).length%4;if(2<c)return null;for(r=0;r<c;r++)if(t.charAt(t.length-r-1)!=ut[64])return null;var d,p,E,C,w=new Array(3*(t.length-c)/4);for(r=0,s=0;s<w.length;)d=ut.indexOf(t.charAt(r++)),p=ut.indexOf(t.charAt(r++)),E=ut.indexOf(t.charAt(r++)),C=ut.indexOf(t.charAt(r++)),w[s++]=d<<2|p>>4,w[s++]=(15&p)<<4|E>>2,w[s++]=(3&E)<<6|C;for(r=0;r<c;r++)if(w.pop()!=0)return null;return w}},At="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Dt={b4_encode:function(t){var r=0,s=(j=0)<t.length%3?3-t.length%3:0;for(r=0;r<s;r++)t[t.length]=0;var c="";for(r=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
4
- `),c+=At[t[j]>>2]+At[(3&t[j])<<4|t[j+1]>>4]+At[(15&t[j+1])<<2|t[j+2]>>6]+At[63&t[j+2]];for(r=0;r<s;r++)c+="=";return c},b4_decode:function(t){var r=0,s=0,c=(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length%4;if(2<c)return null;for(r=0;r<c;r++)if(t.charAt(t.length-r-1)!="=")return null;var d,p,E,C,w=new Array(3*(t.length-c)/4);for(r=0,s=0;s<w.length;)d=At.indexOf(t.charAt(r++)),p=At.indexOf(t.charAt(r++)),E=At.indexOf(t.charAt(r++)),C=At.indexOf(t.charAt(r++)),w[s++]=d<<2|p>>4,w[s++]=(15&p)<<4|E>>2,w[s++]=(3&E)<<6|C;for(r=0;r<c;r++)if(w.pop()!=0)return null;return w}};function ft(){}ft.encode=function(t,r,s){for(var c=new Array(2*s),d=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),p=r,E=0;p<s+r;p++,E++)c[E]=d[(255&t[p])>>4],c[++E]=d[15&t[p]];return c.join("")},ft.decode=function(t){if(t==null||t==""||t.length%2!=0)return null;for(var r=t.length/2,s=ft.toCharCodeArray(t),c=new Array(r),d=0;d<r;d++){if(48<=s[2*d]&&s[2*d]<=57)c[d]=s[2*d]-48<<4;else if(65<=s[2*d]&&s[2*d]<=70)c[d]=s[2*d]-65+10<<4;else{if(!(97<=s[2*d]&&s[2*d]<=102))return null;c[d]=s[2*d]-97+10<<4}if(48<=s[2*d+1]&&s[2*d+1]<=57)c[d]=c[d]|s[2*d+1]-48;else if(65<=s[2*d+1]&&s[2*d+1]<=70)c[d]=c[d]|s[2*d+1]-65+10;else{if(!(97<=s[2*d+1]&&s[2*d+1]<=102))return null;c[d]=c[d]|s[2*d+1]-97+10}}return c},ft.toCharCodeArray=function(t){for(var r=new Array(t.length),s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return r};var Yt=ft,Vt=Yt;(Ut=function(){}).utf8StrToh6=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],d=0;d<s;d++)c[d]=r.charCodeAt(d).toString(16);return c.join("")},Ut.utf8StrToBytes=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],d=0;d<s;d++)c[d]=r.charCodeAt(d);return c},Ut.hexToUtf8Str=function(t){for(var r=Vt.decode(t),s=[],c=0;c<r.length;c++)s.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(s.join("")))},Ut.bytesToUtf8Str=function(t){for(var r=t,s=[],c=0;c<r.length;c++)s.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(s.join("")))},Ut.intToByte=function(t){return new Array(t>>24&255,t>>16&255,t>>8&255,255&t)},Ut.byteToInt=function(t,r){return r+3<t.length?t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]:r+2<t.length?t[r+1]<<16|t[r+2]<<8|t[r+3]:r+1<t.length?t[r]<<8|t[r+1]:t[r]};var kt,Wt=Ut,Ht={exports:{}};kt=Ht,function(){function t(e,n,o){e!=null&&(typeof e=="number"?this.fromNumber(e,n,o):n==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,n))}function r(){return new t(null)}var s=(s=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(t.prototype.am=function(e,n,o,f,_,N){for(var B=32767&n,L=n>>15;0<=--N;){var xt=32767&this[e],Xt=this[e++]>>15,ae=L*xt+Xt*B;_=((xt=B*xt+((32767&ae)<<15)+o[f]+(1073741823&_))>>>30)+(ae>>>15)+L*Xt+(_>>>30),o[f++]=1073741823&xt}return _},30):s&&navigator.appName!="Netscape"?(t.prototype.am=function(e,n,o,f,_,N){for(;0<=--N;){var B=n*this[e++]+o[f]+_;_=Math.floor(B/67108864),o[f++]=67108863&B}return _},26):(t.prototype.am=function(e,n,o,f,_,N){for(var B=16383&n,L=n>>14;0<=--N;){var xt=16383&this[e],Xt=this[e++]>>14,ae=L*xt+Xt*B;_=((xt=B*xt+((16383&ae)<<14)+o[f]+_)>>28)+(ae>>14)+L*Xt,o[f++]=268435455&xt}return _},28);t.prototype.DB=s,t.prototype.DM=(1<<s)-1,t.prototype.DV=1<<s,t.prototype.FV=Math.pow(2,52),t.prototype.F1=52-s,t.prototype.F2=2*s-52;for(var c=new Array,d=48,p=0;p<=9;++p)c[d++]=p;for(d=97,p=10;p<36;++p)c[d++]=p;for(d=65,p=10;p<36;++p)c[d++]=p;function E(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function C(e,n){return(e=c[e.charCodeAt(n)])==null?-1:e}function w(e){var n=r();return n.fromInt(e),n}function nt(e){var n,o=1;return(n=e>>>16)!=0&&(e=n,o+=16),(n=e>>8)!=0&&(e=n,o+=8),(n=e>>4)!=0&&(e=n,o+=4),(n=e>>2)!=0&&(e=n,o+=2),(n=e>>1)!=0&&(e=n,o+=1),o}function ot(e){this.m=e}function b(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function H(e,n){return e&n}function tt(e,n){return e|n}function W(e,n){return e^n}function it(e,n){return e&~n}function lt(){}function Ct(e){return e}function q(e){this.r2=r(),this.q3=r(),t.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}ot.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},ot.prototype.revert=function(e){return e},ot.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},ot.prototype.mulTo=function(e,n,o){e.multiplyTo(n,o),this.reduce(o)},ot.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)},b.prototype.convert=function(e){var n=r();return e.abs().dlShiftTo(this.m.t,n),n.divRemTo(this.m,null,n),e.s<0&&0<n.compareTo(t.ZERO)&&this.m.subTo(n,n),n},b.prototype.revert=function(e){var n=r();return e.copyTo(n),this.reduce(n),n},b.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var n=0;n<this.m.t;++n){var o=32767&e[n],f=o*this.mpl+((o*this.mph+(e[n]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[o=n+this.m.t]+=this.m.am(0,f,e,n,0,this.m.t);e[o]>=e.DV;)e[o]-=e.DV,e[++o]++}e.clamp(),e.drShiftTo(this.m.t,e),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,n,o){e.multiplyTo(n,o),this.reduce(o)},b.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)},t.prototype.copyTo=function(e){for(var n=this.t-1;0<=n;--n)e[n]=this[n];e.t=this.t,e.s=this.s},t.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0<e?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},t.prototype.fromString=function(e,n){var o;if(n==16)o=4;else if(n==8)o=3;else if(n==256)o=8;else if(n==2)o=1;else if(n==32)o=5;else{if(n!=4)return void this.fromRadix(e,n);o=2}this.t=0,this.s=0;for(var f=e.length,_=!1,N=0;0<=--f;){var B=o==8?255&e[f]:C(e,f);B<0?e.charAt(f)=="-"&&(_=!0):(_=!1,N==0?this[this.t++]=B:N+o>this.DB?(this[this.t-1]|=(B&(1<<this.DB-N)-1)<<N,this[this.t++]=B>>this.DB-N):this[this.t-1]|=B<<N,(N+=o)>=this.DB&&(N-=this.DB))}o==8&&128&e[0]&&(this.s=-1,0<N&&(this[this.t-1]|=(1<<this.DB-N)-1<<N)),this.clamp(),_&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var e=this.s&this.DM;0<this.t&&this[this.t-1]==e;)--this.t},t.prototype.dlShiftTo=function(e,n){for(var o=this.t-1;0<=o;--o)n[o+e]=this[o];for(o=e-1;0<=o;--o)n[o]=0;n.t=this.t+e,n.s=this.s},t.prototype.drShiftTo=function(e,n){for(var o=e;o<this.t;++o)n[o-e]=this[o];n.t=Math.max(this.t-e,0),n.s=this.s},t.prototype.lShiftTo=function(e,n){for(var o=e%this.DB,f=this.DB-o,_=(1<<f)-1,N=Math.floor(e/this.DB),B=this.s<<o&this.DM,L=this.t-1;0<=L;--L)n[L+N+1]=this[L]>>f|B,B=(this[L]&_)<<o;for(L=N-1;0<=L;--L)n[L]=0;n[N]=B,n.t=this.t+N+1,n.s=this.s,n.clamp()},t.prototype.rShiftTo=function(e,n){n.s=this.s;var o=Math.floor(e/this.DB);if(o>=this.t)n.t=0;else{var f=e%this.DB,_=this.DB-f,N=(1<<f)-1;n[0]=this[o]>>f;for(var B=o+1;B<this.t;++B)n[B-o-1]|=(this[B]&N)<<_,n[B-o]=this[B]>>f;0<f&&(n[this.t-o-1]|=(this.s&N)<<_),n.t=this.t-o,n.clamp()}},t.prototype.subTo=function(e,n){for(var o=0,f=0,_=Math.min(e.t,this.t);o<_;)f+=this[o]-e[o],n[o++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f-=e.s;o<this.t;)f+=this[o],n[o++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;o<e.t;)f-=e[o],n[o++]=f&this.DM,f>>=this.DB;f-=e.s}n.s=f<0?-1:0,f<-1?n[o++]=this.DV+f:0<f&&(n[o++]=f),n.t=o,n.clamp()},t.prototype.multiplyTo=function(e,n){var o=this.abs(),f=e.abs(),_=o.t;for(n.t=_+f.t;0<=--_;)n[_]=0;for(_=0;_<f.t;++_)n[_+o.t]=o.am(0,f[_],n,_,0,o.t);n.s=0,n.clamp(),this.s!=e.s&&t.ZERO.subTo(n,n)},t.prototype.squareTo=function(e){for(var n=this.abs(),o=e.t=2*n.t;0<=--o;)e[o]=0;for(o=0;o<n.t-1;++o){var f=n.am(o,n[o],e,2*o,0,1);(e[o+n.t]+=n.am(o+1,2*n[o],e,2*o+1,f,n.t-o-1))>=n.DV&&(e[o+n.t]-=n.DV,e[o+n.t+1]=1)}0<e.t&&(e[e.t-1]+=n.am(o,n[o],e,2*o,0,1)),e.s=0,e.clamp()},t.prototype.divRemTo=function(e,n,o){var f=e.abs();if(!(f.t<=0)){if((Xt=this.abs()).t<f.t)return n!=null&&n.fromInt(0),void(o!=null&&this.copyTo(o));o==null&&(o=r());var _=r(),N=this.s,B=e.s;0<(e=this.DB-nt(f[f.t-1]))?(f.lShiftTo(e,_),Xt.lShiftTo(e,o)):(f.copyTo(_),Xt.copyTo(o));var L=_.t,xt=_[L-1];if(xt!=0){var Xt=xt*(1<<this.F1)+(1<L?_[L-2]>>this.F2:0),ae=this.FV/Xt,le=(1<<this.F1)/Xt,Ee=1<<this.F2,Bt=o.t,ge=Bt-L,qt=n==null?r():n;for(_.dlShiftTo(ge,qt),0<=o.compareTo(qt)&&(o[o.t++]=1,o.subTo(qt,o)),t.ONE.dlShiftTo(L,qt),qt.subTo(_,_);_.t<L;)_[_.t++]=0;for(;0<=--ge;){var Ve=o[--Bt]==xt?this.DM:Math.floor(o[Bt]*ae+(o[Bt-1]+Ee)*le);if((o[Bt]+=_.am(0,Ve,o,ge,0,L))<Ve)for(_.dlShiftTo(ge,qt),o.subTo(qt,o);o[Bt]<--Ve;)o.subTo(qt,o)}n!=null&&(o.drShiftTo(L,n),N!=B&&t.ZERO.subTo(n,n)),o.t=L,o.clamp(),0<e&&o.rShiftTo(e,o),N<0&&t.ZERO.subTo(o,o)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var n=3&e;return 0<(n=(n=(n=(n=n*(2-(15&e)*n)&15)*(2-(255&e)*n)&255)*(2-((65535&e)*n&65535))&65535)*(2-e*n%this.DV)%this.DV)?this.DV-n:-n},t.prototype.isEven=function(){return(0<this.t?1&this[0]:this.s)==0},t.prototype.exp=function(e,n){if(4294967295<e||e<1)return t.ONE;var o,f=r(),_=r(),N=n.convert(this),B=nt(e)-1;for(N.copyTo(f);0<=--B;)n.sqrTo(f,_),0<(e&1<<B)?n.mulTo(_,N,f):(o=f,f=_,_=o);return n.revert(f)},t.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var n;if(e==16)n=4;else if(e==8)n=3;else if(e==2)n=1;else if(e==32)n=5;else{if(e!=4)return this.toRadix(e);n=2}var o,f=(1<<n)-1,_=!1,N="",B=this.t,L=this.DB-B*this.DB%n;if(0<B--)for(L<this.DB&&0<(o=this[B]>>L)&&(_=!0,N=E(o));0<=B;)L<n?(o=(this[B]&(1<<L)-1)<<n-L,o|=this[--B]>>(L+=this.DB-n)):(o=this[B]>>(L-=n)&f,L<=0&&(L+=this.DB,--B)),(_=0<o||_)&&(N+=E(o));return _?N:"0"},t.prototype.negate=function(){var e=r();return t.ZERO.subTo(this,e),e},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(e){var n=this.s-e.s;if(n!=0)return n;var o=this.t;if((n=o-e.t)!=0)return this.s<0?-n:n;for(;0<=--o;)if((n=this[o]-e[o])!=0)return n;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+nt(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var n=r();return this.abs().divRemTo(e,null,n),this.s<0&&0<n.compareTo(t.ZERO)&&e.subTo(n,n),n},t.prototype.modPowInt=function(e,n){return n=new(e<256||n.isEven()?ot:b)(n),this.exp(e,n)},t.ZERO=w(0),t.ONE=w(1),lt.prototype.convert=Ct,lt.prototype.revert=Ct,lt.prototype.mulTo=function(e,n,o){e.multiplyTo(n,o)},lt.prototype.sqrTo=function(e,n){e.squareTo(n)},q.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var n=r();return e.copyTo(n),this.reduce(n),n},q.prototype.revert=function(e){return e},q.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);0<=e.compareTo(this.m);)e.subTo(this.m,e)},q.prototype.mulTo=function(e,n,o){e.multiplyTo(n,o),this.reduce(o)},q.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)};var X,Y=[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],G=(1<<26)/Y[Y.length-1];function K(){var e;e=new Date().getTime(),gt[et++]^=255&e,gt[et++]^=e>>8&255,gt[et++]^=e>>16&255,gt[et++]^=e>>24&255,Ye<=et&&(et-=Ye)}if(t.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},t.prototype.toRadix=function(e){if(e==null&&(e=10),this.signum()==0||e<2||36<e)return"0";var n=this.chunkSize(e),o=Math.pow(e,n),f=w(o),_=r(),N=r(),B="";for(this.divRemTo(f,_,N);0<_.signum();)B=(o+N.intValue()).toString(e).substr(1)+B,_.divRemTo(f,_,N);return N.intValue().toString(e)+B},t.prototype.fromRadix=function(e,n){this.fromInt(0);for(var o=this.chunkSize(n=n==null?10:n),f=Math.pow(n,o),_=!1,N=0,B=0,L=0;L<e.length;++L){var xt=C(e,L);xt<0?e.charAt(L)=="-"&&this.signum()==0&&(_=!0):(B=n*B+xt,++N>=o&&(this.dMultiply(f),this.dAddOffset(B,0),B=N=0))}0<N&&(this.dMultiply(Math.pow(n,N)),this.dAddOffset(B,0)),_&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,n,o){if(typeof n=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,o),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),tt,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 f=new Array;o=7&e,f.length=1+(e>>3),n.nextBytes(f),0<o?f[0]&=(1<<o)-1:f[0]=0,this.fromString(f,256)}},t.prototype.bitwiseTo=function(e,n,o){for(var f,_=Math.min(e.t,this.t),N=0;N<_;++N)o[N]=n(this[N],e[N]);if(e.t<this.t){for(f=e.s&this.DM,N=_;N<this.t;++N)o[N]=n(this[N],f);o.t=this.t}else{for(f=this.s&this.DM,N=_;N<e.t;++N)o[N]=n(f,e[N]);o.t=e.t}o.s=n(this.s,e.s),o.clamp()},t.prototype.changeBit=function(e,n){return e=t.ONE.shiftLeft(e),this.bitwiseTo(e,n,e),e},t.prototype.addTo=function(e,n){for(var o=0,f=0,_=Math.min(e.t,this.t);o<_;)f+=this[o]+e[o],n[o++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f+=e.s;o<this.t;)f+=this[o],n[o++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;o<e.t;)f+=e[o],n[o++]=f&this.DM,f>>=this.DB;f+=e.s}n.s=f<0?-1:0,0<f?n[o++]=f:f<-1&&(n[o++]=this.DV+f),n.t=o,n.clamp()},t.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(e,n){if(e!=0){for(;this.t<=n;)this[this.t++]=0;for(this[n]+=e;this[n]>=this.DV;)this[n]-=this.DV,++n>=this.t&&(this[this.t++]=0),++this[n]}},t.prototype.multiplyLowerTo=function(e,n,o){var f,_=Math.min(this.t+e.t,n);for(o.s=0,o.t=_;0<_;)o[--_]=0;for(f=o.t-this.t;_<f;++_)o[_+this.t]=this.am(0,e[_],o,_,0,this.t);for(f=Math.min(e.t,n);_<f;++_)this.am(0,e[_],o,_,0,n-_);o.clamp()},t.prototype.multiplyUpperTo=function(e,n,o){var f=o.t=this.t+e.t- --n;for(o.s=0;0<=--f;)o[f]=0;for(f=Math.max(n-this.t,0);f<e.t;++f)o[this.t+f-n]=this.am(n-f,e[f],o,0,0,this.t+f-n);o.clamp(),o.drShiftTo(1,o)},t.prototype.modInt=function(e){if(e<=0)return 0;var n=this.DV%e,o=this.s<0?e-1:0;if(0<this.t)if(n==0)o=this[0]%e;else for(var f=this.t-1;0<=f;--f)o=(n*o+this[f])%e;return o},t.prototype.millerRabin=function(e){var n=this.subtract(t.ONE),o=n.getLowestSetBit();if(o<=0)return!1;var f=n.shiftRight(o);Y.length<(e=e+1>>1)&&(e=Y.length);for(var _=r(),N=0;N<e;++N){_.fromInt(Y[Math.floor(Math.random()*Y.length)]);var B=_.modPow(f,this);if(B.compareTo(t.ONE)!=0&&B.compareTo(n)!=0){for(var L=1;L++<o&&B.compareTo(n)!=0;)if((B=B.modPowInt(2,this)).compareTo(t.ONE)==0)return!1;if(B.compareTo(n)!=0)return!1}}return!0},t.prototype.clone=function(){var e=r();return this.copyTo(e),e},t.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},t.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},t.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},t.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},t.prototype.toByteArray=function(){var e=this.t,n=new Array;n[0]=this.s;var o,f=this.DB-e*this.DB%8,_=0;if(0<e--)for(f<this.DB&&(o=this[e]>>f)!=(this.s&this.DM)>>f&&(n[_++]=o|this.s<<this.DB-f);0<=e;)f<8?(o=(this[e]&(1<<f)-1)<<8-f,o|=this[--e]>>(f+=this.DB-8)):(o=this[e]>>(f-=8)&255,f<=0&&(f+=this.DB,--e)),128&o&&(o|=-256),_==0&&(128&this.s)!=(128&o)&&++_,(0<_||o!=this.s)&&(n[_++]=o);return n},t.prototype.equals=function(e){return this.compareTo(e)==0},t.prototype.min=function(e){return this.compareTo(e)<0?this:e},t.prototype.max=function(e){return 0<this.compareTo(e)?this:e},t.prototype.and=function(e){var n=r();return this.bitwiseTo(e,H,n),n},t.prototype.or=function(e){var n=r();return this.bitwiseTo(e,tt,n),n},t.prototype.xor=function(e){var n=r();return this.bitwiseTo(e,W,n),n},t.prototype.andNot=function(e){var n=r();return this.bitwiseTo(e,it,n),n},t.prototype.not=function(){for(var e=r(),n=0;n<this.t;++n)e[n]=this.DM&~this[n];return e.t=this.t,e.s=~this.s,e},t.prototype.shiftLeft=function(e){var n=r();return e<0?this.rShiftTo(-e,n):this.lShiftTo(e,n),n},t.prototype.shiftRight=function(e){var n=r();return e<0?this.lShiftTo(-e,n):this.rShiftTo(e,n),n},t.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+(function(n){if(n==0)return-1;var o=0;return!(65535&n)&&(n>>=16,o+=16),!(255&n)&&(n>>=8,o+=8),!(15&n)&&(n>>=4,o+=4),!(3&n)&&(n>>=2,o+=2),!(1&n)&&++o,o})(this[e]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var e=0,n=this.s&this.DM,o=0;o<this.t;++o)e+=(function(f){for(var _=0;f!=0;)f&=f-1,++_;return _})(this[o]^n);return e},t.prototype.testBit=function(e){var n=Math.floor(e/this.DB);return n>=this.t?this.s!=0:!!(this[n]&1<<e%this.DB)},t.prototype.setBit=function(e){return this.changeBit(e,tt)},t.prototype.clearBit=function(e){return this.changeBit(e,it)},t.prototype.flipBit=function(e){return this.changeBit(e,W)},t.prototype.add=function(e){var n=r();return this.addTo(e,n),n},t.prototype.subtract=function(e){var n=r();return this.subTo(e,n),n},t.prototype.multiply=function(e){var n=r();return this.multiplyTo(e,n),n},t.prototype.divide=function(e){var n=r();return this.divRemTo(e,n,null),n},t.prototype.remainder=function(e){var n=r();return this.divRemTo(e,null,n),n},t.prototype.divideAndRemainder=function(e){var n=r(),o=r();return this.divRemTo(e,n,o),new Array(n,o)},t.prototype.modPow=function(e,n){var o=e.bitLength(),f=w(1);if(o<=0)return f;var _=o<18?1:o<48?3:o<144?4:o<768?5:6,N=new(o<8?ot:n.isEven()?q:b)(n),B=new Array,L=3,xt=_-1,Xt=(1<<_)-1;if(B[1]=N.convert(this),1<_){var ae=r();for(N.sqrTo(B[1],ae);L<=Xt;)B[L]=r(),N.mulTo(ae,B[L-2],B[L]),L+=2}var le,Ee,Bt=e.t-1,ge=!0,qt=r();for(o=nt(e[Bt])-1;0<=Bt;){for(xt<=o?le=e[Bt]>>o-xt&Xt:(le=(e[Bt]&(1<<o+1)-1)<<xt-o,0<Bt&&(le|=e[Bt-1]>>this.DB+o-xt)),L=_;!(1&le);)le>>=1,--L;if((o-=L)<0&&(o+=this.DB,--Bt),ge)B[le].copyTo(f),ge=!1;else{for(;1<L;)N.sqrTo(f,qt),N.sqrTo(qt,f),L-=2;0<L?N.sqrTo(f,qt):(Ee=f,f=qt,qt=Ee),N.mulTo(qt,B[le],f)}for(;0<=Bt&&!(e[Bt]&1<<o);)N.sqrTo(f,qt),Ee=f,f=qt,qt=Ee,--o<0&&(o=this.DB-1,--Bt)}return N.revert(f)},t.prototype.modInverse=function(e){var n=e.isEven();if(this.isEven()&&n||e.signum()==0)return t.ZERO;for(var o=e.clone(),f=this.clone(),_=w(1),N=w(0),B=w(0),L=w(1);o.signum()!=0;){for(;o.isEven();)o.rShiftTo(1,o),n?(_.isEven()&&N.isEven()||(_.addTo(this,_),N.subTo(e,N)),_.rShiftTo(1,_)):N.isEven()||N.subTo(e,N),N.rShiftTo(1,N);for(;f.isEven();)f.rShiftTo(1,f),n?(B.isEven()&&L.isEven()||(B.addTo(this,B),L.subTo(e,L)),B.rShiftTo(1,B)):L.isEven()||L.subTo(e,L),L.rShiftTo(1,L);0<=o.compareTo(f)?(o.subTo(f,o),n&&_.subTo(B,_),N.subTo(L,N)):(f.subTo(o,f),n&&B.subTo(_,B),L.subTo(N,L))}return f.compareTo(t.ONE)!=0?t.ZERO:0<=L.compareTo(e)?L.subtract(e):L.signum()<0?(L.addTo(e,L),L.signum()<0?L.add(e):L):L},t.prototype.pow=function(e){return this.exp(e,new lt)},t.prototype.gcd=function(e){var n=this.s<0?this.negate():this.clone(),o=e.s<0?e.negate():e.clone();n.compareTo(o)<0&&(_=n,n=o,o=_);var f=n.getLowestSetBit(),_=o.getLowestSetBit();if(_<0)return n;for(0<(_=f<_?f:_)&&(n.rShiftTo(_,n),o.rShiftTo(_,o));0<n.signum();)0<(f=n.getLowestSetBit())&&n.rShiftTo(f,n),0<(f=o.getLowestSetBit())&&o.rShiftTo(f,o),0<=n.compareTo(o)?(n.subTo(o,n),n.rShiftTo(1,n)):(o.subTo(n,o),o.rShiftTo(1,o));return 0<_&&o.lShiftTo(_,o),o},t.prototype.isProbablePrime=function(e){var n,o=this.abs();if(o.t==1&&o[0]<=Y[Y.length-1]){for(n=0;n<Y.length;++n)if(o[0]==Y[n])return!0;return!1}if(o.isEven())return!1;for(n=1;n<Y.length;){for(var f=Y[n],_=n+1;_<Y.length&&f<G;)f*=Y[_++];for(f=o.modInt(f);n<_;)if(f%Y[n++]==0)return!1}return o.millerRabin(e)},t.prototype.square=function(){var e=r();return this.squareTo(e),e},t.prototype.Barrett=q,gt==null){var gt=new Array,et=0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var It=new Uint8Array(32);for(window.crypto.getRandomValues(It),Mt=0;Mt<32;++Mt)gt[et++]=It[Mt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var Nt=window.crypto.random(32),Mt=0;Mt<Nt.length;++Mt)gt[et++]=255&Nt.charCodeAt(Mt)}for(;et<Ye;)Mt=Math.floor(65536*Math.random()),gt[et++]=Mt>>>8,gt[et++]=255&Mt;et=0,K()}function ke(){if(X==null){for(K(),(X=new Je).init(gt),et=0;et<gt.length;++et)gt[et]=0;et=0}return X.next()}function hr(){}function Je(){this.i=0,this.j=0,this.S=new Array}hr.prototype.nextBytes=function(e){for(var n=0;n<e.length;++n)e[n]=ke()},Je.prototype.init=function(e){for(var n,o,f=0;f<256;++f)this.S[f]=f;for(f=n=0;f<256;++f)n=n+this.S[f]+e[f%e.length]&255,o=this.S[f],this.S[f]=this.S[n],this.S[n]=o;this.i=0,this.j=0},Je.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var Ye=256;kt.exports={default:t,BigInteger:t,SecureRandom:hr}}.call(T);var wt=Ht.exports.BigInteger,Pt=(function(){function t(){Q(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return R(t,[{key:"getEncodedHex",value:function(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}},{key:"getLength",value:function(){var r=this.v.length/2,s=r.toString(16);return s.length%2==1&&(s="0"+s),r<128?s:(128+s.length/2).toString(16)+s}},{key:"getValue",value:function(){return""}}]),t})(),oe=(function(){Z(r,Pt);var t=k(r);function r(s){var c;return Q(this,r),(c=t.call(this)).t="02",s&&(c.v=(function(d){if((p=d.toString(16))[0]!=="-")p.length%2==1?p="0"+p:p.match(/^[0-7]/)||(p="00"+p);else{var p,E=(p=p.substr(1)).length;E%2==1?E+=1:p.match(/^[0-7]/)||(E+=2);for(var C="",w=0;w<E;w++)C+="f";p=(p=(C=new wt(C,16)).xor(d).add(wt.ONE)).toString(16).replace(/^-/,"")}return p})(s)),c}return R(r,[{key:"getValue",value:function(){return this.v}}]),r})(),ee=(function(){Z(r,Pt);var t=k(r);function r(s){var c;return Q(this,r),(c=t.call(this)).t="30",c.asn1Array=s,c}return R(r,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(s){return s.getEncodedHex()})).join(""),this.v}}]),r})();function jt(t,r){return+t[r+2]<8?1:128&+t.substr(r+2,2)}function ie(t,r){var s=jt(t,r);return(t=t.substr(r+2,2*s))?(+t[0]<8?new wt(t,16):new wt(t.substr(2),16)).intValue():-1}function re(t,r){return r+2*(jt(t,r)+1)}var Lt=Ht.exports.BigInteger,Jt=new Lt("3"),pe=(function(){function t(r,s){Q(this,t),this.x=s,this.q=r}return R(t,[{key:"equals",value:function(r){return r===this||this.q.equals(r.q)&&this.x.equals(r.x)}},{key:"toBigInteger",value:function(){return this.x}},{key:"negate",value:function(){return new t(this.q,this.x.negate().mod(this.q))}},{key:"add",value:function(r){return new t(this.q,this.x.add(r.toBigInteger()).mod(this.q))}},{key:"subtract",value:function(r){return new t(this.q,this.x.subtract(r.toBigInteger()).mod(this.q))}},{key:"multiply",value:function(r){return new t(this.q,this.x.multiply(r.toBigInteger()).mod(this.q))}},{key:"divide",value:function(r){return new t(this.q,this.x.multiply(r.toBigInteger().modInverse(this.q)).mod(this.q))}},{key:"square",value:function(){return new t(this.q,this.x.square().mod(this.q))}}]),t})(),zt=(function(){function t(r,s,c,d){Q(this,t),this.curve=r,this.x=s,this.y=c,this.z=d==null?Lt.ONE:d,this.zinv=null}return R(t,[{key:"getX",value:function(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"getY",value:function(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"equals",value:function(r){return r===this||(this.isInfinity()?r.isInfinity():r.isInfinity()?this.isInfinity():!!r.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(r.z)).mod(this.curve.q).equals(Lt.ZERO)&&r.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(r.z)).mod(this.curve.q).equals(Lt.ZERO))}},{key:"isInfinity",value:function(){return this.x===null&&this.y===null||this.z.equals(Lt.ZERO)&&!this.y.toBigInteger().equals(Lt.ZERO)}},{key:"negate",value:function(){return new t(this.curve,this.x,this.y.negate(),this.z)}},{key:"add",value:function(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var s=this.x.toBigInteger(),c=this.y.toBigInteger(),d=this.z,p=r.x.toBigInteger(),E=r.y.toBigInteger(),C=r.z,w=this.curve.q,nt=s.multiply(C).mod(w);return r=p.multiply(d).mod(w),s=nt.subtract(r),p=c.multiply(C).mod(w),c=E.multiply(d).mod(w),E=p.subtract(c),Lt.ZERO.equals(s)?Lt.ZERO.equals(E)?this.twice():this.curve.infinity:(c=nt.add(r),r=d.multiply(C).mod(w),C=s.square().mod(w),d=s.multiply(C).mod(w),c=r.multiply(E.square()).subtract(c.multiply(C)).mod(w),s=s.multiply(c).mod(w),p=E.multiply(C.multiply(nt).subtract(c)).subtract(p.multiply(d)).mod(w),w=d.multiply(r).mod(w),new t(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(p),w))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var r=this.x.toBigInteger(),s=this.y.toBigInteger(),c=this.z,d=this.curve.q,p=this.curve.a.toBigInteger(),E=r.square().multiply(Jt).add(p.multiply(c.square())).mod(d),C=s.shiftLeft(1).multiply(c).mod(d),w=(p=(w=s.square().mod(d)).multiply(r).multiply(c).mod(d),s=C.square().mod(d),r=E.square().subtract(p.shiftLeft(3)).mod(d),c=C.multiply(r).mod(d),E.multiply(p.shiftLeft(2).subtract(r)).subtract(s.shiftLeft(1).multiply(w)).mod(d));return d=C.multiply(s).mod(d),new t(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(w),d)}},{key:"multiply",value:function(r){if(this.isInfinity())return this;if(!r.signum())return this.curve.infinity;for(var s=r.multiply(Jt),c=this.negate(),d=this,p=s.bitLength()-2;0<p;p--){d=d.twice();var E=s.testBit(p);E!==r.testBit(p)&&(d=d.add(E?this:c))}return d}}]),t})(),Ot=(function(){function t(r,s,c){Q(this,t),this.q=r,this.a=this.fromBigInteger(s),this.b=this.fromBigInteger(c),this.infinity=new zt(this,null,null)}return R(t,[{key:"equals",value:function(r){return r===this||this.q.equals(r.q)&&this.a.equals(r.a)&&this.b.equals(r.b)}},{key:"fromBigInteger",value:function(r){return new pe(this.q,r)}},{key:"decodePointHex",value:function(r){switch(parseInt(r.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:default:return null;case 4:case 6:case 7:var s=(r.length-2)/2,c=r.substr(2,s);return s=r.substr(2+s,s),new zt(this,this.fromBigInteger(new Lt(c,16)),this.fromBigInteger(new Lt(s,16)))}}}]),t})(),Ut={ECPointFp:zt,ECCurveFp:Ot},Zt=Ht.exports.BigInteger,ue=(Ot=Ht.exports.SecureRandom,Ut.ECCurveFp),ce=new Ot,te=(Ut=y()).curve,h=Ut.G,l=Ut.n;function y(){var t=new Zt("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),r=new Zt("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),s=new Zt("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return s=(r=new ue(t,r,s)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:r,G:s,n:new Zt("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function x(t,r){return t.length>=r?t:new Array(r-t.length+1).join("0")+t}function A(t,r){for(var s=[],c=~~(r/8),d=r%8,p=0,E=t.length;p<E;p++)s[p]=(t[(p+c)%E]<<d&255)+(t[(p+c+1)%E]>>>8-d&255);return s}function M(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=255&(t[c]^r[c]);return s}function rt(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=t[c]&r[c]&255;return s}function mt(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=255&(t[c]|r[c]);return s}function pt(t,r){for(var s=[],c=0,d=t.length-1;0<=d;d--){var p=t[d]+r[d]+c;c=255<p?1:0,s[d]=255&p}return s}function Gt(t,r,s,c){return 0<=c&&c<=15?M(M(t,r),s):mt(rt(t,r),rt((function(d){for(var p=[],E=d.length-1;0<=E;E--)p[E]=255&~d[E];return p})(t),s))}function $t(t,r){for(var s=[],c=[],d=0;d<16;d++){var p=4*d;s.push(r.slice(p,4+p))}for(var E,C=16;C<68;C++)s.push(M(M((E=M(M(s[C-16],s[C-9]),A(s[C-3],15)),M(M(E,A(E,15)),A(E,23))),A(s[C-13],7)),s[C-6]));for(var w=0;w<64;w++)c.push(M(s[w],s[w+4]));for(var nt,ot,b,H=[121,204,69,25],tt=[122,135,157,138],W=t.slice(0,4),it=t.slice(4,8),lt=t.slice(8,12),Ct=t.slice(12,16),q=t.slice(16,20),X=t.slice(20,24),Y=t.slice(24,28),G=t.slice(28,32),K=0;K<64;K++){var gt=0<=K&&K<=15?H:tt,et=M(It=A(pt(pt(A(W,12),q),A(gt,K)),7),A(W,12)),It=(et=pt(pt(pt((nt=W,ot=it,b=lt,0<=(gt=K)&&gt<=15?M(M(nt,ot),b):mt(mt(rt(nt,ot),rt(nt,b)),rt(ot,b))),Ct),et),c[K]),pt(pt(pt(Gt(q,X,Y,K),G),It),s[K]));Ct=lt,lt=A(it,9),it=W,W=et,G=Y,Y=A(X,19),X=q,q=M(M(It,A(It,9)),A(It,17))}return M([].concat(W,it,lt,Ct,q,X,Y,G),t)}Ot={getGlobalCurve:function(){return te},generateEcparam:y,generateKeyPairHex:function(t,r,s){return{privateKey:s=x((r=(t?new Zt(t,r,s):new Zt(l.bitLength(),ce)).mod(l.subtract(Zt.ONE)).add(Zt.ONE)).toString(16),64),publicKey:"04"+x((r=h.multiply(r)).getX().toBigInteger().toString(16),64)+x(r.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(t){for(var r=(t=unescape(encodeURIComponent(t))).length,s=[],c=0;c<r;c++)s[c>>>2]|=(255&t.charCodeAt(c))<<24-c%4*8;for(var d=[],p=0;p<r;p++){var E=s[p>>>2]>>>24-p%4*8&255;d.push((E>>>4).toString(16)),d.push((15&E).toString(16))}return d.join("")},leftPad:x,arrayToHex:function(t){return t.map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},arrayToUtf8:function(t){for(var r=[],s=0,c=0;c<2*t.length;c+=2)r[c>>>3]|=parseInt(t[s],10)<<24-c%8*4,s++;try{for(var d=[],p=0;p<t.length;p++){var E=r[p>>>2]>>>24-p%4*8&255;d.push(String.fromCharCode(E))}return decodeURIComponent(escape(d.join("")))}catch(C){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){for(var r=[],s=(t=(s=t.length)%2!=0?x(t,s+1):t).length,c=0;c<s;c+=2)r.push(parseInt(t.substr(c,2),16));return r},verifyPublicKey:function(t){var r=te.decodePointHex(t);return!!r&&(t=r.getX(),r.getY().square().equals(t.multiply(t.square()).add(t.multiply(te.a)).add(te.b)))}},Ut=function(t){for(var r=448<=(r=(C=8*t.length)%512)?512-r%448-1:448-r-1,s=new Array((r-7)/8),c=0,d=s.length;c<d;c++)s[c]=0;for(var p,E=[],C=C.toString(2),w=7;0<=w;w--)8<C.length?(p=C.length-8,E[w]=parseInt(C.substr(p),2),C=C.substr(0,p)):0<C.length?(E[w]=parseInt(C,2),C=""):E[w]=0;for(var nt=[].concat(t,[128],s,E),ot=nt.length/64,b=[115,128,22,111,73,20,178,185,23,36,66,215,218,138,6,0,169,111,48,188,22,49,56,170,227,141,238,77,176,251,14,78],H=0;H<ot;H++){var tt=64*H;b=$t(b,nt.slice(tt,64+tt))}return b};var Et=Ht.exports.BigInteger,zr=function(t,r){return t=new oe(t),r=new oe(r),new ee([t,r]).getEncodedHex()},$r=function(t){var r=re(t,0),s=re(t,r),c=ie(t,r);return r=t.substr(s,2*c),s=re(t,c=s+r.length),c=ie(t,c),t=t.substr(s,2*c),{r:new wt(r,16),s:new wt(t,16)}},ct=Ot,ve=Ut,Ae=(Ot=ct.generateEcparam()).G,sr=Ot.curve,De=Ot.n;function ur(t,r,s){var c=2<arguments.length&&s!==void 0?s:"1234567812345678",d=(c=ct.utf8ToHex(c),ct.leftPad(Ae.curve.a.toBigInteger().toRadix(16),64)),p=ct.leftPad(Ae.curve.b.toBigInteger().toRadix(16),64),E=ct.leftPad(Ae.getX().toBigInteger().toRadix(16),64),C=ct.leftPad(Ae.getY().toBigInteger().toRadix(16),64);return s=(r=128<r.length?r.substr(2,128):r).substr(0,64),r=r.substr(64,64),r=ct.hexToArray(c+d+p+E+C+s+r),c=4*c.length,r.unshift(255&c),r.unshift(c>>8&255),r=ve(r),ct.arrayToHex(ve(r.concat(ct.hexToArray(t))))}function cr(){var t=ct.generateKeyPairHex(),r=sr.decodePointHex(t.publicKey);return t.k=new Et(t.privateKey,16),t.x1=r.getX().toBigInteger(),t}Ot={generateKeyPairHex:ct.generateKeyPairHex,doEncrypt:function(t,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;t=typeof t=="string"?ct.hexToArray(ct.utf8ToHex(t)):Array.prototype.slice.call(t),r=ct.getGlobalCurve().decodePointHex(r);var c=ct.generateKeyPairHex(),d=new Et(c.privateKey,16),p=c.publicKey;128<p.length&&(p=p.substr(p.length-128)),c=r.multiply(d),d=ct.hexToArray(ct.leftPad(c.getX().toBigInteger().toRadix(16),64)),r=ct.hexToArray(ct.leftPad(c.getY().toBigInteger().toRadix(16),64)),c=ct.arrayToHex(ve([].concat(d,t,r)));var E,C=1,w=0,nt=[],ot=[].concat(d,r);(E=function(){nt=ve([].concat(St(ot),[C>>24&255,C>>16&255,C>>8&255,255&C])),C++,w=0})();for(var b=0,H=t.length;b<H;b++)w===nt.length&&E(),t[b]^=255&nt[w++];return r=ct.arrayToHex(t),s===0?p+r+c:p+c+r},doDecrypt:function(t,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,c=(p=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":p;r=new Et(r,16);var d=t.substr(128,64),p=t.substr(192);s===0&&(d=t.substr(t.length-64),p=t.substr(128,t.length-128-64));var E,C=ct.hexToArray(p),w=(t=ct.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(r),r=ct.hexToArray(ct.leftPad(t.getX().toBigInteger().toRadix(16),64)),t=ct.hexToArray(ct.leftPad(t.getY().toBigInteger().toRadix(16),64)),1),nt=0,ot=[],b=[].concat(r,t);(E=function(){ot=ve([].concat(St(b),[w>>24&255,w>>16&255,w>>8&255,255&w])),w++,nt=0})();for(var H=0,tt=C.length;H<tt;H++)nt===ot.length&&E(),C[H]^=255&ot[nt++];return ct.arrayToHex(ve([].concat(r,C,t)))===d?c==="array"?C:ct.arrayToUtf8(C):c==="array"?[]:""},doSignature:function(t,r){var s=(C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,c=C.der,d=C.hash,p=C.publicKey,E=C.userId,C=typeof t=="string"?ct.utf8ToHex(t):ct.arrayToHex(t);d&&(C=ur(C,p||(t=r,d=Ae.multiply(new Et(t,16)),"04"+(t=ct.leftPad(d.getX().toBigInteger().toString(16),64))+(d=ct.leftPad(d.getY().toBigInteger().toString(16),64))),E));var w=new Et(r,16),nt=new Et(C,16),ot=null,b=null,H=null;do do{var tt;ot=(tt=s&&s.length?s.pop():cr()).k,b=nt.add(tt.x1).mod(De)}while(b.equals(Et.ZERO)||b.add(ot).equals(De));while((H=w.add(Et.ONE).modInverse(De).multiply(ot.subtract(b.multiply(w))).mod(De)).equals(Et.ZERO));return c?zr(b,H):ct.leftPad(b.toString(16),64)+ct.leftPad(H.toString(16),64)},doVerifySignature:function(t,r,s){var c,d,p=(C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,E=C.hash,C=C.userId;return t=typeof t=="string"?ct.utf8ToHex(t):ct.arrayToHex(t),E&&(t=ur(t,s,C)),d=p?(c=(d=$r(r)).r,d.s):(c=new Et(r.substring(0,64),16),new Et(r.substring(64),16)),r=sr.decodePointHex(s),s=new Et(t,16),!(t=c.add(d).mod(De)).equals(Et.ZERO)&&(r=Ae.multiply(d).add(r.multiply(t)),s=s.add(r.getX().toBigInteger()).mod(De),c.equals(s))},getPoint:cr,verifyPublicKey:ct.verifyPublicKey};var Qr=Ut,Ne=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],xe=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function Be(t){for(var r=[],s=0,c=t.length;s<c;s+=2)r.push(parseInt(t.substr(s,2),16));return r}function Re(t,r){return t<<r|t>>>32-r}function he(t){return(255&Ne[t>>>24&255])<<24|(255&Ne[t>>>16&255])<<16|(255&Ne[t>>>8&255])<<8|255&Ne[255&t]}function Fe(t){return t^Re(t,2)^Re(t,10)^Re(t,18)^Re(t,24)}function Le(t){return t^Re(t,13)^Re(t,23)}function lr(t,r,s,c){c=(p=(E=3<arguments.length&&c!==void 0?c:{}).padding)===void 0?"pkcs#5":p;var d=E.mode,p=(p=E.iv)===void 0?[]:p,E=(E=E.output)===void 0?"string":E;if(d==="cbc"&&(p=typeof p=="string"?Be(p):p).length!==16)throw new Error("iv is invalid");if((r=typeof r=="string"?Be(r):r).length!==16)throw new Error("key is invalid");if(t=(typeof t=="string"?s!==0?function(q){for(var X=[],Y=0,G=q.length;Y<G;Y++){var K=q.codePointAt(Y);if(K<=127)X.push(K);else if(K<=2047)X.push(192|K>>>6),X.push(128|63&K);else if(K<=55295||57344<=K&&K<=65535)X.push(224|K>>>12),X.push(128|K>>>6&63),X.push(128|63&K);else{if(!(65536<=K&&K<=1114111))throw X.push(K),new Error("input is not supported");Y++,X.push(240|K>>>18&28),X.push(128|K>>>12&63),X.push(128|K>>>6&63),X.push(128|63&K)}}return X}:Be:St)(t),c==="pkcs#5"&&s!==0)for(var C=16-t.length%16,w=0;w<C;w++)t.push(C);var nt=new Array(32);(function(q,X,Y){for(var G=new Array(4),K=new Array(4),gt=0;gt<4;gt++)K[0]=255&q[0+4*gt],K[1]=255&q[1+4*gt],K[2]=255&q[2+4*gt],K[3]=255&q[3+4*gt],G[gt]=K[0]<<24|K[1]<<16|K[2]<<8|K[3];G[0]^=2746333894,G[1]^=1453994832,G[2]^=1736282519,G[3]^=2993693404;for(var et,It=0;It<32;It+=4)et=G[1]^G[2]^G[3]^xe[It+0],X[It+0]=G[0]^=Le(he(et)),et=G[2]^G[3]^G[0]^xe[It+1],X[It+1]=G[1]^=Le(he(et)),et=G[3]^G[0]^G[1]^xe[It+2],X[It+2]=G[2]^=Le(he(et)),et=G[0]^G[1]^G[2]^xe[It+3],X[It+3]=G[3]^=Le(he(et));if(Y===0)for(var Nt,Mt=0;Mt<16;Mt++)Nt=X[Mt],X[Mt]=X[31-Mt],X[31-Mt]=Nt})(r,nt,s);for(var ot=[],b=p,H=t.length,tt=0;16<=H;){var W=t.slice(tt,tt+16),it=new Array(16);if(d==="cbc")for(var lt=0;lt<16;lt++)s!==0&&(W[lt]^=b[lt]);(function(q,X,Y){for(var G=new Array(4),K=new Array(4),gt=0;gt<4;gt++)K[0]=255&q[4*gt],K[1]=255&q[4*gt+1],K[2]=255&q[4*gt+2],K[3]=255&q[4*gt+3],G[gt]=K[0]<<24|K[1]<<16|K[2]<<8|K[3];for(var et,It=0;It<32;It+=4)et=G[1]^G[2]^G[3]^Y[It+0],G[0]^=Fe(he(et)),et=G[2]^G[3]^G[0]^Y[It+1],G[1]^=Fe(he(et)),et=G[3]^G[0]^G[1]^Y[It+2],G[2]^=Fe(he(et)),et=G[0]^G[1]^G[2]^Y[It+3],G[3]^=Fe(he(et));for(var Nt=0;Nt<16;Nt+=4)X[Nt]=G[3-Nt/4]>>>24&255,X[Nt+1]=G[3-Nt/4]>>>16&255,X[Nt+2]=G[3-Nt/4]>>>8&255,X[Nt+3]=255&G[3-Nt/4]})(W,it,nt);for(var Ct=0;Ct<16;Ct++)d==="cbc"&&s===0&&(it[Ct]^=b[Ct]),ot[tt+Ct]=it[Ct];d==="cbc"&&(b=s!==0?it:W),H-=16,tt+=16}return c==="pkcs#5"&&s===0&&(c=ot[ot.length-1],ot.splice(ot.length-c,c)),E!=="array"?s!==0?ot.map((function(q){return(q=q.toString(16)).length===1?"0"+q:q})).join(""):(function(q){for(var X=[],Y=0,G=q.length;Y<G;Y++)240<=q[Y]&&q[Y]<=247?(X.push(String.fromCodePoint(((7&q[Y])<<18)+((63&q[Y+1])<<12)+((63&q[Y+2])<<6)+(63&q[Y+3]))),Y+=3):224<=q[Y]&&q[Y]<=239?(X.push(String.fromCodePoint(((15&q[Y])<<12)+((63&q[Y+1])<<6)+(63&q[Y+2]))),Y+=2):192<=q[Y]&&q[Y]<=223?(X.push(String.fromCodePoint(((31&q[Y])<<6)+(63&q[Y+1]))),Y++):X.push(String.fromCodePoint(q[Y]));return X.join("")})(ot):ot}var Zr=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],ye=[],tn=function(t,r,s){for(var c=t[0],d=t[1],p=t[2],E=t[3],C=t[4],w=t[5],nt=t[6],ot=t[7],b=0;b<64;b++){b<16?ye[b]=0|r[s+b]:(H=ye[b-15],tt=ye[b-2],ye[b]=((H<<25|H>>>7)^(H<<14|H>>>18)^H>>>3)+ye[b-7]+((tt<<15|tt>>>17)^(tt<<13|tt>>>19)^tt>>>10)+ye[b-16]);var H=c&d^c&p^d&p,tt=ot+((C<<26|C>>>6)^(C<<21|C>>>11)^(C<<7|C>>>25))+(C&w^~C&nt)+Zr[b]+ye[b];ot=nt,nt=w,w=C,C=E+tt|0,E=p,p=d,d=c,c=tt+(((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+H)|0}t[0]=t[0]+c|0,t[1]=t[1]+d|0,t[2]=t[2]+p|0,t[3]=t[3]+E|0,t[4]=t[4]+C|0,t[5]=t[5]+w|0,t[6]=t[6]+nt|0,t[7]=t[7]+ot|0},fr=(Ot={c2:Ot,c3:function(t){return t=typeof t=="string"?(function(r){for(var s=[],c=0,d=r.length;c<d;c++){var p=r.codePointAt(c);if(p<=127)s.push(p);else if(p<=2047)s.push(192|p>>>6),s.push(128|63&p);else if(p<=55295||57344<=p&&p<=65535)s.push(224|p>>>12),s.push(128|p>>>6&63),s.push(128|63&p);else{if(!(65536<=p&&p<=1114111))throw s.push(p),new Error("input is not supported");c++,s.push(240|p>>>18&28),s.push(128|p>>>12&63),s.push(128|p>>>6&63),s.push(128|63&p)}}return s})(t):Array.prototype.slice.call(t),Qr(t).map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},c4:{encrypt:function(t,r,s){return lr(t,r,1,s)},decrypt:function(t,r,s){return lr(t,r,0,s)}},s2:function(t){var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],s=(function(d){for(var p=[],E=0;E<Math.ceil(d.length/4);E++)p[E]=d[4*E]<<24|(255&d[4*E+1])<<16|(255&d[4*E+2])<<8|255&d[4*E+3];return p})(t);s[(t=8*t.length)>>5]|=128<<24-t%32,s[15+(64+t>>9<<4)]=t;for(var c=0;c<s.length;c+=16)tn(r,s,c);return(function(d){for(var p=[],E=0;E<d.length;E++)p[4*E]=d[E]>>24&255,p[4*E+1]=d[E]>>16&255,p[4*E+2]=d[E]>>8&255,p[4*E+3]=255&d[E];return p})(r).map((function(d){return(d=d.toString(16)).length===1?"0"+d:d})).join("")}},vt),en=yt,rn=Dt,nn=Yt,on=Wt,an=Ot.c2,sn=Ot.c3,un=Ot.c4,cn=Ot.s2;return(function(){var t;(t=function(){}).VERSION="2.1.0";var r=T;if(r.AAR2)return r.AAR2.VERSION!==t.VERSION&&console.log(r.AAR2.VERSION),r.AAR2;var s="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",c=!1,d=!1,p=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,E=p!==void 0&&!!p.request&&!!p.login,C=function(b,H){return typeof b=="string"&&typeof H=="string"&&b!=null&&H!=null&&b.substring(0,H.length)===H},w={SUCCESS:0,ALREADY_SUCCESS:1,ERROR_XHR_TIMEOUT:-1,ERROR_XHR_ERROR:-2,ERROR_XXX_REQUEST_TIMEOUT:-3,ERROR_XXX_REQUEST_FAIL:-4,ERROR_SIGN_CHECK:-5,ERROR_UNKNOWN_ERROR:-6,ERROR_DATA_FORMAT:-7},nt=function(b){for(var H in w)if(w[H]===b)return H},ot=function(b,H,tt){var W=Date.now(),it=new t;try{if(!b||b.length<=75)return console.error("error format 1:",b),w.ERROR_DATA_FORMAT;if(!C(b,"eyJ"))return console.error("error format 2:",b),w.ERROR_DATA_FORMAT;b=b.substring(3,b.length);var lt=en.my_b4_decode(b);if(!lt)return console.error("error format 3:",b),w.ERROR_DATA_FORMAT;var Ct,q=it.cc.u8.byteToInt(lt.slice(0,4),0),X=lt.slice(4,4+q),Y=it.cc.u8.byteToInt(lt.slice(4+q,4+q+4),0),G=lt.slice(4+q+4,4+q+4+Y),K=it.cc.u8.byteToInt(lt.slice(4+q+4+Y,4+q+4+Y+4),0),gt=lt.slice(4+q+4+Y+4,4+q+4+Y+4+K),et=it.cc.u8.bytesToUtf8Str(X);if(it.cc.h6.encode(G,0,Y),H||(tt!==void 0&&tt==="sm2"?(Ct=it.cc.h6.encode(G,0,Y),it.co.c2.doVerifySignature(et,Ct,s,{der:!0,hash:!0})):it.co.c3(et+"8890012345678890").toLowerCase()===it.cc.h6.encode(gt,0,K).toLowerCase())){if(et.length%2==0){t.prototype.__v=function(){return et.slice(0,2)};for(var It=[],Nt=2;Nt<66;Nt+=2)It.push(parseInt("0x"+et.slice(Nt,Nt+2)));t.prototype.__i=function(){return It};var Mt=parseInt("0x"+et.slice(66,82))-W;t.prototype.__o=function(){return Mt}}return E||T.AAR2||(T.AAR2=t),w.SUCCESS}}catch(ke){return console.error(ke),w.ERROR_UNKNOWN_ERROR}return w.ERROR_SIGN_CHECK};return t.init=function(b,H){var tt,W={debug:!1,url:"https://aks.jdpay.com/aar2/getJS",callback:function(){}};typeof b=="string"?(C(b,"https")||C(b,"https")?W.url=b:C(b,"eyJ")&&(W.code=b),typeof H=="string"&&(W.publicKey=H)):ht(b)==="object"&&(b.debug&&(W.debug=b.debug),b.url&&(W.url=b.url),b.code&&(W.code=b.code),b.publicKey&&(W.publicKey=b.publicKey),b.skipVerify&&(W.skipVerify=b.skipVerify),b.alg&&(W.alg=b.alg),b.callback&&typeof b.callback=="function"&&(W.callback=b.callback)),d?W.callback&&W.callback(!0,{errorNo:tt=w.ALREADY_SUCCESS,errorMsg:nt(tt)}):c?setTimeout((function(){t.init(b,H)}),50):(c=!0,W.debug&&fr.start(W.debug),W.publicKey&&(s=W.publicKey),W.code?(tt=ot(W.code,W.skipVerify))===w.SUCCESS?(c=!(d=!0),W.callback(!0,{errorNo:tt,errorMsg:nt(tt)})):W.callback(!1,{errorNo:tt,errorMsg:nt(tt)}):W.url&&(function(it,lt,Ct){try{if(it=it+"?version="+t.VERSION+(E?"&name=wechat":"&name=browser")+"&t="+Date.now(),E)p.request({url:it,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function(X){X.statusCode===200?lt(X.data):Ct(w.ERROR_XXX_REQUEST_FAIL)},fail:function(X){X&&X.errMsg&&X.errMsg.indexOf("timeout")!==-1?Ct(w.ERROR_XXX_REQUEST_TIMEOUT):Ct(w.ERROR_XXX_REQUEST_FAIL)}});else{var q;if(window.XMLHttpRequest)q=new XMLHttpRequest;else if(window.ActiveXObject)try{q=new ActiveXObject("Msxml2.XMLHTTP")}catch(X){try{q=new ActiveXObject("Microsoft.XMLHTTP")}catch(Y){}}q&&(q.onload=function(){q.readyState===4&&(q.status===200?lt(q.responseText):Ct(w.ERROR_XHR_ERROR))},q.ontimeout=function(){Ct(w.ERROR_XHR_TIMEOUT)},q.onerror=function(){Ct(w.ERROR_XHR_ERROR)},q.open("POST",it,!0),q.timeout=5e3,q.send(null))}}catch(X){console.error(X),Ct(w.ERROR_UNKNOWN_ERROR)}})(W.url,(function(it){(it=ot(it,W.skipVerify,W.alg))===w.SUCCESS?(c=!(d=!0),W.callback(!0,{errorNo:it,errorMsg:nt(it)})):(c=!1,W.callback(!1,{errorNo:it,errorMsg:nt(it)}))}),(function(it){c=!1,W.callback(!1,{errorNo:it,errorMsg:nt(it)})})))},t.prototype={cc:{b4:rn,h6:nn,u8:on},co:{c2:an,c3:sn,c4:un,s2:cn},nonce:function(){var b="0000000000"+Math.ceil(2147483647*Math.random())+Math.floor((Date.now()+this.__o())/1e3);return b.substring(b.length-20)},sign:function(b,H){return this.__s(b,H)},__s:function(b,H){var tt=this.cc.u8.utf8StrToBytes(b),W=this.__i();return b=this.cc.u8.utf8StrToBytes(H),H=this.cc.u8.utf8StrToBytes(this.__c()),b=[].concat(tt,W,b,H),H=parseInt("0x"+this.__v()),this.__f(H)(b)+this.__v()},__f:function(b){var H=this.co.s2,tt=this.co.c3,W=this.cc.h6.decode,it=[function(lt){return H(lt)},function(lt){return tt(lt)},function(lt){return tt(W(H(lt)))},function(lt){return H(W(tt(lt)))},function(lt){return tt(W(tt(lt)))},function(lt){return H(W(H(lt)))}];return it[(128<b?b-128:b)%it.length]},__i:function(){return[115,128,22,111,73,20,178,185,23,36,66,215,218,138,6,0,169,111,48,188,22,49,56,170,227,141,238,77,176,251,14,78]},__v:function(){return"00"},__c:function(){if(this.__d())return"debug";if(typeof phantom!="undefined"&&phantom.exit&&phantom.injectJs)return"phantom";if(typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]"&&process.version&&process.pid&&process.argv)return"require";if(p!==void 0&&p.env&&p.request&&p.getStorage){if(typeof window!="undefined"&&window.document&&window.alert&&window.atob&&typeof window.setTimeout=="function")return"window"}else{if(!(typeof window!="undefined"&&window.document&&window.alert&&window.atob&&typeof window.setTimeout=="function"))return"window";if(!window.navigator||typeof window.navigator.vendor!="string")return"navigator";if(window.navigator.webdriver)return"webdriver"}return""},__o:function(){return 0},__d:function(){return fr.isDebug()},version:function(){return t.VERSION}},t})()},Rt(D)=="object"?g.exports=at():($=typeof(J=at)=="function"?J.call(D,S,D,g):J)===void 0||(g.exports=$)}},a={};function u(g){var D=a[g];if(D!==void 0)return D.exports;var S=a[g]={id:g,loaded:!1,exports:{}};return i[g].call(S.exports,S,S.exports,u),S.loaded=!0,S.exports}u.n=g=>{var D=g&&g.__esModule?()=>g.default:()=>g;return u.d(D,{a:D}),D},u.d=(g,D)=>{for(var S in D)u.o(D,S)&&!u.o(g,S)&&Object.defineProperty(g,S,{enumerable:!0,get:D[S]})},u.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(g){if(typeof window=="object")return window}})(),u.hmd=g=>((g=Object.create(g)).children||(g.children=[]),Object.defineProperty(g,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+g.id)}}),g),u.o=(g,D)=>Object.prototype.hasOwnProperty.call(g,D),u.r=g=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(g,"__esModule",{value:!0})};var v=u(737);Or.exports.LyyGetCommandSDK=v})()});var Kt={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},fe={SIT:"sit",RELEASE:"release",PROD:"prod"},Me={[Kt.DEV]:"https://dm.leyaoyao.com",[Kt.SIT]:"https://sm.leyaoyao.com",[Kt.UAT]:"https://um.leyaoyao.com",[Kt.PROD]:"https://m.leyaoyao.com"},yr={[Kt.DEV]:"https://dad2.leyaoyao.com",[Kt.SIT]:"https://sad2.leyaoyao.com",[Kt.UAT]:"https://uad2.leyaoyao.com",[Kt.PROD]:"https://nad.ehuoke.com"},we={[fe.SIT]:"https://sopenapi.leyaoyao.com",[fe.RELEASE]:"https://uopen-api.leyaoyao.com",[fe.PROD]:"https://api-gateway.leyaoyao.com"};function je(i,a){return`${Me[i]||Me[Kt.PROD]}${a}`}function gr(i){return yr[i]||yr[Kt.PROD]}var Ie={debug:!1,env:Kt.PROD,externalEnv:fe.PROD,apiDomain:""},mr=bt({},Ie);function _r(i){mr=bt(bt({},Ie),i)}function de(){return mr}var yn=Object.defineProperty,gn=(i,a,u)=>a in i?yn(i,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[a]=u,mn=(i,a,u)=>gn(i,typeof a!="symbol"?a+"":a,u);function se(){return typeof Taro!="undefined"&&Taro.getEnv?"taro":typeof uni!="undefined"&&uni.request?"uni":typeof wx!="undefined"&&wx.request?"wechat":typeof my!="undefined"&&my.request?"alipay":typeof window!="undefined"?"web":"unknown"}var _n=class{constructor(i=!1){mn(this,"enable"),this.enable=i}setEnable(i){this.enable=i}info(...i){this.enable&&console.info("[BI Info]",...i)}warn(...i){this.enable&&console.warn("[BI Warn]",...i)}error(...i){this.enable&&console.error("[BI Error]",...i)}debug(...i){this.enable&&console.log("[BI Debug]",...i)}},U=new _n;function Xe(i){let a=se();return a==="taro"?Taro.setClipboardData({data:i}).then(()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):a==="uni"?new Promise((u,v)=>{uni.setClipboardData({data:i,success:()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{U.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),v(g)}})}):a==="wechat"?new Promise((u,v)=>{wx.setClipboardData({data:i,success:()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{U.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),v(g)}})}):a==="alipay"?new Promise((u,v)=>{my.setClipboardData({text:i,success:()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{U.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),v(g)}})}):navigator.clipboard.writeText(i).then(()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function Ke(i,a=2e3){let u=se();if(u==="taro"){Taro.showToast({title:i,icon:"none",mask:!0,duration:a});return}if(u==="uni"){uni.showToast({title:i,icon:"none",mask:!0,duration:a});return}if(u==="wechat"){wx.showToast({title:i,icon:"none",mask:!0,duration:a});return}if(u==="alipay"){my.showToast({content:i,duration:a});return}typeof console!="undefined"&&console.log(`[Toast] ${i}`)}async function me(){var i,a,u,v,g;let D=se();try{if(D==="taro")return((i=(await Taro.getSystemInfo()).platform)==null?void 0:i.toLowerCase())==="ios"?"ios":"android";if(D==="uni")return((a=uni.getSystemInfoSync().platform)==null?void 0:a.toLowerCase())==="ios"?"ios":"android";if(D==="wechat")return wx.getDeviceInfo?((u=(await wx.getDeviceInfo()).platform)==null?void 0:u.toLowerCase())==="ios"?"ios":"android":((v=wx.getSystemInfoSync().platform)==null?void 0:v.toLowerCase())==="ios"?"ios":"android";if(D==="alipay")return((g=my.getSystemInfoSync().platform)==null?void 0:g.toLowerCase())==="ios"?"ios":"android";if(typeof navigator!="undefined"){let S=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(S))return"ios";if(/android/.test(S))return"android"}return"unknown"}catch(S){return U.error("\u83B7\u53D6\u5E73\u53F0\u4FE1\u606F\u5931\u8D25",S),"unknown"}}var Ft={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function z(i,a,u=null){return{code:i,message:a,data:u}}function qe(i,a){return i==null?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof i=="string"&&i.trim().length===0?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function Pe(i,a){for(let u of a){let v=qe(i[u],u);if(!v.valid)return v}return{valid:!0}}var tr={};Ge(tr,{handleJdInsurance:()=>Lr,handleJdInsuranceExt:()=>Ur,handleJdjrCashLoanExt:()=>Cr,handleJdjrCashLoanFlow:()=>Pr});var We=(k=>(k[k.JD_CASH_LOAN__MISSING_PHONE=2001]="JD_CASH_LOAN__MISSING_PHONE",k[k.JD_CASH_LOAN__MISSING_DEVICE_ID=2002]="JD_CASH_LOAN__MISSING_DEVICE_ID",k[k.JD_CASH_LOAN__RTA_FAILED=2003]="JD_CASH_LOAN__RTA_FAILED",k[k.JD_CASH_LOAN__GET_CONFIG_FAILED=2004]="JD_CASH_LOAN__GET_CONFIG_FAILED",k[k.JD_CASH_LOAN__INVALID_CONFIG=2005]="JD_CASH_LOAN__INVALID_CONFIG",k[k.JD_CASH_LOAN__EXT_NOT_ELIGIBLE=2006]="JD_CASH_LOAN__EXT_NOT_ELIGIBLE",k[k.JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS=2007]="JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS",k[k.JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM=2008]="JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM",k[k.JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID=2009]="JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID",k[k.JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE=2010]="JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE",k[k.JD_INSURANCE__USER_NOT_ELIGIBLE=2101]="JD_INSURANCE__USER_NOT_ELIGIBLE",k[k.JD_INSURANCE__H5_NOT_SUPPORTED=2102]="JD_INSURANCE__H5_NOT_SUPPORTED",k[k.JD_INSURANCE__INVALID_JUMP_PARAMS=2103]="JD_INSURANCE__INVALID_JUMP_PARAMS",k[k.JD_INSURANCE__GET_CONFIG_FAILED=2104]="JD_INSURANCE__GET_CONFIG_FAILED",k[k.JD_INSURANCE__COPY_FAILED=2105]="JD_INSURANCE__COPY_FAILED",k[k.JD_INSURANCE__TASK_COMPLETED=2106]="JD_INSURANCE__TASK_COMPLETED",k[k.JD_INSURANCE__UNKNOWN_JUMP_MODE=2107]="JD_INSURANCE__UNKNOWN_JUMP_MODE",k[k.JD_INSURANCE__RTA_FAILED=2108]="JD_INSURANCE__RTA_FAILED",k))(We||{}),Tt={2001:"\u7F3A\u5C11\u624B\u673A\u53F7\u53C2\u6570",2002:"\u7F3A\u5C11\u8BBE\u5907ID",2003:"\u672A\u6EE1\u8DB3\u6D3B\u52A8\u8D44\u683C",2004:"\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E\u5931\u8D25",2005:"\u8DF3\u8F6C\u914D\u7F6E\u53C2\u6570\u5F02\u5E38",2006:"\u7528\u6237\u4E0D\u7B26\u5408\u6D3B\u52A8\u53C2\u4E0E\u6761\u4EF6",2007:"\u8DF3\u8F6C\u53C2\u6570\u5F02\u5E38",2008:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u5E73\u53F0\u53C2\u6570",2009:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u7528\u6237ID",2010:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u8BBE\u5907\u503C",2101:"\u7528\u6237\u4E0D\u7B26\u5408\u6D3B\u52A8\u53C2\u4E0E\u6761\u4EF6",2102:"H5\u6A21\u5F0F\u6682\u4E0D\u652F\u6301",2103:"\u8DF3\u8F6C\u53C2\u6570\u5F02\u5E38",2104:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u5931\u8D25",2105:"\u590D\u5236\u53E3\u4EE4\u5931\u8D25",2106:"\u7528\u6237\u5DF2\u5B8C\u6210\u4EFB\u52A1",2107:"\u672A\u77E5\u8DF3\u8F6C\u6A21\u5F0F",2108:"RTA\u6821\u9A8C\u5931\u8D25"},be=(F=>(F[F.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",F[F.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",F[F.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",F[F.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",F[F.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",F[F.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",F[F.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",F[F.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",F[F.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",F[F.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",F[F.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",F[F.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",F[F.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",F[F.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",F[F.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",F[F.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",F[F.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",F))(be||{}),Qt={3001:"\u7F3A\u5C11\u624B\u673A\u53F7\u53C2\u6570",3002:"\u7F3A\u5C11\u8BBE\u5907ID\u53C2\u6570",3003:"\u7F3A\u5C11\u5957\u9910\u91D1\u989D\u53C2\u6570",3004:"\u65E0\u6548\u7684\u5BA2\u6237\u7AEF\u7C7B\u578B",3005:"\u4E1A\u52A1\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E",3006:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u5931\u8D25",3007:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u8BF7\u6C42\u5931\u8D25",3008:"\u7EDF\u4E00\u4E0B\u5355\u5931\u8D25",3009:"\u7EDF\u4E00\u4E0B\u5355\u8BF7\u6C42\u5931\u8D25",3010:"\u83B7\u53D6\u8DF3\u8F6C\u5730\u5740\u5931\u8D25",3011:"\u7F51\u7EDC\u8BF7\u6C42\u5F02\u5E38",3012:"\u4E0B\u5355\u6D41\u7A0B\u5F02\u5E38",3013:"\u83B7\u53D6RTA\u4FE1\u606F\u5931\u8D25",3014:"\u83B7\u53D6RTA\u4FE1\u606F\u8BF7\u6C42\u5931\u8D25",3015:"\u83B7\u53D6RTA\u4FE1\u606F\u5F02\u5E38",3016:"\u65E0\u6548\u7684\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u65B9\u5F0F",3017:"\u7F3A\u5C11\u4E1A\u52A1\u7C7B\u578B\u53C2\u6570"};var vn=(i,a,u,v)=>{let g=se();if(g==="taro")return Taro.request({url:i,method:a,data:u,header:v}).then(J=>J);if(g==="uni")return new Promise((J,$)=>{uni.request({url:i,method:a,data:u,header:v,success:at=>J(at),fail:at=>$(at)})});if(g==="wechat")return new Promise((J,$)=>{wx.request({url:i,method:a,data:u,header:v,success:at=>J(at),fail:at=>$(at)})});if(g==="alipay")return new Promise((J,$)=>{my.request({url:i,method:a,data:u,headers:v,success:at=>J(at),fail:at=>$(at)})});let D=a.toUpperCase()==="GET",S=D&&u&&Object.keys(u).length?`${i}?${new URLSearchParams(u).toString()}`:i;return fetch(S,{method:a,headers:v,body:D?void 0:JSON.stringify(u)}).then(async J=>({statusCode:J.status,data:await J.json()}))},ze=class{constructor(a=null){Ue(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||de()||Ie}async getAuthToken(){let a=this.getCurrentConfig();if(a.getAuthToken&&typeof a.getAuthToken=="function")try{let u=await a.getAuthToken();return u?(U.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),u):(U.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(u){return U.error("\u83B7\u53D6Token\u5931\u8D25",u),null}return null}async buildHeader(a={},u=!0){let v=bt({"content-type":"application/json"},a);if(!u)return v;let g=await this.getAuthToken();if(!g)throw{code:"AUTH_TOKEN_REQUIRED",message:"\u5F53\u524D\u63A5\u53E3\u9700\u8981 token\uFF0C\u8BF7\u5728\u7528\u6237\u767B\u5F55\u6210\u529F\u540E\u8C03\u7528 nova.setToken(token) \u6216 \u76F4\u63A5createServices\u65F6\u4F20\u5165getAuthToken"};return v.Authorization_bar=g,v}async request(a){let{path:u,method:v="POST",data:g={},header:D={},authRequired:S=!0,baseDomain:J,beforeRequest:$,afterResponse:at}=a,Rt=J?`${J}${u}`:je(this.getCurrentConfig().env||"prod",u),ht=await this.buildHeader(D,S);$&&typeof $=="function"&&await $({url:Rt,method:v,data:g,header:ht}),U.info(`\u53D1\u8D77${v}\u8BF7\u6C42:`,{path:u,method:v});try{let Q=await vn(Rt,v,g,ht);return U.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:Q.statusCode}),at&&typeof at=="function"&&await at(Q.data),Q.data}catch(Q){throw U.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:Q}),Q}}get(a,u={},v={}){return this.request(bt({path:a,method:"GET",data:u},v))}post(a,u={},v={}){return this.request(bt({path:a,method:"POST",data:u},v))}},Se=(i=null)=>new ze(i);var An=(function(){"use strict";function i(R,Z){var dt=(65535&R)+(65535&Z);return(R>>16)+(Z>>16)+(dt>>16)<<16|65535&dt}function a(R,Z,dt,F,k,St){return i((St=i(i(Z,R),i(F,St)))<<k|St>>>32-k,dt)}function u(R,Z,dt,F,k,St,I){return a(Z&dt|~Z&F,R,Z,k,St,I)}function v(R,Z,dt,F,k,St,I){return a(Z&F|dt&~F,R,Z,k,St,I)}function g(R,Z,dt,F,k,St,I){return a(Z^dt^F,R,Z,k,St,I)}function D(R,Z,dt,F,k,St,I){return a(dt^(Z|~F),R,Z,k,St,I)}function S(R,Z){var dt,F,k,St;R[Z>>5]|=128<<Z%32,R[14+(Z+64>>>9<<4)]=Z;for(var I=1732584193,T=-271733879,O=-1732584194,P=271733878,m=0;m<R.length;m+=16)I=u(dt=I,F=T,k=O,St=P,R[m],7,-680876936),P=u(P,I,T,O,R[m+1],12,-389564586),O=u(O,P,I,T,R[m+2],17,606105819),T=u(T,O,P,I,R[m+3],22,-1044525330),I=u(I,T,O,P,R[m+4],7,-176418897),P=u(P,I,T,O,R[m+5],12,1200080426),O=u(O,P,I,T,R[m+6],17,-1473231341),T=u(T,O,P,I,R[m+7],22,-45705983),I=u(I,T,O,P,R[m+8],7,1770035416),P=u(P,I,T,O,R[m+9],12,-1958414417),O=u(O,P,I,T,R[m+10],17,-42063),T=u(T,O,P,I,R[m+11],22,-1990404162),I=u(I,T,O,P,R[m+12],7,1804603682),P=u(P,I,T,O,R[m+13],12,-40341101),O=u(O,P,I,T,R[m+14],17,-1502002290),I=v(I,T=u(T,O,P,I,R[m+15],22,1236535329),O,P,R[m+1],5,-165796510),P=v(P,I,T,O,R[m+6],9,-1069501632),O=v(O,P,I,T,R[m+11],14,643717713),T=v(T,O,P,I,R[m],20,-373897302),I=v(I,T,O,P,R[m+5],5,-701558691),P=v(P,I,T,O,R[m+10],9,38016083),O=v(O,P,I,T,R[m+15],14,-660478335),T=v(T,O,P,I,R[m+4],20,-405537848),I=v(I,T,O,P,R[m+9],5,568446438),P=v(P,I,T,O,R[m+14],9,-1019803690),O=v(O,P,I,T,R[m+3],14,-187363961),T=v(T,O,P,I,R[m+8],20,1163531501),I=v(I,T,O,P,R[m+13],5,-1444681467),P=v(P,I,T,O,R[m+2],9,-51403784),O=v(O,P,I,T,R[m+7],14,1735328473),I=g(I,T=v(T,O,P,I,R[m+12],20,-1926607734),O,P,R[m+5],4,-378558),P=g(P,I,T,O,R[m+8],11,-2022574463),O=g(O,P,I,T,R[m+11],16,1839030562),T=g(T,O,P,I,R[m+14],23,-35309556),I=g(I,T,O,P,R[m+1],4,-1530992060),P=g(P,I,T,O,R[m+4],11,1272893353),O=g(O,P,I,T,R[m+7],16,-155497632),T=g(T,O,P,I,R[m+10],23,-1094730640),I=g(I,T,O,P,R[m+13],4,681279174),P=g(P,I,T,O,R[m],11,-358537222),O=g(O,P,I,T,R[m+3],16,-722521979),T=g(T,O,P,I,R[m+6],23,76029189),I=g(I,T,O,P,R[m+9],4,-640364487),P=g(P,I,T,O,R[m+12],11,-421815835),O=g(O,P,I,T,R[m+15],16,530742520),I=D(I,T=g(T,O,P,I,R[m+2],23,-995338651),O,P,R[m],6,-198630844),P=D(P,I,T,O,R[m+7],10,1126891415),O=D(O,P,I,T,R[m+14],15,-1416354905),T=D(T,O,P,I,R[m+5],21,-57434055),I=D(I,T,O,P,R[m+12],6,1700485571),P=D(P,I,T,O,R[m+3],10,-1894986606),O=D(O,P,I,T,R[m+10],15,-1051523),T=D(T,O,P,I,R[m+1],21,-2054922799),I=D(I,T,O,P,R[m+8],6,1873313359),P=D(P,I,T,O,R[m+15],10,-30611744),O=D(O,P,I,T,R[m+6],15,-1560198380),T=D(T,O,P,I,R[m+13],21,1309151649),I=D(I,T,O,P,R[m+4],6,-145523070),P=D(P,I,T,O,R[m+11],10,-1120210379),O=D(O,P,I,T,R[m+2],15,718787259),T=D(T,O,P,I,R[m+9],21,-343485551),I=i(I,dt),T=i(T,F),O=i(O,k),P=i(P,St);return[I,T,O,P]}function J(R){for(var Z="",dt=32*R.length,F=0;F<dt;F+=8)Z+=String.fromCharCode(R[F>>5]>>>F%32&255);return Z}function $(R){var Z=[];for(Z[(R.length>>2)-1]=void 0,F=0;F<Z.length;F+=1)Z[F]=0;for(var dt=8*R.length,F=0;F<dt;F+=8)Z[F>>5]|=(255&R.charCodeAt(F/8))<<F%32;return Z}function at(R){for(var Z,dt="0123456789abcdef",F="",k=0;k<R.length;k+=1)Z=R.charCodeAt(k),F+=dt.charAt(Z>>>4&15)+dt.charAt(15&Z);return F}function Rt(R){return unescape(encodeURIComponent(R))}function ht(R){return J(S($(R=Rt(R)),8*R.length))}function Q(R,Z){return(function(dt,F){var k,St=$(dt),I=[],T=[];for(I[15]=T[15]=void 0,16<St.length&&(St=S(St,8*dt.length)),k=0;k<16;k+=1)I[k]=909522486^St[k],T[k]=1549556828^St[k];return F=S(I.concat($(F)),512+8*F.length),J(S(T.concat(F),640))})(Rt(R),Rt(Z))}function _e(R,Z,dt){return Z?dt?Q(Z,R):at(Q(Z,R)):dt?ht(R):at(ht(R))}return _e})(),Ce=An;function vr(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function Ar(i){if(typeof i!="object"||i===null)return i;let a=Object.keys(i).sort(),u={};for(let v of a)u[v]=i[v];return JSON.stringify(u)}function Dr(i,a){let u={appId:i.appId,randomStr:i.randomStr,data:i.data},v=Object.keys(u).sort(),g="";for(let[D,S]of v.entries())g+=`${S}=${u[S]}`,D<v.length-1&&(g+="&");return g+=`&secretKey=${a}`,Ce(g)}var Dn=(i,a,u,v)=>{let g=se();return g==="taro"?Taro.request({url:i,method:a,data:u,header:v}).then(D=>D):g==="uni"?new Promise((D,S)=>{uni.request({url:i,method:a,data:u,header:v,success:J=>D(J),fail:J=>S(J)})}):g==="wechat"?new Promise((D,S)=>{wx.request({url:i,method:a,data:u,header:v,success:J=>D(J),fail:J=>S(J)})}):g==="alipay"?new Promise((D,S)=>{my.request({url:i,method:a,data:u,headers:v,success:J=>D(J),fail:J=>S(J)})}):fetch(i,{method:a,headers:v,body:JSON.stringify(u)}).then(async D=>({statusCode:D.status,data:await D.json()}))},$e=class{constructor(a=null){Ue(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||de()||{}}getExternalEnv(){var a;return((a=this.getCurrentConfig())==null?void 0:a.externalEnv)||fe.PROD}getExternalHost(){let a=this.getExternalEnv();return we[a]||we.prod}generateSign(a={}){let u=this.getCurrentConfig(),{externalAppId:v,externalAppSecret:g}=u;if(!v||!g)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let D=vr(),S=Ar(a),J=Dr({appId:v,randomStr:D,data:S},g);return{appId:v,randomStr:D,sign:J}}buildRequestBody(a={}){let u=this.generateSign(a);return ne(bt({},u),{data:a})}buildUrl(a){return`${this.getExternalHost()}${a}`}async request(a){let{path:u,method:v="POST",data:g={},header:D={},needSign:S=!0,beforeRequest:J,afterResponse:$}=a,at=this.buildUrl(u),Rt=bt({"content-type":"application/json"},D),ht=S?this.buildRequestBody(g):g;J&&typeof J=="function"&&await J({url:at,method:v,data:ht,header:Rt}),U.info(`\u53D1\u8D77${v}\u8BF7\u6C42:`,{path:u,method:v});try{let Q=await Dn(at,v,ht,Rt);if(U.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:Q.statusCode}),$&&typeof $=="function"&&await $(Q.data),Q.statusCode===200&&Q.data.code===200)return Q.data.data;throw{code:Q.data.code,msg:Q.data.data||"\u8BF7\u6C42\u4E1A\u52A1\u5F02\u5E38",original:Q.data}}catch(Q){throw(Q==null?void 0:Q.code)!==void 0?Q:(U.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:Q}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:Q})}}get(a,u={},v={}){return this.request(bt({path:a,method:"GET",data:u},v))}post(a,u={},v={}){return this.request(bt({path:a,method:"POST",data:u},v))}},Rr=(i=null)=>new $e(i);var Qe=Se(),Ze=Rr();function Er(i){let a=qe(i==null?void 0:i.equipmentValue,"equipmentValue");return a.valid?Qe.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",i):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Ir(i){let a=Pe(i,["idMd5Value","rtaStrategy"]);return a.valid?Ze.post("/open/rest/cpa/jd/rta-check",i):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function br(i){try{let a={thirdPlatform:i.thirdPlatform,thirdPlatformUserId:i.thirdPlatformUserId,thirdPlatformEquipmentValue:i.thirdPlatformEquipmentValue,os:i.os,client:"wxMini"};i.phone&&(a.mobileMd5=Ce(i.phone)),i.extendData&&(Object.prototype.toString.call(i.extendData)==="[object Object]"?a.extendData=i.extendData:U.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let u=await Ze.post("/open/rest/cpa/jd/insurance/get",a);return u?u.jumpMode==1?{jumpMode:1,appId:u.appId,url:u.url}:{jumpMode:2,url:u.url,channel:u.channelId}:void 0}catch(a){throw U.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",a),a}}function Sr(i){let a=qe(i==null?void 0:i.equipmentValue,"equipmentValue");return a.valid?Qe.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",i):Promise.reject({code:"PARAM_ERROR",message:a.message})}function Tr(i){let a=Pe(i,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return a.valid?Qe.post("/gw/advert/customer/cpa-activity/jd/rta/validate",i):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function wr(i){let a=await me(),u={thirdPlatform:i.thirdPlatform,thirdPlatformUserId:i.thirdPlatformUserId,thirdPlatformEquipmentValue:i.thirdPlatformEquipmentValue,os:a,client:i.client};return i.phone&&(u.mobileMd5=Ce(i.phone)),i.extendData&&(Object.prototype.toString.call(i.extendData)==="[object Object]"?u.extendData=i.extendData:U.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),Ze.post("/open/rest/cpa/jd/cash-loan/get",u)}async function Pr(i){let{phone:a,rtaId:u,equipmentId:v,lyyUserId:g,entrance:D}=i;if(!a)return z(Ft.INVALID_PARAM,Tt[2001]);if(!v)return z(Ft.INVALID_PARAM,Tt[2002]);try{if(u){U.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let ht=await Tr({phone:a,lyyEquipmentValue:v,lyyUserId:g||"",rtaId:u});if(ht.code!=="0000000"||!ht.body||ht.body.state!=1)return U.error("RTA\u9A8C\u8BC1\u5931\u8D25",ht),z(2003,Tt[2003]);U.info("RTA\u9A8C\u8BC1\u6210\u529F",ht.body)}U.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:a});let S=await me(),J=await Sr({phone:a,equipmentValue:v,os:S,entrance:D});if(J.code!=="0000000"||!J.body)return U.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",J),z(2004,Tt[2004]);let{appId:$,targetUrl:at}=J.body;if(!$||!at)return U.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:$,targetUrl:at}),z(2005,Tt[2005]);let Rt=z(Ft.SUCCESS,"\u6210\u529F",{appId:$,targetUrl:at});return U.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",Rt),Rt}catch(S){return U.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",S),z(Ft.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function Cr(i){let{phone:a,rtaId:u,thirdPlatform:v,thirdPlatformUserId:g,thirdPlatformEquipmentValue:D}=i;if(!a)return z(Ft.INVALID_PARAM,Tt[2001]);if(!v)return z(2008,Tt[2008]);if(!g)return z(2009,Tt[2009]);if(!D)return z(2010,Tt[2010]);try{if(u){U.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let Q=await Ir({idMd5Value:a,rtaStrategy:u});if(Q.status!=1)return U.error("RTA\u9A8C\u8BC1\u5931\u8D25",Q),z(2003,Tt[2003]);U.info("RTA\u9A8C\u8BC1\u6210\u529F",Q)}let S=await wr(i),{url:J,channelId:$,matchFlag:at,jumpMode:Rt,appId:ht}=S||{};return at?Rt===3?!ht||!J?z(2007,Tt[2007]):z(Ft.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:ht,url:J}):z(2007,Tt[2007]):z(2006,Tt[2006])}catch(S){return U.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",S),z(Ft.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var Te=null,Oe=null;try{Oe=Nr()}catch(i){}function xr(){return Te||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(Te=globalThis.LyyGetCommandSDK,Te):Oe?(Te=Oe.LyyGetCommandSDK||Oe.default||Oe,Te):null)}function Fr(i){var u;U.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",i);let a=xr();a!=null&&a.getJrCommand?a.getJrCommand(i):(u=a==null?void 0:a.default)!=null&&u.getJrCommand?a.default.getJrCommand(i):(U.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),i.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function Rn(i,a){return new Promise((u,v)=>{try{Fr({url:i,channel:a,callback:g=>{g.code==="0"?u(g.data):v({msg:g.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(g){v(g)}})}async function Lr(i){try{let a=await me(),u=bt({os:a},i);U.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",u);let{code:v,body:g}=await Er(u);if(v==="0000000"&&g){let{url:D,channelId:S,matchFlag:J,jumpMode:$,appId:at}=g;if(!J)return z(2101,Tt[2101]);if($===1)return U.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),z(2102,Tt[2102]);if($===2)return se()==="web"&&U.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:D}),!D||!S?z(2103,Tt[2103]):new Promise(Rt=>{Fr({url:D,channel:S,callback:async ht=>{if((ht==null?void 0:ht.code)==="0")try{await Xe(ht==null?void 0:ht.data),Rt(z(Ft.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch(Q){Rt(z(2105,Tt[2105]))}else Rt(z(2105,Tt[2105]))}})});if($===3)return!at||!D?z(2103,Tt[2103]):z(Ft.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:at,path:D})}return z(2104,Tt[2104])}catch(a){return U.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",a),z(Ft.NETWORK_ERROR,"\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5")}}async function Ur(i){U.info("\u5F00\u59CB\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4...");try{let a=await br(ne(bt({},i),{os:await me()}));if(!a)return U.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),z(2106,Tt[2106]);if(a.jumpMode===1)return U.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{appId:a.appId,url:a.url}),z(Ft.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:a.appId,path:a.url});if(a.jumpMode===2){if(se()==="web")return U.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:a.url}),z(Ft.SUCCESS,"\u6210\u529F",{type:"h5",url:a.url});try{let u=await Rn(a.url,a.channel);return await Xe(u),U.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),z(Ft.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(u){return U.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",u),Ke("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),z(2105,Tt[2105])}}return U.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",a.jumpMode),z(2107,Tt[2107])}catch(a){let u=typeof a=="string"?a:(a==null?void 0:a.msg)||(a==null?void 0:a.message)||"\u672A\u77E5\u9519\u8BEF";return U.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",u),Ke("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),u.includes("RTA")||u.includes("\u8D44\u683C")?z(2108,Tt[2108]):z(Ft.NETWORK_ERROR,u)}}var rr={};Ge(rr,{DyErrorCode:()=>be,getDyPayRtaData:()=>Yr,handleDyPayFlow:()=>Jr});var En=["weapp","h5"];function In(i){return En.includes(i)}var bn=["switchTab","reLaunch","redirectTo","navigateTo"];function Sn(i){return bn.includes(i)}function Mr(i){return i.telephone?i.price?i.equipmentValue?i.businessType?i.client&&!In(i.client)?{valid:!1,errorCode:3004}:i.douyinOrderExtendData&&typeof i.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:i.backWay&&i.client==="weapp"&&!Sn(i.backWay)?{valid:!1,errorCode:3016}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}:{valid:!1,errorCode:3001}}function jr(i){return i.equipmentValue?i.telephone?{valid:!0,errorCode:0}:{valid:!1,errorCode:3001}:{valid:!1,errorCode:3002}}var er=Se();async function qr(i){let{price:a,equipmentValue:u,douyinOrderExtendData:v,businessType:g}=i,D={businessType:g,equipmentValue:u,payInfoBusinessType:"commonDouyinPayment",platformActivities:{douyinCommodityPrice:a,douyinOrderExtendData:v||""}};try{let S=await er.post("/gw/advert/customer/payment/pay-info",D);return S.code!=="0000000"||!(S!=null&&S.body)?Promise.reject({code:3006,message:S.message||Qt[3006]}):S}catch(S){return U.error("getDyOrderAmountFn error:",S),Promise.reject({code:3007,message:Qt[3007]})}}async function Br(i){try{let a=i.commodityList.map(D=>({commodity:D.commodityId,quantity:1,categoryCode:D.categoryCode||"",supportMarketing:D.supportMarketing})),u=i.advertExtendInfo&&Object.keys(i.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:i.advertExtendInfo}):"",v={businessType:i.businessType,fixedClientType:21,channelCode:null,douyinData:{loginMobile:i.telephone||""},equipmentUseFlag:!0,payEquipmentDTO:{equipmentValue:i.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:u,transType:5,actualFee:i.totalFee,totalFee:i.totalFee,commodityList:a},g=await er.post("/gw/payment-bff/unified/order",v);return g.code!=="0000000"||!(g!=null&&g.body)?Promise.reject({code:3008,message:g.message||Qt[3008]}):g}catch(a){return U.error("dyUnifiedOrderFn error:",a),Promise.reject({code:3009,message:Qt[3009]})}}async function kr(i){let a={equipmentValue:i.equipmentValue,phone:i.telephone||""};i.price&&(a.orderAmount=i.price);try{let u=await er.post("/gw/advert/customer/douyin/pay/check",a);return u.code!=="0000000"||!(u!=null&&u.body)?Promise.reject({code:3013,message:u.message||Qt[3013]}):u}catch(u){return U.error("getDyPayRtaData error:",u),Promise.reject({code:3014,message:(u==null?void 0:u.message)||Qt[3014]})}}async function Jr(i){var u,v,g;let a=Mr(i);if(!a.valid)return z(a.errorCode,Qt[a.errorCode]);try{let D=await qr({price:i.price,equipmentValue:i.equipmentValue,businessType:i.businessType,douyinOrderExtendData:(i==null?void 0:i.douyinOrderExtendData)||""}),S=await Br(ne(bt({},D.body),{telephone:i.telephone,equipmentValue:i.equipmentValue,businessType:i.businessType})),J=(u=S==null?void 0:S.body)!=null&&u.h5Url?await Tn(ne(bt({},i),{dyUrl:S.body.h5Url})):"",$=((v=S==null?void 0:S.body)==null?void 0:v.outTradeNo)||"";return J?z(0,"success",{h5Url:J,outTradeNo:$}):z(3010,Qt[3010])}catch(D){U.error("handleDyPayFlow error:",D);let S=(g=D==null?void 0:D.code)!=null?g:3012,J=(D==null?void 0:D.message)||Qt[3012];return z(S,J)}}async function Tn(i){let a=de(),u=je(a.env||"prod",""),v=typeof a.getAuthToken=="function"?await a.getAuthToken():"",g=i.client||"weapp";return`${u}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${g}&equipmentId=${i.equipmentValue}&dyUrl=${i.dyUrl}&fromUrl=${encodeURIComponent(i.fromUrl||"")}&backUrl=${encodeURIComponent(i.backUrl||"")}&backWay=${i.backWay||""}&url_token=${v}`}async function Yr(i){var u;let a=jr(i);if(!a.valid)return z(a.errorCode,Qt[a.errorCode]);try{let v=await kr({price:(i==null?void 0:i.price)||"",equipmentValue:i.equipmentValue,telephone:(i==null?void 0:i.telephone)||""});return z(0,"success",v.body)}catch(v){U.error("getDyPayRtaData error:",v);let g=(u=v==null?void 0:v.code)!=null?u:3015,D=(v==null?void 0:v.message)||Qt[3015];return z(g,D)}}var ar={};Ge(ar,{getDisplayAdConfig:()=>Wr,normalizeDisplayAdData:()=>ir});var wn=Se();function Vr(i){let a=Pe(i,["placementId"]);if(!a.valid)return Promise.reject({code:"PARAM_ERROR",message:a.message});let u=de().env||"prod";return wn.get(`/gw/advert-plugin/api/v1/config/list/valid/${i.placementId}`,{},{authRequired:!1,baseDomain:gr(u)})}var Hr=30*1e3,Pn="__",or=new Map,nr=new Map;function Cn(i,a){return[i.appId||"",a,i.type||""].join(Pn)}function On(i){let a=or.get(i);return a?a.expireAt<=Date.now()?(or.delete(i),U.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:i}),null):a.data:null}function Nn(i,a){or.set(i,{data:a,expireAt:Date.now()+Hr})}function xn(i){return Array.isArray(i==null?void 0:i.body)?i.body:[]}function Fn(i){return String(i==null?void 0:i.code)!=="200"}function Ln(i,a){let u=String(i||a||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(u)?u:a||"banner"}function Gr(i){return String(i||"").trim().toLowerCase()}function Un(i){var a;return!!i&&i.status!==0&&((a=i.platformConfig)==null?void 0:a.valid)!==!1}function Mn(i){return[...i].sort((a,u)=>{var D,S,J,$;let v=Number((D=a.priority)!=null?D:9999),g=Number((S=u.priority)!=null?S:9999);return v!==g?v-g:Number((J=u.weight)!=null?J:0)-Number(($=a.weight)!=null?$:0)})}function Xr(i){return i.find(a=>Gr(a.advertPlatform)==="gdt")||null}function Kr(i){return i.find(a=>Gr(a.advertPlatform)!=="gdt")||null}function jn(i,a){return i&&a?"mixed":i?"wechat":a?"custom":"none"}function qn(i,a){var g,D;let u=Xr(i),v=Kr(i);return u&&v?Number((g=u.priority)!=null?g:9999)<=Number((D=v.priority)!=null?D:9999)?"wechat-first":"custom-first":a==="custom"?"custom-only":a==="wechat"?"wechat-only":"wechat-first"}function Bn(i){var u;let a=Xr(i);return((u=a==null?void 0:a.platformConfig)==null?void 0:u.adId)||""}function kn(i){let a=Kr(i),u=a==null?void 0:a.platformConfig;if(!u)return null;let v=u.image||u.imageUrl||"",g=u.video||u.videoUrl||"",D=u.poster||v||"",S=u.jumpUrl||u.url||u.webUrl||"";return!v&&!g?null:{image:v||void 0,video:g||void 0,poster:D||void 0,title:u.title,description:u.description,buttonText:u.buttonText,badgeText:u.badgeText,jumpSeconds:u.jumpSeconds,loadTimeout:u.loadTimeout||u.timeout,muted:u.muted,adSpec:u.adSpec,url:S||void 0,action:S?{type:"web",url:S}:void 0}}function ir(i,a){let u=Mn(i.filter(Un)),v=kn(u),g=Bn(u),D=Ln(void 0,a),S=jn(g,v),J=qn(u,S);return{show:!!(g||v),adId:"",type:D,provider:S,priority:J,unitId:g,customAd:v,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:i}}async function Wr(i){let a=i.placementId||i.adId||"",u=Cn(i,a),v=On(u);if(v)return U.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:u,placementId:a}),z(Ft.SUCCESS,"\u6210\u529F",v);let g=nr.get(u);if(g)return U.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:u,placementId:a}),g;let D=(async()=>{try{U.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",i);let S=await Vr({placementId:a}),J=xn(S);if(U.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:u,placementId:a,response:S,body:J}),Fn(S)||!J)return U.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",S),z(Ft.UNKNOWN_ERROR,(S==null?void 0:S.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");let $=ir(J,i.type);return $.adId=a,$.cache=ne(bt({},$.cache),{enable:!0,ttl:Hr}),Nn(u,$),U.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:u,placementId:a,provider:$.provider,priority:$.priority,hasUnitId:!!$.unitId,hasCustomAd:!!$.customAd}),z(Ft.SUCCESS,"\u6210\u529F",$)}catch(S){return U.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:u,placementId:a,error:S}),z(Ft.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{nr.delete(u)}})();return nr.set(u,D),D}function Jn(i={}){U.info("\u670D\u52A1\u521D\u59CB\u5316",i);let a=bt(bt({},Ie),i);a.env&&!Me[a.env]&&(U.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${a.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),a.env=Kt.PROD),a.externalEnv&&!we[a.externalEnv]&&(U.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${a.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),a.externalEnv=fe.PROD),a.debug!==void 0&&U.setEnable(a.debug),_r(a),U.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",a)}function Yn(i={}){let a="",u=null;async function v(){if(typeof i.getAuthToken=="function"){let D=await i.getAuthToken();if(D)return D}return u&&typeof u.getStorage=="function"&&u.getStorage("auth_token")||""}let g={name:"services",setToken(D){return a=D||"",u&&typeof u.setStorage=="function"&&u.setStorage("auth_token",a),g},async getAuthToken(){return a||v()},clearToken(){return a="",u&&typeof u.setStorage=="function"&&u.setStorage("auth_token",""),g},install(D){u=D;let S=ne(bt({},i),{getAuthToken:()=>g.getAuthToken()});Jn(S),U.info("services installed via nova.use()"),Object.assign(D,{jd:bt({},tr),dy:bt({},rr),ads:bt({},ar),setToken:g.setToken,clearToken:g.clearToken})}};return g}export{be as DyErrorCode,Qt as DyErrorMessage,Kt as ENV_TYPE,fe as EXTERNAL_ENV_TYPE,We as JdErrorCode,Tt as JdErrorMessage,Yn as createServices,Wr as getDisplayAdConfig,Yr as getDyPayRtaData,Jr as handleDyPayFlow,Lr as handleJdInsurance,Ur as handleJdInsuranceExt,Cr as handleJdjrCashLoanExt,Pr as handleJdjrCashLoanFlow,ir as normalizeDisplayAdData};
1
+ var pr=Object.defineProperty,ln=Object.defineProperties;var fn=Object.getOwnPropertyDescriptors;var dr=Object.getOwnPropertySymbols;var hn=Object.prototype.hasOwnProperty,dn=Object.prototype.propertyIsEnumerable;var He=(i,a,u)=>a in i?pr(i,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[a]=u,bt=(i,a)=>{for(var u in a||(a={}))hn.call(a,u)&&He(i,u,a[u]);if(dr)for(var u of dr(a))dn.call(a,u)&&He(i,u,a[u]);return i},oe=(i,a)=>ln(i,fn(a));var pn=(i,a)=>()=>(a||i((a={exports:{}}).exports,a),a.exports),Ge=(i,a)=>{for(var u in a)pr(i,u,{get:a[u],enumerable:!0})};var Ue=(i,a,u)=>He(i,typeof a!="symbol"?a+"":a,u);var Nr=pn((Ao,Or)=>{"use strict";(()=>{var i={737:(g,R,E)=>{"use strict";E.r(R),E.d(R,{default:()=>P,getJrCommand:()=>b});var k=E(307),$=E.n(k);function at(){at=function(){return V};var m,V={},_t=Object.prototype,st=_t.hasOwnProperty,vt=Object.defineProperty||function(h,l,y){h[l]=y.value},ut=typeof Symbol=="function"?Symbol:{},yt=ut.iterator||"@@iterator",At=ut.asyncIterator||"@@asyncIterator",Dt=ut.toStringTag||"@@toStringTag";function ft(h,l,y){return Object.defineProperty(h,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),h[l]}try{ft({},"")}catch(h){ft=function(l,y,x){return l[y]=x}}function Yt(h,l,y,x){var A=l&&l.prototype instanceof ie?l:ie,M=Object.create(A.prototype),rt=new ce(x||[]);return vt(M,"_invoke",{value:Ot(h,y,rt)}),M}function Vt(h,l,y){try{return{type:"normal",arg:h.call(l,y)}}catch(x){return{type:"throw",arg:x}}}V.wrap=Yt;var kt="suspendedStart",Wt="suspendedYield",Ht="executing",wt="completed",Pt={};function ie(){}function re(){}function jt(){}var ae={};ft(ae,yt,(function(){return this}));var ne=Object.getPrototypeOf,Lt=ne&&ne(ne(te([])));Lt&&Lt!==_t&&st.call(Lt,yt)&&(ae=Lt);var Jt=jt.prototype=ie.prototype=Object.create(ae);function pe(h){["next","throw","return"].forEach((function(l){ft(h,l,(function(y){return this._invoke(l,y)}))}))}function zt(h,l){function y(A,M,rt,mt){var pt=Vt(h[A],h,M);if(pt.type!=="throw"){var Gt=pt.arg,$t=Gt.value;return $t&&ht($t)=="object"&&st.call($t,"__await")?l.resolve($t.__await).then((function(Et){y("next",Et,rt,mt)}),(function(Et){y("throw",Et,rt,mt)})):l.resolve($t).then((function(Et){Gt.value=Et,rt(Gt)}),(function(Et){return y("throw",Et,rt,mt)}))}mt(pt.arg)}var x;vt(this,"_invoke",{value:function(A,M){function rt(){return new l((function(mt,pt){y(A,M,mt,pt)}))}return x=x?x.then(rt,rt):rt()}})}function Ot(h,l,y){var x=kt;return function(A,M){if(x===Ht)throw Error("Generator is already running");if(x===wt){if(A==="throw")throw M;return{value:m,done:!0}}for(y.method=A,y.arg=M;;){var rt=y.delegate;if(rt){var mt=Ut(rt,y);if(mt){if(mt===Pt)continue;return mt}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(x===kt)throw x=wt,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);x=Ht;var pt=Vt(h,l,y);if(pt.type==="normal"){if(x=y.done?wt:Wt,pt.arg===Pt)continue;return{value:pt.arg,done:y.done}}pt.type==="throw"&&(x=wt,y.method="throw",y.arg=pt.arg)}}}function Ut(h,l){var y=l.method,x=h.iterator[y];if(x===m)return l.delegate=null,y==="throw"&&h.iterator.return&&(l.method="return",l.arg=m,Ut(h,l),l.method==="throw")||y!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+y+"' method")),Pt;var A=Vt(x,h.iterator,l.arg);if(A.type==="throw")return l.method="throw",l.arg=A.arg,l.delegate=null,Pt;var M=A.arg;return M?M.done?(l[h.resultName]=M.value,l.next=h.nextLoc,l.method!=="return"&&(l.method="next",l.arg=m),l.delegate=null,Pt):M:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,Pt)}function Zt(h){var l={tryLoc:h[0]};1 in h&&(l.catchLoc=h[1]),2 in h&&(l.finallyLoc=h[2],l.afterLoc=h[3]),this.tryEntries.push(l)}function ue(h){var l=h.completion||{};l.type="normal",delete l.arg,h.completion=l}function ce(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(Zt,this),this.reset(!0)}function te(h){if(h||h===""){var l=h[yt];if(l)return l.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var y=-1,x=function A(){for(;++y<h.length;)if(st.call(h,y))return A.value=h[y],A.done=!1,A;return A.value=m,A.done=!0,A};return x.next=x}}throw new TypeError(ht(h)+" is not iterable")}return re.prototype=jt,vt(Jt,"constructor",{value:jt,configurable:!0}),vt(jt,"constructor",{value:re,configurable:!0}),re.displayName=ft(jt,Dt,"GeneratorFunction"),V.isGeneratorFunction=function(h){var l=typeof h=="function"&&h.constructor;return!!l&&(l===re||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,jt):(h.__proto__=jt,ft(h,Dt,"GeneratorFunction")),h.prototype=Object.create(Jt),h},V.awrap=function(h){return{__await:h}},pe(zt.prototype),ft(zt.prototype,At,(function(){return this})),V.AsyncIterator=zt,V.async=function(h,l,y,x,A){A===void 0&&(A=Promise);var M=new zt(Yt(h,l,y,x),A);return V.isGeneratorFunction(l)?M:M.next().then((function(rt){return rt.done?rt.value:M.next()}))},pe(Jt),ft(Jt,Dt,"Generator"),ft(Jt,yt,(function(){return this})),ft(Jt,"toString",(function(){return"[object Generator]"})),V.keys=function(h){var l=Object(h),y=[];for(var x in l)y.push(x);return y.reverse(),function A(){for(;y.length;){var M=y.pop();if(M in l)return A.value=M,A.done=!1,A}return A.done=!0,A}},V.values=te,ce.prototype={constructor:ce,reset:function(h){if(this.prev=0,this.next=0,this.sent=this._sent=m,this.done=!1,this.delegate=null,this.method="next",this.arg=m,this.tryEntries.forEach(ue),!h)for(var l in this)l.charAt(0)==="t"&&st.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=m)},stop:function(){this.done=!0;var h=this.tryEntries[0].completion;if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(h){if(this.done)throw h;var l=this;function y(pt,Gt){return M.type="throw",M.arg=h,l.next=pt,Gt&&(l.method="next",l.arg=m),!!Gt}for(var x=this.tryEntries.length-1;x>=0;--x){var A=this.tryEntries[x],M=A.completion;if(A.tryLoc==="root")return y("end");if(A.tryLoc<=this.prev){var rt=st.call(A,"catchLoc"),mt=st.call(A,"finallyLoc");if(rt&&mt){if(this.prev<A.catchLoc)return y(A.catchLoc,!0);if(this.prev<A.finallyLoc)return y(A.finallyLoc)}else if(rt){if(this.prev<A.catchLoc)return y(A.catchLoc,!0)}else{if(!mt)throw Error("try statement without catch or finally");if(this.prev<A.finallyLoc)return y(A.finallyLoc)}}}},abrupt:function(h,l){for(var y=this.tryEntries.length-1;y>=0;--y){var x=this.tryEntries[y];if(x.tryLoc<=this.prev&&st.call(x,"finallyLoc")&&this.prev<x.finallyLoc){var A=x;break}}A&&(h==="break"||h==="continue")&&A.tryLoc<=l&&l<=A.finallyLoc&&(A=null);var M=A?A.completion:{};return M.type=h,M.arg=l,A?(this.method="next",this.next=A.finallyLoc,Pt):this.complete(M)},complete:function(h,l){if(h.type==="throw")throw h.arg;return h.type==="break"||h.type==="continue"?this.next=h.arg:h.type==="return"?(this.rval=this.arg=h.arg,this.method="return",this.next="end"):h.type==="normal"&&l&&(this.next=l),Pt},finish:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===h)return this.complete(y.completion,y.afterLoc),ue(y),Pt}},catch:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===h){var x=y.completion;if(x.type==="throw"){var A=x.arg;ue(y)}return A}}throw Error("illegal catch attempt")},delegateYield:function(h,l,y){return this.delegate={iterator:te(h),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=m),Pt}},V}function Rt(m,V,_t,st,vt,ut,yt){try{var At=m[ut](yt),Dt=At.value}catch(ft){return void _t(ft)}At.done?V(Dt):Promise.resolve(Dt).then(st,vt)}function ht(m){return ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},ht(m)}var Q="https://ms.jr.jd.com";function _e(m){var V=m.host,_t=m.type,st=_t===void 0?"post":_t,vt=m.data,ut=m.path,yt=ut===void 0?"":ut,At=m.config,Dt=At===void 0?{}:At,ft=(Dt.withCredentials,Dt.isWG),Yt=ft===void 0||ft,Vt=Dt.contentType,kt=Vt===void 0?"application/x-www-form-urlencoded":Vt;return new Promise((function(Wt,Ht){wx.request({url:(V||Q)+yt,method:st.toUpperCase(),data:Yt?D({reqData:JSON.stringify(vt)}):vt,header:{"content-type":kt},success:function(wt){wt.statusCode===200?Wt(wt.data):Ht({statusCode:wt.statusCode,errMsg:wt.errMsg,data:wt.data})},fail:function(wt){Ht(wt)}})}))}function D(m){var V="";return ht(m)==="object"&&m!==null&&(Object.keys(m).map((function(_t){var st=m[_t];return V+=_t+"="+encodeURIComponent(st)+"&",""})),V.length>0&&(V=V.substr(0,V.length-1))),V}function Z(m){return dt.apply(this,arguments)}function dt(){var m;return m=at().mark((function V(_t){var st,vt,ut,yt,At,Dt,ft,Yt,Vt,kt;return at().wrap((function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return st=_t.url,vt=_t.channel,ut=_t.callback,$().init(),yt=new($()),At=yt.nonce(),Dt=yt.sign(JSON.stringify({t:"".concat(new Date().getTime())}),At),ft="/gw/generic/app/h5/m/execute1/ug-service-orchestrator".concat(""),Yt="",Vt={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:st,channel:vt,clientCode:"0",antiRushInfo:Dt}},Wt.next=12,_e({host:"https://ms.jr.jd.com",type:"post",path:ft,config:{withCredentials:!0},data:Vt});case 12:(kt=Wt.sent).resultCode===0&&kt.resultData&&kt.resultData.code==="00000"&&kt.resultData.data&&(Yt=kt.resultData.data.goldenKeyText),ut&&ut(Yt?{code:"0",msg:"command success",data:Yt}:{code:"-1",msg:"command empty"});case 15:case"end":return Wt.stop()}}),V)})),dt=function(){var V=this,_t=arguments;return new Promise((function(st,vt){var ut=m.apply(V,_t);function yt(Dt){Rt(ut,st,vt,yt,At,"next",Dt)}function At(Dt){Rt(ut,st,vt,yt,At,"throw",Dt)}yt(void 0)}))},dt.apply(this,arguments)}function F(m){return F=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(V){return typeof V}:function(V){return V&&typeof Symbol=="function"&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":typeof V},F(m)}function J(){J=function(){return V};var m,V={},_t=Object.prototype,st=_t.hasOwnProperty,vt=Object.defineProperty||function(h,l,y){h[l]=y.value},ut=typeof Symbol=="function"?Symbol:{},yt=ut.iterator||"@@iterator",At=ut.asyncIterator||"@@asyncIterator",Dt=ut.toStringTag||"@@toStringTag";function ft(h,l,y){return Object.defineProperty(h,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),h[l]}try{ft({},"")}catch(h){ft=function(l,y,x){return l[y]=x}}function Yt(h,l,y,x){var A=l&&l.prototype instanceof ie?l:ie,M=Object.create(A.prototype),rt=new ce(x||[]);return vt(M,"_invoke",{value:Ot(h,y,rt)}),M}function Vt(h,l,y){try{return{type:"normal",arg:h.call(l,y)}}catch(x){return{type:"throw",arg:x}}}V.wrap=Yt;var kt="suspendedStart",Wt="suspendedYield",Ht="executing",wt="completed",Pt={};function ie(){}function re(){}function jt(){}var ae={};ft(ae,yt,(function(){return this}));var ne=Object.getPrototypeOf,Lt=ne&&ne(ne(te([])));Lt&&Lt!==_t&&st.call(Lt,yt)&&(ae=Lt);var Jt=jt.prototype=ie.prototype=Object.create(ae);function pe(h){["next","throw","return"].forEach((function(l){ft(h,l,(function(y){return this._invoke(l,y)}))}))}function zt(h,l){function y(A,M,rt,mt){var pt=Vt(h[A],h,M);if(pt.type!=="throw"){var Gt=pt.arg,$t=Gt.value;return $t&&F($t)=="object"&&st.call($t,"__await")?l.resolve($t.__await).then((function(Et){y("next",Et,rt,mt)}),(function(Et){y("throw",Et,rt,mt)})):l.resolve($t).then((function(Et){Gt.value=Et,rt(Gt)}),(function(Et){return y("throw",Et,rt,mt)}))}mt(pt.arg)}var x;vt(this,"_invoke",{value:function(A,M){function rt(){return new l((function(mt,pt){y(A,M,mt,pt)}))}return x=x?x.then(rt,rt):rt()}})}function Ot(h,l,y){var x=kt;return function(A,M){if(x===Ht)throw Error("Generator is already running");if(x===wt){if(A==="throw")throw M;return{value:m,done:!0}}for(y.method=A,y.arg=M;;){var rt=y.delegate;if(rt){var mt=Ut(rt,y);if(mt){if(mt===Pt)continue;return mt}}if(y.method==="next")y.sent=y._sent=y.arg;else if(y.method==="throw"){if(x===kt)throw x=wt,y.arg;y.dispatchException(y.arg)}else y.method==="return"&&y.abrupt("return",y.arg);x=Ht;var pt=Vt(h,l,y);if(pt.type==="normal"){if(x=y.done?wt:Wt,pt.arg===Pt)continue;return{value:pt.arg,done:y.done}}pt.type==="throw"&&(x=wt,y.method="throw",y.arg=pt.arg)}}}function Ut(h,l){var y=l.method,x=h.iterator[y];if(x===m)return l.delegate=null,y==="throw"&&h.iterator.return&&(l.method="return",l.arg=m,Ut(h,l),l.method==="throw")||y!=="return"&&(l.method="throw",l.arg=new TypeError("The iterator does not provide a '"+y+"' method")),Pt;var A=Vt(x,h.iterator,l.arg);if(A.type==="throw")return l.method="throw",l.arg=A.arg,l.delegate=null,Pt;var M=A.arg;return M?M.done?(l[h.resultName]=M.value,l.next=h.nextLoc,l.method!=="return"&&(l.method="next",l.arg=m),l.delegate=null,Pt):M:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,Pt)}function Zt(h){var l={tryLoc:h[0]};1 in h&&(l.catchLoc=h[1]),2 in h&&(l.finallyLoc=h[2],l.afterLoc=h[3]),this.tryEntries.push(l)}function ue(h){var l=h.completion||{};l.type="normal",delete l.arg,h.completion=l}function ce(h){this.tryEntries=[{tryLoc:"root"}],h.forEach(Zt,this),this.reset(!0)}function te(h){if(h||h===""){var l=h[yt];if(l)return l.call(h);if(typeof h.next=="function")return h;if(!isNaN(h.length)){var y=-1,x=function A(){for(;++y<h.length;)if(st.call(h,y))return A.value=h[y],A.done=!1,A;return A.value=m,A.done=!0,A};return x.next=x}}throw new TypeError(F(h)+" is not iterable")}return re.prototype=jt,vt(Jt,"constructor",{value:jt,configurable:!0}),vt(jt,"constructor",{value:re,configurable:!0}),re.displayName=ft(jt,Dt,"GeneratorFunction"),V.isGeneratorFunction=function(h){var l=typeof h=="function"&&h.constructor;return!!l&&(l===re||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,jt):(h.__proto__=jt,ft(h,Dt,"GeneratorFunction")),h.prototype=Object.create(Jt),h},V.awrap=function(h){return{__await:h}},pe(zt.prototype),ft(zt.prototype,At,(function(){return this})),V.AsyncIterator=zt,V.async=function(h,l,y,x,A){A===void 0&&(A=Promise);var M=new zt(Yt(h,l,y,x),A);return V.isGeneratorFunction(l)?M:M.next().then((function(rt){return rt.done?rt.value:M.next()}))},pe(Jt),ft(Jt,Dt,"Generator"),ft(Jt,yt,(function(){return this})),ft(Jt,"toString",(function(){return"[object Generator]"})),V.keys=function(h){var l=Object(h),y=[];for(var x in l)y.push(x);return y.reverse(),function A(){for(;y.length;){var M=y.pop();if(M in l)return A.value=M,A.done=!1,A}return A.done=!0,A}},V.values=te,ce.prototype={constructor:ce,reset:function(h){if(this.prev=0,this.next=0,this.sent=this._sent=m,this.done=!1,this.delegate=null,this.method="next",this.arg=m,this.tryEntries.forEach(ue),!h)for(var l in this)l.charAt(0)==="t"&&st.call(this,l)&&!isNaN(+l.slice(1))&&(this[l]=m)},stop:function(){this.done=!0;var h=this.tryEntries[0].completion;if(h.type==="throw")throw h.arg;return this.rval},dispatchException:function(h){if(this.done)throw h;var l=this;function y(pt,Gt){return M.type="throw",M.arg=h,l.next=pt,Gt&&(l.method="next",l.arg=m),!!Gt}for(var x=this.tryEntries.length-1;x>=0;--x){var A=this.tryEntries[x],M=A.completion;if(A.tryLoc==="root")return y("end");if(A.tryLoc<=this.prev){var rt=st.call(A,"catchLoc"),mt=st.call(A,"finallyLoc");if(rt&&mt){if(this.prev<A.catchLoc)return y(A.catchLoc,!0);if(this.prev<A.finallyLoc)return y(A.finallyLoc)}else if(rt){if(this.prev<A.catchLoc)return y(A.catchLoc,!0)}else{if(!mt)throw Error("try statement without catch or finally");if(this.prev<A.finallyLoc)return y(A.finallyLoc)}}}},abrupt:function(h,l){for(var y=this.tryEntries.length-1;y>=0;--y){var x=this.tryEntries[y];if(x.tryLoc<=this.prev&&st.call(x,"finallyLoc")&&this.prev<x.finallyLoc){var A=x;break}}A&&(h==="break"||h==="continue")&&A.tryLoc<=l&&l<=A.finallyLoc&&(A=null);var M=A?A.completion:{};return M.type=h,M.arg=l,A?(this.method="next",this.next=A.finallyLoc,Pt):this.complete(M)},complete:function(h,l){if(h.type==="throw")throw h.arg;return h.type==="break"||h.type==="continue"?this.next=h.arg:h.type==="return"?(this.rval=this.arg=h.arg,this.method="return",this.next="end"):h.type==="normal"&&l&&(this.next=l),Pt},finish:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===h)return this.complete(y.completion,y.afterLoc),ue(y),Pt}},catch:function(h){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===h){var x=y.completion;if(x.type==="throw"){var A=x.arg;ue(y)}return A}}throw Error("illegal catch attempt")},delegateYield:function(h,l,y){return this.delegate={iterator:te(h),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=m),Pt}},V}function St(m,V,_t,st,vt,ut,yt){try{var At=m[ut](yt),Dt=At.value}catch(ft){return void _t(ft)}At.done?V(Dt):Promise.resolve(Dt).then(st,vt)}function b(m){return T.apply(this,arguments)}function T(){var m;return m=J().mark((function V(_t){var st,vt,ut;return J().wrap((function(yt){for(;;)switch(yt.prev=yt.next){case 0:return st=_t.url,vt=_t.channel,ut=_t.callback,yt.next=3,Z({url:st,channel:vt,callback:ut});case 3:case"end":return yt.stop()}}),V)})),T=function(){var V=this,_t=arguments;return new Promise((function(st,vt){var ut=m.apply(V,_t);function yt(Dt){St(ut,st,vt,yt,At,"next",Dt)}function At(Dt){St(ut,st,vt,yt,At,"throw",Dt)}yt(void 0)}))},T.apply(this,arguments)}var O={getJrCommand:b};(g=E.hmd(g)).exports&&(g.exports=O,g.exports.getJrCommand=b),typeof window!="undefined"&&(window.LyyGetCommandSDK=O);let P=O},307:function(g,R,E){var k,$,at;function Rt(ht){return Rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Q){return typeof Q}:function(Q){return Q&&typeof Symbol=="function"&&Q.constructor===Symbol&&Q!==Symbol.prototype?"symbol":typeof Q},Rt(ht)}at=function(){"use strict";function ht(t){return(ht=typeof Symbol=="function"&&Rt(Symbol.iterator)=="symbol"?function(r){return Rt(r)}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":Rt(r)})(t)}function Q(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _e(t,r){for(var s=0;s<r.length;s++){var c=r[s];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}function D(t,r,s){return r&&_e(t.prototype,r),s&&_e(t,s),t}function Z(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&F(t,r)}function dt(t){return(dt=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(t)}function F(t,r){return(F=Object.setPrototypeOf||function(s,c){return s.__proto__=c,s})(t,r)}function J(t){var r=(function(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(s){return!1}})();return function(){var s,c=dt(t);return(function(d,p){if(p&&(Rt(p)=="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(I){if(I===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I})(d)})(this,r?(s=dt(this).constructor,Reflect.construct(c,arguments,s)):c.apply(this,arguments))}}function St(t){return(function(r){if(Array.isArray(r))return b(r)})(t)||(function(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)})(t)||(function(r,s){if(r){if(typeof r=="string")return b(r,s);var c=Object.prototype.toString.call(r).slice(8,-1);return(c=c==="Object"&&r.constructor?r.constructor.name:c)==="Map"||c==="Set"?Array.from(r):c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?b(r,s):void 0}})(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function b(t,r){(r==null||r>t.length)&&(r=t.length);for(var s=0,c=new Array(r);s<r;s++)c[s]=t[s];return c}var T=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:E.g!==void 0?E.g:typeof self!="undefined"?self:{},O=!1,P=!1,m={console:!0,focus:!1,time:!1,length:!0,infinite:!1,time_interval:500,time_threshold:100,length_threshold:300},V=function(){typeof document!="undefined"&&document.hasFocus&&!document.hasFocus()&&(P=!0)},_t=function(){var t=Date.now();Date.now()-t>m.time_threshold&&(P=!0)},st=function(){var t=T.outerWidth,r=T.outerHeight,s=T.innerWidth,c=T.innerHeight;t&&r&&s&&c&&typeof t=="number"&&typeof r=="number"&&typeof s=="number"&&typeof c=="number"&&(t-s>m.length_threshold||r-c>m.length_threshold)&&(P=!0)};(Ot={}).start=function(t){if(!O){if(t&&ht(t)==="object")for(var r in t)m[r]=t[r];var s;m.infinite&&(typeof window!="undefined"&&Object.prototype.toString.call(window)==="[object Window]"?typeof Function!="undefined"&&Function.constructor!==void 0&&/Function[^]*\[native code\]/.test(""+Function.constructor)&&typeof setInterval!="undefined"&&/setInterval[^]*\[native code\]/.test(""+setInterval)?new Function('setInterval(function(){!/Function[^]*[native code]/.test("" + Function.constructor) ? function(){while(1);}() : new Function("debugger")(); }, 100);')():P=!0:setInterval((function(){}),100)),m.console&&(function(){var c=new Date;c.toString=function(){for(var d=Date.now();;)if(10<Date.now()-d)return Date.now()},console.log(c),c.toString=function(){return P=!0,Date.now()}})(),m.focus&&V(),m.time&&_t(),m.length&&st(),s=setInterval((function(){s&&P&&clearInterval(s),m.focus&&V(),m.time&&_t(),m.length&&st()}),m.time_interval),O=!0}},Ot.isDebug=function(){return P};var vt=Ot,ut=".123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-!",yt={my_b4_encode:function(t){var r=0,s=(j=0)<t.length%3?3-t.length%3:0;for(r=0;r<s;r++)t[t.length]=0;var c="";for(j=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
3
+ `),c+=ut[t[j]>>2]+ut[(3&t[j])<<4|t[j+1]>>4]+ut[(15&t[j+1])<<2|t[j+2]>>6]+ut[63&t[j+2]];for(r=0;r<s;r++)c+=ut[64];return c},my_b4_decode:function(t){var r=0,s=0,c=(t=t.replace(/[^A-Za-z0-9\+\-\!\.]/g,"")).length%4;if(2<c)return null;for(r=0;r<c;r++)if(t.charAt(t.length-r-1)!=ut[64])return null;var d,p,I,C,w=new Array(3*(t.length-c)/4);for(r=0,s=0;s<w.length;)d=ut.indexOf(t.charAt(r++)),p=ut.indexOf(t.charAt(r++)),I=ut.indexOf(t.charAt(r++)),C=ut.indexOf(t.charAt(r++)),w[s++]=d<<2|p>>4,w[s++]=(15&p)<<4|I>>2,w[s++]=(3&I)<<6|C;for(r=0;r<c;r++)if(w.pop()!=0)return null;return w}},At="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Dt={b4_encode:function(t){var r=0,s=(j=0)<t.length%3?3-t.length%3:0;for(r=0;r<s;r++)t[t.length]=0;var c="";for(r=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
4
+ `),c+=At[t[j]>>2]+At[(3&t[j])<<4|t[j+1]>>4]+At[(15&t[j+1])<<2|t[j+2]>>6]+At[63&t[j+2]];for(r=0;r<s;r++)c+="=";return c},b4_decode:function(t){var r=0,s=0,c=(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length%4;if(2<c)return null;for(r=0;r<c;r++)if(t.charAt(t.length-r-1)!="=")return null;var d,p,I,C,w=new Array(3*(t.length-c)/4);for(r=0,s=0;s<w.length;)d=At.indexOf(t.charAt(r++)),p=At.indexOf(t.charAt(r++)),I=At.indexOf(t.charAt(r++)),C=At.indexOf(t.charAt(r++)),w[s++]=d<<2|p>>4,w[s++]=(15&p)<<4|I>>2,w[s++]=(3&I)<<6|C;for(r=0;r<c;r++)if(w.pop()!=0)return null;return w}};function ft(){}ft.encode=function(t,r,s){for(var c=new Array(2*s),d=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),p=r,I=0;p<s+r;p++,I++)c[I]=d[(255&t[p])>>4],c[++I]=d[15&t[p]];return c.join("")},ft.decode=function(t){if(t==null||t==""||t.length%2!=0)return null;for(var r=t.length/2,s=ft.toCharCodeArray(t),c=new Array(r),d=0;d<r;d++){if(48<=s[2*d]&&s[2*d]<=57)c[d]=s[2*d]-48<<4;else if(65<=s[2*d]&&s[2*d]<=70)c[d]=s[2*d]-65+10<<4;else{if(!(97<=s[2*d]&&s[2*d]<=102))return null;c[d]=s[2*d]-97+10<<4}if(48<=s[2*d+1]&&s[2*d+1]<=57)c[d]=c[d]|s[2*d+1]-48;else if(65<=s[2*d+1]&&s[2*d+1]<=70)c[d]=c[d]|s[2*d+1]-65+10;else{if(!(97<=s[2*d+1]&&s[2*d+1]<=102))return null;c[d]=c[d]|s[2*d+1]-97+10}}return c},ft.toCharCodeArray=function(t){for(var r=new Array(t.length),s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return r};var Yt=ft,Vt=Yt;(Ut=function(){}).utf8StrToh6=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],d=0;d<s;d++)c[d]=r.charCodeAt(d).toString(16);return c.join("")},Ut.utf8StrToBytes=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],d=0;d<s;d++)c[d]=r.charCodeAt(d);return c},Ut.hexToUtf8Str=function(t){for(var r=Vt.decode(t),s=[],c=0;c<r.length;c++)s.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(s.join("")))},Ut.bytesToUtf8Str=function(t){for(var r=t,s=[],c=0;c<r.length;c++)s.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(s.join("")))},Ut.intToByte=function(t){return new Array(t>>24&255,t>>16&255,t>>8&255,255&t)},Ut.byteToInt=function(t,r){return r+3<t.length?t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]:r+2<t.length?t[r+1]<<16|t[r+2]<<8|t[r+3]:r+1<t.length?t[r]<<8|t[r+1]:t[r]};var kt,Wt=Ut,Ht={exports:{}};kt=Ht,function(){function t(e,n,o){e!=null&&(typeof e=="number"?this.fromNumber(e,n,o):n==null&&typeof e!="string"?this.fromString(e,256):this.fromString(e,n))}function r(){return new t(null)}var s=(s=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(t.prototype.am=function(e,n,o,f,_,N){for(var B=32767&n,L=n>>15;0<=--N;){var xt=32767&this[e],Xt=this[e++]>>15,se=L*xt+Xt*B;_=((xt=B*xt+((32767&se)<<15)+o[f]+(1073741823&_))>>>30)+(se>>>15)+L*Xt+(_>>>30),o[f++]=1073741823&xt}return _},30):s&&navigator.appName!="Netscape"?(t.prototype.am=function(e,n,o,f,_,N){for(;0<=--N;){var B=n*this[e++]+o[f]+_;_=Math.floor(B/67108864),o[f++]=67108863&B}return _},26):(t.prototype.am=function(e,n,o,f,_,N){for(var B=16383&n,L=n>>14;0<=--N;){var xt=16383&this[e],Xt=this[e++]>>14,se=L*xt+Xt*B;_=((xt=B*xt+((16383&se)<<14)+o[f]+_)>>28)+(se>>14)+L*Xt,o[f++]=268435455&xt}return _},28);t.prototype.DB=s,t.prototype.DM=(1<<s)-1,t.prototype.DV=1<<s,t.prototype.FV=Math.pow(2,52),t.prototype.F1=52-s,t.prototype.F2=2*s-52;for(var c=new Array,d=48,p=0;p<=9;++p)c[d++]=p;for(d=97,p=10;p<36;++p)c[d++]=p;for(d=65,p=10;p<36;++p)c[d++]=p;function I(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function C(e,n){return(e=c[e.charCodeAt(n)])==null?-1:e}function w(e){var n=r();return n.fromInt(e),n}function nt(e){var n,o=1;return(n=e>>>16)!=0&&(e=n,o+=16),(n=e>>8)!=0&&(e=n,o+=8),(n=e>>4)!=0&&(e=n,o+=4),(n=e>>2)!=0&&(e=n,o+=2),(n=e>>1)!=0&&(e=n,o+=1),o}function ot(e){this.m=e}function S(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function H(e,n){return e&n}function tt(e,n){return e|n}function W(e,n){return e^n}function it(e,n){return e&~n}function lt(){}function Ct(e){return e}function q(e){this.r2=r(),this.q3=r(),t.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}ot.prototype.convert=function(e){return e.s<0||0<=e.compareTo(this.m)?e.mod(this.m):e},ot.prototype.revert=function(e){return e},ot.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},ot.prototype.mulTo=function(e,n,o){e.multiplyTo(n,o),this.reduce(o)},ot.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)},S.prototype.convert=function(e){var n=r();return e.abs().dlShiftTo(this.m.t,n),n.divRemTo(this.m,null,n),e.s<0&&0<n.compareTo(t.ZERO)&&this.m.subTo(n,n),n},S.prototype.revert=function(e){var n=r();return e.copyTo(n),this.reduce(n),n},S.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var n=0;n<this.m.t;++n){var o=32767&e[n],f=o*this.mpl+((o*this.mph+(e[n]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[o=n+this.m.t]+=this.m.am(0,f,e,n,0,this.m.t);e[o]>=e.DV;)e[o]-=e.DV,e[++o]++}e.clamp(),e.drShiftTo(this.m.t,e),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},S.prototype.mulTo=function(e,n,o){e.multiplyTo(n,o),this.reduce(o)},S.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)},t.prototype.copyTo=function(e){for(var n=this.t-1;0<=n;--n)e[n]=this[n];e.t=this.t,e.s=this.s},t.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,0<e?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},t.prototype.fromString=function(e,n){var o;if(n==16)o=4;else if(n==8)o=3;else if(n==256)o=8;else if(n==2)o=1;else if(n==32)o=5;else{if(n!=4)return void this.fromRadix(e,n);o=2}this.t=0,this.s=0;for(var f=e.length,_=!1,N=0;0<=--f;){var B=o==8?255&e[f]:C(e,f);B<0?e.charAt(f)=="-"&&(_=!0):(_=!1,N==0?this[this.t++]=B:N+o>this.DB?(this[this.t-1]|=(B&(1<<this.DB-N)-1)<<N,this[this.t++]=B>>this.DB-N):this[this.t-1]|=B<<N,(N+=o)>=this.DB&&(N-=this.DB))}o==8&&128&e[0]&&(this.s=-1,0<N&&(this[this.t-1]|=(1<<this.DB-N)-1<<N)),this.clamp(),_&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var e=this.s&this.DM;0<this.t&&this[this.t-1]==e;)--this.t},t.prototype.dlShiftTo=function(e,n){for(var o=this.t-1;0<=o;--o)n[o+e]=this[o];for(o=e-1;0<=o;--o)n[o]=0;n.t=this.t+e,n.s=this.s},t.prototype.drShiftTo=function(e,n){for(var o=e;o<this.t;++o)n[o-e]=this[o];n.t=Math.max(this.t-e,0),n.s=this.s},t.prototype.lShiftTo=function(e,n){for(var o=e%this.DB,f=this.DB-o,_=(1<<f)-1,N=Math.floor(e/this.DB),B=this.s<<o&this.DM,L=this.t-1;0<=L;--L)n[L+N+1]=this[L]>>f|B,B=(this[L]&_)<<o;for(L=N-1;0<=L;--L)n[L]=0;n[N]=B,n.t=this.t+N+1,n.s=this.s,n.clamp()},t.prototype.rShiftTo=function(e,n){n.s=this.s;var o=Math.floor(e/this.DB);if(o>=this.t)n.t=0;else{var f=e%this.DB,_=this.DB-f,N=(1<<f)-1;n[0]=this[o]>>f;for(var B=o+1;B<this.t;++B)n[B-o-1]|=(this[B]&N)<<_,n[B-o]=this[B]>>f;0<f&&(n[this.t-o-1]|=(this.s&N)<<_),n.t=this.t-o,n.clamp()}},t.prototype.subTo=function(e,n){for(var o=0,f=0,_=Math.min(e.t,this.t);o<_;)f+=this[o]-e[o],n[o++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f-=e.s;o<this.t;)f+=this[o],n[o++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;o<e.t;)f-=e[o],n[o++]=f&this.DM,f>>=this.DB;f-=e.s}n.s=f<0?-1:0,f<-1?n[o++]=this.DV+f:0<f&&(n[o++]=f),n.t=o,n.clamp()},t.prototype.multiplyTo=function(e,n){var o=this.abs(),f=e.abs(),_=o.t;for(n.t=_+f.t;0<=--_;)n[_]=0;for(_=0;_<f.t;++_)n[_+o.t]=o.am(0,f[_],n,_,0,o.t);n.s=0,n.clamp(),this.s!=e.s&&t.ZERO.subTo(n,n)},t.prototype.squareTo=function(e){for(var n=this.abs(),o=e.t=2*n.t;0<=--o;)e[o]=0;for(o=0;o<n.t-1;++o){var f=n.am(o,n[o],e,2*o,0,1);(e[o+n.t]+=n.am(o+1,2*n[o],e,2*o+1,f,n.t-o-1))>=n.DV&&(e[o+n.t]-=n.DV,e[o+n.t+1]=1)}0<e.t&&(e[e.t-1]+=n.am(o,n[o],e,2*o,0,1)),e.s=0,e.clamp()},t.prototype.divRemTo=function(e,n,o){var f=e.abs();if(!(f.t<=0)){if((Xt=this.abs()).t<f.t)return n!=null&&n.fromInt(0),void(o!=null&&this.copyTo(o));o==null&&(o=r());var _=r(),N=this.s,B=e.s;0<(e=this.DB-nt(f[f.t-1]))?(f.lShiftTo(e,_),Xt.lShiftTo(e,o)):(f.copyTo(_),Xt.copyTo(o));var L=_.t,xt=_[L-1];if(xt!=0){var Xt=xt*(1<<this.F1)+(1<L?_[L-2]>>this.F2:0),se=this.FV/Xt,le=(1<<this.F1)/Xt,Ee=1<<this.F2,Bt=o.t,ge=Bt-L,qt=n==null?r():n;for(_.dlShiftTo(ge,qt),0<=o.compareTo(qt)&&(o[o.t++]=1,o.subTo(qt,o)),t.ONE.dlShiftTo(L,qt),qt.subTo(_,_);_.t<L;)_[_.t++]=0;for(;0<=--ge;){var Ve=o[--Bt]==xt?this.DM:Math.floor(o[Bt]*se+(o[Bt-1]+Ee)*le);if((o[Bt]+=_.am(0,Ve,o,ge,0,L))<Ve)for(_.dlShiftTo(ge,qt),o.subTo(qt,o);o[Bt]<--Ve;)o.subTo(qt,o)}n!=null&&(o.drShiftTo(L,n),N!=B&&t.ZERO.subTo(n,n)),o.t=L,o.clamp(),0<e&&o.rShiftTo(e,o),N<0&&t.ZERO.subTo(o,o)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var n=3&e;return 0<(n=(n=(n=(n=n*(2-(15&e)*n)&15)*(2-(255&e)*n)&255)*(2-((65535&e)*n&65535))&65535)*(2-e*n%this.DV)%this.DV)?this.DV-n:-n},t.prototype.isEven=function(){return(0<this.t?1&this[0]:this.s)==0},t.prototype.exp=function(e,n){if(4294967295<e||e<1)return t.ONE;var o,f=r(),_=r(),N=n.convert(this),B=nt(e)-1;for(N.copyTo(f);0<=--B;)n.sqrTo(f,_),0<(e&1<<B)?n.mulTo(_,N,f):(o=f,f=_,_=o);return n.revert(f)},t.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var n;if(e==16)n=4;else if(e==8)n=3;else if(e==2)n=1;else if(e==32)n=5;else{if(e!=4)return this.toRadix(e);n=2}var o,f=(1<<n)-1,_=!1,N="",B=this.t,L=this.DB-B*this.DB%n;if(0<B--)for(L<this.DB&&0<(o=this[B]>>L)&&(_=!0,N=I(o));0<=B;)L<n?(o=(this[B]&(1<<L)-1)<<n-L,o|=this[--B]>>(L+=this.DB-n)):(o=this[B]>>(L-=n)&f,L<=0&&(L+=this.DB,--B)),(_=0<o||_)&&(N+=I(o));return _?N:"0"},t.prototype.negate=function(){var e=r();return t.ZERO.subTo(this,e),e},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(e){var n=this.s-e.s;if(n!=0)return n;var o=this.t;if((n=o-e.t)!=0)return this.s<0?-n:n;for(;0<=--o;)if((n=this[o]-e[o])!=0)return n;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+nt(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var n=r();return this.abs().divRemTo(e,null,n),this.s<0&&0<n.compareTo(t.ZERO)&&e.subTo(n,n),n},t.prototype.modPowInt=function(e,n){return n=new(e<256||n.isEven()?ot:S)(n),this.exp(e,n)},t.ZERO=w(0),t.ONE=w(1),lt.prototype.convert=Ct,lt.prototype.revert=Ct,lt.prototype.mulTo=function(e,n,o){e.multiplyTo(n,o)},lt.prototype.sqrTo=function(e,n){e.squareTo(n)},q.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var n=r();return e.copyTo(n),this.reduce(n),n},q.prototype.revert=function(e){return e},q.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);0<=e.compareTo(this.m);)e.subTo(this.m,e)},q.prototype.mulTo=function(e,n,o){e.multiplyTo(n,o),this.reduce(o)},q.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)};var X,Y=[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],G=(1<<26)/Y[Y.length-1];function K(){var e;e=new Date().getTime(),gt[et++]^=255&e,gt[et++]^=e>>8&255,gt[et++]^=e>>16&255,gt[et++]^=e>>24&255,Ye<=et&&(et-=Ye)}if(t.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},t.prototype.toRadix=function(e){if(e==null&&(e=10),this.signum()==0||e<2||36<e)return"0";var n=this.chunkSize(e),o=Math.pow(e,n),f=w(o),_=r(),N=r(),B="";for(this.divRemTo(f,_,N);0<_.signum();)B=(o+N.intValue()).toString(e).substr(1)+B,_.divRemTo(f,_,N);return N.intValue().toString(e)+B},t.prototype.fromRadix=function(e,n){this.fromInt(0);for(var o=this.chunkSize(n=n==null?10:n),f=Math.pow(n,o),_=!1,N=0,B=0,L=0;L<e.length;++L){var xt=C(e,L);xt<0?e.charAt(L)=="-"&&this.signum()==0&&(_=!0):(B=n*B+xt,++N>=o&&(this.dMultiply(f),this.dAddOffset(B,0),B=N=0))}0<N&&(this.dMultiply(Math.pow(n,N)),this.dAddOffset(B,0)),_&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,n,o){if(typeof n=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,o),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),tt,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 f=new Array;o=7&e,f.length=1+(e>>3),n.nextBytes(f),0<o?f[0]&=(1<<o)-1:f[0]=0,this.fromString(f,256)}},t.prototype.bitwiseTo=function(e,n,o){for(var f,_=Math.min(e.t,this.t),N=0;N<_;++N)o[N]=n(this[N],e[N]);if(e.t<this.t){for(f=e.s&this.DM,N=_;N<this.t;++N)o[N]=n(this[N],f);o.t=this.t}else{for(f=this.s&this.DM,N=_;N<e.t;++N)o[N]=n(f,e[N]);o.t=e.t}o.s=n(this.s,e.s),o.clamp()},t.prototype.changeBit=function(e,n){return e=t.ONE.shiftLeft(e),this.bitwiseTo(e,n,e),e},t.prototype.addTo=function(e,n){for(var o=0,f=0,_=Math.min(e.t,this.t);o<_;)f+=this[o]+e[o],n[o++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f+=e.s;o<this.t;)f+=this[o],n[o++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;o<e.t;)f+=e[o],n[o++]=f&this.DM,f>>=this.DB;f+=e.s}n.s=f<0?-1:0,0<f?n[o++]=f:f<-1&&(n[o++]=this.DV+f),n.t=o,n.clamp()},t.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(e,n){if(e!=0){for(;this.t<=n;)this[this.t++]=0;for(this[n]+=e;this[n]>=this.DV;)this[n]-=this.DV,++n>=this.t&&(this[this.t++]=0),++this[n]}},t.prototype.multiplyLowerTo=function(e,n,o){var f,_=Math.min(this.t+e.t,n);for(o.s=0,o.t=_;0<_;)o[--_]=0;for(f=o.t-this.t;_<f;++_)o[_+this.t]=this.am(0,e[_],o,_,0,this.t);for(f=Math.min(e.t,n);_<f;++_)this.am(0,e[_],o,_,0,n-_);o.clamp()},t.prototype.multiplyUpperTo=function(e,n,o){var f=o.t=this.t+e.t- --n;for(o.s=0;0<=--f;)o[f]=0;for(f=Math.max(n-this.t,0);f<e.t;++f)o[this.t+f-n]=this.am(n-f,e[f],o,0,0,this.t+f-n);o.clamp(),o.drShiftTo(1,o)},t.prototype.modInt=function(e){if(e<=0)return 0;var n=this.DV%e,o=this.s<0?e-1:0;if(0<this.t)if(n==0)o=this[0]%e;else for(var f=this.t-1;0<=f;--f)o=(n*o+this[f])%e;return o},t.prototype.millerRabin=function(e){var n=this.subtract(t.ONE),o=n.getLowestSetBit();if(o<=0)return!1;var f=n.shiftRight(o);Y.length<(e=e+1>>1)&&(e=Y.length);for(var _=r(),N=0;N<e;++N){_.fromInt(Y[Math.floor(Math.random()*Y.length)]);var B=_.modPow(f,this);if(B.compareTo(t.ONE)!=0&&B.compareTo(n)!=0){for(var L=1;L++<o&&B.compareTo(n)!=0;)if((B=B.modPowInt(2,this)).compareTo(t.ONE)==0)return!1;if(B.compareTo(n)!=0)return!1}}return!0},t.prototype.clone=function(){var e=r();return this.copyTo(e),e},t.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},t.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},t.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},t.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},t.prototype.toByteArray=function(){var e=this.t,n=new Array;n[0]=this.s;var o,f=this.DB-e*this.DB%8,_=0;if(0<e--)for(f<this.DB&&(o=this[e]>>f)!=(this.s&this.DM)>>f&&(n[_++]=o|this.s<<this.DB-f);0<=e;)f<8?(o=(this[e]&(1<<f)-1)<<8-f,o|=this[--e]>>(f+=this.DB-8)):(o=this[e]>>(f-=8)&255,f<=0&&(f+=this.DB,--e)),128&o&&(o|=-256),_==0&&(128&this.s)!=(128&o)&&++_,(0<_||o!=this.s)&&(n[_++]=o);return n},t.prototype.equals=function(e){return this.compareTo(e)==0},t.prototype.min=function(e){return this.compareTo(e)<0?this:e},t.prototype.max=function(e){return 0<this.compareTo(e)?this:e},t.prototype.and=function(e){var n=r();return this.bitwiseTo(e,H,n),n},t.prototype.or=function(e){var n=r();return this.bitwiseTo(e,tt,n),n},t.prototype.xor=function(e){var n=r();return this.bitwiseTo(e,W,n),n},t.prototype.andNot=function(e){var n=r();return this.bitwiseTo(e,it,n),n},t.prototype.not=function(){for(var e=r(),n=0;n<this.t;++n)e[n]=this.DM&~this[n];return e.t=this.t,e.s=~this.s,e},t.prototype.shiftLeft=function(e){var n=r();return e<0?this.rShiftTo(-e,n):this.lShiftTo(e,n),n},t.prototype.shiftRight=function(e){var n=r();return e<0?this.lShiftTo(-e,n):this.rShiftTo(e,n),n},t.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(this[e]!=0)return e*this.DB+(function(n){if(n==0)return-1;var o=0;return!(65535&n)&&(n>>=16,o+=16),!(255&n)&&(n>>=8,o+=8),!(15&n)&&(n>>=4,o+=4),!(3&n)&&(n>>=2,o+=2),!(1&n)&&++o,o})(this[e]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var e=0,n=this.s&this.DM,o=0;o<this.t;++o)e+=(function(f){for(var _=0;f!=0;)f&=f-1,++_;return _})(this[o]^n);return e},t.prototype.testBit=function(e){var n=Math.floor(e/this.DB);return n>=this.t?this.s!=0:!!(this[n]&1<<e%this.DB)},t.prototype.setBit=function(e){return this.changeBit(e,tt)},t.prototype.clearBit=function(e){return this.changeBit(e,it)},t.prototype.flipBit=function(e){return this.changeBit(e,W)},t.prototype.add=function(e){var n=r();return this.addTo(e,n),n},t.prototype.subtract=function(e){var n=r();return this.subTo(e,n),n},t.prototype.multiply=function(e){var n=r();return this.multiplyTo(e,n),n},t.prototype.divide=function(e){var n=r();return this.divRemTo(e,n,null),n},t.prototype.remainder=function(e){var n=r();return this.divRemTo(e,null,n),n},t.prototype.divideAndRemainder=function(e){var n=r(),o=r();return this.divRemTo(e,n,o),new Array(n,o)},t.prototype.modPow=function(e,n){var o=e.bitLength(),f=w(1);if(o<=0)return f;var _=o<18?1:o<48?3:o<144?4:o<768?5:6,N=new(o<8?ot:n.isEven()?q:S)(n),B=new Array,L=3,xt=_-1,Xt=(1<<_)-1;if(B[1]=N.convert(this),1<_){var se=r();for(N.sqrTo(B[1],se);L<=Xt;)B[L]=r(),N.mulTo(se,B[L-2],B[L]),L+=2}var le,Ee,Bt=e.t-1,ge=!0,qt=r();for(o=nt(e[Bt])-1;0<=Bt;){for(xt<=o?le=e[Bt]>>o-xt&Xt:(le=(e[Bt]&(1<<o+1)-1)<<xt-o,0<Bt&&(le|=e[Bt-1]>>this.DB+o-xt)),L=_;!(1&le);)le>>=1,--L;if((o-=L)<0&&(o+=this.DB,--Bt),ge)B[le].copyTo(f),ge=!1;else{for(;1<L;)N.sqrTo(f,qt),N.sqrTo(qt,f),L-=2;0<L?N.sqrTo(f,qt):(Ee=f,f=qt,qt=Ee),N.mulTo(qt,B[le],f)}for(;0<=Bt&&!(e[Bt]&1<<o);)N.sqrTo(f,qt),Ee=f,f=qt,qt=Ee,--o<0&&(o=this.DB-1,--Bt)}return N.revert(f)},t.prototype.modInverse=function(e){var n=e.isEven();if(this.isEven()&&n||e.signum()==0)return t.ZERO;for(var o=e.clone(),f=this.clone(),_=w(1),N=w(0),B=w(0),L=w(1);o.signum()!=0;){for(;o.isEven();)o.rShiftTo(1,o),n?(_.isEven()&&N.isEven()||(_.addTo(this,_),N.subTo(e,N)),_.rShiftTo(1,_)):N.isEven()||N.subTo(e,N),N.rShiftTo(1,N);for(;f.isEven();)f.rShiftTo(1,f),n?(B.isEven()&&L.isEven()||(B.addTo(this,B),L.subTo(e,L)),B.rShiftTo(1,B)):L.isEven()||L.subTo(e,L),L.rShiftTo(1,L);0<=o.compareTo(f)?(o.subTo(f,o),n&&_.subTo(B,_),N.subTo(L,N)):(f.subTo(o,f),n&&B.subTo(_,B),L.subTo(N,L))}return f.compareTo(t.ONE)!=0?t.ZERO:0<=L.compareTo(e)?L.subtract(e):L.signum()<0?(L.addTo(e,L),L.signum()<0?L.add(e):L):L},t.prototype.pow=function(e){return this.exp(e,new lt)},t.prototype.gcd=function(e){var n=this.s<0?this.negate():this.clone(),o=e.s<0?e.negate():e.clone();n.compareTo(o)<0&&(_=n,n=o,o=_);var f=n.getLowestSetBit(),_=o.getLowestSetBit();if(_<0)return n;for(0<(_=f<_?f:_)&&(n.rShiftTo(_,n),o.rShiftTo(_,o));0<n.signum();)0<(f=n.getLowestSetBit())&&n.rShiftTo(f,n),0<(f=o.getLowestSetBit())&&o.rShiftTo(f,o),0<=n.compareTo(o)?(n.subTo(o,n),n.rShiftTo(1,n)):(o.subTo(n,o),o.rShiftTo(1,o));return 0<_&&o.lShiftTo(_,o),o},t.prototype.isProbablePrime=function(e){var n,o=this.abs();if(o.t==1&&o[0]<=Y[Y.length-1]){for(n=0;n<Y.length;++n)if(o[0]==Y[n])return!0;return!1}if(o.isEven())return!1;for(n=1;n<Y.length;){for(var f=Y[n],_=n+1;_<Y.length&&f<G;)f*=Y[_++];for(f=o.modInt(f);n<_;)if(f%Y[n++]==0)return!1}return o.millerRabin(e)},t.prototype.square=function(){var e=r();return this.squareTo(e),e},t.prototype.Barrett=q,gt==null){var gt=new Array,et=0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var It=new Uint8Array(32);for(window.crypto.getRandomValues(It),Mt=0;Mt<32;++Mt)gt[et++]=It[Mt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var Nt=window.crypto.random(32),Mt=0;Mt<Nt.length;++Mt)gt[et++]=255&Nt.charCodeAt(Mt)}for(;et<Ye;)Mt=Math.floor(65536*Math.random()),gt[et++]=Mt>>>8,gt[et++]=255&Mt;et=0,K()}function ke(){if(X==null){for(K(),(X=new Je).init(gt),et=0;et<gt.length;++et)gt[et]=0;et=0}return X.next()}function hr(){}function Je(){this.i=0,this.j=0,this.S=new Array}hr.prototype.nextBytes=function(e){for(var n=0;n<e.length;++n)e[n]=ke()},Je.prototype.init=function(e){for(var n,o,f=0;f<256;++f)this.S[f]=f;for(f=n=0;f<256;++f)n=n+this.S[f]+e[f%e.length]&255,o=this.S[f],this.S[f]=this.S[n],this.S[n]=o;this.i=0,this.j=0},Je.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]};var Ye=256;kt.exports={default:t,BigInteger:t,SecureRandom:hr}}.call(T);var wt=Ht.exports.BigInteger,Pt=(function(){function t(){Q(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return D(t,[{key:"getEncodedHex",value:function(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}},{key:"getLength",value:function(){var r=this.v.length/2,s=r.toString(16);return s.length%2==1&&(s="0"+s),r<128?s:(128+s.length/2).toString(16)+s}},{key:"getValue",value:function(){return""}}]),t})(),ie=(function(){Z(r,Pt);var t=J(r);function r(s){var c;return Q(this,r),(c=t.call(this)).t="02",s&&(c.v=(function(d){if((p=d.toString(16))[0]!=="-")p.length%2==1?p="0"+p:p.match(/^[0-7]/)||(p="00"+p);else{var p,I=(p=p.substr(1)).length;I%2==1?I+=1:p.match(/^[0-7]/)||(I+=2);for(var C="",w=0;w<I;w++)C+="f";p=(p=(C=new wt(C,16)).xor(d).add(wt.ONE)).toString(16).replace(/^-/,"")}return p})(s)),c}return D(r,[{key:"getValue",value:function(){return this.v}}]),r})(),re=(function(){Z(r,Pt);var t=J(r);function r(s){var c;return Q(this,r),(c=t.call(this)).t="30",c.asn1Array=s,c}return D(r,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(s){return s.getEncodedHex()})).join(""),this.v}}]),r})();function jt(t,r){return+t[r+2]<8?1:128&+t.substr(r+2,2)}function ae(t,r){var s=jt(t,r);return(t=t.substr(r+2,2*s))?(+t[0]<8?new wt(t,16):new wt(t.substr(2),16)).intValue():-1}function ne(t,r){return r+2*(jt(t,r)+1)}var Lt=Ht.exports.BigInteger,Jt=new Lt("3"),pe=(function(){function t(r,s){Q(this,t),this.x=s,this.q=r}return D(t,[{key:"equals",value:function(r){return r===this||this.q.equals(r.q)&&this.x.equals(r.x)}},{key:"toBigInteger",value:function(){return this.x}},{key:"negate",value:function(){return new t(this.q,this.x.negate().mod(this.q))}},{key:"add",value:function(r){return new t(this.q,this.x.add(r.toBigInteger()).mod(this.q))}},{key:"subtract",value:function(r){return new t(this.q,this.x.subtract(r.toBigInteger()).mod(this.q))}},{key:"multiply",value:function(r){return new t(this.q,this.x.multiply(r.toBigInteger()).mod(this.q))}},{key:"divide",value:function(r){return new t(this.q,this.x.multiply(r.toBigInteger().modInverse(this.q)).mod(this.q))}},{key:"square",value:function(){return new t(this.q,this.x.square().mod(this.q))}}]),t})(),zt=(function(){function t(r,s,c,d){Q(this,t),this.curve=r,this.x=s,this.y=c,this.z=d==null?Lt.ONE:d,this.zinv=null}return D(t,[{key:"getX",value:function(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"getY",value:function(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}},{key:"equals",value:function(r){return r===this||(this.isInfinity()?r.isInfinity():r.isInfinity()?this.isInfinity():!!r.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(r.z)).mod(this.curve.q).equals(Lt.ZERO)&&r.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(r.z)).mod(this.curve.q).equals(Lt.ZERO))}},{key:"isInfinity",value:function(){return this.x===null&&this.y===null||this.z.equals(Lt.ZERO)&&!this.y.toBigInteger().equals(Lt.ZERO)}},{key:"negate",value:function(){return new t(this.curve,this.x,this.y.negate(),this.z)}},{key:"add",value:function(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var s=this.x.toBigInteger(),c=this.y.toBigInteger(),d=this.z,p=r.x.toBigInteger(),I=r.y.toBigInteger(),C=r.z,w=this.curve.q,nt=s.multiply(C).mod(w);return r=p.multiply(d).mod(w),s=nt.subtract(r),p=c.multiply(C).mod(w),c=I.multiply(d).mod(w),I=p.subtract(c),Lt.ZERO.equals(s)?Lt.ZERO.equals(I)?this.twice():this.curve.infinity:(c=nt.add(r),r=d.multiply(C).mod(w),C=s.square().mod(w),d=s.multiply(C).mod(w),c=r.multiply(I.square()).subtract(c.multiply(C)).mod(w),s=s.multiply(c).mod(w),p=I.multiply(C.multiply(nt).subtract(c)).subtract(p.multiply(d)).mod(w),w=d.multiply(r).mod(w),new t(this.curve,this.curve.fromBigInteger(s),this.curve.fromBigInteger(p),w))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var r=this.x.toBigInteger(),s=this.y.toBigInteger(),c=this.z,d=this.curve.q,p=this.curve.a.toBigInteger(),I=r.square().multiply(Jt).add(p.multiply(c.square())).mod(d),C=s.shiftLeft(1).multiply(c).mod(d),w=(p=(w=s.square().mod(d)).multiply(r).multiply(c).mod(d),s=C.square().mod(d),r=I.square().subtract(p.shiftLeft(3)).mod(d),c=C.multiply(r).mod(d),I.multiply(p.shiftLeft(2).subtract(r)).subtract(s.shiftLeft(1).multiply(w)).mod(d));return d=C.multiply(s).mod(d),new t(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(w),d)}},{key:"multiply",value:function(r){if(this.isInfinity())return this;if(!r.signum())return this.curve.infinity;for(var s=r.multiply(Jt),c=this.negate(),d=this,p=s.bitLength()-2;0<p;p--){d=d.twice();var I=s.testBit(p);I!==r.testBit(p)&&(d=d.add(I?this:c))}return d}}]),t})(),Ot=(function(){function t(r,s,c){Q(this,t),this.q=r,this.a=this.fromBigInteger(s),this.b=this.fromBigInteger(c),this.infinity=new zt(this,null,null)}return D(t,[{key:"equals",value:function(r){return r===this||this.q.equals(r.q)&&this.a.equals(r.a)&&this.b.equals(r.b)}},{key:"fromBigInteger",value:function(r){return new pe(this.q,r)}},{key:"decodePointHex",value:function(r){switch(parseInt(r.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:default:return null;case 4:case 6:case 7:var s=(r.length-2)/2,c=r.substr(2,s);return s=r.substr(2+s,s),new zt(this,this.fromBigInteger(new Lt(c,16)),this.fromBigInteger(new Lt(s,16)))}}}]),t})(),Ut={ECPointFp:zt,ECCurveFp:Ot},Zt=Ht.exports.BigInteger,ue=(Ot=Ht.exports.SecureRandom,Ut.ECCurveFp),ce=new Ot,te=(Ut=y()).curve,h=Ut.G,l=Ut.n;function y(){var t=new Zt("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),r=new Zt("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),s=new Zt("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return s=(r=new ue(t,r,s)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:r,G:s,n:new Zt("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function x(t,r){return t.length>=r?t:new Array(r-t.length+1).join("0")+t}function A(t,r){for(var s=[],c=~~(r/8),d=r%8,p=0,I=t.length;p<I;p++)s[p]=(t[(p+c)%I]<<d&255)+(t[(p+c+1)%I]>>>8-d&255);return s}function M(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=255&(t[c]^r[c]);return s}function rt(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=t[c]&r[c]&255;return s}function mt(t,r){for(var s=[],c=t.length-1;0<=c;c--)s[c]=255&(t[c]|r[c]);return s}function pt(t,r){for(var s=[],c=0,d=t.length-1;0<=d;d--){var p=t[d]+r[d]+c;c=255<p?1:0,s[d]=255&p}return s}function Gt(t,r,s,c){return 0<=c&&c<=15?M(M(t,r),s):mt(rt(t,r),rt((function(d){for(var p=[],I=d.length-1;0<=I;I--)p[I]=255&~d[I];return p})(t),s))}function $t(t,r){for(var s=[],c=[],d=0;d<16;d++){var p=4*d;s.push(r.slice(p,4+p))}for(var I,C=16;C<68;C++)s.push(M(M((I=M(M(s[C-16],s[C-9]),A(s[C-3],15)),M(M(I,A(I,15)),A(I,23))),A(s[C-13],7)),s[C-6]));for(var w=0;w<64;w++)c.push(M(s[w],s[w+4]));for(var nt,ot,S,H=[121,204,69,25],tt=[122,135,157,138],W=t.slice(0,4),it=t.slice(4,8),lt=t.slice(8,12),Ct=t.slice(12,16),q=t.slice(16,20),X=t.slice(20,24),Y=t.slice(24,28),G=t.slice(28,32),K=0;K<64;K++){var gt=0<=K&&K<=15?H:tt,et=M(It=A(pt(pt(A(W,12),q),A(gt,K)),7),A(W,12)),It=(et=pt(pt(pt((nt=W,ot=it,S=lt,0<=(gt=K)&&gt<=15?M(M(nt,ot),S):mt(mt(rt(nt,ot),rt(nt,S)),rt(ot,S))),Ct),et),c[K]),pt(pt(pt(Gt(q,X,Y,K),G),It),s[K]));Ct=lt,lt=A(it,9),it=W,W=et,G=Y,Y=A(X,19),X=q,q=M(M(It,A(It,9)),A(It,17))}return M([].concat(W,it,lt,Ct,q,X,Y,G),t)}Ot={getGlobalCurve:function(){return te},generateEcparam:y,generateKeyPairHex:function(t,r,s){return{privateKey:s=x((r=(t?new Zt(t,r,s):new Zt(l.bitLength(),ce)).mod(l.subtract(Zt.ONE)).add(Zt.ONE)).toString(16),64),publicKey:"04"+x((r=h.multiply(r)).getX().toBigInteger().toString(16),64)+x(r.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(t){for(var r=(t=unescape(encodeURIComponent(t))).length,s=[],c=0;c<r;c++)s[c>>>2]|=(255&t.charCodeAt(c))<<24-c%4*8;for(var d=[],p=0;p<r;p++){var I=s[p>>>2]>>>24-p%4*8&255;d.push((I>>>4).toString(16)),d.push((15&I).toString(16))}return d.join("")},leftPad:x,arrayToHex:function(t){return t.map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},arrayToUtf8:function(t){for(var r=[],s=0,c=0;c<2*t.length;c+=2)r[c>>>3]|=parseInt(t[s],10)<<24-c%8*4,s++;try{for(var d=[],p=0;p<t.length;p++){var I=r[p>>>2]>>>24-p%4*8&255;d.push(String.fromCharCode(I))}return decodeURIComponent(escape(d.join("")))}catch(C){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){for(var r=[],s=(t=(s=t.length)%2!=0?x(t,s+1):t).length,c=0;c<s;c+=2)r.push(parseInt(t.substr(c,2),16));return r},verifyPublicKey:function(t){var r=te.decodePointHex(t);return!!r&&(t=r.getX(),r.getY().square().equals(t.multiply(t.square()).add(t.multiply(te.a)).add(te.b)))}},Ut=function(t){for(var r=448<=(r=(C=8*t.length)%512)?512-r%448-1:448-r-1,s=new Array((r-7)/8),c=0,d=s.length;c<d;c++)s[c]=0;for(var p,I=[],C=C.toString(2),w=7;0<=w;w--)8<C.length?(p=C.length-8,I[w]=parseInt(C.substr(p),2),C=C.substr(0,p)):0<C.length?(I[w]=parseInt(C,2),C=""):I[w]=0;for(var nt=[].concat(t,[128],s,I),ot=nt.length/64,S=[115,128,22,111,73,20,178,185,23,36,66,215,218,138,6,0,169,111,48,188,22,49,56,170,227,141,238,77,176,251,14,78],H=0;H<ot;H++){var tt=64*H;S=$t(S,nt.slice(tt,64+tt))}return S};var Et=Ht.exports.BigInteger,zr=function(t,r){return t=new ie(t),r=new ie(r),new re([t,r]).getEncodedHex()},$r=function(t){var r=ne(t,0),s=ne(t,r),c=ae(t,r);return r=t.substr(s,2*c),s=ne(t,c=s+r.length),c=ae(t,c),t=t.substr(s,2*c),{r:new wt(r,16),s:new wt(t,16)}},ct=Ot,ve=Ut,Ae=(Ot=ct.generateEcparam()).G,sr=Ot.curve,De=Ot.n;function ur(t,r,s){var c=2<arguments.length&&s!==void 0?s:"1234567812345678",d=(c=ct.utf8ToHex(c),ct.leftPad(Ae.curve.a.toBigInteger().toRadix(16),64)),p=ct.leftPad(Ae.curve.b.toBigInteger().toRadix(16),64),I=ct.leftPad(Ae.getX().toBigInteger().toRadix(16),64),C=ct.leftPad(Ae.getY().toBigInteger().toRadix(16),64);return s=(r=128<r.length?r.substr(2,128):r).substr(0,64),r=r.substr(64,64),r=ct.hexToArray(c+d+p+I+C+s+r),c=4*c.length,r.unshift(255&c),r.unshift(c>>8&255),r=ve(r),ct.arrayToHex(ve(r.concat(ct.hexToArray(t))))}function cr(){var t=ct.generateKeyPairHex(),r=sr.decodePointHex(t.publicKey);return t.k=new Et(t.privateKey,16),t.x1=r.getX().toBigInteger(),t}Ot={generateKeyPairHex:ct.generateKeyPairHex,doEncrypt:function(t,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;t=typeof t=="string"?ct.hexToArray(ct.utf8ToHex(t)):Array.prototype.slice.call(t),r=ct.getGlobalCurve().decodePointHex(r);var c=ct.generateKeyPairHex(),d=new Et(c.privateKey,16),p=c.publicKey;128<p.length&&(p=p.substr(p.length-128)),c=r.multiply(d),d=ct.hexToArray(ct.leftPad(c.getX().toBigInteger().toRadix(16),64)),r=ct.hexToArray(ct.leftPad(c.getY().toBigInteger().toRadix(16),64)),c=ct.arrayToHex(ve([].concat(d,t,r)));var I,C=1,w=0,nt=[],ot=[].concat(d,r);(I=function(){nt=ve([].concat(St(ot),[C>>24&255,C>>16&255,C>>8&255,255&C])),C++,w=0})();for(var S=0,H=t.length;S<H;S++)w===nt.length&&I(),t[S]^=255&nt[w++];return r=ct.arrayToHex(t),s===0?p+r+c:p+c+r},doDecrypt:function(t,r){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,c=(p=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":p;r=new Et(r,16);var d=t.substr(128,64),p=t.substr(192);s===0&&(d=t.substr(t.length-64),p=t.substr(128,t.length-128-64));var I,C=ct.hexToArray(p),w=(t=ct.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(r),r=ct.hexToArray(ct.leftPad(t.getX().toBigInteger().toRadix(16),64)),t=ct.hexToArray(ct.leftPad(t.getY().toBigInteger().toRadix(16),64)),1),nt=0,ot=[],S=[].concat(r,t);(I=function(){ot=ve([].concat(St(S),[w>>24&255,w>>16&255,w>>8&255,255&w])),w++,nt=0})();for(var H=0,tt=C.length;H<tt;H++)nt===ot.length&&I(),C[H]^=255&ot[nt++];return ct.arrayToHex(ve([].concat(r,C,t)))===d?c==="array"?C:ct.arrayToUtf8(C):c==="array"?[]:""},doSignature:function(t,r){var s=(C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,c=C.der,d=C.hash,p=C.publicKey,I=C.userId,C=typeof t=="string"?ct.utf8ToHex(t):ct.arrayToHex(t);d&&(C=ur(C,p||(t=r,d=Ae.multiply(new Et(t,16)),"04"+(t=ct.leftPad(d.getX().toBigInteger().toString(16),64))+(d=ct.leftPad(d.getY().toBigInteger().toString(16),64))),I));var w=new Et(r,16),nt=new Et(C,16),ot=null,S=null,H=null;do do{var tt;ot=(tt=s&&s.length?s.pop():cr()).k,S=nt.add(tt.x1).mod(De)}while(S.equals(Et.ZERO)||S.add(ot).equals(De));while((H=w.add(Et.ONE).modInverse(De).multiply(ot.subtract(S.multiply(w))).mod(De)).equals(Et.ZERO));return c?zr(S,H):ct.leftPad(S.toString(16),64)+ct.leftPad(H.toString(16),64)},doVerifySignature:function(t,r,s){var c,d,p=(C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,I=C.hash,C=C.userId;return t=typeof t=="string"?ct.utf8ToHex(t):ct.arrayToHex(t),I&&(t=ur(t,s,C)),d=p?(c=(d=$r(r)).r,d.s):(c=new Et(r.substring(0,64),16),new Et(r.substring(64),16)),r=sr.decodePointHex(s),s=new Et(t,16),!(t=c.add(d).mod(De)).equals(Et.ZERO)&&(r=Ae.multiply(d).add(r.multiply(t)),s=s.add(r.getX().toBigInteger()).mod(De),c.equals(s))},getPoint:cr,verifyPublicKey:ct.verifyPublicKey};var Qr=Ut,Ne=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],xe=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function Be(t){for(var r=[],s=0,c=t.length;s<c;s+=2)r.push(parseInt(t.substr(s,2),16));return r}function Re(t,r){return t<<r|t>>>32-r}function he(t){return(255&Ne[t>>>24&255])<<24|(255&Ne[t>>>16&255])<<16|(255&Ne[t>>>8&255])<<8|255&Ne[255&t]}function Fe(t){return t^Re(t,2)^Re(t,10)^Re(t,18)^Re(t,24)}function Le(t){return t^Re(t,13)^Re(t,23)}function lr(t,r,s,c){c=(p=(I=3<arguments.length&&c!==void 0?c:{}).padding)===void 0?"pkcs#5":p;var d=I.mode,p=(p=I.iv)===void 0?[]:p,I=(I=I.output)===void 0?"string":I;if(d==="cbc"&&(p=typeof p=="string"?Be(p):p).length!==16)throw new Error("iv is invalid");if((r=typeof r=="string"?Be(r):r).length!==16)throw new Error("key is invalid");if(t=(typeof t=="string"?s!==0?function(q){for(var X=[],Y=0,G=q.length;Y<G;Y++){var K=q.codePointAt(Y);if(K<=127)X.push(K);else if(K<=2047)X.push(192|K>>>6),X.push(128|63&K);else if(K<=55295||57344<=K&&K<=65535)X.push(224|K>>>12),X.push(128|K>>>6&63),X.push(128|63&K);else{if(!(65536<=K&&K<=1114111))throw X.push(K),new Error("input is not supported");Y++,X.push(240|K>>>18&28),X.push(128|K>>>12&63),X.push(128|K>>>6&63),X.push(128|63&K)}}return X}:Be:St)(t),c==="pkcs#5"&&s!==0)for(var C=16-t.length%16,w=0;w<C;w++)t.push(C);var nt=new Array(32);(function(q,X,Y){for(var G=new Array(4),K=new Array(4),gt=0;gt<4;gt++)K[0]=255&q[0+4*gt],K[1]=255&q[1+4*gt],K[2]=255&q[2+4*gt],K[3]=255&q[3+4*gt],G[gt]=K[0]<<24|K[1]<<16|K[2]<<8|K[3];G[0]^=2746333894,G[1]^=1453994832,G[2]^=1736282519,G[3]^=2993693404;for(var et,It=0;It<32;It+=4)et=G[1]^G[2]^G[3]^xe[It+0],X[It+0]=G[0]^=Le(he(et)),et=G[2]^G[3]^G[0]^xe[It+1],X[It+1]=G[1]^=Le(he(et)),et=G[3]^G[0]^G[1]^xe[It+2],X[It+2]=G[2]^=Le(he(et)),et=G[0]^G[1]^G[2]^xe[It+3],X[It+3]=G[3]^=Le(he(et));if(Y===0)for(var Nt,Mt=0;Mt<16;Mt++)Nt=X[Mt],X[Mt]=X[31-Mt],X[31-Mt]=Nt})(r,nt,s);for(var ot=[],S=p,H=t.length,tt=0;16<=H;){var W=t.slice(tt,tt+16),it=new Array(16);if(d==="cbc")for(var lt=0;lt<16;lt++)s!==0&&(W[lt]^=S[lt]);(function(q,X,Y){for(var G=new Array(4),K=new Array(4),gt=0;gt<4;gt++)K[0]=255&q[4*gt],K[1]=255&q[4*gt+1],K[2]=255&q[4*gt+2],K[3]=255&q[4*gt+3],G[gt]=K[0]<<24|K[1]<<16|K[2]<<8|K[3];for(var et,It=0;It<32;It+=4)et=G[1]^G[2]^G[3]^Y[It+0],G[0]^=Fe(he(et)),et=G[2]^G[3]^G[0]^Y[It+1],G[1]^=Fe(he(et)),et=G[3]^G[0]^G[1]^Y[It+2],G[2]^=Fe(he(et)),et=G[0]^G[1]^G[2]^Y[It+3],G[3]^=Fe(he(et));for(var Nt=0;Nt<16;Nt+=4)X[Nt]=G[3-Nt/4]>>>24&255,X[Nt+1]=G[3-Nt/4]>>>16&255,X[Nt+2]=G[3-Nt/4]>>>8&255,X[Nt+3]=255&G[3-Nt/4]})(W,it,nt);for(var Ct=0;Ct<16;Ct++)d==="cbc"&&s===0&&(it[Ct]^=S[Ct]),ot[tt+Ct]=it[Ct];d==="cbc"&&(S=s!==0?it:W),H-=16,tt+=16}return c==="pkcs#5"&&s===0&&(c=ot[ot.length-1],ot.splice(ot.length-c,c)),I!=="array"?s!==0?ot.map((function(q){return(q=q.toString(16)).length===1?"0"+q:q})).join(""):(function(q){for(var X=[],Y=0,G=q.length;Y<G;Y++)240<=q[Y]&&q[Y]<=247?(X.push(String.fromCodePoint(((7&q[Y])<<18)+((63&q[Y+1])<<12)+((63&q[Y+2])<<6)+(63&q[Y+3]))),Y+=3):224<=q[Y]&&q[Y]<=239?(X.push(String.fromCodePoint(((15&q[Y])<<12)+((63&q[Y+1])<<6)+(63&q[Y+2]))),Y+=2):192<=q[Y]&&q[Y]<=223?(X.push(String.fromCodePoint(((31&q[Y])<<6)+(63&q[Y+1]))),Y++):X.push(String.fromCodePoint(q[Y]));return X.join("")})(ot):ot}var Zr=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],ye=[],tn=function(t,r,s){for(var c=t[0],d=t[1],p=t[2],I=t[3],C=t[4],w=t[5],nt=t[6],ot=t[7],S=0;S<64;S++){S<16?ye[S]=0|r[s+S]:(H=ye[S-15],tt=ye[S-2],ye[S]=((H<<25|H>>>7)^(H<<14|H>>>18)^H>>>3)+ye[S-7]+((tt<<15|tt>>>17)^(tt<<13|tt>>>19)^tt>>>10)+ye[S-16]);var H=c&d^c&p^d&p,tt=ot+((C<<26|C>>>6)^(C<<21|C>>>11)^(C<<7|C>>>25))+(C&w^~C&nt)+Zr[S]+ye[S];ot=nt,nt=w,w=C,C=I+tt|0,I=p,p=d,d=c,c=tt+(((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+H)|0}t[0]=t[0]+c|0,t[1]=t[1]+d|0,t[2]=t[2]+p|0,t[3]=t[3]+I|0,t[4]=t[4]+C|0,t[5]=t[5]+w|0,t[6]=t[6]+nt|0,t[7]=t[7]+ot|0},fr=(Ot={c2:Ot,c3:function(t){return t=typeof t=="string"?(function(r){for(var s=[],c=0,d=r.length;c<d;c++){var p=r.codePointAt(c);if(p<=127)s.push(p);else if(p<=2047)s.push(192|p>>>6),s.push(128|63&p);else if(p<=55295||57344<=p&&p<=65535)s.push(224|p>>>12),s.push(128|p>>>6&63),s.push(128|63&p);else{if(!(65536<=p&&p<=1114111))throw s.push(p),new Error("input is not supported");c++,s.push(240|p>>>18&28),s.push(128|p>>>12&63),s.push(128|p>>>6&63),s.push(128|63&p)}}return s})(t):Array.prototype.slice.call(t),Qr(t).map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},c4:{encrypt:function(t,r,s){return lr(t,r,1,s)},decrypt:function(t,r,s){return lr(t,r,0,s)}},s2:function(t){var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],s=(function(d){for(var p=[],I=0;I<Math.ceil(d.length/4);I++)p[I]=d[4*I]<<24|(255&d[4*I+1])<<16|(255&d[4*I+2])<<8|255&d[4*I+3];return p})(t);s[(t=8*t.length)>>5]|=128<<24-t%32,s[15+(64+t>>9<<4)]=t;for(var c=0;c<s.length;c+=16)tn(r,s,c);return(function(d){for(var p=[],I=0;I<d.length;I++)p[4*I]=d[I]>>24&255,p[4*I+1]=d[I]>>16&255,p[4*I+2]=d[I]>>8&255,p[4*I+3]=255&d[I];return p})(r).map((function(d){return(d=d.toString(16)).length===1?"0"+d:d})).join("")}},vt),en=yt,rn=Dt,nn=Yt,on=Wt,an=Ot.c2,sn=Ot.c3,un=Ot.c4,cn=Ot.s2;return(function(){var t;(t=function(){}).VERSION="2.1.0";var r=T;if(r.AAR2)return r.AAR2.VERSION!==t.VERSION&&console.log(r.AAR2.VERSION),r.AAR2;var s="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",c=!1,d=!1,p=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,I=p!==void 0&&!!p.request&&!!p.login,C=function(S,H){return typeof S=="string"&&typeof H=="string"&&S!=null&&H!=null&&S.substring(0,H.length)===H},w={SUCCESS:0,ALREADY_SUCCESS:1,ERROR_XHR_TIMEOUT:-1,ERROR_XHR_ERROR:-2,ERROR_XXX_REQUEST_TIMEOUT:-3,ERROR_XXX_REQUEST_FAIL:-4,ERROR_SIGN_CHECK:-5,ERROR_UNKNOWN_ERROR:-6,ERROR_DATA_FORMAT:-7},nt=function(S){for(var H in w)if(w[H]===S)return H},ot=function(S,H,tt){var W=Date.now(),it=new t;try{if(!S||S.length<=75)return console.error("error format 1:",S),w.ERROR_DATA_FORMAT;if(!C(S,"eyJ"))return console.error("error format 2:",S),w.ERROR_DATA_FORMAT;S=S.substring(3,S.length);var lt=en.my_b4_decode(S);if(!lt)return console.error("error format 3:",S),w.ERROR_DATA_FORMAT;var Ct,q=it.cc.u8.byteToInt(lt.slice(0,4),0),X=lt.slice(4,4+q),Y=it.cc.u8.byteToInt(lt.slice(4+q,4+q+4),0),G=lt.slice(4+q+4,4+q+4+Y),K=it.cc.u8.byteToInt(lt.slice(4+q+4+Y,4+q+4+Y+4),0),gt=lt.slice(4+q+4+Y+4,4+q+4+Y+4+K),et=it.cc.u8.bytesToUtf8Str(X);if(it.cc.h6.encode(G,0,Y),H||(tt!==void 0&&tt==="sm2"?(Ct=it.cc.h6.encode(G,0,Y),it.co.c2.doVerifySignature(et,Ct,s,{der:!0,hash:!0})):it.co.c3(et+"8890012345678890").toLowerCase()===it.cc.h6.encode(gt,0,K).toLowerCase())){if(et.length%2==0){t.prototype.__v=function(){return et.slice(0,2)};for(var It=[],Nt=2;Nt<66;Nt+=2)It.push(parseInt("0x"+et.slice(Nt,Nt+2)));t.prototype.__i=function(){return It};var Mt=parseInt("0x"+et.slice(66,82))-W;t.prototype.__o=function(){return Mt}}return I||T.AAR2||(T.AAR2=t),w.SUCCESS}}catch(ke){return console.error(ke),w.ERROR_UNKNOWN_ERROR}return w.ERROR_SIGN_CHECK};return t.init=function(S,H){var tt,W={debug:!1,url:"https://aks.jdpay.com/aar2/getJS",callback:function(){}};typeof S=="string"?(C(S,"https")||C(S,"https")?W.url=S:C(S,"eyJ")&&(W.code=S),typeof H=="string"&&(W.publicKey=H)):ht(S)==="object"&&(S.debug&&(W.debug=S.debug),S.url&&(W.url=S.url),S.code&&(W.code=S.code),S.publicKey&&(W.publicKey=S.publicKey),S.skipVerify&&(W.skipVerify=S.skipVerify),S.alg&&(W.alg=S.alg),S.callback&&typeof S.callback=="function"&&(W.callback=S.callback)),d?W.callback&&W.callback(!0,{errorNo:tt=w.ALREADY_SUCCESS,errorMsg:nt(tt)}):c?setTimeout((function(){t.init(S,H)}),50):(c=!0,W.debug&&fr.start(W.debug),W.publicKey&&(s=W.publicKey),W.code?(tt=ot(W.code,W.skipVerify))===w.SUCCESS?(c=!(d=!0),W.callback(!0,{errorNo:tt,errorMsg:nt(tt)})):W.callback(!1,{errorNo:tt,errorMsg:nt(tt)}):W.url&&(function(it,lt,Ct){try{if(it=it+"?version="+t.VERSION+(I?"&name=wechat":"&name=browser")+"&t="+Date.now(),I)p.request({url:it,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function(X){X.statusCode===200?lt(X.data):Ct(w.ERROR_XXX_REQUEST_FAIL)},fail:function(X){X&&X.errMsg&&X.errMsg.indexOf("timeout")!==-1?Ct(w.ERROR_XXX_REQUEST_TIMEOUT):Ct(w.ERROR_XXX_REQUEST_FAIL)}});else{var q;if(window.XMLHttpRequest)q=new XMLHttpRequest;else if(window.ActiveXObject)try{q=new ActiveXObject("Msxml2.XMLHTTP")}catch(X){try{q=new ActiveXObject("Microsoft.XMLHTTP")}catch(Y){}}q&&(q.onload=function(){q.readyState===4&&(q.status===200?lt(q.responseText):Ct(w.ERROR_XHR_ERROR))},q.ontimeout=function(){Ct(w.ERROR_XHR_TIMEOUT)},q.onerror=function(){Ct(w.ERROR_XHR_ERROR)},q.open("POST",it,!0),q.timeout=5e3,q.send(null))}}catch(X){console.error(X),Ct(w.ERROR_UNKNOWN_ERROR)}})(W.url,(function(it){(it=ot(it,W.skipVerify,W.alg))===w.SUCCESS?(c=!(d=!0),W.callback(!0,{errorNo:it,errorMsg:nt(it)})):(c=!1,W.callback(!1,{errorNo:it,errorMsg:nt(it)}))}),(function(it){c=!1,W.callback(!1,{errorNo:it,errorMsg:nt(it)})})))},t.prototype={cc:{b4:rn,h6:nn,u8:on},co:{c2:an,c3:sn,c4:un,s2:cn},nonce:function(){var S="0000000000"+Math.ceil(2147483647*Math.random())+Math.floor((Date.now()+this.__o())/1e3);return S.substring(S.length-20)},sign:function(S,H){return this.__s(S,H)},__s:function(S,H){var tt=this.cc.u8.utf8StrToBytes(S),W=this.__i();return S=this.cc.u8.utf8StrToBytes(H),H=this.cc.u8.utf8StrToBytes(this.__c()),S=[].concat(tt,W,S,H),H=parseInt("0x"+this.__v()),this.__f(H)(S)+this.__v()},__f:function(S){var H=this.co.s2,tt=this.co.c3,W=this.cc.h6.decode,it=[function(lt){return H(lt)},function(lt){return tt(lt)},function(lt){return tt(W(H(lt)))},function(lt){return H(W(tt(lt)))},function(lt){return tt(W(tt(lt)))},function(lt){return H(W(H(lt)))}];return it[(128<S?S-128:S)%it.length]},__i:function(){return[115,128,22,111,73,20,178,185,23,36,66,215,218,138,6,0,169,111,48,188,22,49,56,170,227,141,238,77,176,251,14,78]},__v:function(){return"00"},__c:function(){if(this.__d())return"debug";if(typeof phantom!="undefined"&&phantom.exit&&phantom.injectJs)return"phantom";if(typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]"&&process.version&&process.pid&&process.argv)return"require";if(p!==void 0&&p.env&&p.request&&p.getStorage){if(typeof window!="undefined"&&window.document&&window.alert&&window.atob&&typeof window.setTimeout=="function")return"window"}else{if(!(typeof window!="undefined"&&window.document&&window.alert&&window.atob&&typeof window.setTimeout=="function"))return"window";if(!window.navigator||typeof window.navigator.vendor!="string")return"navigator";if(window.navigator.webdriver)return"webdriver"}return""},__o:function(){return 0},__d:function(){return fr.isDebug()},version:function(){return t.VERSION}},t})()},Rt(R)=="object"?g.exports=at():($=typeof(k=at)=="function"?k.call(R,E,R,g):k)===void 0||(g.exports=$)}},a={};function u(g){var R=a[g];if(R!==void 0)return R.exports;var E=a[g]={id:g,loaded:!1,exports:{}};return i[g].call(E.exports,E,E.exports,u),E.loaded=!0,E.exports}u.n=g=>{var R=g&&g.__esModule?()=>g.default:()=>g;return u.d(R,{a:R}),R},u.d=(g,R)=>{for(var E in R)u.o(R,E)&&!u.o(g,E)&&Object.defineProperty(g,E,{enumerable:!0,get:R[E]})},u.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(g){if(typeof window=="object")return window}})(),u.hmd=g=>((g=Object.create(g)).children||(g.children=[]),Object.defineProperty(g,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+g.id)}}),g),u.o=(g,R)=>Object.prototype.hasOwnProperty.call(g,R),u.r=g=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(g,"__esModule",{value:!0})};var v=u(737);Or.exports.LyyGetCommandSDK=v})()});var Kt={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},fe={SIT:"sit",RELEASE:"release",PROD:"prod"},Me={[Kt.DEV]:"https://dm.leyaoyao.com",[Kt.SIT]:"https://sm.leyaoyao.com",[Kt.UAT]:"https://um.leyaoyao.com",[Kt.PROD]:"https://m.leyaoyao.com"},yr={[Kt.DEV]:"https://dad2.leyaoyao.com",[Kt.SIT]:"https://sad2.leyaoyao.com",[Kt.UAT]:"https://uad2.leyaoyao.com",[Kt.PROD]:"https://nad.ehuoke.com"},we={[fe.SIT]:"https://sopenapi.leyaoyao.com",[fe.RELEASE]:"https://uopen-api.leyaoyao.com",[fe.PROD]:"https://api-gateway.leyaoyao.com"};function je(i,a){return`${Me[i]||Me[Kt.PROD]}${a}`}function gr(i){return yr[i]||yr[Kt.PROD]}var Ie={debug:!1,env:Kt.PROD,externalEnv:fe.PROD,apiDomain:""},mr=bt({},Ie);function _r(i){mr=bt(bt({},Ie),i)}function de(){return mr}var yn=Object.defineProperty,gn=(i,a,u)=>a in i?yn(i,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):i[a]=u,mn=(i,a,u)=>gn(i,typeof a!="symbol"?a+"":a,u);function ee(){return typeof Taro!="undefined"&&Taro.getEnv?"taro":typeof uni!="undefined"&&uni.request?"uni":typeof wx!="undefined"&&wx.request?"wechat":typeof my!="undefined"&&my.request?"alipay":typeof window!="undefined"?"web":"unknown"}var _n=class{constructor(i=!1){mn(this,"enable"),this.enable=i}setEnable(i){this.enable=i}info(...i){this.enable&&console.info("[BI Info]",...i)}warn(...i){this.enable&&console.warn("[BI Warn]",...i)}error(...i){this.enable&&console.error("[BI Error]",...i)}debug(...i){this.enable&&console.log("[BI Debug]",...i)}},U=new _n;function Xe(i){let a=ee();return a==="taro"?Taro.setClipboardData({data:i}).then(()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):a==="uni"?new Promise((u,v)=>{uni.setClipboardData({data:i,success:()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{U.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),v(g)}})}):a==="wechat"?new Promise((u,v)=>{wx.setClipboardData({data:i,success:()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{U.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),v(g)}})}):a==="alipay"?new Promise((u,v)=>{my.setClipboardData({text:i,success:()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{U.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),v(g)}})}):navigator.clipboard.writeText(i).then(()=>{U.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function Ke(i,a=2e3){let u=ee();if(u==="taro"){Taro.showToast({title:i,icon:"none",mask:!0,duration:a});return}if(u==="uni"){uni.showToast({title:i,icon:"none",mask:!0,duration:a});return}if(u==="wechat"){wx.showToast({title:i,icon:"none",mask:!0,duration:a});return}if(u==="alipay"){my.showToast({content:i,duration:a});return}typeof console!="undefined"&&console.log(`[Toast] ${i}`)}async function me(){var i,a,u,v,g;let R=ee();try{if(R==="taro")return((i=(await Taro.getSystemInfo()).platform)==null?void 0:i.toLowerCase())==="ios"?"ios":"android";if(R==="uni")return((a=uni.getSystemInfoSync().platform)==null?void 0:a.toLowerCase())==="ios"?"ios":"android";if(R==="wechat")return wx.getDeviceInfo?((u=(await wx.getDeviceInfo()).platform)==null?void 0:u.toLowerCase())==="ios"?"ios":"android":((v=wx.getSystemInfoSync().platform)==null?void 0:v.toLowerCase())==="ios"?"ios":"android";if(R==="alipay")return((g=my.getSystemInfoSync().platform)==null?void 0:g.toLowerCase())==="ios"?"ios":"android";if(typeof navigator!="undefined"){let E=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(E))return"ios";if(/android/.test(E))return"android"}return"unknown"}catch(E){return U.error("\u83B7\u53D6\u5E73\u53F0\u4FE1\u606F\u5931\u8D25",E),"unknown"}}var Ft={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function z(i,a,u=null){return{code:i,message:a,data:u}}function qe(i,a){return i==null?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof i=="string"&&i.trim().length===0?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function Pe(i,a){for(let u of a){let v=qe(i[u],u);if(!v.valid)return v}return{valid:!0}}var tr={};Ge(tr,{handleJdInsurance:()=>Lr,handleJdInsuranceExt:()=>Ur,handleJdjrCashLoanExt:()=>Cr,handleJdjrCashLoanFlow:()=>Pr});var We=(J=>(J[J.JD_CASH_LOAN__MISSING_PHONE=2001]="JD_CASH_LOAN__MISSING_PHONE",J[J.JD_CASH_LOAN__MISSING_DEVICE_ID=2002]="JD_CASH_LOAN__MISSING_DEVICE_ID",J[J.JD_CASH_LOAN__RTA_FAILED=2003]="JD_CASH_LOAN__RTA_FAILED",J[J.JD_CASH_LOAN__GET_CONFIG_FAILED=2004]="JD_CASH_LOAN__GET_CONFIG_FAILED",J[J.JD_CASH_LOAN__INVALID_CONFIG=2005]="JD_CASH_LOAN__INVALID_CONFIG",J[J.JD_CASH_LOAN__EXT_NOT_ELIGIBLE=2006]="JD_CASH_LOAN__EXT_NOT_ELIGIBLE",J[J.JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS=2007]="JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS",J[J.JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM=2008]="JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM",J[J.JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID=2009]="JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID",J[J.JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE=2010]="JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE",J[J.JD_INSURANCE__USER_NOT_ELIGIBLE=2101]="JD_INSURANCE__USER_NOT_ELIGIBLE",J[J.JD_INSURANCE__H5_NOT_SUPPORTED=2102]="JD_INSURANCE__H5_NOT_SUPPORTED",J[J.JD_INSURANCE__INVALID_JUMP_PARAMS=2103]="JD_INSURANCE__INVALID_JUMP_PARAMS",J[J.JD_INSURANCE__GET_CONFIG_FAILED=2104]="JD_INSURANCE__GET_CONFIG_FAILED",J[J.JD_INSURANCE__COPY_FAILED=2105]="JD_INSURANCE__COPY_FAILED",J[J.JD_INSURANCE__TASK_COMPLETED=2106]="JD_INSURANCE__TASK_COMPLETED",J[J.JD_INSURANCE__UNKNOWN_JUMP_MODE=2107]="JD_INSURANCE__UNKNOWN_JUMP_MODE",J[J.JD_INSURANCE__RTA_FAILED=2108]="JD_INSURANCE__RTA_FAILED",J))(We||{}),Tt={2001:"\u7F3A\u5C11\u624B\u673A\u53F7\u53C2\u6570",2002:"\u7F3A\u5C11\u8BBE\u5907ID",2003:"\u672A\u6EE1\u8DB3\u6D3B\u52A8\u8D44\u683C",2004:"\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E\u5931\u8D25",2005:"\u8DF3\u8F6C\u914D\u7F6E\u53C2\u6570\u5F02\u5E38",2006:"\u7528\u6237\u4E0D\u7B26\u5408\u6D3B\u52A8\u53C2\u4E0E\u6761\u4EF6",2007:"\u8DF3\u8F6C\u53C2\u6570\u5F02\u5E38",2008:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u5E73\u53F0\u53C2\u6570",2009:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u7528\u6237ID",2010:"\u7F3A\u5C11\u7B2C\u4E09\u65B9\u8BBE\u5907\u503C",2101:"\u7528\u6237\u4E0D\u7B26\u5408\u6D3B\u52A8\u53C2\u4E0E\u6761\u4EF6",2102:"H5\u6A21\u5F0F\u6682\u4E0D\u652F\u6301",2103:"\u8DF3\u8F6C\u53C2\u6570\u5F02\u5E38",2104:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u5931\u8D25",2105:"\u590D\u5236\u53E3\u4EE4\u5931\u8D25",2106:"\u7528\u6237\u5DF2\u5B8C\u6210\u4EFB\u52A1",2107:"\u672A\u77E5\u8DF3\u8F6C\u6A21\u5F0F",2108:"RTA\u6821\u9A8C\u5931\u8D25"},be=(F=>(F[F.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",F[F.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",F[F.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",F[F.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",F[F.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",F[F.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",F[F.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",F[F.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",F[F.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",F[F.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",F[F.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",F[F.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",F[F.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",F[F.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",F[F.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",F[F.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",F[F.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",F))(be||{}),Qt={3001:"\u7F3A\u5C11\u624B\u673A\u53F7\u53C2\u6570",3002:"\u7F3A\u5C11\u8BBE\u5907ID\u53C2\u6570",3003:"\u7F3A\u5C11\u5957\u9910\u91D1\u989D\u53C2\u6570",3004:"\u65E0\u6548\u7684\u5BA2\u6237\u7AEF\u7C7B\u578B",3005:"\u4E1A\u52A1\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E",3006:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u5931\u8D25",3007:"\u83B7\u53D6\u6D3B\u52A8\u914D\u7F6E\u8BF7\u6C42\u5931\u8D25",3008:"\u7EDF\u4E00\u4E0B\u5355\u5931\u8D25",3009:"\u7EDF\u4E00\u4E0B\u5355\u8BF7\u6C42\u5931\u8D25",3010:"\u83B7\u53D6\u8DF3\u8F6C\u5730\u5740\u5931\u8D25",3011:"\u7F51\u7EDC\u8BF7\u6C42\u5F02\u5E38",3012:"\u4E0B\u5355\u6D41\u7A0B\u5F02\u5E38",3013:"\u83B7\u53D6RTA\u4FE1\u606F\u5931\u8D25",3014:"\u83B7\u53D6RTA\u4FE1\u606F\u8BF7\u6C42\u5931\u8D25",3015:"\u83B7\u53D6RTA\u4FE1\u606F\u5F02\u5E38",3016:"\u65E0\u6548\u7684\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u65B9\u5F0F",3017:"\u7F3A\u5C11\u4E1A\u52A1\u7C7B\u578B\u53C2\u6570"};var vn=(i,a,u,v)=>{let g=ee();if(g==="taro")return Taro.request({url:i,method:a,data:u,header:v}).then(k=>k);if(g==="uni")return new Promise((k,$)=>{uni.request({url:i,method:a,data:u,header:v,success:at=>k(at),fail:at=>$(at)})});if(g==="wechat")return new Promise((k,$)=>{wx.request({url:i,method:a,data:u,header:v,success:at=>k(at),fail:at=>$(at)})});if(g==="alipay")return new Promise((k,$)=>{my.request({url:i,method:a,data:u,headers:v,success:at=>k(at),fail:at=>$(at)})});let R=a.toUpperCase()==="GET",E=R&&u&&Object.keys(u).length?`${i}?${new URLSearchParams(u).toString()}`:i;return fetch(E,{method:a,headers:v,body:R?void 0:JSON.stringify(u)}).then(async k=>({statusCode:k.status,data:await k.json()}))},ze=class{constructor(a=null){Ue(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||de()||Ie}async getAuthToken(){let a=this.getCurrentConfig();if(a.getAuthToken&&typeof a.getAuthToken=="function")try{let u=await a.getAuthToken();return u?(U.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),u):(U.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(u){return U.error("\u83B7\u53D6Token\u5931\u8D25",u),null}return null}async buildHeader(a={},u=!0){let v=bt({"content-type":"application/json"},a);if(!u)return v;let g=await this.getAuthToken();if(!g)throw{code:"AUTH_TOKEN_REQUIRED",message:"\u5F53\u524D\u63A5\u53E3\u9700\u8981 token\uFF0C\u8BF7\u5728\u7528\u6237\u767B\u5F55\u6210\u529F\u540E\u8C03\u7528 nova.setToken(token) \u6216 \u76F4\u63A5createServices\u65F6\u4F20\u5165getAuthToken"};return v.Authorization_bar=g,v}async request(a){let{path:u,method:v="POST",data:g={},header:R={},authRequired:E=!0,baseDomain:k,beforeRequest:$,afterResponse:at}=a,Rt=k?`${k}${u}`:je(this.getCurrentConfig().env||"prod",u),ht=await this.buildHeader(R,E);$&&typeof $=="function"&&await $({url:Rt,method:v,data:g,header:ht}),U.info(`\u53D1\u8D77${v}\u8BF7\u6C42:`,{path:u,method:v});try{let Q=await vn(Rt,v,g,ht);return U.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:Q.statusCode}),at&&typeof at=="function"&&await at(Q.data),Q.data}catch(Q){throw U.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:Q}),Q}}get(a,u={},v={}){return this.request(bt({path:a,method:"GET",data:u},v))}post(a,u={},v={}){return this.request(bt({path:a,method:"POST",data:u},v))}},Se=(i=null)=>new ze(i);var An=(function(){"use strict";function i(D,Z){var dt=(65535&D)+(65535&Z);return(D>>16)+(Z>>16)+(dt>>16)<<16|65535&dt}function a(D,Z,dt,F,J,St){return i((St=i(i(Z,D),i(F,St)))<<J|St>>>32-J,dt)}function u(D,Z,dt,F,J,St,b){return a(Z&dt|~Z&F,D,Z,J,St,b)}function v(D,Z,dt,F,J,St,b){return a(Z&F|dt&~F,D,Z,J,St,b)}function g(D,Z,dt,F,J,St,b){return a(Z^dt^F,D,Z,J,St,b)}function R(D,Z,dt,F,J,St,b){return a(dt^(Z|~F),D,Z,J,St,b)}function E(D,Z){var dt,F,J,St;D[Z>>5]|=128<<Z%32,D[14+(Z+64>>>9<<4)]=Z;for(var b=1732584193,T=-271733879,O=-1732584194,P=271733878,m=0;m<D.length;m+=16)b=u(dt=b,F=T,J=O,St=P,D[m],7,-680876936),P=u(P,b,T,O,D[m+1],12,-389564586),O=u(O,P,b,T,D[m+2],17,606105819),T=u(T,O,P,b,D[m+3],22,-1044525330),b=u(b,T,O,P,D[m+4],7,-176418897),P=u(P,b,T,O,D[m+5],12,1200080426),O=u(O,P,b,T,D[m+6],17,-1473231341),T=u(T,O,P,b,D[m+7],22,-45705983),b=u(b,T,O,P,D[m+8],7,1770035416),P=u(P,b,T,O,D[m+9],12,-1958414417),O=u(O,P,b,T,D[m+10],17,-42063),T=u(T,O,P,b,D[m+11],22,-1990404162),b=u(b,T,O,P,D[m+12],7,1804603682),P=u(P,b,T,O,D[m+13],12,-40341101),O=u(O,P,b,T,D[m+14],17,-1502002290),b=v(b,T=u(T,O,P,b,D[m+15],22,1236535329),O,P,D[m+1],5,-165796510),P=v(P,b,T,O,D[m+6],9,-1069501632),O=v(O,P,b,T,D[m+11],14,643717713),T=v(T,O,P,b,D[m],20,-373897302),b=v(b,T,O,P,D[m+5],5,-701558691),P=v(P,b,T,O,D[m+10],9,38016083),O=v(O,P,b,T,D[m+15],14,-660478335),T=v(T,O,P,b,D[m+4],20,-405537848),b=v(b,T,O,P,D[m+9],5,568446438),P=v(P,b,T,O,D[m+14],9,-1019803690),O=v(O,P,b,T,D[m+3],14,-187363961),T=v(T,O,P,b,D[m+8],20,1163531501),b=v(b,T,O,P,D[m+13],5,-1444681467),P=v(P,b,T,O,D[m+2],9,-51403784),O=v(O,P,b,T,D[m+7],14,1735328473),b=g(b,T=v(T,O,P,b,D[m+12],20,-1926607734),O,P,D[m+5],4,-378558),P=g(P,b,T,O,D[m+8],11,-2022574463),O=g(O,P,b,T,D[m+11],16,1839030562),T=g(T,O,P,b,D[m+14],23,-35309556),b=g(b,T,O,P,D[m+1],4,-1530992060),P=g(P,b,T,O,D[m+4],11,1272893353),O=g(O,P,b,T,D[m+7],16,-155497632),T=g(T,O,P,b,D[m+10],23,-1094730640),b=g(b,T,O,P,D[m+13],4,681279174),P=g(P,b,T,O,D[m],11,-358537222),O=g(O,P,b,T,D[m+3],16,-722521979),T=g(T,O,P,b,D[m+6],23,76029189),b=g(b,T,O,P,D[m+9],4,-640364487),P=g(P,b,T,O,D[m+12],11,-421815835),O=g(O,P,b,T,D[m+15],16,530742520),b=R(b,T=g(T,O,P,b,D[m+2],23,-995338651),O,P,D[m],6,-198630844),P=R(P,b,T,O,D[m+7],10,1126891415),O=R(O,P,b,T,D[m+14],15,-1416354905),T=R(T,O,P,b,D[m+5],21,-57434055),b=R(b,T,O,P,D[m+12],6,1700485571),P=R(P,b,T,O,D[m+3],10,-1894986606),O=R(O,P,b,T,D[m+10],15,-1051523),T=R(T,O,P,b,D[m+1],21,-2054922799),b=R(b,T,O,P,D[m+8],6,1873313359),P=R(P,b,T,O,D[m+15],10,-30611744),O=R(O,P,b,T,D[m+6],15,-1560198380),T=R(T,O,P,b,D[m+13],21,1309151649),b=R(b,T,O,P,D[m+4],6,-145523070),P=R(P,b,T,O,D[m+11],10,-1120210379),O=R(O,P,b,T,D[m+2],15,718787259),T=R(T,O,P,b,D[m+9],21,-343485551),b=i(b,dt),T=i(T,F),O=i(O,J),P=i(P,St);return[b,T,O,P]}function k(D){for(var Z="",dt=32*D.length,F=0;F<dt;F+=8)Z+=String.fromCharCode(D[F>>5]>>>F%32&255);return Z}function $(D){var Z=[];for(Z[(D.length>>2)-1]=void 0,F=0;F<Z.length;F+=1)Z[F]=0;for(var dt=8*D.length,F=0;F<dt;F+=8)Z[F>>5]|=(255&D.charCodeAt(F/8))<<F%32;return Z}function at(D){for(var Z,dt="0123456789abcdef",F="",J=0;J<D.length;J+=1)Z=D.charCodeAt(J),F+=dt.charAt(Z>>>4&15)+dt.charAt(15&Z);return F}function Rt(D){return unescape(encodeURIComponent(D))}function ht(D){return k(E($(D=Rt(D)),8*D.length))}function Q(D,Z){return(function(dt,F){var J,St=$(dt),b=[],T=[];for(b[15]=T[15]=void 0,16<St.length&&(St=E(St,8*dt.length)),J=0;J<16;J+=1)b[J]=909522486^St[J],T[J]=1549556828^St[J];return F=E(b.concat($(F)),512+8*F.length),k(E(T.concat(F),640))})(Rt(D),Rt(Z))}function _e(D,Z,dt){return Z?dt?Q(Z,D):at(Q(Z,D)):dt?ht(D):at(ht(D))}return _e})(),Ce=An;function vr(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function Ar(i){if(typeof i!="object"||i===null)return i;let a=Object.keys(i).sort(),u={};for(let v of a)u[v]=i[v];return JSON.stringify(u)}function Dr(i,a){let u={appId:i.appId,randomStr:i.randomStr,data:i.data},v=Object.keys(u).sort(),g="";for(let[R,E]of v.entries())g+=`${E}=${u[E]}`,R<v.length-1&&(g+="&");return g+=`&secretKey=${a}`,Ce(g)}var Dn=(i,a,u,v)=>{let g=ee();return g==="taro"?Taro.request({url:i,method:a,data:u,header:v}).then(R=>R):g==="uni"?new Promise((R,E)=>{uni.request({url:i,method:a,data:u,header:v,success:k=>R(k),fail:k=>E(k)})}):g==="wechat"?new Promise((R,E)=>{wx.request({url:i,method:a,data:u,header:v,success:k=>R(k),fail:k=>E(k)})}):g==="alipay"?new Promise((R,E)=>{my.request({url:i,method:a,data:u,headers:v,success:k=>R(k),fail:k=>E(k)})}):fetch(i,{method:a,headers:v,body:JSON.stringify(u)}).then(async R=>({statusCode:R.status,data:await R.json()}))},$e=class{constructor(a=null){Ue(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||de()||{}}getExternalEnv(){var a;return((a=this.getCurrentConfig())==null?void 0:a.externalEnv)||fe.PROD}getExternalHost(){let a=this.getExternalEnv();return we[a]||we.prod}generateSign(a={}){let u=this.getCurrentConfig(),{externalAppId:v,externalAppSecret:g}=u;if(!v||!g)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let R=vr(),E=Ar(a),k=Dr({appId:v,randomStr:R,data:E},g);return{appId:v,randomStr:R,sign:k}}buildRequestBody(a={}){let u=this.generateSign(a);return oe(bt({},u),{data:a})}buildUrl(a){return`${this.getExternalHost()}${a}`}async request(a){let{path:u,method:v="POST",data:g={},header:R={},needSign:E=!0,beforeRequest:k,afterResponse:$}=a,at=this.buildUrl(u),Rt=bt({"content-type":"application/json"},R),ht=E?this.buildRequestBody(g):g;k&&typeof k=="function"&&await k({url:at,method:v,data:ht,header:Rt}),U.info(`\u53D1\u8D77${v}\u8BF7\u6C42:`,{path:u,method:v});try{let Q=await Dn(at,v,ht,Rt);if(U.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:Q.statusCode}),$&&typeof $=="function"&&await $(Q.data),Q.statusCode===200&&Q.data.code===200)return Q.data.data;throw{code:Q.data.code,msg:Q.data.data||"\u8BF7\u6C42\u4E1A\u52A1\u5F02\u5E38",original:Q.data}}catch(Q){throw(Q==null?void 0:Q.code)!==void 0?Q:(U.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:Q}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:Q})}}get(a,u={},v={}){return this.request(bt({path:a,method:"GET",data:u},v))}post(a,u={},v={}){return this.request(bt({path:a,method:"POST",data:u},v))}},Rr=(i=null)=>new $e(i);var Qe=Se(),Ze=Rr();function Er(i){let a=qe(i==null?void 0:i.equipmentValue,"equipmentValue");return a.valid?Qe.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",i):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Ir(i){let a=Pe(i,["idMd5Value","rtaStrategy"]);return a.valid?Ze.post("/open/rest/cpa/jd/rta-check",i):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function br(i){try{let a={thirdPlatform:i.thirdPlatform,thirdPlatformUserId:i.thirdPlatformUserId,thirdPlatformEquipmentValue:i.thirdPlatformEquipmentValue,os:i.os,client:"wxMini"};i.phone&&(a.mobileMd5=Ce(i.phone)),i.extendData&&(Object.prototype.toString.call(i.extendData)==="[object Object]"?a.extendData=i.extendData:U.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let u=await Ze.post("/open/rest/cpa/jd/insurance/get",a);return u?u.jumpMode==1?{jumpMode:1,appId:u.appId,url:u.url}:{jumpMode:2,url:u.url,channel:u.channelId}:void 0}catch(a){throw U.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",a),a}}function Sr(i){let a=qe(i==null?void 0:i.equipmentValue,"equipmentValue");return a.valid?Qe.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",i):Promise.reject({code:"PARAM_ERROR",message:a.message})}function Tr(i){let a=Pe(i,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return a.valid?Qe.post("/gw/advert/customer/cpa-activity/jd/rta/validate",i):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function wr(i){let a=await me(),u={thirdPlatform:i.thirdPlatform,thirdPlatformUserId:i.thirdPlatformUserId,thirdPlatformEquipmentValue:i.thirdPlatformEquipmentValue,os:a,client:i.client};return i.phone&&(u.mobileMd5=Ce(i.phone)),i.extendData&&(Object.prototype.toString.call(i.extendData)==="[object Object]"?u.extendData=i.extendData:U.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),Ze.post("/open/rest/cpa/jd/cash-loan/get",u)}async function Pr(i){let{phone:a,rtaId:u,equipmentId:v,lyyUserId:g,entrance:R}=i;if(!a)return z(Ft.INVALID_PARAM,Tt[2001]);if(!v)return z(Ft.INVALID_PARAM,Tt[2002]);try{if(u){U.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let ht=await Tr({phone:a,lyyEquipmentValue:v,lyyUserId:g||"",rtaId:u});if(ht.code!=="0000000"||!ht.body||ht.body.state!=1)return U.error("RTA\u9A8C\u8BC1\u5931\u8D25",ht),z(2003,Tt[2003]);U.info("RTA\u9A8C\u8BC1\u6210\u529F",ht.body)}U.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:a});let E=await me(),k=await Sr({phone:a,equipmentValue:v,os:E,entrance:R});if(k.code!=="0000000"||!k.body)return U.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",k),z(2004,Tt[2004]);let{appId:$,targetUrl:at}=k.body;if(!$||!at)return U.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:$,targetUrl:at}),z(2005,Tt[2005]);let Rt=z(Ft.SUCCESS,"\u6210\u529F",{appId:$,targetUrl:at});return U.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",Rt),Rt}catch(E){return U.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",E),z(Ft.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function Cr(i){let{phone:a,rtaId:u,thirdPlatform:v,thirdPlatformUserId:g,thirdPlatformEquipmentValue:R}=i;if(!a)return z(Ft.INVALID_PARAM,Tt[2001]);if(!v)return z(2008,Tt[2008]);if(!g)return z(2009,Tt[2009]);if(!R)return z(2010,Tt[2010]);try{if(u){U.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let Q=await Ir({idMd5Value:a,rtaStrategy:u});if(Q.status!=1)return U.error("RTA\u9A8C\u8BC1\u5931\u8D25",Q),z(2003,Tt[2003]);U.info("RTA\u9A8C\u8BC1\u6210\u529F",Q)}let E=await wr(i),{url:k,channelId:$,matchFlag:at,jumpMode:Rt,appId:ht}=E||{};return at?Rt===3?!ht||!k?z(2007,Tt[2007]):z(Ft.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:ht,url:k}):z(2007,Tt[2007]):z(2006,Tt[2006])}catch(E){return U.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",E),z(Ft.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var Te=null,Oe=null;try{Oe=Nr()}catch(i){}function xr(){return Te||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(Te=globalThis.LyyGetCommandSDK,Te):Oe?(Te=Oe.LyyGetCommandSDK||Oe.default||Oe,Te):null)}function Fr(i){var u;U.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",i);let a=xr();a!=null&&a.getJrCommand?a.getJrCommand(i):(u=a==null?void 0:a.default)!=null&&u.getJrCommand?a.default.getJrCommand(i):(U.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),i.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function Rn(i,a){return new Promise((u,v)=>{try{Fr({url:i,channel:a,callback:g=>{g.code==="0"?u(g.data):v({msg:g.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(g){v(g)}})}async function Lr(i){try{let a=await me(),u=bt({os:a},i);U.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",u);let{code:v,body:g}=await Er(u);if(v==="0000000"&&g){let{url:R,channelId:E,matchFlag:k,jumpMode:$,appId:at}=g;if(!k)return z(2101,Tt[2101]);if($===1)return U.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),z(2102,Tt[2102]);if($===2)return ee()==="web"&&U.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:R}),!R||!E?z(2103,Tt[2103]):new Promise(Rt=>{Fr({url:R,channel:E,callback:async ht=>{if((ht==null?void 0:ht.code)==="0")try{await Xe(ht==null?void 0:ht.data),Rt(z(Ft.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch(Q){Rt(z(2105,Tt[2105]))}else Rt(z(2105,Tt[2105]))}})});if($===3)return!at||!R?z(2103,Tt[2103]):z(Ft.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:at,path:R})}return z(2104,Tt[2104])}catch(a){return U.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",a),z(Ft.NETWORK_ERROR,"\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5")}}async function Ur(i){U.info("\u5F00\u59CB\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4...");try{let a=await br(oe(bt({},i),{os:await me()}));if(!a)return U.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),z(2106,Tt[2106]);if(a.jumpMode===1)return U.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{appId:a.appId,url:a.url}),z(Ft.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:a.appId,path:a.url});if(a.jumpMode===2){if(ee()==="web")return U.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:a.url}),z(Ft.SUCCESS,"\u6210\u529F",{type:"h5",url:a.url});try{let u=await Rn(a.url,a.channel);return await Xe(u),U.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),z(Ft.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(u){return U.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",u),Ke("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),z(2105,Tt[2105])}}return U.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",a.jumpMode),z(2107,Tt[2107])}catch(a){let u=typeof a=="string"?a:(a==null?void 0:a.msg)||(a==null?void 0:a.message)||"\u672A\u77E5\u9519\u8BEF";return U.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",u),Ke("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),u.includes("RTA")||u.includes("\u8D44\u683C")?z(2108,Tt[2108]):z(Ft.NETWORK_ERROR,u)}}var rr={};Ge(rr,{DyErrorCode:()=>be,getDyPayRtaData:()=>Yr,handleDyPayFlow:()=>Jr});var En=["weapp","h5"];function In(i){return En.includes(i)}var bn=["switchTab","reLaunch","redirectTo","navigateTo"];function Sn(i){return bn.includes(i)}function Mr(i){return i.telephone?i.price?i.equipmentValue?i.businessType?i.client&&!In(i.client)?{valid:!1,errorCode:3004}:i.douyinOrderExtendData&&typeof i.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:i.backWay&&i.client==="weapp"&&!Sn(i.backWay)?{valid:!1,errorCode:3016}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}:{valid:!1,errorCode:3001}}function jr(i){return i.equipmentValue?i.telephone?{valid:!0,errorCode:0}:{valid:!1,errorCode:3001}:{valid:!1,errorCode:3002}}var er=Se();async function qr(i){let{price:a,equipmentValue:u,douyinOrderExtendData:v,businessType:g}=i,R={businessType:g,equipmentValue:u,payInfoBusinessType:"commonDouyinPayment",platformActivities:{douyinCommodityPrice:a,douyinOrderExtendData:v||""}};try{let E=await er.post("/gw/advert/customer/payment/pay-info",R);return E.code!=="0000000"||!(E!=null&&E.body)?Promise.reject({code:3006,message:E.message||Qt[3006]}):E}catch(E){return U.error("getDyOrderAmountFn error:",E),Promise.reject({code:3007,message:Qt[3007]})}}async function Br(i){try{let a=i.commodityList.map(k=>({commodity:k.commodityId,quantity:1,categoryCode:k.categoryCode||"",supportMarketing:k.supportMarketing})),u=i.advertExtendInfo&&Object.keys(i.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:i.advertExtendInfo}):"",v=ee(),g="";v==="wechat"?g="wechatMini":v==="web"&&navigator.userAgent.toLowerCase().includes("micromessenger")&&(g="wechatHtml");let R={businessType:i.businessType,fixedClientType:21,channelCode:null,douyinData:{loginMobile:i.telephone||""},equipmentUseFlag:!0,payEquipmentDTO:{equipmentValue:i.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:u,transType:5,actualFee:i.totalFee,totalFee:i.totalFee,commodityList:a,clientSourceDetailType:g},E=await er.post("/gw/payment-bff/unified/order",R);return E.code!=="0000000"||!(E!=null&&E.body)?Promise.reject({code:3008,message:E.message||Qt[3008]}):E}catch(a){return U.error("dyUnifiedOrderFn error:",a),Promise.reject({code:3009,message:Qt[3009]})}}async function kr(i){let a={equipmentValue:i.equipmentValue,phone:i.telephone||""};i.price&&(a.orderAmount=i.price);try{let u=await er.post("/gw/advert/customer/douyin/pay/check",a);return u.code!=="0000000"||!(u!=null&&u.body)?Promise.reject({code:3013,message:u.message||Qt[3013]}):u}catch(u){return U.error("getDyPayRtaData error:",u),Promise.reject({code:3014,message:(u==null?void 0:u.message)||Qt[3014]})}}async function Jr(i){var u,v,g;let a=Mr(i);if(!a.valid)return z(a.errorCode,Qt[a.errorCode]);try{let R=await qr({price:i.price,equipmentValue:i.equipmentValue,businessType:i.businessType,douyinOrderExtendData:(i==null?void 0:i.douyinOrderExtendData)||""}),E=await Br(oe(bt({},R.body),{telephone:i.telephone,equipmentValue:i.equipmentValue,businessType:i.businessType})),k=(u=E==null?void 0:E.body)!=null&&u.h5Url?await Tn(oe(bt({},i),{dyUrl:E.body.h5Url})):"",$=((v=E==null?void 0:E.body)==null?void 0:v.outTradeNo)||"";return k?z(0,"success",{h5Url:k,outTradeNo:$}):z(3010,Qt[3010])}catch(R){U.error("handleDyPayFlow error:",R);let E=(g=R==null?void 0:R.code)!=null?g:3012,k=(R==null?void 0:R.message)||Qt[3012];return z(E,k)}}async function Tn(i){let a=de(),u=je(a.env||"prod",""),v=typeof a.getAuthToken=="function"?await a.getAuthToken():"",g=i.client||"weapp";return`${u}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${g}&equipmentId=${i.equipmentValue}&dyUrl=${i.dyUrl}&fromUrl=${encodeURIComponent(i.fromUrl||"")}&backUrl=${encodeURIComponent(i.backUrl||"")}&backWay=${i.backWay||""}&url_token=${v}`}async function Yr(i){var u;let a=jr(i);if(!a.valid)return z(a.errorCode,Qt[a.errorCode]);try{let v=await kr({price:(i==null?void 0:i.price)||"",equipmentValue:i.equipmentValue,telephone:(i==null?void 0:i.telephone)||""});return z(0,"success",v.body)}catch(v){U.error("getDyPayRtaData error:",v);let g=(u=v==null?void 0:v.code)!=null?u:3015,R=(v==null?void 0:v.message)||Qt[3015];return z(g,R)}}var ar={};Ge(ar,{getDisplayAdConfig:()=>Wr,normalizeDisplayAdData:()=>ir});var wn=Se();function Vr(i){let a=Pe(i,["placementId"]);if(!a.valid)return Promise.reject({code:"PARAM_ERROR",message:a.message});let u=de().env||"prod";return wn.get(`/gw/advert-plugin/api/v1/config/list/valid/${i.placementId}`,{},{authRequired:!1,baseDomain:gr(u)})}var Hr=30*1e3,Pn="__",or=new Map,nr=new Map;function Cn(i,a){return[i.appId||"",a,i.type||""].join(Pn)}function On(i){let a=or.get(i);return a?a.expireAt<=Date.now()?(or.delete(i),U.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:i}),null):a.data:null}function Nn(i,a){or.set(i,{data:a,expireAt:Date.now()+Hr})}function xn(i){return Array.isArray(i==null?void 0:i.body)?i.body:[]}function Fn(i){return String(i==null?void 0:i.code)!=="200"}function Ln(i,a){let u=String(i||a||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(u)?u:a||"banner"}function Gr(i){return String(i||"").trim().toLowerCase()}function Un(i){var a;return!!i&&i.status!==0&&((a=i.platformConfig)==null?void 0:a.valid)!==!1}function Mn(i){return[...i].sort((a,u)=>{var R,E,k,$;let v=Number((R=a.priority)!=null?R:9999),g=Number((E=u.priority)!=null?E:9999);return v!==g?v-g:Number((k=u.weight)!=null?k:0)-Number(($=a.weight)!=null?$:0)})}function Xr(i){return i.find(a=>Gr(a.advertPlatform)==="gdt")||null}function Kr(i){return i.find(a=>Gr(a.advertPlatform)!=="gdt")||null}function jn(i,a){return i&&a?"mixed":i?"wechat":a?"custom":"none"}function qn(i,a){var g,R;let u=Xr(i),v=Kr(i);return u&&v?Number((g=u.priority)!=null?g:9999)<=Number((R=v.priority)!=null?R:9999)?"wechat-first":"custom-first":a==="custom"?"custom-only":a==="wechat"?"wechat-only":"wechat-first"}function Bn(i){var u;let a=Xr(i);return((u=a==null?void 0:a.platformConfig)==null?void 0:u.adId)||""}function kn(i){let a=Kr(i),u=a==null?void 0:a.platformConfig;if(!u)return null;let v=u.image||u.imageUrl||"",g=u.video||u.videoUrl||"",R=u.poster||v||"",E=u.jumpUrl||u.url||u.webUrl||"";return!v&&!g?null:{image:v||void 0,video:g||void 0,poster:R||void 0,title:u.title,description:u.description,buttonText:u.buttonText,badgeText:u.badgeText,jumpSeconds:u.jumpSeconds,loadTimeout:u.loadTimeout||u.timeout,muted:u.muted,adSpec:u.adSpec,url:E||void 0,action:E?{type:"web",url:E}:void 0}}function ir(i,a){let u=Mn(i.filter(Un)),v=kn(u),g=Bn(u),R=Ln(void 0,a),E=jn(g,v),k=qn(u,E);return{show:!!(g||v),adId:"",type:R,provider:E,priority:k,unitId:g,customAd:v,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:i}}async function Wr(i){let a=i.placementId||i.adId||"",u=Cn(i,a),v=On(u);if(v)return U.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:u,placementId:a}),z(Ft.SUCCESS,"\u6210\u529F",v);let g=nr.get(u);if(g)return U.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:u,placementId:a}),g;let R=(async()=>{try{U.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",i);let E=await Vr({placementId:a}),k=xn(E);if(U.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:u,placementId:a,response:E,body:k}),Fn(E)||!k)return U.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",E),z(Ft.UNKNOWN_ERROR,(E==null?void 0:E.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");let $=ir(k,i.type);return $.adId=a,$.cache=oe(bt({},$.cache),{enable:!0,ttl:Hr}),Nn(u,$),U.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:u,placementId:a,provider:$.provider,priority:$.priority,hasUnitId:!!$.unitId,hasCustomAd:!!$.customAd}),z(Ft.SUCCESS,"\u6210\u529F",$)}catch(E){return U.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:u,placementId:a,error:E}),z(Ft.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{nr.delete(u)}})();return nr.set(u,R),R}function Jn(i={}){U.info("\u670D\u52A1\u521D\u59CB\u5316",i);let a=bt(bt({},Ie),i);a.env&&!Me[a.env]&&(U.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${a.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),a.env=Kt.PROD),a.externalEnv&&!we[a.externalEnv]&&(U.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${a.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),a.externalEnv=fe.PROD),a.debug!==void 0&&U.setEnable(a.debug),_r(a),U.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",a)}function Yn(i={}){let a="",u=null;async function v(){if(typeof i.getAuthToken=="function"){let R=await i.getAuthToken();if(R)return R}return u&&typeof u.getStorage=="function"&&u.getStorage("auth_token")||""}let g={name:"services",setToken(R){return a=R||"",u&&typeof u.setStorage=="function"&&u.setStorage("auth_token",a),g},async getAuthToken(){return a||v()},clearToken(){return a="",u&&typeof u.setStorage=="function"&&u.setStorage("auth_token",""),g},install(R){u=R;let E=oe(bt({},i),{getAuthToken:()=>g.getAuthToken()});Jn(E),U.info("services installed via nova.use()"),Object.assign(R,{jd:bt({},tr),dy:bt({},rr),ads:bt({},ar),setToken:g.setToken,clearToken:g.clearToken})}};return g}export{be as DyErrorCode,Qt as DyErrorMessage,Kt as ENV_TYPE,fe as EXTERNAL_ENV_TYPE,We as JdErrorCode,Tt as JdErrorMessage,Yn as createServices,Wr as getDisplayAdConfig,Yr as getDyPayRtaData,Jr as handleDyPayFlow,Lr as handleJdInsurance,Ur as handleJdInsuranceExt,Cr as handleJdjrCashLoanExt,Pr as handleJdjrCashLoanFlow,ir as normalizeDisplayAdData};
5
5
  /*! For license information please see LyyGetCommandSDK.min.js.LICENSE.txt */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bi-nova/services",
3
- "version": "1.3.2-beta.202605161224",
3
+ "version": "1.3.3",
4
4
  "description": "BI Nova 跨平台广告服务 SDK(京东/淘宝/拼多多等)",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -16,7 +16,7 @@
16
16
  "dist"
17
17
  ],
18
18
  "dependencies": {
19
- "@bi-nova/utils": "1.1.1-beta.202605161224"
19
+ "@bi-nova/utils": "1.1.1"
20
20
  },
21
21
  "keywords": [
22
22
  "ads",