@bi-nova/services 1.6.2 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";var We=Object.defineProperty,$r=Object.defineProperties,zr=Object.getOwnPropertyDescriptor,Zr=Object.getOwnPropertyDescriptors,to=Object.getOwnPropertyNames,kn=Object.getOwnPropertySymbols;var qn=Object.prototype.hasOwnProperty,eo=Object.prototype.propertyIsEnumerable;var dn=(t,n,a)=>n in t?We(t,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[n]=a,et=(t,n)=>{for(var a in n||(n={}))qn.call(n,a)&&dn(t,a,n[a]);if(kn)for(var a of kn(n))eo.call(n,a)&&dn(t,a,n[a]);return t},zt=(t,n)=>$r(t,Zr(n));var no=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports),Qe=(t,n)=>{for(var a in n)We(t,a,{get:n[a],enumerable:!0})},ro=(t,n,a,f)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of to(n))!qn.call(t,l)&&l!==a&&We(t,l,{get:()=>n[l],enumerable:!(f=zr(n,l))||f.enumerable});return t};var oo=t=>ro(We({},"__esModule",{value:!0}),t);var $e=(t,n,a)=>dn(t,typeof n!="symbol"?n+"":n,a);var rr=no((Oi,nr)=>{"use strict";(()=>{var t={737:(l,d,g)=>{"use strict";g.r(d),g.d(d,{default:()=>F,getJrCommand:()=>w});var P=g(307),T=g.n(P);function x(){x=function(){return X};var D,X={},Pt=Object.prototype,dt=Pt.hasOwnProperty,vt=Object.defineProperty||function(p,_,A){p[_]=A.value},_t=typeof Symbol=="function"?Symbol:{},At=_t.iterator||"@@iterator",St=_t.asyncIterator||"@@asyncIterator",Et=_t.toStringTag||"@@toStringTag";function ht(p,_,A){return Object.defineProperty(p,_,{value:A,enumerable:!0,configurable:!0,writable:!0}),p[_]}try{ht({},"")}catch(p){ht=function(_,A,M){return _[A]=M}}function Gt(p,_,A,M){var v=_&&_.prototype instanceof ce?_:ce,q=Object.create(v.prototype),at=new ye(M||[]);return vt(q,"_invoke",{value:Ft(p,A,at)}),q}function Kt(p,_,A){try{return{type:"normal",arg:p.call(_,A)}}catch(M){return{type:"throw",arg:M}}}X.wrap=Gt;var Vt="suspendedStart",Zt="suspendedYield",Xt="executing",N="completed",bt={};function ce(){}function se(){}function qt(){}var le={};ht(le,At,(function(){return this}));var ue=Object.getPrototypeOf,Ut=ue&&ue(ue(oe([])));Ut&&Ut!==Pt&&dt.call(Ut,At)&&(le=Ut);var Ht=qt.prototype=ce.prototype=Object.create(le);function Ae(p){["next","throw","return"].forEach((function(_){ht(p,_,(function(A){return this._invoke(_,A)}))}))}function te(p,_){function A(v,q,at,It){var gt=Kt(p[v],p,q);if(gt.type!=="throw"){var Wt=gt.arg,ee=Wt.value;return ee&&tt(ee)=="object"&&dt.call(ee,"__await")?_.resolve(ee.__await).then((function(Rt){A("next",Rt,at,It)}),(function(Rt){A("throw",Rt,at,It)})):_.resolve(ee).then((function(Rt){Wt.value=Rt,at(Wt)}),(function(Rt){return A("throw",Rt,at,It)}))}It(gt.arg)}var M;vt(this,"_invoke",{value:function(v,q){function at(){return new _((function(It,gt){A(v,q,It,gt)}))}return M=M?M.then(at,at):at()}})}function Ft(p,_,A){var M=Vt;return function(v,q){if(M===Xt)throw Error("Generator is already running");if(M===N){if(v==="throw")throw q;return{value:D,done:!0}}for(A.method=v,A.arg=q;;){var at=A.delegate;if(at){var It=Mt(at,A);if(It){if(It===bt)continue;return It}}if(A.method==="next")A.sent=A._sent=A.arg;else if(A.method==="throw"){if(M===Vt)throw M=N,A.arg;A.dispatchException(A.arg)}else A.method==="return"&&A.abrupt("return",A.arg);M=Xt;var gt=Kt(p,_,A);if(gt.type==="normal"){if(M=A.done?N:Zt,gt.arg===bt)continue;return{value:gt.arg,done:A.done}}gt.type==="throw"&&(M=N,A.method="throw",A.arg=gt.arg)}}}function Mt(p,_){var A=_.method,M=p.iterator[A];if(M===D)return _.delegate=null,A==="throw"&&p.iterator.return&&(_.method="return",_.arg=D,Mt(p,_),_.method==="throw")||A!=="return"&&(_.method="throw",_.arg=new TypeError("The iterator does not provide a '"+A+"' method")),bt;var v=Kt(M,p.iterator,_.arg);if(v.type==="throw")return _.method="throw",_.arg=v.arg,_.delegate=null,bt;var q=v.arg;return q?q.done?(_[p.resultName]=q.value,_.next=p.nextLoc,_.method!=="return"&&(_.method="next",_.arg=D),_.delegate=null,bt):q:(_.method="throw",_.arg=new TypeError("iterator result is not an object"),_.delegate=null,bt)}function re(p){var _={tryLoc:p[0]};1 in p&&(_.catchLoc=p[1]),2 in p&&(_.finallyLoc=p[2],_.afterLoc=p[3]),this.tryEntries.push(_)}function _e(p){var _=p.completion||{};_.type="normal",delete _.arg,p.completion=_}function ye(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(re,this),this.reset(!0)}function oe(p){if(p||p===""){var _=p[At];if(_)return _.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var A=-1,M=function v(){for(;++A<p.length;)if(dt.call(p,A))return v.value=p[A],v.done=!1,v;return v.value=D,v.done=!0,v};return M.next=M}}throw new TypeError(tt(p)+" is not iterable")}return se.prototype=qt,vt(Ht,"constructor",{value:qt,configurable:!0}),vt(qt,"constructor",{value:se,configurable:!0}),se.displayName=ht(qt,Et,"GeneratorFunction"),X.isGeneratorFunction=function(p){var _=typeof p=="function"&&p.constructor;return!!_&&(_===se||(_.displayName||_.name)==="GeneratorFunction")},X.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,qt):(p.__proto__=qt,ht(p,Et,"GeneratorFunction")),p.prototype=Object.create(Ht),p},X.awrap=function(p){return{__await:p}},Ae(te.prototype),ht(te.prototype,St,(function(){return this})),X.AsyncIterator=te,X.async=function(p,_,A,M,v){v===void 0&&(v=Promise);var q=new te(Gt(p,_,A,M),v);return X.isGeneratorFunction(_)?q:q.next().then((function(at){return at.done?at.value:q.next()}))},Ae(Ht),ht(Ht,Et,"Generator"),ht(Ht,At,(function(){return this})),ht(Ht,"toString",(function(){return"[object Generator]"})),X.keys=function(p){var _=Object(p),A=[];for(var M in _)A.push(M);return A.reverse(),function v(){for(;A.length;){var q=A.pop();if(q in _)return v.value=q,v.done=!1,v}return v.done=!0,v}},X.values=oe,ye.prototype={constructor:ye,reset:function(p){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(_e),!p)for(var _ in this)_.charAt(0)==="t"&&dt.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=D)},stop:function(){this.done=!0;var p=this.tryEntries[0].completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var _=this;function A(gt,Wt){return q.type="throw",q.arg=p,_.next=gt,Wt&&(_.method="next",_.arg=D),!!Wt}for(var M=this.tryEntries.length-1;M>=0;--M){var v=this.tryEntries[M],q=v.completion;if(v.tryLoc==="root")return A("end");if(v.tryLoc<=this.prev){var at=dt.call(v,"catchLoc"),It=dt.call(v,"finallyLoc");if(at&&It){if(this.prev<v.catchLoc)return A(v.catchLoc,!0);if(this.prev<v.finallyLoc)return A(v.finallyLoc)}else if(at){if(this.prev<v.catchLoc)return A(v.catchLoc,!0)}else{if(!It)throw Error("try statement without catch or finally");if(this.prev<v.finallyLoc)return A(v.finallyLoc)}}}},abrupt:function(p,_){for(var A=this.tryEntries.length-1;A>=0;--A){var M=this.tryEntries[A];if(M.tryLoc<=this.prev&&dt.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var v=M;break}}v&&(p==="break"||p==="continue")&&v.tryLoc<=_&&_<=v.finallyLoc&&(v=null);var q=v?v.completion:{};return q.type=p,q.arg=_,v?(this.method="next",this.next=v.finallyLoc,bt):this.complete(q)},complete:function(p,_){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&_&&(this.next=_),bt},finish:function(p){for(var _=this.tryEntries.length-1;_>=0;--_){var A=this.tryEntries[_];if(A.finallyLoc===p)return this.complete(A.completion,A.afterLoc),_e(A),bt}},catch:function(p){for(var _=this.tryEntries.length-1;_>=0;--_){var A=this.tryEntries[_];if(A.tryLoc===p){var M=A.completion;if(M.type==="throw"){var v=M.arg;_e(A)}return v}}throw Error("illegal catch attempt")},delegateYield:function(p,_,A){return this.delegate={iterator:oe(p),resultName:_,nextLoc:A},this.method==="next"&&(this.arg=D),bt}},X}function ut(D,X,Pt,dt,vt,_t,At){try{var St=D[_t](At),Et=St.value}catch(ht){return void Pt(ht)}St.done?X(Et):Promise.resolve(Et).then(dt,vt)}function tt(D){return tt=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},tt(D)}var G="https://ms.jr.jd.com";function Ct(D){var X=D.host,Pt=D.type,dt=Pt===void 0?"post":Pt,vt=D.data,_t=D.path,At=_t===void 0?"":_t,St=D.config,Et=St===void 0?{}:St,ht=(Et.withCredentials,Et.isWG),Gt=ht===void 0||ht,Kt=Et.contentType,Vt=Kt===void 0?"application/x-www-form-urlencoded":Kt;return new Promise((function(Zt,Xt){wx.request({url:(X||G)+At,method:dt.toUpperCase(),data:Gt?S({reqData:JSON.stringify(vt)}):vt,header:{"content-type":Vt},success:function(N){N.statusCode===200?Zt(N.data):Xt({statusCode:N.statusCode,errMsg:N.errMsg,data:N.data})},fail:function(N){Xt(N)}})}))}function S(D){var X="";return tt(D)==="object"&&D!==null&&(Object.keys(D).map((function(Pt){var dt=D[Pt];return X+=Pt+"="+encodeURIComponent(dt)+"&",""})),X.length>0&&(X=X.substr(0,X.length-1))),X}function nt(D){return mt.apply(this,arguments)}function mt(){var D;return D=x().mark((function X(Pt){var dt,vt,_t,At,St,Et,ht,Gt,Kt,Vt;return x().wrap((function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return dt=Pt.url,vt=Pt.channel,_t=Pt.callback,T().init(),At=new(T()),St=At.nonce(),Et=At.sign(JSON.stringify({t:"".concat(new Date().getTime())}),St),ht="/gw/generic/app/h5/m/execute1/ug-service-orchestrator".concat(""),Gt="",Kt={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:dt,channel:vt,clientCode:"0",antiRushInfo:Et}},Zt.next=12,Ct({host:"https://ms.jr.jd.com",type:"post",path:ht,config:{withCredentials:!0},data:Kt});case 12:(Vt=Zt.sent).resultCode===0&&Vt.resultData&&Vt.resultData.code==="00000"&&Vt.resultData.data&&(Gt=Vt.resultData.data.goldenKeyText),_t&&_t(Gt?{code:"0",msg:"command success",data:Gt}:{code:"-1",msg:"command empty"});case 15:case"end":return Zt.stop()}}),X)})),mt=function(){var X=this,Pt=arguments;return new Promise((function(dt,vt){var _t=D.apply(X,Pt);function At(Et){ut(_t,dt,vt,At,St,"next",Et)}function St(Et){ut(_t,dt,vt,At,St,"throw",Et)}At(void 0)}))},mt.apply(this,arguments)}function st(D){return st=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},st(D)}function H(){H=function(){return X};var D,X={},Pt=Object.prototype,dt=Pt.hasOwnProperty,vt=Object.defineProperty||function(p,_,A){p[_]=A.value},_t=typeof Symbol=="function"?Symbol:{},At=_t.iterator||"@@iterator",St=_t.asyncIterator||"@@asyncIterator",Et=_t.toStringTag||"@@toStringTag";function ht(p,_,A){return Object.defineProperty(p,_,{value:A,enumerable:!0,configurable:!0,writable:!0}),p[_]}try{ht({},"")}catch(p){ht=function(_,A,M){return _[A]=M}}function Gt(p,_,A,M){var v=_&&_.prototype instanceof ce?_:ce,q=Object.create(v.prototype),at=new ye(M||[]);return vt(q,"_invoke",{value:Ft(p,A,at)}),q}function Kt(p,_,A){try{return{type:"normal",arg:p.call(_,A)}}catch(M){return{type:"throw",arg:M}}}X.wrap=Gt;var Vt="suspendedStart",Zt="suspendedYield",Xt="executing",N="completed",bt={};function ce(){}function se(){}function qt(){}var le={};ht(le,At,(function(){return this}));var ue=Object.getPrototypeOf,Ut=ue&&ue(ue(oe([])));Ut&&Ut!==Pt&&dt.call(Ut,At)&&(le=Ut);var Ht=qt.prototype=ce.prototype=Object.create(le);function Ae(p){["next","throw","return"].forEach((function(_){ht(p,_,(function(A){return this._invoke(_,A)}))}))}function te(p,_){function A(v,q,at,It){var gt=Kt(p[v],p,q);if(gt.type!=="throw"){var Wt=gt.arg,ee=Wt.value;return ee&&st(ee)=="object"&&dt.call(ee,"__await")?_.resolve(ee.__await).then((function(Rt){A("next",Rt,at,It)}),(function(Rt){A("throw",Rt,at,It)})):_.resolve(ee).then((function(Rt){Wt.value=Rt,at(Wt)}),(function(Rt){return A("throw",Rt,at,It)}))}It(gt.arg)}var M;vt(this,"_invoke",{value:function(v,q){function at(){return new _((function(It,gt){A(v,q,It,gt)}))}return M=M?M.then(at,at):at()}})}function Ft(p,_,A){var M=Vt;return function(v,q){if(M===Xt)throw Error("Generator is already running");if(M===N){if(v==="throw")throw q;return{value:D,done:!0}}for(A.method=v,A.arg=q;;){var at=A.delegate;if(at){var It=Mt(at,A);if(It){if(It===bt)continue;return It}}if(A.method==="next")A.sent=A._sent=A.arg;else if(A.method==="throw"){if(M===Vt)throw M=N,A.arg;A.dispatchException(A.arg)}else A.method==="return"&&A.abrupt("return",A.arg);M=Xt;var gt=Kt(p,_,A);if(gt.type==="normal"){if(M=A.done?N:Zt,gt.arg===bt)continue;return{value:gt.arg,done:A.done}}gt.type==="throw"&&(M=N,A.method="throw",A.arg=gt.arg)}}}function Mt(p,_){var A=_.method,M=p.iterator[A];if(M===D)return _.delegate=null,A==="throw"&&p.iterator.return&&(_.method="return",_.arg=D,Mt(p,_),_.method==="throw")||A!=="return"&&(_.method="throw",_.arg=new TypeError("The iterator does not provide a '"+A+"' method")),bt;var v=Kt(M,p.iterator,_.arg);if(v.type==="throw")return _.method="throw",_.arg=v.arg,_.delegate=null,bt;var q=v.arg;return q?q.done?(_[p.resultName]=q.value,_.next=p.nextLoc,_.method!=="return"&&(_.method="next",_.arg=D),_.delegate=null,bt):q:(_.method="throw",_.arg=new TypeError("iterator result is not an object"),_.delegate=null,bt)}function re(p){var _={tryLoc:p[0]};1 in p&&(_.catchLoc=p[1]),2 in p&&(_.finallyLoc=p[2],_.afterLoc=p[3]),this.tryEntries.push(_)}function _e(p){var _=p.completion||{};_.type="normal",delete _.arg,p.completion=_}function ye(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(re,this),this.reset(!0)}function oe(p){if(p||p===""){var _=p[At];if(_)return _.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var A=-1,M=function v(){for(;++A<p.length;)if(dt.call(p,A))return v.value=p[A],v.done=!1,v;return v.value=D,v.done=!0,v};return M.next=M}}throw new TypeError(st(p)+" is not iterable")}return se.prototype=qt,vt(Ht,"constructor",{value:qt,configurable:!0}),vt(qt,"constructor",{value:se,configurable:!0}),se.displayName=ht(qt,Et,"GeneratorFunction"),X.isGeneratorFunction=function(p){var _=typeof p=="function"&&p.constructor;return!!_&&(_===se||(_.displayName||_.name)==="GeneratorFunction")},X.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,qt):(p.__proto__=qt,ht(p,Et,"GeneratorFunction")),p.prototype=Object.create(Ht),p},X.awrap=function(p){return{__await:p}},Ae(te.prototype),ht(te.prototype,St,(function(){return this})),X.AsyncIterator=te,X.async=function(p,_,A,M,v){v===void 0&&(v=Promise);var q=new te(Gt(p,_,A,M),v);return X.isGeneratorFunction(_)?q:q.next().then((function(at){return at.done?at.value:q.next()}))},Ae(Ht),ht(Ht,Et,"Generator"),ht(Ht,At,(function(){return this})),ht(Ht,"toString",(function(){return"[object Generator]"})),X.keys=function(p){var _=Object(p),A=[];for(var M in _)A.push(M);return A.reverse(),function v(){for(;A.length;){var q=A.pop();if(q in _)return v.value=q,v.done=!1,v}return v.done=!0,v}},X.values=oe,ye.prototype={constructor:ye,reset:function(p){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(_e),!p)for(var _ in this)_.charAt(0)==="t"&&dt.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=D)},stop:function(){this.done=!0;var p=this.tryEntries[0].completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var _=this;function A(gt,Wt){return q.type="throw",q.arg=p,_.next=gt,Wt&&(_.method="next",_.arg=D),!!Wt}for(var M=this.tryEntries.length-1;M>=0;--M){var v=this.tryEntries[M],q=v.completion;if(v.tryLoc==="root")return A("end");if(v.tryLoc<=this.prev){var at=dt.call(v,"catchLoc"),It=dt.call(v,"finallyLoc");if(at&&It){if(this.prev<v.catchLoc)return A(v.catchLoc,!0);if(this.prev<v.finallyLoc)return A(v.finallyLoc)}else if(at){if(this.prev<v.catchLoc)return A(v.catchLoc,!0)}else{if(!It)throw Error("try statement without catch or finally");if(this.prev<v.finallyLoc)return A(v.finallyLoc)}}}},abrupt:function(p,_){for(var A=this.tryEntries.length-1;A>=0;--A){var M=this.tryEntries[A];if(M.tryLoc<=this.prev&&dt.call(M,"finallyLoc")&&this.prev<M.finallyLoc){var v=M;break}}v&&(p==="break"||p==="continue")&&v.tryLoc<=_&&_<=v.finallyLoc&&(v=null);var q=v?v.completion:{};return q.type=p,q.arg=_,v?(this.method="next",this.next=v.finallyLoc,bt):this.complete(q)},complete:function(p,_){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&_&&(this.next=_),bt},finish:function(p){for(var _=this.tryEntries.length-1;_>=0;--_){var A=this.tryEntries[_];if(A.finallyLoc===p)return this.complete(A.completion,A.afterLoc),_e(A),bt}},catch:function(p){for(var _=this.tryEntries.length-1;_>=0;--_){var A=this.tryEntries[_];if(A.tryLoc===p){var M=A.completion;if(M.type==="throw"){var v=M.arg;_e(A)}return v}}throw Error("illegal catch attempt")},delegateYield:function(p,_,A){return this.delegate={iterator:oe(p),resultName:_,nextLoc:A},this.method==="next"&&(this.arg=D),bt}},X}function wt(D,X,Pt,dt,vt,_t,At){try{var St=D[_t](At),Et=St.value}catch(ht){return void Pt(ht)}St.done?X(Et):Promise.resolve(Et).then(dt,vt)}function w(D){return O.apply(this,arguments)}function O(){var D;return D=H().mark((function X(Pt){var dt,vt,_t;return H().wrap((function(At){for(;;)switch(At.prev=At.next){case 0:return dt=Pt.url,vt=Pt.channel,_t=Pt.callback,At.next=3,nt({url:dt,channel:vt,callback:_t});case 3:case"end":return At.stop()}}),X)})),O=function(){var X=this,Pt=arguments;return new Promise((function(dt,vt){var _t=D.apply(X,Pt);function At(Et){wt(_t,dt,vt,At,St,"next",Et)}function St(Et){wt(_t,dt,vt,At,St,"throw",Et)}At(void 0)}))},O.apply(this,arguments)}var L={getJrCommand:w};(l=g.hmd(l)).exports&&(l.exports=L,l.exports.getJrCommand=w),typeof window!="undefined"&&(window.LyyGetCommandSDK=L);let F=L},307:function(l,d,g){var P,T,x;function ut(tt){return ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(G){return typeof G}:function(G){return G&&typeof Symbol=="function"&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":typeof G},ut(tt)}x=function(){"use strict";function tt(e){return(tt=typeof Symbol=="function"&&ut(Symbol.iterator)=="symbol"?function(o){return ut(o)}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":ut(o)})(e)}function G(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}function Ct(e,o){for(var u=0;u<o.length;u++){var c=o[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(e,c.key,c)}}function S(e,o,u){return o&&Ct(e.prototype,o),u&&Ct(e,u),e}function nt(e,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(o&&o.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),o&&st(e,o)}function mt(e){return(mt=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(e)}function st(e,o){return(st=Object.setPrototypeOf||function(u,c){return u.__proto__=c,u})(e,o)}function H(e){var o=(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=mt(e);return(function(h,m){if(m&&(ut(m)=="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(R){if(R===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R})(h)})(this,o?(u=mt(this).constructor,Reflect.construct(c,arguments,u)):c.apply(this,arguments))}}function wt(e){return(function(o){if(Array.isArray(o))return w(o)})(e)||(function(o){if(typeof Symbol!="undefined"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)})(e)||(function(o,u){if(o){if(typeof o=="string")return w(o,u);var c=Object.prototype.toString.call(o).slice(8,-1);return(c=c==="Object"&&o.constructor?o.constructor.name:c)==="Map"||c==="Set"?Array.from(o):c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?w(o,u):void 0}})(e)||(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 w(e,o){(o==null||o>e.length)&&(o=e.length);for(var u=0,c=new Array(o);u<o;u++)c[u]=e[u];return c}var O=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:g.g!==void 0?g.g:typeof self!="undefined"?self:{},L=!1,F=!1,D={console:!0,focus:!1,time:!1,length:!0,infinite:!1,time_interval:500,time_threshold:100,length_threshold:300},X=function(){typeof document!="undefined"&&document.hasFocus&&!document.hasFocus()&&(F=!0)},Pt=function(){var e=Date.now();Date.now()-e>D.time_threshold&&(F=!0)},dt=function(){var e=O.outerWidth,o=O.outerHeight,u=O.innerWidth,c=O.innerHeight;e&&o&&u&&c&&typeof e=="number"&&typeof o=="number"&&typeof u=="number"&&typeof c=="number"&&(e-u>D.length_threshold||o-c>D.length_threshold)&&(F=!0)};(Ft={}).start=function(e){if(!L){if(e&&tt(e)==="object")for(var o in e)D[o]=e[o];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);')():F=!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 F=!0,Date.now()}})(),D.focus&&X(),D.time&&Pt(),D.length&&dt(),u=setInterval((function(){u&&F&&clearInterval(u),D.focus&&X(),D.time&&Pt(),D.length&&dt()}),D.time_interval),L=!0}},Ft.isDebug=function(){return F};var vt=Ft,_t=".123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-!",At={my_b4_encode:function(e){var o=0,u=(j=0)<e.length%3?3-e.length%3:0;for(o=0;o<u;o++)e[e.length]=0;var c="";for(j=0;j<e.length;j+=3)0<j&&j%57==0&&(c+=`
3
- `),c+=_t[e[j]>>2]+_t[(3&e[j])<<4|e[j+1]>>4]+_t[(15&e[j+1])<<2|e[j+2]>>6]+_t[63&e[j+2]];for(o=0;o<u;o++)c+=_t[64];return c},my_b4_decode:function(e){var o=0,u=0,c=(e=e.replace(/[^A-Za-z0-9\+\-\!\.]/g,"")).length%4;if(2<c)return null;for(o=0;o<c;o++)if(e.charAt(e.length-o-1)!=_t[64])return null;var h,m,R,Y,C=new Array(3*(e.length-c)/4);for(o=0,u=0;u<C.length;)h=_t.indexOf(e.charAt(o++)),m=_t.indexOf(e.charAt(o++)),R=_t.indexOf(e.charAt(o++)),Y=_t.indexOf(e.charAt(o++)),C[u++]=h<<2|m>>4,C[u++]=(15&m)<<4|R>>2,C[u++]=(3&R)<<6|Y;for(o=0;o<c;o++)if(C.pop()!=0)return null;return C}},St="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Et={b4_encode:function(e){var o=0,u=(j=0)<e.length%3?3-e.length%3:0;for(o=0;o<u;o++)e[e.length]=0;var c="";for(o=0;j<e.length;j+=3)0<j&&j%57==0&&(c+=`
4
- `),c+=St[e[j]>>2]+St[(3&e[j])<<4|e[j+1]>>4]+St[(15&e[j+1])<<2|e[j+2]>>6]+St[63&e[j+2]];for(o=0;o<u;o++)c+="=";return c},b4_decode:function(e){var o=0,u=0,c=(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length%4;if(2<c)return null;for(o=0;o<c;o++)if(e.charAt(e.length-o-1)!="=")return null;var h,m,R,Y,C=new Array(3*(e.length-c)/4);for(o=0,u=0;u<C.length;)h=St.indexOf(e.charAt(o++)),m=St.indexOf(e.charAt(o++)),R=St.indexOf(e.charAt(o++)),Y=St.indexOf(e.charAt(o++)),C[u++]=h<<2|m>>4,C[u++]=(15&m)<<4|R>>2,C[u++]=(3&R)<<6|Y;for(o=0;o<c;o++)if(C.pop()!=0)return null;return C}};function ht(){}ht.encode=function(e,o,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"),m=o,R=0;m<u+o;m++,R++)c[R]=h[(255&e[m])>>4],c[++R]=h[15&e[m]];return c.join("")},ht.decode=function(e){if(e==null||e==""||e.length%2!=0)return null;for(var o=e.length/2,u=ht.toCharCodeArray(e),c=new Array(o),h=0;h<o;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(e){for(var o=new Array(e.length),u=0;u<e.length;u++)o[u]=e.charCodeAt(u);return o};var Gt=ht,Kt=Gt;(Mt=function(){}).utf8StrToh6=function(e){e=encodeURIComponent(e);for(var o=unescape(e),u=o.length,c=[],h=0;h<u;h++)c[h]=o.charCodeAt(h).toString(16);return c.join("")},Mt.utf8StrToBytes=function(e){e=encodeURIComponent(e);for(var o=unescape(e),u=o.length,c=[],h=0;h<u;h++)c[h]=o.charCodeAt(h);return c},Mt.hexToUtf8Str=function(e){for(var o=Kt.decode(e),u=[],c=0;c<o.length;c++)u.push(String.fromCharCode(o[c]));return decodeURIComponent(escape(u.join("")))},Mt.bytesToUtf8Str=function(e){for(var o=e,u=[],c=0;c<o.length;c++)u.push(String.fromCharCode(o[c]));return decodeURIComponent(escape(u.join("")))},Mt.intToByte=function(e){return new Array(e>>24&255,e>>16&255,e>>8&255,255&e)},Mt.byteToInt=function(e,o){return o+3<e.length?e[o]<<24|e[o+1]<<16|e[o+2]<<8|e[o+3]:o+2<e.length?e[o+1]<<16|e[o+2]<<8|e[o+3]:o+1<e.length?e[o]<<8|e[o+1]:e[o]};var Vt,Zt=Mt,Xt={exports:{}};Vt=Xt,function(){function e(r,i,s){r!=null&&(typeof r=="number"?this.fromNumber(r,i,s):i==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,i))}function o(){return new e(null)}var u=(u=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(e.prototype.am=function(r,i,s,y,I,U){for(var V=32767&i,k=i>>15;0<=--U;){var Lt=32767&this[r],$t=this[r++]>>15,fe=k*Lt+$t*V;I=((Lt=V*Lt+((32767&fe)<<15)+s[y]+(1073741823&I))>>>30)+(fe>>>15)+k*$t+(I>>>30),s[y++]=1073741823&Lt}return I},30):u&&navigator.appName!="Netscape"?(e.prototype.am=function(r,i,s,y,I,U){for(;0<=--U;){var V=i*this[r++]+s[y]+I;I=Math.floor(V/67108864),s[y++]=67108863&V}return I},26):(e.prototype.am=function(r,i,s,y,I,U){for(var V=16383&i,k=i>>14;0<=--U;){var Lt=16383&this[r],$t=this[r++]>>14,fe=k*Lt+$t*V;I=((Lt=V*Lt+((16383&fe)<<14)+s[y]+I)>>28)+(fe>>14)+k*$t,s[y++]=268435455&Lt}return I},28);e.prototype.DB=u,e.prototype.DM=(1<<u)-1,e.prototype.DV=1<<u,e.prototype.FV=Math.pow(2,52),e.prototype.F1=52-u,e.prototype.F2=2*u-52;for(var c=new Array,h=48,m=0;m<=9;++m)c[h++]=m;for(h=97,m=10;m<36;++m)c[h++]=m;for(h=65,m=10;m<36;++m)c[h++]=m;function R(r){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(r)}function Y(r,i){return(r=c[r.charCodeAt(i)])==null?-1:r}function C(r){var i=o();return i.fromInt(r),i}function ct(r){var i,s=1;return(i=r>>>16)!=0&&(r=i,s+=16),(i=r>>8)!=0&&(r=i,s+=8),(i=r>>4)!=0&&(r=i,s+=4),(i=r>>2)!=0&&(r=i,s+=2),(i=r>>1)!=0&&(r=i,s+=1),s}function lt(r){this.m=r}function b(r){this.m=r,this.mp=r.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<r.DB-15)-1,this.mt2=2*r.t}function W(r,i){return r&i}function rt(r,i){return r|i}function Z(r,i){return r^i}function ft(r,i){return r&~i}function pt(){}function Ot(r){return r}function B(r){this.r2=o(),this.q3=o(),e.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}lt.prototype.convert=function(r){return r.s<0||0<=r.compareTo(this.m)?r.mod(this.m):r},lt.prototype.revert=function(r){return r},lt.prototype.reduce=function(r){r.divRemTo(this.m,null,r)},lt.prototype.mulTo=function(r,i,s){r.multiplyTo(i,s),this.reduce(s)},lt.prototype.sqrTo=function(r,i){r.squareTo(i),this.reduce(i)},b.prototype.convert=function(r){var i=o();return r.abs().dlShiftTo(this.m.t,i),i.divRemTo(this.m,null,i),r.s<0&&0<i.compareTo(e.ZERO)&&this.m.subTo(i,i),i},b.prototype.revert=function(r){var i=o();return r.copyTo(i),this.reduce(i),i},b.prototype.reduce=function(r){for(;r.t<=this.mt2;)r[r.t++]=0;for(var i=0;i<this.m.t;++i){var s=32767&r[i],y=s*this.mpl+((s*this.mph+(r[i]>>15)*this.mpl&this.um)<<15)&r.DM;for(r[s=i+this.m.t]+=this.m.am(0,y,r,i,0,this.m.t);r[s]>=r.DV;)r[s]-=r.DV,r[++s]++}r.clamp(),r.drShiftTo(this.m.t,r),0<=r.compareTo(this.m)&&r.subTo(this.m,r)},b.prototype.mulTo=function(r,i,s){r.multiplyTo(i,s),this.reduce(s)},b.prototype.sqrTo=function(r,i){r.squareTo(i),this.reduce(i)},e.prototype.copyTo=function(r){for(var i=this.t-1;0<=i;--i)r[i]=this[i];r.t=this.t,r.s=this.s},e.prototype.fromInt=function(r){this.t=1,this.s=r<0?-1:0,0<r?this[0]=r:r<-1?this[0]=r+this.DV:this.t=0},e.prototype.fromString=function(r,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(r,i);s=2}this.t=0,this.s=0;for(var y=r.length,I=!1,U=0;0<=--y;){var V=s==8?255&r[y]:Y(r,y);V<0?r.charAt(y)=="-"&&(I=!0):(I=!1,U==0?this[this.t++]=V:U+s>this.DB?(this[this.t-1]|=(V&(1<<this.DB-U)-1)<<U,this[this.t++]=V>>this.DB-U):this[this.t-1]|=V<<U,(U+=s)>=this.DB&&(U-=this.DB))}s==8&&128&r[0]&&(this.s=-1,0<U&&(this[this.t-1]|=(1<<this.DB-U)-1<<U)),this.clamp(),I&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var r=this.s&this.DM;0<this.t&&this[this.t-1]==r;)--this.t},e.prototype.dlShiftTo=function(r,i){for(var s=this.t-1;0<=s;--s)i[s+r]=this[s];for(s=r-1;0<=s;--s)i[s]=0;i.t=this.t+r,i.s=this.s},e.prototype.drShiftTo=function(r,i){for(var s=r;s<this.t;++s)i[s-r]=this[s];i.t=Math.max(this.t-r,0),i.s=this.s},e.prototype.lShiftTo=function(r,i){for(var s=r%this.DB,y=this.DB-s,I=(1<<y)-1,U=Math.floor(r/this.DB),V=this.s<<s&this.DM,k=this.t-1;0<=k;--k)i[k+U+1]=this[k]>>y|V,V=(this[k]&I)<<s;for(k=U-1;0<=k;--k)i[k]=0;i[U]=V,i.t=this.t+U+1,i.s=this.s,i.clamp()},e.prototype.rShiftTo=function(r,i){i.s=this.s;var s=Math.floor(r/this.DB);if(s>=this.t)i.t=0;else{var y=r%this.DB,I=this.DB-y,U=(1<<y)-1;i[0]=this[s]>>y;for(var V=s+1;V<this.t;++V)i[V-s-1]|=(this[V]&U)<<I,i[V-s]=this[V]>>y;0<y&&(i[this.t-s-1]|=(this.s&U)<<I),i.t=this.t-s,i.clamp()}},e.prototype.subTo=function(r,i){for(var s=0,y=0,I=Math.min(r.t,this.t);s<I;)y+=this[s]-r[s],i[s++]=y&this.DM,y>>=this.DB;if(r.t<this.t){for(y-=r.s;s<this.t;)y+=this[s],i[s++]=y&this.DM,y>>=this.DB;y+=this.s}else{for(y+=this.s;s<r.t;)y-=r[s],i[s++]=y&this.DM,y>>=this.DB;y-=r.s}i.s=y<0?-1:0,y<-1?i[s++]=this.DV+y:0<y&&(i[s++]=y),i.t=s,i.clamp()},e.prototype.multiplyTo=function(r,i){var s=this.abs(),y=r.abs(),I=s.t;for(i.t=I+y.t;0<=--I;)i[I]=0;for(I=0;I<y.t;++I)i[I+s.t]=s.am(0,y[I],i,I,0,s.t);i.s=0,i.clamp(),this.s!=r.s&&e.ZERO.subTo(i,i)},e.prototype.squareTo=function(r){for(var i=this.abs(),s=r.t=2*i.t;0<=--s;)r[s]=0;for(s=0;s<i.t-1;++s){var y=i.am(s,i[s],r,2*s,0,1);(r[s+i.t]+=i.am(s+1,2*i[s],r,2*s+1,y,i.t-s-1))>=i.DV&&(r[s+i.t]-=i.DV,r[s+i.t+1]=1)}0<r.t&&(r[r.t-1]+=i.am(s,i[s],r,2*s,0,1)),r.s=0,r.clamp()},e.prototype.divRemTo=function(r,i,s){var y=r.abs();if(!(y.t<=0)){if(($t=this.abs()).t<y.t)return i!=null&&i.fromInt(0),void(s!=null&&this.copyTo(s));s==null&&(s=o());var I=o(),U=this.s,V=r.s;0<(r=this.DB-ct(y[y.t-1]))?(y.lShiftTo(r,I),$t.lShiftTo(r,s)):(y.copyTo(I),$t.copyTo(s));var k=I.t,Lt=I[k-1];if(Lt!=0){var $t=Lt*(1<<this.F1)+(1<k?I[k-2]>>this.F2:0),fe=this.FV/$t,pe=(1<<this.F1)/$t,we=1<<this.F2,jt=s.t,Ie=jt-k,Bt=i==null?o():i;for(I.dlShiftTo(Ie,Bt),0<=s.compareTo(Bt)&&(s[s.t++]=1,s.subTo(Bt,s)),e.ONE.dlShiftTo(k,Bt),Bt.subTo(I,I);I.t<k;)I[I.t++]=0;for(;0<=--Ie;){var fn=s[--jt]==Lt?this.DM:Math.floor(s[jt]*fe+(s[jt-1]+we)*pe);if((s[jt]+=I.am(0,fn,s,Ie,0,k))<fn)for(I.dlShiftTo(Ie,Bt),s.subTo(Bt,s);s[jt]<--fn;)s.subTo(Bt,s)}i!=null&&(s.drShiftTo(k,i),U!=V&&e.ZERO.subTo(i,i)),s.t=k,s.clamp(),0<r&&s.rShiftTo(r,s),U<0&&e.ZERO.subTo(s,s)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var r=this[0];if(!(1&r))return 0;var i=3&r;return 0<(i=(i=(i=(i=i*(2-(15&r)*i)&15)*(2-(255&r)*i)&255)*(2-((65535&r)*i&65535))&65535)*(2-r*i%this.DV)%this.DV)?this.DV-i:-i},e.prototype.isEven=function(){return(0<this.t?1&this[0]:this.s)==0},e.prototype.exp=function(r,i){if(4294967295<r||r<1)return e.ONE;var s,y=o(),I=o(),U=i.convert(this),V=ct(r)-1;for(U.copyTo(y);0<=--V;)i.sqrTo(y,I),0<(r&1<<V)?i.mulTo(I,U,y):(s=y,y=I,I=s);return i.revert(y)},e.prototype.toString=function(r){if(this.s<0)return"-"+this.negate().toString(r);var i;if(r==16)i=4;else if(r==8)i=3;else if(r==2)i=1;else if(r==32)i=5;else{if(r!=4)return this.toRadix(r);i=2}var s,y=(1<<i)-1,I=!1,U="",V=this.t,k=this.DB-V*this.DB%i;if(0<V--)for(k<this.DB&&0<(s=this[V]>>k)&&(I=!0,U=R(s));0<=V;)k<i?(s=(this[V]&(1<<k)-1)<<i-k,s|=this[--V]>>(k+=this.DB-i)):(s=this[V]>>(k-=i)&y,k<=0&&(k+=this.DB,--V)),(I=0<s||I)&&(U+=R(s));return I?U:"0"},e.prototype.negate=function(){var r=o();return e.ZERO.subTo(this,r),r},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(r){var i=this.s-r.s;if(i!=0)return i;var s=this.t;if((i=s-r.t)!=0)return this.s<0?-i:i;for(;0<=--s;)if((i=this[s]-r[s])!=0)return i;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+ct(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(r){var i=o();return this.abs().divRemTo(r,null,i),this.s<0&&0<i.compareTo(e.ZERO)&&r.subTo(i,i),i},e.prototype.modPowInt=function(r,i){return i=new(r<256||i.isEven()?lt:b)(i),this.exp(r,i)},e.ZERO=C(0),e.ONE=C(1),pt.prototype.convert=Ot,pt.prototype.revert=Ot,pt.prototype.mulTo=function(r,i,s){r.multiplyTo(i,s)},pt.prototype.sqrTo=function(r,i){r.squareTo(i)},B.prototype.convert=function(r){if(r.s<0||r.t>2*this.m.t)return r.mod(this.m);if(r.compareTo(this.m)<0)return r;var i=o();return r.copyTo(i),this.reduce(i),i},B.prototype.revert=function(r){return r},B.prototype.reduce=function(r){for(r.drShiftTo(this.m.t-1,this.r2),r.t>this.m.t+1&&(r.t=this.m.t+1,r.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);r.compareTo(this.r2)<0;)r.dAddOffset(1,this.m.t+1);for(r.subTo(this.r2,r);0<=r.compareTo(this.m);)r.subTo(this.m,r)},B.prototype.mulTo=function(r,i,s){r.multiplyTo(i,s),this.reduce(s)},B.prototype.sqrTo=function(r,i){r.squareTo(i),this.reduce(i)};var $,K=[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)/K[K.length-1];function z(){var r;r=new Date().getTime(),Dt[ot++]^=255&r,Dt[ot++]^=r>>8&255,Dt[ot++]^=r>>16&255,Dt[ot++]^=r>>24&255,ln<=ot&&(ot-=ln)}if(e.prototype.chunkSize=function(r){return Math.floor(Math.LN2*this.DB/Math.log(r))},e.prototype.toRadix=function(r){if(r==null&&(r=10),this.signum()==0||r<2||36<r)return"0";var i=this.chunkSize(r),s=Math.pow(r,i),y=C(s),I=o(),U=o(),V="";for(this.divRemTo(y,I,U);0<I.signum();)V=(s+U.intValue()).toString(r).substr(1)+V,I.divRemTo(y,I,U);return U.intValue().toString(r)+V},e.prototype.fromRadix=function(r,i){this.fromInt(0);for(var s=this.chunkSize(i=i==null?10:i),y=Math.pow(i,s),I=!1,U=0,V=0,k=0;k<r.length;++k){var Lt=Y(r,k);Lt<0?r.charAt(k)=="-"&&this.signum()==0&&(I=!0):(V=i*V+Lt,++U>=s&&(this.dMultiply(y),this.dAddOffset(V,0),V=U=0))}0<U&&(this.dMultiply(Math.pow(i,U)),this.dAddOffset(V,0)),I&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(r,i,s){if(typeof i=="number")if(r<2)this.fromInt(1);else for(this.fromNumber(r,s),this.testBit(r-1)||this.bitwiseTo(e.ONE.shiftLeft(r-1),rt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(i);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(e.ONE.shiftLeft(r-1),this);else{var y=new Array;s=7&r,y.length=1+(r>>3),i.nextBytes(y),0<s?y[0]&=(1<<s)-1:y[0]=0,this.fromString(y,256)}},e.prototype.bitwiseTo=function(r,i,s){for(var y,I=Math.min(r.t,this.t),U=0;U<I;++U)s[U]=i(this[U],r[U]);if(r.t<this.t){for(y=r.s&this.DM,U=I;U<this.t;++U)s[U]=i(this[U],y);s.t=this.t}else{for(y=this.s&this.DM,U=I;U<r.t;++U)s[U]=i(y,r[U]);s.t=r.t}s.s=i(this.s,r.s),s.clamp()},e.prototype.changeBit=function(r,i){return r=e.ONE.shiftLeft(r),this.bitwiseTo(r,i,r),r},e.prototype.addTo=function(r,i){for(var s=0,y=0,I=Math.min(r.t,this.t);s<I;)y+=this[s]+r[s],i[s++]=y&this.DM,y>>=this.DB;if(r.t<this.t){for(y+=r.s;s<this.t;)y+=this[s],i[s++]=y&this.DM,y>>=this.DB;y+=this.s}else{for(y+=this.s;s<r.t;)y+=r[s],i[s++]=y&this.DM,y>>=this.DB;y+=r.s}i.s=y<0?-1:0,0<y?i[s++]=y:y<-1&&(i[s++]=this.DV+y),i.t=s,i.clamp()},e.prototype.dMultiply=function(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(r,i){if(r!=0){for(;this.t<=i;)this[this.t++]=0;for(this[i]+=r;this[i]>=this.DV;)this[i]-=this.DV,++i>=this.t&&(this[this.t++]=0),++this[i]}},e.prototype.multiplyLowerTo=function(r,i,s){var y,I=Math.min(this.t+r.t,i);for(s.s=0,s.t=I;0<I;)s[--I]=0;for(y=s.t-this.t;I<y;++I)s[I+this.t]=this.am(0,r[I],s,I,0,this.t);for(y=Math.min(r.t,i);I<y;++I)this.am(0,r[I],s,I,0,i-I);s.clamp()},e.prototype.multiplyUpperTo=function(r,i,s){var y=s.t=this.t+r.t- --i;for(s.s=0;0<=--y;)s[y]=0;for(y=Math.max(i-this.t,0);y<r.t;++y)s[this.t+y-i]=this.am(i-y,r[y],s,0,0,this.t+y-i);s.clamp(),s.drShiftTo(1,s)},e.prototype.modInt=function(r){if(r<=0)return 0;var i=this.DV%r,s=this.s<0?r-1:0;if(0<this.t)if(i==0)s=this[0]%r;else for(var y=this.t-1;0<=y;--y)s=(i*s+this[y])%r;return s},e.prototype.millerRabin=function(r){var i=this.subtract(e.ONE),s=i.getLowestSetBit();if(s<=0)return!1;var y=i.shiftRight(s);K.length<(r=r+1>>1)&&(r=K.length);for(var I=o(),U=0;U<r;++U){I.fromInt(K[Math.floor(Math.random()*K.length)]);var V=I.modPow(y,this);if(V.compareTo(e.ONE)!=0&&V.compareTo(i)!=0){for(var k=1;k++<s&&V.compareTo(i)!=0;)if((V=V.modPowInt(2,this)).compareTo(e.ONE)==0)return!1;if(V.compareTo(i)!=0)return!1}}return!0},e.prototype.clone=function(){var r=o();return this.copyTo(r),r},e.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]},e.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var r=this.t,i=new Array;i[0]=this.s;var s,y=this.DB-r*this.DB%8,I=0;if(0<r--)for(y<this.DB&&(s=this[r]>>y)!=(this.s&this.DM)>>y&&(i[I++]=s|this.s<<this.DB-y);0<=r;)y<8?(s=(this[r]&(1<<y)-1)<<8-y,s|=this[--r]>>(y+=this.DB-8)):(s=this[r]>>(y-=8)&255,y<=0&&(y+=this.DB,--r)),128&s&&(s|=-256),I==0&&(128&this.s)!=(128&s)&&++I,(0<I||s!=this.s)&&(i[I++]=s);return i},e.prototype.equals=function(r){return this.compareTo(r)==0},e.prototype.min=function(r){return this.compareTo(r)<0?this:r},e.prototype.max=function(r){return 0<this.compareTo(r)?this:r},e.prototype.and=function(r){var i=o();return this.bitwiseTo(r,W,i),i},e.prototype.or=function(r){var i=o();return this.bitwiseTo(r,rt,i),i},e.prototype.xor=function(r){var i=o();return this.bitwiseTo(r,Z,i),i},e.prototype.andNot=function(r){var i=o();return this.bitwiseTo(r,ft,i),i},e.prototype.not=function(){for(var r=o(),i=0;i<this.t;++i)r[i]=this.DM&~this[i];return r.t=this.t,r.s=~this.s,r},e.prototype.shiftLeft=function(r){var i=o();return r<0?this.rShiftTo(-r,i):this.lShiftTo(r,i),i},e.prototype.shiftRight=function(r){var i=o();return r<0?this.lShiftTo(-r,i):this.rShiftTo(r,i),i},e.prototype.getLowestSetBit=function(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*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[r]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var r=0,i=this.s&this.DM,s=0;s<this.t;++s)r+=(function(y){for(var I=0;y!=0;)y&=y-1,++I;return I})(this[s]^i);return r},e.prototype.testBit=function(r){var i=Math.floor(r/this.DB);return i>=this.t?this.s!=0:!!(this[i]&1<<r%this.DB)},e.prototype.setBit=function(r){return this.changeBit(r,rt)},e.prototype.clearBit=function(r){return this.changeBit(r,ft)},e.prototype.flipBit=function(r){return this.changeBit(r,Z)},e.prototype.add=function(r){var i=o();return this.addTo(r,i),i},e.prototype.subtract=function(r){var i=o();return this.subTo(r,i),i},e.prototype.multiply=function(r){var i=o();return this.multiplyTo(r,i),i},e.prototype.divide=function(r){var i=o();return this.divRemTo(r,i,null),i},e.prototype.remainder=function(r){var i=o();return this.divRemTo(r,null,i),i},e.prototype.divideAndRemainder=function(r){var i=o(),s=o();return this.divRemTo(r,i,s),new Array(i,s)},e.prototype.modPow=function(r,i){var s=r.bitLength(),y=C(1);if(s<=0)return y;var I=s<18?1:s<48?3:s<144?4:s<768?5:6,U=new(s<8?lt:i.isEven()?B:b)(i),V=new Array,k=3,Lt=I-1,$t=(1<<I)-1;if(V[1]=U.convert(this),1<I){var fe=o();for(U.sqrTo(V[1],fe);k<=$t;)V[k]=o(),U.mulTo(fe,V[k-2],V[k]),k+=2}var pe,we,jt=r.t-1,Ie=!0,Bt=o();for(s=ct(r[jt])-1;0<=jt;){for(Lt<=s?pe=r[jt]>>s-Lt&$t:(pe=(r[jt]&(1<<s+1)-1)<<Lt-s,0<jt&&(pe|=r[jt-1]>>this.DB+s-Lt)),k=I;!(1&pe);)pe>>=1,--k;if((s-=k)<0&&(s+=this.DB,--jt),Ie)V[pe].copyTo(y),Ie=!1;else{for(;1<k;)U.sqrTo(y,Bt),U.sqrTo(Bt,y),k-=2;0<k?U.sqrTo(y,Bt):(we=y,y=Bt,Bt=we),U.mulTo(Bt,V[pe],y)}for(;0<=jt&&!(r[jt]&1<<s);)U.sqrTo(y,Bt),we=y,y=Bt,Bt=we,--s<0&&(s=this.DB-1,--jt)}return U.revert(y)},e.prototype.modInverse=function(r){var i=r.isEven();if(this.isEven()&&i||r.signum()==0)return e.ZERO;for(var s=r.clone(),y=this.clone(),I=C(1),U=C(0),V=C(0),k=C(1);s.signum()!=0;){for(;s.isEven();)s.rShiftTo(1,s),i?(I.isEven()&&U.isEven()||(I.addTo(this,I),U.subTo(r,U)),I.rShiftTo(1,I)):U.isEven()||U.subTo(r,U),U.rShiftTo(1,U);for(;y.isEven();)y.rShiftTo(1,y),i?(V.isEven()&&k.isEven()||(V.addTo(this,V),k.subTo(r,k)),V.rShiftTo(1,V)):k.isEven()||k.subTo(r,k),k.rShiftTo(1,k);0<=s.compareTo(y)?(s.subTo(y,s),i&&I.subTo(V,I),U.subTo(k,U)):(y.subTo(s,y),i&&V.subTo(I,V),k.subTo(U,k))}return y.compareTo(e.ONE)!=0?e.ZERO:0<=k.compareTo(r)?k.subtract(r):k.signum()<0?(k.addTo(r,k),k.signum()<0?k.add(r):k):k},e.prototype.pow=function(r){return this.exp(r,new pt)},e.prototype.gcd=function(r){var i=this.s<0?this.negate():this.clone(),s=r.s<0?r.negate():r.clone();i.compareTo(s)<0&&(I=i,i=s,s=I);var y=i.getLowestSetBit(),I=s.getLowestSetBit();if(I<0)return i;for(0<(I=y<I?y:I)&&(i.rShiftTo(I,i),s.rShiftTo(I,s));0<i.signum();)0<(y=i.getLowestSetBit())&&i.rShiftTo(y,i),0<(y=s.getLowestSetBit())&&s.rShiftTo(y,s),0<=i.compareTo(s)?(i.subTo(s,i),i.rShiftTo(1,i)):(s.subTo(i,s),s.rShiftTo(1,s));return 0<I&&s.lShiftTo(I,s),s},e.prototype.isProbablePrime=function(r){var i,s=this.abs();if(s.t==1&&s[0]<=K[K.length-1]){for(i=0;i<K.length;++i)if(s[0]==K[i])return!0;return!1}if(s.isEven())return!1;for(i=1;i<K.length;){for(var y=K[i],I=i+1;I<K.length&&y<Q;)y*=K[I++];for(y=s.modInt(y);i<I;)if(y%K[i++]==0)return!1}return s.millerRabin(r)},e.prototype.square=function(){var r=o();return this.squareTo(r),r},e.prototype.Barrett=B,Dt==null){var Dt=new Array,ot=0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var Tt=new Uint8Array(32);for(window.crypto.getRandomValues(Tt),kt=0;kt<32;++kt)Dt[ot++]=Tt[kt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var Yt=window.crypto.random(32),kt=0;kt<Yt.length;++kt)Dt[ot++]=255&Yt.charCodeAt(kt)}for(;ot<ln;)kt=Math.floor(65536*Math.random()),Dt[ot++]=kt>>>8,Dt[ot++]=255&kt;ot=0,z()}function un(){if($==null){for(z(),($=new cn).init(Dt),ot=0;ot<Dt.length;++ot)Dt[ot]=0;ot=0}return $.next()}function Jn(){}function cn(){this.i=0,this.j=0,this.S=new Array}Jn.prototype.nextBytes=function(r){for(var i=0;i<r.length;++i)r[i]=un()},cn.prototype.init=function(r){for(var i,s,y=0;y<256;++y)this.S[y]=y;for(y=i=0;y<256;++y)i=i+this.S[y]+r[y%r.length]&255,s=this.S[y],this.S[y]=this.S[i],this.S[i]=s;this.i=0,this.j=0},cn.prototype.next=function(){var r;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,r=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=r,this.S[r+this.S[this.i]&255]};var ln=256;Vt.exports={default:e,BigInteger:e,SecureRandom:Jn}}.call(O);var N=Xt.exports.BigInteger,bt=(function(){function e(){G(this,e),this.tlv=null,this.t="00",this.l="00",this.v=""}return S(e,[{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 o=this.v.length/2,u=o.toString(16);return u.length%2==1&&(u="0"+u),o<128?u:(128+u.length/2).toString(16)+u}},{key:"getValue",value:function(){return""}}]),e})(),ce=(function(){nt(o,bt);var e=H(o);function o(u){var c;return G(this,o),(c=e.call(this)).t="02",u&&(c.v=(function(h){if((m=h.toString(16))[0]!=="-")m.length%2==1?m="0"+m:m.match(/^[0-7]/)||(m="00"+m);else{var m,R=(m=m.substr(1)).length;R%2==1?R+=1:m.match(/^[0-7]/)||(R+=2);for(var Y="",C=0;C<R;C++)Y+="f";m=(m=(Y=new N(Y,16)).xor(h).add(N.ONE)).toString(16).replace(/^-/,"")}return m})(u)),c}return S(o,[{key:"getValue",value:function(){return this.v}}]),o})(),se=(function(){nt(o,bt);var e=H(o);function o(u){var c;return G(this,o),(c=e.call(this)).t="30",c.asn1Array=u,c}return S(o,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(u){return u.getEncodedHex()})).join(""),this.v}}]),o})();function qt(e,o){return+e[o+2]<8?1:128&+e.substr(o+2,2)}function le(e,o){var u=qt(e,o);return(e=e.substr(o+2,2*u))?(+e[0]<8?new N(e,16):new N(e.substr(2),16)).intValue():-1}function ue(e,o){return o+2*(qt(e,o)+1)}var Ut=Xt.exports.BigInteger,Ht=new Ut("3"),Ae=(function(){function e(o,u){G(this,e),this.x=u,this.q=o}return S(e,[{key:"equals",value:function(o){return o===this||this.q.equals(o.q)&&this.x.equals(o.x)}},{key:"toBigInteger",value:function(){return this.x}},{key:"negate",value:function(){return new e(this.q,this.x.negate().mod(this.q))}},{key:"add",value:function(o){return new e(this.q,this.x.add(o.toBigInteger()).mod(this.q))}},{key:"subtract",value:function(o){return new e(this.q,this.x.subtract(o.toBigInteger()).mod(this.q))}},{key:"multiply",value:function(o){return new e(this.q,this.x.multiply(o.toBigInteger()).mod(this.q))}},{key:"divide",value:function(o){return new e(this.q,this.x.multiply(o.toBigInteger().modInverse(this.q)).mod(this.q))}},{key:"square",value:function(){return new e(this.q,this.x.square().mod(this.q))}}]),e})(),te=(function(){function e(o,u,c,h){G(this,e),this.curve=o,this.x=u,this.y=c,this.z=h==null?Ut.ONE:h,this.zinv=null}return S(e,[{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(o){return o===this||(this.isInfinity()?o.isInfinity():o.isInfinity()?this.isInfinity():!!o.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(o.z)).mod(this.curve.q).equals(Ut.ZERO)&&o.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(o.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 e(this.curve,this.x,this.y.negate(),this.z)}},{key:"add",value:function(o){if(this.isInfinity())return o;if(o.isInfinity())return this;var u=this.x.toBigInteger(),c=this.y.toBigInteger(),h=this.z,m=o.x.toBigInteger(),R=o.y.toBigInteger(),Y=o.z,C=this.curve.q,ct=u.multiply(Y).mod(C);return o=m.multiply(h).mod(C),u=ct.subtract(o),m=c.multiply(Y).mod(C),c=R.multiply(h).mod(C),R=m.subtract(c),Ut.ZERO.equals(u)?Ut.ZERO.equals(R)?this.twice():this.curve.infinity:(c=ct.add(o),o=h.multiply(Y).mod(C),Y=u.square().mod(C),h=u.multiply(Y).mod(C),c=o.multiply(R.square()).subtract(c.multiply(Y)).mod(C),u=u.multiply(c).mod(C),m=R.multiply(Y.multiply(ct).subtract(c)).subtract(m.multiply(h)).mod(C),C=h.multiply(o).mod(C),new e(this.curve,this.curve.fromBigInteger(u),this.curve.fromBigInteger(m),C))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var o=this.x.toBigInteger(),u=this.y.toBigInteger(),c=this.z,h=this.curve.q,m=this.curve.a.toBigInteger(),R=o.square().multiply(Ht).add(m.multiply(c.square())).mod(h),Y=u.shiftLeft(1).multiply(c).mod(h),C=(m=(C=u.square().mod(h)).multiply(o).multiply(c).mod(h),u=Y.square().mod(h),o=R.square().subtract(m.shiftLeft(3)).mod(h),c=Y.multiply(o).mod(h),R.multiply(m.shiftLeft(2).subtract(o)).subtract(u.shiftLeft(1).multiply(C)).mod(h));return h=Y.multiply(u).mod(h),new e(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(C),h)}},{key:"multiply",value:function(o){if(this.isInfinity())return this;if(!o.signum())return this.curve.infinity;for(var u=o.multiply(Ht),c=this.negate(),h=this,m=u.bitLength()-2;0<m;m--){h=h.twice();var R=u.testBit(m);R!==o.testBit(m)&&(h=h.add(R?this:c))}return h}}]),e})(),Ft=(function(){function e(o,u,c){G(this,e),this.q=o,this.a=this.fromBigInteger(u),this.b=this.fromBigInteger(c),this.infinity=new te(this,null,null)}return S(e,[{key:"equals",value:function(o){return o===this||this.q.equals(o.q)&&this.a.equals(o.a)&&this.b.equals(o.b)}},{key:"fromBigInteger",value:function(o){return new Ae(this.q,o)}},{key:"decodePointHex",value:function(o){switch(parseInt(o.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:default:return null;case 4:case 6:case 7:var u=(o.length-2)/2,c=o.substr(2,u);return u=o.substr(2+u,u),new te(this,this.fromBigInteger(new Ut(c,16)),this.fromBigInteger(new Ut(u,16)))}}}]),e})(),Mt={ECPointFp:te,ECCurveFp:Ft},re=Xt.exports.BigInteger,_e=(Ft=Xt.exports.SecureRandom,Mt.ECCurveFp),ye=new Ft,oe=(Mt=A()).curve,p=Mt.G,_=Mt.n;function A(){var e=new re("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),o=new re("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),u=new re("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return u=(o=new _e(e,o,u)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:o,G:u,n:new re("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function M(e,o){return e.length>=o?e:new Array(o-e.length+1).join("0")+e}function v(e,o){for(var u=[],c=~~(o/8),h=o%8,m=0,R=e.length;m<R;m++)u[m]=(e[(m+c)%R]<<h&255)+(e[(m+c+1)%R]>>>8-h&255);return u}function q(e,o){for(var u=[],c=e.length-1;0<=c;c--)u[c]=255&(e[c]^o[c]);return u}function at(e,o){for(var u=[],c=e.length-1;0<=c;c--)u[c]=e[c]&o[c]&255;return u}function It(e,o){for(var u=[],c=e.length-1;0<=c;c--)u[c]=255&(e[c]|o[c]);return u}function gt(e,o){for(var u=[],c=0,h=e.length-1;0<=h;h--){var m=e[h]+o[h]+c;c=255<m?1:0,u[h]=255&m}return u}function Wt(e,o,u,c){return 0<=c&&c<=15?q(q(e,o),u):It(at(e,o),at((function(h){for(var m=[],R=h.length-1;0<=R;R--)m[R]=255&~h[R];return m})(e),u))}function ee(e,o){for(var u=[],c=[],h=0;h<16;h++){var m=4*h;u.push(o.slice(m,4+m))}for(var R,Y=16;Y<68;Y++)u.push(q(q((R=q(q(u[Y-16],u[Y-9]),v(u[Y-3],15)),q(q(R,v(R,15)),v(R,23))),v(u[Y-13],7)),u[Y-6]));for(var C=0;C<64;C++)c.push(q(u[C],u[C+4]));for(var ct,lt,b,W=[121,204,69,25],rt=[122,135,157,138],Z=e.slice(0,4),ft=e.slice(4,8),pt=e.slice(8,12),Ot=e.slice(12,16),B=e.slice(16,20),$=e.slice(20,24),K=e.slice(24,28),Q=e.slice(28,32),z=0;z<64;z++){var Dt=0<=z&&z<=15?W:rt,ot=q(Tt=v(gt(gt(v(Z,12),B),v(Dt,z)),7),v(Z,12)),Tt=(ot=gt(gt(gt((ct=Z,lt=ft,b=pt,0<=(Dt=z)&&Dt<=15?q(q(ct,lt),b):It(It(at(ct,lt),at(ct,b)),at(lt,b))),Ot),ot),c[z]),gt(gt(gt(Wt(B,$,K,z),Q),Tt),u[z]));Ot=pt,pt=v(ft,9),ft=Z,Z=ot,Q=K,K=v($,19),$=B,B=q(q(Tt,v(Tt,9)),v(Tt,17))}return q([].concat(Z,ft,pt,Ot,B,$,K,Q),e)}Ft={getGlobalCurve:function(){return oe},generateEcparam:A,generateKeyPairHex:function(e,o,u){return{privateKey:u=M((o=(e?new re(e,o,u):new re(_.bitLength(),ye)).mod(_.subtract(re.ONE)).add(re.ONE)).toString(16),64),publicKey:"04"+M((o=p.multiply(o)).getX().toBigInteger().toString(16),64)+M(o.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(e){for(var o=(e=unescape(encodeURIComponent(e))).length,u=[],c=0;c<o;c++)u[c>>>2]|=(255&e.charCodeAt(c))<<24-c%4*8;for(var h=[],m=0;m<o;m++){var R=u[m>>>2]>>>24-m%4*8&255;h.push((R>>>4).toString(16)),h.push((15&R).toString(16))}return h.join("")},leftPad:M,arrayToHex:function(e){return e.map((function(o){return(o=o.toString(16)).length===1?"0"+o:o})).join("")},arrayToUtf8:function(e){for(var o=[],u=0,c=0;c<2*e.length;c+=2)o[c>>>3]|=parseInt(e[u],10)<<24-c%8*4,u++;try{for(var h=[],m=0;m<e.length;m++){var R=o[m>>>2]>>>24-m%4*8&255;h.push(String.fromCharCode(R))}return decodeURIComponent(escape(h.join("")))}catch(Y){throw new Error("Malformed UTF-8 data")}},hexToArray:function(e){for(var o=[],u=(e=(u=e.length)%2!=0?M(e,u+1):e).length,c=0;c<u;c+=2)o.push(parseInt(e.substr(c,2),16));return o},verifyPublicKey:function(e){var o=oe.decodePointHex(e);return!!o&&(e=o.getX(),o.getY().square().equals(e.multiply(e.square()).add(e.multiply(oe.a)).add(oe.b)))}},Mt=function(e){for(var o=448<=(o=(Y=8*e.length)%512)?512-o%448-1:448-o-1,u=new Array((o-7)/8),c=0,h=u.length;c<h;c++)u[c]=0;for(var m,R=[],Y=Y.toString(2),C=7;0<=C;C--)8<Y.length?(m=Y.length-8,R[C]=parseInt(Y.substr(m),2),Y=Y.substr(0,m)):0<Y.length?(R[C]=parseInt(Y,2),Y=""):R[C]=0;for(var ct=[].concat(e,[128],u,R),lt=ct.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],W=0;W<lt;W++){var rt=64*W;b=ee(b,ct.slice(rt,64+rt))}return b};var Rt=Xt.exports.BigInteger,Mr=function(e,o){return e=new ce(e),o=new ce(o),new se([e,o]).getEncodedHex()},Jr=function(e){var o=ue(e,0),u=ue(e,o),c=le(e,o);return o=e.substr(u,2*c),u=ue(e,c=u+o.length),c=le(e,c),e=e.substr(u,2*c),{r:new N(o,16),s:new N(e,16)}},yt=Ft,Se=Mt,Ee=(Ft=yt.generateEcparam()).G,Yn=Ft.curve,Re=Ft.n;function Ln(e,o,u){var c=2<arguments.length&&u!==void 0?u:"1234567812345678",h=(c=yt.utf8ToHex(c),yt.leftPad(Ee.curve.a.toBigInteger().toRadix(16),64)),m=yt.leftPad(Ee.curve.b.toBigInteger().toRadix(16),64),R=yt.leftPad(Ee.getX().toBigInteger().toRadix(16),64),Y=yt.leftPad(Ee.getY().toBigInteger().toRadix(16),64);return u=(o=128<o.length?o.substr(2,128):o).substr(0,64),o=o.substr(64,64),o=yt.hexToArray(c+h+m+R+Y+u+o),c=4*c.length,o.unshift(255&c),o.unshift(c>>8&255),o=Se(o),yt.arrayToHex(Se(o.concat(yt.hexToArray(e))))}function xn(){var e=yt.generateKeyPairHex(),o=Yn.decodePointHex(e.publicKey);return e.k=new Rt(e.privateKey,16),e.x1=o.getX().toBigInteger(),e}Ft={generateKeyPairHex:yt.generateKeyPairHex,doEncrypt:function(e,o){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;e=typeof e=="string"?yt.hexToArray(yt.utf8ToHex(e)):Array.prototype.slice.call(e),o=yt.getGlobalCurve().decodePointHex(o);var c=yt.generateKeyPairHex(),h=new Rt(c.privateKey,16),m=c.publicKey;128<m.length&&(m=m.substr(m.length-128)),c=o.multiply(h),h=yt.hexToArray(yt.leftPad(c.getX().toBigInteger().toRadix(16),64)),o=yt.hexToArray(yt.leftPad(c.getY().toBigInteger().toRadix(16),64)),c=yt.arrayToHex(Se([].concat(h,e,o)));var R,Y=1,C=0,ct=[],lt=[].concat(h,o);(R=function(){ct=Se([].concat(wt(lt),[Y>>24&255,Y>>16&255,Y>>8&255,255&Y])),Y++,C=0})();for(var b=0,W=e.length;b<W;b++)C===ct.length&&R(),e[b]^=255&ct[C++];return o=yt.arrayToHex(e),u===0?m+o+c:m+c+o},doDecrypt:function(e,o){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,c=(m=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":m;o=new Rt(o,16);var h=e.substr(128,64),m=e.substr(192);u===0&&(h=e.substr(e.length-64),m=e.substr(128,e.length-128-64));var R,Y=yt.hexToArray(m),C=(e=yt.getGlobalCurve().decodePointHex("04"+e.substr(0,128)).multiply(o),o=yt.hexToArray(yt.leftPad(e.getX().toBigInteger().toRadix(16),64)),e=yt.hexToArray(yt.leftPad(e.getY().toBigInteger().toRadix(16),64)),1),ct=0,lt=[],b=[].concat(o,e);(R=function(){lt=Se([].concat(wt(b),[C>>24&255,C>>16&255,C>>8&255,255&C])),C++,ct=0})();for(var W=0,rt=Y.length;W<rt;W++)ct===lt.length&&R(),Y[W]^=255&lt[ct++];return yt.arrayToHex(Se([].concat(o,Y,e)))===h?c==="array"?Y:yt.arrayToUtf8(Y):c==="array"?[]:""},doSignature:function(e,o){var u=(Y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,c=Y.der,h=Y.hash,m=Y.publicKey,R=Y.userId,Y=typeof e=="string"?yt.utf8ToHex(e):yt.arrayToHex(e);h&&(Y=Ln(Y,m||(e=o,h=Ee.multiply(new Rt(e,16)),"04"+(e=yt.leftPad(h.getX().toBigInteger().toString(16),64))+(h=yt.leftPad(h.getY().toBigInteger().toString(16),64))),R));var C=new Rt(o,16),ct=new Rt(Y,16),lt=null,b=null,W=null;do do{var rt;lt=(rt=u&&u.length?u.pop():xn()).k,b=ct.add(rt.x1).mod(Re)}while(b.equals(Rt.ZERO)||b.add(lt).equals(Re));while((W=C.add(Rt.ONE).modInverse(Re).multiply(lt.subtract(b.multiply(C))).mod(Re)).equals(Rt.ZERO));return c?Mr(b,W):yt.leftPad(b.toString(16),64)+yt.leftPad(W.toString(16),64)},doVerifySignature:function(e,o,u){var c,h,m=(Y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,R=Y.hash,Y=Y.userId;return e=typeof e=="string"?yt.utf8ToHex(e):yt.arrayToHex(e),R&&(e=Ln(e,u,Y)),h=m?(c=(h=Jr(o)).r,h.s):(c=new Rt(o.substring(0,64),16),new Rt(o.substring(64),16)),o=Yn.decodePointHex(u),u=new Rt(e,16),!(e=c.add(h).mod(Re)).equals(Rt.ZERO)&&(o=Ee.multiply(h).add(o.multiply(e)),u=u.add(o.getX().toBigInteger()).mod(Re),c.equals(u))},getPoint:xn,verifyPublicKey:yt.verifyPublicKey};var kr=Mt,He=[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],Ge=[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 sn(e){for(var o=[],u=0,c=e.length;u<c;u+=2)o.push(parseInt(e.substr(u,2),16));return o}function Te(e,o){return e<<o|e>>>32-o}function ge(e){return(255&He[e>>>24&255])<<24|(255&He[e>>>16&255])<<16|(255&He[e>>>8&255])<<8|255&He[255&e]}function Ke(e){return e^Te(e,2)^Te(e,10)^Te(e,18)^Te(e,24)}function Xe(e){return e^Te(e,13)^Te(e,23)}function Un(e,o,u,c){c=(m=(R=3<arguments.length&&c!==void 0?c:{}).padding)===void 0?"pkcs#5":m;var h=R.mode,m=(m=R.iv)===void 0?[]:m,R=(R=R.output)===void 0?"string":R;if(h==="cbc"&&(m=typeof m=="string"?sn(m):m).length!==16)throw new Error("iv is invalid");if((o=typeof o=="string"?sn(o):o).length!==16)throw new Error("key is invalid");if(e=(typeof e=="string"?u!==0?function(B){for(var $=[],K=0,Q=B.length;K<Q;K++){var z=B.codePointAt(K);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");K++,$.push(240|z>>>18&28),$.push(128|z>>>12&63),$.push(128|z>>>6&63),$.push(128|63&z)}}return $}:sn:wt)(e),c==="pkcs#5"&&u!==0)for(var Y=16-e.length%16,C=0;C<Y;C++)e.push(Y);var ct=new Array(32);(function(B,$,K){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 ot,Tt=0;Tt<32;Tt+=4)ot=Q[1]^Q[2]^Q[3]^Ge[Tt+0],$[Tt+0]=Q[0]^=Xe(ge(ot)),ot=Q[2]^Q[3]^Q[0]^Ge[Tt+1],$[Tt+1]=Q[1]^=Xe(ge(ot)),ot=Q[3]^Q[0]^Q[1]^Ge[Tt+2],$[Tt+2]=Q[2]^=Xe(ge(ot)),ot=Q[0]^Q[1]^Q[2]^Ge[Tt+3],$[Tt+3]=Q[3]^=Xe(ge(ot));if(K===0)for(var Yt,kt=0;kt<16;kt++)Yt=$[kt],$[kt]=$[31-kt],$[31-kt]=Yt})(o,ct,u);for(var lt=[],b=m,W=e.length,rt=0;16<=W;){var Z=e.slice(rt,rt+16),ft=new Array(16);if(h==="cbc")for(var pt=0;pt<16;pt++)u!==0&&(Z[pt]^=b[pt]);(function(B,$,K){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 ot,Tt=0;Tt<32;Tt+=4)ot=Q[1]^Q[2]^Q[3]^K[Tt+0],Q[0]^=Ke(ge(ot)),ot=Q[2]^Q[3]^Q[0]^K[Tt+1],Q[1]^=Ke(ge(ot)),ot=Q[3]^Q[0]^Q[1]^K[Tt+2],Q[2]^=Ke(ge(ot)),ot=Q[0]^Q[1]^Q[2]^K[Tt+3],Q[3]^=Ke(ge(ot));for(var Yt=0;Yt<16;Yt+=4)$[Yt]=Q[3-Yt/4]>>>24&255,$[Yt+1]=Q[3-Yt/4]>>>16&255,$[Yt+2]=Q[3-Yt/4]>>>8&255,$[Yt+3]=255&Q[3-Yt/4]})(Z,ft,ct);for(var Ot=0;Ot<16;Ot++)h==="cbc"&&u===0&&(ft[Ot]^=b[Ot]),lt[rt+Ot]=ft[Ot];h==="cbc"&&(b=u!==0?ft:Z),W-=16,rt+=16}return c==="pkcs#5"&&u===0&&(c=lt[lt.length-1],lt.splice(lt.length-c,c)),R!=="array"?u!==0?lt.map((function(B){return(B=B.toString(16)).length===1?"0"+B:B})).join(""):(function(B){for(var $=[],K=0,Q=B.length;K<Q;K++)240<=B[K]&&B[K]<=247?($.push(String.fromCodePoint(((7&B[K])<<18)+((63&B[K+1])<<12)+((63&B[K+2])<<6)+(63&B[K+3]))),K+=3):224<=B[K]&&B[K]<=239?($.push(String.fromCodePoint(((15&B[K])<<12)+((63&B[K+1])<<6)+(63&B[K+2]))),K+=2):192<=B[K]&&B[K]<=223?($.push(String.fromCodePoint(((31&B[K])<<6)+(63&B[K+1]))),K++):$.push(String.fromCodePoint(B[K]));return $.join("")})(lt):lt}var qr=[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],De=[],Br=function(e,o,u){for(var c=e[0],h=e[1],m=e[2],R=e[3],Y=e[4],C=e[5],ct=e[6],lt=e[7],b=0;b<64;b++){b<16?De[b]=0|o[u+b]:(W=De[b-15],rt=De[b-2],De[b]=((W<<25|W>>>7)^(W<<14|W>>>18)^W>>>3)+De[b-7]+((rt<<15|rt>>>17)^(rt<<13|rt>>>19)^rt>>>10)+De[b-16]);var W=c&h^c&m^h&m,rt=lt+((Y<<26|Y>>>6)^(Y<<21|Y>>>11)^(Y<<7|Y>>>25))+(Y&C^~Y&ct)+qr[b]+De[b];lt=ct,ct=C,C=Y,Y=R+rt|0,R=m,m=h,h=c,c=rt+(((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+W)|0}e[0]=e[0]+c|0,e[1]=e[1]+h|0,e[2]=e[2]+m|0,e[3]=e[3]+R|0,e[4]=e[4]+Y|0,e[5]=e[5]+C|0,e[6]=e[6]+ct|0,e[7]=e[7]+lt|0},Mn=(Ft={c2:Ft,c3:function(e){return e=typeof e=="string"?(function(o){for(var u=[],c=0,h=o.length;c<h;c++){var m=o.codePointAt(c);if(m<=127)u.push(m);else if(m<=2047)u.push(192|m>>>6),u.push(128|63&m);else if(m<=55295||57344<=m&&m<=65535)u.push(224|m>>>12),u.push(128|m>>>6&63),u.push(128|63&m);else{if(!(65536<=m&&m<=1114111))throw u.push(m),new Error("input is not supported");c++,u.push(240|m>>>18&28),u.push(128|m>>>12&63),u.push(128|m>>>6&63),u.push(128|63&m)}}return u})(e):Array.prototype.slice.call(e),kr(e).map((function(o){return(o=o.toString(16)).length===1?"0"+o:o})).join("")},c4:{encrypt:function(e,o,u){return Un(e,o,1,u)},decrypt:function(e,o,u){return Un(e,o,0,u)}},s2:function(e){var o=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],u=(function(h){for(var m=[],R=0;R<Math.ceil(h.length/4);R++)m[R]=h[4*R]<<24|(255&h[4*R+1])<<16|(255&h[4*R+2])<<8|255&h[4*R+3];return m})(e);u[(e=8*e.length)>>5]|=128<<24-e%32,u[15+(64+e>>9<<4)]=e;for(var c=0;c<u.length;c+=16)Br(o,u,c);return(function(h){for(var m=[],R=0;R<h.length;R++)m[4*R]=h[R]>>24&255,m[4*R+1]=h[R]>>16&255,m[4*R+2]=h[R]>>8&255,m[4*R+3]=255&h[R];return m})(o).map((function(h){return(h=h.toString(16)).length===1?"0"+h:h})).join("")}},vt),jr=At,Vr=Et,Hr=Gt,Gr=Zt,Kr=Ft.c2,Xr=Ft.c3,Wr=Ft.c4,Qr=Ft.s2;return(function(){var e;(e=function(){}).VERSION="2.1.0";var o=O;if(o.AAR2)return o.AAR2.VERSION!==e.VERSION&&console.log(o.AAR2.VERSION),o.AAR2;var u="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",c=!1,h=!1,m=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,R=m!==void 0&&!!m.request&&!!m.login,Y=function(b,W){return typeof b=="string"&&typeof W=="string"&&b!=null&&W!=null&&b.substring(0,W.length)===W},C={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},ct=function(b){for(var W in C)if(C[W]===b)return W},lt=function(b,W,rt){var Z=Date.now(),ft=new e;try{if(!b||b.length<=75)return console.error("error format 1:",b),C.ERROR_DATA_FORMAT;if(!Y(b,"eyJ"))return console.error("error format 2:",b),C.ERROR_DATA_FORMAT;b=b.substring(3,b.length);var pt=jr.my_b4_decode(b);if(!pt)return console.error("error format 3:",b),C.ERROR_DATA_FORMAT;var Ot,B=ft.cc.u8.byteToInt(pt.slice(0,4),0),$=pt.slice(4,4+B),K=ft.cc.u8.byteToInt(pt.slice(4+B,4+B+4),0),Q=pt.slice(4+B+4,4+B+4+K),z=ft.cc.u8.byteToInt(pt.slice(4+B+4+K,4+B+4+K+4),0),Dt=pt.slice(4+B+4+K+4,4+B+4+K+4+z),ot=ft.cc.u8.bytesToUtf8Str($);if(ft.cc.h6.encode(Q,0,K),W||(rt!==void 0&&rt==="sm2"?(Ot=ft.cc.h6.encode(Q,0,K),ft.co.c2.doVerifySignature(ot,Ot,u,{der:!0,hash:!0})):ft.co.c3(ot+"8890012345678890").toLowerCase()===ft.cc.h6.encode(Dt,0,z).toLowerCase())){if(ot.length%2==0){e.prototype.__v=function(){return ot.slice(0,2)};for(var Tt=[],Yt=2;Yt<66;Yt+=2)Tt.push(parseInt("0x"+ot.slice(Yt,Yt+2)));e.prototype.__i=function(){return Tt};var kt=parseInt("0x"+ot.slice(66,82))-Z;e.prototype.__o=function(){return kt}}return R||O.AAR2||(O.AAR2=e),C.SUCCESS}}catch(un){return console.error(un),C.ERROR_UNKNOWN_ERROR}return C.ERROR_SIGN_CHECK};return e.init=function(b,W){var rt,Z={debug:!1,url:"https://aks.jdpay.com/aar2/getJS",callback:function(){}};typeof b=="string"?(Y(b,"https")||Y(b,"https")?Z.url=b:Y(b,"eyJ")&&(Z.code=b),typeof W=="string"&&(Z.publicKey=W)):tt(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:rt=C.ALREADY_SUCCESS,errorMsg:ct(rt)}):c?setTimeout((function(){e.init(b,W)}),50):(c=!0,Z.debug&&Mn.start(Z.debug),Z.publicKey&&(u=Z.publicKey),Z.code?(rt=lt(Z.code,Z.skipVerify))===C.SUCCESS?(c=!(h=!0),Z.callback(!0,{errorNo:rt,errorMsg:ct(rt)})):Z.callback(!1,{errorNo:rt,errorMsg:ct(rt)}):Z.url&&(function(ft,pt,Ot){try{if(ft=ft+"?version="+e.VERSION+(R?"&name=wechat":"&name=browser")+"&t="+Date.now(),R)m.request({url:ft,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function($){$.statusCode===200?pt($.data):Ot(C.ERROR_XXX_REQUEST_FAIL)},fail:function($){$&&$.errMsg&&$.errMsg.indexOf("timeout")!==-1?Ot(C.ERROR_XXX_REQUEST_TIMEOUT):Ot(C.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(K){}}B&&(B.onload=function(){B.readyState===4&&(B.status===200?pt(B.responseText):Ot(C.ERROR_XHR_ERROR))},B.ontimeout=function(){Ot(C.ERROR_XHR_TIMEOUT)},B.onerror=function(){Ot(C.ERROR_XHR_ERROR)},B.open("POST",ft,!0),B.timeout=5e3,B.send(null))}}catch($){console.error($),Ot(C.ERROR_UNKNOWN_ERROR)}})(Z.url,(function(ft){(ft=lt(ft,Z.skipVerify,Z.alg))===C.SUCCESS?(c=!(h=!0),Z.callback(!0,{errorNo:ft,errorMsg:ct(ft)})):(c=!1,Z.callback(!1,{errorNo:ft,errorMsg:ct(ft)}))}),(function(ft){c=!1,Z.callback(!1,{errorNo:ft,errorMsg:ct(ft)})})))},e.prototype={cc:{b4:Vr,h6:Hr,u8:Gr},co:{c2:Kr,c3:Xr,c4:Wr,s2:Qr},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,W){return this.__s(b,W)},__s:function(b,W){var rt=this.cc.u8.utf8StrToBytes(b),Z=this.__i();return b=this.cc.u8.utf8StrToBytes(W),W=this.cc.u8.utf8StrToBytes(this.__c()),b=[].concat(rt,Z,b,W),W=parseInt("0x"+this.__v()),this.__f(W)(b)+this.__v()},__f:function(b){var W=this.co.s2,rt=this.co.c3,Z=this.cc.h6.decode,ft=[function(pt){return W(pt)},function(pt){return rt(pt)},function(pt){return rt(Z(W(pt)))},function(pt){return W(Z(rt(pt)))},function(pt){return rt(Z(rt(pt)))},function(pt){return W(Z(W(pt)))}];return ft[(128<b?b-128:b)%ft.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(m!==void 0&&m.env&&m.request&&m.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 Mn.isDebug()},version:function(){return e.VERSION}},e})()},ut(d)=="object"?l.exports=x():(T=typeof(P=x)=="function"?P.call(d,g,d,l):P)===void 0||(l.exports=T)}},n={};function a(l){var d=n[l];if(d!==void 0)return d.exports;var g=n[l]={id:l,loaded:!1,exports:{}};return t[l].call(g.exports,g,g.exports,a),g.loaded=!0,g.exports}a.n=l=>{var d=l&&l.__esModule?()=>l.default:()=>l;return a.d(d,{a:d}),d},a.d=(l,d)=>{for(var g in d)a.o(d,g)&&!a.o(l,g)&&Object.defineProperty(l,g,{enumerable:!0,get:d[g]})},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,d)=>Object.prototype.hasOwnProperty.call(l,d),a.r=l=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})};var f=a(737);nr.exports.LyyGetCommandSDK=f})()});var ei={};Qe(ei,{DyErrorCode:()=>he,DyErrorMessage:()=>it,ENV_TYPE:()=>Qt,EXTERNAL_ENV_TYPE:()=>de,JdErrorCode:()=>en,JdErrorMessage:()=>Nt,createServices:()=>Ur,getDisplayAdConfig:()=>Cn,getDyPayRtaData:()=>on,handleDyAuthDebitSignFlow:()=>Tn,handleDyAuthDebitSignFlowWithRawPayInfo:()=>wn,handleDyJsapiPayFlow:()=>Rn,handleDyPayCommandFlow:()=>En,handleDyPayFlow:()=>rn,handleJdInsurance:()=>Dn,handleJdInsuranceExt:()=>In,handleJdjrCashLoanExt:()=>An,handleJdjrCashLoanFlow:()=>gn,normalizeDisplayAdData:()=>an});module.exports=oo(ei);var Qt={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},de={SIT:"sit",RELEASE:"release",PROD:"prod"},ze={[Qt.DEV]:"https://dm.leyaoyao.com",[Qt.SIT]:"https://sm.leyaoyao.com",[Qt.UAT]:"https://um.leyaoyao.com",[Qt.PROD]:"https://m.leyaoyao.com"},Bn={[Qt.DEV]:"https://dad2.leyaoyao.com",[Qt.SIT]:"https://sad2.leyaoyao.com",[Qt.UAT]:"https://uad2.leyaoyao.com",[Qt.PROD]:"https://nad.ehuoke.com"},Fe={[de.SIT]:"https://sopenapi.leyaoyao.com",[de.RELEASE]:"https://uopen-api.leyaoyao.com",[de.PROD]:"https://api-gateway.leyaoyao.com"};function Ze(t,n){return`${ze[t]||ze[Qt.PROD]}${n}`}function jn(t){return Bn[t]||Bn[Qt.PROD]}var Ne={debug:!1,env:Qt.PROD,externalEnv:de.PROD,apiDomain:""},Vn=et({},Ne);function Hn(t){Vn=et(et({},Ne),t)}function ie(){return Vn}var io=Object.defineProperty,ao=(t,n,a)=>n in t?io(t,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[n]=a,so=(t,n,a)=>ao(t,typeof n!="symbol"?n+"":n,a);function ae(){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 uo=class{constructor(t=!1){so(this,"enable"),this.enable=t}setEnable(t){this.enable=t}info(...t){this.enable&&console.info("[BI Info]",...t)}warn(...t){this.enable&&console.warn("[BI Warn]",...t)}error(...t){this.enable&&console.error("[BI Error]",...t)}debug(...t){this.enable&&console.log("[BI Debug]",...t)}},E=new uo;function Ye(t){let n=ae();return n==="taro"?Taro.setClipboardData({data:t}).then(()=>{E.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):n==="uni"?new Promise((a,f)=>{uni.setClipboardData({data:t,success:()=>{E.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),a()},fail:l=>{E.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",l),f(l)}})}):n==="wechat"?new Promise((a,f)=>{wx.setClipboardData({data:t,success:()=>{E.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),a()},fail:l=>{E.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",l),f(l)}})}):n==="alipay"?new Promise((a,f)=>{my.setClipboardData({text:t,success:()=>{E.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),a()},fail:l=>{E.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",l),f(l)}})}):navigator.clipboard.writeText(t).then(()=>{E.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function _n(t,n=2e3){let a=ae();if(a==="taro"){Taro.showToast({title:t,icon:"none",mask:!0,duration:n});return}if(a==="uni"){uni.showToast({title:t,icon:"none",mask:!0,duration:n});return}if(a==="wechat"){wx.showToast({title:t,icon:"none",mask:!0,duration:n});return}if(a==="alipay"){my.showToast({content:t,duration:n});return}typeof console!="undefined"&&console.log(`[Toast] ${t}`)}async function Pe(){var t,n,a,f,l;let d=ae();try{if(d==="taro")return((t=(await Taro.getSystemInfo()).platform)==null?void 0:t.toLowerCase())==="ios"?"ios":"android";if(d==="uni")return((n=uni.getSystemInfoSync().platform)==null?void 0:n.toLowerCase())==="ios"?"ios":"android";if(d==="wechat")return wx.getDeviceInfo?((a=(await wx.getDeviceInfo()).platform)==null?void 0:a.toLowerCase())==="ios"?"ios":"android":((f=wx.getSystemInfoSync().platform)==null?void 0:f.toLowerCase())==="ios"?"ios":"android";if(d==="alipay")return((l=my.getSystemInfoSync().platform)==null?void 0:l.toLowerCase())==="ios"?"ios":"android";if(typeof navigator!="undefined"){let g=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(g))return"ios";if(/android/.test(g))return"android"}return"unknown"}catch(g){return E.error("\u83B7\u53D6\u5E73\u53F0\u4FE1\u606F\u5931\u8D25",g),"unknown"}}var xt={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function J(t,n,a=null){return{code:t,message:n,data:a}}function tn(t,n){return t==null?{valid:!1,message:`${n}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof t=="string"&&t.trim().length===0?{valid:!1,message:`${n}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function Le(t,n){for(let a of n){let f=tn(t[a],a);if(!f.valid)return f}return{valid:!0}}var Pn={};Qe(Pn,{handleJdInsurance:()=>Dn,handleJdInsuranceExt:()=>In,handleJdjrCashLoanExt:()=>An,handleJdjrCashLoanFlow:()=>gn});var en=(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))(en||{}),Nt={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"},he=(N=>(N[N.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",N[N.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",N[N.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",N[N.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",N[N.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",N[N.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",N[N.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",N[N.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",N[N.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",N[N.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",N[N.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",N[N.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",N[N.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",N[N.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",N[N.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",N[N.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",N[N.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",N[N.DY_PAY__INVALID_RETURN_TYPE=3018]="DY_PAY__INVALID_RETURN_TYPE",N[N.DY_PAY__JSAPI_INFO_FAILED=3019]="DY_PAY__JSAPI_INFO_FAILED",N[N.DY_PAY__REQUEST_JSAPI_INFO_FAILED=3020]="DY_PAY__REQUEST_JSAPI_INFO_FAILED",N[N.DY_PAY__MISSING_JSAPI_PAY_INFO=3021]="DY_PAY__MISSING_JSAPI_PAY_INFO",N[N.DY_PAY__INVALID_JSAPI_PAY_INFO=3022]="DY_PAY__INVALID_JSAPI_PAY_INFO",N[N.DY_PAY__JSAPI_SIGNATURE_FAILED=3023]="DY_PAY__JSAPI_SIGNATURE_FAILED",N[N.DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED=3024]="DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED",N[N.DY_PAY__JSAPI_UNSUPPORTED_ENV=3025]="DY_PAY__JSAPI_UNSUPPORTED_ENV",N[N.DY_PAY__JSAPI_AUTH_REDIRECT_FAILED=3026]="DY_PAY__JSAPI_AUTH_REDIRECT_FAILED",N[N.DY_PAY__JSAPI_SDK_LOAD_FAILED=3027]="DY_PAY__JSAPI_SDK_LOAD_FAILED",N[N.DY_PAY__JSAPI_CONFIG_FAILED=3028]="DY_PAY__JSAPI_CONFIG_FAILED",N[N.DY_PAY__JSAPI_INVOKE_FAILED=3029]="DY_PAY__JSAPI_INVOKE_FAILED",N[N.DY_PAY__MISSING_AUTH_TOKEN=3030]="DY_PAY__MISSING_AUTH_TOKEN",N[N.DY_PAY_COMMAND__MISSING_ORDER_AMOUNT=3031]="DY_PAY_COMMAND__MISSING_ORDER_AMOUNT",N[N.DY_PAY_COMMAND__GET_FAILED=3032]="DY_PAY_COMMAND__GET_FAILED",N[N.DY_PAY_COMMAND__REQUEST_FAILED=3033]="DY_PAY_COMMAND__REQUEST_FAILED",N[N.DY_PAY_COMMAND__COPY_FAILED=3034]="DY_PAY_COMMAND__COPY_FAILED",N[N.DY_PAY_COMMAND__INVALID_RTA_DATA=3035]="DY_PAY_COMMAND__INVALID_RTA_DATA",N[N.DY_PAY__MISSING_AUTH_DEBIT_SIGN_REQUEST_ID=3036]="DY_PAY__MISSING_AUTH_DEBIT_SIGN_REQUEST_ID",N[N.DY_PAY__AUTH_DEBIT_SIGN_FAILED=3037]="DY_PAY__AUTH_DEBIT_SIGN_FAILED",N[N.DY_PAY__REQUEST_AUTH_DEBIT_SIGN_FAILED=3038]="DY_PAY__REQUEST_AUTH_DEBIT_SIGN_FAILED",N[N.DY_PAY__JSAPI_PAY_CANCELLED=3039]="DY_PAY__JSAPI_PAY_CANCELLED",N))(he||{}),it={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",3036:"\u7F3A\u5C11\u6388\u6743\u4EE3\u6263\u7B7E\u7EA6requestId",3037:"\u6388\u6743\u4EE3\u6263\u7B7E\u7EA6\u5931\u8D25",3038:"\u6388\u6743\u4EE3\u6263\u7B7E\u7EA6\u8BF7\u6C42\u5931\u8D25",3039:"\u7528\u6237\u53D6\u6D88\u6296\u97F3\u652F\u4ED8"};var co=(t,n,a,f)=>{let l=ae();if(l==="taro")return Taro.request({url:t,method:n,data:a,header:f}).then(P=>P);if(l==="uni")return new Promise((P,T)=>{uni.request({url:t,method:n,data:a,header:f,success:x=>P(x),fail:x=>T(x)})});if(l==="wechat")return new Promise((P,T)=>{wx.request({url:t,method:n,data:a,header:f,success:x=>P(x),fail:x=>T(x)})});if(l==="alipay")return new Promise((P,T)=>{my.request({url:t,method:n,data:a,headers:f,success:x=>P(x),fail:x=>T(x)})});let d=n.toUpperCase()==="GET",g=d&&a&&Object.keys(a).length?`${t}?${new URLSearchParams(a).toString()}`:t;return fetch(g,{method:n,headers:f,body:d?void 0:JSON.stringify(a)}).then(async P=>({statusCode:P.status,data:await P.json()}))},yn=class{constructor(n=null){$e(this,"staticConfig");this.staticConfig=n}getCurrentConfig(){return this.staticConfig||ie()||Ne}async getAuthToken(){let n=this.getCurrentConfig();if(n.getAuthToken&&typeof n.getAuthToken=="function")try{let a=await n.getAuthToken();return a?(E.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),a):(E.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(a){return E.error("\u83B7\u53D6Token\u5931\u8D25",a),null}return null}async buildHeader(n={},a=!0){let f=et({"content-type":"application/json"},n);if(!a)return f;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 f.Authorization_bar=l,f}async request(n){let{path:a,method:f="POST",data:l={},header:d={},authRequired:g=!0,baseDomain:P,beforeRequest:T,afterResponse:x}=n,ut=P?`${P}${a}`:Ze(this.getCurrentConfig().env||"prod",a),tt=await this.buildHeader(d,g);T&&typeof T=="function"&&await T({url:ut,method:f,data:l,header:tt}),E.info(`\u53D1\u8D77${f}\u8BF7\u6C42:`,{path:a,method:f});try{let G=await co(ut,f,l,tt);return E.info("\u8BF7\u6C42\u6210\u529F:",{path:a,statusCode:G.statusCode}),x&&typeof x=="function"&&await x(G.data),G.data}catch(G){throw E.error("\u8BF7\u6C42\u5931\u8D25:",{path:a,error:G}),G}}get(n,a={},f={}){return this.request(et({path:n,method:"GET",data:a},f))}post(n,a={},f={}){return this.request(et({path:n,method:"POST",data:a},f))}},be=(t=null)=>new yn(t);var lo=(function(){"use strict";function t(S,nt){var mt=(65535&S)+(65535&nt);return(S>>16)+(nt>>16)+(mt>>16)<<16|65535&mt}function n(S,nt,mt,st,H,wt){return t((wt=t(t(nt,S),t(st,wt)))<<H|wt>>>32-H,mt)}function a(S,nt,mt,st,H,wt,w){return n(nt&mt|~nt&st,S,nt,H,wt,w)}function f(S,nt,mt,st,H,wt,w){return n(nt&st|mt&~st,S,nt,H,wt,w)}function l(S,nt,mt,st,H,wt,w){return n(nt^mt^st,S,nt,H,wt,w)}function d(S,nt,mt,st,H,wt,w){return n(mt^(nt|~st),S,nt,H,wt,w)}function g(S,nt){var mt,st,H,wt;S[nt>>5]|=128<<nt%32,S[14+(nt+64>>>9<<4)]=nt;for(var w=1732584193,O=-271733879,L=-1732584194,F=271733878,D=0;D<S.length;D+=16)w=a(mt=w,st=O,H=L,wt=F,S[D],7,-680876936),F=a(F,w,O,L,S[D+1],12,-389564586),L=a(L,F,w,O,S[D+2],17,606105819),O=a(O,L,F,w,S[D+3],22,-1044525330),w=a(w,O,L,F,S[D+4],7,-176418897),F=a(F,w,O,L,S[D+5],12,1200080426),L=a(L,F,w,O,S[D+6],17,-1473231341),O=a(O,L,F,w,S[D+7],22,-45705983),w=a(w,O,L,F,S[D+8],7,1770035416),F=a(F,w,O,L,S[D+9],12,-1958414417),L=a(L,F,w,O,S[D+10],17,-42063),O=a(O,L,F,w,S[D+11],22,-1990404162),w=a(w,O,L,F,S[D+12],7,1804603682),F=a(F,w,O,L,S[D+13],12,-40341101),L=a(L,F,w,O,S[D+14],17,-1502002290),w=f(w,O=a(O,L,F,w,S[D+15],22,1236535329),L,F,S[D+1],5,-165796510),F=f(F,w,O,L,S[D+6],9,-1069501632),L=f(L,F,w,O,S[D+11],14,643717713),O=f(O,L,F,w,S[D],20,-373897302),w=f(w,O,L,F,S[D+5],5,-701558691),F=f(F,w,O,L,S[D+10],9,38016083),L=f(L,F,w,O,S[D+15],14,-660478335),O=f(O,L,F,w,S[D+4],20,-405537848),w=f(w,O,L,F,S[D+9],5,568446438),F=f(F,w,O,L,S[D+14],9,-1019803690),L=f(L,F,w,O,S[D+3],14,-187363961),O=f(O,L,F,w,S[D+8],20,1163531501),w=f(w,O,L,F,S[D+13],5,-1444681467),F=f(F,w,O,L,S[D+2],9,-51403784),L=f(L,F,w,O,S[D+7],14,1735328473),w=l(w,O=f(O,L,F,w,S[D+12],20,-1926607734),L,F,S[D+5],4,-378558),F=l(F,w,O,L,S[D+8],11,-2022574463),L=l(L,F,w,O,S[D+11],16,1839030562),O=l(O,L,F,w,S[D+14],23,-35309556),w=l(w,O,L,F,S[D+1],4,-1530992060),F=l(F,w,O,L,S[D+4],11,1272893353),L=l(L,F,w,O,S[D+7],16,-155497632),O=l(O,L,F,w,S[D+10],23,-1094730640),w=l(w,O,L,F,S[D+13],4,681279174),F=l(F,w,O,L,S[D],11,-358537222),L=l(L,F,w,O,S[D+3],16,-722521979),O=l(O,L,F,w,S[D+6],23,76029189),w=l(w,O,L,F,S[D+9],4,-640364487),F=l(F,w,O,L,S[D+12],11,-421815835),L=l(L,F,w,O,S[D+15],16,530742520),w=d(w,O=l(O,L,F,w,S[D+2],23,-995338651),L,F,S[D],6,-198630844),F=d(F,w,O,L,S[D+7],10,1126891415),L=d(L,F,w,O,S[D+14],15,-1416354905),O=d(O,L,F,w,S[D+5],21,-57434055),w=d(w,O,L,F,S[D+12],6,1700485571),F=d(F,w,O,L,S[D+3],10,-1894986606),L=d(L,F,w,O,S[D+10],15,-1051523),O=d(O,L,F,w,S[D+1],21,-2054922799),w=d(w,O,L,F,S[D+8],6,1873313359),F=d(F,w,O,L,S[D+15],10,-30611744),L=d(L,F,w,O,S[D+6],15,-1560198380),O=d(O,L,F,w,S[D+13],21,1309151649),w=d(w,O,L,F,S[D+4],6,-145523070),F=d(F,w,O,L,S[D+11],10,-1120210379),L=d(L,F,w,O,S[D+2],15,718787259),O=d(O,L,F,w,S[D+9],21,-343485551),w=t(w,mt),O=t(O,st),L=t(L,H),F=t(F,wt);return[w,O,L,F]}function P(S){for(var nt="",mt=32*S.length,st=0;st<mt;st+=8)nt+=String.fromCharCode(S[st>>5]>>>st%32&255);return nt}function T(S){var nt=[];for(nt[(S.length>>2)-1]=void 0,st=0;st<nt.length;st+=1)nt[st]=0;for(var mt=8*S.length,st=0;st<mt;st+=8)nt[st>>5]|=(255&S.charCodeAt(st/8))<<st%32;return nt}function x(S){for(var nt,mt="0123456789abcdef",st="",H=0;H<S.length;H+=1)nt=S.charCodeAt(H),st+=mt.charAt(nt>>>4&15)+mt.charAt(15&nt);return st}function ut(S){return unescape(encodeURIComponent(S))}function tt(S){return P(g(T(S=ut(S)),8*S.length))}function G(S,nt){return(function(mt,st){var H,wt=T(mt),w=[],O=[];for(w[15]=O[15]=void 0,16<wt.length&&(wt=g(wt,8*mt.length)),H=0;H<16;H+=1)w[H]=909522486^wt[H],O[H]=1549556828^wt[H];return st=g(w.concat(T(st)),512+8*st.length),P(g(O.concat(st),640))})(ut(S),ut(nt))}function Ct(S,nt,mt){return nt?mt?G(nt,S):x(G(nt,S)):mt?tt(S):x(tt(S))}return Ct})(),xe=lo;function Gn(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function Kn(t){if(typeof t!="object"||t===null)return t;let n=Object.keys(t).sort(),a={};for(let f of n)a[f]=t[f];return JSON.stringify(a)}function Xn(t,n){let a={appId:t.appId,randomStr:t.randomStr,data:t.data},f=Object.keys(a).sort(),l="";for(let[d,g]of f.entries())l+=`${g}=${a[g]}`,d<f.length-1&&(l+="&");return l+=`&secretKey=${n}`,xe(l)}var fo=(t,n,a,f)=>{let l=ae();return l==="taro"?Taro.request({url:t,method:n,data:a,header:f}).then(d=>d):l==="uni"?new Promise((d,g)=>{uni.request({url:t,method:n,data:a,header:f,success:P=>d(P),fail:P=>g(P)})}):l==="wechat"?new Promise((d,g)=>{wx.request({url:t,method:n,data:a,header:f,success:P=>d(P),fail:P=>g(P)})}):l==="alipay"?new Promise((d,g)=>{my.request({url:t,method:n,data:a,headers:f,success:P=>d(P),fail:P=>g(P)})}):fetch(t,{method:n,headers:f,body:JSON.stringify(a)}).then(async d=>({statusCode:d.status,data:await d.json()}))},pn=class{constructor(n=null){$e(this,"staticConfig");this.staticConfig=n}getCurrentConfig(){return this.staticConfig||ie()||{}}getExternalEnv(){var n;return((n=this.getCurrentConfig())==null?void 0:n.externalEnv)||de.PROD}getExternalHost(){let n=this.getExternalEnv();return Fe[n]||Fe.prod}generateSign(n={}){let a=this.getCurrentConfig(),{externalAppId:f,externalAppSecret:l}=a;if(!f||!l)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let d=Gn(),g=Kn(n),P=Xn({appId:f,randomStr:d,data:g},l);return{appId:f,randomStr:d,sign:P}}buildRequestBody(n={}){let a=this.generateSign(n);return zt(et({},a),{data:n})}buildUrl(n){return`${this.getExternalHost()}${n}`}async request(n){let{path:a,method:f="POST",data:l={},header:d={},needSign:g=!0,beforeRequest:P,afterResponse:T}=n,x=this.buildUrl(a),ut=et({"content-type":"application/json"},d),tt=g?this.buildRequestBody(l):l;P&&typeof P=="function"&&await P({url:x,method:f,data:tt,header:ut}),E.info(`\u53D1\u8D77${f}\u8BF7\u6C42:`,{path:a,method:f});try{let G=await fo(x,f,tt,ut);if(E.info("\u8BF7\u6C42\u6210\u529F:",{path:a,statusCode:G.statusCode}),T&&typeof T=="function"&&await T(G.data),G.statusCode===200&&G.data.code===200)return G.data.data;throw{code:G.data.code,msg:G.data.data||"\u8BF7\u6C42\u4E1A\u52A1\u5F02\u5E38",original:G.data}}catch(G){throw(G==null?void 0:G.code)!==void 0?G:(E.error("\u8BF7\u6C42\u5931\u8D25:",{path:a,error:G}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:G})}}get(n,a={},f={}){return this.request(et({path:n,method:"GET",data:a},f))}post(n,a={},f={}){return this.request(et({path:n,method:"POST",data:a},f))}},Wn=(t=null)=>new pn(t);var hn=be(),mn=Wn();function Qn(t){let n=tn(t==null?void 0:t.equipmentValue,"equipmentValue");return n.valid?hn.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",t):Promise.reject({code:"PARAM_ERROR",message:n.message})}async function $n(t){let n=Le(t,["idMd5Value","rtaStrategy"]);return n.valid?mn.post("/open/rest/cpa/jd/rta-check",t):Promise.reject({code:"PARAM_ERROR",message:n.message})}async function zn(t){try{let n={thirdPlatform:t.thirdPlatform,thirdPlatformUserId:t.thirdPlatformUserId,thirdPlatformEquipmentValue:t.thirdPlatformEquipmentValue,os:t.os,client:"wxMini"};t.phone&&(n.mobileMd5=xe(t.phone)),t.extendData&&(Object.prototype.toString.call(t.extendData)==="[object Object]"?n.extendData=t.extendData:E.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let a=await mn.post("/open/rest/cpa/jd/insurance/get",n);return a?a.jumpMode==1?{jumpMode:1,appId:a.appId,url:a.url}:{jumpMode:2,url:a.url,channel:a.channelId}:void 0}catch(n){throw E.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",n),n}}function Zn(t){let n=tn(t==null?void 0:t.equipmentValue,"equipmentValue");return n.valid?hn.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",t):Promise.reject({code:"PARAM_ERROR",message:n.message})}function tr(t){let n=Le(t,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return n.valid?hn.post("/gw/advert/customer/cpa-activity/jd/rta/validate",t):Promise.reject({code:"PARAM_ERROR",message:n.message})}async function er(t){let n=await Pe(),a={thirdPlatform:t.thirdPlatform,thirdPlatformUserId:t.thirdPlatformUserId,thirdPlatformEquipmentValue:t.thirdPlatformEquipmentValue,os:n,client:t.client};return t.phone&&(a.mobileMd5=xe(t.phone)),t.extendData&&(Object.prototype.toString.call(t.extendData)==="[object Object]"?a.extendData=t.extendData:E.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),mn.post("/open/rest/cpa/jd/cash-loan/get",a)}async function gn(t){let{phone:n,rtaId:a,equipmentId:f,lyyUserId:l,entrance:d}=t;if(!n)return J(xt.INVALID_PARAM,Nt[2001]);if(!f)return J(xt.INVALID_PARAM,Nt[2002]);try{if(a){E.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:n});let tt=await tr({phone:n,lyyEquipmentValue:f,lyyUserId:l||"",rtaId:a});if(tt.code!=="0000000"||!tt.body||tt.body.state!=1)return E.error("RTA\u9A8C\u8BC1\u5931\u8D25",tt),J(2003,Nt[2003]);E.info("RTA\u9A8C\u8BC1\u6210\u529F",tt.body)}E.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:n});let g=await Pe(),P=await Zn({phone:n,equipmentValue:f,os:g,entrance:d});if(P.code!=="0000000"||!P.body)return E.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",P),J(2004,Nt[2004]);let{appId:T,targetUrl:x}=P.body;if(!T||!x)return E.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:T,targetUrl:x}),J(2005,Nt[2005]);let ut=J(xt.SUCCESS,"\u6210\u529F",{appId:T,targetUrl:x});return E.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",ut),ut}catch(g){return E.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",g),J(xt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function An(t){let{phone:n,rtaId:a,thirdPlatform:f,thirdPlatformUserId:l,thirdPlatformEquipmentValue:d}=t;if(!n)return J(xt.INVALID_PARAM,Nt[2001]);if(!f)return J(2008,Nt[2008]);if(!l)return J(2009,Nt[2009]);if(!d)return J(2010,Nt[2010]);try{if(a){E.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:n});let G=await $n({idMd5Value:n,rtaStrategy:a});if(G.status!=1)return E.error("RTA\u9A8C\u8BC1\u5931\u8D25",G),J(2003,Nt[2003]);E.info("RTA\u9A8C\u8BC1\u6210\u529F",G)}let g=await er(t),{url:P,channelId:T,matchFlag:x,jumpMode:ut,appId:tt}=g||{};return x?ut===3?!tt||!P?J(2007,Nt[2007]):J(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:tt,url:P}):J(2007,Nt[2007]):J(2006,Nt[2006])}catch(g){return E.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",g),J(xt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var Oe=null,Ue=null;try{Ue=rr()}catch(t){}function or(){return Oe||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(Oe=globalThis.LyyGetCommandSDK,Oe):Ue?(Oe=Ue.LyyGetCommandSDK||Ue.default||Ue,Oe):null)}function ir(t){var a;E.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",t);let n=or();n!=null&&n.getJrCommand?n.getJrCommand(t):(a=n==null?void 0:n.default)!=null&&a.getJrCommand?n.default.getJrCommand(t):(E.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),t.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function _o(t,n){return new Promise((a,f)=>{try{ir({url:t,channel:n,callback:l=>{l.code==="0"?a(l.data):f({msg:l.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(l){f(l)}})}async function Dn(t){try{let n=await Pe(),a=et({os:n},t);E.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",a);let{code:f,body:l}=await Qn(a);if(f==="0000000"&&l){let{url:d,channelId:g,matchFlag:P,jumpMode:T,appId:x}=l;if(!P)return J(2101,Nt[2101]);if(T===1)return E.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),J(2102,Nt[2102]);if(T===2)return ae()==="web"&&E.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:d}),!d||!g?J(2103,Nt[2103]):new Promise(ut=>{ir({url:d,channel:g,callback:async tt=>{if((tt==null?void 0:tt.code)==="0")try{await Ye(tt==null?void 0:tt.data),ut(J(xt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch(G){ut(J(2105,Nt[2105]))}else ut(J(2105,Nt[2105]))}})});if(T===3)return!x||!d?J(2103,Nt[2103]):J(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:x,path:d})}return J(2104,Nt[2104])}catch(n){return E.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",n),J(xt.NETWORK_ERROR,"\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5")}}async function In(t){E.info("\u5F00\u59CB\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4...");try{let n=await zn(zt(et({},t),{os:await Pe()}));if(!n)return E.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),J(2106,Nt[2106]);if(n.jumpMode===1)return E.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{appId:n.appId,url:n.url}),J(xt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:n.appId,path:n.url});if(n.jumpMode===2){if(ae()==="web")return E.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:n.url}),J(xt.SUCCESS,"\u6210\u529F",{type:"h5",url:n.url});try{let a=await _o(n.url,n.channel);return await Ye(a),E.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),J(xt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(a){return E.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",a),_n("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),J(2105,Nt[2105])}}return E.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",n.jumpMode),J(2107,Nt[2107])}catch(n){let a=typeof n=="string"?n:(n==null?void 0:n.msg)||(n==null?void 0:n.message)||"\u672A\u77E5\u9519\u8BEF";return E.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",a),_n("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),a.includes("RTA")||a.includes("\u8D44\u683C")?J(2108,Nt[2108]):J(xt.NETWORK_ERROR,a)}}var Nn={};Qe(Nn,{DyErrorCode:()=>he,getDyPayRtaData:()=>on,handleDyAuthDebitSignFlow:()=>Tn,handleDyAuthDebitSignFlowWithRawPayInfo:()=>wn,handleDyJsapiPayFlow:()=>Rn,handleDyPayCommandFlow:()=>En,handleDyPayFlow:()=>rn});var yo=["weapp","h5"],po=["h5","ulink","jsapi"],ho=["switchTab","reLaunch","redirectTo","navigateTo"];function mo(t){return yo.includes(t)}function go(t){return po.includes(t)}function Ao(t){return ho.includes(t)}function ar(t){let n=t.returnType||"h5";return!t.telephone&&n==="h5"?{valid:!1,errorCode:3001}:t.price?t.equipmentValue?t.businessType?t.client&&!mo(t.client)?{valid:!1,errorCode:3004}:go(n)?t.douyinOrderExtendData&&typeof t.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:t.backWay&&t.client==="weapp"&&!Ao(t.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 sr(t){return t.price?t.equipmentValue?t.businessType?t.douyinOrderExtendData&&typeof t.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}}function ur(t){return t.equipmentValue?{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}function cr(t){return t.equipmentValue?t.orderAmount?t.businessType?t.commandUrl!=null&&typeof t.commandUrl!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3031}:{valid:!1,errorCode:3002}}function lr(t){return t.equipmentValue?t.commandUrl!=null&&typeof t.commandUrl!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}function fr(t){return t.showFlag===!0&&typeof t.payAmount=="number"&&t.payAmount>0&&typeof t.businessType=="number"&&t.businessType>0}var ve=be();async function dr(t){let{price:n,equipmentValue:a,douyinOrderExtendData:f,douyinCommodityVirtualFlag:l,businessType:d,platformActivities:g={}}=t,P={businessType:d,equipmentValue:a,payInfoBusinessType:"commonDouyinPayment",platformActivities:et({douyinCommodityVirtualFlag:l||!1,douyinCommodityPrice:n,douyinOrderExtendData:f||""},g)};try{let T=await ve.post("/gw/advert/customer/payment/pay-info",P);return T.code!=="0000000"||!(T!=null&&T.body)?Promise.reject({code:3006,message:T.message||it[3006]}):(T.body.platformActivities=P.platformActivities,T)}catch(T){return E.error("getDyOrderAmountFn error:",T),Promise.reject({code:3007,message:it[3007]})}}async function _r(t){var n,a,f,l;try{let d=t.commodityList.map(Ct=>(Ct.commodity=Ct.commodityId,delete Ct.commodityId,Ct.quantity=Ct.quantity||1,Ct)),g=t.advertExtendInfo&&Object.keys(t.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:t.advertExtendInfo}):"",P=ae(),T="";P==="wechat"?T="wechatMini":P==="web"&&navigator.userAgent.toLowerCase().includes("micromessenger")&&(T="wechatHtml");let x=t.returnType==="jsapi",ut=x?22:21,tt=et(et(et({businessType:t.businessType,fixedClientType:ut,channelCode:null,douyinData:et(et({loginMobile:t.telephone||""},((n=t.jsapiInfo)==null?void 0:n.outProductCategory)!=null?{outProductCategory:t.jsapiInfo.outProductCategory}:{}),((a=t.jsapiInfo)==null?void 0:a.requestId)!=null?{requestId:t.jsapiInfo.requestId}:{}),equipmentUseFlag:!1,payEquipmentDTO:{equipmentValue:t.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:g,transType:5,actualFee:t.totalFee,totalFee:t.totalFee,commodityList:d,clientSourceDetailType:T,platformActivities:t.platformActivities||{}},t.commoditySign&&{commoditySign:t.commoditySign}),t.unifiedOrderExtendData&&et({},t.unifiedOrderExtendData)),x?{appId:((f=t.jsapiInfo)==null?void 0:f.appId)||"",openId:((l=t.jsapiInfo)==null?void 0:l.douyinOpenId)||""}:{});if(t.returnType=="ulink")return delete tt.channelCode,tt;let G=await ve.post("/gw/payment-bff/unified/order",tt);return G.code!=="0000000"||!(G!=null&&G.body)?Promise.reject({code:3008,message:G.message||it[3008]}):G}catch(d){return E.error("dyUnifiedOrderFn error:",d),Promise.reject({code:3009,message:it[3009]})}}async function yr(t){let n={equipmentValue:t.equipmentValue,phone:t.telephone||""};t.price&&(n.orderAmount=t.price);try{let a=await ve.post("/gw/advert/customer/douyin/pay/check",n);return a.code!=="0000000"||!(a!=null&&a.body)?Promise.reject({code:3013,message:a.message||it[3013]}):a}catch(a){return E.error("getDyPayRtaData error:",a),Promise.reject({code:3014,message:(a==null?void 0:a.message)||it[3014]})}}async function pr(t={}){var n;try{let a=(n=t.requestNo)==null?void 0:n.trim(),f=a?`/gw/advert/customer/douyin/pay/jsapi/info?requestNo=${a}`:"/gw/advert/customer/douyin/pay/jsapi/info",l=await ve.get(f);return l.code!=="0000000"||!(l!=null&&l.body)?Promise.reject({code:3019,message:l.message||it[3019]}):{appId:l.body.appId,douyinOpenId:l.body.douyinOpenId,outProductCategory:l.body.outProductCategory,requestId:l.body.requestId}}catch(a){return E.error("getDyPayJsapiInfoFn error:",a),Promise.reject({code:(a==null?void 0:a.code)||3020,message:(a==null?void 0:a.message)||it[3020]})}}async function Me(t){try{let n=await ve.post("/gw/advert/customer/douyin/pay/jsapi/signature",t);return n.code!=="0000000"||!(n!=null&&n.body)||!n.body.signature||!n.body.timestamp||!n.body.nonceStr?Promise.reject({code:3023,message:n.message||it[3023]}):{signature:n.body.signature,timestamp:n.body.timestamp,nonceStr:n.body.nonceStr}}catch(n){return E.error("getDyPayJsapiSignatureFn error:",n),Promise.reject({code:(n==null?void 0:n.code)||3024,message:(n==null?void 0:n.message)||it[3024]})}}async function hr(t){try{let n=await ve.post("/gw/advert/customer/douyin/pay-command",t);return n.code!=="0000000"||!(n!=null&&n.body)?Promise.reject({code:3032,message:n.message||it[3032]}):n}catch(n){return E.error("getDyPayCommandFn error:",n),Promise.reject({code:(n==null?void 0:n.code)||3033,message:(n==null?void 0:n.message)||it[3033]})}}async function nn(t){try{let n=await ve.post("/gw/advert/customer/automatic-debit/sign/request-id",{requestId:t});return n.code!=="0000000"||!(n!=null&&n.body)?Promise.reject({code:3037,message:n.message||it[3037]}):n.body}catch(n){return E.error("dyAutomaticDebitSignByRequestIdFn error:",n),Promise.reject({code:(n==null?void 0:n.code)||3038,message:(n==null?void 0:n.message)||it[3038]})}}var Do="/auth/rest/auth/third",Dr="url_token",Io="https://unpkg.byted-static.com/bridge/douyin_open/1.0.17/lib/douyin_open.umd.js",Je=null,Po="-2",vo="1",So="0";function Jt(t,n){let a=new Error(n||it[t]);return Object.assign(a,{code:t})}function Ir(t){var a;let n=(a=t==null?void 0:t.data)==null?void 0:a.code;return n!=null?String(n):typeof(t==null?void 0:t.code)=="string"?t.code:""}function mr(t){return String(t==null?void 0:t.code)===Po}function gr(t){return Ir(t)===vo}function Ar(t){var n,a;return((n=t==null?void 0:t.data)==null?void 0:n.msg)||((a=t==null?void 0:t.data)==null?void 0:a.message)||(t==null?void 0:t.message)||(t==null?void 0:t.errMsg)}function ke(){return typeof window!="undefined"&&typeof document!="undefined"}function vn(){return ke()?window.location.href:""}function me(t){let n=t.href||vn();if(!t.key||!n)return"";try{let a=new URL(n,Sr()),f=a.searchParams.get(t.key);return f!=null?f:Eo(a.hash,t.key)}catch(a){return E.warn("getDyUrlParam parse error:",a),""}}function Eo(t,n){if(!t||!n)return"";let a=t.indexOf("?");if(a<0)return"";let f=t.slice(a+1).split("#")[0];return new URLSearchParams(f).get(n)||""}function Pr(t){let{href:n,paramName:a}=t;if(!n||!a)return n;let f=n.indexOf("#"),l=f>=0?n.slice(0,f):n,d=f>=0?n.slice(f):"";try{let g=new URL(l,Sr()),P=To(l);return g.searchParams.delete(a),`${P?`${g.pathname}${g.search}`:g.toString()}${vr(d,a)}`}catch(g){return E.warn("removeDyUrlParam parse error:",g),bo(n,a)}}function vr(t,n){if(!t||!n)return t;let a=t.indexOf("?");if(a<0)return t;let f=t.slice(0,a),l=t.slice(a+1),d=l.indexOf("#"),g=d>=0?l.slice(0,d):l,P=d>=0?l.slice(d):"",T=new URLSearchParams(g);T.delete(n);let x=T.toString();return`${f}${x?`?${x}`:""}${P}`}function qe(t={}){let a=(t.href||vn()).split("#")[0]||"";return Pr({href:a,paramName:t.tokenParamName||Dr})}function Ro(t){var l,d;let n=t.tokenParamName||Dr,a=Pr({href:t.redirectUrl||vn(),paramName:n});if(!a)throw Jt(3025);let f=new URLSearchParams({useAgent:t.useAgent||"douyin",category:t.category||"pay",internal:String((l=t.internal)!=null?l:!1),silent:String((d=t.silent)!=null?d:!1),redirectUrl:a});return t.equipmentValue&&f.set("equipmentValue",t.equipmentValue),`${t.authPath||Do}?${f.toString()}`}function Be(t){if(!ke())throw Jt(3025);let n=Ro(t);E.info("\u8DF3\u8F6C\u6296\u97F3\u6388\u6743:",{authUrl:n,equipmentValue:t.equipmentValue});try{return window.location.href=n,n}catch(a){throw E.error("redirectDyAuth error:",a),Jt(3026)}}function Ce(){if(!ke())return null;let t=window;return t.DouyinOpenJSBridge||t.douyin_open||null}function je(t={}){if(!ke())return Promise.reject(Jt(3025));let n=Ce();if(n)return E.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5DF2\u52A0\u8F7D"),Promise.resolve(n);if(Je)return E.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u590D\u7528\u52A0\u8F7D\u4E2D\u4EFB\u52A1"),Je;let a=t.sdkUrl||Io;return E.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5F00\u59CB\u52A0\u8F7D",{sdkUrl:a}),Je=new Promise((f,l)=>{let d=wo(a),g=()=>{let x=Ce();if(!x){l(Jt(3027));return}E.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u6210\u529F"),f(x)},P=x=>{E.error("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u5931\u8D25",x),l(Jt(3027))};if(d){if(E.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u811A\u672C\u5DF2\u5B58\u5728"),No(d)){window.setTimeout(g,0);return}d.addEventListener("load",g,{once:!0}),d.addEventListener("error",P,{once:!0});return}let T=document.createElement("script");T.src=a,T.async=!0,T.addEventListener("load",g,{once:!0}),T.addEventListener("error",x=>{T.remove(),P(x)},{once:!0}),document.head.appendChild(T)}).catch(f=>{throw Je=null,f}),Je}function Ve(t){let n=t.sdk||Ce();if(!n)return Promise.reject(Jt(3027));let{appId:a,signatureData:f,url:l}=t;return!a||!l||!(f!=null&&f.signature)||!(f!=null&&f.timestamp)||!(f!=null&&f.nonceStr)?Promise.reject(Jt(3028)):new Promise((d,g)=>{E.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u5F00\u59CB\u914D\u7F6E",{appId:a,url:l});try{n.config({params:{client_key:a,signature:f.signature,timestamp:String(f.timestamp),nonce_str:f.nonceStr,url:l}}),n.ready(()=>{E.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5B8C\u6210"),d(n)}),n.error(P=>{E.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5931\u8D25",P),g(Jt(3028))})}catch(P){E.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5F02\u5E38",P),g(Jt(3028))}})}function Sn(t){let n=t.sdk||Ce();if(!n)return Promise.reject(Jt(3027));if(!n.ttcjpay||typeof n.ttcjpay.dypay!="function")return Promise.reject(Jt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));let{appId:a,payInfo:f}=t;if(!a||!f)return Promise.reject(Jt(3021));let l={appId:a,timeStamp:String(f.timeStamp),nonceStr:f.nonceStr,package:f.package,signType:f.signType,paySign:f.paySign};return new Promise((d,g)=>{E.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528 dypay");try{n.ttcjpay.dypay({sdk_info:JSON.stringify(l),success:P=>{if(E.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u6210\u529F\u56DE\u8C03",P),mr(P)){g(Jt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(gr(P)){g(Jt(3039));return}let T=Ir(P);if(T&&T!==So){g(Jt(3029,Ar(P)));return}d(P)},fail:P=>{if(E.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u5931\u8D25\u56DE\u8C03",P),mr(P)){g(Jt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(gr(P)){g(Jt(3039));return}g(Jt(3029,Ar(P)))}})}catch(P){E.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528\u5F02\u5E38",P),g(Jt(3029,P==null?void 0:P.message))}})}function Sr(){return ke()?window.location.origin:"https://bi-nova.local"}function To(t){return!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t)&&!t.startsWith("//")}function wo(t){return Array.from(document.getElementsByTagName("script")).find(a=>a.src===t)||null}function No(t){let n=t.readyState;return n==="loaded"||n==="complete"}function bo(t,n){let a=t.indexOf("#"),f=a>=0?t.slice(0,a):t,l=a>=0?t.slice(a):"",d=f.indexOf("?");if(d<0)return t;let g=f.slice(0,d),T=f.slice(d+1).split("&").filter(x=>x&&decodeURIComponent(x.split("=")[0])!==n).join("&");return`${g}${T?`?${T}`:""}${vr(l,n)}`}async function rn(t){var a,f,l,d;let n=ar(t);if(!n.valid)return J(n.errorCode,it[n.errorCode]);try{let g=t.returnType||"h5",P=await dr({price:t.price,equipmentValue:t.equipmentValue,businessType:t.businessType,douyinOrderExtendData:(t==null?void 0:t.douyinOrderExtendData)||"",platformActivities:(t==null?void 0:t.platformActivities)||{},douyinCommodityVirtualFlag:(t==null?void 0:t.douyinCommodityVirtualFlag)||!1}),T=g==="jsapi"?await pr({requestNo:me({key:"requestNo"})}):void 0,x=await _r(zt(et(zt(et({},P.body),{telephone:t.telephone,equipmentValue:t.equipmentValue,businessType:t.businessType}),t.unifiedOrderExtendData&&{unifiedOrderExtendData:t.unifiedOrderExtendData}),{returnType:g,jsapiInfo:T}));if(t.returnType==="ulink")return J(0,"success",{ulinkQueryParams:x});let ut=((a=x==null?void 0:x.body)==null?void 0:a.h5Url)||"",tt=((f=x==null?void 0:x.body)==null?void 0:f.outTradeNo)||"";if(g==="jsapi"){let Ct=Rr((l=x==null?void 0:x.body)==null?void 0:l.payInfo);return J(0,"success",{appId:(T==null?void 0:T.appId)||"",payInfo:Ct,outTradeNo:tt})}let G=ut?await Oo(zt(et({},t),{dyUrl:ut})):"";return G?J(0,"success",{h5Url:G,outTradeNo:tt}):J(3010,it[3010])}catch(g){E.error("handleDyPayFlow error:",g);let P=(d=g==null?void 0:g.code)!=null?d:3012,T=(g==null?void 0:g.message)||it[3012];return J(P,T)}}function Rr(t){if(!t)throw{code:3021,message:it[3021]};if(typeof t=="object"){if(Er(t))return t;throw{code:3022,message:it[3022]}}try{let n=JSON.parse(t);if(!Er(n))throw new Error("invalid payInfo fields");return n}catch(n){throw{code:3022,message:it[3022],error:n}}}function Er(t){return typeof t.timeStamp=="string"&&t.timeStamp!==""&&typeof t.nonceStr=="string"&&t.nonceStr!==""&&typeof t.package=="string"&&t.package!==""&&typeof t.signType=="string"&&t.signType!==""&&typeof t.paySign=="string"&&t.paySign!==""}async function Oo(t){let n=ie(),a=Ze(n.env||"prod",""),f=typeof n.getAuthToken=="function"?await n.getAuthToken():"",l=t.client||"weapp";return`${a}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${l}&equipmentId=${t.equipmentValue}&dyUrl=${t.dyUrl}&fromUrl=${encodeURIComponent(t.fromUrl||"")}&backUrl=${encodeURIComponent(t.backUrl||"")}&backWay=${t.backWay||""}&url_token=${f}`}async function on(t){var a;let n=ur(t);if(!n.valid)return J(n.errorCode,it[n.errorCode]);try{let f=await yr({price:(t==null?void 0:t.price)||"",equipmentValue:t.equipmentValue,telephone:(t==null?void 0:t.telephone)||""});return J(0,"success",f.body)}catch(f){E.error("getDyPayRtaData error:",f);let l=(a=f==null?void 0:f.code)!=null?a:3015,d=(f==null?void 0:f.message)||it[3015];return J(l,d)}}async function Tr(t){var a,f;let n=cr(t);if(!n.valid)return J(n.errorCode,it[n.errorCode]);try{let l=(a=t.commandUrl)==null?void 0:a.trim(),g=(await hr(et({phone:t.telephone||"",equipmentValue:t.equipmentValue,orderAmount:t.orderAmount,businessType:t.businessType},l?{commandUrl:l}:{}))).body||"";return g?J(0,"success",{command:g}):J(3032,it[3032])}catch(l){E.error("getDyPayCommand error:",l);let d=(f=l==null?void 0:l.code)!=null?f:3033,g=(l==null?void 0:l.message)||it[3033];return J(d,g)}}async function Co(t){var a;let n=await Tr(t);if(n.code!==0||!((a=n.data)!=null&&a.command))return J(n.code,n.message);try{return await Ye(n.data.command),J(0,"success",et({type:"copy_success"},t.returnCommand?{command:n.data.command}:{}))}catch(f){return E.error("copyDyPayCommand error:",f),J(3034,it[3034])}}async function En(t){var a,f,l;let n=lr(t);if(!n.valid)return J(n.errorCode,it[n.errorCode]);try{let d=await on({telephone:t.telephone||"",equipmentValue:t.equipmentValue,price:t.price});if(d.code!==0)return J(d.code,d.message);let g=d.data;if(!(g!=null&&g.showFlag))return J(0,"success",{eligible:!1,type:"not_eligible"});if(!fr(g))return J(3035,it[3035]);let P={telephone:t.telephone||"",equipmentValue:t.equipmentValue,orderAmount:g.payAmount,businessType:g.businessType,commandUrl:t.commandUrl};if(t.autoCopy){let x=await Co(zt(et({},P),{returnCommand:t.returnCommand}));return x.code!==0?J(x.code,x.message):J(0,"success",et({eligible:!0,type:"copy_success"},(a=x.data)!=null&&a.command?{command:x.data.command}:{}))}let T=await Tr(P);return T.code!==0||!((f=T.data)!=null&&f.command)?J(T.code,T.message):J(0,"success",{eligible:!0,type:"command",command:T.data.command})}catch(d){E.error("handleDyPayCommandFlow error:",d);let g=(l=d==null?void 0:d.code)!=null?l:3033,P=(d==null?void 0:d.message)||it[3033];return J(g,P)}}async function Rn(t){var a,f,l;let n=sr(t);if(!n.valid)return J(n.errorCode,it[n.errorCode]);try{let d=ie(),g=t.authToken||(typeof d.getAuthToken=="function"?await d.getAuthToken():""),P=t.autoAuth!==!1;if(!g){if(!P)return J(3030,it[3030]);let Ct=Be({equipmentValue:t.equipmentValue,redirectUrl:t.redirectUrl,tokenParamName:t.tokenParamName});return J(0,"redirecting",{type:"auth_redirect",authUrl:Ct})}let T=await je({sdkUrl:t.sdkUrl}),x=await rn(zt(et({},t),{client:"h5",returnType:"jsapi"}));if(x.code!==0||!((a=x.data)!=null&&a.appId)||!((f=x.data)!=null&&f.payInfo))return J(x.code||3021,x.message||it[3021]);let ut=t.signatureUrl||qe({tokenParamName:t.tokenParamName}),tt=await Me({url:ut});await Ve({appId:x.data.appId,signatureData:tt,url:ut,sdk:T});let G=await Sn({appId:x.data.appId,payInfo:x.data.payInfo,sdk:T});return J(0,"success",{type:"pay_result",outTradeNo:x.data.outTradeNo,payResult:G})}catch(d){E.error("handleDyJsapiPayFlow error:",d);let g=(l=d==null?void 0:d.code)!=null?l:3029,P=(d==null?void 0:d.message)||it[3029];return J(g,P)}}async function Tn(){var l;let t="url_token",n=ie(),f=(typeof n.getAuthToken=="function"?await n.getAuthToken():"")||me({key:t});try{if(!f){let Ct=me({key:"equipmentValue"}),S=Be(et({tokenParamName:t},Ct?{equipmentValue:Ct}:{}));return J(0,"redirecting",{type:"auth_redirect",authUrl:S})}let d=me({key:"requestId"}).trim();if(!d)return J(3036,it[3036]);let g=await je(),P=await nn(d),T=P.appId||P.appid||"",x=Rr(P.payInfo);if(!T)return J(3021,it[3021]);let ut=qe({tokenParamName:t}),tt=await Me(et({url:ut},T?{appid:T}:{}));await Ve({appId:T,signatureData:tt,url:ut,sdk:g});let G=await Sn({appId:T,payInfo:x,sdk:g});return J(0,"success",{type:"sign_result",orderNo:P.orderNo,payResult:G})}catch(d){E.error("handleDyAuthDebitSignFlow error:",d);let g=(l=d==null?void 0:d.code)!=null?l:3029,P=(d==null?void 0:d.message)||it[3029];return J(g,P)}}var Fo="-2",Yo="1",Lo="0";function ne(t,n){let a=new Error(n||it[t]);return Object.assign(a,{code:t})}function Or(t){var a;let n=(a=t==null?void 0:t.data)==null?void 0:a.code;return n!=null?String(n):typeof(t==null?void 0:t.code)=="string"?t.code:""}function wr(t){return String(t==null?void 0:t.code)===Fo}function Nr(t){return Or(t)===Yo}function br(t){var n,a;return((n=t==null?void 0:t.data)==null?void 0:n.msg)||((a=t==null?void 0:t.data)==null?void 0:a.message)||(t==null?void 0:t.message)||(t==null?void 0:t.errMsg)}function xo(t){if(typeof t=="string"){if(!t.trim())throw ne(3021);return t}if(!t||typeof t!="object")throw ne(3021);let n=JSON.stringify(t);if(!n)throw ne(3022);return n}function Uo(t){let n=t.sdk||Ce();if(!n)return Promise.reject(ne(3027));if(!n.ttcjpay||typeof n.ttcjpay.dypay!="function")return Promise.reject(ne(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));let a="";try{a=xo(t.payInfo)}catch(f){return Promise.reject(f!=null&&f.code?f:ne(3022,f==null?void 0:f.message))}return new Promise((f,l)=>{E.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u539F\u59CB payInfo \u900F\u4F20 dypay");try{n.ttcjpay.dypay({sdk_info:a,success:d=>{if(E.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u539F\u59CB payInfo \u900F\u4F20\u6210\u529F\u56DE\u8C03",d),wr(d)){l(ne(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(Nr(d)){l(ne(3039));return}let g=Or(d);if(g&&g!==Lo){l(ne(3029,br(d)));return}f(d)},fail:d=>{if(E.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u539F\u59CB payInfo \u900F\u4F20\u5931\u8D25\u56DE\u8C03",d),wr(d)){l(ne(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(Nr(d)){l(ne(3039));return}l(ne(3029,br(d)))}})}catch(d){E.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u539F\u59CB payInfo \u900F\u4F20\u8C03\u7528\u5F02\u5E38",d),l(ne(3029,d==null?void 0:d.message))}})}async function wn(){var l;let t="url_token",n=ie(),f=(typeof n.getAuthToken=="function"?await n.getAuthToken():"")||me({key:t});try{if(!f){let G=me({key:"equipmentValue"}),Ct=Be(et({tokenParamName:t},G?{equipmentValue:G}:{}));return J(0,"redirecting",{type:"auth_redirect",authUrl:Ct})}let d=me({key:"requestId"}).trim();if(!d)return J(3036,it[3036]);let g=await je(),P=await nn(d),T=P.appId||P.appid||"";if(!T)return J(3021,it[3021]);let x=qe({tokenParamName:t}),ut=await Me({url:x,appid:T});await Ve({appId:T,signatureData:ut,url:x,sdk:g});let tt=await Uo({payInfo:P.payInfo,sdk:g});return J(0,"success",{type:"sign_result",orderNo:P.orderNo,payResult:tt})}catch(d){E.error("handleDyAuthDebitSignFlowWithRawPayInfo error:",d);let g=(l=d==null?void 0:d.code)!=null?l:3029,P=(d==null?void 0:d.message)||it[3029];return J(g,P)}}var Fn={};Qe(Fn,{getDisplayAdConfig:()=>Cn,normalizeDisplayAdData:()=>an});var Mo=be();function Cr(t){let n=Le(t,["placementId"]);if(!n.valid)return Promise.reject({code:"PARAM_ERROR",message:n.message});let a=ie().env||"prod",f=Number.isInteger(t.userId)&&Number(t.userId)>0?{userId:t.userId}:{};return Mo.get(`/gw/advert-plugin/api/v1/config/list/valid/${t.placementId}`,f,{authRequired:!1,baseDomain:jn(a)})}var Fr=30*1e3,Jo="__",On=new Map,bn=new Map;function ko(t,n){let a=Number.isInteger(t.userId)&&Number(t.userId)>0?t.userId:"";return[t.appId||"",n,t.type||"",a].join(Jo)}function qo(t){let n=On.get(t);return n?n.expireAt<=Date.now()?(On.delete(t),E.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:t}),null):n.data:null}function Bo(t,n){On.set(t,{data:n,expireAt:Date.now()+Fr})}function jo(t){return Array.isArray(t==null?void 0:t.body)?t.body:[]}function Vo(t){return String(t==null?void 0:t.code)!=="200"}function Ho(t,n){let a=String(t||n||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(a)?a:n||"banner"}function Yr(t){return String(t||"").trim().toLowerCase()}function Go(t){var n;return!!t&&t.status!==0&&((n=t.platformConfig)==null?void 0:n.valid)!==!1}function Ko(t){return[...t].sort((n,a)=>{var d,g,P,T;let f=Number((d=n.priority)!=null?d:9999),l=Number((g=a.priority)!=null?g:9999);return f!==l?f-l:Number((P=a.weight)!=null?P:0)-Number((T=n.weight)!=null?T:0)})}function Lr(t){return t.find(n=>Yr(n.advertPlatform)==="gdt")||null}function xr(t){return t.find(n=>Yr(n.advertPlatform)!=="gdt")||null}function Xo(t,n){return t&&n?"mixed":t?"wechat":n?"custom":"none"}function Wo(t,n){var l,d;let a=Lr(t),f=xr(t);return a&&f?Number((l=a.priority)!=null?l:9999)<=Number((d=f.priority)!=null?d:9999)?"wechat-first":"custom-first":n==="custom"?"custom-only":n==="wechat"?"wechat-only":"wechat-first"}function Qo(t){var a;let n=Lr(t);return((a=n==null?void 0:n.platformConfig)==null?void 0:a.adId)||""}function $o(t,n,a){let f=String(t.mediaType||"").trim().toLowerCase();return f==="video"&&a?"video":f==="image"&&n?"image":a?"video":"image"}function zo(t){let n=t.targetAppId||"",a=t.targetPath||"",f=t.jumpUrl||t.url||t.webUrl||"",d=String(t.jumpType||"").trim().toLowerCase()||(n?"miniprogram":a?"internal":f?"web":"none");if(d==="miniprogram"){let g=String(t.miniProgramOpenMode||"").trim().toLowerCase()==="half"?"half":"full";return{jumpType:"miniProgram",appId:n||void 0,path:a||void 0,miniProgramOpenMode:g,action:{type:"miniProgram",appId:n||void 0,path:a||void 0,miniProgramOpenMode:g}}}return d==="internal"?{jumpType:"internal",path:a||void 0,action:{type:"internal",path:a||void 0}}:d==="web"?{jumpType:"web",url:f||void 0,action:{type:"web",url:f||void 0}}:d==="api"?{jumpType:"api",url:f||void 0,action:{type:"api",url:f||void 0}}:{jumpType:"none",action:{type:"none"}}}function Zo(t){let n=xr(t),a=n==null?void 0:n.platformConfig;if(!a)return null;let f=a.image||a.imageUrl||"",l=a.video||a.videoUrl||"",d=a.poster||"";if(!f&&!l)return null;let g=$o(a,f,l),P=zo(a),x=String(a.fitMode||"").trim().toLowerCase()==="contain"?"contain":"cover";return et({configId:n.id,placementId:n.placementId,configName:n.configName,advertPlatform:n.advertPlatform,mediaType:g,image:f||void 0,video:l||void 0,poster:d||void 0,bottomImage:a.bottomImage||void 0,advertiserName:a.advertiserName||void 0,advertiserLogo:a.advertiserLogo||void 0,description:a.description||void 0,buttonText:a.buttonText||void 0,badgeText:a.badgeText||void 0,jumpSeconds:a.jumpSeconds,loadTimeout:a.loadTimeout||a.timeout,muted:a.muted,adSpec:a.adSpec,fitMode:x},P)}function an(t,n){let a=Ko(t.filter(Go)),f=Zo(a),l=Qo(a),d=Ho(void 0,n),g=Xo(l,f),P=Wo(a,g);return{show:!!(l||f),adId:"",type:d,provider:g,priority:P,unitId:l,customAd:f,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:t}}async function Cn(t){let n=t.placementId||t.adId||"",a=ko(t,n),f=qo(a);if(f)return E.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:a,placementId:n}),J(xt.SUCCESS,"\u6210\u529F",f);let l=bn.get(a);if(l)return E.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:a,placementId:n}),l;let d=(async()=>{try{E.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",t);let g=await Cr(et({placementId:n},Number.isInteger(t.userId)&&Number(t.userId)>0?{userId:t.userId}:{})),P=jo(g);if(E.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:a,placementId:n,response:g,body:P}),Vo(g)||!P)return E.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",g),J(xt.UNKNOWN_ERROR,(g==null?void 0:g.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");let T=an(P,t.type);return T.adId=n,T.cache=zt(et({},T.cache),{enable:!0,ttl:Fr}),Bo(a,T),E.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:a,placementId:n,provider:T.provider,priority:T.priority,hasUnitId:!!T.unitId,hasCustomAd:!!T.customAd}),J(xt.SUCCESS,"\u6210\u529F",T)}catch(g){return E.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:a,placementId:n,error:g}),J(xt.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{bn.delete(a)}})();return bn.set(a,d),d}function ti(t={}){E.info("\u670D\u52A1\u521D\u59CB\u5316",t);let n=et(et({},Ne),t);n.env&&!ze[n.env]&&(E.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${n.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),n.env=Qt.PROD),n.externalEnv&&!Fe[n.externalEnv]&&(E.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${n.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),n.externalEnv=de.PROD),n.debug!==void 0&&E.setEnable(n.debug),Hn(n),E.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",n)}function Ur(t={}){let n="",a=null;async function f(){if(typeof t.getAuthToken=="function"){let d=await t.getAuthToken();if(d)return d}return a&&typeof a.getStorage=="function"&&a.getStorage("auth_token")||""}let l={name:"services",setToken(d){return n=d||"",a&&typeof a.setStorage=="function"&&a.setStorage("auth_token",n),l},async getAuthToken(){return n||f()},clearToken(){return n="",a&&typeof a.setStorage=="function"&&a.setStorage("auth_token",""),l},install(d){a=d;let g=zt(et({},t),{getAuthToken:()=>l.getAuthToken()});ti(g),E.info("services installed via nova.use()"),Object.assign(d,{jd:et({},Pn),dy:et({},Nn),ads:et({},Fn),setToken:l.setToken,clearToken:l.clearToken})}};return l}0&&(module.exports={DyErrorCode,DyErrorMessage,ENV_TYPE,EXTERNAL_ENV_TYPE,JdErrorCode,JdErrorMessage,createServices,getDisplayAdConfig,getDyPayRtaData,handleDyAuthDebitSignFlow,handleDyAuthDebitSignFlowWithRawPayInfo,handleDyJsapiPayFlow,handleDyPayCommandFlow,handleDyPayFlow,handleJdInsurance,handleJdInsuranceExt,handleJdjrCashLoanExt,handleJdjrCashLoanFlow,normalizeDisplayAdData});
1
+ "use strict";var We=Object.defineProperty,$r=Object.defineProperties,zr=Object.getOwnPropertyDescriptor,Zr=Object.getOwnPropertyDescriptors,to=Object.getOwnPropertyNames,kn=Object.getOwnPropertySymbols;var qn=Object.prototype.hasOwnProperty,eo=Object.prototype.propertyIsEnumerable;var dn=(t,n,a)=>n in t?We(t,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[n]=a,et=(t,n)=>{for(var a in n||(n={}))qn.call(n,a)&&dn(t,a,n[a]);if(kn)for(var a of kn(n))eo.call(n,a)&&dn(t,a,n[a]);return t},zt=(t,n)=>$r(t,Zr(n));var no=(t,n)=>()=>(n||t((n={exports:{}}).exports,n),n.exports),Qe=(t,n)=>{for(var a in n)We(t,a,{get:n[a],enumerable:!0})},ro=(t,n,a,f)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of to(n))!qn.call(t,l)&&l!==a&&We(t,l,{get:()=>n[l],enumerable:!(f=zr(n,l))||f.enumerable});return t};var oo=t=>ro(We({},"__esModule",{value:!0}),t);var $e=(t,n,a)=>dn(t,typeof n!="symbol"?n+"":n,a);var rr=no((Ci,nr)=>{"use strict";(()=>{var t={737:(l,d,g)=>{"use strict";g.r(d),g.d(d,{default:()=>F,getJrCommand:()=>N});var P=g(307),T=g.n(P);function x(){x=function(){return X};var D,X={},Pt=Object.prototype,dt=Pt.hasOwnProperty,vt=Object.defineProperty||function(p,_,A){p[_]=A.value},_t=typeof Symbol=="function"?Symbol:{},At=_t.iterator||"@@iterator",St=_t.asyncIterator||"@@asyncIterator",Et=_t.toStringTag||"@@toStringTag";function ht(p,_,A){return Object.defineProperty(p,_,{value:A,enumerable:!0,configurable:!0,writable:!0}),p[_]}try{ht({},"")}catch(p){ht=function(_,A,J){return _[A]=J}}function Gt(p,_,A,J){var v=_&&_.prototype instanceof ce?_:ce,q=Object.create(v.prototype),at=new ye(J||[]);return vt(q,"_invoke",{value:Ft(p,A,at)}),q}function Kt(p,_,A){try{return{type:"normal",arg:p.call(_,A)}}catch(J){return{type:"throw",arg:J}}}X.wrap=Gt;var jt="suspendedStart",Zt="suspendedYield",Xt="executing",w="completed",bt={};function ce(){}function se(){}function qt(){}var le={};ht(le,At,(function(){return this}));var ue=Object.getPrototypeOf,Ut=ue&&ue(ue(oe([])));Ut&&Ut!==Pt&&dt.call(Ut,At)&&(le=Ut);var Ht=qt.prototype=ce.prototype=Object.create(le);function Ae(p){["next","throw","return"].forEach((function(_){ht(p,_,(function(A){return this._invoke(_,A)}))}))}function te(p,_){function A(v,q,at,It){var gt=Kt(p[v],p,q);if(gt.type!=="throw"){var Wt=gt.arg,ee=Wt.value;return ee&&tt(ee)=="object"&&dt.call(ee,"__await")?_.resolve(ee.__await).then((function(Rt){A("next",Rt,at,It)}),(function(Rt){A("throw",Rt,at,It)})):_.resolve(ee).then((function(Rt){Wt.value=Rt,at(Wt)}),(function(Rt){return A("throw",Rt,at,It)}))}It(gt.arg)}var J;vt(this,"_invoke",{value:function(v,q){function at(){return new _((function(It,gt){A(v,q,It,gt)}))}return J=J?J.then(at,at):at()}})}function Ft(p,_,A){var J=jt;return function(v,q){if(J===Xt)throw Error("Generator is already running");if(J===w){if(v==="throw")throw q;return{value:D,done:!0}}for(A.method=v,A.arg=q;;){var at=A.delegate;if(at){var It=Mt(at,A);if(It){if(It===bt)continue;return It}}if(A.method==="next")A.sent=A._sent=A.arg;else if(A.method==="throw"){if(J===jt)throw J=w,A.arg;A.dispatchException(A.arg)}else A.method==="return"&&A.abrupt("return",A.arg);J=Xt;var gt=Kt(p,_,A);if(gt.type==="normal"){if(J=A.done?w:Zt,gt.arg===bt)continue;return{value:gt.arg,done:A.done}}gt.type==="throw"&&(J=w,A.method="throw",A.arg=gt.arg)}}}function Mt(p,_){var A=_.method,J=p.iterator[A];if(J===D)return _.delegate=null,A==="throw"&&p.iterator.return&&(_.method="return",_.arg=D,Mt(p,_),_.method==="throw")||A!=="return"&&(_.method="throw",_.arg=new TypeError("The iterator does not provide a '"+A+"' method")),bt;var v=Kt(J,p.iterator,_.arg);if(v.type==="throw")return _.method="throw",_.arg=v.arg,_.delegate=null,bt;var q=v.arg;return q?q.done?(_[p.resultName]=q.value,_.next=p.nextLoc,_.method!=="return"&&(_.method="next",_.arg=D),_.delegate=null,bt):q:(_.method="throw",_.arg=new TypeError("iterator result is not an object"),_.delegate=null,bt)}function re(p){var _={tryLoc:p[0]};1 in p&&(_.catchLoc=p[1]),2 in p&&(_.finallyLoc=p[2],_.afterLoc=p[3]),this.tryEntries.push(_)}function _e(p){var _=p.completion||{};_.type="normal",delete _.arg,p.completion=_}function ye(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(re,this),this.reset(!0)}function oe(p){if(p||p===""){var _=p[At];if(_)return _.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var A=-1,J=function v(){for(;++A<p.length;)if(dt.call(p,A))return v.value=p[A],v.done=!1,v;return v.value=D,v.done=!0,v};return J.next=J}}throw new TypeError(tt(p)+" is not iterable")}return se.prototype=qt,vt(Ht,"constructor",{value:qt,configurable:!0}),vt(qt,"constructor",{value:se,configurable:!0}),se.displayName=ht(qt,Et,"GeneratorFunction"),X.isGeneratorFunction=function(p){var _=typeof p=="function"&&p.constructor;return!!_&&(_===se||(_.displayName||_.name)==="GeneratorFunction")},X.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,qt):(p.__proto__=qt,ht(p,Et,"GeneratorFunction")),p.prototype=Object.create(Ht),p},X.awrap=function(p){return{__await:p}},Ae(te.prototype),ht(te.prototype,St,(function(){return this})),X.AsyncIterator=te,X.async=function(p,_,A,J,v){v===void 0&&(v=Promise);var q=new te(Gt(p,_,A,J),v);return X.isGeneratorFunction(_)?q:q.next().then((function(at){return at.done?at.value:q.next()}))},Ae(Ht),ht(Ht,Et,"Generator"),ht(Ht,At,(function(){return this})),ht(Ht,"toString",(function(){return"[object Generator]"})),X.keys=function(p){var _=Object(p),A=[];for(var J in _)A.push(J);return A.reverse(),function v(){for(;A.length;){var q=A.pop();if(q in _)return v.value=q,v.done=!1,v}return v.done=!0,v}},X.values=oe,ye.prototype={constructor:ye,reset:function(p){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(_e),!p)for(var _ in this)_.charAt(0)==="t"&&dt.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=D)},stop:function(){this.done=!0;var p=this.tryEntries[0].completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var _=this;function A(gt,Wt){return q.type="throw",q.arg=p,_.next=gt,Wt&&(_.method="next",_.arg=D),!!Wt}for(var J=this.tryEntries.length-1;J>=0;--J){var v=this.tryEntries[J],q=v.completion;if(v.tryLoc==="root")return A("end");if(v.tryLoc<=this.prev){var at=dt.call(v,"catchLoc"),It=dt.call(v,"finallyLoc");if(at&&It){if(this.prev<v.catchLoc)return A(v.catchLoc,!0);if(this.prev<v.finallyLoc)return A(v.finallyLoc)}else if(at){if(this.prev<v.catchLoc)return A(v.catchLoc,!0)}else{if(!It)throw Error("try statement without catch or finally");if(this.prev<v.finallyLoc)return A(v.finallyLoc)}}}},abrupt:function(p,_){for(var A=this.tryEntries.length-1;A>=0;--A){var J=this.tryEntries[A];if(J.tryLoc<=this.prev&&dt.call(J,"finallyLoc")&&this.prev<J.finallyLoc){var v=J;break}}v&&(p==="break"||p==="continue")&&v.tryLoc<=_&&_<=v.finallyLoc&&(v=null);var q=v?v.completion:{};return q.type=p,q.arg=_,v?(this.method="next",this.next=v.finallyLoc,bt):this.complete(q)},complete:function(p,_){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&_&&(this.next=_),bt},finish:function(p){for(var _=this.tryEntries.length-1;_>=0;--_){var A=this.tryEntries[_];if(A.finallyLoc===p)return this.complete(A.completion,A.afterLoc),_e(A),bt}},catch:function(p){for(var _=this.tryEntries.length-1;_>=0;--_){var A=this.tryEntries[_];if(A.tryLoc===p){var J=A.completion;if(J.type==="throw"){var v=J.arg;_e(A)}return v}}throw Error("illegal catch attempt")},delegateYield:function(p,_,A){return this.delegate={iterator:oe(p),resultName:_,nextLoc:A},this.method==="next"&&(this.arg=D),bt}},X}function ut(D,X,Pt,dt,vt,_t,At){try{var St=D[_t](At),Et=St.value}catch(ht){return void Pt(ht)}St.done?X(Et):Promise.resolve(Et).then(dt,vt)}function tt(D){return tt=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},tt(D)}var G="https://ms.jr.jd.com";function Ot(D){var X=D.host,Pt=D.type,dt=Pt===void 0?"post":Pt,vt=D.data,_t=D.path,At=_t===void 0?"":_t,St=D.config,Et=St===void 0?{}:St,ht=(Et.withCredentials,Et.isWG),Gt=ht===void 0||ht,Kt=Et.contentType,jt=Kt===void 0?"application/x-www-form-urlencoded":Kt;return new Promise((function(Zt,Xt){wx.request({url:(X||G)+At,method:dt.toUpperCase(),data:Gt?S({reqData:JSON.stringify(vt)}):vt,header:{"content-type":jt},success:function(w){w.statusCode===200?Zt(w.data):Xt({statusCode:w.statusCode,errMsg:w.errMsg,data:w.data})},fail:function(w){Xt(w)}})}))}function S(D){var X="";return tt(D)==="object"&&D!==null&&(Object.keys(D).map((function(Pt){var dt=D[Pt];return X+=Pt+"="+encodeURIComponent(dt)+"&",""})),X.length>0&&(X=X.substr(0,X.length-1))),X}function nt(D){return mt.apply(this,arguments)}function mt(){var D;return D=x().mark((function X(Pt){var dt,vt,_t,At,St,Et,ht,Gt,Kt,jt;return x().wrap((function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return dt=Pt.url,vt=Pt.channel,_t=Pt.callback,T().init(),At=new(T()),St=At.nonce(),Et=At.sign(JSON.stringify({t:"".concat(new Date().getTime())}),St),ht="/gw/generic/app/h5/m/execute1/ug-service-orchestrator".concat(""),Gt="",Kt={serviceId:"719986339759652864",params:{activityCode:"GetGoldKeyText",busiUrl:dt,channel:vt,clientCode:"0",antiRushInfo:Et}},Zt.next=12,Ot({host:"https://ms.jr.jd.com",type:"post",path:ht,config:{withCredentials:!0},data:Kt});case 12:(jt=Zt.sent).resultCode===0&&jt.resultData&&jt.resultData.code==="00000"&&jt.resultData.data&&(Gt=jt.resultData.data.goldenKeyText),_t&&_t(Gt?{code:"0",msg:"command success",data:Gt}:{code:"-1",msg:"command empty"});case 15:case"end":return Zt.stop()}}),X)})),mt=function(){var X=this,Pt=arguments;return new Promise((function(dt,vt){var _t=D.apply(X,Pt);function At(Et){ut(_t,dt,vt,At,St,"next",Et)}function St(Et){ut(_t,dt,vt,At,St,"throw",Et)}At(void 0)}))},mt.apply(this,arguments)}function st(D){return st=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},st(D)}function H(){H=function(){return X};var D,X={},Pt=Object.prototype,dt=Pt.hasOwnProperty,vt=Object.defineProperty||function(p,_,A){p[_]=A.value},_t=typeof Symbol=="function"?Symbol:{},At=_t.iterator||"@@iterator",St=_t.asyncIterator||"@@asyncIterator",Et=_t.toStringTag||"@@toStringTag";function ht(p,_,A){return Object.defineProperty(p,_,{value:A,enumerable:!0,configurable:!0,writable:!0}),p[_]}try{ht({},"")}catch(p){ht=function(_,A,J){return _[A]=J}}function Gt(p,_,A,J){var v=_&&_.prototype instanceof ce?_:ce,q=Object.create(v.prototype),at=new ye(J||[]);return vt(q,"_invoke",{value:Ft(p,A,at)}),q}function Kt(p,_,A){try{return{type:"normal",arg:p.call(_,A)}}catch(J){return{type:"throw",arg:J}}}X.wrap=Gt;var jt="suspendedStart",Zt="suspendedYield",Xt="executing",w="completed",bt={};function ce(){}function se(){}function qt(){}var le={};ht(le,At,(function(){return this}));var ue=Object.getPrototypeOf,Ut=ue&&ue(ue(oe([])));Ut&&Ut!==Pt&&dt.call(Ut,At)&&(le=Ut);var Ht=qt.prototype=ce.prototype=Object.create(le);function Ae(p){["next","throw","return"].forEach((function(_){ht(p,_,(function(A){return this._invoke(_,A)}))}))}function te(p,_){function A(v,q,at,It){var gt=Kt(p[v],p,q);if(gt.type!=="throw"){var Wt=gt.arg,ee=Wt.value;return ee&&st(ee)=="object"&&dt.call(ee,"__await")?_.resolve(ee.__await).then((function(Rt){A("next",Rt,at,It)}),(function(Rt){A("throw",Rt,at,It)})):_.resolve(ee).then((function(Rt){Wt.value=Rt,at(Wt)}),(function(Rt){return A("throw",Rt,at,It)}))}It(gt.arg)}var J;vt(this,"_invoke",{value:function(v,q){function at(){return new _((function(It,gt){A(v,q,It,gt)}))}return J=J?J.then(at,at):at()}})}function Ft(p,_,A){var J=jt;return function(v,q){if(J===Xt)throw Error("Generator is already running");if(J===w){if(v==="throw")throw q;return{value:D,done:!0}}for(A.method=v,A.arg=q;;){var at=A.delegate;if(at){var It=Mt(at,A);if(It){if(It===bt)continue;return It}}if(A.method==="next")A.sent=A._sent=A.arg;else if(A.method==="throw"){if(J===jt)throw J=w,A.arg;A.dispatchException(A.arg)}else A.method==="return"&&A.abrupt("return",A.arg);J=Xt;var gt=Kt(p,_,A);if(gt.type==="normal"){if(J=A.done?w:Zt,gt.arg===bt)continue;return{value:gt.arg,done:A.done}}gt.type==="throw"&&(J=w,A.method="throw",A.arg=gt.arg)}}}function Mt(p,_){var A=_.method,J=p.iterator[A];if(J===D)return _.delegate=null,A==="throw"&&p.iterator.return&&(_.method="return",_.arg=D,Mt(p,_),_.method==="throw")||A!=="return"&&(_.method="throw",_.arg=new TypeError("The iterator does not provide a '"+A+"' method")),bt;var v=Kt(J,p.iterator,_.arg);if(v.type==="throw")return _.method="throw",_.arg=v.arg,_.delegate=null,bt;var q=v.arg;return q?q.done?(_[p.resultName]=q.value,_.next=p.nextLoc,_.method!=="return"&&(_.method="next",_.arg=D),_.delegate=null,bt):q:(_.method="throw",_.arg=new TypeError("iterator result is not an object"),_.delegate=null,bt)}function re(p){var _={tryLoc:p[0]};1 in p&&(_.catchLoc=p[1]),2 in p&&(_.finallyLoc=p[2],_.afterLoc=p[3]),this.tryEntries.push(_)}function _e(p){var _=p.completion||{};_.type="normal",delete _.arg,p.completion=_}function ye(p){this.tryEntries=[{tryLoc:"root"}],p.forEach(re,this),this.reset(!0)}function oe(p){if(p||p===""){var _=p[At];if(_)return _.call(p);if(typeof p.next=="function")return p;if(!isNaN(p.length)){var A=-1,J=function v(){for(;++A<p.length;)if(dt.call(p,A))return v.value=p[A],v.done=!1,v;return v.value=D,v.done=!0,v};return J.next=J}}throw new TypeError(st(p)+" is not iterable")}return se.prototype=qt,vt(Ht,"constructor",{value:qt,configurable:!0}),vt(qt,"constructor",{value:se,configurable:!0}),se.displayName=ht(qt,Et,"GeneratorFunction"),X.isGeneratorFunction=function(p){var _=typeof p=="function"&&p.constructor;return!!_&&(_===se||(_.displayName||_.name)==="GeneratorFunction")},X.mark=function(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,qt):(p.__proto__=qt,ht(p,Et,"GeneratorFunction")),p.prototype=Object.create(Ht),p},X.awrap=function(p){return{__await:p}},Ae(te.prototype),ht(te.prototype,St,(function(){return this})),X.AsyncIterator=te,X.async=function(p,_,A,J,v){v===void 0&&(v=Promise);var q=new te(Gt(p,_,A,J),v);return X.isGeneratorFunction(_)?q:q.next().then((function(at){return at.done?at.value:q.next()}))},Ae(Ht),ht(Ht,Et,"Generator"),ht(Ht,At,(function(){return this})),ht(Ht,"toString",(function(){return"[object Generator]"})),X.keys=function(p){var _=Object(p),A=[];for(var J in _)A.push(J);return A.reverse(),function v(){for(;A.length;){var q=A.pop();if(q in _)return v.value=q,v.done=!1,v}return v.done=!0,v}},X.values=oe,ye.prototype={constructor:ye,reset:function(p){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(_e),!p)for(var _ in this)_.charAt(0)==="t"&&dt.call(this,_)&&!isNaN(+_.slice(1))&&(this[_]=D)},stop:function(){this.done=!0;var p=this.tryEntries[0].completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var _=this;function A(gt,Wt){return q.type="throw",q.arg=p,_.next=gt,Wt&&(_.method="next",_.arg=D),!!Wt}for(var J=this.tryEntries.length-1;J>=0;--J){var v=this.tryEntries[J],q=v.completion;if(v.tryLoc==="root")return A("end");if(v.tryLoc<=this.prev){var at=dt.call(v,"catchLoc"),It=dt.call(v,"finallyLoc");if(at&&It){if(this.prev<v.catchLoc)return A(v.catchLoc,!0);if(this.prev<v.finallyLoc)return A(v.finallyLoc)}else if(at){if(this.prev<v.catchLoc)return A(v.catchLoc,!0)}else{if(!It)throw Error("try statement without catch or finally");if(this.prev<v.finallyLoc)return A(v.finallyLoc)}}}},abrupt:function(p,_){for(var A=this.tryEntries.length-1;A>=0;--A){var J=this.tryEntries[A];if(J.tryLoc<=this.prev&&dt.call(J,"finallyLoc")&&this.prev<J.finallyLoc){var v=J;break}}v&&(p==="break"||p==="continue")&&v.tryLoc<=_&&_<=v.finallyLoc&&(v=null);var q=v?v.completion:{};return q.type=p,q.arg=_,v?(this.method="next",this.next=v.finallyLoc,bt):this.complete(q)},complete:function(p,_){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&_&&(this.next=_),bt},finish:function(p){for(var _=this.tryEntries.length-1;_>=0;--_){var A=this.tryEntries[_];if(A.finallyLoc===p)return this.complete(A.completion,A.afterLoc),_e(A),bt}},catch:function(p){for(var _=this.tryEntries.length-1;_>=0;--_){var A=this.tryEntries[_];if(A.tryLoc===p){var J=A.completion;if(J.type==="throw"){var v=J.arg;_e(A)}return v}}throw Error("illegal catch attempt")},delegateYield:function(p,_,A){return this.delegate={iterator:oe(p),resultName:_,nextLoc:A},this.method==="next"&&(this.arg=D),bt}},X}function wt(D,X,Pt,dt,vt,_t,At){try{var St=D[_t](At),Et=St.value}catch(ht){return void Pt(ht)}St.done?X(Et):Promise.resolve(Et).then(dt,vt)}function N(D){return C.apply(this,arguments)}function C(){var D;return D=H().mark((function X(Pt){var dt,vt,_t;return H().wrap((function(At){for(;;)switch(At.prev=At.next){case 0:return dt=Pt.url,vt=Pt.channel,_t=Pt.callback,At.next=3,nt({url:dt,channel:vt,callback:_t});case 3:case"end":return At.stop()}}),X)})),C=function(){var X=this,Pt=arguments;return new Promise((function(dt,vt){var _t=D.apply(X,Pt);function At(Et){wt(_t,dt,vt,At,St,"next",Et)}function St(Et){wt(_t,dt,vt,At,St,"throw",Et)}At(void 0)}))},C.apply(this,arguments)}var L={getJrCommand:N};(l=g.hmd(l)).exports&&(l.exports=L,l.exports.getJrCommand=N),typeof window!="undefined"&&(window.LyyGetCommandSDK=L);let F=L},307:function(l,d,g){var P,T,x;function ut(tt){return ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(G){return typeof G}:function(G){return G&&typeof Symbol=="function"&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":typeof G},ut(tt)}x=function(){"use strict";function tt(e){return(tt=typeof Symbol=="function"&&ut(Symbol.iterator)=="symbol"?function(o){return ut(o)}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":ut(o)})(e)}function G(e,o){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}function Ot(e,o){for(var u=0;u<o.length;u++){var c=o[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(e,c.key,c)}}function S(e,o,u){return o&&Ot(e.prototype,o),u&&Ot(e,u),e}function nt(e,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(o&&o.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),o&&st(e,o)}function mt(e){return(mt=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(e)}function st(e,o){return(st=Object.setPrototypeOf||function(u,c){return u.__proto__=c,u})(e,o)}function H(e){var o=(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=mt(e);return(function(h,m){if(m&&(ut(m)=="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(R){if(R===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R})(h)})(this,o?(u=mt(this).constructor,Reflect.construct(c,arguments,u)):c.apply(this,arguments))}}function wt(e){return(function(o){if(Array.isArray(o))return N(o)})(e)||(function(o){if(typeof Symbol!="undefined"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)})(e)||(function(o,u){if(o){if(typeof o=="string")return N(o,u);var c=Object.prototype.toString.call(o).slice(8,-1);return(c=c==="Object"&&o.constructor?o.constructor.name:c)==="Map"||c==="Set"?Array.from(o):c==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?N(o,u):void 0}})(e)||(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 N(e,o){(o==null||o>e.length)&&(o=e.length);for(var u=0,c=new Array(o);u<o;u++)c[u]=e[u];return c}var C=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:g.g!==void 0?g.g:typeof self!="undefined"?self:{},L=!1,F=!1,D={console:!0,focus:!1,time:!1,length:!0,infinite:!1,time_interval:500,time_threshold:100,length_threshold:300},X=function(){typeof document!="undefined"&&document.hasFocus&&!document.hasFocus()&&(F=!0)},Pt=function(){var e=Date.now();Date.now()-e>D.time_threshold&&(F=!0)},dt=function(){var e=C.outerWidth,o=C.outerHeight,u=C.innerWidth,c=C.innerHeight;e&&o&&u&&c&&typeof e=="number"&&typeof o=="number"&&typeof u=="number"&&typeof c=="number"&&(e-u>D.length_threshold||o-c>D.length_threshold)&&(F=!0)};(Ft={}).start=function(e){if(!L){if(e&&tt(e)==="object")for(var o in e)D[o]=e[o];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);')():F=!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 F=!0,Date.now()}})(),D.focus&&X(),D.time&&Pt(),D.length&&dt(),u=setInterval((function(){u&&F&&clearInterval(u),D.focus&&X(),D.time&&Pt(),D.length&&dt()}),D.time_interval),L=!0}},Ft.isDebug=function(){return F};var vt=Ft,_t=".123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+-!",At={my_b4_encode:function(e){var o=0,u=(j=0)<e.length%3?3-e.length%3:0;for(o=0;o<u;o++)e[e.length]=0;var c="";for(j=0;j<e.length;j+=3)0<j&&j%57==0&&(c+=`
3
+ `),c+=_t[e[j]>>2]+_t[(3&e[j])<<4|e[j+1]>>4]+_t[(15&e[j+1])<<2|e[j+2]>>6]+_t[63&e[j+2]];for(o=0;o<u;o++)c+=_t[64];return c},my_b4_decode:function(e){var o=0,u=0,c=(e=e.replace(/[^A-Za-z0-9\+\-\!\.]/g,"")).length%4;if(2<c)return null;for(o=0;o<c;o++)if(e.charAt(e.length-o-1)!=_t[64])return null;var h,m,R,Y,O=new Array(3*(e.length-c)/4);for(o=0,u=0;u<O.length;)h=_t.indexOf(e.charAt(o++)),m=_t.indexOf(e.charAt(o++)),R=_t.indexOf(e.charAt(o++)),Y=_t.indexOf(e.charAt(o++)),O[u++]=h<<2|m>>4,O[u++]=(15&m)<<4|R>>2,O[u++]=(3&R)<<6|Y;for(o=0;o<c;o++)if(O.pop()!=0)return null;return O}},St="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Et={b4_encode:function(e){var o=0,u=(j=0)<e.length%3?3-e.length%3:0;for(o=0;o<u;o++)e[e.length]=0;var c="";for(o=0;j<e.length;j+=3)0<j&&j%57==0&&(c+=`
4
+ `),c+=St[e[j]>>2]+St[(3&e[j])<<4|e[j+1]>>4]+St[(15&e[j+1])<<2|e[j+2]>>6]+St[63&e[j+2]];for(o=0;o<u;o++)c+="=";return c},b4_decode:function(e){var o=0,u=0,c=(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length%4;if(2<c)return null;for(o=0;o<c;o++)if(e.charAt(e.length-o-1)!="=")return null;var h,m,R,Y,O=new Array(3*(e.length-c)/4);for(o=0,u=0;u<O.length;)h=St.indexOf(e.charAt(o++)),m=St.indexOf(e.charAt(o++)),R=St.indexOf(e.charAt(o++)),Y=St.indexOf(e.charAt(o++)),O[u++]=h<<2|m>>4,O[u++]=(15&m)<<4|R>>2,O[u++]=(3&R)<<6|Y;for(o=0;o<c;o++)if(O.pop()!=0)return null;return O}};function ht(){}ht.encode=function(e,o,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"),m=o,R=0;m<u+o;m++,R++)c[R]=h[(255&e[m])>>4],c[++R]=h[15&e[m]];return c.join("")},ht.decode=function(e){if(e==null||e==""||e.length%2!=0)return null;for(var o=e.length/2,u=ht.toCharCodeArray(e),c=new Array(o),h=0;h<o;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(e){for(var o=new Array(e.length),u=0;u<e.length;u++)o[u]=e.charCodeAt(u);return o};var Gt=ht,Kt=Gt;(Mt=function(){}).utf8StrToh6=function(e){e=encodeURIComponent(e);for(var o=unescape(e),u=o.length,c=[],h=0;h<u;h++)c[h]=o.charCodeAt(h).toString(16);return c.join("")},Mt.utf8StrToBytes=function(e){e=encodeURIComponent(e);for(var o=unescape(e),u=o.length,c=[],h=0;h<u;h++)c[h]=o.charCodeAt(h);return c},Mt.hexToUtf8Str=function(e){for(var o=Kt.decode(e),u=[],c=0;c<o.length;c++)u.push(String.fromCharCode(o[c]));return decodeURIComponent(escape(u.join("")))},Mt.bytesToUtf8Str=function(e){for(var o=e,u=[],c=0;c<o.length;c++)u.push(String.fromCharCode(o[c]));return decodeURIComponent(escape(u.join("")))},Mt.intToByte=function(e){return new Array(e>>24&255,e>>16&255,e>>8&255,255&e)},Mt.byteToInt=function(e,o){return o+3<e.length?e[o]<<24|e[o+1]<<16|e[o+2]<<8|e[o+3]:o+2<e.length?e[o+1]<<16|e[o+2]<<8|e[o+3]:o+1<e.length?e[o]<<8|e[o+1]:e[o]};var jt,Zt=Mt,Xt={exports:{}};jt=Xt,function(){function e(r,i,s){r!=null&&(typeof r=="number"?this.fromNumber(r,i,s):i==null&&typeof r!="string"?this.fromString(r,256):this.fromString(r,i))}function o(){return new e(null)}var u=(u=typeof navigator!="undefined")&&navigator.appName=="Microsoft Internet Explorer"?(e.prototype.am=function(r,i,s,y,I,M){for(var V=32767&i,k=i>>15;0<=--M;){var xt=32767&this[r],$t=this[r++]>>15,fe=k*xt+$t*V;I=((xt=V*xt+((32767&fe)<<15)+s[y]+(1073741823&I))>>>30)+(fe>>>15)+k*$t+(I>>>30),s[y++]=1073741823&xt}return I},30):u&&navigator.appName!="Netscape"?(e.prototype.am=function(r,i,s,y,I,M){for(;0<=--M;){var V=i*this[r++]+s[y]+I;I=Math.floor(V/67108864),s[y++]=67108863&V}return I},26):(e.prototype.am=function(r,i,s,y,I,M){for(var V=16383&i,k=i>>14;0<=--M;){var xt=16383&this[r],$t=this[r++]>>14,fe=k*xt+$t*V;I=((xt=V*xt+((16383&fe)<<14)+s[y]+I)>>28)+(fe>>14)+k*$t,s[y++]=268435455&xt}return I},28);e.prototype.DB=u,e.prototype.DM=(1<<u)-1,e.prototype.DV=1<<u,e.prototype.FV=Math.pow(2,52),e.prototype.F1=52-u,e.prototype.F2=2*u-52;for(var c=new Array,h=48,m=0;m<=9;++m)c[h++]=m;for(h=97,m=10;m<36;++m)c[h++]=m;for(h=65,m=10;m<36;++m)c[h++]=m;function R(r){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(r)}function Y(r,i){return(r=c[r.charCodeAt(i)])==null?-1:r}function O(r){var i=o();return i.fromInt(r),i}function ct(r){var i,s=1;return(i=r>>>16)!=0&&(r=i,s+=16),(i=r>>8)!=0&&(r=i,s+=8),(i=r>>4)!=0&&(r=i,s+=4),(i=r>>2)!=0&&(r=i,s+=2),(i=r>>1)!=0&&(r=i,s+=1),s}function lt(r){this.m=r}function b(r){this.m=r,this.mp=r.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<r.DB-15)-1,this.mt2=2*r.t}function W(r,i){return r&i}function rt(r,i){return r|i}function Z(r,i){return r^i}function ft(r,i){return r&~i}function pt(){}function Ct(r){return r}function B(r){this.r2=o(),this.q3=o(),e.ONE.dlShiftTo(2*r.t,this.r2),this.mu=this.r2.divide(r),this.m=r}lt.prototype.convert=function(r){return r.s<0||0<=r.compareTo(this.m)?r.mod(this.m):r},lt.prototype.revert=function(r){return r},lt.prototype.reduce=function(r){r.divRemTo(this.m,null,r)},lt.prototype.mulTo=function(r,i,s){r.multiplyTo(i,s),this.reduce(s)},lt.prototype.sqrTo=function(r,i){r.squareTo(i),this.reduce(i)},b.prototype.convert=function(r){var i=o();return r.abs().dlShiftTo(this.m.t,i),i.divRemTo(this.m,null,i),r.s<0&&0<i.compareTo(e.ZERO)&&this.m.subTo(i,i),i},b.prototype.revert=function(r){var i=o();return r.copyTo(i),this.reduce(i),i},b.prototype.reduce=function(r){for(;r.t<=this.mt2;)r[r.t++]=0;for(var i=0;i<this.m.t;++i){var s=32767&r[i],y=s*this.mpl+((s*this.mph+(r[i]>>15)*this.mpl&this.um)<<15)&r.DM;for(r[s=i+this.m.t]+=this.m.am(0,y,r,i,0,this.m.t);r[s]>=r.DV;)r[s]-=r.DV,r[++s]++}r.clamp(),r.drShiftTo(this.m.t,r),0<=r.compareTo(this.m)&&r.subTo(this.m,r)},b.prototype.mulTo=function(r,i,s){r.multiplyTo(i,s),this.reduce(s)},b.prototype.sqrTo=function(r,i){r.squareTo(i),this.reduce(i)},e.prototype.copyTo=function(r){for(var i=this.t-1;0<=i;--i)r[i]=this[i];r.t=this.t,r.s=this.s},e.prototype.fromInt=function(r){this.t=1,this.s=r<0?-1:0,0<r?this[0]=r:r<-1?this[0]=r+this.DV:this.t=0},e.prototype.fromString=function(r,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(r,i);s=2}this.t=0,this.s=0;for(var y=r.length,I=!1,M=0;0<=--y;){var V=s==8?255&r[y]:Y(r,y);V<0?r.charAt(y)=="-"&&(I=!0):(I=!1,M==0?this[this.t++]=V:M+s>this.DB?(this[this.t-1]|=(V&(1<<this.DB-M)-1)<<M,this[this.t++]=V>>this.DB-M):this[this.t-1]|=V<<M,(M+=s)>=this.DB&&(M-=this.DB))}s==8&&128&r[0]&&(this.s=-1,0<M&&(this[this.t-1]|=(1<<this.DB-M)-1<<M)),this.clamp(),I&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var r=this.s&this.DM;0<this.t&&this[this.t-1]==r;)--this.t},e.prototype.dlShiftTo=function(r,i){for(var s=this.t-1;0<=s;--s)i[s+r]=this[s];for(s=r-1;0<=s;--s)i[s]=0;i.t=this.t+r,i.s=this.s},e.prototype.drShiftTo=function(r,i){for(var s=r;s<this.t;++s)i[s-r]=this[s];i.t=Math.max(this.t-r,0),i.s=this.s},e.prototype.lShiftTo=function(r,i){for(var s=r%this.DB,y=this.DB-s,I=(1<<y)-1,M=Math.floor(r/this.DB),V=this.s<<s&this.DM,k=this.t-1;0<=k;--k)i[k+M+1]=this[k]>>y|V,V=(this[k]&I)<<s;for(k=M-1;0<=k;--k)i[k]=0;i[M]=V,i.t=this.t+M+1,i.s=this.s,i.clamp()},e.prototype.rShiftTo=function(r,i){i.s=this.s;var s=Math.floor(r/this.DB);if(s>=this.t)i.t=0;else{var y=r%this.DB,I=this.DB-y,M=(1<<y)-1;i[0]=this[s]>>y;for(var V=s+1;V<this.t;++V)i[V-s-1]|=(this[V]&M)<<I,i[V-s]=this[V]>>y;0<y&&(i[this.t-s-1]|=(this.s&M)<<I),i.t=this.t-s,i.clamp()}},e.prototype.subTo=function(r,i){for(var s=0,y=0,I=Math.min(r.t,this.t);s<I;)y+=this[s]-r[s],i[s++]=y&this.DM,y>>=this.DB;if(r.t<this.t){for(y-=r.s;s<this.t;)y+=this[s],i[s++]=y&this.DM,y>>=this.DB;y+=this.s}else{for(y+=this.s;s<r.t;)y-=r[s],i[s++]=y&this.DM,y>>=this.DB;y-=r.s}i.s=y<0?-1:0,y<-1?i[s++]=this.DV+y:0<y&&(i[s++]=y),i.t=s,i.clamp()},e.prototype.multiplyTo=function(r,i){var s=this.abs(),y=r.abs(),I=s.t;for(i.t=I+y.t;0<=--I;)i[I]=0;for(I=0;I<y.t;++I)i[I+s.t]=s.am(0,y[I],i,I,0,s.t);i.s=0,i.clamp(),this.s!=r.s&&e.ZERO.subTo(i,i)},e.prototype.squareTo=function(r){for(var i=this.abs(),s=r.t=2*i.t;0<=--s;)r[s]=0;for(s=0;s<i.t-1;++s){var y=i.am(s,i[s],r,2*s,0,1);(r[s+i.t]+=i.am(s+1,2*i[s],r,2*s+1,y,i.t-s-1))>=i.DV&&(r[s+i.t]-=i.DV,r[s+i.t+1]=1)}0<r.t&&(r[r.t-1]+=i.am(s,i[s],r,2*s,0,1)),r.s=0,r.clamp()},e.prototype.divRemTo=function(r,i,s){var y=r.abs();if(!(y.t<=0)){if(($t=this.abs()).t<y.t)return i!=null&&i.fromInt(0),void(s!=null&&this.copyTo(s));s==null&&(s=o());var I=o(),M=this.s,V=r.s;0<(r=this.DB-ct(y[y.t-1]))?(y.lShiftTo(r,I),$t.lShiftTo(r,s)):(y.copyTo(I),$t.copyTo(s));var k=I.t,xt=I[k-1];if(xt!=0){var $t=xt*(1<<this.F1)+(1<k?I[k-2]>>this.F2:0),fe=this.FV/$t,pe=(1<<this.F1)/$t,Ne=1<<this.F2,Vt=s.t,Ie=Vt-k,Bt=i==null?o():i;for(I.dlShiftTo(Ie,Bt),0<=s.compareTo(Bt)&&(s[s.t++]=1,s.subTo(Bt,s)),e.ONE.dlShiftTo(k,Bt),Bt.subTo(I,I);I.t<k;)I[I.t++]=0;for(;0<=--Ie;){var fn=s[--Vt]==xt?this.DM:Math.floor(s[Vt]*fe+(s[Vt-1]+Ne)*pe);if((s[Vt]+=I.am(0,fn,s,Ie,0,k))<fn)for(I.dlShiftTo(Ie,Bt),s.subTo(Bt,s);s[Vt]<--fn;)s.subTo(Bt,s)}i!=null&&(s.drShiftTo(k,i),M!=V&&e.ZERO.subTo(i,i)),s.t=k,s.clamp(),0<r&&s.rShiftTo(r,s),M<0&&e.ZERO.subTo(s,s)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var r=this[0];if(!(1&r))return 0;var i=3&r;return 0<(i=(i=(i=(i=i*(2-(15&r)*i)&15)*(2-(255&r)*i)&255)*(2-((65535&r)*i&65535))&65535)*(2-r*i%this.DV)%this.DV)?this.DV-i:-i},e.prototype.isEven=function(){return(0<this.t?1&this[0]:this.s)==0},e.prototype.exp=function(r,i){if(4294967295<r||r<1)return e.ONE;var s,y=o(),I=o(),M=i.convert(this),V=ct(r)-1;for(M.copyTo(y);0<=--V;)i.sqrTo(y,I),0<(r&1<<V)?i.mulTo(I,M,y):(s=y,y=I,I=s);return i.revert(y)},e.prototype.toString=function(r){if(this.s<0)return"-"+this.negate().toString(r);var i;if(r==16)i=4;else if(r==8)i=3;else if(r==2)i=1;else if(r==32)i=5;else{if(r!=4)return this.toRadix(r);i=2}var s,y=(1<<i)-1,I=!1,M="",V=this.t,k=this.DB-V*this.DB%i;if(0<V--)for(k<this.DB&&0<(s=this[V]>>k)&&(I=!0,M=R(s));0<=V;)k<i?(s=(this[V]&(1<<k)-1)<<i-k,s|=this[--V]>>(k+=this.DB-i)):(s=this[V]>>(k-=i)&y,k<=0&&(k+=this.DB,--V)),(I=0<s||I)&&(M+=R(s));return I?M:"0"},e.prototype.negate=function(){var r=o();return e.ZERO.subTo(this,r),r},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(r){var i=this.s-r.s;if(i!=0)return i;var s=this.t;if((i=s-r.t)!=0)return this.s<0?-i:i;for(;0<=--s;)if((i=this[s]-r[s])!=0)return i;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+ct(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(r){var i=o();return this.abs().divRemTo(r,null,i),this.s<0&&0<i.compareTo(e.ZERO)&&r.subTo(i,i),i},e.prototype.modPowInt=function(r,i){return i=new(r<256||i.isEven()?lt:b)(i),this.exp(r,i)},e.ZERO=O(0),e.ONE=O(1),pt.prototype.convert=Ct,pt.prototype.revert=Ct,pt.prototype.mulTo=function(r,i,s){r.multiplyTo(i,s)},pt.prototype.sqrTo=function(r,i){r.squareTo(i)},B.prototype.convert=function(r){if(r.s<0||r.t>2*this.m.t)return r.mod(this.m);if(r.compareTo(this.m)<0)return r;var i=o();return r.copyTo(i),this.reduce(i),i},B.prototype.revert=function(r){return r},B.prototype.reduce=function(r){for(r.drShiftTo(this.m.t-1,this.r2),r.t>this.m.t+1&&(r.t=this.m.t+1,r.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);r.compareTo(this.r2)<0;)r.dAddOffset(1,this.m.t+1);for(r.subTo(this.r2,r);0<=r.compareTo(this.m);)r.subTo(this.m,r)},B.prototype.mulTo=function(r,i,s){r.multiplyTo(i,s),this.reduce(s)},B.prototype.sqrTo=function(r,i){r.squareTo(i),this.reduce(i)};var $,K=[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)/K[K.length-1];function z(){var r;r=new Date().getTime(),Dt[ot++]^=255&r,Dt[ot++]^=r>>8&255,Dt[ot++]^=r>>16&255,Dt[ot++]^=r>>24&255,ln<=ot&&(ot-=ln)}if(e.prototype.chunkSize=function(r){return Math.floor(Math.LN2*this.DB/Math.log(r))},e.prototype.toRadix=function(r){if(r==null&&(r=10),this.signum()==0||r<2||36<r)return"0";var i=this.chunkSize(r),s=Math.pow(r,i),y=O(s),I=o(),M=o(),V="";for(this.divRemTo(y,I,M);0<I.signum();)V=(s+M.intValue()).toString(r).substr(1)+V,I.divRemTo(y,I,M);return M.intValue().toString(r)+V},e.prototype.fromRadix=function(r,i){this.fromInt(0);for(var s=this.chunkSize(i=i==null?10:i),y=Math.pow(i,s),I=!1,M=0,V=0,k=0;k<r.length;++k){var xt=Y(r,k);xt<0?r.charAt(k)=="-"&&this.signum()==0&&(I=!0):(V=i*V+xt,++M>=s&&(this.dMultiply(y),this.dAddOffset(V,0),V=M=0))}0<M&&(this.dMultiply(Math.pow(i,M)),this.dAddOffset(V,0)),I&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(r,i,s){if(typeof i=="number")if(r<2)this.fromInt(1);else for(this.fromNumber(r,s),this.testBit(r-1)||this.bitwiseTo(e.ONE.shiftLeft(r-1),rt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(i);)this.dAddOffset(2,0),this.bitLength()>r&&this.subTo(e.ONE.shiftLeft(r-1),this);else{var y=new Array;s=7&r,y.length=1+(r>>3),i.nextBytes(y),0<s?y[0]&=(1<<s)-1:y[0]=0,this.fromString(y,256)}},e.prototype.bitwiseTo=function(r,i,s){for(var y,I=Math.min(r.t,this.t),M=0;M<I;++M)s[M]=i(this[M],r[M]);if(r.t<this.t){for(y=r.s&this.DM,M=I;M<this.t;++M)s[M]=i(this[M],y);s.t=this.t}else{for(y=this.s&this.DM,M=I;M<r.t;++M)s[M]=i(y,r[M]);s.t=r.t}s.s=i(this.s,r.s),s.clamp()},e.prototype.changeBit=function(r,i){return r=e.ONE.shiftLeft(r),this.bitwiseTo(r,i,r),r},e.prototype.addTo=function(r,i){for(var s=0,y=0,I=Math.min(r.t,this.t);s<I;)y+=this[s]+r[s],i[s++]=y&this.DM,y>>=this.DB;if(r.t<this.t){for(y+=r.s;s<this.t;)y+=this[s],i[s++]=y&this.DM,y>>=this.DB;y+=this.s}else{for(y+=this.s;s<r.t;)y+=r[s],i[s++]=y&this.DM,y>>=this.DB;y+=r.s}i.s=y<0?-1:0,0<y?i[s++]=y:y<-1&&(i[s++]=this.DV+y),i.t=s,i.clamp()},e.prototype.dMultiply=function(r){this[this.t]=this.am(0,r-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(r,i){if(r!=0){for(;this.t<=i;)this[this.t++]=0;for(this[i]+=r;this[i]>=this.DV;)this[i]-=this.DV,++i>=this.t&&(this[this.t++]=0),++this[i]}},e.prototype.multiplyLowerTo=function(r,i,s){var y,I=Math.min(this.t+r.t,i);for(s.s=0,s.t=I;0<I;)s[--I]=0;for(y=s.t-this.t;I<y;++I)s[I+this.t]=this.am(0,r[I],s,I,0,this.t);for(y=Math.min(r.t,i);I<y;++I)this.am(0,r[I],s,I,0,i-I);s.clamp()},e.prototype.multiplyUpperTo=function(r,i,s){var y=s.t=this.t+r.t- --i;for(s.s=0;0<=--y;)s[y]=0;for(y=Math.max(i-this.t,0);y<r.t;++y)s[this.t+y-i]=this.am(i-y,r[y],s,0,0,this.t+y-i);s.clamp(),s.drShiftTo(1,s)},e.prototype.modInt=function(r){if(r<=0)return 0;var i=this.DV%r,s=this.s<0?r-1:0;if(0<this.t)if(i==0)s=this[0]%r;else for(var y=this.t-1;0<=y;--y)s=(i*s+this[y])%r;return s},e.prototype.millerRabin=function(r){var i=this.subtract(e.ONE),s=i.getLowestSetBit();if(s<=0)return!1;var y=i.shiftRight(s);K.length<(r=r+1>>1)&&(r=K.length);for(var I=o(),M=0;M<r;++M){I.fromInt(K[Math.floor(Math.random()*K.length)]);var V=I.modPow(y,this);if(V.compareTo(e.ONE)!=0&&V.compareTo(i)!=0){for(var k=1;k++<s&&V.compareTo(i)!=0;)if((V=V.modPowInt(2,this)).compareTo(e.ONE)==0)return!1;if(V.compareTo(i)!=0)return!1}}return!0},e.prototype.clone=function(){var r=o();return this.copyTo(r),r},e.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]},e.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var r=this.t,i=new Array;i[0]=this.s;var s,y=this.DB-r*this.DB%8,I=0;if(0<r--)for(y<this.DB&&(s=this[r]>>y)!=(this.s&this.DM)>>y&&(i[I++]=s|this.s<<this.DB-y);0<=r;)y<8?(s=(this[r]&(1<<y)-1)<<8-y,s|=this[--r]>>(y+=this.DB-8)):(s=this[r]>>(y-=8)&255,y<=0&&(y+=this.DB,--r)),128&s&&(s|=-256),I==0&&(128&this.s)!=(128&s)&&++I,(0<I||s!=this.s)&&(i[I++]=s);return i},e.prototype.equals=function(r){return this.compareTo(r)==0},e.prototype.min=function(r){return this.compareTo(r)<0?this:r},e.prototype.max=function(r){return 0<this.compareTo(r)?this:r},e.prototype.and=function(r){var i=o();return this.bitwiseTo(r,W,i),i},e.prototype.or=function(r){var i=o();return this.bitwiseTo(r,rt,i),i},e.prototype.xor=function(r){var i=o();return this.bitwiseTo(r,Z,i),i},e.prototype.andNot=function(r){var i=o();return this.bitwiseTo(r,ft,i),i},e.prototype.not=function(){for(var r=o(),i=0;i<this.t;++i)r[i]=this.DM&~this[i];return r.t=this.t,r.s=~this.s,r},e.prototype.shiftLeft=function(r){var i=o();return r<0?this.rShiftTo(-r,i):this.lShiftTo(r,i),i},e.prototype.shiftRight=function(r){var i=o();return r<0?this.lShiftTo(-r,i):this.rShiftTo(r,i),i},e.prototype.getLowestSetBit=function(){for(var r=0;r<this.t;++r)if(this[r]!=0)return r*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[r]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var r=0,i=this.s&this.DM,s=0;s<this.t;++s)r+=(function(y){for(var I=0;y!=0;)y&=y-1,++I;return I})(this[s]^i);return r},e.prototype.testBit=function(r){var i=Math.floor(r/this.DB);return i>=this.t?this.s!=0:!!(this[i]&1<<r%this.DB)},e.prototype.setBit=function(r){return this.changeBit(r,rt)},e.prototype.clearBit=function(r){return this.changeBit(r,ft)},e.prototype.flipBit=function(r){return this.changeBit(r,Z)},e.prototype.add=function(r){var i=o();return this.addTo(r,i),i},e.prototype.subtract=function(r){var i=o();return this.subTo(r,i),i},e.prototype.multiply=function(r){var i=o();return this.multiplyTo(r,i),i},e.prototype.divide=function(r){var i=o();return this.divRemTo(r,i,null),i},e.prototype.remainder=function(r){var i=o();return this.divRemTo(r,null,i),i},e.prototype.divideAndRemainder=function(r){var i=o(),s=o();return this.divRemTo(r,i,s),new Array(i,s)},e.prototype.modPow=function(r,i){var s=r.bitLength(),y=O(1);if(s<=0)return y;var I=s<18?1:s<48?3:s<144?4:s<768?5:6,M=new(s<8?lt:i.isEven()?B:b)(i),V=new Array,k=3,xt=I-1,$t=(1<<I)-1;if(V[1]=M.convert(this),1<I){var fe=o();for(M.sqrTo(V[1],fe);k<=$t;)V[k]=o(),M.mulTo(fe,V[k-2],V[k]),k+=2}var pe,Ne,Vt=r.t-1,Ie=!0,Bt=o();for(s=ct(r[Vt])-1;0<=Vt;){for(xt<=s?pe=r[Vt]>>s-xt&$t:(pe=(r[Vt]&(1<<s+1)-1)<<xt-s,0<Vt&&(pe|=r[Vt-1]>>this.DB+s-xt)),k=I;!(1&pe);)pe>>=1,--k;if((s-=k)<0&&(s+=this.DB,--Vt),Ie)V[pe].copyTo(y),Ie=!1;else{for(;1<k;)M.sqrTo(y,Bt),M.sqrTo(Bt,y),k-=2;0<k?M.sqrTo(y,Bt):(Ne=y,y=Bt,Bt=Ne),M.mulTo(Bt,V[pe],y)}for(;0<=Vt&&!(r[Vt]&1<<s);)M.sqrTo(y,Bt),Ne=y,y=Bt,Bt=Ne,--s<0&&(s=this.DB-1,--Vt)}return M.revert(y)},e.prototype.modInverse=function(r){var i=r.isEven();if(this.isEven()&&i||r.signum()==0)return e.ZERO;for(var s=r.clone(),y=this.clone(),I=O(1),M=O(0),V=O(0),k=O(1);s.signum()!=0;){for(;s.isEven();)s.rShiftTo(1,s),i?(I.isEven()&&M.isEven()||(I.addTo(this,I),M.subTo(r,M)),I.rShiftTo(1,I)):M.isEven()||M.subTo(r,M),M.rShiftTo(1,M);for(;y.isEven();)y.rShiftTo(1,y),i?(V.isEven()&&k.isEven()||(V.addTo(this,V),k.subTo(r,k)),V.rShiftTo(1,V)):k.isEven()||k.subTo(r,k),k.rShiftTo(1,k);0<=s.compareTo(y)?(s.subTo(y,s),i&&I.subTo(V,I),M.subTo(k,M)):(y.subTo(s,y),i&&V.subTo(I,V),k.subTo(M,k))}return y.compareTo(e.ONE)!=0?e.ZERO:0<=k.compareTo(r)?k.subtract(r):k.signum()<0?(k.addTo(r,k),k.signum()<0?k.add(r):k):k},e.prototype.pow=function(r){return this.exp(r,new pt)},e.prototype.gcd=function(r){var i=this.s<0?this.negate():this.clone(),s=r.s<0?r.negate():r.clone();i.compareTo(s)<0&&(I=i,i=s,s=I);var y=i.getLowestSetBit(),I=s.getLowestSetBit();if(I<0)return i;for(0<(I=y<I?y:I)&&(i.rShiftTo(I,i),s.rShiftTo(I,s));0<i.signum();)0<(y=i.getLowestSetBit())&&i.rShiftTo(y,i),0<(y=s.getLowestSetBit())&&s.rShiftTo(y,s),0<=i.compareTo(s)?(i.subTo(s,i),i.rShiftTo(1,i)):(s.subTo(i,s),s.rShiftTo(1,s));return 0<I&&s.lShiftTo(I,s),s},e.prototype.isProbablePrime=function(r){var i,s=this.abs();if(s.t==1&&s[0]<=K[K.length-1]){for(i=0;i<K.length;++i)if(s[0]==K[i])return!0;return!1}if(s.isEven())return!1;for(i=1;i<K.length;){for(var y=K[i],I=i+1;I<K.length&&y<Q;)y*=K[I++];for(y=s.modInt(y);i<I;)if(y%K[i++]==0)return!1}return s.millerRabin(r)},e.prototype.square=function(){var r=o();return this.squareTo(r),r},e.prototype.Barrett=B,Dt==null){var Dt=new Array,ot=0;if(typeof window!="undefined"&&window.crypto){if(window.crypto.getRandomValues){var Tt=new Uint8Array(32);for(window.crypto.getRandomValues(Tt),kt=0;kt<32;++kt)Dt[ot++]=Tt[kt]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5")for(var Lt=window.crypto.random(32),kt=0;kt<Lt.length;++kt)Dt[ot++]=255&Lt.charCodeAt(kt)}for(;ot<ln;)kt=Math.floor(65536*Math.random()),Dt[ot++]=kt>>>8,Dt[ot++]=255&kt;ot=0,z()}function un(){if($==null){for(z(),($=new cn).init(Dt),ot=0;ot<Dt.length;++ot)Dt[ot]=0;ot=0}return $.next()}function Jn(){}function cn(){this.i=0,this.j=0,this.S=new Array}Jn.prototype.nextBytes=function(r){for(var i=0;i<r.length;++i)r[i]=un()},cn.prototype.init=function(r){for(var i,s,y=0;y<256;++y)this.S[y]=y;for(y=i=0;y<256;++y)i=i+this.S[y]+r[y%r.length]&255,s=this.S[y],this.S[y]=this.S[i],this.S[i]=s;this.i=0,this.j=0},cn.prototype.next=function(){var r;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,r=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=r,this.S[r+this.S[this.i]&255]};var ln=256;jt.exports={default:e,BigInteger:e,SecureRandom:Jn}}.call(C);var w=Xt.exports.BigInteger,bt=(function(){function e(){G(this,e),this.tlv=null,this.t="00",this.l="00",this.v=""}return S(e,[{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 o=this.v.length/2,u=o.toString(16);return u.length%2==1&&(u="0"+u),o<128?u:(128+u.length/2).toString(16)+u}},{key:"getValue",value:function(){return""}}]),e})(),ce=(function(){nt(o,bt);var e=H(o);function o(u){var c;return G(this,o),(c=e.call(this)).t="02",u&&(c.v=(function(h){if((m=h.toString(16))[0]!=="-")m.length%2==1?m="0"+m:m.match(/^[0-7]/)||(m="00"+m);else{var m,R=(m=m.substr(1)).length;R%2==1?R+=1:m.match(/^[0-7]/)||(R+=2);for(var Y="",O=0;O<R;O++)Y+="f";m=(m=(Y=new w(Y,16)).xor(h).add(w.ONE)).toString(16).replace(/^-/,"")}return m})(u)),c}return S(o,[{key:"getValue",value:function(){return this.v}}]),o})(),se=(function(){nt(o,bt);var e=H(o);function o(u){var c;return G(this,o),(c=e.call(this)).t="30",c.asn1Array=u,c}return S(o,[{key:"getValue",value:function(){return this.v=this.asn1Array.map((function(u){return u.getEncodedHex()})).join(""),this.v}}]),o})();function qt(e,o){return+e[o+2]<8?1:128&+e.substr(o+2,2)}function le(e,o){var u=qt(e,o);return(e=e.substr(o+2,2*u))?(+e[0]<8?new w(e,16):new w(e.substr(2),16)).intValue():-1}function ue(e,o){return o+2*(qt(e,o)+1)}var Ut=Xt.exports.BigInteger,Ht=new Ut("3"),Ae=(function(){function e(o,u){G(this,e),this.x=u,this.q=o}return S(e,[{key:"equals",value:function(o){return o===this||this.q.equals(o.q)&&this.x.equals(o.x)}},{key:"toBigInteger",value:function(){return this.x}},{key:"negate",value:function(){return new e(this.q,this.x.negate().mod(this.q))}},{key:"add",value:function(o){return new e(this.q,this.x.add(o.toBigInteger()).mod(this.q))}},{key:"subtract",value:function(o){return new e(this.q,this.x.subtract(o.toBigInteger()).mod(this.q))}},{key:"multiply",value:function(o){return new e(this.q,this.x.multiply(o.toBigInteger()).mod(this.q))}},{key:"divide",value:function(o){return new e(this.q,this.x.multiply(o.toBigInteger().modInverse(this.q)).mod(this.q))}},{key:"square",value:function(){return new e(this.q,this.x.square().mod(this.q))}}]),e})(),te=(function(){function e(o,u,c,h){G(this,e),this.curve=o,this.x=u,this.y=c,this.z=h==null?Ut.ONE:h,this.zinv=null}return S(e,[{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(o){return o===this||(this.isInfinity()?o.isInfinity():o.isInfinity()?this.isInfinity():!!o.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(o.z)).mod(this.curve.q).equals(Ut.ZERO)&&o.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(o.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 e(this.curve,this.x,this.y.negate(),this.z)}},{key:"add",value:function(o){if(this.isInfinity())return o;if(o.isInfinity())return this;var u=this.x.toBigInteger(),c=this.y.toBigInteger(),h=this.z,m=o.x.toBigInteger(),R=o.y.toBigInteger(),Y=o.z,O=this.curve.q,ct=u.multiply(Y).mod(O);return o=m.multiply(h).mod(O),u=ct.subtract(o),m=c.multiply(Y).mod(O),c=R.multiply(h).mod(O),R=m.subtract(c),Ut.ZERO.equals(u)?Ut.ZERO.equals(R)?this.twice():this.curve.infinity:(c=ct.add(o),o=h.multiply(Y).mod(O),Y=u.square().mod(O),h=u.multiply(Y).mod(O),c=o.multiply(R.square()).subtract(c.multiply(Y)).mod(O),u=u.multiply(c).mod(O),m=R.multiply(Y.multiply(ct).subtract(c)).subtract(m.multiply(h)).mod(O),O=h.multiply(o).mod(O),new e(this.curve,this.curve.fromBigInteger(u),this.curve.fromBigInteger(m),O))}},{key:"twice",value:function(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;var o=this.x.toBigInteger(),u=this.y.toBigInteger(),c=this.z,h=this.curve.q,m=this.curve.a.toBigInteger(),R=o.square().multiply(Ht).add(m.multiply(c.square())).mod(h),Y=u.shiftLeft(1).multiply(c).mod(h),O=(m=(O=u.square().mod(h)).multiply(o).multiply(c).mod(h),u=Y.square().mod(h),o=R.square().subtract(m.shiftLeft(3)).mod(h),c=Y.multiply(o).mod(h),R.multiply(m.shiftLeft(2).subtract(o)).subtract(u.shiftLeft(1).multiply(O)).mod(h));return h=Y.multiply(u).mod(h),new e(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(O),h)}},{key:"multiply",value:function(o){if(this.isInfinity())return this;if(!o.signum())return this.curve.infinity;for(var u=o.multiply(Ht),c=this.negate(),h=this,m=u.bitLength()-2;0<m;m--){h=h.twice();var R=u.testBit(m);R!==o.testBit(m)&&(h=h.add(R?this:c))}return h}}]),e})(),Ft=(function(){function e(o,u,c){G(this,e),this.q=o,this.a=this.fromBigInteger(u),this.b=this.fromBigInteger(c),this.infinity=new te(this,null,null)}return S(e,[{key:"equals",value:function(o){return o===this||this.q.equals(o.q)&&this.a.equals(o.a)&&this.b.equals(o.b)}},{key:"fromBigInteger",value:function(o){return new Ae(this.q,o)}},{key:"decodePointHex",value:function(o){switch(parseInt(o.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:default:return null;case 4:case 6:case 7:var u=(o.length-2)/2,c=o.substr(2,u);return u=o.substr(2+u,u),new te(this,this.fromBigInteger(new Ut(c,16)),this.fromBigInteger(new Ut(u,16)))}}}]),e})(),Mt={ECPointFp:te,ECCurveFp:Ft},re=Xt.exports.BigInteger,_e=(Ft=Xt.exports.SecureRandom,Mt.ECCurveFp),ye=new Ft,oe=(Mt=A()).curve,p=Mt.G,_=Mt.n;function A(){var e=new re("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),o=new re("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),u=new re("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16);return u=(o=new _e(e,o,u)).decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),{curve:o,G:u,n:new re("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function J(e,o){return e.length>=o?e:new Array(o-e.length+1).join("0")+e}function v(e,o){for(var u=[],c=~~(o/8),h=o%8,m=0,R=e.length;m<R;m++)u[m]=(e[(m+c)%R]<<h&255)+(e[(m+c+1)%R]>>>8-h&255);return u}function q(e,o){for(var u=[],c=e.length-1;0<=c;c--)u[c]=255&(e[c]^o[c]);return u}function at(e,o){for(var u=[],c=e.length-1;0<=c;c--)u[c]=e[c]&o[c]&255;return u}function It(e,o){for(var u=[],c=e.length-1;0<=c;c--)u[c]=255&(e[c]|o[c]);return u}function gt(e,o){for(var u=[],c=0,h=e.length-1;0<=h;h--){var m=e[h]+o[h]+c;c=255<m?1:0,u[h]=255&m}return u}function Wt(e,o,u,c){return 0<=c&&c<=15?q(q(e,o),u):It(at(e,o),at((function(h){for(var m=[],R=h.length-1;0<=R;R--)m[R]=255&~h[R];return m})(e),u))}function ee(e,o){for(var u=[],c=[],h=0;h<16;h++){var m=4*h;u.push(o.slice(m,4+m))}for(var R,Y=16;Y<68;Y++)u.push(q(q((R=q(q(u[Y-16],u[Y-9]),v(u[Y-3],15)),q(q(R,v(R,15)),v(R,23))),v(u[Y-13],7)),u[Y-6]));for(var O=0;O<64;O++)c.push(q(u[O],u[O+4]));for(var ct,lt,b,W=[121,204,69,25],rt=[122,135,157,138],Z=e.slice(0,4),ft=e.slice(4,8),pt=e.slice(8,12),Ct=e.slice(12,16),B=e.slice(16,20),$=e.slice(20,24),K=e.slice(24,28),Q=e.slice(28,32),z=0;z<64;z++){var Dt=0<=z&&z<=15?W:rt,ot=q(Tt=v(gt(gt(v(Z,12),B),v(Dt,z)),7),v(Z,12)),Tt=(ot=gt(gt(gt((ct=Z,lt=ft,b=pt,0<=(Dt=z)&&Dt<=15?q(q(ct,lt),b):It(It(at(ct,lt),at(ct,b)),at(lt,b))),Ct),ot),c[z]),gt(gt(gt(Wt(B,$,K,z),Q),Tt),u[z]));Ct=pt,pt=v(ft,9),ft=Z,Z=ot,Q=K,K=v($,19),$=B,B=q(q(Tt,v(Tt,9)),v(Tt,17))}return q([].concat(Z,ft,pt,Ct,B,$,K,Q),e)}Ft={getGlobalCurve:function(){return oe},generateEcparam:A,generateKeyPairHex:function(e,o,u){return{privateKey:u=J((o=(e?new re(e,o,u):new re(_.bitLength(),ye)).mod(_.subtract(re.ONE)).add(re.ONE)).toString(16),64),publicKey:"04"+J((o=p.multiply(o)).getX().toBigInteger().toString(16),64)+J(o.getY().toBigInteger().toString(16),64)}},utf8ToHex:function(e){for(var o=(e=unescape(encodeURIComponent(e))).length,u=[],c=0;c<o;c++)u[c>>>2]|=(255&e.charCodeAt(c))<<24-c%4*8;for(var h=[],m=0;m<o;m++){var R=u[m>>>2]>>>24-m%4*8&255;h.push((R>>>4).toString(16)),h.push((15&R).toString(16))}return h.join("")},leftPad:J,arrayToHex:function(e){return e.map((function(o){return(o=o.toString(16)).length===1?"0"+o:o})).join("")},arrayToUtf8:function(e){for(var o=[],u=0,c=0;c<2*e.length;c+=2)o[c>>>3]|=parseInt(e[u],10)<<24-c%8*4,u++;try{for(var h=[],m=0;m<e.length;m++){var R=o[m>>>2]>>>24-m%4*8&255;h.push(String.fromCharCode(R))}return decodeURIComponent(escape(h.join("")))}catch(Y){throw new Error("Malformed UTF-8 data")}},hexToArray:function(e){for(var o=[],u=(e=(u=e.length)%2!=0?J(e,u+1):e).length,c=0;c<u;c+=2)o.push(parseInt(e.substr(c,2),16));return o},verifyPublicKey:function(e){var o=oe.decodePointHex(e);return!!o&&(e=o.getX(),o.getY().square().equals(e.multiply(e.square()).add(e.multiply(oe.a)).add(oe.b)))}},Mt=function(e){for(var o=448<=(o=(Y=8*e.length)%512)?512-o%448-1:448-o-1,u=new Array((o-7)/8),c=0,h=u.length;c<h;c++)u[c]=0;for(var m,R=[],Y=Y.toString(2),O=7;0<=O;O--)8<Y.length?(m=Y.length-8,R[O]=parseInt(Y.substr(m),2),Y=Y.substr(0,m)):0<Y.length?(R[O]=parseInt(Y,2),Y=""):R[O]=0;for(var ct=[].concat(e,[128],u,R),lt=ct.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],W=0;W<lt;W++){var rt=64*W;b=ee(b,ct.slice(rt,64+rt))}return b};var Rt=Xt.exports.BigInteger,Mr=function(e,o){return e=new ce(e),o=new ce(o),new se([e,o]).getEncodedHex()},Jr=function(e){var o=ue(e,0),u=ue(e,o),c=le(e,o);return o=e.substr(u,2*c),u=ue(e,c=u+o.length),c=le(e,c),e=e.substr(u,2*c),{r:new w(o,16),s:new w(e,16)}},yt=Ft,Se=Mt,Ee=(Ft=yt.generateEcparam()).G,Yn=Ft.curve,Re=Ft.n;function Ln(e,o,u){var c=2<arguments.length&&u!==void 0?u:"1234567812345678",h=(c=yt.utf8ToHex(c),yt.leftPad(Ee.curve.a.toBigInteger().toRadix(16),64)),m=yt.leftPad(Ee.curve.b.toBigInteger().toRadix(16),64),R=yt.leftPad(Ee.getX().toBigInteger().toRadix(16),64),Y=yt.leftPad(Ee.getY().toBigInteger().toRadix(16),64);return u=(o=128<o.length?o.substr(2,128):o).substr(0,64),o=o.substr(64,64),o=yt.hexToArray(c+h+m+R+Y+u+o),c=4*c.length,o.unshift(255&c),o.unshift(c>>8&255),o=Se(o),yt.arrayToHex(Se(o.concat(yt.hexToArray(e))))}function xn(){var e=yt.generateKeyPairHex(),o=Yn.decodePointHex(e.publicKey);return e.k=new Rt(e.privateKey,16),e.x1=o.getX().toBigInteger(),e}Ft={generateKeyPairHex:yt.generateKeyPairHex,doEncrypt:function(e,o){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1;e=typeof e=="string"?yt.hexToArray(yt.utf8ToHex(e)):Array.prototype.slice.call(e),o=yt.getGlobalCurve().decodePointHex(o);var c=yt.generateKeyPairHex(),h=new Rt(c.privateKey,16),m=c.publicKey;128<m.length&&(m=m.substr(m.length-128)),c=o.multiply(h),h=yt.hexToArray(yt.leftPad(c.getX().toBigInteger().toRadix(16),64)),o=yt.hexToArray(yt.leftPad(c.getY().toBigInteger().toRadix(16),64)),c=yt.arrayToHex(Se([].concat(h,e,o)));var R,Y=1,O=0,ct=[],lt=[].concat(h,o);(R=function(){ct=Se([].concat(wt(lt),[Y>>24&255,Y>>16&255,Y>>8&255,255&Y])),Y++,O=0})();for(var b=0,W=e.length;b<W;b++)O===ct.length&&R(),e[b]^=255&ct[O++];return o=yt.arrayToHex(e),u===0?m+o+c:m+c+o},doDecrypt:function(e,o){var u=2<arguments.length&&arguments[2]!==void 0?arguments[2]:1,c=(m=(3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).output)===void 0?"string":m;o=new Rt(o,16);var h=e.substr(128,64),m=e.substr(192);u===0&&(h=e.substr(e.length-64),m=e.substr(128,e.length-128-64));var R,Y=yt.hexToArray(m),O=(e=yt.getGlobalCurve().decodePointHex("04"+e.substr(0,128)).multiply(o),o=yt.hexToArray(yt.leftPad(e.getX().toBigInteger().toRadix(16),64)),e=yt.hexToArray(yt.leftPad(e.getY().toBigInteger().toRadix(16),64)),1),ct=0,lt=[],b=[].concat(o,e);(R=function(){lt=Se([].concat(wt(b),[O>>24&255,O>>16&255,O>>8&255,255&O])),O++,ct=0})();for(var W=0,rt=Y.length;W<rt;W++)ct===lt.length&&R(),Y[W]^=255&lt[ct++];return yt.arrayToHex(Se([].concat(o,Y,e)))===h?c==="array"?Y:yt.arrayToUtf8(Y):c==="array"?[]:""},doSignature:function(e,o){var u=(Y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{}).pointPool,c=Y.der,h=Y.hash,m=Y.publicKey,R=Y.userId,Y=typeof e=="string"?yt.utf8ToHex(e):yt.arrayToHex(e);h&&(Y=Ln(Y,m||(e=o,h=Ee.multiply(new Rt(e,16)),"04"+(e=yt.leftPad(h.getX().toBigInteger().toString(16),64))+(h=yt.leftPad(h.getY().toBigInteger().toString(16),64))),R));var O=new Rt(o,16),ct=new Rt(Y,16),lt=null,b=null,W=null;do do{var rt;lt=(rt=u&&u.length?u.pop():xn()).k,b=ct.add(rt.x1).mod(Re)}while(b.equals(Rt.ZERO)||b.add(lt).equals(Re));while((W=O.add(Rt.ONE).modInverse(Re).multiply(lt.subtract(b.multiply(O))).mod(Re)).equals(Rt.ZERO));return c?Mr(b,W):yt.leftPad(b.toString(16),64)+yt.leftPad(W.toString(16),64)},doVerifySignature:function(e,o,u){var c,h,m=(Y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:{}).der,R=Y.hash,Y=Y.userId;return e=typeof e=="string"?yt.utf8ToHex(e):yt.arrayToHex(e),R&&(e=Ln(e,u,Y)),h=m?(c=(h=Jr(o)).r,h.s):(c=new Rt(o.substring(0,64),16),new Rt(o.substring(64),16)),o=Yn.decodePointHex(u),u=new Rt(e,16),!(e=c.add(h).mod(Re)).equals(Rt.ZERO)&&(o=Ee.multiply(h).add(o.multiply(e)),u=u.add(o.getX().toBigInteger()).mod(Re),c.equals(u))},getPoint:xn,verifyPublicKey:yt.verifyPublicKey};var kr=Mt,He=[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],Ge=[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 sn(e){for(var o=[],u=0,c=e.length;u<c;u+=2)o.push(parseInt(e.substr(u,2),16));return o}function Te(e,o){return e<<o|e>>>32-o}function ge(e){return(255&He[e>>>24&255])<<24|(255&He[e>>>16&255])<<16|(255&He[e>>>8&255])<<8|255&He[255&e]}function Ke(e){return e^Te(e,2)^Te(e,10)^Te(e,18)^Te(e,24)}function Xe(e){return e^Te(e,13)^Te(e,23)}function Un(e,o,u,c){c=(m=(R=3<arguments.length&&c!==void 0?c:{}).padding)===void 0?"pkcs#5":m;var h=R.mode,m=(m=R.iv)===void 0?[]:m,R=(R=R.output)===void 0?"string":R;if(h==="cbc"&&(m=typeof m=="string"?sn(m):m).length!==16)throw new Error("iv is invalid");if((o=typeof o=="string"?sn(o):o).length!==16)throw new Error("key is invalid");if(e=(typeof e=="string"?u!==0?function(B){for(var $=[],K=0,Q=B.length;K<Q;K++){var z=B.codePointAt(K);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");K++,$.push(240|z>>>18&28),$.push(128|z>>>12&63),$.push(128|z>>>6&63),$.push(128|63&z)}}return $}:sn:wt)(e),c==="pkcs#5"&&u!==0)for(var Y=16-e.length%16,O=0;O<Y;O++)e.push(Y);var ct=new Array(32);(function(B,$,K){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 ot,Tt=0;Tt<32;Tt+=4)ot=Q[1]^Q[2]^Q[3]^Ge[Tt+0],$[Tt+0]=Q[0]^=Xe(ge(ot)),ot=Q[2]^Q[3]^Q[0]^Ge[Tt+1],$[Tt+1]=Q[1]^=Xe(ge(ot)),ot=Q[3]^Q[0]^Q[1]^Ge[Tt+2],$[Tt+2]=Q[2]^=Xe(ge(ot)),ot=Q[0]^Q[1]^Q[2]^Ge[Tt+3],$[Tt+3]=Q[3]^=Xe(ge(ot));if(K===0)for(var Lt,kt=0;kt<16;kt++)Lt=$[kt],$[kt]=$[31-kt],$[31-kt]=Lt})(o,ct,u);for(var lt=[],b=m,W=e.length,rt=0;16<=W;){var Z=e.slice(rt,rt+16),ft=new Array(16);if(h==="cbc")for(var pt=0;pt<16;pt++)u!==0&&(Z[pt]^=b[pt]);(function(B,$,K){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 ot,Tt=0;Tt<32;Tt+=4)ot=Q[1]^Q[2]^Q[3]^K[Tt+0],Q[0]^=Ke(ge(ot)),ot=Q[2]^Q[3]^Q[0]^K[Tt+1],Q[1]^=Ke(ge(ot)),ot=Q[3]^Q[0]^Q[1]^K[Tt+2],Q[2]^=Ke(ge(ot)),ot=Q[0]^Q[1]^Q[2]^K[Tt+3],Q[3]^=Ke(ge(ot));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,ft,ct);for(var Ct=0;Ct<16;Ct++)h==="cbc"&&u===0&&(ft[Ct]^=b[Ct]),lt[rt+Ct]=ft[Ct];h==="cbc"&&(b=u!==0?ft:Z),W-=16,rt+=16}return c==="pkcs#5"&&u===0&&(c=lt[lt.length-1],lt.splice(lt.length-c,c)),R!=="array"?u!==0?lt.map((function(B){return(B=B.toString(16)).length===1?"0"+B:B})).join(""):(function(B){for(var $=[],K=0,Q=B.length;K<Q;K++)240<=B[K]&&B[K]<=247?($.push(String.fromCodePoint(((7&B[K])<<18)+((63&B[K+1])<<12)+((63&B[K+2])<<6)+(63&B[K+3]))),K+=3):224<=B[K]&&B[K]<=239?($.push(String.fromCodePoint(((15&B[K])<<12)+((63&B[K+1])<<6)+(63&B[K+2]))),K+=2):192<=B[K]&&B[K]<=223?($.push(String.fromCodePoint(((31&B[K])<<6)+(63&B[K+1]))),K++):$.push(String.fromCodePoint(B[K]));return $.join("")})(lt):lt}var qr=[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],De=[],Br=function(e,o,u){for(var c=e[0],h=e[1],m=e[2],R=e[3],Y=e[4],O=e[5],ct=e[6],lt=e[7],b=0;b<64;b++){b<16?De[b]=0|o[u+b]:(W=De[b-15],rt=De[b-2],De[b]=((W<<25|W>>>7)^(W<<14|W>>>18)^W>>>3)+De[b-7]+((rt<<15|rt>>>17)^(rt<<13|rt>>>19)^rt>>>10)+De[b-16]);var W=c&h^c&m^h&m,rt=lt+((Y<<26|Y>>>6)^(Y<<21|Y>>>11)^(Y<<7|Y>>>25))+(Y&O^~Y&ct)+qr[b]+De[b];lt=ct,ct=O,O=Y,Y=R+rt|0,R=m,m=h,h=c,c=rt+(((c<<30|c>>>2)^(c<<19|c>>>13)^(c<<10|c>>>22))+W)|0}e[0]=e[0]+c|0,e[1]=e[1]+h|0,e[2]=e[2]+m|0,e[3]=e[3]+R|0,e[4]=e[4]+Y|0,e[5]=e[5]+O|0,e[6]=e[6]+ct|0,e[7]=e[7]+lt|0},Mn=(Ft={c2:Ft,c3:function(e){return e=typeof e=="string"?(function(o){for(var u=[],c=0,h=o.length;c<h;c++){var m=o.codePointAt(c);if(m<=127)u.push(m);else if(m<=2047)u.push(192|m>>>6),u.push(128|63&m);else if(m<=55295||57344<=m&&m<=65535)u.push(224|m>>>12),u.push(128|m>>>6&63),u.push(128|63&m);else{if(!(65536<=m&&m<=1114111))throw u.push(m),new Error("input is not supported");c++,u.push(240|m>>>18&28),u.push(128|m>>>12&63),u.push(128|m>>>6&63),u.push(128|63&m)}}return u})(e):Array.prototype.slice.call(e),kr(e).map((function(o){return(o=o.toString(16)).length===1?"0"+o:o})).join("")},c4:{encrypt:function(e,o,u){return Un(e,o,1,u)},decrypt:function(e,o,u){return Un(e,o,0,u)}},s2:function(e){var o=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],u=(function(h){for(var m=[],R=0;R<Math.ceil(h.length/4);R++)m[R]=h[4*R]<<24|(255&h[4*R+1])<<16|(255&h[4*R+2])<<8|255&h[4*R+3];return m})(e);u[(e=8*e.length)>>5]|=128<<24-e%32,u[15+(64+e>>9<<4)]=e;for(var c=0;c<u.length;c+=16)Br(o,u,c);return(function(h){for(var m=[],R=0;R<h.length;R++)m[4*R]=h[R]>>24&255,m[4*R+1]=h[R]>>16&255,m[4*R+2]=h[R]>>8&255,m[4*R+3]=255&h[R];return m})(o).map((function(h){return(h=h.toString(16)).length===1?"0"+h:h})).join("")}},vt),Vr=At,jr=Et,Hr=Gt,Gr=Zt,Kr=Ft.c2,Xr=Ft.c3,Wr=Ft.c4,Qr=Ft.s2;return(function(){var e;(e=function(){}).VERSION="2.1.0";var o=C;if(o.AAR2)return o.AAR2.VERSION!==e.VERSION&&console.log(o.AAR2.VERSION),o.AAR2;var u="04a9e1d2b39a224811a20bb85ea4b302e2aab74a31e662a474f4378b4d071658840612894c0ebff53dd75158316df0df97b966f70e74a4b4f29d85fe947b4fc73c",c=!1,h=!1,m=typeof wx!="undefined"?wx:typeof jd!="undefined"?jd:void 0,R=m!==void 0&&!!m.request&&!!m.login,Y=function(b,W){return typeof b=="string"&&typeof W=="string"&&b!=null&&W!=null&&b.substring(0,W.length)===W},O={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},ct=function(b){for(var W in O)if(O[W]===b)return W},lt=function(b,W,rt){var Z=Date.now(),ft=new e;try{if(!b||b.length<=75)return console.error("error format 1:",b),O.ERROR_DATA_FORMAT;if(!Y(b,"eyJ"))return console.error("error format 2:",b),O.ERROR_DATA_FORMAT;b=b.substring(3,b.length);var pt=Vr.my_b4_decode(b);if(!pt)return console.error("error format 3:",b),O.ERROR_DATA_FORMAT;var Ct,B=ft.cc.u8.byteToInt(pt.slice(0,4),0),$=pt.slice(4,4+B),K=ft.cc.u8.byteToInt(pt.slice(4+B,4+B+4),0),Q=pt.slice(4+B+4,4+B+4+K),z=ft.cc.u8.byteToInt(pt.slice(4+B+4+K,4+B+4+K+4),0),Dt=pt.slice(4+B+4+K+4,4+B+4+K+4+z),ot=ft.cc.u8.bytesToUtf8Str($);if(ft.cc.h6.encode(Q,0,K),W||(rt!==void 0&&rt==="sm2"?(Ct=ft.cc.h6.encode(Q,0,K),ft.co.c2.doVerifySignature(ot,Ct,u,{der:!0,hash:!0})):ft.co.c3(ot+"8890012345678890").toLowerCase()===ft.cc.h6.encode(Dt,0,z).toLowerCase())){if(ot.length%2==0){e.prototype.__v=function(){return ot.slice(0,2)};for(var Tt=[],Lt=2;Lt<66;Lt+=2)Tt.push(parseInt("0x"+ot.slice(Lt,Lt+2)));e.prototype.__i=function(){return Tt};var kt=parseInt("0x"+ot.slice(66,82))-Z;e.prototype.__o=function(){return kt}}return R||C.AAR2||(C.AAR2=e),O.SUCCESS}}catch(un){return console.error(un),O.ERROR_UNKNOWN_ERROR}return O.ERROR_SIGN_CHECK};return e.init=function(b,W){var rt,Z={debug:!1,url:"https://aks.jdpay.com/aar2/getJS",callback:function(){}};typeof b=="string"?(Y(b,"https")||Y(b,"https")?Z.url=b:Y(b,"eyJ")&&(Z.code=b),typeof W=="string"&&(Z.publicKey=W)):tt(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:rt=O.ALREADY_SUCCESS,errorMsg:ct(rt)}):c?setTimeout((function(){e.init(b,W)}),50):(c=!0,Z.debug&&Mn.start(Z.debug),Z.publicKey&&(u=Z.publicKey),Z.code?(rt=lt(Z.code,Z.skipVerify))===O.SUCCESS?(c=!(h=!0),Z.callback(!0,{errorNo:rt,errorMsg:ct(rt)})):Z.callback(!1,{errorNo:rt,errorMsg:ct(rt)}):Z.url&&(function(ft,pt,Ct){try{if(ft=ft+"?version="+e.VERSION+(R?"&name=wechat":"&name=browser")+"&t="+Date.now(),R)m.request({url:ft,method:"POST",header:{"content-type":"application/x-www-form-urlencoded"},success:function($){$.statusCode===200?pt($.data):Ct(O.ERROR_XXX_REQUEST_FAIL)},fail:function($){$&&$.errMsg&&$.errMsg.indexOf("timeout")!==-1?Ct(O.ERROR_XXX_REQUEST_TIMEOUT):Ct(O.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(K){}}B&&(B.onload=function(){B.readyState===4&&(B.status===200?pt(B.responseText):Ct(O.ERROR_XHR_ERROR))},B.ontimeout=function(){Ct(O.ERROR_XHR_TIMEOUT)},B.onerror=function(){Ct(O.ERROR_XHR_ERROR)},B.open("POST",ft,!0),B.timeout=5e3,B.send(null))}}catch($){console.error($),Ct(O.ERROR_UNKNOWN_ERROR)}})(Z.url,(function(ft){(ft=lt(ft,Z.skipVerify,Z.alg))===O.SUCCESS?(c=!(h=!0),Z.callback(!0,{errorNo:ft,errorMsg:ct(ft)})):(c=!1,Z.callback(!1,{errorNo:ft,errorMsg:ct(ft)}))}),(function(ft){c=!1,Z.callback(!1,{errorNo:ft,errorMsg:ct(ft)})})))},e.prototype={cc:{b4:jr,h6:Hr,u8:Gr},co:{c2:Kr,c3:Xr,c4:Wr,s2:Qr},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,W){return this.__s(b,W)},__s:function(b,W){var rt=this.cc.u8.utf8StrToBytes(b),Z=this.__i();return b=this.cc.u8.utf8StrToBytes(W),W=this.cc.u8.utf8StrToBytes(this.__c()),b=[].concat(rt,Z,b,W),W=parseInt("0x"+this.__v()),this.__f(W)(b)+this.__v()},__f:function(b){var W=this.co.s2,rt=this.co.c3,Z=this.cc.h6.decode,ft=[function(pt){return W(pt)},function(pt){return rt(pt)},function(pt){return rt(Z(W(pt)))},function(pt){return W(Z(rt(pt)))},function(pt){return rt(Z(rt(pt)))},function(pt){return W(Z(W(pt)))}];return ft[(128<b?b-128:b)%ft.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(m!==void 0&&m.env&&m.request&&m.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 Mn.isDebug()},version:function(){return e.VERSION}},e})()},ut(d)=="object"?l.exports=x():(T=typeof(P=x)=="function"?P.call(d,g,d,l):P)===void 0||(l.exports=T)}},n={};function a(l){var d=n[l];if(d!==void 0)return d.exports;var g=n[l]={id:l,loaded:!1,exports:{}};return t[l].call(g.exports,g,g.exports,a),g.loaded=!0,g.exports}a.n=l=>{var d=l&&l.__esModule?()=>l.default:()=>l;return a.d(d,{a:d}),d},a.d=(l,d)=>{for(var g in d)a.o(d,g)&&!a.o(l,g)&&Object.defineProperty(l,g,{enumerable:!0,get:d[g]})},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,d)=>Object.prototype.hasOwnProperty.call(l,d),a.r=l=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})};var f=a(737);nr.exports.LyyGetCommandSDK=f})()});var ei={};Qe(ei,{DyErrorCode:()=>he,DyErrorMessage:()=>it,ENV_TYPE:()=>Qt,EXTERNAL_ENV_TYPE:()=>de,JdErrorCode:()=>en,JdErrorMessage:()=>Nt,createServices:()=>Ur,getDisplayAdConfig:()=>On,getDyPayRtaData:()=>on,handleDyAuthDebitSignFlow:()=>Tn,handleDyAuthDebitSignFlowWithRawPayInfo:()=>Nn,handleDyJsapiPayFlow:()=>Rn,handleDyPayCommandFlow:()=>En,handleDyPayFlow:()=>rn,handleJdInsurance:()=>Dn,handleJdInsuranceExt:()=>In,handleJdjrCashLoanExt:()=>An,handleJdjrCashLoanFlow:()=>gn,normalizeDisplayAdData:()=>an});module.exports=oo(ei);var Qt={DEV:"dev",SIT:"sit",UAT:"uat",PROD:"prod"},de={SIT:"sit",RELEASE:"release",PROD:"prod"},ze={[Qt.DEV]:"https://dm.leyaoyao.com",[Qt.SIT]:"https://sm.leyaoyao.com",[Qt.UAT]:"https://um.leyaoyao.com",[Qt.PROD]:"https://m.leyaoyao.com"},Bn={[Qt.DEV]:"https://dad2.leyaoyao.com",[Qt.SIT]:"https://sad2.leyaoyao.com",[Qt.UAT]:"https://uad2.leyaoyao.com",[Qt.PROD]:"https://nad.ehuoke.com"},Fe={[de.SIT]:"https://sopenapi.leyaoyao.com",[de.RELEASE]:"https://uopen-api.leyaoyao.com",[de.PROD]:"https://api-gateway.leyaoyao.com"};function Ze(t,n){return`${ze[t]||ze[Qt.PROD]}${n}`}function Vn(t){return Bn[t]||Bn[Qt.PROD]}var we={debug:!1,env:Qt.PROD,externalEnv:de.PROD,apiDomain:""},jn=et({},we);function Hn(t){jn=et(et({},we),t)}function ie(){return jn}var io=Object.defineProperty,ao=(t,n,a)=>n in t?io(t,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[n]=a,so=(t,n,a)=>ao(t,typeof n!="symbol"?n+"":n,a);function ae(){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 uo=class{constructor(t=!1){so(this,"enable"),this.enable=t}setEnable(t){this.enable=t}info(...t){this.enable&&console.info("[BI Info]",...t)}warn(...t){this.enable&&console.warn("[BI Warn]",...t)}error(...t){this.enable&&console.error("[BI Error]",...t)}debug(...t){this.enable&&console.log("[BI Debug]",...t)}},E=new uo;function Ye(t){let n=ae();return n==="taro"?Taro.setClipboardData({data:t}).then(()=>{E.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")}):n==="uni"?new Promise((a,f)=>{uni.setClipboardData({data:t,success:()=>{E.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),a()},fail:l=>{E.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",l),f(l)}})}):n==="wechat"?new Promise((a,f)=>{wx.setClipboardData({data:t,success:()=>{E.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),a()},fail:l=>{E.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",l),f(l)}})}):n==="alipay"?new Promise((a,f)=>{my.setClipboardData({text:t,success:()=>{E.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F"),a()},fail:l=>{E.error("\u590D\u5236\u5230\u526A\u8D34\u677F\u5931\u8D25",l),f(l)}})}):navigator.clipboard.writeText(t).then(()=>{E.info("\u590D\u5236\u5230\u526A\u8D34\u677F\u6210\u529F")})}function _n(t,n=2e3){let a=ae();if(a==="taro"){Taro.showToast({title:t,icon:"none",mask:!0,duration:n});return}if(a==="uni"){uni.showToast({title:t,icon:"none",mask:!0,duration:n});return}if(a==="wechat"){wx.showToast({title:t,icon:"none",mask:!0,duration:n});return}if(a==="alipay"){my.showToast({content:t,duration:n});return}typeof console!="undefined"&&console.log(`[Toast] ${t}`)}async function Pe(){var t,n,a,f,l;let d=ae();try{if(d==="taro")return((t=(await Taro.getSystemInfo()).platform)==null?void 0:t.toLowerCase())==="ios"?"ios":"android";if(d==="uni")return((n=uni.getSystemInfoSync().platform)==null?void 0:n.toLowerCase())==="ios"?"ios":"android";if(d==="wechat")return wx.getDeviceInfo?((a=(await wx.getDeviceInfo()).platform)==null?void 0:a.toLowerCase())==="ios"?"ios":"android":((f=wx.getSystemInfoSync().platform)==null?void 0:f.toLowerCase())==="ios"?"ios":"android";if(d==="alipay")return((l=my.getSystemInfoSync().platform)==null?void 0:l.toLowerCase())==="ios"?"ios":"android";if(typeof navigator!="undefined"){let g=navigator.userAgent.toLowerCase();if(/iphone|ipad|ipod/.test(g))return"ios";if(/android/.test(g))return"android"}return"unknown"}catch(g){return E.error("\u83B7\u53D6\u5E73\u53F0\u4FE1\u606F\u5931\u8D25",g),"unknown"}}var Yt={SUCCESS:0,UNKNOWN_ERROR:1e3,NETWORK_ERROR:1001,PARSE_ERROR:1002,INVALID_PARAM:1003};function U(t,n,a=null){return{code:t,message:n,data:a}}function tn(t,n){return t==null?{valid:!1,message:`${n}\u4E0D\u80FD\u4E3A\u7A7A`}:typeof t=="string"&&t.trim().length===0?{valid:!1,message:`${n}\u4E0D\u80FD\u4E3A\u7A7A`}:{valid:!0}}function Le(t,n){for(let a of n){let f=tn(t[a],a);if(!f.valid)return f}return{valid:!0}}var Pn={};Qe(Pn,{handleJdInsurance:()=>Dn,handleJdInsuranceExt:()=>In,handleJdjrCashLoanExt:()=>An,handleJdjrCashLoanFlow:()=>gn});var en=(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))(en||{}),Nt={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"},he=(w=>(w[w.DY_PAY__MISSING_PHONE=3001]="DY_PAY__MISSING_PHONE",w[w.DY_PAY__MISSING_DEVICE_ID=3002]="DY_PAY__MISSING_DEVICE_ID",w[w.DY_PAY__MISSING_PRICE=3003]="DY_PAY__MISSING_PRICE",w[w.DY_PAY__INVALID_CLIENT=3004]="DY_PAY__INVALID_CLIENT",w[w.DY_PAY__INVALID_EXTEND_PARAMS=3005]="DY_PAY__INVALID_EXTEND_PARAMS",w[w.DY_PAY__ORDER_AMOUNT_FAILED=3006]="DY_PAY__ORDER_AMOUNT_FAILED",w[w.DY_PAY__REQUEST_ORDER_AMOUNT_FAILED=3007]="DY_PAY__REQUEST_ORDER_AMOUNT_FAILED",w[w.DY_PAY__UNIFIED_ORDER_FAILED=3008]="DY_PAY__UNIFIED_ORDER_FAILED",w[w.DY_PAY__REQUEST_UNIFIED_ORDER_FAILED=3009]="DY_PAY__REQUEST_UNIFIED_ORDER_FAILED",w[w.DY_PAY__NO_H5_URL=3010]="DY_PAY__NO_H5_URL",w[w.DY_PAY__NETWORK_ERROR=3011]="DY_PAY__NETWORK_ERROR",w[w.DY_PAY__FLOW_ERROR=3012]="DY_PAY__FLOW_ERROR",w[w.DY_PAY__RTA_FAILED=3013]="DY_PAY__RTA_FAILED",w[w.DY_PAY__REQUEST_RTA_FAILED=3014]="DY_PAY__REQUEST_RTA_FAILED",w[w.DY_PAY__RTA_ERROR=3015]="DY_PAY__RTA_ERROR",w[w.DY_PAY__INVALID_BACK_WAY=3016]="DY_PAY__INVALID_BACK_WAY",w[w.DY_PAY__MISSING_BUSINESS_TYPE=3017]="DY_PAY__MISSING_BUSINESS_TYPE",w[w.DY_PAY__INVALID_RETURN_TYPE=3018]="DY_PAY__INVALID_RETURN_TYPE",w[w.DY_PAY__JSAPI_INFO_FAILED=3019]="DY_PAY__JSAPI_INFO_FAILED",w[w.DY_PAY__REQUEST_JSAPI_INFO_FAILED=3020]="DY_PAY__REQUEST_JSAPI_INFO_FAILED",w[w.DY_PAY__MISSING_JSAPI_PAY_INFO=3021]="DY_PAY__MISSING_JSAPI_PAY_INFO",w[w.DY_PAY__INVALID_JSAPI_PAY_INFO=3022]="DY_PAY__INVALID_JSAPI_PAY_INFO",w[w.DY_PAY__JSAPI_SIGNATURE_FAILED=3023]="DY_PAY__JSAPI_SIGNATURE_FAILED",w[w.DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED=3024]="DY_PAY__REQUEST_JSAPI_SIGNATURE_FAILED",w[w.DY_PAY__JSAPI_UNSUPPORTED_ENV=3025]="DY_PAY__JSAPI_UNSUPPORTED_ENV",w[w.DY_PAY__JSAPI_AUTH_REDIRECT_FAILED=3026]="DY_PAY__JSAPI_AUTH_REDIRECT_FAILED",w[w.DY_PAY__JSAPI_SDK_LOAD_FAILED=3027]="DY_PAY__JSAPI_SDK_LOAD_FAILED",w[w.DY_PAY__JSAPI_CONFIG_FAILED=3028]="DY_PAY__JSAPI_CONFIG_FAILED",w[w.DY_PAY__JSAPI_INVOKE_FAILED=3029]="DY_PAY__JSAPI_INVOKE_FAILED",w[w.DY_PAY__MISSING_AUTH_TOKEN=3030]="DY_PAY__MISSING_AUTH_TOKEN",w[w.DY_PAY_COMMAND__MISSING_ORDER_AMOUNT=3031]="DY_PAY_COMMAND__MISSING_ORDER_AMOUNT",w[w.DY_PAY_COMMAND__GET_FAILED=3032]="DY_PAY_COMMAND__GET_FAILED",w[w.DY_PAY_COMMAND__REQUEST_FAILED=3033]="DY_PAY_COMMAND__REQUEST_FAILED",w[w.DY_PAY_COMMAND__COPY_FAILED=3034]="DY_PAY_COMMAND__COPY_FAILED",w[w.DY_PAY_COMMAND__INVALID_RTA_DATA=3035]="DY_PAY_COMMAND__INVALID_RTA_DATA",w[w.DY_PAY__MISSING_AUTH_DEBIT_SIGN_REQUEST_ID=3036]="DY_PAY__MISSING_AUTH_DEBIT_SIGN_REQUEST_ID",w[w.DY_PAY__AUTH_DEBIT_SIGN_FAILED=3037]="DY_PAY__AUTH_DEBIT_SIGN_FAILED",w[w.DY_PAY__REQUEST_AUTH_DEBIT_SIGN_FAILED=3038]="DY_PAY__REQUEST_AUTH_DEBIT_SIGN_FAILED",w[w.DY_PAY__JSAPI_PAY_CANCELLED=3039]="DY_PAY__JSAPI_PAY_CANCELLED",w))(he||{}),it={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",3036:"\u7F3A\u5C11\u6388\u6743\u4EE3\u6263\u7B7E\u7EA6requestId",3037:"\u6388\u6743\u4EE3\u6263\u7B7E\u7EA6\u5931\u8D25",3038:"\u6388\u6743\u4EE3\u6263\u7B7E\u7EA6\u8BF7\u6C42\u5931\u8D25",3039:"\u7528\u6237\u53D6\u6D88\u6296\u97F3\u652F\u4ED8"};var co=(t,n,a,f)=>{let l=ae();if(l==="taro")return Taro.request({url:t,method:n,data:a,header:f}).then(P=>P);if(l==="uni")return new Promise((P,T)=>{uni.request({url:t,method:n,data:a,header:f,success:x=>P(x),fail:x=>T(x)})});if(l==="wechat")return new Promise((P,T)=>{wx.request({url:t,method:n,data:a,header:f,success:x=>P(x),fail:x=>T(x)})});if(l==="alipay")return new Promise((P,T)=>{my.request({url:t,method:n,data:a,headers:f,success:x=>P(x),fail:x=>T(x)})});let d=n.toUpperCase()==="GET",g=d&&a&&Object.keys(a).length?`${t}?${new URLSearchParams(a).toString()}`:t;return fetch(g,{method:n,headers:f,body:d?void 0:JSON.stringify(a)}).then(async P=>({statusCode:P.status,data:await P.json()}))},yn=class{constructor(n=null){$e(this,"staticConfig");this.staticConfig=n}getCurrentConfig(){return this.staticConfig||ie()||we}async getAuthToken(){let n=this.getCurrentConfig();if(n.getAuthToken&&typeof n.getAuthToken=="function")try{let a=await n.getAuthToken();return a?(E.debug("\u6210\u529F\u83B7\u53D6\u8BA4\u8BC1Token"),a):(E.warn("getAuthToken\u8FD4\u56DE\u4E86\u7A7A\u503C"),null)}catch(a){return E.error("\u83B7\u53D6Token\u5931\u8D25",a),null}return null}async buildHeader(n={},a=!0){let f=et({"content-type":"application/json"},n);if(!a)return f;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 f.Authorization_bar=l,f}async request(n){let{path:a,method:f="POST",data:l={},header:d={},authRequired:g=!0,baseDomain:P,beforeRequest:T,afterResponse:x}=n,ut=P?`${P}${a}`:Ze(this.getCurrentConfig().env||"prod",a),tt=await this.buildHeader(d,g);T&&typeof T=="function"&&await T({url:ut,method:f,data:l,header:tt}),E.info(`\u53D1\u8D77${f}\u8BF7\u6C42:`,{path:a,method:f});try{let G=await co(ut,f,l,tt);return E.info("\u8BF7\u6C42\u6210\u529F:",{path:a,statusCode:G.statusCode}),x&&typeof x=="function"&&await x(G.data),G.data}catch(G){throw E.error("\u8BF7\u6C42\u5931\u8D25:",{path:a,error:G}),G}}get(n,a={},f={}){return this.request(et({path:n,method:"GET",data:a},f))}post(n,a={},f={}){return this.request(et({path:n,method:"POST",data:a},f))}},be=(t=null)=>new yn(t);var lo=(function(){"use strict";function t(S,nt){var mt=(65535&S)+(65535&nt);return(S>>16)+(nt>>16)+(mt>>16)<<16|65535&mt}function n(S,nt,mt,st,H,wt){return t((wt=t(t(nt,S),t(st,wt)))<<H|wt>>>32-H,mt)}function a(S,nt,mt,st,H,wt,N){return n(nt&mt|~nt&st,S,nt,H,wt,N)}function f(S,nt,mt,st,H,wt,N){return n(nt&st|mt&~st,S,nt,H,wt,N)}function l(S,nt,mt,st,H,wt,N){return n(nt^mt^st,S,nt,H,wt,N)}function d(S,nt,mt,st,H,wt,N){return n(mt^(nt|~st),S,nt,H,wt,N)}function g(S,nt){var mt,st,H,wt;S[nt>>5]|=128<<nt%32,S[14+(nt+64>>>9<<4)]=nt;for(var N=1732584193,C=-271733879,L=-1732584194,F=271733878,D=0;D<S.length;D+=16)N=a(mt=N,st=C,H=L,wt=F,S[D],7,-680876936),F=a(F,N,C,L,S[D+1],12,-389564586),L=a(L,F,N,C,S[D+2],17,606105819),C=a(C,L,F,N,S[D+3],22,-1044525330),N=a(N,C,L,F,S[D+4],7,-176418897),F=a(F,N,C,L,S[D+5],12,1200080426),L=a(L,F,N,C,S[D+6],17,-1473231341),C=a(C,L,F,N,S[D+7],22,-45705983),N=a(N,C,L,F,S[D+8],7,1770035416),F=a(F,N,C,L,S[D+9],12,-1958414417),L=a(L,F,N,C,S[D+10],17,-42063),C=a(C,L,F,N,S[D+11],22,-1990404162),N=a(N,C,L,F,S[D+12],7,1804603682),F=a(F,N,C,L,S[D+13],12,-40341101),L=a(L,F,N,C,S[D+14],17,-1502002290),N=f(N,C=a(C,L,F,N,S[D+15],22,1236535329),L,F,S[D+1],5,-165796510),F=f(F,N,C,L,S[D+6],9,-1069501632),L=f(L,F,N,C,S[D+11],14,643717713),C=f(C,L,F,N,S[D],20,-373897302),N=f(N,C,L,F,S[D+5],5,-701558691),F=f(F,N,C,L,S[D+10],9,38016083),L=f(L,F,N,C,S[D+15],14,-660478335),C=f(C,L,F,N,S[D+4],20,-405537848),N=f(N,C,L,F,S[D+9],5,568446438),F=f(F,N,C,L,S[D+14],9,-1019803690),L=f(L,F,N,C,S[D+3],14,-187363961),C=f(C,L,F,N,S[D+8],20,1163531501),N=f(N,C,L,F,S[D+13],5,-1444681467),F=f(F,N,C,L,S[D+2],9,-51403784),L=f(L,F,N,C,S[D+7],14,1735328473),N=l(N,C=f(C,L,F,N,S[D+12],20,-1926607734),L,F,S[D+5],4,-378558),F=l(F,N,C,L,S[D+8],11,-2022574463),L=l(L,F,N,C,S[D+11],16,1839030562),C=l(C,L,F,N,S[D+14],23,-35309556),N=l(N,C,L,F,S[D+1],4,-1530992060),F=l(F,N,C,L,S[D+4],11,1272893353),L=l(L,F,N,C,S[D+7],16,-155497632),C=l(C,L,F,N,S[D+10],23,-1094730640),N=l(N,C,L,F,S[D+13],4,681279174),F=l(F,N,C,L,S[D],11,-358537222),L=l(L,F,N,C,S[D+3],16,-722521979),C=l(C,L,F,N,S[D+6],23,76029189),N=l(N,C,L,F,S[D+9],4,-640364487),F=l(F,N,C,L,S[D+12],11,-421815835),L=l(L,F,N,C,S[D+15],16,530742520),N=d(N,C=l(C,L,F,N,S[D+2],23,-995338651),L,F,S[D],6,-198630844),F=d(F,N,C,L,S[D+7],10,1126891415),L=d(L,F,N,C,S[D+14],15,-1416354905),C=d(C,L,F,N,S[D+5],21,-57434055),N=d(N,C,L,F,S[D+12],6,1700485571),F=d(F,N,C,L,S[D+3],10,-1894986606),L=d(L,F,N,C,S[D+10],15,-1051523),C=d(C,L,F,N,S[D+1],21,-2054922799),N=d(N,C,L,F,S[D+8],6,1873313359),F=d(F,N,C,L,S[D+15],10,-30611744),L=d(L,F,N,C,S[D+6],15,-1560198380),C=d(C,L,F,N,S[D+13],21,1309151649),N=d(N,C,L,F,S[D+4],6,-145523070),F=d(F,N,C,L,S[D+11],10,-1120210379),L=d(L,F,N,C,S[D+2],15,718787259),C=d(C,L,F,N,S[D+9],21,-343485551),N=t(N,mt),C=t(C,st),L=t(L,H),F=t(F,wt);return[N,C,L,F]}function P(S){for(var nt="",mt=32*S.length,st=0;st<mt;st+=8)nt+=String.fromCharCode(S[st>>5]>>>st%32&255);return nt}function T(S){var nt=[];for(nt[(S.length>>2)-1]=void 0,st=0;st<nt.length;st+=1)nt[st]=0;for(var mt=8*S.length,st=0;st<mt;st+=8)nt[st>>5]|=(255&S.charCodeAt(st/8))<<st%32;return nt}function x(S){for(var nt,mt="0123456789abcdef",st="",H=0;H<S.length;H+=1)nt=S.charCodeAt(H),st+=mt.charAt(nt>>>4&15)+mt.charAt(15&nt);return st}function ut(S){return unescape(encodeURIComponent(S))}function tt(S){return P(g(T(S=ut(S)),8*S.length))}function G(S,nt){return(function(mt,st){var H,wt=T(mt),N=[],C=[];for(N[15]=C[15]=void 0,16<wt.length&&(wt=g(wt,8*mt.length)),H=0;H<16;H+=1)N[H]=909522486^wt[H],C[H]=1549556828^wt[H];return st=g(N.concat(T(st)),512+8*st.length),P(g(C.concat(st),640))})(ut(S),ut(nt))}function Ot(S,nt,mt){return nt?mt?G(nt,S):x(G(nt,S)):mt?tt(S):x(tt(S))}return Ot})(),xe=lo;function Gn(){return Math.random().toString(36).slice(2)+Date.now().toString(36)}function Kn(t){if(typeof t!="object"||t===null)return t;let n=Object.keys(t).sort(),a={};for(let f of n)a[f]=t[f];return JSON.stringify(a)}function Xn(t,n){let a={appId:t.appId,randomStr:t.randomStr,data:t.data},f=Object.keys(a).sort(),l="";for(let[d,g]of f.entries())l+=`${g}=${a[g]}`,d<f.length-1&&(l+="&");return l+=`&secretKey=${n}`,xe(l)}var fo=(t,n,a,f)=>{let l=ae();return l==="taro"?Taro.request({url:t,method:n,data:a,header:f}).then(d=>d):l==="uni"?new Promise((d,g)=>{uni.request({url:t,method:n,data:a,header:f,success:P=>d(P),fail:P=>g(P)})}):l==="wechat"?new Promise((d,g)=>{wx.request({url:t,method:n,data:a,header:f,success:P=>d(P),fail:P=>g(P)})}):l==="alipay"?new Promise((d,g)=>{my.request({url:t,method:n,data:a,headers:f,success:P=>d(P),fail:P=>g(P)})}):fetch(t,{method:n,headers:f,body:JSON.stringify(a)}).then(async d=>({statusCode:d.status,data:await d.json()}))},pn=class{constructor(n=null){$e(this,"staticConfig");this.staticConfig=n}getCurrentConfig(){return this.staticConfig||ie()||{}}getExternalEnv(){var n;return((n=this.getCurrentConfig())==null?void 0:n.externalEnv)||de.PROD}getExternalHost(){let n=this.getExternalEnv();return Fe[n]||Fe.prod}generateSign(n={}){let a=this.getCurrentConfig(),{externalAppId:f,externalAppSecret:l}=a;if(!f||!l)throw new Error("\u8BF7\u5728 init \u65F6\u914D\u7F6E externalAppId \u548C externalAppSecret");let d=Gn(),g=Kn(n),P=Xn({appId:f,randomStr:d,data:g},l);return{appId:f,randomStr:d,sign:P}}buildRequestBody(n={}){let a=this.generateSign(n);return zt(et({},a),{data:n})}buildUrl(n){return`${this.getExternalHost()}${n}`}async request(n){let{path:a,method:f="POST",data:l={},header:d={},needSign:g=!0,beforeRequest:P,afterResponse:T}=n,x=this.buildUrl(a),ut=et({"content-type":"application/json"},d),tt=g?this.buildRequestBody(l):l;P&&typeof P=="function"&&await P({url:x,method:f,data:tt,header:ut}),E.info(`\u53D1\u8D77${f}\u8BF7\u6C42:`,{path:a,method:f});try{let G=await fo(x,f,tt,ut);if(E.info("\u8BF7\u6C42\u6210\u529F:",{path:a,statusCode:G.statusCode}),T&&typeof T=="function"&&await T(G.data),G.statusCode===200&&G.data.code===200)return G.data.data;throw{code:G.data.code,msg:G.data.data||"\u8BF7\u6C42\u4E1A\u52A1\u5F02\u5E38",original:G.data}}catch(G){throw(G==null?void 0:G.code)!==void 0?G:(E.error("\u8BF7\u6C42\u5931\u8D25:",{path:a,error:G}),{msg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:G})}}get(n,a={},f={}){return this.request(et({path:n,method:"GET",data:a},f))}post(n,a={},f={}){return this.request(et({path:n,method:"POST",data:a},f))}},Wn=(t=null)=>new pn(t);var hn=be(),mn=Wn();function Qn(t){let n=tn(t==null?void 0:t.equipmentValue,"equipmentValue");return n.valid?hn.post("/gw/advert/customer/cpa-activity/jd/insurance/get-activity-url/v3",t):Promise.reject({code:"PARAM_ERROR",message:n.message})}async function $n(t){let n=Le(t,["idMd5Value","rtaStrategy"]);return n.valid?mn.post("/open/rest/cpa/jd/rta-check",t):Promise.reject({code:"PARAM_ERROR",message:n.message})}async function zn(t){try{let n={thirdPlatform:t.thirdPlatform,thirdPlatformUserId:t.thirdPlatformUserId,thirdPlatformEquipmentValue:t.thirdPlatformEquipmentValue,os:t.os,client:"wxMini"};t.phone&&(n.mobileMd5=xe(t.phone)),t.extendData&&(Object.prototype.toString.call(t.extendData)==="[object Object]"?n.extendData=t.extendData:E.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61"));let a=await mn.post("/open/rest/cpa/jd/insurance/get",n);return a?{jumpMode:Number(a.jumpMode),appId:a.appId,url:a.url,channel:a.channelId}:void 0}catch(n){throw E.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25:",n),n}}function Zn(t){let n=tn(t==null?void 0:t.equipmentValue,"equipmentValue");return n.valid?hn.post("/gw/advert/customer/cpa-activity/jd/cash-loan/get-activity-url",t):Promise.reject({code:"PARAM_ERROR",message:n.message})}function tr(t){let n=Le(t,["lyyUserId","lyyEquipmentValue","rtaId","phone"]);return n.valid?hn.post("/gw/advert/customer/cpa-activity/jd/rta/validate",t):Promise.reject({code:"PARAM_ERROR",message:n.message})}async function er(t){let n=await Pe(),a={thirdPlatform:t.thirdPlatform,thirdPlatformUserId:t.thirdPlatformUserId,thirdPlatformEquipmentValue:t.thirdPlatformEquipmentValue,os:n,client:t.client};return t.phone&&(a.mobileMd5=xe(t.phone)),t.extendData&&(Object.prototype.toString.call(t.extendData)==="[object Object]"?a.extendData=t.extendData:E.error("extendData\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u5E94\u4F20\u5165\u5BF9\u8C61")),mn.post("/open/rest/cpa/jd/cash-loan/get",a)}async function gn(t){let{phone:n,rtaId:a,equipmentId:f,lyyUserId:l,entrance:d}=t;if(!n)return U(Yt.INVALID_PARAM,Nt[2001]);if(!f)return U(Yt.INVALID_PARAM,Nt[2002]);try{if(a){E.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:n});let tt=await tr({phone:n,lyyEquipmentValue:f,lyyUserId:l||"",rtaId:a});if(tt.code!=="0000000"||!tt.body||tt.body.state!=1)return E.error("RTA\u9A8C\u8BC1\u5931\u8D25",tt),U(2003,Nt[2003]);E.info("RTA\u9A8C\u8BC1\u6210\u529F",tt.body)}E.info("\u83B7\u53D6\u8DF3\u8F6C\u914D\u7F6E",{phone:n});let g=await Pe(),P=await Zn({phone:n,equipmentValue:f,os:g,entrance:d});if(P.code!=="0000000"||!P.body)return E.error("\u83B7\u53D6\u8DF3\u8F6C\u94FE\u63A5\u5931\u8D25",P),U(2004,Nt[2004]);let{appId:T,targetUrl:x}=P.body;if(!T||!x)return E.error("\u8DF3\u8F6C\u94FE\u63A5\u53C2\u6570\u4E0D\u5B8C\u6574",{appId:T,targetUrl:x}),U(2005,Nt[2005]);let ut=U(Yt.SUCCESS,"\u6210\u529F",{appId:T,targetUrl:x});return E.info("\u83B7\u53D6\u8DF3\u8F6C\u4FE1\u606F\u6210\u529F",ut),ut}catch(g){return E.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u6D41\u7A0B\u5931\u8D25",g),U(Yt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}async function An(t){let{phone:n,rtaId:a,thirdPlatform:f,thirdPlatformUserId:l,thirdPlatformEquipmentValue:d}=t;if(!n)return U(Yt.INVALID_PARAM,Nt[2001]);if(!f)return U(2008,Nt[2008]);if(!l)return U(2009,Nt[2009]);if(!d)return U(2010,Nt[2010]);try{if(a){E.info("\u5F00\u59CBRTA\u9A8C\u8BC1",{phone:n});let G=await $n({idMd5Value:n,rtaStrategy:a});if(G.status!=1)return E.error("RTA\u9A8C\u8BC1\u5931\u8D25",G),U(2003,Nt[2003]);E.info("RTA\u9A8C\u8BC1\u6210\u529F",G)}let g=await er(t),{url:P,channelId:T,matchFlag:x,jumpMode:ut,appId:tt}=g||{};return x?ut===3?!tt||!P?U(2007,Nt[2007]):U(Yt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:tt,url:P}):U(2007,Nt[2007]):U(2006,Nt[2006])}catch(g){return E.error("\u4EAC\u4E1C\u91D1\u878D\u73B0\u91D1\u8D37\u5BF9\u5916\u6D41\u7A0B\u5931\u8D25",g),U(Yt.NETWORK_ERROR,"\u6D41\u7A0B\u5904\u7406\u5931\u8D25")}}var Ce=null,Ue=null;try{Ue=rr()}catch(t){}function or(){return Ce||(typeof globalThis!="undefined"&&globalThis.LyyGetCommandSDK?(Ce=globalThis.LyyGetCommandSDK,Ce):Ue?(Ce=Ue.LyyGetCommandSDK||Ue.default||Ue,Ce):null)}function ir(t){var a;E.debug("getJdCommandSdk \u88AB\u8C03\u7528\uFF0C\u53C2\u6570:",t);let n=or();n!=null&&n.getJrCommand?n.getJrCommand(t):(a=n==null?void 0:n.default)!=null&&a.getJrCommand?n.default.getJrCommand(t):(E.error("\u4EAC\u4E1CSDK\u672A\u6CE8\u5165"),t.callback({code:"-1",message:"SDK\u672A\u6CE8\u5165"}))}function _o(t,n){return new Promise((a,f)=>{try{ir({url:t,channel:n,callback:l=>{l.code==="0"?a(l.data):f({msg:l.msg||"SDK\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25"})}})}catch(l){f(l)}})}async function Dn(t){try{let n=await Pe(),a=et({os:n},t);E.info("\u5F00\u59CB\u5904\u7406\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1",a);let{code:f,body:l}=await Qn(a);if(f==="0000000"&&l){let{url:d,channelId:g,matchFlag:P,jumpMode:T,appId:x}=l;if(!P)return U(2101,Nt[2101]);if(T===1)return E.info("H5\u6A21\u5F0F\uFF0C\u6682\u4E0D\u5904\u7406"),U(2102,Nt[2102]);if(T===2)return ae()==="web"&&E.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:d}),!d||!g?U(2103,Nt[2103]):new Promise(ut=>{ir({url:d,channel:g,callback:async tt=>{if((tt==null?void 0:tt.code)==="0")try{await Ye(tt==null?void 0:tt.data),ut(U(Yt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"}))}catch(G){ut(U(2105,Nt[2105]))}else ut(U(2105,Nt[2105]))}})});if(T===3)return!x||!d?U(2103,Nt[2103]):U(Yt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:x,path:d})}return U(2104,Nt[2104])}catch(n){return E.error("\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38",n),U(Yt.NETWORK_ERROR,"\u4EAC\u4E1C\u4FDD\u9669\u670D\u52A1\u5F02\u5E38\uFF0C\u8BF7\u91CD\u8BD5")}}async function In(t){E.info("\u5F00\u59CB\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4...");try{let n=await zn(zt(et({},t),{os:await Pe()}));if(!n)return E.warn("\u65E0\u53EF\u7528\u8DF3\u8F6C\u914D\u7F6E\uFF0C\u7528\u6237\u53EF\u80FD\u5DF2\u5B8C\u6210\u4EFB\u52A1"),U(2106,Nt[2106]);let{jumpMode:a,appId:f,url:l,channel:d}=n;if(a===1)return l?(E.info("H5\u8DF3\u8F6C\u6A21\u5F0F",{url:l}),U(Yt.SUCCESS,"\u6210\u529F",{type:"h5",url:l})):(E.error("H5\u8DF3\u8F6C\u53C2\u6570\u4E0D\u5B8C\u6574:",{jumpMode:a,url:l}),U(2103,Nt[2103]));if(a===3)return!f||!l?(E.error("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u53C2\u6570\u4E0D\u5B8C\u6574:",{jumpMode:a,appId:f,url:l}),U(2103,Nt[2103])):(E.info("\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u6A21\u5F0F",{jumpMode:a,appId:f,url:l}),U(Yt.SUCCESS,"\u6210\u529F",{type:"mini_program",appId:f,path:l}));if(a===2){if(ae()==="web")return E.info("H5\u73AF\u5883\u53E3\u4EE4\u6A21\u5F0F\uFF0C\u8FD4\u56DEurl\u7531\u5BBF\u4E3B\u8DF3\u8F6C",{url:l}),U(Yt.SUCCESS,"\u6210\u529F",{type:"h5",url:l});try{let g=await _o(l,d);return await Ye(g),E.info("\u4EAC\u4E1C\u53E3\u4EE4\u5DF2\u81EA\u52A8\u590D\u5236"),U(Yt.SUCCESS,"\u53E3\u4EE4\u5DF2\u590D\u5236",{type:"copy_success"})}catch(g){return E.error("\u590D\u5236\u53E3\u4EE4\u5931\u8D25:",g),_n("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),U(2105,Nt[2105])}}return E.error("\u672A\u77E5\u7684\u8DF3\u8F6C\u6A21\u5F0F:",a),U(2107,Nt[2107])}catch(n){let a=typeof n=="string"?n:(n==null?void 0:n.msg)||(n==null?void 0:n.message)||"\u672A\u77E5\u9519\u8BEF";return E.error("\u83B7\u53D6\u4EAC\u4E1C\u53E3\u4EE4\u5931\u8D25:",a),_n("\u83B7\u53D6\u53E3\u4EE4\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),a.includes("RTA")||a.includes("\u8D44\u683C")?U(2108,Nt[2108]):U(Yt.NETWORK_ERROR,a)}}var wn={};Qe(wn,{DyErrorCode:()=>he,getDyPayRtaData:()=>on,handleDyAuthDebitSignFlow:()=>Tn,handleDyAuthDebitSignFlowWithRawPayInfo:()=>Nn,handleDyJsapiPayFlow:()=>Rn,handleDyPayCommandFlow:()=>En,handleDyPayFlow:()=>rn});var yo=["weapp","h5"],po=["h5","ulink","jsapi"],ho=["switchTab","reLaunch","redirectTo","navigateTo"];function mo(t){return yo.includes(t)}function go(t){return po.includes(t)}function Ao(t){return ho.includes(t)}function ar(t){let n=t.returnType||"h5";return!t.telephone&&n==="h5"?{valid:!1,errorCode:3001}:t.price?t.equipmentValue?t.businessType?t.client&&!mo(t.client)?{valid:!1,errorCode:3004}:go(n)?t.douyinOrderExtendData&&typeof t.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:t.backWay&&t.client==="weapp"&&!Ao(t.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 sr(t){return t.price?t.equipmentValue?t.businessType?t.douyinOrderExtendData&&typeof t.douyinOrderExtendData!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3002}:{valid:!1,errorCode:3003}}function ur(t){return t.equipmentValue?{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}function cr(t){return t.equipmentValue?t.orderAmount?t.businessType?t.commandUrl!=null&&typeof t.commandUrl!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3017}:{valid:!1,errorCode:3031}:{valid:!1,errorCode:3002}}function lr(t){return t.equipmentValue?t.commandUrl!=null&&typeof t.commandUrl!="string"?{valid:!1,errorCode:3005}:{valid:!0,errorCode:0}:{valid:!1,errorCode:3002}}function fr(t){return t.showFlag===!0&&typeof t.payAmount=="number"&&t.payAmount>0&&typeof t.businessType=="number"&&t.businessType>0}var ve=be();async function dr(t){let{price:n,equipmentValue:a,douyinOrderExtendData:f,douyinCommodityVirtualFlag:l,businessType:d,platformActivities:g={}}=t,P={businessType:d,equipmentValue:a,payInfoBusinessType:"commonDouyinPayment",platformActivities:et({douyinCommodityVirtualFlag:l||!1,douyinCommodityPrice:n,douyinOrderExtendData:f||""},g)};try{let T=await ve.post("/gw/advert/customer/payment/pay-info",P);return T.code!=="0000000"||!(T!=null&&T.body)?Promise.reject({code:3006,message:T.message||it[3006]}):(T.body.platformActivities=P.platformActivities,T)}catch(T){return E.error("getDyOrderAmountFn error:",T),Promise.reject({code:3007,message:it[3007]})}}async function _r(t){var n,a,f,l;try{let d=t.commodityList.map(Ot=>(Ot.commodity=Ot.commodityId,delete Ot.commodityId,Ot.quantity=Ot.quantity||1,Ot)),g=t.advertExtendInfo&&Object.keys(t.advertExtendInfo).length>0?JSON.stringify({advertExtendInfo:t.advertExtendInfo}):"",P=ae(),T="";P==="wechat"?T="wechatMini":P==="web"&&navigator.userAgent.toLowerCase().includes("micromessenger")&&(T="wechatHtml");let x=t.returnType==="jsapi",ut=x?22:21,tt=et(et(et({businessType:t.businessType,fixedClientType:ut,channelCode:null,douyinData:et(et({loginMobile:t.telephone||""},((n=t.jsapiInfo)==null?void 0:n.outProductCategory)!=null?{outProductCategory:t.jsapiInfo.outProductCategory}:{}),((a=t.jsapiInfo)==null?void 0:a.requestId)!=null?{requestId:t.jsapiInfo.requestId}:{}),equipmentUseFlag:!1,payEquipmentDTO:{equipmentValue:t.equipmentValue,checkOnline:!1,isThirdEquipment:!1},extendInfo:g,transType:5,actualFee:t.totalFee,totalFee:t.totalFee,commodityList:d,clientSourceDetailType:T,platformActivities:t.platformActivities||{}},t.commoditySign&&{commoditySign:t.commoditySign}),t.unifiedOrderExtendData&&et({},t.unifiedOrderExtendData)),x?{appId:((f=t.jsapiInfo)==null?void 0:f.appId)||"",openId:((l=t.jsapiInfo)==null?void 0:l.douyinOpenId)||""}:{});if(t.returnType=="ulink")return delete tt.channelCode,tt;let G=await ve.post("/gw/payment-bff/unified/order",tt);return G.code!=="0000000"||!(G!=null&&G.body)?Promise.reject({code:3008,message:G.message||it[3008]}):G}catch(d){return E.error("dyUnifiedOrderFn error:",d),Promise.reject({code:3009,message:it[3009]})}}async function yr(t){let n={equipmentValue:t.equipmentValue,phone:t.telephone||""};t.price&&(n.orderAmount=t.price);try{let a=await ve.post("/gw/advert/customer/douyin/pay/check",n);return a.code!=="0000000"||!(a!=null&&a.body)?Promise.reject({code:3013,message:a.message||it[3013]}):a}catch(a){return E.error("getDyPayRtaData error:",a),Promise.reject({code:3014,message:(a==null?void 0:a.message)||it[3014]})}}async function pr(t={}){var n;try{let a=(n=t.requestNo)==null?void 0:n.trim(),f=a?`/gw/advert/customer/douyin/pay/jsapi/info?requestNo=${a}`:"/gw/advert/customer/douyin/pay/jsapi/info",l=await ve.get(f);return l.code!=="0000000"||!(l!=null&&l.body)?Promise.reject({code:3019,message:l.message||it[3019]}):{appId:l.body.appId,douyinOpenId:l.body.douyinOpenId,outProductCategory:l.body.outProductCategory,requestId:l.body.requestId}}catch(a){return E.error("getDyPayJsapiInfoFn error:",a),Promise.reject({code:(a==null?void 0:a.code)||3020,message:(a==null?void 0:a.message)||it[3020]})}}async function Me(t){try{let n=await ve.post("/gw/advert/customer/douyin/pay/jsapi/signature",t);return n.code!=="0000000"||!(n!=null&&n.body)||!n.body.signature||!n.body.timestamp||!n.body.nonceStr?Promise.reject({code:3023,message:n.message||it[3023]}):{signature:n.body.signature,timestamp:n.body.timestamp,nonceStr:n.body.nonceStr}}catch(n){return E.error("getDyPayJsapiSignatureFn error:",n),Promise.reject({code:(n==null?void 0:n.code)||3024,message:(n==null?void 0:n.message)||it[3024]})}}async function hr(t){try{let n=await ve.post("/gw/advert/customer/douyin/pay-command",t);return n.code!=="0000000"||!(n!=null&&n.body)?Promise.reject({code:3032,message:n.message||it[3032]}):n}catch(n){return E.error("getDyPayCommandFn error:",n),Promise.reject({code:(n==null?void 0:n.code)||3033,message:(n==null?void 0:n.message)||it[3033]})}}async function nn(t){try{let n=await ve.post("/gw/advert/customer/automatic-debit/sign/request-id",{requestId:t});return n.code!=="0000000"||!(n!=null&&n.body)?Promise.reject({code:3037,message:n.message||it[3037]}):n.body}catch(n){return E.error("dyAutomaticDebitSignByRequestIdFn error:",n),Promise.reject({code:(n==null?void 0:n.code)||3038,message:(n==null?void 0:n.message)||it[3038]})}}var Do="/auth/rest/auth/third",Dr="url_token",Io="https://unpkg.byted-static.com/bridge/douyin_open/1.0.17/lib/douyin_open.umd.js",Je=null,Po="-2",vo="1",So="0";function Jt(t,n){let a=new Error(n||it[t]);return Object.assign(a,{code:t})}function Ir(t){var a;let n=(a=t==null?void 0:t.data)==null?void 0:a.code;return n!=null?String(n):typeof(t==null?void 0:t.code)=="string"?t.code:""}function mr(t){return String(t==null?void 0:t.code)===Po}function gr(t){return Ir(t)===vo}function Ar(t){var n,a;return((n=t==null?void 0:t.data)==null?void 0:n.msg)||((a=t==null?void 0:t.data)==null?void 0:a.message)||(t==null?void 0:t.message)||(t==null?void 0:t.errMsg)}function ke(){return typeof window!="undefined"&&typeof document!="undefined"}function vn(){return ke()?window.location.href:""}function me(t){let n=t.href||vn();if(!t.key||!n)return"";try{let a=new URL(n,Sr()),f=a.searchParams.get(t.key);return f!=null?f:Eo(a.hash,t.key)}catch(a){return E.warn("getDyUrlParam parse error:",a),""}}function Eo(t,n){if(!t||!n)return"";let a=t.indexOf("?");if(a<0)return"";let f=t.slice(a+1).split("#")[0];return new URLSearchParams(f).get(n)||""}function Pr(t){let{href:n,paramName:a}=t;if(!n||!a)return n;let f=n.indexOf("#"),l=f>=0?n.slice(0,f):n,d=f>=0?n.slice(f):"";try{let g=new URL(l,Sr()),P=To(l);return g.searchParams.delete(a),`${P?`${g.pathname}${g.search}`:g.toString()}${vr(d,a)}`}catch(g){return E.warn("removeDyUrlParam parse error:",g),bo(n,a)}}function vr(t,n){if(!t||!n)return t;let a=t.indexOf("?");if(a<0)return t;let f=t.slice(0,a),l=t.slice(a+1),d=l.indexOf("#"),g=d>=0?l.slice(0,d):l,P=d>=0?l.slice(d):"",T=new URLSearchParams(g);T.delete(n);let x=T.toString();return`${f}${x?`?${x}`:""}${P}`}function qe(t={}){let a=(t.href||vn()).split("#")[0]||"";return Pr({href:a,paramName:t.tokenParamName||Dr})}function Ro(t){var l,d;let n=t.tokenParamName||Dr,a=Pr({href:t.redirectUrl||vn(),paramName:n});if(!a)throw Jt(3025);let f=new URLSearchParams({useAgent:t.useAgent||"douyin",category:t.category||"pay",internal:String((l=t.internal)!=null?l:!1),silent:String((d=t.silent)!=null?d:!1),redirectUrl:a});return t.equipmentValue&&f.set("equipmentValue",t.equipmentValue),`${t.authPath||Do}?${f.toString()}`}function Be(t){if(!ke())throw Jt(3025);let n=Ro(t);E.info("\u8DF3\u8F6C\u6296\u97F3\u6388\u6743:",{authUrl:n,equipmentValue:t.equipmentValue});try{return window.location.href=n,n}catch(a){throw E.error("redirectDyAuth error:",a),Jt(3026)}}function Oe(){if(!ke())return null;let t=window;return t.DouyinOpenJSBridge||t.douyin_open||null}function Ve(t={}){if(!ke())return Promise.reject(Jt(3025));let n=Oe();if(n)return E.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5DF2\u52A0\u8F7D"),Promise.resolve(n);if(Je)return E.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u590D\u7528\u52A0\u8F7D\u4E2D\u4EFB\u52A1"),Je;let a=t.sdkUrl||Io;return E.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u5F00\u59CB\u52A0\u8F7D",{sdkUrl:a}),Je=new Promise((f,l)=>{let d=No(a),g=()=>{let x=Oe();if(!x){l(Jt(3027));return}E.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u6210\u529F"),f(x)},P=x=>{E.error("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u52A0\u8F7D\u5931\u8D25",x),l(Jt(3027))};if(d){if(E.info("\u52A0\u8F7D\u6296\u97F3\u5F00\u653E SDK\uFF1A\u811A\u672C\u5DF2\u5B58\u5728"),wo(d)){window.setTimeout(g,0);return}d.addEventListener("load",g,{once:!0}),d.addEventListener("error",P,{once:!0});return}let T=document.createElement("script");T.src=a,T.async=!0,T.addEventListener("load",g,{once:!0}),T.addEventListener("error",x=>{T.remove(),P(x)},{once:!0}),document.head.appendChild(T)}).catch(f=>{throw Je=null,f}),Je}function je(t){let n=t.sdk||Oe();if(!n)return Promise.reject(Jt(3027));let{appId:a,signatureData:f,url:l}=t;return!a||!l||!(f!=null&&f.signature)||!(f!=null&&f.timestamp)||!(f!=null&&f.nonceStr)?Promise.reject(Jt(3028)):new Promise((d,g)=>{E.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u5F00\u59CB\u914D\u7F6E",{appId:a,url:l});try{n.config({params:{client_key:a,signature:f.signature,timestamp:String(f.timestamp),nonce_str:f.nonceStr,url:l}}),n.ready(()=>{E.info("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5B8C\u6210"),d(n)}),n.error(P=>{E.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5931\u8D25",P),g(Jt(3028))})}catch(P){E.error("\u521D\u59CB\u5316\u6296\u97F3 JSSDK\uFF1A\u914D\u7F6E\u5F02\u5E38",P),g(Jt(3028))}})}function Sn(t){let n=t.sdk||Oe();if(!n)return Promise.reject(Jt(3027));if(!n.ttcjpay||typeof n.ttcjpay.dypay!="function")return Promise.reject(Jt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));let{appId:a,payInfo:f}=t;if(!a||!f)return Promise.reject(Jt(3021));let l={appId:a,timeStamp:String(f.timeStamp),nonceStr:f.nonceStr,package:f.package,signType:f.signType,paySign:f.paySign};return new Promise((d,g)=>{E.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528 dypay");try{n.ttcjpay.dypay({sdk_info:JSON.stringify(l),success:P=>{if(E.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u6210\u529F\u56DE\u8C03",P),mr(P)){g(Jt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(gr(P)){g(Jt(3039));return}let T=Ir(P);if(T&&T!==So){g(Jt(3029,Ar(P)));return}d(P)},fail:P=>{if(E.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u5931\u8D25\u56DE\u8C03",P),mr(P)){g(Jt(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(gr(P)){g(Jt(3039));return}g(Jt(3029,Ar(P)))}})}catch(P){E.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u8C03\u7528\u5F02\u5E38",P),g(Jt(3029,P==null?void 0:P.message))}})}function Sr(){return ke()?window.location.origin:"https://bi-nova.local"}function To(t){return!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t)&&!t.startsWith("//")}function No(t){return Array.from(document.getElementsByTagName("script")).find(a=>a.src===t)||null}function wo(t){let n=t.readyState;return n==="loaded"||n==="complete"}function bo(t,n){let a=t.indexOf("#"),f=a>=0?t.slice(0,a):t,l=a>=0?t.slice(a):"",d=f.indexOf("?");if(d<0)return t;let g=f.slice(0,d),T=f.slice(d+1).split("&").filter(x=>x&&decodeURIComponent(x.split("=")[0])!==n).join("&");return`${g}${T?`?${T}`:""}${vr(l,n)}`}async function rn(t){var a,f,l,d;let n=ar(t);if(!n.valid)return U(n.errorCode,it[n.errorCode]);try{let g=t.returnType||"h5",P=await dr({price:t.price,equipmentValue:t.equipmentValue,businessType:t.businessType,douyinOrderExtendData:(t==null?void 0:t.douyinOrderExtendData)||"",platformActivities:(t==null?void 0:t.platformActivities)||{},douyinCommodityVirtualFlag:(t==null?void 0:t.douyinCommodityVirtualFlag)||!1}),T=g==="jsapi"?await pr({requestNo:me({key:"requestNo"})}):void 0,x=await _r(zt(et(zt(et({},P.body),{telephone:t.telephone,equipmentValue:t.equipmentValue,businessType:t.businessType}),t.unifiedOrderExtendData&&{unifiedOrderExtendData:t.unifiedOrderExtendData}),{returnType:g,jsapiInfo:T}));if(t.returnType==="ulink")return U(0,"success",{ulinkQueryParams:x});let ut=((a=x==null?void 0:x.body)==null?void 0:a.h5Url)||"",tt=((f=x==null?void 0:x.body)==null?void 0:f.outTradeNo)||"";if(g==="jsapi"){let Ot=Rr((l=x==null?void 0:x.body)==null?void 0:l.payInfo);return U(0,"success",{appId:(T==null?void 0:T.appId)||"",payInfo:Ot,outTradeNo:tt})}let G=ut?await Co(zt(et({},t),{dyUrl:ut})):"";return G?U(0,"success",{h5Url:G,outTradeNo:tt}):U(3010,it[3010])}catch(g){E.error("handleDyPayFlow error:",g);let P=(d=g==null?void 0:g.code)!=null?d:3012,T=(g==null?void 0:g.message)||it[3012];return U(P,T)}}function Rr(t){if(!t)throw{code:3021,message:it[3021]};if(typeof t=="object"){if(Er(t))return t;throw{code:3022,message:it[3022]}}try{let n=JSON.parse(t);if(!Er(n))throw new Error("invalid payInfo fields");return n}catch(n){throw{code:3022,message:it[3022],error:n}}}function Er(t){return typeof t.timeStamp=="string"&&t.timeStamp!==""&&typeof t.nonceStr=="string"&&t.nonceStr!==""&&typeof t.package=="string"&&t.package!==""&&typeof t.signType=="string"&&t.signType!==""&&typeof t.paySign=="string"&&t.paySign!==""}async function Co(t){let n=ie(),a=Ze(n.env||"prod",""),f=typeof n.getAuthToken=="function"?await n.getAuthToken():"",l=t.client||"weapp";return`${a}/pages/subAdvertising.html?#/douyinPayInnerH5Transfer?client=${l}&equipmentId=${t.equipmentValue}&dyUrl=${t.dyUrl}&fromUrl=${encodeURIComponent(t.fromUrl||"")}&backUrl=${encodeURIComponent(t.backUrl||"")}&backWay=${t.backWay||""}&url_token=${f}`}async function on(t){var a;let n=ur(t);if(!n.valid)return U(n.errorCode,it[n.errorCode]);try{let f=await yr({price:(t==null?void 0:t.price)||"",equipmentValue:t.equipmentValue,telephone:(t==null?void 0:t.telephone)||""});return U(0,"success",f.body)}catch(f){E.error("getDyPayRtaData error:",f);let l=(a=f==null?void 0:f.code)!=null?a:3015,d=(f==null?void 0:f.message)||it[3015];return U(l,d)}}async function Tr(t){var a,f;let n=cr(t);if(!n.valid)return U(n.errorCode,it[n.errorCode]);try{let l=(a=t.commandUrl)==null?void 0:a.trim(),g=(await hr(et({phone:t.telephone||"",equipmentValue:t.equipmentValue,orderAmount:t.orderAmount,businessType:t.businessType},l?{commandUrl:l}:{}))).body||"";return g?U(0,"success",{command:g}):U(3032,it[3032])}catch(l){E.error("getDyPayCommand error:",l);let d=(f=l==null?void 0:l.code)!=null?f:3033,g=(l==null?void 0:l.message)||it[3033];return U(d,g)}}async function Oo(t){var a;let n=await Tr(t);if(n.code!==0||!((a=n.data)!=null&&a.command))return U(n.code,n.message);try{return await Ye(n.data.command),U(0,"success",et({type:"copy_success"},t.returnCommand?{command:n.data.command}:{}))}catch(f){return E.error("copyDyPayCommand error:",f),U(3034,it[3034])}}async function En(t){var a,f,l;let n=lr(t);if(!n.valid)return U(n.errorCode,it[n.errorCode]);try{let d=await on({telephone:t.telephone||"",equipmentValue:t.equipmentValue,price:t.price});if(d.code!==0)return U(d.code,d.message);let g=d.data;if(!(g!=null&&g.showFlag))return U(0,"success",{eligible:!1,type:"not_eligible"});if(!fr(g))return U(3035,it[3035]);let P={telephone:t.telephone||"",equipmentValue:t.equipmentValue,orderAmount:g.payAmount,businessType:g.businessType,commandUrl:t.commandUrl};if(t.autoCopy){let x=await Oo(zt(et({},P),{returnCommand:t.returnCommand}));return x.code!==0?U(x.code,x.message):U(0,"success",et({eligible:!0,type:"copy_success"},(a=x.data)!=null&&a.command?{command:x.data.command}:{}))}let T=await Tr(P);return T.code!==0||!((f=T.data)!=null&&f.command)?U(T.code,T.message):U(0,"success",{eligible:!0,type:"command",command:T.data.command})}catch(d){E.error("handleDyPayCommandFlow error:",d);let g=(l=d==null?void 0:d.code)!=null?l:3033,P=(d==null?void 0:d.message)||it[3033];return U(g,P)}}async function Rn(t){var a,f,l;let n=sr(t);if(!n.valid)return U(n.errorCode,it[n.errorCode]);try{let d=ie(),g=t.authToken||(typeof d.getAuthToken=="function"?await d.getAuthToken():""),P=t.autoAuth!==!1;if(!g){if(!P)return U(3030,it[3030]);let Ot=Be({equipmentValue:t.equipmentValue,redirectUrl:t.redirectUrl,tokenParamName:t.tokenParamName});return U(0,"redirecting",{type:"auth_redirect",authUrl:Ot})}let T=await Ve({sdkUrl:t.sdkUrl}),x=await rn(zt(et({},t),{client:"h5",returnType:"jsapi"}));if(x.code!==0||!((a=x.data)!=null&&a.appId)||!((f=x.data)!=null&&f.payInfo))return U(x.code||3021,x.message||it[3021]);let ut=t.signatureUrl||qe({tokenParamName:t.tokenParamName}),tt=await Me({url:ut});await je({appId:x.data.appId,signatureData:tt,url:ut,sdk:T});let G=await Sn({appId:x.data.appId,payInfo:x.data.payInfo,sdk:T});return U(0,"success",{type:"pay_result",outTradeNo:x.data.outTradeNo,payResult:G})}catch(d){E.error("handleDyJsapiPayFlow error:",d);let g=(l=d==null?void 0:d.code)!=null?l:3029,P=(d==null?void 0:d.message)||it[3029];return U(g,P)}}async function Tn(){var l;let t="url_token",n=ie(),f=(typeof n.getAuthToken=="function"?await n.getAuthToken():"")||me({key:t});try{if(!f){let Ot=me({key:"equipmentValue"}),S=Be(et({tokenParamName:t},Ot?{equipmentValue:Ot}:{}));return U(0,"redirecting",{type:"auth_redirect",authUrl:S})}let d=me({key:"requestId"}).trim();if(!d)return U(3036,it[3036]);let g=await Ve(),P=await nn(d),T=P.appId||P.appid||"",x=Rr(P.payInfo);if(!T)return U(3021,it[3021]);let ut=qe({tokenParamName:t}),tt=await Me(et({url:ut},T?{appid:T}:{}));await je({appId:T,signatureData:tt,url:ut,sdk:g});let G=await Sn({appId:T,payInfo:x,sdk:g});return U(0,"success",{type:"sign_result",orderNo:P.orderNo,payResult:G})}catch(d){E.error("handleDyAuthDebitSignFlow error:",d);let g=(l=d==null?void 0:d.code)!=null?l:3029,P=(d==null?void 0:d.message)||it[3029];return U(g,P)}}var Fo="-2",Yo="1",Lo="0";function ne(t,n){let a=new Error(n||it[t]);return Object.assign(a,{code:t})}function Cr(t){var a;let n=(a=t==null?void 0:t.data)==null?void 0:a.code;return n!=null?String(n):typeof(t==null?void 0:t.code)=="string"?t.code:""}function Nr(t){return String(t==null?void 0:t.code)===Fo}function wr(t){return Cr(t)===Yo}function br(t){var n,a;return((n=t==null?void 0:t.data)==null?void 0:n.msg)||((a=t==null?void 0:t.data)==null?void 0:a.message)||(t==null?void 0:t.message)||(t==null?void 0:t.errMsg)}function xo(t){if(typeof t=="string"){if(!t.trim())throw ne(3021);return t}if(!t||typeof t!="object")throw ne(3021);let n=JSON.stringify(t);if(!n)throw ne(3022);return n}function Uo(t){let n=t.sdk||Oe();if(!n)return Promise.reject(ne(3027));if(!n.ttcjpay||typeof n.ttcjpay.dypay!="function")return Promise.reject(ne(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));let a="";try{a=xo(t.payInfo)}catch(f){return Promise.reject(f!=null&&f.code?f:ne(3022,f==null?void 0:f.message))}return new Promise((f,l)=>{E.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u539F\u59CB payInfo \u900F\u4F20 dypay");try{n.ttcjpay.dypay({sdk_info:a,success:d=>{if(E.info("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u539F\u59CB payInfo \u900F\u4F20\u6210\u529F\u56DE\u8C03",d),Nr(d)){l(ne(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(wr(d)){l(ne(3039));return}let g=Cr(d);if(g&&g!==Lo){l(ne(3029,br(d)));return}f(d)},fail:d=>{if(E.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u539F\u59CB payInfo \u900F\u4F20\u5931\u8D25\u56DE\u8C03",d),Nr(d)){l(ne(3029,"\u5F53\u524D\u6296\u97F3\u7248\u672C\u4E0D\u652F\u6301\u652F\u4ED8\uFF0C\u8BF7\u5347\u7EA7\u6296\u97F3 APP"));return}if(wr(d)){l(ne(3039));return}l(ne(3029,br(d)))}})}catch(d){E.error("\u8C03\u8D77\u6296\u97F3\u652F\u4ED8\uFF1A\u539F\u59CB payInfo \u900F\u4F20\u8C03\u7528\u5F02\u5E38",d),l(ne(3029,d==null?void 0:d.message))}})}async function Nn(){var l;let t="url_token",n=ie(),f=(typeof n.getAuthToken=="function"?await n.getAuthToken():"")||me({key:t});try{if(!f){let G=me({key:"equipmentValue"}),Ot=Be(et({tokenParamName:t},G?{equipmentValue:G}:{}));return U(0,"redirecting",{type:"auth_redirect",authUrl:Ot})}let d=me({key:"requestId"}).trim();if(!d)return U(3036,it[3036]);let g=await Ve(),P=await nn(d),T=P.appId||P.appid||"";if(!T)return U(3021,it[3021]);let x=qe({tokenParamName:t}),ut=await Me({url:x,appid:T});await je({appId:T,signatureData:ut,url:x,sdk:g});let tt=await Uo({payInfo:P.payInfo,sdk:g});return U(0,"success",{type:"sign_result",orderNo:P.orderNo,payResult:tt})}catch(d){E.error("handleDyAuthDebitSignFlowWithRawPayInfo error:",d);let g=(l=d==null?void 0:d.code)!=null?l:3029,P=(d==null?void 0:d.message)||it[3029];return U(g,P)}}var Fn={};Qe(Fn,{getDisplayAdConfig:()=>On,normalizeDisplayAdData:()=>an});var Mo=be();function Or(t){let n=Le(t,["placementId"]);if(!n.valid)return Promise.reject({code:"PARAM_ERROR",message:n.message});let a=ie().env||"prod",f=Number.isInteger(t.userId)&&Number(t.userId)>0?{userId:t.userId}:{};return Mo.get(`/gw/advert-plugin/api/v1/config/list/valid/${t.placementId}`,f,{authRequired:!1,baseDomain:Vn(a)})}var Fr=30*1e3,Jo="__",Cn=new Map,bn=new Map;function ko(t,n){let a=Number.isInteger(t.userId)&&Number(t.userId)>0?t.userId:"";return[t.appId||"",n,t.type||"",a].join(Jo)}function qo(t){let n=Cn.get(t);return n?n.expireAt<=Date.now()?(Cn.delete(t),E.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58\u5DF2\u8FC7\u671F\u5E76\u6E05\u7406",{cacheKey:t}),null):n.data:null}function Bo(t,n){Cn.set(t,{data:n,expireAt:Date.now()+Fr})}function Vo(t){return Array.isArray(t==null?void 0:t.body)?t.body:[]}function jo(t){return String(t==null?void 0:t.code)!=="200"}function Ho(t,n){let a=String(t||n||"banner").trim().toLowerCase();return["splash","banner","interstitial","feed"].includes(a)?a:n||"banner"}function Yr(t){return String(t||"").trim().toLowerCase()}function Go(t){var n;return!!t&&t.status!==0&&((n=t.platformConfig)==null?void 0:n.valid)!==!1}function Ko(t){return[...t].sort((n,a)=>{var d,g,P,T;let f=Number((d=n.priority)!=null?d:9999),l=Number((g=a.priority)!=null?g:9999);return f!==l?f-l:Number((P=a.weight)!=null?P:0)-Number((T=n.weight)!=null?T:0)})}function Lr(t){return t.find(n=>Yr(n.advertPlatform)==="gdt")||null}function xr(t){return t.find(n=>Yr(n.advertPlatform)!=="gdt")||null}function Xo(t,n){return t&&n?"mixed":t?"wechat":n?"custom":"none"}function Wo(t,n){var l,d;let a=Lr(t),f=xr(t);return a&&f?Number((l=a.priority)!=null?l:9999)<=Number((d=f.priority)!=null?d:9999)?"wechat-first":"custom-first":n==="custom"?"custom-only":n==="wechat"?"wechat-only":"wechat-first"}function Qo(t){var a;let n=Lr(t);return((a=n==null?void 0:n.platformConfig)==null?void 0:a.adId)||""}function $o(t,n,a){let f=String(t.mediaType||"").trim().toLowerCase();return f==="video"&&a?"video":f==="image"&&n?"image":a?"video":"image"}function zo(t){let n=t.targetAppId||"",a=t.targetPath||"",f=t.jumpUrl||t.url||t.webUrl||"",d=String(t.jumpType||"").trim().toLowerCase()||(n?"miniprogram":a?"internal":f?"web":"none");if(d==="miniprogram"){let g=String(t.miniProgramOpenMode||"").trim().toLowerCase()==="half"?"half":"full";return{jumpType:"miniProgram",appId:n||void 0,path:a||void 0,miniProgramOpenMode:g,action:{type:"miniProgram",appId:n||void 0,path:a||void 0,miniProgramOpenMode:g}}}return d==="internal"?{jumpType:"internal",path:a||void 0,action:{type:"internal",path:a||void 0}}:d==="web"?{jumpType:"web",url:f||void 0,action:{type:"web",url:f||void 0}}:d==="api"?{jumpType:"api",url:f||void 0,action:{type:"api",url:f||void 0}}:{jumpType:"none",action:{type:"none"}}}function Zo(t){let n=xr(t),a=n==null?void 0:n.platformConfig;if(!a)return null;let f=a.image||a.imageUrl||"",l=a.video||a.videoUrl||"",d=a.poster||"";if(!f&&!l)return null;let g=$o(a,f,l),P=zo(a),x=String(a.fitMode||"").trim().toLowerCase()==="contain"?"contain":"cover";return et({configId:n.id,placementId:n.placementId,configName:n.configName,advertPlatform:n.advertPlatform,mediaType:g,image:f||void 0,video:l||void 0,poster:d||void 0,bottomImage:a.bottomImage||void 0,advertiserName:a.advertiserName||void 0,advertiserLogo:a.advertiserLogo||void 0,description:a.description||void 0,buttonText:a.buttonText||void 0,badgeText:a.badgeText||void 0,jumpSeconds:a.jumpSeconds,loadTimeout:a.loadTimeout||a.timeout,muted:a.muted,adSpec:a.adSpec,fitMode:x},P)}function an(t,n){let a=Ko(t.filter(Go)),f=Zo(a),l=Qo(a),d=Ho(void 0,n),g=Xo(l,f),P=Wo(a,g);return{show:!!(l||f),adId:"",type:d,provider:g,priority:P,unitId:l,customAd:f,trackers:{},cache:{enable:!1,ttl:0},ext:{},rawData:t}}async function On(t){let n=t.placementId||t.adId||"",a=ko(t,n),f=qo(a);if(f)return E.info("\u547D\u4E2D\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u7F13\u5B58",{cacheKey:a,placementId:n}),U(Yt.SUCCESS,"\u6210\u529F",f);let l=bn.get(a);if(l)return E.info("\u590D\u7528\u8FDB\u884C\u4E2D\u7684\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u8BF7\u6C42",{cacheKey:a,placementId:n}),l;let d=(async()=>{try{E.info("\u5F00\u59CB\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E",t);let g=await Or(et({placementId:n},Number.isInteger(t.userId)&&Number(t.userId)>0?{userId:t.userId}:{})),P=Vo(g);if(E.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u539F\u59CB\u8FD4\u56DE",{cacheKey:a,placementId:n,response:g,body:P}),jo(g)||!P)return E.warn("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u63A5\u53E3\u8FD4\u56DE\u5F02\u5E38",g),U(Yt.UNKNOWN_ERROR,(g==null?void 0:g.message)||"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5931\u8D25");let T=an(P,t.type);return T.adId=n,T.cache=zt(et({},T.cache),{enable:!0,ttl:Fr}),Bo(a,T),E.info("\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u83B7\u53D6\u6210\u529F",{cacheKey:a,placementId:n,provider:T.provider,priority:T.priority,hasUnitId:!!T.unitId,hasCustomAd:!!T.customAd}),U(Yt.SUCCESS,"\u6210\u529F",T)}catch(g){return E.error("\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38",{cacheKey:a,placementId:n,error:g}),U(Yt.NETWORK_ERROR,"\u83B7\u53D6\u5C55\u793A\u5E7F\u544A\u914D\u7F6E\u5F02\u5E38\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")}finally{bn.delete(a)}})();return bn.set(a,d),d}function ti(t={}){E.info("\u670D\u52A1\u521D\u59CB\u5316",t);let n=et(et({},we),t);n.env&&!ze[n.env]&&(E.warn(`\u65E0\u6548\u7684\u73AF\u5883\u7C7B\u578B: ${n.env}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),n.env=Qt.PROD),n.externalEnv&&!Fe[n.externalEnv]&&(E.warn(`\u65E0\u6548\u7684\u5916\u90E8\u5BF9\u63A5\u73AF\u5883\u7C7B\u578B: ${n.externalEnv}\uFF0C\u5C06\u4F7F\u7528\u751F\u4EA7\u73AF\u5883`),n.externalEnv=de.PROD),n.debug!==void 0&&E.setEnable(n.debug),Hn(n),E.info("\u670D\u52A1\u521D\u59CB\u5316\u5B8C\u6210",n)}function Ur(t={}){let n="",a=null;async function f(){if(typeof t.getAuthToken=="function"){let d=await t.getAuthToken();if(d)return d}return a&&typeof a.getStorage=="function"&&a.getStorage("auth_token")||""}let l={name:"services",setToken(d){return n=d||"",a&&typeof a.setStorage=="function"&&a.setStorage("auth_token",n),l},async getAuthToken(){return n||f()},clearToken(){return n="",a&&typeof a.setStorage=="function"&&a.setStorage("auth_token",""),l},install(d){a=d;let g=zt(et({},t),{getAuthToken:()=>l.getAuthToken()});ti(g),E.info("services installed via nova.use()"),Object.assign(d,{jd:et({},Pn),dy:et({},wn),ads:et({},Fn),setToken:l.setToken,clearToken:l.clearToken})}};return l}0&&(module.exports={DyErrorCode,DyErrorMessage,ENV_TYPE,EXTERNAL_ENV_TYPE,JdErrorCode,JdErrorMessage,createServices,getDisplayAdConfig,getDyPayRtaData,handleDyAuthDebitSignFlow,handleDyAuthDebitSignFlowWithRawPayInfo,handleDyJsapiPayFlow,handleDyPayCommandFlow,handleDyPayFlow,handleJdInsurance,handleJdInsuranceExt,handleJdjrCashLoanExt,handleJdjrCashLoanFlow,normalizeDisplayAdData});
5
5
  /*! For license information please see LyyGetCommandSDK.min.js.LICENSE.txt */