@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,5 +1,5 @@
1
1
  const NAMESPACE = 'chucao';
2
- const BUILD = /* chucao */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, prop: true, propChangeCallback: false, updatable: true};
2
+ const BUILD = /* chucao */ { hotModuleReplacement: false, lazyLoad: true, prop: true, propChangeCallback: false, updatable: true};
3
3
 
4
4
  const globalScripts = () => {};
5
5
  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)}";
@@ -8,6 +8,30 @@ const globalStyles = ":root{--color-background-base:#100a1c;--color-background-t
8
8
  Stencil Client Platform v4.43.5 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
 
11
+ var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
12
+ PrimitiveType2["Undefined"] = "undefined";
13
+ PrimitiveType2["Null"] = "null";
14
+ PrimitiveType2["String"] = "string";
15
+ PrimitiveType2["Number"] = "number";
16
+ PrimitiveType2["SpecialNumber"] = "number";
17
+ PrimitiveType2["Boolean"] = "boolean";
18
+ PrimitiveType2["BigInt"] = "bigint";
19
+ return PrimitiveType2;
20
+ })(PrimitiveType || {});
21
+ var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
22
+ NonPrimitiveType2["Array"] = "array";
23
+ NonPrimitiveType2["Date"] = "date";
24
+ NonPrimitiveType2["Map"] = "map";
25
+ NonPrimitiveType2["Object"] = "object";
26
+ NonPrimitiveType2["RegularExpression"] = "regexp";
27
+ NonPrimitiveType2["Set"] = "set";
28
+ NonPrimitiveType2["Channel"] = "channel";
29
+ NonPrimitiveType2["Symbol"] = "symbol";
30
+ return NonPrimitiveType2;
31
+ })(NonPrimitiveType || {});
32
+ var TYPE_CONSTANT = "type";
33
+ var VALUE_CONSTANT = "value";
34
+ var SERIALIZED_PREFIX = "serialized:";
11
35
 
12
36
  // src/utils/get-prop-descriptor.ts
13
37
  function getPropertyDescriptor(obj, memberName, getOnly) {
@@ -122,7 +146,16 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
122
146
 
123
147
  // src/client/client-style.ts
124
148
  var styles = /* @__PURE__ */ new Map();
125
- var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
149
+
150
+ // src/runtime/runtime-constants.ts
151
+ var CONTENT_REF_ID = "r";
152
+ var ORG_LOCATION_ID = "o";
153
+ var SLOT_NODE_ID = "s";
154
+ var TEXT_NODE_ID = "t";
155
+ var COMMENT_NODE_ID = "c";
156
+ var HYDRATE_ID = "s-id";
157
+ var HYDRATED_STYLE_ID = "sty-id";
158
+ var HYDRATE_CHILD_ID = "c-id";
126
159
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
127
160
  var win = typeof window !== "undefined" ? window : {};
128
161
  var plt = {
@@ -210,6 +243,82 @@ function createShadowRoot(cmpMeta) {
210
243
  shadowRoot.prepend(styleElm);
211
244
  }
212
245
  }
246
+ var getSlottedChildNodes = (childNodes) => {
247
+ const result = [];
248
+ for (let i2 = 0; i2 < childNodes.length; i2++) {
249
+ const slottedNode = childNodes[i2]["s-nr"] || void 0;
250
+ if (slottedNode && slottedNode.isConnected) {
251
+ result.push(slottedNode);
252
+ }
253
+ }
254
+ return result;
255
+ };
256
+ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
257
+ if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
258
+ return;
259
+ }
260
+ const slottedNodeLocation = document.createTextNode("");
261
+ slottedNodeLocation["s-nr"] = newChild;
262
+ if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
263
+ const parent = slotNode["s-cr"].parentNode;
264
+ const appendMethod = internalCall(parent, "appendChild");
265
+ if (typeof position !== "undefined") {
266
+ slottedNodeLocation["s-oo"] = position;
267
+ const childNodes = internalCall(parent, "childNodes");
268
+ const slotRelocateNodes = [slottedNodeLocation];
269
+ childNodes.forEach((n) => {
270
+ if (n["s-nr"]) slotRelocateNodes.push(n);
271
+ });
272
+ slotRelocateNodes.sort((a, b) => {
273
+ if (!a["s-oo"] || a["s-oo"] < (b["s-oo"] || 0)) return -1;
274
+ else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
275
+ return 0;
276
+ });
277
+ slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
278
+ } else {
279
+ appendMethod.call(parent, slottedNodeLocation);
280
+ }
281
+ newChild["s-ol"] = slottedNodeLocation;
282
+ newChild["s-sh"] = slotNode["s-hn"];
283
+ };
284
+ var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
285
+ function patchSlotNode(node) {
286
+ if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
287
+ const assignedFactory = (elementsOnly) => (function(opts) {
288
+ const toReturn = [];
289
+ const slotName = this["s-sn"];
290
+ if (opts == null ? void 0 : opts.flatten) {
291
+ console.error(`
292
+ Flattening is not supported for Stencil non-shadow slots.
293
+ You can use \`.childNodes\` to nested slot fallback content.
294
+ If you have a particular use case, please open an issue on the Stencil repo.
295
+ `);
296
+ }
297
+ const parent = this["s-cr"].parentElement;
298
+ const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
299
+ slottedNodes.forEach((n) => {
300
+ if (slotName === getSlotName(n)) {
301
+ toReturn.push(n);
302
+ }
303
+ });
304
+ if (elementsOnly) {
305
+ return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
306
+ }
307
+ return toReturn;
308
+ }).bind(node);
309
+ node.assignedElements = assignedFactory(true);
310
+ node.assignedNodes = assignedFactory(false);
311
+ }
312
+ function internalCall(node, method) {
313
+ if ("__" + method in node) {
314
+ const toReturn = node["__" + method];
315
+ if (typeof toReturn !== "function") return toReturn;
316
+ return toReturn.bind(node);
317
+ } else {
318
+ if (typeof node[method] !== "function") return node[method];
319
+ return node[method].bind(node);
320
+ }
321
+ }
213
322
  var createTime = (fnName, tagName = "") => {
214
323
  {
215
324
  return () => {
@@ -263,7 +372,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
263
372
  if (!appliedStyles) {
264
373
  rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
265
374
  }
266
- if (!appliedStyles.has(scopeId2)) {
375
+ const existingStyleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
376
+ if (existingStyleElm) {
377
+ existingStyleElm.textContent = style;
378
+ } else if (!appliedStyles.has(scopeId2)) {
267
379
  styleElm = win.document.createElement("style");
268
380
  styleElm.textContent = style;
269
381
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
@@ -332,6 +444,12 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
332
444
  styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
333
445
  }
334
446
  appliedStyles.add(scopeId2);
447
+ if ("host" in styleContainerNode) {
448
+ const ssrStyleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`);
449
+ if (ssrStyleElm) {
450
+ writeTask(() => ssrStyleElm.remove());
451
+ }
452
+ }
335
453
  }
336
454
  }
337
455
  }
@@ -352,6 +470,17 @@ var attachStyles = (hostRef) => {
352
470
  endAttachStyles();
353
471
  };
354
472
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
473
+ var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
474
+ var hydrateScopedToShadow = () => {
475
+ if (!win.document) {
476
+ return;
477
+ }
478
+ const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
479
+ let i2 = 0;
480
+ for (; i2 < styles2.length; i2++) {
481
+ registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
482
+ }
483
+ };
355
484
  var isComplexType = (o) => {
356
485
  o = typeof o;
357
486
  return o === "object" || o === "function";
@@ -427,8 +556,511 @@ var newVNode = (tag, text) => {
427
556
  var Host = {};
428
557
  var isHost = (node) => node && node.$tag$ === Host;
429
558
 
559
+ // src/runtime/client-hydrate.ts
560
+ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
561
+ var _a, _b, _c, _d;
562
+ const endHydrate = createTime("hydrateClient", tagName);
563
+ const shadowRoot = hostElm.shadowRoot;
564
+ const childRenderNodes = [];
565
+ const slotNodes = [];
566
+ const slottedNodes = [];
567
+ const shadowRootNodes = shadowRoot ? [] : null;
568
+ const vnode = newVNode(tagName, null);
569
+ vnode.$elm$ = hostElm;
570
+ if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
571
+ initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
572
+ }
573
+ hostElm[HYDRATE_ID] = hostId;
574
+ hostElm.removeAttribute(HYDRATE_ID);
575
+ hostRef.$vnode$ = clientHydrate(
576
+ vnode,
577
+ childRenderNodes,
578
+ slotNodes,
579
+ shadowRootNodes,
580
+ hostElm,
581
+ hostElm,
582
+ hostId,
583
+ slottedNodes
584
+ );
585
+ let crIndex = 0;
586
+ const crLength = childRenderNodes.length;
587
+ let childRenderNode;
588
+ for (crIndex; crIndex < crLength; crIndex++) {
589
+ childRenderNode = childRenderNodes[crIndex];
590
+ const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
591
+ const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
592
+ const node = childRenderNode.$elm$;
593
+ if (!shadowRoot) {
594
+ node["s-hn"] = transformTag(tagName).toUpperCase();
595
+ if (childRenderNode.$tag$ === "slot") {
596
+ node["s-cr"] = hostElm["s-cr"];
597
+ }
598
+ } else if (((_a = childRenderNode.$tag$) == null ? void 0 : _a.toString().includes("-")) && childRenderNode.$tag$ !== "slot-fb" && !childRenderNode.$elm$.shadowRoot) {
599
+ const cmpMeta = getHostRef(childRenderNode.$elm$);
600
+ if (cmpMeta) {
601
+ const scopeId3 = getScopeId(
602
+ cmpMeta.$cmpMeta$);
603
+ const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
604
+ if (styleSheet) {
605
+ shadowRootNodes.unshift(styleSheet.cloneNode(true));
606
+ }
607
+ }
608
+ }
609
+ if (childRenderNode.$tag$ === "slot") {
610
+ childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
611
+ if (childRenderNode.$children$) {
612
+ childRenderNode.$flags$ |= 2 /* isSlotFallback */;
613
+ if (!childRenderNode.$elm$.childNodes.length) {
614
+ childRenderNode.$children$.forEach((c) => {
615
+ childRenderNode.$elm$.appendChild(c.$elm$);
616
+ });
617
+ }
618
+ } else {
619
+ childRenderNode.$flags$ |= 1 /* isSlotReference */;
620
+ }
621
+ }
622
+ if (orgLocationNode && orgLocationNode.isConnected) {
623
+ if (orgLocationNode.parentElement.shadowRoot && orgLocationNode["s-en"] === "") {
624
+ orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
625
+ }
626
+ orgLocationNode.parentNode.removeChild(orgLocationNode);
627
+ if (!shadowRoot) {
628
+ node["s-oo"] = parseInt(childRenderNode.$nodeId$);
629
+ }
630
+ }
631
+ if (orgLocationNode && !orgLocationNode["s-id"]) {
632
+ plt.$orgLocNodes$.delete(orgLocationId);
633
+ }
634
+ }
635
+ const hosts = [];
636
+ const snLen = slottedNodes.length;
637
+ let snIndex = 0;
638
+ let slotGroup;
639
+ let snGroupIdx;
640
+ let snGroupLen;
641
+ let slottedItem;
642
+ let currentPos = 0;
643
+ for (snIndex; snIndex < snLen; snIndex++) {
644
+ slotGroup = slottedNodes[snIndex];
645
+ if (!slotGroup || !slotGroup.length) continue;
646
+ snGroupLen = slotGroup.length;
647
+ snGroupIdx = 0;
648
+ for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
649
+ slottedItem = slotGroup[snGroupIdx];
650
+ if (!hosts[slottedItem.hostId]) {
651
+ hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
652
+ }
653
+ if (!hosts[slottedItem.hostId]) continue;
654
+ const hostEle = hosts[slottedItem.hostId];
655
+ if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
656
+ hostEle.insertBefore(slottedItem.node, (_c = (_b = slotGroup[snGroupIdx - 1]) == null ? void 0 : _b.node) == null ? void 0 : _c.nextSibling);
657
+ }
658
+ if (!hostEle.shadowRoot || !shadowRoot) {
659
+ if (!slottedItem.slot["s-cr"]) {
660
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
661
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
662
+ slottedItem.slot["s-cr"] = hostEle;
663
+ } else {
664
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
665
+ }
666
+ }
667
+ addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"] || currentPos);
668
+ if (((_d = slottedItem.node.parentElement) == null ? void 0 : _d.shadowRoot) && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) {
669
+ slottedItem.node.removeAttribute("slot");
670
+ }
671
+ }
672
+ currentPos = (slottedItem.node["s-oo"] || currentPos) + 1;
673
+ }
674
+ }
675
+ if (shadowRoot && !shadowRoot.childNodes.length) {
676
+ let rnIdex = 0;
677
+ const rnLen = shadowRootNodes.length;
678
+ if (rnLen) {
679
+ for (rnIdex; rnIdex < rnLen; rnIdex++) {
680
+ const node = shadowRootNodes[rnIdex];
681
+ if (node) {
682
+ shadowRoot.appendChild(node);
683
+ }
684
+ }
685
+ Array.from(hostElm.childNodes).forEach((node) => {
686
+ if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
687
+ if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
688
+ node.removeAttribute("hidden");
689
+ } else if (node.nodeType === 8 /* CommentNode */ && !node.nodeValue) {
690
+ node.parentNode.removeChild(node);
691
+ }
692
+ }
693
+ });
694
+ }
695
+ }
696
+ hostRef.$hostElement$ = hostElm;
697
+ endHydrate();
698
+ };
699
+ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
700
+ let childNodeType;
701
+ let childIdSplt;
702
+ let childVNode;
703
+ let i2;
704
+ if (node.nodeType === 1 /* ElementNode */) {
705
+ childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
706
+ if (childNodeType) {
707
+ childIdSplt = childNodeType.split(".");
708
+ if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
709
+ childVNode = createSimpleVNode({
710
+ $flags$: 0,
711
+ $hostId$: childIdSplt[0],
712
+ $nodeId$: childIdSplt[1],
713
+ $depth$: childIdSplt[2],
714
+ $index$: childIdSplt[3],
715
+ $tag$: node.tagName.toLowerCase(),
716
+ $elm$: node,
717
+ // If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
718
+ // won't try to reconcile them. Classes set on the node will be blown away.
719
+ $attrs$: { class: node.className || "" }
720
+ });
721
+ childRenderNodes.push(childVNode);
722
+ node.removeAttribute(HYDRATE_CHILD_ID);
723
+ if (!parentVNode.$children$) {
724
+ parentVNode.$children$ = [];
725
+ }
726
+ const slotName = childVNode.$elm$.getAttribute("s-sn");
727
+ if (typeof slotName === "string") {
728
+ if (childVNode.$tag$ === "slot-fb") {
729
+ addSlot(
730
+ slotName,
731
+ childIdSplt[2],
732
+ childVNode,
733
+ node,
734
+ parentVNode,
735
+ childRenderNodes,
736
+ slotNodes,
737
+ shadowRootNodes,
738
+ slottedNodes
739
+ );
740
+ }
741
+ childVNode.$elm$["s-sn"] = slotName;
742
+ childVNode.$elm$.removeAttribute("s-sn");
743
+ }
744
+ if (childVNode.$index$ !== void 0) {
745
+ parentVNode.$children$[childVNode.$index$] = childVNode;
746
+ }
747
+ parentVNode = childVNode;
748
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
749
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
750
+ }
751
+ }
752
+ }
753
+ if (node.shadowRoot) {
754
+ for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
755
+ clientHydrate(
756
+ parentVNode,
757
+ childRenderNodes,
758
+ slotNodes,
759
+ shadowRootNodes,
760
+ hostElm,
761
+ node.shadowRoot.childNodes[i2],
762
+ hostId,
763
+ slottedNodes
764
+ );
765
+ }
766
+ }
767
+ const nonShadowNodes = node.__childNodes || node.childNodes;
768
+ for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
769
+ clientHydrate(
770
+ parentVNode,
771
+ childRenderNodes,
772
+ slotNodes,
773
+ shadowRootNodes,
774
+ hostElm,
775
+ nonShadowNodes[i2],
776
+ hostId,
777
+ slottedNodes
778
+ );
779
+ }
780
+ } else if (node.nodeType === 8 /* CommentNode */) {
781
+ childIdSplt = node.nodeValue.split(".");
782
+ if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
783
+ childNodeType = childIdSplt[0];
784
+ childVNode = createSimpleVNode({
785
+ $hostId$: childIdSplt[1],
786
+ $nodeId$: childIdSplt[2],
787
+ $depth$: childIdSplt[3],
788
+ $index$: childIdSplt[4] || "0",
789
+ $elm$: node,
790
+ $attrs$: null,
791
+ $children$: null,
792
+ $key$: null,
793
+ $name$: null,
794
+ $tag$: null,
795
+ $text$: null
796
+ });
797
+ if (childNodeType === TEXT_NODE_ID) {
798
+ childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);
799
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
800
+ childVNode.$text$ = childVNode.$elm$.textContent;
801
+ childRenderNodes.push(childVNode);
802
+ node.remove();
803
+ if (hostId === childVNode.$hostId$) {
804
+ if (!parentVNode.$children$) {
805
+ parentVNode.$children$ = [];
806
+ }
807
+ parentVNode.$children$[childVNode.$index$] = childVNode;
808
+ }
809
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
810
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
811
+ }
812
+ }
813
+ } else if (childNodeType === COMMENT_NODE_ID) {
814
+ childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);
815
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
816
+ childRenderNodes.push(childVNode);
817
+ node.remove();
818
+ }
819
+ } else if (childVNode.$hostId$ === hostId) {
820
+ if (childNodeType === SLOT_NODE_ID) {
821
+ const slotName = node["s-sn"] = childIdSplt[5] || "";
822
+ addSlot(
823
+ slotName,
824
+ childIdSplt[2],
825
+ childVNode,
826
+ node,
827
+ parentVNode,
828
+ childRenderNodes,
829
+ slotNodes,
830
+ shadowRootNodes,
831
+ slottedNodes
832
+ );
833
+ } else if (childNodeType === CONTENT_REF_ID) {
834
+ if (shadowRootNodes) {
835
+ node.remove();
836
+ }
837
+ }
838
+ }
839
+ }
840
+ } else if (parentVNode && parentVNode.$tag$ === "style") {
841
+ const vnode = newVNode(null, node.textContent);
842
+ vnode.$elm$ = node;
843
+ vnode.$index$ = "0";
844
+ parentVNode.$children$ = [vnode];
845
+ }
846
+ return parentVNode;
847
+ };
848
+ var initializeDocumentHydrate = (node, orgLocNodes) => {
849
+ if (node.nodeType === 1 /* ElementNode */) {
850
+ const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
851
+ if (componentId) {
852
+ orgLocNodes.set(componentId, node);
853
+ }
854
+ let i2 = 0;
855
+ if (node.shadowRoot) {
856
+ for (; i2 < node.shadowRoot.childNodes.length; i2++) {
857
+ initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
858
+ }
859
+ }
860
+ const nonShadowNodes = node.__childNodes || node.childNodes;
861
+ for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
862
+ initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
863
+ }
864
+ } else if (node.nodeType === 8 /* CommentNode */) {
865
+ const childIdSplt = node.nodeValue.split(".");
866
+ if (childIdSplt[0] === ORG_LOCATION_ID) {
867
+ orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
868
+ node.nodeValue = "";
869
+ node["s-en"] = childIdSplt[3];
870
+ }
871
+ }
872
+ };
873
+ var createSimpleVNode = (vnode) => {
874
+ const defaultVNode = {
875
+ $flags$: 0,
876
+ $hostId$: null,
877
+ $nodeId$: null,
878
+ $depth$: null,
879
+ $index$: "0",
880
+ $elm$: null,
881
+ $attrs$: null,
882
+ $children$: null,
883
+ $key$: null,
884
+ $name$: null,
885
+ $tag$: null,
886
+ $text$: null
887
+ };
888
+ return { ...defaultVNode, ...vnode };
889
+ };
890
+ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
891
+ node["s-sr"] = true;
892
+ childVNode.$name$ = slotName || null;
893
+ childVNode.$tag$ = "slot";
894
+ const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
895
+ if (shadowRootNodes && win.document) {
896
+ const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
897
+ if (childVNode.$name$) {
898
+ childVNode.$elm$.setAttribute("name", slotName);
899
+ }
900
+ if (parentVNode.$elm$.shadowRoot && parentNodeId && parentNodeId !== childVNode.$hostId$) {
901
+ internalCall(parentVNode.$elm$, "insertBefore")(slot, internalCall(parentVNode.$elm$, "children")[0]);
902
+ } else {
903
+ internalCall(internalCall(node, "parentNode"), "insertBefore")(slot, node);
904
+ }
905
+ addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
906
+ node.remove();
907
+ if (childVNode.$depth$ === "0") {
908
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
909
+ }
910
+ } else {
911
+ const slot = childVNode.$elm$;
912
+ const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
913
+ addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
914
+ patchSlotNode(node);
915
+ if (shouldMove) {
916
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
917
+ }
918
+ }
919
+ childRenderNodes.push(childVNode);
920
+ slotNodes.push(childVNode);
921
+ if (!parentVNode.$children$) {
922
+ parentVNode.$children$ = [];
923
+ }
924
+ parentVNode.$children$[childVNode.$index$] = childVNode;
925
+ }
926
+ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
927
+ var _a, _b;
928
+ let slottedNode = slotNode.nextSibling;
929
+ slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
930
+ if (!slottedNode || ((_a = slottedNode.nodeValue) == null ? void 0 : _a.startsWith(SLOT_NODE_ID + "."))) return;
931
+ do {
932
+ 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 */))) {
933
+ slottedNode["s-sn"] = slotName;
934
+ slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
935
+ }
936
+ slottedNode = slottedNode == null ? void 0 : slottedNode.nextSibling;
937
+ } while (slottedNode && !((_b = slottedNode.nodeValue) == null ? void 0 : _b.startsWith(SLOT_NODE_ID + ".")));
938
+ };
939
+ var findCorrespondingNode = (node, type) => {
940
+ let sibling = node;
941
+ do {
942
+ sibling = sibling.nextSibling;
943
+ } while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
944
+ return sibling;
945
+ };
946
+
947
+ // src/utils/remote-value.ts
948
+ var RemoteValue = class _RemoteValue {
949
+ /**
950
+ * Deserializes a LocalValue serialized object back to its original JavaScript representation
951
+ *
952
+ * @param serialized The serialized LocalValue object
953
+ * @returns The original JavaScript value/object
954
+ */
955
+ static fromLocalValue(serialized) {
956
+ const type = serialized[TYPE_CONSTANT];
957
+ const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
958
+ switch (type) {
959
+ case "string" /* String */:
960
+ return value;
961
+ case "boolean" /* Boolean */:
962
+ return value;
963
+ case "bigint" /* BigInt */:
964
+ return BigInt(value);
965
+ case "undefined" /* Undefined */:
966
+ return void 0;
967
+ case "null" /* Null */:
968
+ return null;
969
+ case "number" /* Number */:
970
+ if (value === "NaN") return NaN;
971
+ if (value === "-0") return -0;
972
+ if (value === "Infinity") return Infinity;
973
+ if (value === "-Infinity") return -Infinity;
974
+ return value;
975
+ case "array" /* Array */:
976
+ return value.map((item) => _RemoteValue.fromLocalValue(item));
977
+ case "date" /* Date */:
978
+ return new Date(value);
979
+ case "map" /* Map */:
980
+ const map = /* @__PURE__ */ new Map();
981
+ for (const [key, val] of value) {
982
+ const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
983
+ const deserializedValue = _RemoteValue.fromLocalValue(val);
984
+ map.set(deserializedKey, deserializedValue);
985
+ }
986
+ return map;
987
+ case "object" /* Object */:
988
+ const obj = {};
989
+ for (const [key, val] of value) {
990
+ obj[key] = _RemoteValue.fromLocalValue(val);
991
+ }
992
+ return obj;
993
+ case "regexp" /* RegularExpression */:
994
+ const { pattern, flags } = value;
995
+ return new RegExp(pattern, flags);
996
+ case "set" /* Set */:
997
+ const set = /* @__PURE__ */ new Set();
998
+ for (const item of value) {
999
+ set.add(_RemoteValue.fromLocalValue(item));
1000
+ }
1001
+ return set;
1002
+ case "symbol" /* Symbol */:
1003
+ return Symbol(value);
1004
+ default:
1005
+ throw new Error(`Unsupported type: ${type}`);
1006
+ }
1007
+ }
1008
+ /**
1009
+ * Utility method to deserialize multiple LocalValues at once
1010
+ *
1011
+ * @param serializedValues Array of serialized LocalValue objects
1012
+ * @returns Array of deserialized JavaScript values
1013
+ */
1014
+ static fromLocalValueArray(serializedValues) {
1015
+ return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
1016
+ }
1017
+ /**
1018
+ * Verifies if the given object matches the structure of a serialized LocalValue
1019
+ *
1020
+ * @param obj Object to verify
1021
+ * @returns boolean indicating if the object has LocalValue structure
1022
+ */
1023
+ static isLocalValueObject(obj) {
1024
+ if (typeof obj !== "object" || obj === null) {
1025
+ return false;
1026
+ }
1027
+ if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
1028
+ return false;
1029
+ }
1030
+ const type = obj[TYPE_CONSTANT];
1031
+ const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
1032
+ if (!hasTypeProperty) {
1033
+ return false;
1034
+ }
1035
+ if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
1036
+ return obj.hasOwnProperty(VALUE_CONSTANT);
1037
+ }
1038
+ return true;
1039
+ }
1040
+ };
1041
+
1042
+ // src/utils/serialize.ts
1043
+ function decodeBase64Unicode(base64) {
1044
+ const binary = atob(base64);
1045
+ const bytes = new Uint8Array(binary.length);
1046
+ for (let i2 = 0; i2 < binary.length; i2++) {
1047
+ bytes[i2] = binary.charCodeAt(i2);
1048
+ }
1049
+ return new TextDecoder().decode(bytes);
1050
+ }
1051
+ function deserializeProperty(value) {
1052
+ if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
1053
+ return value;
1054
+ }
1055
+ return RemoteValue.fromLocalValue(JSON.parse(decodeBase64Unicode(value.slice(SERIALIZED_PREFIX.length))));
1056
+ }
1057
+
430
1058
  // src/runtime/parse-property-value.ts
431
1059
  var parsePropertyValue = (propValue, propType, isFormAssociated) => {
1060
+ if (typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
1061
+ propValue = deserializeProperty(propValue);
1062
+ return propValue;
1063
+ }
432
1064
  if (propValue != null && !isComplexType(propValue)) {
433
1065
  if (propType & 4 /* Boolean */) {
434
1066
  {
@@ -479,7 +1111,15 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
479
1111
  const classList = elm.classList;
480
1112
  const oldClasses = parseClassList(oldValue);
481
1113
  let newClasses = parseClassList(newValue);
482
- {
1114
+ if ((elm["s-si"] || elm["s-sc"]) && initialRender) {
1115
+ const scopeId2 = elm["s-sc"] || elm["s-si"];
1116
+ newClasses.push(scopeId2);
1117
+ oldClasses.forEach((c) => {
1118
+ if (c.startsWith(scopeId2)) newClasses.push(c);
1119
+ });
1120
+ newClasses = [...new Set(newClasses)].filter((c) => c);
1121
+ classList.add(...newClasses);
1122
+ } else {
483
1123
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
484
1124
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
485
1125
  }
@@ -597,7 +1237,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
597
1237
  oldVnodeAttrs[memberName],
598
1238
  void 0,
599
1239
  isSvgMode2,
600
- newVnode.$flags$);
1240
+ newVnode.$flags$,
1241
+ isInitialRender
1242
+ );
601
1243
  }
602
1244
  }
603
1245
  }
@@ -608,7 +1250,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
608
1250
  oldVnodeAttrs[memberName],
609
1251
  newVnodeAttrs[memberName],
610
1252
  isSvgMode2,
611
- newVnode.$flags$);
1253
+ newVnode.$flags$,
1254
+ isInitialRender
1255
+ );
612
1256
  }
613
1257
  };
614
1258
  function sortedAttrNames(attrNames) {
@@ -816,7 +1460,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
816
1460
  relocateToHostRoot(newVNode2.$elm$.parentElement);
817
1461
  }
818
1462
  }
819
- updateElement(oldVNode, newVNode2, isSvgMode);
1463
+ updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
820
1464
  }
821
1465
  if (oldChildren !== null && newChildren !== null) {
822
1466
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
@@ -830,7 +1474,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
830
1474
  !isInitialRender && BUILD.updatable && oldChildren !== null
831
1475
  ) {
832
1476
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
833
- } else ;
1477
+ } else if (isInitialRender && BUILD.updatable && oldChildren !== null && newChildren === null) {
1478
+ newVNode2.$children$ = oldChildren;
1479
+ }
834
1480
  } else if (oldVNode.$text$ !== text) {
835
1481
  elm.data = text;
836
1482
  }
@@ -1006,9 +1652,6 @@ var postUpdateComponent = (hostRef) => {
1006
1652
  safeCall(instance, "componentDidRender", void 0, elm);
1007
1653
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1008
1654
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1009
- {
1010
- addHydratedFlag(elm);
1011
- }
1012
1655
  safeCall(instance, "componentDidLoad", void 0, elm);
1013
1656
  endPostUpdate();
1014
1657
  {
@@ -1033,7 +1676,13 @@ var postUpdateComponent = (hostRef) => {
1033
1676
  }
1034
1677
  };
1035
1678
  var appDidLoad = (who) => {
1679
+ var _a;
1036
1680
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
1681
+ {
1682
+ if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
1683
+ plt.$orgLocNodes$.clear();
1684
+ }
1685
+ }
1037
1686
  };
1038
1687
  var safeCall = (instance, method, arg, elm) => {
1039
1688
  if (instance && instance[method]) {
@@ -1045,10 +1694,6 @@ var safeCall = (instance, method, arg, elm) => {
1045
1694
  }
1046
1695
  return void 0;
1047
1696
  };
1048
- var addHydratedFlag = (elm) => {
1049
- var _a;
1050
- return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
1051
- };
1052
1697
 
1053
1698
  // src/runtime/set-value.ts
1054
1699
  var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
@@ -1315,10 +1960,21 @@ var connectedCallback = (elm) => {
1315
1960
  const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
1316
1961
  if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1317
1962
  hostRef.$flags$ |= 1 /* hasConnected */;
1963
+ let hostId;
1964
+ {
1965
+ hostId = elm.getAttribute(HYDRATE_ID);
1966
+ if (hostId) {
1967
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1968
+ const scopeId2 = addStyle(elm.shadowRoot, cmpMeta);
1969
+ elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
1970
+ }
1971
+ initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
1972
+ }
1973
+ }
1318
1974
  {
1319
1975
  let ancestorComponent = elm;
1320
1976
  while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
1321
- if (ancestorComponent["s-p"]) {
1977
+ if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
1322
1978
  attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
1323
1979
  break;
1324
1980
  }
@@ -1387,6 +2043,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1387
2043
  let isBootstrapping = true;
1388
2044
  Object.assign(plt, options);
1389
2045
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
2046
+ {
2047
+ plt.$flags$ |= 2 /* appLoaded */;
2048
+ }
2049
+ {
2050
+ hydrateScopedToShadow();
2051
+ }
1390
2052
  lazyBundles.map((lazyBundle) => {
1391
2053
  lazyBundle[1].map((compactMeta) => {
1392
2054
  const cmpMeta = {
@@ -1473,9 +2135,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1473
2135
  });
1474
2136
  });
1475
2137
  if (cmpTags.length > 0) {
1476
- {
1477
- dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
1478
- }
1479
2138
  if (dataStyles.innerHTML.length) {
1480
2139
  dataStyles.setAttribute("data-styles", "");
1481
2140
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
@@ -1503,6 +2162,6 @@ function transformTag(tag) {
1503
2162
  }
1504
2163
 
1505
2164
  export { Host as H, bootstrapLazy as b, createEvent as c, globalScripts as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
1506
- //# sourceMappingURL=index-C_GZnvOi.js.map
2165
+ //# sourceMappingURL=index-ImsAHlk9.js.map
1507
2166
 
1508
- //# sourceMappingURL=index-C_GZnvOi.js.map
2167
+ //# sourceMappingURL=index-ImsAHlk9.js.map