7 lines
36 KiB
JavaScript
7 lines
36 KiB
JavaScript
|
/*!
|
||
|
* vue-i18n v9.2.2
|
||
|
* (c) 2022 kazuya kawaguchi
|
||
|
* Released under the MIT License.
|
||
|
*/
|
||
|
import{createVNode as e,Text as t,ref as a,computed as n,watch as l,getCurrentInstance as r,Fragment as o,h as s,effectScope as i,inject as c,onMounted as u,onUnmounted as m,shallowRef as f,onBeforeMount as g,isRef as _}from"vue";const p="undefined"!=typeof window,v="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,b=e=>v?Symbol(e):e,d=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),k=e=>"number"==typeof e&&isFinite(e),h=e=>"[object RegExp]"===D(e),E=e=>C(e)&&0===Object.keys(e).length;function L(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const F=Object.assign;function y(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const T=Object.prototype.hasOwnProperty;function N(e,t){return T.call(e,t)}const R=Array.isArray,I=e=>"function"==typeof e,W=e=>"string"==typeof e,M=e=>"boolean"==typeof e,O=e=>null!==e&&"object"==typeof e,w=Object.prototype.toString,D=e=>w.call(e),C=e=>"[object Object]"===D(e),P=15;function A(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 S=[];S[0]={w:[0],i:[3,0],"[":[4],o:[7]},S[1]={w:[1],".":[2],"[":[4],o:[7]},S[2]={w:[2],i:[3,0],0:[3,0]},S[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},S[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},S[5]={"'":[4,0],o:8,l:[5,0]},S[6]={'"':[4,0],o:8,l:[6,0]};const $=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function U(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 H(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(a=t,$.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 j=new Map;function V(e,t){return O(e)?e[t]:null}const x=e=>e,G=e=>"",B=e=>0===e.length?"":e.join(""),Y=e=>null==e?"":R(e)||C(e)&&e.toString===w?JSON.stringify(e,null,2):String(e);function X(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function z(e={}){const t=e.locale,a=function(e){const t=k(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(k(e.named.count)||k(e.named.n))?k(e.named.count)?e.named.count:k(e.named.n)?e.named.n:t:t}(e),n=O(e.pluralRules)&&W(t)&&I(e.pluralRules[t])?e.pluralRules[t]:X,l=O(e.pluralRules)&&W(t)&&I(e.pluralRules[t])?X:void 0,r=e.list||[],o=e.named||{};k(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(a,o);function s(t){const a=I(e.messages)?e.messages(t):!!O(e.messages)&&e.messages[t];return a||(e.parent?e.parent.message(t):G)}const i=C(e.processor)&&I(e.processor.normalize)?e.processor.normalize:B,c=C(e.processor)&&I(e.processor.interpolate)?e.processor.interpolate:Y,u={list:e=>r[e],named:e=>o[e],plural:e=>e[n(a,e.length,l)],linked:(t,...a)=>{const[n,l]=a;let r="text",o="";1===a.length?O(n)?(o=n.modifier||o,r=n.type||r):W(n)&&(o=n||o):2===a.length&&(W(n)&&(o=n||o),W(l)&&(r=l||r));let i=s(t)(u);return"vnode"===r&&R(i)&&o&&(i=i[0]),o?(c=o,e.modifiers?e.modifiers[c]:x)(i,r):i;var c},message:s,type:C(e.processor)&&W(e.processor.type)?e.processor.type:"text",interpolate:c,normalize:i};return u}function J(e,t,a){return[...new Set([a,...R(t)?t:O(t)?Object.keys(t):W(t)?[t]:[a]])]}function q(e,t,a){const n=W(a)?a:ee,l=e;l.__localeChainCache||(l.__localeChainCache=new Map);let r=l.__localeChainCache.get(n);if(!r){r=[];let e=[a];for(;R(e);)e=Z(r,e,t);const o=R(t)||!C(t)?t:t.default?t.default:null;e=W(o)?[o]:o,R(e)&&Z(r,e,!1),l.__localeChainCache.set(n,r)}return r}function Z(e,t,a){let n=!0;for(let l=0;l<t.length&&M(n);l++){const r=t[l];W(r)&&(n=Q(e,t[l],a))}return n}function Q(e,t,a){let n;const l=t.split("-");do{n=K(e,l.join("-"),a),l.splice(-1,1)}while(l.length&&!0===n);return n}function K(e,t,a){let n=!1;if(!e.includes(t)&&(n=!0,t)){n="!"!==t[t.length-1];const l=t.replace(/!/g,"");e.push(l),(R(a)||C(a))&
|