@solidjs/web 2.0.0-rc.7 → 2.0.0-rc.8

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 (72) hide show
  1. package/dist/server.dev.js +15 -2
  2. package/dist/server.js +15 -2
  3. package/dist/web.dev.js +41 -9
  4. package/dist/web.js +39 -8
  5. package/dist/{web.cjs → web.observe.js} +137 -239
  6. package/frames/dist/server.dev.js +19 -0
  7. package/frames/dist/server.js +19 -0
  8. package/frames/package.json +6 -24
  9. package/package.json +81 -314
  10. package/serialization/decode/package.json +3 -9
  11. package/serialization/package.json +3 -9
  12. package/serialization/types/serializer-decode.d.ts +49 -2
  13. package/server-functions/dist/server.dev.js +28 -10
  14. package/server-functions/dist/server.js +28 -10
  15. package/server-functions/package.json +6 -24
  16. package/server-functions/rich-args/package.json +3 -9
  17. package/storage/package.json +3 -9
  18. package/types/client.d.ts +17 -0
  19. package/types/frames/serializer-decode.d.ts +49 -2
  20. package/types/serializer-decode.d.ts +49 -2
  21. package/types/server-functions/server.d.ts +27 -4
  22. package/types/server.d.ts +1 -1
  23. package/dist/server.cjs +0 -3708
  24. package/dist/server.dev.cjs +0 -3794
  25. package/dist/web.dev.cjs +0 -2285
  26. package/frames/dist/client.cjs +0 -2043
  27. package/frames/dist/client.dev.cjs +0 -2063
  28. package/frames/dist/server.cjs +0 -4542
  29. package/frames/dist/server.dev.cjs +0 -4584
  30. package/serialization/dist/decode.cjs +0 -155
  31. package/serialization/dist/serialization.cjs +0 -275
  32. package/serialization/types-cjs/index.d.cts +0 -101
  33. package/serialization/types-cjs/package.json +0 -3
  34. package/serialization/types-cjs/serializer-decode.d.cts +0 -172
  35. package/serialization/types-cjs/serializer.d.cts +0 -101
  36. package/server-functions/dist/client.cjs +0 -1069
  37. package/server-functions/dist/rich-args.cjs +0 -11
  38. package/server-functions/dist/server.cjs +0 -2381
  39. package/server-functions/dist/server.dev.cjs +0 -2409
  40. package/storage/dist/storage.cjs +0 -12
  41. package/storage/types-cjs/index.d.cts +0 -28
  42. package/storage/types-cjs/package.json +0 -3
  43. package/types-cjs/client.d.cts +0 -197
  44. package/types-cjs/constants.d.cts +0 -20
  45. package/types-cjs/cookies.d.cts +0 -41
  46. package/types-cjs/frames/client.d.cts +0 -36
  47. package/types-cjs/frames/frame-client.d.cts +0 -370
  48. package/types-cjs/frames/frame-container-plugin.d.cts +0 -71
  49. package/types-cjs/frames/frame-sink.d.cts +0 -92
  50. package/types-cjs/frames/frame-transport.d.cts +0 -189
  51. package/types-cjs/frames/serializer-decode.d.cts +0 -172
  52. package/types-cjs/frames/serializer.d.cts +0 -101
  53. package/types-cjs/frames/server.d.cts +0 -52
  54. package/types-cjs/head.d.cts +0 -19
  55. package/types-cjs/index.d.cts +0 -191
  56. package/types-cjs/index.server.d.cts +0 -147
  57. package/types-cjs/jsx-properties.d.cts +0 -93
  58. package/types-cjs/jsx.d.cts +0 -4146
  59. package/types-cjs/package.json +0 -3
  60. package/types-cjs/reconcile.d.cts +0 -1
  61. package/types-cjs/render.d.cts +0 -6
  62. package/types-cjs/response.d.cts +0 -81
  63. package/types-cjs/serializer-decode.d.cts +0 -172
  64. package/types-cjs/serializer.d.cts +0 -101
  65. package/types-cjs/server-functions/client.d.cts +0 -184
  66. package/types-cjs/server-functions/flash.d.cts +0 -36
  67. package/types-cjs/server-functions/registry.d.cts +0 -100
  68. package/types-cjs/server-functions/rich-args.d.cts +0 -1
  69. package/types-cjs/server-functions/server.d.cts +0 -546
  70. package/types-cjs/server-functions/shared.d.cts +0 -283
  71. package/types-cjs/server-mock.d.cts +0 -337
  72. package/types-cjs/server.d.cts +0 -408
package/dist/web.dev.cjs DELETED
@@ -1,2285 +0,0 @@
1
- 'use strict';
2
-
3
- var solidJs = require('solid-js');
4
-
5
- const DOMWithState = {
6
- INPUT: {
7
- value: 1,
8
- defaultValue: 2,
9
- checked: 1,
10
- defaultChecked: 2
11
- },
12
- SELECT: {
13
- value: 1
14
- },
15
- OPTION: {
16
- value: 1,
17
- selected: 1,
18
- defaultSelected: 2
19
- },
20
- TEXTAREA: {
21
- value: 1,
22
- defaultValue: 2
23
- },
24
- VIDEO: {
25
- muted: 1,
26
- defaultMuted: 2
27
- },
28
- AUDIO: {
29
- muted: 1,
30
- defaultMuted: 2
31
- }
32
- };
33
- const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
34
- const $$SLOT = /*#__PURE__*/Symbol("slot");
35
- const $$HOST = /*#__PURE__*/Symbol("host");
36
- const DelegatedEvents = /*#__PURE__*/new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
37
- const SVGElements = /*#__PURE__*/new Set([
38
- "altGlyph", "altGlyphDef", "altGlyphItem", "animate", "animateColor", "animateMotion", "animateTransform", "circle", "clipPath", "color-profile", "cursor", "defs", "desc", "ellipse", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence", "filter", "font", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignObject", "g", "glyph", "glyphRef", "hkern", "image", "line", "linearGradient", "marker", "mask", "metadata", "missing-glyph", "mpath", "path", "pattern", "polygon", "polyline", "radialGradient", "rect",
39
- "set", "stop",
40
- "svg", "switch", "symbol", "text", "textPath",
41
- "tref", "tspan", "use", "view", "vkern"]);
42
- const MathMLElements = /*#__PURE__*/new Set(["annotation", "annotation-xml", "maction", "math", "menclose", "merror", "mfenced", "mfrac", "mi", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mprescripts", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msubsup", "msup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "semantics"]);
43
- const Namespaces = {
44
- svg: "http://www.w3.org/2000/svg",
45
- mathml: "http://www.w3.org/1998/Math/MathML",
46
- xlink: "http://www.w3.org/1999/xlink",
47
- xml: "http://www.w3.org/XML/1998/namespace"
48
- };
49
- const VoidElements = /*#__PURE__*/new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"]);
50
- const RawTextElements = /*#__PURE__*/new Set(["style", "script", "noscript", "template", "textarea", "title"]);
51
- const DOMElements = /*#__PURE__*/new Set(/*#__PURE__*/"a,abbr,acronym,address,applet,area,article,aside,audio,b,base,basefont,bdi,bdo,bgsound,big,blink,blockquote,body,br,button,canvas,caption,center,cite,code,col,colgroup,content,data,datalist,dd,del,details,dfn,dialog,dir,div,dl,dt,em,embed,fieldset,figcaption,figure,font,footer,form,frame,frameset,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,i,iframe,image,img,input,ins,isindex,kbd,keygen,label,legend,li,link,listing,main,map,mark,marquee,math,menu,menuitem,meta,meter,multicol,nav,nextid,nobr,noembed,noframes,noindex,noscript,object,ol,optgroup,option,output,p,param,picture,plaintext,portal,pre,progress,q,rb,rp,rt,rtc,ruby,s,samp,script,search,section,select,shadow,slot,small,source,spacer,span,strike,strong,style,sub,summary,sup,svg,table,tbody,td,template,textarea,tfoot,th,thead,time,title,tr,track,tt,u,ul,var,video,wbr,webview,xmp".split(","));
52
- const COMPOSED_BODY_FRAMING = /*#__PURE__*/new Set(["content-length", "content-encoding", "transfer-encoding"]);
53
-
54
- const transparentOptions = {
55
- transparent: true,
56
- sync: true
57
- };
58
- const syncOptions = {
59
- sync: true
60
- };
61
- let bindingEffect = null;
62
- function tagElement(node) {
63
- if (bindingEffect !== null && bindingEffect._devElement === undefined) bindingEffect._devElement = node;
64
- }
65
- function effect(fn, effectFn, options) {
66
- const nodeOptions = options ? {
67
- sync: true,
68
- ...options,
69
- transparent: !options.scope
70
- } : transparentOptions;
71
- {
72
- let node = null;
73
- solidJs.createRenderEffect(prev => {
74
- node = solidJs.getOwner();
75
- return fn(prev);
76
- }, (value, prev) => {
77
- const outer = bindingEffect;
78
- bindingEffect = node;
79
- try {
80
- return effectFn(value, prev);
81
- } finally {
82
- bindingEffect = outer;
83
- }
84
- }, nodeOptions);
85
- return;
86
- }
87
- }
88
- function memo(fn) {
89
- return solidJs.createMemo(() => fn(), syncOptions);
90
- }
91
-
92
- function reconcileArrays(parentNode, a, b, marker) {
93
- let bLength = b.length,
94
- aEnd = a.length,
95
- bEnd = bLength,
96
- aStart = 0,
97
- bStart = 0,
98
- tail = a[aEnd - 1],
99
- tailTag = tail[$$SLOT],
100
- after = tail.parentNode === parentNode && (!tailTag || tailTag === marker) ? tail.nextSibling : marker || null,
101
- map = null,
102
- anchor,
103
- anchorTag;
104
- const isLive = n => {
105
- if (!n) return false;
106
- const tag = n[$$SLOT];
107
- return n.parentNode === parentNode && (!tag || tag === marker);
108
- };
109
- while (aStart < aEnd || bStart < bEnd) {
110
- if (a[aStart] === b[bStart] && isLive(a[aStart])) {
111
- aStart++;
112
- bStart++;
113
- continue;
114
- }
115
- while (a[aEnd - 1] === b[bEnd - 1] && isLive(a[aEnd - 1])) {
116
- aEnd--;
117
- bEnd--;
118
- }
119
- if (aEnd === aStart) {
120
- let node;
121
- if (bEnd < bLength) {
122
- if (bStart) {
123
- const prev = b[bStart - 1];
124
- const prevTag = prev[$$SLOT];
125
- node = prev.parentNode === parentNode && (!prevTag || prevTag === marker) ? prev.nextSibling : after;
126
- } else node = b[bEnd - bStart];
127
- } else node = after;
128
- while (bStart < bEnd) {
129
- const n = b[bStart++];
130
- parentNode.insertBefore(n, node);
131
- if (marker) n[$$SLOT] = marker;
132
- }
133
- } else if (bEnd === bStart) {
134
- while (aStart < aEnd) {
135
- const n = a[aStart++];
136
- if (!map || !map.has(n)) {
137
- const tag = n[$$SLOT];
138
- if (n.parentNode === parentNode && (!tag || tag === marker)) n.remove();
139
- }
140
- }
141
- } else if ((anchor = a[aStart]) === b[bEnd - 1] && b[bStart] === a[aEnd - 1] && anchor.parentNode === parentNode && (!(anchorTag = anchor[$$SLOT]) || anchorTag === marker)) {
142
- if (marker) {
143
- do {
144
- const n = a[--aEnd];
145
- parentNode.insertBefore(n, anchor);
146
- n[$$SLOT] = marker;
147
- bStart++;
148
- if (aStart >= aEnd - 1 || bStart >= bEnd) break;
149
- } while (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]);
150
- } else {
151
- do {
152
- parentNode.insertBefore(a[--aEnd], anchor);
153
- bStart++;
154
- if (aStart >= aEnd - 1 || bStart >= bEnd) break;
155
- } while (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]);
156
- }
157
- } else {
158
- if (!map) {
159
- map = new Map();
160
- let i = bStart;
161
- while (i < bEnd) map.set(b[i], i++);
162
- }
163
- const index = map.get(a[aStart]);
164
- if (index != null) {
165
- if (bStart < index && index < bEnd) {
166
- let i = aStart,
167
- sequence = 1,
168
- t;
169
- while (++i < aEnd && i < bEnd) {
170
- if ((t = map.get(a[i])) == null || t !== index + sequence) break;
171
- sequence++;
172
- }
173
- if (sequence > index - bStart) {
174
- const head = a[aStart];
175
- const headTag = head[$$SLOT];
176
- const node = head.parentNode === parentNode && (!headTag || headTag === marker) ? head : after;
177
- while (bStart < index) {
178
- const n = b[bStart++];
179
- parentNode.insertBefore(n, node);
180
- if (marker) n[$$SLOT] = marker;
181
- }
182
- } else {
183
- const oldNode = a[aStart++];
184
- const newNode = b[bStart++];
185
- const oldTag = oldNode[$$SLOT];
186
- if (oldNode.parentNode === parentNode && (!oldTag || oldTag === marker)) {
187
- parentNode.replaceChild(newNode, oldNode);
188
- } else {
189
- parentNode.insertBefore(newNode, after);
190
- }
191
- if (marker) newNode[$$SLOT] = marker;
192
- }
193
- } else aStart++;
194
- } else {
195
- const n = a[aStart++];
196
- const nTag = n[$$SLOT];
197
- if (n.parentNode === parentNode && (!nTag || nTag === marker)) n.remove();
198
- }
199
- }
200
- }
201
- }
202
-
203
- const HEAD_ELIGIBLE_TAGS = new Set(["title", "meta", "link", "style", "script", "base"]);
204
- const HEAD_ATTR_NAME = /^[a-zA-Z_][a-zA-Z0-9_:.-]*$/;
205
- const RESOURCE_LINK_RELS = new Set(["preload", "modulepreload", "prefetch", "preconnect", "dns-prefetch", "stylesheet"]);
206
- const RESOURCE_QUALIFIERS = ["as", "crossorigin", "type", "media", "imagesrcset", "imagesizes"];
207
- const STYLESHEET_FETCH_META = new Set(["crossorigin", "integrity", "referrerpolicy", "fetchpriority"]);
208
- function evalHeadValue(v) {
209
- return typeof v === "function" ? v() : v;
210
- }
211
- function evalHeadProps(props, presets) {
212
- const out = {};
213
- for (const name in props) out[name] = presets && name in presets ? presets[name] : evalHeadValue(props[name]);
214
- return out;
215
- }
216
- function classifyHeadTag(desc) {
217
- const tag = desc.tag;
218
- if (tag === "link") {
219
- const rel = evalHeadValue(desc.props && desc.props.rel);
220
- return {
221
- resource: RESOURCE_LINK_RELS.has(rel),
222
- rel
223
- };
224
- }
225
- if (tag === "style") return {
226
- resource: !!(desc.props && "href" in desc.props)
227
- };
228
- if (tag === "script") return {
229
- resource: !!(desc.props && "src" in desc.props)
230
- };
231
- return {
232
- resource: false
233
- };
234
- }
235
- function qualifierValue(name, value) {
236
- if (value == null || value === false) return null;
237
- if (name === "imagesrcset" || name === "imagesizes") return typeof value === "string" && value !== "" ? value : null;
238
- const v = value === true ? "" : String(value);
239
- if (name === "as") return asciiLowerCase(v);
240
- if (name !== "crossorigin") return v;
241
- return v.length === 15 && v.toLowerCase() === "use-credentials" ? v.toLowerCase() : "anonymous";
242
- }
243
- function asciiLowerCase(value) {
244
- return value.replace(/[A-Z]/g, c => String.fromCharCode(c.charCodeAt(0) + 32));
245
- }
246
- function resourceIdentity(tag, props) {
247
- const url = String(props.href || props.src || "");
248
- let id = "res:" + tag + ":" + (props.rel || "") + ":" + url.length + ":" + url;
249
- for (let i = 0; i < RESOURCE_QUALIFIERS.length; i++) {
250
- const q = RESOURCE_QUALIFIERS[i];
251
- const value = qualifierValue(q, props[q]);
252
- if (value !== null) id += ":" + q + "=" + value.length + ":" + value;
253
- }
254
- return id;
255
- }
256
- function replaceableIdentity(tag, props, key, unique) {
257
- if (tag === "title") return "title";
258
- if (tag === "base") return "base";
259
- if (tag === "meta" && props.charset != null) return "charset";
260
- if (key != null) return tag + ":key:" + key;
261
- if (tag === "meta") {
262
- for (const ns of ["name", "property", "http-equiv"]) if (props[ns] != null) return "meta:" + ns + ":" + props[ns] + (props.media != null ? ":media=" + props.media : "");
263
- return unique;
264
- }
265
- if (tag === "link") {
266
- const rel = props.rel || "";
267
- if (rel === "icon" || rel === "apple-touch-icon") return "link:" + rel + (props.sizes != null ? ":sizes=" + props.sizes : "") + (props.type != null ? ":type=" + props.type : "");
268
- return "link:" + rel + ":" + (props.href || "");
269
- }
270
- return unique;
271
- }
272
- function resolveHead(groups) {
273
- const winners = new Map();
274
- const sorted = groups.slice().sort((a, b) => a.seq - b.seq);
275
- for (let i = 0; i < sorted.length; i++) {
276
- const group = sorted[i];
277
- const byIdentity = new Map();
278
- for (let j = 0; j < group.tags.length; j++) {
279
- const t = group.tags[j];
280
- let list = byIdentity.get(t.identity);
281
- if (!list) byIdentity.set(t.identity, list = []);
282
- list.push(t);
283
- }
284
- for (const [identity, tags] of byIdentity) {
285
- if (identity === "title") {
286
- if (tags.length > 1) console.warn("Multiple <title> tags in one head group; the last one wins.");
287
- winners.set(identity, {
288
- seq: group.seq,
289
- tags: [tags[tags.length - 1]]
290
- });
291
- } else {
292
- winners.set(identity, {
293
- seq: group.seq,
294
- tags
295
- });
296
- }
297
- }
298
- }
299
- return winners;
300
- }
301
-
302
- function parseCookieHeader(header) {
303
- const cookies = {};
304
- if (!header) return cookies;
305
- for (const part of header.split(";")) {
306
- const eq = part.indexOf("=");
307
- if (eq < 0) continue;
308
- const name = decodeSafe(part.slice(0, eq).trim());
309
- let value = part.slice(eq + 1).trim();
310
- if (value.length > 1 && value[0] === '"' && value[value.length - 1] === '"') {
311
- value = value.slice(1, -1);
312
- }
313
- cookies[name] = decodeSafe(value);
314
- }
315
- return cookies;
316
- }
317
- function decodeSafe(text) {
318
- try {
319
- return decodeURIComponent(text);
320
- } catch {
321
- return text;
322
- }
323
- }
324
- function serializeCookie(name, value, options = {}) {
325
- assertServableCookie(name, options);
326
- let cookie = `${encodeURIComponent(name)}=${encodeURIComponent(value)}`;
327
- cookie += `; Path=${options.path === undefined ? "/" : options.path}`;
328
- if (options.domain) cookie += `; Domain=${options.domain}`;
329
- if (options.maxAge !== undefined) cookie += `; Max-Age=${Math.trunc(options.maxAge)}`;
330
- if (options.expires) cookie += `; Expires=${options.expires.toUTCString()}`;
331
- if (options.httpOnly) cookie += "; HttpOnly";
332
- if (options.secure) cookie += "; Secure";
333
- if (options.partitioned) cookie += "; Partitioned";
334
- if (options.sameSite) {
335
- const sameSite = options.sameSite.toLowerCase();
336
- cookie += `; SameSite=${sameSite === "none" ? "None" : sameSite === "strict" ? "Strict" : "Lax"}`;
337
- }
338
- return cookie;
339
- }
340
- function assertServableCookie(name, options) {
341
- const reject = reason => {
342
- throw new Error(`serializeCookie: every browser silently rejects this cookie — ${reason}. ` + `It would never come back on a request, with no error anywhere.`);
343
- };
344
- const lower = name.toLowerCase();
345
- if (lower.startsWith("__host-")) {
346
- if (!options.secure) reject(`the __Host- prefix on \`${name}\` requires \`secure: true\``);
347
- if (options.path !== undefined && options.path !== "/") reject(`the __Host- prefix on \`${name}\` requires \`Path=/\` (got \`${options.path}\`) — ` + `host-locking is the prefix's whole contract, so it cannot be path-scoped`);
348
- if (options.domain) reject(`the __Host- prefix on \`${name}\` forbids \`Domain\` (got \`${options.domain}\`)`);
349
- } else if (lower.startsWith("__secure-") && !options.secure) {
350
- reject(`the __Secure- prefix on \`${name}\` requires \`secure: true\``);
351
- }
352
- if (options.sameSite && options.sameSite.toLowerCase() === "none" && !options.secure) {
353
- reject("`SameSite=None` requires `secure: true`");
354
- }
355
- if (options.partitioned && !options.secure) {
356
- reject("`Partitioned` requires `secure: true`");
357
- }
358
- }
359
- const FLASH_COOKIE = "flash";
360
- const FLASH_MATCHER = new RegExp(`(?:^|;\\s*)${FLASH_COOKIE}=([^;]+)`);
361
- function hasFlashCookie(cookieHeader) {
362
- return !!cookieHeader && FLASH_MATCHER.test(cookieHeader);
363
- }
364
- function clearFlashCookie() {
365
- return `${FLASH_COOKIE}=; Max-Age=0; Path=/`;
366
- }
367
-
368
- const SERVER_FUNCTION_METADATA = Symbol.for("solid.ServerFunctionMetadata");
369
- function getServerFunctionMetadata(fn) {
370
- if (typeof fn !== "function") return undefined;
371
- return fn[SERVER_FUNCTION_METADATA] || undefined;
372
- }
373
- function isServerFunction(fn) {
374
- return typeof fn === "function" && !!fn[SERVER_FUNCTION_METADATA];
375
- }
376
- const SERVER_FUNCTION_RPC = Symbol.for("solid.ServerFunctionRPC");
377
- function getServerFunctionRPC() {
378
- return globalThis[SERVER_FUNCTION_RPC];
379
- }
380
-
381
- const assetGates = new WeakMap();
382
- const waitAsset = promise => {
383
- let gate = assetGates.get(promise);
384
- if (!gate) {
385
- solidJs.runWithOwner(null, () => {
386
- gate = solidJs.createMemo(() => promise);
387
- });
388
- assetGates.set(promise, gate);
389
- }
390
- gate();
391
- };
392
- const $$EVENT_OWNER = "_$SOLID_EVENT_OWNER";
393
- const $$EVENT_TUPLE = Symbol();
394
- const hasOwn = Object.prototype.hasOwnProperty;
395
- const INNER_OWNED = {};
396
- const delegatedEvents = new Set();
397
- const delegatedContainers = new Map();
398
- function voidFn() {}
399
- function generateHydrationScript(_options) {
400
- return "";
401
- }
402
- function HydrationScript(_props) {
403
- return null;
404
- }
405
- const getRequestEvent = voidFn;
406
- function render(code, element, init, options = {}) {
407
- if (!element) {
408
- throw new Error("The `element` passed to `render(..., element)` doesn't exist. Make sure `element` exists in the document.");
409
- }
410
- solidJs.resetErrorHalt();
411
- solidJs.enforceLoadingBoundary(true);
412
- let disposer;
413
- registerDelegatedRoot(element);
414
- try {
415
- solidJs.createRoot(dispose => {
416
- disposer = dispose;
417
- if (element === document) {
418
- const tree = code();
419
- effect(() => solidJs.flatten(tree), () => {});
420
- } else {
421
- const tree = code();
422
- insert(element, () => tree, element.firstChild ? null : undefined, init, {
423
- ...options.insertOptions,
424
- schedule: true
425
- });
426
- }
427
- }, {
428
- id: options.renderId
429
- });
430
- solidJs.flush();
431
- } catch (err) {
432
- if (disposer) disposer();
433
- unregisterDelegatedRoot(element);
434
- throw err;
435
- } finally {
436
- solidJs.enforceLoadingBoundary(false);
437
- }
438
- return () => {
439
- disposer();
440
- unregisterDelegatedRoot(element);
441
- element.textContent = "";
442
- };
443
- }
444
- function create(html, bypassGuard, flag) {
445
- if (isHydrating() && !bypassGuard) throw new Error("Failed attempt to create new DOM elements during hydration. Check that the libraries you are using support hydration.");
446
- if (/^<(html|head|body)[\s>]/i.test(html)) throw new Error("Document shell templates (<html>, <head>, <body>) cannot be client-created: " + "a <template> parse strips those tags. Render this component through hydrate(), " + "where the document shell already exists.");
447
- const t = document.createElement("template");
448
- t.innerHTML = html;
449
- return flag === 2 ? t.content.firstChild.firstChild : t.content.firstChild;
450
- }
451
- function template(html, flag) {
452
- let node;
453
- const fn = flag === 1 ? bypassGuard => document.importNode(node || (node = create(html, bypassGuard, flag)), true) : bypassGuard => (node || (node = create(html, bypassGuard, flag))).cloneNode(true);
454
- fn._html = flag === 2 ? html.replace(/^<[^>]+>/, "") : html;
455
- return fn;
456
- }
457
- function delegateEvents(eventNames) {
458
- for (let i = 0, l = eventNames.length; i < l; i++) {
459
- const name = eventNames[i];
460
- if (!delegatedEvents.has(name)) {
461
- delegatedEvents.add(name);
462
- delegatedContainers.forEach((state, container) => attachDelegatedEvent(name, container, state));
463
- }
464
- }
465
- }
466
- function registerDelegatedRoot(root) {
467
- const state = registerDelegatedContainer(root, root);
468
- if (state) state.roots = (state.roots || 0) + 1;
469
- }
470
- function unregisterDelegatedRoot(root) {
471
- const state = delegatedContainers.get(root);
472
- if (state) state.roots > 1 ? state.roots-- : delete state.roots;
473
- unregisterDelegatedContainer(root, root);
474
- }
475
- function registerDelegatedContainer(container, owner = container) {
476
- if (!container || !owner) return;
477
- let state = delegatedContainers.get(container);
478
- if (!state) delegatedContainers.set(container, state = {
479
- owners: new Map(),
480
- handlers: new Map()
481
- });
482
- state.owners.set(owner, (state.owners.get(owner) || 0) + 1);
483
- delegatedEvents.forEach(name => attachDelegatedEvent(name, container, state));
484
- return state;
485
- }
486
- function unregisterDelegatedContainer(container, owner = container) {
487
- const state = delegatedContainers.get(container);
488
- if (!state) return;
489
- const count = state.owners.get(owner);
490
- if (count > 1) state.owners.set(owner, count - 1);else state.owners.delete(owner);
491
- if (state.owners.size) return;
492
- state.handlers.forEach((handler, name) => container.removeEventListener(name, handler));
493
- delegatedContainers.delete(container);
494
- }
495
- function attachDelegatedEvent(name, container, state) {
496
- if (state.handlers.has(name)) return;
497
- const handler = e => dispatchAsInteraction(e, () => eventHandler(e, container, state)) ;
498
- state.handlers.set(name, handler);
499
- container.addEventListener(name, handler);
500
- }
501
- function describeEventTarget(target) {
502
- if (!target || typeof target.tagName !== "string") return undefined;
503
- const tag = target.tagName.toLowerCase();
504
- let out = tag;
505
- if (target.id) out += `#${target.id}`;else if (typeof target.name === "string" && target.name) out += `[name=${target.name}]`;
506
- if (tag !== "input" && tag !== "textarea" && tag !== "select") {
507
- const text = (target.textContent || "").trim().replace(/\s+/g, " ");
508
- if (text) out += ` "${text.length > 30 ? text.slice(0, 29) + "…" : text}"`;
509
- }
510
- return out;
511
- }
512
- function dispatchAsInteraction(e, fn) {
513
- return solidJs.DEV.attribution.withInteraction({
514
- type: e.type,
515
- target: describeEventTarget(e.target)
516
- }, fn);
517
- }
518
- function getDelegatedRoot(node) {
519
- while (node) {
520
- if (delegatedContainers.get(node)?.roots) return node;
521
- node = node._$host || node.parentNode || node.host;
522
- }
523
- }
524
- function findOwner(target, state) {
525
- let node = target;
526
- let distance = 0;
527
- while (node) {
528
- if (state.owners.has(node)) return {
529
- owner: node,
530
- distance
531
- };
532
- distance++;
533
- node = node._$host || node.parentNode || node.host;
534
- }
535
- }
536
- function setProperty(node, name, value) {
537
- tagElement(node);
538
- if (isHydrating(node)) return;
539
- const nodeName = node.nodeName;
540
- if (name === "value" && nodeName === "SELECT") queueMicrotask(() => node.value = value) || (node.value = value);else if ((name === "value" || name === "defaultValue") && (nodeName === "INPUT" || nodeName === "TEXTAREA")) node[name] = value ?? "";else node[name] = value;
541
- }
542
- let claimHandlers = null;
543
- const CLAIM_SEAM = Symbol.for("solid.element-claims");
544
- function registerElementClaim(handler) {
545
- (claimHandlers || (claimHandlers = globalThis[CLAIM_SEAM] = [])).push(handler);
546
- return () => {
547
- const index = claimHandlers.indexOf(handler);
548
- index > -1 && claimHandlers.splice(index, 1);
549
- };
550
- }
551
- const CLAIMED_ELEMENTS = "a[href], form[action]";
552
- function claimElementTree(root) {
553
- const handlers = globalThis[CLAIM_SEAM];
554
- if (handlers === undefined || handlers.length === 0) return root;
555
- const isElement = root.nodeType === 1;
556
- if (!isElement && root.nodeType !== 11) return root;
557
- if (isElement && root.matches(CLAIMED_ELEMENTS)) {
558
- for (let i = 0; i < handlers.length; i++) handlers[i](root);
559
- }
560
- const found = root.querySelectorAll(CLAIMED_ELEMENTS);
561
- for (let i = 0; i < found.length; i++) {
562
- for (let j = 0; j < handlers.length; j++) handlers[j](found[i]);
563
- }
564
- return root;
565
- }
566
- function claimElement(node) {
567
- if (claimHandlers !== null) {
568
- for (let i = 0; i < claimHandlers.length; i++) claimHandlers[i](node);
569
- }
570
- return node;
571
- }
572
- function setAttribute(node, name, value) {
573
- tagElement(node);
574
- if (isHydrating(node)) return;
575
- const selectMultiple = name === "multiple" && node.localName === "select";
576
- if (value == null || value === false) node.removeAttribute(name);else {
577
- node.setAttribute(name, value === true ? "" : value);
578
- if (selectMultiple && !node._$multiple) {
579
- const options = node.options;
580
- for (let i = 0; i < options.length; i++) {
581
- if (options[i].defaultSelected) options[i].selected = true;
582
- }
583
- }
584
- }
585
- if (selectMultiple) node._$multiple = true;
586
- if (claimHandlers !== null && (name === "href" || name === "action")) claimElement(node);
587
- }
588
- function setAttributeNS(node, namespace, name, value) {
589
- tagElement(node);
590
- if (isHydrating(node)) return;
591
- if (value == null || value === false) node.removeAttributeNS(namespace, name.indexOf(":") > -1 ? name.split(":").pop() : name);else node.setAttributeNS(namespace, name, value === true ? "" : value);
592
- }
593
- function className(node, value, prev) {
594
- tagElement(node);
595
- if (typeof value === "number") value = "" + value;
596
- if (typeof prev === "number") prev = "" + prev;
597
- if (isHydrating(node)) {
598
- node._$classes = value && typeof value === "object" ? classListToObject(value) : undefined;
599
- return;
600
- }
601
- if (value == null || value === false) {
602
- if (prev || node._$classes) {
603
- node.removeAttribute("class");
604
- node._$classes = undefined;
605
- }
606
- return;
607
- }
608
- if (typeof value === "string") {
609
- node._$classes = undefined;
610
- value !== prev && node.setAttribute("class", value);
611
- return;
612
- }
613
- let applied;
614
- if (typeof prev === "string") {
615
- applied = {};
616
- node.removeAttribute("class");
617
- } else applied = node._$classes || classListToObject(prev || {});
618
- value = classListToObject(value);
619
- const classKeys = Object.keys(value);
620
- const prevKeys = Object.keys(applied);
621
- let i, len;
622
- for (i = 0, len = prevKeys.length; i < len; i++) {
623
- const key = prevKeys[i];
624
- if (!key || key === "undefined" || value[key]) continue;
625
- node.classList.remove(key);
626
- }
627
- for (i = 0, len = classKeys.length; i < len; i++) {
628
- const key = classKeys[i],
629
- classValue = !!value[key];
630
- if (!key || key === "undefined" || applied[key] === classValue || !classValue) continue;
631
- node.classList.add(key);
632
- }
633
- node._$classes = value;
634
- }
635
- function addEvent(node, name, handler, delegate) {
636
- if (delegate) {
637
- const key = `$$${name}`;
638
- let data;
639
- if (Array.isArray(handler)) {
640
- data = handler[1];
641
- node[key] = handler[0];
642
- } else node[key] = handler;
643
- node[`${key}Data`] = data;
644
- return;
645
- }
646
- if (Array.isArray(handler)) {
647
- const handlerFn = handler[0];
648
- const listener = e => dispatchAsInteraction(e, () => handlerFn.call(node, handler[1], e)) ;
649
- listener[$$EVENT_TUPLE] = handler;
650
- node.addEventListener(name, listener);
651
- return listener;
652
- }
653
- if (typeof handler === "function") {
654
- const listener = e => dispatchAsInteraction(e, () => handler.call(node, e));
655
- node.addEventListener(name, listener);
656
- return listener;
657
- }
658
- node.addEventListener(name, handler, typeof handler !== "function" && handler);
659
- return handler;
660
- }
661
- function style(node, value, prev) {
662
- tagElement(node);
663
- if (isHydrating(node)) return;
664
- if (!value) {
665
- if (prev || node._$styles) {
666
- setAttribute(node, "style");
667
- node._$styles = undefined;
668
- }
669
- return;
670
- }
671
- const nodeStyle = node.style;
672
- if (typeof value === "string") {
673
- node._$styles = undefined;
674
- return nodeStyle.cssText = value;
675
- }
676
- if (typeof prev === "string") {
677
- nodeStyle.cssText = "";
678
- prev = undefined;
679
- }
680
- let applied = node._$styles;
681
- if (!applied) {
682
- applied = node._$styles = prev ? {
683
- ...prev
684
- } : {};
685
- }
686
- let v, s;
687
- for (s in applied) {
688
- if (!hasOwn.call(value, s) || value[s] == null) {
689
- nodeStyle.removeProperty(s);
690
- delete applied[s];
691
- }
692
- }
693
- for (s in value) {
694
- if (!hasOwn.call(value, s)) continue;
695
- v = value[s];
696
- if (v != null && v !== applied[s]) {
697
- nodeStyle.setProperty(s, v);
698
- applied[s] = v;
699
- }
700
- }
701
- }
702
- function setStyleProperty(node, name, value) {
703
- tagElement(node);
704
- if (isHydrating(node)) return;
705
- value != null ? node.style.setProperty(name, value) : node.style.removeProperty(name);
706
- }
707
- function spread(node, props, skipChildren) {
708
- const prevProps = {};
709
- const get = () => (typeof props === "function" ? props() : props) ?? {};
710
- if (!skipChildren) insert(node, () => {
711
- const source = get();
712
- return hasOwn.call(source, "children") ? source.children : undefined;
713
- });
714
- effect(() => {
715
- const source = get();
716
- const r = hasOwn.call(source, "ref") && source.ref;
717
- (typeof r === "function" || Array.isArray(r)) && ref(() => r, node);
718
- }, () => {});
719
- effect(() => {
720
- const source = get();
721
- const newProps = {};
722
- for (const prop in source) {
723
- if (!hasOwn.call(source, prop)) continue;
724
- if (prop === "children" || prop === "ref") continue;
725
- newProps[prop] = source[prop];
726
- }
727
- return newProps;
728
- }, props => assign(node, props, true, prevProps, true));
729
- return prevProps;
730
- }
731
- function dynamicProperty(props, key) {
732
- const src = props[key];
733
- Object.defineProperty(props, key, {
734
- get() {
735
- return src();
736
- },
737
- enumerable: true
738
- });
739
- return props;
740
- }
741
- function applyRef(r, element) {
742
- Array.isArray(r) ? r.flat(Infinity).forEach(f => f && f(element)) : r(element);
743
- }
744
- function ref(fn, element) {
745
- const resolved = solidJs.untrack(fn);
746
- solidJs.runWithOwner(null, () => applyRef(resolved, element));
747
- }
748
- function scope(fn) {
749
- fn.$s = true;
750
- return fn;
751
- }
752
- const SCOPE_OPTIONS = {
753
- scope: true
754
- };
755
- let hydrationRt = null;
756
- function installHydrationRuntime() {
757
- hydrationRt = {
758
- claimInitial(parent, multi, initial) {
759
- if (isHydrating(parent)) {
760
- if (!multi && initial === undefined && parent) initial = [...parent.childNodes];
761
- if (Array.isArray(initial)) stripTextSeparators(initial);
762
- }
763
- return initial;
764
- },
765
- reclaimRegion(current, parent, marker) {
766
- if (!solidJs.sharedConfig.hydrating || !current || !parent.isConnected) return current;
767
- const first = Array.isArray(current) ? current[0] : current;
768
- if (!first || !first.nodeType || first.isConnected) return current;
769
- let nodes;
770
- if (marker) {
771
- nodes = [];
772
- let node = marker.previousSibling,
773
- depth = 0;
774
- while (node) {
775
- if (node.nodeType === 8) {
776
- const v = node.nodeValue;
777
- if (v === "/") depth++;else if (v === "$") {
778
- if (depth === 0) break;
779
- depth--;
780
- }
781
- }
782
- nodes.unshift(node);
783
- node = node.previousSibling;
784
- }
785
- } else nodes = [...parent.childNodes];
786
- return stripTextSeparators(nodes);
787
- },
788
- dedupEvent(e) {
789
- return !!(solidJs.sharedConfig.registry && solidJs.sharedConfig.events && solidJs.sharedConfig.events.find(([el, ev]) => ev === e));
790
- }
791
- };
792
- }
793
- function stripTextSeparators(nodes) {
794
- let j = 0;
795
- for (let i = 0; i < nodes.length; i++) {
796
- const node = nodes[i],
797
- t = node.nodeType;
798
- if (t === 8) {
799
- const v = node.nodeValue;
800
- if (v === "!$") {
801
- node.remove();
802
- continue;
803
- }
804
- if (v.startsWith("pl-")) continue;
805
- } else if (t === 1 && node.localName === "template" && node.id.startsWith("pl-")) continue;
806
- nodes[j++] = node;
807
- }
808
- nodes.length = j;
809
- return nodes;
810
- }
811
- function insert(parent, accessor, marker, initial, options) {
812
- const multi = marker !== undefined;
813
- const host = options && options.host;
814
- if (multi && !initial) initial = [];
815
- if (hydrationRt !== null) initial = hydrationRt.claimInitial(parent, multi, initial);
816
- if (typeof accessor !== "function") {
817
- accessor = normalize(accessor, initial, multi, true);
818
- if (typeof accessor !== "function") {
819
- insertExpression(parent, accessor, initial, marker);
820
- host && tagHost(accessor, host);
821
- return;
822
- }
823
- }
824
- if (multi && initial.length === 0) {
825
- const placeholder = document.createTextNode("");
826
- parent.insertBefore(placeholder, marker);
827
- initial = [placeholder];
828
- }
829
- let current = initial;
830
- effect(prev => {
831
- if (hydrationRt !== null) current = hydrationRt.reclaimRegion(current, parent, marker);
832
- const value = normalize(accessor(), current, multi, true);
833
- if (typeof value !== "function") return value;
834
- effect(() => (hydrationRt !== null && (current = hydrationRt.reclaimRegion(current, parent, marker)), normalize(value, current, multi)), inner => {
835
- current = insertExpression(parent, inner, current, marker);
836
- host && tagHost(current, host);
837
- }, prev !== undefined && !(options && options.schedule) ? {
838
- ...options,
839
- schedule: true
840
- } : options);
841
- return INNER_OWNED;
842
- }, value => {
843
- if (value === INNER_OWNED) return;
844
- current = insertExpression(parent, value, current, marker);
845
- host && tagHost(current, host);
846
- },
847
- accessor.$s ? options ? {
848
- ...options,
849
- scope: true
850
- } : SCOPE_OPTIONS : options);
851
- }
852
- function assign(node, props, skipChildren, prevProps = {}, skipRef = false) {
853
- tagElement(node);
854
- const nodeName = node.nodeName;
855
- props || (props = {});
856
- for (const prop in prevProps) {
857
- if (!(prop in props)) {
858
- if (prop === "children") continue;
859
- prevProps[prop] = assignProp(node, prop, null, prevProps[prop], skipRef, nodeName);
860
- }
861
- }
862
- for (const prop in props) {
863
- if (prop === "children") {
864
- if (!skipChildren) insertExpression(node, normalize(props.children, undefined, false));
865
- continue;
866
- }
867
- prevProps[prop] = assignProp(node, prop, props[prop], prevProps[prop], skipRef, nodeName);
868
- }
869
- }
870
- const ASSET_REMOVAL_GRACE = 100;
871
- const assetRegistry = new Map();
872
- function assetEntryKey(descriptor) {
873
- if (descriptor.policy === "exclusive") return "x|" + descriptor.key;
874
- return descriptor.type === "inline-style" ? "i|" + descriptor.id : descriptor.type + "|" + descriptor.href;
875
- }
876
- function findAssetElement(selector, attr, value, qualifiers) {
877
- const nodes = document.querySelectorAll(selector);
878
- outer: for (let i = 0; i < nodes.length; i++) {
879
- if (nodes[i].getAttribute(attr) !== value) continue;
880
- if (!qualifiers) return nodes[i];
881
- for (let q = 0; q < RESOURCE_QUALIFIERS.length; q++) {
882
- const name = RESOURCE_QUALIFIERS[q];
883
- if (qualifierValue(name, qualifiers[name]) !== qualifierValue(name, nodes[i].getAttribute(name))) continue outer;
884
- }
885
- return nodes[i];
886
- }
887
- return null;
888
- }
889
- function setAssetAttrs(el, attrs) {
890
- for (const name in attrs) el.setAttribute(name, attrs[name]);
891
- }
892
- function mountAssetElement(descriptor) {
893
- let el;
894
- if (descriptor.type === "inline-style") {
895
- el = findAssetElement("style[data-asset]", "data-asset", descriptor.id);
896
- if (!el) {
897
- el = document.createElement("style");
898
- el.setAttribute("data-asset", descriptor.id);
899
- el.textContent = descriptor.content || "";
900
- }
901
- } else {
902
- const rel = descriptor.type === "module" ? "modulepreload" : "stylesheet";
903
- el = findAssetElement(`link[rel="${rel}"]`, "href", descriptor.href);
904
- if (!el) {
905
- el = document.createElement("link");
906
- el.rel = rel;
907
- el.href = descriptor.href;
908
- }
909
- }
910
- if (descriptor.attrs) setAssetAttrs(el, descriptor.attrs);
911
- if (!el.isConnected) document.head.appendChild(el);
912
- return el;
913
- }
914
- const assetLoadSettled = /*#__PURE__*/Promise.resolve();
915
- function trackAssetLoad(entry, adopted) {
916
- if (entry.loadPromise) return;
917
- const el = entry.element;
918
- let settled = el.sheet != null;
919
- if (!settled && adopted && typeof performance !== "undefined" && performance.getEntriesByName) {
920
- settled = performance.getEntriesByName(el.href).length > 0;
921
- }
922
- if (settled) {
923
- entry.loadState = "loaded";
924
- entry.loadPromise = assetLoadSettled;
925
- return;
926
- }
927
- entry.loadState = "pending";
928
- entry.loadPromise = new Promise(resolve => {
929
- const settle = state => {
930
- entry.loadState = state;
931
- resolve();
932
- };
933
- el.addEventListener("load", () => settle("loaded"), {
934
- once: true
935
- });
936
- el.addEventListener("error", () => settle("errored"), {
937
- once: true
938
- });
939
- });
940
- }
941
- function warmAsset(descriptor) {
942
- if (descriptor.policy === "exclusive" || descriptor.type === "inline-style") return;
943
- const key = assetEntryKey(descriptor);
944
- let entry = assetRegistry.get(key);
945
- if (!entry) {
946
- entry = {
947
- count: 0,
948
- element: null,
949
- timer: null
950
- };
951
- assetRegistry.set(key, entry);
952
- }
953
- let adopted = true;
954
- if (!entry.element || !entry.element.isConnected) {
955
- const rel = descriptor.type === "module" ? "modulepreload" : "stylesheet";
956
- let el = findAssetElement(`link[rel="${rel}"]`, "href", descriptor.href);
957
- if (!el && descriptor.type === "style") {
958
- el = findAssetElement('link[rel="preload"][as="style"]', "href", descriptor.href);
959
- }
960
- if (!el) {
961
- adopted = false;
962
- el = document.createElement("link");
963
- if (descriptor.type === "style") {
964
- el.setAttribute("rel", "preload");
965
- el.setAttribute("as", "style");
966
- } else {
967
- el.setAttribute("rel", "modulepreload");
968
- }
969
- el.setAttribute("href", descriptor.href);
970
- if (!document.body) el.setAttribute("blocking", "render");
971
- }
972
- if (descriptor.attrs) setAssetAttrs(el, descriptor.attrs);
973
- if (!el.isConnected) document.head.appendChild(el);
974
- entry.element = el;
975
- entry.loadState = undefined;
976
- entry.loadPromise = undefined;
977
- }
978
- if (descriptor.type === "style") trackAssetLoad(entry, adopted);
979
- return entry;
980
- }
981
- function acquireAsset(descriptor) {
982
- const key = assetEntryKey(descriptor);
983
- let entry = assetRegistry.get(key);
984
- if (descriptor.policy === "exclusive") {
985
- if (!entry) {
986
- entry = {
987
- original: descriptor.get(),
988
- set: descriptor.set,
989
- writers: []
990
- };
991
- assetRegistry.set(key, entry);
992
- }
993
- const writer = {
994
- value: descriptor.value
995
- };
996
- entry.writers.push(writer);
997
- entry.set(writer.value);
998
- let released = false;
999
- return () => {
1000
- if (released) return;
1001
- released = true;
1002
- const index = entry.writers.indexOf(writer);
1003
- const wasTop = index === entry.writers.length - 1;
1004
- entry.writers.splice(index, 1);
1005
- if (!wasTop) return;
1006
- if (entry.writers.length) {
1007
- entry.set(entry.writers[entry.writers.length - 1].value);
1008
- } else {
1009
- entry.set(entry.original);
1010
- assetRegistry.delete(key);
1011
- }
1012
- };
1013
- }
1014
- if (!entry) {
1015
- entry = {
1016
- count: 0,
1017
- element: null,
1018
- timer: null
1019
- };
1020
- assetRegistry.set(key, entry);
1021
- }
1022
- if (entry.timer) {
1023
- clearTimeout(entry.timer);
1024
- entry.timer = null;
1025
- }
1026
- entry.count++;
1027
- if (!entry.element || !entry.element.isConnected) {
1028
- entry.element = mountAssetElement(descriptor);
1029
- } else if (descriptor.type === "style" && entry.element.getAttribute("rel") === "preload") {
1030
- entry.element.removeAttribute("as");
1031
- entry.element.setAttribute("rel", "stylesheet");
1032
- }
1033
- let released = false;
1034
- return () => {
1035
- if (released) return;
1036
- released = true;
1037
- if (--entry.count > 0) return;
1038
- entry.timer = setTimeout(() => {
1039
- assetRegistry.delete(key);
1040
- entry.element && entry.element.remove();
1041
- }, ASSET_REMOVAL_GRACE);
1042
- };
1043
- }
1044
- let headRegistrations = null;
1045
- let headSeq = 0;
1046
- let headUid = 0;
1047
- let headOwned = null;
1048
- let headApplied = null;
1049
- let headFallbackTitle = null;
1050
- let headScheduled = false;
1051
- const headMountedResources = new Set();
1052
- function initHeadRegistry() {
1053
- if (headRegistrations) return;
1054
- headRegistrations = [];
1055
- headOwned = new Map();
1056
- headApplied = new Map();
1057
- const t = document.querySelector("title");
1058
- headFallbackTitle = t ? t.hasAttribute("data-dh") ? t.getAttribute("data-dhf") : t.textContent : null;
1059
- if (globalThis._$HY) globalThis._$HY.h = applyServerHeadOps;
1060
- }
1061
- function applyServerHeadOps(ops) {
1062
- for (let i = 0; i < ops.length; i++) {
1063
- const op = ops[i];
1064
- const identity = op[0] === "t" ? "title" : op[1];
1065
- if (headOwned.has(identity)) continue;
1066
- if (op[0] === "t") setHeadTitle(op[1]);else if (op[0] === "r") {
1067
- const els = headMarkedElements(identity);
1068
- for (let j = 0; j < els.length; j++) els[j].remove();
1069
- } else {
1070
- const el = document.createElement(op[2]);
1071
- for (const name in op[3]) el.setAttribute(name, op[3][name]);
1072
- if (op[4] != null) el.textContent = op[4];
1073
- el.setAttribute("data-dh", identity);
1074
- document.head.appendChild(el);
1075
- }
1076
- }
1077
- }
1078
- function headMarkedElements(identity) {
1079
- const nodes = document.head.querySelectorAll("[data-dh]");
1080
- const out = [];
1081
- for (let i = 0; i < nodes.length; i++) {
1082
- if (nodes[i].getAttribute("data-dh") === identity) out.push(nodes[i]);
1083
- }
1084
- return out;
1085
- }
1086
- function setHeadTitle(text) {
1087
- let el = document.querySelector("title");
1088
- if (!el) {
1089
- el = document.createElement("title");
1090
- document.head.appendChild(el);
1091
- }
1092
- el.textContent = text;
1093
- el.setAttribute("data-dh", "title");
1094
- return el;
1095
- }
1096
- function scheduleHeadApply() {
1097
- if (headScheduled) return;
1098
- headScheduled = true;
1099
- queueMicrotask(flushHeadRegistry);
1100
- }
1101
- function flushHeadRegistry() {
1102
- if (solidJs.sharedConfig.hydrating) {
1103
- setTimeout(flushHeadRegistry, 0);
1104
- return;
1105
- }
1106
- headScheduled = false;
1107
- const winners = resolveHead(headRegistrations);
1108
- for (const [identity, els] of headOwned) {
1109
- if (winners.has(identity)) continue;
1110
- headOwned.delete(identity);
1111
- headApplied.delete(identity);
1112
- if (identity === "title") {
1113
- if (headFallbackTitle != null) {
1114
- const el = setHeadTitle(headFallbackTitle);
1115
- el.removeAttribute("data-dh");
1116
- el.removeAttribute("data-dhf");
1117
- }
1118
- } else {
1119
- for (let i = 0; i < els.length; i++) els[i].remove();
1120
- }
1121
- }
1122
- for (const [identity, winner] of winners) {
1123
- let sig = "";
1124
- for (let i = 0; i < winner.tags.length; i++) sig += winner.tags[i].tag + JSON.stringify(winner.tags[i].props) + "|";
1125
- if (headApplied.get(identity) === sig) continue;
1126
- headApplied.set(identity, sig);
1127
- if (identity === "base" || identity === "charset") {
1128
- console.warn(`useHead: <${winner.tags[0].tag}> (${identity}) is shell-only and ignored on the client`);
1129
- continue;
1130
- }
1131
- if (identity === "title") {
1132
- const children = winner.tags[0].props.children;
1133
- setHeadTitle(children == null ? "" : String(children));
1134
- headOwned.set(identity, []);
1135
- continue;
1136
- }
1137
- const existing = headMarkedElements(identity);
1138
- const els = [];
1139
- for (let i = 0; i < winner.tags.length; i++) {
1140
- els.push(renderHeadElement(winner.tags[i], identity, existing));
1141
- }
1142
- for (let i = 0; i < existing.length; i++) {
1143
- if (els.indexOf(existing[i]) === -1) existing[i].remove();
1144
- }
1145
- headOwned.set(identity, els);
1146
- }
1147
- }
1148
- function createHeadElement(tag, props) {
1149
- const el = document.createElement(tag);
1150
- for (const name in props) {
1151
- if (name === "children" || name === "ref" || name.slice(0, 2) === "on") continue;
1152
- if (!HEAD_ATTR_NAME.test(name)) {
1153
- console.warn(`useHead: ignoring invalid attribute name "${name}"`);
1154
- continue;
1155
- }
1156
- const v = props[name];
1157
- if (v == null || v === false) continue;
1158
- el.setAttribute(name, v === true ? "" : String(v));
1159
- }
1160
- if (props.children != null) el.textContent = String(props.children);
1161
- return el;
1162
- }
1163
- function renderHeadElement(t, identity, existing) {
1164
- for (let i = 0; i < existing.length; i++) {
1165
- if (headElementMatches(existing[i], t)) return existing.splice(i, 1)[0];
1166
- }
1167
- const el = createHeadElement(t.tag, t.props);
1168
- el.setAttribute("data-dh", identity);
1169
- document.head.appendChild(el);
1170
- return el;
1171
- }
1172
- function headElementMatches(el, t) {
1173
- if (el.tagName.toLowerCase() !== t.tag) return false;
1174
- for (const name in t.props) {
1175
- if (name === "children" || name === "ref" || name.slice(0, 2) === "on") continue;
1176
- if (!HEAD_ATTR_NAME.test(name)) continue;
1177
- const v = t.props[name];
1178
- if (v == null || v === false) {
1179
- if (el.hasAttribute(name)) return false;
1180
- } else if (el.getAttribute(name) !== (v === true ? "" : String(v))) return false;
1181
- }
1182
- const children = t.props.children;
1183
- return (children == null ? "" : String(children)) === el.textContent;
1184
- }
1185
- function mountHeadResource(tag, props) {
1186
- const identity = resourceIdentity(tag, props);
1187
- if (headMountedResources.has(identity)) return;
1188
- headMountedResources.add(identity);
1189
- const url = props.href || props.src;
1190
- let el = null;
1191
- if (tag === "link" && url == null && typeof props.imagesrcset === "string") el = findAssetElement(`link[rel="${props.rel}"]`, "href", null, props);else if (url != null) {
1192
- if (tag === "link") el = findAssetElement(`link[rel="${props.rel}"]`, "href", url, props);else if (tag === "script") el = findAssetElement("script[src]", "src", url);else el = findAssetElement("style[href]", "href", url);
1193
- }
1194
- if (!el) document.head.appendChild(createHeadElement(tag, props));
1195
- }
1196
- function gateHeadResource(props) {
1197
- const descriptor = {
1198
- type: props.rel === "stylesheet" ? "style" : "module",
1199
- href: props.href
1200
- };
1201
- let gateable = props.rel === "stylesheet" && props.href != null;
1202
- let attrs = null;
1203
- for (const name in props) {
1204
- if (name === "rel" || name === "href") continue;
1205
- if (!STYLESHEET_FETCH_META.has(name)) gateable = false;
1206
- if (!HEAD_ATTR_NAME.test(name)) continue;
1207
- const v = props[name];
1208
- if (v == null || v === false) continue;
1209
- (attrs || (attrs = {}))[name] = v === true ? "" : String(v);
1210
- }
1211
- if (attrs) descriptor.attrs = attrs;
1212
- effect(() => {
1213
- const entry = warmAsset(descriptor);
1214
- if (gateable && entry.loadState === "pending" && typeof waitAsset === "function") waitAsset(entry.loadPromise);
1215
- }, () => acquireAsset(descriptor));
1216
- }
1217
- function useHead(tags) {
1218
- initHeadRegistry();
1219
- const reg = {
1220
- seq: -1,
1221
- tags: null
1222
- };
1223
- const uid = ++headUid;
1224
- effect(() => {
1225
- let list = typeof tags === "function" ? tags() : tags;
1226
- if (!Array.isArray(list)) list = [list];
1227
- const replaceable = [];
1228
- const resources = [];
1229
- for (let i = 0; i < list.length; i++) {
1230
- const desc = list[i];
1231
- if (!desc || !HEAD_ELIGIBLE_TAGS.has(desc.tag)) {
1232
- console.warn(`useHead: ignoring non-head tag`, desc);
1233
- continue;
1234
- }
1235
- const cls = classifyHeadTag(desc);
1236
- const props = evalHeadProps(desc.props || {}, cls.rel !== undefined ? {
1237
- rel: cls.rel
1238
- } : undefined);
1239
- if (cls.resource) {
1240
- if (desc.tag === "link" && (props.rel === "stylesheet" || props.rel === "modulepreload")) {
1241
- gateHeadResource(props);
1242
- } else if (desc.tag === "link") {
1243
- mountHeadResource(desc.tag, props);
1244
- } else {
1245
- resources.push({
1246
- tag: desc.tag,
1247
- props
1248
- });
1249
- }
1250
- } else {
1251
- const key = evalHeadValue(desc.key);
1252
- replaceable.push({
1253
- tag: desc.tag,
1254
- props,
1255
- identity: replaceableIdentity(desc.tag, props, key, "u:c" + uid + ":" + i)
1256
- });
1257
- }
1258
- }
1259
- return {
1260
- replaceable,
1261
- resources
1262
- };
1263
- }, evaluated => {
1264
- for (let i = 0; i < evaluated.resources.length; i++) {
1265
- mountHeadResource(evaluated.resources[i].tag, evaluated.resources[i].props);
1266
- }
1267
- reg.tags = evaluated.replaceable;
1268
- if (reg.seq < 0) reg.seq = ++headSeq;
1269
- if (headRegistrations.indexOf(reg) === -1) headRegistrations.push(reg);
1270
- scheduleHeadApply();
1271
- return () => {
1272
- const idx = headRegistrations.indexOf(reg);
1273
- if (idx > -1) headRegistrations.splice(idx, 1);
1274
- scheduleHeadApply();
1275
- };
1276
- });
1277
- }
1278
- function loadModuleAssets(mapping) {
1279
- const hy = globalThis._$HY;
1280
- if (!hy) return;
1281
- const pending = [];
1282
- for (const key in mapping) {
1283
- if (hy.modules[key]) continue;
1284
- const entryUrl = new URL(mapping[key], document.baseURI).href;
1285
- if (!hy.loading[key]) {
1286
- hy.loading[key] = import(entryUrl).then(mod => {
1287
- hy.modules[key] = mod;
1288
- }, err => {
1289
- delete hy.loading[key];
1290
- throw err;
1291
- });
1292
- }
1293
- pending.push(hy.loading[key]);
1294
- }
1295
- return pending.length ? Promise.all(pending).then(() => {}) : undefined;
1296
- }
1297
- function hydrate(code, element, options = {}) {
1298
- solidJs.enableHydration();
1299
- installHydrationRuntime();
1300
- if (globalThis._$HY.done) return render(code, element, [...element.childNodes], options);
1301
- const head = (element.nodeType === 9 ? element : element.ownerDocument).head;
1302
- if (head && element.contains(head)) {
1303
- let n = head.firstChild;
1304
- while (n && n.nodeType === 1 && n.hasAttribute("data-dh") && !n.hasAttribute("data-dhf")) {
1305
- const next = n.nextSibling;
1306
- head.appendChild(n);
1307
- n = next;
1308
- }
1309
- }
1310
- options.renderId ||= "";
1311
- if (!globalThis._$HY.modules) globalThis._$HY.modules = {};
1312
- if (!globalThis._$HY.loading) globalThis._$HY.loading = {};
1313
- solidJs.sharedConfig.completed = globalThis._$HY.completed;
1314
- solidJs.sharedConfig.events = globalThis._$HY.events;
1315
- solidJs.sharedConfig.load = id => globalThis._$HY.r[id];
1316
- solidJs.sharedConfig.has = id => id in globalThis._$HY.r;
1317
- solidJs.sharedConfig.gather = root => gatherHydratable(element, root);
1318
- solidJs.sharedConfig.loadModuleAssets = loadModuleAssets;
1319
- solidJs.sharedConfig.cleanupFragment = id => {
1320
- const tpl = document.getElementById("pl-" + id);
1321
- if (tpl) {
1322
- let node = tpl.nextSibling;
1323
- while (node) {
1324
- const next = node.nextSibling;
1325
- if (node.nodeType === 8 && node.nodeValue === "pl-" + id) {
1326
- node.remove();
1327
- break;
1328
- }
1329
- node.remove();
1330
- node = next;
1331
- }
1332
- tpl.remove();
1333
- }
1334
- };
1335
- solidJs.sharedConfig.registry = new Map();
1336
- if (!solidJs.sharedConfig.boundaryScopes) solidJs.sharedConfig.boundaryScopes = new Map();
1337
- solidJs.sharedConfig.captureBoundaryScope = id => {
1338
- if (solidJs.sharedConfig.registry) solidJs.sharedConfig.boundaryScopes.set(id, {
1339
- registry: solidJs.sharedConfig.registry,
1340
- gather: solidJs.sharedConfig.gather
1341
- });
1342
- };
1343
- solidJs.sharedConfig.hydrating = true;
1344
- {
1345
- solidJs.sharedConfig.verifyHydration = () => {
1346
- if (solidJs.sharedConfig.registry && solidJs.sharedConfig.registry.size) {
1347
- const orphaned = [...solidJs.sharedConfig.registry.values()].filter(node => node.isConnected);
1348
- solidJs.sharedConfig.registry.clear();
1349
- if (!orphaned.length) return;
1350
- console.warn(`Hydration completed with ${orphaned.length} unclaimed server-rendered node(s):\n` + orphaned.map(node => ` ${node.outerHTML.slice(0, 100)}`).join("\n"));
1351
- }
1352
- };
1353
- }
1354
- const hyr = globalThis._$HY.r;
1355
- const rootMapping = hyr && (hyr[options.renderId + "_assets"] || hyr["_assets"]);
1356
- if (rootMapping && typeof rootMapping === "object") {
1357
- const p = loadModuleAssets(rootMapping);
1358
- if (p) {
1359
- gatherHydratable(element, options.renderId);
1360
- const registry = solidJs.sharedConfig.registry;
1361
- const gather = solidJs.sharedConfig.gather;
1362
- let disposer;
1363
- p.then(() => {
1364
- solidJs.sharedConfig.registry = registry;
1365
- solidJs.sharedConfig.gather = gather;
1366
- solidJs.sharedConfig.hydrating = true;
1367
- try {
1368
- disposer = render(code, element, [...element.childNodes], options);
1369
- } finally {
1370
- solidJs.sharedConfig.hydrating = false;
1371
- }
1372
- }, err => {
1373
- console.error("Hydration module preload failed, falling back to client render:", err);
1374
- solidJs.sharedConfig.hydrating = false;
1375
- solidJs.sharedConfig.registry = undefined;
1376
- disposer = render(code, element, [...element.childNodes], options);
1377
- });
1378
- return () => disposer && disposer();
1379
- }
1380
- }
1381
- try {
1382
- gatherHydratable(element, options.renderId);
1383
- return render(code, element, [...element.childNodes], options);
1384
- } finally {
1385
- solidJs.sharedConfig.hydrating = false;
1386
- }
1387
- }
1388
- function getNextElement(template) {
1389
- let node,
1390
- key,
1391
- hydrating = isHydrating();
1392
- if (!hydrating || !(node = solidJs.sharedConfig.registry.get(key = getHydrationKey()))) {
1393
- if (!template) {
1394
- throw new Error(`Hydration Mismatch. Unable to find DOM nodes for hydration key: ${key}`);
1395
- }
1396
- if (hydrating) {
1397
- console.warn(`Hydration key miss for "${key}": no server-rendered element carries this key` + (template._html ? ` (template: ${template._html.slice(0, 60)})` : "") + `. A detached element was created instead; its subtree will not appear in the ` + `document or become interactive. This usually means the server and client ` + `hydration id namespaces are misaligned — when hydrating a subtree of a larger ` + `server render, wrap the document shell in <NoHydration> and re-enter with ` + `<Hydration> around the hydrated subtree (or pass hydrate() a renderId matching ` + `the server's <Hydration id>).`);
1398
- }
1399
- return template(true);
1400
- }
1401
- if (template && template._html) {
1402
- const expected = template._html.match(/^<(\w+)/)?.[1];
1403
- if (expected && node.localName !== expected) {
1404
- console.warn(`Hydration tag mismatch for key "${key}": expected <${expected}> but found`, node);
1405
- }
1406
- }
1407
- if (solidJs.sharedConfig.completed) solidJs.sharedConfig.completed.add(node);
1408
- solidJs.sharedConfig.registry.delete(key);
1409
- return node;
1410
- }
1411
- function getNextMatch(el, nodeName) {
1412
- while (el && el.localName !== nodeName) el = el.nextSibling;
1413
- return el;
1414
- }
1415
- function getNextMarker(start) {
1416
- let end = start,
1417
- count = 0,
1418
- current = [];
1419
- if (isHydrating(start)) {
1420
- while (end) {
1421
- if (end.nodeType === 8) {
1422
- const v = end.nodeValue;
1423
- if (v === "$") count++;else if (v === "/") {
1424
- if (count === 0) return [end, current];
1425
- count--;
1426
- }
1427
- }
1428
- current.push(end);
1429
- end = end.nextSibling;
1430
- }
1431
- }
1432
- return [end, current];
1433
- }
1434
- function getFirstChild(node, expectedTag) {
1435
- const child = node.firstChild;
1436
- if (isHydrating() && expectedTag && child?.localName !== expectedTag) {
1437
- const isMissing = !child || child.nodeType !== 1;
1438
- console.warn("Hydration structure mismatch: expected <" + expectedTag + "> as first child of", node, "\n " + describeSiblings(node, child, expectedTag, isMissing));
1439
- }
1440
- return child;
1441
- }
1442
- function getNextSibling(node, expectedTag) {
1443
- const sibling = node.nextSibling;
1444
- if (isHydrating() && expectedTag && sibling?.localName !== expectedTag) {
1445
- const parent = node.parentNode;
1446
- const isMissing = !sibling || sibling.nodeType !== 1;
1447
- console.warn("Hydration structure mismatch: expected <" + expectedTag + "> after", node, "in", parent, "\n " + describeSiblings(parent, sibling, expectedTag, isMissing));
1448
- }
1449
- return sibling;
1450
- }
1451
- function describeSiblings(parent, mismatchChild, expectedTag, isMissing) {
1452
- if (!parent) return `<${expectedTag} \u2190 parent unavailable>`;
1453
- const children = [];
1454
- let child = parent.firstChild;
1455
- while (child) {
1456
- if (child.nodeType === 1) children.push(child);
1457
- child = child.nextSibling;
1458
- }
1459
- const pTag = parent.localName || "#fragment";
1460
- if (isMissing) {
1461
- const tags = children.map(c => `<${c.localName}>`).join("");
1462
- return `<${pTag}>${tags}<${expectedTag} \u2190 missing></${pTag}>`;
1463
- }
1464
- const idx = children.indexOf(mismatchChild);
1465
- let start = 0,
1466
- end = children.length;
1467
- let prefix = "",
1468
- suffix = "";
1469
- if (children.length > 6) {
1470
- start = Math.max(0, idx - 2);
1471
- end = Math.min(children.length, idx + 3);
1472
- if (start > 0) prefix = "...";
1473
- if (end < children.length) suffix = "...";
1474
- }
1475
- const tags = children.slice(start, end).map(c => c === mismatchChild ? `<${c.localName} \u2190 expected ${expectedTag}>` : `<${c.localName}>`).join("");
1476
- return `<${pTag}>${prefix}${tags}${suffix}</${pTag}>`;
1477
- }
1478
- function runHydrationEvents() {
1479
- if (solidJs.sharedConfig.events && !solidJs.sharedConfig.events.queued) {
1480
- queueMicrotask(() => {
1481
- const {
1482
- completed,
1483
- events
1484
- } = solidJs.sharedConfig;
1485
- if (!events) return;
1486
- events.queued = false;
1487
- while (events.length) {
1488
- const [el, e] = events[0];
1489
- if (!completed.has(el)) return;
1490
- events.shift();
1491
- let matchContainer, matchState, matchDistance, matches;
1492
- for (const [container, state] of delegatedContainers) {
1493
- if (!state.handlers.has(e.type)) continue;
1494
- const entry = findOwner(e.target, state);
1495
- if (!entry) continue;
1496
- if (matchContainer) {
1497
- if (!matches) matches = [{
1498
- container: matchContainer,
1499
- state: matchState,
1500
- distance: matchDistance
1501
- }];
1502
- matches.push({
1503
- container,
1504
- state,
1505
- distance: entry.distance
1506
- });
1507
- } else {
1508
- matchContainer = container;
1509
- matchState = state;
1510
- matchDistance = entry.distance;
1511
- }
1512
- }
1513
- if (matches) {
1514
- matches.sort((a, b) => a.distance - b.distance);
1515
- for (let i = 0; i < matches.length; i++) eventHandler(e, matches[i].container, matches[i].state);
1516
- } else if (matchContainer) eventHandler(e, matchContainer, matchState);
1517
- }
1518
- if (solidJs.sharedConfig.done) {
1519
- solidJs.sharedConfig.events = _$HY.events = null;
1520
- solidJs.sharedConfig.completed = _$HY.completed = null;
1521
- }
1522
- });
1523
- solidJs.sharedConfig.events.queued = true;
1524
- }
1525
- }
1526
- function isHydrating(node) {
1527
- if (!solidJs.sharedConfig.hydrating) return false;
1528
- if (!node || node.isConnected) return true;
1529
- const roots = solidJs.sharedConfig.claimRoots;
1530
- if (roots) {
1531
- for (let i = 0; i < roots.length; i++) {
1532
- if (roots[i].contains(node)) return true;
1533
- }
1534
- }
1535
- return false;
1536
- }
1537
- function classListToObject(classList) {
1538
- if (Array.isArray(classList)) {
1539
- const result = {};
1540
- flattenClassList(classList, result);
1541
- classList = result;
1542
- }
1543
- if (classList && typeof classList === "object") {
1544
- const result = {},
1545
- keys = Object.keys(classList);
1546
- for (let i = 0, len = keys.length; i < len; i++) {
1547
- const key = keys[i];
1548
- if (!classList[key]) continue;
1549
- const classNames = key.trim().split(/\s+/);
1550
- for (let j = 0, nameLen = classNames.length; j < nameLen; j++) classNames[j] && (result[classNames[j]] = true);
1551
- }
1552
- return result;
1553
- }
1554
- return classList;
1555
- }
1556
- function flattenClassList(list, result) {
1557
- for (let i = 0, len = list.length; i < len; i++) {
1558
- const item = list[i];
1559
- if (Array.isArray(item)) flattenClassList(item, result);else if (typeof item === "object" && item != null) Object.assign(result, item);
1560
- else if (typeof item !== "boolean" && (item || item === 0)) result[item] = true;
1561
- }
1562
- }
1563
- function assignProp(node, prop, value, prev, skipRef, nodeName) {
1564
- if (prop === "style") return style(node, value, prev), value;
1565
- if (prop === "class") return className(node, value, prev), value;
1566
- if (value === prev && DOMWithState[nodeName]?.[prop] !== 1) return prev;
1567
- if (prop === "ref") {
1568
- if (!skipRef && value) ref(() => value, node);
1569
- return value;
1570
- }
1571
- const hasNamespace = prop.indexOf(":") > -1;
1572
- if (!hasNamespace && prop.slice(0, 2) === "on") {
1573
- const name = prop.slice(2).toLowerCase();
1574
- const delegate = DelegatedEvents.has(name);
1575
- if (!delegate && prev) {
1576
- if (Array.isArray(value) && typeof prev === "function" && prev[$$EVENT_TUPLE] === value) return prev;
1577
- node.removeEventListener(name, prev, typeof prev !== "function" && prev);
1578
- }
1579
- if (delegate || value) {
1580
- const attached = addEvent(node, name, value, delegate);
1581
- delegate && delegateEvents([name]);
1582
- if (!delegate) return attached;
1583
- }
1584
- } else if (hasNamespace && prop.slice(0, 5) === "prop:" || ChildProperties.has(prop) || DOMWithState[nodeName]?.[prop]) {
1585
- if (hasNamespace) prop = prop.slice(5);else if (isHydrating(node)) return value;
1586
- if (prop === "value" && nodeName === "SELECT") queueMicrotask(() => node.value = value) || (node.value = value);else if ((prop === "value" || prop === "defaultValue") && (nodeName === "INPUT" || nodeName === "TEXTAREA"))
1587
- node[prop] = value ?? "";else node[prop] = value;
1588
- } else {
1589
- const ns = hasNamespace && Namespaces[prop.split(":")[0]];
1590
- if (ns) setAttributeNS(node, ns, prop, value);else setAttribute(node, prop, value);
1591
- }
1592
- return value;
1593
- }
1594
- function eventHandler(e, container, state) {
1595
- if (hydrationRt !== null && hydrationRt.dedupEvent(e)) return;
1596
- const prev = e[$$EVENT_OWNER];
1597
- let resumeNode;
1598
- if (prev) {
1599
- if (prev === true || prev === container || !container.contains(prev)) return;
1600
- resumeNode = prev;
1601
- }
1602
- const owner = state && (state.owners.size === 1 && state.owners.has(container) ? container : findOwner(e.target, state)?.owner);
1603
- if (state && !owner) return;
1604
- if (owner && owner === resumeNode) return;
1605
- e[$$EVENT_OWNER] = owner || true;
1606
- let node = resumeNode || e.target;
1607
- const key = `$$${e.type}`;
1608
- const oriTarget = e.target;
1609
- const boundary = owner || container || e.currentTarget;
1610
- const retarget = value => Object.defineProperty(e, "target", {
1611
- configurable: true,
1612
- value
1613
- });
1614
- const handleNode = () => {
1615
- let handler = node[key];
1616
- if (handler === undefined && node.hasAttribute && node.hasAttribute("_bnd")) {
1617
- const seam = globalThis[Symbol.for("solid.bnd")];
1618
- if (seam) handler = seam.resolve(node, e.type);
1619
- }
1620
- if (handler && !node.disabled) {
1621
- const data = node[`${key}Data`];
1622
- data !== undefined ? handler.call(node, data, e) : typeof handler === "function" ? handler.call(node, e) : handler.handleEvent(e);
1623
- if (e.cancelBubble) return;
1624
- }
1625
- node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && retarget(node.host);
1626
- return true;
1627
- };
1628
- const walkUpTree = () => {
1629
- while (node && handleNode()) {
1630
- if (node === boundary || node.parentNode === boundary) break;
1631
- node = node._$host || node.parentNode || node.host;
1632
- }
1633
- };
1634
- Object.defineProperty(e, "currentTarget", {
1635
- configurable: true,
1636
- get() {
1637
- return node || boundary || document;
1638
- }
1639
- });
1640
- if (resumeNode) {
1641
- if (resumeNode === e.target) node = resumeNode._$host || resumeNode.parentNode || resumeNode.host;
1642
- if (node && node !== boundary) walkUpTree();
1643
- } else if (e.composedPath) {
1644
- const path = e.composedPath();
1645
- if (path.length) {
1646
- retarget(path[0]);
1647
- for (let i = 0; i < path.length; i++) {
1648
- node = path[i];
1649
- if (!handleNode()) break;
1650
- if (node._$host) {
1651
- node = node._$host;
1652
- walkUpTree();
1653
- break;
1654
- }
1655
- if (node === boundary || node.parentNode === boundary) {
1656
- break;
1657
- }
1658
- }
1659
- } else walkUpTree();
1660
- }
1661
- else walkUpTree();
1662
- retarget(oriTarget);
1663
- }
1664
- function insertExpression(parent, value, current, marker) {
1665
- tagElement(parent);
1666
- if (hydrationRt !== null && isHydrating(parent)) {
1667
- if (value && value !== current) {
1668
- const arr = Array.isArray(value);
1669
- for (const n of arr ? value : [value]) {
1670
- if (n && n.nodeType) {
1671
- if (!isHydrating(n)) return current;
1672
- } else if (arr && (typeof n === "string" || typeof n === "number")) {
1673
- return current;
1674
- }
1675
- }
1676
- }
1677
- return value;
1678
- }
1679
- if (value === current) return value;
1680
- const t = typeof value,
1681
- multi = marker !== undefined;
1682
- if (t === "string" || t === "number") {
1683
- const tc = typeof current;
1684
- if (tc === "string" || tc === "number") {
1685
- parent.firstChild.data = value;
1686
- } else {
1687
- if (ownsAllChildren(parent, current)) parent.textContent = value;else {
1688
- removeOwnedChildren(parent, current);
1689
- parent.insertBefore(document.createTextNode(value), parent.firstChild);
1690
- }
1691
- }
1692
- } else if (value === undefined) {
1693
- cleanChildren(parent, current, marker);
1694
- } else if (value.nodeType) {
1695
- if (Array.isArray(current)) {
1696
- cleanChildren(parent, current, multi ? marker : null, value);
1697
- } else if (current && current.nodeType) {
1698
- current.parentNode === parent ? parent.replaceChild(value, current) : parent.appendChild(value);
1699
- } else if (current && parent.firstChild) {
1700
- parent.replaceChild(value, parent.firstChild);
1701
- } else {
1702
- parent.appendChild(value);
1703
- }
1704
- if (marker) value[$$SLOT] = marker;
1705
- } else if (Array.isArray(value)) {
1706
- const currentArray = current && Array.isArray(current);
1707
- for (let i = 0, len = value.length; i < len; i++) {
1708
- const item = value[i],
1709
- t = typeof item;
1710
- if (t === "string" || t === "number") {
1711
- const prev = currentArray ? current[i] : undefined;
1712
- if (prev && prev.nodeType === 3) {
1713
- if (prev.data !== "" + item) prev.data = item;
1714
- value[i] = prev;
1715
- } else value[i] = document.createTextNode(item);
1716
- }
1717
- }
1718
- if (value.length === 0) {
1719
- cleanChildren(parent, current, marker);
1720
- } else if (currentArray) {
1721
- if (current.length === 0) {
1722
- appendNodes(parent, value, marker);
1723
- } else reconcileArrays(parent, current, value, marker);
1724
- } else {
1725
- current && cleanChildren(parent, current);
1726
- appendNodes(parent, value);
1727
- }
1728
- } else console.warn(`Unrecognized value. Skipped inserting`, value);
1729
- return value;
1730
- }
1731
- function normalize(value, current, multi, doNotUnwrap) {
1732
- value = solidJs.flatten(value, {
1733
- skipNonRendered: true,
1734
- doNotUnwrap
1735
- });
1736
- if (doNotUnwrap && typeof value === "function") return value;
1737
- if (multi && !Array.isArray(value)) value = [value != null ? value : ""];
1738
- if (solidJs.sharedConfig.hydrating && Array.isArray(value)) {
1739
- for (let i = 0, len = value.length; i < len; i++) {
1740
- const item = value[i],
1741
- prev = current && current[i],
1742
- t = typeof item;
1743
- if ((t === "string" || t === "number") && prev && prev.nodeType === 3 && isHydrating(prev)) value[i] = prev;
1744
- }
1745
- }
1746
- return value;
1747
- }
1748
- function tagHost(value, host) {
1749
- if (Array.isArray(value)) {
1750
- for (let i = 0, len = value.length; i < len; i++) tagHost(value[i], host);
1751
- } else if (value && value.nodeType && value[$$HOST] !== host) {
1752
- value[$$HOST] = host;
1753
- Object.defineProperty(value, "_$host", {
1754
- get: host,
1755
- configurable: true
1756
- });
1757
- }
1758
- }
1759
- function appendNodes(parent, array, marker = null) {
1760
- for (let i = 0, len = array.length; i < len; i++) {
1761
- const n = array[i];
1762
- parent.insertBefore(n, marker);
1763
- if (marker) n[$$SLOT] = marker;
1764
- }
1765
- }
1766
- function ownsAllChildren(parent, current) {
1767
- if (current == null) return true;
1768
- if (Array.isArray(current)) {
1769
- return current.length ? parent.firstChild === current[0] && parent.lastChild === current[current.length - 1] : parent.firstChild === null;
1770
- }
1771
- if (current === "") return parent.firstChild === null;
1772
- if (current.nodeType) return parent.firstChild === current && parent.lastChild === current;
1773
- const first = parent.firstChild;
1774
- return first !== null && first.nodeType === 3 && parent.lastChild === first;
1775
- }
1776
- function removeOwnedChildren(parent, current) {
1777
- if (Array.isArray(current)) {
1778
- for (let i = 0; i < current.length; i++) {
1779
- const el = current[i];
1780
- if (el.parentNode === parent) el.remove();
1781
- }
1782
- } else if (current.nodeType) {
1783
- if (current.parentNode === parent) current.remove();
1784
- } else {
1785
- const first = parent.firstChild;
1786
- if (first && first.nodeType === 3) first.remove();
1787
- }
1788
- }
1789
- function cleanChildren(parent, current, marker, replacement) {
1790
- if (marker === undefined) {
1791
- if (ownsAllChildren(parent, current)) return parent.textContent = "";
1792
- return removeOwnedChildren(parent, current);
1793
- }
1794
- if (current.length) {
1795
- let inserted = false;
1796
- for (let i = current.length - 1; i >= 0; i--) {
1797
- const el = current[i];
1798
- if (replacement !== el) {
1799
- const tag = el[$$SLOT];
1800
- const owns = el.parentNode === parent && (!tag || tag === marker);
1801
- if (replacement && !inserted && !i) owns ? parent.replaceChild(replacement, el) : parent.insertBefore(replacement, marker);else if (owns) el.remove();
1802
- } else inserted = true;
1803
- }
1804
- } else if (replacement) parent.insertBefore(replacement, marker);
1805
- if (replacement && marker) replacement[$$SLOT] = marker;
1806
- }
1807
- function gatherHydratable(element, root) {
1808
- const templates = element.querySelectorAll(`*[_hk]`);
1809
- for (let i = 0; i < templates.length; i++) {
1810
- const node = templates[i];
1811
- const key = node.getAttribute("_hk");
1812
- if (root) {
1813
- if (!key.startsWith(root)) continue;
1814
- } else {
1815
- const frame = node.closest("[data-fid]");
1816
- if (frame && frame !== element && element.contains(frame)) continue;
1817
- }
1818
- if (!solidJs.sharedConfig.registry.has(key)) solidJs.sharedConfig.registry.set(key, node);
1819
- }
1820
- }
1821
- function getHydrationKey() {
1822
- return solidJs.sharedConfig.getNextContextId();
1823
- }
1824
- const RequestContext = Symbol();
1825
-
1826
- function throwInBrowser(func) {
1827
- const err = new Error(`${func.name} is not supported in the browser, returning undefined`);
1828
- console.error(err);
1829
- }
1830
- function renderToString(fn, options) {
1831
- throwInBrowser(renderToString);
1832
- }
1833
- function renderToStream(fn, options) {
1834
- throwInBrowser(renderToStream);
1835
- }
1836
- function createResponseStub() {
1837
- throwInBrowser(createResponseStub);
1838
- }
1839
- function createRequestEvent(request, init) {
1840
- throwInBrowser(createRequestEvent);
1841
- }
1842
- function getExpectedRedirectStatus(response) {
1843
- throwInBrowser(getExpectedRedirectStatus);
1844
- }
1845
- function createSSRResponse() {
1846
- throwInBrowser(createSSRResponse);
1847
- }
1848
- function commitEventResponse(response, event) {
1849
- throwInBrowser(commitEventResponse);
1850
- }
1851
- function composeMiddleware(middlewares) {
1852
- throwInBrowser(composeMiddleware);
1853
- }
1854
- function ssr(template, ...nodes) {}
1855
- function ssrElement(name, props, children, needsId) {}
1856
- function ssrClassName(value) {}
1857
- function ssrStyle(value) {}
1858
- function ssrStyleProperty(name, value) {}
1859
- function ssrAttribute(key, value) {}
1860
- function ssrGroup(fn, n) {}
1861
- function ssrHydrationKey() {}
1862
- function resolveSSRNode(node, result, top) {}
1863
- function escape(s, attr) {}
1864
-
1865
- const ENVELOPE = Symbol.for("solid.ResponseEnvelope");
1866
- // PURE-annotated factory (same convention as solid's MockPromise): the brand
1867
- const ResponseEnvelope = /* @__PURE__ */(() => {
1868
- class ResponseEnvelope {
1869
- constructor(response, value) {
1870
- this.response = response;
1871
- this.value = value;
1872
- }
1873
- }
1874
- ResponseEnvelope.prototype[ENVELOPE] = true;
1875
- return ResponseEnvelope;
1876
- })();
1877
- function isResponseEnvelope(value) {
1878
- return !!(value && typeof value === "object" && value[ENVELOPE]);
1879
- }
1880
- const HREF = Symbol.for("solid.Href");
1881
- function isHref(value) {
1882
- return !!(value && (typeof value === "object" || typeof value === "function") && value[HREF]);
1883
- }
1884
- const SAFE_ERROR = Symbol.for("solid.SafeError");
1885
- function markSafeError(error) {
1886
- if (error && (typeof error === "object" || typeof error === "function")) {
1887
- Object.defineProperty(error, SAFE_ERROR, {
1888
- value: true,
1889
- enumerable: false,
1890
- configurable: true
1891
- });
1892
- }
1893
- return error;
1894
- }
1895
- function isSafeError(value) {
1896
- return !!(value && (typeof value === "object" || typeof value === "function") && value[SAFE_ERROR]);
1897
- }
1898
- const REVALIDATE_HEADER = "X-Revalidate";
1899
- const RESPONSE_HEADER_VALUE_LIMIT = 4096;
1900
- function initWithRevalidate(init = {}) {
1901
- const resolved = typeof init === "number" ? {
1902
- status: init
1903
- } : init;
1904
- const {
1905
- revalidate,
1906
- ...responseInit
1907
- } = resolved;
1908
- let headers;
1909
- if (responseInit.headers && responseInit.headers.getSetCookie) {
1910
- headers = new Headers();
1911
- responseInit.headers.forEach((value, key) => {
1912
- if (key !== "set-cookie") headers.append(key, value);
1913
- });
1914
- for (const cookie of responseInit.headers.getSetCookie()) {
1915
- headers.append("Set-Cookie", cookie);
1916
- }
1917
- } else {
1918
- headers = new Headers(responseInit.headers);
1919
- }
1920
- if (revalidate !== undefined) {
1921
- const keys = revalidate.toString();
1922
- if (keys.length > RESPONSE_HEADER_VALUE_LIMIT) {
1923
- throw new TypeError(`revalidate names ${keys.length} characters of cache keys; past ` + `${RESPONSE_HEADER_VALUE_LIMIT} the ${REVALIDATE_HEADER} header would overflow ` + `receivers (an 8 KiB proxy buffer holds the whole header block) and the response ` + `dies at the socket after the mutation committed. Split the invalidation across ` + `calls or use coarser keys — a dropped key would be a silently stale cache, so ` + `the runtime refuses rather than trims.`);
1924
- }
1925
- headers.set(REVALIDATE_HEADER, keys);
1926
- }
1927
- return {
1928
- responseInit,
1929
- headers
1930
- };
1931
- }
1932
- function redirect(url, init = 302) {
1933
- if (typeof url !== "string" && !isHref(url)) {
1934
- throw new TypeError("redirect() expects a string URL or an Href-branded value (Symbol.for('solid.Href')).");
1935
- }
1936
- const {
1937
- responseInit,
1938
- headers
1939
- } = initWithRevalidate(init);
1940
- if (responseInit.status === undefined) {
1941
- responseInit.status = 302;
1942
- }
1943
- const target = typeof url === "string" ? url : url[HREF];
1944
- const location = typeof target === "string" ? target : String(url);
1945
- const encoded = location.replace(/[^\x00-\x7f]/gu, encodeURIComponent);
1946
- if (encoded.length > RESPONSE_HEADER_VALUE_LIMIT) {
1947
- throw new TypeError(`redirect() target is ${encoded.length} characters; past ` + `${RESPONSE_HEADER_VALUE_LIMIT} the Location header (and the scripted transport's ` + `redirect header) would overflow receivers and the response dies at the socket. ` + `A target this size is usually unbounded input echoed into the url — carry the ` + `state server-side instead. Refused rather than trimmed: a cut target is a ` + `different address.`);
1948
- }
1949
- headers.set("Location", encoded);
1950
- return new Response(null, {
1951
- ...responseInit,
1952
- headers
1953
- });
1954
- }
1955
- function reload(init = {}) {
1956
- const {
1957
- responseInit,
1958
- headers
1959
- } = initWithRevalidate(init);
1960
- return new Response(null, {
1961
- ...responseInit,
1962
- headers
1963
- });
1964
- }
1965
- const NULL_BODY_STATUSES = new Set([204, 205, 304]);
1966
- function respond(value, init = {}) {
1967
- const {
1968
- responseInit,
1969
- headers
1970
- } = initWithRevalidate(init);
1971
- for (const header of COMPOSED_BODY_FRAMING) headers.delete(header);
1972
- if (NULL_BODY_STATUSES.has(responseInit.status)) {
1973
- return new ResponseEnvelope(new Response(null, {
1974
- ...responseInit,
1975
- headers
1976
- }), value);
1977
- }
1978
- headers.set("Content-Type", "application/json");
1979
- return new ResponseEnvelope(new Response(JSON.stringify(value), {
1980
- ...responseInit,
1981
- headers
1982
- }), value);
1983
- }
1984
-
1985
- const isServer = false;
1986
- const isDev = true;
1987
- function Portal(props) {
1988
- return solidJs.runWithOwner(solidJs.createOwner(), () => portalImpl(props));
1989
- }
1990
- function portalImpl(props) {
1991
- const treeMarker = document.createTextNode(""),
1992
- startMarker = document.createTextNode(""),
1993
- endMarker = document.createTextNode(""),
1994
- mount = () => props.mount || document.body,
1995
- content = solidJs.createMemo(() => [startMarker, props.children], {
1996
- ssrSource: "client",
1997
- loadingValue: undefined
1998
- });
1999
- solidJs.createRenderEffect(
2000
- () => [mount(), content(), solidJs.getOwner()], ([, c, owner]) => {
2001
- const m = solidJs.untrack(mount);
2002
- m.appendChild(endMarker);
2003
- const dispose = solidJs.runWithOwner(owner, () => solidJs.createRoot(d => {
2004
- insert(m, c, endMarker, undefined, {
2005
- host: () => treeMarker.parentNode
2006
- });
2007
- return d;
2008
- }));
2009
- return () => {
2010
- dispose();
2011
- let c = startMarker;
2012
- while (c) {
2013
- const n = c.nextSibling;
2014
- m.removeChild(c);
2015
- if (c === endMarker) break;
2016
- c = n;
2017
- }
2018
- };
2019
- },
2020
- {
2021
- schedule: true,
2022
- ssrSource: "client"
2023
- });
2024
- solidJs.createEffect(mount, () => {
2025
- const m = solidJs.untrack(mount);
2026
- const ownerRoot = getDelegatedRoot(treeMarker);
2027
- if (!ownerRoot || ownerRoot.contains(m)) return;
2028
- registerDelegatedContainer(m, ownerRoot);
2029
- return () => unregisterDelegatedContainer(m, ownerRoot);
2030
- }, {
2031
- ssrSource: "client"
2032
- });
2033
- if (solidJs.sharedConfig.hydrating) return solidJs.createMemo(() => treeMarker, {
2034
- ssrSource: "client",
2035
- loadingValue: undefined
2036
- });
2037
- return treeMarker;
2038
- }
2039
- const COMPONENT_BINDING = Symbol.for("solid.component-binding");
2040
- function bindingOf(value) {
2041
- return value !== null && (typeof value === "function" || typeof value === "object") && value[COMPONENT_BINDING] || undefined;
2042
- }
2043
- function dynamic(source, _options) {
2044
- let latest = 0;
2045
- const sites = new Set();
2046
- let deliveredAddress;
2047
- const resolveBinding = (next, prev) => {
2048
- const binding = bindingOf(next);
2049
- if (!binding) return next;
2050
- deliveredAddress = binding.address;
2051
- const prevBinding = bindingOf(prev);
2052
- if (prevBinding && prevBinding.component === binding.component) {
2053
- for (const deliver of sites) deliver(binding.address);
2054
- return prev;
2055
- }
2056
- return next;
2057
- };
2058
- const cached = solidJs.createMemo(prev => {
2059
- const next = source();
2060
- if (!next || typeof next.then !== "function") return resolveBinding(next, prev);
2061
- const token = ++latest;
2062
- return {
2063
- then: (onFulfilled, onRejected) => next.then(resolved => onFulfilled(token === latest ? resolveBinding(resolved, prev) : resolved), onRejected)
2064
- };
2065
- }, {
2066
- lazy: true
2067
- });
2068
- return props => {
2069
- return solidJs.createMemo(() => {
2070
- const component = cached();
2071
- switch (typeof component) {
2072
- case "function":
2073
- {
2074
- Object.assign(component, {
2075
- [solidJs.$DEVCOMP]: true
2076
- });
2077
- const binding = bindingOf(component);
2078
- if (binding) {
2079
- const [address, setAddress] = solidJs.createSignal(deliveredAddress ?? binding.address);
2080
- sites.add(setAddress);
2081
- solidJs.onCleanup(() => sites.delete(setAddress));
2082
- return solidJs.untrack(() => binding.component(props, address));
2083
- }
2084
- return solidJs.untrack(() => component(props));
2085
- }
2086
- case "string":
2087
- const el = solidJs.sharedConfig.hydrating ? getNextElement() : createElement(component, solidJs.untrack(() => props.is));
2088
- spread(el, props);
2089
- return el;
2090
- }
2091
- });
2092
- };
2093
- }
2094
- function Dynamic(props) {
2095
- const Comp = dynamic(() => props.component);
2096
- return solidJs.createComponent(Comp, solidJs.omit(props, "component"));
2097
- }
2098
- function createElement(tagName, is = undefined) {
2099
- return SVGElements.has(tagName) ? document.createElementNS(Namespaces.svg, tagName) : MathMLElements.has(tagName) ? document.createElementNS(Namespaces.mathml, tagName) : document.createElement(tagName, {
2100
- is
2101
- });
2102
- }
2103
- function loadClientOnly(fn, setComp, exportName) {
2104
- fn().then(m => setComp(() => exportName ? m[exportName] : m.default));
2105
- }
2106
- function clientOnly(fn, options = {},
2107
- _moduleUrl) {
2108
- const [comp, setComp] = solidJs.createSignal();
2109
- let started = !options.lazy;
2110
- started && loadClientOnly(fn, setComp, options.export);
2111
- return props => {
2112
- let Comp;
2113
- let m;
2114
- const rest = solidJs.omit(props, "fallback");
2115
- if (!started) {
2116
- started = true;
2117
- loadClientOnly(fn, setComp, options.export);
2118
- }
2119
- if ((Comp = solidJs.untrack(comp)) && !solidJs.sharedConfig.hydrating) return Comp(rest);
2120
- const [mounted, setMounted] = solidJs.createSignal(!solidJs.sharedConfig.hydrating);
2121
- const gate = solidJs.createMemo(() => (Comp = comp(), m = mounted(), solidJs.untrack(() => Comp && m ? Comp(rest) : props.fallback)));
2122
- const onHydrationEnd = solidJs.sharedConfig.onHydrationEnd;
2123
- const release = () => setMounted(true);
2124
- onHydrationEnd ? onHydrationEnd(release) : queueMicrotask(release);
2125
- return gate;
2126
- };
2127
- }
2128
- function httpStatus(_code, _text) {}
2129
- function httpHeader(_name, _value, _options) {}
2130
-
2131
- Object.defineProperty(exports, "Errored", {
2132
- enumerable: true,
2133
- get: function () { return solidJs.Errored; }
2134
- });
2135
- Object.defineProperty(exports, "For", {
2136
- enumerable: true,
2137
- get: function () { return solidJs.For; }
2138
- });
2139
- Object.defineProperty(exports, "Hydration", {
2140
- enumerable: true,
2141
- get: function () { return solidJs.Hydration; }
2142
- });
2143
- Object.defineProperty(exports, "Loading", {
2144
- enumerable: true,
2145
- get: function () { return solidJs.Loading; }
2146
- });
2147
- Object.defineProperty(exports, "Match", {
2148
- enumerable: true,
2149
- get: function () { return solidJs.Match; }
2150
- });
2151
- Object.defineProperty(exports, "NoHydration", {
2152
- enumerable: true,
2153
- get: function () { return solidJs.NoHydration; }
2154
- });
2155
- Object.defineProperty(exports, "Repeat", {
2156
- enumerable: true,
2157
- get: function () { return solidJs.Repeat; }
2158
- });
2159
- Object.defineProperty(exports, "Reveal", {
2160
- enumerable: true,
2161
- get: function () { return solidJs.Reveal; }
2162
- });
2163
- Object.defineProperty(exports, "Show", {
2164
- enumerable: true,
2165
- get: function () { return solidJs.Show; }
2166
- });
2167
- Object.defineProperty(exports, "Switch", {
2168
- enumerable: true,
2169
- get: function () { return solidJs.Switch; }
2170
- });
2171
- Object.defineProperty(exports, "createComponent", {
2172
- enumerable: true,
2173
- get: function () { return solidJs.createComponent; }
2174
- });
2175
- Object.defineProperty(exports, "getOwner", {
2176
- enumerable: true,
2177
- get: function () { return solidJs.getOwner; }
2178
- });
2179
- Object.defineProperty(exports, "mergeProps", {
2180
- enumerable: true,
2181
- get: function () { return solidJs.merge; }
2182
- });
2183
- Object.defineProperty(exports, "untrack", {
2184
- enumerable: true,
2185
- get: function () { return solidJs.untrack; }
2186
- });
2187
- exports.ChildProperties = ChildProperties;
2188
- exports.DOMElements = DOMElements;
2189
- exports.DOMWithState = DOMWithState;
2190
- exports.DelegatedEvents = DelegatedEvents;
2191
- exports.Dynamic = Dynamic;
2192
- exports.HREF = HREF;
2193
- exports.HydrationScript = HydrationScript;
2194
- exports.MathMLElements = MathMLElements;
2195
- exports.NULL_BODY_STATUSES = NULL_BODY_STATUSES;
2196
- exports.Namespaces = Namespaces;
2197
- exports.Portal = Portal;
2198
- exports.RESPONSE_HEADER_VALUE_LIMIT = RESPONSE_HEADER_VALUE_LIMIT;
2199
- exports.REVALIDATE_HEADER = REVALIDATE_HEADER;
2200
- exports.RawTextElements = RawTextElements;
2201
- exports.RequestContext = RequestContext;
2202
- exports.ResponseEnvelope = ResponseEnvelope;
2203
- exports.SAFE_ERROR = SAFE_ERROR;
2204
- exports.SVGElements = SVGElements;
2205
- exports.VoidElements = VoidElements;
2206
- exports.acquireAsset = acquireAsset;
2207
- exports.addEvent = addEvent;
2208
- exports.applyRef = applyRef;
2209
- exports.assign = assign;
2210
- exports.claimElement = claimElement;
2211
- exports.claimElementTree = claimElementTree;
2212
- exports.className = className;
2213
- exports.clearFlashCookie = clearFlashCookie;
2214
- exports.clientOnly = clientOnly;
2215
- exports.commitEventResponse = commitEventResponse;
2216
- exports.composeMiddleware = composeMiddleware;
2217
- exports.createRequestEvent = createRequestEvent;
2218
- exports.createResponseStub = createResponseStub;
2219
- exports.createSSRResponse = createSSRResponse;
2220
- exports.delegateEvents = delegateEvents;
2221
- exports.dynamic = dynamic;
2222
- exports.dynamicProperty = dynamicProperty;
2223
- exports.effect = effect;
2224
- exports.escape = escape;
2225
- exports.generateHydrationScript = generateHydrationScript;
2226
- exports.getDelegatedRoot = getDelegatedRoot;
2227
- exports.getExpectedRedirectStatus = getExpectedRedirectStatus;
2228
- exports.getFirstChild = getFirstChild;
2229
- exports.getHydrationKey = getHydrationKey;
2230
- exports.getNextElement = getNextElement;
2231
- exports.getNextMarker = getNextMarker;
2232
- exports.getNextMatch = getNextMatch;
2233
- exports.getNextSibling = getNextSibling;
2234
- exports.getRequestEvent = getRequestEvent;
2235
- exports.getServerFunctionMetadata = getServerFunctionMetadata;
2236
- exports.getServerFunctionRPC = getServerFunctionRPC;
2237
- exports.hasFlashCookie = hasFlashCookie;
2238
- exports.httpHeader = httpHeader;
2239
- exports.httpStatus = httpStatus;
2240
- exports.hydrate = hydrate;
2241
- exports.insert = insert;
2242
- exports.installHydrationRuntime = installHydrationRuntime;
2243
- exports.isDev = isDev;
2244
- exports.isHref = isHref;
2245
- exports.isResponseEnvelope = isResponseEnvelope;
2246
- exports.isSafeError = isSafeError;
2247
- exports.isServer = isServer;
2248
- exports.isServerFunction = isServerFunction;
2249
- exports.markSafeError = markSafeError;
2250
- exports.memo = memo;
2251
- exports.parseCookieHeader = parseCookieHeader;
2252
- exports.redirect = redirect;
2253
- exports.ref = ref;
2254
- exports.registerDelegatedContainer = registerDelegatedContainer;
2255
- exports.registerDelegatedRoot = registerDelegatedRoot;
2256
- exports.registerElementClaim = registerElementClaim;
2257
- exports.reload = reload;
2258
- exports.render = render;
2259
- exports.renderToStream = renderToStream;
2260
- exports.renderToString = renderToString;
2261
- exports.resolveSSRNode = resolveSSRNode;
2262
- exports.respond = respond;
2263
- exports.runHydrationEvents = runHydrationEvents;
2264
- exports.scope = scope;
2265
- exports.serializeCookie = serializeCookie;
2266
- exports.setAttribute = setAttribute;
2267
- exports.setAttributeNS = setAttributeNS;
2268
- exports.setProperty = setProperty;
2269
- exports.setStyleProperty = setStyleProperty;
2270
- exports.spread = spread;
2271
- exports.ssr = ssr;
2272
- exports.ssrAttribute = ssrAttribute;
2273
- exports.ssrClassName = ssrClassName;
2274
- exports.ssrElement = ssrElement;
2275
- exports.ssrGroup = ssrGroup;
2276
- exports.ssrHydrationKey = ssrHydrationKey;
2277
- exports.ssrStyle = ssrStyle;
2278
- exports.ssrStyleProperty = ssrStyleProperty;
2279
- exports.style = style;
2280
- exports.template = template;
2281
- exports.unregisterDelegatedContainer = unregisterDelegatedContainer;
2282
- exports.unregisterDelegatedRoot = unregisterDelegatedRoot;
2283
- exports.useHead = useHead;
2284
- exports.waitAsset = waitAsset;
2285
- exports.warmAsset = warmAsset;