433 lines
104 KiB
JavaScript
433 lines
104 KiB
JavaScript
![]() |
/*!
|
||
|
* https://github.com/es-shims/es5-shim
|
||
|
* @license es5-shim Copyright 2009-2020 by contributors, MIT License
|
||
|
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
|
||
|
*/
|
||
|
(function(t,r){"use strict";if(typeof define==="function"&&define.amd){define(r)}else if(typeof exports==="object"){module.exports=r()}else{t.returnExports=r()}})(this,function(){var t=Array;var r=t.prototype;var e=Object;var n=e.prototype;var i=Function;var a=i.prototype;var o=String;var f=o.prototype;var u=Number;var l=u.prototype;var s=r.slice;var c=r.splice;var v=r.push;var h=r.unshift;var p=r.concat;var y=r.join;var d=a.call;var g=a.apply;var w=Math.max;var b=Math.min;var T=n.toString;var m=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var D;var S=Function.prototype.toString,x=/^\s*class /,O=function isES6ClassFn(t){try{var r=S.call(t);var e=r.replace(/\/\/.*\n/g,"");var n=e.replace(/\/\*[.\s\S]*\*\//g,"");var i=n.replace(/\n/gm," ").replace(/ {2}/g," ");return x.test(i)}catch(a){return false}},E=function tryFunctionObject(t){try{if(O(t)){return false}S.call(t);return true}catch(r){return false}},j="[object Function]",I="[object GeneratorFunction]",D=function isCallable(t){if(!t){return false}if(typeof t!=="function"&&typeof t!=="object"){return false}if(m){return E(t)}if(O(t)){return false}var r=T.call(t);return r===j||r===I};var M;var U=RegExp.prototype.exec,$=function tryRegexExec(t){try{U.call(t);return true}catch(r){return false}},F="[object RegExp]";M=function isRegex(t){if(typeof t!=="object"){return false}return m?$(t):T.call(t)===F};var N;var C=String.prototype.valueOf,k=function tryStringObject(t){try{C.call(t);return true}catch(r){return false}},A="[object String]";N=function isString(t){if(typeof t==="string"){return true}if(typeof t!=="object"){return false}return m?k(t):T.call(t)===A};var R=e.defineProperty&&function(){try{var t={};e.defineProperty(t,"x",{enumerable:false,value:t});for(var r in t){return false}return t.x===t}catch(n){return false}}();var P=function(t){var r;if(R){r=function(t,r,n,i){if(!i&&r in t){return}e.defineProperty(t,r,{configurable:true,enumerable:false,writable:true,value:n})}}else{r=function(t,r,e,n){if(!n&&r in t){return}t[r]=e}}return function defineProperties(e,n,i){for(var a in n){if(t.call(n,a)){r(e,a,n[a],i)}}}}(n.hasOwnProperty);var J=function isPrimitive(t){var r=typeof t;return t===null||r!=="object"&&r!=="function"};var Y=u.isNaN||function isActualNaN(t){return t!==t};var z={ToInteger:function ToInteger(t){var r=+t;if(Y(r)){r=0}else if(r!==0&&r!==1/0&&r!==-(1/0)){r=(r>0||-1)*Math.floor(Math.abs(r))}return r},ToPrimitive:function ToPrimitive(t){var r,e,n;if(J(t)){return t}e=t.valueOf;if(D(e)){r=e.call(t);if(J(r)){return r}}n=t.toString;if(D(n)){r=n.call(t);if(J(r)){return r}}throw new TypeError},ToObject:function(t){if(t==null){throw new TypeError("can't convert "+t+" to object")}return e(t)},ToUint32:function ToUint32(t){return t>>>0}};var Z=function Empty(){};P(a,{bind:function bind(t){var r=this;if(!D(r)){throw new TypeError("Function.prototype.bind called on incompatible "+r)}var n=s.call(arguments,1);var a;var o=function(){if(this instanceof a){var i=g.call(r,this,p.call(n,s.call(arguments)));if(e(i)===i){return i}return this}else{return g.call(r,t,p.call(n,s.call(arguments)))}};var f=w(0,r.length-n.length);var u=[];for(var l=0;l<f;l++){v.call(u,"$"+l)}a=i("binder","return function ("+y.call(u,",")+"){ return binder.apply(this, arguments); }")(o);if(r.prototype){Z.prototype=r.prototype;a.prototype=new Z;Z.prototype=null}return a}});var G=d.bind(n.hasOwnProperty);var H=d.bind(n.toString);var W=d.bind(s);var B=g.bind(s);if(typeof document==="object"&&document&&document.documentElement){try{W(document.documentElement.childNodes)}catch(X){var L=W;var q=B;W=function arraySliceIE(t){var r=[];var e=t.length;while(e-- >0){r[e]=t[e]}return q(r,L(arguments,1))};B=function arraySliceApplyIE(t,r){return q(W(t),r)}}}var K=d.bind(f.slice);var Q=d.bind(f.split);var V=d.bind(f.indexOf);var _=d.bind(v);var tt=d.bind(n.propertyIsEnumerable);var rt=d.bind(r.sort);var et=t.isArray||function isArray(t){return H(t)==="[object Array]"};var nt=[].unshift(0)!==1;P(r,{unshift:function(){h.apply(this,arguments);return this.length}},nt);P(t,{isArray:et});var it=e("a");va
|
||
|
|
||
|
/*!
|
||
|
* https://github.com/paulmillr/es6-shim
|
||
|
* @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com)
|
||
|
* and contributors, MIT License
|
||
|
* es6-shim: v0.35.4
|
||
|
* see https://github.com/paulmillr/es6-shim/blob/0.35.3/LICENSE
|
||
|
* Details and documentation:
|
||
|
* https://github.com/paulmillr/es6-shim/
|
||
|
*/
|
||
|
(function(e,t){if(typeof define==="function"&&define.amd){define(t)}else if(typeof exports==="object"){module.exports=t()}else{e.returnExports=t()}})(this,function(){"use strict";var e=Function.call.bind(Function.apply);var t=Function.call.bind(Function.call);var r=Array.isArray;var n=Object.keys;var o=function notThunker(t){return function notThunk(){return!e(t,this,arguments)}};var i=function(e){try{e();return false}catch(t){return true}};var a=function valueOrFalseIfThrows(e){try{return e()}catch(t){return false}};var u=o(i);var f=function(){return!i(function(){return Object.defineProperty({},"x",{get:function(){}})})};var s=!!Object.defineProperty&&f();var c=function foo(){}.name==="foo";var l=Function.call.bind(Array.prototype.forEach);var p=Function.call.bind(Array.prototype.reduce);var v=Function.call.bind(Array.prototype.filter);var y=Function.call.bind(Array.prototype.some);var h=function(e,t,r,n){if(!n&&t in e){return}if(s){Object.defineProperty(e,t,{configurable:true,enumerable:false,writable:true,value:r})}else{e[t]=r}};var b=function(e,t,r){l(n(t),function(n){var o=t[n];h(e,n,o,!!r)})};var g=Function.call.bind(Object.prototype.toString);var d=typeof/abc/==="function"?function IsCallableSlow(e){return typeof e==="function"&&g(e)==="[object Function]"}:function IsCallableFast(e){return typeof e==="function"};var m={getter:function(e,t,r){if(!s){throw new TypeError("getters require true ES5 support")}Object.defineProperty(e,t,{configurable:true,enumerable:false,get:r})},proxy:function(e,t,r){if(!s){throw new TypeError("getters require true ES5 support")}var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,{configurable:n.configurable,enumerable:n.enumerable,get:function getKey(){return e[t]},set:function setKey(r){e[t]=r}})},redefine:function(e,t,r){if(s){var n=Object.getOwnPropertyDescriptor(e,t);n.value=r;Object.defineProperty(e,t,n)}else{e[t]=r}},defineByDescriptor:function(e,t,r){if(s){Object.defineProperty(e,t,r)}else if("value"in r){e[t]=r.value}},preserveToString:function(e,t){if(t&&d(t.toString)){h(e,"toString",t.toString.bind(t),true)}}};var O=Object.create||function(e,t){var r=function Prototype(){};r.prototype=e;var o=new r;if(typeof t!=="undefined"){n(t).forEach(function(e){m.defineByDescriptor(o,e,t[e])})}return o};var w=function(e,t){if(!Object.setPrototypeOf){return false}return a(function(){var r=function Subclass(t){var r=new e(t);Object.setPrototypeOf(r,Subclass.prototype);return r};Object.setPrototypeOf(r,e);r.prototype=O(e.prototype,{constructor:{value:r}});return t(r)})};var j=function(){if(typeof self!=="undefined"){return self}if(typeof window!=="undefined"){return window}if(typeof global!=="undefined"){return global}throw new Error("unable to locate global object")};var S=j();var T=S.isFinite;var I=Function.call.bind(String.prototype.indexOf);var E=Function.apply.bind(Array.prototype.indexOf);var P=Function.call.bind(Array.prototype.concat);var C=Function.call.bind(String.prototype.slice);var M=Function.call.bind(Array.prototype.push);var x=Function.apply.bind(Array.prototype.push);var N=Function.call.bind(Array.prototype.shift);var A=Math.max;var R=Math.min;var _=Math.floor;var k=Math.abs;var L=Math.exp;var F=Math.log;var D=Math.sqrt;var z=Function.call.bind(Object.prototype.hasOwnProperty);var q;var W=function(){};var G=S.Map;var H=G&&G.prototype["delete"];var V=G&&G.prototype.get;var B=G&&G.prototype.has;var U=G&&G.prototype.set;var $=S.Symbol||{};var J=$.species||"@@species";var X=Number.isNaN||function isNaN(e){return e!==e};var K=Number.isFinite||function isFinite(e){return typeof e==="number"&&T(e)};var Z=d(Math.sign)?Math.sign:function sign(e){var t=Number(e);if(t===0){return t}if(X(t)){return t}return t<0?-1:1};var Y=function log1p(e){var t=Number(e);if(t<-1||X(t)){return NaN}if(t===0||t===Infinity){return t}if(t===-1){return-Infinity}return 1+t-1===0?t:t*(F(1+t)/(1+t-1))};var Q=function isArguments(e){return g(e)==="[object Arguments]"};var ee=function isArguments(e){return e!==null&&typeof e==="object"&&typeof e.length==="number"&&e.length>=0&&g(e)!=="[object
|
||
|
h(Math,"acosh",Cr.acosh,Math.acosh(Number.MAX_VALUE)===Infinity);h(Math,"acosh",Cr.acosh,!Mr(Math.acosh(1+Number.EPSILON),Math.sqrt(2*Number.EPSILON)));h(Math,"cbrt",Cr.cbrt,!Mr(Math.cbrt(1e-300),1e-100));h(Math,"sinh",Cr.sinh,Math.sinh(-2e-17)!==-2e-17);var xr=Math.expm1(10);h(Math,"expm1",Cr.expm1,xr>22025.465794806718||xr<22025.465794806718);var Nr=Math.round;var Ar=Math.round(.5-Number.EPSILON/4)===0&&Math.round(-.5+Number.EPSILON/3.99)===1;var Rr=mr+1;var _r=2*mr-1;var kr=[Rr,_r].every(function(e){return Math.round(e)===e});h(Math,"round",function round(e){var t=_(e);var r=t===-1?-0:t+1;return e-t<.5?t:r},!Ar||!kr);m.preserveToString(Math.round,Nr);var Lr=Math.imul;if(Math.imul(4294967295,5)!==-5){Math.imul=Cr.imul;m.preserveToString(Math.imul,Lr)}if(Math.imul.length!==2){ne(Math,"imul",function imul(e,t){return ce.Call(Lr,Math,arguments)})}var Fr=function(){var e=S.setTimeout;if(typeof e!=="function"&&typeof e!=="object"){return}ce.IsPromise=function(e){if(!ce.TypeIsObject(e)){return false}if(typeof e._promise==="undefined"){return false}return true};var r=function(e){if(!ce.IsConstructor(e)){throw new TypeError("Bad promise constructor")}var t=this;var r=function(e,r){if(t.resolve!==void 0||t.reject!==void 0){throw new TypeError("Bad Promise implementation!")}t.resolve=e;t.reject=r};t.resolve=void 0;t.reject=void 0;t.promise=new e(r);if(!(ce.IsCallable(t.resolve)&&ce.IsCallable(t.reject))){throw new TypeError("Bad promise constructor")}};var n;if(typeof window!=="undefined"&&ce.IsCallable(window.postMessage)){n=function(){var e=[];var t="zero-timeout-message";var r=function(r){M(e,r);window.postMessage(t,"*")};var n=function(r){if(r.source===window&&r.data===t){r.stopPropagation();if(e.length===0){return}var n=N(e);n()}};window.addEventListener("message",n,true);return r}}var o=function(){var e=S.Promise;var t=e&&e.resolve&&e.resolve();return t&&function(e){return t.then(e)}};var i=ce.IsCallable(S.setImmediate)?S.setImmediate:typeof process==="object"&&process.nextTick?process.nextTick:o()||(ce.IsCallable(n)?n():function(t){e(t,0)});var a=function(e){return e};var u=function(e){throw e};var f=0;var s=1;var c=2;var l=0;var p=1;var v=2;var y={};var h=function(e,t,r){i(function(){g(e,t,r)})};var g=function(e,t,r){var n,o;if(t===y){return e(r)}try{n=e(r);o=t.resolve}catch(i){n=i;o=t.reject}o(n)};var d=function(e,t){var r=e._promise;var n=r.reactionLength;if(n>0){h(r.fulfillReactionHandler0,r.reactionCapability0,t);r.fulfillReactionHandler0=void 0;r.rejectReactions0=void 0;r.reactionCapability0=void 0;if(n>1){for(var o=1,i=0;o<n;o++,i+=3){h(r[i+l],r[i+v],t);e[i+l]=void 0;e[i+p]=void 0;e[i+v]=void 0}}}r.result=t;r.state=s;r.reactionLength=0};var m=function(e,t){var r=e._promise;var n=r.reactionLength;if(n>0){h(r.rejectReactionHandler0,r.reactionCapability0,t);r.fulfillReactionHandler0=void 0;r.rejectReactions0=void 0;r.reactionCapability0=void 0;if(n>1){for(var o=1,i=0;o<n;o++,i+=3){h(r[i+p],r[i+v],t);e[i+l]=void 0;e[i+p]=void 0;e[i+v]=void 0}}}r.result=t;r.state=c;r.reactionLength=0};var O=function(e){var t=false;var r=function(r){var n;if(t){return}t=true;if(r===e){return m(e,new TypeError("Self resolution"))}if(!ce.TypeIsObject(r)){return d(e,r)}try{n=r.then}catch(o){return m(e,o)}if(!ce.IsCallable(n)){return d(e,r)}i(function(){j(e,r,n)})};var n=function(r){if(t){return}t=true;return m(e,r)};return{resolve:r,reject:n}};var w=function(e,r,n,o){if(e===I){t(e,r,n,o,y)}else{t(e,r,n,o)}};var j=function(e,t,r){var n=O(e);var o=n.resolve;var i=n.reject;try{w(r,t,o,i)}catch(a){i(a)}};var T,I;var E=function(){var e=function Promise(t){if(!(this instanceof e)){throw new TypeError('Constructor Promise requires "new"')}if(this&&this._promise){throw new TypeError("Bad construction")}if(!ce.IsCallable(t)){throw new TypeError("not a valid resolver")}var r=Ae(this,e,T,{_promise:{result:void 0,state:f,reactionLength:0,fulfillReactionHandler0:void 0,rejectReactionHandler0:void 0,reactionCapability0:void 0}});var n=O(r);var o=n.reject;try{t(n.resolve,o)}catch(i){o(i)}return r};return e}();T=E.prototype;var P=function(e,t,r,n){var o=f
|
||
|
|
||
|
|
||
|
/*!
|
||
|
* https://github.com/es-shims/es5-shim
|
||
|
* @license es5-shim Copyright 2009-2020 by contributors, MIT License
|
||
|
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
|
||
|
*/
|
||
|
//es5-shim;
|
||
|
(function(e,t){"use strict";if(typeof define==="function"&&define.amd){define(t)}else if(typeof exports==="object"){module.exports=t()}else{e.returnExports=t()}})(this,function(){var e=Function.call;var t=Object.prototype;var r=e.bind(t.hasOwnProperty);var n=e.bind(t.propertyIsEnumerable);var o=e.bind(t.toString);var i;var c;var f;var a;var l=r(t,"__defineGetter__");if(l){i=e.bind(t.__defineGetter__);c=e.bind(t.__defineSetter__);f=e.bind(t.__lookupGetter__);a=e.bind(t.__lookupSetter__)}var u=function isPrimitive(e){return e==null||typeof e!=="object"&&typeof e!=="function"};if(!Object.getPrototypeOf){Object.getPrototypeOf=function getPrototypeOf(e){var r=e.__proto__;if(r||r===null){return r}else if(o(e.constructor)==="[object Function]"){return e.constructor.prototype}else if(e instanceof Object){return t}else{return null}}}if(Object.defineProperty){var s=function doesGetOwnPropertyDescriptorWork(e){try{e.sentinel=0;return Object.getOwnPropertyDescriptor(e,"sentinel").value===0}catch(t){return false}};var p=s({});var b=typeof document==="undefined"||s(document.createElement("div"));if(!b||!p){var O=Object.getOwnPropertyDescriptor}}if(!Object.getOwnPropertyDescriptor||O){var d="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function getOwnPropertyDescriptor(e,o){if(u(e)){throw new TypeError(d+e)}if(O){try{return O.call(Object,e,o)}catch(i){}}var c;if(!r(e,o)){return c}c={enumerable:n(e,o),configurable:true};if(l){var s=e.__proto__;var p=e!==t;if(p){e.__proto__=t}var b=f(e,o);var y=a(e,o);if(p){e.__proto__=s}if(b||y){if(b){c.get=b}if(y){c.set=y}return c}}c.value=e[o];c.writable=true;return c}}if(!Object.getOwnPropertyNames){Object.getOwnPropertyNames=function getOwnPropertyNames(e){return Object.keys(e)}}if(!Object.create){var y;var j=!({__proto__:null}instanceof Object);var v=function shouldUseActiveX(){if(!document.domain){return false}try{return!!new ActiveXObject("htmlfile")}catch(e){return false}};var _=function getEmptyViaActiveX(){var e;var t;t=new ActiveXObject("htmlfile");var r="script";t.write("<"+r+"></"+r+">");t.close();e=t.parentWindow.Object.prototype;t=null;return e};var w=function getEmptyViaIFrame(){var e=document.createElement("iframe");var t=document.body||document.documentElement;var r;e.style.display="none";t.appendChild(e);e.src="javascript:";r=e.contentWindow.Object.prototype;t.removeChild(e);e=null;return r};if(j||typeof document==="undefined"){y=function(){return{__proto__:null}}}else{y=function(){var e=v()?_():w();delete e.constructor;delete e.hasOwnProperty;delete e.propertyIsEnumerable;delete e.isPrototypeOf;delete e.toLocaleString;delete e.toString;delete e.valueOf;var t=function Empty(){};t.prototype=e;y=function(){return new t};return new t}}Object.create=function create(e,t){var r;var n=function Type(){};if(e===null){r=y()}else if(u(e)){throw new TypeError("Object prototype may only be an Object or null")}else{n.prototype=e;r=new n;r.__proto__=e}if(t!==void 0){Object.defineProperties(r,t)}return r}}var m=function doesDefinePropertyWork(e){try{Object.defineProperty(e,"sentinel",{});return"sentinel"in e}catch(t){return false}};if(Object.defineProperty){var P=m({});var E=typeof document==="undefined"||m(document.createElement("div"));if(!P||!E){var h=Object.defineProperty,g=Object.defineProperties}}if(!Object.defineProperty||h){var z="Property description must be an object: ";var T="Object.defineProperty called on non-object: ";var x="getters & setters can not be defined on this javascript engine";Object.defineProperty=function defineProperty(e,r,n){if(u(e)){throw new TypeError(T+e)}if(u(n)){throw new TypeError(z+n)}if(h){try{return h.call(Object,e,r,n)}catch(o){}}if("value"in n){if(l&&(f(e,r)||a(e,r))){var s=e.__proto__;e.__proto__=t;delete e[r];e[r]=n.value;e.__proto__=s}else{e[r]=n.value}}else{var p="get"in n;var b="set"in n;if(!l&&(p||b)){throw new TypeError(x)}if(p){i(e,r,n.get)}if(b){c(e,r,n.set)}}return e}}if(!Object.defineProperties||g){Object.defineProperties=function defineProperties(e,t){if(g){try{return g.call(Object,e,t)}catch(r){}}Object
|
||
|
|
||
|
//es6-shim;
|
||
|
(function(t,e){if(typeof define==="function"&&define.amd){define(e)}else if(typeof exports==="object"){module.exports=e()}else{t.returnExports=e()}})(this,function(){"use strict";var t=new Function("return this;");var e=t();var r=e.Object;var n=Function.call.bind(Function.call);var o=Function.toString;var i=String.prototype.match;var f=function(t){try{t();return false}catch(e){return true}};var u=function(){return!f(function(){r.defineProperty({},"x",{get:function(){}})})};var a=!!r.defineProperty&&u();(function(){if(r.setPrototypeOf){return}var t=r.getOwnPropertyNames;var e=r.getOwnPropertyDescriptor;var n=r.create;var o=r.defineProperty;var i=r.getPrototypeOf;var f=r.prototype;var u=function(r,n){t(n).forEach(function(t){o(r,t,e(n,t))});return r};var a=function(t,e){return u(n(e),t)};var c,s;try{c=e(f,"__proto__").set;c.call({},null);s=function(t,e){c.call(t,e);return t}}catch(p){c={__proto__:null};if(c instanceof r){s=a}else{c.__proto__=f;if(c instanceof r){s=function(t,e){t.__proto__=e;return t}}else{s=function(t,e){if(i(t)){t.__proto__=e;return t}else{return a(t,e)}}}}}r.setPrototypeOf=s})();if(a&&function foo(){}.name!=="foo"){r.defineProperty(Function.prototype,"name",{configurable:true,enumerable:false,get:function(){if(this===Function.prototype){return""}var t=n(o,this);var e=n(i,t,/\s*function\s+([^(\s]*)\s*/);var f=e&&e[1];r.defineProperty(this,"name",{configurable:true,enumerable:false,writable:false,value:f});return f}})}});
|
||
|
|
||
|
/*!
|
||
|
* weakmap-polyfill v2.0.2 - ECMAScript6 WeakMap polyfill
|
||
|
* https://github.com/polygonplanet/weakmap-polyfill
|
||
|
* Copyright (c) 2015-2020 Polygon Planet <polygon.planet.aqua@gmail.com>
|
||
|
* @license MIT
|
||
|
*/
|
||
|
(function(e){"use strict";if(e.WeakMap){return}var r=Object.prototype.hasOwnProperty;var n=function(e,t,r){if(Object.defineProperty){Object.defineProperty(e,t,{configurable:true,writable:true,value:r})}else{e[t]=r}};e.WeakMap=function(){function WeakMap(){if(this===void 0){throw new TypeError("Constructor WeakMap requires 'new'")}n(this,"_id",genId("_WeakMap"));if(arguments.length>0){throw new TypeError("WeakMap iterable is not supported")}}n(WeakMap.prototype,"delete",function(e){checkInstance(this,"delete");if(!isObject(e)){return false}var t=e[this._id];if(t&&t[0]===e){delete e[this._id];return true}return false});n(WeakMap.prototype,"get",function(e){checkInstance(this,"get");if(!isObject(e)){return void 0}var t=e[this._id];if(t&&t[0]===e){return t[1]}return void 0});n(WeakMap.prototype,"has",function(e){checkInstance(this,"has");if(!isObject(e)){return false}var t=e[this._id];if(t&&t[0]===e){return true}return false});n(WeakMap.prototype,"set",function(e,t){checkInstance(this,"set");if(!isObject(e)){throw new TypeError("Invalid value used as weak map key")}var r=e[this._id];if(r&&r[0]===e){r[1]=t;return this}n(e,this._id,[e,t]);return this});function checkInstance(e,t){if(!isObject(e)||!r.call(e,"_id")){throw new TypeError(t+" method called on incompatible receiver "+typeof e)}}function genId(e){return e+"_"+rand()+"."+rand()}function rand(){return Math.random().toString().substring(2)}n(WeakMap,"_polyfill",true);return WeakMap}();function isObject(e){return Object(e)===e}})(typeof self!=="undefined"?self:typeof window!=="undefined"?window:typeof global!=="undefined"?global:this);
|
||
|
|
||
|
|
||
|
|
||
|
(function(){
|
||
|
if(!window.requestAnimationFrame){
|
||
|
var lastTime = 0;
|
||
|
window.requestAnimationFrame = function(callback){
|
||
|
var currTime = new Date().getTime();
|
||
|
var timeToCall = Math.max(0,16.7-(currTime - lastTime));
|
||
|
var id = window.setTimeout(function(){
|
||
|
callback(currTime + timeToCall);
|
||
|
},timeToCall);
|
||
|
lastTime = currTime + timeToCall;
|
||
|
return id;
|
||
|
}
|
||
|
}
|
||
|
if (!window.cancelAnimationFrame) {
|
||
|
window.cancelAnimationFrame = function(id) {
|
||
|
clearTimeout(id);
|
||
|
};
|
||
|
}
|
||
|
}());
|
||
|
|
||
|
if (!String.prototype.includes) {
|
||
|
String.prototype.includes = function (search, start) {
|
||
|
if (typeof start !== 'number') {
|
||
|
start = 0;
|
||
|
}
|
||
|
if (start + search.length > this.length) {
|
||
|
return false;
|
||
|
} else {
|
||
|
return this.indexOf(search, start) !== -1;
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
if(!document.head){
|
||
|
document.head = document.getElementsByTagName("head")[0];
|
||
|
}
|
||
|
if (!document.querySelectorAll) {
|
||
|
document.querySelectorAll = function (selectors) {
|
||
|
var style = document.createElement('style'), elements = [], element;
|
||
|
document.documentElement.firstChild.appendChild(style);
|
||
|
document._qsa = [];
|
||
|
|
||
|
style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}';
|
||
|
window.scrollBy(0, 0);
|
||
|
style.parentNode.removeChild(style);
|
||
|
|
||
|
while (document._qsa.length) {
|
||
|
element = document._qsa.shift();
|
||
|
element.style.removeAttribute('x-qsa');
|
||
|
elements.push(element);
|
||
|
}
|
||
|
document._qsa = null;
|
||
|
return elements;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
if (!document.querySelector) {
|
||
|
document.querySelector = function (selectors) {
|
||
|
var elements = document.querySelectorAll(selectors);
|
||
|
return (elements.length) ? elements[0] : null;
|
||
|
};
|
||
|
}
|
||
|
if (!Array.prototype.includes) {
|
||
|
Object.defineProperty(Array.prototype, 'includes', {
|
||
|
value: function (valueToFind, fromIndex) {
|
||
|
if (this == null) {
|
||
|
throw new TypeError('"this" is null or not defined');
|
||
|
}
|
||
|
// 1. Let O be ? ToObject(this value).
|
||
|
var o = Object(this);
|
||
|
var len = o.length >>> 0;
|
||
|
if (len === 0) return false;
|
||
|
var n = fromIndex | 0;
|
||
|
var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
|
||
|
|
||
|
function sameValueZero(x, y) {
|
||
|
return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));
|
||
|
}
|
||
|
while (k < len) {
|
||
|
if (sameValueZero(o[k], valueToFind)) {
|
||
|
return true;
|
||
|
}
|
||
|
k++;
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
if (!String.prototype.repeat) {
|
||
|
String.prototype.repeat = function (count) {
|
||
|
if (this == null) {
|
||
|
throw new TypeError('can\'t convert ' + this + ' to object');
|
||
|
}
|
||
|
var str = '' + this;
|
||
|
count = +count;
|
||
|
if (count != count) {
|
||
|
count = 0;
|
||
|
}
|
||
|
if (count < 0) {
|
||
|
throw new RangeError('repeat count must be non-negative');
|
||
|
}
|
||
|
if (count == Infinity) {
|
||
|
throw new RangeError('repeat count must be less than infinity');
|
||
|
}
|
||
|
count = Math.floor(count);
|
||
|
if (str.length == 0 || count == 0) {
|
||
|
return '';
|
||
|
}
|
||
|
if (str.length * count >= 1 << 28) {
|
||
|
throw new RangeError('repeat count must not overflow maximum string size');
|
||
|
}
|
||
|
var rpt = '';
|
||
|
for (; ;) {
|
||
|
if ((count & 1) == 1) {
|
||
|
rpt += str;
|
||
|
}
|
||
|
count >>>= 1;
|
||
|
if (count == 0) {
|
||
|
break;
|
||
|
}
|
||
|
str += str;
|
||
|
}
|
||
|
return rpt;
|
||
|
}
|
||
|
}
|
||
|
if (!String.prototype.padStart) {
|
||
|
String.prototype.padStart = function (targetLength, padString) {
|
||
|
targetLength = targetLength>>0;
|
||
|
padString = String((typeof padString !== 'undefined' ? padString : ' '));
|
||
|
if (this.length > targetLength || padString === '') {
|
||
|
return String(this);
|
||
|
}
|
||
|
targetLength = targetLength-this.length;
|
||
|
if (targetLength > padString.length) {
|
||
|
padString += padString.repeat(targetLength / padString.length);
|
||
|
}
|
||
|
return padString.slice(0, targetLength) + String(this);
|
||
|
};
|
||
|
}
|
||
|
if (!String.prototype.padEnd) {
|
||
|
String.prototype.padEnd = function (targetLength, padString) {
|
||
|
targetLength = targetLength >> 0;
|
||
|
padString = String((typeof padString !== 'undefined' ? padString : ' '));
|
||
|
if (this.length > targetLength || padString === '') {
|
||
|
return String(this);
|
||
|
}
|
||
|
targetLength = targetLength - this.length;
|
||
|
if (targetLength > padString.length) {
|
||
|
padString += padString.repeat(targetLength / padString.length);
|
||
|
}
|
||
|
return String(this) + padString.slice(0, targetLength);
|
||
|
};
|
||
|
}
|
||
|
|
||
|
|
||
|
/*!
|
||
|
https://mths.be/scrollingelement v1.5.2 by @diegoperini & @mathias | MIT license
|
||
|
https://www.zhangxinxu.com/wordpress/2019/02/document-scrollingelement/
|
||
|
*/
|
||
|
if (!('scrollingElement' in document)) (function() {
|
||
|
function computeStyle(element) {
|
||
|
if (window.getComputedStyle) {
|
||
|
// Support Firefox < 4 which throws on a single parameter.
|
||
|
return getComputedStyle(element, null);
|
||
|
}
|
||
|
// Support Internet Explorer < 9.
|
||
|
return element.currentStyle;
|
||
|
}
|
||
|
|
||
|
function isBodyElement(element) {
|
||
|
// The `instanceof` check gives the correct result for e.g. `body` in a
|
||
|
// non-HTML namespace.
|
||
|
if (window.HTMLBodyElement) {
|
||
|
return element instanceof HTMLBodyElement;
|
||
|
}
|
||
|
// Fall back to a `tagName` check for old browsers.
|
||
|
return /body/i.test(element.tagName);
|
||
|
}
|
||
|
|
||
|
function getNextBodyElement(frameset) {
|
||
|
// We use this function to be correct per spec in case `document.body` is
|
||
|
// a `frameset` but there exists a later `body`. Since `document.body` is
|
||
|
// a `frameset`, we know the root is an `html`, and there was no `body`
|
||
|
// before the `frameset`, so we just need to look at siblings after the
|
||
|
// `frameset`.
|
||
|
var current = frameset;
|
||
|
while (current = current.nextSibling) {
|
||
|
if (current.nodeType == 1 && isBodyElement(current)) {
|
||
|
return current;
|
||
|
}
|
||
|
}
|
||
|
// No `body` found.
|
||
|
return null;
|
||
|
}
|
||
|
|
||
|
// Note: standards mode / quirks mode can be toggled at runtime via
|
||
|
// `document.write`.
|
||
|
var isCompliantCached;
|
||
|
var isCompliant = function() {
|
||
|
var isStandardsMode = /^CSS1/.test(document.compatMode);
|
||
|
if (!isStandardsMode) {
|
||
|
// In quirks mode, the result is equivalent to the non-compliant
|
||
|
// standards mode behavior.
|
||
|
return false;
|
||
|
}
|
||
|
if (isCompliantCached === void 0) {
|
||
|
// When called for the first time, check whether the browser is
|
||
|
// standard-compliant, and cache the result.
|
||
|
var iframe = document.createElement('iframe');
|
||
|
iframe.style.height = '1px';
|
||
|
(document.body || document.documentElement || document).appendChild(iframe);
|
||
|
var doc = iframe.contentWindow.document;
|
||
|
doc.write('<!DOCTYPE html><div style="height:9999em">x</div>');
|
||
|
doc.close();
|
||
|
isCompliantCached = doc.documentElement.scrollHeight > doc.body.scrollHeight;
|
||
|
iframe.parentNode.removeChild(iframe);
|
||
|
}
|
||
|
return isCompliantCached;
|
||
|
};
|
||
|
|
||
|
function isRendered(style) {
|
||
|
return style.display != 'none' && !(style.visibility == 'collapse' &&
|
||
|
/^table-(.+-group|row|column)$/.test(style.display));
|
||
|
}
|
||
|
|
||
|
function isScrollable(body) {
|
||
|
// A `body` element is scrollable if `body` and `html` both have
|
||
|
// non-`visible` overflow and are both being rendered.
|
||
|
var bodyStyle = computeStyle(body);
|
||
|
var htmlStyle = computeStyle(document.documentElement);
|
||
|
return bodyStyle.overflow != 'visible' && htmlStyle.overflow != 'visible' &&
|
||
|
isRendered(bodyStyle) && isRendered(htmlStyle);
|
||
|
}
|
||
|
|
||
|
var scrollingElement = function() {
|
||
|
if (isCompliant()) {
|
||
|
return document.documentElement;
|
||
|
}
|
||
|
var body = document.body;
|
||
|
// Note: `document.body` could be a `frameset` element, or `null`.
|
||
|
// `tagName` is uppercase in HTML, but lowercase in XML.
|
||
|
var isFrameset = body && !/body/i.test(body.tagName);
|
||
|
body = isFrameset ? getNextBodyElement(body) : body;
|
||
|
// If `body` is itself scrollable, it is not the `scrollingElement`.
|
||
|
return body && isScrollable(body) ? null : body;
|
||
|
};
|
||
|
|
||
|
if (Object.defineProperty) {
|
||
|
// Support modern browsers that lack a native implementation.
|
||
|
Object.defineProperty(document, 'scrollingElement', {
|
||
|
'get': scrollingElement
|
||
|
});
|
||
|
} else if (document.__defineGetter__) {
|
||
|
// Support Firefox ≤ 3.6.9, Safari ≤ 4.1.3.
|
||
|
document.__defineGetter__('scrollingElement', scrollingElement);
|
||
|
} else {
|
||
|
// IE ≤ 4 lacks `attachEvent`, so it only gets this one assignment. IE ≤ 7
|
||
|
// gets it too, but the value is updated later (see `propertychange`).
|
||
|
document.scrollingElement = scrollingElement();
|
||
|
document.attachEvent && document.attachEvent('onpropertychange', function() {
|
||
|
// This is for IE ≤ 7 only.
|
||
|
// A `propertychange` event fires when `<body>` is parsed because
|
||
|
// `document.activeElement` then changes.
|
||
|
if (window.event.propertyName == 'activeElement') {
|
||
|
document.scrollingElement = scrollingElement();
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
}());
|
||
|
|
||
|
window.matchMedia || (window.matchMedia = function() {
|
||
|
"use strict";
|
||
|
|
||
|
// For browsers that support matchMedium api such as IE 9 and webkit
|
||
|
var styleMedia = (window.styleMedia || window.media);
|
||
|
|
||
|
// For those that don't support matchMedium
|
||
|
if (!styleMedia) {
|
||
|
var style = document.createElement('style'),
|
||
|
script = document.getElementsByTagName('script')[0],
|
||
|
info = null;
|
||
|
|
||
|
style.type = 'text/css';
|
||
|
style.id = 'matchmediajs-test';
|
||
|
|
||
|
if (!script) {
|
||
|
document.head.appendChild(style);
|
||
|
} else {
|
||
|
script.parentNode.insertBefore(style, script);
|
||
|
}
|
||
|
// 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
|
||
|
info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle;
|
||
|
|
||
|
styleMedia = {
|
||
|
matchMedium: function(media) {
|
||
|
var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';
|
||
|
|
||
|
// 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
|
||
|
if (style.styleSheet) {
|
||
|
style.styleSheet.cssText = text;
|
||
|
} else {
|
||
|
style.textContent = text;
|
||
|
}
|
||
|
|
||
|
// Test if media query is true or false
|
||
|
return info.width === '1px';
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
return function(media) {
|
||
|
return {
|
||
|
matches: styleMedia.matchMedium(media || 'all'),
|
||
|
media: media || 'all'
|
||
|
};
|
||
|
};
|
||
|
}());
|
||
|
/*! matchMedia() polyfill addListener/removeListener extension. Author & copyright (c) 2012: Scott Jehl. MIT license */
|
||
|
(function(){
|
||
|
// Bail out for browsers that have addListener support
|
||
|
if (window.matchMedia && window.matchMedia('all').addListener) {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
var localMatchMedia = window.matchMedia,
|
||
|
hasMediaQueries = localMatchMedia('only all').matches,
|
||
|
isListening = false,
|
||
|
timeoutID = 0, // setTimeout for debouncing 'handleChange'
|
||
|
queries = [], // Contains each 'mql' and associated 'listeners' if 'addListener' is used
|
||
|
handleChange = function(evt) {
|
||
|
// Debounce
|
||
|
clearTimeout(timeoutID);
|
||
|
|
||
|
timeoutID = setTimeout(function() {
|
||
|
for (var i = 0, il = queries.length; i < il; i++) {
|
||
|
var mql = queries[i].mql,
|
||
|
listeners = queries[i].listeners || [],
|
||
|
matches = localMatchMedia(mql.media).matches;
|
||
|
|
||
|
// Update mql.matches value and call listeners
|
||
|
// Fire listeners only if transitioning to or from matched state
|
||
|
if (matches !== mql.matches) {
|
||
|
mql.matches = matches;
|
||
|
|
||
|
for (var j = 0, jl = listeners.length; j < jl; j++) {
|
||
|
listeners[j].call(window, mql);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}, 30);
|
||
|
};
|
||
|
|
||
|
window.matchMedia = function(media) {
|
||
|
var mql = localMatchMedia(media),
|
||
|
listeners = [],
|
||
|
index = 0;
|
||
|
|
||
|
mql.addListener = function(listener) {
|
||
|
// Changes would not occur to css media type so return now (Affects IE <= 8)
|
||
|
if (!hasMediaQueries) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
// Set up 'resize' listener for browsers that support CSS3 media queries (Not for IE <= 8)
|
||
|
// There should only ever be 1 resize listener running for performance
|
||
|
if (!isListening) {
|
||
|
isListening = true;
|
||
|
window.addEventListener('resize', handleChange, true);
|
||
|
}
|
||
|
|
||
|
// Push object only if it has not been pushed already
|
||
|
if (index === 0) {
|
||
|
index = queries.push({
|
||
|
mql : mql,
|
||
|
listeners : listeners
|
||
|
});
|
||
|
}
|
||
|
|
||
|
listeners.push(listener);
|
||
|
};
|
||
|
|
||
|
mql.removeListener = function(listener) {
|
||
|
for (var i = 0, il = listeners.length; i < il; i++){
|
||
|
if (listeners[i] === listener){
|
||
|
listeners.splice(i, 1);
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
return mql;
|
||
|
};
|
||
|
}());
|