
管理员
站长
- UID
- 1
- 积分
- 224402
- 余额
- 13 R
- Moe币
- 84883
- 在线时间
- 279 小时
- 注册时间
- 2025-12-28
- 最后登录
- 2026-11-13
|
|
t.apply(i,[s].concat(I(u,f))),t._locale=p.$i18n.locale,t._localeMessage=p.$i18n.getLocaleMessage(p.$i18n.locale)}else o("`path` is required in v-t directive");else o("value type not supported")}function I(t,e){var n=[];return t&&n.push(t),e&&(Array.isArray(e)||l(e))&&n.push(e),n}function $(t,e){void 0===e&&(e={bridge:!1}),$.installed=!0;(k=t).version&&Number(k.version.split(".")[0]);(function(t){t.prototype.hasOwnProperty("$i18n")||Object.defineProperty(t.prototype,"$i18n",{get:function(){return this._i18n}}),t.prototype.$t=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var r=this.$i18n;return r._t.apply(r,[t,r.locale,r._getMessages(),this].concat(e))},t.prototype.$tc=function(t,e){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];var i=this.$i18n;return i._tc.apply(i,[t,i.locale,i._getMessages(),this,e].concat(n))},t.prototype.$te=function(t,e){var n=this.$i18n;return n._te(t,n.locale,n._getMessages(),e)},t.prototype.$d=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).d.apply(e,[t].concat(n))},t.prototype.$n=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this.$i18n).n.apply(e,[t].concat(n))}})(k),k.mixin(function(t){function e(){this!==this.$root&&this.$options.__INTLIFY_META__&&this.$el&&this.$el.setAttribute("data-intlify",this.$options.__INTLIFY_META__)}return void 0===t&&(t=!1),t?{mounted:e}:{beforeCreate:function(){var t=this.$options;if(t.i18n=t.i18n||(t.__i18nBridge||t.__i18n?{}:null),t.i18n){if(t.i18n instanceof ot){if(t.__i18nBridge||t.__i18n)try{var e=t.i18n&&t.i18n.messages?t.i18n.messages:{};(t.__i18nBridge||t.__i18n).forEach(function(t){e=b(e,JSON.parse(t))}),Object.keys(e).forEach(function(n){t.i18n.mergeLocaleMessage(n,e[n])})}catch(t){}this._i18n=t.i18n,this._i18nWatcher=this._i18n.watchI18nData()}else if(l(t.i18n)){var n=this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof ot?this.$root.$i18n:null;if(n&&(t.i18n.root=this.$root,t.i18n.formatter=n.formatter,t.i18n.fallbackLocale=n.fallbackLocale,t.i18n.formatFallbackMessages=n.formatFallbackMessages,t.i18n.silentTranslationWarn=n.silentTranslationWarn,t.i18n.silentFallbackWarn=n.silentFallbackWarn,t.i18n.pluralizationRules=n.pluralizationRules,t.i18n.preserveDirectiveContent=n.preserveDirectiveContent),t.__i18nBridge||t.__i18n)try{var r=t.i18n&&t.i18n.messages?t.i18n.messages:{};(t.__i18nBridge||t.__i18n).forEach(function(t){r=b(r,JSON.parse(t))}),t.i18n.messages=r}catch(t){}var i=t.i18n.sharedMessages;i&&l(i)&&(t.i18n.messages=b(t.i18n.messages,i)),this._i18n=new ot(t.i18n),this._i18nWatcher=this._i18n.watchI18nData(),(void 0===t.i18n.sync||t.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale()),n&&n.onComponentInstanceCreated(this._i18n)}}else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof ot?this._i18n=this.$root.$i18n:t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof ot&&(this._i18n=t.parent.$i18n)},beforeMount:function(){var t=this.$options;t.i18n=t.i18n||(t.__i18nBridge||t.__i18n?{}:null),t.i18n?t.i18n instanceof ot?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):l(t.i18n)&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0):this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof ot?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof ot&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0)},mounted:e,beforeDestroy:function(){if(this._i18n){var t=this;this.$nextTick(function(){t._subscribing&&(t._i18n.unsubscribeDataChanging(t),delete t._subscribing),t._i18nWatcher&&(t._i18nWatcher(),t._i18n.destroyVM(),delete t._i18nWatcher),t._localeWatcher&&(t._localeWatcher(),delete t._localeWatcher)})}}}}(e.bridge)),k.directive("t",{bind:C,update:E,unbind:T}),k.component(x.name,x),k.component(A.name,A),k.config.optionMergeStrategies.i18n=function(t,e){return void 0===e?t:e}}var L=function(){this._caches=Object.create(null)};L.prototype.interpolate=function(t,e){if(!e)return[t];var n=this._caches[t];return n||(n=function(t){var e=[],n=0,r="";for(;n<t.length;){var i=t[n++];if("{"===i){r&&e.push({type:"text",value:r}),r="";var o="";for(i=t[n++];void 0!==i&&"}"!==i;)o+=i,i=t[n++];var a="}"===i,s=M.test(o)?"list":a&&F.test(o)?"named":"unknown";e.push({value:o,type:s})}else"%"===i?"{"!==t[n]&&(r+=i):r+=i}return r&&e.push({type:"text",value:r}),e}(t),this._caches[t]=n),function(t,e){var n=[],r=0,i=Array.isArray(e)?"list":s(e)?"named":"unknown";if("unknown"===i)return n;for(;r<t.length;){var o=t[r];switch(o.type){case"text":n.push(o.value);break;case"list":n.push(e[parseInt(o.value,10)]);break;case"named":"named"===i&&n.push(e[o.value]);break;case"unknown":0}r++}return n}(n,e)};var M=/^(?:\d)+/,F=/^(?:\w)+/;var R=0,N=1,D=2,U=3,B=0,z=4,V=5,W=6,H=7,q=8,G=[];G[B]={ws:[B],ident:[3,R],"[":[z],eof:[H]},G[1]={ws:[1],".":[2],"[":[z],eof:[H]},G[2]={ws:[2],ident:[3,R],0:[3,R],number:[3,R]},G[3]={ident:[3,R],0:[3,R],number:[3,R],ws:[1,N],".":[2,N],"[":[z,N],eof:[H,N]},G[z]={"'":[V,R],'"':[W,R],"[":[z,D],"]":[1,U],eof:q,else:[z,R]},G[V]={"'":[z,R],eof:q,else:[V,R]},G[W]={'"':[z,R],eof:q,else:[W,R]};var Y=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function J(t){if(null==t)return"eof";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"ident";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return"ident"}function K(t){var e,n,r,i=t.trim();return("0"!==t.charAt(0)||!isNaN(t))&&(r=i,Y.test(r)?(n=(e=i).charCodeAt(0))!==e.charCodeAt(e.length-1)||34!==n&&39!==n?e:e.slice(1,-1):"*"+i)}var X=function(){this._cache=Object.create(null)};X.prototype.parsePath=function(t){var e=this._cache[t];return e||(e=function(t){var e,n,r,i,o,a,s,c=[],u=-1,f=B,l=0,d=[];function p(){var e=t[u+1];if(f===V&&"'"===e||f===W&&'"'===e)return u++,r="\\"+e,d[R](),!0}for(d[N]=function(){void 0!==n&&(c.push(n),n=void 0)},d[R]=function(){void 0===n?n=r:n+=r},d[D]=function(){d[R](),l++},d[U]=function(){if(l>0)l--,f=z,d[R]();else{if(l=0,void 0===n)return!1;if(!1===(n=K(n)))return!1;d[N]()}};null!==f;)if("\\"!==(e=t[++u])||!p()){if(i=J(e),(o=(s=G[f])[i]||s.else||q)===q)return;if(f=o[0],(a=d[o[1]])&&(r=void 0===(r=o[2])?e:r,!1===a()))return;if(f===H)return c}}(t))&&(this._cache[t]=e),e||[]},X.prototype.getPathValue=function(t,e){if(!s(t))return null;var n=this.parsePath(e);if(0===n.length)return null;for(var r=n.length,i=t,o=0;o<r;){var a=i[n[o]];if(null==a)return null;i=a,o++}return i};var Q,Z=/<\/?[\w\s="/.':;#-\/]+>/,tt=/(?:@(?:\.[a-zA-Z]+)?:(?:[\w\-_|./]+|\([\w\-_:|./]+\)))/g,et=/^@(?:\.([a-zA-Z]+))?:/,nt=/[()]/g,rt={upper:function(t){return t.toLocaleUpperCase()},lower:function(t){return t.toLocaleLowerCase()},capitalize:function(t){return""+t.charAt(0).toLocaleUpperCase()+t.substr(1)}},it=new L,ot=function(t){var e=this;void 0===t&&(t={}),!k&&"undefined"!=typeof window&&window.Vue&&$(window.Vue);var n=t.locale||"en-US",r=!1!==t.fallbackLocale&&(t.fallbackLocale||"en-US"),i=t.messages||{},o=t.dateTimeFormats||t.datetimeFormats||{},a=t.numberFormats||{};this._vm=null,this._formatter=t.formatter||it,this._modifiers=t.modifiers||{},this._missing=t.missing||null,this._root=t.root||null,this._sync=void 0===t.sync||!!t.sync,this._fallbackRoot=void 0===t.fallbackRoot||!!t.fallbackRoot,this._fallbackRootWithEmptyString=void 0===t.fallbackRootWithEmptyString||!!t.fallbackRootWithEmptyString,this._formatFallbackMessages=void 0!==t.formatFallbackMessages&&!!t.formatFallbackMessages,this._silentTranslationWarn=void 0!==t.silentTranslationWarn&&t.silentTranslationWarn,this._silentFallbackWarn=void 0!==t.silentFallbackWarn&&!!t.silentFallbackWarn,this._dateTimeFormatters={},this._numberFormatters={},this._path=new X,this._dataListeners=new Set,this._componentInstanceCreatedListener=t.componentInstanceCreatedListener||null,this._preserveDirectiveContent=void 0!==t.preserveDirectiveContent&&!!t.preserveDirectiveContent,this.pluralizationRules=t.pluralizationRules||{},this._warnHtmlInMessage=t.warnHtmlInMessage||"off",this._postTranslation=t.postTranslation||null,this._escapeParameterHtml=t.escapeParameterHtml||!1,"__VUE_I18N_BRIDGE__"in t&&(this.__VUE_I18N_BRIDGE__=t.__VUE_I18N_BRIDGE__),this.getChoiceIndex=function(t,n){var r=Object.getPrototypeOf(e);if(r&&r.getChoiceIndex)return r.getChoiceIndex.call(e,t,n);var i,o;return e.locale in e.pluralizationRules?e.pluralizationRules[e.locale].apply(e,[t,n]):(i=t,o=n,i=Math.abs(i),2===o?i?i>1?1:0:1:i?Math.min(i,2):0)},this._exist=function(t,n){return!(!t||!n)&&(!d(e._path.getPathValue(t,n))||!!t[n])},"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||Object.keys(i).forEach(function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,i[t])}),this._initVM({locale:n,fallbackLocale:r,messages:i,dateTimeFormats:o,numberFormats:a})},at={vm:{configurable:!0},messages:{configurable:!0},dateTimeFormats:{configurable:!0},numberFormats:{configurable:!0},availableLocales:{configurable:!0},locale:{configurable:!0},fallbackLocale:{configurable:!0},formatFallbackMessages:{configurable:!0},missing:{configurable:!0},formatter:{configurable:!0},silentTranslationWarn:{configurable:!0},silentFallbackWarn:{configurable:!0},preserveDirectiveContent:{configurable:!0},warnHtmlInMessage:{configurable:!0},postTranslation:{configurable:!0},sync:{configurable:!0}};ot.prototype._checkLocaleMessage=function(t,e,n){var r=function(t,e,n,i){if(l(n))Object.keys(n).forEach(function(o){var a=n[o];l(a)?(i.push(o),i.push("."),r(t,e,a,i),i.pop(),i.pop()):(i.push(o),r(t,e,a,i),i.pop())});else if(a(n))n.forEach(function(n,o){l(n)?(i.push("["+o+"]"),i.push("."),r(t,e,n,i),i.pop(),i.pop()):(i.push("["+o+"]"),r(t,e,n,i),i.pop())});else if(c(n)){if(Z.test(n)){var s="Detected HTML in message '"+n+"' of keypath '"+i.join("")+"' at '"+e+"'. Consider component interpolation with '<i18n>' to avoid XSS. See https://bit.ly/2ZqJzkp";"warn"===t?o(s):"error"===t&&function(t,e){"undefined"!=typeof console&&(console.error("[vue-i18n] "+t),e&&console.error(e.stack))}(s)}}};r(e,t,n,[])},ot.prototype._initVM=function(t){var e=k.config.silent;k.config.silent=!0,this._vm=new k({data:t,__VUE18N__INSTANCE__:!0}),k.config.silent=e},ot.prototype.destroyVM=function(){this._vm.$destroy()},ot.prototype.subscribeDataChanging=function(t){this._dataListeners.add(t)},ot.prototype.unsubscribeDataChanging=function(t){!function(t,e){if(t.delete(e));}(this._dataListeners,t)},ot.prototype.watchI18nData=function(){var t=this;return this._vm.$watch("$data",function(){for(var e,n,r=(e=t._dataListeners,n=[],e.forEach(function(t){return n.push(t)}),n),i=r.length;i--;)k.nextTick(function(){r[i]&&r[i].$forceUpdate()})},{deep:!0})},ot.prototype.watchLocale=function(t){if(t){if(!this.__VUE_I18N_BRIDGE__)return null;var e=this,n=this._vm;return this.vm.$watch("locale",function(r){n.$set(n,"locale",r),e.__VUE_I18N_BRIDGE__&&t&&(t.locale.value=r),n.$forceUpdate()},{immediate:!0})}if(!this._sync||!this._root)return null;var r=this._vm;return this._root.$i18n.vm.$watch("locale",function(t){r.$set(r,"locale",t),r.$forceUpdate()},{immediate:!0})},ot.prototype.onComponentInstanceCreated=function(t){this._componentInstanceCreatedListener&&this._componentInstanceCreatedListener(t,this)},at.vm.get=function(){return this._vm},at.messages.get=function(){return v(this._getMessages())},at.dateTimeFormats.get=function(){return v(this._getDateTimeFormats())},at.numberFormats.get=function(){return v(this._getNumberFormats())},at.availableLocales.get=function(){return Object.keys(this.messages).sort()},at.locale.get=function(){return this._vm.locale},at.locale.set=function(t){this._vm.$set(this._vm,"locale",t)},at.fallbackLocale.get=function(){return this._vm.fallbackLocale},at.fallbackLocale.set=function(t){this._localeChainCache={},this._vm.$set(this._vm,"fallbackLocale",t)},at.formatFallbackMessages.get=function(){return this._formatFallbackMessages},at.formatFallbackMessages.set=function(t){this._formatFallbackMessages=t},at.missing.get=function(){return this._missing},at.missing.set=function(t){this._missing=t},at.formatter.get=function(){return this._formatter},at.formatter.set=function(t){this._formatter=t},at.silentTranslationWarn.get=function(){return this._silentTranslationWarn},at.silentTranslationWarn.set=function(t){this._silentTranslationWarn=t},at.silentFallbackWarn.get=function(){return this._silentFallbackWarn},at.silentFallbackWarn.set=function(t){this._silentFallbackWarn=t},at.preserveDirectiveContent.get=function(){return this._preserveDirectiveContent},at.preserveDirectiveContent.set=function(t){this._preserveDirectiveContent=t},at.warnHtmlInMessage.get=function(){return this._warnHtmlInMessage},at.warnHtmlInMessage.set=function(t){var e=this,n=this._warnHtmlInMessage;if(this._warnHtmlInMessage=t,n!==t&&("warn"===t||"error"===t)){var r=this._getMessages();Object.keys(r).forEach(function(t){e._checkLocaleMessage(t,e._warnHtmlInMessage,r[t])})}},at.postTranslation.get=function(){return this._postTranslation},at.postTranslation.set=function(t){this._postTranslation=t},at.sync.get=function(){return this._sync},at.sync.set=function(t){this._sync=t},ot.prototype._getMessages=function(){return this._vm.messages},ot.prototype._getDateTimeFormats=function(){return this._vm.dateTimeFormats},ot.prototype._getNumberFormats=function(){return this._vm.numberFormats},ot.prototype._warnDefault=function(t,e,n,r,i,o){if(!d(n))return n;if(this._missing){var a=this._missing.apply(null,[t,e,r,i]);if(c(a))return a}else 0;if(this._formatFallbackMessages){var s=h.apply(void 0,i);return this._render(e,o,s.params,e)}return e},ot.prototype._isFallbackRoot=function(t){return(this._fallbackRootWithEmptyString?!t:d(t))&&!d(this._root)&&this._fallbackRoot},ot.prototype._isSilentFallbackWarn=function(t){return this._silentFallbackWarn instanceof RegExp?this._silentFallbackWarn.test(t):this._silentFallbackWarn},ot.prototype._isSilentFallback=function(t,e){return this._isSilentFallbackWarn(e)&&(this._isFallbackRoot()||t!==this.fallbackLocale)},ot.prototype._isSilentTranslationWarn=function(t){return this._silentTranslationWarn instanceof RegExp?this._silentTranslationWarn.test(t):this._silentTranslationWarn},ot.prototype._interpolate=function(t,e,n,r,i,o,s){if(!e)return null;var u,f=this._path.getPathValue(e,n);if(a(f)||l(f))return f;if(d(f)){if(!l(e))return null;if(!c(u=e[n])&&!p(u))return null}else{if(!c(f)&&!p(f))return null;u=f}return c(u)&&(u.indexOf("@:")>=0||u.indexOf("@.")>=0)&&(u=this._link(t,e,u,r,"raw",o,s)),this._render(u,i,o,n)},ot.prototype._link=function(t,e,n,r,i,o,s){var c=n,u=c.match(tt);for(var f in u)if(u.hasOwnProperty(f)){var l=u[f],d=l.match(et),p=d[0],h=d[1],v=l.replace(p,"").replace(nt,"");if(g(s,v))return c;s.push(v);var y=this._interpolate(t,e,v,r,"raw"===i?"string":i,"raw"===i?void 0:o,s);if(this._isFallbackRoot(y)){if(!this._root)throw Error("unexpected error");var m=this._root.$i18n;y=m._translate(m._getMessages(),m.locale,m.fallbackLocale,v,r,i,o)}y=this._warnDefault(t,v,y,r,a(o)?o:[o],i),this._modifiers.hasOwnProperty(h)?y=this._modifiers[h](y):rt.hasOwnProperty(h)&&(y=rt[h](y)),s.pop(),c=y?c.replace(l,y):c}return c},ot.prototype._createMessageContext=function(t,e,n,r){var i=this,o=a(t)?t:[],c=s(t)?t:{},u=this._getMessages(),f=this.locale;return{list:function(t){return o[t]},named:function(t){return c[t]},values:t,formatter:e,path:n,messages:u,locale:f,linked:function(t){return i._interpolate(f,u[f]||{},t,null,r,void 0,[t])}}},ot.prototype._render=function(t,e,n,r){if(p(t))return t(this._createMessageContext(n,this._formatter||it,r,e));var i=this._formatter.interpolate(t,n,r);return i||(i=it.interpolate(t,n,r)),"string"!==e||c(i)?i:i.join("")},ot.prototype._appendItemToChain=function(t,e,n){var r=!1;return g(t,e)||(r=!0,e&&(r="!"!==e[e.length-1],e=e.replace(/!/g,""),t.push(e),n&&n[e]&&(r=n[e]))),r},ot.prototype._appendLocaleToChain=function(t,e,n){var r,i=e.split("-");do{var o=i.join("-");r=this._appendItemToChain(t,o,n),i.splice(-1,1)}while(i.length&&!0===r);return r},ot.prototype._appendBlockToChain=function(t,e,n){for(var r=!0,i=0;i<e.length&&"boolean"==typeof r;i++){var o=e[i];c(o)&&(r=this._appendLocaleToChain(t,o,n))}return r},ot.prototype._getLocaleChain=function(t,e){if(""===t)return[];this._localeChainCache||(this._localeChainCache={});var n=this._localeChainCache[t];if(!n){e||(e=this.fallbackLocale),n=[];for(var r,i=[t];a(i);)i=this._appendBlockToChain(n,i,e);(i=c(r=a(e)?e:s(e)?e.default?e.default:null:e)?[r]:r)&&this._appendBlockToChain(n,i,null),this._localeChainCache[t]=n}return n},ot.prototype._translate=function(t,e,n,r,i,o,a){for(var s,c=this._getLocaleChain(e,n),u=0;u<c.length;u++){var f=c[u];if(!d(s=this._interpolate(f,t[f],r,i,o,a,[r])))return s}return null},ot.prototype._t=function(t,e,n,r){for(var i,o=[],a=arguments.length-4;a-- >0;)o[a]=arguments[a+4];if(!t)return"";var s,c=h.apply(void 0,o);this._escapeParameterHtml&&(c.params=(null!=(s=c.params)&&Object.keys(s).forEach(function(t){"string"==typeof s[t]&&(s[t]=s[t].replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"))}),s));var u=c.locale||e,f=this._translate(n,u,this.fallbackLocale,t,r,"string",c.params);if(this._isFallbackRoot(f)){if(!this._root)throw Error("unexpected error");return(i=this._root).$t.apply(i,[t].concat(o))}return f=this._warnDefault(u,t,f,r,o,"string"),this._postTranslation&&null!=f&&(f=this._postTranslation(f,t)),f},ot.prototype.t=function(t){for(var e,n=[],r=arguments.length-1;r-- >0;)n[r]=arguments[r+1];return(e=this)._t.apply(e,[t,this.locale,this._getMessages(),null].concat(n))},ot.prototype._i=function(t,e,n,r,i){var o=this._translate(n,e,this.fallbackLocale,t,r,"raw",i);if(this._isFallbackRoot(o)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.i(t,e,i)}return this._warnDefault(e,t,o,r,[i],"raw")},ot.prototype.i=function(t,e,n){return t?(c(e)||(e=this.locale),this._i(t,e,this._getMessages(),null,n)):""},ot.prototype._tc=function(t,e,n,r,i){for(var o,a=[],s=arguments.length-5;s-- >0;)a[s]=arguments[s+5];if(!t)return"";void 0===i&&(i=1);var c={count:i,n:i},u=h.apply(void 0,a);return u.params=Object.assign(c,u.params),a=null===u.locale?[u.params]:[u.locale,u.params],this.fetchChoice((o=this)._t.apply(o,[t,e,n,r].concat(a)),i)},ot.prototype.fetchChoice=function(t,e){if(!t||!c(t))return null;var n=t.split("|");return n[e=this.getChoiceIndex(e,n.length)]?n[e].trim():t},ot.prototype.tc=function(t,e){for(var n,r=[],i=arguments.length-2;i-- >0;)r[i]=arguments[i+2];return(n=this)._tc.apply(n,[t,this.locale,this._getMessages(),null,e].concat(r))},ot.prototype._te=function(t,e,n){for(var r=[],i=arguments.length-3;i-- >0;)r[i]=arguments[i+3];var o=h.apply(void 0,r).locale||e;return this._exist(n[o],t)},ot.prototype.te=function(t,e){return this._te(t,this.locale,this._getMessages(),e)},ot.prototype.getLocaleMessage=function(t){return v(this._vm.messages[t]||{})},ot.prototype.setLocaleMessage=function(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,e)},ot.prototype.mergeLocaleMessage=function(t,e){"warn"!==this._warnHtmlInMessage&&"error"!==this._warnHtmlInMessage||this._checkLocaleMessage(t,this._warnHtmlInMessage,e),this._vm.$set(this._vm.messages,t,b(void 0!==this._vm.messages[t]&&Object.keys(this._vm.messages[t]).length?Object.assign({},this._vm.messages[t]):{},e))},ot.prototype.getDateTimeFormat=function(t){return v(this._vm.dateTimeFormats[t]||{})},ot.prototype.setDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,e),this._clearDateTimeFormat(t,e)},ot.prototype.mergeDateTimeFormat=function(t,e){this._vm.$set(this._vm.dateTimeFormats,t,b(this._vm.dateTimeFormats[t]||{},e)),this._clearDateTimeFormat(t,e)},ot.prototype._clearDateTimeFormat=function(t,e){for(var n in e){var r=t+"__"+n;this._dateTimeFormatters.hasOwnProperty(r)&&delete this._dateTimeFormatters[r]}},ot.prototype._localizeDateTime=function(t,e,n,r,i,o){for(var a=e,s=r[a],c=this._getLocaleChain(e,n),u=0;u<c.length;u++){var f=c[u];if(a=f,!d(s=r[f])&&!d(s[i]))break}if(d(s)||d(s[i]))return null;var l,p=s[i];if(o)l=new Intl.DateTimeFormat(a,Object.assign({},p,o));else{var h=a+"__"+i;(l=this._dateTimeFormatters[h])||(l=this._dateTimeFormatters[h]=new Intl.DateTimeFormat(a,p))}return l.format(t)},ot.prototype._d=function(t,e,n,r){if(!n)return(r?new Intl.DateTimeFormat(e,r):new Intl.DateTimeFormat(e)).format(t);var i=this._localizeDateTime(t,e,this.fallbackLocale,this._getDateTimeFormats(),n,r);if(this._isFallbackRoot(i)){if(!this._root)throw Error("unexpected error");return this._root.$i18n.d(t,n,e)}return i||""},o |
|