Socket
Socket
Sign inDemoInstall

angular-l10n

Package Overview
Dependencies
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-l10n - npm Package Compare versions

Comparing version 4.1.5 to 4.2.0

2

bundles/angular-l10n.umd.min.js

@@ -1,1 +0,1 @@

!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("rxjs/Subject"),require("rxjs/Observable"),require("rxjs/BehaviorSubject"),require("rxjs/observable/merge"),require("rxjs/observable/concat"),require("@angular/common/http"),require("rxjs/ReplaySubject"),require("@angular/forms")):"function"==typeof define&&define.amd?define("angular-l10n",["exports","@angular/core","rxjs/Subject","rxjs/Observable","rxjs/BehaviorSubject","rxjs/observable/merge","rxjs/observable/concat","@angular/common/http","rxjs/ReplaySubject","@angular/forms"],factory):factory((global.ng=global.ng||{},global.ng.l10n={}),global.ng.core,global.Rx,global.Rx,global.Rx,global.Rx.Observable,global.Rx.Observable,global.ng.commmon.http,global.Rx,global.ng.forms)}(this,function(exports,core,Subject,Observable,BehaviorSubject,merge,concat,http,ReplaySubject,forms){"use strict";function __extends(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}function __awaiter(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):new P(function(resolve){resolve(result.value)}).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})}function __generator(thisArg,body){function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=y[2&op[0]?"return":op[0]?"throw":"next"])&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[0,t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(t=_.trys,!(t=t.length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g}function isObject(item){return"object"==typeof item&&!Array.isArray(item)}function mergeDeep(target,source){var output=Object.assign({},target);return isObject(target)&&isObject(source)&&Object.keys(source).forEach(function(key){isObject(source[key])?key in target?output[key]=mergeDeep(target[key],source[key]):Object.assign(output,(_a={},_a[key]=source[key],_a)):Object.assign(output,(_b={},_b[key]=source[key],_b));var _a,_b}),output}function intlDateTimeFormat(date,defaultLocale,options,timezone){return options.timeZone=IntlAPI.hasTimezone()?timezone:"UTC",new Intl.DateTimeFormat(defaultLocale,options).format(date).replace(/[\u200e\u200f]/g,"")}function datePartFactory(options){return function(date,defaultLocale,timezone){return intlDateTimeFormat(date,defaultLocale,options,timezone)}}function combine(options){return options.reduce(function(merged,opt){return __assign({},merged,opt)},{})}function digitCondition(prop,len){var result={};return result[prop]=2===len?"2-digit":"numeric",result}function nameCondition(prop,len){var result={};return result[prop]=len<4?len>1?"short":"narrow":"long",result}function l10nValidateNumber(digits,MIN_VALUE,MAX_VALUE){void 0===MIN_VALUE&&(MIN_VALUE=Number.MIN_VALUE),void 0===MAX_VALUE&&(MAX_VALUE=Number.MAX_VALUE);var defaultLocale,NUMBER_REGEXP,locale=InjectorRef.get(LocaleService),localeValidation=InjectorRef.get(LocaleValidation);return function(formControl){if(null==formControl.value||""==formControl.value)return null;if(defaultLocale!=locale.getDefaultLocale()&&(NUMBER_REGEXP=localeValidation.getRegExp(digits),defaultLocale=locale.getDefaultLocale()),NUMBER_REGEXP.test(formControl.value)){var parsedValue=localeValidation.parseNumber(formControl.value);return null!=parsedValue&&parsedValue<MIN_VALUE?{minValue:{valid:!1}}:null!=parsedValue&&parsedValue>MAX_VALUE?{maxValue:{valid:!1}}:null}return{format:{valid:!1}}}}var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},InjectorRef=function(){function InjectorRef(injector){this.injector=injector,InjectorRef.injector=this.injector}return InjectorRef.get=function(token){return InjectorRef.injector.get(token)},InjectorRef.injector=null,InjectorRef.decorators=[{type:core.Injectable}],InjectorRef.ctorParameters=function(){return[{type:core.Injector}]},InjectorRef}(),StorageStrategy={Session:0,Local:1,Cookie:2,Disabled:3};StorageStrategy[StorageStrategy.Session]="Session",StorageStrategy[StorageStrategy.Local]="Local",StorageStrategy[StorageStrategy.Cookie]="Cookie",StorageStrategy[StorageStrategy.Disabled]="Disabled";var ProviderType={Fallback:0,Static:1,WebAPI:2};ProviderType[ProviderType.Fallback]="Fallback",ProviderType[ProviderType.Static]="Static",ProviderType[ProviderType.WebAPI]="WebAPI";var ISOCode={Language:0,Country:1,Script:2};ISOCode[ISOCode.Language]="Language",ISOCode[ISOCode.Country]="Country",ISOCode[ISOCode.Script]="Script";var LoadingMode={Direct:0,Async:1};LoadingMode[LoadingMode.Direct]="Direct",LoadingMode[LoadingMode.Async]="Async";var ServiceState={isReady:0,isLoading:1,isWaiting:2};ServiceState[ServiceState.isReady]="isReady",ServiceState[ServiceState.isLoading]="isLoading",ServiceState[ServiceState.isWaiting]="isWaiting";var NumberFormatStyle={Decimal:0,Percent:1,Currency:2};NumberFormatStyle[NumberFormatStyle.Decimal]="Decimal",NumberFormatStyle[NumberFormatStyle.Percent]="Percent",NumberFormatStyle[NumberFormatStyle.Currency]="Currency";var LOCALE_CONFIG=new core.InjectionToken("LOCALE_CONFIG"),TRANSLATION_CONFIG=new core.InjectionToken("TRANSLATION_CONFIG"),IntlAPI=function(){function IntlAPI(){}return IntlAPI.hasIntl=function(){return"object"==typeof Intl&&!!Intl},IntlAPI.hasDateTimeFormat=function(){return IntlAPI.hasIntl()&&Intl.hasOwnProperty("DateTimeFormat")},IntlAPI.hasTimezone=function(){if(IntlAPI.hasIntl()&&IntlAPI.hasDateTimeFormat()){try{new Intl.DateTimeFormat("en-US",{timeZone:"America/Los_Angeles"}).format(new Date)}catch(e){return!1}return!0}return!1},IntlAPI.hasNumberFormat=function(){return IntlAPI.hasIntl()&&Intl.hasOwnProperty("NumberFormat")},IntlAPI.hasCollator=function(){return IntlAPI.hasIntl()&&Intl.hasOwnProperty("Collator")},IntlAPI}(),LocaleStorage=function(){function LocaleStorage(){}return LocaleStorage.decorators=[{type:core.Injectable}],LocaleStorage.ctorParameters=function(){return[]},LocaleStorage}(),BrowserStorage=function(){function BrowserStorage(configuration){this.configuration=configuration,this.hasCookie="undefined"!=typeof navigator&&navigator.cookieEnabled,this.hasStorage="undefined"!=typeof Storage}return BrowserStorage.prototype.read=function(name){return __awaiter(this,void 0,void 0,function(){var value;return __generator(this,function(_a){return value=null,this.configuration.storage!=StorageStrategy.Disabled&&(this.configuration.storage==StorageStrategy.Local&&this.hasStorage?value=this.getLocalStorage(name):this.configuration.storage==StorageStrategy.Session&&this.hasStorage?value=this.getSessionStorage(name):this.configuration.storage==StorageStrategy.Cookie&&this.hasCookie&&(value=this.getCookie(name))),[2,value]})})},BrowserStorage.prototype.write=function(name,value){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return this.configuration.storage!=StorageStrategy.Disabled&&(this.configuration.storage==StorageStrategy.Local&&this.hasStorage?this.setLocalStorage(name,value):this.configuration.storage==StorageStrategy.Session&&this.hasStorage?this.setSessionStorage(name,value):this.configuration.storage==StorageStrategy.Cookie&&this.hasCookie&&this.setCookie(name,value)),[2]})})},BrowserStorage.prototype.getLocalStorage=function(name){return localStorage.getItem(name)},BrowserStorage.prototype.getSessionStorage=function(name){return sessionStorage.getItem(name)},BrowserStorage.prototype.getCookie=function(name){var result=null;return"undefined"!=typeof document&&(result=new RegExp("(?:^|; )"+encodeURIComponent(name)+"=([^;]*)").exec(document.cookie)),result?result[1]:null},BrowserStorage.prototype.setLocalStorage=function(name,value){localStorage.setItem(name,value)},BrowserStorage.prototype.setSessionStorage=function(name,value){sessionStorage.setItem(name,value)},BrowserStorage.prototype.setCookie=function(name,value){var expires="";if(null!=this.configuration.cookieExpiration){var expirationDate=new Date;expirationDate.setTime(expirationDate.getTime()+24*this.configuration.cookieExpiration*60*60*1e3),expires="; expires="+expirationDate.toUTCString()}"undefined"!=typeof document&&(document.cookie=name+"="+value+expires+"; path=/")},BrowserStorage.decorators=[{type:core.Injectable}],BrowserStorage.ctorParameters=function(){return[{type:void 0,decorators:[{type:core.Inject,args:[LOCALE_CONFIG]}]}]},BrowserStorage}(),DefaultLocale=function(){function DefaultLocale(){}return Object.defineProperty(DefaultLocale.prototype,"value",{get:function(){return this._value},set:function(defaultLocale){this._value=defaultLocale,this.parseValue()},enumerable:!0,configurable:!0}),DefaultLocale.prototype.build=function(languageCode,countryCode,scriptCode,numberingSystem,calendar){this.languageCode=languageCode,this.scriptCode=scriptCode,this.countryCode=countryCode,this.numberingSystem=numberingSystem,this.calendar=calendar;var value=[];value.push(languageCode),value.push(scriptCode?"-"+scriptCode:""),value.push(countryCode?"-"+countryCode:""),value.push(numberingSystem||calendar?"-u":""),value.push(numberingSystem?"-nu-"+numberingSystem:""),value.push(calendar?"-ca-"+calendar:""),this._value=value.join("")},DefaultLocale.prototype.parseValue=function(){if(this.value){var value=this.value,index=value.search("-u");if(-1!=index){var extensions=value.substring(index+1).split("-");switch(extensions.length){case 3:"nu"==extensions[1]?this.numberingSystem=extensions[2]:"ca"==extensions[1]&&(this.calendar=extensions[2]);break;default:this.numberingSystem=extensions[2],this.calendar=extensions[4]}value=value.substring(0,index)}var codes=value.split("-");switch(codes.length){case 1:this.languageCode=codes[0];break;case 2:this.languageCode=codes[0],this.countryCode=codes[1];break;default:this.languageCode=codes[0],this.scriptCode=codes[1],this.countryCode=codes[2]}}},DefaultLocale}(),LocaleService=function(){function LocaleService(configuration,storage){this.configuration=configuration,this.storage=storage,this.languageCodeChanged=new core.EventEmitter(!0),this.defaultLocaleChanged=new core.EventEmitter(!0),this.currencyCodeChanged=new core.EventEmitter(!0),this.timezoneChanged=new core.EventEmitter(!0),this.loadTranslation=new Subject.Subject,this.defaultLocale=new DefaultLocale}return LocaleService.prototype.getConfiguration=function(){return this.configuration},LocaleService.prototype.init=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.initStorage()];case 1:return _a.sent(),this.configuration.defaultLocale?this.initDefaultLocale():this.configuration.language&&this.initLanguage(),this.configuration.currency&&this.initCurrency(),this.configuration.timezone&&this.initTimezone(),[2]}})})},LocaleService.prototype.getBrowserLanguage=function(){var browserLanguage=null;if("undefined"!=typeof navigator&&navigator.language&&(browserLanguage=navigator.language),null!=browserLanguage){var index=browserLanguage.indexOf("-");-1!=index&&(browserLanguage=browserLanguage.substring(0,index))}return browserLanguage},LocaleService.prototype.getAvailableLanguages=function(){var languages=[];return this.configuration.languages&&(languages=this.configuration.languages.map(function(language){return language.code})),languages},LocaleService.prototype.getLanguageDirection=function(languageCode){return void 0===languageCode&&(languageCode=this.defaultLocale.languageCode),this.matchLanguage(languageCode)[0].dir},LocaleService.prototype.getCurrentLanguage=function(){return this.defaultLocale.languageCode},LocaleService.prototype.getCurrentCountry=function(){return this.defaultLocale.countryCode?this.defaultLocale.countryCode:""},LocaleService.prototype.getCurrentScript=function(){return this.defaultLocale.scriptCode?this.defaultLocale.scriptCode:""},LocaleService.prototype.getCurrentLocale=function(){return this.defaultLocale.countryCode?this.defaultLocale.languageCode+"-"+this.defaultLocale.countryCode:this.defaultLocale.languageCode},LocaleService.prototype.getCurrentNumberingSystem=function(){return this.defaultLocale.numberingSystem?this.defaultLocale.numberingSystem:""},LocaleService.prototype.getCurrentCalendar=function(){return this.defaultLocale.calendar?this.defaultLocale.calendar:""},LocaleService.prototype.getDefaultLocale=function(){return this.defaultLocale.value},LocaleService.prototype.getCurrentCurrency=function(){return this.currencyCode},LocaleService.prototype.getCurrencySymbol=function(currencyDisplay,defaultLocale,currency){void 0===currencyDisplay&&(currencyDisplay="symbol"),void 0===defaultLocale&&(defaultLocale=this.defaultLocale.value),void 0===currency&&(currency=this.currencyCode);var currencySymbol=this.currencyCode;if(IntlAPI.hasNumberFormat()){var localeZero=new Intl.NumberFormat(defaultLocale).format(0);currencySymbol=(currencySymbol=new Intl.NumberFormat(defaultLocale,{style:"currency",currency:currency,currencyDisplay:currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0}).format(0).replace(localeZero,"")).trim()}return currencySymbol},LocaleService.prototype.getCurrentTimezone=function(){return this.timezone},LocaleService.prototype.setCurrentLanguage=function(languageCode){this.defaultLocale.languageCode!=languageCode&&(this.defaultLocale.build(languageCode),this.storage.write("defaultLocale",this.defaultLocale.value),this.sendLanguageEvents(),this.sendTranslationEvents())},LocaleService.prototype.setDefaultLocale=function(languageCode,countryCode,scriptCode,numberingSystem,calendar){this.defaultLocale.languageCode==languageCode&&this.defaultLocale.countryCode==countryCode&&this.defaultLocale.scriptCode==scriptCode&&this.defaultLocale.numberingSystem==numberingSystem&&this.defaultLocale.calendar==calendar||(this.defaultLocale.build(languageCode,countryCode,scriptCode,numberingSystem,calendar),this.storage.write("defaultLocale",this.defaultLocale.value),this.sendDefaultLocaleEvents(),this.sendTranslationEvents())},LocaleService.prototype.setCurrentCurrency=function(currencyCode){this.currencyCode!=currencyCode&&(this.currencyCode=currencyCode,this.storage.write("currency",this.currencyCode),this.sendCurrencyEvents())},LocaleService.prototype.setCurrentTimezone=function(zoneName){this.timezone!=zoneName&&(this.timezone=zoneName,this.storage.write("timezone",this.timezone),this.sendTimezoneEvents())},LocaleService.prototype.initStorage=function(){return __awaiter(this,void 0,void 0,function(){var defaultLocale,currencyCode,zoneName;return __generator(this,function(_a){switch(_a.label){case 0:return this.defaultLocale.value?[3,2]:[4,this.storage.read("defaultLocale")];case 1:(defaultLocale=_a.sent())&&(this.defaultLocale.value=defaultLocale),_a.label=2;case 2:return null!=this.currencyCode?[3,4]:[4,this.storage.read("currency")];case 3:(currencyCode=_a.sent())&&(this.currencyCode=currencyCode),_a.label=4;case 4:return null!=this.timezone?[3,6]:[4,this.storage.read("timezone")];case 5:(zoneName=_a.sent())&&(this.timezone=zoneName),_a.label=6;case 6:return[2]}})})},LocaleService.prototype.initLanguage=function(){if(!this.defaultLocale.languageCode){var browserLanguage=this.getBrowserLanguage(),matchedLanguages=[];browserLanguage&&(matchedLanguages=this.matchLanguage(browserLanguage)),browserLanguage&&matchedLanguages.length>0?this.defaultLocale.build(browserLanguage):this.configuration.language&&this.defaultLocale.build(this.configuration.language),this.storage.write("defaultLocale",this.defaultLocale.value)}this.sendLanguageEvents()},LocaleService.prototype.initDefaultLocale=function(){this.defaultLocale.value||this.configuration.defaultLocale&&(this.defaultLocale.build(this.configuration.defaultLocale.languageCode,this.configuration.defaultLocale.countryCode,this.configuration.defaultLocale.scriptCode,this.configuration.defaultLocale.numberingSystem,this.configuration.defaultLocale.calendar),this.storage.write("defaultLocale",this.defaultLocale.value)),this.sendDefaultLocaleEvents()},LocaleService.prototype.initCurrency=function(){null==this.currencyCode&&this.configuration.currency&&(this.currencyCode=this.configuration.currency,this.storage.write("currency",this.currencyCode)),this.sendCurrencyEvents()},LocaleService.prototype.initTimezone=function(){null==this.timezone&&this.configuration.timezone&&(this.timezone=this.configuration.timezone,this.storage.write("timezone",this.timezone)),this.sendCurrencyEvents()},LocaleService.prototype.matchLanguage=function(languageCode){var matchedLanguages=[];return this.configuration.languages&&(matchedLanguages=this.configuration.languages.filter(function(language){return language.code==languageCode})),matchedLanguages},LocaleService.prototype.sendLanguageEvents=function(){this.languageCodeChanged.emit(this.defaultLocale.languageCode)},LocaleService.prototype.sendDefaultLocaleEvents=function(){this.defaultLocaleChanged.emit(this.defaultLocale.value)},LocaleService.prototype.sendCurrencyEvents=function(){this.currencyCodeChanged.emit(this.currencyCode)},LocaleService.prototype.sendTimezoneEvents=function(){this.timezoneChanged.emit(this.timezone)},LocaleService.prototype.sendTranslationEvents=function(){this.loadTranslation.next()},LocaleService.decorators=[{type:core.Injectable}],LocaleService.ctorParameters=function(){return[{type:void 0,decorators:[{type:core.Inject,args:[LOCALE_CONFIG]}]},{type:LocaleStorage}]},LocaleService.propDecorators={languageCodeChanged:[{type:core.Output}],defaultLocaleChanged:[{type:core.Output}],currencyCodeChanged:[{type:core.Output}],timezoneChanged:[{type:core.Output}]},LocaleService}(),TranslationProvider=function(){function TranslationProvider(){}return TranslationProvider.decorators=[{type:core.Injectable}],TranslationProvider.ctorParameters=function(){return[]},TranslationProvider}(),HttpTranslationProvider=function(){function HttpTranslationProvider(configuration,http$$1){this.configuration=configuration,this.http=http$$1,this.cache={}}return HttpTranslationProvider.prototype.getTranslation=function(language,args){var url="";switch(args.type){case ProviderType.WebAPI:url+=args.path+language;break;default:url+=args.prefix+language+".json"}return this.configuration.caching?this.caching(url,this.http.get(url)):this.http.get(url)},HttpTranslationProvider.prototype.caching=function(key,request){if(this.cache[key])return this.cache[key];var buffer=new ReplaySubject.ReplaySubject(1);request.subscribe(function(value){return buffer.next(value)},function(error){return buffer.error(error)},function(){return buffer.complete()});var response=buffer.asObservable();return this.cache[key]=response,response},HttpTranslationProvider.decorators=[{type:core.Injectable}],HttpTranslationProvider.ctorParameters=function(){return[{type:void 0,decorators:[{type:core.Inject,args:[TRANSLATION_CONFIG]}]},{type:http.HttpClient}]},HttpTranslationProvider}(),TranslationHandler=function(){function TranslationHandler(){}return TranslationHandler.decorators=[{type:core.Injectable}],TranslationHandler.ctorParameters=function(){return[]},TranslationHandler}(),DefaultTranslationHandler=function(){function DefaultTranslationHandler(configuration){this.configuration=configuration}return DefaultTranslationHandler.prototype.parseValue=function(path,key,value,args,lang){return null==value?this.handleMissingValue(path):args?this.handleArgs(value,args):value},DefaultTranslationHandler.prototype.handleMissingValue=function(path){return this.configuration.missingValue?"function"==typeof this.configuration.missingValue?this.configuration.missingValue(path):this.configuration.missingValue:path},DefaultTranslationHandler.prototype.handleArgs=function(value,args){return value.replace(/{{\s?([^{}\s]*)\s?}}/g,function(substring,parsedKey){var replacer=args[parsedKey];return void 0!==replacer?replacer:substring})},DefaultTranslationHandler.decorators=[{type:core.Injectable}],DefaultTranslationHandler.ctorParameters=function(){return[{type:void 0,decorators:[{type:core.Inject,args:[TRANSLATION_CONFIG]}]}]},DefaultTranslationHandler}(),TranslationService=function(){function TranslationService(configuration,locale,translationProvider,translationHandler){this.configuration=configuration,this.locale=locale,this.translationProvider=translationProvider,this.translationHandler=translationHandler,this.translationError=new Subject.Subject,this.translation=new BehaviorSubject.BehaviorSubject(""),this.translationData={},this.serviceState=ServiceState.isWaiting}return TranslationService.prototype.getConfiguration=function(){return this.configuration},TranslationService.prototype.init=function(){return __awaiter(this,void 0,void 0,function(){var translations,_i,translations_1,translation,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:if(this.configuration.providers)this.loadingMode=LoadingMode.Async;else if(this.loadingMode=LoadingMode.Direct,this.configuration.translationData)for(translations=this.configuration.translationData,_i=0,translations_1=translations;_i<translations_1.length;_i++)translation=translations_1[_i],this.addData(translation.data,translation.languageCode);return this.locale.loadTranslation.subscribe(function(){_this.loadTranslation()}),[4,this.loadTranslation()];case 1:return _a.sent(),[2]}})})},TranslationService.prototype.translationChanged=function(){return this.translation.asObservable()},TranslationService.prototype.translate=function(keys,args,lang){if(void 0===args&&(args=null),void 0===lang&&(lang=this.translation.getValue()),this.serviceState!=ServiceState.isReady)return keys;if(Array.isArray(keys)){for(var data={},_i=0,keys_1=keys;_i<keys_1.length;_i++){var key=keys_1[_i];data[key]=this.translateKey(key,args,lang)}return data}return this.translateKey(keys,args,lang)},TranslationService.prototype.translateAsync=function(keys,args,lang){var _this=this;return void 0===lang&&(lang=this.translation.getValue()),Observable.Observable.create(function(observer){var values=_this.translate(keys,args,lang);observer.next(values),observer.complete()})},TranslationService.prototype.translateKey=function(key,args,lang){return null==key||""==key?null:this.configuration.i18nPlural&&/^\d+\b/.exec(key)?this.translateI18nPlural(key,args,lang):this.getValue(key,args,lang)},TranslationService.prototype.getValue=function(key,args,lang){var path=key,value=null,translation=this.translationData[lang];if(translation){if(this.configuration.composedKeySeparator){var sequences=key.split(this.configuration.composedKeySeparator);for(key=sequences.shift();sequences.length>0&&translation[key];)translation=translation[key],key=sequences.shift()}value=translation[key]||translation[this.configuration.missingKey||""]}return this.translationHandler.parseValue(path,key,value,args,lang)},TranslationService.prototype.translateI18nPlural=function(key,args,lang){var keyText=key.replace(/^\d+\b/,"");keyText=keyText.trim();var keyNumber=parseFloat(key);return(key=key.replace(/^\d+/,this.translateNumber(keyNumber))).replace(keyText,this.getValue(keyText,args,lang))},TranslationService.prototype.translateNumber=function(keyNumber){return!isNaN(keyNumber)&&IntlAPI.hasNumberFormat()?new Intl.NumberFormat(this.translation.getValue()).format(keyNumber):keyNumber.toString()},TranslationService.prototype.loadTranslation=function(){return __awaiter(this,void 0,void 0,function(){var language;return __generator(this,function(_a){switch(_a.label){case 0:return null==(language=this.configuration.composedLanguage?this.composeLanguage(this.configuration.composedLanguage):this.locale.getCurrentLanguage())||language==this.translation.getValue()?[3,3]:this.loadingMode!=LoadingMode.Async?[3,2]:[4,this.getTranslation(language).toPromise()];case 1:return _a.sent(),[3,3];case 2:this.releaseTranslation(language),_a.label=3;case 3:return[2]}})})},TranslationService.prototype.composeLanguage=function(composedLanguage){var language="";if(composedLanguage.length>0)for(var i=0;i<=composedLanguage.length-1;i++){switch(composedLanguage[i]){case ISOCode.Script:language+=this.locale.getCurrentScript();break;case ISOCode.Country:language+=this.locale.getCurrentCountry();break;default:language+=this.locale.getCurrentLanguage()}i<composedLanguage.length-1&&(language+="-")}return language},TranslationService.prototype.getTranslation=function(language){var _this=this;return Observable.Observable.create(function(observer){_this.translationData={},_this.serviceState=ServiceState.isLoading;for(var sequencesOfOrderedTranslationData=[],sequencesOfTranslationData=[],_i=0,_a=_this.configuration.providers;_i<_a.length;_i++){var provider=_a[_i];if(void 0!==provider.type&&provider.type==ProviderType.Fallback){var fallbackLanguage=language;provider.fallbackLanguage&&(fallbackLanguage=_this.composeLanguage(provider.fallbackLanguage)),sequencesOfOrderedTranslationData.push(_this.translationProvider.getTranslation(fallbackLanguage,provider))}else sequencesOfTranslationData.push(_this.translationProvider.getTranslation(language,provider))}var mergedSequencesOfTranslationData=merge.merge.apply(void 0,sequencesOfTranslationData);sequencesOfOrderedTranslationData.push(mergedSequencesOfTranslationData),concat.concat.apply(void 0,sequencesOfOrderedTranslationData).subscribe(function(data){_this.addData(data,language)},function(error){_this.translationError.next(error),_this.releaseTranslation(language),observer.next(null),observer.complete()},function(){_this.releaseTranslation(language),observer.next(null),observer.complete()})})},TranslationService.prototype.addData=function(data,language){this.translationData[language]=void 0!==this.translationData[language]?mergeDeep(this.translationData[language],data):data},TranslationService.prototype.releaseTranslation=function(language){this.serviceState=ServiceState.isReady,this.sendEvents(language)},TranslationService.prototype.sendEvents=function(language){this.translation.next(language)},TranslationService.decorators=[{type:core.Injectable}],TranslationService.ctorParameters=function(){return[{type:void 0,decorators:[{type:core.Inject,args:[TRANSLATION_CONFIG]}]},{type:LocaleService},{type:TranslationProvider},{type:TranslationHandler}]},TranslationService}(),L10nLoader=function(){function L10nLoader(localeConfig,translationConfig,locale,translation){this.localeConfig=localeConfig,this.translationConfig=translationConfig,this.locale=locale,this.translation=translation}return L10nLoader.prototype.load=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return Object.keys(this.localeConfig).length>0?[4,this.locale.init()]:[3,2];case 1:_a.sent(),_a.label=2;case 2:return Object.keys(this.translationConfig).length>0?[4,this.translation.init()]:[3,4];case 3:_a.sent(),_a.label=4;case 4:return[2]}})})},L10nLoader.decorators=[{type:core.Injectable}],L10nLoader.ctorParameters=function(){return[{type:void 0,decorators:[{type:core.Inject,args:[LOCALE_CONFIG]}]},{type:void 0,decorators:[{type:core.Inject,args:[TRANSLATION_CONFIG]}]},{type:LocaleService},{type:TranslationService}]},L10nLoader}(),Translation=function(){function Translation(changeDetectorRef){var _this=this;this.changeDetectorRef=changeDetectorRef,this.paramSubscriptions=[],this.translation=InjectorRef.get(TranslationService),this.paramSubscriptions.push(this.translation.translationChanged().subscribe(function(language){_this.lang=language,_this.changeDetectorRef&&_this.changeDetectorRef.markForCheck()}))}return Translation.prototype.cancelParamSubscriptions=function(){this.paramSubscriptions.forEach(function(subscription){void 0!==subscription&&subscription.unsubscribe()})},Translation.decorators=[{type:core.Injectable}],Translation.ctorParameters=function(){return[{type:core.ChangeDetectorRef}]},Translation}(),Localization=function(_super){function Localization(changeDetectorRef){var _this=_super.call(this)||this;return _this.changeDetectorRef=changeDetectorRef,_this.locale=InjectorRef.get(LocaleService),_this.defaultLocale=_this.locale.getDefaultLocale(),_this.paramSubscriptions.push(_this.locale.defaultLocaleChanged.subscribe(function(defaultLocale){_this.defaultLocale=defaultLocale,_this.changeDetectorRef&&_this.changeDetectorRef.markForCheck()})),_this.currency=_this.locale.getCurrentCurrency(),_this.paramSubscriptions.push(_this.locale.currencyCodeChanged.subscribe(function(currency){_this.currency=currency,_this.changeDetectorRef&&_this.changeDetectorRef.markForCheck()})),_this.timezone=_this.locale.getCurrentTimezone(),_this.paramSubscriptions.push(_this.locale.timezoneChanged.subscribe(function(zoneName){_this.timezone=zoneName,_this.changeDetectorRef&&_this.changeDetectorRef.markForCheck()})),_this}return __extends(Localization,_super),Localization.decorators=[{type:core.Injectable}],Localization.ctorParameters=function(){return[{type:core.ChangeDetectorRef}]},Localization}(Translation),LocaleValidation=function(){function LocaleValidation(locale){this.locale=locale}return LocaleValidation.prototype.parseNumber=function(s,defaultLocale){if(void 0===defaultLocale&&(defaultLocale=this.locale.getDefaultLocale()),""==s||null==s)return null;for(var value="",decimalCode=this.getDecimalCode(defaultLocale),numberCodes=this.getNumberCodes(defaultLocale),_i=0,characters_1=s.split("");_i<characters_1.length;_i++){var char=characters_1[_i],charCode=this.toUnicode(char),index=numberCodes.indexOf(charCode);if(-1!=index)value+=index;else if(charCode==decimalCode.minusSign)value+="-";else{if(charCode!=decimalCode.decimalSeparator){if(charCode==decimalCode.thousandSeparator)continue;return NaN}value+="."}}return parseFloat(value)},LocaleValidation.prototype.getRegExp=function(digits,defaultLocale){void 0===defaultLocale&&(defaultLocale=this.locale.getDefaultLocale());var minInt=1,minFraction=0,maxFraction=3;if(digits){var parts=digits.match(/^(\d+)?\.((\d+)(\-(\d+))?)?$/);null!=parts&&(null!=parts[1]&&(minInt=parseInt(parts[1])),null!=parts[3]&&(minFraction=parseInt(parts[3])),null!=parts[5]&&(maxFraction=parseInt(parts[5])))}var decimalCode=this.getDecimalCode(defaultLocale),numberCodes=this.getNumberCodes(defaultLocale),minusSign=decimalCode.minusSign,zero=numberCodes[0],decimalSeparator=decimalCode.decimalSeparator,thousandSeparator=decimalCode.thousandSeparator,d="["+zero+"-"+numberCodes[9]+"]",n="{"+minInt+",}",nm="{"+minFraction+","+maxFraction+"}",pattern="^"+minusSign+"?("+(""+d+n)+"|"+("(?=(?:\\"+thousandSeparator+"*"+d+")"+n+"(\\"+decimalSeparator+"|$))(?!"+zero+"(?!\\"+decimalSeparator+"|"+d+"))"+d+"{1,3}(\\"+thousandSeparator+d+"{3})*")+")";return pattern+=minFraction>0&&maxFraction>0?"\\"+decimalSeparator+d+nm+"$":0==minFraction&&maxFraction>0?"(\\"+decimalSeparator+d+nm+")?$":"$",pattern=this.toChar(pattern),new RegExp(pattern)},LocaleValidation.prototype.getDecimalCode=function(defaultLocale){var decimalCode={minusSign:this.toUnicode("-"),decimalSeparator:this.toUnicode("."),thousandSeparator:this.toUnicode(",")};if(IntlAPI.hasNumberFormat()){for(var localeValue=new Intl.NumberFormat(defaultLocale).format(-1000.9),unicodeChars=[],i=0;i<=7;i++)unicodeChars.push(this.toUnicode(localeValue.charAt(i)));decimalCode="\\u200F"==unicodeChars[0]||"\\u061C"==unicodeChars[0]?{minusSign:unicodeChars[1],decimalSeparator:unicodeChars[7],thousandSeparator:unicodeChars[3]}:unicodeChars[0]==this.toUnicode(new Intl.NumberFormat(defaultLocale).format(1))?{minusSign:unicodeChars[7],decimalSeparator:unicodeChars[5],thousandSeparator:unicodeChars[1]}:"\\u200E"==unicodeChars[0]?{minusSign:unicodeChars[1],decimalSeparator:unicodeChars[7],thousandSeparator:unicodeChars[3]}:{minusSign:unicodeChars[0],decimalSeparator:unicodeChars[6],thousandSeparator:unicodeChars[2]}}return decimalCode},LocaleValidation.prototype.getNumberCodes=function(defaultLocale){for(var numberCodes=[],num=0;num<=9;num++)numberCodes.push(this.toUnicode(num.toString()));if(IntlAPI.hasNumberFormat())for(num=0;num<=9;num++)numberCodes[num]=this.toUnicode(new Intl.NumberFormat(defaultLocale).format(num));return numberCodes},LocaleValidation.prototype.toChar=function(pattern){return pattern.replace(/\\u[\dA-F]{4}/gi,function(match){return String.fromCharCode(parseInt(match.replace(/\\u/g,""),16))})},LocaleValidation.prototype.toUnicode=function(c){return"\\u"+this.toHex(c.charCodeAt(0))},LocaleValidation.prototype.toHex=function(value){var hex=value.toString(16).toUpperCase();return hex="0000".substr(0,4-hex.length)+hex},LocaleValidation.decorators=[{type:core.Injectable}],LocaleValidation.ctorParameters=function(){return[{type:LocaleService}]},LocaleValidation}(),Collator=function(){function Collator(locale,translation){this.locale=locale,this.translation=translation}return Collator.prototype.compare=function(key1,key2,extension,options){if(void 0===options&&(options={usage:"sort",sensitivity:"variant"}),!IntlAPI.hasCollator())return 0;var value1=this.translation.translate(key1),value2=this.translation.translate(key2),locale=this.addExtension(this.locale.getCurrentLocale(),extension);return new Intl.Collator(locale,options).compare(value1,value2)},Collator.prototype.sort=function(list,keyName,order,extension,options){var _this=this;return void 0===order&&(order="asc"),void 0===options&&(options={usage:"sort",sensitivity:"variant"}),list&&keyName&&IntlAPI.hasCollator()?(list.sort(function(key1,key2){return _this.compare(key1[keyName],key2[keyName],extension,options)}),"desc"==order&&list.reverse(),list):list},Collator.prototype.sortAsync=function(list,keyName,order,extension,options){var _this=this;return void 0===options&&(options={usage:"sort",sensitivity:"variant"}),Observable.Observable.create(function(observer){observer.next(_this.sort(list,keyName,order,extension,options)),observer.complete()})},Collator.prototype.search=function(s,list,keyNames,options){var _this=this;if(void 0===options&&(options={usage:"search"}),!list||!keyNames||""==s||null==s||!IntlAPI.hasCollator())return list;var locale=this.locale.getCurrentLocale(),collator=new Intl.Collator(locale,options);return list.filter(function(key){for(var found=!1,i=0;i<keyNames.length;i++)if(_this.match(key[keyNames[i]],s,collator)){found=!0;break}return found})},Collator.prototype.searchAsync=function(s,list,keyNames,options){var _this=this;return void 0===options&&(options={usage:"search"}),Observable.Observable.create(function(observer){observer.next(_this.search(s,list,keyNames,options)),observer.complete()})},Collator.prototype.addExtension=function(locale,extension){return extension&&(locale=locale+"-u-"+extension),locale},Collator.prototype.match=function(key,s,collator){var value=this.translation.translate(key),valueLength=value.length,sLength=s.length;if(sLength>valueLength)return!1;if(sLength==valueLength)return 0==collator.compare(value,s);for(var found=!1,i=0;i<valueLength-(sLength-1);i++){var str=value.substr(i,sLength);if(0==collator.compare(str,s)){found=!0;break}}return found},Collator.decorators=[{type:core.Injectable}],Collator.ctorParameters=function(){return[{type:LocaleService},{type:TranslationService}]},Collator}(),TranslatePipe=function(){function TranslatePipe(translation){this.translation=translation}return TranslatePipe.prototype.transform=function(key,lang,args){return this.translation.translate(key,args,lang)},TranslatePipe.decorators=[{type:core.Pipe,args:[{name:"translate",pure:!0}]}],TranslatePipe.ctorParameters=function(){return[{type:TranslationService}]},TranslatePipe}(),FORMAT_ALIASES={short:datePartFactory(combine([digitCondition("year",1),digitCondition("month",1),digitCondition("day",1),digitCondition("hour",1),digitCondition("minute",1)])),medium:datePartFactory(combine([digitCondition("year",1),nameCondition("month",3),digitCondition("day",1),digitCondition("hour",1),digitCondition("minute",1),digitCondition("second",1)])),shortDate:datePartFactory(combine([digitCondition("year",1),digitCondition("month",1),digitCondition("day",1)])),mediumDate:datePartFactory(combine([digitCondition("year",1),nameCondition("month",3),digitCondition("day",1)])),longDate:datePartFactory(combine([digitCondition("year",1),nameCondition("month",4),digitCondition("day",1)])),fullDate:datePartFactory(combine([digitCondition("year",1),nameCondition("month",4),nameCondition("weekday",4),digitCondition("day",1)])),shortTime:datePartFactory(combine([digitCondition("hour",1),digitCondition("minute",1)])),mediumTime:datePartFactory(combine([digitCondition("hour",1),digitCondition("second",1),digitCondition("minute",1)]))},IntlFormatter=function(){function IntlFormatter(){}return IntlFormatter.formatNumber=function(num,defaultLocale,style,digits,currency,currencyDisplay){var minInt,minFraction,maxFraction;if(style!==NumberFormatStyle.Currency&&(minInt=1,minFraction=0,maxFraction=3),digits){var parts=digits.match(/^(\d+)?\.((\d+)(\-(\d+))?)?$/);null!=parts&&(null!=parts[1]&&(minInt=parseInt(parts[1])),null!=parts[3]&&(minFraction=parseInt(parts[3])),null!=parts[5]&&(maxFraction=parseInt(parts[5])))}return IntlFormatter.numberFormatter(num,defaultLocale,style,{minimumIntegerDigits:minInt,minimumFractionDigits:minFraction,maximumFractionDigits:maxFraction,currency:currency,currencyDisplay:currencyDisplay})},IntlFormatter.formatDate=function(date,defaultLocale,format,timezone){return IntlFormatter.dateTimeFormatter(date,defaultLocale,format,timezone)},IntlFormatter.numberFormatter=function(num,defaultLocale,style,opts){void 0===opts&&(opts={});var minimumIntegerDigits=opts.minimumIntegerDigits,minimumFractionDigits=opts.minimumFractionDigits,maximumFractionDigits=opts.maximumFractionDigits,currency=opts.currency,currencyDisplay=opts.currencyDisplay,options={minimumIntegerDigits:minimumIntegerDigits,minimumFractionDigits:minimumFractionDigits,maximumFractionDigits:maximumFractionDigits,style:NumberFormatStyle[style].toLowerCase()};return style==NumberFormatStyle.Currency&&(options.currency=currency,options.currencyDisplay=currencyDisplay),new Intl.NumberFormat(defaultLocale,options).format(num)},IntlFormatter.dateTimeFormatter=function(date,defaultLocale,format,timezone){var options={};if("string"==typeof format){var fnFormatAliases=FORMAT_ALIASES[format];if(fnFormatAliases)return fnFormatAliases(date,defaultLocale,timezone)}else options=format;return intlDateTimeFormat(date,defaultLocale,options,timezone)},IntlFormatter}(),L10nDatePipe=function(){function L10nDatePipe(){this.ISO8601_DATE_REGEX=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/}return L10nDatePipe.prototype.transform=function(value,defaultLocale,format,timezone){if(void 0===format&&(format="mediumDate"),null==value||""===value||value!=value)return null;if(void 0===defaultLocale)return null;if(IntlAPI.hasDateTimeFormat()){var date=void 0;if("string"==typeof value&&(value=value.trim()),this.isDate(value))date=value;else if(isNaN(value-parseFloat(value)))if("string"==typeof value&&/^(\d{4}-\d{1,2}-\d{1,2})$/.test(value)){var _a=value.split("-").map(function(val){return parseInt(val,10)}),y=_a[0],m=_a[1],d=_a[2];date=new Date(y,m-1,d)}else date=new Date(value);else date=new Date(parseFloat(value));if(!this.isDate(date)){var match=void 0;"string"==typeof value&&(match=value.match(this.ISO8601_DATE_REGEX))&&(date=this.isoStringToDate(match))}return IntlFormatter.formatDate(date,defaultLocale,format,timezone)}return value},L10nDatePipe.prototype.isDate=function(value){return value instanceof Date&&!isNaN(value.valueOf())},L10nDatePipe.prototype.isoStringToDate=function(match){var date=new Date(0),tzHour=0,tzMin=0,dateSetter=match[8]?date.setUTCFullYear:date.setFullYear,timeSetter=match[8]?date.setUTCHours:date.setHours;match[9]&&(tzHour=+(match[9]+match[10]),tzMin=+(match[9]+match[11])),dateSetter.call(date,+match[1],+match[2]-1,+match[3]);var h=+(match[4]||"0")-tzHour,m=+(match[5]||"0")-tzMin,s=+(match[6]||"0"),ms=Math.round(1e3*parseFloat("0."+(match[7]||0)));return timeSetter.call(date,h,m,s,ms),date},L10nDatePipe.decorators=[{type:core.Pipe,args:[{name:"l10nDate",pure:!0}]}],L10nDatePipe.ctorParameters=function(){return[]},L10nDatePipe}(),L10nDecimalPipe=function(){function L10nDecimalPipe(){}return L10nDecimalPipe.prototype.transform=function(value,defaultLocale,digits){return null==value?null:void 0===defaultLocale?null:IntlAPI.hasNumberFormat()?(value="string"!=typeof value||isNaN(+value-parseFloat(value))?value:+value,IntlFormatter.formatNumber(value,defaultLocale,NumberFormatStyle.Decimal,digits)):value},L10nDecimalPipe.decorators=[{type:core.Pipe,args:[{name:"l10nDecimal",pure:!0}]}],L10nDecimalPipe.ctorParameters=function(){return[]},L10nDecimalPipe}(),L10nPercentPipe=function(){function L10nPercentPipe(){}return L10nPercentPipe.prototype.transform=function(value,defaultLocale,digits){return null==value?null:void 0===defaultLocale?null:IntlAPI.hasNumberFormat()?(value="string"!=typeof value||isNaN(+value-parseFloat(value))?value:+value,IntlFormatter.formatNumber(value,defaultLocale,NumberFormatStyle.Percent,digits)):value},L10nPercentPipe.decorators=[{type:core.Pipe,args:[{name:"l10nPercent",pure:!0}]}],L10nPercentPipe.ctorParameters=function(){return[]},L10nPercentPipe}(),L10nCurrencyPipe=function(){function L10nCurrencyPipe(){}return L10nCurrencyPipe.prototype.transform=function(value,defaultLocale,currency,currencyDisplay,digits){return void 0===currencyDisplay&&(currencyDisplay="symbol"),null==value?null:void 0===defaultLocale||void 0===currency?null:IntlAPI.hasNumberFormat()?(value="string"!=typeof value||isNaN(+value-parseFloat(value))?value:+value,IntlFormatter.formatNumber(value,defaultLocale,NumberFormatStyle.Currency,digits,currency,currencyDisplay)):value+" "+currency},L10nCurrencyPipe.decorators=[{type:core.Pipe,args:[{name:"l10nCurrency",pure:!0}]}],L10nCurrencyPipe.ctorParameters=function(){return[]},L10nCurrencyPipe}(),BFS=function(){function BFS(){}return BFS.getTargetNode=function(rootNode){return BFS.walk(rootNode)},BFS.walk=function(rootNode){var iNode,queue=[],depth=0,nodeToDepthIncrease=1;for(queue.push(rootNode);queue.length>0&&depth<=this.MAX_DEPTH;){if(iNode=queue.shift(),this.isTargetNode(iNode))return iNode;if(depth<this.MAX_DEPTH&&null!=iNode.childNodes)for(var _i=0,_a=iNode.childNodes;_i<_a.length;_i++){var child=_a[_i];this.isValidNode(child)&&queue.push(child)}0==--nodeToDepthIncrease&&(depth++,nodeToDepthIncrease=queue.length)}return rootNode},BFS.isTargetNode=function(node){return void 0!==node&&3==node.nodeType&&null!=node.nodeValue&&""!=node.nodeValue.trim()},BFS.isValidNode=function(node){if(void 0!==node&&1==node.nodeType&&node.attributes)for(var _i=0,_a=node.attributes;_i<_a.length;_i++){var attr=_a[_i];if(attr&&this.SELECTOR.test(attr.name))return!1}return!0},BFS.SELECTOR=new RegExp("^l10n|translate|locale"),BFS.MAX_DEPTH=10,BFS}(),BaseDirective=function(){function BaseDirective(el,renderer){this.el=el,this.renderer=renderer,this.attributes=[],this.subscriptions=[],this.TEXT_MUTATION_CONFIG={subtree:!0,characterData:!0},this.SELECTOR=/^l10n-/}return BaseDirective.prototype.ngAfterViewInit=function(){this.el&&this.el.nativeElement&&(this.element=this.el.nativeElement,this.renderNode=BFS.getTargetNode(this.element),this.getKey(),this.getAttributes(),this.addTextListener(),this.setup())},BaseDirective.prototype.ngOnChanges=function(changes){this.key&&(null!=this.nodeValue&&""!=this.nodeValue||(this.valueAttribute?this.key=this.valueAttribute:this.innerHTMLProperty&&(this.key=this.innerHTMLProperty)),this.replaceText()),this.attributes.length>0&&this.replaceAttributes()},BaseDirective.prototype.ngOnDestroy=function(){this.removeTextListener(),this.cancelSubscriptions()},BaseDirective.prototype.getAttributesData=function(){for(var data={},_i=0,keys_1=this.getAttributesKeys();_i<keys_1.length;_i++){var key=keys_1[_i];data[key]=this.getValues(key)}return data},BaseDirective.prototype.getAttributesKeys=function(){return this.attributes.map(function(attr){return attr.key})},BaseDirective.prototype.setText=function(value){value&&(this.nodeValue&&this.key?(this.removeTextListener(),this.renderer.setValue(this.renderNode,this.nodeValue.replace(this.key,value)),this.addTextListener()):this.valueAttribute?this.renderer.setAttribute(this.element,"value",value):this.innerHTMLProperty&&this.renderer.setProperty(this.element,"innerHTML",value))},BaseDirective.prototype.setAttributes=function(data){for(var _i=0,_a=this.attributes;_i<_a.length;_i++){var attr=_a[_i];this.renderer.setAttribute(this.element,attr.name,data[attr.key])}},BaseDirective.prototype.addTextListener=function(){var _this=this;"undefined"!=typeof MutationObserver&&(this.textObserver=new MutationObserver(function(mutations){_this.renderNode=BFS.getTargetNode(_this.element),_this.getKey(),_this.replaceText()}),this.textObserver.observe(this.renderNode,this.TEXT_MUTATION_CONFIG))},BaseDirective.prototype.removeTextListener=function(){void 0!==this.textObserver&&this.textObserver.disconnect()},BaseDirective.prototype.getText=function(){return this.nodeValue=null!=this.renderNode?this.renderNode.nodeValue:"",this.nodeValue?this.nodeValue.trim():""},BaseDirective.prototype.getKey=function(){this.element.childNodes.length>0?this.key=this.getText():this.valueAttribute?this.key=this.valueAttribute:this.innerHTMLProperty&&(this.key=this.innerHTMLProperty)},BaseDirective.prototype.getAttributes=function(){if(this.element.attributes)for(var _i=0,_a=this.element.attributes;_i<_a.length;_i++){var attr=_a[_i];if(attr&&this.SELECTOR.test(attr.name))for(var name_1=attr.name.substr(5),_b=0,_c=this.element.attributes;_b<_c.length;_b++){var targetAttr=_c[_b];new RegExp("^"+name_1+"$").test(targetAttr.name)&&this.attributes.push({name:name_1,key:targetAttr.value})}}},BaseDirective.prototype.cancelSubscriptions=function(){this.subscriptions.forEach(function(subscription){void 0!==subscription&&subscription.unsubscribe()})},BaseDirective.propDecorators={valueAttribute:[{type:core.Input,args:["value"]}],innerHTMLProperty:[{type:core.Input,args:["innerHTML"]}]},BaseDirective}(),TranslateDirective=function(_super){function TranslateDirective(translation,el,renderer){var _this=_super.call(this,el,renderer)||this;return _this.translation=translation,_this.el=el,_this.renderer=renderer,_this}return __extends(TranslateDirective,_super),Object.defineProperty(TranslateDirective.prototype,"l10nTranslate",{set:function(params){this.params=params},enumerable:!0,configurable:!0}),Object.defineProperty(TranslateDirective.prototype,"translate",{set:function(params){this.params=params},enumerable:!0,configurable:!0}),TranslateDirective.prototype.setup=function(){var _this=this;this.replace(),this.subscriptions.push(this.translation.translationChanged().subscribe(function(){_this.replace()}))},TranslateDirective.prototype.replace=function(){this.replaceText(),this.replaceAttributes()},TranslateDirective.prototype.replaceText=function(){this.key&&this.setText(this.getValues(this.key))},TranslateDirective.prototype.replaceAttributes=function(){if(this.attributes.length>0){var keys=this.getAttributesKeys();this.setAttributes(this.getValues(keys))}},TranslateDirective.prototype.getValues=function(keys){return this.translation.translate(keys,this.params)},TranslateDirective.decorators=[{type:core.Directive,args:[{selector:"[l10nTranslate],[translate]"}]}],TranslateDirective.ctorParameters=function(){return[{type:TranslationService},{type:core.ElementRef},{type:core.Renderer2}]},TranslateDirective.propDecorators={l10nTranslate:[{type:core.Input}],translate:[{type:core.Input}],params:[{type:core.Input}]},TranslateDirective}(BaseDirective),L10nDateDirective=function(_super){function L10nDateDirective(locale,el,renderer){var _this=_super.call(this,el,renderer)||this;return _this.locale=locale,_this.el=el,_this.renderer=renderer,_this.defaultFormat="mediumDate",_this.l10nDatePipe=new L10nDatePipe,_this}return __extends(L10nDateDirective,_super),Object.defineProperty(L10nDateDirective.prototype,"l10nDate",{set:function(format){this.format=format},enumerable:!0,configurable:!0}),L10nDateDirective.prototype.setup=function(){var _this=this;this.replace(),this.subscriptions.push(this.locale.defaultLocaleChanged.subscribe(function(){_this.replace()})),this.subscriptions.push(this.locale.timezoneChanged.subscribe(function(){_this.replace()}))},L10nDateDirective.prototype.replace=function(){this.replaceText(),this.replaceAttributes()},L10nDateDirective.prototype.replaceText=function(){this.key&&this.setText(this.getValues(this.key))},L10nDateDirective.prototype.replaceAttributes=function(){this.attributes.length>0&&this.setAttributes(this.getAttributesData())},L10nDateDirective.prototype.getValues=function(keys){return this.l10nDatePipe.transform(keys,this.locale.getDefaultLocale(),this.format||this.defaultFormat,this.locale.getCurrentTimezone())},L10nDateDirective.decorators=[{type:core.Directive,args:[{selector:"[l10nDate]"}]}],L10nDateDirective.ctorParameters=function(){return[{type:LocaleService},{type:core.ElementRef},{type:core.Renderer2}]},L10nDateDirective.propDecorators={l10nDate:[{type:core.Input}],format:[{type:core.Input}]},L10nDateDirective}(BaseDirective),L10nDecimalDirective=function(_super){function L10nDecimalDirective(locale,el,renderer){var _this=_super.call(this,el,renderer)||this;return _this.locale=locale,_this.el=el,_this.renderer=renderer,_this.l10nDecimalPipe=new L10nDecimalPipe,_this}return __extends(L10nDecimalDirective,_super),Object.defineProperty(L10nDecimalDirective.prototype,"l10nDecimal",{set:function(digits){this.digits=digits},enumerable:!0,configurable:!0}),L10nDecimalDirective.prototype.setup=function(){var _this=this;this.replace(),this.subscriptions.push(this.locale.defaultLocaleChanged.subscribe(function(){_this.replace()}))},L10nDecimalDirective.prototype.replace=function(){this.replaceText(),this.replaceAttributes()},L10nDecimalDirective.prototype.replaceText=function(){this.key&&this.setText(this.getValues(this.key))},L10nDecimalDirective.prototype.replaceAttributes=function(){this.attributes.length>0&&this.setAttributes(this.getAttributesData())},L10nDecimalDirective.prototype.getValues=function(keys){return this.l10nDecimalPipe.transform(keys,this.locale.getDefaultLocale(),this.digits)},L10nDecimalDirective.decorators=[{type:core.Directive,args:[{selector:"[l10nDecimal]"}]}],L10nDecimalDirective.ctorParameters=function(){return[{type:LocaleService},{type:core.ElementRef},{type:core.Renderer2}]},L10nDecimalDirective.propDecorators={l10nDecimal:[{type:core.Input}],digits:[{type:core.Input}]},L10nDecimalDirective}(BaseDirective),L10nPercentDirective=function(_super){function L10nPercentDirective(locale,el,renderer){var _this=_super.call(this,el,renderer)||this;return _this.locale=locale,_this.el=el,_this.renderer=renderer,_this.l10nPercentPipe=new L10nPercentPipe,_this}return __extends(L10nPercentDirective,_super),Object.defineProperty(L10nPercentDirective.prototype,"l10nPercent",{set:function(digits){this.digits=digits},enumerable:!0,configurable:!0}),L10nPercentDirective.prototype.setup=function(){var _this=this;this.replace(),this.subscriptions.push(this.locale.defaultLocaleChanged.subscribe(function(){_this.replace()}))},L10nPercentDirective.prototype.replace=function(){this.replaceText(),this.replaceAttributes()},L10nPercentDirective.prototype.replaceText=function(){this.key&&this.setText(this.getValues(this.key))},L10nPercentDirective.prototype.replaceAttributes=function(){this.attributes.length>0&&this.setAttributes(this.getAttributesData())},L10nPercentDirective.prototype.getValues=function(keys){return this.l10nPercentPipe.transform(keys,this.locale.getDefaultLocale(),this.digits)},L10nPercentDirective.decorators=[{type:core.Directive,args:[{selector:"[l10nPercent]"}]}],L10nPercentDirective.ctorParameters=function(){return[{type:LocaleService},{type:core.ElementRef},{type:core.Renderer2}]},L10nPercentDirective.propDecorators={l10nPercent:[{type:core.Input}],digits:[{type:core.Input}]},L10nPercentDirective}(BaseDirective),L10nCurrencyDirective=function(_super){function L10nCurrencyDirective(locale,el,renderer){var _this=_super.call(this,el,renderer)||this;return _this.locale=locale,_this.el=el,_this.renderer=renderer,_this.l10nCurrencyPipe=new L10nCurrencyPipe,_this}return __extends(L10nCurrencyDirective,_super),Object.defineProperty(L10nCurrencyDirective.prototype,"l10nCurrency",{set:function(digits){this.digits=digits},enumerable:!0,configurable:!0}),L10nCurrencyDirective.prototype.setup=function(){var _this=this;this.replace(),this.subscriptions.push(this.locale.defaultLocaleChanged.subscribe(function(){_this.replace()})),this.subscriptions.push(this.locale.currencyCodeChanged.subscribe(function(){_this.replace()}))},L10nCurrencyDirective.prototype.replace=function(){this.replaceText(),this.replaceAttributes()},L10nCurrencyDirective.prototype.replaceText=function(){this.key&&this.setText(this.getValues(this.key))},L10nCurrencyDirective.prototype.replaceAttributes=function(){this.attributes.length>0&&this.setAttributes(this.getAttributesData())},L10nCurrencyDirective.prototype.getValues=function(keys){return this.l10nCurrencyPipe.transform(keys,this.locale.getDefaultLocale(),this.locale.getCurrentCurrency(),this.currencyDisplay,this.digits)},L10nCurrencyDirective.decorators=[{type:core.Directive,args:[{selector:"[l10nCurrency]"}]}],L10nCurrencyDirective.ctorParameters=function(){return[{type:LocaleService},{type:core.ElementRef},{type:core.Renderer2}]},L10nCurrencyDirective.propDecorators={l10nCurrency:[{type:core.Input}],currencyDisplay:[{type:core.Input}],digits:[{type:core.Input}]},L10nCurrencyDirective}(BaseDirective),L10nNumberValidatorDirective=function(){function L10nNumberValidatorDirective(){this.MIN_VALUE=Number.MIN_VALUE,this.MAX_VALUE=Number.MAX_VALUE}return Object.defineProperty(L10nNumberValidatorDirective.prototype,"l10nValidateNumber",{set:function(digits){this.digits=digits},enumerable:!0,configurable:!0}),L10nNumberValidatorDirective.prototype.ngOnInit=function(){this.validator=l10nValidateNumber(this.digits,this.minValue||this.MIN_VALUE,this.maxValue||this.MAX_VALUE)},L10nNumberValidatorDirective.prototype.validate=function(formControl){return this.validator(formControl)},L10nNumberValidatorDirective.decorators=[{type:core.Directive,args:[{selector:"[l10nValidateNumber][ngModel],[l10nValidateNumber][formControl]",providers:[{provide:forms.NG_VALIDATORS,useExisting:core.forwardRef(function(){return L10nNumberValidatorDirective}),multi:!0}]}]}],L10nNumberValidatorDirective.ctorParameters=function(){return[]},L10nNumberValidatorDirective.propDecorators={l10nValidateNumber:[{type:core.Input}],digits:[{type:core.Input}],minValue:[{type:core.Input}],maxValue:[{type:core.Input}]},L10nNumberValidatorDirective}(),TranslationModule=function(){function TranslationModule(injector){this.injector=injector}return TranslationModule.forRoot=function(l10nConfig,token){return void 0===token&&(token={}),{ngModule:TranslationModule,providers:[InjectorRef,{provide:LOCALE_CONFIG,useValue:l10nConfig.locale||{}},{provide:TRANSLATION_CONFIG,useValue:l10nConfig.translation||{}},LocaleService,{provide:LocaleStorage,useClass:token.localeStorage||BrowserStorage},TranslationService,{provide:TranslationProvider,useClass:token.translationProvider||HttpTranslationProvider},{provide:TranslationHandler,useClass:token.translationHandler||DefaultTranslationHandler},L10nLoader]}},TranslationModule.forChild=function(l10nConfig,token){return void 0===token&&(token={}),{ngModule:TranslationModule,providers:[InjectorRef,{provide:TRANSLATION_CONFIG,useValue:l10nConfig.translation||{}},TranslationService,L10nLoader]}},TranslationModule.decorators=[{type:core.NgModule,args:[{declarations:[TranslatePipe,TranslateDirective],exports:[TranslatePipe,TranslateDirective]}]}],TranslationModule.ctorParameters=function(){return[{type:InjectorRef}]},TranslationModule}(),LocalizationModule=function(){function LocalizationModule(injector){this.injector=injector}return LocalizationModule.forRoot=function(l10nConfig,token){return void 0===token&&(token={}),{ngModule:LocalizationModule,providers:[InjectorRef,{provide:LOCALE_CONFIG,useValue:l10nConfig.locale||{}},{provide:TRANSLATION_CONFIG,useValue:l10nConfig.translation||{}},LocaleService,{provide:LocaleStorage,useClass:token.localeStorage||BrowserStorage},TranslationService,{provide:TranslationProvider,useClass:token.translationProvider||HttpTranslationProvider},{provide:TranslationHandler,useClass:token.translationHandler||DefaultTranslationHandler},L10nLoader]}},LocalizationModule.forChild=function(l10nConfig,token){return void 0===token&&(token={}),{ngModule:LocalizationModule,providers:[InjectorRef,{provide:TRANSLATION_CONFIG,useValue:l10nConfig.translation||{}},TranslationService,L10nLoader]}},LocalizationModule.decorators=[{type:core.NgModule,args:[{declarations:[L10nDatePipe,L10nDecimalPipe,L10nPercentPipe,L10nCurrencyPipe,L10nDateDirective,L10nDecimalDirective,L10nPercentDirective,L10nCurrencyDirective],imports:[TranslationModule],exports:[TranslationModule,L10nDatePipe,L10nDecimalPipe,L10nPercentPipe,L10nCurrencyPipe,L10nDateDirective,L10nDecimalDirective,L10nPercentDirective,L10nCurrencyDirective]}]}],LocalizationModule.ctorParameters=function(){return[{type:InjectorRef}]},LocalizationModule}(),LocaleValidationModule=function(){function LocaleValidationModule(){}return LocaleValidationModule.forRoot=function(){return{ngModule:LocaleValidationModule,providers:[LocaleValidation]}},LocaleValidationModule.decorators=[{type:core.NgModule,args:[{declarations:[L10nNumberValidatorDirective],exports:[L10nNumberValidatorDirective]}]}],LocaleValidationModule.ctorParameters=function(){return[]},LocaleValidationModule}();exports.InjectorRef=InjectorRef,exports.StorageStrategy=StorageStrategy,exports.ProviderType=ProviderType,exports.ISOCode=ISOCode,exports.LOCALE_CONFIG=LOCALE_CONFIG,exports.TRANSLATION_CONFIG=TRANSLATION_CONFIG,exports.L10nLoader=L10nLoader,exports.LocaleService=LocaleService,exports.LocaleStorage=LocaleStorage,exports.BrowserStorage=BrowserStorage,exports.TranslationService=TranslationService,exports.TranslationProvider=TranslationProvider,exports.HttpTranslationProvider=HttpTranslationProvider,exports.TranslationHandler=TranslationHandler,exports.DefaultTranslationHandler=DefaultTranslationHandler,exports.Translation=Translation,exports.Localization=Localization,exports.LocaleValidation=LocaleValidation,exports.Collator=Collator,exports.IntlAPI=IntlAPI,exports.Language=function(){return function(target,propertyKey){var subscription,targetNgOnInit=target.ngOnInit;target.ngOnInit=function(){var _this=this,translation=InjectorRef.get(TranslationService);void 0!==propertyKey&&(subscription=translation.translationChanged().subscribe(function(language){_this[propertyKey]=language})),targetNgOnInit&&targetNgOnInit.apply(this)};var targetNgOnDestroy=target.ngOnDestroy;target.ngOnDestroy=function(){void 0!==subscription&&subscription.unsubscribe(),targetNgOnDestroy&&targetNgOnDestroy.apply(this)},void 0!==propertyKey&&Object.defineProperty(target,propertyKey,{writable:!0,value:void 0})}},exports.DefaultLocale=function(){return function(target,propertyKey){var subscription,targetNgOnInit=target.ngOnInit;target.ngOnInit=function(){var _this=this,locale=InjectorRef.get(LocaleService);void 0!==propertyKey&&(this[propertyKey]=locale.getDefaultLocale(),subscription=locale.defaultLocaleChanged.subscribe(function(defaultLocale){_this[propertyKey]=defaultLocale})),targetNgOnInit&&targetNgOnInit.apply(this)};var targetNgOnDestroy=target.ngOnDestroy;target.ngOnDestroy=function(){void 0!==subscription&&subscription.unsubscribe(),targetNgOnDestroy&&targetNgOnDestroy.apply(this)},void 0!==propertyKey&&Object.defineProperty(target,propertyKey,{writable:!0,value:void 0})}},exports.Currency=function(){return function(target,propertyKey){var subscription,targetNgOnInit=target.ngOnInit;target.ngOnInit=function(){var _this=this,locale=InjectorRef.get(LocaleService);void 0!==propertyKey&&(this[propertyKey]=locale.getCurrentCurrency(),subscription=locale.currencyCodeChanged.subscribe(function(currency){_this[propertyKey]=currency})),targetNgOnInit&&targetNgOnInit.apply(this)};var targetNgOnDestroy=target.ngOnDestroy;target.ngOnDestroy=function(){void 0!==subscription&&subscription.unsubscribe(),targetNgOnDestroy&&targetNgOnDestroy.apply(this)},void 0!==propertyKey&&Object.defineProperty(target,propertyKey,{writable:!0,value:void 0})}},exports.Timezone=function(){return function(target,propertyKey){var subscription,targetNgOnInit=target.ngOnInit;target.ngOnInit=function(){var _this=this,locale=InjectorRef.get(LocaleService);void 0!==propertyKey&&(this[propertyKey]=locale.getCurrentTimezone(),subscription=locale.timezoneChanged.subscribe(function(zoneName){_this[propertyKey]=zoneName})),targetNgOnInit&&targetNgOnInit.apply(this)};var targetNgOnDestroy=target.ngOnDestroy;target.ngOnDestroy=function(){void 0!==subscription&&subscription.unsubscribe(),targetNgOnDestroy&&targetNgOnDestroy.apply(this)},void 0!==propertyKey&&Object.defineProperty(target,propertyKey,{writable:!0,value:void 0})}},exports.TranslatePipe=TranslatePipe,exports.L10nDatePipe=L10nDatePipe,exports.L10nDecimalPipe=L10nDecimalPipe,exports.L10nPercentPipe=L10nPercentPipe,exports.L10nCurrencyPipe=L10nCurrencyPipe,exports.BaseDirective=BaseDirective,exports.TranslateDirective=TranslateDirective,exports.L10nDateDirective=L10nDateDirective,exports.L10nDecimalDirective=L10nDecimalDirective,exports.L10nPercentDirective=L10nPercentDirective,exports.L10nCurrencyDirective=L10nCurrencyDirective,exports.L10nNumberValidatorDirective=L10nNumberValidatorDirective,exports.l10nValidateNumber=l10nValidateNumber,exports.TranslationModule=TranslationModule,exports.LocalizationModule=LocalizationModule,exports.LocaleValidationModule=LocaleValidationModule,Object.defineProperty(exports,"__esModule",{value:!0})});
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("rxjs/Subject"),require("rxjs/Observable"),require("rxjs/BehaviorSubject"),require("rxjs/observable/merge"),require("rxjs/observable/concat"),require("@angular/common/http"),require("rxjs/ReplaySubject"),require("@angular/forms")):"function"==typeof define&&define.amd?define("angular-l10n",["exports","@angular/core","rxjs/Subject","rxjs/Observable","rxjs/BehaviorSubject","rxjs/observable/merge","rxjs/observable/concat","@angular/common/http","rxjs/ReplaySubject","@angular/forms"],factory):factory((global.ng=global.ng||{},global.ng.l10n={}),global.ng.core,global.Rx,global.Rx,global.Rx,global.Rx.Observable,global.Rx.Observable,global.ng.commmon.http,global.Rx,global.ng.forms)}(this,function(exports,core,Subject,Observable,BehaviorSubject,merge,concat,http,ReplaySubject,forms){"use strict";function __extends(d,b){function __(){this.constructor=d}extendStatics(d,b),d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)}function __awaiter(thisArg,_arguments,P,generator){return new(P||(P=Promise))(function(resolve,reject){function fulfilled(value){try{step(generator.next(value))}catch(e){reject(e)}}function rejected(value){try{step(generator.throw(value))}catch(e){reject(e)}}function step(result){result.done?resolve(result.value):new P(function(resolve){resolve(result.value)}).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})}function __generator(thisArg,body){function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");for(;_;)try{if(f=1,y&&(t=y[2&op[0]?"return":op[0]?"throw":"next"])&&!(t=t.call(y,op[1])).done)return t;switch(y=0,t&&(op=[0,t.value]),op[0]){case 0:case 1:t=op;break;case 4:return _.label++,{value:op[1],done:!1};case 5:_.label++,y=op[1],op=[0];continue;case 7:op=_.ops.pop(),_.trys.pop();continue;default:if(t=_.trys,!(t=t.length>0&&t[t.length-1])&&(6===op[0]||2===op[0])){_=0;continue}if(3===op[0]&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(6===op[0]&&_.label<t[1]){_.label=t[1],t=op;break}if(t&&_.label<t[2]){_.label=t[2],_.ops.push(op);break}t[2]&&_.ops.pop(),_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e],y=0}finally{f=t=0}if(5&op[0])throw op[1];return{value:op[0]?op[1]:void 0,done:!0}}var f,y,t,g,_={label:0,sent:function(){if(1&t[0])throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),throw:verb(1),return:verb(2)},"function"==typeof Symbol&&(g[Symbol.iterator]=function(){return this}),g}function isObject(item){return"object"==typeof item&&!Array.isArray(item)}function mergeDeep(target,source){var output=Object.assign({},target);return isObject(target)&&isObject(source)&&Object.keys(source).forEach(function(key){isObject(source[key])?key in target?output[key]=mergeDeep(target[key],source[key]):Object.assign(output,(_a={},_a[key]=source[key],_a)):Object.assign(output,(_b={},_b[key]=source[key],_b));var _a,_b}),output}function intlDateTimeFormat(date,defaultLocale,options,timezone){return options.timeZone=IntlAPI.hasTimezone()?timezone:"UTC",new Intl.DateTimeFormat(defaultLocale,options).format(date).replace(/[\u200e\u200f]/g,"")}function datePartFactory(options){return function(date,defaultLocale,timezone){return intlDateTimeFormat(date,defaultLocale,options,timezone)}}function combine(options){return options.reduce(function(merged,opt){return __assign({},merged,opt)},{})}function digitCondition(prop,len){var result={};return result[prop]=2===len?"2-digit":"numeric",result}function nameCondition(prop,len){var result={};return result[prop]=len<4?len>1?"short":"narrow":"long",result}function l10nValidateNumber(digits,MIN_VALUE,MAX_VALUE){void 0===MIN_VALUE&&(MIN_VALUE=Number.MIN_VALUE),void 0===MAX_VALUE&&(MAX_VALUE=Number.MAX_VALUE);var defaultLocale,NUMBER_REGEXP,locale=InjectorRef.get(LocaleService),localeValidation=InjectorRef.get(LocaleValidation);return function(formControl){if(null==formControl.value||""==formControl.value)return null;if(defaultLocale!=locale.getDefaultLocale()&&(NUMBER_REGEXP=localeValidation.getRegExp(digits),defaultLocale=locale.getDefaultLocale()),NUMBER_REGEXP.test(formControl.value)){var parsedValue=localeValidation.parseNumber(formControl.value);return null!=parsedValue&&parsedValue<MIN_VALUE?{minValue:{valid:!1}}:null!=parsedValue&&parsedValue>MAX_VALUE?{maxValue:{valid:!1}}:null}return{format:{valid:!1}}}}var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},InjectorRef=function(){function InjectorRef(injector){this.injector=injector,InjectorRef.injector=this.injector}return InjectorRef.get=function(token){return InjectorRef.injector.get(token)},InjectorRef.injector=null,InjectorRef.decorators=[{type:core.Injectable}],InjectorRef.ctorParameters=function(){return[{type:core.Injector}]},InjectorRef}(),StorageStrategy={Session:0,Local:1,Cookie:2,Disabled:3};StorageStrategy[StorageStrategy.Session]="Session",StorageStrategy[StorageStrategy.Local]="Local",StorageStrategy[StorageStrategy.Cookie]="Cookie",StorageStrategy[StorageStrategy.Disabled]="Disabled";var ProviderType={Fallback:0,Static:1,WebAPI:2};ProviderType[ProviderType.Fallback]="Fallback",ProviderType[ProviderType.Static]="Static",ProviderType[ProviderType.WebAPI]="WebAPI";var ISOCode={Language:0,Country:1,Script:2};ISOCode[ISOCode.Language]="Language",ISOCode[ISOCode.Country]="Country",ISOCode[ISOCode.Script]="Script";var LoadingMode={Direct:0,Async:1};LoadingMode[LoadingMode.Direct]="Direct",LoadingMode[LoadingMode.Async]="Async";var ServiceState={isReady:0,isLoading:1,isWaiting:2};ServiceState[ServiceState.isReady]="isReady",ServiceState[ServiceState.isLoading]="isLoading",ServiceState[ServiceState.isWaiting]="isWaiting";var NumberFormatStyle={Decimal:0,Percent:1,Currency:2};NumberFormatStyle[NumberFormatStyle.Decimal]="Decimal",NumberFormatStyle[NumberFormatStyle.Percent]="Percent",NumberFormatStyle[NumberFormatStyle.Currency]="Currency";var LOCALE_CONFIG=new core.InjectionToken("LOCALE_CONFIG"),TRANSLATION_CONFIG=new core.InjectionToken("TRANSLATION_CONFIG"),IntlAPI=function(){function IntlAPI(){}return IntlAPI.hasIntl=function(){return"object"==typeof Intl&&!!Intl},IntlAPI.hasDateTimeFormat=function(){return IntlAPI.hasIntl()&&Intl.hasOwnProperty("DateTimeFormat")},IntlAPI.hasTimezone=function(){if(IntlAPI.hasIntl()&&IntlAPI.hasDateTimeFormat()){try{new Intl.DateTimeFormat("en-US",{timeZone:"America/Los_Angeles"}).format(new Date)}catch(e){return!1}return!0}return!1},IntlAPI.hasNumberFormat=function(){return IntlAPI.hasIntl()&&Intl.hasOwnProperty("NumberFormat")},IntlAPI.hasCollator=function(){return IntlAPI.hasIntl()&&Intl.hasOwnProperty("Collator")},IntlAPI}(),LocaleStorage=function(){function LocaleStorage(){}return LocaleStorage.decorators=[{type:core.Injectable}],LocaleStorage.ctorParameters=function(){return[]},LocaleStorage}(),BrowserStorage=function(){function BrowserStorage(configuration){this.configuration=configuration,this.hasCookie="undefined"!=typeof navigator&&navigator.cookieEnabled,this.hasStorage="undefined"!=typeof Storage}return BrowserStorage.prototype.read=function(name){return __awaiter(this,void 0,void 0,function(){var value;return __generator(this,function(_a){return value=null,this.configuration.storage!=StorageStrategy.Disabled&&(this.configuration.storage==StorageStrategy.Local&&this.hasStorage?value=this.getLocalStorage(name):this.configuration.storage==StorageStrategy.Session&&this.hasStorage?value=this.getSessionStorage(name):this.configuration.storage==StorageStrategy.Cookie&&this.hasCookie&&(value=this.getCookie(name))),[2,value]})})},BrowserStorage.prototype.write=function(name,value){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){return this.configuration.storage!=StorageStrategy.Disabled&&(this.configuration.storage==StorageStrategy.Local&&this.hasStorage?this.setLocalStorage(name,value):this.configuration.storage==StorageStrategy.Session&&this.hasStorage?this.setSessionStorage(name,value):this.configuration.storage==StorageStrategy.Cookie&&this.hasCookie&&this.setCookie(name,value)),[2]})})},BrowserStorage.prototype.getLocalStorage=function(name){return localStorage.getItem(name)},BrowserStorage.prototype.getSessionStorage=function(name){return sessionStorage.getItem(name)},BrowserStorage.prototype.getCookie=function(name){var result=null;return"undefined"!=typeof document&&(result=new RegExp("(?:^|; )"+encodeURIComponent(name)+"=([^;]*)").exec(document.cookie)),result?result[1]:null},BrowserStorage.prototype.setLocalStorage=function(name,value){localStorage.setItem(name,value)},BrowserStorage.prototype.setSessionStorage=function(name,value){sessionStorage.setItem(name,value)},BrowserStorage.prototype.setCookie=function(name,value){var expires="";if(null!=this.configuration.cookieExpiration){var expirationDate=new Date;expirationDate.setTime(expirationDate.getTime()+24*this.configuration.cookieExpiration*60*60*1e3),expires="; expires="+expirationDate.toUTCString()}"undefined"!=typeof document&&(document.cookie=name+"="+value+expires+"; path=/")},BrowserStorage.decorators=[{type:core.Injectable}],BrowserStorage.ctorParameters=function(){return[{type:void 0,decorators:[{type:core.Inject,args:[LOCALE_CONFIG]}]}]},BrowserStorage}(),DefaultLocale=function(){function DefaultLocale(){}return Object.defineProperty(DefaultLocale.prototype,"value",{get:function(){return this._value},set:function(defaultLocale){this._value=defaultLocale,this.parseValue()},enumerable:!0,configurable:!0}),DefaultLocale.prototype.build=function(languageCode,countryCode,scriptCode,numberingSystem,calendar){this.languageCode=languageCode,this.scriptCode=scriptCode,this.countryCode=countryCode,this.numberingSystem=numberingSystem,this.calendar=calendar;var value=[];value.push(languageCode),value.push(scriptCode?"-"+scriptCode:""),value.push(countryCode?"-"+countryCode:""),value.push(numberingSystem||calendar?"-u":""),value.push(numberingSystem?"-nu-"+numberingSystem:""),value.push(calendar?"-ca-"+calendar:""),this._value=value.join("")},DefaultLocale.prototype.parseValue=function(){if(this.value){var value=this.value,index=value.search("-u");if(-1!=index){var extensions=value.substring(index+1).split("-");switch(extensions.length){case 3:"nu"==extensions[1]?this.numberingSystem=extensions[2]:"ca"==extensions[1]&&(this.calendar=extensions[2]);break;default:this.numberingSystem=extensions[2],this.calendar=extensions[4]}value=value.substring(0,index)}var codes=value.split("-");switch(codes.length){case 1:this.languageCode=codes[0];break;case 2:this.languageCode=codes[0],this.countryCode=codes[1];break;default:this.languageCode=codes[0],this.scriptCode=codes[1],this.countryCode=codes[2]}}},DefaultLocale}(),LocaleService=function(){function LocaleService(configuration,storage){this.configuration=configuration,this.storage=storage,this.languageCodeChanged=new core.EventEmitter(!0),this.defaultLocaleChanged=new core.EventEmitter(!0),this.currencyCodeChanged=new core.EventEmitter(!0),this.timezoneChanged=new core.EventEmitter(!0),this.loadTranslation=new Subject.Subject,this.defaultLocale=new DefaultLocale}return LocaleService.prototype.getConfiguration=function(){return this.configuration},LocaleService.prototype.init=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return[4,this.initStorage()];case 1:return _a.sent(),this.configuration.defaultLocale?this.initDefaultLocale():this.configuration.language&&this.initLanguage(),this.configuration.currency&&this.initCurrency(),this.configuration.timezone&&this.initTimezone(),[2]}})})},LocaleService.prototype.getBrowserLanguage=function(){var browserLanguage=null;if("undefined"!=typeof navigator&&navigator.language&&(browserLanguage=navigator.language),null!=browserLanguage){var index=browserLanguage.indexOf("-");-1!=index&&(browserLanguage=browserLanguage.substring(0,index))}return browserLanguage},LocaleService.prototype.getAvailableLanguages=function(){var languages=[];return this.configuration.languages&&(languages=this.configuration.languages.map(function(language){return language.code})),languages},LocaleService.prototype.getLanguageDirection=function(languageCode){return void 0===languageCode&&(languageCode=this.defaultLocale.languageCode),this.matchLanguage(languageCode)[0].dir},LocaleService.prototype.getCurrentLanguage=function(){return this.defaultLocale.languageCode},LocaleService.prototype.getCurrentCountry=function(){return this.defaultLocale.countryCode?this.defaultLocale.countryCode:""},LocaleService.prototype.getCurrentScript=function(){return this.defaultLocale.scriptCode?this.defaultLocale.scriptCode:""},LocaleService.prototype.getCurrentLocale=function(){return this.defaultLocale.countryCode?this.defaultLocale.languageCode+"-"+this.defaultLocale.countryCode:this.defaultLocale.languageCode},LocaleService.prototype.getCurrentNumberingSystem=function(){return this.defaultLocale.numberingSystem?this.defaultLocale.numberingSystem:""},LocaleService.prototype.getCurrentCalendar=function(){return this.defaultLocale.calendar?this.defaultLocale.calendar:""},LocaleService.prototype.getDefaultLocale=function(){return this.defaultLocale.value},LocaleService.prototype.getCurrentCurrency=function(){return this.currencyCode},LocaleService.prototype.getCurrencySymbol=function(currencyDisplay,defaultLocale,currency){void 0===currencyDisplay&&(currencyDisplay="symbol"),void 0===defaultLocale&&(defaultLocale=this.defaultLocale.value),void 0===currency&&(currency=this.currencyCode);var currencySymbol=this.currencyCode;if(IntlAPI.hasNumberFormat()){var localeZero=new Intl.NumberFormat(defaultLocale).format(0);currencySymbol=(currencySymbol=new Intl.NumberFormat(defaultLocale,{style:"currency",currency:currency,currencyDisplay:currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0}).format(0).replace(localeZero,"")).trim()}return currencySymbol},LocaleService.prototype.getCurrentTimezone=function(){return this.timezone},LocaleService.prototype.setCurrentLanguage=function(languageCode){this.defaultLocale.languageCode!=languageCode&&(this.defaultLocale.build(languageCode),this.storage.write("defaultLocale",this.defaultLocale.value),this.sendLanguageEvents(),this.sendTranslationEvents())},LocaleService.prototype.setDefaultLocale=function(languageCode,countryCode,scriptCode,numberingSystem,calendar){this.defaultLocale.languageCode==languageCode&&this.defaultLocale.countryCode==countryCode&&this.defaultLocale.scriptCode==scriptCode&&this.defaultLocale.numberingSystem==numberingSystem&&this.defaultLocale.calendar==calendar||(this.defaultLocale.build(languageCode,countryCode,scriptCode,numberingSystem,calendar),this.storage.write("defaultLocale",this.defaultLocale.value),this.sendDefaultLocaleEvents(),this.sendTranslationEvents())},LocaleService.prototype.setCurrentCurrency=function(currencyCode){this.currencyCode!=currencyCode&&(this.currencyCode=currencyCode,this.storage.write("currency",this.currencyCode),this.sendCurrencyEvents())},LocaleService.prototype.setCurrentTimezone=function(zoneName){this.timezone!=zoneName&&(this.timezone=zoneName,this.storage.write("timezone",this.timezone),this.sendTimezoneEvents())},LocaleService.prototype.initStorage=function(){return __awaiter(this,void 0,void 0,function(){var defaultLocale,currencyCode,zoneName;return __generator(this,function(_a){switch(_a.label){case 0:return this.defaultLocale.value?[3,2]:[4,this.storage.read("defaultLocale")];case 1:(defaultLocale=_a.sent())&&(this.defaultLocale.value=defaultLocale),_a.label=2;case 2:return null!=this.currencyCode?[3,4]:[4,this.storage.read("currency")];case 3:(currencyCode=_a.sent())&&(this.currencyCode=currencyCode),_a.label=4;case 4:return null!=this.timezone?[3,6]:[4,this.storage.read("timezone")];case 5:(zoneName=_a.sent())&&(this.timezone=zoneName),_a.label=6;case 6:return[2]}})})},LocaleService.prototype.initLanguage=function(){if(!this.defaultLocale.languageCode){var browserLanguage=this.getBrowserLanguage(),matchedLanguages=[];browserLanguage&&(matchedLanguages=this.matchLanguage(browserLanguage)),browserLanguage&&matchedLanguages.length>0?this.defaultLocale.build(browserLanguage):this.configuration.language&&this.defaultLocale.build(this.configuration.language),this.storage.write("defaultLocale",this.defaultLocale.value)}this.sendLanguageEvents()},LocaleService.prototype.initDefaultLocale=function(){this.defaultLocale.value||this.configuration.defaultLocale&&(this.defaultLocale.build(this.configuration.defaultLocale.languageCode,this.configuration.defaultLocale.countryCode,this.configuration.defaultLocale.scriptCode,this.configuration.defaultLocale.numberingSystem,this.configuration.defaultLocale.calendar),this.storage.write("defaultLocale",this.defaultLocale.value)),this.sendDefaultLocaleEvents()},LocaleService.prototype.initCurrency=function(){null==this.currencyCode&&this.configuration.currency&&(this.currencyCode=this.configuration.currency,this.storage.write("currency",this.currencyCode)),this.sendCurrencyEvents()},LocaleService.prototype.initTimezone=function(){null==this.timezone&&this.configuration.timezone&&(this.timezone=this.configuration.timezone,this.storage.write("timezone",this.timezone)),this.sendCurrencyEvents()},LocaleService.prototype.matchLanguage=function(languageCode){var matchedLanguages=[];return this.configuration.languages&&(matchedLanguages=this.configuration.languages.filter(function(language){return language.code==languageCode})),matchedLanguages},LocaleService.prototype.sendLanguageEvents=function(){this.languageCodeChanged.emit(this.defaultLocale.languageCode)},LocaleService.prototype.sendDefaultLocaleEvents=function(){this.defaultLocaleChanged.emit(this.defaultLocale.value)},LocaleService.prototype.sendCurrencyEvents=function(){this.currencyCodeChanged.emit(this.currencyCode)},LocaleService.prototype.sendTimezoneEvents=function(){this.timezoneChanged.emit(this.timezone)},LocaleService.prototype.sendTranslationEvents=function(){this.loadTranslation.next()},LocaleService.decorators=[{type:core.Injectable}],LocaleService.ctorParameters=function(){return[{type:void 0,decorators:[{type:core.Inject,args:[LOCALE_CONFIG]}]},{type:LocaleStorage}]},LocaleService.propDecorators={languageCodeChanged:[{type:core.Output}],defaultLocaleChanged:[{type:core.Output}],currencyCodeChanged:[{type:core.Output}],timezoneChanged:[{type:core.Output}]},LocaleService}(),TranslationProvider=function(){function TranslationProvider(){}return TranslationProvider.decorators=[{type:core.Injectable}],TranslationProvider.ctorParameters=function(){return[]},TranslationProvider}(),HttpTranslationProvider=function(){function HttpTranslationProvider(configuration,http$$1){this.configuration=configuration,this.http=http$$1,this.cache={}}return HttpTranslationProvider.prototype.getTranslation=function(language,args){var url="";switch(args.type){case ProviderType.WebAPI:url+=args.path+language;break;default:url+=args.prefix+language+".json"}return this.configuration.caching?this.caching(url,this.http.get(url)):this.http.get(url)},HttpTranslationProvider.prototype.caching=function(key,request){if(this.cache[key])return this.cache[key];var buffer=new ReplaySubject.ReplaySubject(1);request.subscribe(function(value){return buffer.next(value)},function(error){return buffer.error(error)},function(){return buffer.complete()});var response=buffer.asObservable();return this.cache[key]=response,response},HttpTranslationProvider.decorators=[{type:core.Injectable}],HttpTranslationProvider.ctorParameters=function(){return[{type:void 0,decorators:[{type:core.Inject,args:[TRANSLATION_CONFIG]}]},{type:http.HttpClient}]},HttpTranslationProvider}(),TranslationHandler=function(){function TranslationHandler(){}return TranslationHandler.decorators=[{type:core.Injectable}],TranslationHandler.ctorParameters=function(){return[]},TranslationHandler}(),DefaultTranslationHandler=function(){function DefaultTranslationHandler(configuration){this.configuration=configuration}return DefaultTranslationHandler.prototype.parseValue=function(path,key,value,args,lang){return null==value?this.handleMissingValue(path):args?this.handleArgs(value,args):value},DefaultTranslationHandler.prototype.handleMissingValue=function(path){return this.configuration.missingValue?"function"==typeof this.configuration.missingValue?this.configuration.missingValue(path):this.configuration.missingValue:path},DefaultTranslationHandler.prototype.handleArgs=function(value,args){return value.replace(/{{\s?([^{}\s]*)\s?}}/g,function(substring,parsedKey){var replacer=args[parsedKey];return void 0!==replacer?replacer:substring})},DefaultTranslationHandler.decorators=[{type:core.Injectable}],DefaultTranslationHandler.ctorParameters=function(){return[{type:void 0,decorators:[{type:core.Inject,args:[TRANSLATION_CONFIG]}]}]},DefaultTranslationHandler}(),TranslationService=function(){function TranslationService(configuration,locale,translationProvider,translationHandler){this.configuration=configuration,this.locale=locale,this.translationProvider=translationProvider,this.translationHandler=translationHandler,this.translationError=new Subject.Subject,this.translation=new BehaviorSubject.BehaviorSubject(""),this.translationData={},this.serviceState=ServiceState.isWaiting}return TranslationService.prototype.getConfiguration=function(){return this.configuration},TranslationService.prototype.init=function(){return __awaiter(this,void 0,void 0,function(){var translations,_i,translations_1,translation,_this=this;return __generator(this,function(_a){switch(_a.label){case 0:if(this.configuration.providers)this.loadingMode=LoadingMode.Async;else if(this.loadingMode=LoadingMode.Direct,this.configuration.translationData)for(translations=this.configuration.translationData,_i=0,translations_1=translations;_i<translations_1.length;_i++)translation=translations_1[_i],this.addData(translation.data,translation.languageCode);return this.locale.loadTranslation.subscribe(function(){_this.loadTranslation()}),[4,this.loadTranslation()];case 1:return _a.sent(),[2]}})})},TranslationService.prototype.translationChanged=function(){return this.translation.asObservable()},TranslationService.prototype.translate=function(keys,args,lang){if(void 0===args&&(args=null),void 0===lang&&(lang=this.translation.getValue()),this.serviceState!=ServiceState.isReady)return keys;if(Array.isArray(keys)){for(var data={},_i=0,keys_1=keys;_i<keys_1.length;_i++){var key=keys_1[_i];data[key]=this.translateKey(key,args,lang)}return data}return this.translateKey(keys,args,lang)},TranslationService.prototype.translateAsync=function(keys,args,lang){var _this=this;return void 0===lang&&(lang=this.translation.getValue()),Observable.Observable.create(function(observer){var values=_this.translate(keys,args,lang);observer.next(values),observer.complete()})},TranslationService.prototype.translateKey=function(key,args,lang){return null==key||""==key?null:this.configuration.i18nPlural&&/^\d+\b/.exec(key)?this.translateI18nPlural(key,args,lang):this.getValue(key,args,lang)},TranslationService.prototype.getValue=function(key,args,lang){var path=key,value=null,translation=this.translationData[lang];if(translation){if(this.configuration.composedKeySeparator){var sequences=key.split(this.configuration.composedKeySeparator);for(key=sequences.shift();sequences.length>0&&translation[key];)translation=translation[key],key=sequences.shift()}value=translation[key]||translation[this.configuration.missingKey||""]}return this.translationHandler.parseValue(path,key,value,args,lang)},TranslationService.prototype.translateI18nPlural=function(key,args,lang){var keyText=key.replace(/^\d+\b/,"");keyText=keyText.trim();var keyNumber=parseFloat(key);return(key=key.replace(/^\d+/,this.translateNumber(keyNumber))).replace(keyText,this.getValue(keyText,args,lang))},TranslationService.prototype.translateNumber=function(keyNumber){return!isNaN(keyNumber)&&IntlAPI.hasNumberFormat()?new Intl.NumberFormat(this.translation.getValue()).format(keyNumber):keyNumber.toString()},TranslationService.prototype.loadTranslation=function(){return __awaiter(this,void 0,void 0,function(){var language;return __generator(this,function(_a){switch(_a.label){case 0:return null==(language=this.configuration.composedLanguage?this.composeLanguage(this.configuration.composedLanguage):this.locale.getCurrentLanguage())?[3,3]:this.loadingMode!=LoadingMode.Async?[3,2]:[4,this.getTranslation(language).toPromise()];case 1:return _a.sent(),[3,3];case 2:this.releaseTranslation(language),_a.label=3;case 3:return[2]}})})},TranslationService.prototype.composeLanguage=function(composedLanguage){var language="";if(composedLanguage.length>0)for(var i=0;i<=composedLanguage.length-1;i++){switch(composedLanguage[i]){case ISOCode.Script:language+=this.locale.getCurrentScript();break;case ISOCode.Country:language+=this.locale.getCurrentCountry();break;default:language+=this.locale.getCurrentLanguage()}i<composedLanguage.length-1&&(language+="-")}return language},TranslationService.prototype.getTranslation=function(language){var _this=this;return Observable.Observable.create(function(observer){_this.translationData={},_this.serviceState=ServiceState.isLoading;for(var sequencesOfOrderedTranslationData=[],sequencesOfTranslationData=[],_i=0,_a=_this.configuration.providers;_i<_a.length;_i++){var provider=_a[_i];if(void 0!==provider.type&&provider.type==ProviderType.Fallback){var fallbackLanguage=language;provider.fallbackLanguage&&(fallbackLanguage=_this.composeLanguage(provider.fallbackLanguage)),sequencesOfOrderedTranslationData.push(_this.translationProvider.getTranslation(fallbackLanguage,provider))}else sequencesOfTranslationData.push(_this.translationProvider.getTranslation(language,provider))}var mergedSequencesOfTranslationData=merge.merge.apply(void 0,sequencesOfTranslationData);sequencesOfOrderedTranslationData.push(mergedSequencesOfTranslationData),concat.concat.apply(void 0,sequencesOfOrderedTranslationData).subscribe(function(data){_this.addData(data,language)},function(error){_this.translationError.next(error),_this.releaseTranslation(language),observer.next(null),observer.complete()},function(){_this.releaseTranslation(language),observer.next(null),observer.complete()})})},TranslationService.prototype.addData=function(data,language){this.translationData[language]=void 0!==this.translationData[language]?mergeDeep(this.translationData[language],data):data},TranslationService.prototype.releaseTranslation=function(language){this.serviceState=ServiceState.isReady,this.sendEvents(language)},TranslationService.prototype.sendEvents=function(language){this.translation.next(language)},TranslationService.decorators=[{type:core.Injectable}],TranslationService.ctorParameters=function(){return[{type:void 0,decorators:[{type:core.Inject,args:[TRANSLATION_CONFIG]}]},{type:LocaleService},{type:TranslationProvider},{type:TranslationHandler}]},TranslationService}(),L10nLoader=function(){function L10nLoader(localeConfig,translationConfig,locale,translation){this.localeConfig=localeConfig,this.translationConfig=translationConfig,this.locale=locale,this.translation=translation}return L10nLoader.prototype.load=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(_a){switch(_a.label){case 0:return Object.keys(this.localeConfig).length>0?[4,this.locale.init()]:[3,2];case 1:_a.sent(),_a.label=2;case 2:return Object.keys(this.translationConfig).length>0?[4,this.translation.init()]:[3,4];case 3:_a.sent(),_a.label=4;case 4:return[2]}})})},L10nLoader.decorators=[{type:core.Injectable}],L10nLoader.ctorParameters=function(){return[{type:void 0,decorators:[{type:core.Inject,args:[LOCALE_CONFIG]}]},{type:void 0,decorators:[{type:core.Inject,args:[TRANSLATION_CONFIG]}]},{type:LocaleService},{type:TranslationService}]},L10nLoader}(),Translation=function(){function Translation(changeDetectorRef){var _this=this;this.changeDetectorRef=changeDetectorRef,this.paramSubscriptions=[],this.translation=InjectorRef.get(TranslationService),this.paramSubscriptions.push(this.translation.translationChanged().subscribe(function(language){_this.lang=language,_this.changeDetectorRef&&_this.changeDetectorRef.markForCheck()}))}return Translation.prototype.cancelParamSubscriptions=function(){this.paramSubscriptions.forEach(function(subscription){void 0!==subscription&&subscription.unsubscribe()})},Translation.decorators=[{type:core.Injectable}],Translation.ctorParameters=function(){return[{type:core.ChangeDetectorRef}]},Translation}(),Localization=function(_super){function Localization(changeDetectorRef){var _this=_super.call(this)||this;return _this.changeDetectorRef=changeDetectorRef,_this.locale=InjectorRef.get(LocaleService),_this.defaultLocale=_this.locale.getDefaultLocale(),_this.paramSubscriptions.push(_this.locale.defaultLocaleChanged.subscribe(function(defaultLocale){_this.defaultLocale=defaultLocale,_this.changeDetectorRef&&_this.changeDetectorRef.markForCheck()})),_this.currency=_this.locale.getCurrentCurrency(),_this.paramSubscriptions.push(_this.locale.currencyCodeChanged.subscribe(function(currency){_this.currency=currency,_this.changeDetectorRef&&_this.changeDetectorRef.markForCheck()})),_this.timezone=_this.locale.getCurrentTimezone(),_this.paramSubscriptions.push(_this.locale.timezoneChanged.subscribe(function(zoneName){_this.timezone=zoneName,_this.changeDetectorRef&&_this.changeDetectorRef.markForCheck()})),_this}return __extends(Localization,_super),Localization.decorators=[{type:core.Injectable}],Localization.ctorParameters=function(){return[{type:core.ChangeDetectorRef}]},Localization}(Translation),LocaleValidation=function(){function LocaleValidation(locale){this.locale=locale}return LocaleValidation.prototype.parseNumber=function(s,defaultLocale){if(void 0===defaultLocale&&(defaultLocale=this.locale.getDefaultLocale()),""==s||null==s)return null;for(var value="",decimalCode=this.getDecimalCode(defaultLocale),numberCodes=this.getNumberCodes(defaultLocale),_i=0,characters_1=s.split("");_i<characters_1.length;_i++){var char=characters_1[_i],charCode=this.toUnicode(char),index=numberCodes.indexOf(charCode);if(-1!=index)value+=index;else if(charCode==decimalCode.minusSign)value+="-";else{if(charCode!=decimalCode.decimalSeparator){if(charCode==decimalCode.thousandSeparator)continue;return NaN}value+="."}}return parseFloat(value)},LocaleValidation.prototype.getRegExp=function(digits,defaultLocale){void 0===defaultLocale&&(defaultLocale=this.locale.getDefaultLocale());var minInt=1,minFraction=0,maxFraction=3;if(digits){var parts=digits.match(/^(\d+)?\.((\d+)(\-(\d+))?)?$/);null!=parts&&(null!=parts[1]&&(minInt=parseInt(parts[1])),null!=parts[3]&&(minFraction=parseInt(parts[3])),null!=parts[5]&&(maxFraction=parseInt(parts[5])))}var decimalCode=this.getDecimalCode(defaultLocale),numberCodes=this.getNumberCodes(defaultLocale),minusSign=decimalCode.minusSign,zero=numberCodes[0],decimalSeparator=decimalCode.decimalSeparator,thousandSeparator=decimalCode.thousandSeparator,d="["+zero+"-"+numberCodes[9]+"]",n="{"+minInt+",}",nm="{"+minFraction+","+maxFraction+"}",pattern="^"+minusSign+"?("+(""+d+n)+"|"+("(?=(?:\\"+thousandSeparator+"*"+d+")"+n+"(\\"+decimalSeparator+"|$))(?!"+zero+"(?!\\"+decimalSeparator+"|"+d+"))"+d+"{1,3}(\\"+thousandSeparator+d+"{3})*")+")";return pattern+=minFraction>0&&maxFraction>0?"\\"+decimalSeparator+d+nm+"$":0==minFraction&&maxFraction>0?"(\\"+decimalSeparator+d+nm+")?$":"$",pattern=this.toChar(pattern),new RegExp(pattern)},LocaleValidation.prototype.getDecimalCode=function(defaultLocale){var decimalCode={minusSign:this.toUnicode("-"),decimalSeparator:this.toUnicode("."),thousandSeparator:this.toUnicode(",")};if(IntlAPI.hasNumberFormat()){for(var localeValue=new Intl.NumberFormat(defaultLocale).format(-1000.9),unicodeChars=[],i=0;i<=7;i++)unicodeChars.push(this.toUnicode(localeValue.charAt(i)));decimalCode="\\u200F"==unicodeChars[0]||"\\u061C"==unicodeChars[0]?{minusSign:unicodeChars[1],decimalSeparator:unicodeChars[7],thousandSeparator:unicodeChars[3]}:unicodeChars[0]==this.toUnicode(new Intl.NumberFormat(defaultLocale).format(1))?{minusSign:unicodeChars[7],decimalSeparator:unicodeChars[5],thousandSeparator:unicodeChars[1]}:"\\u200E"==unicodeChars[0]?{minusSign:unicodeChars[1],decimalSeparator:unicodeChars[7],thousandSeparator:unicodeChars[3]}:{minusSign:unicodeChars[0],decimalSeparator:unicodeChars[6],thousandSeparator:unicodeChars[2]}}return decimalCode},LocaleValidation.prototype.getNumberCodes=function(defaultLocale){for(var numberCodes=[],num=0;num<=9;num++)numberCodes.push(this.toUnicode(num.toString()));if(IntlAPI.hasNumberFormat())for(num=0;num<=9;num++)numberCodes[num]=this.toUnicode(new Intl.NumberFormat(defaultLocale).format(num));return numberCodes},LocaleValidation.prototype.toChar=function(pattern){return pattern.replace(/\\u[\dA-F]{4}/gi,function(match){return String.fromCharCode(parseInt(match.replace(/\\u/g,""),16))})},LocaleValidation.prototype.toUnicode=function(c){return"\\u"+this.toHex(c.charCodeAt(0))},LocaleValidation.prototype.toHex=function(value){var hex=value.toString(16).toUpperCase();return hex="0000".substr(0,4-hex.length)+hex},LocaleValidation.decorators=[{type:core.Injectable}],LocaleValidation.ctorParameters=function(){return[{type:LocaleService}]},LocaleValidation}(),Collator=function(){function Collator(locale,translation){this.locale=locale,this.translation=translation}return Collator.prototype.compare=function(key1,key2,extension,options){if(void 0===options&&(options={usage:"sort",sensitivity:"variant"}),!IntlAPI.hasCollator())return 0;var value1=this.translation.translate(key1),value2=this.translation.translate(key2),locale=this.addExtension(this.locale.getCurrentLocale(),extension);return new Intl.Collator(locale,options).compare(value1,value2)},Collator.prototype.sort=function(list,keyName,order,extension,options){var _this=this;return void 0===order&&(order="asc"),void 0===options&&(options={usage:"sort",sensitivity:"variant"}),list&&keyName&&IntlAPI.hasCollator()?(list.sort(function(key1,key2){return _this.compare(key1[keyName],key2[keyName],extension,options)}),"desc"==order&&list.reverse(),list):list},Collator.prototype.sortAsync=function(list,keyName,order,extension,options){var _this=this;return void 0===options&&(options={usage:"sort",sensitivity:"variant"}),Observable.Observable.create(function(observer){observer.next(_this.sort(list,keyName,order,extension,options)),observer.complete()})},Collator.prototype.search=function(s,list,keyNames,options){var _this=this;if(void 0===options&&(options={usage:"search"}),!list||!keyNames||""==s||null==s||!IntlAPI.hasCollator())return list;var locale=this.locale.getCurrentLocale(),collator=new Intl.Collator(locale,options);return list.filter(function(key){for(var found=!1,i=0;i<keyNames.length;i++)if(_this.match(key[keyNames[i]],s,collator)){found=!0;break}return found})},Collator.prototype.searchAsync=function(s,list,keyNames,options){var _this=this;return void 0===options&&(options={usage:"search"}),Observable.Observable.create(function(observer){observer.next(_this.search(s,list,keyNames,options)),observer.complete()})},Collator.prototype.addExtension=function(locale,extension){return extension&&(locale=locale+"-u-"+extension),locale},Collator.prototype.match=function(key,s,collator){var value=this.translation.translate(key),valueLength=value.length,sLength=s.length;if(sLength>valueLength)return!1;if(sLength==valueLength)return 0==collator.compare(value,s);for(var found=!1,i=0;i<valueLength-(sLength-1);i++){var str=value.substr(i,sLength);if(0==collator.compare(str,s)){found=!0;break}}return found},Collator.decorators=[{type:core.Injectable}],Collator.ctorParameters=function(){return[{type:LocaleService},{type:TranslationService}]},Collator}(),TranslatePipe=function(){function TranslatePipe(translation){this.translation=translation}return TranslatePipe.prototype.transform=function(key,lang,args){return this.translation.translate(key,args,lang)},TranslatePipe.decorators=[{type:core.Pipe,args:[{name:"translate",pure:!0}]}],TranslatePipe.ctorParameters=function(){return[{type:TranslationService}]},TranslatePipe}(),FORMAT_ALIASES={short:datePartFactory(combine([digitCondition("year",1),digitCondition("month",1),digitCondition("day",1),digitCondition("hour",1),digitCondition("minute",1)])),medium:datePartFactory(combine([digitCondition("year",1),nameCondition("month",3),digitCondition("day",1),digitCondition("hour",1),digitCondition("minute",1),digitCondition("second",1)])),shortDate:datePartFactory(combine([digitCondition("year",1),digitCondition("month",1),digitCondition("day",1)])),mediumDate:datePartFactory(combine([digitCondition("year",1),nameCondition("month",3),digitCondition("day",1)])),longDate:datePartFactory(combine([digitCondition("year",1),nameCondition("month",4),digitCondition("day",1)])),fullDate:datePartFactory(combine([digitCondition("year",1),nameCondition("month",4),nameCondition("weekday",4),digitCondition("day",1)])),shortTime:datePartFactory(combine([digitCondition("hour",1),digitCondition("minute",1)])),mediumTime:datePartFactory(combine([digitCondition("hour",1),digitCondition("second",1),digitCondition("minute",1)]))},IntlFormatter=function(){function IntlFormatter(){}return IntlFormatter.formatNumber=function(num,defaultLocale,style,digits,currency,currencyDisplay){var minInt,minFraction,maxFraction;if(style!==NumberFormatStyle.Currency&&(minInt=1,minFraction=0,maxFraction=3),digits){var parts=digits.match(/^(\d+)?\.((\d+)(\-(\d+))?)?$/);null!=parts&&(null!=parts[1]&&(minInt=parseInt(parts[1])),null!=parts[3]&&(minFraction=parseInt(parts[3])),null!=parts[5]&&(maxFraction=parseInt(parts[5])))}return IntlFormatter.numberFormatter(num,defaultLocale,style,{minimumIntegerDigits:minInt,minimumFractionDigits:minFraction,maximumFractionDigits:maxFraction,currency:currency,currencyDisplay:currencyDisplay})},IntlFormatter.formatDate=function(date,defaultLocale,format,timezone){return IntlFormatter.dateTimeFormatter(date,defaultLocale,format,timezone)},IntlFormatter.numberFormatter=function(num,defaultLocale,style,opts){void 0===opts&&(opts={});var minimumIntegerDigits=opts.minimumIntegerDigits,minimumFractionDigits=opts.minimumFractionDigits,maximumFractionDigits=opts.maximumFractionDigits,currency=opts.currency,currencyDisplay=opts.currencyDisplay,options={minimumIntegerDigits:minimumIntegerDigits,minimumFractionDigits:minimumFractionDigits,maximumFractionDigits:maximumFractionDigits,style:NumberFormatStyle[style].toLowerCase()};return style==NumberFormatStyle.Currency&&(options.currency=currency,options.currencyDisplay=currencyDisplay),new Intl.NumberFormat(defaultLocale,options).format(num)},IntlFormatter.dateTimeFormatter=function(date,defaultLocale,format,timezone){var options={};if("string"==typeof format){var fnFormatAliases=FORMAT_ALIASES[format];if(fnFormatAliases)return fnFormatAliases(date,defaultLocale,timezone)}else options=format;return intlDateTimeFormat(date,defaultLocale,options,timezone)},IntlFormatter}(),L10nDatePipe=function(){function L10nDatePipe(){this.ISO8601_DATE_REGEX=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/}return L10nDatePipe.prototype.transform=function(value,defaultLocale,format,timezone){if(void 0===format&&(format="mediumDate"),null==value||""===value||value!=value)return null;if(void 0===defaultLocale)return null;if(IntlAPI.hasDateTimeFormat()){var date=void 0;if("string"==typeof value&&(value=value.trim()),this.isDate(value))date=value;else if(isNaN(value-parseFloat(value)))if("string"==typeof value&&/^(\d{4}-\d{1,2}-\d{1,2})$/.test(value)){var _a=value.split("-").map(function(val){return parseInt(val,10)}),y=_a[0],m=_a[1],d=_a[2];date=new Date(y,m-1,d)}else date=new Date(value);else date=new Date(parseFloat(value));if(!this.isDate(date)){var match=void 0;"string"==typeof value&&(match=value.match(this.ISO8601_DATE_REGEX))&&(date=this.isoStringToDate(match))}return IntlFormatter.formatDate(date,defaultLocale,format,timezone)}return value},L10nDatePipe.prototype.isDate=function(value){return value instanceof Date&&!isNaN(value.valueOf())},L10nDatePipe.prototype.isoStringToDate=function(match){var date=new Date(0),tzHour=0,tzMin=0,dateSetter=match[8]?date.setUTCFullYear:date.setFullYear,timeSetter=match[8]?date.setUTCHours:date.setHours;match[9]&&(tzHour=+(match[9]+match[10]),tzMin=+(match[9]+match[11])),dateSetter.call(date,+match[1],+match[2]-1,+match[3]);var h=+(match[4]||"0")-tzHour,m=+(match[5]||"0")-tzMin,s=+(match[6]||"0"),ms=Math.round(1e3*parseFloat("0."+(match[7]||0)));return timeSetter.call(date,h,m,s,ms),date},L10nDatePipe.decorators=[{type:core.Pipe,args:[{name:"l10nDate",pure:!0}]}],L10nDatePipe.ctorParameters=function(){return[]},L10nDatePipe}(),L10nDecimalPipe=function(){function L10nDecimalPipe(){}return L10nDecimalPipe.prototype.transform=function(value,defaultLocale,digits){return null==value?null:void 0===defaultLocale?null:IntlAPI.hasNumberFormat()?(value="string"!=typeof value||isNaN(+value-parseFloat(value))?value:+value,IntlFormatter.formatNumber(value,defaultLocale,NumberFormatStyle.Decimal,digits)):value},L10nDecimalPipe.decorators=[{type:core.Pipe,args:[{name:"l10nDecimal",pure:!0}]}],L10nDecimalPipe.ctorParameters=function(){return[]},L10nDecimalPipe}(),L10nPercentPipe=function(){function L10nPercentPipe(){}return L10nPercentPipe.prototype.transform=function(value,defaultLocale,digits){return null==value?null:void 0===defaultLocale?null:IntlAPI.hasNumberFormat()?(value="string"!=typeof value||isNaN(+value-parseFloat(value))?value:+value,IntlFormatter.formatNumber(value,defaultLocale,NumberFormatStyle.Percent,digits)):value},L10nPercentPipe.decorators=[{type:core.Pipe,args:[{name:"l10nPercent",pure:!0}]}],L10nPercentPipe.ctorParameters=function(){return[]},L10nPercentPipe}(),L10nCurrencyPipe=function(){function L10nCurrencyPipe(){}return L10nCurrencyPipe.prototype.transform=function(value,defaultLocale,currency,currencyDisplay,digits){return void 0===currencyDisplay&&(currencyDisplay="symbol"),null==value?null:void 0===defaultLocale||void 0===currency?null:IntlAPI.hasNumberFormat()?(value="string"!=typeof value||isNaN(+value-parseFloat(value))?value:+value,IntlFormatter.formatNumber(value,defaultLocale,NumberFormatStyle.Currency,digits,currency,currencyDisplay)):value+" "+currency},L10nCurrencyPipe.decorators=[{type:core.Pipe,args:[{name:"l10nCurrency",pure:!0}]}],L10nCurrencyPipe.ctorParameters=function(){return[]},L10nCurrencyPipe}(),BFS=function(){function BFS(){}return BFS.getTargetNode=function(rootNode){return BFS.walk(rootNode)},BFS.walk=function(rootNode){var iNode,queue=[],depth=0,nodeToDepthIncrease=1;for(queue.push(rootNode);queue.length>0&&depth<=this.MAX_DEPTH;){if(iNode=queue.shift(),this.isTargetNode(iNode))return iNode;if(depth<this.MAX_DEPTH&&null!=iNode.childNodes)for(var _i=0,_a=iNode.childNodes;_i<_a.length;_i++){var child=_a[_i];this.isValidNode(child)&&queue.push(child)}0==--nodeToDepthIncrease&&(depth++,nodeToDepthIncrease=queue.length)}return rootNode},BFS.isTargetNode=function(node){return void 0!==node&&3==node.nodeType&&null!=node.nodeValue&&""!=node.nodeValue.trim()},BFS.isValidNode=function(node){if(void 0!==node&&1==node.nodeType&&node.attributes)for(var _i=0,_a=node.attributes;_i<_a.length;_i++){var attr=_a[_i];if(attr&&this.SELECTOR.test(attr.name))return!1}return!0},BFS.SELECTOR=new RegExp("^l10n|translate|locale"),BFS.MAX_DEPTH=10,BFS}(),BaseDirective=function(){function BaseDirective(el,renderer){this.el=el,this.renderer=renderer,this.attributes=[],this.subscriptions=[],this.TEXT_MUTATION_CONFIG={subtree:!0,characterData:!0},this.SELECTOR=/^l10n-/}return BaseDirective.prototype.ngAfterViewInit=function(){this.el&&this.el.nativeElement&&(this.element=this.el.nativeElement,this.renderNode=BFS.getTargetNode(this.element),this.getKey(),this.getAttributes(),this.addTextListener(),this.setup())},BaseDirective.prototype.ngOnChanges=function(changes){this.key&&(null!=this.nodeValue&&""!=this.nodeValue||(this.valueAttribute?this.key=this.valueAttribute:this.innerHTMLProperty&&(this.key=this.innerHTMLProperty)),this.replaceText()),this.attributes.length>0&&this.replaceAttributes()},BaseDirective.prototype.ngOnDestroy=function(){this.removeTextListener(),this.cancelSubscriptions()},BaseDirective.prototype.getAttributesData=function(){for(var data={},_i=0,keys_1=this.getAttributesKeys();_i<keys_1.length;_i++){var key=keys_1[_i];data[key]=this.getValues(key)}return data},BaseDirective.prototype.getAttributesKeys=function(){return this.attributes.map(function(attr){return attr.key})},BaseDirective.prototype.setText=function(value){value&&(this.nodeValue&&this.key?(this.removeTextListener(),this.renderer.setValue(this.renderNode,this.nodeValue.replace(this.key,value)),this.addTextListener()):this.valueAttribute?this.renderer.setAttribute(this.element,"value",value):this.innerHTMLProperty&&this.renderer.setProperty(this.element,"innerHTML",value))},BaseDirective.prototype.setAttributes=function(data){for(var _i=0,_a=this.attributes;_i<_a.length;_i++){var attr=_a[_i];this.renderer.setAttribute(this.element,attr.name,data[attr.key])}},BaseDirective.prototype.addTextListener=function(){var _this=this;"undefined"!=typeof MutationObserver&&(this.textObserver=new MutationObserver(function(mutations){_this.renderNode=BFS.getTargetNode(_this.element),_this.getKey(),_this.replaceText()}),this.textObserver.observe(this.renderNode,this.TEXT_MUTATION_CONFIG))},BaseDirective.prototype.removeTextListener=function(){void 0!==this.textObserver&&this.textObserver.disconnect()},BaseDirective.prototype.getText=function(){return this.nodeValue=null!=this.renderNode?this.renderNode.nodeValue:"",this.nodeValue?this.nodeValue.trim():""},BaseDirective.prototype.getKey=function(){this.element.childNodes.length>0?this.key=this.getText():this.valueAttribute?this.key=this.valueAttribute:this.innerHTMLProperty&&(this.key=this.innerHTMLProperty)},BaseDirective.prototype.getAttributes=function(){if(this.element.attributes)for(var _i=0,_a=this.element.attributes;_i<_a.length;_i++){var attr=_a[_i];if(attr&&this.SELECTOR.test(attr.name))for(var name_1=attr.name.substr(5),_b=0,_c=this.element.attributes;_b<_c.length;_b++){var targetAttr=_c[_b];new RegExp("^"+name_1+"$").test(targetAttr.name)&&this.attributes.push({name:name_1,key:targetAttr.value})}}},BaseDirective.prototype.cancelSubscriptions=function(){this.subscriptions.forEach(function(subscription){void 0!==subscription&&subscription.unsubscribe()})},BaseDirective.propDecorators={valueAttribute:[{type:core.Input,args:["value"]}],innerHTMLProperty:[{type:core.Input,args:["innerHTML"]}]},BaseDirective}(),TranslateDirective=function(_super){function TranslateDirective(translation,el,renderer){var _this=_super.call(this,el,renderer)||this;return _this.translation=translation,_this.el=el,_this.renderer=renderer,_this}return __extends(TranslateDirective,_super),Object.defineProperty(TranslateDirective.prototype,"l10nTranslate",{set:function(params){this.params=params},enumerable:!0,configurable:!0}),Object.defineProperty(TranslateDirective.prototype,"translate",{set:function(params){this.params=params},enumerable:!0,configurable:!0}),TranslateDirective.prototype.setup=function(){var _this=this;this.replace(),this.subscriptions.push(this.translation.translationChanged().subscribe(function(){_this.replace()}))},TranslateDirective.prototype.replace=function(){this.replaceText(),this.replaceAttributes()},TranslateDirective.prototype.replaceText=function(){this.key&&this.setText(this.getValues(this.key))},TranslateDirective.prototype.replaceAttributes=function(){if(this.attributes.length>0){var keys=this.getAttributesKeys();this.setAttributes(this.getValues(keys))}},TranslateDirective.prototype.getValues=function(keys){return this.translation.translate(keys,this.params)},TranslateDirective.decorators=[{type:core.Directive,args:[{selector:"[l10nTranslate],[translate]"}]}],TranslateDirective.ctorParameters=function(){return[{type:TranslationService},{type:core.ElementRef},{type:core.Renderer2}]},TranslateDirective.propDecorators={l10nTranslate:[{type:core.Input}],translate:[{type:core.Input}],params:[{type:core.Input}]},TranslateDirective}(BaseDirective),L10nDateDirective=function(_super){function L10nDateDirective(locale,el,renderer){var _this=_super.call(this,el,renderer)||this;return _this.locale=locale,_this.el=el,_this.renderer=renderer,_this.defaultFormat="mediumDate",_this.l10nDatePipe=new L10nDatePipe,_this}return __extends(L10nDateDirective,_super),Object.defineProperty(L10nDateDirective.prototype,"l10nDate",{set:function(format){this.format=format},enumerable:!0,configurable:!0}),L10nDateDirective.prototype.setup=function(){var _this=this;this.replace(),this.subscriptions.push(this.locale.defaultLocaleChanged.subscribe(function(){_this.replace()})),this.subscriptions.push(this.locale.timezoneChanged.subscribe(function(){_this.replace()}))},L10nDateDirective.prototype.replace=function(){this.replaceText(),this.replaceAttributes()},L10nDateDirective.prototype.replaceText=function(){this.key&&this.setText(this.getValues(this.key))},L10nDateDirective.prototype.replaceAttributes=function(){this.attributes.length>0&&this.setAttributes(this.getAttributesData())},L10nDateDirective.prototype.getValues=function(keys){return this.l10nDatePipe.transform(keys,this.locale.getDefaultLocale(),this.format||this.defaultFormat,this.locale.getCurrentTimezone())},L10nDateDirective.decorators=[{type:core.Directive,args:[{selector:"[l10nDate]"}]}],L10nDateDirective.ctorParameters=function(){return[{type:LocaleService},{type:core.ElementRef},{type:core.Renderer2}]},L10nDateDirective.propDecorators={l10nDate:[{type:core.Input}],format:[{type:core.Input}]},L10nDateDirective}(BaseDirective),L10nDecimalDirective=function(_super){function L10nDecimalDirective(locale,el,renderer){var _this=_super.call(this,el,renderer)||this;return _this.locale=locale,_this.el=el,_this.renderer=renderer,_this.l10nDecimalPipe=new L10nDecimalPipe,_this}return __extends(L10nDecimalDirective,_super),Object.defineProperty(L10nDecimalDirective.prototype,"l10nDecimal",{set:function(digits){this.digits=digits},enumerable:!0,configurable:!0}),L10nDecimalDirective.prototype.setup=function(){var _this=this;this.replace(),this.subscriptions.push(this.locale.defaultLocaleChanged.subscribe(function(){_this.replace()}))},L10nDecimalDirective.prototype.replace=function(){this.replaceText(),this.replaceAttributes()},L10nDecimalDirective.prototype.replaceText=function(){this.key&&this.setText(this.getValues(this.key))},L10nDecimalDirective.prototype.replaceAttributes=function(){this.attributes.length>0&&this.setAttributes(this.getAttributesData())},L10nDecimalDirective.prototype.getValues=function(keys){return this.l10nDecimalPipe.transform(keys,this.locale.getDefaultLocale(),this.digits)},L10nDecimalDirective.decorators=[{type:core.Directive,args:[{selector:"[l10nDecimal]"}]}],L10nDecimalDirective.ctorParameters=function(){return[{type:LocaleService},{type:core.ElementRef},{type:core.Renderer2}]},L10nDecimalDirective.propDecorators={l10nDecimal:[{type:core.Input}],digits:[{type:core.Input}]},L10nDecimalDirective}(BaseDirective),L10nPercentDirective=function(_super){function L10nPercentDirective(locale,el,renderer){var _this=_super.call(this,el,renderer)||this;return _this.locale=locale,_this.el=el,_this.renderer=renderer,_this.l10nPercentPipe=new L10nPercentPipe,_this}return __extends(L10nPercentDirective,_super),Object.defineProperty(L10nPercentDirective.prototype,"l10nPercent",{set:function(digits){this.digits=digits},enumerable:!0,configurable:!0}),L10nPercentDirective.prototype.setup=function(){var _this=this;this.replace(),this.subscriptions.push(this.locale.defaultLocaleChanged.subscribe(function(){_this.replace()}))},L10nPercentDirective.prototype.replace=function(){this.replaceText(),this.replaceAttributes()},L10nPercentDirective.prototype.replaceText=function(){this.key&&this.setText(this.getValues(this.key))},L10nPercentDirective.prototype.replaceAttributes=function(){this.attributes.length>0&&this.setAttributes(this.getAttributesData())},L10nPercentDirective.prototype.getValues=function(keys){return this.l10nPercentPipe.transform(keys,this.locale.getDefaultLocale(),this.digits)},L10nPercentDirective.decorators=[{type:core.Directive,args:[{selector:"[l10nPercent]"}]}],L10nPercentDirective.ctorParameters=function(){return[{type:LocaleService},{type:core.ElementRef},{type:core.Renderer2}]},L10nPercentDirective.propDecorators={l10nPercent:[{type:core.Input}],digits:[{type:core.Input}]},L10nPercentDirective}(BaseDirective),L10nCurrencyDirective=function(_super){function L10nCurrencyDirective(locale,el,renderer){var _this=_super.call(this,el,renderer)||this;return _this.locale=locale,_this.el=el,_this.renderer=renderer,_this.l10nCurrencyPipe=new L10nCurrencyPipe,_this}return __extends(L10nCurrencyDirective,_super),Object.defineProperty(L10nCurrencyDirective.prototype,"l10nCurrency",{set:function(digits){this.digits=digits},enumerable:!0,configurable:!0}),L10nCurrencyDirective.prototype.setup=function(){var _this=this;this.replace(),this.subscriptions.push(this.locale.defaultLocaleChanged.subscribe(function(){_this.replace()})),this.subscriptions.push(this.locale.currencyCodeChanged.subscribe(function(){_this.replace()}))},L10nCurrencyDirective.prototype.replace=function(){this.replaceText(),this.replaceAttributes()},L10nCurrencyDirective.prototype.replaceText=function(){this.key&&this.setText(this.getValues(this.key))},L10nCurrencyDirective.prototype.replaceAttributes=function(){this.attributes.length>0&&this.setAttributes(this.getAttributesData())},L10nCurrencyDirective.prototype.getValues=function(keys){return this.l10nCurrencyPipe.transform(keys,this.locale.getDefaultLocale(),this.locale.getCurrentCurrency(),this.currencyDisplay,this.digits)},L10nCurrencyDirective.decorators=[{type:core.Directive,args:[{selector:"[l10nCurrency]"}]}],L10nCurrencyDirective.ctorParameters=function(){return[{type:LocaleService},{type:core.ElementRef},{type:core.Renderer2}]},L10nCurrencyDirective.propDecorators={l10nCurrency:[{type:core.Input}],currencyDisplay:[{type:core.Input}],digits:[{type:core.Input}]},L10nCurrencyDirective}(BaseDirective),L10nNumberValidatorDirective=function(){function L10nNumberValidatorDirective(){this.MIN_VALUE=Number.MIN_VALUE,this.MAX_VALUE=Number.MAX_VALUE}return Object.defineProperty(L10nNumberValidatorDirective.prototype,"l10nValidateNumber",{set:function(digits){this.digits=digits},enumerable:!0,configurable:!0}),L10nNumberValidatorDirective.prototype.ngOnInit=function(){this.validator=l10nValidateNumber(this.digits,this.minValue||this.MIN_VALUE,this.maxValue||this.MAX_VALUE)},L10nNumberValidatorDirective.prototype.validate=function(formControl){return this.validator(formControl)},L10nNumberValidatorDirective.decorators=[{type:core.Directive,args:[{selector:"[l10nValidateNumber][ngModel],[l10nValidateNumber][formControl]",providers:[{provide:forms.NG_VALIDATORS,useExisting:core.forwardRef(function(){return L10nNumberValidatorDirective}),multi:!0}]}]}],L10nNumberValidatorDirective.ctorParameters=function(){return[]},L10nNumberValidatorDirective.propDecorators={l10nValidateNumber:[{type:core.Input}],digits:[{type:core.Input}],minValue:[{type:core.Input}],maxValue:[{type:core.Input}]},L10nNumberValidatorDirective}(),TranslationModule=function(){function TranslationModule(injector){this.injector=injector}return TranslationModule.forRoot=function(l10nConfig,token){return void 0===token&&(token={}),{ngModule:TranslationModule,providers:[InjectorRef,{provide:LOCALE_CONFIG,useValue:l10nConfig.locale||{}},{provide:TRANSLATION_CONFIG,useValue:l10nConfig.translation||{}},LocaleService,{provide:LocaleStorage,useClass:token.localeStorage||BrowserStorage},TranslationService,{provide:TranslationProvider,useClass:token.translationProvider||HttpTranslationProvider},{provide:TranslationHandler,useClass:token.translationHandler||DefaultTranslationHandler},L10nLoader]}},TranslationModule.forChild=function(l10nConfig,token){return void 0===token&&(token={}),{ngModule:TranslationModule,providers:[InjectorRef,{provide:TRANSLATION_CONFIG,useValue:l10nConfig.translation||{}},TranslationService,L10nLoader]}},TranslationModule.decorators=[{type:core.NgModule,args:[{declarations:[TranslatePipe,TranslateDirective],exports:[TranslatePipe,TranslateDirective]}]}],TranslationModule.ctorParameters=function(){return[{type:InjectorRef}]},TranslationModule}(),LocalizationModule=function(){function LocalizationModule(injector){this.injector=injector}return LocalizationModule.forRoot=function(l10nConfig,token){return void 0===token&&(token={}),{ngModule:LocalizationModule,providers:[InjectorRef,{provide:LOCALE_CONFIG,useValue:l10nConfig.locale||{}},{provide:TRANSLATION_CONFIG,useValue:l10nConfig.translation||{}},LocaleService,{provide:LocaleStorage,useClass:token.localeStorage||BrowserStorage},TranslationService,{provide:TranslationProvider,useClass:token.translationProvider||HttpTranslationProvider},{provide:TranslationHandler,useClass:token.translationHandler||DefaultTranslationHandler},L10nLoader]}},LocalizationModule.forChild=function(l10nConfig,token){return void 0===token&&(token={}),{ngModule:LocalizationModule,providers:[InjectorRef,{provide:TRANSLATION_CONFIG,useValue:l10nConfig.translation||{}},TranslationService,L10nLoader]}},LocalizationModule.decorators=[{type:core.NgModule,args:[{declarations:[L10nDatePipe,L10nDecimalPipe,L10nPercentPipe,L10nCurrencyPipe,L10nDateDirective,L10nDecimalDirective,L10nPercentDirective,L10nCurrencyDirective],imports:[TranslationModule],exports:[TranslationModule,L10nDatePipe,L10nDecimalPipe,L10nPercentPipe,L10nCurrencyPipe,L10nDateDirective,L10nDecimalDirective,L10nPercentDirective,L10nCurrencyDirective]}]}],LocalizationModule.ctorParameters=function(){return[{type:InjectorRef}]},LocalizationModule}(),LocaleValidationModule=function(){function LocaleValidationModule(){}return LocaleValidationModule.forRoot=function(){return{ngModule:LocaleValidationModule,providers:[LocaleValidation]}},LocaleValidationModule.decorators=[{type:core.NgModule,args:[{declarations:[L10nNumberValidatorDirective],exports:[L10nNumberValidatorDirective]}]}],LocaleValidationModule.ctorParameters=function(){return[]},LocaleValidationModule}();exports.InjectorRef=InjectorRef,exports.StorageStrategy=StorageStrategy,exports.ProviderType=ProviderType,exports.ISOCode=ISOCode,exports.LOCALE_CONFIG=LOCALE_CONFIG,exports.TRANSLATION_CONFIG=TRANSLATION_CONFIG,exports.L10nLoader=L10nLoader,exports.LocaleService=LocaleService,exports.LocaleStorage=LocaleStorage,exports.BrowserStorage=BrowserStorage,exports.TranslationService=TranslationService,exports.TranslationProvider=TranslationProvider,exports.HttpTranslationProvider=HttpTranslationProvider,exports.TranslationHandler=TranslationHandler,exports.DefaultTranslationHandler=DefaultTranslationHandler,exports.Translation=Translation,exports.Localization=Localization,exports.LocaleValidation=LocaleValidation,exports.Collator=Collator,exports.IntlAPI=IntlAPI,exports.Language=function(){return function(target,propertyKey){var subscription,targetNgOnInit=target.ngOnInit;target.ngOnInit=function(){var _this=this,translation=InjectorRef.get(TranslationService);void 0!==propertyKey&&(subscription=translation.translationChanged().subscribe(function(language){_this[propertyKey]=language})),targetNgOnInit&&targetNgOnInit.apply(this)};var targetNgOnDestroy=target.ngOnDestroy;target.ngOnDestroy=function(){void 0!==subscription&&subscription.unsubscribe(),targetNgOnDestroy&&targetNgOnDestroy.apply(this)},void 0!==propertyKey&&Object.defineProperty(target,propertyKey,{writable:!0,value:void 0})}},exports.DefaultLocale=function(){return function(target,propertyKey){var subscription,targetNgOnInit=target.ngOnInit;target.ngOnInit=function(){var _this=this,locale=InjectorRef.get(LocaleService);void 0!==propertyKey&&(this[propertyKey]=locale.getDefaultLocale(),subscription=locale.defaultLocaleChanged.subscribe(function(defaultLocale){_this[propertyKey]=defaultLocale})),targetNgOnInit&&targetNgOnInit.apply(this)};var targetNgOnDestroy=target.ngOnDestroy;target.ngOnDestroy=function(){void 0!==subscription&&subscription.unsubscribe(),targetNgOnDestroy&&targetNgOnDestroy.apply(this)},void 0!==propertyKey&&Object.defineProperty(target,propertyKey,{writable:!0,value:void 0})}},exports.Currency=function(){return function(target,propertyKey){var subscription,targetNgOnInit=target.ngOnInit;target.ngOnInit=function(){var _this=this,locale=InjectorRef.get(LocaleService);void 0!==propertyKey&&(this[propertyKey]=locale.getCurrentCurrency(),subscription=locale.currencyCodeChanged.subscribe(function(currency){_this[propertyKey]=currency})),targetNgOnInit&&targetNgOnInit.apply(this)};var targetNgOnDestroy=target.ngOnDestroy;target.ngOnDestroy=function(){void 0!==subscription&&subscription.unsubscribe(),targetNgOnDestroy&&targetNgOnDestroy.apply(this)},void 0!==propertyKey&&Object.defineProperty(target,propertyKey,{writable:!0,value:void 0})}},exports.Timezone=function(){return function(target,propertyKey){var subscription,targetNgOnInit=target.ngOnInit;target.ngOnInit=function(){var _this=this,locale=InjectorRef.get(LocaleService);void 0!==propertyKey&&(this[propertyKey]=locale.getCurrentTimezone(),subscription=locale.timezoneChanged.subscribe(function(zoneName){_this[propertyKey]=zoneName})),targetNgOnInit&&targetNgOnInit.apply(this)};var targetNgOnDestroy=target.ngOnDestroy;target.ngOnDestroy=function(){void 0!==subscription&&subscription.unsubscribe(),targetNgOnDestroy&&targetNgOnDestroy.apply(this)},void 0!==propertyKey&&Object.defineProperty(target,propertyKey,{writable:!0,value:void 0})}},exports.TranslatePipe=TranslatePipe,exports.L10nDatePipe=L10nDatePipe,exports.L10nDecimalPipe=L10nDecimalPipe,exports.L10nPercentPipe=L10nPercentPipe,exports.L10nCurrencyPipe=L10nCurrencyPipe,exports.BaseDirective=BaseDirective,exports.TranslateDirective=TranslateDirective,exports.L10nDateDirective=L10nDateDirective,exports.L10nDecimalDirective=L10nDecimalDirective,exports.L10nPercentDirective=L10nPercentDirective,exports.L10nCurrencyDirective=L10nCurrencyDirective,exports.L10nNumberValidatorDirective=L10nNumberValidatorDirective,exports.l10nValidateNumber=l10nValidateNumber,exports.TranslationModule=TranslationModule,exports.LocalizationModule=LocalizationModule,exports.LocaleValidationModule=LocaleValidationModule,Object.defineProperty(exports,"__esModule",{value:!0})});
{
"name": "angular-l10n",
"version": "4.1.5",
"version": "4.2.0",
"description": "An Angular library to translate messages, dates and numbers",

@@ -5,0 +5,0 @@ "main": "./bundles/angular-l10n.umd.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc