preact-render-to-string 6.5.6 → 6.5.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.
@@ -38,13 +38,13 @@
38
38
  } // Append skipped/buffered characters and the encoded entity:
39
39
 
40
40
 
41
- if (i !== last) out += str.slice(last, i);
42
- out += ch; // Start the next seek/buffer after the entity's offset:
41
+ if (i !== last) out = out + str.slice(last, i);
42
+ out = out + ch; // Start the next seek/buffer after the entity's offset:
43
43
 
44
44
  last = i + 1;
45
45
  }
46
46
 
47
- if (i !== last) out += str.slice(last, i);
47
+ if (i !== last) out = out + str.slice(last, i);
48
48
  return out;
49
49
  }
50
50
  const JS_TO_CSS = {};
@@ -72,6 +72,24 @@
72
72
 
73
73
  return str || undefined;
74
74
  }
75
+
76
+ function markAsDirty() {
77
+ this.__d = true;
78
+ }
79
+
80
+ function createComponent(vnode, context) {
81
+ return {
82
+ __v: vnode,
83
+ context,
84
+ props: vnode.props,
85
+ // silently drop state updates
86
+ setState: markAsDirty,
87
+ forceUpdate: markAsDirty,
88
+ __d: true,
89
+ // hooks
90
+ __h: new Array(0)
91
+ };
92
+ } // Necessary for createContext api. Setting this property will pass
75
93
  /**
76
94
  * @template T
77
95
  */
@@ -106,9 +124,11 @@
106
124
  const NEXT_STATE = '__s';
107
125
  const CHILD_DID_SUSPEND = '__c';
108
126
 
127
+ const EMPTY_OBJ = {};
109
128
  const EMPTY_ARR = [];
110
129
  const isArray = Array.isArray;
111
- const assign = Object.assign; // Global state for the current render pass
130
+ const assign = Object.assign;
131
+ const EMPTY_STR = ''; // Global state for the current render pass
112
132
 
113
133
  let beforeDiff, afterDiff, renderHook, ummountHook;
114
134
  /**
@@ -138,8 +158,8 @@
138
158
  try {
139
159
  const rendered = _renderToString(vnode, context || EMPTY_OBJ, false, undefined, parent, false, _rendererState);
140
160
 
141
- if (Array.isArray(rendered)) {
142
- return rendered.join('');
161
+ if (isArray(rendered)) {
162
+ return rendered.join(EMPTY_STR);
143
163
  }
144
164
 
145
165
  return rendered;
@@ -157,12 +177,6 @@
157
177
  EMPTY_ARR.length = 0;
158
178
  }
159
179
  }
160
-
161
- function markAsDirty() {
162
- this.__d = true;
163
- }
164
-
165
- const EMPTY_OBJ = {};
166
180
  /**
167
181
  * @param {VNode} vnode
168
182
  * @param {Record<string, unknown>} context
@@ -224,36 +238,40 @@
224
238
 
225
239
  function _renderToString(vnode, context, isSvgMode, selectValue, parent, asyncMode, renderer) {
226
240
  // Ignore non-rendered VNodes/values
227
- if (vnode == null || vnode === true || vnode === false || vnode === '') {
228
- return '';
229
- } // Text VNodes: escape as HTML
241
+ if (vnode == null || vnode === true || vnode === false || vnode === EMPTY_STR) {
242
+ return EMPTY_STR;
243
+ }
230
244
 
245
+ let vnodeType = typeof vnode; // Text VNodes: escape as HTML
231
246
 
232
- if (typeof vnode !== 'object') {
233
- if (typeof vnode === 'function') return '';
234
- return encodeEntities(vnode + '');
247
+ if (vnodeType != 'object') {
248
+ if (vnodeType == 'function') return EMPTY_STR;
249
+ return vnodeType == 'string' ? encodeEntities(vnode) : vnode + EMPTY_STR;
235
250
  } // Recurse into children / Arrays
236
251
 
237
252
 
238
253
  if (isArray(vnode)) {
239
- let rendered = '',
254
+ let rendered = EMPTY_STR,
240
255
  renderArray;
241
256
  parent[CHILDREN] = vnode;
242
257
 
243
258
  for (let i = 0; i < vnode.length; i++) {
244
259
  let child = vnode[i];
245
- if (child == null || typeof child === 'boolean') continue;
260
+ if (child == null || typeof child == 'boolean') continue;
246
261
 
247
262
  const childRender = _renderToString(child, context, isSvgMode, selectValue, parent, asyncMode, renderer);
248
263
 
249
- if (typeof childRender === 'string') {
250
- rendered += childRender;
264
+ if (typeof childRender == 'string') {
265
+ rendered = rendered + childRender;
251
266
  } else {
252
- renderArray = renderArray || [];
267
+ if (!renderArray) {
268
+ renderArray = [];
269
+ }
270
+
253
271
  if (rendered) renderArray.push(rendered);
254
- rendered = '';
272
+ rendered = EMPTY_STR;
255
273
 
256
- if (Array.isArray(childRender)) {
274
+ if (isArray(childRender)) {
257
275
  renderArray.push(...childRender);
258
276
  } else {
259
277
  renderArray.push(childRender);
@@ -270,43 +288,44 @@
270
288
  } // VNodes have {constructor:undefined} to prevent JSON injection:
271
289
 
272
290
 
273
- if (vnode.constructor !== undefined) return '';
291
+ if (vnode.constructor !== undefined) return EMPTY_STR;
274
292
  vnode[PARENT] = parent;
275
293
  if (beforeDiff) beforeDiff(vnode);
276
294
  let type = vnode.type,
277
- props = vnode.props,
278
- cctx = context,
279
- contextType,
280
- rendered,
281
- component; // Invoke rendering on Components
295
+ props = vnode.props; // Invoke rendering on Components
296
+
297
+ if (typeof type == 'function') {
298
+ let cctx = context,
299
+ contextType,
300
+ rendered,
301
+ component;
282
302
 
283
- if (typeof type === 'function') {
284
303
  if (type === preact.Fragment) {
285
304
  // Serialized precompiled JSX.
286
- if (props.tpl) {
287
- let out = '';
305
+ if ('tpl' in props) {
306
+ let out = EMPTY_STR;
288
307
 
289
308
  for (let i = 0; i < props.tpl.length; i++) {
290
- out += props.tpl[i];
309
+ out = out + props.tpl[i];
291
310
 
292
311
  if (props.exprs && i < props.exprs.length) {
293
312
  const value = props.exprs[i];
294
313
  if (value == null) continue; // Check if we're dealing with a vnode or an array of nodes
295
314
 
296
- if (typeof value === 'object' && (value.constructor === undefined || isArray(value))) {
297
- out += _renderToString(value, context, isSvgMode, selectValue, vnode, asyncMode, renderer);
315
+ if (typeof value == 'object' && (value.constructor === undefined || isArray(value))) {
316
+ out = out + _renderToString(value, context, isSvgMode, selectValue, vnode, asyncMode, renderer);
298
317
  } else {
299
318
  // Values are pre-escaped by the JSX transform
300
- out += value;
319
+ out = out + value;
301
320
  }
302
321
  }
303
322
  }
304
323
 
305
324
  return out;
306
- } else if (props.UNSTABLE_comment) {
325
+ } else if ('UNSTABLE_comment' in props) {
307
326
  // Fragments are the least used components of core that's why
308
327
  // branching here for comments has the least effect on perf.
309
- return '<!--' + encodeEntities(props.UNSTABLE_comment || '') + '-->';
328
+ return '<!--' + encodeEntities(props.UNSTABLE_comment) + '-->';
310
329
  }
311
330
 
312
331
  rendered = props.children;
@@ -318,24 +337,17 @@
318
337
  cctx = provider ? provider.props.value : contextType.__;
319
338
  }
320
339
 
321
- if (type.prototype && typeof type.prototype.render === 'function') {
340
+ let isClassComponent = type.prototype && typeof type.prototype.render == 'function';
341
+
342
+ if (isClassComponent) {
322
343
  rendered =
323
344
  /**#__NOINLINE__**/
324
345
  renderClassComponent(vnode, cctx);
325
346
  component = vnode[COMPONENT];
326
347
  } else {
327
- component = {
328
- __v: vnode,
329
- props,
330
- context: cctx,
331
- // silently drop state updates
332
- setState: markAsDirty,
333
- forceUpdate: markAsDirty,
334
- __d: true,
335
- // hooks
336
- __h: []
337
- };
338
- vnode[COMPONENT] = component; // If a hook invokes setState() to invalidate the component during rendering,
348
+ vnode[COMPONENT] = component =
349
+ /**#__NOINLINE__**/
350
+ createComponent(vnode, cctx); // If a hook invokes setState() to invalidate the component during rendering,
339
351
  // re-render it up to 25 times to allow "settling" of memoized states.
340
352
  // Note:
341
353
  // This will need to be updated for Preact 11 to use internal.flags rather than component._dirty:
@@ -356,23 +368,21 @@
356
368
  context = assign({}, context, component.getChildContext());
357
369
  }
358
370
 
359
- if ((type.getDerivedStateFromError || component.componentDidCatch) && preact.options.errorBoundaries) {
360
- let str = ''; // When a component returns a Fragment node we flatten it in core, so we
371
+ if (isClassComponent && preact.options.errorBoundaries && (type.getDerivedStateFromError || component.componentDidCatch)) {
372
+ // When a component returns a Fragment node we flatten it in core, so we
361
373
  // need to mirror that logic here too
362
-
363
- let isTopLevelFragment = rendered != null && rendered.type === preact.Fragment && rendered.key == null;
374
+ let isTopLevelFragment = rendered != null && rendered.type === preact.Fragment && rendered.key == null && rendered.props.tpl == null;
364
375
  rendered = isTopLevelFragment ? rendered.props.children : rendered;
365
376
 
366
377
  try {
367
- str = _renderToString(rendered, context, isSvgMode, selectValue, vnode, asyncMode, renderer);
368
- return str;
378
+ return _renderToString(rendered, context, isSvgMode, selectValue, vnode, asyncMode, renderer);
369
379
  } catch (err) {
370
380
  if (type.getDerivedStateFromError) {
371
381
  component[NEXT_STATE] = type.getDerivedStateFromError(err);
372
382
  }
373
383
 
374
384
  if (component.componentDidCatch) {
375
- component.componentDidCatch(err, {});
385
+ component.componentDidCatch(err, EMPTY_OBJ);
376
386
  }
377
387
 
378
388
  if (component[DIRTY]) {
@@ -383,12 +393,12 @@
383
393
  context = assign({}, context, component.getChildContext());
384
394
  }
385
395
 
386
- let isTopLevelFragment = rendered != null && rendered.type === preact.Fragment && rendered.key == null;
396
+ let isTopLevelFragment = rendered != null && rendered.type === preact.Fragment && rendered.key == null && rendered.props.tpl == null;
387
397
  rendered = isTopLevelFragment ? rendered.props.children : rendered;
388
- str = _renderToString(rendered, context, isSvgMode, selectValue, vnode, asyncMode, renderer);
398
+ return _renderToString(rendered, context, isSvgMode, selectValue, vnode, asyncMode, renderer);
389
399
  }
390
400
 
391
- return str;
401
+ return EMPTY_STR;
392
402
  } finally {
393
403
  if (afterDiff) afterDiff(vnode);
394
404
  vnode[PARENT] = null;
@@ -417,32 +427,33 @@
417
427
  if (res !== undefined) return res;
418
428
  let errorHook = preact.options[CATCH_ERROR];
419
429
  if (errorHook) errorHook(error, vnode);
420
- return '';
430
+ return EMPTY_STR;
421
431
  }
422
432
 
423
433
  if (!asyncMode) throw error;
424
- if (!error || typeof error.then !== 'function') throw error;
434
+ if (!error || typeof error.then != 'function') throw error;
425
435
 
426
436
  const renderNestedChildren = () => {
427
437
  try {
428
438
  return _renderToString(rendered, context, isSvgMode, selectValue, vnode, asyncMode, renderer);
429
439
  } catch (e) {
430
- if (!e || typeof e.then !== 'function') throw e;
431
- return e.then(() => _renderToString(rendered, context, isSvgMode, selectValue, vnode, asyncMode, renderer), () => renderNestedChildren());
440
+ if (!e || typeof e.then != 'function') throw e;
441
+ return e.then(() => _renderToString(rendered, context, isSvgMode, selectValue, vnode, asyncMode, renderer), renderNestedChildren);
432
442
  }
433
443
  };
434
444
 
435
- return error.then(() => renderNestedChildren());
445
+ return error.then(renderNestedChildren);
436
446
  }
437
447
  } // Serialize Element VNodes to HTML
438
448
 
439
449
 
440
450
  let s = '<' + type,
441
- html = '',
451
+ html = EMPTY_STR,
442
452
  children;
443
453
 
444
454
  for (let name in props) {
445
455
  let v = props[name];
456
+ if (typeof v == 'function') continue;
446
457
 
447
458
  switch (name) {
448
459
  case 'children':
@@ -533,7 +544,7 @@
533
544
  // serialize boolean aria-xyz or draggable attribute values as strings
534
545
  // `draggable` is an enumerated attribute and not Boolean. A value of `true` or `false` is mandatory
535
546
  // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable
536
- v += '';
547
+ v = v + EMPTY_STR;
537
548
  } else if (isSvgMode) {
538
549
  if (SVG_CAMEL_CASE.test(name)) {
539
550
  name = name === 'panose1' ? 'panose-1' : name.replace(/([A-Z])/g, '-$1').toLowerCase();
@@ -545,11 +556,11 @@
545
556
  } // write this attribute to the buffer
546
557
 
547
558
 
548
- if (v != null && v !== false && typeof v !== 'function') {
549
- if (v === true || v === '') {
559
+ if (v != null && v !== false) {
560
+ if (v === true || v === EMPTY_STR) {
550
561
  s = s + ' ' + name;
551
562
  } else {
552
- s = s + ' ' + name + '="' + encodeEntities(v + '') + '"';
563
+ s = s + ' ' + name + '="' + (typeof v == 'string' ? encodeEntities(v) : v + EMPTY_STR) + '"';
553
564
  }
554
565
  }
555
566
  }
@@ -580,7 +591,7 @@
580
591
 
581
592
  const endTag = '</' + type + '>';
582
593
  const startTag = s + '>';
583
- if (Array.isArray(html)) return [startTag, ...html, endTag];else if (typeof html !== 'string') return [startTag, html, endTag];
594
+ if (isArray(html)) return [startTag, ...html, endTag];else if (typeof html != 'string') return [startTag, html, endTag];
584
595
  return startTag + html + endTag;
585
596
  }
586
597
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../../../src/lib/util.js","../../../src/lib/constants.js","../../../src/index.js","../../../src/lib/client.js","../../../src/lib/chunked.js","../../../src/stream-node.js"],"sourcesContent":["export const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/;\nexport const UNSAFE_NAME = /[\\s\\n\\\\/='\"\\0<>]/;\nexport const NAMESPACE_REPLACE_REGEX = /^(xlink|xmlns|xml)([A-Z])/;\nexport const HTML_LOWER_CASE = /^accessK|^auto[A-Z]|^cell|^ch|^col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|spellC|src[A-Z]|tabI|useM|item[A-Z]/;\nexport const SVG_CAMEL_CASE = /^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/;\n\n// DOM properties that should NOT have \"px\" added when numeric\nconst ENCODED_ENTITIES = /[\"&<]/;\n\n/** @param {string} str */\nexport function encodeEntities(str) {\n\t// Skip all work for strings with no entities needing encoding:\n\tif (str.length === 0 || ENCODED_ENTITIES.test(str) === false) return str;\n\n\tlet last = 0,\n\t\ti = 0,\n\t\tout = '',\n\t\tch = '';\n\n\t// Seek forward in str until the next entity char:\n\tfor (; i < str.length; i++) {\n\t\tswitch (str.charCodeAt(i)) {\n\t\t\tcase 34:\n\t\t\t\tch = '&quot;';\n\t\t\t\tbreak;\n\t\t\tcase 38:\n\t\t\t\tch = '&amp;';\n\t\t\t\tbreak;\n\t\t\tcase 60:\n\t\t\t\tch = '&lt;';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcontinue;\n\t\t}\n\t\t// Append skipped/buffered characters and the encoded entity:\n\t\tif (i !== last) out += str.slice(last, i);\n\t\tout += ch;\n\t\t// Start the next seek/buffer after the entity's offset:\n\t\tlast = i + 1;\n\t}\n\tif (i !== last) out += str.slice(last, i);\n\treturn out;\n}\n\nexport let indent = (s, char) =>\n\tString(s).replace(/(\\n+)/g, '$1' + (char || '\\t'));\n\nexport let isLargeString = (s, length, ignoreLines) =>\n\tString(s).length > (length || 40) ||\n\t(!ignoreLines && String(s).indexOf('\\n') !== -1) ||\n\tString(s).indexOf('<') !== -1;\n\nconst JS_TO_CSS = {};\n\nconst IS_NON_DIMENSIONAL = new Set([\n\t'animation-iteration-count',\n\t'border-image-outset',\n\t'border-image-slice',\n\t'border-image-width',\n\t'box-flex',\n\t'box-flex-group',\n\t'box-ordinal-group',\n\t'column-count',\n\t'fill-opacity',\n\t'flex',\n\t'flex-grow',\n\t'flex-negative',\n\t'flex-order',\n\t'flex-positive',\n\t'flex-shrink',\n\t'flood-opacity',\n\t'font-weight',\n\t'grid-column',\n\t'grid-row',\n\t'line-clamp',\n\t'line-height',\n\t'opacity',\n\t'order',\n\t'orphans',\n\t'stop-opacity',\n\t'stroke-dasharray',\n\t'stroke-dashoffset',\n\t'stroke-miterlimit',\n\t'stroke-opacity',\n\t'stroke-width',\n\t'tab-size',\n\t'widows',\n\t'z-index',\n\t'zoom'\n]);\n\nconst CSS_REGEX = /[A-Z]/g;\n// Convert an Object style to a CSSText string\nexport function styleObjToCss(s) {\n\tlet str = '';\n\tfor (let prop in s) {\n\t\tlet val = s[prop];\n\t\tif (val != null && val !== '') {\n\t\t\tconst name =\n\t\t\t\tprop[0] == '-'\n\t\t\t\t\t? prop\n\t\t\t\t\t: JS_TO_CSS[prop] ||\n\t\t\t\t\t (JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$&').toLowerCase());\n\n\t\t\tlet suffix = ';';\n\t\t\tif (\n\t\t\t\ttypeof val === 'number' &&\n\t\t\t\t// Exclude custom-attributes\n\t\t\t\t!name.startsWith('--') &&\n\t\t\t\t!IS_NON_DIMENSIONAL.has(name)\n\t\t\t) {\n\t\t\t\tsuffix = 'px;';\n\t\t\t}\n\t\t\tstr = str + name + ':' + val + suffix;\n\t\t}\n\t}\n\treturn str || undefined;\n}\n\n/**\n * Get flattened children from the children prop\n * @param {Array} accumulator\n * @param {any} children A `props.children` opaque object.\n * @returns {Array} accumulator\n * @private\n */\nexport function getChildren(accumulator, children) {\n\tif (Array.isArray(children)) {\n\t\tchildren.reduce(getChildren, accumulator);\n\t} else if (children != null && children !== false) {\n\t\taccumulator.push(children);\n\t}\n\treturn accumulator;\n}\n\nfunction markAsDirty() {\n\tthis.__d = true;\n}\n\nexport function createComponent(vnode, context) {\n\treturn {\n\t\t__v: vnode,\n\t\tcontext,\n\t\tprops: vnode.props,\n\t\t// silently drop state updates\n\t\tsetState: markAsDirty,\n\t\tforceUpdate: markAsDirty,\n\t\t__d: true,\n\t\t// hooks\n\t\t__h: []\n\t};\n}\n\n// Necessary for createContext api. Setting this property will pass\n// the context value as `this.context` just for this component.\nexport function getContext(nodeName, context) {\n\tlet cxType = nodeName.contextType;\n\tlet provider = cxType && context[cxType.__c];\n\treturn cxType != null\n\t\t? provider\n\t\t\t? provider.props.value\n\t\t\t: cxType.__\n\t\t: context;\n}\n\n/**\n * @template T\n */\nexport class Deferred {\n\tconstructor() {\n\t\t// eslint-disable-next-line lines-around-comment\n\t\t/** @type {Promise<T>} */\n\t\tthis.promise = new Promise((resolve, reject) => {\n\t\t\tthis.resolve = resolve;\n\t\t\tthis.reject = reject;\n\t\t});\n\t}\n}\n","// Options hooks\nexport const DIFF = '__b';\nexport const RENDER = '__r';\nexport const DIFFED = 'diffed';\nexport const COMMIT = '__c';\nexport const SKIP_EFFECTS = '__s';\nexport const CATCH_ERROR = '__e';\n\n// VNode properties\nexport const COMPONENT = '__c';\nexport const CHILDREN = '__k';\nexport const PARENT = '__';\nexport const MASK = '__m';\n\n// Component properties\nexport const VNODE = '__v';\nexport const DIRTY = '__d';\nexport const NEXT_STATE = '__s';\nexport const CHILD_DID_SUSPEND = '__c';\n","import {\n\tencodeEntities,\n\tstyleObjToCss,\n\tUNSAFE_NAME,\n\tNAMESPACE_REPLACE_REGEX,\n\tHTML_LOWER_CASE,\n\tSVG_CAMEL_CASE\n} from './lib/util.js';\nimport { options, h, Fragment } from 'preact';\nimport {\n\tCHILDREN,\n\tCOMMIT,\n\tCOMPONENT,\n\tDIFF,\n\tDIFFED,\n\tDIRTY,\n\tNEXT_STATE,\n\tPARENT,\n\tRENDER,\n\tSKIP_EFFECTS,\n\tVNODE,\n\tCATCH_ERROR\n} from './lib/constants.js';\n\nconst EMPTY_ARR = [];\nconst isArray = Array.isArray;\nconst assign = Object.assign;\n\n// Global state for the current render pass\nlet beforeDiff, afterDiff, renderHook, ummountHook;\n\n/**\n * Render Preact JSX + Components to an HTML string.\n * @param {VNode} vnode\tJSX Element / VNode to render\n * @param {Object} [context={}] Initial root context object\n * @param {RendererState} [_rendererState] for internal use\n * @returns {string} serialized HTML\n */\nexport function renderToString(vnode, context, _rendererState) {\n\t// Performance optimization: `renderToString` is synchronous and we\n\t// therefore don't execute any effects. To do that we pass an empty\n\t// array to `options._commit` (`__c`). But we can go one step further\n\t// and avoid a lot of dirty checks and allocations by setting\n\t// `options._skipEffects` (`__s`) too.\n\tconst previousSkipEffects = options[SKIP_EFFECTS];\n\toptions[SKIP_EFFECTS] = true;\n\n\t// store options hooks once before each synchronous render call\n\tbeforeDiff = options[DIFF];\n\tafterDiff = options[DIFFED];\n\trenderHook = options[RENDER];\n\tummountHook = options.unmount;\n\n\tconst parent = h(Fragment, null);\n\tparent[CHILDREN] = [vnode];\n\n\ttry {\n\t\tconst rendered = _renderToString(\n\t\t\tvnode,\n\t\t\tcontext || EMPTY_OBJ,\n\t\t\tfalse,\n\t\t\tundefined,\n\t\t\tparent,\n\t\t\tfalse,\n\t\t\t_rendererState\n\t\t);\n\n\t\tif (Array.isArray(rendered)) {\n\t\t\treturn rendered.join('');\n\t\t}\n\t\treturn rendered;\n\t} catch (e) {\n\t\tif (e.then) {\n\t\t\tthrow new Error('Use \"renderToStringAsync\" for suspenseful rendering.');\n\t\t}\n\n\t\tthrow e;\n\t} finally {\n\t\t// options._commit, we don't schedule any effects in this library right now,\n\t\t// so we can pass an empty queue to this hook.\n\t\tif (options[COMMIT]) options[COMMIT](vnode, EMPTY_ARR);\n\t\toptions[SKIP_EFFECTS] = previousSkipEffects;\n\t\tEMPTY_ARR.length = 0;\n\t}\n}\n\n/**\n * Render Preact JSX + Components to an HTML string.\n * @param {VNode} vnode\tJSX Element / VNode to render\n * @param {Object} [context={}] Initial root context object\n * @returns {string} serialized HTML\n */\nexport async function renderToStringAsync(vnode, context) {\n\t// Performance optimization: `renderToString` is synchronous and we\n\t// therefore don't execute any effects. To do that we pass an empty\n\t// array to `options._commit` (`__c`). But we can go one step further\n\t// and avoid a lot of dirty checks and allocations by setting\n\t// `options._skipEffects` (`__s`) too.\n\tconst previousSkipEffects = options[SKIP_EFFECTS];\n\toptions[SKIP_EFFECTS] = true;\n\n\t// store options hooks once before each synchronous render call\n\tbeforeDiff = options[DIFF];\n\tafterDiff = options[DIFFED];\n\trenderHook = options[RENDER];\n\tummountHook = options.unmount;\n\n\tconst parent = h(Fragment, null);\n\tparent[CHILDREN] = [vnode];\n\n\ttry {\n\t\tconst rendered = await _renderToString(\n\t\t\tvnode,\n\t\t\tcontext || EMPTY_OBJ,\n\t\t\tfalse,\n\t\t\tundefined,\n\t\t\tparent,\n\t\t\ttrue,\n\t\t\tundefined\n\t\t);\n\n\t\tif (Array.isArray(rendered)) {\n\t\t\tlet count = 0;\n\t\t\tlet resolved = rendered;\n\n\t\t\t// Resolving nested Promises with a maximum depth of 25\n\t\t\twhile (\n\t\t\t\tresolved.some((element) => typeof element.then === 'function') &&\n\t\t\t\tcount++ < 25\n\t\t\t) {\n\t\t\t\tresolved = (await Promise.all(resolved)).flat();\n\t\t\t}\n\n\t\t\treturn resolved.join('');\n\t\t}\n\n\t\treturn rendered;\n\t} finally {\n\t\t// options._commit, we don't schedule any effects in this library right now,\n\t\t// so we can pass an empty queue to this hook.\n\t\tif (options[COMMIT]) options[COMMIT](vnode, EMPTY_ARR);\n\t\toptions[SKIP_EFFECTS] = previousSkipEffects;\n\t\tEMPTY_ARR.length = 0;\n\t}\n}\n\n// Installed as setState/forceUpdate for function components\nfunction markAsDirty() {\n\tthis.__d = true;\n}\n\nconst EMPTY_OBJ = {};\n\n/**\n * @param {VNode} vnode\n * @param {Record<string, unknown>} context\n */\nfunction renderClassComponent(vnode, context) {\n\tlet type = /** @type {import(\"preact\").ComponentClass<typeof vnode.props>} */ (vnode.type);\n\n\tlet isMounting = true;\n\tlet c;\n\tif (vnode[COMPONENT]) {\n\t\tisMounting = false;\n\t\tc = vnode[COMPONENT];\n\t\tc.state = c[NEXT_STATE];\n\t} else {\n\t\tc = new type(vnode.props, context);\n\t}\n\n\tvnode[COMPONENT] = c;\n\tc[VNODE] = vnode;\n\n\tc.props = vnode.props;\n\tc.context = context;\n\t// turn off stateful re-rendering:\n\tc[DIRTY] = true;\n\n\tif (c.state == null) c.state = EMPTY_OBJ;\n\n\tif (c[NEXT_STATE] == null) {\n\t\tc[NEXT_STATE] = c.state;\n\t}\n\n\tif (type.getDerivedStateFromProps) {\n\t\tc.state = assign(\n\t\t\t{},\n\t\t\tc.state,\n\t\t\ttype.getDerivedStateFromProps(c.props, c.state)\n\t\t);\n\t} else if (isMounting && c.componentWillMount) {\n\t\tc.componentWillMount();\n\n\t\t// If the user called setState in cWM we need to flush pending,\n\t\t// state updates. This is the same behaviour in React.\n\t\tc.state = c[NEXT_STATE] !== c.state ? c[NEXT_STATE] : c.state;\n\t} else if (!isMounting && c.componentWillUpdate) {\n\t\tc.componentWillUpdate();\n\t}\n\n\tif (renderHook) renderHook(vnode);\n\n\treturn c.render(c.props, c.state, context);\n}\n\n/**\n * Recursively render VNodes to HTML.\n * @param {VNode|any} vnode\n * @param {any} context\n * @param {boolean} isSvgMode\n * @param {any} selectValue\n * @param {VNode} parent\n * @param {boolean} asyncMode\n * @param {RendererState | undefined} [renderer]\n * @returns {string | Promise<string> | (string | Promise<string>)[]}\n */\nfunction _renderToString(\n\tvnode,\n\tcontext,\n\tisSvgMode,\n\tselectValue,\n\tparent,\n\tasyncMode,\n\trenderer\n) {\n\t// Ignore non-rendered VNodes/values\n\tif (vnode == null || vnode === true || vnode === false || vnode === '') {\n\t\treturn '';\n\t}\n\n\t// Text VNodes: escape as HTML\n\tif (typeof vnode !== 'object') {\n\t\tif (typeof vnode === 'function') return '';\n\t\treturn encodeEntities(vnode + '');\n\t}\n\n\t// Recurse into children / Arrays\n\tif (isArray(vnode)) {\n\t\tlet rendered = '',\n\t\t\trenderArray;\n\t\tparent[CHILDREN] = vnode;\n\t\tfor (let i = 0; i < vnode.length; i++) {\n\t\t\tlet child = vnode[i];\n\t\t\tif (child == null || typeof child === 'boolean') continue;\n\n\t\t\tconst childRender = _renderToString(\n\t\t\t\tchild,\n\t\t\t\tcontext,\n\t\t\t\tisSvgMode,\n\t\t\t\tselectValue,\n\t\t\t\tparent,\n\t\t\t\tasyncMode,\n\t\t\t\trenderer\n\t\t\t);\n\n\t\t\tif (typeof childRender === 'string') {\n\t\t\t\trendered += childRender;\n\t\t\t} else {\n\t\t\t\trenderArray = renderArray || [];\n\n\t\t\t\tif (rendered) renderArray.push(rendered);\n\n\t\t\t\trendered = '';\n\n\t\t\t\tif (Array.isArray(childRender)) {\n\t\t\t\t\trenderArray.push(...childRender);\n\t\t\t\t} else {\n\t\t\t\t\trenderArray.push(childRender);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (renderArray) {\n\t\t\tif (rendered) renderArray.push(rendered);\n\t\t\treturn renderArray;\n\t\t}\n\n\t\treturn rendered;\n\t}\n\n\t// VNodes have {constructor:undefined} to prevent JSON injection:\n\tif (vnode.constructor !== undefined) return '';\n\n\tvnode[PARENT] = parent;\n\tif (beforeDiff) beforeDiff(vnode);\n\n\tlet type = vnode.type,\n\t\tprops = vnode.props,\n\t\tcctx = context,\n\t\tcontextType,\n\t\trendered,\n\t\tcomponent;\n\n\t// Invoke rendering on Components\n\tif (typeof type === 'function') {\n\t\tif (type === Fragment) {\n\t\t\t// Serialized precompiled JSX.\n\t\t\tif (props.tpl) {\n\t\t\t\tlet out = '';\n\t\t\t\tfor (let i = 0; i < props.tpl.length; i++) {\n\t\t\t\t\tout += props.tpl[i];\n\n\t\t\t\t\tif (props.exprs && i < props.exprs.length) {\n\t\t\t\t\t\tconst value = props.exprs[i];\n\t\t\t\t\t\tif (value == null) continue;\n\n\t\t\t\t\t\t// Check if we're dealing with a vnode or an array of nodes\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof value === 'object' &&\n\t\t\t\t\t\t\t(value.constructor === undefined || isArray(value))\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tout += _renderToString(\n\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\tisSvgMode,\n\t\t\t\t\t\t\t\tselectValue,\n\t\t\t\t\t\t\t\tvnode,\n\t\t\t\t\t\t\t\tasyncMode,\n\t\t\t\t\t\t\t\trenderer\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Values are pre-escaped by the JSX transform\n\t\t\t\t\t\t\tout += value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn out;\n\t\t\t} else if (props.UNSTABLE_comment) {\n\t\t\t\t// Fragments are the least used components of core that's why\n\t\t\t\t// branching here for comments has the least effect on perf.\n\t\t\t\treturn '<!--' + encodeEntities(props.UNSTABLE_comment || '') + '-->';\n\t\t\t}\n\n\t\t\trendered = props.children;\n\t\t} else {\n\t\t\tcontextType = type.contextType;\n\t\t\tif (contextType != null) {\n\t\t\t\tlet provider = context[contextType.__c];\n\t\t\t\tcctx = provider ? provider.props.value : contextType.__;\n\t\t\t}\n\n\t\t\tif (type.prototype && typeof type.prototype.render === 'function') {\n\t\t\t\trendered = /**#__NOINLINE__**/ renderClassComponent(vnode, cctx);\n\t\t\t\tcomponent = vnode[COMPONENT];\n\t\t\t} else {\n\t\t\t\tcomponent = {\n\t\t\t\t\t__v: vnode,\n\t\t\t\t\tprops,\n\t\t\t\t\tcontext: cctx,\n\t\t\t\t\t// silently drop state updates\n\t\t\t\t\tsetState: markAsDirty,\n\t\t\t\t\tforceUpdate: markAsDirty,\n\t\t\t\t\t__d: true,\n\t\t\t\t\t// hooks\n\t\t\t\t\t__h: []\n\t\t\t\t};\n\t\t\t\tvnode[COMPONENT] = component;\n\n\t\t\t\t// If a hook invokes setState() to invalidate the component during rendering,\n\t\t\t\t// re-render it up to 25 times to allow \"settling\" of memoized states.\n\t\t\t\t// Note:\n\t\t\t\t// This will need to be updated for Preact 11 to use internal.flags rather than component._dirty:\n\t\t\t\t// https://github.com/preactjs/preact/blob/d4ca6fdb19bc715e49fd144e69f7296b2f4daa40/src/diff/component.js#L35-L44\n\t\t\t\tlet count = 0;\n\t\t\t\twhile (component[DIRTY] && count++ < 25) {\n\t\t\t\t\tcomponent[DIRTY] = false;\n\n\t\t\t\t\tif (renderHook) renderHook(vnode);\n\n\t\t\t\t\trendered = type.call(component, props, cctx);\n\t\t\t\t}\n\t\t\t\tcomponent[DIRTY] = true;\n\t\t\t}\n\n\t\t\tif (component.getChildContext != null) {\n\t\t\t\tcontext = assign({}, context, component.getChildContext());\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t(type.getDerivedStateFromError || component.componentDidCatch) &&\n\t\t\t\toptions.errorBoundaries\n\t\t\t) {\n\t\t\t\tlet str = '';\n\t\t\t\t// When a component returns a Fragment node we flatten it in core, so we\n\t\t\t\t// need to mirror that logic here too\n\t\t\t\tlet isTopLevelFragment =\n\t\t\t\t\trendered != null &&\n\t\t\t\t\trendered.type === Fragment &&\n\t\t\t\t\trendered.key == null;\n\t\t\t\trendered = isTopLevelFragment ? rendered.props.children : rendered;\n\n\t\t\t\ttry {\n\t\t\t\t\tstr = _renderToString(\n\t\t\t\t\t\trendered,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tisSvgMode,\n\t\t\t\t\t\tselectValue,\n\t\t\t\t\t\tvnode,\n\t\t\t\t\t\tasyncMode,\n\t\t\t\t\t\trenderer\n\t\t\t\t\t);\n\t\t\t\t\treturn str;\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (type.getDerivedStateFromError) {\n\t\t\t\t\t\tcomponent[NEXT_STATE] = type.getDerivedStateFromError(err);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (component.componentDidCatch) {\n\t\t\t\t\t\tcomponent.componentDidCatch(err, {});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (component[DIRTY]) {\n\t\t\t\t\t\trendered = renderClassComponent(vnode, context);\n\t\t\t\t\t\tcomponent = vnode[COMPONENT];\n\n\t\t\t\t\t\tif (component.getChildContext != null) {\n\t\t\t\t\t\t\tcontext = assign({}, context, component.getChildContext());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet isTopLevelFragment =\n\t\t\t\t\t\t\trendered != null &&\n\t\t\t\t\t\t\trendered.type === Fragment &&\n\t\t\t\t\t\t\trendered.key == null;\n\t\t\t\t\t\trendered = isTopLevelFragment ? rendered.props.children : rendered;\n\n\t\t\t\t\t\tstr = _renderToString(\n\t\t\t\t\t\t\trendered,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tisSvgMode,\n\t\t\t\t\t\t\tselectValue,\n\t\t\t\t\t\t\tvnode,\n\t\t\t\t\t\t\tasyncMode,\n\t\t\t\t\t\t\trenderer\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn str;\n\t\t\t\t} finally {\n\t\t\t\t\tif (afterDiff) afterDiff(vnode);\n\t\t\t\t\tvnode[PARENT] = null;\n\n\t\t\t\t\tif (ummountHook) ummountHook(vnode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// When a component returns a Fragment node we flatten it in core, so we\n\t\t// need to mirror that logic here too\n\t\tlet isTopLevelFragment =\n\t\t\trendered != null &&\n\t\t\trendered.type === Fragment &&\n\t\t\trendered.key == null &&\n\t\t\trendered.props.tpl == null;\n\t\trendered = isTopLevelFragment ? rendered.props.children : rendered;\n\n\t\ttry {\n\t\t\t// Recurse into children before invoking the after-diff hook\n\t\t\tconst str = _renderToString(\n\t\t\t\trendered,\n\t\t\t\tcontext,\n\t\t\t\tisSvgMode,\n\t\t\t\tselectValue,\n\t\t\t\tvnode,\n\t\t\t\tasyncMode,\n\t\t\t\trenderer\n\t\t\t);\n\n\t\t\tif (afterDiff) afterDiff(vnode);\n\t\t\t// when we are dealing with suspense we can't do this...\n\t\t\tvnode[PARENT] = null;\n\n\t\t\tif (options.unmount) options.unmount(vnode);\n\n\t\t\treturn str;\n\t\t} catch (error) {\n\t\t\tif (!asyncMode && renderer && renderer.onError) {\n\t\t\t\tlet res = renderer.onError(error, vnode, (child) =>\n\t\t\t\t\t_renderToString(\n\t\t\t\t\t\tchild,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tisSvgMode,\n\t\t\t\t\t\tselectValue,\n\t\t\t\t\t\tvnode,\n\t\t\t\t\t\tasyncMode,\n\t\t\t\t\t\trenderer\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tif (res !== undefined) return res;\n\n\t\t\t\tlet errorHook = options[CATCH_ERROR];\n\t\t\t\tif (errorHook) errorHook(error, vnode);\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tif (!asyncMode) throw error;\n\n\t\t\tif (!error || typeof error.then !== 'function') throw error;\n\n\t\t\tconst renderNestedChildren = () => {\n\t\t\t\ttry {\n\t\t\t\t\treturn _renderToString(\n\t\t\t\t\t\trendered,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tisSvgMode,\n\t\t\t\t\t\tselectValue,\n\t\t\t\t\t\tvnode,\n\t\t\t\t\t\tasyncMode,\n\t\t\t\t\t\trenderer\n\t\t\t\t\t);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (!e || typeof e.then !== 'function') throw e;\n\n\t\t\t\t\treturn e.then(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t_renderToString(\n\t\t\t\t\t\t\t\trendered,\n\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\tisSvgMode,\n\t\t\t\t\t\t\t\tselectValue,\n\t\t\t\t\t\t\t\tvnode,\n\t\t\t\t\t\t\t\tasyncMode,\n\t\t\t\t\t\t\t\trenderer\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t() => renderNestedChildren()\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\treturn error.then(() => renderNestedChildren());\n\t\t}\n\t}\n\n\t// Serialize Element VNodes to HTML\n\tlet s = '<' + type,\n\t\thtml = '',\n\t\tchildren;\n\n\tfor (let name in props) {\n\t\tlet v = props[name];\n\n\t\tswitch (name) {\n\t\t\tcase 'children':\n\t\t\t\tchildren = v;\n\t\t\t\tcontinue;\n\n\t\t\t// VDOM-specific props\n\t\t\tcase 'key':\n\t\t\tcase 'ref':\n\t\t\tcase '__self':\n\t\t\tcase '__source':\n\t\t\t\tcontinue;\n\n\t\t\t// prefer for/class over htmlFor/className\n\t\t\tcase 'htmlFor':\n\t\t\t\tif ('for' in props) continue;\n\t\t\t\tname = 'for';\n\t\t\t\tbreak;\n\t\t\tcase 'className':\n\t\t\t\tif ('class' in props) continue;\n\t\t\t\tname = 'class';\n\t\t\t\tbreak;\n\n\t\t\t// Form element reflected properties\n\t\t\tcase 'defaultChecked':\n\t\t\t\tname = 'checked';\n\t\t\t\tbreak;\n\t\t\tcase 'defaultSelected':\n\t\t\t\tname = 'selected';\n\t\t\t\tbreak;\n\n\t\t\t// Special value attribute handling\n\t\t\tcase 'defaultValue':\n\t\t\tcase 'value':\n\t\t\t\tname = 'value';\n\t\t\t\tswitch (type) {\n\t\t\t\t\t// <textarea value=\"a&b\"> --> <textarea>a&amp;b</textarea>\n\t\t\t\t\tcase 'textarea':\n\t\t\t\t\t\tchildren = v;\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t// <select value> is serialized as a selected attribute on the matching option child\n\t\t\t\t\tcase 'select':\n\t\t\t\t\t\tselectValue = v;\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t// Add a selected attribute to <option> if its value matches the parent <select> value\n\t\t\t\t\tcase 'option':\n\t\t\t\t\t\tif (selectValue == v && !('selected' in props)) {\n\t\t\t\t\t\t\ts = s + ' selected';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'dangerouslySetInnerHTML':\n\t\t\t\thtml = v && v.__html;\n\t\t\t\tcontinue;\n\n\t\t\t// serialize object styles to a CSS string\n\t\t\tcase 'style':\n\t\t\t\tif (typeof v === 'object') {\n\t\t\t\t\tv = styleObjToCss(v);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'acceptCharset':\n\t\t\t\tname = 'accept-charset';\n\t\t\t\tbreak;\n\t\t\tcase 'httpEquiv':\n\t\t\t\tname = 'http-equiv';\n\t\t\t\tbreak;\n\n\t\t\tdefault: {\n\t\t\t\tif (NAMESPACE_REPLACE_REGEX.test(name)) {\n\t\t\t\t\tname = name.replace(NAMESPACE_REPLACE_REGEX, '$1:$2').toLowerCase();\n\t\t\t\t} else if (UNSAFE_NAME.test(name)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if ((name[4] === '-' || name === 'draggable') && v != null) {\n\t\t\t\t\t// serialize boolean aria-xyz or draggable attribute values as strings\n\t\t\t\t\t// `draggable` is an enumerated attribute and not Boolean. A value of `true` or `false` is mandatory\n\t\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable\n\t\t\t\t\tv += '';\n\t\t\t\t} else if (isSvgMode) {\n\t\t\t\t\tif (SVG_CAMEL_CASE.test(name)) {\n\t\t\t\t\t\tname =\n\t\t\t\t\t\t\tname === 'panose1'\n\t\t\t\t\t\t\t\t? 'panose-1'\n\t\t\t\t\t\t\t\t: name.replace(/([A-Z])/g, '-$1').toLowerCase();\n\t\t\t\t\t}\n\t\t\t\t} else if (HTML_LOWER_CASE.test(name)) {\n\t\t\t\t\tname = name.toLowerCase();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// write this attribute to the buffer\n\t\tif (v != null && v !== false && typeof v !== 'function') {\n\t\t\tif (v === true || v === '') {\n\t\t\t\ts = s + ' ' + name;\n\t\t\t} else {\n\t\t\t\ts = s + ' ' + name + '=\"' + encodeEntities(v + '') + '\"';\n\t\t\t}\n\t\t}\n\t}\n\n\tif (UNSAFE_NAME.test(type)) {\n\t\t// this seems to performs a lot better than throwing\n\t\t// return '<!-- -->';\n\t\tthrow new Error(`${type} is not a valid HTML tag name in ${s}>`);\n\t}\n\n\tif (html) {\n\t\t// dangerouslySetInnerHTML defined this node's contents\n\t} else if (typeof children === 'string') {\n\t\t// single text child\n\t\thtml = encodeEntities(children);\n\t} else if (children != null && children !== false && children !== true) {\n\t\t// recurse into this element VNode's children\n\t\tlet childSvgMode =\n\t\t\ttype === 'svg' || (type !== 'foreignObject' && isSvgMode);\n\t\thtml = _renderToString(\n\t\t\tchildren,\n\t\t\tcontext,\n\t\t\tchildSvgMode,\n\t\t\tselectValue,\n\t\t\tvnode,\n\t\t\tasyncMode,\n\t\t\trenderer\n\t\t);\n\t}\n\n\tif (afterDiff) afterDiff(vnode);\n\n\t// TODO: this was commented before\n\tvnode[PARENT] = null;\n\n\tif (ummountHook) ummountHook(vnode);\n\n\t// Emit self-closing tag for empty void elements:\n\tif (!html && SELF_CLOSING.has(type)) {\n\t\treturn s + '/>';\n\t}\n\n\tconst endTag = '</' + type + '>';\n\tconst startTag = s + '>';\n\n\tif (Array.isArray(html)) return [startTag, ...html, endTag];\n\telse if (typeof html !== 'string') return [startTag, html, endTag];\n\treturn startTag + html + endTag;\n}\n\nconst SELF_CLOSING = new Set([\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr'\n]);\n\nexport default renderToString;\nexport const render = renderToString;\nexport const renderToStaticMarkup = renderToString;\n","/* eslint-disable no-var, key-spacing, object-curly-spacing, prefer-arrow-callback, semi, keyword-spacing */\n\n// function initPreactIslandElement() {\n// \tclass PreactIslandElement extends HTMLElement {\n// \t\tconnectedCallback() {\n// \t\t\tvar d = this;\n// \t\t\tif (!d.isConnected) return;\n\n// \t\t\tlet i = this.getAttribute('data-target');\n// \t\t\tif (!i) return;\n\n// \t\t\tvar s,\n// \t\t\t\te,\n// \t\t\t\tc = document.createNodeIterator(document, 128);\n// \t\t\twhile (c.nextNode()) {\n// \t\t\t\tlet n = c.referenceNode;\n\n// \t\t\t\tif (n.data == 'preact-island:' + i) s = n;\n// \t\t\t\telse if (n.data == '/preact-island:' + i) e = n;\n// \t\t\t\tif (s && e) break;\n// \t\t\t}\n// \t\t\tif (s && e) {\n// \t\t\t\trequestAnimationFrame(() => {\n// \t\t\t\t\tvar p = e.previousSibling;\n// \t\t\t\t\twhile (p != s) {\n// \t\t\t\t\t\tif (!p || p == s) break;\n// \t\t\t\t\t\te.parentNode.removeChild(p);\n// \t\t\t\t\t\tp = e.previousSibling;\n// \t\t\t\t\t}\n\n// \t\t\t\t\tc = s;\n// \t\t\t\t\twhile (d.firstChild) {\n// \t\t\t\t\t\ts = d.firstChild;\n// \t\t\t\t\t\td.removeChild(s);\n// \t\t\t\t\t\tc.after(s);\n// \t\t\t\t\t\tc = s;\n// \t\t\t\t\t}\n\n// \t\t\t\t\td.parentNode.removeChild(d);\n// \t\t\t\t});\n// \t\t\t}\n// \t\t}\n// \t}\n\n// \tcustomElements.define('preact-island', PreactIslandElement);\n// }\n\n// To modify the INIT_SCRIPT, uncomment the above code, modify it, and paste it into https://try.terser.org/.\nconst INIT_SCRIPT = `class e extends HTMLElement{connectedCallback(){var e=this;if(!e.isConnected)return;let t=this.getAttribute(\"data-target\");if(t){for(var r,a,i=document.createNodeIterator(document,128);i.nextNode();){let e=i.referenceNode;if(e.data==\"preact-island:\"+t?r=e:e.data==\"/preact-island:\"+t&&(a=e),r&&a)break}r&&a&&requestAnimationFrame((()=>{for(var t=a.previousSibling;t!=r&&t&&t!=r;)a.parentNode.removeChild(t),t=a.previousSibling;for(i=r;e.firstChild;)r=e.firstChild,e.removeChild(r),i.after(r),i=r;e.parentNode.removeChild(e)}))}}}customElements.define(\"preact-island\",e);`;\n\nexport function createInitScript() {\n\treturn `<script>(function(){${INIT_SCRIPT}}())</script>`;\n}\n\n/**\n * @param {string} id\n * @param {string} content\n * @returns {string}\n */\nexport function createSubtree(id, content) {\n\treturn `<preact-island hidden data-target=\"${id}\">${content}</preact-island>`;\n}\n","import { renderToString } from '../index.js';\nimport { CHILD_DID_SUSPEND, COMPONENT, PARENT } from './constants.js';\nimport { Deferred } from './util.js';\nimport { createInitScript, createSubtree } from './client.js';\n\n/**\n * @param {VNode} vnode\n * @param {RenderToChunksOptions} options\n * @returns {Promise<void>}\n */\nexport async function renderToChunks(vnode, { context, onWrite, abortSignal }) {\n\tcontext = context || {};\n\n\t/** @type {RendererState} */\n\tconst renderer = {\n\t\tstart: Date.now(),\n\t\tabortSignal,\n\t\tonWrite,\n\t\tonError: handleError,\n\t\tsuspended: []\n\t};\n\n\t// Synchronously render the shell\n\t// @ts-ignore - using third internal RendererState argument\n\tconst shell = renderToString(vnode, context, renderer);\n\tonWrite(shell);\n\n\t// Wait for any suspended sub-trees if there are any\n\tconst len = renderer.suspended.length;\n\tif (len > 0) {\n\t\tonWrite('<div hidden>');\n\t\tonWrite(createInitScript(len));\n\t\t// We should keep checking all promises\n\t\tawait forkPromises(renderer);\n\t\tonWrite('</div>');\n\t}\n}\n\nasync function forkPromises(renderer) {\n\tif (renderer.suspended.length > 0) {\n\t\tconst suspensions = [...renderer.suspended];\n\t\tawait Promise.all(renderer.suspended.map((s) => s.promise));\n\t\trenderer.suspended = renderer.suspended.filter(\n\t\t\t(s) => !suspensions.includes(s)\n\t\t);\n\t\tawait forkPromises(renderer);\n\t}\n}\n\n/** @type {RendererErrorHandler} */\nfunction handleError(error, vnode, renderChild) {\n\tif (!error || !error.then) return;\n\n\t// walk up to the Suspense boundary\n\twhile ((vnode = vnode[PARENT])) {\n\t\tlet component = vnode[COMPONENT];\n\t\tif (component && component[CHILD_DID_SUSPEND]) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!vnode) return;\n\n\tconst id = vnode.__v;\n\tconst found = this.suspended.find((x) => x.id === id);\n\tconst race = new Deferred();\n\n\tconst abortSignal = this.abortSignal;\n\tif (abortSignal) {\n\t\t// @ts-ignore 2554 - implicit undefined arg\n\t\tif (abortSignal.aborted) race.resolve();\n\t\telse abortSignal.addEventListener('abort', race.resolve);\n\t}\n\n\tconst promise = error.then(\n\t\t() => {\n\t\t\tif (abortSignal && abortSignal.aborted) return;\n\t\t\tconst child = renderChild(vnode.props.children);\n\t\t\tif (child) this.onWrite(createSubtree(id, child));\n\t\t},\n\t\t// TODO: Abort and send hydration code snippet to client\n\t\t// to attempt to recover during hydration\n\t\tthis.onError\n\t);\n\n\tthis.suspended.push({\n\t\tid,\n\t\tvnode,\n\t\tpromise: Promise.race([promise, race.promise])\n\t});\n\n\tconst fallback = renderChild(vnode.props.fallback);\n\n\treturn found\n\t\t? ''\n\t\t: `<!--preact-island:${id}-->${fallback}<!--/preact-island:${id}-->`;\n}\n","import { PassThrough } from 'node:stream';\nimport { renderToChunks } from './lib/chunked.js';\n\n/**\n * @typedef {object} RenderToPipeableStreamOptions\n * @property {() => void} [onShellReady]\n * @property {() => void} [onAllReady]\n * @property {(error) => void} [onError]\n */\n\n/**\n * @typedef {object} PipeableStream\n * @property {() => void} abort\n * @property {(writable: import('stream').Writable) => void} pipe\n */\n\n/**\n * @param {import('preact').VNode} vnode\n * @param {RenderToPipeableStreamOptions} options\n * @param {any} [context]\n * @returns {PipeableStream}\n */\nexport function renderToPipeableStream(vnode, options, context) {\n\tconst encoder = new TextEncoder('utf-8');\n\n\tconst controller = new AbortController();\n\tconst stream = new PassThrough();\n\n\trenderToChunks(vnode, {\n\t\tcontext,\n\t\tabortSignal: controller.signal,\n\t\tonError: (error) => {\n\t\t\tif (options.onError) {\n\t\t\t\toptions.onError(error);\n\t\t\t}\n\t\t\tcontroller.abort(error);\n\t\t},\n\t\tonWrite(s) {\n\t\t\tstream.write(encoder.encode(s));\n\t\t}\n\t})\n\t\t.then(() => {\n\t\t\toptions.onAllReady && options.onAllReady();\n\t\t\tstream.end();\n\t\t})\n\t\t.catch((error) => {\n\t\t\tstream.destroy(error);\n\t\t});\n\n\tPromise.resolve().then(() => {\n\t\toptions.onShellReady && options.onShellReady();\n\t});\n\n\treturn {\n\t\tabort() {\n\t\t\tcontroller.abort();\n\t\t\tstream.destroy(new Error('aborted'));\n\t\t},\n\t\t/**\n\t\t * @param {import(\"stream\").Writable} writable\n\t\t */\n\t\tpipe(writable) {\n\t\t\tstream.pipe(writable, { end: true });\n\t\t}\n\t};\n}\n"],"names":["UNSAFE_NAME","NAMESPACE_REPLACE_REGEX","HTML_LOWER_CASE","SVG_CAMEL_CASE","ENCODED_ENTITIES","encodeEntities","str","length","test","last","i","out","ch","charCodeAt","slice","JS_TO_CSS","IS_NON_DIMENSIONAL","Set","CSS_REGEX","styleObjToCss","s","prop","val","name","replace","toLowerCase","suffix","startsWith","has","undefined","Deferred","constructor","promise","Promise","resolve","reject","DIFF","RENDER","DIFFED","COMMIT","SKIP_EFFECTS","CATCH_ERROR","COMPONENT","CHILDREN","PARENT","VNODE","DIRTY","NEXT_STATE","CHILD_DID_SUSPEND","EMPTY_ARR","isArray","Array","assign","Object","beforeDiff","afterDiff","renderHook","ummountHook","renderToString","vnode","context","_rendererState","previousSkipEffects","options","unmount","parent","h","Fragment","rendered","_renderToString","EMPTY_OBJ","join","e","then","Error","markAsDirty","__d","renderClassComponent","type","isMounting","c","state","props","getDerivedStateFromProps","componentWillMount","componentWillUpdate","render","isSvgMode","selectValue","asyncMode","renderer","renderArray","child","childRender","push","cctx","contextType","component","tpl","exprs","value","UNSTABLE_comment","children","provider","__c","__","prototype","__v","setState","forceUpdate","__h","count","call","getChildContext","getDerivedStateFromError","componentDidCatch","errorBoundaries","isTopLevelFragment","key","err","error","onError","res","errorHook","renderNestedChildren","html","v","__html","childSvgMode","SELF_CLOSING","endTag","startTag","INIT_SCRIPT","createInitScript","createSubtree","id","content","renderToChunks","onWrite","abortSignal","start","Date","now","handleError","suspended","shell","len","forkPromises","suspensions","all","map","filter","includes","renderChild","found","find","x","race","aborted","addEventListener","fallback","renderToPipeableStream","encoder","TextEncoder","controller","AbortController","stream","PassThrough","signal","abort","write","encode","onAllReady","end","catch","destroy","onShellReady","pipe","writable"],"mappings":";;;;;CACO,MAAMA,WAAW,GAAG,kBAApB;CACA,MAAMC,uBAAuB,GAAG,2BAAhC;CACA,MAAMC,eAAe,GAAG,oKAAxB;CACA,MAAMC,cAAc,GAAG,wQAAvB;;CAGP,MAAMC,gBAAgB,GAAG,OAAzB;CAEA;;CACO,SAASC,cAAT,CAAwBC,GAAxB,EAA6B;CACnC;CACA,MAAIA,GAAG,CAACC,MAAJ,KAAe,CAAf,IAAoBH,gBAAgB,CAACI,IAAjB,CAAsBF,GAAtB,MAA+B,KAAvD,EAA8D,OAAOA,GAAP;CAE9D,MAAIG,IAAI,GAAG,CAAX;CAAA,MACCC,CAAC,GAAG,CADL;CAAA,MAECC,GAAG,GAAG,EAFP;CAAA,MAGCC,EAAE,GAAG,EAHN,CAJmC;;CAUnC,SAAOF,CAAC,GAAGJ,GAAG,CAACC,MAAf,EAAuBG,CAAC,EAAxB,EAA4B;CAC3B,YAAQJ,GAAG,CAACO,UAAJ,CAAeH,CAAf,CAAR;CACC,WAAK,EAAL;CACCE,QAAAA,EAAE,GAAG,QAAL;CACA;;CACD,WAAK,EAAL;CACCA,QAAAA,EAAE,GAAG,OAAL;CACA;;CACD,WAAK,EAAL;CACCA,QAAAA,EAAE,GAAG,MAAL;CACA;;CACD;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AU,CAACI,MAFH;CAGrB/C,IAAAA,OAAO,EAAGD,KAAD,IAAW;CACnB,UAAIzD,OAAO,CAAC0D,OAAZ,EAAqB;CACpB1D,QAAAA,OAAO,CAAC0D,OAAR,CAAgBD,KAAhB;CACA;;CACD4C,MAAAA,UAAU,CAACK,KAAX,CAAiBjD,KAAjB;CACA,KARoB;;CASrBkB,IAAAA,OAAO,CAACtH,CAAD,EAAI;CACVkJ,MAAAA,MAAM,CAACI,KAAP,CAAaR,OAAO,CAACS,MAAR,CAAevJ,CAAf,CAAb;CACA;;CAXoB,GAAR,CAAd,CAaEqD,IAbF,CAaO,MAAM;CACXV,IAAAA,OAAO,CAAC6G,UAAR,IAAsB7G,OAAO,CAAC6G,UAAR,EAAtB;CACAN,IAAAA,MAAM,CAACO,GAAP;CACA,GAhBF,EAiBEC,KAjBF,CAiBStD,KAAD,IAAW;CACjB8C,IAAAA,MAAM,CAACS,OAAP,CAAevD,KAAf;CACA,GAnBF;CAqBAvF,EAAAA,OAAO,CAACC,OAAR,GAAkBuC,IAAlB,CAAuB,MAAM;CAC5BV,IAAAA,OAAO,CAACiH,YAAR,IAAwBjH,OAAO,CAACiH,YAAR,EAAxB;CACA,GAFD;CAIA,SAAO;CACNP,IAAAA,KAAK,GAAG;CACPL,MAAAA,UAAU,CAACK,KAAX;CACAH,MAAAA,MAAM,CAACS,OAAP,CAAe,IAAIrG,KAAJ,CAAU,SAAV,CAAf;CACA,KAJK;;CAKN;CACF;CACA;CACEuG,IAAAA,IAAI,CAACC,QAAD,EAAW;CACdZ,MAAAA,MAAM,CAACW,IAAP,CAAYC,QAAZ,EAAsB;CAAEL,QAAAA,GAAG,EAAE;CAAP,OAAtB;CACA;;CAVK,GAAP;CAYA;;;;;;;;"}
1
+ {"version":3,"file":"index.umd.js","sources":["../../../src/lib/util.js","../../../src/lib/constants.js","../../../src/index.js","../../../src/lib/client.js","../../../src/lib/chunked.js","../../../src/stream-node.js"],"sourcesContent":["export const VOID_ELEMENTS = /^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/;\nexport const UNSAFE_NAME = /[\\s\\n\\\\/='\"\\0<>]/;\nexport const NAMESPACE_REPLACE_REGEX = /^(xlink|xmlns|xml)([A-Z])/;\nexport const HTML_LOWER_CASE = /^accessK|^auto[A-Z]|^cell|^ch|^col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|spellC|src[A-Z]|tabI|useM|item[A-Z]/;\nexport const SVG_CAMEL_CASE = /^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/;\n\n// DOM properties that should NOT have \"px\" added when numeric\nconst ENCODED_ENTITIES = /[\"&<]/;\n\n/** @param {string} str */\nexport function encodeEntities(str) {\n\t// Skip all work for strings with no entities needing encoding:\n\tif (str.length === 0 || ENCODED_ENTITIES.test(str) === false) return str;\n\n\tlet last = 0,\n\t\ti = 0,\n\t\tout = '',\n\t\tch = '';\n\n\t// Seek forward in str until the next entity char:\n\tfor (; i < str.length; i++) {\n\t\tswitch (str.charCodeAt(i)) {\n\t\t\tcase 34:\n\t\t\t\tch = '&quot;';\n\t\t\t\tbreak;\n\t\t\tcase 38:\n\t\t\t\tch = '&amp;';\n\t\t\t\tbreak;\n\t\t\tcase 60:\n\t\t\t\tch = '&lt;';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcontinue;\n\t\t}\n\t\t// Append skipped/buffered characters and the encoded entity:\n\t\tif (i !== last) out = out + str.slice(last, i);\n\t\tout = out + ch;\n\t\t// Start the next seek/buffer after the entity's offset:\n\t\tlast = i + 1;\n\t}\n\tif (i !== last) out = out + str.slice(last, i);\n\treturn out;\n}\n\nexport let indent = (s, char) =>\n\tString(s).replace(/(\\n+)/g, '$1' + (char || '\\t'));\n\nexport let isLargeString = (s, length, ignoreLines) =>\n\tString(s).length > (length || 40) ||\n\t(!ignoreLines && String(s).indexOf('\\n') !== -1) ||\n\tString(s).indexOf('<') !== -1;\n\nconst JS_TO_CSS = {};\n\nconst IS_NON_DIMENSIONAL = new Set([\n\t'animation-iteration-count',\n\t'border-image-outset',\n\t'border-image-slice',\n\t'border-image-width',\n\t'box-flex',\n\t'box-flex-group',\n\t'box-ordinal-group',\n\t'column-count',\n\t'fill-opacity',\n\t'flex',\n\t'flex-grow',\n\t'flex-negative',\n\t'flex-order',\n\t'flex-positive',\n\t'flex-shrink',\n\t'flood-opacity',\n\t'font-weight',\n\t'grid-column',\n\t'grid-row',\n\t'line-clamp',\n\t'line-height',\n\t'opacity',\n\t'order',\n\t'orphans',\n\t'stop-opacity',\n\t'stroke-dasharray',\n\t'stroke-dashoffset',\n\t'stroke-miterlimit',\n\t'stroke-opacity',\n\t'stroke-width',\n\t'tab-size',\n\t'widows',\n\t'z-index',\n\t'zoom'\n]);\n\nconst CSS_REGEX = /[A-Z]/g;\n// Convert an Object style to a CSSText string\nexport function styleObjToCss(s) {\n\tlet str = '';\n\tfor (let prop in s) {\n\t\tlet val = s[prop];\n\t\tif (val != null && val !== '') {\n\t\t\tconst name =\n\t\t\t\tprop[0] == '-'\n\t\t\t\t\t? prop\n\t\t\t\t\t: JS_TO_CSS[prop] ||\n\t\t\t\t\t (JS_TO_CSS[prop] = prop.replace(CSS_REGEX, '-$&').toLowerCase());\n\n\t\t\tlet suffix = ';';\n\t\t\tif (\n\t\t\t\ttypeof val === 'number' &&\n\t\t\t\t// Exclude custom-attributes\n\t\t\t\t!name.startsWith('--') &&\n\t\t\t\t!IS_NON_DIMENSIONAL.has(name)\n\t\t\t) {\n\t\t\t\tsuffix = 'px;';\n\t\t\t}\n\t\t\tstr = str + name + ':' + val + suffix;\n\t\t}\n\t}\n\treturn str || undefined;\n}\n\n/**\n * Get flattened children from the children prop\n * @param {Array} accumulator\n * @param {any} children A `props.children` opaque object.\n * @returns {Array} accumulator\n * @private\n */\nexport function getChildren(accumulator, children) {\n\tif (Array.isArray(children)) {\n\t\tchildren.reduce(getChildren, accumulator);\n\t} else if (children != null && children !== false) {\n\t\taccumulator.push(children);\n\t}\n\treturn accumulator;\n}\n\nfunction markAsDirty() {\n\tthis.__d = true;\n}\n\nexport function createComponent(vnode, context) {\n\treturn {\n\t\t__v: vnode,\n\t\tcontext,\n\t\tprops: vnode.props,\n\t\t// silently drop state updates\n\t\tsetState: markAsDirty,\n\t\tforceUpdate: markAsDirty,\n\t\t__d: true,\n\t\t// hooks\n\t\t__h: new Array(0)\n\t};\n}\n\n// Necessary for createContext api. Setting this property will pass\n// the context value as `this.context` just for this component.\nexport function getContext(nodeName, context) {\n\tlet cxType = nodeName.contextType;\n\tlet provider = cxType && context[cxType.__c];\n\treturn cxType != null\n\t\t? provider\n\t\t\t? provider.props.value\n\t\t\t: cxType.__\n\t\t: context;\n}\n\n/**\n * @template T\n */\nexport class Deferred {\n\tconstructor() {\n\t\t// eslint-disable-next-line lines-around-comment\n\t\t/** @type {Promise<T>} */\n\t\tthis.promise = new Promise((resolve, reject) => {\n\t\t\tthis.resolve = resolve;\n\t\t\tthis.reject = reject;\n\t\t});\n\t}\n}\n","// Options hooks\nexport const DIFF = '__b';\nexport const RENDER = '__r';\nexport const DIFFED = 'diffed';\nexport const COMMIT = '__c';\nexport const SKIP_EFFECTS = '__s';\nexport const CATCH_ERROR = '__e';\n\n// VNode properties\nexport const COMPONENT = '__c';\nexport const CHILDREN = '__k';\nexport const PARENT = '__';\nexport const MASK = '__m';\n\n// Component properties\nexport const VNODE = '__v';\nexport const DIRTY = '__d';\nexport const NEXT_STATE = '__s';\nexport const CHILD_DID_SUSPEND = '__c';\n","import {\n\tencodeEntities,\n\tstyleObjToCss,\n\tUNSAFE_NAME,\n\tNAMESPACE_REPLACE_REGEX,\n\tHTML_LOWER_CASE,\n\tSVG_CAMEL_CASE,\n\tcreateComponent\n} from './lib/util.js';\nimport { options, h, Fragment } from 'preact';\nimport {\n\tCHILDREN,\n\tCOMMIT,\n\tCOMPONENT,\n\tDIFF,\n\tDIFFED,\n\tDIRTY,\n\tNEXT_STATE,\n\tPARENT,\n\tRENDER,\n\tSKIP_EFFECTS,\n\tVNODE,\n\tCATCH_ERROR\n} from './lib/constants.js';\n\nconst EMPTY_OBJ = {};\nconst EMPTY_ARR = [];\nconst isArray = Array.isArray;\nconst assign = Object.assign;\nconst EMPTY_STR = '';\n\n// Global state for the current render pass\nlet beforeDiff, afterDiff, renderHook, ummountHook;\n\n/**\n * Render Preact JSX + Components to an HTML string.\n * @param {VNode} vnode\tJSX Element / VNode to render\n * @param {Object} [context={}] Initial root context object\n * @param {RendererState} [_rendererState] for internal use\n * @returns {string} serialized HTML\n */\nexport function renderToString(vnode, context, _rendererState) {\n\t// Performance optimization: `renderToString` is synchronous and we\n\t// therefore don't execute any effects. To do that we pass an empty\n\t// array to `options._commit` (`__c`). But we can go one step further\n\t// and avoid a lot of dirty checks and allocations by setting\n\t// `options._skipEffects` (`__s`) too.\n\tconst previousSkipEffects = options[SKIP_EFFECTS];\n\toptions[SKIP_EFFECTS] = true;\n\n\t// store options hooks once before each synchronous render call\n\tbeforeDiff = options[DIFF];\n\tafterDiff = options[DIFFED];\n\trenderHook = options[RENDER];\n\tummountHook = options.unmount;\n\n\tconst parent = h(Fragment, null);\n\tparent[CHILDREN] = [vnode];\n\n\ttry {\n\t\tconst rendered = _renderToString(\n\t\t\tvnode,\n\t\t\tcontext || EMPTY_OBJ,\n\t\t\tfalse,\n\t\t\tundefined,\n\t\t\tparent,\n\t\t\tfalse,\n\t\t\t_rendererState\n\t\t);\n\n\t\tif (isArray(rendered)) {\n\t\t\treturn rendered.join(EMPTY_STR);\n\t\t}\n\t\treturn rendered;\n\t} catch (e) {\n\t\tif (e.then) {\n\t\t\tthrow new Error('Use \"renderToStringAsync\" for suspenseful rendering.');\n\t\t}\n\n\t\tthrow e;\n\t} finally {\n\t\t// options._commit, we don't schedule any effects in this library right now,\n\t\t// so we can pass an empty queue to this hook.\n\t\tif (options[COMMIT]) options[COMMIT](vnode, EMPTY_ARR);\n\t\toptions[SKIP_EFFECTS] = previousSkipEffects;\n\t\tEMPTY_ARR.length = 0;\n\t}\n}\n\n/**\n * Render Preact JSX + Components to an HTML string.\n * @param {VNode} vnode\tJSX Element / VNode to render\n * @param {Object} [context={}] Initial root context object\n * @returns {string} serialized HTML\n */\nexport async function renderToStringAsync(vnode, context) {\n\t// Performance optimization: `renderToString` is synchronous and we\n\t// therefore don't execute any effects. To do that we pass an empty\n\t// array to `options._commit` (`__c`). But we can go one step further\n\t// and avoid a lot of dirty checks and allocations by setting\n\t// `options._skipEffects` (`__s`) too.\n\tconst previousSkipEffects = options[SKIP_EFFECTS];\n\toptions[SKIP_EFFECTS] = true;\n\n\t// store options hooks once before each synchronous render call\n\tbeforeDiff = options[DIFF];\n\tafterDiff = options[DIFFED];\n\trenderHook = options[RENDER];\n\tummountHook = options.unmount;\n\n\tconst parent = h(Fragment, null);\n\tparent[CHILDREN] = [vnode];\n\n\ttry {\n\t\tconst rendered = await _renderToString(\n\t\t\tvnode,\n\t\t\tcontext || EMPTY_OBJ,\n\t\t\tfalse,\n\t\t\tundefined,\n\t\t\tparent,\n\t\t\ttrue,\n\t\t\tundefined\n\t\t);\n\n\t\tif (isArray(rendered)) {\n\t\t\tlet count = 0;\n\t\t\tlet resolved = rendered;\n\n\t\t\t// Resolving nested Promises with a maximum depth of 25\n\t\t\twhile (\n\t\t\t\tresolved.some(\n\t\t\t\t\t(element) => element && typeof element.then === 'function'\n\t\t\t\t) &&\n\t\t\t\tcount++ < 25\n\t\t\t) {\n\t\t\t\tresolved = (await Promise.all(resolved)).flat();\n\t\t\t}\n\n\t\t\treturn resolved.join(EMPTY_STR);\n\t\t}\n\n\t\treturn rendered;\n\t} finally {\n\t\t// options._commit, we don't schedule any effects in this library right now,\n\t\t// so we can pass an empty queue to this hook.\n\t\tif (options[COMMIT]) options[COMMIT](vnode, EMPTY_ARR);\n\t\toptions[SKIP_EFFECTS] = previousSkipEffects;\n\t\tEMPTY_ARR.length = 0;\n\t}\n}\n\n/**\n * @param {VNode} vnode\n * @param {Record<string, unknown>} context\n */\nfunction renderClassComponent(vnode, context) {\n\tlet type = /** @type {import(\"preact\").ComponentClass<typeof vnode.props>} */ (vnode.type);\n\n\tlet isMounting = true;\n\tlet c;\n\tif (vnode[COMPONENT]) {\n\t\tisMounting = false;\n\t\tc = vnode[COMPONENT];\n\t\tc.state = c[NEXT_STATE];\n\t} else {\n\t\tc = new type(vnode.props, context);\n\t}\n\n\tvnode[COMPONENT] = c;\n\tc[VNODE] = vnode;\n\n\tc.props = vnode.props;\n\tc.context = context;\n\t// turn off stateful re-rendering:\n\tc[DIRTY] = true;\n\n\tif (c.state == null) c.state = EMPTY_OBJ;\n\n\tif (c[NEXT_STATE] == null) {\n\t\tc[NEXT_STATE] = c.state;\n\t}\n\n\tif (type.getDerivedStateFromProps) {\n\t\tc.state = assign(\n\t\t\t{},\n\t\t\tc.state,\n\t\t\ttype.getDerivedStateFromProps(c.props, c.state)\n\t\t);\n\t} else if (isMounting && c.componentWillMount) {\n\t\tc.componentWillMount();\n\n\t\t// If the user called setState in cWM we need to flush pending,\n\t\t// state updates. This is the same behaviour in React.\n\t\tc.state = c[NEXT_STATE] !== c.state ? c[NEXT_STATE] : c.state;\n\t} else if (!isMounting && c.componentWillUpdate) {\n\t\tc.componentWillUpdate();\n\t}\n\n\tif (renderHook) renderHook(vnode);\n\n\treturn c.render(c.props, c.state, context);\n}\n\n/**\n * Recursively render VNodes to HTML.\n * @param {VNode|any} vnode\n * @param {any} context\n * @param {boolean} isSvgMode\n * @param {any} selectValue\n * @param {VNode} parent\n * @param {boolean} asyncMode\n * @param {RendererState | undefined} [renderer]\n * @returns {string | Promise<string> | (string | Promise<string>)[]}\n */\nfunction _renderToString(\n\tvnode,\n\tcontext,\n\tisSvgMode,\n\tselectValue,\n\tparent,\n\tasyncMode,\n\trenderer\n) {\n\t// Ignore non-rendered VNodes/values\n\tif (\n\t\tvnode == null ||\n\t\tvnode === true ||\n\t\tvnode === false ||\n\t\tvnode === EMPTY_STR\n\t) {\n\t\treturn EMPTY_STR;\n\t}\n\n\tlet vnodeType = typeof vnode;\n\t// Text VNodes: escape as HTML\n\tif (vnodeType != 'object') {\n\t\tif (vnodeType == 'function') return EMPTY_STR;\n\t\treturn vnodeType == 'string' ? encodeEntities(vnode) : vnode + EMPTY_STR;\n\t}\n\n\t// Recurse into children / Arrays\n\tif (isArray(vnode)) {\n\t\tlet rendered = EMPTY_STR,\n\t\t\trenderArray;\n\t\tparent[CHILDREN] = vnode;\n\t\tfor (let i = 0; i < vnode.length; i++) {\n\t\t\tlet child = vnode[i];\n\t\t\tif (child == null || typeof child == 'boolean') continue;\n\n\t\t\tconst childRender = _renderToString(\n\t\t\t\tchild,\n\t\t\t\tcontext,\n\t\t\t\tisSvgMode,\n\t\t\t\tselectValue,\n\t\t\t\tparent,\n\t\t\t\tasyncMode,\n\t\t\t\trenderer\n\t\t\t);\n\n\t\t\tif (typeof childRender == 'string') {\n\t\t\t\trendered = rendered + childRender;\n\t\t\t} else {\n\t\t\t\tif (!renderArray) {\n\t\t\t\t\trenderArray = [];\n\t\t\t\t}\n\n\t\t\t\tif (rendered) renderArray.push(rendered);\n\n\t\t\t\trendered = EMPTY_STR;\n\n\t\t\t\tif (isArray(childRender)) {\n\t\t\t\t\trenderArray.push(...childRender);\n\t\t\t\t} else {\n\t\t\t\t\trenderArray.push(childRender);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (renderArray) {\n\t\t\tif (rendered) renderArray.push(rendered);\n\t\t\treturn renderArray;\n\t\t}\n\n\t\treturn rendered;\n\t}\n\n\t// VNodes have {constructor:undefined} to prevent JSON injection:\n\tif (vnode.constructor !== undefined) return EMPTY_STR;\n\n\tvnode[PARENT] = parent;\n\tif (beforeDiff) beforeDiff(vnode);\n\n\tlet type = vnode.type,\n\t\tprops = vnode.props;\n\n\t// Invoke rendering on Components\n\tif (typeof type == 'function') {\n\t\tlet cctx = context,\n\t\t\tcontextType,\n\t\t\trendered,\n\t\t\tcomponent;\n\t\tif (type === Fragment) {\n\t\t\t// Serialized precompiled JSX.\n\t\t\tif ('tpl' in props) {\n\t\t\t\tlet out = EMPTY_STR;\n\t\t\t\tfor (let i = 0; i < props.tpl.length; i++) {\n\t\t\t\t\tout = out + props.tpl[i];\n\n\t\t\t\t\tif (props.exprs && i < props.exprs.length) {\n\t\t\t\t\t\tconst value = props.exprs[i];\n\t\t\t\t\t\tif (value == null) continue;\n\n\t\t\t\t\t\t// Check if we're dealing with a vnode or an array of nodes\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof value == 'object' &&\n\t\t\t\t\t\t\t(value.constructor === undefined || isArray(value))\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tout =\n\t\t\t\t\t\t\t\tout +\n\t\t\t\t\t\t\t\t_renderToString(\n\t\t\t\t\t\t\t\t\tvalue,\n\t\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\t\tisSvgMode,\n\t\t\t\t\t\t\t\t\tselectValue,\n\t\t\t\t\t\t\t\t\tvnode,\n\t\t\t\t\t\t\t\t\tasyncMode,\n\t\t\t\t\t\t\t\t\trenderer\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Values are pre-escaped by the JSX transform\n\t\t\t\t\t\t\tout = out + value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn out;\n\t\t\t} else if ('UNSTABLE_comment' in props) {\n\t\t\t\t// Fragments are the least used components of core that's why\n\t\t\t\t// branching here for comments has the least effect on perf.\n\t\t\t\treturn '<!--' + encodeEntities(props.UNSTABLE_comment) + '-->';\n\t\t\t}\n\n\t\t\trendered = props.children;\n\t\t} else {\n\t\t\tcontextType = type.contextType;\n\t\t\tif (contextType != null) {\n\t\t\t\tlet provider = context[contextType.__c];\n\t\t\t\tcctx = provider ? provider.props.value : contextType.__;\n\t\t\t}\n\n\t\t\tlet isClassComponent =\n\t\t\t\ttype.prototype && typeof type.prototype.render == 'function';\n\t\t\tif (isClassComponent) {\n\t\t\t\trendered = /**#__NOINLINE__**/ renderClassComponent(vnode, cctx);\n\t\t\t\tcomponent = vnode[COMPONENT];\n\t\t\t} else {\n\t\t\t\tvnode[COMPONENT] = component = /**#__NOINLINE__**/ createComponent(\n\t\t\t\t\tvnode,\n\t\t\t\t\tcctx\n\t\t\t\t);\n\n\t\t\t\t// If a hook invokes setState() to invalidate the component during rendering,\n\t\t\t\t// re-render it up to 25 times to allow \"settling\" of memoized states.\n\t\t\t\t// Note:\n\t\t\t\t// This will need to be updated for Preact 11 to use internal.flags rather than component._dirty:\n\t\t\t\t// https://github.com/preactjs/preact/blob/d4ca6fdb19bc715e49fd144e69f7296b2f4daa40/src/diff/component.js#L35-L44\n\t\t\t\tlet count = 0;\n\t\t\t\twhile (component[DIRTY] && count++ < 25) {\n\t\t\t\t\tcomponent[DIRTY] = false;\n\n\t\t\t\t\tif (renderHook) renderHook(vnode);\n\n\t\t\t\t\trendered = type.call(component, props, cctx);\n\t\t\t\t}\n\t\t\t\tcomponent[DIRTY] = true;\n\t\t\t}\n\n\t\t\tif (component.getChildContext != null) {\n\t\t\t\tcontext = assign({}, context, component.getChildContext());\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tisClassComponent &&\n\t\t\t\toptions.errorBoundaries &&\n\t\t\t\t(type.getDerivedStateFromError || component.componentDidCatch)\n\t\t\t) {\n\t\t\t\t// When a component returns a Fragment node we flatten it in core, so we\n\t\t\t\t// need to mirror that logic here too\n\t\t\t\tlet isTopLevelFragment =\n\t\t\t\t\trendered != null &&\n\t\t\t\t\trendered.type === Fragment &&\n\t\t\t\t\trendered.key == null &&\n\t\t\t\t\trendered.props.tpl == null;\n\t\t\t\trendered = isTopLevelFragment ? rendered.props.children : rendered;\n\n\t\t\t\ttry {\n\t\t\t\t\treturn _renderToString(\n\t\t\t\t\t\trendered,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tisSvgMode,\n\t\t\t\t\t\tselectValue,\n\t\t\t\t\t\tvnode,\n\t\t\t\t\t\tasyncMode,\n\t\t\t\t\t\trenderer\n\t\t\t\t\t);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (type.getDerivedStateFromError) {\n\t\t\t\t\t\tcomponent[NEXT_STATE] = type.getDerivedStateFromError(err);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (component.componentDidCatch) {\n\t\t\t\t\t\tcomponent.componentDidCatch(err, EMPTY_OBJ);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (component[DIRTY]) {\n\t\t\t\t\t\trendered = renderClassComponent(vnode, context);\n\t\t\t\t\t\tcomponent = vnode[COMPONENT];\n\n\t\t\t\t\t\tif (component.getChildContext != null) {\n\t\t\t\t\t\t\tcontext = assign({}, context, component.getChildContext());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet isTopLevelFragment =\n\t\t\t\t\t\t\trendered != null &&\n\t\t\t\t\t\t\trendered.type === Fragment &&\n\t\t\t\t\t\t\trendered.key == null &&\n\t\t\t\t\t\t\trendered.props.tpl == null;\n\t\t\t\t\t\trendered = isTopLevelFragment ? rendered.props.children : rendered;\n\n\t\t\t\t\t\treturn _renderToString(\n\t\t\t\t\t\t\trendered,\n\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\tisSvgMode,\n\t\t\t\t\t\t\tselectValue,\n\t\t\t\t\t\t\tvnode,\n\t\t\t\t\t\t\tasyncMode,\n\t\t\t\t\t\t\trenderer\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn EMPTY_STR;\n\t\t\t\t} finally {\n\t\t\t\t\tif (afterDiff) afterDiff(vnode);\n\t\t\t\t\tvnode[PARENT] = null;\n\n\t\t\t\t\tif (ummountHook) ummountHook(vnode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// When a component returns a Fragment node we flatten it in core, so we\n\t\t// need to mirror that logic here too\n\t\tlet isTopLevelFragment =\n\t\t\trendered != null &&\n\t\t\trendered.type === Fragment &&\n\t\t\trendered.key == null &&\n\t\t\trendered.props.tpl == null;\n\t\trendered = isTopLevelFragment ? rendered.props.children : rendered;\n\n\t\ttry {\n\t\t\t// Recurse into children before invoking the after-diff hook\n\t\t\tconst str = _renderToString(\n\t\t\t\trendered,\n\t\t\t\tcontext,\n\t\t\t\tisSvgMode,\n\t\t\t\tselectValue,\n\t\t\t\tvnode,\n\t\t\t\tasyncMode,\n\t\t\t\trenderer\n\t\t\t);\n\n\t\t\tif (afterDiff) afterDiff(vnode);\n\t\t\t// when we are dealing with suspense we can't do this...\n\t\t\tvnode[PARENT] = null;\n\n\t\t\tif (options.unmount) options.unmount(vnode);\n\n\t\t\treturn str;\n\t\t} catch (error) {\n\t\t\tif (!asyncMode && renderer && renderer.onError) {\n\t\t\t\tlet res = renderer.onError(error, vnode, (child) =>\n\t\t\t\t\t_renderToString(\n\t\t\t\t\t\tchild,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tisSvgMode,\n\t\t\t\t\t\tselectValue,\n\t\t\t\t\t\tvnode,\n\t\t\t\t\t\tasyncMode,\n\t\t\t\t\t\trenderer\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t\tif (res !== undefined) return res;\n\n\t\t\t\tlet errorHook = options[CATCH_ERROR];\n\t\t\t\tif (errorHook) errorHook(error, vnode);\n\t\t\t\treturn EMPTY_STR;\n\t\t\t}\n\n\t\t\tif (!asyncMode) throw error;\n\n\t\t\tif (!error || typeof error.then != 'function') throw error;\n\n\t\t\tconst renderNestedChildren = () => {\n\t\t\t\ttry {\n\t\t\t\t\treturn _renderToString(\n\t\t\t\t\t\trendered,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\tisSvgMode,\n\t\t\t\t\t\tselectValue,\n\t\t\t\t\t\tvnode,\n\t\t\t\t\t\tasyncMode,\n\t\t\t\t\t\trenderer\n\t\t\t\t\t);\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (!e || typeof e.then != 'function') throw e;\n\n\t\t\t\t\treturn e.then(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\t_renderToString(\n\t\t\t\t\t\t\t\trendered,\n\t\t\t\t\t\t\t\tcontext,\n\t\t\t\t\t\t\t\tisSvgMode,\n\t\t\t\t\t\t\t\tselectValue,\n\t\t\t\t\t\t\t\tvnode,\n\t\t\t\t\t\t\t\tasyncMode,\n\t\t\t\t\t\t\t\trenderer\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\trenderNestedChildren\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\treturn error.then(renderNestedChildren);\n\t\t}\n\t}\n\n\t// Serialize Element VNodes to HTML\n\tlet s = '<' + type,\n\t\thtml = EMPTY_STR,\n\t\tchildren;\n\n\tfor (let name in props) {\n\t\tlet v = props[name];\n\n\t\tif (typeof v == 'function') continue;\n\n\t\tswitch (name) {\n\t\t\tcase 'children':\n\t\t\t\tchildren = v;\n\t\t\t\tcontinue;\n\n\t\t\t// VDOM-specific props\n\t\t\tcase 'key':\n\t\t\tcase 'ref':\n\t\t\tcase '__self':\n\t\t\tcase '__source':\n\t\t\t\tcontinue;\n\n\t\t\t// prefer for/class over htmlFor/className\n\t\t\tcase 'htmlFor':\n\t\t\t\tif ('for' in props) continue;\n\t\t\t\tname = 'for';\n\t\t\t\tbreak;\n\t\t\tcase 'className':\n\t\t\t\tif ('class' in props) continue;\n\t\t\t\tname = 'class';\n\t\t\t\tbreak;\n\n\t\t\t// Form element reflected properties\n\t\t\tcase 'defaultChecked':\n\t\t\t\tname = 'checked';\n\t\t\t\tbreak;\n\t\t\tcase 'defaultSelected':\n\t\t\t\tname = 'selected';\n\t\t\t\tbreak;\n\n\t\t\t// Special value attribute handling\n\t\t\tcase 'defaultValue':\n\t\t\tcase 'value':\n\t\t\t\tname = 'value';\n\t\t\t\tswitch (type) {\n\t\t\t\t\t// <textarea value=\"a&b\"> --> <textarea>a&amp;b</textarea>\n\t\t\t\t\tcase 'textarea':\n\t\t\t\t\t\tchildren = v;\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t// <select value> is serialized as a selected attribute on the matching option child\n\t\t\t\t\tcase 'select':\n\t\t\t\t\t\tselectValue = v;\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t// Add a selected attribute to <option> if its value matches the parent <select> value\n\t\t\t\t\tcase 'option':\n\t\t\t\t\t\tif (selectValue == v && !('selected' in props)) {\n\t\t\t\t\t\t\ts = s + ' selected';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'dangerouslySetInnerHTML':\n\t\t\t\thtml = v && v.__html;\n\t\t\t\tcontinue;\n\n\t\t\t// serialize object styles to a CSS string\n\t\t\tcase 'style':\n\t\t\t\tif (typeof v === 'object') {\n\t\t\t\t\tv = styleObjToCss(v);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'acceptCharset':\n\t\t\t\tname = 'accept-charset';\n\t\t\t\tbreak;\n\t\t\tcase 'httpEquiv':\n\t\t\t\tname = 'http-equiv';\n\t\t\t\tbreak;\n\n\t\t\tdefault: {\n\t\t\t\tif (NAMESPACE_REPLACE_REGEX.test(name)) {\n\t\t\t\t\tname = name.replace(NAMESPACE_REPLACE_REGEX, '$1:$2').toLowerCase();\n\t\t\t\t} else if (UNSAFE_NAME.test(name)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if ((name[4] === '-' || name === 'draggable') && v != null) {\n\t\t\t\t\t// serialize boolean aria-xyz or draggable attribute values as strings\n\t\t\t\t\t// `draggable` is an enumerated attribute and not Boolean. A value of `true` or `false` is mandatory\n\t\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable\n\t\t\t\t\tv = v + EMPTY_STR;\n\t\t\t\t} else if (isSvgMode) {\n\t\t\t\t\tif (SVG_CAMEL_CASE.test(name)) {\n\t\t\t\t\t\tname =\n\t\t\t\t\t\t\tname === 'panose1'\n\t\t\t\t\t\t\t\t? 'panose-1'\n\t\t\t\t\t\t\t\t: name.replace(/([A-Z])/g, '-$1').toLowerCase();\n\t\t\t\t\t}\n\t\t\t\t} else if (HTML_LOWER_CASE.test(name)) {\n\t\t\t\t\tname = name.toLowerCase();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// write this attribute to the buffer\n\t\tif (v != null && v !== false) {\n\t\t\tif (v === true || v === EMPTY_STR) {\n\t\t\t\ts = s + ' ' + name;\n\t\t\t} else {\n\t\t\t\ts =\n\t\t\t\t\ts +\n\t\t\t\t\t' ' +\n\t\t\t\t\tname +\n\t\t\t\t\t'=\"' +\n\t\t\t\t\t(typeof v == 'string' ? encodeEntities(v) : v + EMPTY_STR) +\n\t\t\t\t\t'\"';\n\t\t\t}\n\t\t}\n\t}\n\n\tif (UNSAFE_NAME.test(type)) {\n\t\t// this seems to performs a lot better than throwing\n\t\t// return '<!-- -->';\n\t\tthrow new Error(`${type} is not a valid HTML tag name in ${s}>`);\n\t}\n\n\tif (html) {\n\t\t// dangerouslySetInnerHTML defined this node's contents\n\t} else if (typeof children === 'string') {\n\t\t// single text child\n\t\thtml = encodeEntities(children);\n\t} else if (children != null && children !== false && children !== true) {\n\t\t// recurse into this element VNode's children\n\t\tlet childSvgMode =\n\t\t\ttype === 'svg' || (type !== 'foreignObject' && isSvgMode);\n\t\thtml = _renderToString(\n\t\t\tchildren,\n\t\t\tcontext,\n\t\t\tchildSvgMode,\n\t\t\tselectValue,\n\t\t\tvnode,\n\t\t\tasyncMode,\n\t\t\trenderer\n\t\t);\n\t}\n\n\tif (afterDiff) afterDiff(vnode);\n\n\t// TODO: this was commented before\n\tvnode[PARENT] = null;\n\n\tif (ummountHook) ummountHook(vnode);\n\n\t// Emit self-closing tag for empty void elements:\n\tif (!html && SELF_CLOSING.has(type)) {\n\t\treturn s + '/>';\n\t}\n\n\tconst endTag = '</' + type + '>';\n\tconst startTag = s + '>';\n\n\tif (isArray(html)) return [startTag, ...html, endTag];\n\telse if (typeof html != 'string') return [startTag, html, endTag];\n\treturn startTag + html + endTag;\n}\n\nconst SELF_CLOSING = new Set([\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr'\n]);\n\nexport default renderToString;\nexport const render = renderToString;\nexport const renderToStaticMarkup = renderToString;\n","/* eslint-disable no-var, key-spacing, object-curly-spacing, prefer-arrow-callback, semi, keyword-spacing */\n\n// function initPreactIslandElement() {\n// \tclass PreactIslandElement extends HTMLElement {\n// \t\tconnectedCallback() {\n// \t\t\tvar d = this;\n// \t\t\tif (!d.isConnected) return;\n\n// \t\t\tlet i = this.getAttribute('data-target');\n// \t\t\tif (!i) return;\n\n// \t\t\tvar s,\n// \t\t\t\te,\n// \t\t\t\tc = document.createNodeIterator(document, 128);\n// \t\t\twhile (c.nextNode()) {\n// \t\t\t\tlet n = c.referenceNode;\n\n// \t\t\t\tif (n.data == 'preact-island:' + i) s = n;\n// \t\t\t\telse if (n.data == '/preact-island:' + i) e = n;\n// \t\t\t\tif (s && e) break;\n// \t\t\t}\n// \t\t\tif (s && e) {\n// \t\t\t\trequestAnimationFrame(() => {\n// \t\t\t\t\tvar p = e.previousSibling;\n// \t\t\t\t\twhile (p != s) {\n// \t\t\t\t\t\tif (!p || p == s) break;\n// \t\t\t\t\t\te.parentNode.removeChild(p);\n// \t\t\t\t\t\tp = e.previousSibling;\n// \t\t\t\t\t}\n\n// \t\t\t\t\tc = s;\n// \t\t\t\t\twhile (d.firstChild) {\n// \t\t\t\t\t\ts = d.firstChild;\n// \t\t\t\t\t\td.removeChild(s);\n// \t\t\t\t\t\tc.after(s);\n// \t\t\t\t\t\tc = s;\n// \t\t\t\t\t}\n\n// \t\t\t\t\td.parentNode.removeChild(d);\n// \t\t\t\t});\n// \t\t\t}\n// \t\t}\n// \t}\n\n// \tcustomElements.define('preact-island', PreactIslandElement);\n// }\n\n// To modify the INIT_SCRIPT, uncomment the above code, modify it, and paste it into https://try.terser.org/.\nconst INIT_SCRIPT = `class e extends HTMLElement{connectedCallback(){var e=this;if(!e.isConnected)return;let t=this.getAttribute(\"data-target\");if(t){for(var r,a,i=document.createNodeIterator(document,128);i.nextNode();){let e=i.referenceNode;if(e.data==\"preact-island:\"+t?r=e:e.data==\"/preact-island:\"+t&&(a=e),r&&a)break}r&&a&&requestAnimationFrame((()=>{for(var t=a.previousSibling;t!=r&&t&&t!=r;)a.parentNode.removeChild(t),t=a.previousSibling;for(i=r;e.firstChild;)r=e.firstChild,e.removeChild(r),i.after(r),i=r;e.parentNode.removeChild(e)}))}}}customElements.define(\"preact-island\",e);`;\n\nexport function createInitScript() {\n\treturn `<script>(function(){${INIT_SCRIPT}}())</script>`;\n}\n\n/**\n * @param {string} id\n * @param {string} content\n * @returns {string}\n */\nexport function createSubtree(id, content) {\n\treturn `<preact-island hidden data-target=\"${id}\">${content}</preact-island>`;\n}\n","import { renderToString } from '../index.js';\nimport { CHILD_DID_SUSPEND, COMPONENT, PARENT } from './constants.js';\nimport { Deferred } from './util.js';\nimport { createInitScript, createSubtree } from './client.js';\n\n/**\n * @param {VNode} vnode\n * @param {RenderToChunksOptions} options\n * @returns {Promise<void>}\n */\nexport async function renderToChunks(vnode, { context, onWrite, abortSignal }) {\n\tcontext = context || {};\n\n\t/** @type {RendererState} */\n\tconst renderer = {\n\t\tstart: Date.now(),\n\t\tabortSignal,\n\t\tonWrite,\n\t\tonError: handleError,\n\t\tsuspended: []\n\t};\n\n\t// Synchronously render the shell\n\t// @ts-ignore - using third internal RendererState argument\n\tconst shell = renderToString(vnode, context, renderer);\n\tonWrite(shell);\n\n\t// Wait for any suspended sub-trees if there are any\n\tconst len = renderer.suspended.length;\n\tif (len > 0) {\n\t\tonWrite('<div hidden>');\n\t\tonWrite(createInitScript(len));\n\t\t// We should keep checking all promises\n\t\tawait forkPromises(renderer);\n\t\tonWrite('</div>');\n\t}\n}\n\nasync function forkPromises(renderer) {\n\tif (renderer.suspended.length > 0) {\n\t\tconst suspensions = [...renderer.suspended];\n\t\tawait Promise.all(renderer.suspended.map((s) => s.promise));\n\t\trenderer.suspended = renderer.suspended.filter(\n\t\t\t(s) => !suspensions.includes(s)\n\t\t);\n\t\tawait forkPromises(renderer);\n\t}\n}\n\n/** @type {RendererErrorHandler} */\nfunction handleError(error, vnode, renderChild) {\n\tif (!error || !error.then) return;\n\n\t// walk up to the Suspense boundary\n\twhile ((vnode = vnode[PARENT])) {\n\t\tlet component = vnode[COMPONENT];\n\t\tif (component && component[CHILD_DID_SUSPEND]) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!vnode) return;\n\n\tconst id = vnode.__v;\n\tconst found = this.suspended.find((x) => x.id === id);\n\tconst race = new Deferred();\n\n\tconst abortSignal = this.abortSignal;\n\tif (abortSignal) {\n\t\t// @ts-ignore 2554 - implicit undefined arg\n\t\tif (abortSignal.aborted) race.resolve();\n\t\telse abortSignal.addEventListener('abort', race.resolve);\n\t}\n\n\tconst promise = error.then(\n\t\t() => {\n\t\t\tif (abortSignal && abortSignal.aborted) return;\n\t\t\tconst child = renderChild(vnode.props.children);\n\t\t\tif (child) this.onWrite(createSubtree(id, child));\n\t\t},\n\t\t// TODO: Abort and send hydration code snippet to client\n\t\t// to attempt to recover during hydration\n\t\tthis.onError\n\t);\n\n\tthis.suspended.push({\n\t\tid,\n\t\tvnode,\n\t\tpromise: Promise.race([promise, race.promise])\n\t});\n\n\tconst fallback = renderChild(vnode.props.fallback);\n\n\treturn found\n\t\t? ''\n\t\t: `<!--preact-island:${id}-->${fallback}<!--/preact-island:${id}-->`;\n}\n","import { PassThrough } from 'node:stream';\nimport { renderToChunks } from './lib/chunked.js';\n\n/**\n * @typedef {object} RenderToPipeableStreamOptions\n * @property {() => void} [onShellReady]\n * @property {() => void} [onAllReady]\n * @property {(error) => void} [onError]\n */\n\n/**\n * @typedef {object} PipeableStream\n * @property {() => void} abort\n * @property {(writable: import('stream').Writable) => void} pipe\n */\n\n/**\n * @param {import('preact').VNode} vnode\n * @param {RenderToPipeableStreamOptions} options\n * @param {any} [context]\n * @returns {PipeableStream}\n */\nexport function renderToPipeableStream(vnode, options, context) {\n\tconst encoder = new TextEncoder('utf-8');\n\n\tconst controller = new AbortController();\n\tconst stream = new PassThrough();\n\n\trenderToChunks(vnode, {\n\t\tcontext,\n\t\tabortSignal: controller.signal,\n\t\tonError: (error) => {\n\t\t\tif (options.onError) {\n\t\t\t\toptions.onError(error);\n\t\t\t}\n\t\t\tcontroller.abort(error);\n\t\t},\n\t\tonWrite(s) {\n\t\t\tstream.write(encoder.encode(s));\n\t\t}\n\t})\n\t\t.then(() => {\n\t\t\toptions.onAllReady && options.onAllReady();\n\t\t\tstream.end();\n\t\t})\n\t\t.catch((error) => {\n\t\t\tstream.destroy(error);\n\t\t});\n\n\tPromise.resolve().then(() => {\n\t\toptions.onShellReady && options.onShellReady();\n\t});\n\n\treturn {\n\t\tabort() {\n\t\t\tcontroller.abort();\n\t\t\tstream.destroy(new Error('aborted'));\n\t\t},\n\t\t/**\n\t\t * @param {import(\"stream\").Writable} writable\n\t\t */\n\t\tpipe(writable) {\n\t\t\tstream.pipe(writable, { end: true });\n\t\t}\n\t};\n}\n"],"names":["UNSAFE_NAME","NAMESPACE_REPLACE_REGEX","HTML_LOWER_CASE","SVG_CAMEL_CASE","ENCODED_ENTITIES","encodeEntities","str","length","test","last","i","out","ch","charCodeAt","slice","JS_TO_CSS","IS_NON_DIMENSIONAL","Set","CSS_REGEX","styleObjToCss","s","prop","val","name","replace","toLowerCase","suffix","startsWith","has","undefined","markAsDirty","__d","createComponent","vnode","context","__v","props","setState","forceUpdate","__h","Array","Deferred","constructor","promise","Promise","resolve","reject","DIFF","RENDER","DIFFED","COMMIT","SKIP_EFFECTS","CATCH_ERROR","COMPONENT","CHILDREN","PARENT","VNODE","DIRTY","NEXT_STATE","CHILD_DID_SUSPEND","EMPTY_OBJ","EMPTY_ARR","isArray","assign","Object","EMPTY_STR","beforeDiff","afterDiff","renderHook","ummountHook","renderToString","_rendererState","previousSkipEffects","options","unmount","parent","h","Fragment","rendered","_renderToString","join","e","then","Error","renderClassComponent","type","isMounting","c","state","getDerivedStateFromProps","componentWillMount","componentWillUpdate","render","isSvgMode","selectValue","asyncMode","renderer","vnodeType","renderArray","child","childRender","push","cctx","contextType","component","tpl","exprs","value","UNSTABLE_comment","children","provider","__c","__","isClassComponent","prototype","count","call","getChildContext","errorBoundaries","getDerivedStateFromError","componentDidCatch","isTopLevelFragment","key","err","error","onError","res","errorHook","renderNestedChildren","html","v","__html","childSvgMode","SELF_CLOSING","endTag","startTag","INIT_SCRIPT","createInitScript","createSubtree","id","content","renderToChunks","onWrite","abortSignal","start","Date","now","handleError","suspended","shell","len","forkPromises","suspensions","all","map","filter","includes","renderChild","found","find","x","race","aborted","addEventListener","fallback","renderToPipeableStream","encoder","TextEncoder","controller","AbortController","stream","PassThrough","signal","abort","write","encode","onAllReady","end","catch","destroy","onShellReady","pipe","writable"],"mappings":";;;;;CACO,MAAMA,WAAW,GAAG,kBAApB;CACA,MAAMC,uBAAuB,GAAG,2BAAhC;CACA,MAAMC,eAAe,GAAG,oKAAxB;CACA,MAAMC,cAAc,GAAG,wQAAvB;;CAGP,MAAMC,gBAAgB,GAAG,OAAzB;CAEA;;CACO,SAASC,cAAT,CAAwBC,GAAxB,EAA6B;CACnC;CACA,MAAIA,GAAG,CAACC,MAAJ,KAAe,CAAf,IAAoBH,gBAAgB,CAACI,IAAjB,CAAsBF,GAAtB,MAA+B,KAAvD,EAA8D,OAAOA,GAAP;CAE9D,MAAIG,IAAI,GAAG,CAAX;CAAA,MACCC,CAAC,GAAG,CADL;CAAA,MAECC,GAAG,GAAG,EAF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,MAAM;CACXT,IAAAA,OAAO,CAACuG,UAAR,IAAsBvG,OAAO,CAACuG,UAAR,EAAtB;CACAN,IAAAA,MAAM,CAACO,GAAP;CACA,GAhBF,EAiBEC,KAjBF,CAiBStD,KAAD,IAAW;CACjB8C,IAAAA,MAAM,CAACS,OAAP,CAAevD,KAAf;CACA,GAnBF;CAqBAhF,EAAAA,OAAO,CAACC,OAAR,GAAkBqC,IAAlB,CAAuB,MAAM;CAC5BT,IAAAA,OAAO,CAAC2G,YAAR,IAAwB3G,OAAO,CAAC2G,YAAR,EAAxB;CACA,GAFD;CAIA,SAAO;CACNP,IAAAA,KAAK,GAAG;CACPL,MAAAA,UAAU,CAACK,KAAX;CACAH,MAAAA,MAAM,CAACS,OAAP,CAAe,IAAIhG,KAAJ,CAAU,SAAV,CAAf;CACA,KAJK;;CAKN;CACF;CACA;CACEkG,IAAAA,IAAI,CAACC,QAAD,EAAW;CACdZ,MAAAA,MAAM,CAACW,IAAP,CAAYC,QAAZ,EAAsB;CAAEL,QAAAA,GAAG,EAAE;CAAP,OAAtB;CACA;;CAVK,GAAP;CAYA;;;;;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "preact-render-to-string",
3
3
  "amdName": "preactRenderToString",
4
- "version": "6.5.6",
4
+ "version": "6.5.8",
5
5
  "description": "Render JSX to an HTML string, with support for Preact components.",
6
6
  "main": "dist/index.js",
7
7
  "umd:main": "dist/index.umd.js",