1 |
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.log=e():t.log=e()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},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=34)}([function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=function(){},i=Symbol("valid log levels"),c=Symbol("a log instance");t.exports=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this[c]=e,this[i]={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5}}var e,n,u;return e=t,(n=[{key:"bindMethod",value:function(t,e){var n=t[e];if("function"==typeof n.bind)return n.bind(t);try{return Function.prototype.bind.call(n,t)}catch(e){return function(){return Function.prototype.apply.apply(n,[t,arguments])}}}},{key:"distillLevel",value:function(t){var e=t;if("string"==typeof e&&void 0!==this.levels[e.toUpperCase()]&&(e=this.levels[e.toUpperCase()]),this.levelValid(e))return e}},{key:"levelValid",value:function(t){return"number"==typeof t&&t>=0&&t<=this.levels.SILENT}},{key:"make",value:function(t){return"debug"===t&&(t="log"),void 0!==console[t]?this.bindMethod(console,t):void 0!==console.log?this.bindMethod(console,"log"):o}},{key:"replaceMethods",value:function(t){var e=this,n=this.distillLevel(t);if(null==n)throw new Error("loglevelnext: replaceMethods() called with invalid level: ".concat(t));if(!this.logger||"LogLevel"!==this.logger.type)throw new TypeError("loglevelnext: Logger is undefined or invalid. Please specify a valid Logger instance.");this.methods.forEach(function(t){var r=e.levels[t.toUpperCase()];e.logger[t]=r<n?o:e.make(t)}),this.logger.log=this.logger.debug}},{key:"levels",get:function(){return this[i]}},{key:"logger",get:function(){return this[c]},set:function(t){this[c]=t}},{key:"methods",get:function(){return Object.keys(this.levels).map(function(t){return t.toLowerCase()}).filter(function(t){return"silent"!==t})}}])&&r(e.prototype,n),u&&r(e,u),t}()},function(t,e,n){"use strict";var r=n(13)();t.exports=function(t){return t!==r&&null!==t}},function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function c(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function u(t,e,n){return(u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=l(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function l(t){return(l=Object.getPrototypeOf||function(t){return t.__proto__})(t)}var a=n(0),s={level:function(t){return"[".concat(t.level,"]")},name:function(t){return t.logger.name},template:"{{time}} {{level}} ",time:function(){return(new Date).toTimeString().split(" ")[0]}};t.exports=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(r=c(this,l(e).call(this,t))).options=Object.assign({},s,n),r}var n,r,a;return n=e,(r=[{key:"interpolate",value:function(t){var e=this;return this.options.template.replace(/{{([^{}]*)}}/g,function(n,r){var o=e.options[r];return o?o({level:t,logger:e.logger}):n})}},{key:"make",value:function(t){var n=this,r=u(l(e.prototype),"make",this).call(this,t);return function(){for(var e=n.interpolate(t),o=arguments.length,i=new Array(o),c=0;c<o;c++)i[c]=arguments[c];var u=i[0];"string"==typeof u?i[0]=e+u:i.unshift(e),r.apply(void 0,i)}}}])&&i(n.prototype,r),a&&i(n,a),function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");o(t.prototype,e&&e.prototype),e&&o(t,e)}(e,t),e}(a)},function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=Array.prototype.slice,c=n(31),u=Object.prototype.propertyIsEnumerable,l=!u.call({toString:null},"toString"),a=u.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},y=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&r.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),b=function(t){var e=null!==t&&"object"==typeof t,n="[object Function]"===o.call(t),i=c(t),u=e&&"[object String]"===o.call(t),p=[];if(!e&&!n&&!i)throw new TypeError("Object.keys called on a non-object");var b=a&&n;if(u&&t.length>0&&!r.call(t,0))for(var g=0;g<t.length;++g)p.push(String(g));if(i&&t.length>0)for(var h=0;h<t.length;++h)p.push(String(h));else for(var v in t)b&&"prototype"===v||!r.call(t,v)||p.push(String(v));if(l)for(var d=function(t){if("undefined"==typeof window||!y)return f(t);try{return f(t)}catch(t){return!1}}(t),m=0;m<s.length;++m)d&&"constructor"===s[m]||!r.call(t,s[m])||p.push(s[m]);return p};b.shim=function(){if(Object.keys){if(!function(){return 2===(Object.keys(arguments)||"").length}(1,2)){var t=Object.keys;Object.keys=function(e){return c(e)?t(i.call(e)):t(e)}}}else Object.keys=b;return Object.keys||b},t.exports=b},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=n(2),i=n(0),c={factory:null,level:"warn",name:+new Date,prefix:null};t.exports=function(){function t(e){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.type="LogLevel",this.options=Object.assign({},c,e),this.methodFactory=e.factory,!this.methodFactory){var n=e.prefix?new o(this,e.prefix):new i(this);this.methodFactory=n}this.methodFactory.logger||(this.methodFactory.logger=this),this.name=e.name||"<unknown>",this.level=this.options.level}var e,n,u;return e=t,(n=[{key:"disable",value:function(){this.level=this.levels.SILENT}},{key:"enable",value:function(){this.level=this.levels.TRACE}},{key:"factory",get:function(){return this.methodFactory},set:function(t){t.logger=this,this.methodFactory=t,this.methodFactory.replaceMethods(this.level)}},{key:"level",get:function(){return this.currentLevel},set:function(t){var e=this.methodFactory.distillLevel(t);if(null==e)throw new Error("loglevelnext: setLevel() called with invalid level: ".concat(t));this.currentLevel=e,this.methodFactory.replaceMethods(e),"undefined"==typeof console&&e<this.levels.SILENT&&console.warn("loglevelnext: console is undefined. The log will produce no output.")}},{key:"levels",get:function(){return this.methodFactory.levels}}])&&r(e.prototype,n),u&&r(e,u),t}()},function(t,e,n){"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},function(t,e,n){"use strict";var r=n(5);t.exports=function(t){if(!r(t))throw new TypeError(t+" is not a symbol");return t}},function(t,e,n){"use strict";var r=String.prototype.indexOf;t.exports=function(t){return r.call(this,t,arguments[1])>-1}},function(t,e,n){"use strict";var r="razdwatrzy";t.exports=function(){return"function"==typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},function(t,e,n){"use strict";t.exports=n(8)()?String.prototype.contains:n(7)},function(t,e,n){"use strict";t.exports=function(t){return"function"==typeof t}},function(t,e,n){"use strict";var r=n(1),o=Array.prototype.forEach,i=Object.create;t.exports=function(t){var e=i(null);return o.call(arguments,function(t){r(t)&&function(t,e){var n;for(n in t)e[n]=t[n]}(Object(t),e)}),e}},function(t,e,n){"use strict";var r=n(1);t.exports=function(t){if(!r(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,n){"use strict";t.exports=function(){}},function(t,e,n){"use strict";var r=n(1),o=Object.keys;t.exports=function(t){return o(r(t)?Object(t):t)}},function(t,e,n){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,n){"use strict";t.exports=n(15)()?Object.keys:n(14)},function(t,e,n){"use strict";var r=n(16),o=n(12),i=Math.max;t.exports=function(t,e){var n,c,u,l=i(arguments.length,2);for(t=Object(o(t)),u=function(r){try{t[r]=e[r]}catch(t){n||(n=t)}},c=1;c<l;++c)e=arguments[c],r(e).forEach(u);if(void 0!==n)throw n;return t}},function(t,e,n){"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,n){"use strict";t.exports=n(18)()?Object.assign:n(17)},function(t,e,n){"use strict";var r=n(19),o=n(11),i=n(10),c=n(9);(t.exports=function(t,e){var n,i,u,l,a;return arguments.length<2||"string"!=typeof t?(l=e,e=t,t=null):l=arguments[2],null==t?(n=u=!0,i=!1):(n=c.call(t,"c"),i=c.call(t,"e"),u=c.call(t,"w")),a={value:e,configurable:n,enumerable:i,writable:u},l?r(o(l),a):a}).gs=function(t,e,n){var u,l,a,s;return"string"!=typeof t?(a=n,n=e,e=t,t=null):a=arguments[3],null==e?e=void 0:i(e)?null==n?n=void 0:i(n)||(a=n,n=void 0):(a=e,e=n=void 0),null==t?(u=!0,l=!1):(u=c.call(t,"c"),l=c.call(t,"e")),s={get:e,set:n,configurable:u,enumerable:l},a?r(o(a),s):s}},function(t,e,n){"use strict";var r,o,i,c,u=n(20),l=n(6),a=Object.create,s=Object.defineProperties,f=Object.defineProperty,p=Object.prototype,y=a(null);if("function"==typeof Symbol){r=Symbol;try{String(r()),c=!0}catch(t){}}var b,g=(b=a(null),function(t){for(var e,n,r=0;b[t+(r||"")];)++r;return b[t+=r||""]=!0,f(p,e="@@"+t,u.gs(null,function(t){n||(n=!0,f(this,e,u(t)),n=!1)})),e});i=function(t){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return o(t)},t.exports=o=function t(e){var n;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return c?r(e):(n=a(i.prototype),e=void 0===e?"":String(e),s(n,{__description__:u("",e),__name__:u("",g(e))}))},s(o,{for:u(function(t){return y[t]?y[t]:y[t]=o(String(t))}),keyFor:u(function(t){var e;for(e in l(t),y)if(y[e]===t)return e}),hasInstance:u("",r&&r.hasInstance||o("hasInstance")),isConcatSpreadable:u("",r&&r.isConcatSpreadable||o("isConcatSpreadable")),iterator:u("",r&&r.iterator||o("iterator")),match:u("",r&&r.match||o("match")),replace:u("",r&&r.replace||o("replace")),search:u("",r&&r.search||o("search")),species:u("",r&&r.species||o("species")),split:u("",r&&r.split||o("split")),toPrimitive:u("",r&&r.toPrimitive||o("toPrimitive")),toStringTag:u("",r&&r.toStringTag||o("toStringTag")),unscopables:u("",r&&r.unscopables||o("unscopables"))}),s(i.prototype,{constructor:u(o),toString:u("",function(){return this.__name__})}),s(o.prototype,{toString:u(function(){return"Symbol ("+l(this).__description__+")"}),valueOf:u(function(){return l(this)})}),f(o.prototype,o.toPrimitive,u("",function(){var t=l(this);return"symbol"==typeof t?t:t.toString()})),f(o.prototype,o.toStringTag,u("c","Symbol")),f(i.prototype,o.toStringTag,u("c",o.prototype[o.toStringTag])),f(i.prototype,o.toPrimitive,u("c",o.prototype[o.toPrimitive]))},function(t,e){t.exports=function(){return this}()},function(t,e,n){"use strict";var r={object:!0,symbol:!0};t.exports=function(){var t;if("function"!=typeof Symbol)return!1;t=Symbol("test symbol");try{String(t)}catch(t){return!1}return!!r[typeof Symbol.iterator]&&(!!r[typeof Symbol.toPrimitive]&&!!r[typeof Symbol.toStringTag])}},function(t,e,n){"use strict";n(23)()||Object.defineProperty(n(22),"Symbol",{value:n(21),configurable:!0,enumerable:!1,writable:!0})},function(t,e,n){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),n=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var r=Object.getOwnPropertySymbols(t);if(1!==r.length||r[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(t,e,n){"use strict";var r=Array.prototype.slice,o=Object.prototype.toString;t.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==o.call(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var n,i=r.call(arguments,1),c=Math.max(0,e.length-i.length),u=[],l=0;l<c;l++)u.push("$"+l);if(n=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof n){var o=e.apply(this,i.concat(r.call(arguments)));return Object(o)===o?o:this}return e.apply(t,i.concat(r.call(arguments)))}),e.prototype){var a=function(){};a.prototype=e.prototype,n.prototype=new a,a.prototype=null}return n}},function(t,e,n){"use strict";var r=n(26);t.exports=Function.prototype.bind||r},function(t,e,n){"use strict";var r=n(3),o=n(27),i=n(25)(),c=Object,u=o.call(Function.call,Array.prototype.push),l=o.call(Function.call,Object.prototype.propertyIsEnumerable),a=i?Object.getOwnPropertySymbols:null;t.exports=function(t,e){if(void 0===(n=t)||null===n)throw new TypeError("target must be an object");var n,o,s,f,p,y,b,g,h=c(t);for(o=1;o<arguments.length;++o){s=c(arguments[o]),p=r(s);var v=i&&(Object.getOwnPropertySymbols||a);if(v)for(y=v(s),f=0;f<y.length;++f)g=y[f],l(s,g)&&u(p,g);for(f=0;f<p.length;++f)b=s[g=p[f]],l(s,g)&&(h[g]=b)}return h}},function(t,e,n){"use strict";var r=n(28);t.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var t="abcdefghijklmnopqrst",e=t.split(""),n={},r=0;r<e.length;++r)n[e[r]]=e[r];var o=Object.assign({},n),i="";for(var c in o)i+=c;return t!==i}()?r:function(){if(!Object.assign||!Object.preventExtensions)return!1;var t=Object.preventExtensions({1:2});try{Object.assign(t,"xy")}catch(e){return"y"===t[1]}return!1}()?r:Object.assign:r}},function(t,e){var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,e,o){if("[object Function]"!==r.call(e))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var c=0;c<i;c++)e.call(o,t[c],c,t);else for(var u in t)n.call(t,u)&&e.call(o,t[u],u,t)}},function(t,e,n){"use strict";var r=Object.prototype.toString;t.exports=function(t){var e=r.call(t),n="[object Arguments]"===e;return n||(n="[object Array]"!==e&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===r.call(t.callee)),n}},function(t,e,n){"use strict";var r=n(3),o=n(30),i="function"==typeof Symbol&&"symbol"==typeof Symbol(),c=Object.prototype.toString,u=Object.defineProperty&&function(){var t={};try{for(var e in Object.defineProperty(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch(t){return!1}}(),l=function(t,e,n,r){var o;e in t&&("function"!=typeof(o=r)||"[object Function]"!==c.call(o)||!r())||(u?Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n,writable:!0}):t[e]=n)},a=function(t,e){var n=arguments.length>2?arguments[2]:{},c=r(e);i&&(c=c.concat(Object.getOwnPropertySymbols(e))),o(c,function(r){l(t,r,e[r],n[r])})};a.supportsDescriptors=!!u,t.exports=a},function(t,e,n){"use strict";var r=n(32),o=n(29);t.exports=function(){var t=o();return r(Object,{assign:t},{assign:function(){return Object.assign!==t}}),t}},function(t,e,n){"use strict";n(33)(),n(24);var r=n(4),o=n(0),i=n(2),c=new r({name:"default"}),u={default:c},l="undefined"!=typeof window?window.log:null;t.exports=Object.assign(c,{get factories(){return{MethodFactory:o,PrefixFactory:i}},get loggers(){return u},getLogger:function(t){"string"==typeof t&&(t={name:t}),t.id||(t.id=t.name);var e=t,n=e.name,o=e.id,i={level:c.level};if("string"!=typeof n||!n||!n.length)throw new TypeError("You must supply a name when creating a logger.");var l=u[o];return l||(l=new r(Object.assign({},i,t)),u[o]=l),l},noConflict:function(){return"undefined"!=typeof window&&window.log===c&&(window.log=l),c}})}])});
|