@dudousxd/nestjs-inertia-vite 1.0.0

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.
@@ -0,0 +1,117 @@
1
+ const __importMetaUrl = require('url').pathToFileURL(__filename).href;
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // src/plugin/plugin.ts
23
+ var plugin_exports = {};
24
+ __export(plugin_exports, {
25
+ InvalidViteConfigException: () => InvalidViteConfigException,
26
+ default: () => nestInertia
27
+ });
28
+ module.exports = __toCommonJS(plugin_exports);
29
+ var import_node_module = require("module");
30
+ var import_node_path = require("path");
31
+ var require2 = (0, import_node_module.createRequire)(__importMetaUrl);
32
+ var InvalidViteConfigException = class extends Error {
33
+ static {
34
+ __name(this, "InvalidViteConfigException");
35
+ }
36
+ constructor(message) {
37
+ super(`[nestjs-inertia-vite] ${message}`);
38
+ this.name = "InvalidViteConfigException";
39
+ }
40
+ };
41
+ function loadFrameworkPlugin(framework) {
42
+ const pkg = framework === "react" ? "@vitejs/plugin-react" : framework === "vue" ? "@vitejs/plugin-vue" : "@sveltejs/vite-plugin-svelte";
43
+ try {
44
+ const mod = require2(pkg);
45
+ const factory = mod.default ?? (framework === "svelte" ? mod.svelte : void 0) ?? mod;
46
+ return factory();
47
+ } catch {
48
+ throw new InvalidViteConfigException(`Plugin "${pkg}" not installed. Run: pnpm add ${pkg}`);
49
+ }
50
+ }
51
+ __name(loadFrameworkPlugin, "loadFrameworkPlugin");
52
+ function nestInertia(options = {}) {
53
+ const frameworkFlags = [
54
+ options.react,
55
+ options.vue,
56
+ options.svelte
57
+ ].filter(Boolean);
58
+ if (frameworkFlags.length !== 1) {
59
+ throw new InvalidViteConfigException("nestInertia requires exactly one framework flag: react, vue, or svelte");
60
+ }
61
+ const defaultRoot = "inertia";
62
+ const alias = {
63
+ "@": (0, import_node_path.resolve)(process.cwd(), options.root ?? defaultRoot),
64
+ ...options.alias ?? {}
65
+ };
66
+ const configurer = {
67
+ name: "nestjs-inertia",
68
+ config: /* @__PURE__ */ __name((userConfig) => {
69
+ const resolvedRoot = options.root ?? defaultRoot;
70
+ const defaultEntry = options.entry ?? options.clientEntry ?? `${resolvedRoot}/app/client.tsx`;
71
+ const buildConfig = {
72
+ manifest: true,
73
+ rollupOptions: {}
74
+ };
75
+ if (!userConfig.build?.outDir) {
76
+ buildConfig.outDir = "dist/inertia/client";
77
+ }
78
+ if (!userConfig.build?.rollupOptions?.input) {
79
+ buildConfig.rollupOptions = {
80
+ input: (0, import_node_path.resolve)(process.cwd(), defaultEntry)
81
+ };
82
+ }
83
+ const result = {
84
+ build: buildConfig,
85
+ resolve: {
86
+ alias
87
+ },
88
+ server: {
89
+ middlewareMode: true,
90
+ hmr: {
91
+ port: 24679
92
+ }
93
+ }
94
+ };
95
+ if (!userConfig.root) {
96
+ result.root = (0, import_node_path.resolve)(process.cwd(), resolvedRoot);
97
+ }
98
+ return result;
99
+ }, "config")
100
+ };
101
+ if (options.skipFrameworkPlugin) {
102
+ return [
103
+ configurer
104
+ ];
105
+ }
106
+ const frameworkPlugin = options.react ? loadFrameworkPlugin("react") : options.vue ? loadFrameworkPlugin("vue") : loadFrameworkPlugin("svelte");
107
+ return [
108
+ configurer,
109
+ frameworkPlugin
110
+ ];
111
+ }
112
+ __name(nestInertia, "nestInertia");
113
+ // Annotate the CommonJS export names for ESM import in node:
114
+ 0 && (module.exports = {
115
+ InvalidViteConfigException
116
+ });
117
+ //# sourceMappingURL=plugin.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/plugin/plugin.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport { resolve } from 'node:path';\nimport type { Plugin, UserConfig } from 'vite';\n\nconst require = createRequire(import.meta.url);\n\nexport interface NestInertiaPluginOptions {\n ssr?: boolean;\n react?: boolean;\n vue?: boolean;\n svelte?: boolean;\n /**\n * When `true`, the nestInertia plugin will skip auto-loading the framework\n * Vite plugin. Use this when the framework plugin (e.g. @sveltejs/vite-plugin-svelte)\n * needs to be added manually in the vite config alongside nestInertia().\n *\n * @default false\n */\n skipFrameworkPlugin?: boolean;\n clientEntry?: string;\n ssrEntry?: string;\n alias?: Record<string, string>;\n root?: string;\n entry?: string;\n}\n\nexport class InvalidViteConfigException extends Error {\n constructor(message: string) {\n super(`[nestjs-inertia-vite] ${message}`);\n this.name = 'InvalidViteConfigException';\n }\n}\n\nfunction loadFrameworkPlugin(framework: 'react' | 'vue' | 'svelte'): Plugin {\n const pkg =\n framework === 'react'\n ? '@vitejs/plugin-react'\n : framework === 'vue'\n ? '@vitejs/plugin-vue'\n : '@sveltejs/vite-plugin-svelte';\n try {\n const mod = require(pkg) as { default?: () => Plugin; svelte?: () => Plugin };\n // @sveltejs/vite-plugin-svelte v3+ exports a named `svelte` export rather than default\n const factory =\n mod.default ??\n (framework === 'svelte' ? mod.svelte : undefined) ??\n (mod as unknown as () => Plugin);\n return (factory as () => Plugin)();\n } catch {\n throw new InvalidViteConfigException(`Plugin \"${pkg}\" not installed. Run: pnpm add ${pkg}`);\n }\n}\n\nexport default function nestInertia(options: NestInertiaPluginOptions = {}): Plugin[] {\n const frameworkFlags = [options.react, options.vue, options.svelte].filter(Boolean);\n if (frameworkFlags.length !== 1) {\n throw new InvalidViteConfigException(\n 'nestInertia requires exactly one framework flag: react, vue, or svelte',\n );\n }\n\n const defaultRoot = 'inertia';\n const alias = {\n '@': resolve(process.cwd(), options.root ?? defaultRoot),\n ...(options.alias ?? {}),\n };\n\n const configurer: Plugin = {\n name: 'nestjs-inertia',\n config: (userConfig: UserConfig): Omit<UserConfig, 'plugins'> => {\n const resolvedRoot = options.root ?? defaultRoot;\n const defaultEntry = options.entry ?? options.clientEntry ?? `${resolvedRoot}/app/client.tsx`;\n\n const buildConfig: NonNullable<UserConfig['build']> = {\n manifest: true,\n rollupOptions: {},\n };\n\n // Only set outDir if the user hasn't already defined it\n if (!userConfig.build?.outDir) {\n buildConfig.outDir = 'dist/inertia/client';\n }\n\n // Only set rollupOptions.input if the user hasn't already defined it\n if (!userConfig.build?.rollupOptions?.input) {\n buildConfig.rollupOptions = {\n input: resolve(process.cwd(), defaultEntry),\n };\n }\n\n const result: Omit<UserConfig, 'plugins'> = {\n build: buildConfig,\n resolve: { alias },\n server: {\n middlewareMode: true,\n hmr: { port: 24679 },\n },\n };\n\n // Only set root if the user hasn't already defined it in their vite config\n if (!userConfig.root) {\n result.root = resolve(process.cwd(), resolvedRoot);\n }\n\n return result;\n },\n };\n\n if (options.skipFrameworkPlugin) {\n return [configurer];\n }\n\n const frameworkPlugin = options.react\n ? loadFrameworkPlugin('react')\n : options.vue\n ? loadFrameworkPlugin('vue')\n : loadFrameworkPlugin('svelte');\n\n return [configurer, frameworkPlugin];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;yBAA8B;AAC9B,uBAAwB;AAGxB,IAAMA,eAAUC,kCAAc,eAAe;AAsBtC,IAAMC,6BAAN,cAAyCC,MAAAA;EA1BhD,OA0BgDA;;;EAC9C,YAAYC,SAAiB;AAC3B,UAAM,yBAAyBA,OAAAA,EAAS;AACxC,SAAKC,OAAO;EACd;AACF;AAEA,SAASC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WAAWH,MAAM;AACpBc,eAAOd,WAAOH,0BAAQC,QAAQC,IAAG,GAAIK,YAAAA;MACvC;AAEA,aAAOU;IACT,GApCQ;EAqCV;AAEA,MAAI1B,QAAQ+B,qBAAqB;AAC/B,WAAO;MAAClB;;EACV;AAEA,QAAMmB,kBAAkBhC,QAAQE,QAC5BV,oBAAoB,OAAA,IACpBQ,QAAQG,MACNX,oBAAoB,KAAA,IACpBA,oBAAoB,QAAA;AAE1B,SAAO;IAACqB;IAAYmB;;AACtB;AAlEwBC;","names":["require","createRequire","InvalidViteConfigException","Error","message","name","loadFrameworkPlugin","framework","pkg","mod","factory","default","svelte","undefined","options","frameworkFlags","react","vue","filter","Boolean","length","defaultRoot","alias","resolve","process","cwd","root","configurer","config","userConfig","resolvedRoot","defaultEntry","entry","clientEntry","buildConfig","manifest","rollupOptions","build","outDir","input","result","server","middlewareMode","hmr","port","skipFrameworkPlugin","frameworkPlugin","nestInertia"]}
@@ -0,0 +1,27 @@
1
+ import { Plugin } from 'vite';
2
+
3
+ interface NestInertiaPluginOptions {
4
+ ssr?: boolean;
5
+ react?: boolean;
6
+ vue?: boolean;
7
+ svelte?: boolean;
8
+ /**
9
+ * When `true`, the nestInertia plugin will skip auto-loading the framework
10
+ * Vite plugin. Use this when the framework plugin (e.g. @sveltejs/vite-plugin-svelte)
11
+ * needs to be added manually in the vite config alongside nestInertia().
12
+ *
13
+ * @default false
14
+ */
15
+ skipFrameworkPlugin?: boolean;
16
+ clientEntry?: string;
17
+ ssrEntry?: string;
18
+ alias?: Record<string, string>;
19
+ root?: string;
20
+ entry?: string;
21
+ }
22
+ declare class InvalidViteConfigException extends Error {
23
+ constructor(message: string);
24
+ }
25
+ declare function nestInertia(options?: NestInertiaPluginOptions): Plugin[];
26
+
27
+ export { InvalidViteConfigException, type NestInertiaPluginOptions, nestInertia as default };
@@ -0,0 +1,93 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ // src/plugin/plugin.ts
5
+ import { createRequire } from "module";
6
+ import { resolve } from "path";
7
+ var require2 = createRequire(import.meta.url);
8
+ var InvalidViteConfigException = class extends Error {
9
+ static {
10
+ __name(this, "InvalidViteConfigException");
11
+ }
12
+ constructor(message) {
13
+ super(`[nestjs-inertia-vite] ${message}`);
14
+ this.name = "InvalidViteConfigException";
15
+ }
16
+ };
17
+ function loadFrameworkPlugin(framework) {
18
+ const pkg = framework === "react" ? "@vitejs/plugin-react" : framework === "vue" ? "@vitejs/plugin-vue" : "@sveltejs/vite-plugin-svelte";
19
+ try {
20
+ const mod = require2(pkg);
21
+ const factory = mod.default ?? (framework === "svelte" ? mod.svelte : void 0) ?? mod;
22
+ return factory();
23
+ } catch {
24
+ throw new InvalidViteConfigException(`Plugin "${pkg}" not installed. Run: pnpm add ${pkg}`);
25
+ }
26
+ }
27
+ __name(loadFrameworkPlugin, "loadFrameworkPlugin");
28
+ function nestInertia(options = {}) {
29
+ const frameworkFlags = [
30
+ options.react,
31
+ options.vue,
32
+ options.svelte
33
+ ].filter(Boolean);
34
+ if (frameworkFlags.length !== 1) {
35
+ throw new InvalidViteConfigException("nestInertia requires exactly one framework flag: react, vue, or svelte");
36
+ }
37
+ const defaultRoot = "inertia";
38
+ const alias = {
39
+ "@": resolve(process.cwd(), options.root ?? defaultRoot),
40
+ ...options.alias ?? {}
41
+ };
42
+ const configurer = {
43
+ name: "nestjs-inertia",
44
+ config: /* @__PURE__ */ __name((userConfig) => {
45
+ const resolvedRoot = options.root ?? defaultRoot;
46
+ const defaultEntry = options.entry ?? options.clientEntry ?? `${resolvedRoot}/app/client.tsx`;
47
+ const buildConfig = {
48
+ manifest: true,
49
+ rollupOptions: {}
50
+ };
51
+ if (!userConfig.build?.outDir) {
52
+ buildConfig.outDir = "dist/inertia/client";
53
+ }
54
+ if (!userConfig.build?.rollupOptions?.input) {
55
+ buildConfig.rollupOptions = {
56
+ input: resolve(process.cwd(), defaultEntry)
57
+ };
58
+ }
59
+ const result = {
60
+ build: buildConfig,
61
+ resolve: {
62
+ alias
63
+ },
64
+ server: {
65
+ middlewareMode: true,
66
+ hmr: {
67
+ port: 24679
68
+ }
69
+ }
70
+ };
71
+ if (!userConfig.root) {
72
+ result.root = resolve(process.cwd(), resolvedRoot);
73
+ }
74
+ return result;
75
+ }, "config")
76
+ };
77
+ if (options.skipFrameworkPlugin) {
78
+ return [
79
+ configurer
80
+ ];
81
+ }
82
+ const frameworkPlugin = options.react ? loadFrameworkPlugin("react") : options.vue ? loadFrameworkPlugin("vue") : loadFrameworkPlugin("svelte");
83
+ return [
84
+ configurer,
85
+ frameworkPlugin
86
+ ];
87
+ }
88
+ __name(nestInertia, "nestInertia");
89
+ export {
90
+ InvalidViteConfigException,
91
+ nestInertia as default
92
+ };
93
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/plugin/plugin.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport { resolve } from 'node:path';\nimport type { Plugin, UserConfig } from 'vite';\n\nconst require = createRequire(import.meta.url);\n\nexport interface NestInertiaPluginOptions {\n ssr?: boolean;\n react?: boolean;\n vue?: boolean;\n svelte?: boolean;\n /**\n * When `true`, the nestInertia plugin will skip auto-loading the framework\n * Vite plugin. Use this when the framework plugin (e.g. @sveltejs/vite-plugin-svelte)\n * needs to be added manually in the vite config alongside nestInertia().\n *\n * @default false\n */\n skipFrameworkPlugin?: boolean;\n clientEntry?: string;\n ssrEntry?: string;\n alias?: Record<string, string>;\n root?: string;\n entry?: string;\n}\n\nexport class InvalidViteConfigException extends Error {\n constructor(message: string) {\n super(`[nestjs-inertia-vite] ${message}`);\n this.name = 'InvalidViteConfigException';\n }\n}\n\nfunction loadFrameworkPlugin(framework: 'react' | 'vue' | 'svelte'): Plugin {\n const pkg =\n framework === 'react'\n ? '@vitejs/plugin-react'\n : framework === 'vue'\n ? '@vitejs/plugin-vue'\n : '@sveltejs/vite-plugin-svelte';\n try {\n const mod = require(pkg) as { default?: () => Plugin; svelte?: () => Plugin };\n // @sveltejs/vite-plugin-svelte v3+ exports a named `svelte` export rather than default\n const factory =\n mod.default ??\n (framework === 'svelte' ? mod.svelte : undefined) ??\n (mod as unknown as () => Plugin);\n return (factory as () => Plugin)();\n } catch {\n throw new InvalidViteConfigException(`Plugin \"${pkg}\" not installed. Run: pnpm add ${pkg}`);\n }\n}\n\nexport default function nestInertia(options: NestInertiaPluginOptions = {}): Plugin[] {\n const frameworkFlags = [options.react, options.vue, options.svelte].filter(Boolean);\n if (frameworkFlags.length !== 1) {\n throw new InvalidViteConfigException(\n 'nestInertia requires exactly one framework flag: react, vue, or svelte',\n );\n }\n\n const defaultRoot = 'inertia';\n const alias = {\n '@': resolve(process.cwd(), options.root ?? defaultRoot),\n ...(options.alias ?? {}),\n };\n\n const configurer: Plugin = {\n name: 'nestjs-inertia',\n config: (userConfig: UserConfig): Omit<UserConfig, 'plugins'> => {\n const resolvedRoot = options.root ?? defaultRoot;\n const defaultEntry = options.entry ?? options.clientEntry ?? `${resolvedRoot}/app/client.tsx`;\n\n const buildConfig: NonNullable<UserConfig['build']> = {\n manifest: true,\n rollupOptions: {},\n };\n\n // Only set outDir if the user hasn't already defined it\n if (!userConfig.build?.outDir) {\n buildConfig.outDir = 'dist/inertia/client';\n }\n\n // Only set rollupOptions.input if the user hasn't already defined it\n if (!userConfig.build?.rollupOptions?.input) {\n buildConfig.rollupOptions = {\n input: resolve(process.cwd(), defaultEntry),\n };\n }\n\n const result: Omit<UserConfig, 'plugins'> = {\n build: buildConfig,\n resolve: { alias },\n server: {\n middlewareMode: true,\n hmr: { port: 24679 },\n },\n };\n\n // Only set root if the user hasn't already defined it in their vite config\n if (!userConfig.root) {\n result.root = resolve(process.cwd(), resolvedRoot);\n }\n\n return result;\n },\n };\n\n if (options.skipFrameworkPlugin) {\n return [configurer];\n }\n\n const frameworkPlugin = options.react\n ? loadFrameworkPlugin('react')\n : options.vue\n ? loadFrameworkPlugin('vue')\n : lo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;MACvB;AAGA,UAAI,CAACT,WAAWQ,OAAOD,eAAeG,OAAO;AAC3CL,oBAAYE,gBAAgB;UAC1BG,OAAOhB,QAAQC,QAAQC,IAAG,GAAIM,YAAAA;QAChC;MACF;AAEA,YAAMS,SAAsC;QAC1CH,OAAOH;QACPX,SAAS;UAAED;QAAM;QACjBmB,QAAQ;UACNC,gBAAgB;UAChBC,KAAK;YAAEC,MAAM;UAAM;QACrB;MACF;AAGA,UAAI,CAACf,WAAWH,MAAM;AACpBc,eAAOd,OAAOH,QAAQC,QAAQC,IAAG,GAAIK,YAAAA;MACvC;AAEA,aAAOU;IACT,GApCQ;EAqCV;AAEA,MAAI1B,QAAQ+B,qBAAqB;AAC/B,WAAO;MAAClB;;EACV;AAEA,QAAMmB,kBAAkBhC,QAAQE,QAC5BV,oBAAoB,OAAA,IACpBQ,QAAQG,MACNX,oBAAoB,KAAA,IACpBA,oBAAoB,QAAA;AAE1B,SAAO;IAACqB;IAAYmB;;AACtB;AAlEwBC;","names":["createRequire","resolve","require","createRequire","url","InvalidViteConfigException","Error","message","name","loadFrameworkPlugin","framework","pkg","mod","factory","default","svelte","undefined","options","frameworkFlags","react","vue","filter","Boolean","length","defaultRoot","alias","resolve","process","cwd","root","configurer","config","userConfig","resolvedRoot","defaultEntry","entry","clientEntry","buildConfig","manifest","rollupOptions","build","outDir","input","result","server","middlewareMode","hmr","port","skipFrameworkPlugin","frameworkPlugin","nestInertia"]}
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@dudousxd/nestjs-inertia-vite",
3
+ "version": "1.0.0",
4
+ "description": "Vite integration for @dudousxd/nestjs-inertia — dev middleware, prod static serving, plugin.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/DavideCarvalho/nestjs-inertia.git",
9
+ "directory": "packages/vite"
10
+ },
11
+ "author": "Davi Carvalho <davi@goflip.ai>",
12
+ "type": "module",
13
+ "main": "./dist/index.cjs",
14
+ "module": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js",
20
+ "require": "./dist/index.cjs"
21
+ },
22
+ "./plugin": {
23
+ "types": "./dist/plugin/plugin.d.ts",
24
+ "import": "./dist/plugin/plugin.js",
25
+ "require": "./dist/plugin/plugin.cjs"
26
+ }
27
+ },
28
+ "files": [
29
+ "dist/",
30
+ "README.md",
31
+ "CHANGELOG.md"
32
+ ],
33
+ "peerDependencies": {
34
+ "@dudousxd/nestjs-inertia": ">=1.0.0",
35
+ "@nestjs/common": ">=10.0.0",
36
+ "@nestjs/core": ">=10.0.0",
37
+ "vite": ">=5.0.0",
38
+ "@vitejs/plugin-react": ">=4.0.0",
39
+ "@vitejs/plugin-vue": ">=5.0.0",
40
+ "@sveltejs/vite-plugin-svelte": ">=3.0.0"
41
+ },
42
+ "peerDependenciesMeta": {
43
+ "@vitejs/plugin-react": {
44
+ "optional": true
45
+ },
46
+ "@vitejs/plugin-vue": {
47
+ "optional": true
48
+ },
49
+ "@sveltejs/vite-plugin-svelte": {
50
+ "optional": true
51
+ }
52
+ },
53
+ "devDependencies": {
54
+ "@nestjs/common": "^11.0.0",
55
+ "@nestjs/core": "^11.0.0",
56
+ "@types/express": "^4.17.21",
57
+ "@types/node": "^20.0.0",
58
+ "@vitejs/plugin-react": "^4.3.0",
59
+ "express": "^4.19.2",
60
+ "typescript": "^5.4.0",
61
+ "vite": "^6.4.2",
62
+ "vitest": "^3.0.0",
63
+ "@dudousxd/nestjs-inertia": "1.0.0"
64
+ },
65
+ "engines": {
66
+ "node": ">=20"
67
+ },
68
+ "scripts": {
69
+ "build": "tsup",
70
+ "test": "vitest run",
71
+ "test:watch": "vitest",
72
+ "typecheck": "tsc --noEmit -p tsconfig.json"
73
+ }
74
+ }