@rindo/core 4.22.3 → 4.23.1

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Rindo Hydrate Platform v4.22.3 | MIT Licensed | https://rindojs.web.app
2
+ Rindo Hydrate Platform v4.23.1 | MIT Licensed | https://rindojs.web.app
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __export = (target, all) => {
@@ -8,7 +8,7 @@ var __export = (target, all) => {
8
8
  };
9
9
 
10
10
  // src/hydrate/platform/index.ts
11
- import { BUILD as BUILD22 } from "@rindo/core/internal/app-data";
11
+ import { BUILD as BUILD23 } from "@rindo/core/internal/app-data";
12
12
 
13
13
  // src/runtime/asset-path.ts
14
14
  var getAssetPath = (path) => {
@@ -18,7 +18,7 @@ var getAssetPath = (path) => {
18
18
  var setAssetPath = (path) => plt.$resourcesUrl$ = path;
19
19
 
20
20
  // src/runtime/bootstrap-custom-element.ts
21
- import { BUILD as BUILD18 } from "@rindo/core/internal/app-data";
21
+ import { BUILD as BUILD19 } from "@rindo/core/internal/app-data";
22
22
 
23
23
  // src/utils/constants.ts
24
24
  var EMPTY_OBJ = {};
@@ -26,7 +26,7 @@ var SVG_NS = "http://www.w3.org/2000/svg";
26
26
  var HTML_NS = "http://www.w3.org/1999/xhtml";
27
27
 
28
28
  // src/utils/helpers.ts
29
- var isDef = (v) => v != null;
29
+ var isDef = (v) => v != null && v !== void 0;
30
30
  var isComplexType = (o) => {
31
31
  o = typeof o;
32
32
  return o === "object" || o === "function";
@@ -88,102 +88,20 @@ var unwrapErr = (result) => {
88
88
  };
89
89
 
90
90
  // src/runtime/connected-callback.ts
91
- import { BUILD as BUILD15 } from "@rindo/core/internal/app-data";
91
+ import { BUILD as BUILD17 } from "@rindo/core/internal/app-data";
92
92
 
93
93
  // src/runtime/client-hydrate.ts
94
- import { BUILD as BUILD3 } from "@rindo/core/internal/app-data";
94
+ import { BUILD as BUILD8 } from "@rindo/core/internal/app-data";
95
95
 
96
- // src/runtime/profile.ts
97
- import { BUILD } from "@rindo/core/internal/app-data";
98
- var i = 0;
99
- var createTime = (fnName, tagName = "") => {
100
- if (BUILD.profile && performance.mark) {
101
- const key = `st:${fnName}:${tagName}:${i++}`;
102
- performance.mark(key);
103
- return () => performance.measure(`[Rindo] ${fnName}() <${tagName}>`, key);
104
- } else {
105
- return () => {
106
- return;
107
- };
108
- }
109
- };
110
- var uniqueTime = (key, measureText) => {
111
- if (BUILD.profile && performance.mark) {
112
- if (performance.getEntriesByName(key, "mark").length === 0) {
113
- performance.mark(key);
114
- }
115
- return () => {
116
- if (performance.getEntriesByName(measureText, "measure").length === 0) {
117
- performance.measure(measureText, key);
118
- }
119
- };
120
- } else {
121
- return () => {
122
- return;
123
- };
124
- }
125
- };
126
- var inspect = (ref) => {
127
- const hostRef = getHostRef(ref);
128
- if (!hostRef) {
129
- return void 0;
130
- }
131
- const flags = hostRef.$flags$;
132
- const hostElement = hostRef.$hostElement$;
133
- return {
134
- renderCount: hostRef.$renderCount$,
135
- flags: {
136
- hasRendered: !!(flags & 2 /* hasRendered */),
137
- hasConnected: !!(flags & 1 /* hasConnected */),
138
- isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */),
139
- isConstructingInstance: !!(flags & 8 /* isConstructingInstance */),
140
- isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */),
141
- hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */),
142
- hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */),
143
- isWatchReady: !!(flags & 128 /* isWatchReady */),
144
- isListenReady: !!(flags & 256 /* isListenReady */),
145
- needsRerender: !!(flags & 512 /* needsRerender */)
146
- },
147
- instanceValues: hostRef.$instanceValues$,
148
- ancestorComponent: hostRef.$ancestorComponent$,
149
- hostElement,
150
- lazyInstance: hostRef.$lazyInstance$,
151
- vnode: hostRef.$vnode$,
152
- modeName: hostRef.$modeName$,
153
- onReadyPromise: hostRef.$onReadyPromise$,
154
- onReadyResolve: hostRef.$onReadyResolve$,
155
- onInstancePromise: hostRef.$onInstancePromise$,
156
- onInstanceResolve: hostRef.$onInstanceResolve$,
157
- onRenderResolve: hostRef.$onRenderResolve$,
158
- queuedListeners: hostRef.$queuedListeners$,
159
- rmListeners: hostRef.$rmListeners$,
160
- ["s-id"]: hostElement["s-id"],
161
- ["s-cr"]: hostElement["s-cr"],
162
- ["s-lr"]: hostElement["s-lr"],
163
- ["s-p"]: hostElement["s-p"],
164
- ["s-rc"]: hostElement["s-rc"],
165
- ["s-sc"]: hostElement["s-sc"]
166
- };
167
- };
168
- var installDevTools = () => {
169
- if (BUILD.devTools) {
170
- const rindo = win.rindo = win.rindo || {};
171
- const originalInspect = rindo.inspect;
172
- rindo.inspect = (ref) => {
173
- let result = inspect(ref);
174
- if (!result && typeof originalInspect === "function") {
175
- result = originalInspect(ref);
176
- }
177
- return result;
178
- };
179
- }
180
- };
96
+ // src/runtime/dom-extras.ts
97
+ import { BUILD as BUILD6 } from "@rindo/core/internal/app-data";
181
98
 
182
99
  // src/runtime/runtime-constants.ts
183
100
  var CONTENT_REF_ID = "r";
184
101
  var ORG_LOCATION_ID = "o";
185
102
  var SLOT_NODE_ID = "s";
186
103
  var TEXT_NODE_ID = "t";
104
+ var COMMENT_NODE_ID = "c";
187
105
  var HYDRATE_ID = "s-id";
188
106
  var HYDRATED_STYLE_ID = "sty-id";
189
107
  var HYDRATE_CHILD_ID = "c-id";
@@ -203,6 +121,112 @@ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
203
121
  "formStateRestoreCallback"
204
122
  ];
205
123
 
124
+ // src/runtime/slot-polyfill-utils.ts
125
+ import { BUILD } from "@rindo/core/internal/app-data";
126
+ var updateFallbackSlotVisibility = (elm) => {
127
+ const childNodes = elm.__childNodes || elm.childNodes;
128
+ if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
129
+ getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
130
+ var _a;
131
+ if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
132
+ if ((_a = getHostSlotChildNodes(slotNode, slotNode["s-sn"], false)) == null ? void 0 : _a.length) {
133
+ slotNode.hidden = true;
134
+ } else {
135
+ slotNode.hidden = false;
136
+ }
137
+ }
138
+ });
139
+ }
140
+ for (const childNode of childNodes) {
141
+ if (childNode.nodeType === 1 /* ElementNode */ && (childNode.__childNodes || childNode.childNodes).length) {
142
+ updateFallbackSlotVisibility(childNode);
143
+ }
144
+ }
145
+ };
146
+ var getSlottedChildNodes = (childNodes) => {
147
+ const result = [];
148
+ for (let i2 = 0; i2 < childNodes.length; i2++) {
149
+ const slottedNode = childNodes[i2]["s-nr"];
150
+ if (slottedNode && slottedNode.isConnected) {
151
+ result.push(slottedNode);
152
+ }
153
+ }
154
+ return result;
155
+ };
156
+ var getHostSlotNodes = (childNodes, hostName, slotName) => {
157
+ let i2 = 0;
158
+ let slottedNodes = [];
159
+ let childNode;
160
+ for (; i2 < childNodes.length; i2++) {
161
+ childNode = childNodes[i2];
162
+ if (childNode["s-sr"] && childNode["s-hn"] === hostName && (!slotName || childNode["s-sn"] === slotName)) {
163
+ slottedNodes.push(childNode);
164
+ if (typeof slotName !== "undefined") return slottedNodes;
165
+ }
166
+ slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
167
+ }
168
+ return slottedNodes;
169
+ };
170
+ var getHostSlotChildNodes = (node, slotName, includeSlot = true) => {
171
+ const childNodes = [];
172
+ if (includeSlot && node["s-sr"] || !node["s-sr"]) childNodes.push(node);
173
+ while ((node = node.nextSibling) && node["s-sn"] === slotName) {
174
+ childNodes.push(node);
175
+ }
176
+ return childNodes;
177
+ };
178
+ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
179
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
180
+ if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
181
+ return true;
182
+ }
183
+ if (nodeToRelocate.getAttribute("slot") === slotName) {
184
+ return true;
185
+ }
186
+ return false;
187
+ }
188
+ if (nodeToRelocate["s-sn"] === slotName) {
189
+ return true;
190
+ }
191
+ return slotName === "";
192
+ };
193
+ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
194
+ let slottedNodeLocation;
195
+ if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
196
+ slottedNodeLocation = newChild["s-ol"];
197
+ } else {
198
+ slottedNodeLocation = document.createTextNode("");
199
+ slottedNodeLocation["s-nr"] = newChild;
200
+ }
201
+ if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
202
+ const parent = slotNode["s-cr"].parentNode;
203
+ const appendMethod = prepend ? parent.__prepend || parent.prepend : parent.__appendChild || parent.appendChild;
204
+ if (typeof position !== "undefined") {
205
+ if (BUILD.hydrateClientSide) {
206
+ slottedNodeLocation["s-oo"] = position;
207
+ const childNodes = parent.__childNodes || parent.childNodes;
208
+ const slotRelocateNodes = [slottedNodeLocation];
209
+ childNodes.forEach((n) => {
210
+ if (n["s-nr"]) slotRelocateNodes.push(n);
211
+ });
212
+ slotRelocateNodes.sort((a, b) => {
213
+ if (!a["s-oo"] || a["s-oo"] < b["s-oo"]) return -1;
214
+ else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
215
+ return 0;
216
+ });
217
+ slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
218
+ }
219
+ } else {
220
+ appendMethod.call(parent, slottedNodeLocation);
221
+ }
222
+ newChild["s-ol"] = slottedNodeLocation;
223
+ newChild["s-sh"] = slotNode["s-hn"];
224
+ };
225
+ var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
226
+
227
+ // src/runtime/vdom/vdom-render.ts
228
+ import { BUILD as BUILD5 } from "@rindo/core/internal/app-data";
229
+
206
230
  // src/runtime/vdom/h.ts
207
231
  import { BUILD as BUILD2 } from "@rindo/core/internal/app-data";
208
232
  var h = (nodeName, vnodeData, ...children) => {
@@ -343,416 +367,58 @@ var validateInputProperties = (inputElm) => {
343
367
  }
344
368
  };
345
369
 
346
- // src/runtime/client-hydrate.ts
347
- var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
348
- const endHydrate = createTime("hydrateClient", tagName);
349
- const shadowRoot = hostElm.shadowRoot;
350
- const childRenderNodes = [];
351
- const slotNodes = [];
352
- const shadowRootNodes = BUILD3.shadowDom && shadowRoot ? [] : null;
353
- const vnode = hostRef.$vnode$ = newVNode(tagName, null);
354
- if (!plt.$orgLocNodes$) {
355
- initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
356
- }
357
- hostElm[HYDRATE_ID] = hostId;
358
- hostElm.removeAttribute(HYDRATE_ID);
359
- clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
360
- childRenderNodes.map((c) => {
361
- const orgLocationId = c.$hostId$ + "." + c.$nodeId$;
362
- const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
363
- const node = c.$elm$;
364
- if (orgLocationNode && supportsShadow && orgLocationNode["s-en"] === "") {
365
- orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
366
- }
367
- if (!shadowRoot) {
368
- node["s-hn"] = tagName;
369
- if (orgLocationNode) {
370
- node["s-ol"] = orgLocationNode;
371
- node["s-ol"]["s-nr"] = node;
372
- }
373
- }
374
- plt.$orgLocNodes$.delete(orgLocationId);
375
- });
376
- if (BUILD3.shadowDom && shadowRoot) {
377
- shadowRootNodes.map((shadowRootNode) => {
378
- if (shadowRootNode) {
379
- shadowRoot.appendChild(shadowRootNode);
370
+ // src/runtime/vdom/update-element.ts
371
+ import { BUILD as BUILD4 } from "@rindo/core/internal/app-data";
372
+
373
+ // src/runtime/vdom/set-accessor.ts
374
+ import { BUILD as BUILD3 } from "@rindo/core/internal/app-data";
375
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
376
+ if (oldValue !== newValue) {
377
+ let isProp = isMemberInElement(elm, memberName);
378
+ let ln = memberName.toLowerCase();
379
+ if (BUILD3.vdomClass && memberName === "class") {
380
+ const classList = elm.classList;
381
+ const oldClasses = parseClassList(oldValue);
382
+ let newClasses = parseClassList(newValue);
383
+ if (elm["s-si"]) {
384
+ newClasses.push(elm["s-si"]);
385
+ oldClasses.forEach((c) => {
386
+ if (c.startsWith(elm["s-si"])) newClasses.push(c);
387
+ });
388
+ newClasses = [...new Set(newClasses)];
389
+ classList.add(...newClasses);
390
+ delete elm["s-si"];
391
+ } else {
392
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
393
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
380
394
  }
381
- });
382
- }
383
- endHydrate();
384
- };
385
- var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
386
- let childNodeType;
387
- let childIdSplt;
388
- let childVNode;
389
- let i2;
390
- if (node.nodeType === 1 /* ElementNode */) {
391
- childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
392
- if (childNodeType) {
393
- childIdSplt = childNodeType.split(".");
394
- if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
395
- childVNode = {
396
- $flags$: 0,
397
- $hostId$: childIdSplt[0],
398
- $nodeId$: childIdSplt[1],
399
- $depth$: childIdSplt[2],
400
- $index$: childIdSplt[3],
401
- $tag$: node.tagName.toLowerCase(),
402
- $elm$: node,
403
- $attrs$: null,
404
- $children$: null,
405
- $key$: null,
406
- $name$: null,
407
- $text$: null
408
- };
409
- childRenderNodes.push(childVNode);
410
- node.removeAttribute(HYDRATE_CHILD_ID);
411
- if (!parentVNode.$children$) {
412
- parentVNode.$children$ = [];
395
+ } else if (BUILD3.vdomStyle && memberName === "style") {
396
+ if (BUILD3.updatable) {
397
+ for (const prop in oldValue) {
398
+ if (!newValue || newValue[prop] == null) {
399
+ if (!BUILD3.hydrateServerSide && prop.includes("-")) {
400
+ elm.style.removeProperty(prop);
401
+ } else {
402
+ elm.style[prop] = "";
403
+ }
404
+ }
413
405
  }
414
- parentVNode.$children$[childVNode.$index$] = childVNode;
415
- parentVNode = childVNode;
416
- if (shadowRootNodes && childVNode.$depth$ === "0") {
417
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
406
+ }
407
+ for (const prop in newValue) {
408
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
409
+ if (!BUILD3.hydrateServerSide && prop.includes("-")) {
410
+ elm.style.setProperty(prop, newValue[prop]);
411
+ } else {
412
+ elm.style[prop] = newValue[prop];
413
+ }
418
414
  }
419
415
  }
420
- }
421
- if (node.shadowRoot) {
422
- for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
423
- clientHydrate(
424
- parentVNode,
425
- childRenderNodes,
426
- slotNodes,
427
- shadowRootNodes,
428
- hostElm,
429
- node.shadowRoot.childNodes[i2],
430
- hostId
431
- );
416
+ } else if (BUILD3.vdomKey && memberName === "key") {
417
+ } else if (BUILD3.vdomRef && memberName === "ref") {
418
+ if (newValue) {
419
+ newValue(elm);
432
420
  }
433
- }
434
- for (i2 = node.childNodes.length - 1; i2 >= 0; i2--) {
435
- clientHydrate(
436
- parentVNode,
437
- childRenderNodes,
438
- slotNodes,
439
- shadowRootNodes,
440
- hostElm,
441
- node.childNodes[i2],
442
- hostId
443
- );
444
- }
445
- } else if (node.nodeType === 8 /* CommentNode */) {
446
- childIdSplt = node.nodeValue.split(".");
447
- if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
448
- childNodeType = childIdSplt[0];
449
- childVNode = {
450
- $flags$: 0,
451
- $hostId$: childIdSplt[1],
452
- $nodeId$: childIdSplt[2],
453
- $depth$: childIdSplt[3],
454
- $index$: childIdSplt[4],
455
- $elm$: node,
456
- $attrs$: null,
457
- $children$: null,
458
- $key$: null,
459
- $name$: null,
460
- $tag$: null,
461
- $text$: null
462
- };
463
- if (childNodeType === TEXT_NODE_ID) {
464
- childVNode.$elm$ = node.nextSibling;
465
- if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
466
- childVNode.$text$ = childVNode.$elm$.textContent;
467
- childRenderNodes.push(childVNode);
468
- node.remove();
469
- if (!parentVNode.$children$) {
470
- parentVNode.$children$ = [];
471
- }
472
- parentVNode.$children$[childVNode.$index$] = childVNode;
473
- if (shadowRootNodes && childVNode.$depth$ === "0") {
474
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
475
- }
476
- }
477
- } else if (childVNode.$hostId$ === hostId) {
478
- if (childNodeType === SLOT_NODE_ID) {
479
- childVNode.$tag$ = "slot";
480
- if (childIdSplt[5]) {
481
- node["s-sn"] = childVNode.$name$ = childIdSplt[5];
482
- } else {
483
- node["s-sn"] = "";
484
- }
485
- node["s-sr"] = true;
486
- if (BUILD3.shadowDom && shadowRootNodes) {
487
- childVNode.$elm$ = doc.createElement(childVNode.$tag$);
488
- if (childVNode.$name$) {
489
- childVNode.$elm$.setAttribute("name", childVNode.$name$);
490
- }
491
- node.parentNode.insertBefore(childVNode.$elm$, node);
492
- node.remove();
493
- if (childVNode.$depth$ === "0") {
494
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
495
- }
496
- }
497
- slotNodes.push(childVNode);
498
- if (!parentVNode.$children$) {
499
- parentVNode.$children$ = [];
500
- }
501
- parentVNode.$children$[childVNode.$index$] = childVNode;
502
- } else if (childNodeType === CONTENT_REF_ID) {
503
- if (BUILD3.shadowDom && shadowRootNodes) {
504
- node.remove();
505
- } else if (BUILD3.slotRelocation) {
506
- hostElm["s-cr"] = node;
507
- node["s-cn"] = true;
508
- }
509
- }
510
- }
511
- }
512
- } else if (parentVNode && parentVNode.$tag$ === "style") {
513
- const vnode = newVNode(null, node.textContent);
514
- vnode.$elm$ = node;
515
- vnode.$index$ = "0";
516
- parentVNode.$children$ = [vnode];
517
- }
518
- };
519
- var initializeDocumentHydrate = (node, orgLocNodes) => {
520
- if (node.nodeType === 1 /* ElementNode */) {
521
- let i2 = 0;
522
- if (node.shadowRoot) {
523
- for (; i2 < node.shadowRoot.childNodes.length; i2++) {
524
- initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
525
- }
526
- }
527
- for (i2 = 0; i2 < node.childNodes.length; i2++) {
528
- initializeDocumentHydrate(node.childNodes[i2], orgLocNodes);
529
- }
530
- } else if (node.nodeType === 8 /* CommentNode */) {
531
- const childIdSplt = node.nodeValue.split(".");
532
- if (childIdSplt[0] === ORG_LOCATION_ID) {
533
- orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
534
- node.nodeValue = "";
535
- node["s-en"] = childIdSplt[3];
536
- }
537
- }
538
- };
539
-
540
- // src/runtime/initialize-component.ts
541
- import { BUILD as BUILD14 } from "@rindo/core/internal/app-data";
542
-
543
- // src/runtime/mode.ts
544
- var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
545
- var setMode = (handler) => modeResolutionChain.push(handler);
546
- var getMode = (ref) => getHostRef(ref).$modeName$;
547
-
548
- // src/runtime/proxy-component.ts
549
- import { BUILD as BUILD13 } from "@rindo/core/internal/app-data";
550
-
551
- // src/runtime/set-value.ts
552
- import { BUILD as BUILD12 } from "@rindo/core/internal/app-data";
553
-
554
- // src/runtime/parse-property-value.ts
555
- import { BUILD as BUILD4 } from "@rindo/core/internal/app-data";
556
- var parsePropertyValue = (propValue, propType) => {
557
- if (propValue != null && !isComplexType(propValue)) {
558
- if (BUILD4.propBoolean && propType & 4 /* Boolean */) {
559
- return propValue === "false" ? false : propValue === "" || !!propValue;
560
- }
561
- if (BUILD4.propNumber && propType & 2 /* Number */) {
562
- return parseFloat(propValue);
563
- }
564
- if (BUILD4.propString && propType & 1 /* String */) {
565
- return String(propValue);
566
- }
567
- return propValue;
568
- }
569
- return propValue;
570
- };
571
-
572
- // src/runtime/update-component.ts
573
- import { BUILD as BUILD11, NAMESPACE } from "@rindo/core/internal/app-data";
574
-
575
- // src/runtime/event-emitter.ts
576
- import { BUILD as BUILD6 } from "@rindo/core/internal/app-data";
577
-
578
- // src/runtime/element.ts
579
- import { BUILD as BUILD5 } from "@rindo/core/internal/app-data";
580
- var getElement = (ref) => BUILD5.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
581
-
582
- // src/runtime/event-emitter.ts
583
- var createEvent = (ref, name, flags) => {
584
- const elm = getElement(ref);
585
- return {
586
- emit: (detail) => {
587
- if (BUILD6.isDev && !elm.isConnected) {
588
- consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
589
- }
590
- return emitEvent(elm, name, {
591
- bubbles: !!(flags & 4 /* Bubbles */),
592
- composed: !!(flags & 2 /* Composed */),
593
- cancelable: !!(flags & 1 /* Cancellable */),
594
- detail
595
- });
596
- }
597
- };
598
- };
599
- var emitEvent = (elm, name, opts) => {
600
- const ev = plt.ce(name, opts);
601
- elm.dispatchEvent(ev);
602
- return ev;
603
- };
604
-
605
- // src/runtime/styles.ts
606
- import { BUILD as BUILD7 } from "@rindo/core/internal/app-data";
607
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
608
- var registerStyle = (scopeId2, cssText, allowCS) => {
609
- let style = styles.get(scopeId2);
610
- if (supportsConstructableStylesheets && allowCS) {
611
- style = style || new CSSStyleSheet();
612
- if (typeof style === "string") {
613
- style = cssText;
614
- } else {
615
- style.replaceSync(cssText);
616
- }
617
- } else {
618
- style = cssText;
619
- }
620
- styles.set(scopeId2, style);
621
- };
622
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
623
- var _a;
624
- const scopeId2 = getScopeId(cmpMeta, mode);
625
- const style = styles.get(scopeId2);
626
- if (!BUILD7.attachStyles) {
627
- return scopeId2;
628
- }
629
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
630
- if (style) {
631
- if (typeof style === "string") {
632
- styleContainerNode = styleContainerNode.head || styleContainerNode;
633
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
634
- let styleElm;
635
- if (!appliedStyles) {
636
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
637
- }
638
- if (!appliedStyles.has(scopeId2)) {
639
- if (BUILD7.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
640
- styleElm.innerHTML = style;
641
- } else {
642
- styleElm = doc.createElement("style");
643
- styleElm.innerHTML = style;
644
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
645
- if (nonce != null) {
646
- styleElm.setAttribute("nonce", nonce);
647
- }
648
- if ((BUILD7.hydrateServerSide || BUILD7.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
649
- styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
650
- }
651
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
652
- if (styleContainerNode.nodeName === "HEAD") {
653
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
654
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
655
- styleContainerNode.insertBefore(styleElm, referenceNode2);
656
- } else if ("host" in styleContainerNode) {
657
- if (supportsConstructableStylesheets) {
658
- const stylesheet = new CSSStyleSheet();
659
- stylesheet.replaceSync(style);
660
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
661
- } else {
662
- const existingStyleContainer = styleContainerNode.querySelector("style");
663
- if (existingStyleContainer) {
664
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
665
- } else {
666
- styleContainerNode.prepend(styleElm);
667
- }
668
- }
669
- } else {
670
- styleContainerNode.append(styleElm);
671
- }
672
- }
673
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
674
- styleContainerNode.insertBefore(styleElm, null);
675
- }
676
- }
677
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
678
- styleElm.innerHTML += SLOT_FB_CSS;
679
- }
680
- if (appliedStyles) {
681
- appliedStyles.add(scopeId2);
682
- }
683
- }
684
- } else if (BUILD7.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
685
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
686
- }
687
- }
688
- return scopeId2;
689
- };
690
- var attachStyles = (hostRef) => {
691
- const cmpMeta = hostRef.$cmpMeta$;
692
- const elm = hostRef.$hostElement$;
693
- const flags = cmpMeta.$flags$;
694
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
695
- const scopeId2 = addStyle(
696
- BUILD7.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
697
- cmpMeta,
698
- hostRef.$modeName$
699
- );
700
- if ((BUILD7.shadowDom || BUILD7.scoped) && BUILD7.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
701
- elm["s-sc"] = scopeId2;
702
- elm.classList.add(scopeId2 + "-h");
703
- if (BUILD7.scoped && flags & 2 /* scopedCssEncapsulation */) {
704
- elm.classList.add(scopeId2 + "-s");
705
- }
706
- }
707
- endAttachStyles();
708
- };
709
- var getScopeId = (cmp, mode) => "sc-" + (BUILD7.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
710
-
711
- // src/runtime/vdom/vdom-render.ts
712
- import { BUILD as BUILD10 } from "@rindo/core/internal/app-data";
713
-
714
- // src/runtime/vdom/update-element.ts
715
- import { BUILD as BUILD9 } from "@rindo/core/internal/app-data";
716
-
717
- // src/runtime/vdom/set-accessor.ts
718
- import { BUILD as BUILD8 } from "@rindo/core/internal/app-data";
719
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
720
- if (oldValue !== newValue) {
721
- let isProp = isMemberInElement(elm, memberName);
722
- let ln = memberName.toLowerCase();
723
- if (BUILD8.vdomClass && memberName === "class") {
724
- const classList = elm.classList;
725
- const oldClasses = parseClassList(oldValue);
726
- const newClasses = parseClassList(newValue);
727
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
728
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
729
- } else if (BUILD8.vdomStyle && memberName === "style") {
730
- if (BUILD8.updatable) {
731
- for (const prop in oldValue) {
732
- if (!newValue || newValue[prop] == null) {
733
- if (!BUILD8.hydrateServerSide && prop.includes("-")) {
734
- elm.style.removeProperty(prop);
735
- } else {
736
- elm.style[prop] = "";
737
- }
738
- }
739
- }
740
- }
741
- for (const prop in newValue) {
742
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
743
- if (!BUILD8.hydrateServerSide && prop.includes("-")) {
744
- elm.style.setProperty(prop, newValue[prop]);
745
- } else {
746
- elm.style[prop] = newValue[prop];
747
- }
748
- }
749
- }
750
- } else if (BUILD8.vdomKey && memberName === "key") {
751
- } else if (BUILD8.vdomRef && memberName === "ref") {
752
- if (newValue) {
753
- newValue(elm);
754
- }
755
- } else if (BUILD8.vdomListener && (BUILD8.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
421
+ } else if (BUILD3.vdomListener && (BUILD3.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
756
422
  if (memberName[2] === "-") {
757
423
  memberName = memberName.slice(3);
758
424
  } else if (isMemberInElement(win, ln)) {
@@ -770,7 +436,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
770
436
  plt.ael(elm, memberName, newValue, capture);
771
437
  }
772
438
  }
773
- } else if (BUILD8.vdomPropOrAttr) {
439
+ } else if (BUILD3.vdomPropOrAttr) {
774
440
  const isComplex = isComplexType(newValue);
775
441
  if ((isProp || isComplex && newValue !== null) && !isSvg) {
776
442
  try {
@@ -792,7 +458,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
792
458
  }
793
459
  }
794
460
  let xlink = false;
795
- if (BUILD8.vdomXlink) {
461
+ if (BUILD3.vdomXlink) {
796
462
  if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
797
463
  memberName = ln;
798
464
  xlink = true;
@@ -800,7 +466,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
800
466
  }
801
467
  if (newValue == null || newValue === false) {
802
468
  if (newValue !== false || elm.getAttribute(memberName) === "") {
803
- if (BUILD8.vdomXlink && xlink) {
469
+ if (BUILD3.vdomXlink && xlink) {
804
470
  elm.removeAttributeNS(XLINK_NS, memberName);
805
471
  } else {
806
472
  elm.removeAttribute(memberName);
@@ -808,7 +474,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
808
474
  }
809
475
  } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
810
476
  newValue = newValue === true ? "" : newValue;
811
- if (BUILD8.vdomXlink && xlink) {
477
+ if (BUILD3.vdomXlink && xlink) {
812
478
  elm.setAttributeNS(XLINK_NS, memberName, newValue);
813
479
  } else {
814
480
  elm.setAttribute(memberName, newValue);
@@ -818,7 +484,15 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
818
484
  }
819
485
  };
820
486
  var parseClassListRegex = /\s/;
821
- var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
487
+ var parseClassList = (value) => {
488
+ if (typeof value === "object" && "baseVal" in value) {
489
+ value = value.baseVal;
490
+ }
491
+ if (!value) {
492
+ return [];
493
+ }
494
+ return value.split(parseClassListRegex);
495
+ };
822
496
  var CAPTURE_EVENT_SUFFIX = "Capture";
823
497
  var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
824
498
 
@@ -827,7 +501,7 @@ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
827
501
  const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
828
502
  const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
829
503
  const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
830
- if (BUILD9.updatable) {
504
+ if (BUILD4.updatable) {
831
505
  for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
832
506
  if (!(memberName in newVnodeAttrs)) {
833
507
  setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
@@ -856,19 +530,16 @@ var useNativeShadowDom = false;
856
530
  var checkSlotFallbackVisibility = false;
857
531
  var checkSlotRelocate = false;
858
532
  var isSvgMode = false;
859
- var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
533
+ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
860
534
  var _a;
861
535
  const newVNode2 = newParentVNode.$children$[childIndex];
862
536
  let i2 = 0;
863
537
  let elm;
864
538
  let childNode;
865
539
  let oldVNode;
866
- if (BUILD10.slotRelocation && !useNativeShadowDom) {
540
+ if (BUILD5.slotRelocation && !useNativeShadowDom) {
867
541
  checkSlotRelocate = true;
868
542
  if (newVNode2.$tag$ === "slot") {
869
- if (scopeId) {
870
- parentElm.classList.add(scopeId + "-s");
871
- }
872
543
  newVNode2.$flags$ |= newVNode2.$children$ ? (
873
544
  // slot element has fallback content
874
545
  // still create an element that "mocks" the slot element
@@ -881,48 +552,43 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
881
552
  );
882
553
  }
883
554
  }
884
- if (BUILD10.isDev && newVNode2.$elm$) {
555
+ if (BUILD5.isDev && newVNode2.$elm$) {
885
556
  consoleDevError(
886
557
  `The JSX ${newVNode2.$text$ !== null ? `"${newVNode2.$text$}" text` : `"${newVNode2.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://rindojs.web.app/docs/templating-jsx#avoid-shared-jsx-nodes`
887
558
  );
888
559
  }
889
- if (BUILD10.vdomText && newVNode2.$text$ !== null) {
560
+ if (BUILD5.vdomText && newVNode2.$text$ !== null) {
890
561
  elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
891
- } else if (BUILD10.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
892
- elm = newVNode2.$elm$ = BUILD10.isDebug || BUILD10.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
562
+ } else if (BUILD5.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
563
+ elm = newVNode2.$elm$ = BUILD5.isDebug || BUILD5.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
893
564
  } else {
894
- if (BUILD10.svg && !isSvgMode) {
565
+ if (BUILD5.svg && !isSvgMode) {
895
566
  isSvgMode = newVNode2.$tag$ === "svg";
896
567
  }
897
- elm = newVNode2.$elm$ = BUILD10.svg ? doc.createElementNS(
568
+ elm = newVNode2.$elm$ = BUILD5.svg ? doc.createElementNS(
898
569
  isSvgMode ? SVG_NS : HTML_NS,
899
- !useNativeShadowDom && BUILD10.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
570
+ !useNativeShadowDom && BUILD5.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
900
571
  ) : doc.createElement(
901
- !useNativeShadowDom && BUILD10.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
572
+ !useNativeShadowDom && BUILD5.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
902
573
  );
903
- if (BUILD10.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
574
+ if (BUILD5.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
904
575
  isSvgMode = false;
905
576
  }
906
- if (BUILD10.vdomAttribute) {
577
+ if (BUILD5.vdomAttribute) {
907
578
  updateElement(null, newVNode2, isSvgMode);
908
579
  }
909
- const rootNode = elm.getRootNode();
910
- const isElementWithinShadowRoot = !rootNode.querySelector("body");
911
- if (!isElementWithinShadowRoot && BUILD10.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
580
+ if (BUILD5.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
912
581
  elm.classList.add(elm["s-si"] = scopeId);
913
582
  }
914
- if (BUILD10.scoped) {
915
- updateElementScopeIds(elm, parentElm);
916
- }
917
583
  if (newVNode2.$children$) {
918
584
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
919
- childNode = createElm(oldParentVNode, newVNode2, i2, elm);
585
+ childNode = createElm(oldParentVNode, newVNode2, i2);
920
586
  if (childNode) {
921
587
  elm.appendChild(childNode);
922
588
  }
923
589
  }
924
590
  }
925
- if (BUILD10.svg) {
591
+ if (BUILD5.svg) {
926
592
  if (newVNode2.$tag$ === "svg") {
927
593
  isSvgMode = false;
928
594
  } else if (elm.tagName === "foreignObject") {
@@ -931,7 +597,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
931
597
  }
932
598
  }
933
599
  elm["s-hn"] = hostTagName;
934
- if (BUILD10.slotRelocation) {
600
+ if (BUILD5.slotRelocation) {
935
601
  if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
936
602
  elm["s-sr"] = true;
937
603
  elm["s-cr"] = contentRef;
@@ -939,12 +605,15 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
939
605
  elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
940
606
  oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
941
607
  if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
942
- if (BUILD10.experimentalSlotFixes) {
608
+ if (BUILD5.experimentalSlotFixes) {
943
609
  relocateToHostRoot(oldParentVNode.$elm$);
944
610
  } else {
945
611
  putBackInOriginalLocation(oldParentVNode.$elm$, false);
946
612
  }
947
613
  }
614
+ if (BUILD5.scoped) {
615
+ addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
616
+ }
948
617
  }
949
618
  }
950
619
  return elm;
@@ -953,8 +622,12 @@ var relocateToHostRoot = (parentElm) => {
953
622
  plt.$flags$ |= 1 /* isTmpDisconnected */;
954
623
  const host = parentElm.closest(hostTagName.toLowerCase());
955
624
  if (host != null) {
956
- const contentRefNode = Array.from(host.childNodes).find((ref) => ref["s-cr"]);
957
- const childNodeArray = Array.from(parentElm.childNodes);
625
+ const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(
626
+ (ref) => ref["s-cr"]
627
+ );
628
+ const childNodeArray = Array.from(
629
+ parentElm.__childNodes || parentElm.childNodes
630
+ );
958
631
  for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
959
632
  if (childNode["s-sh"] != null) {
960
633
  insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);
@@ -967,8 +640,8 @@ var relocateToHostRoot = (parentElm) => {
967
640
  };
968
641
  var putBackInOriginalLocation = (parentElm, recursive) => {
969
642
  plt.$flags$ |= 1 /* isTmpDisconnected */;
970
- const oldSlotChildNodes = Array.from(parentElm.childNodes);
971
- if (parentElm["s-sr"] && BUILD10.experimentalSlotFixes) {
643
+ const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
644
+ if (parentElm["s-sr"] && BUILD5.experimentalSlotFixes) {
972
645
  let node = parentElm;
973
646
  while (node = node.nextSibling) {
974
647
  if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
@@ -979,7 +652,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
979
652
  for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
980
653
  const childNode = oldSlotChildNodes[i2];
981
654
  if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
982
- insertBefore(parentReferenceNode(childNode), childNode, referenceNode(childNode));
655
+ insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
983
656
  childNode["s-ol"].remove();
984
657
  childNode["s-ol"] = void 0;
985
658
  childNode["s-sh"] = void 0;
@@ -992,17 +665,17 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
992
665
  plt.$flags$ &= ~1 /* isTmpDisconnected */;
993
666
  };
994
667
  var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
995
- let containerElm = BUILD10.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
668
+ let containerElm = BUILD5.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
996
669
  let childNode;
997
- if (BUILD10.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
670
+ if (BUILD5.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
998
671
  containerElm = containerElm.shadowRoot;
999
672
  }
1000
673
  for (; startIdx <= endIdx; ++startIdx) {
1001
674
  if (vnodes[startIdx]) {
1002
- childNode = createElm(null, parentVNode, startIdx, parentElm);
675
+ childNode = createElm(null, parentVNode, startIdx);
1003
676
  if (childNode) {
1004
677
  vnodes[startIdx].$elm$ = childNode;
1005
- insertBefore(containerElm, childNode, BUILD10.slotRelocation ? referenceNode(before) : before);
678
+ insertBefore(containerElm, childNode, BUILD5.slotRelocation ? referenceNode(before) : before);
1006
679
  }
1007
680
  }
1008
681
  }
@@ -1014,7 +687,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
1014
687
  const elm = vnode.$elm$;
1015
688
  nullifyVNodeRefs(vnode);
1016
689
  if (elm) {
1017
- if (BUILD10.slotRelocation) {
690
+ if (BUILD5.slotRelocation) {
1018
691
  checkSlotFallbackVisibility = true;
1019
692
  if (elm["s-ol"]) {
1020
693
  elm["s-ol"].remove();
@@ -1058,7 +731,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1058
731
  oldEndVnode = oldCh[--oldEndIdx];
1059
732
  newEndVnode = newCh[--newEndIdx];
1060
733
  } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
1061
- if (BUILD10.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
734
+ if (BUILD5.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1062
735
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
1063
736
  }
1064
737
  patch(oldStartVnode, newEndVnode, isInitialRender);
@@ -1066,7 +739,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1066
739
  oldStartVnode = oldCh[++oldStartIdx];
1067
740
  newEndVnode = newCh[--newEndIdx];
1068
741
  } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
1069
- if (BUILD10.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
742
+ if (BUILD5.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1070
743
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
1071
744
  }
1072
745
  patch(oldEndVnode, newStartVnode, isInitialRender);
@@ -1075,7 +748,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1075
748
  newStartVnode = newCh[++newStartIdx];
1076
749
  } else {
1077
750
  idxInOld = -1;
1078
- if (BUILD10.vdomKey) {
751
+ if (BUILD5.vdomKey) {
1079
752
  for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
1080
753
  if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
1081
754
  idxInOld = i2;
@@ -1083,10 +756,10 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1083
756
  }
1084
757
  }
1085
758
  }
1086
- if (BUILD10.vdomKey && idxInOld >= 0) {
759
+ if (BUILD5.vdomKey && idxInOld >= 0) {
1087
760
  elmToMove = oldCh[idxInOld];
1088
761
  if (elmToMove.$tag$ !== newStartVnode.$tag$) {
1089
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm);
762
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
1090
763
  } else {
1091
764
  patch(elmToMove, newStartVnode, isInitialRender);
1092
765
  oldCh[idxInOld] = void 0;
@@ -1094,12 +767,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1094
767
  }
1095
768
  newStartVnode = newCh[++newStartIdx];
1096
769
  } else {
1097
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx, parentElm);
770
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
1098
771
  newStartVnode = newCh[++newStartIdx];
1099
772
  }
1100
773
  if (node) {
1101
- if (BUILD10.slotRelocation) {
1102
- insertBefore(parentReferenceNode(oldStartVnode.$elm$), node, referenceNode(oldStartVnode.$elm$));
774
+ if (BUILD5.slotRelocation) {
775
+ insertBefore(
776
+ referenceNode(oldStartVnode.$elm$).parentNode,
777
+ node,
778
+ referenceNode(oldStartVnode.$elm$)
779
+ );
1103
780
  } else {
1104
781
  insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
1105
782
  }
@@ -1115,35 +792,26 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
1115
792
  newStartIdx,
1116
793
  newEndIdx
1117
794
  );
1118
- } else if (BUILD10.updatable && newStartIdx > newEndIdx) {
795
+ } else if (BUILD5.updatable && newStartIdx > newEndIdx) {
1119
796
  removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1120
797
  }
1121
798
  };
1122
799
  var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1123
800
  if (leftVNode.$tag$ === rightVNode.$tag$) {
1124
- if (BUILD10.slotRelocation && leftVNode.$tag$ === "slot") {
1125
- if (
1126
- // The component gets hydrated and no VDOM has been initialized.
1127
- // Here the comparison can't happen as $name$ property is not set for `leftNode`.
1128
- "$nodeId$" in leftVNode && isInitialRender && // `leftNode` is not from type HTMLComment which would cause many
1129
- // hydration comments to be removed
1130
- leftVNode.$elm$.nodeType !== 8
1131
- ) {
1132
- return false;
1133
- }
801
+ if (BUILD5.slotRelocation && leftVNode.$tag$ === "slot") {
1134
802
  return leftVNode.$name$ === rightVNode.$name$;
1135
803
  }
1136
- if (BUILD10.vdomKey && !isInitialRender) {
804
+ if (BUILD5.vdomKey && !isInitialRender) {
1137
805
  return leftVNode.$key$ === rightVNode.$key$;
1138
806
  }
807
+ if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
808
+ leftVNode.$key$ = rightVNode.$key$;
809
+ }
1139
810
  return true;
1140
811
  }
1141
812
  return false;
1142
813
  };
1143
- var referenceNode = (node) => {
1144
- return node && node["s-ol"] || node;
1145
- };
1146
- var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode;
814
+ var referenceNode = (node) => node && node["s-ol"] || node;
1147
815
  var patch = (oldVNode, newVNode2, isInitialRender = false) => {
1148
816
  const elm = newVNode2.$elm$ = oldVNode.$elm$;
1149
817
  const oldChildren = oldVNode.$children$;
@@ -1151,13 +819,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
1151
819
  const tag = newVNode2.$tag$;
1152
820
  const text = newVNode2.$text$;
1153
821
  let defaultHolder;
1154
- if (!BUILD10.vdomText || text === null) {
1155
- if (BUILD10.svg) {
822
+ if (!BUILD5.vdomText || text === null) {
823
+ if (BUILD5.svg) {
1156
824
  isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
1157
825
  }
1158
- if (BUILD10.vdomAttribute || BUILD10.reflect) {
1159
- if (BUILD10.slot && tag === "slot" && !useNativeShadowDom) {
1160
- if (BUILD10.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
826
+ if (BUILD5.vdomAttribute || BUILD5.reflect) {
827
+ if (BUILD5.slot && tag === "slot" && !useNativeShadowDom) {
828
+ if (BUILD5.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
1161
829
  newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
1162
830
  relocateToHostRoot(newVNode2.$elm$.parentElement);
1163
831
  }
@@ -1165,67 +833,41 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
1165
833
  updateElement(oldVNode, newVNode2, isSvgMode);
1166
834
  }
1167
835
  }
1168
- if (BUILD10.updatable && oldChildren !== null && newChildren !== null) {
836
+ if (BUILD5.updatable && oldChildren !== null && newChildren !== null) {
1169
837
  updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
1170
838
  } else if (newChildren !== null) {
1171
- if (BUILD10.updatable && BUILD10.vdomText && oldVNode.$text$ !== null) {
839
+ if (BUILD5.updatable && BUILD5.vdomText && oldVNode.$text$ !== null) {
1172
840
  elm.textContent = "";
1173
841
  }
1174
842
  addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
1175
843
  } else if (
1176
844
  // don't do this on initial render as it can cause non-hydrated content to be removed
1177
- !isInitialRender && BUILD10.updatable && oldChildren !== null
845
+ !isInitialRender && BUILD5.updatable && oldChildren !== null
1178
846
  ) {
1179
847
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
1180
848
  }
1181
- if (BUILD10.svg && isSvgMode && tag === "svg") {
849
+ if (BUILD5.svg && isSvgMode && tag === "svg") {
1182
850
  isSvgMode = false;
1183
851
  }
1184
- } else if (BUILD10.vdomText && BUILD10.slotRelocation && (defaultHolder = elm["s-cr"])) {
852
+ } else if (BUILD5.vdomText && BUILD5.slotRelocation && (defaultHolder = elm["s-cr"])) {
1185
853
  defaultHolder.parentNode.textContent = text;
1186
- } else if (BUILD10.vdomText && oldVNode.$text$ !== text) {
854
+ } else if (BUILD5.vdomText && oldVNode.$text$ !== text) {
1187
855
  elm.data = text;
1188
856
  }
1189
857
  };
1190
- var updateFallbackSlotVisibility = (elm) => {
1191
- const childNodes = elm.childNodes;
1192
- for (const childNode of childNodes) {
1193
- if (childNode.nodeType === 1 /* ElementNode */) {
1194
- if (childNode["s-sr"]) {
1195
- const slotName = childNode["s-sn"];
1196
- childNode.hidden = false;
1197
- for (const siblingNode of childNodes) {
1198
- if (siblingNode !== childNode) {
1199
- if (siblingNode["s-hn"] !== childNode["s-hn"] || slotName !== "") {
1200
- if (siblingNode.nodeType === 1 /* ElementNode */ && (slotName === siblingNode.getAttribute("slot") || slotName === siblingNode["s-sn"]) || siblingNode.nodeType === 3 /* TextNode */ && slotName === siblingNode["s-sn"]) {
1201
- childNode.hidden = true;
1202
- break;
1203
- }
1204
- } else {
1205
- if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
1206
- childNode.hidden = true;
1207
- break;
1208
- }
1209
- }
1210
- }
1211
- }
1212
- }
1213
- updateFallbackSlotVisibility(childNode);
1214
- }
1215
- }
1216
- };
1217
858
  var relocateNodes = [];
1218
859
  var markSlotContentForRelocation = (elm) => {
1219
860
  let node;
1220
861
  let hostContentNodes;
1221
862
  let j;
1222
- for (const childNode of elm.childNodes) {
863
+ const children = elm.__childNodes || elm.childNodes;
864
+ for (const childNode of children) {
1223
865
  if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
1224
- hostContentNodes = node.parentNode.childNodes;
866
+ hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
1225
867
  const slotName = childNode["s-sn"];
1226
868
  for (j = hostContentNodes.length - 1; j >= 0; j--) {
1227
869
  node = hostContentNodes[j];
1228
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD10.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
870
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD5.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
1229
871
  if (isNodeLocatedInSlot(node, slotName)) {
1230
872
  let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1231
873
  checkSlotFallbackVisibility = true;
@@ -1263,60 +905,40 @@ var markSlotContentForRelocation = (elm) => {
1263
905
  }
1264
906
  }
1265
907
  };
1266
- var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1267
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1268
- if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
1269
- return true;
1270
- }
1271
- if (nodeToRelocate.getAttribute("slot") === slotName) {
1272
- return true;
1273
- }
1274
- return false;
1275
- }
1276
- if (nodeToRelocate["s-sn"] === slotName) {
1277
- return true;
1278
- }
1279
- return slotName === "";
1280
- };
1281
908
  var nullifyVNodeRefs = (vNode) => {
1282
- if (BUILD10.vdomRef) {
909
+ if (BUILD5.vdomRef) {
1283
910
  vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1284
911
  vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1285
912
  }
1286
913
  };
1287
914
  var insertBefore = (parent, newNode, reference) => {
1288
- const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
1289
- if (BUILD10.scoped) {
1290
- updateElementScopeIds(newNode, parent);
915
+ if (BUILD5.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
916
+ addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
1291
917
  }
918
+ const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
1292
919
  return inserted;
1293
920
  };
1294
- var findScopeIds = (element) => {
1295
- const scopeIds = [];
1296
- if (element) {
1297
- scopeIds.push(
1298
- ...element["s-scs"] || [],
1299
- element["s-si"],
1300
- element["s-sc"],
1301
- ...findScopeIds(element.parentElement)
1302
- );
1303
- }
1304
- return scopeIds;
1305
- };
1306
- var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
921
+ function addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {
1307
922
  var _a;
1308
- if (element && parent && element.nodeType === 1 /* ElementNode */) {
1309
- const scopeIds = new Set(findScopeIds(parent).filter(Boolean));
1310
- if (scopeIds.size) {
1311
- (_a = element.classList) == null ? void 0 : _a.add(...element["s-scs"] = Array.from(scopeIds));
1312
- if (element["s-ol"] || iterateChildNodes) {
1313
- for (const childNode of Array.from(element.childNodes)) {
1314
- updateElementScopeIds(childNode, element, true);
923
+ let scopeId2;
924
+ if (reference && typeof slotNode["s-sn"] === "string" && !!slotNode["s-sr"] && reference.parentNode && reference.parentNode["s-sc"] && (scopeId2 = slotNode["s-si"] || reference.parentNode["s-sc"])) {
925
+ const scopeName = slotNode["s-sn"];
926
+ const hostName = slotNode["s-hn"];
927
+ (_a = newParent.classList) == null ? void 0 : _a.add(scopeId2 + "-s");
928
+ if (oldParent && oldParent.classList.contains(scopeId2 + "-s")) {
929
+ let child = (oldParent.__childNodes || oldParent.childNodes)[0];
930
+ let found = false;
931
+ while (child) {
932
+ if (child["s-sn"] !== scopeName && child["s-hn"] === hostName && !!child["s-sr"]) {
933
+ found = true;
934
+ break;
1315
935
  }
936
+ child = child.nextSibling;
1316
937
  }
938
+ if (!found) oldParent.classList.remove(scopeId2 + "-s");
1317
939
  }
1318
940
  }
1319
- };
941
+ }
1320
942
  var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1321
943
  var _a, _b, _c, _d, _e;
1322
944
  const hostElm = hostRef.$hostElement$;
@@ -1324,7 +946,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1324
946
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1325
947
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1326
948
  hostTagName = hostElm.tagName;
1327
- if (BUILD10.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
949
+ if (BUILD5.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
1328
950
  throw new Error(`The <Host> must be the single root component.
1329
951
  Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
1330
952
 
@@ -1338,7 +960,7 @@ render() {
1338
960
  }
1339
961
  `);
1340
962
  }
1341
- if (BUILD10.reflect && cmpMeta.$attrsToReflect$) {
963
+ if (BUILD5.reflect && cmpMeta.$attrsToReflect$) {
1342
964
  rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1343
965
  cmpMeta.$attrsToReflect$.map(
1344
966
  ([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
@@ -1354,24 +976,24 @@ render() {
1354
976
  rootVnode.$tag$ = null;
1355
977
  rootVnode.$flags$ |= 4 /* isHost */;
1356
978
  hostRef.$vnode$ = rootVnode;
1357
- rootVnode.$elm$ = oldVNode.$elm$ = BUILD10.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
1358
- if (BUILD10.scoped || BUILD10.shadowDom) {
979
+ rootVnode.$elm$ = oldVNode.$elm$ = BUILD5.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
980
+ if (BUILD5.scoped || BUILD5.shadowDom) {
1359
981
  scopeId = hostElm["s-sc"];
1360
982
  }
1361
983
  useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
1362
- if (BUILD10.slotRelocation) {
984
+ if (BUILD5.slotRelocation) {
1363
985
  contentRef = hostElm["s-cr"];
1364
986
  checkSlotFallbackVisibility = false;
1365
987
  }
1366
988
  patch(oldVNode, rootVnode, isInitialLoad);
1367
- if (BUILD10.slotRelocation) {
989
+ if (BUILD5.slotRelocation) {
1368
990
  plt.$flags$ |= 1 /* isTmpDisconnected */;
1369
991
  if (checkSlotRelocate) {
1370
992
  markSlotContentForRelocation(rootVnode.$elm$);
1371
993
  for (const relocateData of relocateNodes) {
1372
994
  const nodeToRelocate = relocateData.$nodeToRelocate$;
1373
995
  if (!nodeToRelocate["s-ol"]) {
1374
- const orgLocationNode = BUILD10.isDebug || BUILD10.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
996
+ const orgLocationNode = BUILD5.isDebug || BUILD5.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
1375
997
  orgLocationNode["s-nr"] = nodeToRelocate;
1376
998
  insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
1377
999
  }
@@ -1382,7 +1004,7 @@ render() {
1382
1004
  if (slotRefNode) {
1383
1005
  const parentNodeRef = slotRefNode.parentNode;
1384
1006
  let insertBeforeNode = slotRefNode.nextSibling;
1385
- if (!BUILD10.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
1007
+ if (!BUILD5.hydrateServerSide && (!BUILD5.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
1386
1008
  let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
1387
1009
  while (orgLocationNode) {
1388
1010
  let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
@@ -1401,11 +1023,11 @@ render() {
1401
1023
  }
1402
1024
  if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
1403
1025
  if (nodeToRelocate !== insertBeforeNode) {
1404
- if (!BUILD10.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
1026
+ if (!BUILD5.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
1405
1027
  nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
1406
1028
  }
1407
1029
  insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
1408
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1030
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
1409
1031
  nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
1410
1032
  }
1411
1033
  }
@@ -1427,8 +1049,9 @@ render() {
1427
1049
  plt.$flags$ &= ~1 /* isTmpDisconnected */;
1428
1050
  relocateNodes.length = 0;
1429
1051
  }
1430
- if (BUILD10.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1431
- for (const childNode of rootVnode.$elm$.childNodes) {
1052
+ if (BUILD5.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1053
+ const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
1054
+ for (const childNode of children) {
1432
1055
  if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
1433
1056
  if (isInitialLoad && childNode["s-ih"] == null) {
1434
1057
  childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
@@ -1437,37 +1060,983 @@ render() {
1437
1060
  }
1438
1061
  }
1439
1062
  }
1440
- contentRef = void 0;
1063
+ contentRef = void 0;
1064
+ };
1065
+ var slotReferenceDebugNode = (slotVNode) => doc.createComment(
1066
+ `<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
1067
+ );
1068
+ var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
1069
+ `org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
1070
+ );
1071
+
1072
+ // src/runtime/dom-extras.ts
1073
+ var patchPseudoShadowDom = (hostElementPrototype) => {
1074
+ patchCloneNode(hostElementPrototype);
1075
+ patchSlotAppendChild(hostElementPrototype);
1076
+ patchSlotAppend(hostElementPrototype);
1077
+ patchSlotPrepend(hostElementPrototype);
1078
+ patchSlotInsertAdjacentElement(hostElementPrototype);
1079
+ patchSlotInsertAdjacentHTML(hostElementPrototype);
1080
+ patchSlotInsertAdjacentText(hostElementPrototype);
1081
+ patchTextContent(hostElementPrototype);
1082
+ patchChildSlotNodes(hostElementPrototype);
1083
+ patchSlotRemoveChild(hostElementPrototype);
1084
+ };
1085
+ var patchCloneNode = (HostElementPrototype) => {
1086
+ const orgCloneNode = HostElementPrototype.cloneNode;
1087
+ HostElementPrototype.cloneNode = function(deep) {
1088
+ const srcNode = this;
1089
+ const isShadowDom = BUILD6.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
1090
+ const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
1091
+ if (BUILD6.slot && !isShadowDom && deep) {
1092
+ let i2 = 0;
1093
+ let slotted, nonRindoNode;
1094
+ const rindoPrivates = [
1095
+ "s-id",
1096
+ "s-cr",
1097
+ "s-lr",
1098
+ "s-rc",
1099
+ "s-sc",
1100
+ "s-p",
1101
+ "s-cn",
1102
+ "s-sr",
1103
+ "s-sn",
1104
+ "s-hn",
1105
+ "s-ol",
1106
+ "s-nr",
1107
+ "s-si",
1108
+ "s-rf",
1109
+ "s-scs"
1110
+ ];
1111
+ const childNodes = this.__childNodes || this.childNodes;
1112
+ for (; i2 < childNodes.length; i2++) {
1113
+ slotted = childNodes[i2]["s-nr"];
1114
+ nonRindoNode = rindoPrivates.every((privateField) => !childNodes[i2][privateField]);
1115
+ if (slotted) {
1116
+ if (BUILD6.appendChildSlotFix && clonedNode.__appendChild) {
1117
+ clonedNode.__appendChild(slotted.cloneNode(true));
1118
+ } else {
1119
+ clonedNode.appendChild(slotted.cloneNode(true));
1120
+ }
1121
+ }
1122
+ if (nonRindoNode) {
1123
+ clonedNode.appendChild(childNodes[i2].cloneNode(true));
1124
+ }
1125
+ }
1126
+ }
1127
+ return clonedNode;
1128
+ };
1129
+ };
1130
+ var patchSlotAppendChild = (HostElementPrototype) => {
1131
+ HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
1132
+ HostElementPrototype.appendChild = function(newChild) {
1133
+ const slotName = newChild["s-sn"] = getSlotName(newChild);
1134
+ const slotNode = getHostSlotNodes(this.__childNodes || this.childNodes, this.tagName, slotName)[0];
1135
+ if (slotNode) {
1136
+ addSlotRelocateNode(newChild, slotNode);
1137
+ const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
1138
+ const appendAfter = slotChildNodes[slotChildNodes.length - 1];
1139
+ const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
1140
+ updateFallbackSlotVisibility(this);
1141
+ return insertedNode;
1142
+ }
1143
+ return this.__appendChild(newChild);
1144
+ };
1145
+ };
1146
+ var patchSlotRemoveChild = (ElementPrototype) => {
1147
+ ElementPrototype.__removeChild = ElementPrototype.removeChild;
1148
+ ElementPrototype.removeChild = function(toRemove) {
1149
+ if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
1150
+ const childNodes = this.__childNodes || this.childNodes;
1151
+ const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove["s-sn"]);
1152
+ if (slotNode && toRemove.isConnected) {
1153
+ toRemove.remove();
1154
+ updateFallbackSlotVisibility(this);
1155
+ return;
1156
+ }
1157
+ }
1158
+ return this.__removeChild(toRemove);
1159
+ };
1160
+ };
1161
+ var patchSlotPrepend = (HostElementPrototype) => {
1162
+ HostElementPrototype.__prepend = HostElementPrototype.prepend;
1163
+ HostElementPrototype.prepend = function(...newChildren) {
1164
+ newChildren.forEach((newChild) => {
1165
+ if (typeof newChild === "string") {
1166
+ newChild = this.ownerDocument.createTextNode(newChild);
1167
+ }
1168
+ const slotName = newChild["s-sn"] = getSlotName(newChild);
1169
+ const childNodes = this.__childNodes || this.childNodes;
1170
+ const slotNode = getHostSlotNodes(childNodes, this.tagName, slotName)[0];
1171
+ if (slotNode) {
1172
+ addSlotRelocateNode(newChild, slotNode, true);
1173
+ const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
1174
+ const appendAfter = slotChildNodes[0];
1175
+ return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
1176
+ }
1177
+ if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
1178
+ newChild.hidden = true;
1179
+ }
1180
+ return HostElementPrototype.__prepend(newChild);
1181
+ });
1182
+ };
1183
+ };
1184
+ var patchSlotAppend = (HostElementPrototype) => {
1185
+ HostElementPrototype.__append = HostElementPrototype.append;
1186
+ HostElementPrototype.append = function(...newChildren) {
1187
+ newChildren.forEach((newChild) => {
1188
+ if (typeof newChild === "string") {
1189
+ newChild = this.ownerDocument.createTextNode(newChild);
1190
+ }
1191
+ this.appendChild(newChild);
1192
+ });
1193
+ };
1194
+ };
1195
+ var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
1196
+ const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
1197
+ HostElementPrototype.insertAdjacentHTML = function(position, text) {
1198
+ if (position !== "afterbegin" && position !== "beforeend") {
1199
+ return originalInsertAdjacentHtml.call(this, position, text);
1200
+ }
1201
+ const container = this.ownerDocument.createElement("_");
1202
+ let node;
1203
+ container.innerHTML = text;
1204
+ if (position === "afterbegin") {
1205
+ while (node = container.firstChild) {
1206
+ this.prepend(node);
1207
+ }
1208
+ } else if (position === "beforeend") {
1209
+ while (node = container.firstChild) {
1210
+ this.append(node);
1211
+ }
1212
+ }
1213
+ };
1214
+ };
1215
+ var patchSlotInsertAdjacentText = (HostElementPrototype) => {
1216
+ HostElementPrototype.insertAdjacentText = function(position, text) {
1217
+ this.insertAdjacentHTML(position, text);
1218
+ };
1219
+ };
1220
+ var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
1221
+ const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
1222
+ HostElementPrototype.insertAdjacentElement = function(position, element) {
1223
+ if (position !== "afterbegin" && position !== "beforeend") {
1224
+ return originalInsertAdjacentElement.call(this, position, element);
1225
+ }
1226
+ if (position === "afterbegin") {
1227
+ this.prepend(element);
1228
+ return element;
1229
+ } else if (position === "beforeend") {
1230
+ this.append(element);
1231
+ return element;
1232
+ }
1233
+ return element;
1234
+ };
1235
+ };
1236
+ var patchTextContent = (hostElementPrototype) => {
1237
+ patchHostOriginalAccessor("textContent", hostElementPrototype);
1238
+ Object.defineProperty(hostElementPrototype, "textContent", {
1239
+ get: function() {
1240
+ let text = "";
1241
+ const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
1242
+ childNodes.forEach((node) => text += node.textContent || "");
1243
+ return text;
1244
+ },
1245
+ set: function(value) {
1246
+ const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
1247
+ childNodes.forEach((node) => {
1248
+ if (node["s-ol"]) node["s-ol"].remove();
1249
+ node.remove();
1250
+ });
1251
+ this.insertAdjacentHTML("beforeend", value);
1252
+ }
1253
+ });
1254
+ };
1255
+ var patchChildSlotNodes = (elm) => {
1256
+ class FakeNodeList extends Array {
1257
+ item(n) {
1258
+ return this[n];
1259
+ }
1260
+ }
1261
+ patchHostOriginalAccessor("children", elm);
1262
+ Object.defineProperty(elm, "children", {
1263
+ get() {
1264
+ return this.childNodes.filter((n) => n.nodeType === 1);
1265
+ }
1266
+ });
1267
+ Object.defineProperty(elm, "childElementCount", {
1268
+ get() {
1269
+ return this.children.length;
1270
+ }
1271
+ });
1272
+ patchHostOriginalAccessor("firstChild", elm);
1273
+ Object.defineProperty(elm, "firstChild", {
1274
+ get() {
1275
+ return this.childNodes[0];
1276
+ }
1277
+ });
1278
+ patchHostOriginalAccessor("lastChild", elm);
1279
+ Object.defineProperty(elm, "lastChild", {
1280
+ get() {
1281
+ return this.childNodes[this.childNodes.length - 1];
1282
+ }
1283
+ });
1284
+ patchHostOriginalAccessor("childNodes", elm);
1285
+ Object.defineProperty(elm, "childNodes", {
1286
+ get() {
1287
+ var _a, _b;
1288
+ if (!plt.$flags$ || !((_a = getHostRef(this)) == null ? void 0 : _a.$flags$) || (plt.$flags$ & 1 /* isTmpDisconnected */) === 0 && ((_b = getHostRef(this)) == null ? void 0 : _b.$flags$) & 2 /* hasRendered */) {
1289
+ const result = new FakeNodeList();
1290
+ const nodes = getSlottedChildNodes(this.__childNodes);
1291
+ result.push(...nodes);
1292
+ return result;
1293
+ }
1294
+ return FakeNodeList.from(this.__childNodes);
1295
+ }
1296
+ });
1297
+ };
1298
+ var patchNextPrev = (node) => {
1299
+ if (!node || node.__nextSibling || !globalThis.Node) return;
1300
+ patchNextSibling(node);
1301
+ patchPreviousSibling(node);
1302
+ if (node.nodeType === Node.ELEMENT_NODE) {
1303
+ patchNextElementSibling(node);
1304
+ patchPreviousElementSibling(node);
1305
+ }
1306
+ };
1307
+ var patchNextSibling = (node) => {
1308
+ if (!node || node.__nextSibling) return;
1309
+ patchHostOriginalAccessor("nextSibling", node);
1310
+ Object.defineProperty(node, "nextSibling", {
1311
+ get: function() {
1312
+ var _a;
1313
+ const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
1314
+ const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
1315
+ if (parentNodes && index > -1) {
1316
+ return parentNodes[index + 1];
1317
+ }
1318
+ return this.__nextSibling;
1319
+ }
1320
+ });
1321
+ };
1322
+ var patchNextElementSibling = (element) => {
1323
+ if (!element || element.__nextElementSibling) return;
1324
+ patchHostOriginalAccessor("nextElementSibling", element);
1325
+ Object.defineProperty(element, "nextElementSibling", {
1326
+ get: function() {
1327
+ var _a;
1328
+ const parentEles = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
1329
+ const index = parentEles == null ? void 0 : parentEles.indexOf(this);
1330
+ if (parentEles && index > -1) {
1331
+ return parentEles[index + 1];
1332
+ }
1333
+ return this.__nextElementSibling;
1334
+ }
1335
+ });
1336
+ };
1337
+ var patchPreviousSibling = (node) => {
1338
+ if (!node || node.__previousSibling) return;
1339
+ patchHostOriginalAccessor("previousSibling", node);
1340
+ Object.defineProperty(node, "previousSibling", {
1341
+ get: function() {
1342
+ var _a;
1343
+ const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
1344
+ const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
1345
+ if (parentNodes && index > -1) {
1346
+ return parentNodes[index - 1];
1347
+ }
1348
+ return this.__previousSibling;
1349
+ }
1350
+ });
1351
+ };
1352
+ var patchPreviousElementSibling = (element) => {
1353
+ if (!element || element.__previousElementSibling) return;
1354
+ patchHostOriginalAccessor("previousElementSibling", element);
1355
+ Object.defineProperty(element, "previousElementSibling", {
1356
+ get: function() {
1357
+ var _a;
1358
+ const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
1359
+ const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
1360
+ if (parentNodes && index > -1) {
1361
+ return parentNodes[index - 1];
1362
+ }
1363
+ return this.__previousElementSibling;
1364
+ }
1365
+ });
1366
+ };
1367
+ var validElementPatches = ["children", "nextElementSibling", "previousElementSibling"];
1368
+ var validNodesPatches = [
1369
+ "childNodes",
1370
+ "firstChild",
1371
+ "lastChild",
1372
+ "nextSibling",
1373
+ "previousSibling",
1374
+ "textContent"
1375
+ ];
1376
+ function patchHostOriginalAccessor(accessorName, node) {
1377
+ let accessor;
1378
+ if (validElementPatches.includes(accessorName)) {
1379
+ accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);
1380
+ } else if (validNodesPatches.includes(accessorName)) {
1381
+ accessor = Object.getOwnPropertyDescriptor(Node.prototype, accessorName);
1382
+ }
1383
+ if (!accessor) {
1384
+ accessor = Object.getOwnPropertyDescriptor(node, accessorName);
1385
+ }
1386
+ if (accessor) Object.defineProperty(node, "__" + accessorName, accessor);
1387
+ }
1388
+
1389
+ // src/runtime/profile.ts
1390
+ import { BUILD as BUILD7 } from "@rindo/core/internal/app-data";
1391
+ var i = 0;
1392
+ var createTime = (fnName, tagName = "") => {
1393
+ if (BUILD7.profile && performance.mark) {
1394
+ const key = `st:${fnName}:${tagName}:${i++}`;
1395
+ performance.mark(key);
1396
+ return () => performance.measure(`[Rindo] ${fnName}() <${tagName}>`, key);
1397
+ } else {
1398
+ return () => {
1399
+ return;
1400
+ };
1401
+ }
1402
+ };
1403
+ var uniqueTime = (key, measureText) => {
1404
+ if (BUILD7.profile && performance.mark) {
1405
+ if (performance.getEntriesByName(key, "mark").length === 0) {
1406
+ performance.mark(key);
1407
+ }
1408
+ return () => {
1409
+ if (performance.getEntriesByName(measureText, "measure").length === 0) {
1410
+ performance.measure(measureText, key);
1411
+ }
1412
+ };
1413
+ } else {
1414
+ return () => {
1415
+ return;
1416
+ };
1417
+ }
1418
+ };
1419
+ var inspect = (ref) => {
1420
+ const hostRef = getHostRef(ref);
1421
+ if (!hostRef) {
1422
+ return void 0;
1423
+ }
1424
+ const flags = hostRef.$flags$;
1425
+ const hostElement = hostRef.$hostElement$;
1426
+ return {
1427
+ renderCount: hostRef.$renderCount$,
1428
+ flags: {
1429
+ hasRendered: !!(flags & 2 /* hasRendered */),
1430
+ hasConnected: !!(flags & 1 /* hasConnected */),
1431
+ isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */),
1432
+ isConstructingInstance: !!(flags & 8 /* isConstructingInstance */),
1433
+ isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */),
1434
+ hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */),
1435
+ hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */),
1436
+ isWatchReady: !!(flags & 128 /* isWatchReady */),
1437
+ isListenReady: !!(flags & 256 /* isListenReady */),
1438
+ needsRerender: !!(flags & 512 /* needsRerender */)
1439
+ },
1440
+ instanceValues: hostRef.$instanceValues$,
1441
+ ancestorComponent: hostRef.$ancestorComponent$,
1442
+ hostElement,
1443
+ lazyInstance: hostRef.$lazyInstance$,
1444
+ vnode: hostRef.$vnode$,
1445
+ modeName: hostRef.$modeName$,
1446
+ onReadyPromise: hostRef.$onReadyPromise$,
1447
+ onReadyResolve: hostRef.$onReadyResolve$,
1448
+ onInstancePromise: hostRef.$onInstancePromise$,
1449
+ onInstanceResolve: hostRef.$onInstanceResolve$,
1450
+ onRenderResolve: hostRef.$onRenderResolve$,
1451
+ queuedListeners: hostRef.$queuedListeners$,
1452
+ rmListeners: hostRef.$rmListeners$,
1453
+ ["s-id"]: hostElement["s-id"],
1454
+ ["s-cr"]: hostElement["s-cr"],
1455
+ ["s-lr"]: hostElement["s-lr"],
1456
+ ["s-p"]: hostElement["s-p"],
1457
+ ["s-rc"]: hostElement["s-rc"],
1458
+ ["s-sc"]: hostElement["s-sc"]
1459
+ };
1460
+ };
1461
+ var installDevTools = () => {
1462
+ if (BUILD7.devTools) {
1463
+ const rindo = win.rindo = win.rindo || {};
1464
+ const originalInspect = rindo.inspect;
1465
+ rindo.inspect = (ref) => {
1466
+ let result = inspect(ref);
1467
+ if (!result && typeof originalInspect === "function") {
1468
+ result = originalInspect(ref);
1469
+ }
1470
+ return result;
1471
+ };
1472
+ }
1473
+ };
1474
+
1475
+ // src/runtime/client-hydrate.ts
1476
+ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1477
+ const endHydrate = createTime("hydrateClient", tagName);
1478
+ const shadowRoot = hostElm.shadowRoot;
1479
+ const childRenderNodes = [];
1480
+ const slotNodes = [];
1481
+ const slottedNodes = [];
1482
+ const shadowRootNodes = BUILD8.shadowDom && shadowRoot ? [] : null;
1483
+ const vnode = newVNode(tagName, null);
1484
+ vnode.$elm$ = hostElm;
1485
+ let scopeId2;
1486
+ if (BUILD8.scoped) {
1487
+ const cmpMeta = hostRef.$cmpMeta$;
1488
+ if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
1489
+ scopeId2 = hostElm["s-sc"];
1490
+ hostElm.classList.add(scopeId2 + "-h");
1491
+ } else if (hostElm["s-sc"]) {
1492
+ delete hostElm["s-sc"];
1493
+ }
1494
+ }
1495
+ if (!plt.$orgLocNodes$) {
1496
+ initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
1497
+ }
1498
+ hostElm[HYDRATE_ID] = hostId;
1499
+ hostElm.removeAttribute(HYDRATE_ID);
1500
+ hostRef.$vnode$ = clientHydrate(
1501
+ vnode,
1502
+ childRenderNodes,
1503
+ slotNodes,
1504
+ shadowRootNodes,
1505
+ hostElm,
1506
+ hostElm,
1507
+ hostId,
1508
+ slottedNodes
1509
+ );
1510
+ let crIndex = 0;
1511
+ const crLength = childRenderNodes.length;
1512
+ let childRenderNode;
1513
+ for (crIndex; crIndex < crLength; crIndex++) {
1514
+ childRenderNode = childRenderNodes[crIndex];
1515
+ const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
1516
+ const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
1517
+ const node = childRenderNode.$elm$;
1518
+ if (!shadowRoot) {
1519
+ node["s-hn"] = tagName.toUpperCase();
1520
+ if (childRenderNode.$tag$ === "slot") {
1521
+ node["s-cr"] = hostElm["s-cr"];
1522
+ }
1523
+ }
1524
+ if (childRenderNode.$tag$ === "slot") {
1525
+ if (childRenderNode.$children$) {
1526
+ childRenderNode.$flags$ |= 2 /* isSlotFallback */;
1527
+ if (!childRenderNode.$elm$.childNodes.length) {
1528
+ childRenderNode.$children$.forEach((c) => {
1529
+ childRenderNode.$elm$.appendChild(c.$elm$);
1530
+ });
1531
+ }
1532
+ } else {
1533
+ childRenderNode.$flags$ |= 1 /* isSlotReference */;
1534
+ }
1535
+ }
1536
+ if (orgLocationNode && orgLocationNode.isConnected) {
1537
+ if (shadowRoot && orgLocationNode["s-en"] === "") {
1538
+ orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
1539
+ }
1540
+ orgLocationNode.parentNode.removeChild(orgLocationNode);
1541
+ if (!shadowRoot) {
1542
+ node["s-oo"] = parseInt(childRenderNode.$nodeId$);
1543
+ }
1544
+ }
1545
+ plt.$orgLocNodes$.delete(orgLocationId);
1546
+ }
1547
+ const hosts = [];
1548
+ const snLen = slottedNodes.length;
1549
+ let snIndex = 0;
1550
+ let slotGroup;
1551
+ let snGroupIdx;
1552
+ let snGroupLen;
1553
+ let slottedItem;
1554
+ for (snIndex; snIndex < snLen; snIndex++) {
1555
+ slotGroup = slottedNodes[snIndex];
1556
+ if (!slotGroup || !slotGroup.length) continue;
1557
+ snGroupLen = slotGroup.length;
1558
+ snGroupIdx = 0;
1559
+ for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
1560
+ slottedItem = slotGroup[snGroupIdx];
1561
+ if (!hosts[slottedItem.hostId]) {
1562
+ hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
1563
+ }
1564
+ if (!hosts[slottedItem.hostId]) continue;
1565
+ const hostEle = hosts[slottedItem.hostId];
1566
+ if (!hostEle.shadowRoot || !shadowRoot) {
1567
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
1568
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1569
+ slottedItem.slot["s-cr"] = hostEle;
1570
+ } else {
1571
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1572
+ }
1573
+ addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1574
+ if (BUILD8.experimentalSlotFixes) {
1575
+ patchNextPrev(slottedItem.node);
1576
+ }
1577
+ }
1578
+ if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
1579
+ hostEle.appendChild(slottedItem.node);
1580
+ }
1581
+ }
1582
+ }
1583
+ if (BUILD8.scoped && scopeId2 && slotNodes.length) {
1584
+ slotNodes.forEach((slot) => {
1585
+ slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
1586
+ });
1587
+ }
1588
+ if (BUILD8.shadowDom && shadowRoot) {
1589
+ let rnIdex = 0;
1590
+ const rnLen = shadowRootNodes.length;
1591
+ for (rnIdex; rnIdex < rnLen; rnIdex++) {
1592
+ shadowRoot.appendChild(shadowRootNodes[rnIdex]);
1593
+ }
1594
+ Array.from(hostElm.childNodes).forEach((node) => {
1595
+ if (node.nodeType === 8 /* CommentNode */ && typeof node["s-sn"] !== "string") {
1596
+ node.parentNode.removeChild(node);
1597
+ }
1598
+ });
1599
+ }
1600
+ hostRef.$hostElement$ = hostElm;
1601
+ endHydrate();
1602
+ };
1603
+ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
1604
+ let childNodeType;
1605
+ let childIdSplt;
1606
+ let childVNode;
1607
+ let i2;
1608
+ const scopeId2 = hostElm["s-sc"];
1609
+ if (node.nodeType === 1 /* ElementNode */) {
1610
+ childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
1611
+ if (childNodeType) {
1612
+ childIdSplt = childNodeType.split(".");
1613
+ if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
1614
+ childVNode = createSimpleVNode({
1615
+ $flags$: 0,
1616
+ $hostId$: childIdSplt[0],
1617
+ $nodeId$: childIdSplt[1],
1618
+ $depth$: childIdSplt[2],
1619
+ $index$: childIdSplt[3],
1620
+ $tag$: node.tagName.toLowerCase(),
1621
+ $elm$: node,
1622
+ // If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
1623
+ // won't try to reconcile them. Classes set on the node will be blown away.
1624
+ $attrs$: { class: node.className || "" }
1625
+ });
1626
+ childRenderNodes.push(childVNode);
1627
+ node.removeAttribute(HYDRATE_CHILD_ID);
1628
+ if (!parentVNode.$children$) {
1629
+ parentVNode.$children$ = [];
1630
+ }
1631
+ if (BUILD8.scoped && scopeId2) {
1632
+ node["s-si"] = scopeId2;
1633
+ childVNode.$attrs$.class += " " + scopeId2;
1634
+ }
1635
+ const slotName = childVNode.$elm$.getAttribute("s-sn");
1636
+ if (typeof slotName === "string") {
1637
+ if (childVNode.$tag$ === "slot-fb") {
1638
+ addSlot(
1639
+ slotName,
1640
+ childIdSplt[2],
1641
+ childVNode,
1642
+ node,
1643
+ parentVNode,
1644
+ childRenderNodes,
1645
+ slotNodes,
1646
+ shadowRootNodes,
1647
+ slottedNodes
1648
+ );
1649
+ if (BUILD8.scoped && scopeId2) {
1650
+ node.classList.add(scopeId2);
1651
+ }
1652
+ }
1653
+ childVNode.$elm$["s-sn"] = slotName;
1654
+ childVNode.$elm$.removeAttribute("s-sn");
1655
+ }
1656
+ if (childVNode.$index$ !== void 0) {
1657
+ parentVNode.$children$[childVNode.$index$] = childVNode;
1658
+ }
1659
+ parentVNode = childVNode;
1660
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
1661
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1662
+ }
1663
+ }
1664
+ }
1665
+ if (node.shadowRoot) {
1666
+ for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
1667
+ clientHydrate(
1668
+ parentVNode,
1669
+ childRenderNodes,
1670
+ slotNodes,
1671
+ shadowRootNodes,
1672
+ hostElm,
1673
+ node.shadowRoot.childNodes[i2],
1674
+ hostId,
1675
+ slottedNodes
1676
+ );
1677
+ }
1678
+ }
1679
+ const nonShadowNodes = node.__childNodes || node.childNodes;
1680
+ for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
1681
+ clientHydrate(
1682
+ parentVNode,
1683
+ childRenderNodes,
1684
+ slotNodes,
1685
+ shadowRootNodes,
1686
+ hostElm,
1687
+ nonShadowNodes[i2],
1688
+ hostId,
1689
+ slottedNodes
1690
+ );
1691
+ }
1692
+ } else if (node.nodeType === 8 /* CommentNode */) {
1693
+ childIdSplt = node.nodeValue.split(".");
1694
+ if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
1695
+ childNodeType = childIdSplt[0];
1696
+ childVNode = createSimpleVNode({
1697
+ $hostId$: childIdSplt[1],
1698
+ $nodeId$: childIdSplt[2],
1699
+ $depth$: childIdSplt[3],
1700
+ $index$: childIdSplt[4] || "0",
1701
+ $elm$: node,
1702
+ $attrs$: null,
1703
+ $children$: null,
1704
+ $key$: null,
1705
+ $name$: null,
1706
+ $tag$: null,
1707
+ $text$: null
1708
+ });
1709
+ if (childNodeType === TEXT_NODE_ID) {
1710
+ childVNode.$elm$ = node.nextSibling;
1711
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
1712
+ childVNode.$text$ = childVNode.$elm$.textContent;
1713
+ childRenderNodes.push(childVNode);
1714
+ node.remove();
1715
+ if (hostId === childVNode.$hostId$) {
1716
+ if (!parentVNode.$children$) {
1717
+ parentVNode.$children$ = [];
1718
+ }
1719
+ parentVNode.$children$[childVNode.$index$] = childVNode;
1720
+ }
1721
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
1722
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1723
+ }
1724
+ }
1725
+ } else if (childNodeType === COMMENT_NODE_ID) {
1726
+ childVNode.$elm$ = node.nextSibling;
1727
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
1728
+ childRenderNodes.push(childVNode);
1729
+ node.remove();
1730
+ }
1731
+ } else if (childVNode.$hostId$ === hostId) {
1732
+ if (childNodeType === SLOT_NODE_ID) {
1733
+ const slotName = node["s-sn"] = childIdSplt[5] || "";
1734
+ addSlot(
1735
+ slotName,
1736
+ childIdSplt[2],
1737
+ childVNode,
1738
+ node,
1739
+ parentVNode,
1740
+ childRenderNodes,
1741
+ slotNodes,
1742
+ shadowRootNodes,
1743
+ slottedNodes
1744
+ );
1745
+ } else if (childNodeType === CONTENT_REF_ID) {
1746
+ if (BUILD8.shadowDom && shadowRootNodes) {
1747
+ node.remove();
1748
+ } else if (BUILD8.slotRelocation) {
1749
+ hostElm["s-cr"] = node;
1750
+ node["s-cn"] = true;
1751
+ }
1752
+ }
1753
+ }
1754
+ }
1755
+ } else if (parentVNode && parentVNode.$tag$ === "style") {
1756
+ const vnode = newVNode(null, node.textContent);
1757
+ vnode.$elm$ = node;
1758
+ vnode.$index$ = "0";
1759
+ parentVNode.$children$ = [vnode];
1760
+ }
1761
+ return parentVNode;
1762
+ };
1763
+ var initializeDocumentHydrate = (node, orgLocNodes) => {
1764
+ if (node.nodeType === 1 /* ElementNode */) {
1765
+ const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
1766
+ if (componentId) {
1767
+ orgLocNodes.set(componentId, node);
1768
+ }
1769
+ let i2 = 0;
1770
+ if (node.shadowRoot) {
1771
+ for (; i2 < node.shadowRoot.childNodes.length; i2++) {
1772
+ initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
1773
+ }
1774
+ }
1775
+ const nonShadowNodes = node.__childNodes || node.childNodes;
1776
+ for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
1777
+ initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
1778
+ }
1779
+ } else if (node.nodeType === 8 /* CommentNode */) {
1780
+ const childIdSplt = node.nodeValue.split(".");
1781
+ if (childIdSplt[0] === ORG_LOCATION_ID) {
1782
+ orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
1783
+ node.nodeValue = "";
1784
+ node["s-en"] = childIdSplt[3];
1785
+ }
1786
+ }
1787
+ };
1788
+ var createSimpleVNode = (vnode) => {
1789
+ const defaultVNode = {
1790
+ $flags$: 0,
1791
+ $hostId$: null,
1792
+ $nodeId$: null,
1793
+ $depth$: null,
1794
+ $index$: "0",
1795
+ $elm$: null,
1796
+ $attrs$: null,
1797
+ $children$: null,
1798
+ $key$: null,
1799
+ $name$: null,
1800
+ $tag$: null,
1801
+ $text$: null
1802
+ };
1803
+ return { ...defaultVNode, ...vnode };
1804
+ };
1805
+ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
1806
+ node["s-sr"] = true;
1807
+ childVNode.$name$ = slotName || null;
1808
+ childVNode.$tag$ = "slot";
1809
+ const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
1810
+ if (BUILD8.shadowDom && shadowRootNodes) {
1811
+ const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
1812
+ if (childVNode.$name$) {
1813
+ childVNode.$elm$.setAttribute("name", slotName);
1814
+ }
1815
+ if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
1816
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1817
+ } else {
1818
+ node.parentNode.insertBefore(childVNode.$elm$, node);
1819
+ }
1820
+ addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
1821
+ node.remove();
1822
+ if (childVNode.$depth$ === "0") {
1823
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1824
+ }
1825
+ } else {
1826
+ const slot = childVNode.$elm$;
1827
+ const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
1828
+ addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
1829
+ if (shouldMove) {
1830
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1831
+ }
1832
+ childRenderNodes.push(childVNode);
1833
+ }
1834
+ slotNodes.push(childVNode);
1835
+ if (!parentVNode.$children$) {
1836
+ parentVNode.$children$ = [];
1837
+ }
1838
+ parentVNode.$children$[childVNode.$index$] = childVNode;
1839
+ }
1840
+ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
1841
+ let slottedNode = slotNode.nextSibling;
1842
+ slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
1843
+ while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(".") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {
1844
+ slottedNode["s-sn"] = slotName;
1845
+ slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1846
+ slottedNode = slottedNode.nextSibling;
1847
+ }
1848
+ };
1849
+
1850
+ // src/runtime/initialize-component.ts
1851
+ import { BUILD as BUILD16 } from "@rindo/core/internal/app-data";
1852
+
1853
+ // src/runtime/mode.ts
1854
+ var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
1855
+ var setMode = (handler) => modeResolutionChain.push(handler);
1856
+ var getMode = (ref) => getHostRef(ref).$modeName$;
1857
+
1858
+ // src/runtime/proxy-component.ts
1859
+ import { BUILD as BUILD15 } from "@rindo/core/internal/app-data";
1860
+
1861
+ // src/runtime/set-value.ts
1862
+ import { BUILD as BUILD14 } from "@rindo/core/internal/app-data";
1863
+
1864
+ // src/runtime/parse-property-value.ts
1865
+ import { BUILD as BUILD9 } from "@rindo/core/internal/app-data";
1866
+ var parsePropertyValue = (propValue, propType) => {
1867
+ if (propValue != null && !isComplexType(propValue)) {
1868
+ if (BUILD9.propBoolean && propType & 4 /* Boolean */) {
1869
+ return propValue === "false" ? false : propValue === "" || !!propValue;
1870
+ }
1871
+ if (BUILD9.propNumber && propType & 2 /* Number */) {
1872
+ return parseFloat(propValue);
1873
+ }
1874
+ if (BUILD9.propString && propType & 1 /* String */) {
1875
+ return String(propValue);
1876
+ }
1877
+ return propValue;
1878
+ }
1879
+ return propValue;
1880
+ };
1881
+
1882
+ // src/runtime/update-component.ts
1883
+ import { BUILD as BUILD13, NAMESPACE } from "@rindo/core/internal/app-data";
1884
+
1885
+ // src/runtime/event-emitter.ts
1886
+ import { BUILD as BUILD11 } from "@rindo/core/internal/app-data";
1887
+
1888
+ // src/runtime/element.ts
1889
+ import { BUILD as BUILD10 } from "@rindo/core/internal/app-data";
1890
+ var getElement = (ref) => BUILD10.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
1891
+
1892
+ // src/runtime/event-emitter.ts
1893
+ var createEvent = (ref, name, flags) => {
1894
+ const elm = getElement(ref);
1895
+ return {
1896
+ emit: (detail) => {
1897
+ if (BUILD11.isDev && !elm.isConnected) {
1898
+ consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
1899
+ }
1900
+ return emitEvent(elm, name, {
1901
+ bubbles: !!(flags & 4 /* Bubbles */),
1902
+ composed: !!(flags & 2 /* Composed */),
1903
+ cancelable: !!(flags & 1 /* Cancellable */),
1904
+ detail
1905
+ });
1906
+ }
1907
+ };
1908
+ };
1909
+ var emitEvent = (elm, name, opts) => {
1910
+ const ev = plt.ce(name, opts);
1911
+ elm.dispatchEvent(ev);
1912
+ return ev;
1913
+ };
1914
+
1915
+ // src/runtime/styles.ts
1916
+ import { BUILD as BUILD12 } from "@rindo/core/internal/app-data";
1917
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
1918
+ var registerStyle = (scopeId2, cssText, allowCS) => {
1919
+ let style = styles.get(scopeId2);
1920
+ if (supportsConstructableStylesheets && allowCS) {
1921
+ style = style || new CSSStyleSheet();
1922
+ if (typeof style === "string") {
1923
+ style = cssText;
1924
+ } else {
1925
+ style.replaceSync(cssText);
1926
+ }
1927
+ } else {
1928
+ style = cssText;
1929
+ }
1930
+ styles.set(scopeId2, style);
1931
+ };
1932
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
1933
+ var _a;
1934
+ const scopeId2 = getScopeId(cmpMeta, mode);
1935
+ const style = styles.get(scopeId2);
1936
+ if (!BUILD12.attachStyles) {
1937
+ return scopeId2;
1938
+ }
1939
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
1940
+ if (style) {
1941
+ if (typeof style === "string") {
1942
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
1943
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1944
+ let styleElm;
1945
+ if (!appliedStyles) {
1946
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1947
+ }
1948
+ if (!appliedStyles.has(scopeId2)) {
1949
+ if (BUILD12.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1950
+ styleElm.innerHTML = style;
1951
+ } else {
1952
+ styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
1953
+ styleElm.innerHTML = style;
1954
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
1955
+ if (nonce != null) {
1956
+ styleElm.setAttribute("nonce", nonce);
1957
+ }
1958
+ if ((BUILD12.hydrateServerSide || BUILD12.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1959
+ styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
1960
+ }
1961
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
1962
+ if (styleContainerNode.nodeName === "HEAD") {
1963
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
1964
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
1965
+ styleContainerNode.insertBefore(styleElm, referenceNode2);
1966
+ } else if ("host" in styleContainerNode) {
1967
+ if (supportsConstructableStylesheets) {
1968
+ const stylesheet = new CSSStyleSheet();
1969
+ stylesheet.replaceSync(style);
1970
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
1971
+ } else {
1972
+ const existingStyleContainer = styleContainerNode.querySelector("style");
1973
+ if (existingStyleContainer) {
1974
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
1975
+ } else {
1976
+ styleContainerNode.prepend(styleElm);
1977
+ }
1978
+ }
1979
+ } else {
1980
+ styleContainerNode.append(styleElm);
1981
+ }
1982
+ }
1983
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
1984
+ styleContainerNode.insertBefore(styleElm, null);
1985
+ }
1986
+ }
1987
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1988
+ styleElm.innerHTML += SLOT_FB_CSS;
1989
+ }
1990
+ if (appliedStyles) {
1991
+ appliedStyles.add(scopeId2);
1992
+ }
1993
+ }
1994
+ } else if (BUILD12.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
1995
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
1996
+ }
1997
+ }
1998
+ return scopeId2;
1441
1999
  };
1442
- var slotReferenceDebugNode = (slotVNode) => doc.createComment(
1443
- `<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
1444
- );
1445
- var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
1446
- `org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
1447
- );
2000
+ var attachStyles = (hostRef) => {
2001
+ const cmpMeta = hostRef.$cmpMeta$;
2002
+ const elm = hostRef.$hostElement$;
2003
+ const flags = cmpMeta.$flags$;
2004
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
2005
+ const scopeId2 = addStyle(
2006
+ BUILD12.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
2007
+ cmpMeta,
2008
+ hostRef.$modeName$
2009
+ );
2010
+ if ((BUILD12.shadowDom || BUILD12.scoped) && BUILD12.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
2011
+ elm["s-sc"] = scopeId2;
2012
+ elm.classList.add(scopeId2 + "-h");
2013
+ }
2014
+ endAttachStyles();
2015
+ };
2016
+ var getScopeId = (cmp, mode) => "sc-" + (BUILD12.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
1448
2017
 
1449
2018
  // src/runtime/update-component.ts
1450
2019
  var attachToAncestor = (hostRef, ancestorComponent) => {
1451
- if (BUILD11.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
2020
+ if (BUILD13.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
1452
2021
  ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
1453
2022
  }
1454
2023
  };
1455
2024
  var scheduleUpdate = (hostRef, isInitialLoad) => {
1456
- if (BUILD11.taskQueue && BUILD11.updatable) {
2025
+ if (BUILD13.taskQueue && BUILD13.updatable) {
1457
2026
  hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1458
2027
  }
1459
- if (BUILD11.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
2028
+ if (BUILD13.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1460
2029
  hostRef.$flags$ |= 512 /* needsRerender */;
1461
2030
  return;
1462
2031
  }
1463
2032
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1464
2033
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1465
- return BUILD11.taskQueue ? writeTask(dispatch) : dispatch();
2034
+ return BUILD13.taskQueue ? writeTask(dispatch) : dispatch();
1466
2035
  };
1467
2036
  var dispatchHooks = (hostRef, isInitialLoad) => {
1468
2037
  const elm = hostRef.$hostElement$;
1469
2038
  const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
1470
- const instance = BUILD11.lazyLoad ? hostRef.$lazyInstance$ : elm;
2039
+ const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : elm;
1471
2040
  if (!instance) {
1472
2041
  throw new Error(
1473
2042
  `Can't render component <${elm.tagName.toLowerCase()} /> with invalid Rindo runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://rindojs.web.app/docs/custom-elements#externalruntime`
@@ -1475,7 +2044,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1475
2044
  }
1476
2045
  let maybePromise;
1477
2046
  if (isInitialLoad) {
1478
- if (BUILD11.lazyLoad && BUILD11.hostListener) {
2047
+ if (BUILD13.lazyLoad && BUILD13.hostListener) {
1479
2048
  hostRef.$flags$ |= 256 /* isListenReady */;
1480
2049
  if (hostRef.$queuedListeners$) {
1481
2050
  hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
@@ -1483,17 +2052,17 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
1483
2052
  }
1484
2053
  }
1485
2054
  emitLifecycleEvent(elm, "componentWillLoad");
1486
- if (BUILD11.cmpWillLoad) {
2055
+ if (BUILD13.cmpWillLoad) {
1487
2056
  maybePromise = safeCall(instance, "componentWillLoad");
1488
2057
  }
1489
2058
  } else {
1490
2059
  emitLifecycleEvent(elm, "componentWillUpdate");
1491
- if (BUILD11.cmpWillUpdate) {
2060
+ if (BUILD13.cmpWillUpdate) {
1492
2061
  maybePromise = safeCall(instance, "componentWillUpdate");
1493
2062
  }
1494
2063
  }
1495
2064
  emitLifecycleEvent(elm, "componentWillRender");
1496
- if (BUILD11.cmpWillRender) {
2065
+ if (BUILD13.cmpWillRender) {
1497
2066
  maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
1498
2067
  }
1499
2068
  endSchedule();
@@ -1509,23 +2078,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1509
2078
  const elm = hostRef.$hostElement$;
1510
2079
  const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
1511
2080
  const rc = elm["s-rc"];
1512
- if (BUILD11.style && isInitialLoad) {
2081
+ if (BUILD13.style && isInitialLoad) {
1513
2082
  attachStyles(hostRef);
1514
2083
  }
1515
2084
  const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
1516
- if (BUILD11.isDev) {
2085
+ if (BUILD13.isDev) {
1517
2086
  hostRef.$flags$ |= 1024 /* devOnRender */;
1518
2087
  }
1519
- if (BUILD11.hydrateServerSide) {
2088
+ if (BUILD13.hydrateServerSide) {
1520
2089
  await callRender(hostRef, instance, elm, isInitialLoad);
1521
2090
  } else {
1522
2091
  callRender(hostRef, instance, elm, isInitialLoad);
1523
2092
  }
1524
- if (BUILD11.isDev) {
2093
+ if (BUILD13.isDev) {
1525
2094
  hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
1526
2095
  hostRef.$flags$ &= ~1024 /* devOnRender */;
1527
2096
  }
1528
- if (BUILD11.hydrateServerSide) {
2097
+ if (BUILD13.hydrateServerSide) {
1529
2098
  try {
1530
2099
  serverSideConnected(elm);
1531
2100
  if (isInitialLoad) {
@@ -1539,13 +2108,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1539
2108
  consoleError(e, elm);
1540
2109
  }
1541
2110
  }
1542
- if (BUILD11.asyncLoading && rc) {
2111
+ if (BUILD13.asyncLoading && rc) {
1543
2112
  rc.map((cb) => cb());
1544
2113
  elm["s-rc"] = void 0;
1545
2114
  }
1546
2115
  endRender();
1547
2116
  endUpdate();
1548
- if (BUILD11.asyncLoading) {
2117
+ if (BUILD13.asyncLoading) {
1549
2118
  const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
1550
2119
  const postUpdate = () => postUpdateComponent(hostRef);
1551
2120
  if (childrenPromises.length === 0) {
@@ -1561,10 +2130,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
1561
2130
  };
1562
2131
  var renderingRef = null;
1563
2132
  var callRender = (hostRef, instance, elm, isInitialLoad) => {
1564
- const allRenderFn = BUILD11.allRenderFn ? true : false;
1565
- const lazyLoad = BUILD11.lazyLoad ? true : false;
1566
- const taskQueue = BUILD11.taskQueue ? true : false;
1567
- const updatable = BUILD11.updatable ? true : false;
2133
+ const allRenderFn = BUILD13.allRenderFn ? true : false;
2134
+ const lazyLoad = BUILD13.lazyLoad ? true : false;
2135
+ const taskQueue = BUILD13.taskQueue ? true : false;
2136
+ const updatable = BUILD13.updatable ? true : false;
1568
2137
  try {
1569
2138
  renderingRef = instance;
1570
2139
  instance = allRenderFn ? instance.render() : instance.render && instance.render();
@@ -1574,9 +2143,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
1574
2143
  if (updatable || lazyLoad) {
1575
2144
  hostRef.$flags$ |= 2 /* hasRendered */;
1576
2145
  }
1577
- if (BUILD11.hasRenderFn || BUILD11.reflect) {
1578
- if (BUILD11.vdomRender || BUILD11.reflect) {
1579
- if (BUILD11.hydrateServerSide) {
2146
+ if (BUILD13.hasRenderFn || BUILD13.reflect) {
2147
+ if (BUILD13.vdomRender || BUILD13.reflect) {
2148
+ if (BUILD13.hydrateServerSide) {
1580
2149
  return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
1581
2150
  } else {
1582
2151
  renderVdom(hostRef, instance, isInitialLoad);
@@ -1601,57 +2170,57 @@ var postUpdateComponent = (hostRef) => {
1601
2170
  const tagName = hostRef.$cmpMeta$.$tagName$;
1602
2171
  const elm = hostRef.$hostElement$;
1603
2172
  const endPostUpdate = createTime("postUpdate", tagName);
1604
- const instance = BUILD11.lazyLoad ? hostRef.$lazyInstance$ : elm;
2173
+ const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : elm;
1605
2174
  const ancestorComponent = hostRef.$ancestorComponent$;
1606
- if (BUILD11.cmpDidRender) {
1607
- if (BUILD11.isDev) {
2175
+ if (BUILD13.cmpDidRender) {
2176
+ if (BUILD13.isDev) {
1608
2177
  hostRef.$flags$ |= 1024 /* devOnRender */;
1609
2178
  }
1610
2179
  safeCall(instance, "componentDidRender");
1611
- if (BUILD11.isDev) {
2180
+ if (BUILD13.isDev) {
1612
2181
  hostRef.$flags$ &= ~1024 /* devOnRender */;
1613
2182
  }
1614
2183
  }
1615
2184
  emitLifecycleEvent(elm, "componentDidRender");
1616
2185
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1617
2186
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1618
- if (BUILD11.asyncLoading && BUILD11.cssAnnotations) {
2187
+ if (BUILD13.asyncLoading && BUILD13.cssAnnotations) {
1619
2188
  addHydratedFlag(elm);
1620
2189
  }
1621
- if (BUILD11.cmpDidLoad) {
1622
- if (BUILD11.isDev) {
2190
+ if (BUILD13.cmpDidLoad) {
2191
+ if (BUILD13.isDev) {
1623
2192
  hostRef.$flags$ |= 2048 /* devOnDidLoad */;
1624
2193
  }
1625
2194
  safeCall(instance, "componentDidLoad");
1626
- if (BUILD11.isDev) {
2195
+ if (BUILD13.isDev) {
1627
2196
  hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
1628
2197
  }
1629
2198
  }
1630
2199
  emitLifecycleEvent(elm, "componentDidLoad");
1631
2200
  endPostUpdate();
1632
- if (BUILD11.asyncLoading) {
2201
+ if (BUILD13.asyncLoading) {
1633
2202
  hostRef.$onReadyResolve$(elm);
1634
2203
  if (!ancestorComponent) {
1635
2204
  appDidLoad(tagName);
1636
2205
  }
1637
2206
  }
1638
2207
  } else {
1639
- if (BUILD11.cmpDidUpdate) {
1640
- if (BUILD11.isDev) {
2208
+ if (BUILD13.cmpDidUpdate) {
2209
+ if (BUILD13.isDev) {
1641
2210
  hostRef.$flags$ |= 1024 /* devOnRender */;
1642
2211
  }
1643
2212
  safeCall(instance, "componentDidUpdate");
1644
- if (BUILD11.isDev) {
2213
+ if (BUILD13.isDev) {
1645
2214
  hostRef.$flags$ &= ~1024 /* devOnRender */;
1646
2215
  }
1647
2216
  }
1648
2217
  emitLifecycleEvent(elm, "componentDidUpdate");
1649
2218
  endPostUpdate();
1650
2219
  }
1651
- if (BUILD11.method && BUILD11.lazyLoad) {
2220
+ if (BUILD13.method && BUILD13.lazyLoad) {
1652
2221
  hostRef.$onInstanceResolve$(elm);
1653
2222
  }
1654
- if (BUILD11.asyncLoading) {
2223
+ if (BUILD13.asyncLoading) {
1655
2224
  if (hostRef.$onRenderResolve$) {
1656
2225
  hostRef.$onRenderResolve$();
1657
2226
  hostRef.$onRenderResolve$ = void 0;
@@ -1663,7 +2232,7 @@ var postUpdateComponent = (hostRef) => {
1663
2232
  }
1664
2233
  };
1665
2234
  var forceUpdate = (ref) => {
1666
- if (BUILD11.updatable && (Build.isBrowser || Build.isTesting)) {
2235
+ if (BUILD13.updatable && (Build.isBrowser || Build.isTesting)) {
1667
2236
  const hostRef = getHostRef(ref);
1668
2237
  const isConnected = hostRef.$hostElement$.isConnected;
1669
2238
  if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
@@ -1674,14 +2243,14 @@ var forceUpdate = (ref) => {
1674
2243
  return false;
1675
2244
  };
1676
2245
  var appDidLoad = (who) => {
1677
- if (BUILD11.cssAnnotations) {
2246
+ if (BUILD13.cssAnnotations) {
1678
2247
  addHydratedFlag(doc.documentElement);
1679
2248
  }
1680
- if (BUILD11.asyncQueue) {
2249
+ if (BUILD13.asyncQueue) {
1681
2250
  plt.$flags$ |= 2 /* appLoaded */;
1682
2251
  }
1683
2252
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
1684
- if (BUILD11.profile && performance.measure) {
2253
+ if (BUILD13.profile && performance.measure) {
1685
2254
  performance.measure(`[Rindo] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
1686
2255
  }
1687
2256
  };
@@ -1696,7 +2265,7 @@ var safeCall = (instance, method, arg) => {
1696
2265
  return void 0;
1697
2266
  };
1698
2267
  var emitLifecycleEvent = (elm, lifecycleName) => {
1699
- if (BUILD11.lifecycleDOMEvents) {
2268
+ if (BUILD13.lifecycleDOMEvents) {
1700
2269
  emitEvent(elm, "rindo_" + lifecycleName, {
1701
2270
  bubbles: true,
1702
2271
  composed: true,
@@ -1708,7 +2277,7 @@ var emitLifecycleEvent = (elm, lifecycleName) => {
1708
2277
  };
1709
2278
  var addHydratedFlag = (elm) => {
1710
2279
  var _a, _b;
1711
- return BUILD11.hydratedClass ? elm.classList.add((_a = BUILD11.hydratedSelectorName) != null ? _a : "hydrated") : BUILD11.hydratedAttribute ? elm.setAttribute((_b = BUILD11.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
2280
+ return BUILD13.hydratedClass ? elm.classList.add((_a = BUILD13.hydratedSelectorName) != null ? _a : "hydrated") : BUILD13.hydratedAttribute ? elm.setAttribute((_b = BUILD13.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
1712
2281
  };
1713
2282
  var serverSideConnected = (elm) => {
1714
2283
  const children = elm.children;
@@ -1727,21 +2296,21 @@ var serverSideConnected = (elm) => {
1727
2296
  var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1728
2297
  var setValue = (ref, propName, newVal, cmpMeta) => {
1729
2298
  const hostRef = getHostRef(ref);
1730
- if (BUILD12.lazyLoad && !hostRef) {
2299
+ if (BUILD14.lazyLoad && !hostRef) {
1731
2300
  throw new Error(
1732
2301
  `Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Rindo runtime. This usually happens when integrating a 3rd party Rindo component with another Rindo component or application.`
1733
2302
  );
1734
2303
  }
1735
- const elm = BUILD12.lazyLoad ? hostRef.$hostElement$ : ref;
2304
+ const elm = BUILD14.lazyLoad ? hostRef.$hostElement$ : ref;
1736
2305
  const oldVal = hostRef.$instanceValues$.get(propName);
1737
2306
  const flags = hostRef.$flags$;
1738
- const instance = BUILD12.lazyLoad ? hostRef.$lazyInstance$ : elm;
2307
+ const instance = BUILD14.lazyLoad ? hostRef.$lazyInstance$ : elm;
1739
2308
  newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1740
2309
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1741
2310
  const didValueChange = newVal !== oldVal && !areBothNaN;
1742
- if ((!BUILD12.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
2311
+ if ((!BUILD14.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
1743
2312
  hostRef.$instanceValues$.set(propName, newVal);
1744
- if (BUILD12.isDev) {
2313
+ if (BUILD14.isDev) {
1745
2314
  if (hostRef.$flags$ & 1024 /* devOnRender */) {
1746
2315
  consoleDevWarn(
1747
2316
  `The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
@@ -1764,8 +2333,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1764
2333
  );
1765
2334
  }
1766
2335
  }
1767
- if (!BUILD12.lazyLoad || instance) {
1768
- if (BUILD12.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
2336
+ if (!BUILD14.lazyLoad || instance) {
2337
+ if (BUILD14.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1769
2338
  const watchMethods = cmpMeta.$watchers$[propName];
1770
2339
  if (watchMethods) {
1771
2340
  watchMethods.map((watchMethodName) => {
@@ -1777,8 +2346,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1777
2346
  });
1778
2347
  }
1779
2348
  }
1780
- if (BUILD12.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1781
- if (BUILD12.cmpShouldUpdate && instance.componentShouldUpdate) {
2349
+ if (BUILD14.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
2350
+ if (BUILD14.cmpShouldUpdate && instance.componentShouldUpdate) {
1782
2351
  if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
1783
2352
  return;
1784
2353
  }
@@ -1793,59 +2362,105 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1793
2362
  var proxyComponent = (Cstr, cmpMeta, flags) => {
1794
2363
  var _a, _b;
1795
2364
  const prototype = Cstr.prototype;
1796
- if (BUILD13.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
2365
+ if (BUILD15.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
1797
2366
  FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
1798
2367
  const originalFormAssociatedCallback = prototype[cbName];
1799
2368
  Object.defineProperty(prototype, cbName, {
1800
2369
  value(...args) {
1801
2370
  const hostRef = getHostRef(this);
1802
- const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : this;
2371
+ const instance = BUILD15.lazyLoad ? hostRef.$lazyInstance$ : this;
1803
2372
  if (!instance) {
1804
2373
  hostRef.$onReadyPromise$.then((asyncInstance) => {
1805
2374
  const cb = asyncInstance[cbName];
1806
2375
  typeof cb === "function" && cb.call(asyncInstance, ...args);
1807
2376
  });
1808
2377
  } else {
1809
- const cb = BUILD13.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
2378
+ const cb = BUILD15.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
1810
2379
  typeof cb === "function" && cb.call(instance, ...args);
1811
2380
  }
1812
2381
  }
1813
2382
  });
1814
2383
  });
1815
2384
  }
1816
- if (BUILD13.member && cmpMeta.$members$ || BUILD13.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
1817
- if (BUILD13.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
2385
+ if (BUILD15.member && cmpMeta.$members$ || BUILD15.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
2386
+ if (BUILD15.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
1818
2387
  cmpMeta.$watchers$ = Cstr.watchers;
1819
2388
  }
1820
2389
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
1821
2390
  members.map(([memberName, [memberFlags]]) => {
1822
- if ((BUILD13.prop || BUILD13.state) && (memberFlags & 31 /* Prop */ || (!BUILD13.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
1823
- Object.defineProperty(prototype, memberName, {
1824
- get() {
1825
- return getValue(this, memberName);
1826
- },
1827
- set(newValue) {
1828
- if (BUILD13.isDev) {
1829
- const ref = getHostRef(this);
1830
- if (
1831
- // we are proxying the instance (not element)
1832
- (flags & 1 /* isElementConstructor */) === 0 && // the element is not constructing
1833
- (ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop
1834
- (memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable
1835
- (memberFlags & 1024 /* Mutable */) === 0
1836
- ) {
1837
- consoleDevWarn(
1838
- `@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.
2391
+ if ((BUILD15.prop || BUILD15.state) && (memberFlags & 31 /* Prop */ || (!BUILD15.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
2392
+ if ((memberFlags & 2048 /* Getter */) === 0) {
2393
+ Object.defineProperty(prototype, memberName, {
2394
+ get() {
2395
+ return getValue(this, memberName);
2396
+ },
2397
+ set(newValue) {
2398
+ if (BUILD15.isDev) {
2399
+ const ref = getHostRef(this);
2400
+ if (
2401
+ // we are proxying the instance (not element)
2402
+ (flags & 1 /* isElementConstructor */) === 0 && // the element is not constructing
2403
+ (ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop
2404
+ (memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable
2405
+ (memberFlags & 1024 /* Mutable */) === 0
2406
+ ) {
2407
+ consoleDevWarn(
2408
+ `@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.
1839
2409
  More information: https://rindojs.web.app/docs/properties#prop-mutability`
1840
- );
2410
+ );
2411
+ }
1841
2412
  }
1842
- }
1843
- setValue(this, memberName, newValue, cmpMeta);
1844
- },
1845
- configurable: true,
1846
- enumerable: true
1847
- });
1848
- } else if (BUILD13.lazyLoad && BUILD13.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
2413
+ setValue(this, memberName, newValue, cmpMeta);
2414
+ },
2415
+ configurable: true,
2416
+ enumerable: true
2417
+ });
2418
+ } else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
2419
+ if (BUILD15.lazyLoad) {
2420
+ Object.defineProperty(prototype, memberName, {
2421
+ get() {
2422
+ const ref = getHostRef(this);
2423
+ const instance = BUILD15.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
2424
+ if (!instance) return;
2425
+ return instance[memberName];
2426
+ },
2427
+ configurable: true,
2428
+ enumerable: true
2429
+ });
2430
+ }
2431
+ if (memberFlags & 4096 /* Setter */) {
2432
+ const origSetter = Object.getOwnPropertyDescriptor(prototype, memberName).set;
2433
+ Object.defineProperty(prototype, memberName, {
2434
+ set(newValue) {
2435
+ const ref = getHostRef(this);
2436
+ if (origSetter) {
2437
+ const currentValue = ref.$hostElement$[memberName];
2438
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
2439
+ ref.$instanceValues$.set(memberName, currentValue);
2440
+ }
2441
+ origSetter.apply(this, [parsePropertyValue(newValue, cmpMeta.$members$[memberName][0])]);
2442
+ setValue(this, memberName, ref.$hostElement$[memberName], cmpMeta);
2443
+ return;
2444
+ }
2445
+ if (!ref) return;
2446
+ const setterSetVal = () => {
2447
+ const currentValue = ref.$lazyInstance$[memberName];
2448
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
2449
+ ref.$instanceValues$.set(memberName, currentValue);
2450
+ }
2451
+ ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, cmpMeta.$members$[memberName][0]);
2452
+ setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
2453
+ };
2454
+ if (ref.$lazyInstance$) {
2455
+ setterSetVal();
2456
+ } else {
2457
+ ref.$onReadyPromise$.then(() => setterSetVal());
2458
+ }
2459
+ }
2460
+ });
2461
+ }
2462
+ }
2463
+ } else if (BUILD15.lazyLoad && BUILD15.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
1849
2464
  Object.defineProperty(prototype, memberName, {
1850
2465
  value(...args) {
1851
2466
  var _a2;
@@ -1858,13 +2473,13 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
1858
2473
  });
1859
2474
  }
1860
2475
  });
1861
- if (BUILD13.observeAttribute && (!BUILD13.lazyLoad || flags & 1 /* isElementConstructor */)) {
2476
+ if (BUILD15.observeAttribute && (!BUILD15.lazyLoad || flags & 1 /* isElementConstructor */)) {
1862
2477
  const attrNameToPropName = /* @__PURE__ */ new Map();
1863
2478
  prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
1864
2479
  plt.jmp(() => {
1865
2480
  var _a2;
1866
2481
  const propName = attrNameToPropName.get(attrName);
1867
- if (this.hasOwnProperty(propName)) {
2482
+ if (this.hasOwnProperty(propName) && BUILD15.lazyLoad) {
1868
2483
  newValue = this[propName];
1869
2484
  delete this[propName];
1870
2485
  } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
@@ -1874,8 +2489,8 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
1874
2489
  const hostRef = getHostRef(this);
1875
2490
  const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
1876
2491
  if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
1877
- const elm = BUILD13.lazyLoad ? hostRef.$hostElement$ : this;
1878
- const instance = BUILD13.lazyLoad ? hostRef.$lazyInstance$ : elm;
2492
+ const elm = BUILD15.lazyLoad ? hostRef.$hostElement$ : this;
2493
+ const instance = BUILD15.lazyLoad ? hostRef.$lazyInstance$ : elm;
1879
2494
  const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
1880
2495
  entry == null ? void 0 : entry.forEach((callbackName) => {
1881
2496
  if (instance[callbackName] != null) {
@@ -1885,7 +2500,10 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
1885
2500
  }
1886
2501
  return;
1887
2502
  }
1888
- this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
2503
+ const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
2504
+ if (!propDesc.get || !!propDesc.set) {
2505
+ this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
2506
+ }
1889
2507
  });
1890
2508
  };
1891
2509
  Cstr.observedAttributes = Array.from(
@@ -1895,7 +2513,7 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
1895
2513
  var _a2;
1896
2514
  const attrName = m[1] || propName;
1897
2515
  attrNameToPropName.set(attrName, propName);
1898
- if (BUILD13.reflect && m[0] & 512 /* ReflectAttr */) {
2516
+ if (BUILD15.reflect && m[0] & 512 /* ReflectAttr */) {
1899
2517
  (_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
1900
2518
  }
1901
2519
  return attrName;
@@ -1913,7 +2531,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1913
2531
  if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1914
2532
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1915
2533
  const bundleId = cmpMeta.$lazyBundleId$;
1916
- if ((BUILD14.lazyLoad || BUILD14.hydrateClientSide) && bundleId) {
2534
+ if ((BUILD16.lazyLoad || BUILD16.hydrateClientSide) && bundleId) {
1917
2535
  const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
1918
2536
  if (CstrImport && "then" in CstrImport) {
1919
2537
  const endLoad = uniqueTime(
@@ -1928,15 +2546,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1928
2546
  if (!Cstr) {
1929
2547
  throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
1930
2548
  }
1931
- if (BUILD14.member && !Cstr.isProxied) {
1932
- if (BUILD14.watchCallback) {
2549
+ if (BUILD16.member && !Cstr.isProxied) {
2550
+ if (BUILD16.watchCallback) {
1933
2551
  cmpMeta.$watchers$ = Cstr.watchers;
1934
2552
  }
1935
2553
  proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1936
2554
  Cstr.isProxied = true;
1937
2555
  }
1938
2556
  const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
1939
- if (BUILD14.member) {
2557
+ if (BUILD16.member) {
1940
2558
  hostRef.$flags$ |= 8 /* isConstructingInstance */;
1941
2559
  }
1942
2560
  try {
@@ -1944,10 +2562,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1944
2562
  } catch (e) {
1945
2563
  consoleError(e);
1946
2564
  }
1947
- if (BUILD14.member) {
2565
+ if (BUILD16.member) {
1948
2566
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
1949
2567
  }
1950
- if (BUILD14.watchCallback) {
2568
+ if (BUILD16.watchCallback) {
1951
2569
  hostRef.$flags$ |= 128 /* isWatchReady */;
1952
2570
  }
1953
2571
  endNewInstance();
@@ -1957,24 +2575,24 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1957
2575
  const cmpTag = elm.localName;
1958
2576
  customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
1959
2577
  }
1960
- if (BUILD14.style && Cstr && Cstr.style) {
2578
+ if (BUILD16.style && Cstr && Cstr.style) {
1961
2579
  let style;
1962
2580
  if (typeof Cstr.style === "string") {
1963
2581
  style = Cstr.style;
1964
- } else if (BUILD14.mode && typeof Cstr.style !== "string") {
2582
+ } else if (BUILD16.mode && typeof Cstr.style !== "string") {
1965
2583
  hostRef.$modeName$ = computeMode(elm);
1966
2584
  if (hostRef.$modeName$) {
1967
2585
  style = Cstr.style[hostRef.$modeName$];
1968
2586
  }
1969
- if (BUILD14.hydrateServerSide && hostRef.$modeName$) {
2587
+ if (BUILD16.hydrateServerSide && hostRef.$modeName$) {
1970
2588
  elm.setAttribute("s-mode", hostRef.$modeName$);
1971
2589
  }
1972
2590
  }
1973
2591
  const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
1974
2592
  if (!styles.has(scopeId2)) {
1975
2593
  const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
1976
- if (!BUILD14.hydrateServerSide && BUILD14.shadowDom && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
1977
- BUILD14.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
2594
+ if (!BUILD16.hydrateServerSide && BUILD16.shadowDom && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
2595
+ BUILD16.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
1978
2596
  style = await import("../client/shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
1979
2597
  }
1980
2598
  registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
@@ -1984,14 +2602,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1984
2602
  }
1985
2603
  const ancestorComponent = hostRef.$ancestorComponent$;
1986
2604
  const schedule = () => scheduleUpdate(hostRef, true);
1987
- if (BUILD14.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
2605
+ if (BUILD16.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
1988
2606
  ancestorComponent["s-rc"].push(schedule);
1989
2607
  } else {
1990
2608
  schedule();
1991
2609
  }
1992
2610
  };
1993
2611
  var fireConnectedCallback = (instance) => {
1994
- if (BUILD14.lazyLoad && BUILD14.connectedCallback) {
2612
+ if (BUILD16.lazyLoad && BUILD16.connectedCallback) {
1995
2613
  safeCall(instance, "connectedCallback");
1996
2614
  }
1997
2615
  };
@@ -2002,38 +2620,41 @@ var connectedCallback = (elm) => {
2002
2620
  const hostRef = getHostRef(elm);
2003
2621
  const cmpMeta = hostRef.$cmpMeta$;
2004
2622
  const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
2005
- if (BUILD15.hostListenerTargetParent) {
2623
+ if (BUILD17.hostListenerTargetParent) {
2006
2624
  addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
2007
2625
  }
2008
2626
  if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
2009
2627
  hostRef.$flags$ |= 1 /* hasConnected */;
2010
2628
  let hostId;
2011
- if (BUILD15.hydrateClientSide) {
2629
+ if (BUILD17.hydrateClientSide) {
2012
2630
  hostId = elm.getAttribute(HYDRATE_ID);
2013
2631
  if (hostId) {
2014
- if (BUILD15.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2015
- const scopeId2 = BUILD15.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
2632
+ if (BUILD17.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2633
+ const scopeId2 = BUILD17.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
2016
2634
  elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
2635
+ } else if (BUILD17.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2636
+ const scopeId2 = getScopeId(cmpMeta, BUILD17.mode ? elm.getAttribute("s-mode") : void 0);
2637
+ elm["s-sc"] = scopeId2;
2017
2638
  }
2018
2639
  initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
2019
2640
  }
2020
2641
  }
2021
- if (BUILD15.slotRelocation && !hostId) {
2022
- if (BUILD15.hydrateServerSide || (BUILD15.slot || BUILD15.shadowDom) && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
2642
+ if (BUILD17.slotRelocation && !hostId) {
2643
+ if (BUILD17.hydrateServerSide || (BUILD17.slot || BUILD17.shadowDom) && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
2023
2644
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
2024
2645
  setContentReference(elm);
2025
2646
  }
2026
2647
  }
2027
- if (BUILD15.asyncLoading) {
2648
+ if (BUILD17.asyncLoading) {
2028
2649
  let ancestorComponent = elm;
2029
2650
  while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
2030
- if (BUILD15.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
2651
+ if (BUILD17.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
2031
2652
  attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
2032
2653
  break;
2033
2654
  }
2034
2655
  }
2035
2656
  }
2036
- if (BUILD15.prop && !BUILD15.hydrateServerSide && cmpMeta.$members$) {
2657
+ if (BUILD17.prop && !BUILD17.hydrateServerSide && cmpMeta.$members$) {
2037
2658
  Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2038
2659
  if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
2039
2660
  const value = elm[memberName];
@@ -2042,7 +2663,7 @@ var connectedCallback = (elm) => {
2042
2663
  }
2043
2664
  });
2044
2665
  }
2045
- if (BUILD15.initializeNextTick) {
2666
+ if (BUILD17.initializeNextTick) {
2046
2667
  nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
2047
2668
  } else {
2048
2669
  initializeComponent(elm, hostRef, cmpMeta);
@@ -2060,32 +2681,32 @@ var connectedCallback = (elm) => {
2060
2681
  };
2061
2682
  var setContentReference = (elm) => {
2062
2683
  const contentRefElm = elm["s-cr"] = doc.createComment(
2063
- BUILD15.isDebug ? `content-ref (host=${elm.localName})` : ""
2684
+ BUILD17.isDebug ? `content-ref (host=${elm.localName})` : ""
2064
2685
  );
2065
2686
  contentRefElm["s-cn"] = true;
2066
2687
  insertBefore(elm, contentRefElm, elm.firstChild);
2067
2688
  };
2068
2689
 
2069
2690
  // src/runtime/disconnected-callback.ts
2070
- import { BUILD as BUILD16 } from "@rindo/core/internal/app-data";
2691
+ import { BUILD as BUILD18 } from "@rindo/core/internal/app-data";
2071
2692
  var disconnectInstance = (instance) => {
2072
- if (BUILD16.lazyLoad && BUILD16.disconnectedCallback) {
2693
+ if (BUILD18.lazyLoad && BUILD18.disconnectedCallback) {
2073
2694
  safeCall(instance, "disconnectedCallback");
2074
2695
  }
2075
- if (BUILD16.cmpDidUnload) {
2696
+ if (BUILD18.cmpDidUnload) {
2076
2697
  safeCall(instance, "componentDidUnload");
2077
2698
  }
2078
2699
  };
2079
2700
  var disconnectedCallback = async (elm) => {
2080
2701
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
2081
2702
  const hostRef = getHostRef(elm);
2082
- if (BUILD16.hostListener) {
2703
+ if (BUILD18.hostListener) {
2083
2704
  if (hostRef.$rmListeners$) {
2084
2705
  hostRef.$rmListeners$.map((rmListener) => rmListener());
2085
2706
  hostRef.$rmListeners$ = void 0;
2086
2707
  }
2087
2708
  }
2088
- if (!BUILD16.lazyLoad) {
2709
+ if (!BUILD18.lazyLoad) {
2089
2710
  disconnectInstance(elm);
2090
2711
  } else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
2091
2712
  disconnectInstance(hostRef.$lazyInstance$);
@@ -2095,325 +2716,6 @@ var disconnectedCallback = async (elm) => {
2095
2716
  }
2096
2717
  };
2097
2718
 
2098
- // src/runtime/dom-extras.ts
2099
- import { BUILD as BUILD17 } from "@rindo/core/internal/app-data";
2100
- var patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => {
2101
- patchCloneNode(hostElementPrototype);
2102
- patchSlotAppendChild(hostElementPrototype);
2103
- patchSlotAppend(hostElementPrototype);
2104
- patchSlotPrepend(hostElementPrototype);
2105
- patchSlotInsertAdjacentElement(hostElementPrototype);
2106
- patchSlotInsertAdjacentHTML(hostElementPrototype);
2107
- patchSlotInsertAdjacentText(hostElementPrototype);
2108
- patchTextContent(hostElementPrototype);
2109
- patchChildSlotNodes(hostElementPrototype, descriptorPrototype);
2110
- patchSlotRemoveChild(hostElementPrototype);
2111
- };
2112
- var patchCloneNode = (HostElementPrototype) => {
2113
- const orgCloneNode = HostElementPrototype.cloneNode;
2114
- HostElementPrototype.cloneNode = function(deep) {
2115
- const srcNode = this;
2116
- const isShadowDom = BUILD17.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
2117
- const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
2118
- if (BUILD17.slot && !isShadowDom && deep) {
2119
- let i2 = 0;
2120
- let slotted, nonRindoNode;
2121
- const rindoPrivates = [
2122
- "s-id",
2123
- "s-cr",
2124
- "s-lr",
2125
- "s-rc",
2126
- "s-sc",
2127
- "s-p",
2128
- "s-cn",
2129
- "s-sr",
2130
- "s-sn",
2131
- "s-hn",
2132
- "s-ol",
2133
- "s-nr",
2134
- "s-si",
2135
- "s-rf",
2136
- "s-scs"
2137
- ];
2138
- for (; i2 < srcNode.childNodes.length; i2++) {
2139
- slotted = srcNode.childNodes[i2]["s-nr"];
2140
- nonRindoNode = rindoPrivates.every((privateField) => !srcNode.childNodes[i2][privateField]);
2141
- if (slotted) {
2142
- if (BUILD17.appendChildSlotFix && clonedNode.__appendChild) {
2143
- clonedNode.__appendChild(slotted.cloneNode(true));
2144
- } else {
2145
- clonedNode.appendChild(slotted.cloneNode(true));
2146
- }
2147
- }
2148
- if (nonRindoNode) {
2149
- clonedNode.appendChild(srcNode.childNodes[i2].cloneNode(true));
2150
- }
2151
- }
2152
- }
2153
- return clonedNode;
2154
- };
2155
- };
2156
- var patchSlotAppendChild = (HostElementPrototype) => {
2157
- HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
2158
- HostElementPrototype.appendChild = function(newChild) {
2159
- const slotName = newChild["s-sn"] = getSlotName(newChild);
2160
- const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
2161
- if (slotNode) {
2162
- const slotPlaceholder = document.createTextNode("");
2163
- slotPlaceholder["s-nr"] = newChild;
2164
- slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder);
2165
- newChild["s-ol"] = slotPlaceholder;
2166
- newChild["s-sh"] = slotNode["s-hn"];
2167
- const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
2168
- const appendAfter = slotChildNodes[slotChildNodes.length - 1];
2169
- const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
2170
- updateFallbackSlotVisibility(this);
2171
- return insertedNode;
2172
- }
2173
- return this.__appendChild(newChild);
2174
- };
2175
- };
2176
- var patchSlotRemoveChild = (ElementPrototype) => {
2177
- ElementPrototype.__removeChild = ElementPrototype.removeChild;
2178
- ElementPrototype.removeChild = function(toRemove) {
2179
- if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
2180
- const slotNode = getHostSlotNode(this.childNodes, toRemove["s-sn"], this.tagName);
2181
- if (slotNode) {
2182
- const slotChildNodes = getHostSlotChildNodes(slotNode, toRemove["s-sn"]);
2183
- const existingNode = slotChildNodes.find((n) => n === toRemove);
2184
- if (existingNode) {
2185
- existingNode.remove();
2186
- updateFallbackSlotVisibility(this);
2187
- return;
2188
- }
2189
- }
2190
- }
2191
- return this.__removeChild(toRemove);
2192
- };
2193
- };
2194
- var patchSlotPrepend = (HostElementPrototype) => {
2195
- const originalPrepend = HostElementPrototype.prepend;
2196
- HostElementPrototype.prepend = function(...newChildren) {
2197
- newChildren.forEach((newChild) => {
2198
- if (typeof newChild === "string") {
2199
- newChild = this.ownerDocument.createTextNode(newChild);
2200
- }
2201
- const slotName = newChild["s-sn"] = getSlotName(newChild);
2202
- const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
2203
- if (slotNode) {
2204
- const slotPlaceholder = document.createTextNode("");
2205
- slotPlaceholder["s-nr"] = newChild;
2206
- slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder);
2207
- newChild["s-ol"] = slotPlaceholder;
2208
- newChild["s-sh"] = slotNode["s-hn"];
2209
- const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
2210
- const appendAfter = slotChildNodes[0];
2211
- return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
2212
- }
2213
- if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
2214
- newChild.hidden = true;
2215
- }
2216
- return originalPrepend.call(this, newChild);
2217
- });
2218
- };
2219
- };
2220
- var patchSlotAppend = (HostElementPrototype) => {
2221
- HostElementPrototype.append = function(...newChildren) {
2222
- newChildren.forEach((newChild) => {
2223
- if (typeof newChild === "string") {
2224
- newChild = this.ownerDocument.createTextNode(newChild);
2225
- }
2226
- this.appendChild(newChild);
2227
- });
2228
- };
2229
- };
2230
- var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
2231
- const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
2232
- HostElementPrototype.insertAdjacentHTML = function(position, text) {
2233
- if (position !== "afterbegin" && position !== "beforeend") {
2234
- return originalInsertAdjacentHtml.call(this, position, text);
2235
- }
2236
- const container = this.ownerDocument.createElement("_");
2237
- let node;
2238
- container.innerHTML = text;
2239
- if (position === "afterbegin") {
2240
- while (node = container.firstChild) {
2241
- this.prepend(node);
2242
- }
2243
- } else if (position === "beforeend") {
2244
- while (node = container.firstChild) {
2245
- this.append(node);
2246
- }
2247
- }
2248
- };
2249
- };
2250
- var patchSlotInsertAdjacentText = (HostElementPrototype) => {
2251
- HostElementPrototype.insertAdjacentText = function(position, text) {
2252
- this.insertAdjacentHTML(position, text);
2253
- };
2254
- };
2255
- var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
2256
- const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
2257
- HostElementPrototype.insertAdjacentElement = function(position, element) {
2258
- if (position !== "afterbegin" && position !== "beforeend") {
2259
- return originalInsertAdjacentElement.call(this, position, element);
2260
- }
2261
- if (position === "afterbegin") {
2262
- this.prepend(element);
2263
- return element;
2264
- } else if (position === "beforeend") {
2265
- this.append(element);
2266
- return element;
2267
- }
2268
- return element;
2269
- };
2270
- };
2271
- var patchTextContent = (hostElementPrototype) => {
2272
- const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
2273
- Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
2274
- if (BUILD17.experimentalScopedSlotChanges) {
2275
- Object.defineProperty(hostElementPrototype, "textContent", {
2276
- // To mimic shadow root behavior, we need to return the text content of all
2277
- // nodes in a slot reference node
2278
- get() {
2279
- const slotRefNodes = getAllChildSlotNodes(this.childNodes);
2280
- const textContent = slotRefNodes.map((node) => {
2281
- var _a, _b;
2282
- const text = [];
2283
- let slotContent = node.nextSibling;
2284
- while (slotContent && slotContent["s-sn"] === node["s-sn"]) {
2285
- if (slotContent.nodeType === 3 /* TEXT_NODE */ || slotContent.nodeType === 1 /* ELEMENT_NODE */) {
2286
- text.push((_b = (_a = slotContent.textContent) == null ? void 0 : _a.trim()) != null ? _b : "");
2287
- }
2288
- slotContent = slotContent.nextSibling;
2289
- }
2290
- return text.filter((ref) => ref !== "").join(" ");
2291
- }).filter((text) => text !== "").join(" ");
2292
- return " " + textContent + " ";
2293
- },
2294
- // To mimic shadow root behavior, we need to overwrite all nodes in a slot
2295
- // reference node. If a default slot reference node exists, the text content will be
2296
- // placed there. Otherwise, the new text node will be hidden
2297
- set(value) {
2298
- const slotRefNodes = getAllChildSlotNodes(this.childNodes);
2299
- slotRefNodes.forEach((node) => {
2300
- let slotContent = node.nextSibling;
2301
- while (slotContent && slotContent["s-sn"] === node["s-sn"]) {
2302
- const tmp = slotContent;
2303
- slotContent = slotContent.nextSibling;
2304
- tmp.remove();
2305
- }
2306
- if (node["s-sn"] === "") {
2307
- const textNode = this.ownerDocument.createTextNode(value);
2308
- textNode["s-sn"] = "";
2309
- insertBefore(node.parentElement, textNode, node.nextSibling);
2310
- } else {
2311
- node.remove();
2312
- }
2313
- });
2314
- }
2315
- });
2316
- } else {
2317
- Object.defineProperty(hostElementPrototype, "textContent", {
2318
- get() {
2319
- var _a;
2320
- const slotNode = getHostSlotNode(this.childNodes, "", this.tagName);
2321
- if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
2322
- return slotNode.nextSibling.textContent;
2323
- } else if (slotNode) {
2324
- return slotNode.textContent;
2325
- } else {
2326
- return this.__textContent;
2327
- }
2328
- },
2329
- set(value) {
2330
- var _a;
2331
- const slotNode = getHostSlotNode(this.childNodes, "", this.tagName);
2332
- if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
2333
- slotNode.nextSibling.textContent = value;
2334
- } else if (slotNode) {
2335
- slotNode.textContent = value;
2336
- } else {
2337
- this.__textContent = value;
2338
- const contentRefElm = this["s-cr"];
2339
- if (contentRefElm) {
2340
- insertBefore(this, contentRefElm, this.firstChild);
2341
- }
2342
- }
2343
- }
2344
- });
2345
- }
2346
- };
2347
- var patchChildSlotNodes = (elm, cmpMeta) => {
2348
- class FakeNodeList extends Array {
2349
- item(n) {
2350
- return this[n];
2351
- }
2352
- }
2353
- if (cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
2354
- const childNodesFn = elm.__lookupGetter__("childNodes");
2355
- Object.defineProperty(elm, "children", {
2356
- get() {
2357
- return this.childNodes.map((n) => n.nodeType === 1);
2358
- }
2359
- });
2360
- Object.defineProperty(elm, "childElementCount", {
2361
- get() {
2362
- return elm.children.length;
2363
- }
2364
- });
2365
- Object.defineProperty(elm, "childNodes", {
2366
- get() {
2367
- const childNodes = childNodesFn.call(this);
2368
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0 && getHostRef(this).$flags$ & 2 /* hasRendered */) {
2369
- const result = new FakeNodeList();
2370
- for (let i2 = 0; i2 < childNodes.length; i2++) {
2371
- const slot = childNodes[i2]["s-nr"];
2372
- if (slot) {
2373
- result.push(slot);
2374
- }
2375
- }
2376
- return result;
2377
- }
2378
- return FakeNodeList.from(childNodes);
2379
- }
2380
- });
2381
- }
2382
- };
2383
- var getAllChildSlotNodes = (childNodes) => {
2384
- const slotRefNodes = [];
2385
- for (const childNode of Array.from(childNodes)) {
2386
- if (childNode["s-sr"]) {
2387
- slotRefNodes.push(childNode);
2388
- }
2389
- slotRefNodes.push(...getAllChildSlotNodes(childNode.childNodes));
2390
- }
2391
- return slotRefNodes;
2392
- };
2393
- var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
2394
- var getHostSlotNode = (childNodes, slotName, hostName) => {
2395
- let i2 = 0;
2396
- let childNode;
2397
- for (; i2 < childNodes.length; i2++) {
2398
- childNode = childNodes[i2];
2399
- if (childNode["s-sr"] && childNode["s-sn"] === slotName && childNode["s-hn"] === hostName) {
2400
- return childNode;
2401
- }
2402
- childNode = getHostSlotNode(childNode.childNodes, slotName, hostName);
2403
- if (childNode) {
2404
- return childNode;
2405
- }
2406
- }
2407
- return null;
2408
- };
2409
- var getHostSlotChildNodes = (n, slotName) => {
2410
- const childNodes = [n];
2411
- while ((n = n.nextSibling) && n["s-sn"] === slotName) {
2412
- childNodes.push(n);
2413
- }
2414
- return childNodes;
2415
- };
2416
-
2417
2719
  // src/runtime/bootstrap-custom-element.ts
2418
2720
  var defineCustomElement = (Cstr, compactMeta) => {
2419
2721
  customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));
@@ -2423,67 +2725,67 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2423
2725
  $flags$: compactMeta[0],
2424
2726
  $tagName$: compactMeta[1]
2425
2727
  };
2426
- if (BUILD18.member) {
2728
+ if (BUILD19.member) {
2427
2729
  cmpMeta.$members$ = compactMeta[2];
2428
2730
  }
2429
- if (BUILD18.hostListener) {
2731
+ if (BUILD19.hostListener) {
2430
2732
  cmpMeta.$listeners$ = compactMeta[3];
2431
2733
  }
2432
- if (BUILD18.watchCallback) {
2734
+ if (BUILD19.watchCallback) {
2433
2735
  cmpMeta.$watchers$ = Cstr.$watchers$;
2434
2736
  }
2435
- if (BUILD18.reflect) {
2737
+ if (BUILD19.reflect) {
2436
2738
  cmpMeta.$attrsToReflect$ = [];
2437
2739
  }
2438
- if (BUILD18.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2740
+ if (BUILD19.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2439
2741
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
2440
2742
  }
2441
- if (BUILD18.experimentalSlotFixes) {
2442
- if (BUILD18.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2443
- patchPseudoShadowDom(Cstr.prototype, cmpMeta);
2743
+ if (BUILD19.experimentalSlotFixes) {
2744
+ if (BUILD19.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2745
+ patchPseudoShadowDom(Cstr.prototype);
2444
2746
  }
2445
2747
  } else {
2446
- if (BUILD18.slotChildNodesFix) {
2447
- patchChildSlotNodes(Cstr.prototype, cmpMeta);
2748
+ if (BUILD19.slotChildNodesFix) {
2749
+ patchChildSlotNodes(Cstr.prototype);
2448
2750
  }
2449
- if (BUILD18.cloneNodeFix) {
2751
+ if (BUILD19.cloneNodeFix) {
2450
2752
  patchCloneNode(Cstr.prototype);
2451
2753
  }
2452
- if (BUILD18.appendChildSlotFix) {
2754
+ if (BUILD19.appendChildSlotFix) {
2453
2755
  patchSlotAppendChild(Cstr.prototype);
2454
2756
  }
2455
- if (BUILD18.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2757
+ if (BUILD19.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2456
2758
  patchTextContent(Cstr.prototype);
2457
2759
  }
2458
2760
  }
2459
2761
  const originalConnectedCallback = Cstr.prototype.connectedCallback;
2460
2762
  const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
2461
- let hasHostListenerAttached = false;
2462
2763
  Object.assign(Cstr.prototype, {
2764
+ __hasHostListenerAttached: false,
2463
2765
  __registerHost() {
2464
2766
  registerHost(this, cmpMeta);
2465
2767
  },
2466
2768
  connectedCallback() {
2467
- if (!hasHostListenerAttached) {
2769
+ if (!this.__hasHostListenerAttached) {
2468
2770
  const hostRef = getHostRef(this);
2469
2771
  addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
2470
- hasHostListenerAttached = true;
2772
+ this.__hasHostListenerAttached = true;
2471
2773
  }
2472
2774
  connectedCallback(this);
2473
- if (BUILD18.connectedCallback && originalConnectedCallback) {
2775
+ if (BUILD19.connectedCallback && originalConnectedCallback) {
2474
2776
  originalConnectedCallback.call(this);
2475
2777
  }
2476
2778
  },
2477
2779
  disconnectedCallback() {
2478
2780
  disconnectedCallback(this);
2479
- if (BUILD18.disconnectedCallback && originalDisconnectedCallback) {
2781
+ if (BUILD19.disconnectedCallback && originalDisconnectedCallback) {
2480
2782
  originalDisconnectedCallback.call(this);
2481
2783
  }
2482
2784
  },
2483
2785
  __attachShadow() {
2484
2786
  if (supportsShadow) {
2485
2787
  if (!this.shadowRoot) {
2486
- if (BUILD18.shadowDelegatesFocus) {
2788
+ if (BUILD19.shadowDelegatesFocus) {
2487
2789
  this.attachShadow({
2488
2790
  mode: "open",
2489
2791
  delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
@@ -2507,7 +2809,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
2507
2809
  return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
2508
2810
  };
2509
2811
  var forceModeUpdate = (elm) => {
2510
- if (BUILD18.style && BUILD18.mode && !BUILD18.lazyLoad) {
2812
+ if (BUILD19.style && BUILD19.mode && !BUILD19.lazyLoad) {
2511
2813
  const mode = computeMode(elm);
2512
2814
  const hostRef = getHostRef(elm);
2513
2815
  if (hostRef.$modeName$ !== mode) {
@@ -2530,7 +2832,7 @@ var forceModeUpdate = (elm) => {
2530
2832
  };
2531
2833
 
2532
2834
  // src/runtime/bootstrap-lazy.ts
2533
- import { BUILD as BUILD19 } from "@rindo/core/internal/app-data";
2835
+ import { BUILD as BUILD20 } from "@rindo/core/internal/app-data";
2534
2836
 
2535
2837
  // src/runtime/hmr-component.ts
2536
2838
  var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
@@ -2542,7 +2844,7 @@ var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
2542
2844
  // src/runtime/bootstrap-lazy.ts
2543
2845
  var bootstrapLazy = (lazyBundles, options = {}) => {
2544
2846
  var _a;
2545
- if (BUILD19.profile && performance.mark) {
2847
+ if (BUILD20.profile && performance.mark) {
2546
2848
  performance.mark("st:app:start");
2547
2849
  }
2548
2850
  installDevTools();
@@ -2558,12 +2860,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2558
2860
  let isBootstrapping = true;
2559
2861
  Object.assign(plt, options);
2560
2862
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
2561
- if (BUILD19.asyncQueue) {
2863
+ if (BUILD20.asyncQueue) {
2562
2864
  if (options.syncQueue) {
2563
2865
  plt.$flags$ |= 4 /* queueSync */;
2564
2866
  }
2565
2867
  }
2566
- if (BUILD19.hydrateClientSide) {
2868
+ if (BUILD20.hydrateClientSide) {
2567
2869
  plt.$flags$ |= 2 /* appLoaded */;
2568
2870
  }
2569
2871
  let hasSlotRelocation = false;
@@ -2579,22 +2881,22 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2579
2881
  if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
2580
2882
  hasSlotRelocation = true;
2581
2883
  }
2582
- if (BUILD19.member) {
2884
+ if (BUILD20.member) {
2583
2885
  cmpMeta.$members$ = compactMeta[2];
2584
2886
  }
2585
- if (BUILD19.hostListener) {
2887
+ if (BUILD20.hostListener) {
2586
2888
  cmpMeta.$listeners$ = compactMeta[3];
2587
2889
  }
2588
- if (BUILD19.reflect) {
2890
+ if (BUILD20.reflect) {
2589
2891
  cmpMeta.$attrsToReflect$ = [];
2590
2892
  }
2591
- if (BUILD19.watchCallback) {
2893
+ if (BUILD20.watchCallback) {
2592
2894
  cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
2593
2895
  }
2594
- if (BUILD19.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2896
+ if (BUILD20.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2595
2897
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
2596
2898
  }
2597
- const tagName = BUILD19.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
2899
+ const tagName = BUILD20.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
2598
2900
  const HostElement = class extends HTMLElement {
2599
2901
  // RindoLazyHost
2600
2902
  constructor(self) {
@@ -2602,10 +2904,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2602
2904
  this.hasRegisteredEventListeners = false;
2603
2905
  self = this;
2604
2906
  registerHost(self, cmpMeta);
2605
- if (BUILD19.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2907
+ if (BUILD20.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2606
2908
  if (supportsShadow) {
2607
2909
  if (!self.shadowRoot) {
2608
- if (BUILD19.shadowDelegatesFocus) {
2910
+ if (BUILD20.shadowDelegatesFocus) {
2609
2911
  self.attachShadow({
2610
2912
  mode: "open",
2611
2913
  delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
@@ -2620,7 +2922,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2620
2922
  );
2621
2923
  }
2622
2924
  }
2623
- } else if (!BUILD19.hydrateServerSide && !("shadowRoot" in self)) {
2925
+ } else if (!BUILD20.hydrateServerSide && !("shadowRoot" in self)) {
2624
2926
  self.shadowRoot = self;
2625
2927
  }
2626
2928
  }
@@ -2648,28 +2950,28 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2648
2950
  return getHostRef(this).$onReadyPromise$;
2649
2951
  }
2650
2952
  };
2651
- if (BUILD19.experimentalSlotFixes) {
2652
- if (BUILD19.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2653
- patchPseudoShadowDom(HostElement.prototype, cmpMeta);
2953
+ if (BUILD20.experimentalSlotFixes) {
2954
+ if (BUILD20.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2955
+ patchPseudoShadowDom(HostElement.prototype);
2654
2956
  }
2655
2957
  } else {
2656
- if (BUILD19.slotChildNodesFix) {
2657
- patchChildSlotNodes(HostElement.prototype, cmpMeta);
2958
+ if (BUILD20.slotChildNodesFix) {
2959
+ patchChildSlotNodes(HostElement.prototype);
2658
2960
  }
2659
- if (BUILD19.cloneNodeFix) {
2961
+ if (BUILD20.cloneNodeFix) {
2660
2962
  patchCloneNode(HostElement.prototype);
2661
2963
  }
2662
- if (BUILD19.appendChildSlotFix) {
2964
+ if (BUILD20.appendChildSlotFix) {
2663
2965
  patchSlotAppendChild(HostElement.prototype);
2664
2966
  }
2665
- if (BUILD19.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2967
+ if (BUILD20.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
2666
2968
  patchTextContent(HostElement.prototype);
2667
2969
  }
2668
2970
  }
2669
- if (BUILD19.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
2971
+ if (BUILD20.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
2670
2972
  HostElement.formAssociated = true;
2671
2973
  }
2672
- if (BUILD19.hotModuleReplacement) {
2974
+ if (BUILD20.hotModuleReplacement) {
2673
2975
  HostElement.prototype["s-hmr"] = function(hmrVersionId) {
2674
2976
  hmrStart(this, cmpMeta, hmrVersionId);
2675
2977
  };
@@ -2688,7 +2990,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2688
2990
  if (hasSlotRelocation) {
2689
2991
  dataStyles.textContent += SLOT_FB_CSS;
2690
2992
  }
2691
- if (BUILD19.invisiblePrehydration && (BUILD19.hydratedClass || BUILD19.hydratedAttribute)) {
2993
+ if (BUILD20.invisiblePrehydration && (BUILD20.hydratedClass || BUILD20.hydratedAttribute)) {
2692
2994
  dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
2693
2995
  }
2694
2996
  if (dataStyles.innerHTML.length) {
@@ -2704,7 +3006,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2704
3006
  if (deferredConnectedCallbacks.length) {
2705
3007
  deferredConnectedCallbacks.map((host) => host.connectedCallback());
2706
3008
  } else {
2707
- if (BUILD19.profile) {
3009
+ if (BUILD20.profile) {
2708
3010
  plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout"));
2709
3011
  } else {
2710
3012
  plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
@@ -2717,10 +3019,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
2717
3019
  var Fragment = (_, children) => children;
2718
3020
 
2719
3021
  // src/runtime/host-listener.ts
2720
- import { BUILD as BUILD20 } from "@rindo/core/internal/app-data";
3022
+ import { BUILD as BUILD21 } from "@rindo/core/internal/app-data";
2721
3023
  var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2722
- if (BUILD20.hostListener && listeners) {
2723
- if (BUILD20.hostListenerTargetParent) {
3024
+ if (BUILD21.hostListener && listeners) {
3025
+ if (BUILD21.hostListenerTargetParent) {
2724
3026
  if (attachParentListeners) {
2725
3027
  listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
2726
3028
  } else {
@@ -2728,7 +3030,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
2728
3030
  }
2729
3031
  }
2730
3032
  listeners.map(([flags, name, method]) => {
2731
- const target = BUILD20.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
3033
+ const target = BUILD21.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
2732
3034
  const handler = hostListenerProxy(hostRef, method);
2733
3035
  const opts = hostListenerOpts(flags);
2734
3036
  plt.ael(target, name, handler, opts);
@@ -2739,7 +3041,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
2739
3041
  var hostListenerProxy = (hostRef, methodName) => (ev) => {
2740
3042
  var _a;
2741
3043
  try {
2742
- if (BUILD20.lazyLoad) {
3044
+ if (BUILD21.lazyLoad) {
2743
3045
  if (hostRef.$flags$ & 256 /* isListenReady */) {
2744
3046
  (_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
2745
3047
  } else {
@@ -2753,10 +3055,10 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
2753
3055
  }
2754
3056
  };
2755
3057
  var getHostListenerTarget = (elm, flags) => {
2756
- if (BUILD20.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
2757
- if (BUILD20.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
2758
- if (BUILD20.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
2759
- if (BUILD20.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
3058
+ if (BUILD21.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
3059
+ if (BUILD21.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
3060
+ if (BUILD21.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
3061
+ if (BUILD21.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
2760
3062
  return elm.parentElement;
2761
3063
  return elm;
2762
3064
  };
@@ -2789,6 +3091,9 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
2789
3091
  childId = `${hostId}.${nodeId}`;
2790
3092
  if (nodeRef.nodeType === 1 /* ElementNode */) {
2791
3093
  nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);
3094
+ if (typeof nodeRef["s-sn"] === "string" && !nodeRef.getAttribute("slot")) {
3095
+ nodeRef.setAttribute("s-sn", nodeRef["s-sn"]);
3096
+ }
2792
3097
  } else if (nodeRef.nodeType === 3 /* TextNode */) {
2793
3098
  if (hostId === 0) {
2794
3099
  const textContent = (_a = nodeRef.nodeValue) == null ? void 0 : _a.trim();
@@ -2800,6 +3105,10 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
2800
3105
  const commentBeforeTextNode = doc2.createComment(childId);
2801
3106
  commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;
2802
3107
  insertBefore(nodeRef.parentNode, commentBeforeTextNode, nodeRef);
3108
+ } else if (nodeRef.nodeType === 8 /* CommentNode */) {
3109
+ const commentBeforeTextNode = doc2.createComment(childId);
3110
+ commentBeforeTextNode.nodeValue = `${COMMENT_NODE_ID}.${childId}`;
3111
+ nodeRef.parentNode.insertBefore(commentBeforeTextNode, nodeRef);
2803
3112
  }
2804
3113
  }
2805
3114
  let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;
@@ -2880,6 +3189,9 @@ var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, ind
2880
3189
  childElm["s-node-id"] = nodeId;
2881
3190
  if (childElm.nodeType === 1 /* ElementNode */) {
2882
3191
  childElm.setAttribute(HYDRATE_CHILD_ID, childId);
3192
+ if (typeof childElm["s-sn"] === "string" && !childElm.getAttribute("slot")) {
3193
+ childElm.setAttribute("s-sn", childElm["s-sn"]);
3194
+ }
2883
3195
  } else if (childElm.nodeType === 3 /* TextNode */) {
2884
3196
  const parentNode = childElm.parentNode;
2885
3197
  const nodeName = parentNode == null ? void 0 : parentNode.nodeName;
@@ -2924,7 +3236,7 @@ var hAsync = (nodeName, vnodeData, ...children) => {
2924
3236
  import { globalScripts } from "@rindo/core/internal/app-globals";
2925
3237
 
2926
3238
  // src/hydrate/platform/proxy-host-element.ts
2927
- import { BUILD as BUILD21 } from "@rindo/core/internal/app-data";
3239
+ import { BUILD as BUILD22 } from "@rindo/core/internal/app-data";
2928
3240
  function proxyHostElement(elm, cmpMeta) {
2929
3241
  if (typeof elm.componentOnReady !== "function") {
2930
3242
  elm.componentOnReady = componentOnReady;
@@ -2933,7 +3245,7 @@ function proxyHostElement(elm, cmpMeta) {
2933
3245
  elm.forceUpdate = forceUpdate2;
2934
3246
  }
2935
3247
  if (!elm.shadowRoot && !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
2936
- if (BUILD21.shadowDelegatesFocus) {
3248
+ if (BUILD22.shadowDelegatesFocus) {
2937
3249
  elm.attachShadow({
2938
3250
  mode: "open",
2939
3251
  delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
@@ -3247,7 +3559,7 @@ function waitingOnElementsMsg(waitingElements) {
3247
3559
  }
3248
3560
 
3249
3561
  // src/hydrate/platform/index.ts
3250
- import { BUILD as BUILD23, Env, NAMESPACE as NAMESPACE2 } from "@rindo/core/internal/app-data";
3562
+ import { BUILD as BUILD24, Env, NAMESPACE as NAMESPACE2 } from "@rindo/core/internal/app-data";
3251
3563
  var customError;
3252
3564
  var cmpModules = /* @__PURE__ */ new Map();
3253
3565
  var getModule = (tagName) => {
@@ -3333,7 +3645,7 @@ var plt = {
3333
3645
  var setPlatformHelpers = (helpers) => {
3334
3646
  Object.assign(plt, helpers);
3335
3647
  };
3336
- var supportsShadow = BUILD22.shadowDom;
3648
+ var supportsShadow = BUILD23.shadowDom;
3337
3649
  var supportsListenerOptions = false;
3338
3650
  var supportsConstructableStylesheets = false;
3339
3651
  var hostRefs = /* @__PURE__ */ new WeakMap();
@@ -3362,7 +3674,7 @@ var Build = {
3362
3674
  var styles = /* @__PURE__ */ new Map();
3363
3675
  var modeResolutionChain = [];
3364
3676
  export {
3365
- BUILD23 as BUILD,
3677
+ BUILD24 as BUILD,
3366
3678
  Build,
3367
3679
  Env,
3368
3680
  Fragment,