@bi-nova/services 1.3.4 → 1.4.0
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.d.mts +154 -9
- package/dist/index.d.ts +154 -9
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var Ue=Object.defineProperty,dn=Object.defineProperties,hn=Object.getOwnPropertyDescriptor,pn=Object.getOwnPropertyDescriptors,yn=Object.getOwnPropertyNames,Dr=Object.getOwnPropertySymbols;var Rr=Object.prototype.hasOwnProperty,gn=Object.prototype.propertyIsEnumerable;var We=(o,a,u)=>a in o?Ue(o,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):o[a]=u,mt=(o,a)=>{for(var u in a||(a={}))Rr.call(a,u)&&We(o,u,a[u]);if(Dr)for(var u of Dr(a))gn.call(a,u)&&We(o,u,a[u]);return o},oe=(o,a)=>dn(o,pn(a));var mn=(o,a)=>()=>(a||o((a={exports:{}}).exports,a),a.exports),Me=(o,a)=>{for(var u in a)Ue(o,u,{get:a[u],enumerable:!0})},_n=(o,a,u,_)=>{if(a&&typeof a=="object"||typeof a=="function")for(let g of yn(a))!Rr.call(o,g)&&g!==u&&Ue(o,g,{get:()=>a[g],enumerable:!(_=hn(a,g))||_.enumerable});return o};var vn=o=>_n(Ue({},"__esModule",{value:!0}),o);var qe=(o,a,u)=>We(o,typeof a!="symbol"?a+"":a,u);var qr=mn((bo,Mr)=>{"use strict";(()=>{var o={737:(g,R,S)=>{"use strict";S.r(R),S.d(R,{default:()=>P,getJrCommand:()=>I});var L=S(307),H=S.n(L);function at(){at=function(){return V};var m,V={},vt=Object.prototype,st=vt.hasOwnProperty,At=Object.defineProperty||function(d,l,y){d[l]=y.value},ut=typeof Symbol=="function"?Symbol:{},yt=ut.iterator||"@@iterator",Dt=ut.asyncIterator||"@@asyncIterator",Rt=ut.toStringTag||"@@toStringTag";function ft(d,l,y){return Object.defineProperty(d,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),d[l]}try{ft({},"")}catch(d){ft=function(l,y,x){return l[y]=x}}function Yt(d,l,y,x){var A=l&&l.prototype instanceof ie?l:ie,q=Object.create(A.prototype),rt=new le(x||[]);return At(q,"_invoke",{value:Ot(d,y,rt)}),q}function Vt(d,l,y){try{return{type:"normal",arg:d.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 qt(){}var ae={};ft(ae,yt,(function(){return this}));var ne=Object.getPrototypeOf,Lt=ne&&ne(ne(te([])));Lt&&Lt!==vt&&st.call(Lt,yt)&&(ae=Lt);var Jt=qt.prototype=ie.prototype=Object.create(ae);function pe(d){["next","throw","return"].forEach((function(l){ft(d,l,(function(y){return this._invoke(l,y)}))}))}function $t(d,l){function y(A,q,rt,_t){var pt=Vt(d[A],d,q);if(pt.type!=="throw"){var Gt=pt.arg,Qt=Gt.value;return Qt&&dt(Qt)=="object"&&st.call(Qt,"__await")?l.resolve(Qt.__await).then((function(It){y("next",It,rt,_t)}),(function(It){y("throw",It,rt,_t)})):l.resolve(Qt).then((function(It){Gt.value=It,rt(Gt)}),(function(It){return y("throw",It,rt,_t)}))}_t(pt.arg)}var x;At(this,"_invoke",{value:function(A,q){function rt(){return new l((function(_t,pt){y(A,q,_t,pt)}))}return x=x?x.then(rt,rt):rt()}})}function Ot(d,l,y){var x=kt;return function(A,q){if(x===Ht)throw Error("Generator is already running");if(x===wt){if(A==="throw")throw q;return{value:m,done:!0}}for(y.method=A,y.arg=q;;){var rt=y.delegate;if(rt){var _t=Ut(rt,y);if(_t){if(_t===Pt)continue;return _t}}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(d,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(d,l){var y=l.method,x=d.iterator[y];if(x===m)return l.delegate=null,y==="throw"&&d.iterator.return&&(l.method="return",l.arg=m,Ut(d,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,d.iterator,l.arg);if(A.type==="throw")return l.method="throw",l.arg=A.arg,l.delegate=null,Pt;var q=A.arg;return q?q.done?(l[d.resultName]=q.value,l.next=d.nextLoc,l.method!=="return"&&(l.method="next",l.arg=m),l.delegate=null,Pt):q:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,Pt)}function Zt(d){var l={tryLoc:d[0]};1 in d&&(l.catchLoc=d[1]),2 in d&&(l.finallyLoc=d[2],l.afterLoc=d[3]),this.tryEntries.push(l)}function ce(d){var l=d.completion||{};l.type="normal",delete l.arg,d.completion=l}function le(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(Zt,this),this.reset(!0)}function te(d){if(d||d===""){var l=d[yt];if(l)return l.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var y=-1,x=function A(){for(;++y<d.length;)if(st.call(d,y))return A.value=d[y],A.done=!1,A;return A.value=m,A.done=!0,A};return x.next=x}}throw new TypeError(dt(d)+" is not iterable")}return re.prototype=qt,At(Jt,"constructor",{value:qt,configurable:!0}),At(qt,"constructor",{value:re,configurable:!0}),re.displayName=ft(qt,Rt,"GeneratorFunction"),V.isGeneratorFunction=function(d){var l=typeof d=="function"&&d.constructor;return!!l&&(l===re||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,qt):(d.__proto__=qt,ft(d,Rt,"GeneratorFunction")),d.prototype=Object.create(Jt),d},V.awrap=function(d){return{__await:d}},pe($t.prototype),ft($t.prototype,Dt,(function(){return this})),V.AsyncIterator=$t,V.async=function(d,l,y,x,A){A===void 0&&(A=Promise);var q=new $t(Yt(d,l,y,x),A);return V.isGeneratorFunction(l)?q:q.next().then((function(rt){return rt.done?rt.value:q.next()}))},pe(Jt),ft(Jt,Rt,"Generator"),ft(Jt,yt,(function(){return this})),ft(Jt,"toString",(function(){return"[object Generator]"})),V.keys=function(d){var l=Object(d),y=[];for(var x in l)y.push(x);return y.reverse(),function A(){for(;y.length;){var q=y.pop();if(q in l)return A.value=q,A.done=!1,A}return A.done=!0,A}},V.values=te,le.prototype={constructor:le,reset:function(d){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),!d)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 d=this.tryEntries[0].completion;if(d.type==="throw")throw d.arg;return this.rval},dispatchException:function(d){if(this.done)throw d;var l=this;function y(pt,Gt){return q.type="throw",q.arg=d,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],q=A.completion;if(A.tryLoc==="root")return y("end");if(A.tryLoc<=this.prev){var rt=st.call(A,"catchLoc"),_t=st.call(A,"finallyLoc");if(rt&&_t){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(!_t)throw Error("try statement without catch or finally");if(this.prev<A.finallyLoc)return y(A.finallyLoc)}}}},abrupt:function(d,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&&(d==="break"||d==="continue")&&A.tryLoc<=l&&l<=A.finallyLoc&&(A=null);var q=A?A.completion:{};return q.type=d,q.arg=l,A?(this.method="next",this.next=A.finallyLoc,Pt):this.complete(q)},complete:function(d,l){if(d.type==="throw")throw d.arg;return d.type==="break"||d.type==="continue"?this.next=d.arg:d.type==="return"?(this.rval=this.arg=d.arg,this.method="return",this.next="end"):d.type==="normal"&&l&&(this.next=l),Pt},finish:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===d)return this.complete(y.completion,y.afterLoc),ce(y),Pt}},catch:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===d){var x=y.completion;if(x.type==="throw"){var A=x.arg;ce(y)}return A}}throw Error("illegal catch attempt")},delegateYield:function(d,l,y){return this.delegate={iterator:te(d),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=m),Pt}},V}function Et(m,V,vt,st,At,ut,yt){try{var Dt=m[ut](yt),Rt=Dt.value}catch(ft){return void vt(ft)}Dt.done?V(Rt):Promise.resolve(Rt).then(st,At)}function dt(m){return dt=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},dt(m)}var Q="https://ms.jr.jd.com";function ve(m){var V=m.host,vt=m.type,st=vt===void 0?"post":vt,At=m.data,ut=m.path,yt=ut===void 0?"":ut,Dt=m.config,Rt=Dt===void 0?{}:Dt,ft=(Rt.withCredentials,Rt.isWG),Yt=ft===void 0||ft,Vt=Rt.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(At)}):At,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 dt(m)==="object"&&m!==null&&(Object.keys(m).map((function(vt){var st=m[vt];return V+=vt+"="+encodeURIComponent(st)+"&",""})),V.length>0&&(V=V.substr(0,V.length-1))),V}function Z(m){return ht.apply(this,arguments)}function ht(){var m;return m=at().mark((function V(vt){var st,At,ut,yt,Dt,Rt,ft,Yt,Vt,kt;return at().wrap((function(zt){for(;;)switch(zt.prev=zt.next){case 0:return st=vt.url,At=vt.channel,ut=vt.callback,H().init(),yt=new(H()),Dt=yt.nonce(),Rt=yt.sign(JSON.stringify({t:"".concat(new Date().getTime())}),Dt),ft="/gw/generic/app/h5/m/execute1/ug-service-orchestrator".concat(""),Yt="",Vt={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:st,channel:At,clientCode:"0",antiRushInfo:Rt}},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)})),ht=function(){var V=this,vt=arguments;return new Promise((function(st,At){var ut=m.apply(V,vt);function yt(Rt){Et(ut,st,At,yt,Dt,"next",Rt)}function Dt(Rt){Et(ut,st,At,yt,Dt,"throw",Rt)}yt(void 0)}))},ht.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={},vt=Object.prototype,st=vt.hasOwnProperty,At=Object.defineProperty||function(d,l,y){d[l]=y.value},ut=typeof Symbol=="function"?Symbol:{},yt=ut.iterator||"@@iterator",Dt=ut.asyncIterator||"@@asyncIterator",Rt=ut.toStringTag||"@@toStringTag";function ft(d,l,y){return Object.defineProperty(d,l,{value:y,enumerable:!0,configurable:!0,writable:!0}),d[l]}try{ft({},"")}catch(d){ft=function(l,y,x){return l[y]=x}}function Yt(d,l,y,x){var A=l&&l.prototype instanceof ie?l:ie,q=Object.create(A.prototype),rt=new le(x||[]);return At(q,"_invoke",{value:Ot(d,y,rt)}),q}function Vt(d,l,y){try{return{type:"normal",arg:d.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 qt(){}var ae={};ft(ae,yt,(function(){return this}));var ne=Object.getPrototypeOf,Lt=ne&&ne(ne(te([])));Lt&&Lt!==vt&&st.call(Lt,yt)&&(ae=Lt);var Jt=qt.prototype=ie.prototype=Object.create(ae);function pe(d){["next","throw","return"].forEach((function(l){ft(d,l,(function(y){return this._invoke(l,y)}))}))}function $t(d,l){function y(A,q,rt,_t){var pt=Vt(d[A],d,q);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(It){y("next",It,rt,_t)}),(function(It){y("throw",It,rt,_t)})):l.resolve(Qt).then((function(It){Gt.value=It,rt(Gt)}),(function(It){return y("throw",It,rt,_t)}))}_t(pt.arg)}var x;At(this,"_invoke",{value:function(A,q){function rt(){return new l((function(_t,pt){y(A,q,_t,pt)}))}return x=x?x.then(rt,rt):rt()}})}function Ot(d,l,y){var x=kt;return function(A,q){if(x===Ht)throw Error("Generator is already running");if(x===wt){if(A==="throw")throw q;return{value:m,done:!0}}for(y.method=A,y.arg=q;;){var rt=y.delegate;if(rt){var _t=Ut(rt,y);if(_t){if(_t===Pt)continue;return _t}}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(d,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(d,l){var y=l.method,x=d.iterator[y];if(x===m)return l.delegate=null,y==="throw"&&d.iterator.return&&(l.method="return",l.arg=m,Ut(d,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,d.iterator,l.arg);if(A.type==="throw")return l.method="throw",l.arg=A.arg,l.delegate=null,Pt;var q=A.arg;return q?q.done?(l[d.resultName]=q.value,l.next=d.nextLoc,l.method!=="return"&&(l.method="next",l.arg=m),l.delegate=null,Pt):q:(l.method="throw",l.arg=new TypeError("iterator result is not an object"),l.delegate=null,Pt)}function Zt(d){var l={tryLoc:d[0]};1 in d&&(l.catchLoc=d[1]),2 in d&&(l.finallyLoc=d[2],l.afterLoc=d[3]),this.tryEntries.push(l)}function ce(d){var l=d.completion||{};l.type="normal",delete l.arg,d.completion=l}function le(d){this.tryEntries=[{tryLoc:"root"}],d.forEach(Zt,this),this.reset(!0)}function te(d){if(d||d===""){var l=d[yt];if(l)return l.call(d);if(typeof d.next=="function")return d;if(!isNaN(d.length)){var y=-1,x=function A(){for(;++y<d.length;)if(st.call(d,y))return A.value=d[y],A.done=!1,A;return A.value=m,A.done=!0,A};return x.next=x}}throw new TypeError(F(d)+" is not iterable")}return re.prototype=qt,At(Jt,"constructor",{value:qt,configurable:!0}),At(qt,"constructor",{value:re,configurable:!0}),re.displayName=ft(qt,Rt,"GeneratorFunction"),V.isGeneratorFunction=function(d){var l=typeof d=="function"&&d.constructor;return!!l&&(l===re||(l.displayName||l.name)==="GeneratorFunction")},V.mark=function(d){return Object.setPrototypeOf?Object.setPrototypeOf(d,qt):(d.__proto__=qt,ft(d,Rt,"GeneratorFunction")),d.prototype=Object.create(Jt),d},V.awrap=function(d){return{__await:d}},pe($t.prototype),ft($t.prototype,Dt,(function(){return this})),V.AsyncIterator=$t,V.async=function(d,l,y,x,A){A===void 0&&(A=Promise);var q=new $t(Yt(d,l,y,x),A);return V.isGeneratorFunction(l)?q:q.next().then((function(rt){return rt.done?rt.value:q.next()}))},pe(Jt),ft(Jt,Rt,"Generator"),ft(Jt,yt,(function(){return this})),ft(Jt,"toString",(function(){return"[object Generator]"})),V.keys=function(d){var l=Object(d),y=[];for(var x in l)y.push(x);return y.reverse(),function A(){for(;y.length;){var q=y.pop();if(q in l)return A.value=q,A.done=!1,A}return A.done=!0,A}},V.values=te,le.prototype={constructor:le,reset:function(d){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),!d)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 d=this.tryEntries[0].completion;if(d.type==="throw")throw d.arg;return this.rval},dispatchException:function(d){if(this.done)throw d;var l=this;function y(pt,Gt){return q.type="throw",q.arg=d,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],q=A.completion;if(A.tryLoc==="root")return y("end");if(A.tryLoc<=this.prev){var rt=st.call(A,"catchLoc"),_t=st.call(A,"finallyLoc");if(rt&&_t){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(!_t)throw Error("try statement without catch or finally");if(this.prev<A.finallyLoc)return y(A.finallyLoc)}}}},abrupt:function(d,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&&(d==="break"||d==="continue")&&A.tryLoc<=l&&l<=A.finallyLoc&&(A=null);var q=A?A.completion:{};return q.type=d,q.arg=l,A?(this.method="next",this.next=A.finallyLoc,Pt):this.complete(q)},complete:function(d,l){if(d.type==="throw")throw d.arg;return d.type==="break"||d.type==="continue"?this.next=d.arg:d.type==="return"?(this.rval=this.arg=d.arg,this.method="return",this.next="end"):d.type==="normal"&&l&&(this.next=l),Pt},finish:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.finallyLoc===d)return this.complete(y.completion,y.afterLoc),ce(y),Pt}},catch:function(d){for(var l=this.tryEntries.length-1;l>=0;--l){var y=this.tryEntries[l];if(y.tryLoc===d){var x=y.completion;if(x.type==="throw"){var A=x.arg;ce(y)}return A}}throw Error("illegal catch attempt")},delegateYield:function(d,l,y){return this.delegate={iterator:te(d),resultName:l,nextLoc:y},this.method==="next"&&(this.arg=m),Pt}},V}function St(m,V,vt,st,At,ut,yt){try{var Dt=m[ut](yt),Rt=Dt.value}catch(ft){return void vt(ft)}Dt.done?V(Rt):Promise.resolve(Rt).then(st,At)}function I(m){return T.apply(this,arguments)}function T(){var m;return m=J().mark((function V(vt){var st,At,ut;return J().wrap((function(yt){for(;;)switch(yt.prev=yt.next){case 0:return st=vt.url,At=vt.channel,ut=vt.callback,yt.next=3,Z({url:st,channel:At,callback:ut});case 3:case"end":return yt.stop()}}),V)})),T=function(){var V=this,vt=arguments;return new Promise((function(st,At){var ut=m.apply(V,vt);function yt(Rt){St(ut,st,At,yt,Dt,"next",Rt)}function Dt(Rt){St(ut,st,At,yt,Dt,"throw",Rt)}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,R,S){var L,H,at;function Et(dt){return Et=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},Et(dt)}at=function(){"use strict";function dt(t){return(dt=typeof Symbol=="function"&&Et(Symbol.iterator)=="symbol"?function(r){return Et(r)}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":Et(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 ht(t){return(ht=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=ht(t);return(function(h,p){if(p&&(Et(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})(h)})(this,r?(s=ht(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
|
|
3
|
-
`),c+=
|
|
4
|
-
`),c+=Dt[t[j]>>2]+Dt[(3&t[j])<<4|t[j+1]>>4]+Dt[(15&t[j+1])<<2|t[j+2]>>6]+Dt[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 h,p,E,C,w=new Array(3*(t.length-c)/4);for(r=0,s=0;s<w.length;)h=Dt.indexOf(t.charAt(r++)),p=Dt.indexOf(t.charAt(r++)),E=Dt.indexOf(t.charAt(r++)),C=Dt.indexOf(t.charAt(r++)),w[s++]=h<<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),h=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]=h[(255&t[p])>>4],c[++E]=h[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),h=0;h<r;h++){if(48<=s[2*h]&&s[2*h]<=57)c[h]=s[2*h]-48<<4;else if(65<=s[2*h]&&s[2*h]<=70)c[h]=s[2*h]-65+10<<4;else{if(!(97<=s[2*h]&&s[2*h]<=102))return null;c[h]=s[2*h]-97+10<<4}if(48<=s[2*h+1]&&s[2*h+1]<=57)c[h]=c[h]|s[2*h+1]-48;else if(65<=s[2*h+1]&&s[2*h+1]<=70)c[h]=c[h]|s[2*h+1]-65+10;else{if(!(97<=s[2*h+1]&&s[2*h+1]<=102))return null;c[h]=c[h]|s[2*h+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=[],h=0;h<s;h++)c[h]=r.charCodeAt(h).toString(16);return c.join("")},Ut.utf8StrToBytes=function(t){t=encodeURIComponent(t);for(var r=unescape(t),s=r.length,c=[],h=0;h<s;h++)c[h]=r.charCodeAt(h);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,i){e!=null&&(typeof e=="number"?this.fromNumber(e,n,i):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,i,f,v,N){for(var k=32767&n,U=n>>15;0<=--N;){var xt=32767&this[e],Kt=this[e++]>>15,se=U*xt+Kt*k;v=((xt=k*xt+((32767&se)<<15)+i[f]+(1073741823&v))>>>30)+(se>>>15)+U*Kt+(v>>>30),i[f++]=1073741823&xt}return v},30):s&&navigator.appName!="Netscape"?(t.prototype.am=function(e,n,i,f,v,N){for(;0<=--N;){var k=n*this[e++]+i[f]+v;v=Math.floor(k/67108864),i[f++]=67108863&k}return v},26):(t.prototype.am=function(e,n,i,f,v,N){for(var k=16383&n,U=n>>14;0<=--N;){var xt=16383&this[e],Kt=this[e++]>>14,se=U*xt+Kt*k;v=((xt=k*xt+((16383&se)<<14)+i[f]+v)>>28)+(se>>14)+U*Kt,i[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,h=48,p=0;p<=9;++p)c[h++]=p;for(h=97,p=10;p<36;++p)c[h++]=p;for(h=65,p=10;p<36;++p)c[h++]=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,i=1;return(n=e>>>16)!=0&&(e=n,i+=16),(n=e>>8)!=0&&(e=n,i+=8),(n=e>>4)!=0&&(e=n,i+=4),(n=e>>2)!=0&&(e=n,i+=2),(n=e>>1)!=0&&(e=n,i+=1),i}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 G(e,n){return e&n}function tt(e,n){return e|n}function z(e,n){return e^n}function it(e,n){return e&~n}function lt(){}function Ct(e){return e}function B(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,i){e.multiplyTo(n,i),this.reduce(i)},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 i=32767&e[n],f=i*this.mpl+((i*this.mph+(e[n]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[i=n+this.m.t]+=this.m.am(0,f,e,n,0,this.m.t);e[i]>=e.DV;)e[i]-=e.DV,e[++i]++}e.clamp(),e.drShiftTo(this.m.t,e),0<=e.compareTo(this.m)&&e.subTo(this.m,e)},b.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i),this.reduce(i)},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 i;if(n==16)i=4;else if(n==8)i=3;else if(n==256)i=8;else if(n==2)i=1;else if(n==32)i=5;else{if(n!=4)return void this.fromRadix(e,n);i=2}this.t=0,this.s=0;for(var f=e.length,v=!1,N=0;0<=--f;){var k=i==8?255&e[f]:C(e,f);k<0?e.charAt(f)=="-"&&(v=!0):(v=!1,N==0?this[this.t++]=k:N+i>this.DB?(this[this.t-1]|=(k&(1<<this.DB-N)-1)<<N,this[this.t++]=k>>this.DB-N):this[this.t-1]|=k<<N,(N+=i)>=this.DB&&(N-=this.DB))}i==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 i=this.t-1;0<=i;--i)n[i+e]=this[i];for(i=e-1;0<=i;--i)n[i]=0;n.t=this.t+e,n.s=this.s},t.prototype.drShiftTo=function(e,n){for(var i=e;i<this.t;++i)n[i-e]=this[i];n.t=Math.max(this.t-e,0),n.s=this.s},t.prototype.lShiftTo=function(e,n){for(var i=e%this.DB,f=this.DB-i,v=(1<<f)-1,N=Math.floor(e/this.DB),k=this.s<<i&this.DM,U=this.t-1;0<=U;--U)n[U+N+1]=this[U]>>f|k,k=(this[U]&v)<<i;for(U=N-1;0<=U;--U)n[U]=0;n[N]=k,n.t=this.t+N+1,n.s=this.s,n.clamp()},t.prototype.rShiftTo=function(e,n){n.s=this.s;var i=Math.floor(e/this.DB);if(i>=this.t)n.t=0;else{var f=e%this.DB,v=this.DB-f,N=(1<<f)-1;n[0]=this[i]>>f;for(var k=i+1;k<this.t;++k)n[k-i-1]|=(this[k]&N)<<v,n[k-i]=this[k]>>f;0<f&&(n[this.t-i-1]|=(this.s&N)<<v),n.t=this.t-i,n.clamp()}},t.prototype.subTo=function(e,n){for(var i=0,f=0,v=Math.min(e.t,this.t);i<v;)f+=this[i]-e[i],n[i++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f-=e.s;i<this.t;)f+=this[i],n[i++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;i<e.t;)f-=e[i],n[i++]=f&this.DM,f>>=this.DB;f-=e.s}n.s=f<0?-1:0,f<-1?n[i++]=this.DV+f:0<f&&(n[i++]=f),n.t=i,n.clamp()},t.prototype.multiplyTo=function(e,n){var i=this.abs(),f=e.abs(),v=i.t;for(n.t=v+f.t;0<=--v;)n[v]=0;for(v=0;v<f.t;++v)n[v+i.t]=i.am(0,f[v],n,v,0,i.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(),i=e.t=2*n.t;0<=--i;)e[i]=0;for(i=0;i<n.t-1;++i){var f=n.am(i,n[i],e,2*i,0,1);(e[i+n.t]+=n.am(i+1,2*n[i],e,2*i+1,f,n.t-i-1))>=n.DV&&(e[i+n.t]-=n.DV,e[i+n.t+1]=1)}0<e.t&&(e[e.t-1]+=n.am(i,n[i],e,2*i,0,1)),e.s=0,e.clamp()},t.prototype.divRemTo=function(e,n,i){var f=e.abs();if(!(f.t<=0)){if((Kt=this.abs()).t<f.t)return n!=null&&n.fromInt(0),void(i!=null&&this.copyTo(i));i==null&&(i=r());var v=r(),N=this.s,k=e.s;0<(e=this.DB-nt(f[f.t-1]))?(f.lShiftTo(e,v),Kt.lShiftTo(e,i)):(f.copyTo(v),Kt.copyTo(i));var U=v.t,xt=v[U-1];if(xt!=0){var Kt=xt*(1<<this.F1)+(1<U?v[U-2]>>this.F2:0),se=this.FV/Kt,fe=(1<<this.F1)/Kt,Ie=1<<this.F2,Bt=i.t,ge=Bt-U,jt=n==null?r():n;for(v.dlShiftTo(ge,jt),0<=i.compareTo(jt)&&(i[i.t++]=1,i.subTo(jt,i)),t.ONE.dlShiftTo(U,jt),jt.subTo(v,v);v.t<U;)v[v.t++]=0;for(;0<=--ge;){var Ke=i[--Bt]==xt?this.DM:Math.floor(i[Bt]*se+(i[Bt-1]+Ie)*fe);if((i[Bt]+=v.am(0,Ke,i,ge,0,U))<Ke)for(v.dlShiftTo(ge,jt),i.subTo(jt,i);i[Bt]<--Ke;)i.subTo(jt,i)}n!=null&&(i.drShiftTo(U,n),N!=k&&t.ZERO.subTo(n,n)),i.t=U,i.clamp(),0<e&&i.rShiftTo(e,i),N<0&&t.ZERO.subTo(i,i)}}},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 i,f=r(),v=r(),N=n.convert(this),k=nt(e)-1;for(N.copyTo(f);0<=--k;)n.sqrTo(f,v),0<(e&1<<k)?n.mulTo(v,N,f):(i=f,f=v,v=i);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 i,f=(1<<n)-1,v=!1,N="",k=this.t,U=this.DB-k*this.DB%n;if(0<k--)for(U<this.DB&&0<(i=this[k]>>U)&&(v=!0,N=E(i));0<=k;)U<n?(i=(this[k]&(1<<U)-1)<<n-U,i|=this[--k]>>(U+=this.DB-n)):(i=this[k]>>(U-=n)&f,U<=0&&(U+=this.DB,--k)),(v=0<i||v)&&(N+=E(i));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 i=this.t;if((n=i-e.t)!=0)return this.s<0?-n:n;for(;0<=--i;)if((n=this[i]-e[i])!=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,i){e.multiplyTo(n,i)},lt.prototype.sqrTo=function(e,n){e.squareTo(n)},B.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},B.prototype.revert=function(e){return e},B.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)},B.prototype.mulTo=function(e,n,i){e.multiplyTo(n,i),this.reduce(i)},B.prototype.sqrTo=function(e,n){e.squareTo(n),this.reduce(n)};var K,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],X=(1<<26)/Y[Y.length-1];function W(){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),i=Math.pow(e,n),f=w(i),v=r(),N=r(),k="";for(this.divRemTo(f,v,N);0<v.signum();)k=(i+N.intValue()).toString(e).substr(1)+k,v.divRemTo(f,v,N);return N.intValue().toString(e)+k},t.prototype.fromRadix=function(e,n){this.fromInt(0);for(var i=this.chunkSize(n=n==null?10:n),f=Math.pow(n,i),v=!1,N=0,k=0,U=0;U<e.length;++U){var xt=C(e,U);xt<0?e.charAt(U)=="-"&&this.signum()==0&&(v=!0):(k=n*k+xt,++N>=i&&(this.dMultiply(f),this.dAddOffset(k,0),k=N=0))}0<N&&(this.dMultiply(Math.pow(n,N)),this.dAddOffset(k,0)),v&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,n,i){if(typeof n=="number")if(e<2)this.fromInt(1);else for(this.fromNumber(e,i),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;i=7&e,f.length=1+(e>>3),n.nextBytes(f),0<i?f[0]&=(1<<i)-1:f[0]=0,this.fromString(f,256)}},t.prototype.bitwiseTo=function(e,n,i){for(var f,v=Math.min(e.t,this.t),N=0;N<v;++N)i[N]=n(this[N],e[N]);if(e.t<this.t){for(f=e.s&this.DM,N=v;N<this.t;++N)i[N]=n(this[N],f);i.t=this.t}else{for(f=this.s&this.DM,N=v;N<e.t;++N)i[N]=n(f,e[N]);i.t=e.t}i.s=n(this.s,e.s),i.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 i=0,f=0,v=Math.min(e.t,this.t);i<v;)f+=this[i]+e[i],n[i++]=f&this.DM,f>>=this.DB;if(e.t<this.t){for(f+=e.s;i<this.t;)f+=this[i],n[i++]=f&this.DM,f>>=this.DB;f+=this.s}else{for(f+=this.s;i<e.t;)f+=e[i],n[i++]=f&this.DM,f>>=this.DB;f+=e.s}n.s=f<0?-1:0,0<f?n[i++]=f:f<-1&&(n[i++]=this.DV+f),n.t=i,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,i){var f,v=Math.min(this.t+e.t,n);for(i.s=0,i.t=v;0<v;)i[--v]=0;for(f=i.t-this.t;v<f;++v)i[v+this.t]=this.am(0,e[v],i,v,0,this.t);for(f=Math.min(e.t,n);v<f;++v)this.am(0,e[v],i,v,0,n-v);i.clamp()},t.prototype.multiplyUpperTo=function(e,n,i){var f=i.t=this.t+e.t- --n;for(i.s=0;0<=--f;)i[f]=0;for(f=Math.max(n-this.t,0);f<e.t;++f)i[this.t+f-n]=this.am(n-f,e[f],i,0,0,this.t+f-n);i.clamp(),i.drShiftTo(1,i)},t.prototype.modInt=function(e){if(e<=0)return 0;var n=this.DV%e,i=this.s<0?e-1:0;if(0<this.t)if(n==0)i=this[0]%e;else for(var f=this.t-1;0<=f;--f)i=(n*i+this[f])%e;return i},t.prototype.millerRabin=function(e){var n=this.subtract(t.ONE),i=n.getLowestSetBit();if(i<=0)return!1;var f=n.shiftRight(i);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 k=v.modPow(f,this);if(k.compareTo(t.ONE)!=0&&k.compareTo(n)!=0){for(var U=1;U++<i&&k.compareTo(n)!=0;)if((k=k.modPowInt(2,this)).compareTo(t.ONE)==0)return!1;if(k.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 i,f=this.DB-e*this.DB%8,v=0;if(0<e--)for(f<this.DB&&(i=this[e]>>f)!=(this.s&this.DM)>>f&&(n[v++]=i|this.s<<this.DB-f);0<=e;)f<8?(i=(this[e]&(1<<f)-1)<<8-f,i|=this[--e]>>(f+=this.DB-8)):(i=this[e]>>(f-=8)&255,f<=0&&(f+=this.DB,--e)),128&i&&(i|=-256),v==0&&(128&this.s)!=(128&i)&&++v,(0<v||i!=this.s)&&(n[v++]=i);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,G,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,z,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 i=0;return!(65535&n)&&(n>>=16,i+=16),!(255&n)&&(n>>=8,i+=8),!(15&n)&&(n>>=4,i+=4),!(3&n)&&(n>>=2,i+=2),!(1&n)&&++i,i})(this[e]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var e=0,n=this.s&this.DM,i=0;i<this.t;++i)e+=(function(f){for(var v=0;f!=0;)f&=f-1,++v;return v})(this[i]^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,z)},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(),i=r();return this.divRemTo(e,n,i),new Array(n,i)},t.prototype.modPow=function(e,n){var i=e.bitLength(),f=w(1);if(i<=0)return f;var v=i<18?1:i<48?3:i<144?4:i<768?5:6,N=new(i<8?ot:n.isEven()?B:b)(n),k=new Array,U=3,xt=v-1,Kt=(1<<v)-1;if(k[1]=N.convert(this),1<v){var se=r();for(N.sqrTo(k[1],se);U<=Kt;)k[U]=r(),N.mulTo(se,k[U-2],k[U]),U+=2}var fe,Ie,Bt=e.t-1,ge=!0,jt=r();for(i=nt(e[Bt])-1;0<=Bt;){for(xt<=i?fe=e[Bt]>>i-xt&Kt:(fe=(e[Bt]&(1<<i+1)-1)<<xt-i,0<Bt&&(fe|=e[Bt-1]>>this.DB+i-xt)),U=v;!(1&fe);)fe>>=1,--U;if((i-=U)<0&&(i+=this.DB,--Bt),ge)k[fe].copyTo(f),ge=!1;else{for(;1<U;)N.sqrTo(f,jt),N.sqrTo(jt,f),U-=2;0<U?N.sqrTo(f,jt):(Ie=f,f=jt,jt=Ie),N.mulTo(jt,k[fe],f)}for(;0<=Bt&&!(e[Bt]&1<<i);)N.sqrTo(f,jt),Ie=f,f=jt,jt=Ie,--i<0&&(i=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 i=e.clone(),f=this.clone(),v=w(1),N=w(0),k=w(0),U=w(1);i.signum()!=0;){for(;i.isEven();)i.rShiftTo(1,i),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?(k.isEven()&&U.isEven()||(k.addTo(this,k),U.subTo(e,U)),k.rShiftTo(1,k)):U.isEven()||U.subTo(e,U),U.rShiftTo(1,U);0<=i.compareTo(f)?(i.subTo(f,i),n&&v.subTo(k,v),N.subTo(U,N)):(f.subTo(i,f),n&&k.subTo(v,k),U.subTo(N,U))}return f.compareTo(t.ONE)!=0?t.ZERO:0<=U.compareTo(e)?U.subtract(e):U.signum()<0?(U.addTo(e,U),U.signum()<0?U.add(e):U):U},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(),i=e.s<0?e.negate():e.clone();n.compareTo(i)<0&&(v=n,n=i,i=v);var f=n.getLowestSetBit(),v=i.getLowestSetBit();if(v<0)return n;for(0<(v=f<v?f:v)&&(n.rShiftTo(v,n),i.rShiftTo(v,i));0<n.signum();)0<(f=n.getLowestSetBit())&&n.rShiftTo(f,n),0<(f=i.getLowestSetBit())&&i.rShiftTo(f,i),0<=n.compareTo(i)?(n.subTo(i,n),n.rShiftTo(1,n)):(i.subTo(n,i),i.rShiftTo(1,i));return 0<v&&i.lShiftTo(v,i),i},t.prototype.isProbablePrime=function(e){var n,i=this.abs();if(i.t==1&&i[0]<=Y[Y.length-1]){for(n=0;n<Y.length;++n)if(i[0]==Y[n])return!0;return!1}if(i.isEven())return!1;for(n=1;n<Y.length;){for(var f=Y[n],v=n+1;v<Y.length&&f<X;)f*=Y[v++];for(f=i.modInt(f);n<v;)if(f%Y[n++]==0)return!1}return i.millerRabin(e)},t.prototype.square=function(){var e=r();return this.squareTo(e),e},t.prototype.Barrett=B,gt==null){var gt=new Array,et=0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var bt=new Uint8Array(32);for(window.crypto.getRandomValues(bt),Mt=0;Mt<32;++Mt)gt[et++]=bt[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,W()}function He(){if(K==null){for(W(),(K=new Ge).init(gt),et=0;et<gt.length;++et)gt[et]=0;et=0}return K.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,i,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,i=this.S[f],this.S[f]=this.S[n],this.S[n]=i;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(h){if((p=h.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(h).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 qt(t,r){return+t[r+2]<8?1:128&+t.substr(r+2,2)}function ae(t,r){var s=qt(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*(qt(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,h){Q(this,t),this.curve=r,this.x=s,this.y=c,this.z=h==null?Lt.ONE:h,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(),h=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(h).mod(w),s=nt.subtract(r),p=c.multiply(C).mod(w),c=E.multiply(h).mod(w),E=p.subtract(c),Lt.ZERO.equals(s)?Lt.ZERO.equals(E)?this.twice():this.curve.infinity:(c=nt.add(r),r=h.multiply(C).mod(w),C=s.square().mod(w),h=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(h)).mod(w),w=h.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,h=this.curve.q,p=this.curve.a.toBigInteger(),E=r.square().multiply(Jt).add(p.multiply(c.square())).mod(h),C=s.shiftLeft(1).multiply(c).mod(h),w=(p=(w=s.square().mod(h)).multiply(r).multiply(c).mod(h),s=C.square().mod(h),r=E.square().subtract(p.shiftLeft(3)).mod(h),c=C.multiply(r).mod(h),E.multiply(p.shiftLeft(2).subtract(r)).subtract(s.shiftLeft(1).multiply(w)).mod(h));return h=C.multiply(s).mod(h),new t(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(w),h)}},{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(),h=this,p=s.bitLength()-2;0<p;p--){h=h.twice();var E=s.testBit(p);E!==r.testBit(p)&&(h=h.add(E?this:c))}return h}}]),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,d=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),h=r%8,p=0,E=t.length;p<E;p++)s[p]=(t[(p+c)%E]<<h&255)+(t[(p+c+1)%E]>>>8-h&255);return s}function q(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 _t(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,h=t.length-1;0<=h;h--){var p=t[h]+r[h]+c;c=255<p?1:0,s[h]=255&p}return s}function Gt(t,r,s,c){return 0<=c&&c<=15?q(q(t,r),s):_t(rt(t,r),rt((function(h){for(var p=[],E=h.length-1;0<=E;E--)p[E]=255&~h[E];return p})(t),s))}function Qt(t,r){for(var s=[],c=[],h=0;h<16;h++){var p=4*h;s.push(r.slice(p,4+p))}for(var E,C=16;C<68;C++)s.push(q(q((E=q(q(s[C-16],s[C-9]),A(s[C-3],15)),q(q(E,A(E,15)),A(E,23))),A(s[C-13],7)),s[C-6]));for(var w=0;w<64;w++)c.push(q(s[w],s[w+4]));for(var nt,ot,b,G=[121,204,69,25],tt=[122,135,157,138],z=t.slice(0,4),it=t.slice(4,8),lt=t.slice(8,12),Ct=t.slice(12,16),B=t.slice(16,20),K=t.slice(20,24),Y=t.slice(24,28),X=t.slice(28,32),W=0;W<64;W++){var gt=0<=W&&W<=15?G:tt,et=q(bt=A(pt(pt(A(z,12),B),A(gt,W)),7),A(z,12)),bt=(et=pt(pt(pt((nt=z,ot=it,b=lt,0<=(gt=W)&><=15?q(q(nt,ot),b):_t(_t(rt(nt,ot),rt(nt,b)),rt(ot,b))),Ct),et),c[W]),pt(pt(pt(Gt(B,K,Y,W),X),bt),s[W]));Ct=lt,lt=A(it,9),it=z,z=et,X=Y,Y=A(K,19),K=B,B=q(q(bt,A(bt,9)),A(bt,17))}return q([].concat(z,it,lt,Ct,B,K,Y,X),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=d.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 h=[],p=0;p<r;p++){var E=s[p>>>2]>>>24-p%4*8&255;h.push((E>>>4).toString(16)),h.push((15&E).toString(16))}return h.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 h=[],p=0;p<t.length;p++){var E=r[p>>>2]>>>24-p%4*8&255;h.push(String.fromCharCode(E))}return decodeURIComponent(escape(h.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,h=s.length;c<h;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],G=0;G<ot;G++){var tt=64*G;b=Qt(b,nt.slice(tt,64+tt))}return b};var It=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",h=(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+h+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 It(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(),h=new It(c.privateKey,16),p=c.publicKey;128<p.length&&(p=p.substr(p.length-128)),c=r.multiply(h),h=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(h,t,r)));var E,C=1,w=0,nt=[],ot=[].concat(h,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,G=t.length;b<G;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 It(r,16);var h=t.substr(128,64),p=t.substr(192);s===0&&(h=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 G=0,tt=C.length;G<tt;G++)nt===ot.length&&E(),C[G]^=255&ot[nt++];return ct.arrayToHex(Ae([].concat(r,C,t)))===h?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,h=C.hash,p=C.publicKey,E=C.userId,C=typeof t=="string"?ct.utf8ToHex(t):ct.arrayToHex(t);h&&(C=gr(C,p||(t=r,h=De.multiply(new It(t,16)),"04"+(t=ct.leftPad(h.getX().toBigInteger().toString(16),64))+(h=ct.leftPad(h.getY().toBigInteger().toString(16),64))),E));var w=new It(r,16),nt=new It(C,16),ot=null,b=null,G=null;do do{var tt;ot=(tt=s&&s.length?s.pop():mr()).k,b=nt.add(tt.x1).mod(Re)}while(b.equals(It.ZERO)||b.add(ot).equals(Re));while((G=w.add(It.ONE).modInverse(Re).multiply(ot.subtract(b.multiply(w))).mod(Re)).equals(It.ZERO));return c?Qr(b,G):ct.leftPad(b.toString(16),64)+ct.leftPad(G.toString(16),64)},doVerifySignature:function(t,r,s){var c,h,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)),h=p?(c=(h=Zr(r)).r,h.s):(c=new It(r.substring(0,64),16),new It(r.substring(64),16)),r=yr.decodePointHex(s),s=new It(t,16),!(t=c.add(h).mod(Re)).equals(It.ZERO)&&(r=De.multiply(h).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 de(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 h=E.mode,p=(p=E.iv)===void 0?[]:p,E=(E=E.output)===void 0?"string":E;if(h==="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(B){for(var K=[],Y=0,X=B.length;Y<X;Y++){var W=B.codePointAt(Y);if(W<=127)K.push(W);else if(W<=2047)K.push(192|W>>>6),K.push(128|63&W);else if(W<=55295||57344<=W&&W<=65535)K.push(224|W>>>12),K.push(128|W>>>6&63),K.push(128|63&W);else{if(!(65536<=W&&W<=1114111))throw K.push(W),new Error("input is not supported");Y++,K.push(240|W>>>18&28),K.push(128|W>>>12&63),K.push(128|W>>>6&63),K.push(128|63&W)}}return K}: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(B,K,Y){for(var X=new Array(4),W=new Array(4),gt=0;gt<4;gt++)W[0]=255&B[0+4*gt],W[1]=255&B[1+4*gt],W[2]=255&B[2+4*gt],W[3]=255&B[3+4*gt],X[gt]=W[0]<<24|W[1]<<16|W[2]<<8|W[3];X[0]^=2746333894,X[1]^=1453994832,X[2]^=1736282519,X[3]^=2993693404;for(var et,bt=0;bt<32;bt+=4)et=X[1]^X[2]^X[3]^xe[bt+0],K[bt+0]=X[0]^=Le(de(et)),et=X[2]^X[3]^X[0]^xe[bt+1],K[bt+1]=X[1]^=Le(de(et)),et=X[3]^X[0]^X[1]^xe[bt+2],K[bt+2]=X[2]^=Le(de(et)),et=X[0]^X[1]^X[2]^xe[bt+3],K[bt+3]=X[3]^=Le(de(et));if(Y===0)for(var Nt,Mt=0;Mt<16;Mt++)Nt=K[Mt],K[Mt]=K[31-Mt],K[31-Mt]=Nt})(r,nt,s);for(var ot=[],b=p,G=t.length,tt=0;16<=G;){var z=t.slice(tt,tt+16),it=new Array(16);if(h==="cbc")for(var lt=0;lt<16;lt++)s!==0&&(z[lt]^=b[lt]);(function(B,K,Y){for(var X=new Array(4),W=new Array(4),gt=0;gt<4;gt++)W[0]=255&B[4*gt],W[1]=255&B[4*gt+1],W[2]=255&B[4*gt+2],W[3]=255&B[4*gt+3],X[gt]=W[0]<<24|W[1]<<16|W[2]<<8|W[3];for(var et,bt=0;bt<32;bt+=4)et=X[1]^X[2]^X[3]^Y[bt+0],X[0]^=Fe(de(et)),et=X[2]^X[3]^X[0]^Y[bt+1],X[1]^=Fe(de(et)),et=X[3]^X[0]^X[1]^Y[bt+2],X[2]^=Fe(de(et)),et=X[0]^X[1]^X[2]^Y[bt+3],X[3]^=Fe(de(et));for(var Nt=0;Nt<16;Nt+=4)K[Nt]=X[3-Nt/4]>>>24&255,K[Nt+1]=X[3-Nt/4]>>>16&255,K[Nt+2]=X[3-Nt/4]>>>8&255,K[Nt+3]=255&X[3-Nt/4]})(z,it,nt);for(var Ct=0;Ct<16;Ct++)h==="cbc"&&s===0&&(it[Ct]^=b[Ct]),ot[tt+Ct]=it[Ct];h==="cbc"&&(b=s!==0?it:z),G-=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(B){return(B=B.toString(16)).length===1?"0"+B:B})).join(""):(function(B){for(var K=[],Y=0,X=B.length;Y<X;Y++)240<=B[Y]&&B[Y]<=247?(K.push(String.fromCodePoint(((7&B[Y])<<18)+((63&B[Y+1])<<12)+((63&B[Y+2])<<6)+(63&B[Y+3]))),Y+=3):224<=B[Y]&&B[Y]<=239?(K.push(String.fromCodePoint(((15&B[Y])<<12)+((63&B[Y+1])<<6)+(63&B[Y+2]))),Y+=2):192<=B[Y]&&B[Y]<=223?(K.push(String.fromCodePoint(((31&B[Y])<<6)+(63&B[Y+1]))),Y++):K.push(String.fromCodePoint(B[Y]));return K.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],h=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]:(G=ye[b-15],tt=ye[b-2],ye[b]=((G<<25|G>>>7)^(G<<14|G>>>18)^G>>>3)+ye[b-7]+((tt<<15|tt>>>17)^(tt<<13|tt>>>19)^tt>>>10)+ye[b-16]);var G=c&h^c&p^h&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=h,h=c,c=tt+(((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+G)|0}t[0]=t[0]+c|0,t[1]=t[1]+h|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,h=r.length;c<h;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(h){for(var p=[],E=0;E<Math.ceil(h.length/4);E++)p[E]=h[4*E]<<24|(255&h[4*E+1])<<16|(255&h[4*E+2])<<8|255&h[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(h){for(var p=[],E=0;E<h.length;E++)p[4*E]=h[E]>>24&255,p[4*E+1]=h[E]>>16&255,p[4*E+2]=h[E]>>8&255,p[4*E+3]=255&h[E];return p})(r).map((function(h){return(h=h.toString(16)).length===1?"0"+h:h})).join("")}},At),nn=yt,on=Rt,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,h=!1,p=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,E=p!==void 0&&!!p.request&&!!p.login,C=function(b,G){return typeof b=="string"&&typeof G=="string"&&b!=null&&G!=null&&b.substring(0,G.length)===G},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 G in w)if(w[G]===b)return G},ot=function(b,G,tt){var z=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,B=it.cc.u8.byteToInt(lt.slice(0,4),0),K=lt.slice(4,4+B),Y=it.cc.u8.byteToInt(lt.slice(4+B,4+B+4),0),X=lt.slice(4+B+4,4+B+4+Y),W=it.cc.u8.byteToInt(lt.slice(4+B+4+Y,4+B+4+Y+4),0),gt=lt.slice(4+B+4+Y+4,4+B+4+Y+4+W),et=it.cc.u8.bytesToUtf8Str(K);if(it.cc.h6.encode(X,0,Y),G||(tt!==void 0&&tt==="sm2"?(Ct=it.cc.h6.encode(X,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,W).toLowerCase())){if(et.length%2==0){t.prototype.__v=function(){return et.slice(0,2)};for(var bt=[],Nt=2;Nt<66;Nt+=2)bt.push(parseInt("0x"+et.slice(Nt,Nt+2)));t.prototype.__i=function(){return bt};var Mt=parseInt("0x"+et.slice(66,82))-z;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,G){var tt,z={debug:!1,url:"https://aks.jdpay.com/aar2/getJS",callback:function(){}};typeof b=="string"?(C(b,"https")||C(b,"https")?z.url=b:C(b,"eyJ")&&(z.code=b),typeof G=="string"&&(z.publicKey=G)):dt(b)==="object"&&(b.debug&&(z.debug=b.debug),b.url&&(z.url=b.url),b.code&&(z.code=b.code),b.publicKey&&(z.publicKey=b.publicKey),b.skipVerify&&(z.skipVerify=b.skipVerify),b.alg&&(z.alg=b.alg),b.callback&&typeof b.callback=="function"&&(z.callback=b.callback)),h?z.callback&&z.callback(!0,{errorNo:tt=w.ALREADY_SUCCESS,errorMsg:nt(tt)}):c?setTimeout((function(){t.init(b,G)}),50):(c=!0,z.debug&&vr.start(z.debug),z.publicKey&&(s=z.publicKey),z.code?(tt=ot(z.code,z.skipVerify))===w.SUCCESS?(c=!(h=!0),z.callback(!0,{errorNo:tt,errorMsg:nt(tt)})):z.callback(!1,{errorNo:tt,errorMsg:nt(tt)}):z.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(K){K.statusCode===200?lt(K.data):Ct(w.ERROR_XXX_REQUEST_FAIL)},fail:function(K){K&&K.errMsg&&K.errMsg.indexOf("timeout")!==-1?Ct(w.ERROR_XXX_REQUEST_TIMEOUT):Ct(w.ERROR_XXX_REQUEST_FAIL)}});else{var B;if(window.XMLHttpRequest)B=new XMLHttpRequest;else if(window.ActiveXObject)try{B=new ActiveXObject("Msxml2.XMLHTTP")}catch(K){try{B=new ActiveXObject("Microsoft.XMLHTTP")}catch(Y){}}B&&(B.onload=function(){B.readyState===4&&(B.status===200?lt(B.responseText):Ct(w.ERROR_XHR_ERROR))},B.ontimeout=function(){Ct(w.ERROR_XHR_TIMEOUT)},B.onerror=function(){Ct(w.ERROR_XHR_ERROR)},B.open("POST",it,!0),B.timeout=5e3,B.send(null))}}catch(K){console.error(K),Ct(w.ERROR_UNKNOWN_ERROR)}})(z.url,(function(it){(it=ot(it,z.skipVerify,z.alg))===w.SUCCESS?(c=!(h=!0),z.callback(!0,{errorNo:it,errorMsg:nt(it)})):(c=!1,z.callback(!1,{errorNo:it,errorMsg:nt(it)}))}),(function(it){c=!1,z.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,G){return this.__s(b,G)},__s:function(b,G){var tt=this.cc.u8.utf8StrToBytes(b),z=this.__i();return b=this.cc.u8.utf8StrToBytes(G),G=this.cc.u8.utf8StrToBytes(this.__c()),b=[].concat(tt,z,b,G),G=parseInt("0x"+this.__v()),this.__f(G)(b)+this.__v()},__f:function(b){var G=this.co.s2,tt=this.co.c3,z=this.cc.h6.decode,it=[function(lt){return G(lt)},function(lt){return tt(lt)},function(lt){return tt(z(G(lt)))},function(lt){return G(z(tt(lt)))},function(lt){return tt(z(tt(lt)))},function(lt){return G(z(G(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})()},Et(R)=="object"?g.exports=at():(H=typeof(L=at)=="function"?L.call(R,S,R,g):L)===void 0||(g.exports=H)}},a={};function u(g){var R=a[g];if(R!==void 0)return R.exports;var S=a[g]={id:g,loaded:!1,exports:{}};return o[g].call(S.exports,S,S.exports,u),S.loaded=!0,S.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 S in R)u.o(R,S)&&!u.o(g,S)&&Object.defineProperty(g,S,{enumerable:!0,get:R[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,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:()=>hr,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"},je={[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(o,a){return`${je[o]||je[Xt.PROD]}${a}`}function Ir(o){return Er[o]||Er[Xt.PROD]}var be={debug:!1,env:Xt.PROD,externalEnv:ue.PROD,apiDomain:""},br=mt({},be);function Sr(o){br=mt(mt({},be),o)}function he(){return br}var An=Object.defineProperty,Dn=(o,a,u)=>a in o?An(o,a,{enumerable:!0,configurable:!0,writable:!0,value:u}):o[a]=u,Rn=(o,a,u)=>Dn(o,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(o=!1){Rn(this,"enable"),this.enable=o}setEnable(o){this.enable=o}info(...o){this.enable&&console.info("[BI Info]",...o)}warn(...o){this.enable&&console.warn("[BI Warn]",...o)}error(...o){this.enable&&console.error("[BI Error]",...o)}debug(...o){this.enable&&console.log("[BI Debug]",...o)}},M=new En;function ze(o){let a=ee();return a==="taro"?Taro.setClipboardData({data:o}).then(()=>{M.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):a==="uni"?new Promise((u,_)=>{uni.setClipboardData({data:o,success:()=>{M.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{M.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),_(g)}})}):a==="wechat"?new Promise((u,_)=>{wx.setClipboardData({data:o,success:()=>{M.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{M.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),_(g)}})}):a==="alipay"?new Promise((u,_)=>{my.setClipboardData({text:o,success:()=>{M.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),u()},fail:g=>{M.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",g),_(g)}})}):navigator.clipboard.writeText(o).then(()=>{M.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function $e(o,a=2e3){let u=ee();if(u==="taro"){Taro.showToast({title:o,icon:"none",mask:!0,duration:a});return}if(u==="uni"){uni.showToast({title:o,icon:"none",mask:!0,duration:a});return}if(u==="wechat"){wx.showToast({title:o,icon:"none",mask:!0,duration:a});return}if(u==="alipay"){my.showToast({content:o,duration:a});return}typeof console!="undefined"&&console.log(`[Toast] ${o}`)}async function me(){var o,a,u,_,g;let R=ee();try{if(R==="taro")return((o=(await Taro.getSystemInfo()).platform)==null?void 0:o.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 S=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(S))return"ios";if(/android/.test(S))return"android"}return"unknown"}catch(S){return M.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 $(o,a,u=null){return{code:o,message:a,data:u}}function ke(o,a){return o==null?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof o=="string"&&o.trim().length===0?{valid:!1,message:`${a}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function Pe(o,a){for(let u of a){let _=ke(o[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=(o,a,u,_)=>{let g=ee();if(g==="taro")return Taro.request({url:o,method:a,data:u,header:_}).then(L=>L);if(g==="uni")return new Promise((L,H)=>{uni.request({url:o,method:a,data:u,header:_,success:at=>L(at),fail:at=>H(at)})});if(g==="wechat")return new Promise((L,H)=>{wx.request({url:o,method:a,data:u,header:_,success:at=>L(at),fail:at=>H(at)})});if(g==="alipay")return new Promise((L,H)=>{my.request({url:o,method:a,data:u,headers:_,success:at=>L(at),fail:at=>H(at)})});let R=a.toUpperCase()==="GET",S=R&&u&&Object.keys(u).length?`${o}?${new URLSearchParams(u).toString()}`:o;return fetch(S,{method:a,headers:_,body:R?void 0:JSON.stringify(u)}).then(async L=>({statusCode:L.status,data:await L.json()}))},Qe=class{constructor(a=null){qe(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||he()||be}async getAuthToken(){let a=this.getCurrentConfig();if(a.getAuthToken&&typeof a.getAuthToken=="function")try{let u=await a.getAuthToken();return u?(M.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),u):(M.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(u){return M.error("\u83B7\u53D6Token\u5931\u8D25",u),null}return null}async buildHeader(a={},u=!0){let _=mt({"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:S=!0,baseDomain:L,beforeRequest:H,afterResponse:at}=a,Et=L?`${L}${u}`:Be(this.getCurrentConfig().env||"prod",u),dt=await this.buildHeader(R,S);H&&typeof H=="function"&&await H({url:Et,method:_,data:g,header:dt}),M.info(`\u53D1\u8D77${_}\u8BF7\u6C42:`,{path:u,method:_});try{let Q=await In(Et,_,g,dt);return M.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:Q.statusCode}),at&&typeof at=="function"&&await at(Q.data),Q.data}catch(Q){throw M.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:Q}),Q}}get(a,u={},_={}){return this.request(mt({path:a,method:"GET",data:u},_))}post(a,u={},_={}){return this.request(mt({path:a,method:"POST",data:u},_))}},Se=(o=null)=>new Qe(o);var bn=(function(){"use strict";function o(D,Z){var ht=(65535&D)+(65535&Z);return(D>>16)+(Z>>16)+(ht>>16)<<16|65535&ht}function a(D,Z,ht,F,J,St){return o((St=o(o(Z,D),o(F,St)))<<J|St>>>32-J,ht)}function u(D,Z,ht,F,J,St,I){return a(Z&ht|~Z&F,D,Z,J,St,I)}function _(D,Z,ht,F,J,St,I){return a(Z&F|ht&~F,D,Z,J,St,I)}function g(D,Z,ht,F,J,St,I){return a(Z^ht^F,D,Z,J,St,I)}function R(D,Z,ht,F,J,St,I){return a(ht^(Z|~F),D,Z,J,St,I)}function S(D,Z){var ht,F,J,St;D[Z>>5]|=128<<Z%32,D[14+(Z+64>>>9<<4)]=Z;for(var I=1732584193,T=-271733879,O=-1732584194,P=271733878,m=0;m<D.length;m+=16)I=u(ht=I,F=T,J=O,St=P,D[m],7,-680876936),P=u(P,I,T,O,D[m+1],12,-389564586),O=u(O,P,I,T,D[m+2],17,606105819),T=u(T,O,P,I,D[m+3],22,-1044525330),I=u(I,T,O,P,D[m+4],7,-176418897),P=u(P,I,T,O,D[m+5],12,1200080426),O=u(O,P,I,T,D[m+6],17,-1473231341),T=u(T,O,P,I,D[m+7],22,-45705983),I=u(I,T,O,P,D[m+8],7,1770035416),P=u(P,I,T,O,D[m+9],12,-1958414417),O=u(O,P,I,T,D[m+10],17,-42063),T=u(T,O,P,I,D[m+11],22,-1990404162),I=u(I,T,O,P,D[m+12],7,1804603682),P=u(P,I,T,O,D[m+13],12,-40341101),O=u(O,P,I,T,D[m+14],17,-1502002290),I=_(I,T=u(T,O,P,I,D[m+15],22,1236535329),O,P,D[m+1],5,-165796510),P=_(P,I,T,O,D[m+6],9,-1069501632),O=_(O,P,I,T,D[m+11],14,643717713),T=_(T,O,P,I,D[m],20,-373897302),I=_(I,T,O,P,D[m+5],5,-701558691),P=_(P,I,T,O,D[m+10],9,38016083),O=_(O,P,I,T,D[m+15],14,-660478335),T=_(T,O,P,I,D[m+4],20,-405537848),I=_(I,T,O,P,D[m+9],5,568446438),P=_(P,I,T,O,D[m+14],9,-1019803690),O=_(O,P,I,T,D[m+3],14,-187363961),T=_(T,O,P,I,D[m+8],20,1163531501),I=_(I,T,O,P,D[m+13],5,-1444681467),P=_(P,I,T,O,D[m+2],9,-51403784),O=_(O,P,I,T,D[m+7],14,1735328473),I=g(I,T=_(T,O,P,I,D[m+12],20,-1926607734),O,P,D[m+5],4,-378558),P=g(P,I,T,O,D[m+8],11,-2022574463),O=g(O,P,I,T,D[m+11],16,1839030562),T=g(T,O,P,I,D[m+14],23,-35309556),I=g(I,T,O,P,D[m+1],4,-1530992060),P=g(P,I,T,O,D[m+4],11,1272893353),O=g(O,P,I,T,D[m+7],16,-155497632),T=g(T,O,P,I,D[m+10],23,-1094730640),I=g(I,T,O,P,D[m+13],4,681279174),P=g(P,I,T,O,D[m],11,-358537222),O=g(O,P,I,T,D[m+3],16,-722521979),T=g(T,O,P,I,D[m+6],23,76029189),I=g(I,T,O,P,D[m+9],4,-640364487),P=g(P,I,T,O,D[m+12],11,-421815835),O=g(O,P,I,T,D[m+15],16,530742520),I=R(I,T=g(T,O,P,I,D[m+2],23,-995338651),O,P,D[m],6,-198630844),P=R(P,I,T,O,D[m+7],10,1126891415),O=R(O,P,I,T,D[m+14],15,-1416354905),T=R(T,O,P,I,D[m+5],21,-57434055),I=R(I,T,O,P,D[m+12],6,1700485571),P=R(P,I,T,O,D[m+3],10,-1894986606),O=R(O,P,I,T,D[m+10],15,-1051523),T=R(T,O,P,I,D[m+1],21,-2054922799),I=R(I,T,O,P,D[m+8],6,1873313359),P=R(P,I,T,O,D[m+15],10,-30611744),O=R(O,P,I,T,D[m+6],15,-1560198380),T=R(T,O,P,I,D[m+13],21,1309151649),I=R(I,T,O,P,D[m+4],6,-145523070),P=R(P,I,T,O,D[m+11],10,-1120210379),O=R(O,P,I,T,D[m+2],15,718787259),T=R(T,O,P,I,D[m+9],21,-343485551),I=o(I,ht),T=o(T,F),O=o(O,J),P=o(P,St);return[I,T,O,P]}function L(D){for(var Z="",ht=32*D.length,F=0;F<ht;F+=8)Z+=String.fromCharCode(D[F>>5]>>>F%32&255);return Z}function H(D){var Z=[];for(Z[(D.length>>2)-1]=void 0,F=0;F<Z.length;F+=1)Z[F]=0;for(var ht=8*D.length,F=0;F<ht;F+=8)Z[F>>5]|=(255&D.charCodeAt(F/8))<<F%32;return Z}function at(D){for(var Z,ht="0123456789abcdef",F="",J=0;J<D.length;J+=1)Z=D.charCodeAt(J),F+=ht.charAt(Z>>>4&15)+ht.charAt(15&Z);return F}function Et(D){return unescape(encodeURIComponent(D))}function dt(D){return L(S(H(D=Et(D)),8*D.length))}function Q(D,Z){return(function(ht,F){var J,St=H(ht),I=[],T=[];for(I[15]=T[15]=void 0,16<St.length&&(St=S(St,8*ht.length)),J=0;J<16;J+=1)I[J]=909522486^St[J],T[J]=1549556828^St[J];return F=S(I.concat(H(F)),512+8*F.length),L(S(T.concat(F),640))})(Et(D),Et(Z))}function ve(D,Z,ht){return Z?ht?Q(Z,D):at(Q(Z,D)):ht?dt(D):at(dt(D))}return ve})(),Ce=bn;function Tr(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function wr(o){if(typeof o!="object"||o===null)return o;let a=Object.keys(o).sort(),u={};for(let _ of a)u[_]=o[_];return JSON.stringify(u)}function Pr(o,a){let u={appId:o.appId,randomStr:o.randomStr,data:o.data},_=Object.keys(u).sort(),g="";for(let[R,S]of _.entries())g+=`${S}=${u[S]}`,R<_.length-1&&(g+="&");return g+=`&secretKey=${a}`,Ce(g)}var Sn=(o,a,u,_)=>{let g=ee();return g==="taro"?Taro.request({url:o,method:a,data:u,header:_}).then(R=>R):g==="uni"?new Promise((R,S)=>{uni.request({url:o,method:a,data:u,header:_,success:L=>R(L),fail:L=>S(L)})}):g==="wechat"?new Promise((R,S)=>{wx.request({url:o,method:a,data:u,header:_,success:L=>R(L),fail:L=>S(L)})}):g==="alipay"?new Promise((R,S)=>{my.request({url:o,method:a,data:u,headers:_,success:L=>R(L),fail:L=>S(L)})}):fetch(o,{method:a,headers:_,body:JSON.stringify(u)}).then(async R=>({statusCode:R.status,data:await R.json()}))},Ze=class{constructor(a=null){qe(this,"staticConfig");this.staticConfig=a}getCurrentConfig(){return this.staticConfig||he()||{}}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(),S=wr(a),L=Pr({appId:_,randomStr:R,data:S},g);return{appId:_,randomStr:R,sign:L}}buildRequestBody(a={}){let u=this.generateSign(a);return oe(mt({},u),{data:a})}buildUrl(a){return`${this.getExternalHost()}${a}`}async request(a){let{path:u,method:_="POST",data:g={},header:R={},needSign:S=!0,beforeRequest:L,afterResponse:H}=a,at=this.buildUrl(u),Et=mt({"content-type":"application/json"},R),dt=S?this.buildRequestBody(g):g;L&&typeof L=="function"&&await L({url:at,method:_,data:dt,header:Et}),M.info(`\u53D1\u8D77${_}\u8BF7\u6C42:`,{path:u,method:_});try{let Q=await Sn(at,_,dt,Et);if(M.info("\u8BF7\u6C42\u6210\u529F:",{path:u,statusCode:Q.statusCode}),H&&typeof H=="function"&&await H(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:(M.error("\u8BF7\u6C42\u5931\u8D25:",{path:u,error:Q}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:Q})}}get(a,u={},_={}){return this.request(mt({path:a,method:"GET",data:u},_))}post(a,u={},_={}){return this.request(mt({path:a,method:"POST",data:u},_))}},Cr=(o=null)=>new Ze(o);var tr=Se(),er=Cr();function Or(o){let a=ke(o==null?void 0:o.equipmentValue,"equipmentValue");return a.valid?tr.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Nr(o){let a=Pe(o,["idMd5Value","rtaStrategy"]);return a.valid?er.post("/open/rest/cpa/jd/rta-check",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function xr(o){try{let a={thirdPlatform:o.thirdPlatform,thirdPlatformUserId:o.thirdPlatformUserId,thirdPlatformEquipmentValue:o.thirdPlatformEquipmentValue,os:o.os,client:"wxMini"};o.phone&&(a.mobileMd5=Ce(o.phone)),o.extendData&&(Object.prototype.toString.call(o.extendData)==="[object Object]"?a.extendData=o.extendData:M.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 M.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",a),a}}function Fr(o){let a=ke(o==null?void 0:o.equipmentValue,"equipmentValue");return a.valid?tr.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}function Lr(o){let a=Pe(o,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return a.valid?tr.post("/gw/advert/customer/cpa-activity/jd/rta/validate",o):Promise.reject({code:"PARAM_ERROR",message:a.message})}async function Ur(o){let a=await me(),u={thirdPlatform:o.thirdPlatform,thirdPlatformUserId:o.thirdPlatformUserId,thirdPlatformEquipmentValue:o.thirdPlatformEquipmentValue,os:a,client:o.client};return o.phone&&(u.mobileMd5=Ce(o.phone)),o.extendData&&(Object.prototype.toString.call(o.extendData)==="[object Object]"?u.extendData=o.extendData:M.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(o){let{phone:a,rtaId:u,equipmentId:_,lyyUserId:g,entrance:R}=o;if(!a)return $(Ft.INVALID_PARAM,Tt[2001]);if(!_)return $(Ft.INVALID_PARAM,Tt[2002]);try{if(u){M.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let dt=await Lr({phone:a,lyyEquipmentValue:_,lyyUserId:g||"",rtaId:u});if(dt.code!=="0000000"||!dt.body||dt.body.state!=1)return M.error("RTA\u9A8C\u8BC1\u5931\u8D25",dt),$(2003,Tt[2003]);M.info("RTA\u9A8C\u8BC1\u6210\u529F",dt.body)}M.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:a});let S=await me(),L=await Fr({phone:a,equipmentValue:_,os:S,entrance:R});if(L.code!=="0000000"||!L.body)return M.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",L),$(2004,Tt[2004]);let{appId:H,targetUrl:at}=L.body;if(!H||!at)return M.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:H,targetUrl:at}),$(2005,Tt[2005]);let Et=$(Ft.SUCCESS,"\u6210\u529F",{appId:H,targetUrl:at});return M.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",Et),Et}catch(S){return M.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",S),$(Ft.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function nr(o){let{phone:a,rtaId:u,thirdPlatform:_,thirdPlatformUserId:g,thirdPlatformEquipmentValue:R}=o;if(!a)return $(Ft.INVALID_PARAM,Tt[2001]);if(!_)return $(2008,Tt[2008]);if(!g)return $(2009,Tt[2009]);if(!R)return $(2010,Tt[2010]);try{if(u){M.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:a});let Q=await Nr({idMd5Value:a,rtaStrategy:u});if(Q.status!=1)return M.error("RTA\u9A8C\u8BC1\u5931\u8D25",Q),$(2003,Tt[2003]);M.info("RTA\u9A8C\u8BC1\u6210\u529F",Q)}let S=await Ur(o),{url:L,channelId:H,matchFlag:at,jumpMode:Et,appId:dt}=S||{};return at?Et===3?!dt||!L?$(2007,Tt[2007]):$(Ft.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:dt,url:L}):$(2007,Tt[2007]):$(2006,Tt[2006])}catch(S){return M.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",S),$(Ft.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var Te=null,Oe=null;try{Oe=qr()}catch(o){}function jr(){return Te||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(Te=globalThis.LyyGetCommandSDK,Te):Oe?(Te=Oe.LyyGetCommandSDK||Oe.default||Oe,Te):null)}function Br(o){var u;M.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",o);let a=jr();a!=null&&a.getJrCommand?a.getJrCommand(o):(u=a==null?void 0:a.default)!=null&&u.getJrCommand?a.default.getJrCommand(o):(M.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),o.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function Tn(o,a){return new Promise((u,_)=>{try{Br({url:o,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(o){try{let a=await me(),u=mt({os:a},o);M.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:S,matchFlag:L,jumpMode:H,appId:at}=g;if(!L)return $(2101,Tt[2101]);if(H===1)return M.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),$(2102,Tt[2102]);if(H===2)return ee()==="web"&&M.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:R}),!R||!S?$(2103,Tt[2103]):new Promise(Et=>{Br({url:R,channel:S,callback:async dt=>{if((dt==null?void 0:dt.code)==="0")try{await ze(dt==null?void 0:dt.data),Et($(Ft.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch(Q){Et($(2105,Tt[2105]))}else Et($(2105,Tt[2105]))}})});if(H===3)return!at||!R?$(2103,Tt[2103]):$(Ft.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:at,path:R})}return $(2104,Tt[2104])}catch(a){return M.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",a),$(Ft.NETWORK_ERROR,"\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5")}}async function ir(o){M.info("\u5F00\u59CB\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4...");try{let a=await xr(oe(mt({},o),{os:await me()}));if(!a)return M.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),$(2106,Tt[2106]);if(a.jumpMode===1)return M.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{appId:a.appId,url:a.url}),$(Ft.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:a.appId,path:a.url});if(a.jumpMode===2){if(ee()==="web")return M.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:a.url}),$(Ft.SUCCESS,"\u6210\u529F",{type:"h5",url:a.url});try{let u=await Tn(a.url,a.channel);return await ze(u),M.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),$(Ft.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(u){return M.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",u),$e("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),$(2105,Tt[2105])}}return M.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",a.jumpMode),$(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 M.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")?$(2108,Tt[2108]):$(Ft.NETWORK_ERROR,u)}}var lr={};Me(lr,{DyErrorCode:()=>_e,getDyPayRtaData:()=>cr,handleDyPayFlow:()=>ur});var wn=["weapp","h5"];function Pn(o){return wn.includes(o)}var Cn=["switchTab","reLaunch","redirectTo","navigateTo"];function On(o){return Cn.includes(o)}function kr(o){return o.telephone?o.price?o.equipmentValue?o.businessType?o.client&&!Pn(o.client)?{valid:!1,errorCode:3004}:o.douyinOrderExtendData&&typeof o.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:o.backWay&&o.client==="weapp"&&!On(o.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(o){return o.equipmentValue?o.telephone?{valid:!0,errorCode:0}:{valid:!1,errorCode:3001}:{valid:!1,errorCode:3002}}var sr=Se();async function Yr(o){let{price:a,equipmentValue:u,douyinOrderExtendData:_,douyinCommodityVirtualFlag:g,businessType:R,platformActivities:S={}}=o,L={businessType:R,equipmentValue:u,payInfoBusinessType:"commonDouyinPayment",platformActivities:mt({douyinCommodityVirtualFlag:g||!1,douyinCommodityPrice:a,douyinOrderExtendData:_||""},S)};try{let H=await sr.post("/gw/advert/customer/payment/pay-info",L);return H.code!=="0000000"||!(H!=null&&H.body)?Promise.reject({code:3006,message:H.message||Wt[3006]}):(H.body.platformActivities=L.platformActivities,H)}catch(H){return M.error("getDyOrderAmountFn error:",H),Promise.reject({code:3007,message:Wt[3007]})}}async function Vr(o){try{let a=o.commodityList.map(L=>(L.commodity=L.commodityId,delete L.commodityId,L.quantity=L.quantity||1,L)),u=o.advertExtendInfo&&Object.keys(o.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:o.advertExtendInfo}):"",_=ee(),g="";_==="wechat"?g="wechatMini":_==="web"&&navigator.userAgent.toLowerCase().includes("micromessenger")&&(g="wechatHtml");let R=mt(mt({businessType:o.businessType,fixedClientType:21,channelCode:null,douyinData:{loginMobile:o.telephone||""},equipmentUseFlag:!0,payEquipmentDTO:{equipmentValue:o.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:u,transType:5,actualFee:o.totalFee,totalFee:o.totalFee,commodityList:a,clientSourceDetailType:g,platformActivities:o.platformActivities||{}},o.commoditySign&&{commoditySign:o.commoditySign}),o.unifiedOrderExtendData&&mt({},o.unifiedOrderExtendData)),S=await sr.post("/gw/payment-bff/unified/order",R);return S.code!=="0000000"||!(S!=null&&S.body)?Promise.reject({code:3008,message:S.message||Wt[3008]}):S}catch(a){return M.error("dyUnifiedOrderFn error:",a),Promise.reject({code:3009,message:Wt[3009]})}}async function Hr(o){let a={equipmentValue:o.equipmentValue,phone:o.telephone||""};o.price&&(a.orderAmount=o.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 M.error("getDyPayRtaData error:",u),Promise.reject({code:3014,message:(u==null?void 0:u.message)||Wt[3014]})}}async function ur(o){var u,_,g;let a=kr(o);if(!a.valid)return $(a.errorCode,Wt[a.errorCode]);try{let R=await Yr({price:o.price,equipmentValue:o.equipmentValue,businessType:o.businessType,douyinOrderExtendData:(o==null?void 0:o.douyinOrderExtendData)||"",platformActivities:(o==null?void 0:o.platformActivities)||{},douyinCommodityVirtualFlag:(o==null?void 0:o.douyinCommodityVirtualFlag)||!1}),S=await Vr(mt(oe(mt({},R.body),{telephone:o.telephone,equipmentValue:o.equipmentValue,businessType:o.businessType}),o.unifiedOrderExtendData&&{unifiedOrderExtendData:o.unifiedOrderExtendData})),L=(u=S==null?void 0:S.body)!=null&&u.h5Url?await Nn(oe(mt({},o),{dyUrl:S.body.h5Url})):"",H=((_=S==null?void 0:S.body)==null?void 0:_.outTradeNo)||"";return L?$(0,"success",{h5Url:L,outTradeNo:H}):$(3010,Wt[3010])}catch(R){M.error("handleDyPayFlow error:",R);let S=(g=R==null?void 0:R.code)!=null?g:3012,L=(R==null?void 0:R.message)||Wt[3012];return $(S,L)}}async function Nn(o){let a=he(),u=Be(a.env||"prod",""),_=typeof a.getAuthToken=="function"?await a.getAuthToken():"",g=o.client||"weapp";return`${u}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${g}&equipmentId=${o.equipmentValue}&dyUrl=${o.dyUrl}&fromUrl=${encodeURIComponent(o.fromUrl||"")}&backUrl=${encodeURIComponent(o.backUrl||"")}&backWay=${o.backWay||""}&url_token=${_}`}async function cr(o){var u;let a=Jr(o);if(!a.valid)return $(a.errorCode,Wt[a.errorCode]);try{let _=await Hr({price:(o==null?void 0:o.price)||"",equipmentValue:o.equipmentValue,telephone:(o==null?void 0:o.telephone)||""});return $(0,"success",_.body)}catch(_){M.error("getDyPayRtaData error:",_);let g=(u=_==null?void 0:_.code)!=null?u:3015,R=(_==null?void 0:_.message)||Wt[3015];return $(g,R)}}var pr={};Me(pr,{getDisplayAdConfig:()=>hr,normalizeDisplayAdData:()=>Ye});var xn=Se();function Gr(o){let a=Pe(o,["placementId"]);if(!a.valid)return Promise.reject({code:"PARAM_ERROR",message:a.message});let u=he().env||"prod";return xn.get(`/gw/advert-plugin/api/v1/config/list/valid/${o.placementId}`,{},{authRequired:!1,baseDomain:Ir(u)})}var Xr=30*1e3,Fn="__",dr=new Map,fr=new Map;function Ln(o,a){return[o.appId||"",a,o.type||""].join(Fn)}function Un(o){let a=dr.get(o);return a?a.expireAt<=Date.now()?(dr.delete(o),M.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:o}),null):a.data:null}function Mn(o,a){dr.set(o,{data:a,expireAt:Date.now()+Xr})}function qn(o){return Array.isArray(o==null?void 0:o.body)?o.body:[]}function jn(o){return String(o==null?void 0:o.code)!=="200"}function Bn(o,a){let u=String(o||a||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(u)?u:a||"banner"}function Kr(o){return String(o||"").trim().toLowerCase()}function kn(o){var a;return!!o&&o.status!==0&&((a=o.platformConfig)==null?void 0:a.valid)!==!1}function Jn(o){return[...o].sort((a,u)=>{var R,S,L,H;let _=Number((R=a.priority)!=null?R:9999),g=Number((S=u.priority)!=null?S:9999);return _!==g?_-g:Number((L=u.weight)!=null?L:0)-Number((H=a.weight)!=null?H:0)})}function Wr(o){return o.find(a=>Kr(a.advertPlatform)==="gdt")||null}function zr(o){return o.find(a=>Kr(a.advertPlatform)!=="gdt")||null}function Yn(o,a){return o&&a?"mixed":o?"wechat":a?"custom":"none"}function Vn(o,a){var g,R;let u=Wr(o),_=zr(o);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(o){var u;let a=Wr(o);return((u=a==null?void 0:a.platformConfig)==null?void 0:u.adId)||""}function Gn(o){let a=zr(o),u=a==null?void 0:a.platformConfig;if(!u)return null;let _=u.image||u.imageUrl||"",g=u.video||u.videoUrl||"",R=u.poster||_||"",S=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:S||void 0,action:S?{type:"web",url:S}:void 0}}function Ye(o,a){let u=Jn(o.filter(kn)),_=Gn(u),g=Hn(u),R=Bn(void 0,a),S=Yn(g,_),L=Vn(u,S);return{show:!!(g||_),adId:"",type:R,provider:S,priority:L,unitId:g,customAd:_,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:o}}async function hr(o){let a=o.placementId||o.adId||"",u=Ln(o,a),_=Un(u);if(_)return M.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:u,placementId:a}),$(Ft.SUCCESS,"\u6210\u529F",_);let g=fr.get(u);if(g)return M.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:u,placementId:a}),g;let R=(async()=>{try{M.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",o);let S=await Gr({placementId:a}),L=qn(S);if(M.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:u,placementId:a,response:S,body:L}),jn(S)||!L)return M.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",S),$(Ft.UNKNOWN_ERROR,(S==null?void 0:S.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");let H=Ye(L,o.type);return H.adId=a,H.cache=oe(mt({},H.cache),{enable:!0,ttl:Xr}),Mn(u,H),M.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:u,placementId:a,provider:H.provider,priority:H.priority,hasUnitId:!!H.unitId,hasCustomAd:!!H.customAd}),$(Ft.SUCCESS,"\u6210\u529F",H)}catch(S){return M.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:u,placementId:a,error:S}),$(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(o={}){M.info("\u670D\u52A1\u521D\u59CB\u5316",o);let a=mt(mt({},be),o);a.env&&!je[a.env]&&(M.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]&&(M.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&&M.setEnable(a.debug),Sr(a),M.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",a)}function $r(o={}){let a="",u=null;async function _(){if(typeof o.getAuthToken=="function"){let R=await o.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 S=oe(mt({},o),{getAuthToken:()=>g.getAuthToken()});Xn(S),M.info("services installed via nova.use()"),Object.assign(R,{jd:mt({},ar),dy:mt({},lr),ads:mt({},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 qe=Object.defineProperty,Yr=Object.defineProperties,Ur=Object.getOwnPropertyDescriptor,Mr=Object.getOwnPropertyDescriptors,Jr=Object.getOwnPropertyNames,bn=Object.getOwnPropertySymbols;var Nn=Object.prototype.hasOwnProperty,kr=Object.prototype.propertyIsEnumerable;var rn=(e,o,a)=>o in e?qe(e,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[o]=a,at=(e,o)=>{for(var a in o||(o={}))Nn.call(o,a)&&rn(e,a,o[a]);if(bn)for(var a of bn(o))kr.call(o,a)&&rn(e,a,o[a]);return e},zt=(e,o)=>Yr(e,Mr(o));var qr=(e,o)=>()=>(o||e((o={exports:{}}).exports,o),o.exports),je=(e,o)=>{for(var a in o)qe(e,a,{get:o[a],enumerable:!0})},jr=(e,o,a,p)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of Jr(o))!Nn.call(e,l)&&l!==a&&qe(e,l,{get:()=>o[l],enumerable:!(p=Ur(o,l))||p.enumerable});return e};var Br=e=>jr(qe({},"__esModule",{value:!0}),e);var Be=(e,o,a)=>rn(e,typeof o!="symbol"?o+"":o,a);var Gn=qr((ui,Hn)=>{"use strict";(()=>{var e={737:(l,g,A)=>{"use strict";A.r(g),A.d(g,{default:()=>C,getJrCommand:()=>R});var E=A(307),L=A.n(E);function M(){M=function(){return K};var D,K={},It=Object.prototype,lt=It.hasOwnProperty,Pt=Object.defineProperty||function(y,f,m){y[f]=m.value},ft=typeof Symbol=="function"?Symbol:{},At=ft.iterator||"@@iterator",Et=ft.asyncIterator||"@@asyncIterator",St=ft.toStringTag||"@@toStringTag";function ht(y,f,m){return Object.defineProperty(y,f,{value:m,enumerable:!0,configurable:!0,writable:!0}),y[f]}try{ht({},"")}catch(y){ht=function(f,m,U){return f[m]=U}}function Kt(y,f,m,U){var I=f&&f.prototype instanceof se?f:se,q=Object.create(I.prototype),ot=new de(U||[]);return Pt(q,"_invoke",{value:Ft(y,m,ot)}),q}function x(y,f,m){try{return{type:"normal",arg:y.call(f,m)}}catch(U){return{type:"throw",arg:U}}}K.wrap=Kt;var Ht="suspendedStart",Zt="suspendedYield",Xt="executing",Nt="completed",Ct={};function se(){}function ie(){}function qt(){}var ue={};ht(ue,At,(function(){return this}));var ae=Object.getPrototypeOf,Ut=ae&&ae(ae(re([])));Ut&&Ut!==It&<.call(Ut,At)&&(ue=Ut);var Gt=qt.prototype=se.prototype=Object.create(ue);function me(y){["next","throw","return"].forEach((function(f){ht(y,f,(function(m){return this._invoke(f,m)}))}))}function te(y,f){function m(I,q,ot,vt){var mt=x(y[I],y,q);if(mt.type!=="throw"){var Wt=mt.arg,ee=Wt.value;return ee&&rt(ee)=="object"&<.call(ee,"__await")?f.resolve(ee.__await).then((function(Rt){m("next",Rt,ot,vt)}),(function(Rt){m("throw",Rt,ot,vt)})):f.resolve(ee).then((function(Rt){Wt.value=Rt,ot(Wt)}),(function(Rt){return m("throw",Rt,ot,vt)}))}vt(mt.arg)}var U;Pt(this,"_invoke",{value:function(I,q){function ot(){return new f((function(vt,mt){m(I,q,vt,mt)}))}return U=U?U.then(ot,ot):ot()}})}function Ft(y,f,m){var U=Ht;return function(I,q){if(U===Xt)throw Error("Generator is already running");if(U===Nt){if(I==="throw")throw q;return{value:D,done:!0}}for(m.method=I,m.arg=q;;){var ot=m.delegate;if(ot){var vt=Mt(ot,m);if(vt){if(vt===Ct)continue;return vt}}if(m.method==="next")m.sent=m._sent=m.arg;else if(m.method==="throw"){if(U===Ht)throw U=Nt,m.arg;m.dispatchException(m.arg)}else m.method==="return"&&m.abrupt("return",m.arg);U=Xt;var mt=x(y,f,m);if(mt.type==="normal"){if(U=m.done?Nt:Zt,mt.arg===Ct)continue;return{value:mt.arg,done:m.done}}mt.type==="throw"&&(U=Nt,m.method="throw",m.arg=mt.arg)}}}function Mt(y,f){var m=f.method,U=y.iterator[m];if(U===D)return f.delegate=null,m==="throw"&&y.iterator.return&&(f.method="return",f.arg=D,Mt(y,f),f.method==="throw")||m!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+m+"' method")),Ct;var I=x(U,y.iterator,f.arg);if(I.type==="throw")return f.method="throw",f.arg=I.arg,f.delegate=null,Ct;var q=I.arg;return q?q.done?(f[y.resultName]=q.value,f.next=y.nextLoc,f.method!=="return"&&(f.method="next",f.arg=D),f.delegate=null,Ct):q:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,Ct)}function ne(y){var f={tryLoc:y[0]};1 in y&&(f.catchLoc=y[1]),2 in y&&(f.finallyLoc=y[2],f.afterLoc=y[3]),this.tryEntries.push(f)}function fe(y){var f=y.completion||{};f.type="normal",delete f.arg,y.completion=f}function de(y){this.tryEntries=[{tryLoc:"root"}],y.forEach(ne,this),this.reset(!0)}function re(y){if(y||y===""){var f=y[At];if(f)return f.call(y);if(typeof y.next=="function")return y;if(!isNaN(y.length)){var m=-1,U=function I(){for(;++m<y.length;)if(lt.call(y,m))return I.value=y[m],I.done=!1,I;return I.value=D,I.done=!0,I};return U.next=U}}throw new TypeError(rt(y)+" is not iterable")}return ie.prototype=qt,Pt(Gt,"constructor",{value:qt,configurable:!0}),Pt(qt,"constructor",{value:ie,configurable:!0}),ie.displayName=ht(qt,St,"GeneratorFunction"),K.isGeneratorFunction=function(y){var f=typeof y=="function"&&y.constructor;return!!f&&(f===ie||(f.displayName||f.name)==="GeneratorFunction")},K.mark=function(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,qt):(y.__proto__=qt,ht(y,St,"GeneratorFunction")),y.prototype=Object.create(Gt),y},K.awrap=function(y){return{__await:y}},me(te.prototype),ht(te.prototype,Et,(function(){return this})),K.AsyncIterator=te,K.async=function(y,f,m,U,I){I===void 0&&(I=Promise);var q=new te(Kt(y,f,m,U),I);return K.isGeneratorFunction(f)?q:q.next().then((function(ot){return ot.done?ot.value:q.next()}))},me(Gt),ht(Gt,St,"Generator"),ht(Gt,At,(function(){return this})),ht(Gt,"toString",(function(){return"[object Generator]"})),K.keys=function(y){var f=Object(y),m=[];for(var U in f)m.push(U);return m.reverse(),function I(){for(;m.length;){var q=m.pop();if(q in f)return I.value=q,I.done=!1,I}return I.done=!0,I}},K.values=re,de.prototype={constructor:de,reset:function(y){if(this.prev=0,this.next=0,this.sent=this._sent=D,this.done=!1,this.delegate=null,this.method="next",this.arg=D,this.tryEntries.forEach(fe),!y)for(var f in this)f.charAt(0)==="t"&<.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=D)},stop:function(){this.done=!0;var y=this.tryEntries[0].completion;if(y.type==="throw")throw y.arg;return this.rval},dispatchException:function(y){if(this.done)throw y;var f=this;function m(mt,Wt){return q.type="throw",q.arg=y,f.next=mt,Wt&&(f.method="next",f.arg=D),!!Wt}for(var U=this.tryEntries.length-1;U>=0;--U){var I=this.tryEntries[U],q=I.completion;if(I.tryLoc==="root")return m("end");if(I.tryLoc<=this.prev){var ot=lt.call(I,"catchLoc"),vt=lt.call(I,"finallyLoc");if(ot&&vt){if(this.prev<I.catchLoc)return m(I.catchLoc,!0);if(this.prev<I.finallyLoc)return m(I.finallyLoc)}else if(ot){if(this.prev<I.catchLoc)return m(I.catchLoc,!0)}else{if(!vt)throw Error("try statement without catch or finally");if(this.prev<I.finallyLoc)return m(I.finallyLoc)}}}},abrupt:function(y,f){for(var m=this.tryEntries.length-1;m>=0;--m){var U=this.tryEntries[m];if(U.tryLoc<=this.prev&<.call(U,"finallyLoc")&&this.prev<U.finallyLoc){var I=U;break}}I&&(y==="break"||y==="continue")&&I.tryLoc<=f&&f<=I.finallyLoc&&(I=null);var q=I?I.completion:{};return q.type=y,q.arg=f,I?(this.method="next",this.next=I.finallyLoc,Ct):this.complete(q)},complete:function(y,f){if(y.type==="throw")throw y.arg;return y.type==="break"||y.type==="continue"?this.next=y.arg:y.type==="return"?(this.rval=this.arg=y.arg,this.method="return",this.next="end"):y.type==="normal"&&f&&(this.next=f),Ct},finish:function(y){for(var f=this.tryEntries.length-1;f>=0;--f){var m=this.tryEntries[f];if(m.finallyLoc===y)return this.complete(m.completion,m.afterLoc),fe(m),Ct}},catch:function(y){for(var f=this.tryEntries.length-1;f>=0;--f){var m=this.tryEntries[f];if(m.tryLoc===y){var U=m.completion;if(U.type==="throw"){var I=U.arg;fe(m)}return I}}throw Error("illegal catch attempt")},delegateYield:function(y,f,m){return this.delegate={iterator:re(y),resultName:f,nextLoc:m},this.method==="next"&&(this.arg=D),Ct}},K}function pt(D,K,It,lt,Pt,ft,At){try{var Et=D[ft](At),St=Et.value}catch(ht){return void It(ht)}Et.done?K(St):Promise.resolve(St).then(lt,Pt)}function rt(D){return rt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(K){return typeof K}:function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},rt(D)}var X="https://ms.jr.jd.com";function kt(D){var K=D.host,It=D.type,lt=It===void 0?"post":It,Pt=D.data,ft=D.path,At=ft===void 0?"":ft,Et=D.config,St=Et===void 0?{}:Et,ht=(St.withCredentials,St.isWG),Kt=ht===void 0||ht,x=St.contentType,Ht=x===void 0?"application/x-www-form-urlencoded":x;return new Promise((function(Zt,Xt){wx.request({url:(K||X)+At,method:lt.toUpperCase(),data:Kt?P({reqData:JSON.stringify(Pt)}):Pt,header:{"content-type":Ht},success:function(Nt){Nt.statusCode===200?Zt(Nt.data):Xt({statusCode:Nt.statusCode,errMsg:Nt.errMsg,data:Nt.data})},fail:function(Nt){Xt(Nt)}})}))}function P(D){var K="";return rt(D)==="object"&&D!==null&&(Object.keys(D).map((function(It){var lt=D[It];return K+=It+"="+encodeURIComponent(lt)+"&",""})),K.length>0&&(K=K.substr(0,K.length-1))),K}function tt(D){return _t.apply(this,arguments)}function _t(){var D;return D=M().mark((function K(It){var lt,Pt,ft,At,Et,St,ht,Kt,x,Ht;return M().wrap((function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return lt=It.url,Pt=It.channel,ft=It.callback,L().init(),At=new(L()),Et=At.nonce(),St=At.sign(JSON.stringify({t:"".concat(new Date().getTime())}),Et),ht="/gw/generic/app/h5/m/execute1/ug-service-orchestrator".concat(""),Kt="",x={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:lt,channel:Pt,clientCode:"0",antiRushInfo:St}},Zt.next=12,kt({host:"https://ms.jr.jd.com",type:"post",path:ht,config:{withCredentials:!0},data:x});case 12:(Ht=Zt.sent).resultCode===0&&Ht.resultData&&Ht.resultData.code==="00000"&&Ht.resultData.data&&(Kt=Ht.resultData.data.goldenKeyText),ft&&ft(Kt?{code:"0",msg:"command success",data:Kt}:{code:"-1",msg:"command empty"});case 15:case"end":return Zt.stop()}}),K)})),_t=function(){var K=this,It=arguments;return new Promise((function(lt,Pt){var ft=D.apply(K,It);function At(St){pt(ft,lt,Pt,At,Et,"next",St)}function Et(St){pt(ft,lt,Pt,At,Et,"throw",St)}At(void 0)}))},_t.apply(this,arguments)}function it(D){return it=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(K){return typeof K}:function(K){return K&&typeof Symbol=="function"&&K.constructor===Symbol&&K!==Symbol.prototype?"symbol":typeof K},it(D)}function H(){H=function(){return K};var D,K={},It=Object.prototype,lt=It.hasOwnProperty,Pt=Object.defineProperty||function(y,f,m){y[f]=m.value},ft=typeof Symbol=="function"?Symbol:{},At=ft.iterator||"@@iterator",Et=ft.asyncIterator||"@@asyncIterator",St=ft.toStringTag||"@@toStringTag";function ht(y,f,m){return Object.defineProperty(y,f,{value:m,enumerable:!0,configurable:!0,writable:!0}),y[f]}try{ht({},"")}catch(y){ht=function(f,m,U){return f[m]=U}}function Kt(y,f,m,U){var I=f&&f.prototype instanceof se?f:se,q=Object.create(I.prototype),ot=new de(U||[]);return Pt(q,"_invoke",{value:Ft(y,m,ot)}),q}function x(y,f,m){try{return{type:"normal",arg:y.call(f,m)}}catch(U){return{type:"throw",arg:U}}}K.wrap=Kt;var Ht="suspendedStart",Zt="suspendedYield",Xt="executing",Nt="completed",Ct={};function se(){}function ie(){}function qt(){}var ue={};ht(ue,At,(function(){return this}));var ae=Object.getPrototypeOf,Ut=ae&&ae(ae(re([])));Ut&&Ut!==It&<.call(Ut,At)&&(ue=Ut);var Gt=qt.prototype=se.prototype=Object.create(ue);function me(y){["next","throw","return"].forEach((function(f){ht(y,f,(function(m){return this._invoke(f,m)}))}))}function te(y,f){function m(I,q,ot,vt){var mt=x(y[I],y,q);if(mt.type!=="throw"){var Wt=mt.arg,ee=Wt.value;return ee&&it(ee)=="object"&<.call(ee,"__await")?f.resolve(ee.__await).then((function(Rt){m("next",Rt,ot,vt)}),(function(Rt){m("throw",Rt,ot,vt)})):f.resolve(ee).then((function(Rt){Wt.value=Rt,ot(Wt)}),(function(Rt){return m("throw",Rt,ot,vt)}))}vt(mt.arg)}var U;Pt(this,"_invoke",{value:function(I,q){function ot(){return new f((function(vt,mt){m(I,q,vt,mt)}))}return U=U?U.then(ot,ot):ot()}})}function Ft(y,f,m){var U=Ht;return function(I,q){if(U===Xt)throw Error("Generator is already running");if(U===Nt){if(I==="throw")throw q;return{value:D,done:!0}}for(m.method=I,m.arg=q;;){var ot=m.delegate;if(ot){var vt=Mt(ot,m);if(vt){if(vt===Ct)continue;return vt}}if(m.method==="next")m.sent=m._sent=m.arg;else if(m.method==="throw"){if(U===Ht)throw U=Nt,m.arg;m.dispatchException(m.arg)}else m.method==="return"&&m.abrupt("return",m.arg);U=Xt;var mt=x(y,f,m);if(mt.type==="normal"){if(U=m.done?Nt:Zt,mt.arg===Ct)continue;return{value:mt.arg,done:m.done}}mt.type==="throw"&&(U=Nt,m.method="throw",m.arg=mt.arg)}}}function Mt(y,f){var m=f.method,U=y.iterator[m];if(U===D)return f.delegate=null,m==="throw"&&y.iterator.return&&(f.method="return",f.arg=D,Mt(y,f),f.method==="throw")||m!=="return"&&(f.method="throw",f.arg=new TypeError("The iterator does not provide a '"+m+"' method")),Ct;var I=x(U,y.iterator,f.arg);if(I.type==="throw")return f.method="throw",f.arg=I.arg,f.delegate=null,Ct;var q=I.arg;return q?q.done?(f[y.resultName]=q.value,f.next=y.nextLoc,f.method!=="return"&&(f.method="next",f.arg=D),f.delegate=null,Ct):q:(f.method="throw",f.arg=new TypeError("iterator result is not an object"),f.delegate=null,Ct)}function ne(y){var f={tryLoc:y[0]};1 in y&&(f.catchLoc=y[1]),2 in y&&(f.finallyLoc=y[2],f.afterLoc=y[3]),this.tryEntries.push(f)}function fe(y){var f=y.completion||{};f.type="normal",delete f.arg,y.completion=f}function de(y){this.tryEntries=[{tryLoc:"root"}],y.forEach(ne,this),this.reset(!0)}function re(y){if(y||y===""){var f=y[At];if(f)return f.call(y);if(typeof y.next=="function")return y;if(!isNaN(y.length)){var m=-1,U=function I(){for(;++m<y.length;)if(lt.call(y,m))return I.value=y[m],I.done=!1,I;return I.value=D,I.done=!0,I};return U.next=U}}throw new TypeError(it(y)+" is not iterable")}return ie.prototype=qt,Pt(Gt,"constructor",{value:qt,configurable:!0}),Pt(qt,"constructor",{value:ie,configurable:!0}),ie.displayName=ht(qt,St,"GeneratorFunction"),K.isGeneratorFunction=function(y){var f=typeof y=="function"&&y.constructor;return!!f&&(f===ie||(f.displayName||f.name)==="GeneratorFunction")},K.mark=function(y){return Object.setPrototypeOf?Object.setPrototypeOf(y,qt):(y.__proto__=qt,ht(y,St,"GeneratorFunction")),y.prototype=Object.create(Gt),y},K.awrap=function(y){return{__await:y}},me(te.prototype),ht(te.prototype,Et,(function(){return this})),K.AsyncIterator=te,K.async=function(y,f,m,U,I){I===void 0&&(I=Promise);var q=new te(Kt(y,f,m,U),I);return K.isGeneratorFunction(f)?q:q.next().then((function(ot){return ot.done?ot.value:q.next()}))},me(Gt),ht(Gt,St,"Generator"),ht(Gt,At,(function(){return this})),ht(Gt,"toString",(function(){return"[object Generator]"})),K.keys=function(y){var f=Object(y),m=[];for(var U in f)m.push(U);return m.reverse(),function I(){for(;m.length;){var q=m.pop();if(q in f)return I.value=q,I.done=!1,I}return I.done=!0,I}},K.values=re,de.prototype={constructor:de,reset:function(y){if(this.prev=0,this.next=0,this.sent=this._sent=D,this.done=!1,this.delegate=null,this.method="next",this.arg=D,this.tryEntries.forEach(fe),!y)for(var f in this)f.charAt(0)==="t"&<.call(this,f)&&!isNaN(+f.slice(1))&&(this[f]=D)},stop:function(){this.done=!0;var y=this.tryEntries[0].completion;if(y.type==="throw")throw y.arg;return this.rval},dispatchException:function(y){if(this.done)throw y;var f=this;function m(mt,Wt){return q.type="throw",q.arg=y,f.next=mt,Wt&&(f.method="next",f.arg=D),!!Wt}for(var U=this.tryEntries.length-1;U>=0;--U){var I=this.tryEntries[U],q=I.completion;if(I.tryLoc==="root")return m("end");if(I.tryLoc<=this.prev){var ot=lt.call(I,"catchLoc"),vt=lt.call(I,"finallyLoc");if(ot&&vt){if(this.prev<I.catchLoc)return m(I.catchLoc,!0);if(this.prev<I.finallyLoc)return m(I.finallyLoc)}else if(ot){if(this.prev<I.catchLoc)return m(I.catchLoc,!0)}else{if(!vt)throw Error("try statement without catch or finally");if(this.prev<I.finallyLoc)return m(I.finallyLoc)}}}},abrupt:function(y,f){for(var m=this.tryEntries.length-1;m>=0;--m){var U=this.tryEntries[m];if(U.tryLoc<=this.prev&<.call(U,"finallyLoc")&&this.prev<U.finallyLoc){var I=U;break}}I&&(y==="break"||y==="continue")&&I.tryLoc<=f&&f<=I.finallyLoc&&(I=null);var q=I?I.completion:{};return q.type=y,q.arg=f,I?(this.method="next",this.next=I.finallyLoc,Ct):this.complete(q)},complete:function(y,f){if(y.type==="throw")throw y.arg;return y.type==="break"||y.type==="continue"?this.next=y.arg:y.type==="return"?(this.rval=this.arg=y.arg,this.method="return",this.next="end"):y.type==="normal"&&f&&(this.next=f),Ct},finish:function(y){for(var f=this.tryEntries.length-1;f>=0;--f){var m=this.tryEntries[f];if(m.finallyLoc===y)return this.complete(m.completion,m.afterLoc),fe(m),Ct}},catch:function(y){for(var f=this.tryEntries.length-1;f>=0;--f){var m=this.tryEntries[f];if(m.tryLoc===y){var U=m.completion;if(U.type==="throw"){var I=U.arg;fe(m)}return I}}throw Error("illegal catch attempt")},delegateYield:function(y,f,m){return this.delegate={iterator:re(y),resultName:f,nextLoc:m},this.method==="next"&&(this.arg=D),Ct}},K}function wt(D,K,It,lt,Pt,ft,At){try{var Et=D[ft](At),St=Et.value}catch(ht){return void It(ht)}Et.done?K(St):Promise.resolve(St).then(lt,Pt)}function R(D){return b.apply(this,arguments)}function b(){var D;return D=H().mark((function K(It){var lt,Pt,ft;return H().wrap((function(At){for(;;)switch(At.prev=At.next){case 0:return lt=It.url,Pt=It.channel,ft=It.callback,At.next=3,tt({url:lt,channel:Pt,callback:ft});case 3:case"end":return At.stop()}}),K)})),b=function(){var K=this,It=arguments;return new Promise((function(lt,Pt){var ft=D.apply(K,It);function At(St){wt(ft,lt,Pt,At,Et,"next",St)}function Et(St){wt(ft,lt,Pt,At,Et,"throw",St)}At(void 0)}))},b.apply(this,arguments)}var F={getJrCommand:R};(l=A.hmd(l)).exports&&(l.exports=F,l.exports.getJrCommand=R),typeof window!="undefined"&&(window.LyyGetCommandSDK=F);let C=F},307:function(l,g,A){var E,L,M;function pt(rt){return pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X},pt(rt)}M=function(){"use strict";function rt(t){return(rt=typeof Symbol=="function"&&pt(Symbol.iterator)=="symbol"?function(r){return pt(r)}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":pt(r)})(t)}function X(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function kt(t,r){for(var u=0;u<r.length;u++){var c=r[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}function P(t,r,u){return r&&kt(t.prototype,r),u&&kt(t,u),t}function tt(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&&it(t,r)}function _t(t){return(_t=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(t)}function it(t,r){return(it=Object.setPrototypeOf||function(u,c){return u.__proto__=c,u})(t,r)}function H(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(u){return!1}})();return function(){var u,c=_t(t);return(function(h,_){if(_&&(pt(_)=="object"||typeof _=="function"))return _;if(_!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S})(h)})(this,r?(u=_t(this).constructor,Reflect.construct(c,arguments,u)):c.apply(this,arguments))}}function wt(t){return(function(r){if(Array.isArray(r))return R(r)})(t)||(function(r){if(typeof Symbol!="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)})(t)||(function(r,u){if(r){if(typeof r=="string")return R(r,u);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)?R(r,u):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 R(t,r){(r==null||r>t.length)&&(r=t.length);for(var u=0,c=new Array(r);u<r;u++)c[u]=t[u];return c}var b=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:A.g!==void 0?A.g:typeof self!="undefined"?self:{},F=!1,C=!1,D={console:!0,focus:!1,time:!1,length:!0,infinite:!1,time_interval:500,time_threshold:100,length_threshold:300},K=function(){typeof document!="undefined"&&document.hasFocus&&!document.hasFocus()&&(C=!0)},It=function(){var t=Date.now();Date.now()-t>D.time_threshold&&(C=!0)},lt=function(){var t=b.outerWidth,r=b.outerHeight,u=b.innerWidth,c=b.innerHeight;t&&r&&u&&c&&typeof t=="number"&&typeof r=="number"&&typeof u=="number"&&typeof c=="number"&&(t-u>D.length_threshold||r-c>D.length_threshold)&&(C=!0)};(Ft={}).start=function(t){if(!F){if(t&&rt(t)==="object")for(var r in t)D[r]=t[r];var u;D.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);')():C=!0:setInterval((function(){}),100)),D.console&&(function(){var c=new Date;c.toString=function(){for(var h=Date.now();;)if(10<Date.now()-h)return Date.now()},console.log(c),c.toString=function(){return C=!0,Date.now()}})(),D.focus&&K(),D.time&&It(),D.length&<(),u=setInterval((function(){u&&C&&clearInterval(u),D.focus&&K(),D.time&&It(),D.length&<()}),D.time_interval),F=!0}},Ft.isDebug=function(){return C};var Pt=Ft,ft=".123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-!",At={my_b4_encode:function(t){var r=0,u=(j=0)<t.length%3?3-t.length%3:0;for(r=0;r<u;r++)t[t.length]=0;var c="";for(j=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
|
|
3
|
+
`),c+=ft[t[j]>>2]+ft[(3&t[j])<<4|t[j+1]>>4]+ft[(15&t[j+1])<<2|t[j+2]>>6]+ft[63&t[j+2]];for(r=0;r<u;r++)c+=ft[64];return c},my_b4_decode:function(t){var r=0,u=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)!=ft[64])return null;var h,_,S,O,N=new Array(3*(t.length-c)/4);for(r=0,u=0;u<N.length;)h=ft.indexOf(t.charAt(r++)),_=ft.indexOf(t.charAt(r++)),S=ft.indexOf(t.charAt(r++)),O=ft.indexOf(t.charAt(r++)),N[u++]=h<<2|_>>4,N[u++]=(15&_)<<4|S>>2,N[u++]=(3&S)<<6|O;for(r=0;r<c;r++)if(N.pop()!=0)return null;return N}},Et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",St={b4_encode:function(t){var r=0,u=(j=0)<t.length%3?3-t.length%3:0;for(r=0;r<u;r++)t[t.length]=0;var c="";for(r=0;j<t.length;j+=3)0<j&&j%57==0&&(c+=`
|
|
4
|
+
`),c+=Et[t[j]>>2]+Et[(3&t[j])<<4|t[j+1]>>4]+Et[(15&t[j+1])<<2|t[j+2]>>6]+Et[63&t[j+2]];for(r=0;r<u;r++)c+="=";return c},b4_decode:function(t){var r=0,u=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 h,_,S,O,N=new Array(3*(t.length-c)/4);for(r=0,u=0;u<N.length;)h=Et.indexOf(t.charAt(r++)),_=Et.indexOf(t.charAt(r++)),S=Et.indexOf(t.charAt(r++)),O=Et.indexOf(t.charAt(r++)),N[u++]=h<<2|_>>4,N[u++]=(15&_)<<4|S>>2,N[u++]=(3&S)<<6|O;for(r=0;r<c;r++)if(N.pop()!=0)return null;return N}};function ht(){}ht.encode=function(t,r,u){for(var c=new Array(2*u),h=new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"),_=r,S=0;_<u+r;_++,S++)c[S]=h[(255&t[_])>>4],c[++S]=h[15&t[_]];return c.join("")},ht.decode=function(t){if(t==null||t==""||t.length%2!=0)return null;for(var r=t.length/2,u=ht.toCharCodeArray(t),c=new Array(r),h=0;h<r;h++){if(48<=u[2*h]&&u[2*h]<=57)c[h]=u[2*h]-48<<4;else if(65<=u[2*h]&&u[2*h]<=70)c[h]=u[2*h]-65+10<<4;else{if(!(97<=u[2*h]&&u[2*h]<=102))return null;c[h]=u[2*h]-97+10<<4}if(48<=u[2*h+1]&&u[2*h+1]<=57)c[h]=c[h]|u[2*h+1]-48;else if(65<=u[2*h+1]&&u[2*h+1]<=70)c[h]=c[h]|u[2*h+1]-65+10;else{if(!(97<=u[2*h+1]&&u[2*h+1]<=102))return null;c[h]=c[h]|u[2*h+1]-97+10}}return c},ht.toCharCodeArray=function(t){for(var r=new Array(t.length),u=0;u<t.length;u++)r[u]=t.charCodeAt(u);return r};var Kt=ht,x=Kt;(Mt=function(){}).utf8StrToh6=function(t){t=encodeURIComponent(t);for(var r=unescape(t),u=r.length,c=[],h=0;h<u;h++)c[h]=r.charCodeAt(h).toString(16);return c.join("")},Mt.utf8StrToBytes=function(t){t=encodeURIComponent(t);for(var r=unescape(t),u=r.length,c=[],h=0;h<u;h++)c[h]=r.charCodeAt(h);return c},Mt.hexToUtf8Str=function(t){for(var r=x.decode(t),u=[],c=0;c<r.length;c++)u.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(u.join("")))},Mt.bytesToUtf8Str=function(t){for(var r=t,u=[],c=0;c<r.length;c++)u.push(String.fromCharCode(r[c]));return decodeURIComponent(escape(u.join("")))},Mt.intToByte=function(t){return new Array(t>>24&255,t>>16&255,t>>8&255,255&t)},Mt.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 Ht,Zt=Mt,Xt={exports:{}};Ht=Xt,function(){function t(n,i,s){n!=null&&(typeof n=="number"?this.fromNumber(n,i,s):i==null&&typeof n!="string"?this.fromString(n,256):this.fromString(n,i))}function r(){return new t(null)}var u=(u=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(t.prototype.am=function(n,i,s,d,v,Y){for(var V=32767&i,J=i>>15;0<=--Y;){var xt=32767&this[n],$t=this[n++]>>15,ce=J*xt+$t*V;v=((xt=V*xt+((32767&ce)<<15)+s[d]+(1073741823&v))>>>30)+(ce>>>15)+J*$t+(v>>>30),s[d++]=1073741823&xt}return v},30):u&&navigator.appName!="Netscape"?(t.prototype.am=function(n,i,s,d,v,Y){for(;0<=--Y;){var V=i*this[n++]+s[d]+v;v=Math.floor(V/67108864),s[d++]=67108863&V}return v},26):(t.prototype.am=function(n,i,s,d,v,Y){for(var V=16383&i,J=i>>14;0<=--Y;){var xt=16383&this[n],$t=this[n++]>>14,ce=J*xt+$t*V;v=((xt=V*xt+((16383&ce)<<14)+s[d]+v)>>28)+(ce>>14)+J*$t,s[d++]=268435455&xt}return v},28);t.prototype.DB=u,t.prototype.DM=(1<<u)-1,t.prototype.DV=1<<u,t.prototype.FV=Math.pow(2,52),t.prototype.F1=52-u,t.prototype.F2=2*u-52;for(var c=new Array,h=48,_=0;_<=9;++_)c[h++]=_;for(h=97,_=10;_<36;++_)c[h++]=_;for(h=65,_=10;_<36;++_)c[h++]=_;function S(n){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(n)}function O(n,i){return(n=c[n.charCodeAt(i)])==null?-1:n}function N(n){var i=r();return i.fromInt(n),i}function st(n){var i,s=1;return(i=n>>>16)!=0&&(n=i,s+=16),(i=n>>8)!=0&&(n=i,s+=8),(i=n>>4)!=0&&(n=i,s+=4),(i=n>>2)!=0&&(n=i,s+=2),(i=n>>1)!=0&&(n=i,s+=1),s}function ut(n){this.m=n}function T(n){this.m=n,this.mp=n.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<n.DB-15)-1,this.mt2=2*n.t}function W(n,i){return n&i}function et(n,i){return n|i}function Z(n,i){return n^i}function ct(n,i){return n&~i}function yt(){}function Ot(n){return n}function B(n){this.r2=r(),this.q3=r(),t.ONE.dlShiftTo(2*n.t,this.r2),this.mu=this.r2.divide(n),this.m=n}ut.prototype.convert=function(n){return n.s<0||0<=n.compareTo(this.m)?n.mod(this.m):n},ut.prototype.revert=function(n){return n},ut.prototype.reduce=function(n){n.divRemTo(this.m,null,n)},ut.prototype.mulTo=function(n,i,s){n.multiplyTo(i,s),this.reduce(s)},ut.prototype.sqrTo=function(n,i){n.squareTo(i),this.reduce(i)},T.prototype.convert=function(n){var i=r();return n.abs().dlShiftTo(this.m.t,i),i.divRemTo(this.m,null,i),n.s<0&&0<i.compareTo(t.ZERO)&&this.m.subTo(i,i),i},T.prototype.revert=function(n){var i=r();return n.copyTo(i),this.reduce(i),i},T.prototype.reduce=function(n){for(;n.t<=this.mt2;)n[n.t++]=0;for(var i=0;i<this.m.t;++i){var s=32767&n[i],d=s*this.mpl+((s*this.mph+(n[i]>>15)*this.mpl&this.um)<<15)&n.DM;for(n[s=i+this.m.t]+=this.m.am(0,d,n,i,0,this.m.t);n[s]>=n.DV;)n[s]-=n.DV,n[++s]++}n.clamp(),n.drShiftTo(this.m.t,n),0<=n.compareTo(this.m)&&n.subTo(this.m,n)},T.prototype.mulTo=function(n,i,s){n.multiplyTo(i,s),this.reduce(s)},T.prototype.sqrTo=function(n,i){n.squareTo(i),this.reduce(i)},t.prototype.copyTo=function(n){for(var i=this.t-1;0<=i;--i)n[i]=this[i];n.t=this.t,n.s=this.s},t.prototype.fromInt=function(n){this.t=1,this.s=n<0?-1:0,0<n?this[0]=n:n<-1?this[0]=n+this.DV:this.t=0},t.prototype.fromString=function(n,i){var s;if(i==16)s=4;else if(i==8)s=3;else if(i==256)s=8;else if(i==2)s=1;else if(i==32)s=5;else{if(i!=4)return void this.fromRadix(n,i);s=2}this.t=0,this.s=0;for(var d=n.length,v=!1,Y=0;0<=--d;){var V=s==8?255&n[d]:O(n,d);V<0?n.charAt(d)=="-"&&(v=!0):(v=!1,Y==0?this[this.t++]=V:Y+s>this.DB?(this[this.t-1]|=(V&(1<<this.DB-Y)-1)<<Y,this[this.t++]=V>>this.DB-Y):this[this.t-1]|=V<<Y,(Y+=s)>=this.DB&&(Y-=this.DB))}s==8&&128&n[0]&&(this.s=-1,0<Y&&(this[this.t-1]|=(1<<this.DB-Y)-1<<Y)),this.clamp(),v&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var n=this.s&this.DM;0<this.t&&this[this.t-1]==n;)--this.t},t.prototype.dlShiftTo=function(n,i){for(var s=this.t-1;0<=s;--s)i[s+n]=this[s];for(s=n-1;0<=s;--s)i[s]=0;i.t=this.t+n,i.s=this.s},t.prototype.drShiftTo=function(n,i){for(var s=n;s<this.t;++s)i[s-n]=this[s];i.t=Math.max(this.t-n,0),i.s=this.s},t.prototype.lShiftTo=function(n,i){for(var s=n%this.DB,d=this.DB-s,v=(1<<d)-1,Y=Math.floor(n/this.DB),V=this.s<<s&this.DM,J=this.t-1;0<=J;--J)i[J+Y+1]=this[J]>>d|V,V=(this[J]&v)<<s;for(J=Y-1;0<=J;--J)i[J]=0;i[Y]=V,i.t=this.t+Y+1,i.s=this.s,i.clamp()},t.prototype.rShiftTo=function(n,i){i.s=this.s;var s=Math.floor(n/this.DB);if(s>=this.t)i.t=0;else{var d=n%this.DB,v=this.DB-d,Y=(1<<d)-1;i[0]=this[s]>>d;for(var V=s+1;V<this.t;++V)i[V-s-1]|=(this[V]&Y)<<v,i[V-s]=this[V]>>d;0<d&&(i[this.t-s-1]|=(this.s&Y)<<v),i.t=this.t-s,i.clamp()}},t.prototype.subTo=function(n,i){for(var s=0,d=0,v=Math.min(n.t,this.t);s<v;)d+=this[s]-n[s],i[s++]=d&this.DM,d>>=this.DB;if(n.t<this.t){for(d-=n.s;s<this.t;)d+=this[s],i[s++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;s<n.t;)d-=n[s],i[s++]=d&this.DM,d>>=this.DB;d-=n.s}i.s=d<0?-1:0,d<-1?i[s++]=this.DV+d:0<d&&(i[s++]=d),i.t=s,i.clamp()},t.prototype.multiplyTo=function(n,i){var s=this.abs(),d=n.abs(),v=s.t;for(i.t=v+d.t;0<=--v;)i[v]=0;for(v=0;v<d.t;++v)i[v+s.t]=s.am(0,d[v],i,v,0,s.t);i.s=0,i.clamp(),this.s!=n.s&&t.ZERO.subTo(i,i)},t.prototype.squareTo=function(n){for(var i=this.abs(),s=n.t=2*i.t;0<=--s;)n[s]=0;for(s=0;s<i.t-1;++s){var d=i.am(s,i[s],n,2*s,0,1);(n[s+i.t]+=i.am(s+1,2*i[s],n,2*s+1,d,i.t-s-1))>=i.DV&&(n[s+i.t]-=i.DV,n[s+i.t+1]=1)}0<n.t&&(n[n.t-1]+=i.am(s,i[s],n,2*s,0,1)),n.s=0,n.clamp()},t.prototype.divRemTo=function(n,i,s){var d=n.abs();if(!(d.t<=0)){if(($t=this.abs()).t<d.t)return i!=null&&i.fromInt(0),void(s!=null&&this.copyTo(s));s==null&&(s=r());var v=r(),Y=this.s,V=n.s;0<(n=this.DB-st(d[d.t-1]))?(d.lShiftTo(n,v),$t.lShiftTo(n,s)):(d.copyTo(v),$t.copyTo(s));var J=v.t,xt=v[J-1];if(xt!=0){var $t=xt*(1<<this.F1)+(1<J?v[J-2]>>this.F2:0),ce=this.FV/$t,ye=(1<<this.F1)/$t,Se=1<<this.F2,Vt=s.t,Ae=Vt-J,jt=i==null?r():i;for(v.dlShiftTo(Ae,jt),0<=s.compareTo(jt)&&(s[s.t++]=1,s.subTo(jt,s)),t.ONE.dlShiftTo(J,jt),jt.subTo(v,v);v.t<J;)v[v.t++]=0;for(;0<=--Ae;){var nn=s[--Vt]==xt?this.DM:Math.floor(s[Vt]*ce+(s[Vt-1]+Se)*ye);if((s[Vt]+=v.am(0,nn,s,Ae,0,J))<nn)for(v.dlShiftTo(Ae,jt),s.subTo(jt,s);s[Vt]<--nn;)s.subTo(jt,s)}i!=null&&(s.drShiftTo(J,i),Y!=V&&t.ZERO.subTo(i,i)),s.t=J,s.clamp(),0<n&&s.rShiftTo(n,s),Y<0&&t.ZERO.subTo(s,s)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var n=this[0];if(!(1&n))return 0;var i=3&n;return 0<(i=(i=(i=(i=i*(2-(15&n)*i)&15)*(2-(255&n)*i)&255)*(2-((65535&n)*i&65535))&65535)*(2-n*i%this.DV)%this.DV)?this.DV-i:-i},t.prototype.isEven=function(){return(0<this.t?1&this[0]:this.s)==0},t.prototype.exp=function(n,i){if(4294967295<n||n<1)return t.ONE;var s,d=r(),v=r(),Y=i.convert(this),V=st(n)-1;for(Y.copyTo(d);0<=--V;)i.sqrTo(d,v),0<(n&1<<V)?i.mulTo(v,Y,d):(s=d,d=v,v=s);return i.revert(d)},t.prototype.toString=function(n){if(this.s<0)return"-"+this.negate().toString(n);var i;if(n==16)i=4;else if(n==8)i=3;else if(n==2)i=1;else if(n==32)i=5;else{if(n!=4)return this.toRadix(n);i=2}var s,d=(1<<i)-1,v=!1,Y="",V=this.t,J=this.DB-V*this.DB%i;if(0<V--)for(J<this.DB&&0<(s=this[V]>>J)&&(v=!0,Y=S(s));0<=V;)J<i?(s=(this[V]&(1<<J)-1)<<i-J,s|=this[--V]>>(J+=this.DB-i)):(s=this[V]>>(J-=i)&d,J<=0&&(J+=this.DB,--V)),(v=0<s||v)&&(Y+=S(s));return v?Y:"0"},t.prototype.negate=function(){var n=r();return t.ZERO.subTo(this,n),n},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(n){var i=this.s-n.s;if(i!=0)return i;var s=this.t;if((i=s-n.t)!=0)return this.s<0?-i:i;for(;0<=--s;)if((i=this[s]-n[s])!=0)return i;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+st(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(n){var i=r();return this.abs().divRemTo(n,null,i),this.s<0&&0<i.compareTo(t.ZERO)&&n.subTo(i,i),i},t.prototype.modPowInt=function(n,i){return i=new(n<256||i.isEven()?ut:T)(i),this.exp(n,i)},t.ZERO=N(0),t.ONE=N(1),yt.prototype.convert=Ot,yt.prototype.revert=Ot,yt.prototype.mulTo=function(n,i,s){n.multiplyTo(i,s)},yt.prototype.sqrTo=function(n,i){n.squareTo(i)},B.prototype.convert=function(n){if(n.s<0||n.t>2*this.m.t)return n.mod(this.m);if(n.compareTo(this.m)<0)return n;var i=r();return n.copyTo(i),this.reduce(i),i},B.prototype.revert=function(n){return n},B.prototype.reduce=function(n){for(n.drShiftTo(this.m.t-1,this.r2),n.t>this.m.t+1&&(n.t=this.m.t+1,n.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);n.compareTo(this.r2)<0;)n.dAddOffset(1,this.m.t+1);for(n.subTo(this.r2,n);0<=n.compareTo(this.m);)n.subTo(this.m,n)},B.prototype.mulTo=function(n,i,s){n.multiplyTo(i,s),this.reduce(s)},B.prototype.sqrTo=function(n,i){n.squareTo(i),this.reduce(i)};var $,G=[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],Q=(1<<26)/G[G.length-1];function z(){var n;n=new Date().getTime(),Dt[nt++]^=255&n,Dt[nt++]^=n>>8&255,Dt[nt++]^=n>>16&255,Dt[nt++]^=n>>24&255,en<=nt&&(nt-=en)}if(t.prototype.chunkSize=function(n){return Math.floor(Math.LN2*this.DB/Math.log(n))},t.prototype.toRadix=function(n){if(n==null&&(n=10),this.signum()==0||n<2||36<n)return"0";var i=this.chunkSize(n),s=Math.pow(n,i),d=N(s),v=r(),Y=r(),V="";for(this.divRemTo(d,v,Y);0<v.signum();)V=(s+Y.intValue()).toString(n).substr(1)+V,v.divRemTo(d,v,Y);return Y.intValue().toString(n)+V},t.prototype.fromRadix=function(n,i){this.fromInt(0);for(var s=this.chunkSize(i=i==null?10:i),d=Math.pow(i,s),v=!1,Y=0,V=0,J=0;J<n.length;++J){var xt=O(n,J);xt<0?n.charAt(J)=="-"&&this.signum()==0&&(v=!0):(V=i*V+xt,++Y>=s&&(this.dMultiply(d),this.dAddOffset(V,0),V=Y=0))}0<Y&&(this.dMultiply(Math.pow(i,Y)),this.dAddOffset(V,0)),v&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(n,i,s){if(typeof i=="number")if(n<2)this.fromInt(1);else for(this.fromNumber(n,s),this.testBit(n-1)||this.bitwiseTo(t.ONE.shiftLeft(n-1),et,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(i);)this.dAddOffset(2,0),this.bitLength()>n&&this.subTo(t.ONE.shiftLeft(n-1),this);else{var d=new Array;s=7&n,d.length=1+(n>>3),i.nextBytes(d),0<s?d[0]&=(1<<s)-1:d[0]=0,this.fromString(d,256)}},t.prototype.bitwiseTo=function(n,i,s){for(var d,v=Math.min(n.t,this.t),Y=0;Y<v;++Y)s[Y]=i(this[Y],n[Y]);if(n.t<this.t){for(d=n.s&this.DM,Y=v;Y<this.t;++Y)s[Y]=i(this[Y],d);s.t=this.t}else{for(d=this.s&this.DM,Y=v;Y<n.t;++Y)s[Y]=i(d,n[Y]);s.t=n.t}s.s=i(this.s,n.s),s.clamp()},t.prototype.changeBit=function(n,i){return n=t.ONE.shiftLeft(n),this.bitwiseTo(n,i,n),n},t.prototype.addTo=function(n,i){for(var s=0,d=0,v=Math.min(n.t,this.t);s<v;)d+=this[s]+n[s],i[s++]=d&this.DM,d>>=this.DB;if(n.t<this.t){for(d+=n.s;s<this.t;)d+=this[s],i[s++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;s<n.t;)d+=n[s],i[s++]=d&this.DM,d>>=this.DB;d+=n.s}i.s=d<0?-1:0,0<d?i[s++]=d:d<-1&&(i[s++]=this.DV+d),i.t=s,i.clamp()},t.prototype.dMultiply=function(n){this[this.t]=this.am(0,n-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(n,i){if(n!=0){for(;this.t<=i;)this[this.t++]=0;for(this[i]+=n;this[i]>=this.DV;)this[i]-=this.DV,++i>=this.t&&(this[this.t++]=0),++this[i]}},t.prototype.multiplyLowerTo=function(n,i,s){var d,v=Math.min(this.t+n.t,i);for(s.s=0,s.t=v;0<v;)s[--v]=0;for(d=s.t-this.t;v<d;++v)s[v+this.t]=this.am(0,n[v],s,v,0,this.t);for(d=Math.min(n.t,i);v<d;++v)this.am(0,n[v],s,v,0,i-v);s.clamp()},t.prototype.multiplyUpperTo=function(n,i,s){var d=s.t=this.t+n.t- --i;for(s.s=0;0<=--d;)s[d]=0;for(d=Math.max(i-this.t,0);d<n.t;++d)s[this.t+d-i]=this.am(i-d,n[d],s,0,0,this.t+d-i);s.clamp(),s.drShiftTo(1,s)},t.prototype.modInt=function(n){if(n<=0)return 0;var i=this.DV%n,s=this.s<0?n-1:0;if(0<this.t)if(i==0)s=this[0]%n;else for(var d=this.t-1;0<=d;--d)s=(i*s+this[d])%n;return s},t.prototype.millerRabin=function(n){var i=this.subtract(t.ONE),s=i.getLowestSetBit();if(s<=0)return!1;var d=i.shiftRight(s);G.length<(n=n+1>>1)&&(n=G.length);for(var v=r(),Y=0;Y<n;++Y){v.fromInt(G[Math.floor(Math.random()*G.length)]);var V=v.modPow(d,this);if(V.compareTo(t.ONE)!=0&&V.compareTo(i)!=0){for(var J=1;J++<s&&V.compareTo(i)!=0;)if((V=V.modPowInt(2,this)).compareTo(t.ONE)==0)return!1;if(V.compareTo(i)!=0)return!1}}return!0},t.prototype.clone=function(){var n=r();return this.copyTo(n),n},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 n=this.t,i=new Array;i[0]=this.s;var s,d=this.DB-n*this.DB%8,v=0;if(0<n--)for(d<this.DB&&(s=this[n]>>d)!=(this.s&this.DM)>>d&&(i[v++]=s|this.s<<this.DB-d);0<=n;)d<8?(s=(this[n]&(1<<d)-1)<<8-d,s|=this[--n]>>(d+=this.DB-8)):(s=this[n]>>(d-=8)&255,d<=0&&(d+=this.DB,--n)),128&s&&(s|=-256),v==0&&(128&this.s)!=(128&s)&&++v,(0<v||s!=this.s)&&(i[v++]=s);return i},t.prototype.equals=function(n){return this.compareTo(n)==0},t.prototype.min=function(n){return this.compareTo(n)<0?this:n},t.prototype.max=function(n){return 0<this.compareTo(n)?this:n},t.prototype.and=function(n){var i=r();return this.bitwiseTo(n,W,i),i},t.prototype.or=function(n){var i=r();return this.bitwiseTo(n,et,i),i},t.prototype.xor=function(n){var i=r();return this.bitwiseTo(n,Z,i),i},t.prototype.andNot=function(n){var i=r();return this.bitwiseTo(n,ct,i),i},t.prototype.not=function(){for(var n=r(),i=0;i<this.t;++i)n[i]=this.DM&~this[i];return n.t=this.t,n.s=~this.s,n},t.prototype.shiftLeft=function(n){var i=r();return n<0?this.rShiftTo(-n,i):this.lShiftTo(n,i),i},t.prototype.shiftRight=function(n){var i=r();return n<0?this.lShiftTo(-n,i):this.rShiftTo(n,i),i},t.prototype.getLowestSetBit=function(){for(var n=0;n<this.t;++n)if(this[n]!=0)return n*this.DB+(function(i){if(i==0)return-1;var s=0;return!(65535&i)&&(i>>=16,s+=16),!(255&i)&&(i>>=8,s+=8),!(15&i)&&(i>>=4,s+=4),!(3&i)&&(i>>=2,s+=2),!(1&i)&&++s,s})(this[n]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var n=0,i=this.s&this.DM,s=0;s<this.t;++s)n+=(function(d){for(var v=0;d!=0;)d&=d-1,++v;return v})(this[s]^i);return n},t.prototype.testBit=function(n){var i=Math.floor(n/this.DB);return i>=this.t?this.s!=0:!!(this[i]&1<<n%this.DB)},t.prototype.setBit=function(n){return this.changeBit(n,et)},t.prototype.clearBit=function(n){return this.changeBit(n,ct)},t.prototype.flipBit=function(n){return this.changeBit(n,Z)},t.prototype.add=function(n){var i=r();return this.addTo(n,i),i},t.prototype.subtract=function(n){var i=r();return this.subTo(n,i),i},t.prototype.multiply=function(n){var i=r();return this.multiplyTo(n,i),i},t.prototype.divide=function(n){var i=r();return this.divRemTo(n,i,null),i},t.prototype.remainder=function(n){var i=r();return this.divRemTo(n,null,i),i},t.prototype.divideAndRemainder=function(n){var i=r(),s=r();return this.divRemTo(n,i,s),new Array(i,s)},t.prototype.modPow=function(n,i){var s=n.bitLength(),d=N(1);if(s<=0)return d;var v=s<18?1:s<48?3:s<144?4:s<768?5:6,Y=new(s<8?ut:i.isEven()?B:T)(i),V=new Array,J=3,xt=v-1,$t=(1<<v)-1;if(V[1]=Y.convert(this),1<v){var ce=r();for(Y.sqrTo(V[1],ce);J<=$t;)V[J]=r(),Y.mulTo(ce,V[J-2],V[J]),J+=2}var ye,Se,Vt=n.t-1,Ae=!0,jt=r();for(s=st(n[Vt])-1;0<=Vt;){for(xt<=s?ye=n[Vt]>>s-xt&$t:(ye=(n[Vt]&(1<<s+1)-1)<<xt-s,0<Vt&&(ye|=n[Vt-1]>>this.DB+s-xt)),J=v;!(1&ye);)ye>>=1,--J;if((s-=J)<0&&(s+=this.DB,--Vt),Ae)V[ye].copyTo(d),Ae=!1;else{for(;1<J;)Y.sqrTo(d,jt),Y.sqrTo(jt,d),J-=2;0<J?Y.sqrTo(d,jt):(Se=d,d=jt,jt=Se),Y.mulTo(jt,V[ye],d)}for(;0<=Vt&&!(n[Vt]&1<<s);)Y.sqrTo(d,jt),Se=d,d=jt,jt=Se,--s<0&&(s=this.DB-1,--Vt)}return Y.revert(d)},t.prototype.modInverse=function(n){var i=n.isEven();if(this.isEven()&&i||n.signum()==0)return t.ZERO;for(var s=n.clone(),d=this.clone(),v=N(1),Y=N(0),V=N(0),J=N(1);s.signum()!=0;){for(;s.isEven();)s.rShiftTo(1,s),i?(v.isEven()&&Y.isEven()||(v.addTo(this,v),Y.subTo(n,Y)),v.rShiftTo(1,v)):Y.isEven()||Y.subTo(n,Y),Y.rShiftTo(1,Y);for(;d.isEven();)d.rShiftTo(1,d),i?(V.isEven()&&J.isEven()||(V.addTo(this,V),J.subTo(n,J)),V.rShiftTo(1,V)):J.isEven()||J.subTo(n,J),J.rShiftTo(1,J);0<=s.compareTo(d)?(s.subTo(d,s),i&&v.subTo(V,v),Y.subTo(J,Y)):(d.subTo(s,d),i&&V.subTo(v,V),J.subTo(Y,J))}return d.compareTo(t.ONE)!=0?t.ZERO:0<=J.compareTo(n)?J.subtract(n):J.signum()<0?(J.addTo(n,J),J.signum()<0?J.add(n):J):J},t.prototype.pow=function(n){return this.exp(n,new yt)},t.prototype.gcd=function(n){var i=this.s<0?this.negate():this.clone(),s=n.s<0?n.negate():n.clone();i.compareTo(s)<0&&(v=i,i=s,s=v);var d=i.getLowestSetBit(),v=s.getLowestSetBit();if(v<0)return i;for(0<(v=d<v?d:v)&&(i.rShiftTo(v,i),s.rShiftTo(v,s));0<i.signum();)0<(d=i.getLowestSetBit())&&i.rShiftTo(d,i),0<(d=s.getLowestSetBit())&&s.rShiftTo(d,s),0<=i.compareTo(s)?(i.subTo(s,i),i.rShiftTo(1,i)):(s.subTo(i,s),s.rShiftTo(1,s));return 0<v&&s.lShiftTo(v,s),s},t.prototype.isProbablePrime=function(n){var i,s=this.abs();if(s.t==1&&s[0]<=G[G.length-1]){for(i=0;i<G.length;++i)if(s[0]==G[i])return!0;return!1}if(s.isEven())return!1;for(i=1;i<G.length;){for(var d=G[i],v=i+1;v<G.length&&d<Q;)d*=G[v++];for(d=s.modInt(d);i<v;)if(d%G[i++]==0)return!1}return s.millerRabin(n)},t.prototype.square=function(){var n=r();return this.squareTo(n),n},t.prototype.Barrett=B,Dt==null){var Dt=new Array,nt=0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var Tt=new Uint8Array(32);for(window.crypto.getRandomValues(Tt),Jt=0;Jt<32;++Jt)Dt[nt++]=Tt[Jt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var Lt=window.crypto.random(32),Jt=0;Jt<Lt.length;++Jt)Dt[nt++]=255&Lt.charCodeAt(Jt)}for(;nt<en;)Jt=Math.floor(65536*Math.random()),Dt[nt++]=Jt>>>8,Dt[nt++]=255&Jt;nt=0,z()}function Ze(){if($==null){for(z(),($=new tn).init(Dt),nt=0;nt<Dt.length;++nt)Dt[nt]=0;nt=0}return $.next()}function wn(){}function tn(){this.i=0,this.j=0,this.S=new Array}wn.prototype.nextBytes=function(n){for(var i=0;i<n.length;++i)n[i]=Ze()},tn.prototype.init=function(n){for(var i,s,d=0;d<256;++d)this.S[d]=d;for(d=i=0;d<256;++d)i=i+this.S[d]+n[d%n.length]&255,s=this.S[d],this.S[d]=this.S[i],this.S[i]=s;this.i=0,this.j=0},tn.prototype.next=function(){var n;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,n=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=n,this.S[n+this.S[this.i]&255]};var en=256;Ht.exports={default:t,BigInteger:t,SecureRandom:wn}}.call(b);var Nt=Xt.exports.BigInteger,Ct=(function(){function t(){X(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return P(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,u=r.toString(16);return u.length%2==1&&(u="0"+u),r<128?u:(128+u.length/2).toString(16)+u}},{key:"getValue",value:function(){return""}}]),t})(),se=(function(){tt(r,Ct);var t=H(r);function r(u){var c;return X(this,r),(c=t.call(this)).t="02",u&&(c.v=(function(h){if((_=h.toString(16))[0]!=="-")_.length%2==1?_="0"+_:_.match(/^[0-7]/)||(_="00"+_);else{var _,S=(_=_.substr(1)).length;S%2==1?S+=1:_.match(/^[0-7]/)||(S+=2);for(var O="",N=0;N<S;N++)O+="f";_=(_=(O=new Nt(O,16)).xor(h).add(Nt.ONE)).toString(16).replace(/^-/,"")}return _})(u)),c}return P(r,[{key:"getValue",value:function(){return this.v}}]),r})(),ie=(function(){tt(r,Ct);var t=H(r);function r(u){var c;return X(this,r),(c=t.call(this)).t="30",c.asn1Array=u,c}return P(r,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(u){return u.getEncodedHex()})).join(""),this.v}}]),r})();function qt(t,r){return+t[r+2]<8?1:128&+t.substr(r+2,2)}function ue(t,r){var u=qt(t,r);return(t=t.substr(r+2,2*u))?(+t[0]<8?new Nt(t,16):new Nt(t.substr(2),16)).intValue():-1}function ae(t,r){return r+2*(qt(t,r)+1)}var Ut=Xt.exports.BigInteger,Gt=new Ut("3"),me=(function(){function t(r,u){X(this,t),this.x=u,this.q=r}return P(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})(),te=(function(){function t(r,u,c,h){X(this,t),this.curve=r,this.x=u,this.y=c,this.z=h==null?Ut.ONE:h,this.zinv=null}return P(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(Ut.ZERO)&&r.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(r.z)).mod(this.curve.q).equals(Ut.ZERO))}},{key:"isInfinity",value:function(){return this.x===null&&this.y===null||this.z.equals(Ut.ZERO)&&!this.y.toBigInteger().equals(Ut.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 u=this.x.toBigInteger(),c=this.y.toBigInteger(),h=this.z,_=r.x.toBigInteger(),S=r.y.toBigInteger(),O=r.z,N=this.curve.q,st=u.multiply(O).mod(N);return r=_.multiply(h).mod(N),u=st.subtract(r),_=c.multiply(O).mod(N),c=S.multiply(h).mod(N),S=_.subtract(c),Ut.ZERO.equals(u)?Ut.ZERO.equals(S)?this.twice():this.curve.infinity:(c=st.add(r),r=h.multiply(O).mod(N),O=u.square().mod(N),h=u.multiply(O).mod(N),c=r.multiply(S.square()).subtract(c.multiply(O)).mod(N),u=u.multiply(c).mod(N),_=S.multiply(O.multiply(st).subtract(c)).subtract(_.multiply(h)).mod(N),N=h.multiply(r).mod(N),new t(this.curve,this.curve.fromBigInteger(u),this.curve.fromBigInteger(_),N))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var r=this.x.toBigInteger(),u=this.y.toBigInteger(),c=this.z,h=this.curve.q,_=this.curve.a.toBigInteger(),S=r.square().multiply(Gt).add(_.multiply(c.square())).mod(h),O=u.shiftLeft(1).multiply(c).mod(h),N=(_=(N=u.square().mod(h)).multiply(r).multiply(c).mod(h),u=O.square().mod(h),r=S.square().subtract(_.shiftLeft(3)).mod(h),c=O.multiply(r).mod(h),S.multiply(_.shiftLeft(2).subtract(r)).subtract(u.shiftLeft(1).multiply(N)).mod(h));return h=O.multiply(u).mod(h),new t(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(N),h)}},{key:"multiply",value:function(r){if(this.isInfinity())return this;if(!r.signum())return this.curve.infinity;for(var u=r.multiply(Gt),c=this.negate(),h=this,_=u.bitLength()-2;0<_;_--){h=h.twice();var S=u.testBit(_);S!==r.testBit(_)&&(h=h.add(S?this:c))}return h}}]),t})(),Ft=(function(){function t(r,u,c){X(this,t),this.q=r,this.a=this.fromBigInteger(u),this.b=this.fromBigInteger(c),this.infinity=new te(this,null,null)}return P(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 me(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 u=(r.length-2)/2,c=r.substr(2,u);return u=r.substr(2+u,u),new te(this,this.fromBigInteger(new Ut(c,16)),this.fromBigInteger(new Ut(u,16)))}}}]),t})(),Mt={ECPointFp:te,ECCurveFp:Ft},ne=Xt.exports.BigInteger,fe=(Ft=Xt.exports.SecureRandom,Mt.ECCurveFp),de=new Ft,re=(Mt=m()).curve,y=Mt.G,f=Mt.n;function m(){var t=new ne("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),r=new ne("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),u=new ne("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return u=(r=new fe(t,r,u)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:r,G:u,n:new ne("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function U(t,r){return t.length>=r?t:new Array(r-t.length+1).join("0")+t}function I(t,r){for(var u=[],c=~~(r/8),h=r%8,_=0,S=t.length;_<S;_++)u[_]=(t[(_+c)%S]<<h&255)+(t[(_+c+1)%S]>>>8-h&255);return u}function q(t,r){for(var u=[],c=t.length-1;0<=c;c--)u[c]=255&(t[c]^r[c]);return u}function ot(t,r){for(var u=[],c=t.length-1;0<=c;c--)u[c]=t[c]&r[c]&255;return u}function vt(t,r){for(var u=[],c=t.length-1;0<=c;c--)u[c]=255&(t[c]|r[c]);return u}function mt(t,r){for(var u=[],c=0,h=t.length-1;0<=h;h--){var _=t[h]+r[h]+c;c=255<_?1:0,u[h]=255&_}return u}function Wt(t,r,u,c){return 0<=c&&c<=15?q(q(t,r),u):vt(ot(t,r),ot((function(h){for(var _=[],S=h.length-1;0<=S;S--)_[S]=255&~h[S];return _})(t),u))}function ee(t,r){for(var u=[],c=[],h=0;h<16;h++){var _=4*h;u.push(r.slice(_,4+_))}for(var S,O=16;O<68;O++)u.push(q(q((S=q(q(u[O-16],u[O-9]),I(u[O-3],15)),q(q(S,I(S,15)),I(S,23))),I(u[O-13],7)),u[O-6]));for(var N=0;N<64;N++)c.push(q(u[N],u[N+4]));for(var st,ut,T,W=[121,204,69,25],et=[122,135,157,138],Z=t.slice(0,4),ct=t.slice(4,8),yt=t.slice(8,12),Ot=t.slice(12,16),B=t.slice(16,20),$=t.slice(20,24),G=t.slice(24,28),Q=t.slice(28,32),z=0;z<64;z++){var Dt=0<=z&&z<=15?W:et,nt=q(Tt=I(mt(mt(I(Z,12),B),I(Dt,z)),7),I(Z,12)),Tt=(nt=mt(mt(mt((st=Z,ut=ct,T=yt,0<=(Dt=z)&&Dt<=15?q(q(st,ut),T):vt(vt(ot(st,ut),ot(st,T)),ot(ut,T))),Ot),nt),c[z]),mt(mt(mt(Wt(B,$,G,z),Q),Tt),u[z]));Ot=yt,yt=I(ct,9),ct=Z,Z=nt,Q=G,G=I($,19),$=B,B=q(q(Tt,I(Tt,9)),I(Tt,17))}return q([].concat(Z,ct,yt,Ot,B,$,G,Q),t)}Ft={getGlobalCurve:function(){return re},generateEcparam:m,generateKeyPairHex:function(t,r,u){return{privateKey:u=U((r=(t?new ne(t,r,u):new ne(f.bitLength(),de)).mod(f.subtract(ne.ONE)).add(ne.ONE)).toString(16),64),publicKey:"04"+U((r=y.multiply(r)).getX().toBigInteger().toString(16),64)+U(r.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(t){for(var r=(t=unescape(encodeURIComponent(t))).length,u=[],c=0;c<r;c++)u[c>>>2]|=(255&t.charCodeAt(c))<<24-c%4*8;for(var h=[],_=0;_<r;_++){var S=u[_>>>2]>>>24-_%4*8&255;h.push((S>>>4).toString(16)),h.push((15&S).toString(16))}return h.join("")},leftPad:U,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=[],u=0,c=0;c<2*t.length;c+=2)r[c>>>3]|=parseInt(t[u],10)<<24-c%8*4,u++;try{for(var h=[],_=0;_<t.length;_++){var S=r[_>>>2]>>>24-_%4*8&255;h.push(String.fromCharCode(S))}return decodeURIComponent(escape(h.join("")))}catch(O){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){for(var r=[],u=(t=(u=t.length)%2!=0?U(t,u+1):t).length,c=0;c<u;c+=2)r.push(parseInt(t.substr(c,2),16));return r},verifyPublicKey:function(t){var r=re.decodePointHex(t);return!!r&&(t=r.getX(),r.getY().square().equals(t.multiply(t.square()).add(t.multiply(re.a)).add(re.b)))}},Mt=function(t){for(var r=448<=(r=(O=8*t.length)%512)?512-r%448-1:448-r-1,u=new Array((r-7)/8),c=0,h=u.length;c<h;c++)u[c]=0;for(var _,S=[],O=O.toString(2),N=7;0<=N;N--)8<O.length?(_=O.length-8,S[N]=parseInt(O.substr(_),2),O=O.substr(0,_)):0<O.length?(S[N]=parseInt(O,2),O=""):S[N]=0;for(var st=[].concat(t,[128],u,S),ut=st.length/64,T=[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],W=0;W<ut;W++){var et=64*W;T=ee(T,st.slice(et,64+et))}return T};var Rt=Xt.exports.BigInteger,Pr=function(t,r){return t=new se(t),r=new se(r),new ie([t,r]).getEncodedHex()},Er=function(t){var r=ae(t,0),u=ae(t,r),c=ue(t,r);return r=t.substr(u,2*c),u=ae(t,c=u+r.length),c=ue(t,c),t=t.substr(u,2*c),{r:new Nt(r,16),s:new Nt(t,16)}},dt=Ft,ve=Mt,Ie=(Ft=dt.generateEcparam()).G,Pn=Ft.curve,Pe=Ft.n;function En(t,r,u){var c=2<arguments.length&&u!==void 0?u:"1234567812345678",h=(c=dt.utf8ToHex(c),dt.leftPad(Ie.curve.a.toBigInteger().toRadix(16),64)),_=dt.leftPad(Ie.curve.b.toBigInteger().toRadix(16),64),S=dt.leftPad(Ie.getX().toBigInteger().toRadix(16),64),O=dt.leftPad(Ie.getY().toBigInteger().toRadix(16),64);return u=(r=128<r.length?r.substr(2,128):r).substr(0,64),r=r.substr(64,64),r=dt.hexToArray(c+h+_+S+O+u+r),c=4*c.length,r.unshift(255&c),r.unshift(c>>8&255),r=ve(r),dt.arrayToHex(ve(r.concat(dt.hexToArray(t))))}function Sn(){var t=dt.generateKeyPairHex(),r=Pn.decodePointHex(t.publicKey);return t.k=new Rt(t.privateKey,16),t.x1=r.getX().toBigInteger(),t}Ft={generateKeyPairHex:dt.generateKeyPairHex,doEncrypt:function(t,r){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;t=typeof t=="string"?dt.hexToArray(dt.utf8ToHex(t)):Array.prototype.slice.call(t),r=dt.getGlobalCurve().decodePointHex(r);var c=dt.generateKeyPairHex(),h=new Rt(c.privateKey,16),_=c.publicKey;128<_.length&&(_=_.substr(_.length-128)),c=r.multiply(h),h=dt.hexToArray(dt.leftPad(c.getX().toBigInteger().toRadix(16),64)),r=dt.hexToArray(dt.leftPad(c.getY().toBigInteger().toRadix(16),64)),c=dt.arrayToHex(ve([].concat(h,t,r)));var S,O=1,N=0,st=[],ut=[].concat(h,r);(S=function(){st=ve([].concat(wt(ut),[O>>24&255,O>>16&255,O>>8&255,255&O])),O++,N=0})();for(var T=0,W=t.length;T<W;T++)N===st.length&&S(),t[T]^=255&st[N++];return r=dt.arrayToHex(t),u===0?_+r+c:_+c+r},doDecrypt:function(t,r){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,c=(_=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":_;r=new Rt(r,16);var h=t.substr(128,64),_=t.substr(192);u===0&&(h=t.substr(t.length-64),_=t.substr(128,t.length-128-64));var S,O=dt.hexToArray(_),N=(t=dt.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(r),r=dt.hexToArray(dt.leftPad(t.getX().toBigInteger().toRadix(16),64)),t=dt.hexToArray(dt.leftPad(t.getY().toBigInteger().toRadix(16),64)),1),st=0,ut=[],T=[].concat(r,t);(S=function(){ut=ve([].concat(wt(T),[N>>24&255,N>>16&255,N>>8&255,255&N])),N++,st=0})();for(var W=0,et=O.length;W<et;W++)st===ut.length&&S(),O[W]^=255&ut[st++];return dt.arrayToHex(ve([].concat(r,O,t)))===h?c==="array"?O:dt.arrayToUtf8(O):c==="array"?[]:""},doSignature:function(t,r){var u=(O=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,c=O.der,h=O.hash,_=O.publicKey,S=O.userId,O=typeof t=="string"?dt.utf8ToHex(t):dt.arrayToHex(t);h&&(O=En(O,_||(t=r,h=Ie.multiply(new Rt(t,16)),"04"+(t=dt.leftPad(h.getX().toBigInteger().toString(16),64))+(h=dt.leftPad(h.getY().toBigInteger().toString(16),64))),S));var N=new Rt(r,16),st=new Rt(O,16),ut=null,T=null,W=null;do do{var et;ut=(et=u&&u.length?u.pop():Sn()).k,T=st.add(et.x1).mod(Pe)}while(T.equals(Rt.ZERO)||T.add(ut).equals(Pe));while((W=N.add(Rt.ONE).modInverse(Pe).multiply(ut.subtract(T.multiply(N))).mod(Pe)).equals(Rt.ZERO));return c?Pr(T,W):dt.leftPad(T.toString(16),64)+dt.leftPad(W.toString(16),64)},doVerifySignature:function(t,r,u){var c,h,_=(O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,S=O.hash,O=O.userId;return t=typeof t=="string"?dt.utf8ToHex(t):dt.arrayToHex(t),S&&(t=En(t,u,O)),h=_?(c=(h=Er(r)).r,h.s):(c=new Rt(r.substring(0,64),16),new Rt(r.substring(64),16)),r=Pn.decodePointHex(u),u=new Rt(t,16),!(t=c.add(h).mod(Pe)).equals(Rt.ZERO)&&(r=Ie.multiply(h).add(r.multiply(t)),u=u.add(r.getX().toBigInteger()).mod(Pe),c.equals(u))},getPoint:Sn,verifyPublicKey:dt.verifyPublicKey};var Sr=Mt,Ue=[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],Me=[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 ze(t){for(var r=[],u=0,c=t.length;u<c;u+=2)r.push(parseInt(t.substr(u,2),16));return r}function Ee(t,r){return t<<r|t>>>32-r}function he(t){return(255&Ue[t>>>24&255])<<24|(255&Ue[t>>>16&255])<<16|(255&Ue[t>>>8&255])<<8|255&Ue[255&t]}function Je(t){return t^Ee(t,2)^Ee(t,10)^Ee(t,18)^Ee(t,24)}function ke(t){return t^Ee(t,13)^Ee(t,23)}function Rn(t,r,u,c){c=(_=(S=3<arguments.length&&c!==void 0?c:{}).padding)===void 0?"pkcs#5":_;var h=S.mode,_=(_=S.iv)===void 0?[]:_,S=(S=S.output)===void 0?"string":S;if(h==="cbc"&&(_=typeof _=="string"?ze(_):_).length!==16)throw new Error("iv is invalid");if((r=typeof r=="string"?ze(r):r).length!==16)throw new Error("key is invalid");if(t=(typeof t=="string"?u!==0?function(B){for(var $=[],G=0,Q=B.length;G<Q;G++){var z=B.codePointAt(G);if(z<=127)$.push(z);else if(z<=2047)$.push(192|z>>>6),$.push(128|63&z);else if(z<=55295||57344<=z&&z<=65535)$.push(224|z>>>12),$.push(128|z>>>6&63),$.push(128|63&z);else{if(!(65536<=z&&z<=1114111))throw $.push(z),new Error("input is not supported");G++,$.push(240|z>>>18&28),$.push(128|z>>>12&63),$.push(128|z>>>6&63),$.push(128|63&z)}}return $}:ze:wt)(t),c==="pkcs#5"&&u!==0)for(var O=16-t.length%16,N=0;N<O;N++)t.push(O);var st=new Array(32);(function(B,$,G){for(var Q=new Array(4),z=new Array(4),Dt=0;Dt<4;Dt++)z[0]=255&B[0+4*Dt],z[1]=255&B[1+4*Dt],z[2]=255&B[2+4*Dt],z[3]=255&B[3+4*Dt],Q[Dt]=z[0]<<24|z[1]<<16|z[2]<<8|z[3];Q[0]^=2746333894,Q[1]^=1453994832,Q[2]^=1736282519,Q[3]^=2993693404;for(var nt,Tt=0;Tt<32;Tt+=4)nt=Q[1]^Q[2]^Q[3]^Me[Tt+0],$[Tt+0]=Q[0]^=ke(he(nt)),nt=Q[2]^Q[3]^Q[0]^Me[Tt+1],$[Tt+1]=Q[1]^=ke(he(nt)),nt=Q[3]^Q[0]^Q[1]^Me[Tt+2],$[Tt+2]=Q[2]^=ke(he(nt)),nt=Q[0]^Q[1]^Q[2]^Me[Tt+3],$[Tt+3]=Q[3]^=ke(he(nt));if(G===0)for(var Lt,Jt=0;Jt<16;Jt++)Lt=$[Jt],$[Jt]=$[31-Jt],$[31-Jt]=Lt})(r,st,u);for(var ut=[],T=_,W=t.length,et=0;16<=W;){var Z=t.slice(et,et+16),ct=new Array(16);if(h==="cbc")for(var yt=0;yt<16;yt++)u!==0&&(Z[yt]^=T[yt]);(function(B,$,G){for(var Q=new Array(4),z=new Array(4),Dt=0;Dt<4;Dt++)z[0]=255&B[4*Dt],z[1]=255&B[4*Dt+1],z[2]=255&B[4*Dt+2],z[3]=255&B[4*Dt+3],Q[Dt]=z[0]<<24|z[1]<<16|z[2]<<8|z[3];for(var nt,Tt=0;Tt<32;Tt+=4)nt=Q[1]^Q[2]^Q[3]^G[Tt+0],Q[0]^=Je(he(nt)),nt=Q[2]^Q[3]^Q[0]^G[Tt+1],Q[1]^=Je(he(nt)),nt=Q[3]^Q[0]^Q[1]^G[Tt+2],Q[2]^=Je(he(nt)),nt=Q[0]^Q[1]^Q[2]^G[Tt+3],Q[3]^=Je(he(nt));for(var Lt=0;Lt<16;Lt+=4)$[Lt]=Q[3-Lt/4]>>>24&255,$[Lt+1]=Q[3-Lt/4]>>>16&255,$[Lt+2]=Q[3-Lt/4]>>>8&255,$[Lt+3]=255&Q[3-Lt/4]})(Z,ct,st);for(var Ot=0;Ot<16;Ot++)h==="cbc"&&u===0&&(ct[Ot]^=T[Ot]),ut[et+Ot]=ct[Ot];h==="cbc"&&(T=u!==0?ct:Z),W-=16,et+=16}return c==="pkcs#5"&&u===0&&(c=ut[ut.length-1],ut.splice(ut.length-c,c)),S!=="array"?u!==0?ut.map((function(B){return(B=B.toString(16)).length===1?"0"+B:B})).join(""):(function(B){for(var $=[],G=0,Q=B.length;G<Q;G++)240<=B[G]&&B[G]<=247?($.push(String.fromCodePoint(((7&B[G])<<18)+((63&B[G+1])<<12)+((63&B[G+2])<<6)+(63&B[G+3]))),G+=3):224<=B[G]&&B[G]<=239?($.push(String.fromCodePoint(((15&B[G])<<12)+((63&B[G+1])<<6)+(63&B[G+2]))),G+=2):192<=B[G]&&B[G]<=223?($.push(String.fromCodePoint(((31&B[G])<<6)+(63&B[G+1]))),G++):$.push(String.fromCodePoint(B[G]));return $.join("")})(ut):ut}var Rr=[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],ge=[],Tr=function(t,r,u){for(var c=t[0],h=t[1],_=t[2],S=t[3],O=t[4],N=t[5],st=t[6],ut=t[7],T=0;T<64;T++){T<16?ge[T]=0|r[u+T]:(W=ge[T-15],et=ge[T-2],ge[T]=((W<<25|W>>>7)^(W<<14|W>>>18)^W>>>3)+ge[T-7]+((et<<15|et>>>17)^(et<<13|et>>>19)^et>>>10)+ge[T-16]);var W=c&h^c&_^h&_,et=ut+((O<<26|O>>>6)^(O<<21|O>>>11)^(O<<7|O>>>25))+(O&N^~O&st)+Rr[T]+ge[T];ut=st,st=N,N=O,O=S+et|0,S=_,_=h,h=c,c=et+(((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+W)|0}t[0]=t[0]+c|0,t[1]=t[1]+h|0,t[2]=t[2]+_|0,t[3]=t[3]+S|0,t[4]=t[4]+O|0,t[5]=t[5]+N|0,t[6]=t[6]+st|0,t[7]=t[7]+ut|0},Tn=(Ft={c2:Ft,c3:function(t){return t=typeof t=="string"?(function(r){for(var u=[],c=0,h=r.length;c<h;c++){var _=r.codePointAt(c);if(_<=127)u.push(_);else if(_<=2047)u.push(192|_>>>6),u.push(128|63&_);else if(_<=55295||57344<=_&&_<=65535)u.push(224|_>>>12),u.push(128|_>>>6&63),u.push(128|63&_);else{if(!(65536<=_&&_<=1114111))throw u.push(_),new Error("input is not supported");c++,u.push(240|_>>>18&28),u.push(128|_>>>12&63),u.push(128|_>>>6&63),u.push(128|63&_)}}return u})(t):Array.prototype.slice.call(t),Sr(t).map((function(r){return(r=r.toString(16)).length===1?"0"+r:r})).join("")},c4:{encrypt:function(t,r,u){return Rn(t,r,1,u)},decrypt:function(t,r,u){return Rn(t,r,0,u)}},s2:function(t){var r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],u=(function(h){for(var _=[],S=0;S<Math.ceil(h.length/4);S++)_[S]=h[4*S]<<24|(255&h[4*S+1])<<16|(255&h[4*S+2])<<8|255&h[4*S+3];return _})(t);u[(t=8*t.length)>>5]|=128<<24-t%32,u[15+(64+t>>9<<4)]=t;for(var c=0;c<u.length;c+=16)Tr(r,u,c);return(function(h){for(var _=[],S=0;S<h.length;S++)_[4*S]=h[S]>>24&255,_[4*S+1]=h[S]>>16&255,_[4*S+2]=h[S]>>8&255,_[4*S+3]=255&h[S];return _})(r).map((function(h){return(h=h.toString(16)).length===1?"0"+h:h})).join("")}},Pt),wr=At,br=St,Nr=Kt,Cr=Zt,Or=Ft.c2,Fr=Ft.c3,Lr=Ft.c4,xr=Ft.s2;return(function(){var t;(t=function(){}).VERSION="2.1.0";var r=b;if(r.AAR2)return r.AAR2.VERSION!==t.VERSION&&console.log(r.AAR2.VERSION),r.AAR2;var u="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",c=!1,h=!1,_=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,S=_!==void 0&&!!_.request&&!!_.login,O=function(T,W){return typeof T=="string"&&typeof W=="string"&&T!=null&&W!=null&&T.substring(0,W.length)===W},N={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},st=function(T){for(var W in N)if(N[W]===T)return W},ut=function(T,W,et){var Z=Date.now(),ct=new t;try{if(!T||T.length<=75)return console.error("error format 1:",T),N.ERROR_DATA_FORMAT;if(!O(T,"eyJ"))return console.error("error format 2:",T),N.ERROR_DATA_FORMAT;T=T.substring(3,T.length);var yt=wr.my_b4_decode(T);if(!yt)return console.error("error format 3:",T),N.ERROR_DATA_FORMAT;var Ot,B=ct.cc.u8.byteToInt(yt.slice(0,4),0),$=yt.slice(4,4+B),G=ct.cc.u8.byteToInt(yt.slice(4+B,4+B+4),0),Q=yt.slice(4+B+4,4+B+4+G),z=ct.cc.u8.byteToInt(yt.slice(4+B+4+G,4+B+4+G+4),0),Dt=yt.slice(4+B+4+G+4,4+B+4+G+4+z),nt=ct.cc.u8.bytesToUtf8Str($);if(ct.cc.h6.encode(Q,0,G),W||(et!==void 0&&et==="sm2"?(Ot=ct.cc.h6.encode(Q,0,G),ct.co.c2.doVerifySignature(nt,Ot,u,{der:!0,hash:!0})):ct.co.c3(nt+"8890012345678890").toLowerCase()===ct.cc.h6.encode(Dt,0,z).toLowerCase())){if(nt.length%2==0){t.prototype.__v=function(){return nt.slice(0,2)};for(var Tt=[],Lt=2;Lt<66;Lt+=2)Tt.push(parseInt("0x"+nt.slice(Lt,Lt+2)));t.prototype.__i=function(){return Tt};var Jt=parseInt("0x"+nt.slice(66,82))-Z;t.prototype.__o=function(){return Jt}}return S||b.AAR2||(b.AAR2=t),N.SUCCESS}}catch(Ze){return console.error(Ze),N.ERROR_UNKNOWN_ERROR}return N.ERROR_SIGN_CHECK};return t.init=function(T,W){var et,Z={debug:!1,url:"https://aks.jdpay.com/aar2/getJS",callback:function(){}};typeof T=="string"?(O(T,"https")||O(T,"https")?Z.url=T:O(T,"eyJ")&&(Z.code=T),typeof W=="string"&&(Z.publicKey=W)):rt(T)==="object"&&(T.debug&&(Z.debug=T.debug),T.url&&(Z.url=T.url),T.code&&(Z.code=T.code),T.publicKey&&(Z.publicKey=T.publicKey),T.skipVerify&&(Z.skipVerify=T.skipVerify),T.alg&&(Z.alg=T.alg),T.callback&&typeof T.callback=="function"&&(Z.callback=T.callback)),h?Z.callback&&Z.callback(!0,{errorNo:et=N.ALREADY_SUCCESS,errorMsg:st(et)}):c?setTimeout((function(){t.init(T,W)}),50):(c=!0,Z.debug&&Tn.start(Z.debug),Z.publicKey&&(u=Z.publicKey),Z.code?(et=ut(Z.code,Z.skipVerify))===N.SUCCESS?(c=!(h=!0),Z.callback(!0,{errorNo:et,errorMsg:st(et)})):Z.callback(!1,{errorNo:et,errorMsg:st(et)}):Z.url&&(function(ct,yt,Ot){try{if(ct=ct+"?version="+t.VERSION+(S?"&name=wechat":"&name=browser")+"&t="+Date.now(),S)_.request({url:ct,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function($){$.statusCode===200?yt($.data):Ot(N.ERROR_XXX_REQUEST_FAIL)},fail:function($){$&&$.errMsg&&$.errMsg.indexOf("timeout")!==-1?Ot(N.ERROR_XXX_REQUEST_TIMEOUT):Ot(N.ERROR_XXX_REQUEST_FAIL)}});else{var B;if(window.XMLHttpRequest)B=new XMLHttpRequest;else if(window.ActiveXObject)try{B=new ActiveXObject("Msxml2.XMLHTTP")}catch($){try{B=new ActiveXObject("Microsoft.XMLHTTP")}catch(G){}}B&&(B.onload=function(){B.readyState===4&&(B.status===200?yt(B.responseText):Ot(N.ERROR_XHR_ERROR))},B.ontimeout=function(){Ot(N.ERROR_XHR_TIMEOUT)},B.onerror=function(){Ot(N.ERROR_XHR_ERROR)},B.open("POST",ct,!0),B.timeout=5e3,B.send(null))}}catch($){console.error($),Ot(N.ERROR_UNKNOWN_ERROR)}})(Z.url,(function(ct){(ct=ut(ct,Z.skipVerify,Z.alg))===N.SUCCESS?(c=!(h=!0),Z.callback(!0,{errorNo:ct,errorMsg:st(ct)})):(c=!1,Z.callback(!1,{errorNo:ct,errorMsg:st(ct)}))}),(function(ct){c=!1,Z.callback(!1,{errorNo:ct,errorMsg:st(ct)})})))},t.prototype={cc:{b4:br,h6:Nr,u8:Cr},co:{c2:Or,c3:Fr,c4:Lr,s2:xr},nonce:function(){var T="0000000000"+Math.ceil(2147483647*Math.random())+Math.floor((Date.now()+this.__o())/1e3);return T.substring(T.length-20)},sign:function(T,W){return this.__s(T,W)},__s:function(T,W){var et=this.cc.u8.utf8StrToBytes(T),Z=this.__i();return T=this.cc.u8.utf8StrToBytes(W),W=this.cc.u8.utf8StrToBytes(this.__c()),T=[].concat(et,Z,T,W),W=parseInt("0x"+this.__v()),this.__f(W)(T)+this.__v()},__f:function(T){var W=this.co.s2,et=this.co.c3,Z=this.cc.h6.decode,ct=[function(yt){return W(yt)},function(yt){return et(yt)},function(yt){return et(Z(W(yt)))},function(yt){return W(Z(et(yt)))},function(yt){return et(Z(et(yt)))},function(yt){return W(Z(W(yt)))}];return ct[(128<T?T-128:T)%ct.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(_!==void 0&&_.env&&_.request&&_.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 Tn.isDebug()},version:function(){return t.VERSION}},t})()},pt(g)=="object"?l.exports=M():(L=typeof(E=M)=="function"?E.call(g,A,g,l):E)===void 0||(l.exports=L)}},o={};function a(l){var g=o[l];if(g!==void 0)return g.exports;var A=o[l]={id:l,loaded:!1,exports:{}};return e[l].call(A.exports,A,A.exports,a),A.loaded=!0,A.exports}a.n=l=>{var g=l&&l.__esModule?()=>l.default:()=>l;return a.d(g,{a:g}),g},a.d=(l,g)=>{for(var A in g)a.o(g,A)&&!a.o(l,A)&&Object.defineProperty(l,A,{enumerable:!0,get:g[A]})},a.g=(function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch(l){if(typeof window=="object")return window}})(),a.hmd=l=>((l=Object.create(l)).children||(l.children=[]),Object.defineProperty(l,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+l.id)}}),l),a.o=(l,g)=>Object.prototype.hasOwnProperty.call(l,g),a.r=l=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})};var p=a(737);Hn.exports.LyyGetCommandSDK=p})()});var Oo={};je(Oo,{DyErrorCode:()=>_e,DyErrorMessage:()=>gt,ENV_TYPE:()=>Qt,EXTERNAL_ENV_TYPE:()=>le,JdErrorCode:()=>Ke,JdErrorMessage:()=>bt,createServices:()=>Ir,getDisplayAdConfig:()=>vn,getDyPayRtaData:()=>Qe,handleDyJsapiPayFlow:()=>mn,handleDyPayCommandFlow:()=>_n,handleDyPayFlow:()=>We,handleJdInsurance:()=>dn,handleJdInsuranceExt:()=>yn,handleJdjrCashLoanExt:()=>fn,handleJdjrCashLoanFlow:()=>ln,normalizeDisplayAdData:()=>$e});module.exports=Br(Oo);var Qt={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},le={SIT:"sit",RELEASE:"release",PROD:"prod"},Ve={[Qt.DEV]:"https://dm.leyaoyao.com",[Qt.SIT]:"https://sm.leyaoyao.com",[Qt.UAT]:"https://um.leyaoyao.com",[Qt.PROD]:"https://m.leyaoyao.com"},Cn={[Qt.DEV]:"https://dad2.leyaoyao.com",[Qt.SIT]:"https://sad2.leyaoyao.com",[Qt.UAT]:"https://uad2.leyaoyao.com",[Qt.PROD]:"https://nad.ehuoke.com"},Ne={[le.SIT]:"https://sopenapi.leyaoyao.com",[le.RELEASE]:"https://uopen-api.leyaoyao.com",[le.PROD]:"https://api-gateway.leyaoyao.com"};function He(e,o){return`${Ve[e]||Ve[Qt.PROD]}${o}`}function On(e){return Cn[e]||Cn[Qt.PROD]}var Re={debug:!1,env:Qt.PROD,externalEnv:le.PROD,apiDomain:""},Fn=at({},Re);function Ln(e){Fn=at(at({},Re),e)}function pe(){return Fn}var Vr=Object.defineProperty,Hr=(e,o,a)=>o in e?Vr(e,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[o]=a,Gr=(e,o,a)=>Hr(e,typeof o!="symbol"?o+"":o,a);function oe(){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 Kr=class{constructor(e=!1){Gr(this,"enable"),this.enable=e}setEnable(e){this.enable=e}info(...e){this.enable&&console.info("[BI Info]",...e)}warn(...e){this.enable&&console.warn("[BI Warn]",...e)}error(...e){this.enable&&console.error("[BI Error]",...e)}debug(...e){this.enable&&console.log("[BI Debug]",...e)}},w=new Kr;function Ce(e){let o=oe();return o==="taro"?Taro.setClipboardData({data:e}).then(()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):o==="uni"?new Promise((a,p)=>{uni.setClipboardData({data:e,success:()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),a()},fail:l=>{w.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",l),p(l)}})}):o==="wechat"?new Promise((a,p)=>{wx.setClipboardData({data:e,success:()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),a()},fail:l=>{w.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",l),p(l)}})}):o==="alipay"?new Promise((a,p)=>{my.setClipboardData({text:e,success:()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),a()},fail:l=>{w.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",l),p(l)}})}):navigator.clipboard.writeText(e).then(()=>{w.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function on(e,o=2e3){let a=oe();if(a==="taro"){Taro.showToast({title:e,icon:"none",mask:!0,duration:o});return}if(a==="uni"){uni.showToast({title:e,icon:"none",mask:!0,duration:o});return}if(a==="wechat"){wx.showToast({title:e,icon:"none",mask:!0,duration:o});return}if(a==="alipay"){my.showToast({content:e,duration:o});return}typeof console!="undefined"&&console.log(`[Toast] ${e}`)}async function De(){var e,o,a,p,l;let g=oe();try{if(g==="taro")return((e=(await Taro.getSystemInfo()).platform)==null?void 0:e.toLowerCase())==="ios"?"ios":"android";if(g==="uni")return((o=uni.getSystemInfoSync().platform)==null?void 0:o.toLowerCase())==="ios"?"ios":"android";if(g==="wechat")return wx.getDeviceInfo?((a=(await wx.getDeviceInfo()).platform)==null?void 0:a.toLowerCase())==="ios"?"ios":"android":((p=wx.getSystemInfoSync().platform)==null?void 0:p.toLowerCase())==="ios"?"ios":"android";if(g==="alipay")return((l=my.getSystemInfoSync().platform)==null?void 0:l.toLowerCase())==="ios"?"ios":"android";if(typeof navigator!="undefined"){let A=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(A))return"ios";if(/android/.test(A))return"android"}return"unknown"}catch(A){return w.error("\u83B7\u53D6\u5E73\u53F0\u4FE1\u606F\u5931\u8D25",A),"unknown"}}var Yt={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function k(e,o,a=null){return{code:e,message:o,data:a}}function Ge(e,o){return e==null?{valid:!1,message:`${o}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof e=="string"&&e.trim().length===0?{valid:!1,message:`${o}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function Oe(e,o){for(let a of o){let p=Ge(e[a],a);if(!p.valid)return p}return{valid:!0}}var pn={};je(pn,{handleJdInsurance:()=>dn,handleJdInsuranceExt:()=>yn,handleJdjrCashLoanExt:()=>fn,handleJdjrCashLoanFlow:()=>ln});var Ke=(H=>(H[H.JD_CASH_LOAN__MISSING_PHONE=2001]="JD_CASH_LOAN__MISSING_PHONE",H[H.JD_CASH_LOAN__MISSING_DEVICE_ID=2002]="JD_CASH_LOAN__MISSING_DEVICE_ID",H[H.JD_CASH_LOAN__RTA_FAILED=2003]="JD_CASH_LOAN__RTA_FAILED",H[H.JD_CASH_LOAN__GET_CONFIG_FAILED=2004]="JD_CASH_LOAN__GET_CONFIG_FAILED",H[H.JD_CASH_LOAN__INVALID_CONFIG=2005]="JD_CASH_LOAN__INVALID_CONFIG",H[H.JD_CASH_LOAN__EXT_NOT_ELIGIBLE=2006]="JD_CASH_LOAN__EXT_NOT_ELIGIBLE",H[H.JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS=2007]="JD_CASH_LOAN__EXT_INVALID_JUMP_PARAMS",H[H.JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM=2008]="JD_CASH_LOAN__EXT_MISSING_THIRD_PLATFORM",H[H.JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID=2009]="JD_CASH_LOAN__EXT_MISSING_THIRD_USER_ID",H[H.JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE=2010]="JD_CASH_LOAN__EXT_MISSING_THIRD_EQUIPMENT_VALUE",H[H.JD_INSURANCE__USER_NOT_ELIGIBLE=2101]="JD_INSURANCE__USER_NOT_ELIGIBLE",H[H.JD_INSURANCE__H5_NOT_SUPPORTED=2102]="JD_INSURANCE__H5_NOT_SUPPORTED",H[H.JD_INSURANCE__INVALID_JUMP_PARAMS=2103]="JD_INSURANCE__INVALID_JUMP_PARAMS",H[H.JD_INSURANCE__GET_CONFIG_FAILED=2104]="JD_INSURANCE__GET_CONFIG_FAILED",H[H.JD_INSURANCE__COPY_FAILED=2105]="JD_INSURANCE__COPY_FAILED",H[H.JD_INSURANCE__TASK_COMPLETED=2106]="JD_INSURANCE__TASK_COMPLETED",H[H.JD_INSURANCE__UNKNOWN_JUMP_MODE=2107]="JD_INSURANCE__UNKNOWN_JUMP_MODE",H[H.JD_INSURANCE__RTA_FAILED=2108]="JD_INSURANCE__RTA_FAILED",H))(Ke||{}),bt={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=(x=>(x[x.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",x[x.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",x[x.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",x[x.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",x[x.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",x[x.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",x[x.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",x[x.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",x[x.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",x[x.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",x[x.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",x[x.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",x[x.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",x[x.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",x[x.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",x[x.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",x[x.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",x[x.DY_PAY__INVALID_RETURN_TYPE=3018]="DY_PAY__INVALID_RETURN_TYPE",x[x.DY_PAY__JSAPI_INFO_FAILED=3019]="DY_PAY__JSAPI_INFO_FAILED",x[x.DY_PAY__REQUEST_JSAPI_INFO_FAILED=3020]="DY_PAY__REQUEST_JSAPI_INFO_FAILED",x[x.DY_PAY__MISSING_JSAPI_PAY_INFO=3021]="DY_PAY__MISSING_JSAPI_PAY_INFO",x[x.DY_PAY__INVALID_JSAPI_PAY_INFO=3022]="DY_PAY__INVALID_JSAPI_PAY_INFO",x[x.DY_PAY__JSAPI_SIGNATURE_FAILED=3023]="DY_PAY__JSAPI_SIGNATURE_FAILED",x[x.DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED=3024]="DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED",x[x.DY_PAY__JSAPI_UNSUPPORTED_ENV=3025]="DY_PAY__JSAPI_UNSUPPORTED_ENV",x[x.DY_PAY__JSAPI_AUTH_REDIRECT_FAILED=3026]="DY_PAY__JSAPI_AUTH_REDIRECT_FAILED",x[x.DY_PAY__JSAPI_SDK_LOAD_FAILED=3027]="DY_PAY__JSAPI_SDK_LOAD_FAILED",x[x.DY_PAY__JSAPI_CONFIG_FAILED=3028]="DY_PAY__JSAPI_CONFIG_FAILED",x[x.DY_PAY__JSAPI_INVOKE_FAILED=3029]="DY_PAY__JSAPI_INVOKE_FAILED",x[x.DY_PAY__MISSING_AUTH_TOKEN=3030]="DY_PAY__MISSING_AUTH_TOKEN",x[x.DY_PAY_COMMAND__MISSING_ORDER_AMOUNT=3031]="DY_PAY_COMMAND__MISSING_ORDER_AMOUNT",x[x.DY_PAY_COMMAND__GET_FAILED=3032]="DY_PAY_COMMAND__GET_FAILED",x[x.DY_PAY_COMMAND__REQUEST_FAILED=3033]="DY_PAY_COMMAND__REQUEST_FAILED",x[x.DY_PAY_COMMAND__COPY_FAILED=3034]="DY_PAY_COMMAND__COPY_FAILED",x[x.DY_PAY_COMMAND__INVALID_RTA_DATA=3035]="DY_PAY_COMMAND__INVALID_RTA_DATA",x))(_e||{}),gt={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",3018:"\u65E0\u6548\u7684\u8FD4\u56DE\u5730\u5740\u7C7B\u578B",3019:"\u83B7\u53D6JSAPI\u652F\u4ED8\u4FE1\u606F\u5931\u8D25",3020:"\u83B7\u53D6JSAPI\u652F\u4ED8\u4FE1\u606F\u8BF7\u6C42\u5931\u8D25",3021:"\u7F3A\u5C11JSAPI\u652F\u4ED8\u53C2\u6570",3022:"JSAPI\u652F\u4ED8\u53C2\u6570\u683C\u5F0F\u4E0D\u6B63\u786E",3023:"\u83B7\u53D6JSAPI\u652F\u4ED8\u7B7E\u540D\u5931\u8D25",3024:"\u83B7\u53D6JSAPI\u652F\u4ED8\u7B7E\u540D\u8BF7\u6C42\u5931\u8D25",3025:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u6296\u97F3JSAPI\u652F\u4ED8",3026:"\u6296\u97F3\u6388\u6743\u8DF3\u8F6C\u5931\u8D25",3027:"\u6296\u97F3\u5F00\u653ESDK\u52A0\u8F7D\u5931\u8D25",3028:"\u6296\u97F3JSSDK\u521D\u59CB\u5316\u5931\u8D25",3029:"\u6296\u97F3JSAPI\u652F\u4ED8\u8C03\u8D77\u5931\u8D25",3030:"\u7F3A\u5C11\u6296\u97F3\u6388\u6743token",3031:"\u7F3A\u5C11\u6296\u97F3\u652F\u4ED8\u53E3\u4EE4\u91D1\u989D",3032:"\u83B7\u53D6\u6296\u97F3\u652F\u4ED8\u53E3\u4EE4\u5931\u8D25",3033:"\u83B7\u53D6\u6296\u97F3\u652F\u4ED8\u53E3\u4EE4\u8BF7\u6C42\u5931\u8D25",3034:"\u590D\u5236\u6296\u97F3\u652F\u4ED8\u53E3\u4EE4\u5931\u8D25",3035:"\u6296\u97F3\u652F\u4ED8\u53E3\u4EE4RTA\u6570\u636E\u65E0\u6548"};var Xr=(e,o,a,p)=>{let l=oe();if(l==="taro")return Taro.request({url:e,method:o,data:a,header:p}).then(E=>E);if(l==="uni")return new Promise((E,L)=>{uni.request({url:e,method:o,data:a,header:p,success:M=>E(M),fail:M=>L(M)})});if(l==="wechat")return new Promise((E,L)=>{wx.request({url:e,method:o,data:a,header:p,success:M=>E(M),fail:M=>L(M)})});if(l==="alipay")return new Promise((E,L)=>{my.request({url:e,method:o,data:a,headers:p,success:M=>E(M),fail:M=>L(M)})});let g=o.toUpperCase()==="GET",A=g&&a&&Object.keys(a).length?`${e}?${new URLSearchParams(a).toString()}`:e;return fetch(A,{method:o,headers:p,body:g?void 0:JSON.stringify(a)}).then(async E=>({statusCode:E.status,data:await E.json()}))},an=class{constructor(o=null){Be(this,"staticConfig");this.staticConfig=o}getCurrentConfig(){return this.staticConfig||pe()||Re}async getAuthToken(){let o=this.getCurrentConfig();if(o.getAuthToken&&typeof o.getAuthToken=="function")try{let a=await o.getAuthToken();return a?(w.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),a):(w.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(a){return w.error("\u83B7\u53D6Token\u5931\u8D25",a),null}return null}async buildHeader(o={},a=!0){let p=at({"content-type":"application/json"},o);if(!a)return p;let l=await this.getAuthToken();if(!l)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 p.Authorization_bar=l,p}async request(o){let{path:a,method:p="POST",data:l={},header:g={},authRequired:A=!0,baseDomain:E,beforeRequest:L,afterResponse:M}=o,pt=E?`${E}${a}`:He(this.getCurrentConfig().env||"prod",a),rt=await this.buildHeader(g,A);L&&typeof L=="function"&&await L({url:pt,method:p,data:l,header:rt}),w.info(`\u53D1\u8D77${p}\u8BF7\u6C42:`,{path:a,method:p});try{let X=await Xr(pt,p,l,rt);return w.info("\u8BF7\u6C42\u6210\u529F:",{path:a,statusCode:X.statusCode}),M&&typeof M=="function"&&await M(X.data),X.data}catch(X){throw w.error("\u8BF7\u6C42\u5931\u8D25:",{path:a,error:X}),X}}get(o,a={},p={}){return this.request(at({path:o,method:"GET",data:a},p))}post(o,a={},p={}){return this.request(at({path:o,method:"POST",data:a},p))}},Te=(e=null)=>new an(e);var Wr=(function(){"use strict";function e(P,tt){var _t=(65535&P)+(65535&tt);return(P>>16)+(tt>>16)+(_t>>16)<<16|65535&_t}function o(P,tt,_t,it,H,wt){return e((wt=e(e(tt,P),e(it,wt)))<<H|wt>>>32-H,_t)}function a(P,tt,_t,it,H,wt,R){return o(tt&_t|~tt&it,P,tt,H,wt,R)}function p(P,tt,_t,it,H,wt,R){return o(tt&it|_t&~it,P,tt,H,wt,R)}function l(P,tt,_t,it,H,wt,R){return o(tt^_t^it,P,tt,H,wt,R)}function g(P,tt,_t,it,H,wt,R){return o(_t^(tt|~it),P,tt,H,wt,R)}function A(P,tt){var _t,it,H,wt;P[tt>>5]|=128<<tt%32,P[14+(tt+64>>>9<<4)]=tt;for(var R=1732584193,b=-271733879,F=-1732584194,C=271733878,D=0;D<P.length;D+=16)R=a(_t=R,it=b,H=F,wt=C,P[D],7,-680876936),C=a(C,R,b,F,P[D+1],12,-389564586),F=a(F,C,R,b,P[D+2],17,606105819),b=a(b,F,C,R,P[D+3],22,-1044525330),R=a(R,b,F,C,P[D+4],7,-176418897),C=a(C,R,b,F,P[D+5],12,1200080426),F=a(F,C,R,b,P[D+6],17,-1473231341),b=a(b,F,C,R,P[D+7],22,-45705983),R=a(R,b,F,C,P[D+8],7,1770035416),C=a(C,R,b,F,P[D+9],12,-1958414417),F=a(F,C,R,b,P[D+10],17,-42063),b=a(b,F,C,R,P[D+11],22,-1990404162),R=a(R,b,F,C,P[D+12],7,1804603682),C=a(C,R,b,F,P[D+13],12,-40341101),F=a(F,C,R,b,P[D+14],17,-1502002290),R=p(R,b=a(b,F,C,R,P[D+15],22,1236535329),F,C,P[D+1],5,-165796510),C=p(C,R,b,F,P[D+6],9,-1069501632),F=p(F,C,R,b,P[D+11],14,643717713),b=p(b,F,C,R,P[D],20,-373897302),R=p(R,b,F,C,P[D+5],5,-701558691),C=p(C,R,b,F,P[D+10],9,38016083),F=p(F,C,R,b,P[D+15],14,-660478335),b=p(b,F,C,R,P[D+4],20,-405537848),R=p(R,b,F,C,P[D+9],5,568446438),C=p(C,R,b,F,P[D+14],9,-1019803690),F=p(F,C,R,b,P[D+3],14,-187363961),b=p(b,F,C,R,P[D+8],20,1163531501),R=p(R,b,F,C,P[D+13],5,-1444681467),C=p(C,R,b,F,P[D+2],9,-51403784),F=p(F,C,R,b,P[D+7],14,1735328473),R=l(R,b=p(b,F,C,R,P[D+12],20,-1926607734),F,C,P[D+5],4,-378558),C=l(C,R,b,F,P[D+8],11,-2022574463),F=l(F,C,R,b,P[D+11],16,1839030562),b=l(b,F,C,R,P[D+14],23,-35309556),R=l(R,b,F,C,P[D+1],4,-1530992060),C=l(C,R,b,F,P[D+4],11,1272893353),F=l(F,C,R,b,P[D+7],16,-155497632),b=l(b,F,C,R,P[D+10],23,-1094730640),R=l(R,b,F,C,P[D+13],4,681279174),C=l(C,R,b,F,P[D],11,-358537222),F=l(F,C,R,b,P[D+3],16,-722521979),b=l(b,F,C,R,P[D+6],23,76029189),R=l(R,b,F,C,P[D+9],4,-640364487),C=l(C,R,b,F,P[D+12],11,-421815835),F=l(F,C,R,b,P[D+15],16,530742520),R=g(R,b=l(b,F,C,R,P[D+2],23,-995338651),F,C,P[D],6,-198630844),C=g(C,R,b,F,P[D+7],10,1126891415),F=g(F,C,R,b,P[D+14],15,-1416354905),b=g(b,F,C,R,P[D+5],21,-57434055),R=g(R,b,F,C,P[D+12],6,1700485571),C=g(C,R,b,F,P[D+3],10,-1894986606),F=g(F,C,R,b,P[D+10],15,-1051523),b=g(b,F,C,R,P[D+1],21,-2054922799),R=g(R,b,F,C,P[D+8],6,1873313359),C=g(C,R,b,F,P[D+15],10,-30611744),F=g(F,C,R,b,P[D+6],15,-1560198380),b=g(b,F,C,R,P[D+13],21,1309151649),R=g(R,b,F,C,P[D+4],6,-145523070),C=g(C,R,b,F,P[D+11],10,-1120210379),F=g(F,C,R,b,P[D+2],15,718787259),b=g(b,F,C,R,P[D+9],21,-343485551),R=e(R,_t),b=e(b,it),F=e(F,H),C=e(C,wt);return[R,b,F,C]}function E(P){for(var tt="",_t=32*P.length,it=0;it<_t;it+=8)tt+=String.fromCharCode(P[it>>5]>>>it%32&255);return tt}function L(P){var tt=[];for(tt[(P.length>>2)-1]=void 0,it=0;it<tt.length;it+=1)tt[it]=0;for(var _t=8*P.length,it=0;it<_t;it+=8)tt[it>>5]|=(255&P.charCodeAt(it/8))<<it%32;return tt}function M(P){for(var tt,_t="0123456789abcdef",it="",H=0;H<P.length;H+=1)tt=P.charCodeAt(H),it+=_t.charAt(tt>>>4&15)+_t.charAt(15&tt);return it}function pt(P){return unescape(encodeURIComponent(P))}function rt(P){return E(A(L(P=pt(P)),8*P.length))}function X(P,tt){return(function(_t,it){var H,wt=L(_t),R=[],b=[];for(R[15]=b[15]=void 0,16<wt.length&&(wt=A(wt,8*_t.length)),H=0;H<16;H+=1)R[H]=909522486^wt[H],b[H]=1549556828^wt[H];return it=A(R.concat(L(it)),512+8*it.length),E(A(b.concat(it),640))})(pt(P),pt(tt))}function kt(P,tt,_t){return tt?_t?X(tt,P):M(X(tt,P)):_t?rt(P):M(rt(P))}return kt})(),Fe=Wr;function xn(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function Yn(e){if(typeof e!="object"||e===null)return e;let o=Object.keys(e).sort(),a={};for(let p of o)a[p]=e[p];return JSON.stringify(a)}function Un(e,o){let a={appId:e.appId,randomStr:e.randomStr,data:e.data},p=Object.keys(a).sort(),l="";for(let[g,A]of p.entries())l+=`${A}=${a[A]}`,g<p.length-1&&(l+="&");return l+=`&secretKey=${o}`,Fe(l)}var Qr=(e,o,a,p)=>{let l=oe();return l==="taro"?Taro.request({url:e,method:o,data:a,header:p}).then(g=>g):l==="uni"?new Promise((g,A)=>{uni.request({url:e,method:o,data:a,header:p,success:E=>g(E),fail:E=>A(E)})}):l==="wechat"?new Promise((g,A)=>{wx.request({url:e,method:o,data:a,header:p,success:E=>g(E),fail:E=>A(E)})}):l==="alipay"?new Promise((g,A)=>{my.request({url:e,method:o,data:a,headers:p,success:E=>g(E),fail:E=>A(E)})}):fetch(e,{method:o,headers:p,body:JSON.stringify(a)}).then(async g=>({statusCode:g.status,data:await g.json()}))},sn=class{constructor(o=null){Be(this,"staticConfig");this.staticConfig=o}getCurrentConfig(){return this.staticConfig||pe()||{}}getExternalEnv(){var o;return((o=this.getCurrentConfig())==null?void 0:o.externalEnv)||le.PROD}getExternalHost(){let o=this.getExternalEnv();return Ne[o]||Ne.prod}generateSign(o={}){let a=this.getCurrentConfig(),{externalAppId:p,externalAppSecret:l}=a;if(!p||!l)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let g=xn(),A=Yn(o),E=Un({appId:p,randomStr:g,data:A},l);return{appId:p,randomStr:g,sign:E}}buildRequestBody(o={}){let a=this.generateSign(o);return zt(at({},a),{data:o})}buildUrl(o){return`${this.getExternalHost()}${o}`}async request(o){let{path:a,method:p="POST",data:l={},header:g={},needSign:A=!0,beforeRequest:E,afterResponse:L}=o,M=this.buildUrl(a),pt=at({"content-type":"application/json"},g),rt=A?this.buildRequestBody(l):l;E&&typeof E=="function"&&await E({url:M,method:p,data:rt,header:pt}),w.info(`\u53D1\u8D77${p}\u8BF7\u6C42:`,{path:a,method:p});try{let X=await Qr(M,p,rt,pt);if(w.info("\u8BF7\u6C42\u6210\u529F:",{path:a,statusCode:X.statusCode}),L&&typeof L=="function"&&await L(X.data),X.statusCode===200&&X.data.code===200)return X.data.data;throw{code:X.data.code,msg:X.data.data||"\u8BF7\u6C42\u4E1A\u52A1\u5F02\u5E38",original:X.data}}catch(X){throw(X==null?void 0:X.code)!==void 0?X:(w.error("\u8BF7\u6C42\u5931\u8D25:",{path:a,error:X}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:X})}}get(o,a={},p={}){return this.request(at({path:o,method:"GET",data:a},p))}post(o,a={},p={}){return this.request(at({path:o,method:"POST",data:a},p))}},Mn=(e=null)=>new sn(e);var un=Te(),cn=Mn();function Jn(e){let o=Ge(e==null?void 0:e.equipmentValue,"equipmentValue");return o.valid?un.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",e):Promise.reject({code:"PARAM_ERROR",message:o.message})}async function kn(e){let o=Oe(e,["idMd5Value","rtaStrategy"]);return o.valid?cn.post("/open/rest/cpa/jd/rta-check",e):Promise.reject({code:"PARAM_ERROR",message:o.message})}async function qn(e){try{let o={thirdPlatform:e.thirdPlatform,thirdPlatformUserId:e.thirdPlatformUserId,thirdPlatformEquipmentValue:e.thirdPlatformEquipmentValue,os:e.os,client:"wxMini"};e.phone&&(o.mobileMd5=Fe(e.phone)),e.extendData&&(Object.prototype.toString.call(e.extendData)==="[object Object]"?o.extendData=e.extendData:w.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let a=await cn.post("/open/rest/cpa/jd/insurance/get",o);return a?a.jumpMode==1?{jumpMode:1,appId:a.appId,url:a.url}:{jumpMode:2,url:a.url,channel:a.channelId}:void 0}catch(o){throw w.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",o),o}}function jn(e){let o=Ge(e==null?void 0:e.equipmentValue,"equipmentValue");return o.valid?un.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",e):Promise.reject({code:"PARAM_ERROR",message:o.message})}function Bn(e){let o=Oe(e,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return o.valid?un.post("/gw/advert/customer/cpa-activity/jd/rta/validate",e):Promise.reject({code:"PARAM_ERROR",message:o.message})}async function Vn(e){let o=await De(),a={thirdPlatform:e.thirdPlatform,thirdPlatformUserId:e.thirdPlatformUserId,thirdPlatformEquipmentValue:e.thirdPlatformEquipmentValue,os:o,client:e.client};return e.phone&&(a.mobileMd5=Fe(e.phone)),e.extendData&&(Object.prototype.toString.call(e.extendData)==="[object Object]"?a.extendData=e.extendData:w.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),cn.post("/open/rest/cpa/jd/cash-loan/get",a)}async function ln(e){let{phone:o,rtaId:a,equipmentId:p,lyyUserId:l,entrance:g}=e;if(!o)return k(Yt.INVALID_PARAM,bt[2001]);if(!p)return k(Yt.INVALID_PARAM,bt[2002]);try{if(a){w.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:o});let rt=await Bn({phone:o,lyyEquipmentValue:p,lyyUserId:l||"",rtaId:a});if(rt.code!=="0000000"||!rt.body||rt.body.state!=1)return w.error("RTA\u9A8C\u8BC1\u5931\u8D25",rt),k(2003,bt[2003]);w.info("RTA\u9A8C\u8BC1\u6210\u529F",rt.body)}w.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:o});let A=await De(),E=await jn({phone:o,equipmentValue:p,os:A,entrance:g});if(E.code!=="0000000"||!E.body)return w.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",E),k(2004,bt[2004]);let{appId:L,targetUrl:M}=E.body;if(!L||!M)return w.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:L,targetUrl:M}),k(2005,bt[2005]);let pt=k(Yt.SUCCESS,"\u6210\u529F",{appId:L,targetUrl:M});return w.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",pt),pt}catch(A){return w.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",A),k(Yt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function fn(e){let{phone:o,rtaId:a,thirdPlatform:p,thirdPlatformUserId:l,thirdPlatformEquipmentValue:g}=e;if(!o)return k(Yt.INVALID_PARAM,bt[2001]);if(!p)return k(2008,bt[2008]);if(!l)return k(2009,bt[2009]);if(!g)return k(2010,bt[2010]);try{if(a){w.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:o});let X=await kn({idMd5Value:o,rtaStrategy:a});if(X.status!=1)return w.error("RTA\u9A8C\u8BC1\u5931\u8D25",X),k(2003,bt[2003]);w.info("RTA\u9A8C\u8BC1\u6210\u529F",X)}let A=await Vn(e),{url:E,channelId:L,matchFlag:M,jumpMode:pt,appId:rt}=A||{};return M?pt===3?!rt||!E?k(2007,bt[2007]):k(Yt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:rt,url:E}):k(2007,bt[2007]):k(2006,bt[2006])}catch(A){return w.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",A),k(Yt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var we=null,Le=null;try{Le=Gn()}catch(e){}function Kn(){return we||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(we=globalThis.LyyGetCommandSDK,we):Le?(we=Le.LyyGetCommandSDK||Le.default||Le,we):null)}function Xn(e){var a;w.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",e);let o=Kn();o!=null&&o.getJrCommand?o.getJrCommand(e):(a=o==null?void 0:o.default)!=null&&a.getJrCommand?o.default.getJrCommand(e):(w.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),e.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function $r(e,o){return new Promise((a,p)=>{try{Xn({url:e,channel:o,callback:l=>{l.code==="0"?a(l.data):p({msg:l.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(l){p(l)}})}async function dn(e){try{let o=await De(),a=at({os:o},e);w.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",a);let{code:p,body:l}=await Jn(a);if(p==="0000000"&&l){let{url:g,channelId:A,matchFlag:E,jumpMode:L,appId:M}=l;if(!E)return k(2101,bt[2101]);if(L===1)return w.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),k(2102,bt[2102]);if(L===2)return oe()==="web"&&w.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:g}),!g||!A?k(2103,bt[2103]):new Promise(pt=>{Xn({url:g,channel:A,callback:async rt=>{if((rt==null?void 0:rt.code)==="0")try{await Ce(rt==null?void 0:rt.data),pt(k(Yt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch(X){pt(k(2105,bt[2105]))}else pt(k(2105,bt[2105]))}})});if(L===3)return!M||!g?k(2103,bt[2103]):k(Yt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:M,path:g})}return k(2104,bt[2104])}catch(o){return w.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",o),k(Yt.NETWORK_ERROR,"\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5")}}async function yn(e){w.info("\u5F00\u59CB\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4...");try{let o=await qn(zt(at({},e),{os:await De()}));if(!o)return w.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),k(2106,bt[2106]);if(o.jumpMode===1)return w.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{appId:o.appId,url:o.url}),k(Yt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:o.appId,path:o.url});if(o.jumpMode===2){if(oe()==="web")return w.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:o.url}),k(Yt.SUCCESS,"\u6210\u529F",{type:"h5",url:o.url});try{let a=await $r(o.url,o.channel);return await Ce(a),w.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),k(Yt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(a){return w.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",a),on("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),k(2105,bt[2105])}}return w.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",o.jumpMode),k(2107,bt[2107])}catch(o){let a=typeof o=="string"?o:(o==null?void 0:o.msg)||(o==null?void 0:o.message)||"\u672A\u77E5\u9519\u8BEF";return w.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",a),on("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),a.includes("RTA")||a.includes("\u8D44\u683C")?k(2108,bt[2108]):k(Yt.NETWORK_ERROR,a)}}var gn={};je(gn,{DyErrorCode:()=>_e,getDyPayRtaData:()=>Qe,handleDyJsapiPayFlow:()=>mn,handleDyPayCommandFlow:()=>_n,handleDyPayFlow:()=>We});var zr=["weapp","h5"],Zr=["h5","ulink","jsapi"],to=["switchTab","reLaunch","redirectTo","navigateTo"];function eo(e){return zr.includes(e)}function no(e){return Zr.includes(e)}function ro(e){return to.includes(e)}function Wn(e){let o=e.returnType||"h5";return!e.telephone&&o==="h5"?{valid:!1,errorCode:3001}:e.price?e.equipmentValue?e.businessType?e.client&&!eo(e.client)?{valid:!1,errorCode:3004}:no(o)?e.douyinOrderExtendData&&typeof e.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:e.backWay&&e.client==="weapp"&&!ro(e.backWay)?{valid:!1,errorCode:3016}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3018}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}}function Qn(e){return e.price?e.equipmentValue?e.businessType?e.douyinOrderExtendData&&typeof e.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}}function $n(e){return e.equipmentValue?{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}function zn(e){return e.telephone?e.equipmentValue?e.orderAmount?e.businessType?e.commandUrl!=null&&typeof e.commandUrl!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3031}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3001}}function Zn(e){return e.telephone?e.equipmentValue?e.commandUrl!=null&&typeof e.commandUrl!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3001}}function tr(e){return e.showFlag===!0&&typeof e.payAmount=="number"&&e.payAmount>0&&typeof e.businessType=="number"&&e.businessType>0}var be=Te();async function er(e){let{price:o,equipmentValue:a,douyinOrderExtendData:p,douyinCommodityVirtualFlag:l,businessType:g,platformActivities:A={}}=e,E={businessType:g,equipmentValue:a,payInfoBusinessType:"commonDouyinPayment",platformActivities:at({douyinCommodityVirtualFlag:l||!1,douyinCommodityPrice:o,douyinOrderExtendData:p||""},A)};try{let L=await be.post("/gw/advert/customer/payment/pay-info",E);return L.code!=="0000000"||!(L!=null&&L.body)?Promise.reject({code:3006,message:L.message||gt[3006]}):(L.body.platformActivities=E.platformActivities,L)}catch(L){return w.error("getDyOrderAmountFn error:",L),Promise.reject({code:3007,message:gt[3007]})}}async function nr(e){var o,a,p,l;try{let g=e.commodityList.map(kt=>(kt.commodity=kt.commodityId,delete kt.commodityId,kt.quantity=kt.quantity||1,kt)),A=e.advertExtendInfo&&Object.keys(e.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:e.advertExtendInfo}):"",E=oe(),L="";E==="wechat"?L="wechatMini":E==="web"&&navigator.userAgent.toLowerCase().includes("micromessenger")&&(L="wechatHtml");let M=e.returnType==="jsapi",pt=M?22:21,rt=at(at(at({businessType:e.businessType,fixedClientType:pt,channelCode:null,douyinData:at(at({loginMobile:e.telephone||""},((o=e.jsapiInfo)==null?void 0:o.outProductCategory)!=null?{outProductCategory:e.jsapiInfo.outProductCategory}:{}),((a=e.jsapiInfo)==null?void 0:a.requestId)!=null?{requestId:e.jsapiInfo.requestId}:{}),equipmentUseFlag:!1,payEquipmentDTO:{equipmentValue:e.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:A,transType:5,actualFee:e.totalFee,totalFee:e.totalFee,commodityList:g,clientSourceDetailType:L,platformActivities:e.platformActivities||{}},e.commoditySign&&{commoditySign:e.commoditySign}),e.unifiedOrderExtendData&&at({},e.unifiedOrderExtendData)),M?{appId:((p=e.jsapiInfo)==null?void 0:p.appId)||"",openId:((l=e.jsapiInfo)==null?void 0:l.douyinOpenId)||""}:{});if(e.returnType=="ulink")return delete rt.channelCode,rt;let X=await be.post("/gw/payment-bff/unified/order",rt);return X.code!=="0000000"||!(X!=null&&X.body)?Promise.reject({code:3008,message:X.message||gt[3008]}):X}catch(g){return w.error("dyUnifiedOrderFn error:",g),Promise.reject({code:3009,message:gt[3009]})}}async function rr(e){let o={equipmentValue:e.equipmentValue,phone:e.telephone||""};e.price&&(o.orderAmount=e.price);try{let a=await be.post("/gw/advert/customer/douyin/pay/check",o);return a.code!=="0000000"||!(a!=null&&a.body)?Promise.reject({code:3013,message:a.message||gt[3013]}):a}catch(a){return w.error("getDyPayRtaData error:",a),Promise.reject({code:3014,message:(a==null?void 0:a.message)||gt[3014]})}}async function or(e={}){var o;try{let a=(o=e.requestNo)==null?void 0:o.trim(),p=a?`/gw/advert/customer/douyin/pay/jsapi/info?requestNo=${a}`:"/gw/advert/customer/douyin/pay/jsapi/info",l=await be.get(p);return l.code!=="0000000"||!(l!=null&&l.body)?Promise.reject({code:3019,message:l.message||gt[3019]}):{appId:l.body.appId,douyinOpenId:l.body.douyinOpenId,outProductCategory:l.body.outProductCategory,requestId:l.body.requestId}}catch(a){return w.error("getDyPayJsapiInfoFn error:",a),Promise.reject({code:(a==null?void 0:a.code)||3020,message:(a==null?void 0:a.message)||gt[3020]})}}async function ir(e){try{let o=await be.post("/gw/advert/customer/douyin/pay/jsapi/signature",e);return o.code!=="0000000"||!(o!=null&&o.body)||!o.body.signature||!o.body.timestamp||!o.body.nonceStr?Promise.reject({code:3023,message:o.message||gt[3023]}):{signature:o.body.signature,timestamp:o.body.timestamp,nonceStr:o.body.nonceStr}}catch(o){return w.error("getDyPayJsapiSignatureFn error:",o),Promise.reject({code:(o==null?void 0:o.code)||3024,message:(o==null?void 0:o.message)||gt[3024]})}}async function ar(e){try{let o=await be.post("/gw/advert/customer/douyin/pay-command",e);return o.code!=="0000000"||!(o!=null&&o.body)?Promise.reject({code:3032,message:o.message||gt[3032]}):o}catch(o){return w.error("getDyPayCommandFn error:",o),Promise.reject({code:(o==null?void 0:o.code)||3033,message:(o==null?void 0:o.message)||gt[3033]})}}var oo="/auth/rest/auth/third",sr="url_token",io="https://unpkg.byted-static.com/bridge/douyin_open/1.0.17/lib/douyin_open.umd.js",xe=null;function Bt(e,o){let a=new Error(o||gt[e]);return Object.assign(a,{code:e})}function Ye(){return typeof window!="undefined"&&typeof document!="undefined"}function hn(){return Ye()?window.location.href:""}function ur(e){let o=e.href||hn();if(!e.key||!o)return"";try{let a=new URL(o,hr()),p=a.searchParams.get(e.key);return p!=null?p:ao(a.hash,e.key)}catch(a){return w.warn("getDyUrlParam parse error:",a),""}}function ao(e,o){if(!e||!o)return"";let a=e.indexOf("?");if(a<0)return"";let p=e.slice(a+1).split("#")[0];return new URLSearchParams(p).get(o)||""}function cr(e){let{href:o,paramName:a}=e;if(!o||!a)return o;let p=o.indexOf("#"),l=p>=0?o.slice(0,p):o,g=p>=0?o.slice(p):"";try{let A=new URL(l,hr()),E=uo(l);return A.searchParams.delete(a),`${E?`${A.pathname}${A.search}`:A.toString()}${g}`}catch(A){return w.warn("removeDyUrlParam parse error:",A),fo(o,a)}}function lr(e={}){let a=(e.href||hn()).split("#")[0]||"";return cr({href:a,paramName:e.tokenParamName||sr})}function so(e){var l,g;if(!e.equipmentValue)throw Bt(3002);let o=e.tokenParamName||sr,a=cr({href:e.redirectUrl||hn(),paramName:o});if(!a)throw Bt(3025);let p=new URLSearchParams({useAgent:e.useAgent||"douyin",category:e.category||"pay",internal:String((l=e.internal)!=null?l:!1),silent:String((g=e.silent)!=null?g:!1),equipmentValue:e.equipmentValue,redirectUrl:a});return`${e.authPath||oo}?${p.toString()}`}function fr(e){if(!Ye())throw Bt(3025);let o=so(e);w.info("\u8DF3\u8F6C\u6296\u97F3\u6388\u6743:",{authUrl:o,equipmentValue:e.equipmentValue});try{return window.location.href=o,o}catch(a){throw w.error("redirectDyAuth error:",a),Bt(3026)}}function Xe(){if(!Ye())return null;let e=window;return e.DouyinOpenJSBridge||e.douyin_open||null}function dr(e={}){if(!Ye())return Promise.reject(Bt(3025));let o=Xe();if(o)return w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5DF2\u52A0\u8F7D"),Promise.resolve(o);if(xe)return w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u590D\u7528\u52A0\u8F7D\u4E2D\u4EFB\u52A1"),xe;let a=e.sdkUrl||io;return w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5F00\u59CB\u52A0\u8F7D",{sdkUrl:a}),xe=new Promise((p,l)=>{let g=co(a),A=()=>{let M=Xe();if(!M){l(Bt(3027));return}w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u6210\u529F"),p(M)},E=M=>{w.error("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u5931\u8D25",M),l(Bt(3027))};if(g){if(w.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u811A\u672C\u5DF2\u5B58\u5728"),lo(g)){window.setTimeout(A,0);return}g.addEventListener("load",A,{once:!0}),g.addEventListener("error",E,{once:!0});return}let L=document.createElement("script");L.src=a,L.async=!0,L.addEventListener("load",A,{once:!0}),L.addEventListener("error",M=>{L.remove(),E(M)},{once:!0}),document.head.appendChild(L)}).catch(p=>{throw xe=null,p}),xe}function yr(e){let o=e.sdk||Xe();if(!o)return Promise.reject(Bt(3027));let{appId:a,signatureData:p,url:l}=e;return!a||!l||!(p!=null&&p.signature)||!(p!=null&&p.timestamp)||!(p!=null&&p.nonceStr)?Promise.reject(Bt(3028)):new Promise((g,A)=>{w.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u5F00\u59CB\u914D\u7F6E",{appId:a,url:l});try{o.config({params:{client_key:a,signature:p.signature,timestamp:String(p.timestamp),nonce_str:p.nonceStr,url:l}}),o.ready(()=>{w.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5B8C\u6210"),g(o)}),o.error(E=>{w.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5931\u8D25",E),A(Bt(3028))})}catch(E){w.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5F02\u5E38",E),A(Bt(3028))}})}function pr(e){let o=e.sdk||Xe();if(!o)return Promise.reject(Bt(3027));if(!o.ttcjpay||typeof o.ttcjpay.dypay!="function")return Promise.reject(Bt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));let{appId:a,payInfo:p}=e;if(!a||!p)return Promise.reject(Bt(3021));let l={appId:a,timeStamp:String(p.timeStamp),nonceStr:p.nonceStr,package:p.package,signType:p.signType,paySign:p.paySign};return new Promise((g,A)=>{w.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528 dypay");try{o.ttcjpay.dypay({sdk_info:JSON.stringify(l),success:E=>{if(w.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u6210\u529F\u56DE\u8C03",E),(E==null?void 0:E.code)===-2){A(Bt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}g(E)},fail:E=>{if(w.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u5931\u8D25\u56DE\u8C03",E),(E==null?void 0:E.code)===-2){A(Bt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}A(Bt(3029,(E==null?void 0:E.message)||(E==null?void 0:E.errMsg)))}})}catch(E){w.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528\u5F02\u5E38",E),A(Bt(3029,E==null?void 0:E.message))}})}function hr(){return Ye()?window.location.origin:"https://bi-nova.local"}function uo(e){return!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)&&!e.startsWith("//")}function co(e){return Array.from(document.getElementsByTagName("script")).find(a=>a.src===e)||null}function lo(e){let o=e.readyState;return o==="loaded"||o==="complete"}function fo(e,o){let a=e.indexOf("#"),p=a>=0?e.slice(0,a):e,l=a>=0?e.slice(a):"",g=p.indexOf("?");if(g<0)return e;let A=p.slice(0,g),L=p.slice(g+1).split("&").filter(M=>M&&decodeURIComponent(M.split("=")[0])!==o).join("&");return`${A}${L?`?${L}`:""}${l}`}async function We(e){var a,p,l,g;let o=Wn(e);if(!o.valid)return k(o.errorCode,gt[o.errorCode]);try{let A=e.returnType||"h5",E=await er({price:e.price,equipmentValue:e.equipmentValue,businessType:e.businessType,douyinOrderExtendData:(e==null?void 0:e.douyinOrderExtendData)||"",platformActivities:(e==null?void 0:e.platformActivities)||{},douyinCommodityVirtualFlag:(e==null?void 0:e.douyinCommodityVirtualFlag)||!1}),L=A==="jsapi"?await or({requestNo:ur({key:"requestNo"})}):void 0,M=await nr(zt(at(zt(at({},E.body),{telephone:e.telephone,equipmentValue:e.equipmentValue,businessType:e.businessType}),e.unifiedOrderExtendData&&{unifiedOrderExtendData:e.unifiedOrderExtendData}),{returnType:A,jsapiInfo:L}));if(e.returnType==="ulink")return k(0,"success",{ulinkQueryParams:M});let pt=((a=M==null?void 0:M.body)==null?void 0:a.h5Url)||"",rt=((p=M==null?void 0:M.body)==null?void 0:p.outTradeNo)||"";if(A==="jsapi"){let kt=yo((l=M==null?void 0:M.body)==null?void 0:l.payInfo);return k(0,"success",{appId:(L==null?void 0:L.appId)||"",payInfo:kt,outTradeNo:rt})}let X=pt?await ho(zt(at({},e),{dyUrl:pt})):"";return X?k(0,"success",{h5Url:X,outTradeNo:rt}):k(3010,gt[3010])}catch(A){w.error("handleDyPayFlow error:",A);let E=(g=A==null?void 0:A.code)!=null?g:3012,L=(A==null?void 0:A.message)||gt[3012];return k(E,L)}}function yo(e){if(!e)throw{code:3021,message:gt[3021]};try{let o=JSON.parse(e);if(!po(o))throw new Error("invalid payInfo fields");return o}catch(o){throw{code:3022,message:gt[3022],error:o}}}function po(e){return typeof e.timeStamp=="string"&&e.timeStamp!==""&&typeof e.nonceStr=="string"&&e.nonceStr!==""&&typeof e.package=="string"&&e.package!==""&&typeof e.signType=="string"&&e.signType!==""&&typeof e.paySign=="string"&&e.paySign!==""}async function ho(e){let o=pe(),a=He(o.env||"prod",""),p=typeof o.getAuthToken=="function"?await o.getAuthToken():"",l=e.client||"weapp";return`${a}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${l}&equipmentId=${e.equipmentValue}&dyUrl=${e.dyUrl}&fromUrl=${encodeURIComponent(e.fromUrl||"")}&backUrl=${encodeURIComponent(e.backUrl||"")}&backWay=${e.backWay||""}&url_token=${p}`}async function Qe(e){var a;let o=$n(e);if(!o.valid)return k(o.errorCode,gt[o.errorCode]);try{let p=await rr({price:(e==null?void 0:e.price)||"",equipmentValue:e.equipmentValue,telephone:(e==null?void 0:e.telephone)||""});return k(0,"success",p.body)}catch(p){w.error("getDyPayRtaData error:",p);let l=(a=p==null?void 0:p.code)!=null?a:3015,g=(p==null?void 0:p.message)||gt[3015];return k(l,g)}}async function _r(e){var a,p;let o=zn(e);if(!o.valid)return k(o.errorCode,gt[o.errorCode]);try{let l=(a=e.commandUrl)==null?void 0:a.trim(),A=(await ar(at({phone:e.telephone,equipmentValue:e.equipmentValue,orderAmount:e.orderAmount,businessType:e.businessType},l?{commandUrl:l}:{}))).body||"";return A?k(0,"success",{command:A}):k(3032,gt[3032])}catch(l){w.error("getDyPayCommand error:",l);let g=(p=l==null?void 0:l.code)!=null?p:3033,A=(l==null?void 0:l.message)||gt[3033];return k(g,A)}}async function _o(e){var a;let o=await _r(e);if(o.code!==0||!((a=o.data)!=null&&a.command))return k(o.code,o.message);try{return await Ce(o.data.command),k(0,"success",at({type:"copy_success"},e.returnCommand?{command:o.data.command}:{}))}catch(p){return w.error("copyDyPayCommand error:",p),k(3034,gt[3034])}}async function _n(e){var a,p,l;let o=Zn(e);if(!o.valid)return k(o.errorCode,gt[o.errorCode]);try{let g=await Qe({telephone:e.telephone,equipmentValue:e.equipmentValue,price:e.price});if(g.code!==0)return k(g.code,g.message);let A=g.data;if(!(A!=null&&A.showFlag))return k(0,"success",{eligible:!1,type:"not_eligible"});if(!tr(A))return k(3035,gt[3035]);let E={telephone:e.telephone,equipmentValue:e.equipmentValue,orderAmount:A.payAmount,businessType:A.businessType,commandUrl:e.commandUrl};if(e.autoCopy){let M=await _o(zt(at({},E),{returnCommand:e.returnCommand}));return M.code!==0?k(M.code,M.message):k(0,"success",at({eligible:!0,type:"copy_success"},(a=M.data)!=null&&a.command?{command:M.data.command}:{}))}let L=await _r(E);return L.code!==0||!((p=L.data)!=null&&p.command)?k(L.code,L.message):k(0,"success",{eligible:!0,type:"command",command:L.data.command})}catch(g){w.error("handleDyPayCommandFlow error:",g);let A=(l=g==null?void 0:g.code)!=null?l:3033,E=(g==null?void 0:g.message)||gt[3033];return k(A,E)}}async function mn(e){var a,p,l;let o=Qn(e);if(!o.valid)return k(o.errorCode,gt[o.errorCode]);try{let g=pe(),A=e.authToken||(typeof g.getAuthToken=="function"?await g.getAuthToken():""),E=e.autoAuth!==!1;if(!A){if(!E)return k(3030,gt[3030]);let kt=fr({equipmentValue:e.equipmentValue,redirectUrl:e.redirectUrl,tokenParamName:e.tokenParamName});return k(0,"redirecting",{type:"auth_redirect",authUrl:kt})}let L=await dr({sdkUrl:e.sdkUrl}),M=await We(zt(at({},e),{client:"h5",returnType:"jsapi"}));if(M.code!==0||!((a=M.data)!=null&&a.appId)||!((p=M.data)!=null&&p.payInfo))return k(M.code||3021,M.message||gt[3021]);let pt=e.signatureUrl||lr({tokenParamName:e.tokenParamName}),rt=await ir({url:pt});await yr({appId:M.data.appId,signatureData:rt,url:pt,sdk:L});let X=await pr({appId:M.data.appId,payInfo:M.data.payInfo,sdk:L});return k(0,"success",{type:"pay_result",outTradeNo:M.data.outTradeNo,payResult:X})}catch(g){w.error("handleDyJsapiPayFlow error:",g);let A=(l=g==null?void 0:g.code)!=null?l:3029,E=(g==null?void 0:g.message)||gt[3029];return k(A,E)}}var In={};je(In,{getDisplayAdConfig:()=>vn,normalizeDisplayAdData:()=>$e});var mo=Te();function mr(e){let o=Oe(e,["placementId"]);if(!o.valid)return Promise.reject({code:"PARAM_ERROR",message:o.message});let a=pe().env||"prod";return mo.get(`/gw/advert-plugin/api/v1/config/list/valid/${e.placementId}`,{},{authRequired:!1,baseDomain:On(a)})}var gr=30*1e3,go="__",Dn=new Map,An=new Map;function Ao(e,o){return[e.appId||"",o,e.type||""].join(go)}function Do(e){let o=Dn.get(e);return o?o.expireAt<=Date.now()?(Dn.delete(e),w.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:e}),null):o.data:null}function vo(e,o){Dn.set(e,{data:o,expireAt:Date.now()+gr})}function Io(e){return Array.isArray(e==null?void 0:e.body)?e.body:[]}function Po(e){return String(e==null?void 0:e.code)!=="200"}function Eo(e,o){let a=String(e||o||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(a)?a:o||"banner"}function Ar(e){return String(e||"").trim().toLowerCase()}function So(e){var o;return!!e&&e.status!==0&&((o=e.platformConfig)==null?void 0:o.valid)!==!1}function Ro(e){return[...e].sort((o,a)=>{var g,A,E,L;let p=Number((g=o.priority)!=null?g:9999),l=Number((A=a.priority)!=null?A:9999);return p!==l?p-l:Number((E=a.weight)!=null?E:0)-Number((L=o.weight)!=null?L:0)})}function Dr(e){return e.find(o=>Ar(o.advertPlatform)==="gdt")||null}function vr(e){return e.find(o=>Ar(o.advertPlatform)!=="gdt")||null}function To(e,o){return e&&o?"mixed":e?"wechat":o?"custom":"none"}function wo(e,o){var l,g;let a=Dr(e),p=vr(e);return a&&p?Number((l=a.priority)!=null?l:9999)<=Number((g=p.priority)!=null?g:9999)?"wechat-first":"custom-first":o==="custom"?"custom-only":o==="wechat"?"wechat-only":"wechat-first"}function bo(e){var a;let o=Dr(e);return((a=o==null?void 0:o.platformConfig)==null?void 0:a.adId)||""}function No(e){let o=vr(e),a=o==null?void 0:o.platformConfig;if(!a)return null;let p=a.image||a.imageUrl||"",l=a.video||a.videoUrl||"",g=a.poster||p||"",A=a.jumpUrl||a.url||a.webUrl||"";return!p&&!l?null:{image:p||void 0,video:l||void 0,poster:g||void 0,title:a.title,description:a.description,buttonText:a.buttonText,badgeText:a.badgeText,jumpSeconds:a.jumpSeconds,loadTimeout:a.loadTimeout||a.timeout,muted:a.muted,adSpec:a.adSpec,url:A||void 0,action:A?{type:"web",url:A}:void 0}}function $e(e,o){let a=Ro(e.filter(So)),p=No(a),l=bo(a),g=Eo(void 0,o),A=To(l,p),E=wo(a,A);return{show:!!(l||p),adId:"",type:g,provider:A,priority:E,unitId:l,customAd:p,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:e}}async function vn(e){let o=e.placementId||e.adId||"",a=Ao(e,o),p=Do(a);if(p)return w.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:a,placementId:o}),k(Yt.SUCCESS,"\u6210\u529F",p);let l=An.get(a);if(l)return w.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:a,placementId:o}),l;let g=(async()=>{try{w.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",e);let A=await mr({placementId:o}),E=Io(A);if(w.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:a,placementId:o,response:A,body:E}),Po(A)||!E)return w.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",A),k(Yt.UNKNOWN_ERROR,(A==null?void 0:A.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");let L=$e(E,e.type);return L.adId=o,L.cache=zt(at({},L.cache),{enable:!0,ttl:gr}),vo(a,L),w.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:a,placementId:o,provider:L.provider,priority:L.priority,hasUnitId:!!L.unitId,hasCustomAd:!!L.customAd}),k(Yt.SUCCESS,"\u6210\u529F",L)}catch(A){return w.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:a,placementId:o,error:A}),k(Yt.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{An.delete(a)}})();return An.set(a,g),g}function Co(e={}){w.info("\u670D\u52A1\u521D\u59CB\u5316",e);let o=at(at({},Re),e);o.env&&!Ve[o.env]&&(w.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${o.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),o.env=Qt.PROD),o.externalEnv&&!Ne[o.externalEnv]&&(w.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${o.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),o.externalEnv=le.PROD),o.debug!==void 0&&w.setEnable(o.debug),Ln(o),w.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",o)}function Ir(e={}){let o="",a=null;async function p(){if(typeof e.getAuthToken=="function"){let g=await e.getAuthToken();if(g)return g}return a&&typeof a.getStorage=="function"&&a.getStorage("auth_token")||""}let l={name:"services",setToken(g){return o=g||"",a&&typeof a.setStorage=="function"&&a.setStorage("auth_token",o),l},async getAuthToken(){return o||p()},clearToken(){return o="",a&&typeof a.setStorage=="function"&&a.setStorage("auth_token",""),l},install(g){a=g;let A=zt(at({},e),{getAuthToken:()=>l.getAuthToken()});Co(A),w.info("services installed via nova.use()"),Object.assign(g,{jd:at({},pn),dy:at({},gn),ads:at({},In),setToken:l.setToken,clearToken:l.clearToken})}};return l}0&&(module.exports={DyErrorCode,DyErrorMessage,ENV_TYPE,EXTERNAL_ENV_TYPE,JdErrorCode,JdErrorMessage,createServices,getDisplayAdConfig,getDyPayRtaData,handleDyJsapiPayFlow,handleDyPayCommandFlow,handleDyPayFlow,handleJdInsurance,handleJdInsuranceExt,handleJdjrCashLoanExt,handleJdjrCashLoanFlow,normalizeDisplayAdData});
|
|
5
5
|
/*! For license information please see LyyGetCommandSDK.min.js.LICENSE.txt */
|