!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("relative-time-format",[],t):"object"==typeof exports?exports["relative-time-format"]=t():e["relative-time-format"]=t()}(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var n="en",o={};function a(){return n}function i(e){return o[e]}function l(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).localeMatcher||"lookup";switch(t){case"lookup":case"best fit":return u(e);default:throw new RangeError('Invalid "localeMatcher" option: '.concat(t))}}function u(e){if(i(e))return e;for(var t=e.split("-");e.length>1;)if(t.pop(),i(e=t.join("-")))return e}function c(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),f(this,"numeric","always"),f(this,"style","long"),f(this,"localeMatcher","lookup");var n=r.numeric,o=r.style,i=r.localeMatcher;if(n){if(h.indexOf(n)<0)throw new RangeError('Invalid "numeric" option: '.concat(n));this.numeric=n}if(o){if(p.indexOf(o)<0)throw new RangeError('Invalid "style" option: '.concat(o));this.style=o}if(i&&(this.localeMatcher=i),"string"==typeof t&&(t=[t]),t.push(a()),this.locale=e.supportedLocalesOf(t,{localeMatcher:this.localeMatcher})[0],!this.locale)throw new TypeError("No supported locale was found");this.locale=l(this.locale,{localeMatcher:this.localeMatcher}),"undefined"!=typeof Intl&&Intl.NumberFormat&&(this.numberFormat=new Intl.NumberFormat(this.locale))}var t,r,n;return t=e,(r=[{key:"format",value:function(e,t){return this.getRule(e,t).replace("{0}",this.formatNumber(Math.abs(e)))}},{key:"formatToParts",value:function(e,t){var r=this.getRule(e,t),n=r.indexOf("{0}");if(n<0)return[{type:"literal",value:r}];var o=[];return n>0&&o.push({type:"literal",value:r.slice(0,n)}),o.push({unit:t,type:"integer",value:this.formatNumber(Math.abs(e))}),n+"{0}".length1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.filter(function(e){return l(e,t)})},d.addLocale=function(e){if(!e)throw new Error("No locale data passed");o[e.locale]=e},d.setDefaultLocale=function(e){n=e},d.getDefaultLocale=a,r.d(t,"default",function(){return d})}])}); //# sourceMappingURL=relative-time-format.min.js.map