You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
10 KiB
JavaScript

2 years ago
!function(t){var e={};function n(o){if(e[o])return e[o].exports;var a=e[o]={i:o,l:!1,exports:{}};return t[o].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:o})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(t,e,n){"use strict";var o=0;function a(t){if(!(this instanceof a))return new a(t);this._state=o,this._onFulfilled=[],this._onRejected=[],this._value=null,this._reason=null,s(t)&&t(r(this.resolve,this),r(this.reject,this))}function c(t,e){if(t!==e)if(function(t){return t&&s(t.then)}(e))try{e.then(function(e){c(t,e)},function(e){t.reject(e)})}catch(e){t.reject(e)}else t.resolve(e);else t.reject(new TypeError("A promise cannot be resolved with itself."))}function i(t,e,n){return function(o){if(s(e))try{var a=e(o);c(t,a)}catch(e){t.reject(e)}else t[n](o)}}function r(t,e){var n=[].slice,o=n.call(arguments,2),a=function(){},c=function(){return t.apply(this instanceof a?this:e,o.concat(n.call(arguments)))};return a.prototype=t.prototype,c.prototype=new a,c}a.prototype={constructor:a,then:function(t,e){var n=new a;return this._onFulfilled.push(i(n,t,"resolve")),this._onRejected.push(i(n,e,"reject")),this.flush(),n},flush:function(){var t=this._state;if(t!==o){var e=1===t?this._onFulfilled.slice():this._onRejected.slice(),n=1===t?this._value:this._reason;setTimeout(function(){l(e,function(t){try{t(n)}catch(t){}})},0),this._onFulfilled=[],this._onRejected=[]}},resolve:function(t){this._state===o&&(this._state=1,this._value=t,this.flush())},reject:function(t){this._state===o&&(this._state=2,this._reason=t,this.flush())},always:function(t){return this.then(t,t)}},a.defer=function(){var t={};return t.promise=new a(function(e,n){t.resolve=e,t.reject=n}),t},a.all=function(t){var e=a.defer(),n=t.length,o=[];return l(t,function(t,a){t.then(function(t){o[a]=t,0===--n&&e.resolve(o)},function(t){e.reject(t)})}),e.promise};var s=function(t){return function(e){return{}.toString.call(e)=="[object "+t+"]"}}("Function");function l(t,e){for(var n=0,o=t.length;n<o;n++)e(t[n],n)}t.exports=a},function(t,e,n){"use strict";var o=window,a=document,c=document.head||document.getElementsByTagName("head")[0],i=n(0);function r(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e.join("&")}t.exports={loadScript:function(t){var e=i.defer(),n=a.createElement("script");function o(){n.onreadystatechange=n.onload=null,c.removeChild(n),n=null,e.resolve()}return n.charset="utf-8",n.async=!0,"onload"in n?n.onload=o:n.onreadystatechange=function(){/loaded|complete/.test(n.readyState)&&o()},"onerror"in n&&(n.onerror=function(){e.reject()}),setTimeout(function(){e.reject()},3e3),n.src=t,c.appendChild(n),e.promise},jsonp:function(t){var e,n=0;if(t.timeout=3e3,t.times=3,!(t=t||{}).url||!t.callback)throw new Error("参数不合法");var c=("jsonp_"+Math.random()).replace(".",""),i=a.getElementsByTagName("script")[0],s="";t.data?(t.data[t.callback]=c,s+=r(t.data)):s+=t.callback+"="+c;var l=a.createElement("script");i.parentNode.insertBefore(l,i),o[c]=function(n){o[c]=function(){report("回调已执行过,不再执行"),o[c]=null};try{l.parentNode&&l.parentNode.removeChild(l)}catch(t){}clearInterval(e),t.success&&t.success(n)},l.src=t.url+(-1==t.url.indexOf("?")?"?":"&")+s,console.log("jsonp:",l.src),t.timeout&&(e=setInterval(function(){var i;if(++n>=t.times){o[c]=function(){},clearInterval(e);try{l.parentNode&&l.parentNode.removeChild(l)}catch(t){}t.fail(1)}else try{l.parentNode&&l.parentNode.removeChild(l),l=a.createElement("script"),(i=a.getElementsByTagName("script")[0]).parentNode.insertBefore(l,i),l.src=t.url+(-1==t.url.indexOf("?")?"?":"&")+s+"&t="+Math.random()}catch(t){}},t.timeout))},jsonp2:function(t){var e=("jsonp_"+Math.random()).replace(".",""),n=a.getElementsByTagName("script")[0],c="";t.data?(t.data[t.callback]=e,c+=r(t.data)):c+=t.ca