@pablopunk/webr 0.1.1 → 0.1.2

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 (35) hide show
  1. package/README.md +12 -4
  2. package/dist/client/_astro/App.1PYvyCIo.css +1 -0
  3. package/dist/client/_astro/App.C-zDvcHl.js +2 -0
  4. package/dist/server/chunks/{App_BmsGAwGf.mjs → App_Caoot2xr.mjs} +13 -10
  5. package/dist/server/chunks/{_id__u0ueX6GO.mjs → _id__CGVhhfbw.mjs} +7 -6
  6. package/dist/server/chunks/{_tab__DL6wyr-j.mjs → _tab__CKnH7YTh.mjs} +7 -6
  7. package/dist/server/chunks/_virtual_astro_session-driver_Dp7RXjOf.mjs +123 -0
  8. package/dist/server/chunks/{compiler_CpXox_xS.mjs → compiler_BiU10Vds.mjs} +1 -1
  9. package/dist/server/chunks/{console_CucE1SwS.mjs → console_BOi2ismd.mjs} +6 -6
  10. package/dist/server/chunks/dist_CpTFMtqT.mjs +9199 -0
  11. package/dist/server/chunks/{index_DyyPce_k.mjs → index_DRfLd22k.mjs} +5 -4
  12. package/dist/server/chunks/{new_G7XChx5p.mjs → new_CFN790OC.mjs} +7 -6
  13. package/dist/server/chunks/{node_BlixNyYV.mjs → node_BcIF-BVp.mjs} +461 -14
  14. package/dist/server/chunks/rolldown-runtime_BMI-E3GI.mjs +44 -0
  15. package/dist/server/chunks/{server_DS45LC4q.mjs → server_CnGYDmxV.mjs} +271 -15
  16. package/dist/server/chunks/{settings_DLV2Js3e.mjs → settings_D_k-bZgn.mjs} +7 -6
  17. package/dist/server/chunks/{sharp_CgNvPCpY.mjs → sharp_qIaxzsTp.mjs} +2 -2
  18. package/dist/server/chunks/vnode-children_BSi0H4PL.mjs +213 -0
  19. package/dist/server/entry.mjs +18980 -5126
  20. package/package.json +1 -1
  21. package/server/cli.ts +10 -5
  22. package/server/plugin/probe.ts +3 -3
  23. package/server/port.ts +53 -4
  24. package/server/run.ts +2 -2
  25. package/server/where.ts +22 -0
  26. package/src/server/directories.ts +12 -5
  27. package/src/server/host.ts +3 -4
  28. package/src/server/runtime/target.ts +1 -0
  29. package/src/server/transport/herdr-target.ts +21 -7
  30. package/src/server/transport/registry.ts +1 -1
  31. package/src/server/transport/saved-machines.ts +41 -0
  32. package/dist/client/_astro/App.BxlQhLhN.css +0 -1
  33. package/dist/client/_astro/App.CzxEZ_Dw.js +0 -2
  34. package/dist/server/chunks/_virtual_astro_session-driver_DS5V7T-N.mjs +0 -6
  35. package/dist/server/chunks/vnode-children_CRmaSs5G.mjs +0 -24
@@ -1,18 +1,194 @@
1
1
  import { B as OnlyResponseCanBeReturned, K as ResponseSentError, L as NoMatchingImport, M as MissingMediaQueryDirective, P as NoClientOnlyHint, R as NoMatchingRenderer, Z as UnavailableAstroGlobal, c as EndpointDidNotReturnAResponse, t as AstroError } from "./errors_BgIp4W2B.mjs";
2
- import { decodeBase64, decodeHex, encodeBase64, encodeHexUpperCase } from "@oslojs/encoding";
3
2
  import * as z from "zod/v4";
4
- import colors from "piccolore";
5
- import { clsx } from "clsx";
6
- //#region \0rolldown/runtime.js
7
- var __defProp = Object.defineProperty;
8
- var __exportAll = (all, no_symbols) => {
9
- let target = {};
10
- for (var name in all) __defProp(target, name, {
11
- get: all[name],
12
- enumerable: true
13
- });
14
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
15
- return target;
3
+ //#region node_modules/.pnpm/@oslojs+encoding@1.1.0/node_modules/@oslojs/encoding/dist/hex.js
4
+ function encodeHexUpperCase(data) {
5
+ let result = "";
6
+ for (let i = 0; i < data.length; i++) {
7
+ result += alphabetUpperCase[data[i] >> 4];
8
+ result += alphabetUpperCase[data[i] & 15];
9
+ }
10
+ return result;
11
+ }
12
+ function decodeHex(data) {
13
+ if (data.length % 2 !== 0) throw new Error("Invalid hex string");
14
+ const result = new Uint8Array(data.length / 2);
15
+ for (let i = 0; i < data.length; i += 2) {
16
+ if (!(data[i] in decodeMap)) throw new Error("Invalid character");
17
+ if (!(data[i + 1] in decodeMap)) throw new Error("Invalid character");
18
+ result[i / 2] |= decodeMap[data[i]] << 4;
19
+ result[i / 2] |= decodeMap[data[i + 1]];
20
+ }
21
+ return result;
22
+ }
23
+ var alphabetUpperCase = "0123456789ABCDEF";
24
+ var decodeMap = {
25
+ "0": 0,
26
+ "1": 1,
27
+ "2": 2,
28
+ "3": 3,
29
+ "4": 4,
30
+ "5": 5,
31
+ "6": 6,
32
+ "7": 7,
33
+ "8": 8,
34
+ "9": 9,
35
+ a: 10,
36
+ A: 10,
37
+ b: 11,
38
+ B: 11,
39
+ c: 12,
40
+ C: 12,
41
+ d: 13,
42
+ D: 13,
43
+ e: 14,
44
+ E: 14,
45
+ f: 15,
46
+ F: 15
47
+ };
48
+ //#endregion
49
+ //#region node_modules/.pnpm/@oslojs+encoding@1.1.0/node_modules/@oslojs/encoding/dist/base32.js
50
+ var EncodingPadding$1;
51
+ (function(EncodingPadding) {
52
+ EncodingPadding[EncodingPadding["Include"] = 0] = "Include";
53
+ EncodingPadding[EncodingPadding["None"] = 1] = "None";
54
+ })(EncodingPadding$1 || (EncodingPadding$1 = {}));
55
+ var DecodingPadding$1;
56
+ (function(DecodingPadding) {
57
+ DecodingPadding[DecodingPadding["Required"] = 0] = "Required";
58
+ DecodingPadding[DecodingPadding["Ignore"] = 1] = "Ignore";
59
+ })(DecodingPadding$1 || (DecodingPadding$1 = {}));
60
+ //#endregion
61
+ //#region node_modules/.pnpm/@oslojs+encoding@1.1.0/node_modules/@oslojs/encoding/dist/base64.js
62
+ function encodeBase64(bytes) {
63
+ return encodeBase64_internal(bytes, base64Alphabet, EncodingPadding.Include);
64
+ }
65
+ function encodeBase64_internal(bytes, alphabet, padding) {
66
+ let result = "";
67
+ for (let i = 0; i < bytes.byteLength; i += 3) {
68
+ let buffer = 0;
69
+ let bufferBitSize = 0;
70
+ for (let j = 0; j < 3 && i + j < bytes.byteLength; j++) {
71
+ buffer = buffer << 8 | bytes[i + j];
72
+ bufferBitSize += 8;
73
+ }
74
+ for (let j = 0; j < 4; j++) if (bufferBitSize >= 6) {
75
+ result += alphabet[buffer >> bufferBitSize - 6 & 63];
76
+ bufferBitSize -= 6;
77
+ } else if (bufferBitSize > 0) {
78
+ result += alphabet[buffer << 6 - bufferBitSize & 63];
79
+ bufferBitSize = 0;
80
+ } else if (padding === EncodingPadding.Include) result += "=";
81
+ }
82
+ return result;
83
+ }
84
+ var base64Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
85
+ function decodeBase64(encoded) {
86
+ return decodeBase64_internal(encoded, base64DecodeMap, DecodingPadding.Required);
87
+ }
88
+ function decodeBase64_internal(encoded, decodeMap, padding) {
89
+ const result = new Uint8Array(Math.ceil(encoded.length / 4) * 3);
90
+ let totalBytes = 0;
91
+ for (let i = 0; i < encoded.length; i += 4) {
92
+ let chunk = 0;
93
+ let bitsRead = 0;
94
+ for (let j = 0; j < 4; j++) {
95
+ if (padding === DecodingPadding.Required && encoded[i + j] === "=") continue;
96
+ if (padding === DecodingPadding.Ignore && (i + j >= encoded.length || encoded[i + j] === "=")) continue;
97
+ if (j > 0 && encoded[i + j - 1] === "=") throw new Error("Invalid padding");
98
+ if (!(encoded[i + j] in decodeMap)) throw new Error("Invalid character");
99
+ chunk |= decodeMap[encoded[i + j]] << (3 - j) * 6;
100
+ bitsRead += 6;
101
+ }
102
+ if (bitsRead < 24) {
103
+ let unused;
104
+ if (bitsRead === 12) unused = chunk & 65535;
105
+ else if (bitsRead === 18) unused = chunk & 255;
106
+ else throw new Error("Invalid padding");
107
+ if (unused !== 0) throw new Error("Invalid padding");
108
+ }
109
+ const byteLength = Math.floor(bitsRead / 8);
110
+ for (let i = 0; i < byteLength; i++) {
111
+ result[totalBytes] = chunk >> 16 - i * 8 & 255;
112
+ totalBytes++;
113
+ }
114
+ }
115
+ return result.slice(0, totalBytes);
116
+ }
117
+ var EncodingPadding;
118
+ (function(EncodingPadding) {
119
+ EncodingPadding[EncodingPadding["Include"] = 0] = "Include";
120
+ EncodingPadding[EncodingPadding["None"] = 1] = "None";
121
+ })(EncodingPadding || (EncodingPadding = {}));
122
+ var DecodingPadding;
123
+ (function(DecodingPadding) {
124
+ DecodingPadding[DecodingPadding["Required"] = 0] = "Required";
125
+ DecodingPadding[DecodingPadding["Ignore"] = 1] = "Ignore";
126
+ })(DecodingPadding || (DecodingPadding = {}));
127
+ var base64DecodeMap = {
128
+ "0": 52,
129
+ "1": 53,
130
+ "2": 54,
131
+ "3": 55,
132
+ "4": 56,
133
+ "5": 57,
134
+ "6": 58,
135
+ "7": 59,
136
+ "8": 60,
137
+ "9": 61,
138
+ A: 0,
139
+ B: 1,
140
+ C: 2,
141
+ D: 3,
142
+ E: 4,
143
+ F: 5,
144
+ G: 6,
145
+ H: 7,
146
+ I: 8,
147
+ J: 9,
148
+ K: 10,
149
+ L: 11,
150
+ M: 12,
151
+ N: 13,
152
+ O: 14,
153
+ P: 15,
154
+ Q: 16,
155
+ R: 17,
156
+ S: 18,
157
+ T: 19,
158
+ U: 20,
159
+ V: 21,
160
+ W: 22,
161
+ X: 23,
162
+ Y: 24,
163
+ Z: 25,
164
+ a: 26,
165
+ b: 27,
166
+ c: 28,
167
+ d: 29,
168
+ e: 30,
169
+ f: 31,
170
+ g: 32,
171
+ h: 33,
172
+ i: 34,
173
+ j: 35,
174
+ k: 36,
175
+ l: 37,
176
+ m: 38,
177
+ n: 39,
178
+ o: 40,
179
+ p: 41,
180
+ q: 42,
181
+ r: 43,
182
+ s: 44,
183
+ t: 45,
184
+ u: 46,
185
+ v: 47,
186
+ w: 48,
187
+ x: 49,
188
+ y: 50,
189
+ z: 51,
190
+ "+": 62,
191
+ "/": 63
16
192
  };
17
193
  //#endregion
18
194
  //#region node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/core/csp/config.js
@@ -156,6 +332,71 @@ var fetchStateSymbol = /* @__PURE__ */ Symbol.for("astro.fetchState");
156
332
  var nodeRequestAbortControllerCleanupSymbol = /* @__PURE__ */ Symbol.for("astro.nodeRequestAbortControllerCleanup");
157
333
  var responseSentSymbol = /* @__PURE__ */ Symbol.for("astro.responseSent");
158
334
  //#endregion
335
+ //#region node_modules/.pnpm/piccolore@0.1.3/node_modules/piccolore/dist/index.js
336
+ var e = globalThis.process || {};
337
+ var t = e.argv || [];
338
+ var n = e.env || {};
339
+ var r$1 = !(n.NO_COLOR || t.includes(`--no-color`)) && (!!n.FORCE_COLOR || t.includes(`--color`) || e.platform === `win32` || (e.stdout || {}).isTTY && n.TERM !== `dumb` || !!n.CI);
340
+ var i = (e, t, n = e) => (r) => {
341
+ let i = `` + r, o = i.indexOf(t, e.length);
342
+ return ~o ? e + a(i, t, n, o) + t : e + i + t;
343
+ };
344
+ var a = (e, t, n, r) => {
345
+ let i = ``, a = 0;
346
+ do
347
+ i += e.substring(a, r) + n, a = r + t.length, r = e.indexOf(t, a);
348
+ while (~r);
349
+ return i + e.substring(a);
350
+ };
351
+ var o = (e = r$1) => {
352
+ let t = e ? i : () => String;
353
+ return {
354
+ isColorSupported: e,
355
+ reset: t(`\x1B[0m`, `\x1B[0m`),
356
+ bold: t(`\x1B[1m`, `\x1B[22m`, `\x1B[22m\x1B[1m`),
357
+ dim: t(`\x1B[2m`, `\x1B[22m`, `\x1B[22m\x1B[2m`),
358
+ italic: t(`\x1B[3m`, `\x1B[23m`),
359
+ underline: t(`\x1B[4m`, `\x1B[24m`),
360
+ inverse: t(`\x1B[7m`, `\x1B[27m`),
361
+ hidden: t(`\x1B[8m`, `\x1B[28m`),
362
+ strikethrough: t(`\x1B[9m`, `\x1B[29m`),
363
+ black: t(`\x1B[30m`, `\x1B[39m`),
364
+ red: t(`\x1B[31m`, `\x1B[39m`),
365
+ green: t(`\x1B[32m`, `\x1B[39m`),
366
+ yellow: t(`\x1B[33m`, `\x1B[39m`),
367
+ blue: t(`\x1B[34m`, `\x1B[39m`),
368
+ magenta: t(`\x1B[35m`, `\x1B[39m`),
369
+ cyan: t(`\x1B[36m`, `\x1B[39m`),
370
+ white: t(`\x1B[37m`, `\x1B[39m`),
371
+ gray: t(`\x1B[90m`, `\x1B[39m`),
372
+ bgBlack: t(`\x1B[40m`, `\x1B[49m`),
373
+ bgRed: t(`\x1B[41m`, `\x1B[49m`),
374
+ bgGreen: t(`\x1B[42m`, `\x1B[49m`),
375
+ bgYellow: t(`\x1B[43m`, `\x1B[49m`),
376
+ bgBlue: t(`\x1B[44m`, `\x1B[49m`),
377
+ bgMagenta: t(`\x1B[45m`, `\x1B[49m`),
378
+ bgCyan: t(`\x1B[46m`, `\x1B[49m`),
379
+ bgWhite: t(`\x1B[47m`, `\x1B[49m`),
380
+ blackBright: t(`\x1B[90m`, `\x1B[39m`),
381
+ redBright: t(`\x1B[91m`, `\x1B[39m`),
382
+ greenBright: t(`\x1B[92m`, `\x1B[39m`),
383
+ yellowBright: t(`\x1B[93m`, `\x1B[39m`),
384
+ blueBright: t(`\x1B[94m`, `\x1B[39m`),
385
+ magentaBright: t(`\x1B[95m`, `\x1B[39m`),
386
+ cyanBright: t(`\x1B[96m`, `\x1B[39m`),
387
+ whiteBright: t(`\x1B[97m`, `\x1B[39m`),
388
+ bgBlackBright: t(`\x1B[100m`, `\x1B[49m`),
389
+ bgRedBright: t(`\x1B[101m`, `\x1B[49m`),
390
+ bgGreenBright: t(`\x1B[102m`, `\x1B[49m`),
391
+ bgYellowBright: t(`\x1B[103m`, `\x1B[49m`),
392
+ bgBlueBright: t(`\x1B[104m`, `\x1B[49m`),
393
+ bgMagentaBright: t(`\x1B[105m`, `\x1B[49m`),
394
+ bgCyanBright: t(`\x1B[106m`, `\x1B[49m`),
395
+ bgWhiteBright: t(`\x1B[107m`, `\x1B[49m`)
396
+ };
397
+ };
398
+ var s = o();
399
+ //#endregion
159
400
  //#region node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/core/routing/internal/route-errors.js
160
401
  var ROUTE404_RE = /^\/404\/?$/;
161
402
  var ROUTE500_RE = /^\/500\/?$/;
@@ -264,7 +505,7 @@ async function renderEndpoint(mod, context, isPrerendered, logger, state) {
264
505
  const method = request.method.toUpperCase();
265
506
  let handler = mod[method] ?? mod["ALL"];
266
507
  if (!handler && method === "HEAD" && mod["GET"]) handler = mod["GET"];
267
- if (isPrerendered && !["GET", "HEAD"].includes(method)) logger.warn("router", `${url.pathname} ${colors.bold(method)} requests are not available in static endpoints. Mark this page as server-rendered (\`export const prerender = false;\`) or update your config to \`output: 'server'\` to make all your pages server-rendered by default.`);
508
+ if (isPrerendered && !["GET", "HEAD"].includes(method)) logger.warn("router", `${url.pathname} ${s.bold(method)} requests are not available in static endpoints. Mark this page as server-rendered (\`export const prerender = false;\`) or update your config to \`output: 'server'\` to make all your pages server-rendered by default.`);
268
509
  if (handler === void 0) {
269
510
  logger.warn("router", `No API Route handler exists for the method "${method}" for the route "${url.pathname}".
270
511
  Found handlers: ${Object.keys(mod).map((exp) => JSON.stringify(exp)).join(", ")}
@@ -387,6 +628,21 @@ function isAstroComponentFactory(obj) {
387
628
  return obj == null ? false : obj.isAstroComponentFactory === true;
388
629
  }
389
630
  //#endregion
631
+ //#region node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
632
+ function r(e) {
633
+ var t, f, n = "";
634
+ if ("string" == typeof e || "number" == typeof e) n += e;
635
+ else if ("object" == typeof e) if (Array.isArray(e)) {
636
+ var o = e.length;
637
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
638
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
639
+ return n;
640
+ }
641
+ function clsx() {
642
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
643
+ return n;
644
+ }
645
+ //#endregion
390
646
  //#region node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/runtime/server/serialize.js
391
647
  var PROP_TYPE = {
392
648
  Value: 0,
@@ -2493,4 +2749,4 @@ function spreadAttributes(values = {}, _name, { class: scopedClassName } = {}) {
2493
2749
  return markHTMLString(output);
2494
2750
  }
2495
2751
  //#endregion
2496
- export { clientAddressSymbol as A, isRoute404 as C, DEFAULT_404_COMPONENT as D, ASTRO_GENERATOR as E, decodeKey as F, decryptString as I, generateCspDigest as L, nodeRequestAbortControllerCleanupSymbol as M, originPathnameSymbol as N, REDIRECT_STATUS_CODES as O, responseSentSymbol as P, __exportAll as R, createAstro as S, ASTRO_ERROR_HEADER as T, pushDirective as _, chunkToString as a, unescapeHTML as b, renderSlotToString as c, maybeRenderHead as d, renderHead as f, normalizeCspResourceEntry as g, isRenderInstruction as h, renderComponent as i, fetchStateSymbol as j, REROUTABLE_STATUS_CODES as k, isRenderTemplateResult as l, createRenderInstruction as m, renderPage as n, createSlotValueFromString as o, addAttribute as p, renderJSX as r, renderSlot as s, spreadAttributes as t, renderTemplate as u, isAstroComponentFactory as v, isRoute500 as w, renderEndpoint as x, markHTMLString as y };
2752
+ export { REROUTABLE_STATUS_CODES as A, isRoute404 as C, ASTRO_GENERATOR as D, ASTRO_ERROR_HEADER as E, responseSentSymbol as F, decodeKey as I, decryptString as L, fetchStateSymbol as M, nodeRequestAbortControllerCleanupSymbol as N, DEFAULT_404_COMPONENT as O, originPathnameSymbol as P, generateCspDigest as R, createAstro as S, s as T, pushDirective as _, chunkToString as a, unescapeHTML as b, renderSlotToString as c, maybeRenderHead as d, renderHead as f, normalizeCspResourceEntry as g, isRenderInstruction as h, renderComponent as i, clientAddressSymbol as j, REDIRECT_STATUS_CODES as k, isRenderTemplateResult as l, createRenderInstruction as m, renderPage as n, createSlotValueFromString as o, addAttribute as p, renderJSX as r, renderSlot as s, spreadAttributes as t, renderTemplate as u, isAstroComponentFactory as v, isRoute500 as w, renderEndpoint as x, markHTMLString as y };
@@ -1,6 +1,7 @@
1
- import { R as __exportAll, S as createAstro, i as renderComponent, u as renderTemplate } from "./server_DS45LC4q.mjs";
2
- import { t as createComponent } from "./compiler_CpXox_xS.mjs";
3
- import { n as $$Base, t as App } from "./App_BmsGAwGf.mjs";
1
+ import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
2
+ import { S as createAstro, i as renderComponent, u as renderTemplate } from "./server_CnGYDmxV.mjs";
3
+ import { t as createComponent } from "./compiler_BiU10Vds.mjs";
4
+ import { n as $$Base, t as App } from "./App_Caoot2xr.mjs";
4
5
  //#region src/pages/settings.astro
5
6
  var settings_exports = /* @__PURE__ */ __exportAll({
6
7
  default: () => $$Settings,
@@ -18,11 +19,11 @@ var $$Settings = createComponent(($$result, $$props, $$slots) => {
18
19
  "client:load": true,
19
20
  "data-astro-transition-persist": "webr-app",
20
21
  "client:component-hydration": "load",
21
- "client:component-path": "/Users/pablopunk/src/herdr-web/src/components/App.tsx",
22
+ "client:component-path": "/home/runner/work/webr/webr/src/components/App.tsx",
22
23
  "client:component-export": "default"
23
24
  })}` })}`;
24
- }, "/Users/pablopunk/src/herdr-web/src/pages/settings.astro", void 0);
25
- var $$file = "/Users/pablopunk/src/herdr-web/src/pages/settings.astro";
25
+ }, "/home/runner/work/webr/webr/src/pages/settings.astro", void 0);
26
+ var $$file = "/home/runner/work/webr/webr/src/pages/settings.astro";
26
27
  var $$url = "/settings";
27
28
  //#endregion
28
29
  //#region \0virtual:astro:page:src/pages/settings@_@astro
@@ -1,5 +1,5 @@
1
1
  import { $ as UnsupportedImageFormat, F as NoImageMetadata, N as MissingSharp, t as AstroError } from "./errors_BgIp4W2B.mjs";
2
- import { a as resolveDefaultOutputFormat, i as detector, n as baseService, r as parseQuality } from "./node_BlixNyYV.mjs";
2
+ import { a as resolveDefaultOutputFormat, i as detector, n as baseService, r as parseQuality } from "./node_BcIF-BVp.mjs";
3
3
  //#region node_modules/.pnpm/astro@7.3.5_@types+node@22.20.4_tsx@4.23.15_yaml@2.9.1/node_modules/astro/dist/assets/services/sharp.js
4
4
  var sharp;
5
5
  var qualityTable = {
@@ -45,7 +45,7 @@ function resolveSharpEncoderOptions(transform, inputFormat, serviceConfig = {})
45
45
  async function loadSharp() {
46
46
  let sharpImport;
47
47
  try {
48
- sharpImport = (await import("sharp")).default;
48
+ sharpImport = (await import("./dist_CpTFMtqT.mjs")).default;
49
49
  } catch {
50
50
  throw new AstroError(MissingSharp);
51
51
  }
@@ -0,0 +1,213 @@
1
+ import { Fragment, createElement } from "react";
2
+ var VOID_TAGS = /* @__PURE__ */ new Set([
3
+ "area",
4
+ "base",
5
+ "br",
6
+ "col",
7
+ "embed",
8
+ "hr",
9
+ "img",
10
+ "input",
11
+ "keygen",
12
+ "link",
13
+ "meta",
14
+ "param",
15
+ "source",
16
+ "track",
17
+ "wbr"
18
+ ]);
19
+ var RAW_TAGS = /* @__PURE__ */ new Set(["script", "style"]);
20
+ var DOM_PARSER_RE = /(?:<(\/?)([a-zA-Z][a-zA-Z0-9\:-]*)(?:\s([^>]*?))?((?:\s*\/)?)>|(<\!\-\-)([\s\S]*?)(\-\->)|(<\!)([\s\S]*?)(>))/gm;
21
+ var CHAR_AT = 64;
22
+ var CHAR_DOT = 46;
23
+ var CHAR_HYPHEN = 45;
24
+ var CHAR_COLON = 58;
25
+ var CHAR_UNDERSCORE = 95;
26
+ var CHAR_EQUALS = 61;
27
+ var CHAR_DOUBLE_QUOTE = 34;
28
+ var CHAR_SINGLE_QUOTE = 39;
29
+ var CHAR_BACKSLASH = 92;
30
+ function isAttrKeyIdentifier(chr) {
31
+ return chr >= 97 && chr <= 122 || chr >= 65 && chr <= 90 || chr >= 48 && chr <= 57 || chr === CHAR_AT || chr === CHAR_DOT || chr === CHAR_HYPHEN || chr === CHAR_COLON || chr === CHAR_UNDERSCORE;
32
+ }
33
+ function splitAttrs(str) {
34
+ let obj = {};
35
+ if (str) {
36
+ let state = "none";
37
+ let currentKey;
38
+ let currentValue = "";
39
+ let tokenStartIndex;
40
+ for (let currentIndex = 0; currentIndex < str.length; currentIndex++) {
41
+ const currentChar = str.charCodeAt(currentIndex);
42
+ if (state === "none") {
43
+ if (isAttrKeyIdentifier(currentChar)) {
44
+ if (currentKey) {
45
+ obj[currentKey] = currentValue;
46
+ currentKey = void 0;
47
+ currentValue = "";
48
+ }
49
+ tokenStartIndex = currentIndex;
50
+ state = "key";
51
+ } else if (currentChar === CHAR_EQUALS && currentKey) state = "value";
52
+ } else if (state === "key") {
53
+ if (!isAttrKeyIdentifier(currentChar)) {
54
+ currentKey = str.substring(tokenStartIndex, currentIndex);
55
+ if (currentChar === CHAR_EQUALS) state = "value";
56
+ else state = "none";
57
+ }
58
+ } else if (currentChar === CHAR_DOUBLE_QUOTE || currentChar === CHAR_SINGLE_QUOTE) {
59
+ const quote = currentChar === CHAR_DOUBLE_QUOTE ? "\"" : "'";
60
+ const valueStart = currentIndex + 1;
61
+ let closeIndex = str.indexOf(quote, valueStart);
62
+ while (closeIndex > 0 && str.charCodeAt(closeIndex - 1) === CHAR_BACKSLASH) closeIndex = str.indexOf(quote, closeIndex + 1);
63
+ if (closeIndex === -1) break;
64
+ currentValue = str.substring(valueStart, closeIndex);
65
+ currentIndex = closeIndex;
66
+ state = "none";
67
+ }
68
+ }
69
+ if (state === "key" && tokenStartIndex != void 0 && tokenStartIndex < str.length) currentKey = str.substring(tokenStartIndex, str.length);
70
+ if (currentKey) obj[currentKey] = currentValue;
71
+ }
72
+ return obj;
73
+ }
74
+ function parse(input) {
75
+ let str = typeof input === "string" ? input : input.value;
76
+ let doc, parent, token, text, i, bStart, bText, bEnd, tag;
77
+ const tags = [];
78
+ DOM_PARSER_RE.lastIndex = 0;
79
+ parent = doc = {
80
+ type: 0,
81
+ children: []
82
+ };
83
+ let lastIndex = 0;
84
+ function commitTextNode() {
85
+ text = str.substring(lastIndex, DOM_PARSER_RE.lastIndex - token[0].length);
86
+ if (text) parent.children.push({
87
+ type: 2,
88
+ value: text,
89
+ parent
90
+ });
91
+ }
92
+ while (token = DOM_PARSER_RE.exec(str)) {
93
+ bStart = token[5] || token[8];
94
+ bText = token[6] || token[9];
95
+ bEnd = token[7] || token[10];
96
+ if (RAW_TAGS.has(parent.name) && token[2] !== parent.name) {
97
+ i = DOM_PARSER_RE.lastIndex - token[0].length;
98
+ if (parent.children.length > 0) parent.children[0].value += token[0];
99
+ continue;
100
+ } else if (bStart === "<!--") {
101
+ i = DOM_PARSER_RE.lastIndex - token[0].length;
102
+ if (RAW_TAGS.has(parent.name)) continue;
103
+ tag = {
104
+ type: 3,
105
+ value: bText,
106
+ parent,
107
+ loc: [{
108
+ start: i,
109
+ end: i + bStart.length
110
+ }, {
111
+ start: DOM_PARSER_RE.lastIndex - bEnd.length,
112
+ end: DOM_PARSER_RE.lastIndex
113
+ }]
114
+ };
115
+ tags.push(tag);
116
+ tag.parent.children.push(tag);
117
+ } else if (bStart === "<!") {
118
+ i = DOM_PARSER_RE.lastIndex - token[0].length;
119
+ tag = {
120
+ type: 4,
121
+ value: bText,
122
+ parent,
123
+ loc: [{
124
+ start: i,
125
+ end: i + bStart.length
126
+ }, {
127
+ start: DOM_PARSER_RE.lastIndex - bEnd.length,
128
+ end: DOM_PARSER_RE.lastIndex
129
+ }]
130
+ };
131
+ tags.push(tag);
132
+ tag.parent.children.push(tag);
133
+ } else if (token[1] !== "/") {
134
+ commitTextNode();
135
+ if (RAW_TAGS.has(parent.name)) {
136
+ lastIndex = DOM_PARSER_RE.lastIndex;
137
+ commitTextNode();
138
+ continue;
139
+ } else {
140
+ tag = {
141
+ type: 1,
142
+ name: token[2] + "",
143
+ attributes: splitAttrs(token[3]),
144
+ parent,
145
+ children: [],
146
+ loc: [{
147
+ start: DOM_PARSER_RE.lastIndex - token[0].length,
148
+ end: DOM_PARSER_RE.lastIndex
149
+ }]
150
+ };
151
+ tags.push(tag);
152
+ tag.parent.children.push(tag);
153
+ if (token[4] && token[4].indexOf("/") > -1 || VOID_TAGS.has(tag.name)) {
154
+ tag.loc[1] = tag.loc[0];
155
+ tag.isSelfClosingTag = true;
156
+ } else parent = tag;
157
+ }
158
+ } else {
159
+ commitTextNode();
160
+ if (token[2] + "" === parent.name) {
161
+ tag = parent;
162
+ parent = tag.parent;
163
+ tag.loc.push({
164
+ start: DOM_PARSER_RE.lastIndex - token[0].length,
165
+ end: DOM_PARSER_RE.lastIndex
166
+ });
167
+ text = str.substring(tag.loc[0].end, tag.loc[1].start);
168
+ if (tag.children.length === 0) tag.children.push({
169
+ type: 2,
170
+ value: text,
171
+ parent
172
+ });
173
+ } else if (token[2] + "" === tags[tags.length - 1].name && tags[tags.length - 1].isSelfClosingTag === true) {
174
+ tag = tags[tags.length - 1];
175
+ tag.loc.push({
176
+ start: DOM_PARSER_RE.lastIndex - token[0].length,
177
+ end: DOM_PARSER_RE.lastIndex
178
+ });
179
+ }
180
+ }
181
+ lastIndex = DOM_PARSER_RE.lastIndex;
182
+ }
183
+ text = str.slice(lastIndex);
184
+ parent.children.push({
185
+ type: 2,
186
+ value: text,
187
+ parent
188
+ });
189
+ return doc;
190
+ }
191
+ //#endregion
192
+ //#region node_modules/.pnpm/@astrojs+react@7.0.0_@types+node@22.20.4_@types+react-dom@19.3.0_@types+react@19.3.0__@_02aa85dceaccf3d763325676dd8540a8/node_modules/@astrojs/react/dist/vnode-children.js
193
+ var ids = 0;
194
+ function convert(children) {
195
+ let doc = parse(children.toString().trim());
196
+ let id = ids++;
197
+ let key = 0;
198
+ function createReactElementFromNode(node) {
199
+ const childVnodes = Array.isArray(node.children) && node.children.length ? node.children.map((child) => createReactElementFromNode(child)).filter(Boolean) : void 0;
200
+ if (node.type === 0) return createElement(Fragment, {}, childVnodes);
201
+ else if (node.type === 1) {
202
+ const { class: className, ...props } = node.attributes;
203
+ return createElement(node.name, {
204
+ ...props,
205
+ className,
206
+ key: `${id}-${key++}`
207
+ }, childVnodes);
208
+ } else if (node.type === 2) return node.value.trim() ? node.value : void 0;
209
+ }
210
+ return createReactElementFromNode(doc).props.children;
211
+ }
212
+ //#endregion
213
+ export { convert as default };