Socket
Socket
Sign inDemoInstall

svelte-i18n

Package Overview
Dependencies
4
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.4 to 3.1.0

9

CHANGELOG.md

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

# [3.1.0](https://github.com/kaisermann/svelte-i18n/compare/v3.0.4...v3.1.0) (2020-09-20)
### Bug Fixes
* export correct configuration type ([68e8c51](https://github.com/kaisermann/svelte-i18n/commit/68e8c51a636910bbe0619350b7d8ad6fabe13c7d))
## [3.0.4](https://github.com/kaisermann/svelte-i18n/compare/v3.0.3...v3.0.4) (2020-05-31)

@@ -2,0 +11,0 @@

24

dist/cli.js
#!/usr/bin/env node
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=e(require("fs")),r=require("path"),n=e(require("commander")),i=e(require("tiny-glob")),o=require("svelte/compiler"),a=require("estree-walker");
"use strict";var e=require("fs"),t=require("path"),r=require("commander"),n=require("tiny-glob"),i=require("svelte/compiler"),o=require("estree-walker");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var c=a(e),s=a(r),u=a(n);
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
Copyright (c) Microsoft Corporation.
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function c(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function l(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=c(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,i,(t=e[r](t)).done,t.value)}))}}}function s(e,t,r){const n=t.replace(/\[(\w+)\]/gi,".$1").split(".");return n.reduce((e,t,i)=>{return t in e?e[t]:i<n.length-1?(o=n[i+1],Number.isNaN(parseInt(o))?e[t]={}:e[t]=[]):e[t]=r;var o},e)}function u(e){return e.properties.reduce((e,t)=>{if("Literal"===t.value.type&&t.value.value!==Object(t.value.value)){const r=t.key.name;e.meta[r]=t.value.value}return e},{node:e,meta:{}})}const f=new Set(["format","_","t"]),p=new Set(["number","date","time"]);function m(e){return e.instance?e.instance.content.body.filter(e=>"ImportDeclaration"===e.type&&"svelte-i18n"===e.source.value):[]}function d(e){return e.specifiers.find(e=>"imported"in e&&"defineMessages"===e.imported.name)}function y(e){const t=m(e);if(0===t.length)return[];const r=new Set(t.flatMap(e=>function(e){return e.specifiers.filter(e=>"imported"in e&&f.has(e.imported.name))}(e).map(e=>e.local.name)));if(0===r.size)return[];const n=[];function i(e){(function(e,t){if("CallExpression"!==e.type)return!1;let r;if("MemberExpression"!==e.callee.type||"Identifier"!==e.callee.property.type||p.has(e.callee.property.name)?"Identifier"===e.callee.type&&(r=e.callee):r=e.callee.object,!r||"Identifier"!==r.type)return!1;const n=r.name.slice(1);return t.has(n)})(e,r)&&(n.push(e),this.skip())}return a.walk(e.instance,{enter:i}),a.walk(e.html,{enter:i}),n}function w(e){const t=o.parse(e),r=y(t);return[...function(e){const t=[],r=m(e).find(d);if(null==r)return[];const n=d(r).local.name;return a.walk(e.instance,{enter(e){if(!1===function(e,t){return"CallExpression"===e.type&&(e.callee&&"Identifier"===e.callee.type&&e.callee.name===t)}(e,n))return;const[r]=e.arguments;"ObjectExpression"===r.type&&(t.push(r),this.skip())}}),t.flatMap(e=>e.properties.map(e=>e.value))}(t).map(e=>u(e)),...r.map(e=>{const[t,r]=e.arguments;if("ObjectExpression"===t.type)return u(t);const n=t,i=n.value;if(r&&"ObjectExpression"===r.type){const e=u(r);return e.meta.id=i,e}return{node:n,meta:{id:i}}})].filter(Boolean)}function h(e,{accumulator:t={},shallow:r=!1,overwrite:n=!1}={}){return w(e).forEach(e=>{let i=e.meta.default;if(void 0===i&&(i=""),r){if(!1===n&&e.meta.id in t)return;t[e.meta.id]=i}else{if(!1===n&&"undefined"!=(o=t,typeof e.meta.id.split(".").reduce((e,t)=>"object"!=typeof e?e:e[t],o)))return;s(t,e.meta.id,i)}var o}),t}const{readFile:v,writeFile:g,mkdir:b,access:j}=t.promises;n.command("extract <glob> [output]").description("extract all message definitions from files to a json").option("-s, --shallow","extract to a shallow dictionary (ids with dots interpreted as strings, not paths)",!1).option("--overwrite","overwrite the content of the output file instead of just appending new properties",!1).option("-c, --config <dir>",'path to the "svelte.config.js" file',process.cwd()).action(async(e,t,{shallow:n,overwrite:a,config:c})=>{var s,u;const f=(await i(e)).filter(e=>e.match(/\.html|svelte$/i)),p=await new Promise((function(e){e(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t.default=e,t}(require(r.resolve(c,"svelte.config.js"))))})).catch(()=>null);let m={};null!=t&&!1===a&&await(e=>j(e).then(()=>!0).catch(()=>!1))(t)&&(m=await v(t).then(e=>JSON.parse(e.toString())).catch(e=>{console.warn(e),m={}}));try{for(var d,y=l(f);!(d=await y.next()).done;){const e=d.value;let t=(await v(e)).toString();if(p&&p.preprocess){t=(await o.preprocess(t,p.preprocess,{filename:e})).code}h(t,{accumulator:m,shallow:n})}}catch(e){s={error:e}}finally{try{d&&!d.done&&(u=y.return)&&await u.call(y)}finally{if(s)throw s.error}}const w=JSON.stringify(m,null," ");if(null==t)return console.log(w);await b(r.dirname(t),{recursive:!0}),await g(t,w)}),n.parse(process.argv);
function f(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=f(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,i,(t=e[r](t)).done,t.value)}))}}}function d(e,t,r){const n=t.replace(/\[(\w+)\]/gi,".$1").split(".");return n.reduce((e,t,i)=>{return t in e?e[t]:i<n.length-1?(o=n[i+1],Number.isNaN(parseInt(o,10))?e[t]={}:e[t]=[]):e[t]=r;var o},e)}function m(e){return e.properties.reduce((e,t)=>{if("Literal"===t.value.type&&t.value.value!==Object(t.value.value)){const r=t.key.name;e.meta[r]=t.value.value}return e},{node:e,meta:{}})}const y=new Set(["format","_","t"]),h=new Set(["number","date","time"]);function v(e){return e.instance?e.instance.content.body.filter(e=>"ImportDeclaration"===e.type&&"svelte-i18n"===e.source.value):[]}function w(e){return e.specifiers.find(e=>"imported"in e&&"defineMessages"===e.imported.name)}function b(e){const t=v(e);if(0===t.length)return[];const r=new Set(t.flatMap(e=>function(e){return e.specifiers.filter(e=>"imported"in e&&y.has(e.imported.name))}(e).map(e=>e.local.name)));if(0===r.size)return[];const n=[];function i(e){(function(e,t){if("CallExpression"!==e.type)return!1;let r;if("MemberExpression"!==e.callee.type||"Identifier"!==e.callee.property.type||h.has(e.callee.property.name)?"Identifier"===e.callee.type&&(r=e.callee):r=e.callee.object,!r||"Identifier"!==r.type)return!1;const n=r.name.slice(1);return t.has(n)})(e,r)&&(n.push(e),this.skip())}return o.walk(e.instance,{enter:i}),o.walk(e.html,{enter:i}),n}function g(e){const t=i.parse(e),r=b(t);return[...function(e){const t=[],r=v(e).find(w);if(null==r)return[];const n=w(r).local.name;return o.walk(e.instance,{enter(e){if(!1===function(e,t){return"CallExpression"===e.type&&e.callee&&"Identifier"===e.callee.type&&e.callee.name===t}(e,n))return;const[r]=e.arguments;"ObjectExpression"===r.type&&(t.push(r),this.skip())}}),t.flatMap(e=>e.properties.map(e=>{if("Property"!==e.type)throw new Error(`Found invalid '${e.type}' at L${e.loc.start.line}:${e.loc.start.column}`);return e.value}))}(t).map(e=>m(e)),...r.map(e=>{const[t,r]=e.arguments;if("ObjectExpression"===t.type)return m(t);const n=t,i=n.value;if(r&&"ObjectExpression"===r.type){const e=m(r);return e.meta.id=i,e}return{node:n,meta:{id:i}}})].filter(Boolean)}function j(e,{accumulator:t={},shallow:r=!1,overwrite:n=!1}={}){return g(e).forEach(e=>{let i=e.meta.default;if(void 0===i&&(i=""),r){if(!1===n&&e.meta.id in t)return;t[e.meta.id]=i}else{if(!1===n&&"undefined"!=(o=t,typeof e.meta.id.split(".").reduce((e,t)=>"object"!=typeof e?e:e[t],o)))return;d(t,e.meta.id,i)}var o}),t}const{readFile:S,writeFile:O,mkdir:x,access:E}=c.default.promises;s.default.command("extract <glob> [output]").description("extract all message definitions from files to a json").option("-s, --shallow","extract to a shallow dictionary (ids with dots interpreted as strings, not paths)",!1).option("--overwrite","overwrite the content of the output file instead of just appending new properties",!1).option("-c, --config <dir>",'path to the "svelte.config.js" file',process.cwd()).action(async(e,r,{shallow:n,overwrite:o,config:a})=>{var c,s;const f=(await u.default(e)).filter(e=>e.match(/\.html|svelte$/i)),d=await Promise.resolve().then((function(){return l(require(t.resolve(a,"svelte.config.js")))})).catch(()=>null);let m={};null!=r&&!1===o&&await(e=>E(e).then(()=>!0).catch(()=>!1))(r)&&(m=await S(r).then(e=>JSON.parse(e.toString())).catch(e=>{console.warn(e),m={}}));try{for(var y,h=p(f);!(y=await h.next()).done;){const e=y.value;let t=(await S(e)).toString();if(null==d?void 0:d.preprocess){t=(await i.preprocess(t,d.preprocess,{filename:e})).code}j(t,{filePath:e,accumulator:m,shallow:n})}}catch(e){c={error:e}}finally{try{y&&!y.done&&(s=h.return)&&await s.call(h)}finally{if(c)throw c.error}}const v=JSON.stringify(m,null," ");if(null==r)return console.log(v);await x(t.dirname(r),{recursive:!0}),await O(r,v)}),s.default.parse(process.argv);

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("svelte/store"),n=(e=require("intl-messageformat"))&&"object"==typeof e&&"default"in e?e.default:e;const o=(e,t="")=>{const n={};for(const r in e){const i=t+r;"object"==typeof e[r]?Object.assign(n,o(e[r],`${i}.`)):n[i]=e[r]}return n};let r;const i=t.writable({});function a(e){return e in r}function l(e,t){if(a(e)){const n=function(e){return r[e]||null}(e);if(t in n)return n[t]}return null}function s(e,...t){const n=t.map(e=>o(e));i.update(t=>(t[e]=Object.assign(t[e]||{},...n),t))}const c=t.derived([i],([e])=>Object.keys(e));i.subscribe(e=>r=e);const u={};function m(e){u[e]=new Set}function f(e,t){u[e].delete(t),0===u[e].size&&delete u[e]}function d(e){return u[e]}function p(e){return k(e).reverse().some(e=>{var t;return null===(t=d(e))||void 0===t?void 0:t.size})}const g={};function w(e){if(!p(e))return e in g?g[e]:void 0;const t=function(e){return k(e).reverse().map(e=>{const t=d(e);return[e,t?[...t]:[]]}).filter(([,e])=>e.length>0)}(e);return g[e]=Promise.all(t.map(([e,t])=>function(e,t){return Promise.all(t.map(t=>(f(e,t),t().then(e=>e.default||e)))).then(t=>s(e,...t))}(e,t))).then(()=>{if(p(e))return w(e);delete g[e]}),g[e]}
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("svelte/store");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(require("intl-messageformat"));const o=(e,t="")=>{const n={};for(const r in e){const i=t+r;"object"==typeof e[r]?Object.assign(n,o(e[r],i+".")):n[i]=e[r]}return n};let r;const i=e.writable({});function a(e){return e in r}function l(e,t){if(a(e)){const n=function(e){return r[e]||null}(e);if(t in n)return n[t]}return null}function s(e){return null==e||a(e)?e:s(F(e))}function c(e,...t){const n=t.map(e=>o(e));i.update(t=>(t[e]=Object.assign(t[e]||{},...n),t))}const u=e.derived([i],([e])=>Object.keys(e));i.subscribe(e=>r=e);const m={};function f(e){return m[e]}function d(e){return k(e).reverse().some(e=>{var t;return null===(t=f(e))||void 0===t?void 0:t.size})}function p(e,t){return Promise.all(t.map(t=>(function(e,t){m[e].delete(t),0===m[e].size&&delete m[e]}(e,t),t().then(e=>e.default||e)))).then(t=>c(e,...t))}const g={};function w(e){if(!d(e))return e in g?g[e]:void 0;const t=function(e){return k(e).reverse().map(e=>{const t=f(e);return[e,t?[...t]:[]]}).filter(([,e])=>e.length>0)}(e);return g[e]=Promise.all(t.map(([e,t])=>p(e,t))).then(()=>{if(d(e))return w(e);delete g[e]}),g[e]}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
Copyright (c) Microsoft Corporation.
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
function b(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}const h={fallbackLocale:null,initialLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0};function y(){return h}const v=t.writable(!1);let x;const O=t.writable(null);function j(e,t){return 0===t.indexOf(e)&&e!==t}function L(e,t){return e===t||j(e,t)||j(t,e)}function F(e){const t=e.lastIndexOf("-");if(t>0)return e.slice(0,t);const{fallbackLocale:n}=y();return n&&!L(e,n)?n:null}function k(e){const t=e.split("-").map((e,t,n)=>n.slice(0,t+1).join("-")),{fallbackLocale:n}=y();return n&&!L(e,n)?t.concat(k(n)):t}function M(){return x}O.subscribe(e=>{x=e,"undefined"!=typeof window&&document.documentElement.setAttribute("lang",e)});const D=O.set;O.set=e=>{if(function e(t){return null==t||a(t)?t:e(F(t))}(e)&&p(e)){const t=y().loadingDelay;let n;return"undefined"!=typeof window&&null!=M()&&t?n=window.setTimeout(()=>v.set(!0),t):v.set(!0),w(e).then(()=>{D(e)}).finally(()=>{clearTimeout(n),v.set(!1)})}return D(e)},O.update=e=>D(e(x));const E=(e,t)=>{const n=e.split("&").find(e=>0===e.indexOf(`${t}=`));return n?n.split("=").pop():null},N=(e,t)=>{const n=t.exec(e);return n&&n[1]||null},P={},$=(e,t)=>{if(null==t)return null;const n=l(t,e);return n||$(e,F(t))},S=(e,t)=>{if(t in P&&e in P[t])return P[t][e];const n=$(e,t);return n?((e,t,n)=>n?(t in P||(P[t]={}),e in P[t]||(P[t][e]=n),n):n)(e,t,n):null},T=e=>{const t=Object.create(null);return n=>{const o=JSON.stringify(n);return o in t?t[o]:t[o]=e(n)}},I=(e,t)=>{const n=y().formats;if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},A=T(e=>{var{locale:t,format:n}=e,o=b(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return n&&(o=I("number",n)),new Intl.NumberFormat(t,o)}),_=T(e=>{var{locale:t,format:n}=e,o=b(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return n?o=I("date",n):0===Object.keys(o).length&&(o=I("date","short")),new Intl.DateTimeFormat(t,o)}),q=T(e=>{var{locale:t,format:n}=e,o=b(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return n?o=I("time",n):0===Object.keys(o).length&&(o=I("time","short")),new Intl.DateTimeFormat(t,o)}),z=(e={})=>{var{locale:t=M()}=e,n=b(e,["locale"]);return A(Object.assign({locale:t},n))},H=(e={})=>{var{locale:t=M()}=e,n=b(e,["locale"]);return _(Object.assign({locale:t},n))},Z=(e={})=>{var{locale:t=M()}=e,n=b(e,["locale"]);return q(Object.assign({locale:t},n))},C=T((e,t=M())=>new n(e,t,y().formats)),J=(e,t={})=>{"object"==typeof e&&(e=(t=e).id);const{values:n,locale:o=M(),default:r}=t;if(null==o)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");const i=S(e,o);return i?n?C(i,o).format(n):i:(y().warnOnMissingMessages&&console.warn(`[svelte-i18n] The message "${e}" was not found in "${k(o).join('", "')}".${p(M())?"\n\nNote: there are at least one loader still registered to this locale that wasn't executed.":""}`),r||e)},Q=(e,t)=>Z(t).format(e),U=(e,t)=>H(t).format(e),B=(e,t)=>z(t).format(e),G=t.derived([O,i],()=>J),K=t.derived([O],()=>Q),R=t.derived([O],()=>U),V=t.derived([O],()=>B);exports._=G,exports.addMessages=s,exports.date=R,exports.defineMessages=function(e){return e},exports.dictionary=i,exports.format=G,exports.getDateFormatter=H,exports.getLocaleFromHash=e=>"undefined"==typeof window?null:E(window.location.hash.substr(1),e),exports.getLocaleFromHostname=e=>"undefined"==typeof window?null:N(window.location.hostname,e),exports.getLocaleFromNavigator=()=>"undefined"==typeof window?null:window.navigator.language||window.navigator.languages[0],exports.getLocaleFromPathname=e=>"undefined"==typeof window?null:N(window.location.pathname,e),exports.getLocaleFromQueryString=e=>"undefined"==typeof window?null:E(window.location.search.substr(1),e),exports.getMessageFormatter=C,exports.getNumberFormatter=z,exports.getTimeFormatter=Z,exports.init=function(e){const{formats:t}=e,n=b(e,["formats"]),o=e.initialLocale||e.fallbackLocale;return Object.assign(h,n,{initialLocale:o}),t&&("number"in t&&Object.assign(h.formats.number,t.number),"date"in t&&Object.assign(h.formats.date,t.date),"time"in t&&Object.assign(h.formats.time,t.time)),O.set(o)},exports.isLoading=v,exports.locale=O,exports.locales=c,exports.number=V,exports.register=function(e,t){d(e)||m(e);const n=d(e);d(e).has(t)||(a(e)||i.update(t=>(t[e]={},t)),n.add(t))},exports.t=G,exports.time=K,exports.waitLocale=function(e){return w(e||M()||y().initialLocale)};
function b(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}const h={fallbackLocale:null,initialLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0};function y(){return h}const v=e.writable(!1);let x;const O=e.writable(null);function j(e,t){return 0===t.indexOf(e)&&e!==t}function L(e,t){return e===t||j(e,t)||j(t,e)}function F(e){const t=e.lastIndexOf("-");if(t>0)return e.slice(0,t);const{fallbackLocale:n}=y();return n&&!L(e,n)?n:null}function k(e){const t=e.split("-").map((e,t,n)=>n.slice(0,t+1).join("-")),{fallbackLocale:n}=y();return n&&!L(e,n)?t.concat(k(n)):t}function M(){return x}O.subscribe(e=>{x=e,"undefined"!=typeof window&&document.documentElement.setAttribute("lang",e)});const D=O.set;O.set=e=>{if(s(e)&&d(e)){const{loadingDelay:t}=y();let n;return"undefined"!=typeof window&&null!=M()&&t?n=window.setTimeout(()=>v.set(!0),t):v.set(!0),w(e).then(()=>{D(e)}).finally(()=>{clearTimeout(n),v.set(!1)})}return D(e)},O.update=e=>D(e(x));const E=(e,t)=>{const n=e.split("&").find(e=>0===e.indexOf(t+"="));return n?n.split("=").pop():null},N=(e,t)=>{const n=t.exec(e);return n&&n[1]||null},P={},S=(e,t)=>{if(null==t)return null;const n=l(t,e);return n||S(e,F(t))},T=(e,t)=>{if(t in P&&e in P[t])return P[t][e];const n=S(e,t);return n?((e,t,n)=>n?(t in P||(P[t]={}),e in P[t]||(P[t][e]=n),n):n)(e,t,n):null},I=e=>{const t=Object.create(null);return n=>{const o=JSON.stringify(n);return o in t?t[o]:t[o]=e(n)}},$=(e,t)=>{const{formats:n}=y();if(e in n&&t in n[e])return n[e][t];throw new Error(`[svelte-i18n] Unknown "${t}" ${e} format.`)},A=I(e=>{var{locale:t,format:n}=e,o=b(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return n&&(o=$("number",n)),new Intl.NumberFormat(t,o)}),_=I(e=>{var{locale:t,format:n}=e,o=b(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return n?o=$("date",n):0===Object.keys(o).length&&(o=$("date","short")),new Intl.DateTimeFormat(t,o)}),q=I(e=>{var{locale:t,format:n}=e,o=b(e,["locale","format"]);if(null==t)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return n?o=$("time",n):0===Object.keys(o).length&&(o=$("time","short")),new Intl.DateTimeFormat(t,o)}),z=(e={})=>{var{locale:t=M()}=e,n=b(e,["locale"]);return A(Object.assign({locale:t},n))},H=(e={})=>{var{locale:t=M()}=e,n=b(e,["locale"]);return _(Object.assign({locale:t},n))},Z=(e={})=>{var{locale:t=M()}=e,n=b(e,["locale"]);return q(Object.assign({locale:t},n))},C=I((e,t=M())=>new n.default(e,t,y().formats)),J=(e,t={})=>{"object"==typeof e&&(e=(t=e).id);const{values:n,locale:o=M(),default:r}=t;if(null==o)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");const i=T(e,o);return i?n?C(i,o).format(n):i:(y().warnOnMissingMessages&&console.warn(`[svelte-i18n] The message "${e}" was not found in "${k(o).join('", "')}".${d(M())?"\n\nNote: there are at least one loader still registered to this locale that wasn't executed.":""}`),r||e)},Q=(e,t)=>Z(t).format(e),U=(e,t)=>H(t).format(e),B=(e,t)=>z(t).format(e),G=e.derived([O,i],()=>J),K=e.derived([O],()=>Q),R=e.derived([O],()=>U),V=e.derived([O],()=>B);exports._=G,exports.addMessages=c,exports.date=R,exports.defineMessages=function(e){return e},exports.dictionary=i,exports.format=G,exports.getDateFormatter=H,exports.getLocaleFromHash=e=>"undefined"==typeof window?null:E(window.location.hash.substr(1),e),exports.getLocaleFromHostname=e=>"undefined"==typeof window?null:N(window.location.hostname,e),exports.getLocaleFromNavigator=()=>"undefined"==typeof window?null:window.navigator.language||window.navigator.languages[0],exports.getLocaleFromPathname=e=>"undefined"==typeof window?null:N(window.location.pathname,e),exports.getLocaleFromQueryString=e=>"undefined"==typeof window?null:E(window.location.search.substr(1),e),exports.getMessageFormatter=C,exports.getNumberFormatter=z,exports.getTimeFormatter=Z,exports.init=function(e){const{formats:t}=e,n=b(e,["formats"]),o=e.initialLocale||e.fallbackLocale;return Object.assign(h,n,{initialLocale:o}),t&&("number"in t&&Object.assign(h.formats.number,t.number),"date"in t&&Object.assign(h.formats.date,t.date),"time"in t&&Object.assign(h.formats.time,t.time)),O.set(o)},exports.isLoading=v,exports.locale=O,exports.locales=u,exports.number=V,exports.register=function(e,t){f(e)||function(e){m[e]=new Set}(e);const n=f(e);f(e).has(t)||(a(e)||i.update(t=>(t[e]={},t)),n.add(t))},exports.t=G,exports.time=K,exports.waitLocale=function(e){return w(e||M()||y().initialLocale)};

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

import{writable as n,derived as e}from"svelte/store";import t from"intl-messageformat";const o=(n,e="")=>{const t={};for(const r in n){const i=e+r;"object"==typeof n[r]?Object.assign(t,o(n[r],`${i}.`)):t[i]=n[r]}return t};let r;const i=n({});function a(n){return n in r}function l(n,e){if(a(n)){const t=function(n){return r[n]||null}(n);if(e in t)return t[e]}return null}function s(n,...e){const t=e.map(n=>o(n));i.update(e=>(e[n]=Object.assign(e[n]||{},...t),e))}const c=e([i],([n])=>Object.keys(n));i.subscribe(n=>r=n);const u={};function m(n){u[n]=new Set}function f(n,e){u[n].delete(e),0===u[n].size&&delete u[n]}function d(n){return u[n]}function w(n){return D(n).reverse().some(n=>{var e;return null===(e=d(n))||void 0===e?void 0:e.size})}const g={};function b(n){if(!w(n))return n in g?g[n]:void 0;const e=function(n){return D(n).reverse().map(n=>{const e=d(n);return[n,e?[...e]:[]]}).filter(([,n])=>n.length>0)}(n);return g[n]=Promise.all(e.map(([n,e])=>function(n,e){return Promise.all(e.map(e=>(f(n,e),e().then(n=>n.default||n)))).then(e=>s(n,...e))}(n,e))).then(()=>{if(w(n))return b(n);delete g[n]}),g[n]}function p(n,e){d(n)||m(n);const t=d(n);d(n).has(e)||(a(n)||i.update(e=>(e[n]={},e)),t.add(e))}
import{writable as n,derived as e}from"svelte/store";import t from"intl-messageformat";const o=(n,e="")=>{const t={};for(const r in n){const i=e+r;"object"==typeof n[r]?Object.assign(t,o(n[r],i+".")):t[i]=n[r]}return t};let r;const i=n({});function a(n){return n in r}function l(n,e){if(a(n)){const t=function(n){return r[n]||null}(n);if(e in t)return t[e]}return null}function s(n){return null==n||a(n)?n:s(D(n))}function c(n,...e){const t=e.map(n=>o(n));i.update(e=>(e[n]=Object.assign(e[n]||{},...t),e))}const u=e([i],([n])=>Object.keys(n));i.subscribe(n=>r=n);const m={};function f(n){return m[n]}function d(n){return I(n).reverse().some(n=>{var e;return null===(e=f(n))||void 0===e?void 0:e.size})}function w(n,e){return Promise.all(e.map(e=>(function(n,e){m[n].delete(e),0===m[n].size&&delete m[n]}(n,e),e().then(n=>n.default||n)))).then(e=>c(n,...e))}const g={};function b(n){if(!d(n))return n in g?g[n]:void 0;const e=function(n){return I(n).reverse().map(n=>{const e=f(n);return[n,e?[...e]:[]]}).filter(([,n])=>n.length>0)}(n);return g[n]=Promise.all(e.map(([n,e])=>w(n,e))).then(()=>{if(d(n))return b(n);delete g[n]}),g[n]}function p(n,e){f(n)||function(n){m[n]=new Set}(n);const t=f(n);f(n).has(e)||(a(n)||i.update(e=>(e[n]={},e)),t.add(e))}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
Copyright (c) Microsoft Corporation.
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */function h(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]])}return t}const y={fallbackLocale:null,initialLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0};function O(){return y}function v(n){const{formats:e}=n,t=h(n,["formats"]),o=n.initialLocale||n.fallbackLocale;return Object.assign(y,t,{initialLocale:o}),e&&("number"in e&&Object.assign(y.formats.number,e.number),"date"in e&&Object.assign(y.formats.date,e.date),"time"in e&&Object.assign(y.formats.time,e.time)),k.set(o)}const j=n(!1);let L;const k=n(null);function x(n,e){return 0===e.indexOf(n)&&n!==e}function E(n,e){return n===e||x(n,e)||x(e,n)}function $(n){const e=n.lastIndexOf("-");if(e>0)return n.slice(0,e);const{fallbackLocale:t}=O();return t&&!E(n,t)?t:null}function D(n){const e=n.split("-").map((n,e,t)=>t.slice(0,e+1).join("-")),{fallbackLocale:t}=O();return t&&!E(n,t)?e.concat(D(t)):e}function I(){return L}k.subscribe(n=>{L=n,"undefined"!=typeof window&&document.documentElement.setAttribute("lang",n)});const N=k.set;k.set=n=>{if(function n(e){return null==e||a(e)?e:n($(e))}(n)&&w(n)){const e=O().loadingDelay;let t;return"undefined"!=typeof window&&null!=I()&&e?t=window.setTimeout(()=>j.set(!0),e):j.set(!0),b(n).then(()=>{N(n)}).finally(()=>{clearTimeout(t),j.set(!1)})}return N(n)},k.update=n=>N(n(L));const P=(n,e)=>{const t=n.split("&").find(n=>0===n.indexOf(`${e}=`));return t?t.split("=").pop():null},S=(n,e)=>{const t=e.exec(n);return t&&t[1]||null},T=n=>"undefined"==typeof window?null:S(window.location.hostname,n),A=n=>"undefined"==typeof window?null:S(window.location.pathname,n),M=()=>"undefined"==typeof window?null:window.navigator.language||window.navigator.languages[0],F=n=>"undefined"==typeof window?null:P(window.location.search.substr(1),n),z=n=>"undefined"==typeof window?null:P(window.location.hash.substr(1),n),Z={},C=(n,e)=>{if(null==e)return null;const t=l(e,n);return t||C(n,$(e))},J=(n,e)=>{if(e in Z&&n in Z[e])return Z[e][n];const t=C(n,e);return t?((n,e,t)=>t?(e in Z||(Z[e]={}),n in Z[e]||(Z[e][n]=t),t):t)(n,e,t):null},U=n=>{const e=Object.create(null);return t=>{const o=JSON.stringify(t);return o in e?e[o]:e[o]=n(t)}},_=(n,e)=>{const t=O().formats;if(n in t&&e in t[n])return t[n][e];throw new Error(`[svelte-i18n] Unknown "${e}" ${n} format.`)},q=U(n=>{var{locale:e,format:t}=n,o=h(n,["locale","format"]);if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return t&&(o=_("number",t)),new Intl.NumberFormat(e,o)}),B=U(n=>{var{locale:e,format:t}=n,o=h(n,["locale","format"]);if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return t?o=_("date",t):0===Object.keys(o).length&&(o=_("date","short")),new Intl.DateTimeFormat(e,o)}),G=U(n=>{var{locale:e,format:t}=n,o=h(n,["locale","format"]);if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return t?o=_("time",t):0===Object.keys(o).length&&(o=_("time","short")),new Intl.DateTimeFormat(e,o)}),H=(n={})=>{var{locale:e=I()}=n,t=h(n,["locale"]);return q(Object.assign({locale:e},t))},K=(n={})=>{var{locale:e=I()}=n,t=h(n,["locale"]);return B(Object.assign({locale:e},t))},Q=(n={})=>{var{locale:e=I()}=n,t=h(n,["locale"]);return G(Object.assign({locale:e},t))},R=U((n,e=I())=>new t(n,e,O().formats)),V=(n,e={})=>{"object"==typeof n&&(n=(e=n).id);const{values:t,locale:o=I(),default:r}=e;if(null==o)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");const i=J(n,o);return i?t?R(i,o).format(t):i:(O().warnOnMissingMessages&&console.warn(`[svelte-i18n] The message "${n}" was not found in "${D(o).join('", "')}".${w(I())?"\n\nNote: there are at least one loader still registered to this locale that wasn't executed.":""}`),r||n)},W=(n,e)=>Q(e).format(n),X=(n,e)=>K(e).format(n),Y=(n,e)=>H(e).format(n),nn=e([k,i],()=>V),en=e([k],()=>W),tn=e([k],()=>X),on=e([k],()=>Y);function rn(n){return n}function an(n){return b(n||I()||O().initialLocale)}export{nn as _,s as addMessages,tn as date,rn as defineMessages,i as dictionary,nn as format,K as getDateFormatter,z as getLocaleFromHash,T as getLocaleFromHostname,M as getLocaleFromNavigator,A as getLocaleFromPathname,F as getLocaleFromQueryString,R as getMessageFormatter,H as getNumberFormatter,Q as getTimeFormatter,v as init,j as isLoading,k as locale,c as locales,on as number,p as register,nn as t,en as time,an as waitLocale};
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function h(n,e){var t={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&e.indexOf(o)<0&&(t[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(n);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(t[o[r]]=n[o[r]])}return t}const y={fallbackLocale:null,initialLocale:null,loadingDelay:200,formats:{number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},warnOnMissingMessages:!0};function O(){return y}function v(n){const{formats:e}=n,t=h(n,["formats"]),o=n.initialLocale||n.fallbackLocale;return Object.assign(y,t,{initialLocale:o}),e&&("number"in e&&Object.assign(y.formats.number,e.number),"date"in e&&Object.assign(y.formats.date,e.date),"time"in e&&Object.assign(y.formats.time,e.time)),k.set(o)}const j=n(!1);let L;const k=n(null);function x(n,e){return 0===e.indexOf(n)&&n!==e}function E(n,e){return n===e||x(n,e)||x(e,n)}function D(n){const e=n.lastIndexOf("-");if(e>0)return n.slice(0,e);const{fallbackLocale:t}=O();return t&&!E(n,t)?t:null}function I(n){const e=n.split("-").map((n,e,t)=>t.slice(0,e+1).join("-")),{fallbackLocale:t}=O();return t&&!E(n,t)?e.concat(I(t)):e}function N(){return L}k.subscribe(n=>{L=n,"undefined"!=typeof window&&document.documentElement.setAttribute("lang",n)});const P=k.set;k.set=n=>{if(s(n)&&d(n)){const{loadingDelay:e}=O();let t;return"undefined"!=typeof window&&null!=N()&&e?t=window.setTimeout(()=>j.set(!0),e):j.set(!0),b(n).then(()=>{P(n)}).finally(()=>{clearTimeout(t),j.set(!1)})}return P(n)},k.update=n=>P(n(L));const S=(n,e)=>{const t=n.split("&").find(n=>0===n.indexOf(e+"="));return t?t.split("=").pop():null},T=(n,e)=>{const t=e.exec(n);return t&&t[1]||null},$=n=>"undefined"==typeof window?null:T(window.location.hostname,n),A=n=>"undefined"==typeof window?null:T(window.location.pathname,n),M=()=>"undefined"==typeof window?null:window.navigator.language||window.navigator.languages[0],F=n=>"undefined"==typeof window?null:S(window.location.search.substr(1),n),z=n=>"undefined"==typeof window?null:S(window.location.hash.substr(1),n),Z={},C=(n,e)=>{if(null==e)return null;const t=l(e,n);return t||C(n,D(e))},J=(n,e)=>{if(e in Z&&n in Z[e])return Z[e][n];const t=C(n,e);return t?((n,e,t)=>t?(e in Z||(Z[e]={}),n in Z[e]||(Z[e][n]=t),t):t)(n,e,t):null},U=n=>{const e=Object.create(null);return t=>{const o=JSON.stringify(t);return o in e?e[o]:e[o]=n(t)}},_=(n,e)=>{const{formats:t}=O();if(n in t&&e in t[n])return t[n][e];throw new Error(`[svelte-i18n] Unknown "${e}" ${n} format.`)},q=U(n=>{var{locale:e,format:t}=n,o=h(n,["locale","format"]);if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return t&&(o=_("number",t)),new Intl.NumberFormat(e,o)}),B=U(n=>{var{locale:e,format:t}=n,o=h(n,["locale","format"]);if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return t?o=_("date",t):0===Object.keys(o).length&&(o=_("date","short")),new Intl.DateTimeFormat(e,o)}),G=U(n=>{var{locale:e,format:t}=n,o=h(n,["locale","format"]);if(null==e)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return t?o=_("time",t):0===Object.keys(o).length&&(o=_("time","short")),new Intl.DateTimeFormat(e,o)}),H=(n={})=>{var{locale:e=N()}=n,t=h(n,["locale"]);return q(Object.assign({locale:e},t))},K=(n={})=>{var{locale:e=N()}=n,t=h(n,["locale"]);return B(Object.assign({locale:e},t))},Q=(n={})=>{var{locale:e=N()}=n,t=h(n,["locale"]);return G(Object.assign({locale:e},t))},R=U((n,e=N())=>new t(n,e,O().formats)),V=(n,e={})=>{"object"==typeof n&&(n=(e=n).id);const{values:t,locale:o=N(),default:r}=e;if(null==o)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");const i=J(n,o);return i?t?R(i,o).format(t):i:(O().warnOnMissingMessages&&console.warn(`[svelte-i18n] The message "${n}" was not found in "${I(o).join('", "')}".${d(N())?"\n\nNote: there are at least one loader still registered to this locale that wasn't executed.":""}`),r||n)},W=(n,e)=>Q(e).format(n),X=(n,e)=>K(e).format(n),Y=(n,e)=>H(e).format(n),nn=e([k,i],()=>V),en=e([k],()=>W),tn=e([k],()=>X),on=e([k],()=>Y);function rn(n){return n}function an(n){return b(n||N()||O().initialLocale)}export{nn as _,c as addMessages,tn as date,rn as defineMessages,i as dictionary,nn as format,K as getDateFormatter,z as getLocaleFromHash,$ as getLocaleFromHostname,M as getLocaleFromNavigator,A as getLocaleFromPathname,F as getLocaleFromQueryString,R as getMessageFormatter,H as getNumberFormatter,Q as getTimeFormatter,v as init,j as isLoading,k as locale,u as locales,on as number,p as register,nn as t,en as time,an as waitLocale};
{
"name": "svelte-i18n",
"version": "3.0.4",
"version": "3.1.0",
"main": "dist/runtime.cjs.js",

@@ -33,3 +33,3 @@ "module": "dist/runtime.esm.js",

"lint": "eslint \"src/**/*.ts\"",
"format": "prettier --loglevel silent --write \"src/**/*.ts\" && eslint --fix \"src/**/*.ts\"",
"format": "prettier --loglevel silent --write \"src/**/*.ts\"",
"release": " git add package.json && git commit -m \"chore(release): v$npm_package_version :tada:\"",

@@ -74,30 +74,31 @@ "pretest": "npm run build",

"peerDependencies": {
"svelte": "^3.14.1"
"svelte": "^3.25.1"
},
"devDependencies": {
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"@types/estree": "0.0.39",
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.11.5",
"@kiwi/eslint-config": "^1.2.0",
"@kiwi/prettier-config": "^1.1.0",
"@types/estree": "0.0.45",
"@types/intl": "^1.2.0",
"@types/jest": "^24.0.23",
"@types/jest": "^26.0.14",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^24.9.0",
"conventional-changelog-cli": "^2.0.28",
"eslint": "^6.6.0",
"eslint-config-kaisermann": "0.0.3",
"husky": "^4.2.1",
"jest": "^24.9.0",
"lint-staged": "^10.0.4",
"babel-jest": "^26.3.0",
"conventional-changelog-cli": "^2.1.0",
"eslint": "^7.9.0",
"husky": "^4.3.0",
"jest": "^26.4.2",
"lint-staged": "^10.4.0",
"npm-run-all": "^4.1.5",
"prettier": "^1.19.1",
"rollup": "^1.26.5",
"prettier": "^2.1.2",
"rollup": "^2.27.1",
"rollup-plugin-auto-external": "^2.0.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-terser": "^5.1.3",
"rollup-plugin-typescript2": "^0.25.2",
"sass": "^1.23.6",
"svelte": "^3.14.1",
"svelte-preprocess": "^3.2.6",
"ts-jest": "^24.1.0",
"typescript": "^3.7.2"
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.27.2",
"sass": "^1.26.11",
"svelte": "^3.25.1",
"svelte-preprocess": "^4.3.0",
"ts-jest": "^26.4.0",
"typescript": "^4.0.3"
},

@@ -104,0 +105,0 @@ "dependencies": {

@@ -48,2 +48,3 @@ [![npm version](https://badge.fury.io/js/svelte-i18n.svg)](https://badge.fury.io/js/svelte-i18n) ![](https://github.com/kaisermann/svelte-i18n/workflows/CI/badge.svg)

### [Go see the documentation](/docs/Getting%20Started.md)
- [Documentation](/docs/Getting%20Started.md)
- [Sapper Template](https://github.com/kaisermann/sapper-template-i18n)

@@ -7,13 +7,6 @@ import { ConfigureOptions } from './types';

}
interface Options {
fallbackLocale: string;
initialLocale: string;
formats: Formats;
loadingDelay: number;
warnOnMissingMessages: boolean;
}
export declare const defaultFormats: Formats;
export declare const defaultOptions: Options;
export declare function getOptions(): Options;
export declare const defaultOptions: ConfigureOptions;
export declare function getOptions(): ConfigureOptions;
export declare function init(opts: ConfigureOptions): void;
export {};

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

declare type MemoizedFunction = <F extends any>(fn: F) => F;
declare type MemoizedFunction = <F extends Function>(fn: F) => F;
declare const monadicMemoize: MemoizedFunction;
export { monadicMemoize };

@@ -30,6 +30,7 @@ import { Formats } from 'intl-messageformat';

fallbackLocale: string;
formats?: Partial<Formats>;
initialLocale?: string;
formats?: Partial<Formats>;
loadingDelay?: number;
warnOnMissingMessages?: boolean;
}
export {};
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc