@inventreedb/ui 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -1
- package/README.md +18 -7
- package/dist/.vite/manifest.json +672 -1
- package/dist/_virtual/errors.js +5 -0
- package/dist/_virtual/errors.js.map +1 -0
- package/dist/_virtual/index.js +6 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/index2.js +5 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/_virtual/jsx-runtime.js +6 -0
- package/dist/_virtual/jsx-runtime.js.map +1 -0
- package/dist/_virtual/jsx-runtime2.js +5 -0
- package/dist/_virtual/jsx-runtime2.js.map +1 -0
- package/dist/_virtual/lexer.js +5 -0
- package/dist/_virtual/lexer.js.map +1 -0
- package/dist/_virtual/moo.js +5 -0
- package/dist/_virtual/moo.js.map +1 -0
- package/dist/_virtual/parser.js +6 -0
- package/dist/_virtual/parser.js.map +1 -0
- package/dist/_virtual/parser2.js +5 -0
- package/dist/_virtual/parser2.js.map +1 -0
- package/dist/_virtual/react-jsx-runtime.development.js +5 -0
- package/dist/_virtual/react-jsx-runtime.development.js.map +1 -0
- package/dist/_virtual/react-jsx-runtime.production.min.js +5 -0
- package/dist/_virtual/react-jsx-runtime.production.min.js.map +1 -0
- package/dist/components/StylishText.d.ts +5 -0
- package/dist/components/StylishText.js +36 -0
- package/dist/components/StylishText.js.map +1 -0
- package/dist/enums/ModelInformation.d.ts +20 -0
- package/dist/enums/ModelInformation.js +590 -0
- package/dist/enums/ModelInformation.js.map +1 -0
- package/dist/functions/Events.d.ts +1 -0
- package/dist/functions/Events.js +10 -0
- package/dist/functions/Events.js.map +1 -0
- package/dist/functions/Navigation.d.ts +8 -0
- package/dist/functions/Navigation.js +46 -0
- package/dist/functions/Navigation.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/node_modules/@lingui/core/dist/index.js +405 -0
- package/dist/node_modules/@lingui/core/dist/index.js.map +1 -0
- package/dist/node_modules/@lingui/message-utils/dist/compileMessage.js +326 -0
- package/dist/node_modules/@lingui/message-utils/dist/compileMessage.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/components/Text/Text.js +94 -0
- package/dist/node_modules/@mantine/core/esm/components/Text/Text.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/components/Text/Text.module.css.js +6 -0
- package/dist/node_modules/@mantine/core/esm/components/Text/Text.module.css.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/components/Text/Text.module.css.mjs.vanilla.css.js +2 -0
- package/dist/node_modules/@mantine/core/esm/components/Text/Text.module.css.mjs.vanilla.css.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/Box.js +83 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/Box.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/get-box-mod/get-box-mod.js +33 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/get-box-mod/get-box-mod.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/get-box-style/get-box-style.js +29 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/get-box-style/get-box-style.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/extract-style-props/extract-style-props.js +123 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/extract-style-props/extract-style-props.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/parse-style-props/parse-style-props.js +88 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/parse-style-props/parse-style-props.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/parse-style-props/sort-media-queries.js +15 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/parse-style-props/sort-media-queries.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/border-resolver/border-resolver.js +21 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/border-resolver/border-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/color-resolver/color-resolver.js +25 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/color-resolver/color-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/font-family-resolver/font-family-resolver.js +17 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/font-family-resolver/font-family-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/font-size-resolver/font-size-resolver.js +23 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/font-size-resolver/font-size-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/identity-resolver/identity-resolver.js +7 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/identity-resolver/identity-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/index.js +23 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/index.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/line-height-resolver/line-height-resolver.js +14 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/line-height-resolver/line-height-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/size-resolver/size-resolver.js +13 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/size-resolver/size-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/spacing-resolver/spacing-resolver.js +21 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/spacing-resolver/spacing-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/style-props-data.js +55 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/style-props-data.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/use-random-classname/use-random-classname.js +9 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/use-random-classname/use-random-classname.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/InlineStyles/InlineStyles.js +19 -0
- package/dist/node_modules/@mantine/core/esm/core/InlineStyles/InlineStyles.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/InlineStyles/css-object-to-string/css-object-to-string.js +14 -0
- package/dist/node_modules/@mantine/core/esm/core/InlineStyles/css-object-to-string/css-object-to-string.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/InlineStyles/styles-to-string/styles-to-string.js +13 -0
- package/dist/node_modules/@mantine/core/esm/core/InlineStyles/styles-to-string/styles-to-string.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/Mantine.context.js +40 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/Mantine.context.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.js +17 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/darken/darken.js +14 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/darken/darken.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-gradient/get-gradient.js +15 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-gradient/get-gradient.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-primary-shade/get-primary-shade.js +13 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-primary-shade/get-primary-shade.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-theme-color/get-theme-color.js +9 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-theme-color/get-theme-color.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/luminance/luminance.js +32 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/luminance/luminance.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/parse-theme-color/parse-theme-color.js +78 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/parse-theme-color/parse-theme-color.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/to-rgba/to-rgba.js +116 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/to-rgba/to-rgba.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/use-props/use-props.js +15 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/use-props/use-props.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/factory/create-polymorphic-component.js +7 -0
- package/dist/node_modules/@mantine/core/esm/core/factory/create-polymorphic-component.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/factory/factory.js +9 -0
- package/dist/node_modules/@mantine/core/esm/core/factory/factory.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/factory/polymorphic-factory.js +18 -0
- package/dist/node_modules/@mantine/core/esm/core/factory/polymorphic-factory.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/create-vars-resolver/create-vars-resolver.js +7 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/create-vars-resolver/create-vars-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-class-name.js +48 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-class-name.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-global-class-names/get-global-class-names.js +17 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-global-class-names/get-global-class-names.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-options-class-names/get-options-class-names.js +19 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-options-class-names/get-options-class-names.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-resolved-class-names/get-resolved-class-names.js +14 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-resolved-class-names/get-resolved-class-names.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-root-class-name/get-root-class-name.js +7 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-root-class-name/get-root-class-name.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-selector-class-name/get-selector-class-name.js +7 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-selector-class-name/get-selector-class-name.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-static-class-names/get-static-class-names.js +15 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-static-class-names/get-static-class-names.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-theme-class-names/get-theme-class-names.js +24 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-theme-class-names/get-theme-class-names.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-variant-class-name/get-variant-class-name.js +12 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-variant-class-name/get-variant-class-name.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/resolve-class-names/resolve-class-names.js +26 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/resolve-class-names/resolve-class-names.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/get-style.js +32 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/get-style.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/get-theme-styles/get-theme-styles.js +24 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/get-theme-styles/get-theme-styles.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-style/resolve-style.js +19 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-style/resolve-style.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-styles/resolve-styles.js +13 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-styles/resolve-styles.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-vars/merge-vars.js +17 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-vars/merge-vars.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-vars/resolve-vars.js +25 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-vars/resolve-vars.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/use-styles.js +70 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/use-styles.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/use-transformed-styles.js +34 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/use-transformed-styles.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/camel-to-kebab-case/camel-to-kebab-case.js +7 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/camel-to-kebab-case/camel-to-kebab-case.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/filter-props/filter-props.js +12 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/filter-props/filter-props.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/get-size/get-size.js +20 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/get-size/get-size.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/is-number-like/is-number-like.js +18 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/is-number-like/is-number-like.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/keys/keys.js +7 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/keys/keys.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/units-converters/rem.js +47 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/units-converters/rem.js.map +1 -0
- package/dist/node_modules/@messageformat/parser/lib/lexer.js +74 -0
- package/dist/node_modules/@messageformat/parser/lib/lexer.js.map +1 -0
- package/dist/node_modules/@messageformat/parser/lib/parser.js +223 -0
- package/dist/node_modules/@messageformat/parser/lib/parser.js.map +1 -0
- package/dist/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/moo/moo.js +539 -0
- package/dist/node_modules/moo/moo.js.map +1 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +891 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js.map +1 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +34 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js.map +1 -0
- package/dist/node_modules/react/jsx-runtime.js +18 -0
- package/dist/node_modules/react/jsx-runtime.js.map +1 -0
- package/dist/node_modules/unraw/dist/errors.js +39 -0
- package/dist/node_modules/unraw/dist/errors.js.map +1 -0
- package/dist/node_modules/unraw/dist/index.js +112 -0
- package/dist/node_modules/unraw/dist/index.js.map +1 -0
- package/dist/types/Icons.d.ts +5 -0
- package/dist/types/Plugins.js +1 -1
- package/lib/components/StylishText.tsx +45 -0
- package/lib/enums/ModelInformation.tsx +279 -0
- package/lib/functions/Events.tsx +6 -0
- package/lib/functions/Navigation.tsx +70 -0
- package/lib/index.ts +9 -0
- package/lib/types/Icons.tsx +9 -0
- package/package.json +4 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { __exports as lexer } from "../../../../_virtual/lexer.js";
|
|
2
|
+
import { __require as requireMoo } from "../../../moo/moo.js";
|
|
3
|
+
var hasRequiredLexer;
|
|
4
|
+
function requireLexer() {
|
|
5
|
+
if (hasRequiredLexer) return lexer;
|
|
6
|
+
hasRequiredLexer = 1;
|
|
7
|
+
(function(exports) {
|
|
8
|
+
var __importDefault = lexer && lexer.__importDefault || function(mod) {
|
|
9
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.lexer = exports.states = void 0;
|
|
13
|
+
const moo_1 = __importDefault(requireMoo());
|
|
14
|
+
exports.states = {
|
|
15
|
+
body: {
|
|
16
|
+
doubleapos: { match: "''", value: () => "'" },
|
|
17
|
+
quoted: {
|
|
18
|
+
lineBreaks: true,
|
|
19
|
+
match: /'[{}#](?:[^]*?[^'])?'(?!')/u,
|
|
20
|
+
value: (src) => src.slice(1, -1).replace(/''/g, "'")
|
|
21
|
+
},
|
|
22
|
+
argument: {
|
|
23
|
+
lineBreaks: true,
|
|
24
|
+
match: /\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,
|
|
25
|
+
push: "arg",
|
|
26
|
+
value: (src) => src.substring(1).trim()
|
|
27
|
+
},
|
|
28
|
+
octothorpe: "#",
|
|
29
|
+
end: { match: "}", pop: 1 },
|
|
30
|
+
content: { lineBreaks: true, match: /[^][^{}#']*/u }
|
|
31
|
+
},
|
|
32
|
+
arg: {
|
|
33
|
+
select: {
|
|
34
|
+
lineBreaks: true,
|
|
35
|
+
match: /,\s*(?:plural|select|selectordinal)\s*,\s*/u,
|
|
36
|
+
next: "select",
|
|
37
|
+
value: (src) => src.split(",")[1].trim()
|
|
38
|
+
},
|
|
39
|
+
"func-args": {
|
|
40
|
+
lineBreaks: true,
|
|
41
|
+
match: /,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,
|
|
42
|
+
next: "body",
|
|
43
|
+
value: (src) => src.split(",")[1].trim()
|
|
44
|
+
},
|
|
45
|
+
"func-simple": {
|
|
46
|
+
lineBreaks: true,
|
|
47
|
+
match: /,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,
|
|
48
|
+
value: (src) => src.substring(1).trim()
|
|
49
|
+
},
|
|
50
|
+
end: { match: "}", pop: 1 }
|
|
51
|
+
},
|
|
52
|
+
select: {
|
|
53
|
+
offset: {
|
|
54
|
+
lineBreaks: true,
|
|
55
|
+
match: /\s*offset\s*:\s*\d+\s*/u,
|
|
56
|
+
value: (src) => src.split(":")[1].trim()
|
|
57
|
+
},
|
|
58
|
+
case: {
|
|
59
|
+
lineBreaks: true,
|
|
60
|
+
match: /\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,
|
|
61
|
+
push: "body",
|
|
62
|
+
value: (src) => src.substring(0, src.indexOf("{")).trim()
|
|
63
|
+
},
|
|
64
|
+
end: { match: /\s*\}/u, pop: 1 }
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
exports.lexer = moo_1.default.states(exports.states);
|
|
68
|
+
})(lexer);
|
|
69
|
+
return lexer;
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
requireLexer as __require
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=lexer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexer.js","sources":["../../../../../node_modules/@messageformat/parser/lib/lexer.js"],"sourcesContent":["\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.lexer = exports.states = void 0;\nconst moo_1 = __importDefault(require(\"moo\"));\nexports.states = {\n body: {\n doubleapos: { match: \"''\", value: () => \"'\" },\n quoted: {\n lineBreaks: true,\n match: /'[{}#](?:[^]*?[^'])?'(?!')/u,\n value: src => src.slice(1, -1).replace(/''/g, \"'\")\n },\n argument: {\n lineBreaks: true,\n match: /\\{\\s*[^\\p{Pat_Syn}\\p{Pat_WS}]+\\s*/u,\n push: 'arg',\n value: src => src.substring(1).trim()\n },\n octothorpe: '#',\n end: { match: '}', pop: 1 },\n content: { lineBreaks: true, match: /[^][^{}#']*/u }\n },\n arg: {\n select: {\n lineBreaks: true,\n match: /,\\s*(?:plural|select|selectordinal)\\s*,\\s*/u,\n next: 'select',\n value: src => src.split(',')[1].trim()\n },\n 'func-args': {\n lineBreaks: true,\n match: /,\\s*[^\\p{Pat_Syn}\\p{Pat_WS}]+\\s*,/u,\n next: 'body',\n value: src => src.split(',')[1].trim()\n },\n 'func-simple': {\n lineBreaks: true,\n match: /,\\s*[^\\p{Pat_Syn}\\p{Pat_WS}]+\\s*/u,\n value: src => src.substring(1).trim()\n },\n end: { match: '}', pop: 1 }\n },\n select: {\n offset: {\n lineBreaks: true,\n match: /\\s*offset\\s*:\\s*\\d+\\s*/u,\n value: src => src.split(':')[1].trim()\n },\n case: {\n lineBreaks: true,\n match: /\\s*(?:=\\d+|[^\\p{Pat_Syn}\\p{Pat_WS}]+)\\s*\\{/u,\n push: 'body',\n value: src => src.substring(0, src.indexOf('{')).trim()\n },\n end: { match: /\\s*\\}/u, pop: 1 }\n }\n};\nexports.lexer = moo_1.default.states(exports.states);\n"],"names":["this","require$$0"],"mappings":";;;;;;;AACA,QAAI,kBAAmBA,SAAQA,MAAK,mBAAoB,SAAU,KAAK;AACnE,aAAQ,OAAO,IAAI,aAAc,MAAM,EAAE,WAAW,IAAK;AAAA,IAC5D;AACD,WAAO,eAAc,SAAU,cAAc,EAAE,OAAO,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AAY;AAAA,UACZ,OAAO;AAAA,UACP,MAAM;AAAA,UACN,OAAO,SAAO,IAAI,UAAU,GAAG,IAAI,QAAQ,GAAG,CAAC,EAAE,KAAI;AAAA,QACxD;AAAA,QACD,KAAK,EAAE,OAAO,UAAU,KAAK,EAAC;AAAA,MACtC;AAAA,IACC;AACD,YAAgB,QAAA,MAAM,QAAQ,OAAO,QAAQ,MAAM;AAAA;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { __exports as parser } from "../../../../_virtual/parser2.js";
|
|
2
|
+
import { __require as requireLexer } from "./lexer.js";
|
|
3
|
+
var hasRequiredParser;
|
|
4
|
+
function requireParser() {
|
|
5
|
+
if (hasRequiredParser) return parser;
|
|
6
|
+
hasRequiredParser = 1;
|
|
7
|
+
Object.defineProperty(parser, "__esModule", { value: true });
|
|
8
|
+
parser.parse = parser.ParseError = void 0;
|
|
9
|
+
const lexer_js_1 = requireLexer();
|
|
10
|
+
const getContext = (lt) => ({
|
|
11
|
+
offset: lt.offset,
|
|
12
|
+
line: lt.line,
|
|
13
|
+
col: lt.col,
|
|
14
|
+
text: lt.text,
|
|
15
|
+
lineBreaks: lt.lineBreaks
|
|
16
|
+
});
|
|
17
|
+
const isSelectType = (type) => type === "plural" || type === "select" || type === "selectordinal";
|
|
18
|
+
function strictArgStyleParam(lt, param) {
|
|
19
|
+
let value = "";
|
|
20
|
+
let text = "";
|
|
21
|
+
for (const p of param) {
|
|
22
|
+
const pText = p.ctx.text;
|
|
23
|
+
text += pText;
|
|
24
|
+
switch (p.type) {
|
|
25
|
+
case "content":
|
|
26
|
+
value += p.value;
|
|
27
|
+
break;
|
|
28
|
+
case "argument":
|
|
29
|
+
case "function":
|
|
30
|
+
case "octothorpe":
|
|
31
|
+
value += pText;
|
|
32
|
+
break;
|
|
33
|
+
default:
|
|
34
|
+
throw new ParseError(lt, `Unsupported part in strict mode function arg style: ${pText}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const c = {
|
|
38
|
+
type: "content",
|
|
39
|
+
value: value.trim(),
|
|
40
|
+
ctx: Object.assign({}, param[0].ctx, { text })
|
|
41
|
+
};
|
|
42
|
+
return [c];
|
|
43
|
+
}
|
|
44
|
+
const strictArgTypes = [
|
|
45
|
+
"number",
|
|
46
|
+
"date",
|
|
47
|
+
"time",
|
|
48
|
+
"spellout",
|
|
49
|
+
"ordinal",
|
|
50
|
+
"duration"
|
|
51
|
+
];
|
|
52
|
+
const defaultPluralKeys = ["zero", "one", "two", "few", "many", "other"];
|
|
53
|
+
class ParseError extends Error {
|
|
54
|
+
/** @internal */
|
|
55
|
+
constructor(lt, msg) {
|
|
56
|
+
super(lexer_js_1.lexer.formatError(lt, msg));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
parser.ParseError = ParseError;
|
|
60
|
+
class Parser {
|
|
61
|
+
constructor(src, opt) {
|
|
62
|
+
var _a, _b, _c, _d;
|
|
63
|
+
this.lexer = lexer_js_1.lexer.reset(src);
|
|
64
|
+
this.cardinalKeys = (_a = opt === null || opt === void 0 ? void 0 : opt.cardinal) !== null && _a !== void 0 ? _a : defaultPluralKeys;
|
|
65
|
+
this.ordinalKeys = (_b = opt === null || opt === void 0 ? void 0 : opt.ordinal) !== null && _b !== void 0 ? _b : defaultPluralKeys;
|
|
66
|
+
this.strict = (_c = opt === null || opt === void 0 ? void 0 : opt.strict) !== null && _c !== void 0 ? _c : false;
|
|
67
|
+
this.strictPluralKeys = (_d = opt === null || opt === void 0 ? void 0 : opt.strictPluralKeys) !== null && _d !== void 0 ? _d : true;
|
|
68
|
+
}
|
|
69
|
+
parse() {
|
|
70
|
+
return this.parseBody(false, true);
|
|
71
|
+
}
|
|
72
|
+
checkSelectKey(lt, type, key) {
|
|
73
|
+
if (key[0] === "=") {
|
|
74
|
+
if (type === "select")
|
|
75
|
+
throw new ParseError(lt, `The case ${key} is not valid with select`);
|
|
76
|
+
} else if (type !== "select") {
|
|
77
|
+
const keys = type === "plural" ? this.cardinalKeys : this.ordinalKeys;
|
|
78
|
+
if (this.strictPluralKeys && keys.length > 0 && !keys.includes(key)) {
|
|
79
|
+
const msg = `The ${type} case ${key} is not valid in this locale`;
|
|
80
|
+
throw new ParseError(lt, msg);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
parseSelect({ value: arg }, inPlural, ctx, type) {
|
|
85
|
+
const sel = { type, arg, cases: [], ctx };
|
|
86
|
+
if (type === "plural" || type === "selectordinal")
|
|
87
|
+
inPlural = true;
|
|
88
|
+
else if (this.strict)
|
|
89
|
+
inPlural = false;
|
|
90
|
+
for (const lt of this.lexer) {
|
|
91
|
+
switch (lt.type) {
|
|
92
|
+
case "offset":
|
|
93
|
+
if (type === "select")
|
|
94
|
+
throw new ParseError(lt, "Unexpected plural offset for select");
|
|
95
|
+
if (sel.cases.length > 0)
|
|
96
|
+
throw new ParseError(lt, "Plural offset must be set before cases");
|
|
97
|
+
sel.pluralOffset = Number(lt.value);
|
|
98
|
+
ctx.text += lt.text;
|
|
99
|
+
ctx.lineBreaks += lt.lineBreaks;
|
|
100
|
+
break;
|
|
101
|
+
case "case": {
|
|
102
|
+
this.checkSelectKey(lt, type, lt.value);
|
|
103
|
+
sel.cases.push({
|
|
104
|
+
key: lt.value,
|
|
105
|
+
tokens: this.parseBody(inPlural),
|
|
106
|
+
ctx: getContext(lt)
|
|
107
|
+
});
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
case "end":
|
|
111
|
+
return sel;
|
|
112
|
+
/* istanbul ignore next: never happens */
|
|
113
|
+
default:
|
|
114
|
+
throw new ParseError(lt, `Unexpected lexer token: ${lt.type}`);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
throw new ParseError(null, "Unexpected message end");
|
|
118
|
+
}
|
|
119
|
+
parseArgToken(lt, inPlural) {
|
|
120
|
+
const ctx = getContext(lt);
|
|
121
|
+
const argType = this.lexer.next();
|
|
122
|
+
if (!argType)
|
|
123
|
+
throw new ParseError(null, "Unexpected message end");
|
|
124
|
+
ctx.text += argType.text;
|
|
125
|
+
ctx.lineBreaks += argType.lineBreaks;
|
|
126
|
+
if (this.strict && (argType.type === "func-simple" || argType.type === "func-args") && !strictArgTypes.includes(argType.value)) {
|
|
127
|
+
const msg = `Invalid strict mode function arg type: ${argType.value}`;
|
|
128
|
+
throw new ParseError(lt, msg);
|
|
129
|
+
}
|
|
130
|
+
switch (argType.type) {
|
|
131
|
+
case "end":
|
|
132
|
+
return { type: "argument", arg: lt.value, ctx };
|
|
133
|
+
case "func-simple": {
|
|
134
|
+
const end = this.lexer.next();
|
|
135
|
+
if (!end)
|
|
136
|
+
throw new ParseError(null, "Unexpected message end");
|
|
137
|
+
if (end.type !== "end")
|
|
138
|
+
throw new ParseError(end, `Unexpected lexer token: ${end.type}`);
|
|
139
|
+
ctx.text += end.text;
|
|
140
|
+
if (isSelectType(argType.value.toLowerCase()))
|
|
141
|
+
throw new ParseError(argType, `Invalid type identifier: ${argType.value}`);
|
|
142
|
+
return {
|
|
143
|
+
type: "function",
|
|
144
|
+
arg: lt.value,
|
|
145
|
+
key: argType.value,
|
|
146
|
+
ctx
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
case "func-args": {
|
|
150
|
+
if (isSelectType(argType.value.toLowerCase())) {
|
|
151
|
+
const msg = `Invalid type identifier: ${argType.value}`;
|
|
152
|
+
throw new ParseError(argType, msg);
|
|
153
|
+
}
|
|
154
|
+
let param = this.parseBody(this.strict ? false : inPlural);
|
|
155
|
+
if (this.strict && param.length > 0)
|
|
156
|
+
param = strictArgStyleParam(lt, param);
|
|
157
|
+
return {
|
|
158
|
+
type: "function",
|
|
159
|
+
arg: lt.value,
|
|
160
|
+
key: argType.value,
|
|
161
|
+
param,
|
|
162
|
+
ctx
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
case "select":
|
|
166
|
+
if (isSelectType(argType.value))
|
|
167
|
+
return this.parseSelect(lt, inPlural, ctx, argType.value);
|
|
168
|
+
else
|
|
169
|
+
throw new ParseError(argType, `Unexpected select type ${argType.value}`);
|
|
170
|
+
/* istanbul ignore next: never happens */
|
|
171
|
+
default:
|
|
172
|
+
throw new ParseError(argType, `Unexpected lexer token: ${argType.type}`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
parseBody(inPlural, atRoot) {
|
|
176
|
+
const tokens = [];
|
|
177
|
+
let content = null;
|
|
178
|
+
for (const lt of this.lexer) {
|
|
179
|
+
if (lt.type === "argument") {
|
|
180
|
+
if (content)
|
|
181
|
+
content = null;
|
|
182
|
+
tokens.push(this.parseArgToken(lt, inPlural));
|
|
183
|
+
} else if (lt.type === "octothorpe" && inPlural) {
|
|
184
|
+
if (content)
|
|
185
|
+
content = null;
|
|
186
|
+
tokens.push({ type: "octothorpe", ctx: getContext(lt) });
|
|
187
|
+
} else if (lt.type === "end" && !atRoot) {
|
|
188
|
+
return tokens;
|
|
189
|
+
} else {
|
|
190
|
+
let value = lt.value;
|
|
191
|
+
if (!inPlural && lt.type === "quoted" && value[0] === "#") {
|
|
192
|
+
if (value.includes("{")) {
|
|
193
|
+
const errMsg = `Unsupported escape pattern: ${value}`;
|
|
194
|
+
throw new ParseError(lt, errMsg);
|
|
195
|
+
}
|
|
196
|
+
value = lt.text;
|
|
197
|
+
}
|
|
198
|
+
if (content) {
|
|
199
|
+
content.value += value;
|
|
200
|
+
content.ctx.text += lt.text;
|
|
201
|
+
content.ctx.lineBreaks += lt.lineBreaks;
|
|
202
|
+
} else {
|
|
203
|
+
content = { type: "content", value, ctx: getContext(lt) };
|
|
204
|
+
tokens.push(content);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (atRoot)
|
|
209
|
+
return tokens;
|
|
210
|
+
throw new ParseError(null, "Unexpected message end");
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
function parse(src, options = {}) {
|
|
214
|
+
const parser2 = new Parser(src, options);
|
|
215
|
+
return parser2.parse();
|
|
216
|
+
}
|
|
217
|
+
parser.parse = parse;
|
|
218
|
+
return parser;
|
|
219
|
+
}
|
|
220
|
+
export {
|
|
221
|
+
requireParser as __require
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sources":["../../../../../node_modules/@messageformat/parser/lib/parser.js"],"sourcesContent":["\"use strict\";\n/**\n * An AST parser for ICU MessageFormat strings\n *\n * @packageDocumentation\n * @example\n * ```\n * import { parse } from '@messageformat/parser\n *\n * parse('So {wow}.')\n * [ { type: 'content', value: 'So ' },\n * { type: 'argument', arg: 'wow' },\n * { type: 'content', value: '.' } ]\n *\n *\n * parse('Such { thing }. { count, selectordinal, one {First} two {Second}' +\n * ' few {Third} other {#th} } word.')\n * [ { type: 'content', value: 'Such ' },\n * { type: 'argument', arg: 'thing' },\n * { type: 'content', value: '. ' },\n * { type: 'selectordinal',\n * arg: 'count',\n * cases: [\n * { key: 'one', tokens: [ { type: 'content', value: 'First' } ] },\n * { key: 'two', tokens: [ { type: 'content', value: 'Second' } ] },\n * { key: 'few', tokens: [ { type: 'content', value: 'Third' } ] },\n * { key: 'other',\n * tokens: [ { type: 'octothorpe' }, { type: 'content', value: 'th' } ] }\n * ] },\n * { type: 'content', value: ' word.' } ]\n *\n *\n * parse('Many{type,select,plural{ numbers}selectordinal{ counting}' +\n * 'select{ choices}other{ some {type}}}.')\n * [ { type: 'content', value: 'Many' },\n * { type: 'select',\n * arg: 'type',\n * cases: [\n * { key: 'plural', tokens: [ { type: 'content', value: 'numbers' } ] },\n * { key: 'selectordinal', tokens: [ { type: 'content', value: 'counting' } ] },\n * { key: 'select', tokens: [ { type: 'content', value: 'choices' } ] },\n * { key: 'other',\n * tokens: [ { type: 'content', value: 'some ' }, { type: 'argument', arg: 'type' } ] }\n * ] },\n * { type: 'content', value: '.' } ]\n *\n *\n * parse('{Such compliance')\n * // ParseError: invalid syntax at line 1 col 7:\n * //\n * // {Such compliance\n * // ^\n *\n *\n * const msg = '{words, plural, zero{No words} one{One word} other{# words}}'\n * parse(msg)\n * [ { type: 'plural',\n * arg: 'words',\n * cases: [\n * { key: 'zero', tokens: [ { type: 'content', value: 'No words' } ] },\n * { key: 'one', tokens: [ { type: 'content', value: 'One word' } ] },\n * { key: 'other',\n * tokens: [ { type: 'octothorpe' }, { type: 'content', value: ' words' } ] }\n * ] } ]\n *\n *\n * parse(msg, { cardinal: [ 'one', 'other' ], ordinal: [ 'one', 'two', 'few', 'other' ] })\n * // ParseError: The plural case zero is not valid in this locale at line 1 col 17:\n * //\n * // {words, plural, zero{\n * // ^\n * ```\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parse = exports.ParseError = void 0;\nconst lexer_js_1 = require(\"./lexer.js\");\nconst getContext = (lt) => ({\n offset: lt.offset,\n line: lt.line,\n col: lt.col,\n text: lt.text,\n lineBreaks: lt.lineBreaks\n});\nconst isSelectType = (type) => type === 'plural' || type === 'select' || type === 'selectordinal';\nfunction strictArgStyleParam(lt, param) {\n let value = '';\n let text = '';\n for (const p of param) {\n const pText = p.ctx.text;\n text += pText;\n switch (p.type) {\n case 'content':\n value += p.value;\n break;\n case 'argument':\n case 'function':\n case 'octothorpe':\n value += pText;\n break;\n default:\n throw new ParseError(lt, `Unsupported part in strict mode function arg style: ${pText}`);\n }\n }\n const c = {\n type: 'content',\n value: value.trim(),\n ctx: Object.assign({}, param[0].ctx, { text })\n };\n return [c];\n}\nconst strictArgTypes = [\n 'number',\n 'date',\n 'time',\n 'spellout',\n 'ordinal',\n 'duration'\n];\nconst defaultPluralKeys = ['zero', 'one', 'two', 'few', 'many', 'other'];\n/**\n * Thrown by {@link parse} on error\n *\n * @public\n */\nclass ParseError extends Error {\n /** @internal */\n constructor(lt, msg) {\n super(lexer_js_1.lexer.formatError(lt, msg));\n }\n}\nexports.ParseError = ParseError;\nclass Parser {\n constructor(src, opt) {\n var _a, _b, _c, _d;\n this.lexer = lexer_js_1.lexer.reset(src);\n this.cardinalKeys = (_a = opt === null || opt === void 0 ? void 0 : opt.cardinal) !== null && _a !== void 0 ? _a : defaultPluralKeys;\n this.ordinalKeys = (_b = opt === null || opt === void 0 ? void 0 : opt.ordinal) !== null && _b !== void 0 ? _b : defaultPluralKeys;\n this.strict = (_c = opt === null || opt === void 0 ? void 0 : opt.strict) !== null && _c !== void 0 ? _c : false;\n this.strictPluralKeys = (_d = opt === null || opt === void 0 ? void 0 : opt.strictPluralKeys) !== null && _d !== void 0 ? _d : true;\n }\n parse() {\n return this.parseBody(false, true);\n }\n checkSelectKey(lt, type, key) {\n if (key[0] === '=') {\n if (type === 'select')\n throw new ParseError(lt, `The case ${key} is not valid with select`);\n }\n else if (type !== 'select') {\n const keys = type === 'plural' ? this.cardinalKeys : this.ordinalKeys;\n if (this.strictPluralKeys && keys.length > 0 && !keys.includes(key)) {\n const msg = `The ${type} case ${key} is not valid in this locale`;\n throw new ParseError(lt, msg);\n }\n }\n }\n parseSelect({ value: arg }, inPlural, ctx, type) {\n const sel = { type, arg, cases: [], ctx };\n if (type === 'plural' || type === 'selectordinal')\n inPlural = true;\n else if (this.strict)\n inPlural = false;\n for (const lt of this.lexer) {\n switch (lt.type) {\n case 'offset':\n if (type === 'select')\n throw new ParseError(lt, 'Unexpected plural offset for select');\n if (sel.cases.length > 0)\n throw new ParseError(lt, 'Plural offset must be set before cases');\n sel.pluralOffset = Number(lt.value);\n ctx.text += lt.text;\n ctx.lineBreaks += lt.lineBreaks;\n break;\n case 'case': {\n this.checkSelectKey(lt, type, lt.value);\n sel.cases.push({\n key: lt.value,\n tokens: this.parseBody(inPlural),\n ctx: getContext(lt)\n });\n break;\n }\n case 'end':\n return sel;\n /* istanbul ignore next: never happens */\n default:\n throw new ParseError(lt, `Unexpected lexer token: ${lt.type}`);\n }\n }\n throw new ParseError(null, 'Unexpected message end');\n }\n parseArgToken(lt, inPlural) {\n const ctx = getContext(lt);\n const argType = this.lexer.next();\n if (!argType)\n throw new ParseError(null, 'Unexpected message end');\n ctx.text += argType.text;\n ctx.lineBreaks += argType.lineBreaks;\n if (this.strict &&\n (argType.type === 'func-simple' || argType.type === 'func-args') &&\n !strictArgTypes.includes(argType.value)) {\n const msg = `Invalid strict mode function arg type: ${argType.value}`;\n throw new ParseError(lt, msg);\n }\n switch (argType.type) {\n case 'end':\n return { type: 'argument', arg: lt.value, ctx };\n case 'func-simple': {\n const end = this.lexer.next();\n if (!end)\n throw new ParseError(null, 'Unexpected message end');\n /* istanbul ignore if: never happens */\n if (end.type !== 'end')\n throw new ParseError(end, `Unexpected lexer token: ${end.type}`);\n ctx.text += end.text;\n if (isSelectType(argType.value.toLowerCase()))\n throw new ParseError(argType, `Invalid type identifier: ${argType.value}`);\n return {\n type: 'function',\n arg: lt.value,\n key: argType.value,\n ctx\n };\n }\n case 'func-args': {\n if (isSelectType(argType.value.toLowerCase())) {\n const msg = `Invalid type identifier: ${argType.value}`;\n throw new ParseError(argType, msg);\n }\n let param = this.parseBody(this.strict ? false : inPlural);\n if (this.strict && param.length > 0)\n param = strictArgStyleParam(lt, param);\n return {\n type: 'function',\n arg: lt.value,\n key: argType.value,\n param,\n ctx\n };\n }\n case 'select':\n /* istanbul ignore else: never happens */\n if (isSelectType(argType.value))\n return this.parseSelect(lt, inPlural, ctx, argType.value);\n else\n throw new ParseError(argType, `Unexpected select type ${argType.value}`);\n /* istanbul ignore next: never happens */\n default:\n throw new ParseError(argType, `Unexpected lexer token: ${argType.type}`);\n }\n }\n parseBody(inPlural, atRoot) {\n const tokens = [];\n let content = null;\n for (const lt of this.lexer) {\n if (lt.type === 'argument') {\n if (content)\n content = null;\n tokens.push(this.parseArgToken(lt, inPlural));\n }\n else if (lt.type === 'octothorpe' && inPlural) {\n if (content)\n content = null;\n tokens.push({ type: 'octothorpe', ctx: getContext(lt) });\n }\n else if (lt.type === 'end' && !atRoot) {\n return tokens;\n }\n else {\n let value = lt.value;\n if (!inPlural && lt.type === 'quoted' && value[0] === '#') {\n if (value.includes('{')) {\n const errMsg = `Unsupported escape pattern: ${value}`;\n throw new ParseError(lt, errMsg);\n }\n value = lt.text;\n }\n if (content) {\n content.value += value;\n content.ctx.text += lt.text;\n content.ctx.lineBreaks += lt.lineBreaks;\n }\n else {\n content = { type: 'content', value, ctx: getContext(lt) };\n tokens.push(content);\n }\n }\n }\n if (atRoot)\n return tokens;\n throw new ParseError(null, 'Unexpected message end');\n }\n}\n/**\n * Parse an input string into an array of tokens\n *\n * @public\n * @remarks\n * The parser only supports the default `DOUBLE_OPTIONAL`\n * {@link http://www.icu-project.org/apiref/icu4c/messagepattern_8h.html#af6e0757e0eb81c980b01ee5d68a9978b | apostrophe mode}.\n */\nfunction parse(src, options = {}) {\n const parser = new Parser(src, options);\n return parser.parse();\n}\nexports.parse = parse;\n"],"names":["require$$0","parser"],"mappings":";;;;;;AAyEA,SAAO,eAAe,QAAS,cAAc,EAAE,OAAO,MAAM;AAC5D,SAAA,QAAgB,OAAA,aAAqB;AACrC,QAAM,aAAaA,aAAqB;AACxC,QAAM,aAAa,CAAC,QAAQ;AAAA,IACxB,QAAQ,GAAG;AAAA,IACX,MAAM,GAAG;AAAA,IACT,KAAK,GAAG;AAAA,IACR,MAAM,GAAG;AAAA,IACT,YAAY,GAAG;AAAA,EACnB;AACA,QAAM,eAAe,CAAC,SAAS,SAAS,YAAY,SAAS,YAAY,SAAS;AAClF,WAAS,oBAAoB,IAAI,OAAO;AACpC,QAAI,QAAQ;AACZ,QAAI,OAAO;AACX,eAAW,KAAK,OAAO;AACnB,YAAM,QAAQ,EAAE,IAAI;AACpB,cAAQ;AACR,cAAQ,EAAE,MAAI;AAAA,QACV,KAAK;AACD,mBAAS,EAAE;AACX;AAAA,QACJ,KAAK;AAAA,QACL,KAAK;AAAA,QACL,KAAK;AACD,mBAAS;AACT;AAAA,QACJ;AACI,gBAAM,IAAI,WAAW,IAAI,uDAAuD,KAAK,EAAE;AAAA,MACvG;AAAA,IACA;AAC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AAI;AACA,eAAO;AACX,YAAM,IAAI,WAAW,MAAM,wBAAwB;AAAA,IAC3D;AAAA,EACA;AASA,WAAS,MAAM,KAAK,UAAU,IAAI;AAC9B,UAAMC,UAAS,IAAI,OAAO,KAAK,OAAO;AACtC,WAAOA,QAAO,MAAO;AAAA,EACzB;AACA,SAAA,QAAgB;;;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function r(e) {
|
|
2
|
+
var t, f, n = "";
|
|
3
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
4
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
5
|
+
var o = e.length;
|
|
6
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
7
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
8
|
+
return n;
|
|
9
|
+
}
|
|
10
|
+
function clsx() {
|
|
11
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
12
|
+
return n;
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
clsx,
|
|
16
|
+
clsx as default
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=clsx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clsx.js","sources":["../../../../node_modules/clsx/dist/clsx.mjs"],"sourcesContent":["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;"],"names":[],"mappings":"AAAA,SAAS,EAAE,GAAE;AAAC,MAAI,GAAE,GAAE,IAAE;AAAG,MAAG,YAAU,OAAO,KAAG,YAAU,OAAO,EAAE,MAAG;AAAA,WAAU,YAAU,OAAO,EAAE,KAAG,MAAM,QAAQ,CAAC,GAAE;AAAC,QAAI,IAAE,EAAE;AAAO,SAAI,IAAE,GAAE,IAAE,GAAE,IAAI,GAAE,CAAC,MAAI,IAAE,EAAE,EAAE,CAAC,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAA,EAAE,MAAM,MAAI,KAAK,EAAE,GAAE,CAAC,MAAI,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;AAAQ,SAAS,OAAM;AAAC,WAAQ,GAAE,GAAE,IAAE,GAAE,IAAE,IAAG,IAAE,UAAU,QAAO,IAAE,GAAE,IAAI,EAAC,IAAE,UAAU,CAAC,OAAK,IAAE,EAAE,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;","x_google_ignoreList":[0]}
|