UNPKG

mixfill

Version:
1 lines 6.29 kB
!function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof exports?module.exports=b():a.returnExports=b()}(this,function(){function a(a){try{return a.sentinel=0,0===Object.getOwnPropertyDescriptor(a,"sentinel").value}catch(b){}}function b(a){try{return Object.defineProperty(a,"sentinel",{}),"sentinel"in a}catch(b){}}var c,d,e,f,g=Function.prototype.call,h=Object.prototype,i=g.bind(h.hasOwnProperty),j=i(h,"__defineGetter__");if(j&&(c=g.bind(h.__defineGetter__),d=g.bind(h.__defineSetter__),e=g.bind(h.__lookupGetter__),f=g.bind(h.__lookupSetter__)),Object.getPrototypeOf||(Object.getPrototypeOf=function(a){var b=a.__proto__;return b||null===b?b:a.constructor?a.constructor.prototype:h}),Object.defineProperty){var k=a({}),l="undefined"==typeof document||a(document.createElement("div"));if(!l||!k)var m=Object.getOwnPropertyDescriptor}if(!Object.getOwnPropertyDescriptor||m){var n="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function(a,b){if("object"!=typeof a&&"function"!=typeof a||null===a)throw new TypeError(n+a);if(m)try{return m.call(Object,a,b)}catch(c){}if(i(a,b)){var d={enumerable:!0,configurable:!0};if(j){var g=a.__proto__,k=a!==h;k&&(a.__proto__=h);var l=e(a,b),o=f(a,b);if(k&&(a.__proto__=g),l||o)return l&&(d.get=l),o&&(d.set=o),d}return d.value=a[b],d.writable=!0,d}}}if(Object.getOwnPropertyNames||(Object.getOwnPropertyNames=function(a){return Object.keys(a)}),!Object.create){var o,p=!({__proto__:null}instanceof Object);o=p||"undefined"==typeof document?function(){return{__proto__:null}}:function(){function a(){}var b=document.createElement("iframe"),c=document.body||document.documentElement;b.style.display="none",c.appendChild(b),b.src="javascript:";var d=b.contentWindow.Object.prototype;return c.removeChild(b),b=null,delete d.constructor,delete d.hasOwnProperty,delete d.propertyIsEnumerable,delete d.isPrototypeOf,delete d.toLocaleString,delete d.toString,delete d.valueOf,d.__proto__=null,a.prototype=d,o=function(){return new a},new a},Object.create=function(a,b){function c(){}var d;if(null===a)d=o();else{if("object"!=typeof a&&"function"!=typeof a)throw new TypeError("Object prototype may only be an Object or null");c.prototype=a,d=new c,d.__proto__=a}return void 0!==b&&Object.defineProperties(d,b),d}}if(Object.defineProperty){var q=b({}),r="undefined"==typeof document||b(document.createElement("div"));if(!q||!r)var s=Object.defineProperty,t=Object.defineProperties}if(!Object.defineProperty||s){var u="Property description must be an object: ",v="Object.defineProperty called on non-object: ",w="getters & setters can not be defined on this javascript engine";Object.defineProperty=function(a,b,g){if("object"!=typeof a&&"function"!=typeof a||null===a)throw new TypeError(v+a);if("object"!=typeof g&&"function"!=typeof g||null===g)throw new TypeError(u+g);if(s)try{return s.call(Object,a,b,g)}catch(k){}if(i(g,"value"))if(j&&(e(a,b)||f(a,b))){var l=a.__proto__;a.__proto__=h,delete a[b],a[b]=g.value,a.__proto__=l}else a[b]=g.value;else{if(!j)throw new TypeError(w);i(g,"get")&&c(a,b,g.get),i(g,"set")&&d(a,b,g.set)}return a}}(!Object.defineProperties||t)&&(Object.defineProperties=function(a,b){if(t)try{return t.call(Object,a,b)}catch(c){}for(var d in b)i(b,d)&&"__proto__"!==d&&Object.defineProperty(a,d,b[d]);return a}),Object.seal||(Object.seal=function(a){return a}),Object.freeze||(Object.freeze=function(a){return a});try{Object.freeze(function(){})}catch(x){Object.freeze=function(a){return function(b){return"function"==typeof b?b:a(b)}}(Object.freeze)}Object.preventExtensions||(Object.preventExtensions=function(a){return a}),Object.isSealed||(Object.isSealed=function(){return!1}),Object.isFrozen||(Object.isFrozen=function(){return!1}),Object.isExtensible||(Object.isExtensible=function(a){if(Object(a)!==a)throw new TypeError;for(var b="";i(a,b);)b+="?";a[b]=!0;var c=i(a,b);return delete a[b],c})}),function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void j(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}"undefined"!=typeof module&&module.exports?module.exports=a.Promise?a.Promise:c:a.Promise||(a.Promise=c);var j=a.setImmediate||function(a){setTimeout(a,1)},k=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};c.prototype["catch"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&k(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;f<a.length;f++)d(f,a[f])})},c.resolve=function(a){return a&&"object"==typeof a&&a.constructor===c?a:new c(function(b){b(a)})},c.reject=function(a){return new c(function(b,c){c(a)})},c.race=function(a){return new c(function(b,c){for(var d=0,e=a.length;e>d;d++)a[d].then(b,c)})}}(this);