@withl5e/l5e 1.1.0-alpha.2 → 1.1.0-alpha.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/README.md CHANGED
@@ -23,7 +23,8 @@ export default defineConfig({
23
23
 
24
24
  See the root README and `examples/basic` for a full app.
25
25
 
26
- Compact chunking is experimental and opt-in:
26
+ Compact chunking is experimental and opt-in. The staged activation behavior and
27
+ `islandRuntime` option below require the `1.1.0-alpha.3` prerelease:
27
28
 
28
29
  ```ts
29
30
  coreVite({
@@ -48,6 +49,13 @@ contexts or client caches that multiple islands must share in `islandRuntime`.
48
49
  Only the configured static closure is included, and dynamic imports are not
49
50
  promoted. Compact mode requires native import-map support.
50
51
 
52
+ Compact chunking applies to production builds. Development keeps Vite source modules
53
+ and HMR, and its Network requests are not subject to the production three-file limit.
54
+
51
55
  The alpha renderer bridge expects Vite to emit one entry facade and one canonical
52
56
  renderer export chunk. A different renderer shape is rejected during server setup
53
57
  because merging multiple minified export namespaces can make aliases ambiguous.
58
+
59
+ See [runtime script bundles and shared modules](../../docs/runtime-script-bundling.md)
60
+ for the download/evaluation/mount lifecycle, strategy behavior, ownership rules,
61
+ activation examples and current alpha limitations.
@@ -1,5 +1,5 @@
1
- import { r as e } from "./rolldown-runtime-B0aSnxlc.js";
2
- import { a as t, r as n } from "./render-hUQUreah.js";
1
+ import { n as e } from "./rolldown-runtime-DtPi1Y-2.js";
2
+ import { a as t, r as n } from "./render-Z3_uiPMp.js";
3
3
  import { C as r, S as i, _ as a, a as o, c as s, d as c, f as l, h as u, k as d, l as f, n as p, o as m, r as h, s as g, u as _, v } from "./jsx-runtime-CI0Jmr-C.js";
4
4
  import { t as y } from "./generateMetadata-DcdY-XC1.js";
5
5
  import { a as b, i as x, n as S, o as C, r as w } from "./exceptions-D4OdiQjY.js";
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { i as e, n as t, r as n, t as r } from "./render-hUQUreah.js";
1
+ import { i as e, n as t, r as n, t as r } from "./render-Z3_uiPMp.js";
2
2
  import { C as i, E as a, S as o, T as s, _ as c, a as l, b as u, c as d, d as f, f as p, g as m, h, i as g, k as _, l as v, m as y, n as b, o as x, p as S, r as C, s as w, t as T, u as E, v as D, w as O, x as k, y as A } from "./jsx-runtime-CI0Jmr-C.js";
3
3
  import { a as j, i as M, n as N, o as P, r as F, t as I } from "./exceptions-D4OdiQjY.js";
4
4
  import { render as L } from "./entry-server.js";
5
- import { n as R, t as z } from "./middleware-CnDqZobD.js";
5
+ import { n as R, t as z } from "./middleware-B8m9wPBe.js";
6
6
  import { t as B } from "./defineMiddleware-D017PWDc.js";
7
- import { a as V, n as H } from "./server-C35BtVu8.js";
8
- import { t as U } from "./vite-plugin-BOuzxmb2.js";
7
+ import { a as V, n as H } from "./server-D7amTQoo.js";
8
+ import { t as U } from "./vite-plugin-Bln1di66.js";
9
9
  export { I as BadRequestException, T as Fragment, _ as HEAD_PRIORITY, b as Head, N as HttpException, F as InternalServerErrorException, M as NotFoundException, j as RedirectException, P as ServiceUnavailableException, C as addCacheTag, g as cloneElement, U as coreVite, z as createContext, H as createServer, B as defineMiddleware, r as escapeHTML, t as escapeProp, l as getCacheTags, x as getClientJsEntries, w as getCssEntries, d as getHeadContent, v as getIslandEntries, E as getIslandProps, f as getSchemas, p as getSsrIslands, S as isIslandPropsExternalized, y as isValidElement, h as jsxFactory, m as pushIslandProps, c as pushMetadata, D as pushSchema, A as registerIsland, u as registerSsrIsland, L as render, n as renderJsxToHtmlString, e as renderToRenderedNode, k as resolveMetadata, o as runInRenderContext, R as sequence, i as setViewName, V as startServer, O as useClientJs, s as useCss, a as useRequest };
@@ -1,4 +1,4 @@
1
- import { t as e } from "./rolldown-runtime-B0aSnxlc.js";
1
+ import { t as e } from "./rolldown-runtime-DtPi1Y-2.js";
2
2
  import { t } from "./defineMiddleware-D017PWDc.js";
3
3
  //#endregion
4
4
  //#region src/core/request.ts
@@ -214,4 +214,4 @@ function l(e, t) {
214
214
  //#endregion
215
215
  export { r as i, a as n, i as r, c as t };
216
216
 
217
- //# sourceMappingURL=middleware-CnDqZobD.js.map
217
+ //# sourceMappingURL=middleware-B8m9wPBe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"middleware-CnDqZobD.js","names":["parseCookieHeader"],"sources":["../../../node_modules/.pnpm/cookie@1.1.1/node_modules/cookie/dist/index.js","../src/core/request.ts","../src/middleware/sequence.ts","../src/middleware/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseCookie = parseCookie;\nexports.parse = parseCookie;\nexports.stringifyCookie = stringifyCookie;\nexports.stringifySetCookie = stringifySetCookie;\nexports.serialize = stringifySetCookie;\nexports.parseSetCookie = parseSetCookie;\nexports.stringifySetCookie = stringifySetCookie;\nexports.serialize = stringifySetCookie;\n/**\n * RegExp to match cookie-name in RFC 6265 sec 4.1.1\n * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2\n * which has been replaced by the token definition in RFC 7230 appendix B.\n *\n * cookie-name = token\n * token = 1*tchar\n * tchar = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" /\n * \"*\" / \"+\" / \"-\" / \".\" / \"^\" / \"_\" /\n * \"`\" / \"|\" / \"~\" / DIGIT / ALPHA\n *\n * Note: Allowing more characters - https://github.com/jshttp/cookie/issues/191\n * Allow same range as cookie value, except `=`, which delimits end of name.\n */\nconst cookieNameRegExp = /^[\\u0021-\\u003A\\u003C\\u003E-\\u007E]+$/;\n/**\n * RegExp to match cookie-value in RFC 6265 sec 4.1.1\n *\n * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n * ; US-ASCII characters excluding CTLs,\n * ; whitespace DQUOTE, comma, semicolon,\n * ; and backslash\n *\n * Allowing more characters: https://github.com/jshttp/cookie/issues/191\n * Comma, backslash, and DQUOTE are not part of the parsing algorithm.\n */\nconst cookieValueRegExp = /^[\\u0021-\\u003A\\u003C-\\u007E]*$/;\n/**\n * RegExp to match domain-value in RFC 6265 sec 4.1.1\n *\n * domain-value = <subdomain>\n * ; defined in [RFC1034], Section 3.5, as\n * ; enhanced by [RFC1123], Section 2.1\n * <subdomain> = <label> | <subdomain> \".\" <label>\n * <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]\n * Labels must be 63 characters or less.\n * 'let-dig' not 'letter' in the first char, per RFC1123\n * <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>\n * <let-dig-hyp> = <let-dig> | \"-\"\n * <let-dig> = <letter> | <digit>\n * <letter> = any one of the 52 alphabetic characters A through Z in\n * upper case and a through z in lower case\n * <digit> = any one of the ten digits 0 through 9\n *\n * Keep support for leading dot: https://github.com/jshttp/cookie/issues/173\n *\n * > (Note that a leading %x2E (\".\"), if present, is ignored even though that\n * character is not permitted, but a trailing %x2E (\".\"), if present, will\n * cause the user agent to ignore the attribute.)\n */\nconst domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;\n/**\n * RegExp to match path-value in RFC 6265 sec 4.1.1\n *\n * path-value = <any CHAR except CTLs or \";\">\n * CHAR = %x01-7F\n * ; defined in RFC 5234 appendix B.1\n */\nconst pathValueRegExp = /^[\\u0020-\\u003A\\u003D-\\u007E]*$/;\n/**\n * RegExp to match max-age-value in RFC 6265 sec 5.6.2\n */\nconst maxAgeRegExp = /^-?\\d+$/;\nconst __toString = Object.prototype.toString;\nconst NullObject = /* @__PURE__ */ (() => {\n const C = function () { };\n C.prototype = Object.create(null);\n return C;\n})();\n/**\n * Parse a `Cookie` header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n */\nfunction parseCookie(str, options) {\n const obj = new NullObject();\n const len = str.length;\n // RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='.\n if (len < 2)\n return obj;\n const dec = options?.decode || decode;\n let index = 0;\n do {\n const eqIdx = eqIndex(str, index, len);\n if (eqIdx === -1)\n break; // No more cookie pairs.\n const endIdx = endIndex(str, index, len);\n if (eqIdx > endIdx) {\n // backtrack on prior semicolon\n index = str.lastIndexOf(\";\", eqIdx - 1) + 1;\n continue;\n }\n const key = valueSlice(str, index, eqIdx);\n // only assign once\n if (obj[key] === undefined) {\n obj[key] = dec(valueSlice(str, eqIdx + 1, endIdx));\n }\n index = endIdx + 1;\n } while (index < len);\n return obj;\n}\n/**\n * Stringifies an object into an HTTP `Cookie` header.\n */\nfunction stringifyCookie(cookie, options) {\n const enc = options?.encode || encodeURIComponent;\n const cookieStrings = [];\n for (const name of Object.keys(cookie)) {\n const val = cookie[name];\n if (val === undefined)\n continue;\n if (!cookieNameRegExp.test(name)) {\n throw new TypeError(`cookie name is invalid: ${name}`);\n }\n const value = enc(val);\n if (!cookieValueRegExp.test(value)) {\n throw new TypeError(`cookie val is invalid: ${val}`);\n }\n cookieStrings.push(`${name}=${value}`);\n }\n return cookieStrings.join(\"; \");\n}\nfunction stringifySetCookie(_name, _val, _opts) {\n const cookie = typeof _name === \"object\"\n ? _name\n : { ..._opts, name: _name, value: String(_val) };\n const options = typeof _val === \"object\" ? _val : _opts;\n const enc = options?.encode || encodeURIComponent;\n if (!cookieNameRegExp.test(cookie.name)) {\n throw new TypeError(`argument name is invalid: ${cookie.name}`);\n }\n const value = cookie.value ? enc(cookie.value) : \"\";\n if (!cookieValueRegExp.test(value)) {\n throw new TypeError(`argument val is invalid: ${cookie.value}`);\n }\n let str = cookie.name + \"=\" + value;\n if (cookie.maxAge !== undefined) {\n if (!Number.isInteger(cookie.maxAge)) {\n throw new TypeError(`option maxAge is invalid: ${cookie.maxAge}`);\n }\n str += \"; Max-Age=\" + cookie.maxAge;\n }\n if (cookie.domain) {\n if (!domainValueRegExp.test(cookie.domain)) {\n throw new TypeError(`option domain is invalid: ${cookie.domain}`);\n }\n str += \"; Domain=\" + cookie.domain;\n }\n if (cookie.path) {\n if (!pathValueRegExp.test(cookie.path)) {\n throw new TypeError(`option path is invalid: ${cookie.path}`);\n }\n str += \"; Path=\" + cookie.path;\n }\n if (cookie.expires) {\n if (!isDate(cookie.expires) || !Number.isFinite(cookie.expires.valueOf())) {\n throw new TypeError(`option expires is invalid: ${cookie.expires}`);\n }\n str += \"; Expires=\" + cookie.expires.toUTCString();\n }\n if (cookie.httpOnly) {\n str += \"; HttpOnly\";\n }\n if (cookie.secure) {\n str += \"; Secure\";\n }\n if (cookie.partitioned) {\n str += \"; Partitioned\";\n }\n if (cookie.priority) {\n const priority = typeof cookie.priority === \"string\"\n ? cookie.priority.toLowerCase()\n : undefined;\n switch (priority) {\n case \"low\":\n str += \"; Priority=Low\";\n break;\n case \"medium\":\n str += \"; Priority=Medium\";\n break;\n case \"high\":\n str += \"; Priority=High\";\n break;\n default:\n throw new TypeError(`option priority is invalid: ${cookie.priority}`);\n }\n }\n if (cookie.sameSite) {\n const sameSite = typeof cookie.sameSite === \"string\"\n ? cookie.sameSite.toLowerCase()\n : cookie.sameSite;\n switch (sameSite) {\n case true:\n case \"strict\":\n str += \"; SameSite=Strict\";\n break;\n case \"lax\":\n str += \"; SameSite=Lax\";\n break;\n case \"none\":\n str += \"; SameSite=None\";\n break;\n default:\n throw new TypeError(`option sameSite is invalid: ${cookie.sameSite}`);\n }\n }\n return str;\n}\n/**\n * Deserialize a `Set-Cookie` header into an object.\n *\n * deserialize('foo=bar; httpOnly')\n * => { name: 'foo', value: 'bar', httpOnly: true }\n */\nfunction parseSetCookie(str, options) {\n const dec = options?.decode || decode;\n const len = str.length;\n const endIdx = endIndex(str, 0, len);\n const eqIdx = eqIndex(str, 0, endIdx);\n const setCookie = eqIdx === -1\n ? { name: \"\", value: dec(valueSlice(str, 0, endIdx)) }\n : {\n name: valueSlice(str, 0, eqIdx),\n value: dec(valueSlice(str, eqIdx + 1, endIdx)),\n };\n let index = endIdx + 1;\n while (index < len) {\n const endIdx = endIndex(str, index, len);\n const eqIdx = eqIndex(str, index, endIdx);\n const attr = eqIdx === -1\n ? valueSlice(str, index, endIdx)\n : valueSlice(str, index, eqIdx);\n const val = eqIdx === -1 ? undefined : valueSlice(str, eqIdx + 1, endIdx);\n switch (attr.toLowerCase()) {\n case \"httponly\":\n setCookie.httpOnly = true;\n break;\n case \"secure\":\n setCookie.secure = true;\n break;\n case \"partitioned\":\n setCookie.partitioned = true;\n break;\n case \"domain\":\n setCookie.domain = val;\n break;\n case \"path\":\n setCookie.path = val;\n break;\n case \"max-age\":\n if (val && maxAgeRegExp.test(val))\n setCookie.maxAge = Number(val);\n break;\n case \"expires\":\n if (!val)\n break;\n const date = new Date(val);\n if (Number.isFinite(date.valueOf()))\n setCookie.expires = date;\n break;\n case \"priority\":\n if (!val)\n break;\n const priority = val.toLowerCase();\n if (priority === \"low\" ||\n priority === \"medium\" ||\n priority === \"high\") {\n setCookie.priority = priority;\n }\n break;\n case \"samesite\":\n if (!val)\n break;\n const sameSite = val.toLowerCase();\n if (sameSite === \"lax\" ||\n sameSite === \"strict\" ||\n sameSite === \"none\") {\n setCookie.sameSite = sameSite;\n }\n break;\n }\n index = endIdx + 1;\n }\n return setCookie;\n}\n/**\n * Find the `;` character between `min` and `len` in str.\n */\nfunction endIndex(str, min, len) {\n const index = str.indexOf(\";\", min);\n return index === -1 ? len : index;\n}\n/**\n * Find the `=` character between `min` and `max` in str.\n */\nfunction eqIndex(str, min, max) {\n const index = str.indexOf(\"=\", min);\n return index < max ? index : -1;\n}\n/**\n * Slice out a value between startPod to max.\n */\nfunction valueSlice(str, min, max) {\n let start = min;\n let end = max;\n do {\n const code = str.charCodeAt(start);\n if (code !== 0x20 /* */ && code !== 0x09 /* \\t */)\n break;\n } while (++start < end);\n while (end > start) {\n const code = str.charCodeAt(end - 1);\n if (code !== 0x20 /* */ && code !== 0x09 /* \\t */)\n break;\n end--;\n }\n return str.slice(start, end);\n}\n/**\n * URL-decode string value. Optimized to skip native call when no %.\n */\nfunction decode(str) {\n if (str.indexOf(\"%\") === -1)\n return str;\n try {\n return decodeURIComponent(str);\n }\n catch (e) {\n return str;\n }\n}\n/**\n * Determine if value is a Date.\n */\nfunction isDate(val) {\n return __toString.call(val) === \"[object Date]\";\n}\n//# sourceMappingURL=index.js.map","import { parse as parseCookieHeader } from 'cookie';\nimport type { Request } from 'express';\n\nexport function parseCookies(cookieHeader?: string): Record<string, string> {\n if (!cookieHeader) return {};\n\n // `cookie.parse` decodes values safely (malformed %-sequences fall back to the\n // raw value instead of throwing) and ignores prototype keys.\n const parsed = parseCookieHeader(cookieHeader);\n const cookies: Record<string, string> = {};\n for (const [name, value] of Object.entries(parsed)) {\n if (value !== undefined) {\n cookies[name] = value;\n }\n }\n return cookies;\n}\n\nexport function createHeadersFromExpressRequest(req: Request): Headers {\n const headers = new Headers();\n\n Object.entries(req.headers).forEach(([key, value]) => {\n if (value === undefined) return;\n if (Array.isArray(value)) {\n value.forEach((item) => headers.append(key, item));\n return;\n }\n headers.set(key, value);\n });\n\n return headers;\n}\n","import { parseCookies } from '../core/request';\nimport { defineMiddleware } from './defineMiddleware';\nimport type { MiddlewareContext, MiddlewareHandler, RewritePayload } from './types';\n\n// From SvelteKit via Astro: compose middleware handlers in declaration order.\nexport function sequence(...handlers: Array<MiddlewareHandler | false | null | undefined>) {\n const filtered = handlers.filter(Boolean) as MiddlewareHandler[];\n const length = filtered.length;\n\n if (!length) {\n return defineMiddleware((_context, next) => {\n return next();\n });\n }\n\n return defineMiddleware((context, next) => {\n let carriedPayload: RewritePayload | undefined;\n return applyHandle(0, context);\n\n function applyHandle(\n i: number,\n handleContext: MiddlewareContext,\n ): Promise<Response> | Response {\n const handle = filtered[i];\n\n return handle(handleContext, async (payload?: RewritePayload) => {\n if (i < length - 1) {\n if (payload) {\n carriedPayload = payload;\n updateContextForRewrite(handleContext, payload);\n }\n return applyHandle(i + 1, handleContext);\n }\n\n return next(payload ?? carriedPayload);\n });\n }\n });\n}\n\nfunction updateContextForRewrite(context: MiddlewareContext, payload: RewritePayload): void {\n let request: Request;\n\n if (payload instanceof Request) {\n request = payload;\n } else if (payload instanceof URL) {\n request = new Request(payload.href, context.request.clone());\n } else {\n request = new Request(new URL(payload, context.url).href, context.request.clone());\n }\n\n const previousUrl = context.url;\n const nextUrl = new URL(request.url);\n const nextCookies = parseCookies(request.headers.get('cookie') ?? undefined);\n context.request = request;\n context.url = nextUrl;\n context.cookies = nextCookies;\n\n if (context.requestInfo) {\n const headers: Record<string, string> = {};\n request.headers.forEach((value, key) => {\n headers[key] = value;\n });\n\n context.requestInfo = {\n ...context.requestInfo,\n url: nextUrl,\n path: getRequestInfoPath(nextUrl, previousUrl, context.requestInfo.path),\n pathname: nextUrl.pathname,\n method: request.method,\n headers,\n cookies: nextCookies,\n query: Object.fromEntries(nextUrl.searchParams.entries()),\n };\n }\n}\n\nfunction getRequestInfoPath(nextUrl: URL, previousUrl: URL, previousPath?: string): string {\n const nextPath = `${nextUrl.pathname}${nextUrl.search}` || '/';\n if (!previousPath) {\n return nextPath;\n }\n\n const previousPathname = previousPath.split('?')[0] || '/';\n if (\n previousPathname === previousUrl.pathname ||\n !previousUrl.pathname.endsWith(previousPathname)\n ) {\n return nextPath;\n }\n\n const basePathname = previousUrl.pathname.slice(\n 0,\n previousUrl.pathname.length - previousPathname.length,\n );\n if (!basePathname || !nextUrl.pathname.startsWith(basePathname)) {\n return nextPath;\n }\n\n const strippedPathname = nextUrl.pathname.slice(basePathname.length) || '/';\n const normalizedPathname = strippedPathname.startsWith('/')\n ? strippedPathname\n : `/${strippedPathname}`;\n return `${normalizedPathname}${nextUrl.search}`;\n}\n","import { parseCookies } from '../core/request';\nimport { defineMiddleware } from './defineMiddleware';\nimport { sequence } from './sequence';\nimport type { CreateContext, MiddlewareContext, RewritePayload } from './types';\n\nexport type {\n CreateContext,\n MiddlewareContext,\n MiddlewareHandler,\n MiddlewareNext,\n RewritePayload,\n} from './types';\n\nexport { defineMiddleware, sequence };\n\nexport function createContext({\n request,\n requestInfo,\n locals = {},\n clientAddress,\n}: CreateContext): MiddlewareContext {\n const context = {\n cookies: parseCookies(request.headers.get('cookie') ?? undefined),\n request,\n requestInfo,\n url: new URL(request.url),\n redirect(path: string | URL, status = 302) {\n return new Response(null, {\n status,\n headers: {\n Location: path.toString(),\n },\n });\n },\n rewrite(payload: RewritePayload) {\n return Promise.resolve(new Response(null));\n },\n get clientAddress() {\n if (clientAddress) {\n return clientAddress;\n }\n throw new Error('clientAddress is not available for this request.');\n },\n } as Omit<MiddlewareContext, 'locals'> & {\n locals: Record<string, unknown>;\n };\n\n Object.defineProperty(context, 'locals', {\n enumerable: true,\n get() {\n if (typeof locals !== 'object' || locals === null || Array.isArray(locals)) {\n throw new Error('Middleware locals must be a plain object.');\n }\n return locals;\n },\n set() {\n throw new Error('Middleware locals cannot be reassigned. Mutate its properties instead.');\n },\n });\n\n context.rewrite = (payload: RewritePayload) => {\n return Promise.resolve(\n new Response(null, {\n status: 307,\n headers: {\n 'X-L5E-Rewrite': stringifyRewritePayload(payload, context.url),\n },\n }),\n );\n };\n\n return context;\n}\n\nfunction stringifyRewritePayload(payload: RewritePayload, currentUrl: URL): string {\n if (payload instanceof Request) {\n return payload.url;\n }\n\n if (payload instanceof URL) {\n return payload.href;\n }\n\n return new URL(payload, currentUrl).href;\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;CASA,AARA,OAAO,eAAe,GAAS,cAAc,EAAE,OAAO,GAAK,CAAC,GAE5D,EAAQ,QAAQ,GAEhB,EAAQ,qBAAqB,GAC7B,EAAQ,YAAY,GAEpB,EAAQ,qBAAqB,GAC7B,EAAQ,YAAY;CAepB,IAAM,IAAmB,yCAanB,IAAoB,mCAwBpB,IAAoB,uFAQpB,IAAkB,mCAKlB,IAAa,OAAO,UAAU,UAC9B,IAA6B,uBAAO;EACtC,IAAM,IAAI,WAAY,CAAE;EAExB,OADA,EAAE,YAAY,OAAO,OAAO,IAAI,GACzB;CACX,EAAA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b,aAAmB,MACd,EAAQ,OAGV,IAAI,IAAI,GAAS,CAAU,CAAC,CAAC;AACtC"}
1
+ {"version":3,"file":"middleware-B8m9wPBe.js","names":["parseCookieHeader"],"sources":["../../../node_modules/.pnpm/cookie@1.1.1/node_modules/cookie/dist/index.js","../src/core/request.ts","../src/middleware/sequence.ts","../src/middleware/index.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseCookie = parseCookie;\nexports.parse = parseCookie;\nexports.stringifyCookie = stringifyCookie;\nexports.stringifySetCookie = stringifySetCookie;\nexports.serialize = stringifySetCookie;\nexports.parseSetCookie = parseSetCookie;\nexports.stringifySetCookie = stringifySetCookie;\nexports.serialize = stringifySetCookie;\n/**\n * RegExp to match cookie-name in RFC 6265 sec 4.1.1\n * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2\n * which has been replaced by the token definition in RFC 7230 appendix B.\n *\n * cookie-name = token\n * token = 1*tchar\n * tchar = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" /\n * \"*\" / \"+\" / \"-\" / \".\" / \"^\" / \"_\" /\n * \"`\" / \"|\" / \"~\" / DIGIT / ALPHA\n *\n * Note: Allowing more characters - https://github.com/jshttp/cookie/issues/191\n * Allow same range as cookie value, except `=`, which delimits end of name.\n */\nconst cookieNameRegExp = /^[\\u0021-\\u003A\\u003C\\u003E-\\u007E]+$/;\n/**\n * RegExp to match cookie-value in RFC 6265 sec 4.1.1\n *\n * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n * ; US-ASCII characters excluding CTLs,\n * ; whitespace DQUOTE, comma, semicolon,\n * ; and backslash\n *\n * Allowing more characters: https://github.com/jshttp/cookie/issues/191\n * Comma, backslash, and DQUOTE are not part of the parsing algorithm.\n */\nconst cookieValueRegExp = /^[\\u0021-\\u003A\\u003C-\\u007E]*$/;\n/**\n * RegExp to match domain-value in RFC 6265 sec 4.1.1\n *\n * domain-value = <subdomain>\n * ; defined in [RFC1034], Section 3.5, as\n * ; enhanced by [RFC1123], Section 2.1\n * <subdomain> = <label> | <subdomain> \".\" <label>\n * <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]\n * Labels must be 63 characters or less.\n * 'let-dig' not 'letter' in the first char, per RFC1123\n * <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>\n * <let-dig-hyp> = <let-dig> | \"-\"\n * <let-dig> = <letter> | <digit>\n * <letter> = any one of the 52 alphabetic characters A through Z in\n * upper case and a through z in lower case\n * <digit> = any one of the ten digits 0 through 9\n *\n * Keep support for leading dot: https://github.com/jshttp/cookie/issues/173\n *\n * > (Note that a leading %x2E (\".\"), if present, is ignored even though that\n * character is not permitted, but a trailing %x2E (\".\"), if present, will\n * cause the user agent to ignore the attribute.)\n */\nconst domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;\n/**\n * RegExp to match path-value in RFC 6265 sec 4.1.1\n *\n * path-value = <any CHAR except CTLs or \";\">\n * CHAR = %x01-7F\n * ; defined in RFC 5234 appendix B.1\n */\nconst pathValueRegExp = /^[\\u0020-\\u003A\\u003D-\\u007E]*$/;\n/**\n * RegExp to match max-age-value in RFC 6265 sec 5.6.2\n */\nconst maxAgeRegExp = /^-?\\d+$/;\nconst __toString = Object.prototype.toString;\nconst NullObject = /* @__PURE__ */ (() => {\n const C = function () { };\n C.prototype = Object.create(null);\n return C;\n})();\n/**\n * Parse a `Cookie` header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n */\nfunction parseCookie(str, options) {\n const obj = new NullObject();\n const len = str.length;\n // RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='.\n if (len < 2)\n return obj;\n const dec = options?.decode || decode;\n let index = 0;\n do {\n const eqIdx = eqIndex(str, index, len);\n if (eqIdx === -1)\n break; // No more cookie pairs.\n const endIdx = endIndex(str, index, len);\n if (eqIdx > endIdx) {\n // backtrack on prior semicolon\n index = str.lastIndexOf(\";\", eqIdx - 1) + 1;\n continue;\n }\n const key = valueSlice(str, index, eqIdx);\n // only assign once\n if (obj[key] === undefined) {\n obj[key] = dec(valueSlice(str, eqIdx + 1, endIdx));\n }\n index = endIdx + 1;\n } while (index < len);\n return obj;\n}\n/**\n * Stringifies an object into an HTTP `Cookie` header.\n */\nfunction stringifyCookie(cookie, options) {\n const enc = options?.encode || encodeURIComponent;\n const cookieStrings = [];\n for (const name of Object.keys(cookie)) {\n const val = cookie[name];\n if (val === undefined)\n continue;\n if (!cookieNameRegExp.test(name)) {\n throw new TypeError(`cookie name is invalid: ${name}`);\n }\n const value = enc(val);\n if (!cookieValueRegExp.test(value)) {\n throw new TypeError(`cookie val is invalid: ${val}`);\n }\n cookieStrings.push(`${name}=${value}`);\n }\n return cookieStrings.join(\"; \");\n}\nfunction stringifySetCookie(_name, _val, _opts) {\n const cookie = typeof _name === \"object\"\n ? _name\n : { ..._opts, name: _name, value: String(_val) };\n const options = typeof _val === \"object\" ? _val : _opts;\n const enc = options?.encode || encodeURIComponent;\n if (!cookieNameRegExp.test(cookie.name)) {\n throw new TypeError(`argument name is invalid: ${cookie.name}`);\n }\n const value = cookie.value ? enc(cookie.value) : \"\";\n if (!cookieValueRegExp.test(value)) {\n throw new TypeError(`argument val is invalid: ${cookie.value}`);\n }\n let str = cookie.name + \"=\" + value;\n if (cookie.maxAge !== undefined) {\n if (!Number.isInteger(cookie.maxAge)) {\n throw new TypeError(`option maxAge is invalid: ${cookie.maxAge}`);\n }\n str += \"; Max-Age=\" + cookie.maxAge;\n }\n if (cookie.domain) {\n if (!domainValueRegExp.test(cookie.domain)) {\n throw new TypeError(`option domain is invalid: ${cookie.domain}`);\n }\n str += \"; Domain=\" + cookie.domain;\n }\n if (cookie.path) {\n if (!pathValueRegExp.test(cookie.path)) {\n throw new TypeError(`option path is invalid: ${cookie.path}`);\n }\n str += \"; Path=\" + cookie.path;\n }\n if (cookie.expires) {\n if (!isDate(cookie.expires) || !Number.isFinite(cookie.expires.valueOf())) {\n throw new TypeError(`option expires is invalid: ${cookie.expires}`);\n }\n str += \"; Expires=\" + cookie.expires.toUTCString();\n }\n if (cookie.httpOnly) {\n str += \"; HttpOnly\";\n }\n if (cookie.secure) {\n str += \"; Secure\";\n }\n if (cookie.partitioned) {\n str += \"; Partitioned\";\n }\n if (cookie.priority) {\n const priority = typeof cookie.priority === \"string\"\n ? cookie.priority.toLowerCase()\n : undefined;\n switch (priority) {\n case \"low\":\n str += \"; Priority=Low\";\n break;\n case \"medium\":\n str += \"; Priority=Medium\";\n break;\n case \"high\":\n str += \"; Priority=High\";\n break;\n default:\n throw new TypeError(`option priority is invalid: ${cookie.priority}`);\n }\n }\n if (cookie.sameSite) {\n const sameSite = typeof cookie.sameSite === \"string\"\n ? cookie.sameSite.toLowerCase()\n : cookie.sameSite;\n switch (sameSite) {\n case true:\n case \"strict\":\n str += \"; SameSite=Strict\";\n break;\n case \"lax\":\n str += \"; SameSite=Lax\";\n break;\n case \"none\":\n str += \"; SameSite=None\";\n break;\n default:\n throw new TypeError(`option sameSite is invalid: ${cookie.sameSite}`);\n }\n }\n return str;\n}\n/**\n * Deserialize a `Set-Cookie` header into an object.\n *\n * deserialize('foo=bar; httpOnly')\n * => { name: 'foo', value: 'bar', httpOnly: true }\n */\nfunction parseSetCookie(str, options) {\n const dec = options?.decode || decode;\n const len = str.length;\n const endIdx = endIndex(str, 0, len);\n const eqIdx = eqIndex(str, 0, endIdx);\n const setCookie = eqIdx === -1\n ? { name: \"\", value: dec(valueSlice(str, 0, endIdx)) }\n : {\n name: valueSlice(str, 0, eqIdx),\n value: dec(valueSlice(str, eqIdx + 1, endIdx)),\n };\n let index = endIdx + 1;\n while (index < len) {\n const endIdx = endIndex(str, index, len);\n const eqIdx = eqIndex(str, index, endIdx);\n const attr = eqIdx === -1\n ? valueSlice(str, index, endIdx)\n : valueSlice(str, index, eqIdx);\n const val = eqIdx === -1 ? undefined : valueSlice(str, eqIdx + 1, endIdx);\n switch (attr.toLowerCase()) {\n case \"httponly\":\n setCookie.httpOnly = true;\n break;\n case \"secure\":\n setCookie.secure = true;\n break;\n case \"partitioned\":\n setCookie.partitioned = true;\n break;\n case \"domain\":\n setCookie.domain = val;\n break;\n case \"path\":\n setCookie.path = val;\n break;\n case \"max-age\":\n if (val && maxAgeRegExp.test(val))\n setCookie.maxAge = Number(val);\n break;\n case \"expires\":\n if (!val)\n break;\n const date = new Date(val);\n if (Number.isFinite(date.valueOf()))\n setCookie.expires = date;\n break;\n case \"priority\":\n if (!val)\n break;\n const priority = val.toLowerCase();\n if (priority === \"low\" ||\n priority === \"medium\" ||\n priority === \"high\") {\n setCookie.priority = priority;\n }\n break;\n case \"samesite\":\n if (!val)\n break;\n const sameSite = val.toLowerCase();\n if (sameSite === \"lax\" ||\n sameSite === \"strict\" ||\n sameSite === \"none\") {\n setCookie.sameSite = sameSite;\n }\n break;\n }\n index = endIdx + 1;\n }\n return setCookie;\n}\n/**\n * Find the `;` character between `min` and `len` in str.\n */\nfunction endIndex(str, min, len) {\n const index = str.indexOf(\";\", min);\n return index === -1 ? len : index;\n}\n/**\n * Find the `=` character between `min` and `max` in str.\n */\nfunction eqIndex(str, min, max) {\n const index = str.indexOf(\"=\", min);\n return index < max ? index : -1;\n}\n/**\n * Slice out a value between startPod to max.\n */\nfunction valueSlice(str, min, max) {\n let start = min;\n let end = max;\n do {\n const code = str.charCodeAt(start);\n if (code !== 0x20 /* */ && code !== 0x09 /* \\t */)\n break;\n } while (++start < end);\n while (end > start) {\n const code = str.charCodeAt(end - 1);\n if (code !== 0x20 /* */ && code !== 0x09 /* \\t */)\n break;\n end--;\n }\n return str.slice(start, end);\n}\n/**\n * URL-decode string value. Optimized to skip native call when no %.\n */\nfunction decode(str) {\n if (str.indexOf(\"%\") === -1)\n return str;\n try {\n return decodeURIComponent(str);\n }\n catch (e) {\n return str;\n }\n}\n/**\n * Determine if value is a Date.\n */\nfunction isDate(val) {\n return __toString.call(val) === \"[object Date]\";\n}\n//# sourceMappingURL=index.js.map","import { parse as parseCookieHeader } from 'cookie';\nimport type { Request } from 'express';\n\nexport function parseCookies(cookieHeader?: string): Record<string, string> {\n if (!cookieHeader) return {};\n\n // `cookie.parse` decodes values safely (malformed %-sequences fall back to the\n // raw value instead of throwing) and ignores prototype keys.\n const parsed = parseCookieHeader(cookieHeader);\n const cookies: Record<string, string> = {};\n for (const [name, value] of Object.entries(parsed)) {\n if (value !== undefined) {\n cookies[name] = value;\n }\n }\n return cookies;\n}\n\nexport function createHeadersFromExpressRequest(req: Request): Headers {\n const headers = new Headers();\n\n Object.entries(req.headers).forEach(([key, value]) => {\n if (value === undefined) return;\n if (Array.isArray(value)) {\n value.forEach((item) => headers.append(key, item));\n return;\n }\n headers.set(key, value);\n });\n\n return headers;\n}\n","import { parseCookies } from '../core/request';\nimport { defineMiddleware } from './defineMiddleware';\nimport type { MiddlewareContext, MiddlewareHandler, RewritePayload } from './types';\n\n// From SvelteKit via Astro: compose middleware handlers in declaration order.\nexport function sequence(...handlers: Array<MiddlewareHandler | false | null | undefined>) {\n const filtered = handlers.filter(Boolean) as MiddlewareHandler[];\n const length = filtered.length;\n\n if (!length) {\n return defineMiddleware((_context, next) => {\n return next();\n });\n }\n\n return defineMiddleware((context, next) => {\n let carriedPayload: RewritePayload | undefined;\n return applyHandle(0, context);\n\n function applyHandle(\n i: number,\n handleContext: MiddlewareContext,\n ): Promise<Response> | Response {\n const handle = filtered[i];\n\n return handle(handleContext, async (payload?: RewritePayload) => {\n if (i < length - 1) {\n if (payload) {\n carriedPayload = payload;\n updateContextForRewrite(handleContext, payload);\n }\n return applyHandle(i + 1, handleContext);\n }\n\n return next(payload ?? carriedPayload);\n });\n }\n });\n}\n\nfunction updateContextForRewrite(context: MiddlewareContext, payload: RewritePayload): void {\n let request: Request;\n\n if (payload instanceof Request) {\n request = payload;\n } else if (payload instanceof URL) {\n request = new Request(payload.href, context.request.clone());\n } else {\n request = new Request(new URL(payload, context.url).href, context.request.clone());\n }\n\n const previousUrl = context.url;\n const nextUrl = new URL(request.url);\n const nextCookies = parseCookies(request.headers.get('cookie') ?? undefined);\n context.request = request;\n context.url = nextUrl;\n context.cookies = nextCookies;\n\n if (context.requestInfo) {\n const headers: Record<string, string> = {};\n request.headers.forEach((value, key) => {\n headers[key] = value;\n });\n\n context.requestInfo = {\n ...context.requestInfo,\n url: nextUrl,\n path: getRequestInfoPath(nextUrl, previousUrl, context.requestInfo.path),\n pathname: nextUrl.pathname,\n method: request.method,\n headers,\n cookies: nextCookies,\n query: Object.fromEntries(nextUrl.searchParams.entries()),\n };\n }\n}\n\nfunction getRequestInfoPath(nextUrl: URL, previousUrl: URL, previousPath?: string): string {\n const nextPath = `${nextUrl.pathname}${nextUrl.search}` || '/';\n if (!previousPath) {\n return nextPath;\n }\n\n const previousPathname = previousPath.split('?')[0] || '/';\n if (\n previousPathname === previousUrl.pathname ||\n !previousUrl.pathname.endsWith(previousPathname)\n ) {\n return nextPath;\n }\n\n const basePathname = previousUrl.pathname.slice(\n 0,\n previousUrl.pathname.length - previousPathname.length,\n );\n if (!basePathname || !nextUrl.pathname.startsWith(basePathname)) {\n return nextPath;\n }\n\n const strippedPathname = nextUrl.pathname.slice(basePathname.length) || '/';\n const normalizedPathname = strippedPathname.startsWith('/')\n ? strippedPathname\n : `/${strippedPathname}`;\n return `${normalizedPathname}${nextUrl.search}`;\n}\n","import { parseCookies } from '../core/request';\nimport { defineMiddleware } from './defineMiddleware';\nimport { sequence } from './sequence';\nimport type { CreateContext, MiddlewareContext, RewritePayload } from './types';\n\nexport type {\n CreateContext,\n MiddlewareContext,\n MiddlewareHandler,\n MiddlewareNext,\n RewritePayload,\n} from './types';\n\nexport { defineMiddleware, sequence };\n\nexport function createContext({\n request,\n requestInfo,\n locals = {},\n clientAddress,\n}: CreateContext): MiddlewareContext {\n const context = {\n cookies: parseCookies(request.headers.get('cookie') ?? undefined),\n request,\n requestInfo,\n url: new URL(request.url),\n redirect(path: string | URL, status = 302) {\n return new Response(null, {\n status,\n headers: {\n Location: path.toString(),\n },\n });\n },\n rewrite(payload: RewritePayload) {\n return Promise.resolve(new Response(null));\n },\n get clientAddress() {\n if (clientAddress) {\n return clientAddress;\n }\n throw new Error('clientAddress is not available for this request.');\n },\n } as Omit<MiddlewareContext, 'locals'> & {\n locals: Record<string, unknown>;\n };\n\n Object.defineProperty(context, 'locals', {\n enumerable: true,\n get() {\n if (typeof locals !== 'object' || locals === null || Array.isArray(locals)) {\n throw new Error('Middleware locals must be a plain object.');\n }\n return locals;\n },\n set() {\n throw new Error('Middleware locals cannot be reassigned. Mutate its properties instead.');\n },\n });\n\n context.rewrite = (payload: RewritePayload) => {\n return Promise.resolve(\n new Response(null, {\n status: 307,\n headers: {\n 'X-L5E-Rewrite': stringifyRewritePayload(payload, context.url),\n },\n }),\n );\n };\n\n return context;\n}\n\nfunction stringifyRewritePayload(payload: RewritePayload, currentUrl: URL): string {\n if (payload instanceof Request) {\n return payload.url;\n }\n\n if (payload instanceof URL) {\n return payload.href;\n }\n\n return new URL(payload, currentUrl).href;\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;;CASA,AARA,OAAO,eAAe,GAAS,cAAc,EAAE,OAAO,GAAK,CAAC,GAE5D,EAAQ,QAAQ,GAEhB,EAAQ,qBAAqB,GAC7B,EAAQ,YAAY,GAEpB,EAAQ,qBAAqB,GAC7B,EAAQ,YAAY;CAepB,IAAM,IAAmB,yCAanB,IAAoB,mCAwBpB,IAAoB,uFAQpB,IAAkB,mCAKlB,IAAa,OAAO,UAAU,UAC9B,IAA6B,uBAAO;EACtC,IAAM,IAAI,WAAY,CAAE;EAExB,OADA,EAAE,YAAY,OAAO,OAAO,IAAI,GACzB;CACX,EAAA,CAAG;CAOH,SAAS,EAAY,GAAK,GAAS;EAC/B,IAAM,IAAM,IAAI,EAA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tC"}
@@ -1,3 +1,3 @@
1
- import { n as e, t } from "./middleware-CnDqZobD.js";
1
+ import { n as e, t } from "./middleware-B8m9wPBe.js";
2
2
  import { t as n } from "./defineMiddleware-D017PWDc.js";
3
3
  export { t as createContext, n as defineMiddleware, e as sequence };
@@ -1,4 +1,4 @@
1
- import { t as e } from "./rolldown-runtime-B0aSnxlc.js";
1
+ import { t as e } from "./rolldown-runtime-DtPi1Y-2.js";
2
2
  import { D as t, r as n } from "./jsx-runtime-CI0Jmr-C.js";
3
3
  //#region ../../node_modules/.pnpm/serialize-javascript@7.0.5/node_modules/serialize-javascript/index.js
4
4
  var r = /* @__PURE__ */ e(((e, t) => {
@@ -149,4 +149,4 @@ function g(e) {
149
149
  //#endregion
150
150
  export { r as a, g as i, d as n, h as r, f as t };
151
151
 
152
- //# sourceMappingURL=render-hUQUreah.js.map
152
+ //# sourceMappingURL=render-Z3_uiPMp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"render-hUQUreah.js","names":[],"sources":["../../../node_modules/.pnpm/serialize-javascript@7.0.5/node_modules/serialize-javascript/index.js","../src/core/render.ts"],"sourcesContent":["/*\nCopyright (c) 2014, Yahoo! Inc. All rights reserved.\nCopyrights licensed under the New BSD License.\nSee the accompanying LICENSE file for terms.\n*/\n\n'use strict';\n\n// Generate an internal UID to make the regexp pattern harder to guess.\nvar UID_LENGTH = 16;\nvar UID = generateUID();\nvar PLACE_HOLDER_REGEXP = new RegExp('(\\\\\\\\)?\"@__(F|R|D|M|S|A|U|I|B|L)-' + UID + '-(\\\\d+)__@\"', 'g');\n\nvar IS_NATIVE_CODE_REGEXP = /\\{\\s*\\[native code\\]\\s*\\}/g;\nvar IS_PURE_FUNCTION = /function.*?\\(/;\nvar IS_ARROW_FUNCTION = /.*?=>.*?/;\nvar UNSAFE_CHARS_REGEXP = /[<>\\/\\u2028\\u2029]/g;\n// Regex to match </script> and variations (case-insensitive) for XSS protection\n// Matches </script followed by optional whitespace/attributes and >\nvar SCRIPT_CLOSE_REGEXP = /<\\/script[^>]*>/gi;\n\nvar RESERVED_SYMBOLS = ['*', 'async'];\n\n// Mapping of unsafe HTML and invalid JavaScript line terminator chars to their\n// Unicode char counterparts which are safe to use in JavaScript strings.\nvar ESCAPED_CHARS = {\n '<' : '\\\\u003C',\n '>' : '\\\\u003E',\n '/' : '\\\\u002F',\n '\\u2028': '\\\\u2028',\n '\\u2029': '\\\\u2029'\n};\n\nfunction escapeUnsafeChars(unsafeChar) {\n return ESCAPED_CHARS[unsafeChar];\n}\n\n// Escape function body for XSS protection while preserving arrow function syntax\nfunction escapeFunctionBody(str) {\n // Escape </script> sequences and variations (case-insensitive) - the main XSS risk\n // Matches </script followed by optional whitespace/attributes and >\n // This must be done first before other replacements\n str = str.replace(SCRIPT_CLOSE_REGEXP, function(match) {\n // Escape all <, /, and > characters in the closing script tag\n return match.replace(/</g, '\\\\u003C').replace(/\\//g, '\\\\u002F').replace(/>/g, '\\\\u003E');\n });\n // Escape line terminators (these are always unsafe)\n str = str.replace(/\\u2028/g, '\\\\u2028');\n str = str.replace(/\\u2029/g, '\\\\u2029');\n return str;\n}\n\nfunction generateUID() {\n var bytes = crypto.getRandomValues(new Uint8Array(UID_LENGTH));\n var result = '';\n for(var i=0; i<UID_LENGTH; ++i) {\n result += bytes[i].toString(16);\n }\n return result;\n}\n\nfunction deleteFunctions(obj){\n var functionKeys = [];\n for (var key in obj) {\n if (typeof obj[key] === \"function\") {\n functionKeys.push(key);\n }\n }\n for (var i = 0; i < functionKeys.length; i++) {\n delete obj[functionKeys[i]];\n }\n}\n\nmodule.exports = function serialize(obj, options) {\n options || (options = {});\n\n // Backwards-compatibility for `space` as the second argument.\n if (typeof options === 'number' || typeof options === 'string') {\n options = {space: options};\n }\n\n var functions = [];\n var regexps = [];\n var dates = [];\n var maps = [];\n var sets = [];\n var arrays = [];\n var undefs = [];\n var infinities= [];\n var bigInts = [];\n var urls = [];\n\n // Returns placeholders for functions and regexps (identified by index)\n // which are later replaced by their string representation.\n function replacer(key, value) {\n\n // For nested function\n if(options.ignoreFunction){\n deleteFunctions(value);\n }\n\n if (!value && value !== undefined && value !== BigInt(0)) {\n return value;\n }\n\n // If the value is an object w/ a toJSON method, toJSON is called before\n // the replacer runs, so we use this[key] to get the non-toJSONed value.\n var origValue = this[key];\n var type = typeof origValue;\n\n if (type === 'object') {\n if(origValue instanceof RegExp) {\n return '@__R-' + UID + '-' + (regexps.push(origValue) - 1) + '__@';\n }\n\n if(origValue instanceof Date) {\n return '@__D-' + UID + '-' + (dates.push(origValue) - 1) + '__@';\n }\n\n if(origValue instanceof Map) {\n return '@__M-' + UID + '-' + (maps.push(origValue) - 1) + '__@';\n }\n\n if(origValue instanceof Set) {\n return '@__S-' + UID + '-' + (sets.push(origValue) - 1) + '__@';\n }\n\n if(Array.isArray(origValue)) {\n var isSparse = Object.keys(origValue).length !== origValue.length;\n if (isSparse) {\n return '@__A-' + UID + '-' + (arrays.push(origValue) - 1) + '__@';\n }\n }\n\n if(origValue instanceof URL) {\n return '@__L-' + UID + '-' + (urls.push(origValue) - 1) + '__@';\n }\n }\n\n if (type === 'function') {\n return '@__F-' + UID + '-' + (functions.push(origValue) - 1) + '__@';\n }\n\n if (type === 'undefined') {\n return '@__U-' + UID + '-' + (undefs.push(origValue) - 1) + '__@';\n }\n\n if (type === 'number' && !isNaN(origValue) && !isFinite(origValue)) {\n return '@__I-' + UID + '-' + (infinities.push(origValue) - 1) + '__@';\n }\n\n if (type === 'bigint') {\n return '@__B-' + UID + '-' + (bigInts.push(origValue) - 1) + '__@';\n }\n\n return value;\n }\n\n function serializeFunc(fn, options) {\n var serializedFn = fn.toString();\n if (IS_NATIVE_CODE_REGEXP.test(serializedFn)) {\n throw new TypeError('Serializing native function: ' + fn.name);\n }\n\n // Escape unsafe HTML characters in function body for XSS protection\n // This must preserve arrow function syntax (=>) while escaping </script>\n if (options && options.unsafe !== true) {\n serializedFn = escapeFunctionBody(serializedFn);\n }\n\n // pure functions, example: {key: function() {}}\n if(IS_PURE_FUNCTION.test(serializedFn)) {\n return serializedFn;\n }\n\n // arrow functions, example: arg1 => arg1+5\n if(IS_ARROW_FUNCTION.test(serializedFn)) {\n return serializedFn;\n }\n\n var argsStartsAt = serializedFn.indexOf('(');\n var def = serializedFn.substr(0, argsStartsAt)\n .trim()\n .split(' ')\n .filter(function(val) { return val.length > 0 });\n\n var nonReservedSymbols = def.filter(function(val) {\n return RESERVED_SYMBOLS.indexOf(val) === -1\n });\n\n // enhanced literal objects, example: {key() {}}\n if(nonReservedSymbols.length > 0) {\n return (def.indexOf('async') > -1 ? 'async ' : '') + 'function'\n + (def.join('').indexOf('*') > -1 ? '*' : '')\n + serializedFn.substr(argsStartsAt);\n }\n\n // arrow functions\n return serializedFn;\n }\n\n // Check if the parameter is function\n if (options.ignoreFunction && typeof obj === \"function\") {\n obj = undefined;\n }\n // Protects against `JSON.stringify()` returning `undefined`, by serializing\n // to the literal string: \"undefined\".\n if (obj === undefined) {\n return String(obj);\n }\n\n var str;\n\n // Creates a JSON string representation of the value.\n // NOTE: Node 0.12 goes into slow mode with extra JSON.stringify() args.\n if (options.isJSON && !options.space) {\n str = JSON.stringify(obj);\n } else {\n str = JSON.stringify(obj, options.isJSON ? null : replacer, options.space);\n }\n\n // Protects against `JSON.stringify()` returning `undefined`, by serializing\n // to the literal string: \"undefined\".\n if (typeof str !== 'string') {\n return String(str);\n }\n\n // Replace unsafe HTML and invalid JavaScript line terminator chars with\n // their safe Unicode char counterpart. This _must_ happen before the\n // regexps and functions are serialized and added back to the string.\n if (options.unsafe !== true) {\n str = str.replace(UNSAFE_CHARS_REGEXP, escapeUnsafeChars);\n }\n\n if (functions.length === 0 && regexps.length === 0 && dates.length === 0 && maps.length === 0 && sets.length === 0 && arrays.length === 0 && undefs.length === 0 && infinities.length === 0 && bigInts.length === 0 && urls.length === 0) {\n return str;\n }\n\n // Replaces all occurrences of function, regexp, date, map and set placeholders in the\n // JSON string with their string representations. If the original value can\n // not be found, then `undefined` is used.\n return str.replace(PLACE_HOLDER_REGEXP, function (match, backSlash, type, valueIndex) {\n // The placeholder may not be preceded by a backslash. This is to prevent\n // replacing things like `\"a\\\"@__R-<UID>-0__@\"` and thus outputting\n // invalid JS.\n if (backSlash) {\n return match;\n }\n\n if (type === 'D') {\n // Validate ISO string format to prevent code injection via spoofed toISOString()\n var isoStr = String(dates[valueIndex].toISOString());\n if (!/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?Z$/.test(isoStr)) {\n throw new TypeError('Invalid Date ISO string');\n }\n return \"new Date(\\\"\" + isoStr + \"\\\")\";\n }\n\n if (type === 'R') {\n // Sanitize flags to prevent code injection (only allow valid RegExp flag characters)\n var flags = String(regexps[valueIndex].flags).replace(/[^gimsuydv]/g, '');\n return \"new RegExp(\" + serialize(regexps[valueIndex].source) + \", \\\"\" + flags + \"\\\")\";\n }\n\n if (type === 'M') {\n return \"new Map(\" + serialize(Array.from(maps[valueIndex].entries()), options) + \")\";\n }\n\n if (type === 'S') {\n return \"new Set(\" + serialize(Array.from(sets[valueIndex].values()), options) + \")\";\n }\n\n if (type === 'A') {\n return \"Array.prototype.slice.call(\" + serialize(Object.assign({ length: arrays[valueIndex].length }, arrays[valueIndex]), options) + \")\";\n }\n\n if (type === 'U') {\n return 'undefined'\n }\n\n if (type === 'I') {\n return infinities[valueIndex];\n }\n\n if (type === 'B') {\n return \"BigInt(\\\"\" + bigInts[valueIndex] + \"\\\")\";\n }\n\n if (type === 'L') {\n return \"new URL(\" + serialize(urls[valueIndex].toString(), options) + \")\";\n }\n\n var fn = functions[valueIndex];\n\n return serializeFunc(fn, options);\n });\n}\n","import { RAW_HTML_MARKER } from './const';\nimport {\n addCacheTag,\n type HtmlContentObject,\n type JSXChild,\n type JSXNode,\n type RenderedNode,\n} from './jsx-runtime';\n\nif (true) {\n console.log('render.ts');\n}\n\nconst VOID_ELEMENTS = new Set<string>([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n]);\n\nfunction classList(input: unknown): string {\n if (!input) return '';\n if (typeof input === 'string') return input;\n if (Array.isArray(input)) {\n return input.map(classList).filter(Boolean).join(' ');\n }\n if (typeof input === 'object') {\n return Object.keys(input as Record<string, boolean>)\n .filter((key) => (input as Record<string, boolean>)[key])\n .join(' ');\n }\n return '';\n}\n\n// Attribute-name validation, ported verbatim from React's react-dom\n// (DOMProperty.js `isAttributeNameSafe`). Untrusted spread props can carry\n// keys like `blah\" onclick=\"x` or `></div><script>…`; if such a key were\n// written as `${key}=\"…\"` it would inject new attributes / break out of the\n// tag. Names that don't match this grammar are dropped instead of emitted.\nconst ATTRIBUTE_NAME_START_CHAR =\n ':A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD';\nconst ATTRIBUTE_NAME_CHAR =\n ATTRIBUTE_NAME_START_CHAR + '\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040';\nconst VALID_ATTRIBUTE_NAME_REGEX = new RegExp(\n '^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$',\n);\nconst validatedAttributeNameCache: Record<string, boolean> = {};\nconst illegalAttributeNameCache: Record<string, boolean> = {};\n\nexport function isAttributeNameSafe(attributeName: string): boolean {\n if (Object.prototype.hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {\n return true;\n }\n if (Object.prototype.hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {\n return false;\n }\n if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {\n validatedAttributeNameCache[attributeName] = true;\n return true;\n }\n illegalAttributeNameCache[attributeName] = true;\n if (process.env.NODE_ENV !== 'production') {\n console.error('Invalid attribute name: `%s`', attributeName);\n }\n return false;\n}\n\nexport function escapeProp(value: string): string {\n return value\n .replaceAll('&', '&amp;')\n .replaceAll('\"', '&quot;')\n .replaceAll('<', '&lt;')\n .replaceAll('>', '&gt;')\n .replaceAll('\\n', '&#10;')\n .trim();\n}\n\nexport function escapeHTML(value: string): string {\n return value\n .replaceAll('&', '&amp;')\n .replaceAll('\"', '&quot;')\n .replaceAll(\"'\", '&#39;')\n .replaceAll('<', '&lt;')\n .replaceAll('>', '&gt;')\n .replaceAll('\\n', '<br/>');\n}\n\nfunction renderAttributes(props?: Record<string, any>): string {\n if (!props) return '';\n\n let classValue = '';\n if (props.classList !== undefined) {\n classValue = classList(props.classList);\n }\n if (props.class) {\n const existingClass = typeof props.class === 'string' ? props.class : '';\n classValue = classValue ? `${classValue} ${existingClass}`.trim() : existingClass;\n }\n\n const attrs = Object.entries(props)\n .filter(\n ([key]) =>\n key !== 'children' &&\n key !== 'classList' &&\n key !== 'setHtml' &&\n key !== 'setText' &&\n key !== 'class' &&\n key !== 'key' &&\n key !== 'cacheTag',\n )\n .map(([key, value]) => {\n // Drop attribute names that could break out of the tag (injection guard).\n if (!isAttributeNameSafe(key)) return '';\n\n // HTML standard behavior with function execution support\n if (value === false || value === null || value === undefined) return '';\n if (value === true) return key;\n\n // Execute function props and get result (new feature)\n if (typeof value === 'function') {\n const result = value();\n return `${key}=\"${escapeProp(result?.toString() || '')}\"`;\n }\n\n return `${key}=\"${escapeProp(value?.toString() || '')}\"`;\n })\n .filter(Boolean) as string[];\n\n if (classValue) {\n attrs.push(`class=\"${escapeProp(classValue)}\"`);\n }\n\n return attrs.join(' ');\n}\n\nfunction renderJsxToHtmlStringInternal(element: JSXChild): string {\n // HTML standard: skip boolean, null, undefined children\n if (element === null || typeof element === 'boolean' || element === undefined) return '';\n\n if (element && typeof element === 'object' && (element as any)[RAW_HTML_MARKER]) {\n return (element as any).content || '';\n }\n\n // Support htmlContent object (new feature)\n if (element && typeof element === 'object' && 'htmlContent' in element) {\n return (element as HtmlContentObject).htmlContent;\n }\n\n if (typeof element === 'string') return escapeHTML(element.toString());\n if (typeof element === 'number') return element.toString();\n\n if (Array.isArray(element)) {\n return (element as JSXChild[]).map((el) => renderJsxToHtmlStringInternal(el)).join('');\n }\n\n const { type, props, children } = element as JSXNode;\n\n // Collect cache tags from props\n if (props?.cacheTag) {\n addCacheTag(props.cacheTag);\n }\n\n if (typeof type === 'function') {\n const componentResult = (type as any)({ ...(props || {}), children });\n // Check if component returned a RenderedNode\n if (componentResult && typeof componentResult === 'object' && 'string' in componentResult) {\n return (componentResult as RenderedNode).string;\n }\n return renderJsxToHtmlStringInternal(componentResult as JSXChild);\n }\n\n const attrs = renderAttributes(props);\n const isVoidElement = VOID_ELEMENTS.has((type as string).toLowerCase());\n\n if (isVoidElement) {\n return `<${type}${attrs ? ' ' + attrs : ''} />`;\n }\n\n let childrenHtml = '';\n if (props?.setHtml !== undefined) {\n childrenHtml = props.setHtml?.toString() || '';\n } else if (props?.setText !== undefined) {\n childrenHtml = escapeHTML(props.setText?.toString() || '');\n } else {\n childrenHtml = (children as JSXChild[]).map((el) => renderJsxToHtmlStringInternal(el)).join('');\n }\n\n return `<${type}${attrs ? ' ' + attrs : ''}>${childrenHtml}</${type}>`;\n}\n\nexport function renderJsxToHtmlString(element: JSXChild | RenderedNode): string {\n // If already a RenderedNode, return its string\n if (element && typeof element === 'object' && 'string' in element) {\n return (element as RenderedNode).string;\n }\n return renderJsxToHtmlStringInternal(element as JSXChild);\n}\n\nexport function renderToRenderedNode(element: JSXChild | RenderedNode): RenderedNode {\n // If already a RenderedNode, return as is\n if (element && typeof element === 'object' && 'string' in element) {\n return element as RenderedNode;\n }\n return {\n string: renderJsxToHtmlStringInternal(element as JSXChild),\n };\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;CASA,IACI,IAAsB,EAAY,GACl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AA8B,CAA2B;CAClE;CAEA,IAAM,IAAQ,EAAiB,CAAK;CAGpC,IAFsB,EAAc,IAAK,EAAgB,YAAY,CAErD,GACd,OAAO,IAAI,IAAO,IAAQ,MAAM,IAAQ,GAAG;CAG7C,IAAI,IAAe;CASnB,OARA,AACE,IADE,GAAO,YAAY,KAAA,IAEZ,GAAO,YAAY,KAAA,IAGZ,EAAwB,KAAK,MAAO,EAA8B,CAAE,CAAC,CAAC,CAAC,KAAK,EAAE,IAF/E,EAAW,EAAM,SAAS,SAAS,KAAK,EAAE,IAF1C,EAAM,SAAS,SAAS,KAAK,IAOvC,IAAI,IAAO,IAAQ,MAAM,IAAQ,GAAG,GAAG,EAAa,IAAI,EAAK;AACtE;AAEA,SAAgB,EAAsB,GAA0C;CAK9E,OAHI,KAAW,OAAO,KAAY,YAAY,YAAY,IAChD,EAAyB,SAE5B,EAA8B,CAAmB;AAC1D;AAEA,SAAgB,EAAqB,GAAgD;CAKnF,OAHI,KAAW,OAAO,KAAY,YAAY,YAAY,IACjD,IAEF,EACL,QAAQ,EAA8B,CAAmB,EAC3D;AACF"}
1
+ {"version":3,"file":"render-Z3_uiPMp.js","names":[],"sources":["../../../node_modules/.pnpm/serialize-javascript@7.0.5/node_modules/serialize-javascript/index.js","../src/core/render.ts"],"sourcesContent":["/*\nCopyright (c) 2014, Yahoo! Inc. All rights reserved.\nCopyrights licensed under the New BSD License.\nSee the accompanying LICENSE file for terms.\n*/\n\n'use strict';\n\n// Generate an internal UID to make the regexp pattern harder to guess.\nvar UID_LENGTH = 16;\nvar UID = generateUID();\nvar PLACE_HOLDER_REGEXP = new RegExp('(\\\\\\\\)?\"@__(F|R|D|M|S|A|U|I|B|L)-' + UID + '-(\\\\d+)__@\"', 'g');\n\nvar IS_NATIVE_CODE_REGEXP = /\\{\\s*\\[native code\\]\\s*\\}/g;\nvar IS_PURE_FUNCTION = /function.*?\\(/;\nvar IS_ARROW_FUNCTION = /.*?=>.*?/;\nvar UNSAFE_CHARS_REGEXP = /[<>\\/\\u2028\\u2029]/g;\n// Regex to match </script> and variations (case-insensitive) for XSS protection\n// Matches </script followed by optional whitespace/attributes and >\nvar SCRIPT_CLOSE_REGEXP = /<\\/script[^>]*>/gi;\n\nvar RESERVED_SYMBOLS = ['*', 'async'];\n\n// Mapping of unsafe HTML and invalid JavaScript line terminator chars to their\n// Unicode char counterparts which are safe to use in JavaScript strings.\nvar ESCAPED_CHARS = {\n '<' : '\\\\u003C',\n '>' : '\\\\u003E',\n '/' : '\\\\u002F',\n '\\u2028': '\\\\u2028',\n '\\u2029': '\\\\u2029'\n};\n\nfunction escapeUnsafeChars(unsafeChar) {\n return ESCAPED_CHARS[unsafeChar];\n}\n\n// Escape function body for XSS protection while preserving arrow function syntax\nfunction escapeFunctionBody(str) {\n // Escape </script> sequences and variations (case-insensitive) - the main XSS risk\n // Matches </script followed by optional whitespace/attributes and >\n // This must be done first before other replacements\n str = str.replace(SCRIPT_CLOSE_REGEXP, function(match) {\n // Escape all <, /, and > characters in the closing script tag\n return match.replace(/</g, '\\\\u003C').replace(/\\//g, '\\\\u002F').replace(/>/g, '\\\\u003E');\n });\n // Escape line terminators (these are always unsafe)\n str = str.replace(/\\u2028/g, '\\\\u2028');\n str = str.replace(/\\u2029/g, '\\\\u2029');\n return str;\n}\n\nfunction generateUID() {\n var bytes = crypto.getRandomValues(new Uint8Array(UID_LENGTH));\n var result = '';\n for(var i=0; i<UID_LENGTH; ++i) {\n result += bytes[i].toString(16);\n }\n return result;\n}\n\nfunction deleteFunctions(obj){\n var functionKeys = [];\n for (var key in obj) {\n if (typeof obj[key] === \"function\") {\n functionKeys.push(key);\n }\n }\n for (var i = 0; i < functionKeys.length; i++) {\n delete obj[functionKeys[i]];\n }\n}\n\nmodule.exports = function serialize(obj, options) {\n options || (options = {});\n\n // Backwards-compatibility for `space` as the second argument.\n if (typeof options === 'number' || typeof options === 'string') {\n options = {space: options};\n }\n\n var functions = [];\n var regexps = [];\n var dates = [];\n var maps = [];\n var sets = [];\n var arrays = [];\n var undefs = [];\n var infinities= [];\n var bigInts = [];\n var urls = [];\n\n // Returns placeholders for functions and regexps (identified by index)\n // which are later replaced by their string representation.\n function replacer(key, value) {\n\n // For nested function\n if(options.ignoreFunction){\n deleteFunctions(value);\n }\n\n if (!value && value !== undefined && value !== BigInt(0)) {\n return value;\n }\n\n // If the value is an object w/ a toJSON method, toJSON is called before\n // the replacer runs, so we use this[key] to get the non-toJSONed value.\n var origValue = this[key];\n var type = typeof origValue;\n\n if (type === 'object') {\n if(origValue instanceof RegExp) {\n return '@__R-' + UID + '-' + (regexps.push(origValue) - 1) + '__@';\n }\n\n if(origValue instanceof Date) {\n return '@__D-' + UID + '-' + (dates.push(origValue) - 1) + '__@';\n }\n\n if(origValue instanceof Map) {\n return '@__M-' + UID + '-' + (maps.push(origValue) - 1) + '__@';\n }\n\n if(origValue instanceof Set) {\n return '@__S-' + UID + '-' + (sets.push(origValue) - 1) + '__@';\n }\n\n if(Array.isArray(origValue)) {\n var isSparse = Object.keys(origValue).length !== origValue.length;\n if (isSparse) {\n return '@__A-' + UID + '-' + (arrays.push(origValue) - 1) + '__@';\n }\n }\n\n if(origValue instanceof URL) {\n return '@__L-' + UID + '-' + (urls.push(origValue) - 1) + '__@';\n }\n }\n\n if (type === 'function') {\n return '@__F-' + UID + '-' + (functions.push(origValue) - 1) + '__@';\n }\n\n if (type === 'undefined') {\n return '@__U-' + UID + '-' + (undefs.push(origValue) - 1) + '__@';\n }\n\n if (type === 'number' && !isNaN(origValue) && !isFinite(origValue)) {\n return '@__I-' + UID + '-' + (infinities.push(origValue) - 1) + '__@';\n }\n\n if (type === 'bigint') {\n return '@__B-' + UID + '-' + (bigInts.push(origValue) - 1) + '__@';\n }\n\n return value;\n }\n\n function serializeFunc(fn, options) {\n var serializedFn = fn.toString();\n if (IS_NATIVE_CODE_REGEXP.test(serializedFn)) {\n throw new TypeError('Serializing native function: ' + fn.name);\n }\n\n // Escape unsafe HTML characters in function body for XSS protection\n // This must preserve arrow function syntax (=>) while escaping </script>\n if (options && options.unsafe !== true) {\n serializedFn = escapeFunctionBody(serializedFn);\n }\n\n // pure functions, example: {key: function() {}}\n if(IS_PURE_FUNCTION.test(serializedFn)) {\n return serializedFn;\n }\n\n // arrow functions, example: arg1 => arg1+5\n if(IS_ARROW_FUNCTION.test(serializedFn)) {\n return serializedFn;\n }\n\n var argsStartsAt = serializedFn.indexOf('(');\n var def = serializedFn.substr(0, argsStartsAt)\n .trim()\n .split(' ')\n .filter(function(val) { return val.length > 0 });\n\n var nonReservedSymbols = def.filter(function(val) {\n return RESERVED_SYMBOLS.indexOf(val) === -1\n });\n\n // enhanced literal objects, example: {key() {}}\n if(nonReservedSymbols.length > 0) {\n return (def.indexOf('async') > -1 ? 'async ' : '') + 'function'\n + (def.join('').indexOf('*') > -1 ? '*' : '')\n + serializedFn.substr(argsStartsAt);\n }\n\n // arrow functions\n return serializedFn;\n }\n\n // Check if the parameter is function\n if (options.ignoreFunction && typeof obj === \"function\") {\n obj = undefined;\n }\n // Protects against `JSON.stringify()` returning `undefined`, by serializing\n // to the literal string: \"undefined\".\n if (obj === undefined) {\n return String(obj);\n }\n\n var str;\n\n // Creates a JSON string representation of the value.\n // NOTE: Node 0.12 goes into slow mode with extra JSON.stringify() args.\n if (options.isJSON && !options.space) {\n str = JSON.stringify(obj);\n } else {\n str = JSON.stringify(obj, options.isJSON ? null : replacer, options.space);\n }\n\n // Protects against `JSON.stringify()` returning `undefined`, by serializing\n // to the literal string: \"undefined\".\n if (typeof str !== 'string') {\n return String(str);\n }\n\n // Replace unsafe HTML and invalid JavaScript line terminator chars with\n // their safe Unicode char counterpart. This _must_ happen before the\n // regexps and functions are serialized and added back to the string.\n if (options.unsafe !== true) {\n str = str.replace(UNSAFE_CHARS_REGEXP, escapeUnsafeChars);\n }\n\n if (functions.length === 0 && regexps.length === 0 && dates.length === 0 && maps.length === 0 && sets.length === 0 && arrays.length === 0 && undefs.length === 0 && infinities.length === 0 && bigInts.length === 0 && urls.length === 0) {\n return str;\n }\n\n // Replaces all occurrences of function, regexp, date, map and set placeholders in the\n // JSON string with their string representations. If the original value can\n // not be found, then `undefined` is used.\n return str.replace(PLACE_HOLDER_REGEXP, function (match, backSlash, type, valueIndex) {\n // The placeholder may not be preceded by a backslash. This is to prevent\n // replacing things like `\"a\\\"@__R-<UID>-0__@\"` and thus outputting\n // invalid JS.\n if (backSlash) {\n return match;\n }\n\n if (type === 'D') {\n // Validate ISO string format to prevent code injection via spoofed toISOString()\n var isoStr = String(dates[valueIndex].toISOString());\n if (!/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?Z$/.test(isoStr)) {\n throw new TypeError('Invalid Date ISO string');\n }\n return \"new Date(\\\"\" + isoStr + \"\\\")\";\n }\n\n if (type === 'R') {\n // Sanitize flags to prevent code injection (only allow valid RegExp flag characters)\n var flags = String(regexps[valueIndex].flags).replace(/[^gimsuydv]/g, '');\n return \"new RegExp(\" + serialize(regexps[valueIndex].source) + \", \\\"\" + flags + \"\\\")\";\n }\n\n if (type === 'M') {\n return \"new Map(\" + serialize(Array.from(maps[valueIndex].entries()), options) + \")\";\n }\n\n if (type === 'S') {\n return \"new Set(\" + serialize(Array.from(sets[valueIndex].values()), options) + \")\";\n }\n\n if (type === 'A') {\n return \"Array.prototype.slice.call(\" + serialize(Object.assign({ length: arrays[valueIndex].length }, arrays[valueIndex]), options) + \")\";\n }\n\n if (type === 'U') {\n return 'undefined'\n }\n\n if (type === 'I') {\n return infinities[valueIndex];\n }\n\n if (type === 'B') {\n return \"BigInt(\\\"\" + bigInts[valueIndex] + \"\\\")\";\n }\n\n if (type === 'L') {\n return \"new URL(\" + serialize(urls[valueIndex].toString(), options) + \")\";\n }\n\n var fn = functions[valueIndex];\n\n return serializeFunc(fn, options);\n });\n}\n","import { RAW_HTML_MARKER } from './const';\nimport {\n addCacheTag,\n type HtmlContentObject,\n type JSXChild,\n type JSXNode,\n type RenderedNode,\n} from './jsx-runtime';\n\nif (true) {\n console.log('render.ts');\n}\n\nconst VOID_ELEMENTS = new Set<string>([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n]);\n\nfunction classList(input: unknown): string {\n if (!input) return '';\n if (typeof input === 'string') return input;\n if (Array.isArray(input)) {\n return input.map(classList).filter(Boolean).join(' ');\n }\n if (typeof input === 'object') {\n return Object.keys(input as Record<string, boolean>)\n .filter((key) => (input as Record<string, boolean>)[key])\n .join(' ');\n }\n return '';\n}\n\n// Attribute-name validation, ported verbatim from React's react-dom\n// (DOMProperty.js `isAttributeNameSafe`). Untrusted spread props can carry\n// keys like `blah\" onclick=\"x` or `></div><script>…`; if such a key were\n// written as `${key}=\"…\"` it would inject new attributes / break out of the\n// tag. Names that don't match this grammar are dropped instead of emitted.\nconst ATTRIBUTE_NAME_START_CHAR =\n ':A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD';\nconst ATTRIBUTE_NAME_CHAR =\n ATTRIBUTE_NAME_START_CHAR + '\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040';\nconst VALID_ATTRIBUTE_NAME_REGEX = new RegExp(\n '^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$',\n);\nconst validatedAttributeNameCache: Record<string, boolean> = {};\nconst illegalAttributeNameCache: Record<string, boolean> = {};\n\nexport function isAttributeNameSafe(attributeName: string): boolean {\n if (Object.prototype.hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {\n return true;\n }\n if (Object.prototype.hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {\n return false;\n }\n if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {\n validatedAttributeNameCache[attributeName] = true;\n return true;\n }\n illegalAttributeNameCache[attributeName] = true;\n if (process.env.NODE_ENV !== 'production') {\n console.error('Invalid attribute name: `%s`', attributeName);\n }\n return false;\n}\n\nexport function escapeProp(value: string): string {\n return value\n .replaceAll('&', '&amp;')\n .replaceAll('\"', '&quot;')\n .replaceAll('<', '&lt;')\n .replaceAll('>', '&gt;')\n .replaceAll('\\n', '&#10;')\n .trim();\n}\n\nexport function escapeHTML(value: string): string {\n return value\n .replaceAll('&', '&amp;')\n .replaceAll('\"', '&quot;')\n .replaceAll(\"'\", '&#39;')\n .replaceAll('<', '&lt;')\n .replaceAll('>', '&gt;')\n .replaceAll('\\n', '<br/>');\n}\n\nfunction renderAttributes(props?: Record<string, any>): string {\n if (!props) return '';\n\n let classValue = '';\n if (props.classList !== undefined) {\n classValue = classList(props.classList);\n }\n if (props.class) {\n const existingClass = typeof props.class === 'string' ? props.class : '';\n classValue = classValue ? `${classValue} ${existingClass}`.trim() : existingClass;\n }\n\n const attrs = Object.entries(props)\n .filter(\n ([key]) =>\n key !== 'children' &&\n key !== 'classList' &&\n key !== 'setHtml' &&\n key !== 'setText' &&\n key !== 'class' &&\n key !== 'key' &&\n key !== 'cacheTag',\n )\n .map(([key, value]) => {\n // Drop attribute names that could break out of the tag (injection guard).\n if (!isAttributeNameSafe(key)) return '';\n\n // HTML standard behavior with function execution support\n if (value === false || value === null || value === undefined) return '';\n if (value === true) return key;\n\n // Execute function props and get result (new feature)\n if (typeof value === 'function') {\n const result = value();\n return `${key}=\"${escapeProp(result?.toString() || '')}\"`;\n }\n\n return `${key}=\"${escapeProp(value?.toString() || '')}\"`;\n })\n .filter(Boolean) as string[];\n\n if (classValue) {\n attrs.push(`class=\"${escapeProp(classValue)}\"`);\n }\n\n return attrs.join(' ');\n}\n\nfunction renderJsxToHtmlStringInternal(element: JSXChild): string {\n // HTML standard: skip boolean, null, undefined children\n if (element === null || typeof element === 'boolean' || element === undefined) return '';\n\n if (element && typeof element === 'object' && (element as any)[RAW_HTML_MARKER]) {\n return (element as any).content || '';\n }\n\n // Support htmlContent object (new feature)\n if (element && typeof element === 'object' && 'htmlContent' in element) {\n return (element as HtmlContentObject).htmlContent;\n }\n\n if (typeof element === 'string') return escapeHTML(element.toString());\n if (typeof element === 'number') return element.toString();\n\n if (Array.isArray(element)) {\n return (element as JSXChild[]).map((el) => renderJsxToHtmlStringInternal(el)).join('');\n }\n\n const { type, props, children } = element as JSXNode;\n\n // Collect cache tags from props\n if (props?.cacheTag) {\n addCacheTag(props.cacheTag);\n }\n\n if (typeof type === 'function') {\n const componentResult = (type as any)({ ...(props || {}), children });\n // Check if component returned a RenderedNode\n if (componentResult && typeof componentResult === 'object' && 'string' in componentResult) {\n return (componentResult as RenderedNode).string;\n }\n return renderJsxToHtmlStringInternal(componentResult as JSXChild);\n }\n\n const attrs = renderAttributes(props);\n const isVoidElement = VOID_ELEMENTS.has((type as string).toLowerCase());\n\n if (isVoidElement) {\n return `<${type}${attrs ? ' ' + attrs : ''} />`;\n }\n\n let childrenHtml = '';\n if (props?.setHtml !== undefined) {\n childrenHtml = props.setHtml?.toString() || '';\n } else if (props?.setText !== undefined) {\n childrenHtml = escapeHTML(props.setText?.toString() || '');\n } else {\n childrenHtml = (children as JSXChild[]).map((el) => renderJsxToHtmlStringInternal(el)).join('');\n }\n\n return `<${type}${attrs ? ' ' + attrs : ''}>${childrenHtml}</${type}>`;\n}\n\nexport function renderJsxToHtmlString(element: JSXChild | RenderedNode): string {\n // If already a RenderedNode, return its string\n if (element && typeof element === 'object' && 'string' in element) {\n return (element as RenderedNode).string;\n }\n return renderJsxToHtmlStringInternal(element as JSXChild);\n}\n\nexport function renderToRenderedNode(element: JSXChild | RenderedNode): RenderedNode {\n // If already a RenderedNode, return as is\n if (element && typeof element === 'object' && 'string' in element) {\n return element as RenderedNode;\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AE,GAAI,KAAS,CAAC;GAAI;EAAS,CAAC;EAKpE,OAHI,KAAmB,OAAO,KAAoB,YAAY,YAAY,IAChE,EAAiC,SAEpC,EAA8B,CAA2B;CAClE;CAEA,IAAM,IAAQ,EAAiB,CAAK;CAGpC,IAFsB,EAAc,IAAK,EAAgB,YAAY,CAErD,GACd,OAAO,IAAI,IAAO,IAAQ,MAAM,IAAQ,GAAG;CAG7C,IAAI,IAAe;CASnB,OARA,AACE,IADE,GAAO,YAAY,KAAA,IAEZ,GAAO,YAAY,KAAA,IAGZ,EAAwB,KAAK,MAAO,EAA8B,CAAE,CAAC,CAAC,CAAC,KAAK,EAAE,IAF/E,EAAW,EAAM,SAAS,SAAS,KAAK,EAAE,IAF1C,EAAM,SAAS,SAAS,KAAK,IAOvC,IAAI,IAAO,IAAQ,MAAM,IAAQ,GAAG,GAAG,EAAa,IAAI,EAAK;AACtE;AAEA,SAAgB,EAAsB,GAA0C;CAK9E,OAHI,KAAW,OAAO,KAAY,YAAY,YAAY,IAChD,EAAyB,SAE5B,EAA8B,CAAmB;AAC1D;AAEA,SAAgB,EAAqB,GAAgD;CAKnF,OAHI,KAAW,OAAO,KAAY,YAAY,YAAY,IACjD,IAEF,EACL,QAAQ,EAA8B,CAAmB,EAC3D;AACF"}
@@ -1,20 +1,13 @@
1
1
  //#region \0rolldown/runtime.js
2
- var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, n) => {
3
- let r = {};
4
- for (var i in e) t(r, i, {
5
- get: e[i],
6
- enumerable: !0
7
- });
8
- return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
9
- }, c = (e, i, o, s) => {
2
+ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), s = (e, i, o, s) => {
10
3
  if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
11
4
  get: ((e) => i[e]).bind(null, d),
12
5
  enumerable: !(s = n(i, d)) || s.enumerable
13
6
  });
14
7
  return e;
15
- }, l = (n, r, o) => (o = n == null ? {} : e(i(n)), c(r || !n || !n.__esModule || !a.call(n, "default") ? t(o, "default", {
8
+ }, c = (n, r, o) => (o = n == null ? {} : e(i(n)), s(r || !n || !n.__esModule || !a.call(n, "default") ? t(o, "default", {
16
9
  value: n,
17
10
  enumerable: !0
18
11
  }) : o, n));
19
12
  //#endregion
20
- export { s as n, l as r, o as t };
13
+ export { c as n, o as t };
@@ -1,6 +1,6 @@
1
- import { r as e } from "./rolldown-runtime-B0aSnxlc.js";
2
- import { a as t, n } from "./render-hUQUreah.js";
3
- import { i as r, r as i, t as a } from "./middleware-CnDqZobD.js";
1
+ import { n as e } from "./rolldown-runtime-DtPi1Y-2.js";
2
+ import { a as t, n } from "./render-Z3_uiPMp.js";
3
+ import { i as r, r as i, t as a } from "./middleware-B8m9wPBe.js";
4
4
  import { n as o, r as s } from "./global-style-Cgno-yNl.js";
5
5
  import { existsSync as c } from "fs";
6
6
  import l from "node:fs/promises";
@@ -707,4 +707,4 @@ function Y(e) {
707
707
  //#endregion
708
708
  export { K as a, Y as i, G as n, J as r, P as t };
709
709
 
710
- //# sourceMappingURL=server-C35BtVu8.js.map
710
+ //# sourceMappingURL=server-D7amTQoo.js.map