From db21bb878a78fba31e32b169bb7c2f7a4fa522fa Mon Sep 17 00:00:00 2001 From: Christian Kaisermann Date: Tue, 19 Nov 2019 13:18:42 -0300 Subject: [PATCH 01/78] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20rewrite=20to?= =?UTF-8?q?=20typescript?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintignore | 3 +- .eslintrc | 2 +- README.md | 225 +- example/.gitignore | 7 +- example/README.md | 111 +- example/cypress.json | 4 + example/cypress/fixtures/example.json | 5 + example/cypress/integration/spec.js | 19 + example/cypress/plugins/index.js | 17 + example/cypress/support/commands.js | 25 + example/cypress/support/index.js | 20 + example/messages/default.json | 13 + example/messages/en-US.json | 13 + example/messages/es-ES.json | 13 + example/messages/pt-BR.json | 13 + example/package-lock.json | 2716 ------- example/package.json | 51 +- example/public/bundle.css | 2 + example/public/bundle.js | 3319 +++++++++ example/public/global.css | 61 - example/public/index.html | 21 - example/rollup.config.js | 140 +- example/src/App.svelte | 46 - example/src/client.js | 7 + example/src/components/Nav.svelte | 60 + example/src/i18n.js | 52 +- example/src/main.js | 9 - example/src/routes/_error.svelte | 40 + example/src/routes/_layout.svelte | 41 + example/src/routes/about.svelte | 15 + example/src/routes/blog/[slug].json.js | 28 + example/src/routes/blog/[slug].svelte | 64 + example/src/routes/blog/_posts.js | 92 + example/src/routes/blog/index.json.js | 16 + example/src/routes/blog/index.svelte | 34 + example/src/routes/index.svelte | 59 + example/src/server.js | 19 + example/src/service-worker.js | 82 + example/src/template.html | 33 + example/{public => static}/favicon.png | Bin example/static/global.css | 36 + example/static/great-success.png | Bin 0 -> 81921 bytes example/static/logo-192.png | Bin 0 -> 4760 bytes example/static/logo-512.png | Bin 0 -> 13928 bytes example/static/manifest.json | 20 + example/yarn.lock | 1762 +++++ package-lock.json | 6964 ------------------ package.json | 70 +- rollup.config.js | 39 +- src/cli/extract.ts | 220 + src/cli/index.ts | 73 + src/client/formatters.ts | 80 + src/client/index.ts | 118 + src/client/modules.d.ts | 1 + src/client/types.ts | 39 + src/client/utils.ts | 51 + src/index.js | 119 - src/utils.js | 37 - test/cli/extraction.test.ts | 227 + test/{index.test.js => client/index.test.ts} | 165 +- test/fixtures/en.json | 10 + test/fixtures/es.json | 10 + test/fixtures/pt.json | 10 + test/fixtures/svelte.config.js | 5 + tsconfig.json | 16 + yarn.lock | 5353 ++++++++++++++ 66 files changed, 12629 insertions(+), 10293 deletions(-) create mode 100644 example/cypress.json create mode 100644 example/cypress/fixtures/example.json create mode 100644 example/cypress/integration/spec.js create mode 100644 example/cypress/plugins/index.js create mode 100644 example/cypress/support/commands.js create mode 100644 example/cypress/support/index.js create mode 100644 example/messages/default.json create mode 100644 example/messages/en-US.json create mode 100644 example/messages/es-ES.json create mode 100644 example/messages/pt-BR.json delete mode 100644 example/package-lock.json create mode 100644 example/public/bundle.css create mode 100644 example/public/bundle.js delete mode 100644 example/public/global.css delete mode 100644 example/public/index.html delete mode 100644 example/src/App.svelte create mode 100644 example/src/client.js create mode 100644 example/src/components/Nav.svelte delete mode 100644 example/src/main.js create mode 100644 example/src/routes/_error.svelte create mode 100644 example/src/routes/_layout.svelte create mode 100644 example/src/routes/about.svelte create mode 100644 example/src/routes/blog/[slug].json.js create mode 100644 example/src/routes/blog/[slug].svelte create mode 100644 example/src/routes/blog/_posts.js create mode 100644 example/src/routes/blog/index.json.js create mode 100644 example/src/routes/blog/index.svelte create mode 100644 example/src/routes/index.svelte create mode 100644 example/src/server.js create mode 100644 example/src/service-worker.js create mode 100644 example/src/template.html rename example/{public => static}/favicon.png (100%) create mode 100644 example/static/global.css create mode 100644 example/static/great-success.png create mode 100644 example/static/logo-192.png create mode 100644 example/static/logo-512.png create mode 100644 example/static/manifest.json create mode 100644 example/yarn.lock delete mode 100644 package-lock.json create mode 100644 src/cli/extract.ts create mode 100644 src/cli/index.ts create mode 100644 src/client/formatters.ts create mode 100644 src/client/index.ts create mode 100644 src/client/modules.d.ts create mode 100644 src/client/types.ts create mode 100644 src/client/utils.ts delete mode 100644 src/index.js delete mode 100644 src/utils.js create mode 100644 test/cli/extraction.test.ts rename test/{index.test.js => client/index.test.ts} (52%) create mode 100644 test/fixtures/en.json create mode 100644 test/fixtures/es.json create mode 100644 test/fixtures/pt.json create mode 100644 test/fixtures/svelte.config.js create mode 100644 tsconfig.json create mode 100644 yarn.lock diff --git a/.eslintignore b/.eslintignore index 88264c9..f98ec03 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ -/test/fixtures \ No newline at end of file +/test/fixtures +dist \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index 1ff97d2..729d68e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,5 +1,5 @@ { - "extends": ["kaisermann"], + "extends": ["kaisermann/typescript"], "env": { "browser": true, "jest": true diff --git a/README.md b/README.md index 55dd1d9..660fe19 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,26 @@ > Internationalization for Svelte. -[See Demo](https://svelte-i18n.netlify.com/) + + + + + + +- [Usage](#usage) + - [Locale](#locale) + - [The dictionary](#the-dictionary) + - [Formatting](#formatting) + - [Formatting methods](#formatting-methods) + - [Formats](#formats) +- [CLI](#cli) + - [Options](#options) + + ## Usage -`svelte-i18n` utilizes svelte `stores` for keeping track of the current locale, dictionary of messages and the main format function. This way, we keep everything neat, in sync and easy to use on your svelte files. +`svelte-i18n` uses `stores` to keep track of the current locale, dictionary of messages and the main format function. This way, we keep everything neat, in sync and easy to use on your svelte files. --- @@ -21,9 +36,7 @@ import { locale, dictionary, getClientLocale } from 'svelte-i18n' locale.set('en-US') // This is a store, so we can subscribe to its changes -locale.subscribe(() => { - console.log('locale change') -}) +locale.subscribe(() => console.log('locale change')) // svelte-i18n exports a method to help getting the current client locale locale.set( @@ -95,7 +108,7 @@ Each language message dictionary can be as deep as you want. Messages can also b ### Formatting -The `_`/`format` store is the actual formatter method. To use it, it's simple as any other svelte store. +The `_`/`format` store is the actual formatter method. To use it it's simple as any other svelte store. ```html - -
{$_.upper('greeting.ask')}
- -``` - -#### `_.lower` - -Transforms a localized message into lowercase. - -```html - - -
{$_.lower('greeting.ask')}
- -``` - -#### `_.capital` - -Capitalize a localized message. - -```html - - -
{$_.capital('greeting.ask')}
+
{$_({ id: 'greeting.ask' })}
``` -#### `_.title` +The formatter method also provides some casing utilities: -Transform the message into title case. +- `_.upper` - transforms a localized message into uppercase; +- `_.lower` - transforms a localized message into lowercase; +- `_.capital` - capitalize a localized message; +- `_.title` - transforms the message into title case; ```html - +
{$_.upper('greeting.ask')}
+ + +
{$_.lower('greeting.ask')}
+
{$_.capital('greeting.ask')}
+ + +
{$_.title('greeting.ask')}
``` #### `_.time` -`function(time: Date, format?: string, locale?: string)` +Formats a date object into a time string with the specified format (`short`, `medium`, `long`, `full`). Please refer to the [#formats](#formats) section to see available formats. -Formats a date object into a time string with the specified format (`short`, `medium`, `long`, `full`). Please refer to the [ICU message format](http://userguide.icu-project.org/formatparse/messages) documentation for all available. formats +```ts +function(time: Date, options: MessageObject): string +``` ```html - -
{$_.time(new Date(2019, 3, 24, 23, 45))}
-
{$_.time(new Date(2019, 3, 24, 23, 45), 'medium')}
+
{$_.time(new Date(2019, 3, 24, 23, 45), { format: 'medium' } )}
``` #### `_.date` -`function(date: Date, format?: string, locale?: string)` +Formats a date object into a string with the specified format (`short`, `medium`, `long`, `full`). Please refer to the [#formats](#formats) section to see available formats. -Formats a date object into a string with the specified format (`short`, `medium`, `long`, `full`). Please refer to the [ICU message format](http://userguide.icu-project.org/formatparse/messages) documentation for all available. formats +```ts +function(date: Date, options: MessageObject): string +``` ```html - -
{$_.date(new Date(2019, 3, 24, 23, 45))}
-
{$_.date(new Date(2019, 3, 24, 23, 45), 'medium')}
+
{$_.date(new Date(2019, 3, 24, 23, 45), { format: 'medium' } )}
``` #### `_.number` -`function(number: Number, locale?: string)` +Formats a number with the specified locale and format. Please refer to the [#formats](#formats) section to see available formats. -Formats a number with the specified locale +```ts +function(number: number, options: MessageObject): string +``` ```html - -
{$_.number(100000000)}
-
{$_.number(100000000, 'pt')}
+
{$_.number(100000000, { locale: 'pt' })}
``` + +### Formats + +`svelte-i18n` comes with a set of default `number`, `time` and `date` formats: + +**Number:** + +- `currency`: `{ style: 'currency' }` +- `percent`: `{ style: 'percent' }` +- `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' }` + +It's possible to define custom format styles via the `addCustomFormats` method if you need to supply a set of options to the underlying `Intl` formatter. + +```ts +function addCustomFormats(formatsObject: Formats): void + +interface Formats { + number: Record + date: Record + time: Record +} +``` + +Please refer to the [Intl.NumberFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat) and [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat) documentations to see available formatting options. + +**Example**: + +```js +import { addCustomFormats } from 'svelte-i18n' + +addCustomFormats({ + number: { + EUR: { + style: 'currency', + currency: 'EUR', + }, + }, +}) +``` + +```html +
+ {$_.number(123456.789, { format: 'EUR' })} +
+ +``` + +## CLI + +`svelte-i18n` provides a command-line interface to extract all your messages to the `stdout` or to a specific JSON file. + +```bash +$ svelte-i18n extract [options] [output-file] +``` + +### Options + +- `-s, --shallow` - extract all messages to a shallow object, without creating nested objects. Default: `false`. + +- `--overwrite` - overwrite the content of the `output` file instead of just appending missing properties. Default: `false`. + +- `-c, --configDir` - define the directory of a [`svelte.config.js`](https://github.com/UnwrittenFun/svelte-vscode#generic-setup) in case your svelte components need to be preprocessed. diff --git a/example/.gitignore b/example/.gitignore index 849d10a..5aea041 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -1,3 +1,6 @@ .DS_Store -node_modules -public/bundle.* +/node_modules/ +/src/node_modules/@sapper/ +yarn-error.log +/cypress/screenshots/ +/__sapper__/ diff --git a/example/README.md b/example/README.md index d1d1702..fecc155 100644 --- a/example/README.md +++ b/example/README.md @@ -1,68 +1,109 @@ -*Psst — looking for a shareable component template? Go here --> [sveltejs/component-template](https://github.com/sveltejs/component-template)* +# sapper-template ---- +The default [Sapper](https://github.com/sveltejs/sapper) template, available for Rollup and webpack. -# svelte app -This is a project template for [Svelte](https://svelte.dev) apps. It lives at https://github.com/sveltejs/template. +## Getting started -To create a new project based on this template using [degit](https://github.com/Rich-Harris/degit): + +### Using `degit` + +[`degit`](https://github.com/Rich-Harris/degit) is a scaffolding tool that lets you create a directory from a branch in a repository. Use either the `rollup` or `webpack` branch in `sapper-template`: ```bash -npx degit sveltejs/template svelte-app -cd svelte-app +# for Rollup +npx degit "sveltejs/sapper-template#rollup" my-app +# for webpack +npx degit "sveltejs/sapper-template#webpack" my-app ``` -*Note that you will need to have [Node.js](https://nodejs.org) installed.* + +### Using GitHub templates + +Alternatively, you can use GitHub's template feature with the [sapper-template-rollup](https://github.com/sveltejs/sapper-template-rollup) or [sapper-template-webpack](https://github.com/sveltejs/sapper-template-webpack) repositories. -## Get started +### Running the project -Install the dependencies... - -```bash -cd svelte-app -npm install -``` - -...then start [Rollup](https://rollupjs.org): +However you get the code, you can install dependencies and run the project in development mode with: ```bash +cd my-app +npm install # or yarn npm run dev ``` -Navigate to [localhost:5000](http://localhost:5000). You should see your app running. Edit a component file in `src`, save it, and reload the page to see your changes. +Open up [localhost:3000](http://localhost:3000) and start clicking around. + +Consult [sapper.svelte.dev](https://sapper.svelte.dev) for help getting started. -## Deploying to the web +## Structure -### With [now](https://zeit.co/now) +Sapper expects to find two directories in the root of your project — `src` and `static`. -Install `now` if you haven't already: + +### src + +The [src](src) directory contains the entry points for your app — `client.js`, `server.js` and (optionally) a `service-worker.js` — along with a `template.html` file and a `routes` directory. + + +#### src/routes + +This is the heart of your Sapper app. There are two kinds of routes — *pages*, and *server routes*. + +**Pages** are Svelte components written in `.svelte` files. When a user first visits the application, they will be served a server-rendered version of the route in question, plus some JavaScript that 'hydrates' the page and initialises a client-side router. From that point forward, navigating to other pages is handled entirely on the client for a fast, app-like feel. (Sapper will preload and cache the code for these subsequent pages, so that navigation is instantaneous.) + +**Server routes** are modules written in `.js` files, that export functions corresponding to HTTP methods. Each function receives Express `request` and `response` objects as arguments, plus a `next` function. This is useful for creating a JSON API, for example. + +There are three simple rules for naming the files that define your routes: + +* A file called `src/routes/about.svelte` corresponds to the `/about` route. A file called `src/routes/blog/[slug].svelte` corresponds to the `/blog/:slug` route, in which case `params.slug` is available to the route +* The file `src/routes/index.svelte` (or `src/routes/index.js`) corresponds to the root of your app. `src/routes/about/index.svelte` is treated the same as `src/routes/about.svelte`. +* Files and directories with a leading underscore do *not* create routes. This allows you to colocate helper modules and components with the routes that depend on them — for example you could have a file called `src/routes/_helpers/datetime.js` and it would *not* create a `/_helpers/datetime` route + + +### static + +The [static](static) directory contains any static assets that should be available. These are served using [sirv](https://github.com/lukeed/sirv). + +In your [service-worker.js](src/service-worker.js) file, you can import these as `files` from the generated manifest... + +```js +import { files } from '@sapper/service-worker'; +``` + +...so that you can cache them (though you can choose not to, for example if you don't want to cache very large files). + + +## Bundler config + +Sapper uses Rollup or webpack to provide code-splitting and dynamic imports, as well as compiling your Svelte components. With webpack, it also provides hot module reloading. As long as you don't do anything daft, you can edit the configuration files to add whatever plugins you'd like. + + +## Production mode and deployment + +To start a production version of your app, run `npm run build && npm start`. This will disable live reloading, and activate the appropriate bundler plugins. + +You can deploy your application to any environment that supports Node 8 or above. As an example, to deploy to [Now](https://zeit.co/now), run these commands: ```bash npm install -g now -``` - -Then, from within your project folder: - -```bash now ``` -As an alternative, use the [Now desktop client](https://zeit.co/download) and simply drag the unzipped project folder to the taskbar icon. -### With [surge](https://surge.sh/) +## Using external components -Install `surge` if you haven't already: +When using Svelte components installed from npm, such as [@sveltejs/svelte-virtual-list](https://github.com/sveltejs/svelte-virtual-list), Svelte needs the original component source (rather than any precompiled JavaScript that ships with the component). This allows the component to be rendered server-side, and also keeps your client-side app smaller. + +Because of that, it's essential that the bundler doesn't treat the package as an *external dependency*. You can either modify the `external` option under `server` in [rollup.config.js](rollup.config.js) or the `externals` option in [webpack.config.js](webpack.config.js), or simply install the package to `devDependencies` rather than `dependencies`, which will cause it to get bundled (and therefore compiled) with your app: ```bash -npm install -g surge +npm install -D @sveltejs/svelte-virtual-list ``` -Then, from within your project folder: -```bash -npm run build -surge public -``` +## Bugs and feedback + +Sapper is in early development, and may have the odd rough edge here and there. Please be vocal over on the [Sapper issue tracker](https://github.com/sveltejs/sapper/issues). diff --git a/example/cypress.json b/example/cypress.json new file mode 100644 index 0000000..f5622fa --- /dev/null +++ b/example/cypress.json @@ -0,0 +1,4 @@ +{ + "baseUrl": "http://localhost:3000", + "video": false +} \ No newline at end of file diff --git a/example/cypress/fixtures/example.json b/example/cypress/fixtures/example.json new file mode 100644 index 0000000..da18d93 --- /dev/null +++ b/example/cypress/fixtures/example.json @@ -0,0 +1,5 @@ +{ + "name": "Using fixtures to represent data", + "email": "hello@cypress.io", + "body": "Fixtures are a great way to mock data for responses to routes" +} \ No newline at end of file diff --git a/example/cypress/integration/spec.js b/example/cypress/integration/spec.js new file mode 100644 index 0000000..9a7140d --- /dev/null +++ b/example/cypress/integration/spec.js @@ -0,0 +1,19 @@ +describe('Sapper template app', () => { + beforeEach(() => { + cy.visit('/') + }); + + it('has the correct

', () => { + cy.contains('h1', 'Great success!') + }); + + it('navigates to /about', () => { + cy.get('nav a').contains('about').click(); + cy.url().should('include', '/about'); + }); + + it('navigates to /blog', () => { + cy.get('nav a').contains('blog').click(); + cy.url().should('include', '/blog'); + }); +}); \ No newline at end of file diff --git a/example/cypress/plugins/index.js b/example/cypress/plugins/index.js new file mode 100644 index 0000000..fd170fb --- /dev/null +++ b/example/cypress/plugins/index.js @@ -0,0 +1,17 @@ +// *********************************************************** +// This example plugins/index.js can be used to load plugins +// +// You can change the location of this file or turn off loading +// the plugins file with the 'pluginsFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/plugins-guide +// *********************************************************** + +// This function is called when a project is opened or re-opened (e.g. due to +// the project's config changing) + +module.exports = (on, config) => { + // `on` is used to hook into various events Cypress emits + // `config` is the resolved Cypress config +} diff --git a/example/cypress/support/commands.js b/example/cypress/support/commands.js new file mode 100644 index 0000000..c1f5a77 --- /dev/null +++ b/example/cypress/support/commands.js @@ -0,0 +1,25 @@ +// *********************************************** +// This example commands.js shows you how to +// create various custom commands and overwrite +// existing commands. +// +// For more comprehensive examples of custom +// commands please read more here: +// https://on.cypress.io/custom-commands +// *********************************************** +// +// +// -- This is a parent command -- +// Cypress.Commands.add("login", (email, password) => { ... }) +// +// +// -- This is a child command -- +// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) +// +// +// -- This is a dual command -- +// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) +// +// +// -- This is will overwrite an existing command -- +// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) diff --git a/example/cypress/support/index.js b/example/cypress/support/index.js new file mode 100644 index 0000000..d68db96 --- /dev/null +++ b/example/cypress/support/index.js @@ -0,0 +1,20 @@ +// *********************************************************** +// This example support/index.js is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import './commands' + +// Alternatively you can use CommonJS syntax: +// require('./commands') diff --git a/example/messages/default.json b/example/messages/default.json new file mode 100644 index 0000000..c3b7e92 --- /dev/null +++ b/example/messages/default.json @@ -0,0 +1,13 @@ +{ + "title": { + "about": "About", + "index": "Sapper project template!" + }, + "about_this_site": "About this site", + "about_content": ["This is the 'about' page. There's not much here."], + "messages": { + "success": "Great success!", + "high_five": "High five", + "try_editing": "Try editing this file (src/routes/index.svelte) to test live reloading." + } +} diff --git a/example/messages/en-US.json b/example/messages/en-US.json new file mode 100644 index 0000000..c3b7e92 --- /dev/null +++ b/example/messages/en-US.json @@ -0,0 +1,13 @@ +{ + "title": { + "about": "About", + "index": "Sapper project template!" + }, + "about_this_site": "About this site", + "about_content": ["This is the 'about' page. There's not much here."], + "messages": { + "success": "Great success!", + "high_five": "High five", + "try_editing": "Try editing this file (src/routes/index.svelte) to test live reloading." + } +} diff --git a/example/messages/es-ES.json b/example/messages/es-ES.json new file mode 100644 index 0000000..0efe216 --- /dev/null +++ b/example/messages/es-ES.json @@ -0,0 +1,13 @@ +{ + "title": { + "about": "Acerca de", + "index": " Plantilla de proyecto Sapper!" + }, + "about_this_site": " Acerca de este sitio", + "about_content": ["Esta es la página 'acerca de'. No hay mucho aquí."], + "messages": { + "success": "Gran éxito!", + "high_five": "Cinco altos", + "try_editing": " Intente editar este archivo (src/routes/index.svelte) para probar la recarga en vivo." + } +} diff --git a/example/messages/pt-BR.json b/example/messages/pt-BR.json new file mode 100644 index 0000000..012af99 --- /dev/null +++ b/example/messages/pt-BR.json @@ -0,0 +1,13 @@ +{ + "title": { + "about": "Sobre", + "index": "Modelo de projeto em Sapper!" + }, + "about_this_site": "Sobre este site", + "about_content": ["Esta é a página 'sobre'. Não há muito aqui."], + "messages": { + "success": "Suuuucesso!", + "high_five": "Toca aqui", + "try_editing": "Tente editar este arquivo (src/routes/index.svelte) para testar o recarregamento ao vivo." + } +} diff --git a/example/package-lock.json b/example/package-lock.json deleted file mode 100644 index e4193df..0000000 --- a/example/package-lock.json +++ /dev/null @@ -1,2716 +0,0 @@ -{ - "name": "svelte-app", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@babel/code-frame": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", - "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", - "dev": true, - "requires": { - "@babel/highlight": "^7.0.0" - } - }, - "@babel/highlight": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", - "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", - "dev": true, - "requires": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^4.0.0" - } - }, - "@polka/url": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-0.5.0.tgz", - "integrity": "sha512-oZLYFEAzUKyi3SKnXvj32ZCEGH6RDnao7COuCVhDydMS9NrCSVXhM79VaKyP5+Zc33m0QXEd2DN3UkU7OsHcfw==", - "dev": true - }, - "@types/estree": { - "version": "0.0.39", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", - "dev": true - }, - "@types/node": { - "version": "12.0.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.8.tgz", - "integrity": "sha512-b8bbUOTwzIY3V5vDTY1fIJ+ePKDUBqt2hC2woVGotdQQhG/2Sh62HOKHrT7ab+VerXAcPyAiTEipPu/FsreUtg==", - "dev": true - }, - "@types/resolve": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", - "integrity": "sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, - "acorn": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", - "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", - "dev": true, - "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "dev": true, - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } - } - }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", - "dev": true - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", - "dev": true - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", - "dev": true - }, - "array-filter": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", - "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", - "dev": true - }, - "array-map": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", - "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", - "dev": true - }, - "array-reduce": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", - "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", - "dev": true - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", - "dev": true - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", - "dev": true - }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", - "dev": true - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", - "dev": true - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "dev": true, - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "dev": true, - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", - "dev": true - }, - "builtin-modules": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", - "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", - "dev": true - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", - "dev": true, - "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "chokidar": { - "version": "2.1.6", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", - "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", - "dev": true, - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "dev": true, - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", - "dev": true - }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "console-clear": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/console-clear/-/console-clear-1.1.1.tgz", - "integrity": "sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ==", - "dev": true - }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", - "dev": true - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "requires": { - "object-keys": "^1.0.12" - } - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "dev": true, - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es-abstract": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", - "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.0", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "is-callable": "^1.1.4", - "is-regex": "^1.0.4", - "object-keys": "^1.0.12" - } - }, - "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "estree-walker": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", - "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", - "dev": true - }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", - "dev": true - }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "dev": true, - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "dev": true, - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "dev": true, - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", - "dev": true - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", - "dev": true, - "requires": { - "map-cache": "^0.2.2" - } - }, - "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", - "dev": true, - "optional": true, - "requires": { - "nan": "^2.12.1", - "node-pre-gyp": "^0.12.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true, - "optional": true - }, - "minipass": { - "version": "2.3.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.3.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^4.1.0", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.7.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "yallist": { - "version": "3.0.3", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "get-port": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", - "integrity": "sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw=", - "dev": true - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", - "dev": true - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", - "dev": true - }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "dev": true, - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "hosted-git-info": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", - "dev": true - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "intl-messageformat": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-4.1.2.tgz", - "integrity": "sha512-VAIBsTw8VRgd/h4gYN7IbJFK/H6PbbDa6Sa5p2VbImO7HFr8CGpzX8pOooWQXAmiq+X6tPqPKXdrWFhoPbge/Q==", - "requires": { - "intl-messageformat-parser": "^1.6.8" - } - }, - "intl-messageformat-parser": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/intl-messageformat-parser/-/intl-messageformat-parser-1.6.8.tgz", - "integrity": "sha512-wnjxkKzAOKUgtBYYqVoDf2xt8zSf/c/m7FrQSmaz0SL3LNEMzVzzYXeLLda//RD3s6Ae4Tj2CgpAmY0Fnrws6A==" - }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", - "dev": true - }, - "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", - "dev": true - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", - "dev": true - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", - "dev": true - } - } - }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true - }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", - "dev": true - }, - "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "is-reference": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.1.2.tgz", - "integrity": "sha512-Kn5g8c7XHKejFOpTf2QN9YjiHHKl5xRj+2uAZf9iM2//nkBNi/NNeB5JMoun28nEaUVHyPUzqzhfRlfAirEjXg==", - "dev": true, - "requires": { - "@types/estree": "0.0.39" - } - }, - "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "dev": true, - "requires": { - "has": "^1.0.1" - } - }, - "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", - "dev": true, - "requires": { - "has-symbols": "^1.0.0" - } - }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", - "dev": true - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "jest-worker": { - "version": "24.6.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.6.0.tgz", - "integrity": "sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ==", - "dev": true, - "requires": { - "merge-stream": "^1.0.1", - "supports-color": "^6.1.0" - }, - "dependencies": { - "supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - }, - "kleur": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", - "dev": true - }, - "livereload": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/livereload/-/livereload-0.8.0.tgz", - "integrity": "sha512-Hi5Na6VIK3e8zlgOS50fu+iOTKWj5hM0BE7NKpZkwnfWTnktTjA38ZUXa2NlJww8/GrdVhpnxdqlLad5fkO27g==", - "dev": true, - "requires": { - "chokidar": "^2.1.5", - "opts": ">= 1.2.0", - "ws": "^1.1.5" - } - }, - "load-json-file": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - } - }, - "local-access": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/local-access/-/local-access-1.0.1.tgz", - "integrity": "sha512-ykt2pgN0aqIy6KQC1CqdWTWkmUwNgaOS6dcpHVjyBJONA+Xi7AtSB1vuxC/U/0tjIP3wcRudwQk1YYzUvzk2bA==", - "dev": true - }, - "magic-string": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.2.tgz", - "integrity": "sha512-iLs9mPjh9IuTtRsqqhNGYcZXGei0Nh/A4xirrsqW7c+QhKVFL2vm7U09ru6cHRD22azaP/wMDgI+HCqbETMTtg==", - "dev": true, - "requires": { - "sourcemap-codec": "^1.4.4" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", - "dev": true - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "dev": true, - "requires": { - "object-visit": "^1.0.0" - } - }, - "memorystream": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", - "dev": true - }, - "merge-stream": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", - "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", - "dev": true, - "requires": { - "readable-stream": "^2.0.1" - } - }, - "micro-memoize": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micro-memoize/-/micro-memoize-4.0.8.tgz", - "integrity": "sha512-Mzlo15iWNrP5EwokGjx0Wlh2b3aMjTPdpsD+ryQtkYJBD67IxBddWU2fO3MIXRtXDH8NsuhaotTrtDbfb+k6jw==" - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, - "mime": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", - "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==", - "dev": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "dev": true, - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "mri": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.4.tgz", - "integrity": "sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w==", - "dev": true - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", - "dev": true, - "optional": true - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "npm-run-all": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", - "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "chalk": "^2.4.1", - "cross-spawn": "^6.0.5", - "memorystream": "^0.3.1", - "minimatch": "^3.0.4", - "pidtree": "^0.3.0", - "read-pkg": "^3.0.0", - "shell-quote": "^1.6.1", - "string.prototype.padend": "^3.0.0" - } - }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "dev": true, - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true - }, - "object-resolve-path": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-resolve-path/-/object-resolve-path-1.1.1.tgz", - "integrity": "sha1-p/j5Poogr4DkQhe6fbVDFtnRIjI=" - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "dev": true, - "requires": { - "isobject": "^3.0.0" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "dev": true, - "requires": { - "isobject": "^3.0.1" - } - }, - "options": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", - "integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=", - "dev": true - }, - "opts": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/opts/-/opts-1.2.6.tgz", - "integrity": "sha1-0YXAQlz9652h0YKQi2W1wCOP67M=", - "dev": true - }, - "parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, - "requires": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" - } - }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", - "dev": true - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "pidtree": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.0.tgz", - "integrity": "sha512-9CT4NFlDcosssyg8KVFltgokyKZIFjoBxw8CTGy+5F38Y1eQWrt8tRayiUOXE+zVKQnYu5BR8JjCtvK3BcnBhg==", - "dev": true - }, - "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true - }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true - }, - "read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, - "requires": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "require-relative": { - "version": "0.8.7", - "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz", - "integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=", - "dev": true - }, - "resolve": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", - "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "rollup": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.15.6.tgz", - "integrity": "sha512-s3Vn3QJQ5YVFfIG4nXoG9VdL1I37IZsft+4ZyeBhxE0df1kCFz9e+4bEAbR4mKH3pvBO9e9xjdxWPhhIp0r9ow==", - "dev": true, - "requires": { - "@types/estree": "0.0.39", - "@types/node": "^12.0.8", - "acorn": "^6.1.1" - } - }, - "rollup-plugin-commonjs": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-10.0.0.tgz", - "integrity": "sha512-B8MoX5GRpj3kW4+YaFO/di2JsZkBxNjVmZ9LWjUoTAjq8N9wc7HObMXPsrvolVV9JXVtYSscflXM14A19dXPNQ==", - "dev": true, - "requires": { - "estree-walker": "^0.6.0", - "is-reference": "^1.1.2", - "magic-string": "^0.25.2", - "resolve": "^1.10.1", - "rollup-pluginutils": "^2.7.0" - } - }, - "rollup-plugin-livereload": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-livereload/-/rollup-plugin-livereload-1.0.1.tgz", - "integrity": "sha512-gNuUr+L/8+CR/oKF8ftJNvJEww6iGzNc8+3XcCOvgKWgjhzUBETs8sNONIthcCvVYC2c2PIKMWgQwrYbxRRdwg==", - "dev": true, - "requires": { - "livereload": "^0.8.0" - } - }, - "rollup-plugin-node-resolve": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-5.0.3.tgz", - "integrity": "sha512-Mhhmf0x493xgUPEsRELnU1VM+4+WO82knWkAbZ0d2DvZQZJMbhzyQK/hqtpVscoRru1EqlK3TM1kK9ro469wPw==", - "dev": true, - "requires": { - "@types/resolve": "0.0.8", - "builtin-modules": "^3.1.0", - "is-module": "^1.0.0", - "resolve": "^1.11.0", - "rollup-pluginutils": "^2.8.0" - } - }, - "rollup-plugin-svelte": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-5.1.0.tgz", - "integrity": "sha512-4MRZG29dAWDpoxEs5uIHzDnYafQEOLaKIJAuDYUtFIzEm1F1IGSTlFyjd8/qk4wltlHdu6V7YfZY53+CKryhMg==", - "dev": true, - "requires": { - "require-relative": "^0.8.7", - "rollup-pluginutils": "^2.3.3", - "sourcemap-codec": "^1.4.4" - } - }, - "rollup-plugin-terser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.0.0.tgz", - "integrity": "sha512-W+jJ4opYnlmNyVW0vtRufs+EGf68BIJ7bnOazgz8mgz8pA9lUyrEifAhPs5y9M16wFeAyBGaRjKip4dnFBtXaw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "jest-worker": "^24.6.0", - "serialize-javascript": "^1.7.0", - "terser": "^4.0.0" - } - }, - "rollup-pluginutils": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz", - "integrity": "sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg==", - "dev": true, - "requires": { - "estree-walker": "^0.6.1" - } - }, - "sade": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/sade/-/sade-1.5.0.tgz", - "integrity": "sha512-d1BuDwSfXR3vKnV00YF09f5SgzZsexB0A3YR8c95KhiGlJwwepxPVEQZC17XOBxPeQZ5I7OZszsSHy0JloOcMA==", - "dev": true, - "requires": { - "mri": "^1.1.0" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "dev": true, - "requires": { - "ret": "~0.1.10" - } - }, - "semver": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", - "dev": true - }, - "serialize-javascript": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.7.0.tgz", - "integrity": "sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA==", - "dev": true - }, - "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "shell-quote": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", - "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", - "dev": true, - "requires": { - "array-filter": "~0.0.0", - "array-map": "~0.0.0", - "array-reduce": "~0.0.0", - "jsonify": "~0.0.0" - } - }, - "sirv": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-0.4.2.tgz", - "integrity": "sha512-dQbZnsMaIiTQPZmbGmktz+c74zt/hyrJEB4tdp2Jj0RNv9J6B/OWR5RyrZEvIn9fyh9Zlg2OlE2XzKz6wMKGAw==", - "dev": true, - "requires": { - "@polka/url": "^0.5.0", - "mime": "^2.3.1" - } - }, - "sirv-cli": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/sirv-cli/-/sirv-cli-0.4.4.tgz", - "integrity": "sha512-7SsPrYWptRcOvS7/8VIxYDibLDRB4apZaU+y8lfuSnyjYFg0AVVU3J0qcQjWPxT9Ti/DtHnmbivJ+ZTh8L0ykg==", - "dev": true, - "requires": { - "console-clear": "^1.1.0", - "get-port": "^3.2.0", - "kleur": "^3.0.0", - "local-access": "^1.0.1", - "sade": "^1.4.0", - "sirv": "^0.4.2", - "tinydate": "^1.0.0" - } - }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "dev": true, - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "dev": true, - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "dev": true, - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "dev": true, - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "dev": true, - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "dev": true, - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "dev": true, - "requires": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-support": { - "version": "0.5.12", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", - "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", - "dev": true - }, - "sourcemap-codec": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.4.tgz", - "integrity": "sha512-CYAPYdBu34781kLHkaW3m6b/uUSyMOC2R61gcYMWooeuaGtjof86ZA/8T+qVPPt7np1085CR9hmMGrySwEc8Xg==", - "dev": true - }, - "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", - "dev": true, - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", - "dev": true - }, - "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", - "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", - "dev": true - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "dev": true, - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "dev": true, - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, - "string.prototype.padend": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz", - "integrity": "sha1-86rvfBcZ8XDF6rHDK/eA2W4h8vA=", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.4.3", - "function-bind": "^1.0.2" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "svelte": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.5.1.tgz", - "integrity": "sha512-iMnuyteFGQ8Yl68G/DHTHY1sLwoAMya1eS0ZOHIm/dqn2etR8WEe8hUAoluLryde4Cft4gvMhtHV3NhE60nBmQ==", - "dev": true - }, - "svelte-i18n": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/svelte-i18n/-/svelte-i18n-1.1.0.tgz", - "integrity": "sha512-PcWrv4llsIQE9PhgNYRR4oLvjH8vbZnCZ5kyRhUsIZ88qimH4KuAwaSzwkxAPyW5Yu2JF+opgaS9XcUABNSBXQ==", - "requires": { - "intl-messageformat": "^4.0.1", - "micro-memoize": "^4.0.7", - "object-resolve-path": "^1.1.1" - } - }, - "terser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.0.0.tgz", - "integrity": "sha512-dOapGTU0hETFl1tCo4t56FN+2jffoKyER9qBGoUFyZ6y7WLoKT0bF+lAYi6B6YsILcGF3q1C2FBh8QcKSCgkgA==", - "dev": true, - "requires": { - "commander": "^2.19.0", - "source-map": "~0.6.1", - "source-map-support": "~0.5.10" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, - "tinydate": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/tinydate/-/tinydate-1.1.0.tgz", - "integrity": "sha512-YF6YTOyBRHX4b3EtEI0W/mROcv82Gt6VccmVuSAkRV3FNORug2457wSGvT2cThbfuctQvVSmC5GobGheScxtIw==", - "dev": true - }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "dev": true, - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, - "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", - "dev": true, - "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" - } - }, - "ultron": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", - "integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po=", - "dev": true - }, - "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", - "dev": true, - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } - } - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "dev": true, - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "dev": true, - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", - "dev": true - } - } - }, - "upath": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", - "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", - "dev": true - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", - "dev": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "ws": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz", - "integrity": "sha512-o3KqipXNUdS7wpQzBHSe180lBGO60SoK0yVo3CYJgb2MkobuWuBX6dhkYP5ORCLd55y+SaflMOV5fqAB53ux4w==", - "dev": true, - "requires": { - "options": ">=0.0.5", - "ultron": "1.0.x" - } - } - } -} diff --git a/example/package.json b/example/package.json index b05ad4b..54c41c7 100644 --- a/example/package.json +++ b/example/package.json @@ -1,25 +1,38 @@ { - "name": "svelte-app", - "version": "1.0.0", + "name": "TODO", + "description": "TODO", + "version": "0.0.1", "scripts": { - "build": "rollup -c", - "autobuild": "rollup -c -w", - "dev": "run-p start:dev autobuild", - "start": "sirv public", - "start:dev": "sirv public --dev" - }, - "devDependencies": { - "npm-run-all": "^4.1.5", - "rollup": "^1.15.6", - "rollup-plugin-commonjs": "^10.0.0", - "rollup-plugin-livereload": "^1.0.1", - "rollup-plugin-node-resolve": "^5.0.3", - "rollup-plugin-svelte": "^5.1.0", - "rollup-plugin-terser": "^5.0.0", - "sirv-cli": "^0.4.4", - "svelte": "^3.5.1" + "dev": "sapper dev", + "build": "sapper build --legacy", + "export": "sapper export --legacy", + "start": "node __sapper__/build", + "cy:run": "cypress run", + "cy:open": "cypress open", + "test": "run-p --race dev cy:run" }, "dependencies": { - "svelte-i18n": "^1.1.0" + "compression": "^1.7.1", + "polka": "next", + "rollup-plugin-json": "^4.0.0", + "sirv": "^0.4.0", + "svelte-i18n": "^2.0.0-alpha.2" + }, + "devDependencies": { + "@babel/core": "^7.0.0", + "@babel/plugin-syntax-dynamic-import": "^7.0.0", + "@babel/plugin-transform-runtime": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/runtime": "^7.0.0", + "@rollup/plugin-replace": "^2.2.0", + "npm-run-all": "^4.1.5", + "rollup": "^1.12.0", + "rollup-plugin-babel": "^4.0.2", + "rollup-plugin-commonjs": "^10.0.0", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-svelte": "^5.0.1", + "rollup-plugin-terser": "^4.0.4", + "sapper": "^0.27.0", + "svelte": "^3.0.0" } } diff --git a/example/public/bundle.css b/example/public/bundle.css new file mode 100644 index 0000000..59242b8 --- /dev/null +++ b/example/public/bundle.css @@ -0,0 +1,2 @@ + +/*# sourceMappingURL=bundle.css.map */ \ No newline at end of file diff --git a/example/public/bundle.js b/example/public/bundle.js new file mode 100644 index 0000000..2428188 --- /dev/null +++ b/example/public/bundle.js @@ -0,0 +1,3319 @@ +var app = (function () { + 'use strict'; + + function noop() { } + function add_location(element, file, line, column, char) { + element.__svelte_meta = { + loc: { file, line, column, char } + }; + } + function run(fn) { + return fn(); + } + function blank_object() { + return Object.create(null); + } + function run_all(fns) { + fns.forEach(run); + } + function is_function(thing) { + return typeof thing === 'function'; + } + function safe_not_equal(a, b) { + return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); + } + function validate_store(store, name) { + if (!store || typeof store.subscribe !== 'function') { + throw new Error(`'${name}' is not a store with a 'subscribe' method`); + } + } + function subscribe(component, store, callback) { + const unsub = store.subscribe(callback); + component.$$.on_destroy.push(unsub.unsubscribe + ? () => unsub.unsubscribe() + : unsub); + } + + function append(target, node) { + target.appendChild(node); + } + function insert(target, node, anchor) { + target.insertBefore(node, anchor || null); + } + function detach(node) { + node.parentNode.removeChild(node); + } + function element(name) { + return document.createElement(name); + } + function text(data) { + return document.createTextNode(data); + } + function space() { + return text(' '); + } + function listen(node, event, handler, options) { + node.addEventListener(event, handler, options); + return () => node.removeEventListener(event, handler, options); + } + function attr(node, attribute, value) { + if (value == null) + node.removeAttribute(attribute); + else + node.setAttribute(attribute, value); + } + function to_number(value) { + return value === '' ? undefined : +value; + } + function children(element) { + return Array.from(element.childNodes); + } + function set_data(text, data) { + data = '' + data; + if (text.data !== data) + text.data = data; + } + + let current_component; + function set_current_component(component) { + current_component = component; + } + + const dirty_components = []; + const resolved_promise = Promise.resolve(); + let update_scheduled = false; + const binding_callbacks = []; + const render_callbacks = []; + const flush_callbacks = []; + function schedule_update() { + if (!update_scheduled) { + update_scheduled = true; + resolved_promise.then(flush); + } + } + function add_render_callback(fn) { + render_callbacks.push(fn); + } + function flush() { + const seen_callbacks = new Set(); + do { + // first, call beforeUpdate functions + // and update components + while (dirty_components.length) { + const component = dirty_components.shift(); + set_current_component(component); + update(component.$$); + } + while (binding_callbacks.length) + binding_callbacks.shift()(); + // then, once components are updated, call + // afterUpdate functions. This may cause + // subsequent updates... + while (render_callbacks.length) { + const callback = render_callbacks.pop(); + if (!seen_callbacks.has(callback)) { + callback(); + // ...so guard against infinite loops + seen_callbacks.add(callback); + } + } + } while (dirty_components.length); + while (flush_callbacks.length) { + flush_callbacks.pop()(); + } + update_scheduled = false; + } + function update($$) { + if ($$.fragment) { + $$.update($$.dirty); + run_all($$.before_render); + $$.fragment.p($$.dirty, $$.ctx); + $$.dirty = null; + $$.after_render.forEach(add_render_callback); + } + } + function mount_component(component, target, anchor) { + const { fragment, on_mount, on_destroy, after_render } = component.$$; + fragment.m(target, anchor); + // onMount happens after the initial afterUpdate. Because + // afterUpdate callbacks happen in reverse order (inner first) + // we schedule onMount callbacks before afterUpdate callbacks + add_render_callback(() => { + const new_on_destroy = on_mount.map(run).filter(is_function); + if (on_destroy) { + on_destroy.push(...new_on_destroy); + } + else { + // Edge case - component was destroyed immediately, + // most likely as a result of a binding initialising + run_all(new_on_destroy); + } + component.$$.on_mount = []; + }); + after_render.forEach(add_render_callback); + } + function destroy(component, detaching) { + if (component.$$) { + run_all(component.$$.on_destroy); + component.$$.fragment.d(detaching); + // TODO null out other refs, including component.$$ (but need to + // preserve final state?) + component.$$.on_destroy = component.$$.fragment = null; + component.$$.ctx = {}; + } + } + function make_dirty(component, key) { + if (!component.$$.dirty) { + dirty_components.push(component); + schedule_update(); + component.$$.dirty = blank_object(); + } + component.$$.dirty[key] = true; + } + function init(component, options, instance, create_fragment, not_equal$$1, prop_names) { + const parent_component = current_component; + set_current_component(component); + const props = options.props || {}; + const $$ = component.$$ = { + fragment: null, + ctx: null, + // state + props: prop_names, + update: noop, + not_equal: not_equal$$1, + bound: blank_object(), + // lifecycle + on_mount: [], + on_destroy: [], + before_render: [], + after_render: [], + context: new Map(parent_component ? parent_component.$$.context : []), + // everything else + callbacks: blank_object(), + dirty: null + }; + let ready = false; + $$.ctx = instance + ? instance(component, props, (key, value) => { + if ($$.ctx && not_equal$$1($$.ctx[key], $$.ctx[key] = value)) { + if ($$.bound[key]) + $$.bound[key](value); + if (ready) + make_dirty(component, key); + } + }) + : props; + $$.update(); + ready = true; + run_all($$.before_render); + $$.fragment = create_fragment($$.ctx); + if (options.target) { + if (options.hydrate) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + $$.fragment.l(children(options.target)); + } + else { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + $$.fragment.c(); + } + if (options.intro && component.$$.fragment.i) + component.$$.fragment.i(); + mount_component(component, options.target, options.anchor); + flush(); + } + set_current_component(parent_component); + } + class SvelteComponent { + $destroy() { + destroy(this, true); + this.$destroy = noop; + } + $on(type, callback) { + const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = [])); + callbacks.push(callback); + return () => { + const index = callbacks.indexOf(callback); + if (index !== -1) + callbacks.splice(index, 1); + }; + } + $set() { + // overridden by instance, if it has props + } + } + class SvelteComponentDev extends SvelteComponent { + constructor(options) { + if (!options || (!options.target && !options.$$inline)) { + throw new Error(`'target' is a required option`); + } + super(); + } + $destroy() { + super.$destroy(); + this.$destroy = () => { + console.warn(`Component was already destroyed`); // eslint-disable-line no-console + }; + } + } + + /** + * Creates a `Readable` store that allows reading by subscription. + * @param value initial value + * @param {StartStopNotifier}start start and stop notifications for subscriptions + */ + function readable(value, start) { + return { + subscribe: writable(value, start).subscribe, + }; + } + /** + * Create a `Writable` store that allows both updating and reading by subscription. + * @param {*=}value initial value + * @param {StartStopNotifier=}start start and stop notifications for subscriptions + */ + function writable(value, start = noop) { + let stop; + const subscribers = []; + function set(new_value) { + if (safe_not_equal(value, new_value)) { + value = new_value; + if (!stop) { + return; // not ready + } + subscribers.forEach((s) => s[1]()); + subscribers.forEach((s) => s[0](value)); + } + } + function update(fn) { + set(fn(value)); + } + function subscribe(run, invalidate = noop) { + const subscriber = [run, invalidate]; + subscribers.push(subscriber); + if (subscribers.length === 1) { + stop = start(set) || noop; + } + run(value); + return () => { + const index = subscribers.indexOf(subscriber); + if (index !== -1) { + subscribers.splice(index, 1); + } + if (subscribers.length === 0) { + stop(); + } + }; + } + return { set, update, subscribe }; + } + /** + * Derived value store by synchronizing one or more readable stores and + * applying an aggregation function over its input values. + * @param {Stores} stores input stores + * @param {function(Stores=, function(*)=):*}fn function callback that aggregates the values + * @param {*=}initial_value when used asynchronously + */ + function derived(stores, fn, initial_value) { + const single = !Array.isArray(stores); + const stores_array = single + ? [stores] + : stores; + const auto = fn.length < 2; + const invalidators = []; + const store = readable(initial_value, (set) => { + let inited = false; + const values = []; + let pending = 0; + let cleanup = noop; + const sync = () => { + if (pending) { + return; + } + cleanup(); + const result = fn(single ? values[0] : values, set); + if (auto) { + set(result); + } + else { + cleanup = is_function(result) ? result : noop; + } + }; + const unsubscribers = stores_array.map((store, i) => store.subscribe((value) => { + values[i] = value; + pending &= ~(1 << i); + if (inited) { + sync(); + } + }, () => { + run_all(invalidators); + pending |= (1 << i); + })); + inited = true; + sync(); + return function stop() { + run_all(unsubscribers); + cleanup(); + }; + }); + return { + subscribe(run, invalidate = noop) { + invalidators.push(invalidate); + const unsubscribe = store.subscribe(run, invalidate); + return () => { + const index = invalidators.indexOf(invalidate); + if (index !== -1) { + invalidators.splice(index, 1); + } + unsubscribe(); + }; + } + }; + } + + // gutted from https://github.com/Polymer/observe-js/blob/master/src/observe.js + function noop$1 () {} + function detectEval () { + // Don't test for eval if we're running in a Chrome App environment. + // We check for APIs set that only exist in a Chrome App context. + if (typeof chrome !== 'undefined' && chrome.app && chrome.app.runtime) { + return false + } + + // Firefox OS Apps do not allow eval. This feature detection is very hacky + // but even if some other platform adds support for this function this code + // will continue to work. + if (typeof navigator != 'undefined' && navigator.getDeviceStorage) { + return false + } + + try { + var f = new Function('', 'return true;'); + return f() + } catch (ex) { + return false + } + } + + var hasEval = detectEval(); + + function isIndex (s) { + return +s === s >>> 0 && s !== '' + } + + function isObject (obj) { + return obj === Object(obj) + } + + var createObject = ('__proto__' in {}) ? + function (obj) { + return obj + } : + function (obj) { + var proto = obj.__proto__; + if (!proto) + return obj + var newObject = Object.create(proto); + Object.getOwnPropertyNames(obj).forEach(function (name) { + Object.defineProperty(newObject, name, + Object.getOwnPropertyDescriptor(obj, name)); + }); + return newObject + }; + + function parsePath (path) { + var keys = []; + var index = -1; + var c, newChar, key, type, transition, action, typeMap, mode = 'beforePath'; + + var actions = { + push: function () { + if (key === undefined) + return + + keys.push(key); + key = undefined; + }, + + append: function () { + if (key === undefined) + key = newChar; + else + key += newChar; + } + }; + + function maybeUnescapeQuote () { + if (index >= path.length) + return + + var nextChar = path[index + 1]; + if ((mode == 'inSingleQuote' && nextChar == "'") || + (mode == 'inDoubleQuote' && nextChar == '"')) { + index++; + newChar = nextChar; + actions.append(); + return true + } + } + + while (mode) { + index++; + c = path[index]; + + if (c == '\\' && maybeUnescapeQuote()) + continue + + type = getPathCharType(c); + typeMap = pathStateMachine[mode]; + transition = typeMap[type] || typeMap['else'] || 'error'; + + if (transition == 'error') + return // parse error + + mode = transition[0]; + action = actions[transition[1]] || noop$1; + newChar = transition[2] === undefined ? c : transition[2]; + action(); + + if (mode === 'afterPath') { + return keys + } + } + + return // parse error + } + + var identStart = '[\$_a-zA-Z]'; + var identPart = '[\$_a-zA-Z0-9]'; + var identRegExp = new RegExp('^' + identStart + '+' + identPart + '*' + '$'); + + function isIdent (s) { + return identRegExp.test(s) + } + + var constructorIsPrivate = {}; + + function Path (parts, privateToken) { + if (privateToken !== constructorIsPrivate) + throw Error('Use Path.get to retrieve path objects') + + for (var i = 0; i < parts.length; i++) { + this.push(String(parts[i])); + } + + if (hasEval && this.length) { + this.getValueFrom = this.compiledGetValueFromFn(); + } + } + + var pathCache = {}; + + function getPath (pathString) { + if (pathString instanceof Path) + return pathString + + if (pathString == null || pathString.length == 0) + pathString = ''; + + if (typeof pathString != 'string') { + if (isIndex(pathString.length)) { + // Constructed with array-like (pre-parsed) keys + return new Path(pathString, constructorIsPrivate) + } + + pathString = String(pathString); + } + + var path = pathCache[pathString]; + if (path) + return path + + var parts = parsePath(pathString); + if (!parts) + return invalidPath + + var path = new Path(parts, constructorIsPrivate); + pathCache[pathString] = path; + return path + } + + Path.get = getPath; + + function formatAccessor (key) { + if (isIndex(key)) { + return '[' + key + ']' + } else { + return '["' + key.replace(/"/g, '\\"') + '"]' + } + } + + Path.prototype = createObject({ + __proto__: [], + valid: true, + + toString: function () { + var pathString = ''; + for (var i = 0; i < this.length; i++) { + var key = this[i]; + if (isIdent(key)) { + pathString += i ? '.' + key : key; + } else { + pathString += formatAccessor(key); + } + } + + return pathString + }, + + getValueFrom: function (obj, directObserver) { + for (var i = 0; i < this.length; i++) { + if (obj == null) + return + obj = obj[this[i]]; + } + return obj + }, + + iterateObjects: function (obj, observe) { + for (var i = 0; i < this.length; i++) { + if (i) + obj = obj[this[i - 1]]; + if (!isObject(obj)) + return + observe(obj, this[i]); + } + }, + + compiledGetValueFromFn: function () { + var str = ''; + var pathString = 'obj'; + str += 'if (obj != null'; + var i = 0; + var key; + for (; i < (this.length - 1); i++) { + key = this[i]; + pathString += isIdent(key) ? '.' + key : formatAccessor(key); + str += ' &&\n ' + pathString + ' != null'; + } + str += ')\n'; + + var key = this[i]; + pathString += isIdent(key) ? '.' + key : formatAccessor(key); + + str += ' return ' + pathString + ';\nelse\n return undefined;'; + return new Function('obj', str) + }, + + setValueFrom: function (obj, value) { + if (!this.length) + return false + + for (var i = 0; i < this.length - 1; i++) { + if (!isObject(obj)) + return false + obj = obj[this[i]]; + } + + if (!isObject(obj)) + return false + + obj[this[i]] = value; + return true + } + }); + + function getPathCharType (char) { + if (char === undefined) + return 'eof' + + var code = char.charCodeAt(0); + + switch (code) { + case 0x5B: // [ + case 0x5D: // ] + case 0x2E: // . + case 0x22: // " + case 0x27: // ' + case 0x30: // 0 + return char + + case 0x5F: // _ + case 0x24: // $ + return 'ident' + + case 0x20: // Space + case 0x09: // Tab + case 0x0A: // Newline + case 0x0D: // Return + case 0xA0: // No-break space + case 0xFEFF: // Byte Order Mark + case 0x2028: // Line Separator + case 0x2029: // Paragraph Separator + return 'ws' + } + + // a-z, A-Z + if ((0x61 <= code && code <= 0x7A) || (0x41 <= code && code <= 0x5A)) + return 'ident' + + // 1-9 + if (0x31 <= code && code <= 0x39) + return 'number' + + return 'else' + } + + var pathStateMachine = { + 'beforePath': { + 'ws': ['beforePath'], + 'ident': ['inIdent', 'append'], + '[': ['beforeElement'], + 'eof': ['afterPath'] + }, + + 'inPath': { + 'ws': ['inPath'], + '.': ['beforeIdent'], + '[': ['beforeElement'], + 'eof': ['afterPath'] + }, + + 'beforeIdent': { + 'ws': ['beforeIdent'], + 'ident': ['inIdent', 'append'] + }, + + 'inIdent': { + 'ident': ['inIdent', 'append'], + '0': ['inIdent', 'append'], + 'number': ['inIdent', 'append'], + 'ws': ['inPath', 'push'], + '.': ['beforeIdent', 'push'], + '[': ['beforeElement', 'push'], + 'eof': ['afterPath', 'push'] + }, + + 'beforeElement': { + 'ws': ['beforeElement'], + '0': ['afterZero', 'append'], + 'number': ['inIndex', 'append'], + "'": ['inSingleQuote', 'append', ''], + '"': ['inDoubleQuote', 'append', ''] + }, + + 'afterZero': { + 'ws': ['afterElement', 'push'], + ']': ['inPath', 'push'] + }, + + 'inIndex': { + '0': ['inIndex', 'append'], + 'number': ['inIndex', 'append'], + 'ws': ['afterElement'], + ']': ['inPath', 'push'] + }, + + 'inSingleQuote': { + "'": ['afterElement'], + 'eof': ['error'], + 'else': ['inSingleQuote', 'append'] + }, + + 'inDoubleQuote': { + '"': ['afterElement'], + 'eof': ['error'], + 'else': ['inDoubleQuote', 'append'] + }, + + 'afterElement': { + 'ws': ['afterElement'], + ']': ['inPath', 'push'] + } + }; + + var invalidPath = new Path('', constructorIsPrivate); + invalidPath.valid = false; + invalidPath.getValueFrom = invalidPath.setValueFrom = function () {}; + + var path = Path; + + /** + * + * @param {Object} o + * @param {String} path + * @returns {*} + */ + var objectResolvePath = function (o, path$1) { + if (typeof path$1 !== 'string') { + throw new TypeError('path must be a string') + } + if (typeof o !== 'object') { + throw new TypeError('object must be passed') + } + var pathObj = path.get(path$1); + if (!pathObj.valid) { + throw new Error('path is not a valid object path') + } + return pathObj.getValueFrom(o) + }; + + /* + Copyright (c) 2014, Yahoo! Inc. All rights reserved. + Copyrights licensed under the New BSD License. + See the accompanying LICENSE file for terms. + */ + var __extends = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); + var Compiler = /** @class */ (function () { + function Compiler(locales, formats) { + this.locales = []; + this.formats = { + number: {}, + date: {}, + time: {} + }; + this.pluralNumberFormat = null; + this.currentPlural = null; + this.pluralStack = []; + this.locales = locales; + this.formats = formats; + } + Compiler.prototype.compile = function (ast) { + this.pluralStack = []; + this.currentPlural = null; + this.pluralNumberFormat = null; + return this.compileMessage(ast); + }; + Compiler.prototype.compileMessage = function (ast) { + var _this = this; + if (!(ast && ast.type === 'messageFormatPattern')) { + throw new Error('Message AST is not of type: "messageFormatPattern"'); + } + var elements = ast.elements; + var pattern = elements + .filter(function (el) { + return el.type === 'messageTextElement' || el.type === 'argumentElement'; + }) + .map(function (el) { + return el.type === 'messageTextElement' + ? _this.compileMessageText(el) + : _this.compileArgument(el); + }); + if (pattern.length !== elements.length) { + throw new Error('Message element does not have a valid type'); + } + return pattern; + }; + Compiler.prototype.compileMessageText = function (element) { + // When this `element` is part of plural sub-pattern and its value contains + // an unescaped '#', use a `PluralOffsetString` helper to properly output + // the number with the correct offset in the string. + if (this.currentPlural && /(^|[^\\])#/g.test(element.value)) { + // Create a cache a NumberFormat instance that can be reused for any + // PluralOffsetString instance in this message. + if (!this.pluralNumberFormat) { + this.pluralNumberFormat = new Intl.NumberFormat(this.locales); + } + return new PluralOffsetString(this.currentPlural.id, this.currentPlural.format.offset, this.pluralNumberFormat, element.value); + } + // Unescape the escaped '#'s in the message text. + return element.value.replace(/\\#/g, '#'); + }; + Compiler.prototype.compileArgument = function (element) { + var format = element.format, id = element.id; + if (!format) { + return new StringFormat(id); + } + var _a = this, formats = _a.formats, locales = _a.locales; + switch (format.type) { + case 'numberFormat': + return { + id: id, + format: new Intl.NumberFormat(locales, formats.number[format.style]) + .format + }; + case 'dateFormat': + return { + id: id, + format: new Intl.DateTimeFormat(locales, formats.date[format.style]) + .format + }; + case 'timeFormat': + return { + id: id, + format: new Intl.DateTimeFormat(locales, formats.time[format.style]) + .format + }; + case 'pluralFormat': + return new PluralFormat(id, format.ordinal, format.offset, this.compileOptions(element), locales); + case 'selectFormat': + return new SelectFormat(id, this.compileOptions(element)); + default: + throw new Error('Message element does not have a valid format type'); + } + }; + Compiler.prototype.compileOptions = function (element) { + var _this = this; + var format = element.format; + var options = format.options; + // Save the current plural element, if any, then set it to a new value when + // compiling the options sub-patterns. This conforms the spec's algorithm + // for handling `"#"` syntax in message text. + this.pluralStack.push(this.currentPlural); + this.currentPlural = format.type === 'pluralFormat' ? element : null; + var optionsHash = options.reduce(function (all, option) { + // Compile the sub-pattern and save it under the options's selector. + all[option.selector] = _this.compileMessage(option.value); + return all; + }, {}); + // Pop the plural stack to put back the original current plural value. + this.currentPlural = this.pluralStack.pop(); + return optionsHash; + }; + return Compiler; + }()); + // -- Compiler Helper Classes -------------------------------------------------- + var Formatter = /** @class */ (function () { + function Formatter(id) { + this.id = id; + } + return Formatter; + }()); + var StringFormat = /** @class */ (function (_super) { + __extends(StringFormat, _super); + function StringFormat() { + return _super !== null && _super.apply(this, arguments) || this; + } + StringFormat.prototype.format = function (value) { + if (!value && typeof value !== 'number') { + return ''; + } + return typeof value === 'string' ? value : String(value); + }; + return StringFormat; + }(Formatter)); + var PluralFormat = /** @class */ (function () { + function PluralFormat(id, useOrdinal, offset, options, locales) { + this.id = id; + this.offset = offset; + this.options = options; + this.pluralRules = new Intl.PluralRules(locales, { + type: useOrdinal ? 'ordinal' : 'cardinal' + }); + } + PluralFormat.prototype.getOption = function (value) { + var options = this.options; + var option = options['=' + value] || + options[this.pluralRules.select(value - this.offset)]; + return option || options.other; + }; + return PluralFormat; + }()); + var PluralOffsetString = /** @class */ (function (_super) { + __extends(PluralOffsetString, _super); + function PluralOffsetString(id, offset, numberFormat, string) { + var _this = _super.call(this, id) || this; + _this.offset = offset; + _this.numberFormat = numberFormat; + _this.string = string; + return _this; + } + PluralOffsetString.prototype.format = function (value) { + var number = this.numberFormat.format(value - this.offset); + return this.string + .replace(/(^|[^\\])#/g, '$1' + number) + .replace(/\\#/g, '#'); + }; + return PluralOffsetString; + }(Formatter)); + var SelectFormat = /** @class */ (function () { + function SelectFormat(id, options) { + this.id = id; + this.options = options; + } + SelectFormat.prototype.getOption = function (value) { + var options = this.options; + return options[value] || options.other; + }; + return SelectFormat; + }()); + function isSelectOrPluralFormat(f) { + return !!f.options; + } + //# sourceMappingURL=compiler.js.map + + var parser = /* + * Generated by PEG.js 0.10.0. + * + * http://pegjs.org/ + */ + (function() { + + function peg$subclass(child, parent) { + function ctor() { this.constructor = child; } + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function peg$SyntaxError(message, expected, found, location) { + this.message = message; + this.expected = expected; + this.found = found; + this.location = location; + this.name = "SyntaxError"; + + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, peg$SyntaxError); + } + } + + peg$subclass(peg$SyntaxError, Error); + + peg$SyntaxError.buildMessage = function(expected, found) { + var DESCRIBE_EXPECTATION_FNS = { + literal: function(expectation) { + return "\"" + literalEscape(expectation.text) + "\""; + }, + + "class": function(expectation) { + var escapedParts = "", + i; + + for (i = 0; i < expectation.parts.length; i++) { + escapedParts += expectation.parts[i] instanceof Array + ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) + : classEscape(expectation.parts[i]); + } + + return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; + }, + + any: function(expectation) { + return "any character"; + }, + + end: function(expectation) { + return "end of input"; + }, + + other: function(expectation) { + return expectation.description; + } + }; + + function hex(ch) { + return ch.charCodeAt(0).toString(16).toUpperCase(); + } + + function literalEscape(s) { + return s + .replace(/\\/g, '\\\\') + .replace(/"/g, '\\"') + .replace(/\0/g, '\\0') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); + } + + function classEscape(s) { + return s + .replace(/\\/g, '\\\\') + .replace(/\]/g, '\\]') + .replace(/\^/g, '\\^') + .replace(/-/g, '\\-') + .replace(/\0/g, '\\0') + .replace(/\t/g, '\\t') + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/[\x00-\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) + .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x' + hex(ch); }); + } + + function describeExpectation(expectation) { + return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); + } + + function describeExpected(expected) { + var descriptions = new Array(expected.length), + i, j; + + for (i = 0; i < expected.length; i++) { + descriptions[i] = describeExpectation(expected[i]); + } + + descriptions.sort(); + + if (descriptions.length > 0) { + for (i = 1, j = 1; i < descriptions.length; i++) { + if (descriptions[i - 1] !== descriptions[i]) { + descriptions[j] = descriptions[i]; + j++; + } + } + descriptions.length = j; + } + + switch (descriptions.length) { + case 1: + return descriptions[0]; + + case 2: + return descriptions[0] + " or " + descriptions[1]; + + default: + return descriptions.slice(0, -1).join(", ") + + ", or " + + descriptions[descriptions.length - 1]; + } + } + + function describeFound(found) { + return found ? "\"" + literalEscape(found) + "\"" : "end of input"; + } + + return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; + }; + + function peg$parse(input, options) { + options = options !== void 0 ? options : {}; + + var peg$FAILED = {}, + + peg$startRuleFunctions = { start: peg$parsestart }, + peg$startRuleFunction = peg$parsestart, + + peg$c0 = function(elements) { + return { + type : 'messageFormatPattern', + elements: elements, + location: location() + }; + }, + peg$c1 = function(chunks) { + return chunks.reduce(function (all, chunk) { + return all.concat(chunk) + }, []).join('') + }, + peg$c2 = function(messageText) { + return { + type : 'messageTextElement', + value: messageText, + location: location() + }; + }, + peg$c3 = /^[^ \t\n\r,.+={}#]/, + peg$c4 = peg$classExpectation([" ", "\t", "\n", "\r", ",", ".", "+", "=", "{", "}", "#"], true, false), + peg$c5 = "{", + peg$c6 = peg$literalExpectation("{", false), + peg$c7 = ",", + peg$c8 = peg$literalExpectation(",", false), + peg$c9 = "}", + peg$c10 = peg$literalExpectation("}", false), + peg$c11 = function(id, format) { + return { + type : 'argumentElement', + id : id, + format: format && format[2], + location: location() + }; + }, + peg$c12 = "number", + peg$c13 = peg$literalExpectation("number", false), + peg$c14 = "date", + peg$c15 = peg$literalExpectation("date", false), + peg$c16 = "time", + peg$c17 = peg$literalExpectation("time", false), + peg$c18 = function(type, style) { + return { + type : type + 'Format', + style: style && style[2], + location: location() + }; + }, + peg$c19 = "plural", + peg$c20 = peg$literalExpectation("plural", false), + peg$c21 = function(pluralStyle) { + return { + type : pluralStyle.type, + ordinal: false, + offset : pluralStyle.offset || 0, + options: pluralStyle.options, + location: location() + }; + }, + peg$c22 = "selectordinal", + peg$c23 = peg$literalExpectation("selectordinal", false), + peg$c24 = function(pluralStyle) { + return { + type : pluralStyle.type, + ordinal: true, + offset : pluralStyle.offset || 0, + options: pluralStyle.options, + location: location() + } + }, + peg$c25 = "select", + peg$c26 = peg$literalExpectation("select", false), + peg$c27 = function(options) { + return { + type : 'selectFormat', + options: options, + location: location() + }; + }, + peg$c28 = "=", + peg$c29 = peg$literalExpectation("=", false), + peg$c30 = function(selector, pattern) { + return { + type : 'optionalFormatPattern', + selector: selector, + value : pattern, + location: location() + }; + }, + peg$c31 = "offset:", + peg$c32 = peg$literalExpectation("offset:", false), + peg$c33 = function(number) { + return number; + }, + peg$c34 = function(offset, options) { + return { + type : 'pluralFormat', + offset : offset, + options: options, + location: location() + }; + }, + peg$c35 = peg$otherExpectation("whitespace"), + peg$c36 = /^[ \t\n\r]/, + peg$c37 = peg$classExpectation([" ", "\t", "\n", "\r"], false, false), + peg$c38 = peg$otherExpectation("optionalWhitespace"), + peg$c39 = /^[0-9]/, + peg$c40 = peg$classExpectation([["0", "9"]], false, false), + peg$c41 = /^[0-9a-f]/i, + peg$c42 = peg$classExpectation([["0", "9"], ["a", "f"]], false, true), + peg$c43 = "0", + peg$c44 = peg$literalExpectation("0", false), + peg$c45 = /^[1-9]/, + peg$c46 = peg$classExpectation([["1", "9"]], false, false), + peg$c47 = function(digits) { + return parseInt(digits, 10); + }, + peg$c48 = /^[^{}\\\0-\x1F\x7F \t\n\r]/, + peg$c49 = peg$classExpectation(["{", "}", "\\", ["\0", "\x1F"], "\x7F", " ", "\t", "\n", "\r"], true, false), + peg$c50 = "\\\\", + peg$c51 = peg$literalExpectation("\\\\", false), + peg$c52 = function() { return '\\'; }, + peg$c53 = "\\#", + peg$c54 = peg$literalExpectation("\\#", false), + peg$c55 = function() { return '\\#'; }, + peg$c56 = "\\{", + peg$c57 = peg$literalExpectation("\\{", false), + peg$c58 = function() { return '\u007B'; }, + peg$c59 = "\\}", + peg$c60 = peg$literalExpectation("\\}", false), + peg$c61 = function() { return '\u007D'; }, + peg$c62 = "\\u", + peg$c63 = peg$literalExpectation("\\u", false), + peg$c64 = function(digits) { + return String.fromCharCode(parseInt(digits, 16)); + }, + peg$c65 = function(chars) { return chars.join(''); }, + + peg$currPos = 0, + peg$savedPos = 0, + peg$posDetailsCache = [{ line: 1, column: 1 }], + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function location() { + return peg$computeLocation(peg$savedPos, peg$currPos); + } + + function peg$literalExpectation(text, ignoreCase) { + return { type: "literal", text: text, ignoreCase: ignoreCase }; + } + + function peg$classExpectation(parts, inverted, ignoreCase) { + return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase }; + } + + function peg$endExpectation() { + return { type: "end" }; + } + + function peg$otherExpectation(description) { + return { type: "other", description: description }; + } + + function peg$computePosDetails(pos) { + var details = peg$posDetailsCache[pos], p; + + if (details) { + return details; + } else { + p = pos - 1; + while (!peg$posDetailsCache[p]) { + p--; + } + + details = peg$posDetailsCache[p]; + details = { + line: details.line, + column: details.column + }; + + while (p < pos) { + if (input.charCodeAt(p) === 10) { + details.line++; + details.column = 1; + } else { + details.column++; + } + + p++; + } + + peg$posDetailsCache[pos] = details; + return details; + } + } + + function peg$computeLocation(startPos, endPos) { + var startPosDetails = peg$computePosDetails(startPos), + endPosDetails = peg$computePosDetails(endPos); + + return { + start: { + offset: startPos, + line: startPosDetails.line, + column: startPosDetails.column + }, + end: { + offset: endPos, + line: endPosDetails.line, + column: endPosDetails.column + } + }; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { return; } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$buildStructuredError(expected, found, location) { + return new peg$SyntaxError( + peg$SyntaxError.buildMessage(expected, found), + expected, + found, + location + ); + } + + function peg$parsestart() { + var s0; + + s0 = peg$parsemessageFormatPattern(); + + return s0; + } + + function peg$parsemessageFormatPattern() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsemessageFormatElement(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsemessageFormatElement(); + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c0(s1); + } + s0 = s1; + + return s0; + } + + function peg$parsemessageFormatElement() { + var s0; + + s0 = peg$parsemessageTextElement(); + if (s0 === peg$FAILED) { + s0 = peg$parseargumentElement(); + } + + return s0; + } + + function peg$parsemessageText() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + s1 = []; + s2 = peg$currPos; + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s4 = peg$parsechars(); + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$currPos; + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + s4 = peg$parsechars(); + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s3 = [s3, s4, s5]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } + } else { + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c1(s1); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsews(); + if (s1 !== peg$FAILED) { + s0 = input.substring(s0, peg$currPos); + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parsemessageTextElement() { + var s0, s1; + + s0 = peg$currPos; + s1 = peg$parsemessageText(); + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c2(s1); + } + s0 = s1; + + return s0; + } + + function peg$parseargument() { + var s0, s1, s2; + + s0 = peg$parsenumber(); + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = []; + if (peg$c3.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + if (peg$c3.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c4); } + } + } + } else { + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + s0 = input.substring(s0, peg$currPos); + } else { + s0 = s1; + } + } + + return s0; + } + + function peg$parseargumentElement() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 123) { + s1 = peg$c5; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c6); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parseargument(); + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 44) { + s6 = peg$c7; + peg$currPos++; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + if (s6 !== peg$FAILED) { + s7 = peg$parse_(); + if (s7 !== peg$FAILED) { + s8 = peg$parseelementFormat(); + if (s8 !== peg$FAILED) { + s6 = [s6, s7, s8]; + s5 = s6; + } else { + peg$currPos = s5; + s5 = peg$FAILED; + } + } else { + peg$currPos = s5; + s5 = peg$FAILED; + } + } else { + peg$currPos = s5; + s5 = peg$FAILED; + } + if (s5 === peg$FAILED) { + s5 = null; + } + if (s5 !== peg$FAILED) { + s6 = peg$parse_(); + if (s6 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 125) { + s7 = peg$c9; + peg$currPos++; + } else { + s7 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + if (s7 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c11(s3, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseelementFormat() { + var s0; + + s0 = peg$parsesimpleFormat(); + if (s0 === peg$FAILED) { + s0 = peg$parsepluralFormat(); + if (s0 === peg$FAILED) { + s0 = peg$parseselectOrdinalFormat(); + if (s0 === peg$FAILED) { + s0 = peg$parseselectFormat(); + } + } + } + + return s0; + } + + function peg$parsesimpleFormat() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 6) === peg$c12) { + s1 = peg$c12; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c13); } + } + if (s1 === peg$FAILED) { + if (input.substr(peg$currPos, 4) === peg$c14) { + s1 = peg$c14; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c15); } + } + if (s1 === peg$FAILED) { + if (input.substr(peg$currPos, 4) === peg$c16) { + s1 = peg$c16; + peg$currPos += 4; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c17); } + } + } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 44) { + s4 = peg$c7; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parse_(); + if (s5 !== peg$FAILED) { + s6 = peg$parsechars(); + if (s6 !== peg$FAILED) { + s4 = [s4, s5, s6]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + if (s3 === peg$FAILED) { + s3 = null; + } + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c18(s1, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsepluralFormat() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 6) === peg$c19) { + s1 = peg$c19; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c20); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s3 = peg$c7; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parsepluralStyle(); + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c21(s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseselectOrdinalFormat() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 13) === peg$c22) { + s1 = peg$c22; + peg$currPos += 13; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c23); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s3 = peg$c7; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = peg$parsepluralStyle(); + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c24(s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseselectFormat() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 6) === peg$c25) { + s1 = peg$c25; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c26); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 44) { + s3 = peg$c7; + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c8); } + } + if (s3 !== peg$FAILED) { + s4 = peg$parse_(); + if (s4 !== peg$FAILED) { + s5 = []; + s6 = peg$parseoptionalFormatPattern(); + if (s6 !== peg$FAILED) { + while (s6 !== peg$FAILED) { + s5.push(s6); + s6 = peg$parseoptionalFormatPattern(); + } + } else { + s5 = peg$FAILED; + } + if (s5 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c27(s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseselector() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + s1 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 61) { + s2 = peg$c28; + peg$currPos++; + } else { + s2 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c29); } + } + if (s2 !== peg$FAILED) { + s3 = peg$parsenumber(); + if (s3 !== peg$FAILED) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + s0 = input.substring(s0, peg$currPos); + } else { + s0 = s1; + } + if (s0 === peg$FAILED) { + s0 = peg$parsechars(); + } + + return s0; + } + + function peg$parseoptionalFormatPattern() { + var s0, s1, s2, s3, s4, s5, s6; + + s0 = peg$currPos; + s1 = peg$parse_(); + if (s1 !== peg$FAILED) { + s2 = peg$parseselector(); + if (s2 !== peg$FAILED) { + s3 = peg$parse_(); + if (s3 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 123) { + s4 = peg$c5; + peg$currPos++; + } else { + s4 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c6); } + } + if (s4 !== peg$FAILED) { + s5 = peg$parsemessageFormatPattern(); + if (s5 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 125) { + s6 = peg$c9; + peg$currPos++; + } else { + s6 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c10); } + } + if (s6 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c30(s2, s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseoffset() { + var s0, s1, s2, s3; + + s0 = peg$currPos; + if (input.substr(peg$currPos, 7) === peg$c31) { + s1 = peg$c31; + peg$currPos += 7; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c32); } + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = peg$parsenumber(); + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c33(s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsepluralStyle() { + var s0, s1, s2, s3, s4; + + s0 = peg$currPos; + s1 = peg$parseoffset(); + if (s1 === peg$FAILED) { + s1 = null; + } + if (s1 !== peg$FAILED) { + s2 = peg$parse_(); + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parseoptionalFormatPattern(); + if (s4 !== peg$FAILED) { + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parseoptionalFormatPattern(); + } + } else { + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c34(s1, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsews() { + var s0, s1; + + peg$silentFails++; + s0 = []; + if (peg$c36.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c37); } + } + if (s1 !== peg$FAILED) { + while (s1 !== peg$FAILED) { + s0.push(s1); + if (peg$c36.test(input.charAt(peg$currPos))) { + s1 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c37); } + } + } + } else { + s0 = peg$FAILED; + } + peg$silentFails--; + if (s0 === peg$FAILED) { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c35); } + } + + return s0; + } + + function peg$parse_() { + var s0, s1, s2; + + peg$silentFails++; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsews(); + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsews(); + } + if (s1 !== peg$FAILED) { + s0 = input.substring(s0, peg$currPos); + } else { + s0 = s1; + } + peg$silentFails--; + if (s0 === peg$FAILED) { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c38); } + } + + return s0; + } + + function peg$parsedigit() { + var s0; + + if (peg$c39.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c40); } + } + + return s0; + } + + function peg$parsehexDigit() { + var s0; + + if (peg$c41.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c42); } + } + + return s0; + } + + function peg$parsenumber() { + var s0, s1, s2, s3, s4, s5; + + s0 = peg$currPos; + if (input.charCodeAt(peg$currPos) === 48) { + s1 = peg$c43; + peg$currPos++; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c44); } + } + if (s1 === peg$FAILED) { + s1 = peg$currPos; + s2 = peg$currPos; + if (peg$c45.test(input.charAt(peg$currPos))) { + s3 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s3 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c46); } + } + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parsedigit(); + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parsedigit(); + } + if (s4 !== peg$FAILED) { + s3 = [s3, s4]; + s2 = s3; + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + } else { + peg$currPos = s2; + s2 = peg$FAILED; + } + if (s2 !== peg$FAILED) { + s1 = input.substring(s1, peg$currPos); + } else { + s1 = s2; + } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c47(s1); + } + s0 = s1; + + return s0; + } + + function peg$parsechar() { + var s0, s1, s2, s3, s4, s5, s6, s7; + + if (peg$c48.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c49); } + } + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c50) { + s1 = peg$c50; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c51); } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c52(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c53) { + s1 = peg$c53; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c54); } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c55(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c56) { + s1 = peg$c56; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c57); } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c58(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c59) { + s1 = peg$c59; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c60); } + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c61(); + } + s0 = s1; + if (s0 === peg$FAILED) { + s0 = peg$currPos; + if (input.substr(peg$currPos, 2) === peg$c62) { + s1 = peg$c62; + peg$currPos += 2; + } else { + s1 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c63); } + } + if (s1 !== peg$FAILED) { + s2 = peg$currPos; + s3 = peg$currPos; + s4 = peg$parsehexDigit(); + if (s4 !== peg$FAILED) { + s5 = peg$parsehexDigit(); + if (s5 !== peg$FAILED) { + s6 = peg$parsehexDigit(); + if (s6 !== peg$FAILED) { + s7 = peg$parsehexDigit(); + if (s7 !== peg$FAILED) { + s4 = [s4, s5, s6, s7]; + s3 = s4; + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + } else { + peg$currPos = s3; + s3 = peg$FAILED; + } + if (s3 !== peg$FAILED) { + s2 = input.substring(s2, peg$currPos); + } else { + s2 = s3; + } + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c64(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + } + } + } + } + + return s0; + } + + function peg$parsechars() { + var s0, s1, s2; + + s0 = peg$currPos; + s1 = []; + s2 = peg$parsechar(); + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsechar(); + } + } else { + s1 = peg$FAILED; + } + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c65(s1); + } + s0 = s1; + + return s0; + } + + peg$result = peg$startRuleFunction(); + + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail(peg$endExpectation()); + } + + throw peg$buildStructuredError( + peg$maxFailExpected, + peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, + peg$maxFailPos < input.length + ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) + : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) + ); + } + } + + return { + SyntaxError: peg$SyntaxError, + parse: peg$parse + }; + })(); + + /* + Copyright (c) 2014, Yahoo! Inc. All rights reserved. + Copyrights licensed under the New BSD License. + See the accompanying LICENSE file for terms. + */ + var __extends$1 = (undefined && undefined.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); + var __assign = (undefined && undefined.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + // -- MessageFormat -------------------------------------------------------- + function resolveLocale(locales) { + if (typeof locales === 'string') { + locales = [locales]; + } + try { + return Intl.NumberFormat.supportedLocalesOf(locales, { + // IE11 localeMatcher `lookup` seems to convert `en` -> `en-US` + // but not other browsers, + localeMatcher: 'best fit' + })[0]; + } + catch (e) { + return MessageFormat.defaultLocale; + } + } + function formatPatterns(pattern, values) { + var result = ''; + for (var _i = 0, pattern_1 = pattern; _i < pattern_1.length; _i++) { + var part = pattern_1[_i]; + // Exist early for string parts. + if (typeof part === 'string') { + result += part; + continue; + } + var id = part.id; + // Enforce that all required values are provided by the caller. + if (!(values && id in values)) { + throw new FormatError("A value must be provided for: " + id, id); + } + var value = values[id]; + // Recursively format plural and select parts' option — which can be a + // nested pattern structure. The choosing of the option to use is + // abstracted-by and delegated-to the part helper object. + if (isSelectOrPluralFormat(part)) { + result += formatPatterns(part.getOption(value), values); + } + else { + result += part.format(value); + } + } + return result; + } + function mergeConfig(c1, c2) { + if (!c2) { + return c1; + } + return __assign({}, (c1 || {}), (c2 || {}), Object.keys(c1).reduce(function (all, k) { + all[k] = __assign({}, c1[k], (c2[k] || {})); + return all; + }, {})); + } + function mergeConfigs(defaultConfig, configs) { + if (!configs) { + return defaultConfig; + } + return Object.keys(defaultConfig).reduce(function (all, k) { + all[k] = mergeConfig(defaultConfig[k], configs[k]); + return all; + }, __assign({}, defaultConfig)); + } + var FormatError = /** @class */ (function (_super) { + __extends$1(FormatError, _super); + function FormatError(msg, variableId) { + var _this = _super.call(this, msg) || this; + _this.variableId = variableId; + return _this; + } + return FormatError; + }(Error)); + var MessageFormat = (function (message, locales, overrideFormats) { + if (locales === void 0) { locales = MessageFormat.defaultLocale; } + // Parse string messages into an AST. + var ast = typeof message === 'string' ? MessageFormat.__parse(message) : message; + if (!(ast && ast.type === 'messageFormatPattern')) { + throw new TypeError('A message must be provided as a String or AST.'); + } + // Creates a new object with the specified `formats` merged with the default + // formats. + var formats = mergeConfigs(MessageFormat.formats, overrideFormats); + // Defined first because it's used to build the format pattern. + var locale = resolveLocale(locales || []); + // Compile the `ast` to a pattern that is highly optimized for repeated + // `format()` invocations. **Note:** This passes the `locales` set provided + // to the constructor instead of just the resolved locale. + var pattern = new Compiler(locales, formats).compile(ast); + // "Bind" `format()` method to `this` so it can be passed by reference like + // the other `Intl` APIs. + return { + format: function (values) { + try { + return formatPatterns(pattern, values); + } + catch (e) { + if (e.variableId) { + throw new Error("The intl string context variable '" + e.variableId + "' was not provided to the string '" + message + "'"); + } + else { + throw e; + } + } + }, + resolvedOptions: function () { + return { locale: locale }; + }, + getAst: function () { + return ast; + } + }; + }); + MessageFormat.defaultLocale = 'en'; + // Default format options used as the prototype of the `formats` provided to the + // constructor. These are used when constructing the internal Intl.NumberFormat + // and Intl.DateTimeFormat instances. + MessageFormat.formats = { + number: { + currency: { + style: 'currency' + }, + percent: { + style: 'percent' + } + }, + 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' + } + } + }; + MessageFormat.__parse = parser.parse; + //# sourceMappingURL=index.js.map + + /** + * @constant DEFAULT_OPTIONS_KEYS the default options keys + */ + var DEFAULT_OPTIONS_KEYS = { + isEqual: true, + isMatchingKey: true, + isPromise: true, + maxSize: true, + onCacheAdd: true, + onCacheChange: true, + onCacheHit: true, + transformKey: true, + }; + /** + * @function slice + * + * @description + * slice.call() pre-bound + */ + var slice = Array.prototype.slice; + /** + * @function cloneArray + * + * @description + * clone the array-like object and return the new array + * + * @param arrayLike the array-like object to clone + * @returns the clone as an array + */ + function cloneArray(arrayLike) { + var length = arrayLike.length; + if (!length) { + return []; + } + if (length === 1) { + return [arrayLike[0]]; + } + if (length === 2) { + return [arrayLike[0], arrayLike[1]]; + } + if (length === 3) { + return [arrayLike[0], arrayLike[1], arrayLike[2]]; + } + return slice.call(arrayLike, 0); + } + /** + * @function getCustomOptions + * + * @description + * get the custom options on the object passed + * + * @param options the memoization options passed + * @returns the custom options passed + */ + function getCustomOptions(options) { + var customOptions = {}; + /* eslint-disable no-restricted-syntax */ + for (var key in options) { + if (!DEFAULT_OPTIONS_KEYS[key]) { + customOptions[key] = options[key]; + } + } + /* eslint-enable */ + return customOptions; + } + /** + * @function isMemoized + * + * @description + * is the function passed already memoized + * + * @param fn the function to test + * @returns is the function already memoized + */ + function isMemoized(fn) { + return (typeof fn === 'function' && + fn.isMemoized); + } + /** + * @function isSameValueZero + * + * @description + * are the objects equal based on SameValueZero equality + * + * @param object1 the first object to compare + * @param object2 the second object to compare + * @returns are the two objects equal + */ + function isSameValueZero(object1, object2) { + // eslint-disable-next-line no-self-compare + return object1 === object2 || (object1 !== object1 && object2 !== object2); + } + /** + * @function mergeOptions + * + * @description + * merge the options into the target + * + * @param existingOptions the options provided + * @param newOptions the options to include + * @returns the merged options + */ + function mergeOptions(existingOptions, newOptions) { + // @ts-ignore + var target = {}; + /* eslint-disable no-restricted-syntax */ + for (var key in existingOptions) { + target[key] = existingOptions[key]; + } + for (var key in newOptions) { + target[key] = newOptions[key]; + } + /* eslint-enable */ + return target; + } + + // utils + var Cache = /** @class */ (function () { + function Cache(options) { + this.keys = []; + this.values = []; + this.options = options; + var isMatchingKeyFunction = typeof options.isMatchingKey === 'function'; + if (isMatchingKeyFunction) { + this.getKeyIndex = this._getKeyIndexFromMatchingKey; + } + else if (options.maxSize > 1) { + this.getKeyIndex = this._getKeyIndexForMany; + } + else { + this.getKeyIndex = this._getKeyIndexForSingle; + } + this.canTransformKey = typeof options.transformKey === 'function'; + this.shouldCloneArguments = this.canTransformKey || isMatchingKeyFunction; + this.shouldUpdateOnAdd = typeof options.onCacheAdd === 'function'; + this.shouldUpdateOnChange = typeof options.onCacheChange === 'function'; + this.shouldUpdateOnHit = typeof options.onCacheHit === 'function'; + } + Object.defineProperty(Cache.prototype, "size", { + get: function () { + return this.keys.length; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Cache.prototype, "snapshot", { + get: function () { + return { + keys: cloneArray(this.keys), + size: this.size, + values: cloneArray(this.values), + }; + }, + enumerable: true, + configurable: true + }); + /** + * @function _getKeyIndexFromMatchingKey + * + * @description + * gets the matching key index when a custom key matcher is used + * + * @param keyToMatch the key to match + * @returns the index of the matching key, or -1 + */ + Cache.prototype._getKeyIndexFromMatchingKey = function (keyToMatch) { + var _a = this.options, isMatchingKey = _a.isMatchingKey, maxSize = _a.maxSize; + var keys = this.keys; + var keysLength = keys.length; + if (!keysLength) { + return -1; + } + if (isMatchingKey(keys[0], keyToMatch)) { + return 0; + } + if (maxSize > 1) { + for (var index = 1; index < keysLength; index++) { + if (isMatchingKey(keys[index], keyToMatch)) { + return index; + } + } + } + return -1; + }; + /** + * @function _getKeyIndexForMany + * + * @description + * gets the matching key index when multiple keys are used + * + * @param keyToMatch the key to match + * @returns the index of the matching key, or -1 + */ + Cache.prototype._getKeyIndexForMany = function (keyToMatch) { + var isEqual = this.options.isEqual; + var keys = this.keys; + var keysLength = keys.length; + if (!keysLength) { + return -1; + } + if (keysLength === 1) { + return this._getKeyIndexForSingle(keyToMatch); + } + var keyLength = keyToMatch.length; + var existingKey; + var argIndex; + if (keyLength > 1) { + for (var index = 0; index < keysLength; index++) { + existingKey = keys[index]; + if (existingKey.length === keyLength) { + argIndex = 0; + for (; argIndex < keyLength; argIndex++) { + if (!isEqual(existingKey[argIndex], keyToMatch[argIndex])) { + break; + } + } + if (argIndex === keyLength) { + return index; + } + } + } + } + else { + for (var index = 0; index < keysLength; index++) { + existingKey = keys[index]; + if (existingKey.length === keyLength && + isEqual(existingKey[0], keyToMatch[0])) { + return index; + } + } + } + return -1; + }; + /** + * @function _getKeyIndexForSingle + * + * @description + * gets the matching key index when a single key is used + * + * @param keyToMatch the key to match + * @returns the index of the matching key, or -1 + */ + Cache.prototype._getKeyIndexForSingle = function (keyToMatch) { + var keys = this.keys; + if (!keys.length) { + return -1; + } + var existingKey = keys[0]; + var length = existingKey.length; + if (keyToMatch.length !== length) { + return -1; + } + var isEqual = this.options.isEqual; + if (length > 1) { + for (var index = 0; index < length; index++) { + if (!isEqual(existingKey[index], keyToMatch[index])) { + return -1; + } + } + return 0; + } + return isEqual(existingKey[0], keyToMatch[0]) ? 0 : -1; + }; + /** + * @function orderByLru + * + * @description + * order the array based on a Least-Recently-Used basis + * + * @param key the new key to move to the front + * @param value the new value to move to the front + * @param startingIndex the index of the item to move to the front + */ + Cache.prototype.orderByLru = function (key, value, startingIndex) { + var keys = this.keys; + var values = this.values; + var currentLength = keys.length; + var index = startingIndex; + while (index--) { + keys[index + 1] = keys[index]; + values[index + 1] = values[index]; + } + keys[0] = key; + values[0] = value; + var maxSize = this.options.maxSize; + if (currentLength === maxSize && startingIndex === currentLength) { + keys.pop(); + values.pop(); + } + else if (startingIndex >= maxSize) { + // eslint-disable-next-line no-multi-assign + keys.length = values.length = maxSize; + } + }; + /** + * @function updateAsyncCache + * + * @description + * update the promise method to auto-remove from cache if rejected, and + * if resolved then fire cache hit / changed + * + * @param memoized the memoized function + */ + Cache.prototype.updateAsyncCache = function (memoized) { + var _this = this; + var _a = this.options, onCacheChange = _a.onCacheChange, onCacheHit = _a.onCacheHit; + var firstKey = this.keys[0]; + var firstValue = this.values[0]; + this.values[0] = firstValue.then(function (value) { + if (_this.shouldUpdateOnHit) { + onCacheHit(_this, _this.options, memoized); + } + if (_this.shouldUpdateOnChange) { + onCacheChange(_this, _this.options, memoized); + } + return value; + }, function (error) { + var keyIndex = _this.getKeyIndex(firstKey); + if (keyIndex !== -1) { + _this.keys.splice(keyIndex, 1); + _this.values.splice(keyIndex, 1); + } + throw error; + }); + }; + return Cache; + }()); + + // cache + function createMemoizedFunction(fn, options) { + if (options === void 0) { options = {}; } + if (isMemoized(fn)) { + return createMemoizedFunction(fn.fn, mergeOptions(fn.options, options)); + } + if (typeof fn !== 'function') { + throw new TypeError('You must pass a function to `memoize`.'); + } + var _a = options.isEqual, isEqual = _a === void 0 ? isSameValueZero : _a, isMatchingKey = options.isMatchingKey, _b = options.isPromise, isPromise = _b === void 0 ? false : _b, _c = options.maxSize, maxSize = _c === void 0 ? 1 : _c, onCacheAdd = options.onCacheAdd, onCacheChange = options.onCacheChange, onCacheHit = options.onCacheHit, transformKey = options.transformKey; + var normalizedOptions = mergeOptions({ + isEqual: isEqual, + isMatchingKey: isMatchingKey, + isPromise: isPromise, + maxSize: maxSize, + onCacheAdd: onCacheAdd, + onCacheChange: onCacheChange, + onCacheHit: onCacheHit, + transformKey: transformKey, + }, getCustomOptions(options)); + var cache = new Cache(normalizedOptions); + var keys = cache.keys, values = cache.values, canTransformKey = cache.canTransformKey, shouldCloneArguments = cache.shouldCloneArguments, shouldUpdateOnAdd = cache.shouldUpdateOnAdd, shouldUpdateOnChange = cache.shouldUpdateOnChange, shouldUpdateOnHit = cache.shouldUpdateOnHit; + // @ts-ignore + var memoized = function memoized() { + // @ts-ignore + var key = shouldCloneArguments + ? cloneArray(arguments) + : arguments; + if (canTransformKey) { + key = transformKey(key); + } + var keyIndex = keys.length ? cache.getKeyIndex(key) : -1; + if (keyIndex !== -1) { + if (shouldUpdateOnHit) { + onCacheHit(cache, normalizedOptions, memoized); + } + if (keyIndex) { + cache.orderByLru(keys[keyIndex], values[keyIndex], keyIndex); + if (shouldUpdateOnChange) { + onCacheChange(cache, normalizedOptions, memoized); + } + } + } + else { + var newValue = fn.apply(this, arguments); + var newKey = shouldCloneArguments + ? key + : cloneArray(arguments); + cache.orderByLru(newKey, newValue, keys.length); + if (isPromise) { + cache.updateAsyncCache(memoized); + } + if (shouldUpdateOnAdd) { + onCacheAdd(cache, normalizedOptions, memoized); + } + if (shouldUpdateOnChange) { + onCacheChange(cache, normalizedOptions, memoized); + } + } + return values[0]; + }; + memoized.cache = cache; + memoized.fn = fn; + memoized.isMemoized = true; + memoized.options = normalizedOptions; + return memoized; + } + //# sourceMappingURL=micro-memoize.esm.js.map + + const s=({navigator:t,hash:e,search:o,fallback:r}={})=>{let n;const s=(t,e)=>{const o=t.substr(1).split("&").find(t=>0===t.indexOf(e));if(o)return o.split("=").pop()};return "undefined"!=typeof window&&(t&&(n=window.navigator.language||window.navigator.languages[0]),o&&(n=s(window.location.search,o)),e&&(n=s(window.location.hash,e))),n||r};let a,i;const c=createMemoizedFunction((t,e,o)=>new MessageFormat(t,e,o)),l=createMemoizedFunction((t,e)=>i[e][t]||objectResolvePath(i[e],t)),p=(t,e,o=a)=>c(t,o).format(e),f=(t,e,o=a)=>{"string"==typeof e&&(o=e,e=void 0);const r=l(t,o);return r?e?c(r,o).format(e):r:t};f.time=(t,e="short",o)=>p(`{t,time,${e}}`,{t:t},o),f.date=(t,e="short",o)=>p(`{d,date,${e}}`,{d:t},o),f.number=(t,e)=>p("{n,number}",{n:t},e),f.capital=(t,e,o)=>(t=>t.replace(/(^|\s)\S/,t=>t.toUpperCase()))(f(t,e,o)),f.title=(t,e,o)=>(t=>t.replace(/(^|\s)\S/g,t=>t.toUpperCase()))(f(t,e,o)),f.upper=(t,e,o)=>(t=>t.toLocaleUpperCase())(f(t,e,o)),f.lower=(t,e,o)=>(t=>t.toLocaleLowerCase())(f(t,e,o));const m=writable({});m.subscribe(t=>{i=t;});const u=writable({}),d=u.set;u.set=t=>{const e=(t=>{if(i[t])return t;if("string"==typeof t){const e=t.split("-").shift();if(i[e])return e}return null})(t);return e?d(e):(console.warn(`[svelte-i18n] Locale "${t}" not found.`),d(t))},u.update=t=>d(t(a)),u.subscribe(t=>{a=t;});const w=derived([u,m],()=>f); + + // defining a locale dictionary + m.set({ + pt: { + 'switch.lang': 'Trocar idioma', + greeting: { + ask: 'Por favor, digite seu nome', + message: 'Olá {name}, como vai?', + }, + photos: + 'Você {n, plural, =0 {não tem fotos.} =1 {tem uma foto.} other {tem # fotos.}}', + cats: 'Tenho {n, number} {n,plural,=0{gatos}one{gato}other{gatos}}', + }, + en: { + 'switch.lang': 'Switch language', + greeting: { + ask: 'Please type your name', + message: 'Hello {name}, how are you?', + }, + photos: + 'You have {n, plural, =0 {no photos.} =1 {one photo.} other {# photos.}}', + cats: 'I have {n, number} {n,plural,one{cat}other{cats}}', + }, + }); + + u.set( + s({ + navigator: true, + hash: 'lang', + fallback: 'pt', + }), + ); + + u.subscribe(l => { + console.log('locale change', l); + }); + + /* src/App.svelte generated by Svelte v3.5.1 */ + + const file = "src/App.svelte"; + + function create_fragment(ctx) { + var t0_value = JSON.stringify(Object.keys(ctx.$dictionary), null, ' '), t0, t1, input0, input0_placeholder_value, t2, br0, t3, h1, t4_value = ctx.$_.title('greeting.message', { name: ctx.name }), t4, t5, br1, t6, input1, t7, h20, t8, t9_value = ctx.$_('photos', { n: ctx.pluralN }), t9, t10, br2, t11, input2, t12, h21, t13, t14_value = ctx.$_('cats', { n: ctx.catsN }), t14, t15, br3, t16, h22, t17, t18_value = ctx.$_.number(ctx.catsN), t18, t19, br4, t20, h23, t21, t22_value = ctx.$_.date(ctx.date, 'short'), t22, t23, br5, t24, h24, t25, t26_value = ctx.$_.time(ctx.date, 'medium'), t26, t27, br6, t28, button, t29_value = ctx.$_('switch.lang', null, ctx.oppositeLocale), t29, dispose; + + return { + c: function create() { + t0 = text(t0_value); + t1 = space(); + input0 = element("input"); + t2 = space(); + br0 = element("br"); + t3 = space(); + h1 = element("h1"); + t4 = text(t4_value); + t5 = space(); + br1 = element("br"); + t6 = space(); + input1 = element("input"); + t7 = space(); + h20 = element("h2"); + t8 = text("Plural: "); + t9 = text(t9_value); + t10 = space(); + br2 = element("br"); + t11 = space(); + input2 = element("input"); + t12 = space(); + h21 = element("h2"); + t13 = text("Number: "); + t14 = text(t14_value); + t15 = space(); + br3 = element("br"); + t16 = space(); + h22 = element("h2"); + t17 = text("Number util: "); + t18 = text(t18_value); + t19 = space(); + br4 = element("br"); + t20 = space(); + h23 = element("h2"); + t21 = text("Date util: "); + t22 = text(t22_value); + t23 = space(); + br5 = element("br"); + t24 = space(); + h24 = element("h2"); + t25 = text("Time util: "); + t26 = text(t26_value); + t27 = space(); + br6 = element("br"); + t28 = space(); + button = element("button"); + t29 = text(t29_value); + input0.className = "w-100"; + attr(input0, "type", "text"); + input0.placeholder = input0_placeholder_value = ctx.$_('greeting.ask'); + add_location(input0, file, 17, 0, 318); + add_location(br0, file, 22, 0, 413); + add_location(h1, file, 24, 0, 421); + add_location(br1, file, 26, 0, 472); + attr(input1, "type", "range"); + input1.min = "0"; + input1.max = "5"; + input1.step = "1"; + add_location(input1, file, 27, 0, 479); + add_location(h20, file, 28, 0, 548); + add_location(br2, file, 30, 0, 597); + attr(input2, "type", "range"); + input2.min = "100"; + input2.max = "100000000"; + input2.step = "10000"; + add_location(input2, file, 31, 0, 604); + add_location(h21, file, 32, 0, 685); + add_location(br3, file, 34, 0, 730); + add_location(h22, file, 35, 0, 737); + add_location(br4, file, 37, 0, 779); + add_location(h23, file, 38, 0, 786); + add_location(br5, file, 40, 0, 832); + add_location(h24, file, 41, 0, 839); + add_location(br6, file, 43, 0, 886); + add_location(button, file, 44, 0, 893); + + dispose = [ + listen(input0, "input", ctx.input0_input_handler), + listen(input1, "change", ctx.input1_change_input_handler), + listen(input1, "input", ctx.input1_change_input_handler), + listen(input2, "change", ctx.input2_change_input_handler), + listen(input2, "input", ctx.input2_change_input_handler), + listen(button, "click", ctx.click_handler) + ]; + }, + + l: function claim(nodes) { + throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option"); + }, + + m: function mount(target, anchor) { + insert(target, t0, anchor); + insert(target, t1, anchor); + insert(target, input0, anchor); + + input0.value = ctx.name; + + insert(target, t2, anchor); + insert(target, br0, anchor); + insert(target, t3, anchor); + insert(target, h1, anchor); + append(h1, t4); + insert(target, t5, anchor); + insert(target, br1, anchor); + insert(target, t6, anchor); + insert(target, input1, anchor); + + input1.value = ctx.pluralN; + + insert(target, t7, anchor); + insert(target, h20, anchor); + append(h20, t8); + append(h20, t9); + insert(target, t10, anchor); + insert(target, br2, anchor); + insert(target, t11, anchor); + insert(target, input2, anchor); + + input2.value = ctx.catsN; + + insert(target, t12, anchor); + insert(target, h21, anchor); + append(h21, t13); + append(h21, t14); + insert(target, t15, anchor); + insert(target, br3, anchor); + insert(target, t16, anchor); + insert(target, h22, anchor); + append(h22, t17); + append(h22, t18); + insert(target, t19, anchor); + insert(target, br4, anchor); + insert(target, t20, anchor); + insert(target, h23, anchor); + append(h23, t21); + append(h23, t22); + insert(target, t23, anchor); + insert(target, br5, anchor); + insert(target, t24, anchor); + insert(target, h24, anchor); + append(h24, t25); + append(h24, t26); + insert(target, t27, anchor); + insert(target, br6, anchor); + insert(target, t28, anchor); + insert(target, button, anchor); + append(button, t29); + }, + + p: function update(changed, ctx) { + if ((changed.$dictionary) && t0_value !== (t0_value = JSON.stringify(Object.keys(ctx.$dictionary), null, ' '))) { + set_data(t0, t0_value); + } + + if (changed.name && (input0.value !== ctx.name)) input0.value = ctx.name; + + if ((changed.$_) && input0_placeholder_value !== (input0_placeholder_value = ctx.$_('greeting.ask'))) { + input0.placeholder = input0_placeholder_value; + } + + if ((changed.$_ || changed.name) && t4_value !== (t4_value = ctx.$_.title('greeting.message', { name: ctx.name }))) { + set_data(t4, t4_value); + } + + if (changed.pluralN) input1.value = ctx.pluralN; + + if ((changed.$_ || changed.pluralN) && t9_value !== (t9_value = ctx.$_('photos', { n: ctx.pluralN }))) { + set_data(t9, t9_value); + } + + if (changed.catsN) input2.value = ctx.catsN; + + if ((changed.$_ || changed.catsN) && t14_value !== (t14_value = ctx.$_('cats', { n: ctx.catsN }))) { + set_data(t14, t14_value); + } + + if ((changed.$_ || changed.catsN) && t18_value !== (t18_value = ctx.$_.number(ctx.catsN))) { + set_data(t18, t18_value); + } + + if ((changed.$_ || changed.date) && t22_value !== (t22_value = ctx.$_.date(ctx.date, 'short'))) { + set_data(t22, t22_value); + } + + if ((changed.$_ || changed.date) && t26_value !== (t26_value = ctx.$_.time(ctx.date, 'medium'))) { + set_data(t26, t26_value); + } + + if ((changed.$_ || changed.oppositeLocale) && t29_value !== (t29_value = ctx.$_('switch.lang', null, ctx.oppositeLocale))) { + set_data(t29, t29_value); + } + }, + + i: noop, + o: noop, + + d: function destroy(detaching) { + if (detaching) { + detach(t0); + detach(t1); + detach(input0); + detach(t2); + detach(br0); + detach(t3); + detach(h1); + detach(t5); + detach(br1); + detach(t6); + detach(input1); + detach(t7); + detach(h20); + detach(t10); + detach(br2); + detach(t11); + detach(input2); + detach(t12); + detach(h21); + detach(t15); + detach(br3); + detach(t16); + detach(h22); + detach(t19); + detach(br4); + detach(t20); + detach(h23); + detach(t23); + detach(br5); + detach(t24); + detach(h24); + detach(t27); + detach(br6); + detach(t28); + detach(button); + } + + run_all(dispose); + } + }; + } + + function instance($$self, $$props, $$invalidate) { + let $locale, $dictionary, $_; + + validate_store(u, 'locale'); + subscribe($$self, u, $$value => { $locale = $$value; $$invalidate('$locale', $locale); }); + validate_store(m, 'dictionary'); + subscribe($$self, m, $$value => { $dictionary = $$value; $$invalidate('$dictionary', $dictionary); }); + validate_store(w, '_'); + subscribe($$self, w, $$value => { $_ = $$value; $$invalidate('$_', $_); }); + + let name = ''; + let pluralN = 2; + let catsN = 992301; + let date = new Date(); + + setInterval(() => { + $$invalidate('date', date = new Date()); + }, 1000); + + function input0_input_handler() { + name = this.value; + $$invalidate('name', name); + } + + function input1_change_input_handler() { + pluralN = to_number(this.value); + $$invalidate('pluralN', pluralN); + } + + function input2_change_input_handler() { + catsN = to_number(this.value); + $$invalidate('catsN', catsN); + } + + function click_handler() { + return u.set(oppositeLocale); + } + + let oppositeLocale; + + $$self.$$.update = ($$dirty = { $locale: 1 }) => { + if ($$dirty.$locale) { $$invalidate('oppositeLocale', oppositeLocale = $locale === 'pt' ? 'en' : 'pt'); } + }; + + return { + name, + pluralN, + catsN, + date, + oppositeLocale, + $dictionary, + $_, + input0_input_handler, + input1_change_input_handler, + input2_change_input_handler, + click_handler + }; + } + + class App extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, instance, create_fragment, safe_not_equal, []); + } + } + + const app = new App({ + target: document.body, + props: { name: 'world' }, + }); + + return app; + +}()); +//# sourceMappingURL=bundle.js.map diff --git a/example/public/global.css b/example/public/global.css deleted file mode 100644 index 9d682a3..0000000 --- a/example/public/global.css +++ /dev/null @@ -1,61 +0,0 @@ -html, body { - position: relative; - width: 100%; - height: 100%; -} - -body { - color: #333; - margin: 0; - padding: 8px; - box-sizing: border-box; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; -} - -a { - color: rgb(0,100,200); - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - -a:visited { - color: rgb(0,80,160); -} - -label { - display: block; -} - -input, button, select, textarea { - font-family: inherit; - font-size: inherit; - padding: 0.4em; - margin: 0 0 0.5em 0; - box-sizing: border-box; - border: 1px solid #ccc; - border-radius: 2px; -} - -input:disabled { - color: #ccc; -} - -input[type="range"] { - height: 0; -} - -button { - background-color: #f4f4f4; - outline: none; -} - -button:active { - background-color: #ddd; -} - -button:focus { - border-color: #666; -} \ No newline at end of file diff --git a/example/public/index.html b/example/public/index.html deleted file mode 100644 index 5f7729a..0000000 --- a/example/public/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - Svelte app - - - - - - - - - - - diff --git a/example/rollup.config.js b/example/rollup.config.js index a3174d4..e977918 100644 --- a/example/rollup.config.js +++ b/example/rollup.config.js @@ -1,44 +1,118 @@ -import svelte from 'rollup-plugin-svelte' import resolve from 'rollup-plugin-node-resolve' +import replace from '@rollup/plugin-replace' import commonjs from 'rollup-plugin-commonjs' -import livereload from 'rollup-plugin-livereload' +import svelte from 'rollup-plugin-svelte' +import babel from 'rollup-plugin-babel' +import json from 'rollup-plugin-json' import { terser } from 'rollup-plugin-terser' +import config from 'sapper/config/rollup.js' -const production = !process.env.ROLLUP_WATCH +import pkg from './package.json' + +const mode = process.env.NODE_ENV +const dev = mode === 'development' +const legacy = !!process.env.SAPPER_LEGACY_BUILD + +const onwarn = (warning, onwarn) => + (warning.code === 'CIRCULAR_DEPENDENCY' && + /[/\\]@sapper[/\\]/.test(warning.message)) || + onwarn(warning) +const dedupe = importee => + importee === 'svelte' || importee.startsWith('svelte/') export default { - input: 'src/main.js', - output: { - sourcemap: true, - format: 'iife', - name: 'app', - file: 'public/bundle.js', + client: { + input: config.client.input(), + output: config.client.output(), + plugins: [ + replace({ + 'process.browser': true, + 'process.env.NODE_ENV': JSON.stringify(mode), + }), + svelte({ + dev, + hydratable: true, + emitCss: true, + }), + resolve({ + browser: true, + dedupe, + }), + commonjs(), + json(), + + legacy && + babel({ + extensions: ['.js', '.mjs', '.html', '.svelte'], + runtimeHelpers: true, + exclude: ['node_modules/@babel/**'], + presets: [ + [ + '@babel/preset-env', + { + targets: '> 0.25%, not dead', + }, + ], + ], + plugins: [ + '@babel/plugin-syntax-dynamic-import', + [ + '@babel/plugin-transform-runtime', + { + useESModules: true, + }, + ], + ], + }), + + !dev && + terser({ + module: true, + }), + ], + + onwarn, }, - plugins: [ - svelte({ - // enable run-time checks when not in production - dev: !production, - // we'll extract any component CSS out into - // a separate file — better for performance - css: css => { - css.write('public/bundle.css') - }, - }), - // If you have external dependencies installed from - // npm, you'll most likely need these plugins. In - // some cases you'll need additional configuration — - // consult the documentation for details: - // https://github.com/rollup/rollup-plugin-commonjs - resolve(), - commonjs(), + server: { + input: config.server.input(), + output: config.server.output(), + plugins: [ + replace({ + 'process.browser': false, + 'process.env.NODE_ENV': JSON.stringify(mode), + }), + svelte({ + generate: 'ssr', + dev, + }), + resolve({ + dedupe, + }), + commonjs(), + json(), + ], + external: Object.keys(pkg.dependencies).concat( + require('module').builtinModules || + Object.keys(process.binding('natives')), + ), - // Watch the `public` directory and refresh the - // browser on changes when not in production - !production && livereload('public'), + onwarn, + }, - // If we're building for production (npm run build - // instead of npm run dev), minify - production && terser(), - ], + serviceworker: { + input: config.serviceworker.input(), + output: config.serviceworker.output(), + plugins: [ + resolve(), + replace({ + 'process.browser': true, + 'process.env.NODE_ENV': JSON.stringify(mode), + }), + commonjs(), + !dev && terser(), + ], + + onwarn, + }, } diff --git a/example/src/App.svelte b/example/src/App.svelte deleted file mode 100644 index 168b1e8..0000000 --- a/example/src/App.svelte +++ /dev/null @@ -1,46 +0,0 @@ - - - -
- -

{$_.title('greeting.message', { values: { name } })}

- -
- -

Plural: {$_('photos', { values: { n: pluralN } })}

- -
- -

Number: {$_('cats', { values: { n: catsN } })}

- -
-

Number util: {$_.number(catsN)}

-

Number util: {$_.number(10000000, { format: 'compactShort' })}

- -
-

Date util: {$_.date(date, 'short')}

- -
-

Time util: {$_.time(date, 'medium')}

- -
- diff --git a/example/src/client.js b/example/src/client.js new file mode 100644 index 0000000..0845360 --- /dev/null +++ b/example/src/client.js @@ -0,0 +1,7 @@ +import * as sapper from '@sapper/app' + +import './i18n.js' + +sapper.start({ + target: document.querySelector('#sapper'), +}) diff --git a/example/src/components/Nav.svelte b/example/src/components/Nav.svelte new file mode 100644 index 0000000..1892864 --- /dev/null +++ b/example/src/components/Nav.svelte @@ -0,0 +1,60 @@ + + + + + diff --git a/example/src/i18n.js b/example/src/i18n.js index 5b954c6..6c272fc 100644 --- a/example/src/i18n.js +++ b/example/src/i18n.js @@ -1,51 +1,7 @@ -import { - locale, - dictionary, - getClientLocale, - addCustomFormats, -} from '../../src/index.js' +import { dictionary } from 'svelte-i18n' -addCustomFormats({ - number: { - compact: { - notation: 'compact', - compactDisplay: 'long', - }, - }, -}) - -// defining a locale dictionary dictionary.set({ - pt: { - 'switch.lang': 'Trocar idioma', - greeting: { - ask: 'Por favor, digite seu nome', - message: 'Olá {name}, como vai?', - }, - photos: - 'Você {n, plural, =0 {não tem fotos.} =1 {tem uma foto.} other {tem # fotos.}}', - cats: 'Tenho {n, number} {n,plural,=0{gatos}one{gato}other{gatos}}', - }, - en: { - 'switch.lang': 'Switch language', - greeting: { - ask: 'Please type your name', - message: 'Hello {name}, how are you?', - }, - photos: - 'You have {n, plural, =0 {no photos.} =1 {one photo.} other {# photos.}}', - cats: 'I have {n, number} {n,plural,one{cat}other{cats}}', - }, -}) - -locale.set( - getClientLocale({ - navigator: true, - hash: 'lang', - fallback: 'pt', - }), -) - -locale.subscribe(l => { - console.log('locale change', l) + 'pt-BR': () => import('../messages/pt-BR.json'), + 'en-US': () => import('../messages/en-US.json'), + 'es-ES': () => import('../messages/es-ES.json'), }) diff --git a/example/src/main.js b/example/src/main.js deleted file mode 100644 index 13fc3e6..0000000 --- a/example/src/main.js +++ /dev/null @@ -1,9 +0,0 @@ -import './i18n.js' -import App from './App.svelte' - -const app = new App({ - target: document.body, - props: { name: 'world' }, -}) - -export default app diff --git a/example/src/routes/_error.svelte b/example/src/routes/_error.svelte new file mode 100644 index 0000000..320e587 --- /dev/null +++ b/example/src/routes/_error.svelte @@ -0,0 +1,40 @@ + + + + + + {status} + + +

{status}

+ +

{error.message}

+ +{#if dev && error.stack} +
{error.stack}
+{/if} diff --git a/example/src/routes/_layout.svelte b/example/src/routes/_layout.svelte new file mode 100644 index 0000000..c276ca9 --- /dev/null +++ b/example/src/routes/_layout.svelte @@ -0,0 +1,41 @@ + + + + + + +