@devschile/chucao 1.5.2 → 1.6.0

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 (70) hide show
  1. package/dist/chucao/chucao.esm.js +1 -1
  2. package/dist/chucao/{p-ccae6c46.entry.js → p-175aee94.entry.js} +2 -2
  3. package/dist/chucao/{p-669127c4.entry.js → p-85a49fd7.entry.js} +2 -2
  4. package/dist/chucao/p-ImsAHlk9.js +3 -0
  5. package/dist/chucao/p-ImsAHlk9.js.map +1 -0
  6. package/dist/chucao/{p-bd015077.entry.js → p-af2c57b5.entry.js} +2 -2
  7. package/dist/chucao/{p-88824f74.entry.js → p-b4520f1c.entry.js} +2 -2
  8. package/dist/chucao/{p-21fa1897.entry.js → p-d75eeeea.entry.js} +2 -2
  9. package/dist/chucao/{p-5e0ba154.entry.js → p-dde82d7d.entry.js} +2 -2
  10. package/dist/chucao/{p-5df14f4b.entry.js → p-fcc70c8d.entry.js} +2 -2
  11. package/dist/chucao/{p-5c5048cf.entry.js → p-fe0c9320.entry.js} +2 -2
  12. package/dist/cjs/ch-accordion.cjs.entry.js +1 -1
  13. package/dist/cjs/ch-badge_6.cjs.entry.js +1 -1
  14. package/dist/cjs/ch-checkbox.cjs.entry.js +1 -1
  15. package/dist/cjs/ch-divider.cjs.entry.js +1 -1
  16. package/dist/cjs/ch-link.cjs.entry.js +1 -1
  17. package/dist/cjs/ch-radio.cjs.entry.js +1 -1
  18. package/dist/cjs/ch-tabs.cjs.entry.js +1 -1
  19. package/dist/cjs/ch-textarea.cjs.entry.js +1 -1
  20. package/dist/cjs/chucao.cjs.js +1 -1
  21. package/dist/cjs/{index-Ha3VDOML.js → index-CiYvuUBV.js} +680 -21
  22. package/dist/cjs/index-CiYvuUBV.js.map +1 -0
  23. package/dist/cjs/loader.cjs.js +1 -1
  24. package/dist/components/ch-accordion.js +1 -1
  25. package/dist/components/ch-badge.js +1 -1
  26. package/dist/components/ch-button.js +1 -1
  27. package/dist/components/ch-card.js +1 -1
  28. package/dist/components/ch-checkbox.js +1 -1
  29. package/dist/components/ch-divider.js +1 -1
  30. package/dist/components/ch-input.js +1 -1
  31. package/dist/components/ch-link.js +1 -1
  32. package/dist/components/ch-radio.js +1 -1
  33. package/dist/components/ch-select.js +1 -1
  34. package/dist/components/ch-switch.js +1 -1
  35. package/dist/components/ch-tabs.js +1 -1
  36. package/dist/components/ch-textarea.js +1 -1
  37. package/dist/components/index.js +1 -1
  38. package/dist/components/p-x4aZoujY.js +2 -0
  39. package/dist/components/p-x4aZoujY.js.map +1 -0
  40. package/dist/esm/ch-accordion.entry.js +1 -1
  41. package/dist/esm/ch-badge_6.entry.js +1 -1
  42. package/dist/esm/ch-checkbox.entry.js +1 -1
  43. package/dist/esm/ch-divider.entry.js +1 -1
  44. package/dist/esm/ch-link.entry.js +1 -1
  45. package/dist/esm/ch-radio.entry.js +1 -1
  46. package/dist/esm/ch-tabs.entry.js +1 -1
  47. package/dist/esm/ch-textarea.entry.js +1 -1
  48. package/dist/esm/chucao.js +2 -2
  49. package/dist/esm/{index-C_GZnvOi.js → index-ImsAHlk9.js} +680 -21
  50. package/dist/esm/index-ImsAHlk9.js.map +1 -0
  51. package/dist/esm/loader.js +2 -2
  52. package/hydrate/index.d.ts +287 -0
  53. package/hydrate/index.js +24283 -0
  54. package/hydrate/index.mjs +24273 -0
  55. package/hydrate/package.json +12 -0
  56. package/package.json +7 -1
  57. package/dist/chucao/p-C_GZnvOi.js +0 -3
  58. package/dist/chucao/p-C_GZnvOi.js.map +0 -1
  59. package/dist/cjs/index-Ha3VDOML.js.map +0 -1
  60. package/dist/components/p-C3Jfy_hI.js +0 -2
  61. package/dist/components/p-C3Jfy_hI.js.map +0 -1
  62. package/dist/esm/index-C_GZnvOi.js.map +0 -1
  63. /package/dist/chucao/{p-ccae6c46.entry.js.map → p-175aee94.entry.js.map} +0 -0
  64. /package/dist/chucao/{p-669127c4.entry.js.map → p-85a49fd7.entry.js.map} +0 -0
  65. /package/dist/chucao/{p-bd015077.entry.js.map → p-af2c57b5.entry.js.map} +0 -0
  66. /package/dist/chucao/{p-88824f74.entry.js.map → p-b4520f1c.entry.js.map} +0 -0
  67. /package/dist/chucao/{p-21fa1897.entry.js.map → p-d75eeeea.entry.js.map} +0 -0
  68. /package/dist/chucao/{p-5e0ba154.entry.js.map → p-dde82d7d.entry.js.map} +0 -0
  69. /package/dist/chucao/{p-5df14f4b.entry.js.map → p-fcc70c8d.entry.js.map} +0 -0
  70. /package/dist/chucao/{p-5c5048cf.entry.js.map → p-fe0c9320.entry.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const NAMESPACE = 'chucao';
4
- const BUILD = /* chucao */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, prop: true, propChangeCallback: false, updatable: true};
4
+ const BUILD = /* chucao */ { hotModuleReplacement: false, lazyLoad: true, prop: true, propChangeCallback: false, updatable: true};
5
5
 
6
6
  const globalScripts = () => {};
7
7
  const globalStyles = ":root{--color-background-base:#100a1c;--color-background-top-glow:#201e40;--color-background-bottom-glow:#261226;--color-surface-default:rgba(32, 30, 64, 0.6);--color-surface-hover:rgba(45, 212, 191, 0.08);--color-border-default:rgba(255, 255, 255, 0.08);--color-border-hover:rgba(45, 212, 191, 0.3);--color-accent-default:#2dd4bf;--color-accent-hover:#5ee8d4;--color-accent-text:#06210f;--color-status-positive:#4ade80;--color-status-positive-background:rgba(34, 197, 94, 0.18);--color-status-warning:#f87171;--color-status-warning-background:rgba(248, 113, 113, 0.15);--color-text-primary:#ffffff;--color-text-secondary:rgba(255, 255, 255, 0.55);--color-brand-huemul-dark:#85422b;--color-brand-huemul-light:#b45b38;--color-brand-stroke:#1d1d1b;--typography-body:Fira Sans, Droid Sans, Helvetica Neue, sans-serif;--typography-heading:Inconsolata, monospace;--typography-size-xs:0.68rem;--typography-size-sm:0.85rem;--typography-size-md:1rem;--typography-size-lg:1.25rem;--typography-size-xl:1.5rem;--typography-weight-regular:400;--typography-weight-semibold:600;--typography-weight-bold:700;--typography-tracking-badge:0.03em;--spacing-2xs:0.18rem;--spacing-xs:0.25rem;--spacing-sm:0.35rem;--spacing-md:0.5rem;--spacing-lg:0.6rem;--spacing-xl:0.8rem;--spacing-2xl:1rem;--spacing-3xl:1.25rem;--spacing-4xl:1.35rem;--spacing-5xl:1.5rem;--spacing-6xl:2rem;--spacing-shift:2px;--spacing-elevate:1px;--radius-sm:6px;--radius-md:8px;--radius-pill:999px;--border-width:1px;--border-accent-bar:3px;--shadow-focus-ring:0 0 0 3px rgba(45, 212, 191, 0.12);--shadow-card-hover:0 4px 20px rgba(45, 212, 191, 0.06);--effect-blur:10px;--duration-fast:150ms;--duration-normal:200ms;--easing-default:ease;--focus-outline-width:2px;--focus-outline-offset:2px;--opacity-disabled:0.5;--z-index-base:0;--z-index-dropdown:100;--z-index-modal:1000;--layout-max-width:68rem}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:400;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-400-normal.woff2') format('woff2')}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:600;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-600-normal.woff2') format('woff2')}@font-face{font-family:'Fira Sans';font-style:normal;font-weight:700;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/fira-sans-latin-700-normal.woff2') format('woff2')}@font-face{font-family:'Inconsolata';font-style:normal;font-weight:400;font-display:swap;src:url('https://static.devschile.cl/chucao/fonts/inconsolata-latin-400-normal.woff2') format('woff2')}:root{--bg:var(--color-background-base);--bg-gradient:radial-gradient(50% 30% ellipse at center top, var(--color-background-top-glow) 0%, rgba(0, 0, 0, 0) 100%),\n radial-gradient(60% 50% ellipse at center bottom, var(--color-background-bottom-glow) 0%, var(--color-background-base) 100%);--surface:var(--color-surface-default);--surface-hover:var(--color-surface-hover);--border:var(--color-border-default);--border-hover:var(--color-border-hover);--text:var(--color-text-primary);--text-muted:var(--color-text-secondary);--accent:var(--color-accent-default);--accent-hover:var(--color-accent-hover);--font-body:var(--typography-body);--font-heading:var(--typography-heading);--radius:var(--radius-sm)}body{font-family:var(--font-body)}.ch-container{width:100%;max-width:var(--layout-max-width);margin-inline:auto}.ch-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.ch-flex{display:flex}.ch-flex-col{display:flex;flex-direction:column}.ch-items-center{align-items:center}.ch-justify-center{justify-content:center}.ch-justify-between{justify-content:space-between}.ch-gap-sm{gap:var(--spacing-md)}.ch-gap-md{gap:var(--spacing-2xl)}.ch-text-center{text-align:center}.ch-text-primary{color:var(--text)}.ch-text-muted{color:var(--text-muted)}.ch-text-accent{color:var(--accent)}.ch-heading{font-family:var(--font-heading)}";
@@ -10,6 +10,30 @@ const globalStyles = ":root{--color-background-base:#100a1c;--color-background-t
10
10
  Stencil Client Platform v4.43.5 | MIT Licensed | https://stenciljs.com
11
11
  */
12
12
 
13
+ var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
14
+ PrimitiveType2["Undefined"] = "undefined";
15
+ PrimitiveType2["Null"] = "null";
16
+ PrimitiveType2["String"] = "string";
17
+ PrimitiveType2["Number"] = "number";
18
+ PrimitiveType2["SpecialNumber"] = "number";
19
+ PrimitiveType2["Boolean"] = "boolean";
20
+ PrimitiveType2["BigInt"] = "bigint";
21
+ return PrimitiveType2;
22
+ })(PrimitiveType || {});
23
+ var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
24
+ NonPrimitiveType2["Array"] = "array";
25
+ NonPrimitiveType2["Date"] = "date";
26
+ NonPrimitiveType2["Map"] = "map";
27
+ NonPrimitiveType2["Object"] = "object";
28
+ NonPrimitiveType2["RegularExpression"] = "regexp";
29
+ NonPrimitiveType2["Set"] = "set";
30
+ NonPrimitiveType2["Channel"] = "channel";
31
+ NonPrimitiveType2["Symbol"] = "symbol";
32
+ return NonPrimitiveType2;
33
+ })(NonPrimitiveType || {});
34
+ var TYPE_CONSTANT = "type";
35
+ var VALUE_CONSTANT = "value";
36
+ var SERIALIZED_PREFIX = "serialized:";
13
37
 
14
38
  // src/utils/get-prop-descriptor.ts
15
39
  function getPropertyDescriptor(obj, memberName, getOnly) {
@@ -124,7 +148,16 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
124
148
 
125
149
  // src/client/client-style.ts
126
150
  var styles = /* @__PURE__ */ new Map();
127
- var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
151
+
152
+ // src/runtime/runtime-constants.ts
153
+ var CONTENT_REF_ID = "r";
154
+ var ORG_LOCATION_ID = "o";
155
+ var SLOT_NODE_ID = "s";
156
+ var TEXT_NODE_ID = "t";
157
+ var COMMENT_NODE_ID = "c";
158
+ var HYDRATE_ID = "s-id";
159
+ var HYDRATED_STYLE_ID = "sty-id";
160
+ var HYDRATE_CHILD_ID = "c-id";
128
161
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
129
162
  var win = typeof window !== "undefined" ? window : {};
130
163
  var plt = {
@@ -212,6 +245,82 @@ function createShadowRoot(cmpMeta) {
212
245
  shadowRoot.prepend(styleElm);
213
246
  }
214
247
  }
248
+ var getSlottedChildNodes = (childNodes) => {
249
+ const result = [];
250
+ for (let i2 = 0; i2 < childNodes.length; i2++) {
251
+ const slottedNode = childNodes[i2]["s-nr"] || void 0;
252
+ if (slottedNode && slottedNode.isConnected) {
253
+ result.push(slottedNode);
254
+ }
255
+ }
256
+ return result;
257
+ };
258
+ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
259
+ if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
260
+ return;
261
+ }
262
+ const slottedNodeLocation = document.createTextNode("");
263
+ slottedNodeLocation["s-nr"] = newChild;
264
+ if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
265
+ const parent = slotNode["s-cr"].parentNode;
266
+ const appendMethod = internalCall(parent, "appendChild");
267
+ if (typeof position !== "undefined") {
268
+ slottedNodeLocation["s-oo"] = position;
269
+ const childNodes = internalCall(parent, "childNodes");
270
+ const slotRelocateNodes = [slottedNodeLocation];
271
+ childNodes.forEach((n) => {
272
+ if (n["s-nr"]) slotRelocateNodes.push(n);
273
+ });
274
+ slotRelocateNodes.sort((a, b) => {
275
+ if (!a["s-oo"] || a["s-oo"] < (b["s-oo"] || 0)) return -1;
276
+ else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
277
+ return 0;
278
+ });
279
+ slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
280
+ } else {
281
+ appendMethod.call(parent, slottedNodeLocation);
282
+ }
283
+ newChild["s-ol"] = slottedNodeLocation;
284
+ newChild["s-sh"] = slotNode["s-hn"];
285
+ };
286
+ var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
287
+ function patchSlotNode(node) {
288
+ if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
289
+ const assignedFactory = (elementsOnly) => (function(opts) {
290
+ const toReturn = [];
291
+ const slotName = this["s-sn"];
292
+ if (opts == null ? void 0 : opts.flatten) {
293
+ console.error(`
294
+ Flattening is not supported for Stencil non-shadow slots.
295
+ You can use \`.childNodes\` to nested slot fallback content.
296
+ If you have a particular use case, please open an issue on the Stencil repo.
297
+ `);
298
+ }
299
+ const parent = this["s-cr"].parentElement;
300
+ const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
301
+ slottedNodes.forEach((n) => {
302
+ if (slotName === getSlotName(n)) {
303
+ toReturn.push(n);
304
+ }
305
+ });
306
+ if (elementsOnly) {
307
+ return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
308
+ }
309
+ return toReturn;
310
+ }).bind(node);
311
+ node.assignedElements = assignedFactory(true);
312
+ node.assignedNodes = assignedFactory(false);
313
+ }
314
+ function internalCall(node, method) {
315
+ if ("__" + method in node) {
316
+ const toReturn = node["__" + method];
317
+ if (typeof toReturn !== "function") return toReturn;
318
+ return toReturn.bind(node);
319
+ } else {
320
+ if (typeof node[method] !== "function") return node[method];
321
+ return node[method].bind(node);
322
+ }
323
+ }
215
324
  var createTime = (fnName, tagName = "") => {
216
325
  {
217
326
  return () => {
@@ -265,7 +374,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
265
374
  if (!appliedStyles) {
266
375
  rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
267
376
  }
268
- if (!appliedStyles.has(scopeId2)) {
377
+ const existingStyleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
378
+ if (existingStyleElm) {
379
+ existingStyleElm.textContent = style;
380
+ } else if (!appliedStyles.has(scopeId2)) {
269
381
  styleElm = win.document.createElement("style");
270
382
  styleElm.textContent = style;
271
383
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
@@ -334,6 +446,12 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
334
446
  styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
335
447
  }
336
448
  appliedStyles.add(scopeId2);
449
+ if ("host" in styleContainerNode) {
450
+ const ssrStyleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
451
+ if (ssrStyleElm) {
452
+ writeTask(() => ssrStyleElm.remove());
453
+ }
454
+ }
337
455
  }
338
456
  }
339
457
  }
@@ -354,6 +472,17 @@ var attachStyles = (hostRef) => {
354
472
  endAttachStyles();
355
473
  };
356
474
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
475
+ var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
476
+ var hydrateScopedToShadow = () => {
477
+ if (!win.document) {
478
+ return;
479
+ }
480
+ const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
481
+ let i2 = 0;
482
+ for (; i2 < styles2.length; i2++) {
483
+ registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
484
+ }
485
+ };
357
486
  var isComplexType = (o) => {
358
487
  o = typeof o;
359
488
  return o === "object" || o === "function";
@@ -429,8 +558,511 @@ var newVNode = (tag, text) => {
429
558
  var Host = {};
430
559
  var isHost = (node) => node && node.$tag$ === Host;
431
560
 
561
+ // src/runtime/client-hydrate.ts
562
+ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
563
+ var _a, _b, _c, _d;
564
+ const endHydrate = createTime("hydrateClient", tagName);
565
+ const shadowRoot = hostElm.shadowRoot;
566
+ const childRenderNodes = [];
567
+ const slotNodes = [];
568
+ const slottedNodes = [];
569
+ const shadowRootNodes = shadowRoot ? [] : null;
570
+ const vnode = newVNode(tagName, null);
571
+ vnode.$elm$ = hostElm;
572
+ if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
573
+ initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
574
+ }
575
+ hostElm[HYDRATE_ID] = hostId;
576
+ hostElm.removeAttribute(HYDRATE_ID);
577
+ hostRef.$vnode$ = clientHydrate(
578
+ vnode,
579
+ childRenderNodes,
580
+ slotNodes,
581
+ shadowRootNodes,
582
+ hostElm,
583
+ hostElm,
584
+ hostId,
585
+ slottedNodes
586
+ );
587
+ let crIndex = 0;
588
+ const crLength = childRenderNodes.length;
589
+ let childRenderNode;
590
+ for (crIndex; crIndex < crLength; crIndex++) {
591
+ childRenderNode = childRenderNodes[crIndex];
592
+ const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
593
+ const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
594
+ const node = childRenderNode.$elm$;
595
+ if (!shadowRoot) {
596
+ node["s-hn"] = transformTag(tagName).toUpperCase();
597
+ if (childRenderNode.$tag$ === "slot") {
598
+ node["s-cr"] = hostElm["s-cr"];
599
+ }
600
+ } else if (((_a = childRenderNode.$tag$) == null ? void 0 : _a.toString().includes("-")) && childRenderNode.$tag$ !== "slot-fb" && !childRenderNode.$elm$.shadowRoot) {
601
+ const cmpMeta = getHostRef(childRenderNode.$elm$);
602
+ if (cmpMeta) {
603
+ const scopeId3 = getScopeId(
604
+ cmpMeta.$cmpMeta$);
605
+ const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
606
+ if (styleSheet) {
607
+ shadowRootNodes.unshift(styleSheet.cloneNode(true));
608
+ }
609
+ }
610
+ }
611
+ if (childRenderNode.$tag$ === "slot") {
612
+ childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
613
+ if (childRenderNode.$children$) {
614
+ childRenderNode.$flags$ |= 2 /* isSlotFallback */;
615
+ if (!childRenderNode.$elm$.childNodes.length) {
616
+ childRenderNode.$children$.forEach((c) => {
617
+ childRenderNode.$elm$.appendChild(c.$elm$);
618
+ });
619
+ }
620
+ } else {
621
+ childRenderNode.$flags$ |= 1 /* isSlotReference */;
622
+ }
623
+ }
624
+ if (orgLocationNode && orgLocationNode.isConnected) {
625
+ if (orgLocationNode.parentElement.shadowRoot && orgLocationNode["s-en"] === "") {
626
+ orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
627
+ }
628
+ orgLocationNode.parentNode.removeChild(orgLocationNode);
629
+ if (!shadowRoot) {
630
+ node["s-oo"] = parseInt(childRenderNode.$nodeId$);
631
+ }
632
+ }
633
+ if (orgLocationNode && !orgLocationNode["s-id"]) {
634
+ plt.$orgLocNodes$.delete(orgLocationId);
635
+ }
636
+ }
637
+ const hosts = [];
638
+ const snLen = slottedNodes.length;
639
+ let snIndex = 0;
640
+ let slotGroup;
641
+ let snGroupIdx;
642
+ let snGroupLen;
643
+ let slottedItem;
644
+ let currentPos = 0;
645
+ for (snIndex; snIndex < snLen; snIndex++) {
646
+ slotGroup = slottedNodes[snIndex];
647
+ if (!slotGroup || !slotGroup.length) continue;
648
+ snGroupLen = slotGroup.length;
649
+ snGroupIdx = 0;
650
+ for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
651
+ slottedItem = slotGroup[snGroupIdx];
652
+ if (!hosts[slottedItem.hostId]) {
653
+ hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
654
+ }
655
+ if (!hosts[slottedItem.hostId]) continue;
656
+ const hostEle = hosts[slottedItem.hostId];
657
+ if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
658
+ hostEle.insertBefore(slottedItem.node, (_c = (_b = slotGroup[snGroupIdx - 1]) == null ? void 0 : _b.node) == null ? void 0 : _c.nextSibling);
659
+ }
660
+ if (!hostEle.shadowRoot || !shadowRoot) {
661
+ if (!slottedItem.slot["s-cr"]) {
662
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
663
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
664
+ slottedItem.slot["s-cr"] = hostEle;
665
+ } else {
666
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
667
+ }
668
+ }
669
+ addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"] || currentPos);
670
+ if (((_d = slottedItem.node.parentElement) == null ? void 0 : _d.shadowRoot) && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) {
671
+ slottedItem.node.removeAttribute("slot");
672
+ }
673
+ }
674
+ currentPos = (slottedItem.node["s-oo"] || currentPos) + 1;
675
+ }
676
+ }
677
+ if (shadowRoot && !shadowRoot.childNodes.length) {
678
+ let rnIdex = 0;
679
+ const rnLen = shadowRootNodes.length;
680
+ if (rnLen) {
681
+ for (rnIdex; rnIdex < rnLen; rnIdex++) {
682
+ const node = shadowRootNodes[rnIdex];
683
+ if (node) {
684
+ shadowRoot.appendChild(node);
685
+ }
686
+ }
687
+ Array.from(hostElm.childNodes).forEach((node) => {
688
+ if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
689
+ if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
690
+ node.removeAttribute("hidden");
691
+ } else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue) {
692
+ node.parentNode.removeChild(node);
693
+ }
694
+ }
695
+ });
696
+ }
697
+ }
698
+ hostRef.$hostElement$ = hostElm;
699
+ endHydrate();
700
+ };
701
+ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
702
+ let childNodeType;
703
+ let childIdSplt;
704
+ let childVNode;
705
+ let i2;
706
+ if (node.nodeType === 1 /* ElementNode */) {
707
+ childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
708
+ if (childNodeType) {
709
+ childIdSplt = childNodeType.split(".");
710
+ if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
711
+ childVNode = createSimpleVNode({
712
+ $flags$: 0,
713
+ $hostId$: childIdSplt[0],
714
+ $nodeId$: childIdSplt[1],
715
+ $depth$: childIdSplt[2],
716
+ $index$: childIdSplt[3],
717
+ $tag$: node.tagName.toLowerCase(),
718
+ $elm$: node,
719
+ // If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
720
+ // won't try to reconcile them. Classes set on the node will be blown away.
721
+ $attrs$: { class: node.className || "" }
722
+ });
723
+ childRenderNodes.push(childVNode);
724
+ node.removeAttribute(HYDRATE_CHILD_ID);
725
+ if (!parentVNode.$children$) {
726
+ parentVNode.$children$ = [];
727
+ }
728
+ const slotName = childVNode.$elm$.getAttribute("s-sn");
729
+ if (typeof slotName === "string") {
730
+ if (childVNode.$tag$ === "slot-fb") {
731
+ addSlot(
732
+ slotName,
733
+ childIdSplt[2],
734
+ childVNode,
735
+ node,
736
+ parentVNode,
737
+ childRenderNodes,
738
+ slotNodes,
739
+ shadowRootNodes,
740
+ slottedNodes
741
+ );
742
+ }
743
+ childVNode.$elm$["s-sn"] = slotName;
744
+ childVNode.$elm$.removeAttribute("s-sn");
745
+ }
746
+ if (childVNode.$index$ !== void 0) {
747
+ parentVNode.$children$[childVNode.$index$] = childVNode;
748
+ }
749
+ parentVNode = childVNode;
750
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
751
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
752
+ }
753
+ }
754
+ }
755
+ if (node.shadowRoot) {
756
+ for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
757
+ clientHydrate(
758
+ parentVNode,
759
+ childRenderNodes,
760
+ slotNodes,
761
+ shadowRootNodes,
762
+ hostElm,
763
+ node.shadowRoot.childNodes[i2],
764
+ hostId,
765
+ slottedNodes
766
+ );
767
+ }
768
+ }
769
+ const nonShadowNodes = node.__childNodes || node.childNodes;
770
+ for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
771
+ clientHydrate(
772
+ parentVNode,
773
+ childRenderNodes,
774
+ slotNodes,
775
+ shadowRootNodes,
776
+ hostElm,
777
+ nonShadowNodes[i2],
778
+ hostId,
779
+ slottedNodes
780
+ );
781
+ }
782
+ } else if (node.nodeType === 8 /* CommentNode */) {
783
+ childIdSplt = node.nodeValue.split(".");
784
+ if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
785
+ childNodeType = childIdSplt[0];
786
+ childVNode = createSimpleVNode({
787
+ $hostId$: childIdSplt[1],
788
+ $nodeId$: childIdSplt[2],
789
+ $depth$: childIdSplt[3],
790
+ $index$: childIdSplt[4] || "0",
791
+ $elm$: node,
792
+ $attrs$: null,
793
+ $children$: null,
794
+ $key$: null,
795
+ $name$: null,
796
+ $tag$: null,
797
+ $text$: null
798
+ });
799
+ if (childNodeType === TEXT_NODE_ID) {
800
+ childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);
801
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
802
+ childVNode.$text$ = childVNode.$elm$.textContent;
803
+ childRenderNodes.push(childVNode);
804
+ node.remove();
805
+ if (hostId === childVNode.$hostId$) {
806
+ if (!parentVNode.$children$) {
807
+ parentVNode.$children$ = [];
808
+ }
809
+ parentVNode.$children$[childVNode.$index$] = childVNode;
810
+ }
811
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
812
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
813
+ }
814
+ }
815
+ } else if (childNodeType === COMMENT_NODE_ID) {
816
+ childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);
817
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
818
+ childRenderNodes.push(childVNode);
819
+ node.remove();
820
+ }
821
+ } else if (childVNode.$hostId$ === hostId) {
822
+ if (childNodeType === SLOT_NODE_ID) {
823
+ const slotName = node["s-sn"] = childIdSplt[5] || "";
824
+ addSlot(
825
+ slotName,
826
+ childIdSplt[2],
827
+ childVNode,
828
+ node,
829
+ parentVNode,
830
+ childRenderNodes,
831
+ slotNodes,
832
+ shadowRootNodes,
833
+ slottedNodes
834
+ );
835
+ } else if (childNodeType === CONTENT_REF_ID) {
836
+ if (shadowRootNodes) {
837
+ node.remove();
838
+ }
839
+ }
840
+ }
841
+ }
842
+ } else if (parentVNode && parentVNode.$tag$ === "style") {
843
+ const vnode = newVNode(null, node.textContent);
844
+ vnode.$elm$ = node;
845
+ vnode.$index$ = "0";
846
+ parentVNode.$children$ = [vnode];
847
+ }
848
+ return parentVNode;
849
+ };
850
+ var initializeDocumentHydrate = (node, orgLocNodes) => {
851
+ if (node.nodeType === 1 /* ElementNode */) {
852
+ const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
853
+ if (componentId) {
854
+ orgLocNodes.set(componentId, node);
855
+ }
856
+ let i2 = 0;
857
+ if (node.shadowRoot) {
858
+ for (; i2 < node.shadowRoot.childNodes.length; i2++) {
859
+ initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
860
+ }
861
+ }
862
+ const nonShadowNodes = node.__childNodes || node.childNodes;
863
+ for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
864
+ initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
865
+ }
866
+ } else if (node.nodeType === 8 /* CommentNode */) {
867
+ const childIdSplt = node.nodeValue.split(".");
868
+ if (childIdSplt[0] === ORG_LOCATION_ID) {
869
+ orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
870
+ node.nodeValue = "";
871
+ node["s-en"] = childIdSplt[3];
872
+ }
873
+ }
874
+ };
875
+ var createSimpleVNode = (vnode) => {
876
+ const defaultVNode = {
877
+ $flags$: 0,
878
+ $hostId$: null,
879
+ $nodeId$: null,
880
+ $depth$: null,
881
+ $index$: "0",
882
+ $elm$: null,
883
+ $attrs$: null,
884
+ $children$: null,
885
+ $key$: null,
886
+ $name$: null,
887
+ $tag$: null,
888
+ $text$: null
889
+ };
890
+ return { ...defaultVNode, ...vnode };
891
+ };
892
+ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
893
+ node["s-sr"] = true;
894
+ childVNode.$name$ = slotName || null;
895
+ childVNode.$tag$ = "slot";
896
+ const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
897
+ if (shadowRootNodes && win.document) {
898
+ const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
899
+ if (childVNode.$name$) {
900
+ childVNode.$elm$.setAttribute("name", slotName);
901
+ }
902
+ if (parentVNode.$elm$.shadowRoot && parentNodeId && parentNodeId !== childVNode.$hostId$) {
903
+ internalCall(parentVNode.$elm$, "insertBefore")(slot, internalCall(parentVNode.$elm$, "children")[0]);
904
+ } else {
905
+ internalCall(internalCall(node, "parentNode"), "insertBefore")(slot, node);
906
+ }
907
+ addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
908
+ node.remove();
909
+ if (childVNode.$depth$ === "0") {
910
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
911
+ }
912
+ } else {
913
+ const slot = childVNode.$elm$;
914
+ const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
915
+ addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
916
+ patchSlotNode(node);
917
+ if (shouldMove) {
918
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
919
+ }
920
+ }
921
+ childRenderNodes.push(childVNode);
922
+ slotNodes.push(childVNode);
923
+ if (!parentVNode.$children$) {
924
+ parentVNode.$children$ = [];
925
+ }
926
+ parentVNode.$children$[childVNode.$index$] = childVNode;
927
+ }
928
+ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
929
+ var _a, _b;
930
+ let slottedNode = slotNode.nextSibling;
931
+ slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
932
+ if (!slottedNode || ((_a = slottedNode.nodeValue) == null ? void 0 : _a.startsWith(SLOT_NODE_ID + "."))) return;
933
+ do {
934
+ if (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (!slottedNode["getAttribute"] || !slottedNode.getAttribute("slot")) && (slottedNode.nodeType === 8 /* CommentNode */ || slottedNode.nodeType === 3 /* TextNode */))) {
935
+ slottedNode["s-sn"] = slotName;
936
+ slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
937
+ }
938
+ slottedNode = slottedNode == null ? void 0 : slottedNode.nextSibling;
939
+ } while (slottedNode && !((_b = slottedNode.nodeValue) == null ? void 0 : _b.startsWith(SLOT_NODE_ID + ".")));
940
+ };
941
+ var findCorrespondingNode = (node, type) => {
942
+ let sibling = node;
943
+ do {
944
+ sibling = sibling.nextSibling;
945
+ } while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
946
+ return sibling;
947
+ };
948
+
949
+ // src/utils/remote-value.ts
950
+ var RemoteValue = class _RemoteValue {
951
+ /**
952
+ * Deserializes a LocalValue serialized object back to its original JavaScript representation
953
+ *
954
+ * @param serialized The serialized LocalValue object
955
+ * @returns The original JavaScript value/object
956
+ */
957
+ static fromLocalValue(serialized) {
958
+ const type = serialized[TYPE_CONSTANT];
959
+ const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
960
+ switch (type) {
961
+ case "string" /* String */:
962
+ return value;
963
+ case "boolean" /* Boolean */:
964
+ return value;
965
+ case "bigint" /* BigInt */:
966
+ return BigInt(value);
967
+ case "undefined" /* Undefined */:
968
+ return void 0;
969
+ case "null" /* Null */:
970
+ return null;
971
+ case "number" /* Number */:
972
+ if (value === "NaN") return NaN;
973
+ if (value === "-0") return -0;
974
+ if (value === "Infinity") return Infinity;
975
+ if (value === "-Infinity") return -Infinity;
976
+ return value;
977
+ case "array" /* Array */:
978
+ return value.map((item) => _RemoteValue.fromLocalValue(item));
979
+ case "date" /* Date */:
980
+ return new Date(value);
981
+ case "map" /* Map */:
982
+ const map = /* @__PURE__ */ new Map();
983
+ for (const [key, val] of value) {
984
+ const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
985
+ const deserializedValue = _RemoteValue.fromLocalValue(val);
986
+ map.set(deserializedKey, deserializedValue);
987
+ }
988
+ return map;
989
+ case "object" /* Object */:
990
+ const obj = {};
991
+ for (const [key, val] of value) {
992
+ obj[key] = _RemoteValue.fromLocalValue(val);
993
+ }
994
+ return obj;
995
+ case "regexp" /* RegularExpression */:
996
+ const { pattern, flags } = value;
997
+ return new RegExp(pattern, flags);
998
+ case "set" /* Set */:
999
+ const set = /* @__PURE__ */ new Set();
1000
+ for (const item of value) {
1001
+ set.add(_RemoteValue.fromLocalValue(item));
1002
+ }
1003
+ return set;
1004
+ case "symbol" /* Symbol */:
1005
+ return Symbol(value);
1006
+ default:
1007
+ throw new Error(`Unsupported type: ${type}`);
1008
+ }
1009
+ }
1010
+ /**
1011
+ * Utility method to deserialize multiple LocalValues at once
1012
+ *
1013
+ * @param serializedValues Array of serialized LocalValue objects
1014
+ * @returns Array of deserialized JavaScript values
1015
+ */
1016
+ static fromLocalValueArray(serializedValues) {
1017
+ return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
1018
+ }
1019
+ /**
1020
+ * Verifies if the given object matches the structure of a serialized LocalValue
1021
+ *
1022
+ * @param obj Object to verify
1023
+ * @returns boolean indicating if the object has LocalValue structure
1024
+ */
1025
+ static isLocalValueObject(obj) {
1026
+ if (typeof obj !== "object" || obj === null) {
1027
+ return false;
1028
+ }
1029
+ if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
1030
+ return false;
1031
+ }
1032
+ const type = obj[TYPE_CONSTANT];
1033
+ const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
1034
+ if (!hasTypeProperty) {
1035
+ return false;
1036
+ }
1037
+ if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
1038
+ return obj.hasOwnProperty(VALUE_CONSTANT);
1039
+ }
1040
+ return true;
1041
+ }
1042
+ };
1043
+
1044
+ // src/utils/serialize.ts
1045
+ function decodeBase64Unicode(base64) {
1046
+ const binary = atob(base64);
1047
+ const bytes = new Uint8Array(binary.length);
1048
+ for (let i2 = 0; i2 < binary.length; i2++) {
1049
+ bytes[i2] = binary.charCodeAt(i2);
1050
+ }
1051
+ return new TextDecoder().decode(bytes);
1052
+ }
1053
+ function deserializeProperty(value) {
1054
+ if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
1055
+ return value;
1056
+ }
1057
+ return RemoteValue.fromLocalValue(JSON.parse(decodeBase64Unicode(value.slice(SERIALIZED_PREFIX.length))));
1058
+ }
1059
+
432
1060
  // src/runtime/parse-property-value.ts
433
1061
  var parsePropertyValue = (propValue, propType, isFormAssociated) => {
1062
+ if (typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
1063
+ propValue = deserializeProperty(propValue);
1064
+ return propValue;
1065
+ }
434
1066
  if (propValue != null && !isComplexType(propValue)) {
435
1067
  if (propType & 4 /* Boolean */) {
436
1068
  {
@@ -481,7 +1113,15 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
481
1113
  const classList = elm.classList;
482
1114
  const oldClasses = parseClassList(oldValue);
483
1115
  let newClasses = parseClassList(newValue);
484
- {
1116
+ if ((elm["s-si"] || elm["s-sc"]) && initialRender) {
1117
+ const scopeId2 = elm["s-sc"] || elm["s-si"];
1118
+ newClasses.push(scopeId2);
1119
+ oldClasses.forEach((c) => {
1120
+ if (c.startsWith(scopeId2)) newClasses.push(c);
1121
+ });
1122
+ newClasses = [...new Set(newClasses)].filter((c) => c);
1123
+ classList.add(...newClasses);
1124
+ } else {
485
1125
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
486
1126
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
487
1127
  }
@@ -599,7 +1239,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
599
1239
  oldVnodeAttrs[memberName],
600
1240
  void 0,
601
1241
  isSvgMode2,
602
- newVnode.$flags$);
1242
+ newVnode.$flags$,
1243
+ isInitialRender
1244
+ );
603
1245
  }
604
1246
  }
605
1247
  }
@@ -610,7 +1252,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
610
1252
  oldVnodeAttrs[memberName],
611
1253
  newVnodeAttrs[memberName],
612
1254
  isSvgMode2,
613
- newVnode.$flags$);
1255
+ newVnode.$flags$,
1256
+ isInitialRender
1257
+ );
614
1258
  }
615
1259
  };
616
1260
  function sortedAttrNames(attrNames) {
@@ -818,7 +1462,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
818
1462
  relocateToHostRoot(newVNode2.$elm$.parentElement);
819
1463
  }
820
1464
  }
821
- updateElement(oldVNode, newVNode2, isSvgMode);
1465
+ updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
822
1466
  }
823
1467
  if (oldChildren !== null && newChildren !== null) {
824
1468
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
@@ -832,7 +1476,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
832
1476
  !isInitialRender && BUILD.updatable && oldChildren !== null
833
1477
  ) {
834
1478
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
835
- } else ;
1479
+ } else if (isInitialRender && BUILD.updatable && oldChildren !== null && newChildren === null) {
1480
+ newVNode2.$children$ = oldChildren;
1481
+ }
836
1482
  } else if (oldVNode.$text$ !== text) {
837
1483
  elm.data = text;
838
1484
  }
@@ -1008,9 +1654,6 @@ var postUpdateComponent = (hostRef) => {
1008
1654
  safeCall(instance, "componentDidRender", void 0, elm);
1009
1655
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1010
1656
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1011
- {
1012
- addHydratedFlag(elm);
1013
- }
1014
1657
  safeCall(instance, "componentDidLoad", void 0, elm);
1015
1658
  endPostUpdate();
1016
1659
  {
@@ -1035,7 +1678,13 @@ var postUpdateComponent = (hostRef) => {
1035
1678
  }
1036
1679
  };
1037
1680
  var appDidLoad = (who) => {
1681
+ var _a;
1038
1682
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
1683
+ {
1684
+ if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
1685
+ plt.$orgLocNodes$.clear();
1686
+ }
1687
+ }
1039
1688
  };
1040
1689
  var safeCall = (instance, method, arg, elm) => {
1041
1690
  if (instance && instance[method]) {
@@ -1047,10 +1696,6 @@ var safeCall = (instance, method, arg, elm) => {
1047
1696
  }
1048
1697
  return void 0;
1049
1698
  };
1050
- var addHydratedFlag = (elm) => {
1051
- var _a;
1052
- return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
1053
- };
1054
1699
 
1055
1700
  // src/runtime/set-value.ts
1056
1701
  var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
@@ -1317,10 +1962,21 @@ var connectedCallback = (elm) => {
1317
1962
  const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
1318
1963
  if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1319
1964
  hostRef.$flags$ |= 1 /* hasConnected */;
1965
+ let hostId;
1966
+ {
1967
+ hostId = elm.getAttribute(HYDRATE_ID);
1968
+ if (hostId) {
1969
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1970
+ const scopeId2 = addStyle(elm.shadowRoot, cmpMeta);
1971
+ elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
1972
+ }
1973
+ initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
1974
+ }
1975
+ }
1320
1976
  {
1321
1977
  let ancestorComponent = elm;
1322
1978
  while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
1323
- if (ancestorComponent["s-p"]) {
1979
+ if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
1324
1980
  attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
1325
1981
  break;
1326
1982
  }
@@ -1389,6 +2045,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1389
2045
  let isBootstrapping = true;
1390
2046
  Object.assign(plt, options);
1391
2047
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
2048
+ {
2049
+ plt.$flags$ |= 2 /* appLoaded */;
2050
+ }
2051
+ {
2052
+ hydrateScopedToShadow();
2053
+ }
1392
2054
  lazyBundles.map((lazyBundle) => {
1393
2055
  lazyBundle[1].map((compactMeta) => {
1394
2056
  const cmpMeta = {
@@ -1475,9 +2137,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1475
2137
  });
1476
2138
  });
1477
2139
  if (cmpTags.length > 0) {
1478
- {
1479
- dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
1480
- }
1481
2140
  if (dataStyles.innerHTML.length) {
1482
2141
  dataStyles.setAttribute("data-styles", "");
1483
2142
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
@@ -1512,6 +2171,6 @@ exports.h = h;
1512
2171
  exports.promiseResolve = promiseResolve;
1513
2172
  exports.registerInstance = registerInstance;
1514
2173
  exports.setNonce = setNonce;
1515
- //# sourceMappingURL=index-Ha3VDOML.js.map
2174
+ //# sourceMappingURL=index-CiYvuUBV.js.map
1516
2175
 
1517
- //# sourceMappingURL=index-Ha3VDOML.js.map
2176
+ //# sourceMappingURL=index-CiYvuUBV.js.map