(function(){"use strict";var t=function(t){var s={hoursPerDay:24,daysPerWeek:7,weeksPerMonth:4,monthsPerYear:12};t=t||{},this.settings=s;for(var e in t)this.settings[e]=t[e];this.units={s:["s","sec","secs","second","seconds"],m:["m","min","mins","minute","minutes"],h:["h","hr","hrs","hour","hours"],d:["d","day","days"],w:["w","week","weeks"],mth:["mth","mths","month","months"],y:["y","yr","yrs","year","years"]},this.unitValues={s:1,m:60,h:3600},this.unitValues.d=this.settings.hoursPerDay*this.unitValues.h,this.unitValues.w=this.settings.daysPerWeek*this.unitValues.d,this.unitValues.mth=this.settings.weeksPerMonth*this.unitValues.w,this.unitValues.y=this.settings.monthsPerYear*this.unitValues.mth};t.prototype.parse=function(t,s){function e(t){for(var s in r.units)for(var e in r.units[s])if(t===r.units[s][e])return s;throw new Error("The unit ["+t+"] is not supported by timestring")}function i(t,s){var i=r.unitValues[e(s)];return t/i}function n(t,s){var i=r.unitValues[e(s)];return t*i}var r=this,u=0,h=t.toLowerCase().replace(/[^\.\w+-]+/g,"").match(/[-+]?[0-9]+[a-z]+/g);if(null!==h)for(var a=0;a