-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogger-web.js
1 lines (1 loc) · 9.46 KB
/
logger-web.js
1
module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="./",r(r.s=1)}([function(t,e,r){t.exports=function(){"use strict";var t="millisecond",e="second",r="minute",n="hour",i="day",s="week",o="month",a="year",u=/^(\d{4})-?(\d{1,2})-?(\d{0,2})(.*?(\d{1,2}):(\d{1,2}):(\d{1,2}))?.?(\d{1,3})?$/,c=/\[.*?\]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},h=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},l={padStart:h,padZoneStr:function(t){var e=Math.abs(t),r=Math.floor(e/60),n=e%60;return(t<=0?"+":"-")+h(r,2,"0")+":"+h(n,2,"0")},monthDiff:function(t,e){var r=12*(e.year()-t.year())+(e.month()-t.month()),n=t.clone().add(r,"months"),i=e-n<0,s=t.clone().add(r+(i?-1:1),"months");return Number(-(r+(e-n)/(i?n-s:s-n)))},absFloor:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},prettyUnit:function(u){return{M:o,y:a,w:s,d:i,h:n,m:r,s:e,ms:t}[u]||String(u||"").toLowerCase().replace(/s$/,"")},isUndefined:function(t){return void 0===t}},d="en",$={};$[d]=f;var p=function(t){return t instanceof M},y=function(t,e,r){var n;if(!t)return null;if("string"==typeof t)$[t]&&(n=t),e&&($[t]=e,n=t);else{var i=t.name;$[i]=t,n=i}return r||(d=n),n},m=function(t,e){if(p(t))return t.clone();var r=e||{};return r.date=t,new M(r)},v=function(t,e){return m(t,{locale:e.$L})},g=l;g.parseLocale=y,g.isDayjs=p,g.wrapper=v;var M=function(){function f(t){this.parse(t)}var h=f.prototype;return h.parse=function(t){var e,r;this.$d=null===(e=t.date)?new Date(NaN):g.isUndefined(e)?new Date:e instanceof Date?e:"string"==typeof e&&/.*[^Z]$/i.test(e)&&(r=e.match(u))?new Date(r[1],r[2]-1,r[3]||1,r[5]||0,r[6]||0,r[7]||0,r[8]||0):new Date(e),this.init(t)},h.init=function(t){this.$y=this.$d.getFullYear(),this.$M=this.$d.getMonth(),this.$D=this.$d.getDate(),this.$W=this.$d.getDay(),this.$H=this.$d.getHours(),this.$m=this.$d.getMinutes(),this.$s=this.$d.getSeconds(),this.$ms=this.$d.getMilliseconds(),this.$L=this.$L||y(t.locale,null,!0)||d},h.$utils=function(){return g},h.isValid=function(){return!("Invalid Date"===this.$d.toString())},h.$compare=function(t){return this.valueOf()-m(t).valueOf()},h.isSame=function(t){return 0===this.$compare(t)},h.isBefore=function(t){return this.$compare(t)<0},h.isAfter=function(t){return this.$compare(t)>0},h.year=function(){return this.$y},h.month=function(){return this.$M},h.day=function(){return this.$W},h.date=function(){return this.$D},h.hour=function(){return this.$H},h.minute=function(){return this.$m},h.second=function(){return this.$s},h.millisecond=function(){return this.$ms},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(t,u){var c=this,f=!!g.isUndefined(u)||u,h=function(t,e){var r=v(new Date(c.$y,e,t),c);return f?r:r.endOf(i)},l=function(t,e){return v(c.toDate()[t].apply(c.toDate(),f?[0,0,0,0].slice(e):[23,59,59,999].slice(e)),c)};switch(g.prettyUnit(t)){case a:return f?h(1,0):h(31,11);case o:return f?h(1,this.$M):h(0,this.$M+1);case s:return h(f?this.$D-this.$W:this.$D+(6-this.$W),this.$M);case i:case"date":return l("setHours",0);case n:return l("setMinutes",1);case r:return l("setSeconds",2);case e:return l("setMilliseconds",3);default:return this.clone()}},h.endOf=function(t){return this.startOf(t,!1)},h.$set=function(s,u){switch(g.prettyUnit(s)){case i:this.$d.setDate(this.$D+(u-this.$W));break;case"date":this.$d.setDate(u);break;case o:this.$d.setMonth(u);break;case a:this.$d.setFullYear(u);break;case n:this.$d.setHours(u);break;case r:this.$d.setMinutes(u);break;case e:this.$d.setSeconds(u);break;case t:this.$d.setMilliseconds(u)}return this.init(),this},h.set=function(t,e){return this.clone().$set(t,e)},h.add=function(t,u){var c=this;t=Number(t);var f,h=g.prettyUnit(u),l=function(e,r){var n=c.set("date",1).set(e,r+t);return n.set("date",Math.min(c.$D,n.daysInMonth()))},d=function(e){var r=new Date(c.$d);return r.setDate(r.getDate()+e*t),v(r,c)};if(h===o)return l(o,this.$M);if(h===a)return l(a,this.$y);if(h===i)return d(1);if(h===s)return d(7);switch(h){case r:f=6e4;break;case n:f=36e5;break;case e:f=1e3;break;default:f=1}var $=this.valueOf()+t*f;return v($,this)},h.subtract=function(t,e){return this.add(-1*t,e)},h.format=function(t){var e=this,r=t||"YYYY-MM-DDTHH:mm:ssZ",n=g.padZoneStr(this.$d.getTimezoneOffset()),i=this.$locale(),s=i.weekdays,o=i.months,a=function(t,e,r,n){return t&&t[e]||r[e].substr(0,n)};return r.replace(c,function(t){if(t.indexOf("[")>-1)return t.replace(/\[|\]/g,"");switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return String(e.$y);case"M":return String(e.$M+1);case"MM":return g.padStart(e.$M+1,2,"0");case"MMM":return a(i.monthsShort,e.$M,o,3);case"MMMM":return o[e.$M];case"D":return String(e.$D);case"DD":return g.padStart(e.$D,2,"0");case"d":return String(e.$W);case"dd":return a(i.weekdaysMin,e.$W,s,2);case"ddd":return a(i.weekdaysShort,e.$W,s,3);case"dddd":return s[e.$W];case"H":return String(e.$H);case"HH":return g.padStart(e.$H,2,"0");case"h":case"hh":return 0===e.$H?12:g.padStart(e.$H<13?e.$H:e.$H-12,"hh"===t?2:1,"0");case"a":return e.$H<12?"am":"pm";case"A":return e.$H<12?"AM":"PM";case"m":return String(e.$m);case"mm":return g.padStart(e.$m,2,"0");case"s":return String(e.$s);case"ss":return g.padStart(e.$s,2,"0");case"SSS":return g.padStart(e.$ms,3,"0");case"Z":return n;default:return n.replace(":","")}})},h.diff=function(t,u,c){var f=g.prettyUnit(u),h=m(t),l=this-h,d=g.monthDiff(this,h);switch(f){case a:d/=12;break;case o:break;case"quarter":d/=3;break;case s:d=l/6048e5;break;case i:d=l/864e5;break;case n:d=l/36e5;break;case r:d=l/6e4;break;case e:d=l/1e3;break;default:d=l}return c?d:g.absFloor(d)},h.daysInMonth=function(){return this.endOf(o).$D},h.$locale=function(){return $[this.$L]},h.locale=function(t,e){var r=this.clone();return r.$L=y(t,e,!0),r},h.clone=function(){return v(this.toDate(),this)},h.toDate=function(){return new Date(this.$d)},h.toArray=function(){return[this.$y,this.$M,this.$D,this.$H,this.$m,this.$s,this.$ms]},h.toJSON=function(){return this.toISOString()},h.toISOString=function(){return this.toDate().toISOString()},h.toObject=function(){return{years:this.$y,months:this.$M,date:this.$D,hours:this.$H,minutes:this.$m,seconds:this.$s,milliseconds:this.$ms}},h.toString=function(){return this.$d.toUTCString()},f}();return m.extend=function(t,e){return t(e,M,m),m},m.locale=y,m.isDayjs=p,m.unix=function(t){return m(1e3*t)},m.en=$[d],m}()},function(t,e,r){t.exports=r(2)},function(t,e,r){"use strict";r.r(e);var n,i=r(0),s=r.n(i);!function(t){t[t.FATAL=0]="FATAL",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.INFO=3]="INFO",t[t.DEBUG=4]="DEBUG"}(n||(n={}));var o=function(){function t(t){void 0===t&&(t=n.INFO),this.level=n.INFO,this.level=t}return t.prototype.getCurrentTime=function(){return"["+s()().format("YYYY-MM-DD HH:mm:ss.SSS A")+"]"},t}();r.d(e,"level",function(){return c});var a=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),u=function(t){function e(e){return void 0===e&&(e=n.INFO),t.call(this,e)||this}return a(e,t),e.prototype.fatal=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return!(this.level<n.FATAL)&&console.error.apply(console,["%c "+this.getCurrentTime()+" %c "+n[n.FATAL],"color:red","color:red"].concat(t))},e.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return!(this.level<n.ERROR)&&console.error.apply(console,["%c "+this.getCurrentTime()+" %c "+n[n.ERROR],"color:red","color:red"].concat(t))},e.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return!(this.level<n.WARN)&&console.warn.apply(console,["%c "+this.getCurrentTime()+" %c "+n[n.WARN]+" ","color:yellow","color:yellow","sfsdf"].concat(t))},e.prototype.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return!(this.level<n.INFO)&&console.info.apply(console,["%c "+this.getCurrentTime()+" %c "+n[n.INFO]+" ","color:gray","color:blue"].concat(t))},e.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.info.apply(this,t)},e.prototype.debug=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return!(this.level<n.DEBUG)&&console.log.apply(console,["%c "+this.getCurrentTime()+" %c "+n[n.DEBUG],"color:gray","color:cyan"].concat(t))},e}(o),c=n;e.default=new u}]);