astro-md-editor 0.0.1

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.
Files changed (87) hide show
  1. package/.output/nitro.json +17 -0
  2. package/.output/public/assets/index-Cc7yKB0o.js +19 -0
  3. package/.output/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  4. package/.output/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  5. package/.output/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  6. package/.output/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  7. package/.output/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  8. package/.output/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  9. package/.output/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  10. package/.output/public/assets/main-DDBjVFnt.js +17 -0
  11. package/.output/public/assets/styles-ggfdUHMo.css +1 -0
  12. package/.output/public/favicon.ico +0 -0
  13. package/.output/public/logo192.png +0 -0
  14. package/.output/public/logo512.png +0 -0
  15. package/.output/public/manifest.json +25 -0
  16. package/.output/public/robots.txt +3 -0
  17. package/.output/server/__root-C09LBXMv.mjs +40 -0
  18. package/.output/server/_chunks/ssr-renderer.mjs +21 -0
  19. package/.output/server/_libs/ajv-formats.mjs +330 -0
  20. package/.output/server/_libs/ajv.mjs +5484 -0
  21. package/.output/server/_libs/base-ui__react.mjs +8712 -0
  22. package/.output/server/_libs/base-ui__utils.mjs +980 -0
  23. package/.output/server/_libs/class-variance-authority.mjs +44 -0
  24. package/.output/server/_libs/clsx.mjs +16 -0
  25. package/.output/server/_libs/cookie-es.mjs +58 -0
  26. package/.output/server/_libs/croner.mjs +1 -0
  27. package/.output/server/_libs/crossws.mjs +1 -0
  28. package/.output/server/_libs/date-fns.mjs +1716 -0
  29. package/.output/server/_libs/date-fns__tz.mjs +217 -0
  30. package/.output/server/_libs/extend-shallow.mjs +35 -0
  31. package/.output/server/_libs/fast-deep-equal.mjs +38 -0
  32. package/.output/server/_libs/fast-uri.mjs +725 -0
  33. package/.output/server/_libs/floating-ui__core.mjs +663 -0
  34. package/.output/server/_libs/floating-ui__dom.mjs +624 -0
  35. package/.output/server/_libs/floating-ui__react-dom.mjs +279 -0
  36. package/.output/server/_libs/floating-ui__utils.mjs +322 -0
  37. package/.output/server/_libs/gray-matter.mjs +393 -0
  38. package/.output/server/_libs/h3-v2.mjs +276 -0
  39. package/.output/server/_libs/h3.mjs +400 -0
  40. package/.output/server/_libs/hookable.mjs +1 -0
  41. package/.output/server/_libs/is-extendable.mjs +13 -0
  42. package/.output/server/_libs/isbot.mjs +20 -0
  43. package/.output/server/_libs/js-yaml.mjs +2822 -0
  44. package/.output/server/_libs/json-schema-traverse.mjs +91 -0
  45. package/.output/server/_libs/kind-of.mjs +125 -0
  46. package/.output/server/_libs/lucide-react.mjs +177 -0
  47. package/.output/server/_libs/ohash.mjs +1 -0
  48. package/.output/server/_libs/react-day-picker.mjs +2216 -0
  49. package/.output/server/_libs/react-dom.mjs +10779 -0
  50. package/.output/server/_libs/react-resizable-panels.mjs +2024 -0
  51. package/.output/server/_libs/react.mjs +513 -0
  52. package/.output/server/_libs/reselect.mjs +326 -0
  53. package/.output/server/_libs/rou3.mjs +8 -0
  54. package/.output/server/_libs/section-matter.mjs +112 -0
  55. package/.output/server/_libs/seroval-plugins.mjs +58 -0
  56. package/.output/server/_libs/seroval.mjs +1765 -0
  57. package/.output/server/_libs/srvx.mjs +736 -0
  58. package/.output/server/_libs/strip-bom-string.mjs +16 -0
  59. package/.output/server/_libs/tabbable.mjs +342 -0
  60. package/.output/server/_libs/tailwind-merge.mjs +3175 -0
  61. package/.output/server/_libs/tanstack__history.mjs +217 -0
  62. package/.output/server/_libs/tanstack__react-router.mjs +1464 -0
  63. package/.output/server/_libs/tanstack__react-store.mjs +1 -0
  64. package/.output/server/_libs/tanstack__router-core.mjs +4912 -0
  65. package/.output/server/_libs/tanstack__store.mjs +1 -0
  66. package/.output/server/_libs/tiny-invariant.mjs +12 -0
  67. package/.output/server/_libs/tiny-warning.mjs +5 -0
  68. package/.output/server/_libs/ufo.mjs +54 -0
  69. package/.output/server/_libs/unctx.mjs +1 -0
  70. package/.output/server/_libs/unstorage.mjs +1 -0
  71. package/.output/server/_libs/use-sync-external-store.mjs +139 -0
  72. package/.output/server/_libs/zod.mjs +3634 -0
  73. package/.output/server/_libs/zustand.mjs +43 -0
  74. package/.output/server/_ssr/RightSidebar-RSY9M7XF.mjs +218 -0
  75. package/.output/server/_ssr/collections.server-D6U2tEsT.mjs +120 -0
  76. package/.output/server/_ssr/createServerRpc-29xaFZcb.mjs +12 -0
  77. package/.output/server/_ssr/index-BaqV4cZC.mjs +2083 -0
  78. package/.output/server/_ssr/index-sQBM6rwN.mjs +115 -0
  79. package/.output/server/_ssr/index.mjs +1448 -0
  80. package/.output/server/_ssr/router-D4G1DGr3.mjs +155 -0
  81. package/.output/server/_ssr/start-HYkvq4Ni.mjs +4 -0
  82. package/.output/server/_tanstack-start-manifest_v-CYEHh_qB.mjs +4 -0
  83. package/.output/server/index.mjs +451 -0
  84. package/README.md +118 -0
  85. package/index.mjs +21 -0
  86. package/package.json +86 -0
  87. package/scripts/bootstrap-collections.mjs +1201 -0
@@ -0,0 +1,155 @@
1
+ import { c as createRouter, a as createRootRoute, b as createFileRoute, l as lazyRouteComponent, H as HeadContent, S as Scripts } from "../_libs/tanstack__react-router.mjs";
2
+ import { r as reactExports, j as jsxRuntimeExports } from "../_libs/react.mjs";
3
+ import { c as createServerFn, T as TSS_SERVER_FUNCTION, g as getServerFnById } from "./index.mjs";
4
+ import { T as TooltipProvider$1 } from "../_libs/base-ui__react.mjs";
5
+ import "../_libs/tanstack__router-core.mjs";
6
+ import "../_libs/cookie-es.mjs";
7
+ import "../_libs/tanstack__history.mjs";
8
+ import "../_libs/tiny-invariant.mjs";
9
+ import "../_libs/seroval.mjs";
10
+ import "../_libs/seroval-plugins.mjs";
11
+ import "node:stream/web";
12
+ import "node:stream";
13
+ import "../_libs/react-dom.mjs";
14
+ import "util";
15
+ import "crypto";
16
+ import "async_hooks";
17
+ import "stream";
18
+ import "../_libs/isbot.mjs";
19
+ import "../_libs/tiny-warning.mjs";
20
+ import "node:async_hooks";
21
+ import "../_libs/h3-v2.mjs";
22
+ import "../_libs/rou3.mjs";
23
+ import "../_libs/srvx.mjs";
24
+ import "node:http";
25
+ import "node:https";
26
+ import "node:http2";
27
+ import "../_libs/base-ui__utils.mjs";
28
+ import "../_libs/reselect.mjs";
29
+ import "../_libs/use-sync-external-store.mjs";
30
+ import "../_libs/floating-ui__utils.mjs";
31
+ import "../_libs/floating-ui__react-dom.mjs";
32
+ import "../_libs/floating-ui__dom.mjs";
33
+ import "../_libs/floating-ui__core.mjs";
34
+ import "../_libs/tabbable.mjs";
35
+ const createSsrRpc = (functionId, importer) => {
36
+ const url = "/_serverFn/" + functionId;
37
+ const serverFnMeta = { id: functionId };
38
+ const fn = async (...args) => {
39
+ const serverFn = await getServerFnById(functionId);
40
+ return serverFn(...args);
41
+ };
42
+ return Object.assign(fn, {
43
+ url,
44
+ serverFnMeta,
45
+ [TSS_SERVER_FUNCTION]: true
46
+ });
47
+ };
48
+ const appCss = "/assets/styles-ggfdUHMo.css";
49
+ const CollectionsDataContext = reactExports.createContext(null);
50
+ function CollectionsDataProvider({
51
+ value,
52
+ children
53
+ }) {
54
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(CollectionsDataContext.Provider, { value, children });
55
+ }
56
+ function useCollectionsData() {
57
+ const value = reactExports.useContext(CollectionsDataContext);
58
+ if (!value) {
59
+ throw new Error(
60
+ "useCollectionsData must be used within CollectionsDataProvider"
61
+ );
62
+ }
63
+ return value;
64
+ }
65
+ function TooltipProvider({
66
+ delay = 0,
67
+ ...props
68
+ }) {
69
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
70
+ TooltipProvider$1,
71
+ {
72
+ "data-slot": "tooltip-provider",
73
+ delay,
74
+ ...props
75
+ }
76
+ );
77
+ }
78
+ const THEME_INIT_SCRIPT = `(function(){try{var stored=window.localStorage.getItem('theme');var mode=(stored==='light'||stored==='dark'||stored==='auto')?stored:'auto';var prefersDark=window.matchMedia('(prefers-color-scheme: dark)').matches;var resolved=mode==='auto'?(prefersDark?'dark':'light'):mode;var root=document.documentElement;root.classList.remove('light','dark');root.classList.add(resolved);if(mode==='auto'){root.removeAttribute('data-theme')}else{root.setAttribute('data-theme',mode)}root.style.colorScheme=resolved;}catch(e){}})();`;
79
+ const loadCollectionsData = createServerFn().handler(createSsrRpc("e3ae5ae6db5120d43fecff71cd0258cb4a93807a1a382949ccd189596d190566"));
80
+ const Route$1 = createRootRoute({
81
+ head: () => ({
82
+ meta: [{
83
+ charSet: "utf-8"
84
+ }, {
85
+ name: "viewport",
86
+ content: "width=device-width, initial-scale=1"
87
+ }, {
88
+ title: "Astro MD Editor"
89
+ }],
90
+ links: [{
91
+ rel: "stylesheet",
92
+ href: appCss
93
+ }]
94
+ }),
95
+ shellComponent: RootDocument,
96
+ loader: () => loadCollectionsData()
97
+ });
98
+ function RootDocument({
99
+ children
100
+ }) {
101
+ const collectionsData = Route$1.useLoaderData();
102
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("html", { lang: "en", suppressHydrationWarning: true, children: [
103
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("head", { children: [
104
+ /* @__PURE__ */ jsxRuntimeExports.jsx("script", { dangerouslySetInnerHTML: {
105
+ __html: THEME_INIT_SCRIPT
106
+ } }),
107
+ /* @__PURE__ */ jsxRuntimeExports.jsx(HeadContent, {})
108
+ ] }),
109
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("body", { className: "font-sans wrap-anywhere antialiased", children: [
110
+ /* @__PURE__ */ jsxRuntimeExports.jsx(TooltipProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CollectionsDataProvider, { value: collectionsData, children }) }),
111
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Scripts, {})
112
+ ] })
113
+ ] });
114
+ }
115
+ const $$splitComponentImporter = () => import("./index-BaqV4cZC.mjs");
116
+ const Route = createFileRoute("/")({
117
+ validateSearch: (search) => {
118
+ const record = search;
119
+ const collection = typeof record.collection === "string" && record.collection.length > 0 ? record.collection : void 0;
120
+ const file = typeof record.file === "string" && record.file.length > 0 ? record.file : void 0;
121
+ return {
122
+ collection,
123
+ file
124
+ };
125
+ },
126
+ component: lazyRouteComponent($$splitComponentImporter, "component")
127
+ });
128
+ const IndexRoute = Route.update({
129
+ id: "/",
130
+ path: "/",
131
+ getParentRoute: () => Route$1
132
+ });
133
+ const rootRouteChildren = {
134
+ IndexRoute
135
+ };
136
+ const routeTree = Route$1._addFileChildren(rootRouteChildren)._addFileTypes();
137
+ function getRouter() {
138
+ const router2 = createRouter({
139
+ routeTree,
140
+ scrollRestoration: true,
141
+ defaultPreload: "intent",
142
+ defaultPreloadStaleTime: 0
143
+ });
144
+ return router2;
145
+ }
146
+ const router = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
147
+ __proto__: null,
148
+ getRouter
149
+ }, Symbol.toStringTag, { value: "Module" }));
150
+ export {
151
+ Route as R,
152
+ createSsrRpc as c,
153
+ router as r,
154
+ useCollectionsData as u
155
+ };
@@ -0,0 +1,4 @@
1
+ const startInstance = void 0;
2
+ export {
3
+ startInstance
4
+ };
@@ -0,0 +1,4 @@
1
+ const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "/Users/bimsina/Desktop/Development/Personal/astro-md-editor/src/routes/__root.tsx", "children": ["/"], "preloads": ["/assets/main-DDBjVFnt.js"], "assets": [] }, "/": { "filePath": "/Users/bimsina/Desktop/Development/Personal/astro-md-editor/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-Cc7yKB0o.js"] } }, "clientEntry": "/assets/main-DDBjVFnt.js" });
2
+ export {
3
+ tsrStartManifest
4
+ };
@@ -0,0 +1,451 @@
1
+ globalThis.__nitro_main__ = import.meta.url;
2
+ import { N as NodeResponse, s as serve } from "./_libs/srvx.mjs";
3
+ import { d as defineHandler, H as HTTPError, t as toEventHandler, a as defineLazyEventHandler, b as H3Core } from "./_libs/h3.mjs";
4
+ import { d as decodePath, w as withLeadingSlash, a as withoutTrailingSlash, j as joinURL } from "./_libs/ufo.mjs";
5
+ import { promises } from "node:fs";
6
+ import { fileURLToPath } from "node:url";
7
+ import { dirname, resolve } from "node:path";
8
+ import "node:http";
9
+ import "node:stream";
10
+ import "node:https";
11
+ import "node:http2";
12
+ import "./_libs/rou3.mjs";
13
+ function lazyService(loader) {
14
+ let promise, mod;
15
+ return {
16
+ fetch(req) {
17
+ if (mod) {
18
+ return mod.fetch(req);
19
+ }
20
+ if (!promise) {
21
+ promise = loader().then((_mod) => mod = _mod.default || _mod);
22
+ }
23
+ return promise.then((mod2) => mod2.fetch(req));
24
+ }
25
+ };
26
+ }
27
+ const services = {
28
+ ["ssr"]: lazyService(() => import("./_ssr/index.mjs"))
29
+ };
30
+ globalThis.__nitro_vite_envs__ = services;
31
+ const errorHandler$1 = (error, event) => {
32
+ const res = defaultHandler(error, event);
33
+ return new NodeResponse(typeof res.body === "string" ? res.body : JSON.stringify(res.body, null, 2), res);
34
+ };
35
+ function defaultHandler(error, event, opts) {
36
+ const isSensitive = error.unhandled;
37
+ const status = error.status || 500;
38
+ const url = event.url || new URL(event.req.url);
39
+ if (status === 404) {
40
+ const baseURL = "/";
41
+ if (/^\/[^/]/.test(baseURL) && !url.pathname.startsWith(baseURL)) {
42
+ const redirectTo = `${baseURL}${url.pathname.slice(1)}${url.search}`;
43
+ return {
44
+ status: 302,
45
+ statusText: "Found",
46
+ headers: { location: redirectTo },
47
+ body: `Redirecting...`
48
+ };
49
+ }
50
+ }
51
+ if (isSensitive && !opts?.silent) {
52
+ const tags = [error.unhandled && "[unhandled]"].filter(Boolean).join(" ");
53
+ console.error(`[request error] ${tags} [${event.req.method}] ${url}
54
+ `, error);
55
+ }
56
+ const headers2 = {
57
+ "content-type": "application/json",
58
+ "x-content-type-options": "nosniff",
59
+ "x-frame-options": "DENY",
60
+ "referrer-policy": "no-referrer",
61
+ "content-security-policy": "script-src 'none'; frame-ancestors 'none';"
62
+ };
63
+ if (status === 404 || !event.res.headers.has("cache-control")) {
64
+ headers2["cache-control"] = "no-cache";
65
+ }
66
+ const body = {
67
+ error: true,
68
+ url: url.href,
69
+ status,
70
+ statusText: error.statusText,
71
+ message: isSensitive ? "Server Error" : error.message,
72
+ data: isSensitive ? void 0 : error.data
73
+ };
74
+ return {
75
+ status,
76
+ statusText: error.statusText,
77
+ headers: headers2,
78
+ body
79
+ };
80
+ }
81
+ const errorHandlers = [errorHandler$1];
82
+ async function errorHandler(error, event) {
83
+ for (const handler of errorHandlers) {
84
+ try {
85
+ const response = await handler(error, event, { defaultHandler });
86
+ if (response) {
87
+ return response;
88
+ }
89
+ } catch (error2) {
90
+ console.error(error2);
91
+ }
92
+ }
93
+ }
94
+ const headers = ((m) => function headersRouteRule(event) {
95
+ for (const [key2, value] of Object.entries(m.options || {})) {
96
+ event.res.headers.set(key2, value);
97
+ }
98
+ });
99
+ const assets = {
100
+ "/favicon.ico": {
101
+ "type": "image/vnd.microsoft.icon",
102
+ "etag": '"f1e-ESBTjHetHyiokkO0tT/irBbMO8Y"',
103
+ "mtime": "2026-03-07T10:00:44.436Z",
104
+ "size": 3870,
105
+ "path": "../public/favicon.ico"
106
+ },
107
+ "/logo192.png": {
108
+ "type": "image/png",
109
+ "etag": '"14e3-f08taHgqf6/O2oRVTsq5tImHdQA"',
110
+ "mtime": "2026-03-07T10:00:44.436Z",
111
+ "size": 5347,
112
+ "path": "../public/logo192.png"
113
+ },
114
+ "/logo512.png": {
115
+ "type": "image/png",
116
+ "etag": '"25c0-RpFfnQJpTtSb/HqVNJR2hBA9w/4"',
117
+ "mtime": "2026-03-07T10:00:44.436Z",
118
+ "size": 9664,
119
+ "path": "../public/logo512.png"
120
+ },
121
+ "/manifest.json": {
122
+ "type": "application/json",
123
+ "etag": '"1f2-Oqn/x1R1hBTtEjA8nFhpBeFJJNg"',
124
+ "mtime": "2026-03-07T10:00:44.436Z",
125
+ "size": 498,
126
+ "path": "../public/manifest.json"
127
+ },
128
+ "/robots.txt": {
129
+ "type": "text/plain; charset=utf-8",
130
+ "etag": '"43-BEzmj4PuhUNHX+oW9uOnPSihxtU"',
131
+ "mtime": "2026-03-07T10:00:44.437Z",
132
+ "size": 67,
133
+ "path": "../public/robots.txt"
134
+ },
135
+ "/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2": {
136
+ "type": "font/woff2",
137
+ "etag": '"6568-cF1iUGbboMFZ8TfnP5HiMgl9II0"',
138
+ "mtime": "2026-03-07T10:00:44.091Z",
139
+ "size": 25960,
140
+ "path": "../public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2"
141
+ },
142
+ "/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2": {
143
+ "type": "font/woff2",
144
+ "etag": '"493c-n3Oy9D6jvzfMjpClqox+Zo7ERQQ"',
145
+ "mtime": "2026-03-07T10:00:44.091Z",
146
+ "size": 18748,
147
+ "path": "../public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2"
148
+ },
149
+ "/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2": {
150
+ "type": "font/woff2",
151
+ "etag": '"2be0-BP5iTzJeB8nLqYAgKpWNi5o1Zm8"',
152
+ "mtime": "2026-03-07T10:00:44.091Z",
153
+ "size": 11232,
154
+ "path": "../public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2"
155
+ },
156
+ "/assets/inter-greek-wght-normal-CkhJZR-_.woff2": {
157
+ "type": "font/woff2",
158
+ "etag": '"4a34-xor/hj4YNqI52zFecXnUbzQ4Xs4"',
159
+ "mtime": "2026-03-07T10:00:44.091Z",
160
+ "size": 18996,
161
+ "path": "../public/assets/inter-greek-wght-normal-CkhJZR-_.woff2"
162
+ },
163
+ "/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2": {
164
+ "type": "font/woff2",
165
+ "etag": '"14c4c-zz61D7IQFMB9QxHvTAOk/Vh4ibQ"',
166
+ "mtime": "2026-03-07T10:00:44.091Z",
167
+ "size": 85068,
168
+ "path": "../public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2"
169
+ },
170
+ "/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2": {
171
+ "type": "font/woff2",
172
+ "etag": '"280c-nBythjoDQ0+5wVAendJ6wU7Xz2M"',
173
+ "mtime": "2026-03-07T10:00:44.091Z",
174
+ "size": 10252,
175
+ "path": "../public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2"
176
+ },
177
+ "/assets/inter-latin-wght-normal-Dx4kXJAl.woff2": {
178
+ "type": "font/woff2",
179
+ "etag": '"bc80-8R1ym7Ck2DUNLqPQ/AYs9u8tUpg"',
180
+ "mtime": "2026-03-07T10:00:44.091Z",
181
+ "size": 48256,
182
+ "path": "../public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2"
183
+ },
184
+ "/assets/styles-ggfdUHMo.css": {
185
+ "type": "text/css; charset=utf-8",
186
+ "etag": '"1217d-N1cMgn2LYuziEz5ZMj8Y16wujUE"',
187
+ "mtime": "2026-03-07T10:00:44.091Z",
188
+ "size": 74109,
189
+ "path": "../public/assets/styles-ggfdUHMo.css"
190
+ },
191
+ "/assets/main-DDBjVFnt.js": {
192
+ "type": "text/javascript; charset=utf-8",
193
+ "etag": '"503a0-9a/S0cJDFalzknYsOqdGGtAIHS4"',
194
+ "mtime": "2026-03-07T10:00:44.091Z",
195
+ "size": 328608,
196
+ "path": "../public/assets/main-DDBjVFnt.js"
197
+ },
198
+ "/assets/index-Cc7yKB0o.js": {
199
+ "type": "text/javascript; charset=utf-8",
200
+ "etag": '"80c37-Gu1SQzCRHCr84Q3pJFO6waxy5c8"',
201
+ "mtime": "2026-03-07T10:00:44.091Z",
202
+ "size": 527415,
203
+ "path": "../public/assets/index-Cc7yKB0o.js"
204
+ }
205
+ };
206
+ function readAsset(id) {
207
+ const serverDir = dirname(fileURLToPath(globalThis.__nitro_main__));
208
+ return promises.readFile(resolve(serverDir, assets[id].path));
209
+ }
210
+ const publicAssetBases = {};
211
+ function isPublicAssetURL(id = "") {
212
+ if (assets[id]) {
213
+ return true;
214
+ }
215
+ for (const base in publicAssetBases) {
216
+ if (id.startsWith(base)) {
217
+ return true;
218
+ }
219
+ }
220
+ return false;
221
+ }
222
+ function getAsset(id) {
223
+ return assets[id];
224
+ }
225
+ const METHODS = /* @__PURE__ */ new Set(["HEAD", "GET"]);
226
+ const EncodingMap = {
227
+ gzip: ".gz",
228
+ br: ".br",
229
+ zstd: ".zst"
230
+ };
231
+ const _KnWSef = defineHandler((event) => {
232
+ if (event.req.method && !METHODS.has(event.req.method)) {
233
+ return;
234
+ }
235
+ let id = decodePath(withLeadingSlash(withoutTrailingSlash(event.url.pathname)));
236
+ let asset;
237
+ const encodingHeader = event.req.headers.get("accept-encoding") || "";
238
+ const encodings = [...encodingHeader.split(",").map((e) => EncodingMap[e.trim()]).filter(Boolean).sort(), ""];
239
+ if (encodings.length > 1) {
240
+ event.res.headers.append("Vary", "Accept-Encoding");
241
+ }
242
+ for (const encoding of encodings) {
243
+ for (const _id of [id + encoding, joinURL(id, "index.html" + encoding)]) {
244
+ const _asset = getAsset(_id);
245
+ if (_asset) {
246
+ asset = _asset;
247
+ id = _id;
248
+ break;
249
+ }
250
+ }
251
+ }
252
+ if (!asset) {
253
+ if (isPublicAssetURL(id)) {
254
+ event.res.headers.delete("Cache-Control");
255
+ throw new HTTPError({ status: 404 });
256
+ }
257
+ return;
258
+ }
259
+ const ifNotMatch = event.req.headers.get("if-none-match") === asset.etag;
260
+ if (ifNotMatch) {
261
+ event.res.status = 304;
262
+ event.res.statusText = "Not Modified";
263
+ return "";
264
+ }
265
+ const ifModifiedSinceH = event.req.headers.get("if-modified-since");
266
+ const mtimeDate = new Date(asset.mtime);
267
+ if (ifModifiedSinceH && asset.mtime && new Date(ifModifiedSinceH) >= mtimeDate) {
268
+ event.res.status = 304;
269
+ event.res.statusText = "Not Modified";
270
+ return "";
271
+ }
272
+ if (asset.type) {
273
+ event.res.headers.set("Content-Type", asset.type);
274
+ }
275
+ if (asset.etag && !event.res.headers.has("ETag")) {
276
+ event.res.headers.set("ETag", asset.etag);
277
+ }
278
+ if (asset.mtime && !event.res.headers.has("Last-Modified")) {
279
+ event.res.headers.set("Last-Modified", mtimeDate.toUTCString());
280
+ }
281
+ if (asset.encoding && !event.res.headers.has("Content-Encoding")) {
282
+ event.res.headers.set("Content-Encoding", asset.encoding);
283
+ }
284
+ if (asset.size > 0 && !event.res.headers.has("Content-Length")) {
285
+ event.res.headers.set("Content-Length", asset.size.toString());
286
+ }
287
+ return readAsset(id);
288
+ });
289
+ const findRouteRules = /* @__PURE__ */ (() => {
290
+ const $0 = [{ name: "headers", route: "/assets/**", handler: headers, options: { "cache-control": "public, max-age=31536000, immutable" } }];
291
+ return (m, p) => {
292
+ let r = [];
293
+ if (p.charCodeAt(p.length - 1) === 47) p = p.slice(0, -1) || "/";
294
+ let s = p.split("/");
295
+ s.length - 1;
296
+ if (s[1] === "assets") {
297
+ r.unshift({ data: $0, params: { "_": s.slice(2).join("/") } });
298
+ }
299
+ return r;
300
+ };
301
+ })();
302
+ const _lazy_9j1bZM = defineLazyEventHandler(() => import("./_chunks/ssr-renderer.mjs"));
303
+ const findRoute = /* @__PURE__ */ (() => {
304
+ const data = { route: "/**", handler: _lazy_9j1bZM };
305
+ return ((_m, p) => {
306
+ return { data, params: { "_": p.slice(1) } };
307
+ });
308
+ })();
309
+ const globalMiddleware = [
310
+ toEventHandler(_KnWSef)
311
+ ].filter(Boolean);
312
+ const APP_ID = "default";
313
+ function useNitroApp() {
314
+ let instance = useNitroApp._instance;
315
+ if (instance) {
316
+ return instance;
317
+ }
318
+ instance = useNitroApp._instance = createNitroApp();
319
+ globalThis.__nitro__ = globalThis.__nitro__ || {};
320
+ globalThis.__nitro__[APP_ID] = instance;
321
+ return instance;
322
+ }
323
+ function createNitroApp() {
324
+ const hooks = void 0;
325
+ const captureError = (error, errorCtx) => {
326
+ if (errorCtx?.event) {
327
+ const errors = errorCtx.event.req.context?.nitro?.errors;
328
+ if (errors) {
329
+ errors.push({
330
+ error,
331
+ context: errorCtx
332
+ });
333
+ }
334
+ }
335
+ };
336
+ const h3App = createH3App({ onError(error, event) {
337
+ return errorHandler(error, event);
338
+ } });
339
+ let appHandler = (req) => {
340
+ req.context ||= {};
341
+ req.context.nitro = req.context.nitro || { errors: [] };
342
+ return h3App.fetch(req);
343
+ };
344
+ const app = {
345
+ fetch: appHandler,
346
+ h3: h3App,
347
+ hooks,
348
+ captureError
349
+ };
350
+ return app;
351
+ }
352
+ function createH3App(config) {
353
+ const h3App = new H3Core(config);
354
+ h3App["~findRoute"] = (event) => findRoute(event.req.method, event.url.pathname);
355
+ h3App["~middleware"].push(...globalMiddleware);
356
+ {
357
+ h3App["~getMiddleware"] = (event, route) => {
358
+ const pathname = event.url.pathname;
359
+ const method = event.req.method;
360
+ const middleware = [];
361
+ {
362
+ const routeRules = getRouteRules(method, pathname);
363
+ event.context.routeRules = routeRules?.routeRules;
364
+ if (routeRules?.routeRuleMiddleware.length) {
365
+ middleware.push(...routeRules.routeRuleMiddleware);
366
+ }
367
+ }
368
+ middleware.push(...h3App["~middleware"]);
369
+ if (route?.data?.middleware?.length) {
370
+ middleware.push(...route.data.middleware);
371
+ }
372
+ return middleware;
373
+ };
374
+ }
375
+ return h3App;
376
+ }
377
+ function getRouteRules(method, pathname) {
378
+ const m = findRouteRules(method, pathname);
379
+ if (!m?.length) {
380
+ return { routeRuleMiddleware: [] };
381
+ }
382
+ const routeRules = {};
383
+ for (const layer of m) {
384
+ for (const rule of layer.data) {
385
+ const currentRule = routeRules[rule.name];
386
+ if (currentRule) {
387
+ if (rule.options === false) {
388
+ delete routeRules[rule.name];
389
+ continue;
390
+ }
391
+ if (typeof currentRule.options === "object" && typeof rule.options === "object") {
392
+ currentRule.options = {
393
+ ...currentRule.options,
394
+ ...rule.options
395
+ };
396
+ } else {
397
+ currentRule.options = rule.options;
398
+ }
399
+ currentRule.route = rule.route;
400
+ currentRule.params = {
401
+ ...currentRule.params,
402
+ ...layer.params
403
+ };
404
+ } else if (rule.options !== false) {
405
+ routeRules[rule.name] = {
406
+ ...rule,
407
+ params: layer.params
408
+ };
409
+ }
410
+ }
411
+ }
412
+ const middleware = [];
413
+ for (const rule of Object.values(routeRules)) {
414
+ if (rule.options === false || !rule.handler) {
415
+ continue;
416
+ }
417
+ middleware.push(rule.handler(rule));
418
+ }
419
+ return {
420
+ routeRules,
421
+ routeRuleMiddleware: middleware
422
+ };
423
+ }
424
+ function _captureError(error, type) {
425
+ console.error(`[${type}]`, error);
426
+ useNitroApp().captureError?.(error, { tags: [type] });
427
+ }
428
+ function trapUnhandledErrors() {
429
+ process.on("unhandledRejection", (error) => _captureError(error, "unhandledRejection"));
430
+ process.on("uncaughtException", (error) => _captureError(error, "uncaughtException"));
431
+ }
432
+ const _parsedPort = Number.parseInt(process.env.NITRO_PORT ?? process.env.PORT ?? "");
433
+ const port = Number.isNaN(_parsedPort) ? 3e3 : _parsedPort;
434
+ const host = process.env.NITRO_HOST || process.env.HOST;
435
+ const cert = process.env.NITRO_SSL_CERT;
436
+ const key = process.env.NITRO_SSL_KEY;
437
+ const nitroApp = useNitroApp();
438
+ serve({
439
+ port,
440
+ hostname: host,
441
+ tls: cert && key ? {
442
+ cert,
443
+ key
444
+ } : void 0,
445
+ fetch: nitroApp.fetch
446
+ });
447
+ trapUnhandledErrors();
448
+ const nodeServer = {};
449
+ export {
450
+ nodeServer as default
451
+ };