angular.module("pascalprecht.translate",["ng"]).run(["$translate",function(a){var b=a.storageKey(),c=a.storage();c?c.get(b)?a.uses(c.get(b)):angular.isString(a.preferredLanguage())?a.uses(a.preferredLanguage()):c.set(b,a.uses()):angular.isString(a.preferredLanguage())&&a.uses(a.preferredLanguage())}]),angular.module("pascalprecht.translate").provider("$translate",["$STORAGE_KEY",function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n={},o=a,p=[],q=".",r=function(a,b){if(!a&&!b)return n;if(a&&!b){if(angular.isString(a))return n[a];angular.extend(n,s(a))}else angular.isObject(n[a])||(n[a]={}),angular.extend(n[a],s(b));return this},s=function(a,b,c,d){var e,f,g;b||(b=[]),c||(c={});for(e in a)a.hasOwnProperty(e)&&(g=a[e],angular.isObject(g)?s(g,b.concat(e),c,e):(f=b.length?""+b.join(q)+q+e:e,b.length&&e===d&&(keyWithShortPath=""+b.join(q),c[keyWithShortPath]="@:"+f),c[f]=g));return c};this.translations=r,this.addInterpolation=function(a){return p.push(a),this},this.useMessageFormatInterpolation=function(){return this.useInterpolation("$translateMessageFormatInterpolation")},this.useInterpolation=function(a){return i=a,this},this.preferredLanguage=function(a){return a?(b=a,this):b},this.translationNotFoundIndicator=function(a){return this.translationNotFoundIndicatorLeft(a),this.translationNotFoundIndicatorRight(a),this},this.translationNotFoundIndicatorLeft=function(a){return a?(l=a,this):l},this.translationNotFoundIndicatorRight=function(a){return a?(m=a,this):m},this.fallbackLanguage=function(a){return a?(("string"==typeof a||angular.isArray(a))&&(c=a),this):c},this.uses=function(a){if(a){if(!n[a]&&!j)throw new Error("$translateProvider couldn't find translationTable for langKey: '"+a+"'");return d=a,this}return d};var t=function(a){return a?(o=a,void 0):g?g+o:o};this.storageKey=t,this.useUrlLoader=function(a){return this.useLoader("$translateUrlLoader",{url:a})},this.useStaticFilesLoader=function(a){return this.useLoader("$translateStaticFilesLoader",a)},this.useLoader=function(a,b){return j=a,k=b||{},this},this.useLocalStorage=function(){return this.useStorage("$translateLocalStorage")},this.useCookieStorage=function(){return this.useStorage("$translateCookieStorage")},this.useStorage=function(a){return f=a,this},this.storagePrefix=function(a){return a?(g=a,this):a},this.useMissingTranslationHandlerLog=function(){return this.useMissingTranslationHandler("$translateMissingTranslationHandlerLog")},this.useMissingTranslationHandler=function(a){return h=a,this},this.$get=["$log","$injector","$rootScope","$q",function(a,g,o,q){var s,u=g.get(i||"$translateDefaultInterpolation"),v=!1,w={},x=function(a){if(!a)throw"No language key specified for loading.";var b=q.defer();return o.$broadcast("$translateLoadingStart"),v=!0,g.get(j)(angular.extend(k,{key:a})).then(function(c){o.$broadcast("$translateLoadingSuccess");var d={};angular.isArray(c)?angular.forEach(c,function(a){angular.extend(d,a)}):angular.extend(d,c),v=!1,b.resolve({key:a,table:d}),o.$broadcast("$translateLoadingEnd")},function(a){o.$broadcast("$translateLoadingError"),b.reject(a),o.$broadcast("$translateLoadingEnd")}),b.promise};if(f&&(s=g.get(f),!s.get||!s.set))throw new Error("Couldn't use storage '"+f+"', missing get() or set() method!");p.length>0&&angular.forEach(p,function(a){var c=g.get(a);c.setLocale(b||d),w[c.getInterpolationIdentifier()]=c});var y=function(a){if(a&&c){if(angular.isArray(c)){for(var b=c.length,e=0;b>e;e++)if(d===n[c[e]])return!1;return!0}return a!==c}return!1},z=function(a,b,e){var f=d?n[d]:n,i=e?w[e]:u;if(f&&f.hasOwnProperty(a))return angular.isString(f[a])&&"@:"===f[a].substr(0,2)?z(f[a].substr(2),b,e):i.interpolate(f[a],b);h&&!v&&g.get(h)(a,d);var j;if(d&&c&&y(d)){"string"==typeof c?(j=[],j.push(c)):j=c;for(var k=j.length,o=0;k>o;o++)if(d!==n[j[o]]){var p=n[j[o]][a];if(p){var q;return i.setLocale(j[o]),q=i.interpolate(p,b),i.setLocale(d),q}}}return l&&(a=[l,a].join(" ")),m&&(a=[a,m].join(" ")),a};if(z.preferredLanguage=function(){return b},z.fallbackLanguage=function(){return c},z.proposedLanguage=function(){return e},z.storage=function(){return s},z.uses=function(a){function b(a){d=a,o.$broadcast("$translateChangeSuccess"),f&&s.set(z.storageKey(),d),u.setLocale(d),angular.forEach(w,function(a,b){w[b].setLocale(d)}),c.resolve(a),o.$broadcast("$translateChangeEnd")}if(!a)return d;var c=q.defer();return o.$broadcast("$translateChangeStart"),!n[a]&&j?(e=a,x(a).then(function(a){e=void 0,r(a.key,a.table),b(a.key)},function(a){e=void 0,o.$broadcast("$translateChangeError"),c.reject(a),o.$broadcast("$translateChangeEnd")})):b(a),c.promise},z.storageKey=function(){return t()},z.refresh=function(a){function b(){f.resolve(),o.$broadcast("$translateRefreshEnd")}function e(){f.reject(),o.$broadcast("$translateRefreshEnd")}if(!j)throw new Error("Couldn't refresh translation table, no loader registered!");var f=q.defer();if(a)if(n.hasOwnProperty(a)){o.$broadcast("$translateRefreshStart");var g=x(a);a===d?g.then(function(c){n[a]=c.table,z.uses(d),b()},function(){o.$broadcast("$translateChangeError"),e()}):g.then(function(c){n[a]=c.table,b()},e)}else f.reject();else{o.$broadcast("$translateRefreshStart");var h=[];if(c)if("string"==typeof c)h.push(x(c));else for(var i=c.length,k=0;i>k;k++)h.push(x(c[k]));d&&h.push(x(d)),h.length>0?q.all(h).then(function(a){for(var c in n)n.hasOwnProperty(c)&&delete n[c];for(var e=0,f=a.length;f>e;e++)r(a[e].key,a[e].table);d&&z.uses(d),b()},function(a){a===d&&o.$broadcast("$translateChangeError"),e()}):b()}return f.promise},j&&(angular.equals(n,{})&&z.uses(z.uses()),c))if("string"!=typeof c||n[c])for(var A=c.length,B=0;A>B;B++)n[c[B]]||x(c[B]);else x(c);return z}]}]),angular.module("pascalprecht.translate").factory("$translateDefaultInterpolation",["$interpolate",function(a){var b,c={},d="default";return c.setLocale=function(a){b=a},c.getInterpolationIdentifier=function(){return d},c.interpolate=function(b,c){return a(b)(c)},c}]),angular.module("pascalprecht.translate").constant("$STORAGE_KEY","NG_TRANSLATE_LANG_KEY"),angular.module("pascalprecht.translate").directive("translate",["$filter","$interpolate","$parse",function(a,b,c){var d=a("translate");return{restrict:"AE",scope:!0,link:function(a,e,f){f.translateInterpolation&&(a.interpolation=f.translateInterpolation),f.$observe("translate",function(c){a.translationId=angular.equals(c,"")||void 0===c?b(e.text().replace(/^\s+|\s+$/g,""))(a.$parent):c}),f.$observe("translateValues",function(b){b&&a.$parent.$watch(function(){a.interpolateParams=c(b)(a.$parent)})}),a.$on("$translateChangeSuccess",function(){e.html(d(a.translationId,a.interpolateParams,a.interpolation))}),a.$watch("[translationId, interpolateParams]",function(){a.translationId&&e.html(d(a.translationId,a.interpolateParams,a.interpolation))},!0)}}}]),angular.module("pascalprecht.translate").filter("translate",["$parse","$translate",function(a,b){return function(c,d,e){return angular.isObject(d)||(d=a(d)()),b(c,d,e)}}]);