7 lines
38 KiB
JavaScript
7 lines
38 KiB
JavaScript
|
|
/*!
|
||
|
|
* vue-i18n v9.10.2
|
||
|
|
* (c) 2024 kazuya kawaguchi
|
||
|
|
* Released under the MIT License.
|
||
|
|
*/
|
||
|
|
var VueI18n=function(e,t){"use strict";const a="undefined"!=typeof window,n=(e,t=!1)=>t?Symbol.for(e):Symbol(e),l=(e,t,a)=>r({l:e,k:t,s:a}),r=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),o=e=>"number"==typeof e&&isFinite(e),s=e=>"[object Date]"===k(e),i=e=>"[object RegExp]"===k(e),c=e=>L(e)&&0===Object.keys(e).length,u=Object.assign;function m(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const f=Object.prototype.hasOwnProperty;function _(e,t){return f.call(e,t)}const g=Array.isArray,p=e=>"function"==typeof e,v=e=>"string"==typeof e,d=e=>"boolean"==typeof e,b=e=>null!==e&&"object"==typeof e,E=e=>b(e)&&p(e.then)&&p(e.catch),h=Object.prototype.toString,k=e=>h.call(e),L=e=>{if(!b(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t.constructor===Object};function T(e){let t=e;return()=>++t}function F(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const y=e=>!b(e)||g(e);function N(e,t){if(y(e)||y(t))throw new Error("Invalid value");const a=[{src:e,des:t}];for(;a.length;){const{src:e,des:t}=a.pop();Object.keys(e).forEach((n=>{y(e[n])||y(t[n])?t[n]=e[n]:a.push({src:e[n],des:t[n]})}))}}function I(e,t,a={}){const{domain:n,messages:l,args:r}=a,o=new SyntaxError(String(e));return o.code=e,t&&(o.location=t),o.domain=n,o}const R=[];R[0]={w:[0],i:[3,0],"[":[4],o:[7]},R[1]={w:[1],".":[2],"[":[4],o:[7]},R[2]={w:[2],i:[3,0],0:[3,0]},R[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},R[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},R[5]={"'":[4,0],o:8,l:[5,0]},R[6]={'"':[4,0],o:8,l:[6,0]};const O=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function M(e){if(null==e)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function W(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(a=t,O.test(a)?function(e){const t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}(t):"*"+t);var a}const w=new Map;function P(e,t){return b(e)?e[t]:null}const C=e=>e,D=e=>"",A="text",S=e=>0===e.length?"":function(e,t=""){return e.reduce(((e,a,n)=>0===n?e+a:e+t+a),"")}(e),$=e=>null==e?"":g(e)||L(e)&&e.toString===h?JSON.stringify(e,null,2):String(e);function U(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function x(e={}){const t=e.locale,a=function(e){const t=o(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(o(e.named.count)||o(e.named.n))?o(e.named.count)?e.named.count:o(e.named.n)?e.named.n:t:t}(e),n=b(e.pluralRules)&&v(t)&&p(e.pluralRules[t])?e.pluralRules[t]:U,l=b(e.pluralRules)&&v(t)&&p(e.pluralRules[t])?U:void 0,r=e.list||[],s=e.named||{};o(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(a,s);function i(t){const a=p(e.messages)?e.messages(t):!!b(e.messages)&&e.messages[t];return a||(e.parent?e.parent.message(t):D)}const c=L(e.processor)&&p(e.processor.normalize)?e.processor.normalize:S,m=L(e.processor)&&p(e.processor.interpolate)?e.processor.interpolate:$,f={list:e=>r[e],named:e=>s[e],plural:e=>e[n(a,e.length,l)],linked:(t,...a)=>{const[n,l]=a;let r="text",o="";1===a.length?b(n)?(o=n.modifier||o,r=n.type||r):v(n)&&(o=n||o):2===a.length&&(v(n)&&(o=n||o),v(l)&&(r=l||r));const s=i(t)(f),c="vnode"===r&&g(s)&&o?s[0]:s;return o?(u=o,e.modifiers?e.modifiers[u]:C)(c,r):c;var u},message:i,type:L(e.processor)&&v(e.processor.type)?e.processor.type:A,interpolate:m,normalize:c,values:u({},r,s)};return f}const H=T(17),j={INVALID_ARGUMENT:17,INVALID_DATE_ARGUMENT:H(),INVALID_ISO_DATE_ARGUMENT:H(),NOT_SUPPORT_NON_STRING_MESSAGE:H(),NOT_SUPPORT_LOCALE_PROMISE_VALUE:H(),NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:H(),NOT_SUPPORT_LOCALE_TYPE:H(),__EXTEND_POINT__:H()};function V(e,t){return null!=t.locale?Y(t.locale):Y(e.locale)}let G;function Y(e){if(v(e))return e;if(p(e)){if(e.resolvedOnce&&null!=G)return G;if("Function"===e.constructor.name){const t=e();if(E(t))thr
|