@dooboostore/simple-web-component 1.0.43 → 1.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/README.md +298 -49
  2. package/dist/cjs/SwcAppEngine.js +3 -1
  3. package/dist/cjs/SwcAppEngine.js.map +2 -2
  4. package/dist/cjs/decorators/addEventListener.js.map +2 -2
  5. package/dist/cjs/decorators/applyAttribute.js +30 -28
  6. package/dist/cjs/decorators/applyAttribute.js.map +2 -2
  7. package/dist/cjs/decorators/applyClass.js +57 -21
  8. package/dist/cjs/decorators/applyClass.js.map +3 -3
  9. package/dist/cjs/decorators/applyNode.js +165 -105
  10. package/dist/cjs/decorators/applyNode.js.map +2 -2
  11. package/dist/cjs/decorators/applyProperty.js +11 -28
  12. package/dist/cjs/decorators/applyProperty.js.map +2 -2
  13. package/dist/cjs/decorators/applyStyle.js +39 -15
  14. package/dist/cjs/decorators/applyStyle.js.map +3 -3
  15. package/dist/cjs/decorators/{changedAttributeThis.js → changedAttribute.js} +6 -6
  16. package/dist/cjs/decorators/changedAttribute.js.map +7 -0
  17. package/dist/cjs/decorators/elementDefine.js +37 -6
  18. package/dist/cjs/decorators/elementDefine.js.map +3 -3
  19. package/dist/cjs/decorators/emitCustomEvent.js +56 -42
  20. package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
  21. package/dist/cjs/decorators/index.js +1 -1
  22. package/dist/cjs/decorators/index.js.map +2 -2
  23. package/dist/cjs/decorators/publishSwcAppMessage.js +5 -5
  24. package/dist/cjs/decorators/publishSwcAppMessage.js.map +3 -3
  25. package/dist/cjs/decorators/query.js +96 -145
  26. package/dist/cjs/decorators/query.js.map +3 -3
  27. package/dist/cjs/decorators/queryAll.js +104 -131
  28. package/dist/cjs/decorators/queryAll.js.map +3 -3
  29. package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js +2 -0
  30. package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
  31. package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js +2 -0
  32. package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
  33. package/dist/cjs/elements/SwcAppMixin.js +17 -2
  34. package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
  35. package/dist/cjs/examples/RxJSOperatorsExample.js +285 -0
  36. package/dist/cjs/examples/RxJSOperatorsExample.js.map +7 -0
  37. package/dist/cjs/index.js +1 -0
  38. package/dist/cjs/index.js.map +2 -2
  39. package/dist/cjs/router/ElementRouter.js +4 -0
  40. package/dist/cjs/router/ElementRouter.js.map +2 -2
  41. package/dist/esm/SwcAppEngine.js +3 -1
  42. package/dist/esm/SwcAppEngine.js.map +2 -2
  43. package/dist/esm/decorators/addEventListener.js.map +2 -2
  44. package/dist/esm/decorators/applyAttribute.js +30 -28
  45. package/dist/esm/decorators/applyAttribute.js.map +2 -2
  46. package/dist/esm/decorators/applyClass.js +57 -21
  47. package/dist/esm/decorators/applyClass.js.map +3 -3
  48. package/dist/esm/decorators/applyNode.js +165 -105
  49. package/dist/esm/decorators/applyNode.js.map +2 -2
  50. package/dist/esm/decorators/applyProperty.js +11 -28
  51. package/dist/esm/decorators/applyProperty.js.map +2 -2
  52. package/dist/esm/decorators/applyStyle.js +39 -15
  53. package/dist/esm/decorators/applyStyle.js.map +3 -3
  54. package/dist/esm/decorators/{changedAttributeThis.js → changedAttribute.js} +3 -3
  55. package/dist/esm/decorators/changedAttribute.js.map +7 -0
  56. package/dist/esm/decorators/elementDefine.js +35 -4
  57. package/dist/esm/decorators/elementDefine.js.map +2 -2
  58. package/dist/esm/decorators/emitCustomEvent.js +56 -42
  59. package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
  60. package/dist/esm/decorators/index.js +1 -1
  61. package/dist/esm/decorators/index.js.map +1 -1
  62. package/dist/esm/decorators/publishSwcAppMessage.js +5 -5
  63. package/dist/esm/decorators/publishSwcAppMessage.js.map +3 -3
  64. package/dist/esm/decorators/query.js +96 -145
  65. package/dist/esm/decorators/query.js.map +3 -3
  66. package/dist/esm/decorators/queryAll.js +104 -131
  67. package/dist/esm/decorators/queryAll.js.map +3 -3
  68. package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js +2 -0
  69. package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js.map +2 -2
  70. package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js +2 -0
  71. package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
  72. package/dist/esm/elements/SwcAppMixin.js +18 -3
  73. package/dist/esm/elements/SwcAppMixin.js.map +2 -2
  74. package/dist/esm/examples/RxJSOperatorsExample.js +266 -0
  75. package/dist/esm/examples/RxJSOperatorsExample.js.map +7 -0
  76. package/dist/esm/index.js +1 -0
  77. package/dist/esm/index.js.map +2 -2
  78. package/dist/esm/router/ElementRouter.js +4 -0
  79. package/dist/esm/router/ElementRouter.js.map +2 -2
  80. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +759 -512
  81. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
  82. package/dist/types/SwcAppEngine.d.ts.map +1 -1
  83. package/dist/types/decorators/addEventListener.d.ts +17 -14
  84. package/dist/types/decorators/addEventListener.d.ts.map +1 -1
  85. package/dist/types/decorators/applyAttribute.d.ts +35 -20
  86. package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
  87. package/dist/types/decorators/applyClass.d.ts +16 -36
  88. package/dist/types/decorators/applyClass.d.ts.map +1 -1
  89. package/dist/types/decorators/applyNode.d.ts +172 -30
  90. package/dist/types/decorators/applyNode.d.ts.map +1 -1
  91. package/dist/types/decorators/applyProperty.d.ts +27 -18
  92. package/dist/types/decorators/applyProperty.d.ts.map +1 -1
  93. package/dist/types/decorators/applyStyle.d.ts +7 -7
  94. package/dist/types/decorators/applyStyle.d.ts.map +1 -1
  95. package/dist/types/decorators/{changedAttributeThis.d.ts → changedAttribute.d.ts} +2 -2
  96. package/dist/types/decorators/changedAttribute.d.ts.map +1 -0
  97. package/dist/types/decorators/elementDefine.d.ts.map +1 -1
  98. package/dist/types/decorators/emitCustomEvent.d.ts +3 -10
  99. package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
  100. package/dist/types/decorators/index.d.ts +1 -1
  101. package/dist/types/decorators/index.d.ts.map +1 -1
  102. package/dist/types/decorators/publishSwcAppMessage.d.ts +1 -1
  103. package/dist/types/decorators/publishSwcAppMessage.d.ts.map +1 -1
  104. package/dist/types/decorators/query.d.ts +3 -26
  105. package/dist/types/decorators/query.d.ts.map +1 -1
  106. package/dist/types/decorators/queryAll.d.ts +3 -20
  107. package/dist/types/decorators/queryAll.d.ts.map +1 -1
  108. package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts +1 -0
  109. package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts.map +1 -1
  110. package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +2 -0
  111. package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +1 -1
  112. package/dist/types/elements/SwcAppMixin.d.ts +4 -4
  113. package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
  114. package/dist/types/examples/RxJSOperatorsExample.d.ts +94 -0
  115. package/dist/types/examples/RxJSOperatorsExample.d.ts.map +1 -0
  116. package/dist/types/index.d.ts +1 -0
  117. package/dist/types/index.d.ts.map +1 -1
  118. package/dist/types/router/ElementRouter.d.ts.map +1 -1
  119. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +759 -512
  120. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
  121. package/package.json +3 -3
  122. package/src/SwcAppEngine.ts +3 -1
  123. package/src/decorators/addEventListener.ts +28 -24
  124. package/src/decorators/applyAttribute.ts +109 -63
  125. package/src/decorators/applyClass.ts +89 -15
  126. package/src/decorators/applyNode.ts +357 -100
  127. package/src/decorators/applyProperty.ts +42 -63
  128. package/src/decorators/applyStyle.ts +59 -11
  129. package/src/decorators/{changedAttributeThis.ts → changedAttribute.ts} +1 -1
  130. package/src/decorators/elementDefine.ts +47 -4
  131. package/src/decorators/emitCustomEvent.ts +44 -36
  132. package/src/decorators/index.ts +1 -1
  133. package/src/decorators/publishSwcAppMessage.ts +1 -1
  134. package/src/decorators/query.ts +90 -159
  135. package/src/decorators/queryAll.ts +92 -134
  136. package/src/decorators/subscribeSwcAppMessageWhileConnected.ts +1 -0
  137. package/src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts +3 -1
  138. package/src/elements/SwcAppMixin.ts +43 -24
  139. package/src/examples/RxJSOperatorsExample.ts +279 -0
  140. package/src/index.ts +2 -0
  141. package/src/router/ElementRouter.ts +4 -0
  142. package/dist/cjs/decorators/changedAttributeThis.js.map +0 -7
  143. package/dist/esm/decorators/changedAttributeThis.js.map +0 -7
  144. package/dist/types/decorators/changedAttributeThis.d.ts.map +0 -1
@@ -1158,6 +1158,7 @@ var dooboostoreSimpleWebComponent = (() => {
1158
1158
  SwcAppAside: () => SwcAppAside,
1159
1159
  SwcAppBody: () => SwcAppBody,
1160
1160
  SwcAppDiv: () => SwcAppDiv,
1161
+ SwcAppEngine: () => SwcAppEngine,
1161
1162
  SwcAppFooter: () => SwcAppFooter,
1162
1163
  SwcAppHeader: () => SwcAppHeader,
1163
1164
  SwcAppMain: () => SwcAppMain,
@@ -1166,7 +1167,6 @@ var dooboostoreSimpleWebComponent = (() => {
1166
1167
  SwcAppSection: () => SwcAppSection,
1167
1168
  SwcUtils: () => SwcUtils,
1168
1169
  addClass: () => addClass,
1169
- addClassThis: () => addClassThis,
1170
1170
  addEventListener: () => addEventListener,
1171
1171
  addEventListenerAppHost: () => addEventListenerAppHost,
1172
1172
  addEventListenerDelegate: () => addEventListenerDelegate,
@@ -1176,28 +1176,21 @@ var dooboostoreSimpleWebComponent = (() => {
1176
1176
  addEventListenerDocument: () => addEventListenerDocument,
1177
1177
  addEventListenerThis: () => addEventListenerThis,
1178
1178
  addEventListenerWindow: () => addEventListenerWindow,
1179
- afterBeginLightNodeThis: () => afterBeginLightNodeThis,
1180
- afterBeginNodeThis: () => afterBeginNodeThis,
1181
- allAppHost: () => allAppHost,
1182
- allParentHost: () => allParentHost,
1183
1179
  appendHtmlSlot: () => appendHtmlSlot,
1184
1180
  appendSlot: () => appendSlot,
1185
1181
  appendTextSlot: () => appendTextSlot,
1186
1182
  applyAttribute: () => applyAttribute,
1187
1183
  applyClass: () => applyClass,
1188
- applyClassThis: () => applyClassThis,
1189
1184
  applyNode: () => applyNode,
1190
- applyNodeThis: () => applyNodeThis,
1191
1185
  applyProperty: () => applyProperty,
1192
1186
  applySlot: () => applySlot,
1193
1187
  applyStyle: () => applyStyle,
1194
- applyStyleThis: () => applyStyleThis,
1195
1188
  attribute: () => attribute,
1196
- attributeThis: () => attributeThis,
1197
- beforeEndLightNodeThis: () => beforeEndLightNodeThis,
1198
- beforeEndNodeThis: () => beforeEndNodeThis,
1199
- beforeEndShadowNodeThis: () => beforeEndShadowNodeThis,
1200
- changedAttributeThis: () => changedAttributeThis,
1189
+ changedAttribute: () => changedAttribute,
1190
+ changedRoute: () => changedRoute,
1191
+ clearChildrenLight: () => clearChildrenLight,
1192
+ clearChildrenNode: () => clearChildrenNode,
1193
+ clearNode: () => clearNode,
1201
1194
  clearSlot: () => clearSlot,
1202
1195
  commentNode: () => commentNode,
1203
1196
  convertAttributeValue: () => convertAttributeValue,
@@ -1217,7 +1210,6 @@ var dooboostoreSimpleWebComponent = (() => {
1217
1210
  elementDefine: () => elementDefine,
1218
1211
  emit: () => emit,
1219
1212
  emitCustomEvent: () => emitCustomEvent,
1220
- emitCustomEventThis: () => emitCustomEventThis,
1221
1213
  ensureInit: () => ensureInit,
1222
1214
  event: () => event,
1223
1215
  eventDelegate: () => eventDelegate,
@@ -1260,15 +1252,17 @@ var dooboostoreSimpleWebComponent = (() => {
1260
1252
  htmlSectionElement: () => htmlSectionElement,
1261
1253
  htmlSpanElement: () => htmlSpanElement,
1262
1254
  htmlUlElement: () => htmlUlElement,
1263
- innerHtmlLightNode: () => innerHtmlLightNode,
1264
- innerHtmlLightNodeThis: () => innerHtmlLightNodeThis,
1265
- innerHtmlNode: () => innerHtmlNode,
1266
- innerHtmlNodeThis: () => innerHtmlNodeThis,
1267
- innerHtmlShadowNode: () => innerHtmlShadowNode,
1268
- innerTextLightNode: () => innerTextLightNode,
1269
- innerTextNode: () => innerTextNode,
1270
- innerTextNodeThis: () => innerTextNodeThis,
1271
- innerTextShadowNode: () => innerTextShadowNode,
1255
+ innerHtml: () => innerHtml,
1256
+ innerHtmlLight: () => innerHtmlLight,
1257
+ innerHtmlShadow: () => innerHtmlShadow,
1258
+ innerText: () => innerText,
1259
+ innerTextLight: () => innerTextLight,
1260
+ innerTextShadow: () => innerTextShadow,
1261
+ insertAfterBegin: () => insertAfterBegin,
1262
+ insertAfterBeginLight: () => insertAfterBeginLight,
1263
+ insertBeforeEnd: () => insertBeforeEnd,
1264
+ insertBeforeEndLight: () => insertBeforeEndLight,
1265
+ insertBeforeEndShadow: () => insertBeforeEndShadow,
1272
1266
  isSSR: () => isSSR,
1273
1267
  onAdopted: () => onAdopted,
1274
1268
  onAdoptedAfter: () => onAdoptedAfter,
@@ -1288,39 +1282,26 @@ var dooboostoreSimpleWebComponent = (() => {
1288
1282
  prependSlot: () => prependSlot,
1289
1283
  prependTextSlot: () => prependTextSlot,
1290
1284
  property: () => property,
1291
- propertyThis: () => propertyThis,
1292
- publish: () => publish,
1285
+ publishMessage: () => publishMessage,
1293
1286
  publishSwcAppMessage: () => publishSwcAppMessage,
1294
1287
  query: () => query,
1295
1288
  queryAll: () => queryAll,
1296
- queryAllThis: () => queryAllThis,
1297
- queryAppHost: () => queryAppHost,
1298
- queryDocument: () => queryDocument,
1299
- queryHost: () => queryHost,
1300
- queryThis: () => queryThis,
1301
- queryWindow: () => queryWindow,
1289
+ receiveMessage: () => receiveMessage,
1302
1290
  removeClass: () => removeClass,
1303
- removeClassThis: () => removeClassThis,
1304
1291
  removeSSRAttribute: () => removeSSRAttribute,
1305
1292
  removeStyle: () => removeStyle,
1306
- removeStyleThis: () => removeStyleThis,
1293
+ replaceChildren: () => replaceChildren,
1307
1294
  replaceChildrenHtmlSlot: () => replaceChildrenHtmlSlot,
1308
- replaceChildrenLightNodeThis: () => replaceChildrenLightNodeThis,
1309
- replaceChildrenNode: () => replaceChildrenNode,
1310
- replaceChildrenNodeThis: () => replaceChildrenNodeThis,
1295
+ replaceChildrenLight: () => replaceChildrenLight,
1311
1296
  replaceChildrenSlot: () => replaceChildrenSlot,
1312
1297
  replaceChildrenTextSlot: () => replaceChildrenTextSlot,
1313
1298
  resolveAttributeTargets: () => resolveAttributeTargets,
1314
1299
  resolvePropertyTargets: () => resolvePropertyTargets,
1315
1300
  setAttribute: () => setAttribute,
1316
- setAttributeThis: () => setAttributeThis,
1317
1301
  setClass: () => setClass,
1318
- setClassThis: () => setClassThis,
1319
1302
  setProperty: () => setProperty,
1320
- setPropertyThis: () => setPropertyThis,
1321
1303
  setSSRAttribute: () => setSSRAttribute,
1322
1304
  setStyle: () => setStyle,
1323
- setStyleThis: () => setStyleThis,
1324
1305
  state: () => state,
1325
1306
  subscribeSwcAppMessageWhileConnected: () => subscribeSwcAppMessageWhileConnected,
1326
1307
  subscribeSwcAppRouteChangeWhileConnected: () => subscribeSwcAppRouteChangeWhileConnected,
@@ -1337,11 +1318,8 @@ var dooboostoreSimpleWebComponent = (() => {
1337
1318
  swcAppTagName: () => swcAppTagName,
1338
1319
  textNode: () => textNode,
1339
1320
  toggleClass: () => toggleClass,
1340
- toggleClassThis: () => toggleClassThis,
1341
1321
  updateClass: () => updateClass,
1342
- updateClassThis: () => updateClassThis,
1343
- updateStyle: () => updateStyle,
1344
- updateStyleThis: () => updateStyleThis
1322
+ updateStyle: () => updateStyle
1345
1323
  });
1346
1324
  var import_reflect_metadata3 = __toESM(require_Reflect(), 1);
1347
1325
 
@@ -6573,6 +6551,155 @@ var dooboostoreSimpleWebComponent = (() => {
6573
6551
  return ReflectUtils.getMetadata(ADD_EVENT_LISTENER_METADATA_KEY, constructor);
6574
6552
  };
6575
6553
 
6554
+ // ../core/dist/esm/message/operators/debounceTime.js
6555
+ function debounceTime(duration, config) {
6556
+ return (source) => {
6557
+ return new Observable((subscriber) => {
6558
+ const setTimeoutFn = config?.setTimeout || setTimeout;
6559
+ const clearTimeoutFn = config?.clearTimeout || clearTimeout;
6560
+ let timeoutId = null;
6561
+ let lastValue;
6562
+ let hasValue = false;
6563
+ const subscription = source.subscribe({
6564
+ next: (value) => {
6565
+ clearTimeoutFn(timeoutId);
6566
+ lastValue = value;
6567
+ hasValue = true;
6568
+ timeoutId = setTimeoutFn(() => {
6569
+ if (hasValue) {
6570
+ subscriber.next(lastValue);
6571
+ hasValue = false;
6572
+ }
6573
+ }, duration);
6574
+ },
6575
+ error: (err) => {
6576
+ clearTimeoutFn(timeoutId);
6577
+ subscriber.error(err);
6578
+ },
6579
+ complete: () => {
6580
+ clearTimeoutFn(timeoutId);
6581
+ if (hasValue) {
6582
+ subscriber.next(lastValue);
6583
+ }
6584
+ subscriber.complete();
6585
+ }
6586
+ });
6587
+ return subscription;
6588
+ });
6589
+ };
6590
+ }
6591
+
6592
+ // ../core/dist/esm/message/operators/distinctUntilChanged.js
6593
+ function distinctUntilChanged(comparator) {
6594
+ return (source) => {
6595
+ return new Observable((subscriber) => {
6596
+ let hasValue = false;
6597
+ let previousValue;
6598
+ const subscription = source.subscribe({
6599
+ next: (value) => {
6600
+ const areEqual = hasValue ? comparator ? comparator(previousValue, value) : previousValue === value : false;
6601
+ if (!areEqual) {
6602
+ hasValue = true;
6603
+ previousValue = value;
6604
+ subscriber.next(value);
6605
+ }
6606
+ },
6607
+ error: (err) => {
6608
+ subscriber.error(err);
6609
+ },
6610
+ complete: () => {
6611
+ subscriber.complete();
6612
+ }
6613
+ });
6614
+ return subscription;
6615
+ });
6616
+ };
6617
+ }
6618
+
6619
+ // ../core/dist/esm/message/operators/throttleTime.js
6620
+ function throttleTime(duration, config) {
6621
+ const leading = config?.leading ?? true;
6622
+ const trailing = config?.trailing ?? false;
6623
+ const setTimeoutFn = config?.setTimeout || setTimeout;
6624
+ const clearTimeoutFn = config?.clearTimeout || clearTimeout;
6625
+ return (source) => {
6626
+ return new Observable((subscriber) => {
6627
+ let throttled = false;
6628
+ let trailingValue;
6629
+ let hasTrailingValue = false;
6630
+ let timeoutId = null;
6631
+ const endThrottle = () => {
6632
+ if (timeoutId !== null) {
6633
+ clearTimeoutFn(timeoutId);
6634
+ timeoutId = null;
6635
+ }
6636
+ throttled = false;
6637
+ if (trailing && hasTrailingValue) {
6638
+ const valueToEmit = trailingValue;
6639
+ hasTrailingValue = false;
6640
+ trailingValue = void 0;
6641
+ Promise.resolve().then(() => {
6642
+ if (!subscriber.closed) {
6643
+ subscriber.next(valueToEmit);
6644
+ startThrottle();
6645
+ }
6646
+ });
6647
+ }
6648
+ };
6649
+ const startThrottle = () => {
6650
+ if (throttled) {
6651
+ return;
6652
+ }
6653
+ throttled = true;
6654
+ timeoutId = setTimeoutFn(() => {
6655
+ endThrottle();
6656
+ }, duration);
6657
+ };
6658
+ const subscription = source.subscribe({
6659
+ next: (value) => {
6660
+ if (!throttled) {
6661
+ if (leading) {
6662
+ subscriber.next(value);
6663
+ } else if (trailing) {
6664
+ trailingValue = value;
6665
+ hasTrailingValue = true;
6666
+ }
6667
+ startThrottle();
6668
+ } else if (trailing) {
6669
+ trailingValue = value;
6670
+ hasTrailingValue = true;
6671
+ }
6672
+ },
6673
+ error: (err) => {
6674
+ if (timeoutId !== null) {
6675
+ clearTimeoutFn(timeoutId);
6676
+ timeoutId = null;
6677
+ }
6678
+ throttled = false;
6679
+ subscriber.error(err);
6680
+ },
6681
+ complete: () => {
6682
+ if (timeoutId !== null) {
6683
+ clearTimeoutFn(timeoutId);
6684
+ timeoutId = null;
6685
+ }
6686
+ if (trailing && hasTrailingValue) {
6687
+ subscriber.next(trailingValue);
6688
+ }
6689
+ subscriber.complete();
6690
+ }
6691
+ });
6692
+ return () => {
6693
+ subscription.unsubscribe();
6694
+ if (timeoutId !== null) {
6695
+ clearTimeoutFn(timeoutId);
6696
+ timeoutId = null;
6697
+ }
6698
+ };
6699
+ });
6700
+ };
6701
+ }
6702
+
6576
6703
  // src/decorators/lifecycles.ts
6577
6704
  var ON_INITIALIZE_METADATA_KEY = Symbol.for("simple-web-component:on-constructor");
6578
6705
  var ON_BEFORE_CONNECTED_METADATA_KEY = Symbol.for("simple-web-component:on-before-connected");
@@ -7077,7 +7204,7 @@ var dooboostoreSimpleWebComponent = (() => {
7077
7204
  if (!config?.targetVariableName || config?.targetVariableName && tit.variables.find((v) => v === config?.targetVariableName)) {
7078
7205
  const data = new Function("ctx", `
7079
7206
  with(ctx) {
7080
- return function(){
7207
+ return function(event){
7081
7208
  return (${this.stripWrap(tit.script)});
7082
7209
  }
7083
7210
  }
@@ -9031,18 +9158,32 @@ var dooboostoreSimpleWebComponent = (() => {
9031
9158
 
9032
9159
  // src/decorators/emitCustomEvent.ts
9033
9160
  var EMIT_CUSTOM_EVENT_METADATA_KEY = Symbol.for("simple-web-component:emit-custom-event");
9034
- function emitCustomEvent(selectorOrTarget, type, options = {}) {
9161
+ function emitCustomEvent(selectorOrTarget, typeOrPropertyKey, optionsOrDescriptor) {
9162
+ if (typeof selectorOrTarget === "object" && typeof typeOrPropertyKey === "string" && typeof optionsOrDescriptor === "object" && "value" in optionsOrDescriptor) {
9163
+ throw new Error(`@emitCustomEvent decorator cannot be used on properties. (Property: ${String(typeOrPropertyKey)})`);
9164
+ }
9165
+ if (typeof selectorOrTarget === "string" && typeof typeOrPropertyKey === "string") {
9166
+ return createEmitDecorator(selectorOrTarget, typeOrPropertyKey, optionsOrDescriptor);
9167
+ }
9168
+ if (typeof selectorOrTarget === "string" && typeOrPropertyKey !== "string") {
9169
+ return createEmitDecorator("$this", selectorOrTarget, typeOrPropertyKey);
9170
+ }
9171
+ throw new Error("Invalid @emitCustomEvent usage");
9172
+ }
9173
+ function createEmitDecorator(selector, type, options) {
9035
9174
  return (targetObj, propertyKey, descriptor) => {
9036
9175
  const constructor = targetObj.constructor;
9037
- const fullOptions = { ...options, type };
9038
- if (fullOptions.bubbles === void 0) fullOptions.bubbles = true;
9039
- if (fullOptions.composed === void 0) fullOptions.composed = true;
9176
+ const fullOptions = { ...options || {}, type };
9177
+ if (fullOptions.bubbles === void 0)
9178
+ fullOptions.bubbles = true;
9179
+ if (fullOptions.composed === void 0)
9180
+ fullOptions.composed = true;
9040
9181
  let list = ReflectUtils.getMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, constructor);
9041
9182
  if (!list) {
9042
9183
  list = [];
9043
9184
  ReflectUtils.defineMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, list, constructor);
9044
9185
  }
9045
- list.push({ propertyKey, selector: selectorOrTarget, type, options: fullOptions });
9186
+ list.push({ propertyKey, selector, type, options: fullOptions });
9046
9187
  const original = descriptor.value;
9047
9188
  descriptor.value = function(...args) {
9048
9189
  ensureInit(this);
@@ -9058,40 +9199,53 @@ var dooboostoreSimpleWebComponent = (() => {
9058
9199
  const conf = getElementConfig(this);
9059
9200
  const currentWin = this._resolveWindow?.(conf) || (typeof window !== "undefined" ? window : void 0);
9060
9201
  const eventTargets = [];
9061
- if (selectorOrTarget === "$window") eventTargets.push(currentWin);
9062
- else if (selectorOrTarget === "$document") eventTargets.push(currentWin.document);
9063
- else if (selectorOrTarget === "$host") {
9064
- if (hostSet.$host) eventTargets.push(hostSet.$host);
9065
- } else if (selectorOrTarget === "$parentHost") {
9066
- if (hostSet.$parentHost) eventTargets.push(hostSet.$parentHost);
9067
- } else if (selectorOrTarget === "$appHost") {
9068
- if (hostSet.$appHost) eventTargets.push(hostSet.$appHost);
9069
- } else if (selectorOrTarget === "$firstHost") {
9070
- if (hostSet.$firstHost) eventTargets.push(hostSet.$firstHost);
9071
- } else if (selectorOrTarget === "$lastHost") {
9072
- if (hostSet.$lastHost) eventTargets.push(hostSet.$lastHost);
9073
- } else if (selectorOrTarget === "$firstAppHost") {
9074
- if (hostSet.$firstAppHost) eventTargets.push(hostSet.$firstAppHost);
9075
- } else if (selectorOrTarget === "$lastAppHost") {
9076
- if (hostSet.$lastAppHost) eventTargets.push(hostSet.$lastAppHost);
9077
- } else if (selectorOrTarget === "$hosts") {
9202
+ if (selector === "$window")
9203
+ eventTargets.push(currentWin);
9204
+ else if (selector === "$document")
9205
+ eventTargets.push(currentWin.document);
9206
+ else if (selector === "$host") {
9207
+ if (hostSet.$host)
9208
+ eventTargets.push(hostSet.$host);
9209
+ } else if (selector === "$parentHost") {
9210
+ if (hostSet.$parentHost)
9211
+ eventTargets.push(hostSet.$parentHost);
9212
+ } else if (selector === "$appHost") {
9213
+ if (hostSet.$appHost)
9214
+ eventTargets.push(hostSet.$appHost);
9215
+ } else if (selector === "$firstHost") {
9216
+ if (hostSet.$firstHost)
9217
+ eventTargets.push(hostSet.$firstHost);
9218
+ } else if (selector === "$lastHost") {
9219
+ if (hostSet.$lastHost)
9220
+ eventTargets.push(hostSet.$lastHost);
9221
+ } else if (selector === "$firstAppHost") {
9222
+ if (hostSet.$firstAppHost)
9223
+ eventTargets.push(hostSet.$firstAppHost);
9224
+ } else if (selector === "$lastAppHost") {
9225
+ if (hostSet.$lastAppHost)
9226
+ eventTargets.push(hostSet.$lastAppHost);
9227
+ } else if (selector === "$hosts") {
9078
9228
  hostSet.$hosts.forEach((h) => eventTargets.push(h));
9079
- } else if (selectorOrTarget === "$appHosts") {
9229
+ } else if (selector === "$appHosts") {
9080
9230
  hostSet.$appHosts.forEach((h) => eventTargets.push(h));
9081
- } else if (selectorOrTarget === "$this" || !selectorOrTarget) {
9231
+ } else if (selector === "$this" || !selector) {
9082
9232
  eventTargets.push(this);
9083
9233
  } else {
9084
9234
  const r = fullOptions.root || "auto";
9085
9235
  const searchRoots = [];
9086
- if (r === "auto") searchRoots.push(this.shadowRoot || this);
9087
- else if (r === "light") searchRoots.push(this);
9088
- else if (r === "shadow" && this.shadowRoot) searchRoots.push(this.shadowRoot);
9236
+ if (r === "auto")
9237
+ searchRoots.push(this.shadowRoot || this);
9238
+ else if (r === "light")
9239
+ searchRoots.push(this);
9240
+ else if (r === "shadow" && this.shadowRoot)
9241
+ searchRoots.push(this.shadowRoot);
9089
9242
  else if (r === "all") {
9090
9243
  searchRoots.push(this);
9091
- if (this.shadowRoot) searchRoots.push(this.shadowRoot);
9244
+ if (this.shadowRoot)
9245
+ searchRoots.push(this.shadowRoot);
9092
9246
  }
9093
9247
  searchRoots.forEach((sr) => {
9094
- sr.querySelectorAll(selectorOrTarget).forEach((el) => eventTargets.push(el));
9248
+ sr.querySelectorAll(selector).forEach((el) => eventTargets.push(el));
9095
9249
  });
9096
9250
  }
9097
9251
  eventTargets.forEach((t) => {
@@ -9115,20 +9269,8 @@ var dooboostoreSimpleWebComponent = (() => {
9115
9269
  return ReflectUtils.getMetadata(EMIT_CUSTOM_EVENT_METADATA_KEY, constructor);
9116
9270
  };
9117
9271
  var emit = emitCustomEvent;
9118
- function emitCustomEventThis(type, optionsOrAttributeaName) {
9119
- if (optionsOrAttributeaName && typeof optionsOrAttributeaName === "string") {
9120
- return emitCustomEventThis(type, { attributeName: optionsOrAttributeaName });
9121
- } else if (optionsOrAttributeaName && typeof optionsOrAttributeaName === "object") {
9122
- if (!optionsOrAttributeaName.attributeName) {
9123
- optionsOrAttributeaName.attributeName = `on-emit-${type}`;
9124
- }
9125
- return emitCustomEvent("$this", type, optionsOrAttributeaName);
9126
- } else {
9127
- return emitCustomEvent("$this", type, { attributeName: `on-emit-${type}` });
9128
- }
9129
- }
9130
9272
 
9131
- // src/decorators/changedAttributeThis.ts
9273
+ // src/decorators/changedAttribute.ts
9132
9274
  var ON_ATTRIBUTE_CHANGED_METADATA_KEY = Symbol.for("simple-web-component:on-attribute-changed");
9133
9275
  var convertValue = (val, type) => {
9134
9276
  if (val === null || val === void 0) return val;
@@ -9136,7 +9278,7 @@ var dooboostoreSimpleWebComponent = (() => {
9136
9278
  if (type === Boolean) return val === "false" || val === "0" ? false : true;
9137
9279
  return val;
9138
9280
  };
9139
- function changedAttributeThis(attributeName, options = {}) {
9281
+ function changedAttribute(attributeName, options = {}) {
9140
9282
  return (target, propertyKey) => {
9141
9283
  const constructor = target.constructor;
9142
9284
  let metaList = ReflectUtils.getOwnMetadata(ON_ATTRIBUTE_CHANGED_METADATA_KEY, constructor);
@@ -9176,150 +9318,106 @@ var dooboostoreSimpleWebComponent = (() => {
9176
9318
 
9177
9319
  // src/decorators/query.ts
9178
9320
  var QUERY_METADATA_KEY = Symbol.for("simple-web-component:query");
9179
- function query(selectorOrTarget, options = {}) {
9180
- return (targetObj, propertyKey, descriptor) => {
9181
- if (descriptor !== void 0) {
9182
- throw new Error(`@query decorator cannot be used on methods. (Method: ${String(propertyKey)})`);
9183
- }
9184
- const constructor = targetObj.constructor;
9185
- let queries = ReflectUtils.getMetadata(QUERY_METADATA_KEY, constructor);
9186
- if (!queries) {
9187
- queries = [];
9188
- ReflectUtils.defineMetadata(QUERY_METADATA_KEY, queries, constructor);
9189
- }
9190
- queries.push({ propertyKey, selector: selectorOrTarget, options });
9191
- Object.defineProperty(targetObj, propertyKey, {
9192
- get() {
9193
- ensureInit(this);
9194
- const selector = selectorOrTarget;
9195
- const r = options.root || "auto";
9196
- const applyRoot = (t) => {
9197
- if (!t || !(t instanceof HTMLElement))
9321
+ function query(selectorOrTarget, optionsOrPropertyKey, descriptor) {
9322
+ if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
9323
+ throw new Error(`@query decorator cannot be used on methods. (Method: ${String(optionsOrPropertyKey)})`);
9324
+ }
9325
+ if (typeof selectorOrTarget === "string") {
9326
+ return (targetObj, propertyKey, descriptor2) => {
9327
+ if (descriptor2 !== void 0) {
9328
+ throw new Error(`@query decorator cannot be used on methods. (Method: ${String(propertyKey)})`);
9329
+ }
9330
+ const constructor = targetObj.constructor;
9331
+ let queries = ReflectUtils.getMetadata(QUERY_METADATA_KEY, constructor);
9332
+ if (!queries) {
9333
+ queries = [];
9334
+ ReflectUtils.defineMetadata(QUERY_METADATA_KEY, queries, constructor);
9335
+ }
9336
+ queries.push({ propertyKey, selector: selectorOrTarget, options: optionsOrPropertyKey || {} });
9337
+ Object.defineProperty(targetObj, propertyKey, {
9338
+ get() {
9339
+ ensureInit(this);
9340
+ const selector = selectorOrTarget;
9341
+ const r = optionsOrPropertyKey?.root || "auto";
9342
+ const applyRoot = (t) => {
9343
+ if (!t || !(t instanceof HTMLElement))
9344
+ return t;
9345
+ if (r === "auto")
9346
+ return t.shadowRoot || t;
9347
+ if (r === "shadow")
9348
+ return t.shadowRoot;
9349
+ if (r === "light")
9350
+ return t;
9351
+ if (r === "all")
9352
+ return t.shadowRoot || t;
9198
9353
  return t;
9199
- if (r === "auto")
9200
- return t.shadowRoot || t;
9354
+ };
9355
+ const hostSet = SwcUtils.getHostSet(this);
9356
+ if (selector === "$this")
9357
+ return applyRoot(this);
9358
+ if (selector === "$host")
9359
+ return applyRoot(hostSet.$host);
9360
+ if (selector === "$parentHost")
9361
+ return applyRoot(hostSet.$parentHost);
9362
+ if (selector === "$appHost")
9363
+ return applyRoot(hostSet.$appHost);
9364
+ if (selector === "$firstHost")
9365
+ return applyRoot(hostSet.$firstHost);
9366
+ if (selector === "$lastHost")
9367
+ return applyRoot(hostSet.$lastHost);
9368
+ if (selector === "$firstAppHost")
9369
+ return applyRoot(hostSet.$firstAppHost);
9370
+ if (selector === "$lastAppHost")
9371
+ return applyRoot(hostSet.$lastAppHost);
9372
+ const config = getElementConfig(this);
9373
+ const win = config?.window || window;
9374
+ if (selector === "$window")
9375
+ return win;
9376
+ if (selector === "$document")
9377
+ return win.document;
9201
9378
  if (r === "shadow")
9202
- return t.shadowRoot;
9379
+ return this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;
9203
9380
  if (r === "light")
9204
- return t;
9205
- if (r === "all")
9206
- return t.shadowRoot || t;
9207
- return t;
9208
- };
9209
- const hostSet = SwcUtils.getHostSet(this);
9210
- if (selector === "$this")
9211
- return applyRoot(this);
9212
- if (selector === "$host")
9213
- return applyRoot(hostSet.$host);
9214
- if (selector === "$parentHost")
9215
- return applyRoot(hostSet.$parentHost);
9216
- if (selector === "$appHost")
9217
- return applyRoot(hostSet.$appHost);
9218
- if (selector === "$firstHost")
9219
- return applyRoot(hostSet.$firstHost);
9220
- if (selector === "$lastHost")
9221
- return applyRoot(hostSet.$lastHost);
9222
- if (selector === "$firstAppHost")
9223
- return applyRoot(hostSet.$firstAppHost);
9224
- if (selector === "$lastAppHost")
9225
- return applyRoot(hostSet.$lastAppHost);
9226
- const config = getElementConfig(this);
9227
- const win = config?.window || window;
9228
- if (selector === "$window")
9229
- return win;
9230
- if (selector === "$document")
9231
- return win.document;
9232
- if (r === "shadow")
9233
- return this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;
9234
- if (r === "light")
9235
- return this.querySelector(selector);
9236
- if (r === "all") {
9237
- const shadowMatch = this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;
9238
- return shadowMatch || this.querySelector(selector);
9239
- }
9240
- return (this.shadowRoot || this).querySelector(selector);
9241
- },
9242
- set(nv) {
9243
- ensureInit(this);
9244
- if (nv === null || nv === void 0) {
9245
- const selector = selectorOrTarget;
9246
- if (selector.startsWith("$") && selector !== "$this")
9247
- return;
9248
- const r = options.root || "auto";
9249
- const targets = [];
9250
- if (r === "shadow") {
9251
- if (this.shadowRoot?.querySelector(selector))
9252
- targets.push(this.shadowRoot.querySelector(selector));
9253
- } else if (r === "light") {
9254
- if (this.querySelector(selector))
9255
- targets.push(this.querySelector(selector));
9256
- } else if (r === "all") {
9257
- if (this.shadowRoot?.querySelector(selector))
9258
- targets.push(this.shadowRoot.querySelector(selector));
9259
- if (this.querySelector(selector))
9260
- targets.push(this.querySelector(selector));
9261
- } else {
9262
- const el = (this.shadowRoot || this).querySelector(selector);
9263
- if (el)
9264
- targets.push(el);
9381
+ return this.querySelector(selector);
9382
+ if (r === "all") {
9383
+ const shadowMatch = this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;
9384
+ return shadowMatch || this.querySelector(selector);
9265
9385
  }
9266
- targets.forEach((t) => t.remove());
9267
- }
9268
- },
9269
- enumerable: true,
9270
- configurable: true
9271
- });
9272
- };
9273
- }
9274
- function queryThis(targetOrOptions, propertyKey) {
9275
- if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
9276
- return query("$this", {})(targetOrOptions, propertyKey);
9277
- }
9278
- if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
9279
- return query("$this", targetOrOptions);
9280
- } else {
9281
- return query("$this", {});
9282
- }
9283
- }
9284
- function queryWindow(targetOrOptions, propertyKey) {
9285
- if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
9286
- return query("$window", {})(targetOrOptions, propertyKey);
9287
- }
9288
- if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
9289
- return query("$window", targetOrOptions);
9290
- } else {
9291
- return query("$window", {});
9292
- }
9293
- }
9294
- function queryDocument(targetOrOptions, propertyKey) {
9295
- if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
9296
- return query("$document", {})(targetOrOptions, propertyKey);
9297
- }
9298
- if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
9299
- return query("$document", targetOrOptions);
9300
- } else {
9301
- return query("$document", {});
9302
- }
9303
- }
9304
- function queryHost(targetOrOptions, propertyKey) {
9305
- if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
9306
- return query("$host", {})(targetOrOptions, propertyKey);
9307
- }
9308
- if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
9309
- return query("$host", targetOrOptions);
9310
- } else {
9311
- return query("$host", {});
9312
- }
9313
- }
9314
- function queryAppHost(targetOrOptions, propertyKey) {
9315
- if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
9316
- return query("$appHost", {})(targetOrOptions, propertyKey);
9317
- }
9318
- if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
9319
- return query("$appHost", targetOrOptions);
9320
- } else {
9321
- return query("$appHost", {});
9386
+ return (this.shadowRoot || this).querySelector(selector);
9387
+ },
9388
+ set(nv) {
9389
+ ensureInit(this);
9390
+ if (nv === null || nv === void 0) {
9391
+ const selector = selectorOrTarget;
9392
+ if (selector.startsWith("$") && selector !== "$this")
9393
+ return;
9394
+ const r = optionsOrPropertyKey?.root || "auto";
9395
+ const targets = [];
9396
+ if (r === "shadow") {
9397
+ if (this.shadowRoot?.querySelector(selector))
9398
+ targets.push(this.shadowRoot.querySelector(selector));
9399
+ } else if (r === "light") {
9400
+ if (this.querySelector(selector))
9401
+ targets.push(this.querySelector(selector));
9402
+ } else if (r === "all") {
9403
+ if (this.shadowRoot?.querySelector(selector))
9404
+ targets.push(this.shadowRoot.querySelector(selector));
9405
+ if (this.querySelector(selector))
9406
+ targets.push(this.querySelector(selector));
9407
+ } else {
9408
+ const el = (this.shadowRoot || this).querySelector(selector);
9409
+ if (el)
9410
+ targets.push(el);
9411
+ }
9412
+ targets.forEach((t) => t.remove());
9413
+ }
9414
+ },
9415
+ enumerable: true,
9416
+ configurable: true
9417
+ });
9418
+ };
9322
9419
  }
9420
+ return query("$this", selectorOrTarget);
9323
9421
  }
9324
9422
  var getQueryMetadata = (target) => {
9325
9423
  const constructor = target instanceof Function ? target : target.constructor;
@@ -9328,139 +9426,115 @@ var dooboostoreSimpleWebComponent = (() => {
9328
9426
 
9329
9427
  // src/decorators/queryAll.ts
9330
9428
  var QUERY_ALL_METADATA_KEY = Symbol.for("simple-web-component:query-all");
9331
- function queryAll(selectorOrTarget, options = {}) {
9332
- return (targetObj, propertyKey, descriptor) => {
9333
- if (descriptor !== void 0) {
9334
- throw new Error(`@queryAll decorator cannot be used on methods. (Method: ${String(propertyKey)})`);
9335
- }
9336
- const constructor = targetObj.constructor;
9337
- let queries = ReflectUtils.getMetadata(QUERY_ALL_METADATA_KEY, constructor);
9338
- if (!queries) {
9339
- queries = [];
9340
- ReflectUtils.defineMetadata(QUERY_ALL_METADATA_KEY, queries, constructor);
9341
- }
9342
- queries.push({ propertyKey, selector: selectorOrTarget, options });
9343
- Object.defineProperty(targetObj, propertyKey, {
9344
- get() {
9345
- ensureInit(this);
9346
- const selector = selectorOrTarget;
9347
- const r = options.root || "auto";
9348
- const applyRoot = (t) => {
9349
- if (!t)
9350
- return [];
9351
- const items = Array.isArray(t) ? t : [t];
9352
- const results = [];
9353
- items.forEach((it) => {
9354
- if (!(it instanceof HTMLElement)) {
9355
- results.push(it);
9356
- return;
9357
- }
9358
- if (r === "auto")
9359
- results.push(it.shadowRoot || it);
9360
- else {
9361
- if (r === "light" || r === "all")
9362
- results.push(it);
9363
- if ((r === "shadow" || r === "all") && it.shadowRoot)
9364
- results.push(it.shadowRoot);
9365
- }
9366
- });
9367
- return results;
9368
- };
9369
- const hostSet = SwcUtils.getHostSet(this);
9370
- if (selector === "$hosts")
9371
- return applyRoot(hostSet.$hosts);
9372
- if (selector === "$appHosts")
9373
- return applyRoot(hostSet.$appHosts);
9374
- if (selector === "$host")
9375
- return applyRoot(hostSet.$host);
9376
- if (selector === "$parentHost")
9377
- return applyRoot(hostSet.$parentHost);
9378
- if (selector === "$appHost")
9379
- return applyRoot(hostSet.$appHost);
9380
- if (selector === "$firstHost")
9381
- return applyRoot(hostSet.$firstHost);
9382
- if (selector === "$lastHost")
9383
- return applyRoot(hostSet.$lastHost);
9384
- if (selector === "$firstAppHost")
9385
- return applyRoot(hostSet.$firstAppHost);
9386
- if (selector === "$lastAppHost")
9387
- return applyRoot(hostSet.$lastAppHost);
9388
- const config = getElementConfig(this);
9389
- const win = config?.window || window;
9390
- if (selector === "$window")
9391
- return [win];
9392
- if (selector === "$document")
9393
- return [win.document];
9394
- if (selector === "$this")
9395
- return applyRoot(this);
9396
- if (r === "shadow")
9397
- return this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
9398
- if (r === "light")
9399
- return Array.from(this.querySelectorAll(selector));
9400
- if (r === "all") {
9401
- const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
9402
- const lNodes = Array.from(this.querySelectorAll(selector));
9403
- return [...sNodes, ...lNodes];
9404
- }
9405
- const root = this.shadowRoot || this;
9406
- return Array.from(root.querySelectorAll(selector));
9407
- },
9408
- set(nv) {
9409
- ensureInit(this);
9410
- if (nv === null || nv === void 0 || Array.isArray(nv) && nv.length === 0) {
9429
+ function queryAll(selectorOrTarget, optionsOrPropertyKey, descriptor) {
9430
+ if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
9431
+ throw new Error(`@queryAll decorator cannot be used on methods. (Method: ${String(optionsOrPropertyKey)})`);
9432
+ }
9433
+ if (typeof selectorOrTarget === "string") {
9434
+ return (targetObj, propertyKey, descriptor2) => {
9435
+ if (descriptor2 !== void 0) {
9436
+ throw new Error(`@queryAll decorator cannot be used on methods. (Method: ${String(propertyKey)})`);
9437
+ }
9438
+ const constructor = targetObj.constructor;
9439
+ let queries = ReflectUtils.getMetadata(QUERY_ALL_METADATA_KEY, constructor);
9440
+ if (!queries) {
9441
+ queries = [];
9442
+ ReflectUtils.defineMetadata(QUERY_ALL_METADATA_KEY, queries, constructor);
9443
+ }
9444
+ queries.push({ propertyKey, selector: selectorOrTarget, options: optionsOrPropertyKey || {} });
9445
+ Object.defineProperty(targetObj, propertyKey, {
9446
+ get() {
9447
+ ensureInit(this);
9411
9448
  const selector = selectorOrTarget;
9412
- if (selector.startsWith("$") && selector !== "$this")
9413
- return;
9414
- const r = options.root || "auto";
9415
- let targets = [];
9449
+ const r = optionsOrPropertyKey?.root || "auto";
9450
+ const applyRoot = (t) => {
9451
+ if (!t)
9452
+ return [];
9453
+ const items = Array.isArray(t) ? t : [t];
9454
+ const results = [];
9455
+ items.forEach((it) => {
9456
+ if (!(it instanceof HTMLElement)) {
9457
+ results.push(it);
9458
+ return;
9459
+ }
9460
+ if (r === "auto")
9461
+ results.push(it.shadowRoot || it);
9462
+ else {
9463
+ if (r === "light" || r === "all")
9464
+ results.push(it);
9465
+ if ((r === "shadow" || r === "all") && it.shadowRoot)
9466
+ results.push(it.shadowRoot);
9467
+ }
9468
+ });
9469
+ return results;
9470
+ };
9471
+ const hostSet = SwcUtils.getHostSet(this);
9472
+ if (selector === "$hosts")
9473
+ return applyRoot(hostSet.$hosts);
9474
+ if (selector === "$appHosts")
9475
+ return applyRoot(hostSet.$appHosts);
9476
+ if (selector === "$host")
9477
+ return applyRoot(hostSet.$host);
9478
+ if (selector === "$parentHost")
9479
+ return applyRoot(hostSet.$parentHost);
9480
+ if (selector === "$appHost")
9481
+ return applyRoot(hostSet.$appHost);
9482
+ if (selector === "$firstHost")
9483
+ return applyRoot(hostSet.$firstHost);
9484
+ if (selector === "$lastHost")
9485
+ return applyRoot(hostSet.$lastHost);
9486
+ if (selector === "$firstAppHost")
9487
+ return applyRoot(hostSet.$firstAppHost);
9488
+ if (selector === "$lastAppHost")
9489
+ return applyRoot(hostSet.$lastAppHost);
9490
+ const config = getElementConfig(this);
9491
+ const win = config?.window || window;
9492
+ if (selector === "$window")
9493
+ return [win];
9494
+ if (selector === "$document")
9495
+ return [win.document];
9496
+ if (selector === "$this")
9497
+ return applyRoot(this);
9416
9498
  if (r === "shadow")
9417
- targets = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
9418
- else if (r === "light")
9419
- targets = Array.from(this.querySelectorAll(selector));
9420
- else if (r === "all") {
9499
+ return this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
9500
+ if (r === "light")
9501
+ return Array.from(this.querySelectorAll(selector));
9502
+ if (r === "all") {
9421
9503
  const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
9422
9504
  const lNodes = Array.from(this.querySelectorAll(selector));
9423
- targets = [...sNodes, ...lNodes];
9424
- } else {
9425
- targets = Array.from((this.shadowRoot || this).querySelectorAll(selector));
9505
+ return [...sNodes, ...lNodes];
9426
9506
  }
9427
- targets.forEach((t) => t.remove());
9428
- }
9429
- },
9430
- enumerable: true,
9431
- configurable: true
9432
- });
9433
- };
9434
- }
9435
- function queryAllThis(targetOrOptions, propertyKey) {
9436
- if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
9437
- return queryAll("$this", {})(targetOrOptions, propertyKey);
9438
- }
9439
- if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
9440
- return queryAll("$this", targetOrOptions);
9441
- } else {
9442
- return queryAll("$this", {});
9443
- }
9444
- }
9445
- function allParentHost(targetOrOptions, propertyKey) {
9446
- if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
9447
- return queryAll("$host", {})(targetOrOptions, propertyKey);
9448
- }
9449
- if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
9450
- return queryAll("$host", targetOrOptions);
9451
- } else {
9452
- return queryAll("$host", {});
9453
- }
9454
- }
9455
- function allAppHost(targetOrOptions, propertyKey) {
9456
- if (propertyKey !== void 0 && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
9457
- return queryAll("$appHost", {})(targetOrOptions, propertyKey);
9458
- }
9459
- if (typeof targetOrOptions === "object" && targetOrOptions !== null) {
9460
- return queryAll("$appHost", targetOrOptions);
9461
- } else {
9462
- return queryAll("$appHost", {});
9507
+ const root = this.shadowRoot || this;
9508
+ return Array.from(root.querySelectorAll(selector));
9509
+ },
9510
+ set(nv) {
9511
+ ensureInit(this);
9512
+ if (nv === null || nv === void 0 || Array.isArray(nv) && nv.length === 0) {
9513
+ const selector = selectorOrTarget;
9514
+ if (selector.startsWith("$") && selector !== "$this")
9515
+ return;
9516
+ const r = optionsOrPropertyKey?.root || "auto";
9517
+ let targets = [];
9518
+ if (r === "shadow")
9519
+ targets = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
9520
+ else if (r === "light")
9521
+ targets = Array.from(this.querySelectorAll(selector));
9522
+ else if (r === "all") {
9523
+ const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
9524
+ const lNodes = Array.from(this.querySelectorAll(selector));
9525
+ targets = [...sNodes, ...lNodes];
9526
+ } else {
9527
+ targets = Array.from((this.shadowRoot || this).querySelectorAll(selector));
9528
+ }
9529
+ targets.forEach((t) => t.remove());
9530
+ }
9531
+ },
9532
+ enumerable: true,
9533
+ configurable: true
9534
+ });
9535
+ };
9463
9536
  }
9537
+ return queryAll("$this", selectorOrTarget);
9464
9538
  }
9465
9539
  var getQueryAllMetadata = (target) => {
9466
9540
  const constructor = target instanceof Function ? target : target.constructor;
@@ -9788,35 +9862,20 @@ var dooboostoreSimpleWebComponent = (() => {
9788
9862
  });
9789
9863
  };
9790
9864
  }
9791
- function property(selector, targetPropertyKeyOrOptions, options) {
9792
- return applyProperty(selector, targetPropertyKeyOrOptions, options);
9793
- }
9794
- function propertyThis(targetOrOptions, propertyKeyOrOptions, descriptor) {
9795
- if (typeof targetOrOptions === "object" && targetOrOptions !== null && !Array.isArray(targetOrOptions) && (typeof propertyKeyOrOptions === "string" || typeof propertyKeyOrOptions === "symbol")) {
9796
- return applyProperty("$this", void 0, {})(targetOrOptions, propertyKeyOrOptions, descriptor);
9865
+ function property(selectorOrTarget, targetPropertyKeyOrOptions, optionsOrDescriptor) {
9866
+ if (optionsOrDescriptor !== void 0 && (typeof targetPropertyKeyOrOptions === "string" || typeof targetPropertyKeyOrOptions === "symbol")) {
9867
+ return applyProperty("$this", void 0, {})(selectorOrTarget, targetPropertyKeyOrOptions, optionsOrDescriptor);
9797
9868
  }
9798
- if (typeof targetOrOptions === "string" || typeof targetOrOptions === "symbol") {
9799
- return applyProperty("$this", targetOrOptions, propertyKeyOrOptions);
9800
- } else if (targetOrOptions && typeof targetOrOptions === "object") {
9801
- return applyProperty("$this", void 0, targetOrOptions);
9802
- } else {
9803
- return applyProperty("$this", void 0, {});
9869
+ if (typeof selectorOrTarget === "string") {
9870
+ return applyProperty(selectorOrTarget, targetPropertyKeyOrOptions, optionsOrDescriptor);
9804
9871
  }
9872
+ return applyProperty("$this", void 0, selectorOrTarget);
9805
9873
  }
9806
- function setProperty(selector, targetPropertyKeyOrOptions, options) {
9807
- return applyProperty(selector, targetPropertyKeyOrOptions, options);
9808
- }
9809
- function setPropertyThis(targetOrOptions, propertyKeyOrOptions, descriptor) {
9810
- if (typeof targetOrOptions === "object" && targetOrOptions !== null && !Array.isArray(targetOrOptions) && (typeof propertyKeyOrOptions === "string" || typeof propertyKeyOrOptions === "symbol")) {
9811
- return applyProperty("$this", void 0, {})(targetOrOptions, propertyKeyOrOptions, descriptor);
9812
- }
9813
- if (typeof targetOrOptions === "string" || typeof targetOrOptions === "symbol") {
9814
- return applyProperty("$this", targetOrOptions, propertyKeyOrOptions);
9815
- } else if (targetOrOptions && typeof targetOrOptions === "object") {
9816
- return applyProperty("$this", void 0, targetOrOptions);
9817
- } else {
9818
- return applyProperty("$this", void 0, {});
9874
+ function setProperty(selectorOrOptions, targetPropertyKeyOrOptions, optionsOrUndefined) {
9875
+ if (typeof selectorOrOptions === "string") {
9876
+ return applyProperty(selectorOrOptions, targetPropertyKeyOrOptions, optionsOrUndefined);
9819
9877
  }
9878
+ return applyProperty("$this", void 0, selectorOrOptions);
9820
9879
  }
9821
9880
  var findAllPropertyMetadata = (target) => {
9822
9881
  const actualTarget = target instanceof Function ? target : target.constructor;
@@ -10241,8 +10300,32 @@ var dooboostoreSimpleWebComponent = (() => {
10241
10300
  const args = { event: event2, ...currentHostSet, $el: t, $root: t };
10242
10301
  await this[meta.propertyKey](event2, { currentHostSet, $$matchedElement: event2.currentTarget }, args);
10243
10302
  };
10244
- t.addEventListener(type, handler, opts);
10245
- this._boundListeners.push({ target: t, type, handler, options: opts });
10303
+ const eventSubject = new Subject();
10304
+ let eventStream = eventSubject;
10305
+ if (options.debounceTime !== void 0 && options.debounceTime > 0) {
10306
+ eventStream = eventStream.pipe(debounceTime(options.debounceTime));
10307
+ }
10308
+ if (options.throttleTime !== void 0 && options.throttleTime > 0) {
10309
+ eventStream = eventStream.pipe(throttleTime(options.throttleTime));
10310
+ }
10311
+ if (options.distinctUntilChanged !== void 0 && options.distinctUntilChanged !== false) {
10312
+ if (typeof options.distinctUntilChanged === "function") {
10313
+ eventStream = eventStream.pipe(distinctUntilChanged(options.distinctUntilChanged));
10314
+ } else {
10315
+ eventStream = eventStream.pipe(distinctUntilChanged());
10316
+ }
10317
+ }
10318
+ const subscription = eventStream.subscribe({
10319
+ next: (event2) => {
10320
+ handler(event2).catch((err) => console.error("Event handler error:", err));
10321
+ },
10322
+ error: (err) => console.error("Event stream error:", err)
10323
+ });
10324
+ const wrappedHandler = (event2) => {
10325
+ eventSubject.next(event2);
10326
+ };
10327
+ t.addEventListener(type, wrappedHandler, opts);
10328
+ this._boundListeners.push({ target: t, type, handler: wrappedHandler, options: opts, subscription });
10246
10329
  });
10247
10330
  });
10248
10331
  if (originalConnected) await originalConnected.apply(this);
@@ -10282,7 +10365,12 @@ var dooboostoreSimpleWebComponent = (() => {
10282
10365
  const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_DISCONNECTED_METADATA_KEY);
10283
10366
  for (const m of bMethods) this._invokeLifecycleMethod(m.propertyKey, helperHostSet);
10284
10367
  if (this._boundListeners) {
10285
- this._boundListeners.forEach((l) => l.target.removeEventListener(l.type, l.handler, l.options));
10368
+ this._boundListeners.forEach((l) => {
10369
+ l.target.removeEventListener(l.type, l.handler, l.options);
10370
+ if (l.subscription && typeof l.subscription.unsubscribe === "function") {
10371
+ l.subscription.unsubscribe();
10372
+ }
10373
+ });
10286
10374
  this._boundListeners = [];
10287
10375
  }
10288
10376
  new ElementApply(this, { id: this._swcId }).removeAllEventListener();
@@ -10365,6 +10453,13 @@ var dooboostoreSimpleWebComponent = (() => {
10365
10453
 
10366
10454
  // src/decorators/applyAttribute.ts
10367
10455
  var ATTRIBUTE_METADATA_KEY = Symbol.for("simple-web-component:attribute");
10456
+ var isCssSelector = (str) => {
10457
+ if (!str) return false;
10458
+ if (str.startsWith("$")) return true;
10459
+ if (/^[#.\[\:>+~]/.test(str)) return true;
10460
+ if (/[>+~:\[\]]/.test(str)) return true;
10461
+ return false;
10462
+ };
10368
10463
  var convertValue2 = (val, type) => {
10369
10464
  if (val === null || val === void 0) return val;
10370
10465
  if (type === Number) return Number(val);
@@ -10535,35 +10630,32 @@ var dooboostoreSimpleWebComponent = (() => {
10535
10630
  });
10536
10631
  };
10537
10632
  }
10538
- function attribute(selector, targetAttributeNameOrOptions, options) {
10539
- return applyAttribute(selector, targetAttributeNameOrOptions, options);
10540
- }
10541
- function attributeThis(targetOrOptions, propertyKeyOrOptions, descriptor) {
10542
- if (typeof targetOrOptions === "object" && targetOrOptions !== null && !Array.isArray(targetOrOptions) && typeof propertyKeyOrOptions === "string" || typeof propertyKeyOrOptions === "symbol") {
10543
- return applyAttribute("$this", void 0, {})(targetOrOptions, propertyKeyOrOptions, descriptor);
10544
- }
10545
- if (typeof targetOrOptions === "string") {
10546
- return applyAttribute("$this", targetOrOptions, propertyKeyOrOptions);
10547
- } else if (targetOrOptions && typeof targetOrOptions === "object") {
10548
- return applyAttribute("$this", void 0, targetOrOptions);
10549
- } else {
10550
- return applyAttribute("$this", void 0, {});
10633
+ function attribute(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor) {
10634
+ if (optionsOrDescriptor !== void 0 && (typeof attributeNameOrOptions === "string" || typeof attributeNameOrOptions === "symbol")) {
10635
+ return applyAttribute("$this", void 0, {})(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor);
10636
+ }
10637
+ if (typeof selectorOrAttributeOrTarget === "string") {
10638
+ const isSelector = isCssSelector(selectorOrAttributeOrTarget);
10639
+ if (isSelector) {
10640
+ return applyAttribute(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor);
10641
+ } else {
10642
+ const options = typeof attributeNameOrOptions === "object" && attributeNameOrOptions !== null ? attributeNameOrOptions : {};
10643
+ return applyAttribute("$this", selectorOrAttributeOrTarget, options);
10644
+ }
10551
10645
  }
10646
+ return applyAttribute("$this", void 0, selectorOrAttributeOrTarget);
10552
10647
  }
10553
- function setAttribute(selector, targetAttributeNameOrOptions, options) {
10554
- return applyAttribute(selector, targetAttributeNameOrOptions, options);
10555
- }
10556
- function setAttributeThis(targetOrOptions, propertyKeyOrOptions, descriptor) {
10557
- if (typeof targetOrOptions === "object" && targetOrOptions !== null && !Array.isArray(targetOrOptions) && (typeof propertyKeyOrOptions === "string" || typeof propertyKeyOrOptions === "symbol")) {
10558
- return applyAttribute("$this", void 0, {})(targetOrOptions, propertyKeyOrOptions, descriptor);
10559
- }
10560
- if (typeof targetOrOptions === "string") {
10561
- return applyAttribute("$this", targetOrOptions, propertyKeyOrOptions);
10562
- } else if (targetOrOptions && typeof targetOrOptions === "object") {
10563
- return applyAttribute("$this", void 0, targetOrOptions);
10564
- } else {
10565
- return applyAttribute("$this", void 0, {});
10648
+ function setAttribute(selectorOrAttributeOrOptions, attributeNameOrOptions, optionsOrUndefined) {
10649
+ if (typeof selectorOrAttributeOrOptions === "string") {
10650
+ const isSelector = isCssSelector(selectorOrAttributeOrOptions);
10651
+ if (isSelector) {
10652
+ return applyAttribute(selectorOrAttributeOrOptions, attributeNameOrOptions, optionsOrUndefined);
10653
+ } else {
10654
+ const options = typeof attributeNameOrOptions === "object" && attributeNameOrOptions !== null ? attributeNameOrOptions : {};
10655
+ return applyAttribute("$this", selectorOrAttributeOrOptions, options);
10656
+ }
10566
10657
  }
10658
+ return applyAttribute("$this", void 0, selectorOrAttributeOrOptions);
10567
10659
  }
10568
10660
  var findAllAttributeMetadata = (target) => {
10569
10661
  const actualTarget = target instanceof Function ? target : target.constructor;
@@ -10581,6 +10673,10 @@ var dooboostoreSimpleWebComponent = (() => {
10581
10673
  var APPLY_NODE_METADATA_KEY = Symbol.for("simple-web-component:apply-node");
10582
10674
  var applyToDom = (currentThis, targetEl, res, pos, win, host) => {
10583
10675
  if (!targetEl) return;
10676
+ if (pos === "clearChildren") {
10677
+ targetEl.replaceChildren();
10678
+ return [];
10679
+ }
10584
10680
  const doc = win.document;
10585
10681
  const hostSet = SwcUtils.getHelperAndHostSet(win, currentThis);
10586
10682
  const id = currentThis._swcId;
@@ -10616,7 +10712,16 @@ var dooboostoreSimpleWebComponent = (() => {
10616
10712
  new ElementApply(targetEl, { id }).apply({ target: "noInitialized", context: stateContext, bind: currentThis });
10617
10713
  return nodes;
10618
10714
  };
10619
- function applyNode(selector, options = { position: "replaceChildren" }) {
10715
+ function applyNode(selectorOrOptions, maybeOptions) {
10716
+ let selector;
10717
+ let options;
10718
+ if (typeof selectorOrOptions === "string") {
10719
+ selector = selectorOrOptions;
10720
+ options = maybeOptions || { position: "replaceChildren" };
10721
+ } else {
10722
+ selector = "$this";
10723
+ options = selectorOrOptions || { position: "replaceChildren" };
10724
+ }
10620
10725
  return (targetObj, propertyKey, descriptor) => {
10621
10726
  const constructor = targetObj.constructor;
10622
10727
  let metaList = ReflectUtils.getOwnMetadata(APPLY_NODE_METADATA_KEY, constructor);
@@ -10687,92 +10792,141 @@ var dooboostoreSimpleWebComponent = (() => {
10687
10792
  };
10688
10793
  };
10689
10794
  }
10690
- function applyNodeThis(targetOrOptions, propertyKey, descriptor) {
10691
- const option = { position: "replaceChildren" };
10692
- if (propertyKey !== void 0) return applyNode("$this", option)(targetOrOptions, propertyKey, descriptor);
10693
- const opt = targetOrOptions || {};
10694
- return applyNode("$this", { ...option, ...opt });
10695
- }
10696
- function replaceChildrenNodeThis(targetOrOptions, propertyKey, descriptor) {
10697
- const option = { position: "replaceChildren" };
10698
- if (propertyKey !== void 0) return applyNode("$this", option)(targetOrOptions, propertyKey, descriptor);
10699
- const opt = targetOrOptions || {};
10700
- return applyNode("$this", { ...opt, ...option });
10701
- }
10702
- function beforeEndNodeThis(targetOrOptions, propertyKey, descriptor) {
10703
- const options = { position: "beforeEnd" };
10704
- if (propertyKey !== void 0) return applyNode("$this", options)(targetOrOptions, propertyKey, descriptor);
10705
- const opt = targetOrOptions || {};
10706
- return applyNode("$this", { ...opt, ...options });
10707
- }
10708
- function beforeEndLightNodeThis(targetOrOptions, propertyKey, descriptor) {
10709
- const option = { position: "beforeEnd", root: "light" };
10710
- if (propertyKey !== void 0) return applyNode("$this", option)(targetOrOptions, propertyKey, descriptor);
10711
- const opt = targetOrOptions || {};
10712
- return applyNode("$this", { ...opt, ...option });
10795
+ function replaceChildren(selectorOrOptions, maybeOptions, descriptor) {
10796
+ if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
10797
+ return applyNode({ position: "replaceChildren" })(selectorOrOptions, maybeOptions, descriptor);
10798
+ }
10799
+ if (typeof selectorOrOptions === "string") {
10800
+ return applyNode(selectorOrOptions, { ...maybeOptions, position: "replaceChildren" });
10801
+ }
10802
+ return applyNode({ ...selectorOrOptions, position: "replaceChildren" });
10713
10803
  }
10714
- function beforeEndShadowNodeThis(targetOrOptions, propertyKey, descriptor) {
10715
- const option = { position: "beforeEnd", root: "shadow" };
10716
- if (propertyKey !== void 0) return applyNode("$this", option)(targetOrOptions, propertyKey, descriptor);
10717
- const opt = targetOrOptions || {};
10718
- return applyNode("$this", { ...opt, ...option });
10804
+ function clearChildrenNode(selectorOrOptions, maybeOptions, descriptor) {
10805
+ if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
10806
+ return applyNode({ position: "clearChildren" })(selectorOrOptions, maybeOptions, descriptor);
10807
+ }
10808
+ if (typeof selectorOrOptions === "string") {
10809
+ return applyNode(selectorOrOptions, { ...maybeOptions, position: "clearChildren" });
10810
+ }
10811
+ return applyNode({ ...selectorOrOptions, position: "clearChildren" });
10719
10812
  }
10720
- function afterBeginNodeThis(targetOrOptions, propertyKey, descriptor) {
10721
- const option = { position: "afterBegin" };
10722
- if (propertyKey !== void 0) return applyNode("$this", option)(targetOrOptions, propertyKey, descriptor);
10723
- const opt = targetOrOptions || {};
10724
- return applyNode("$this", { ...opt, ...option });
10813
+ var clearNode = clearChildrenNode;
10814
+ function innerHtml(selectorOrOptions, maybeOptions, descriptor) {
10815
+ if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
10816
+ return applyNode({ position: "innerHtml" })(selectorOrOptions, maybeOptions, descriptor);
10817
+ }
10818
+ if (typeof selectorOrOptions === "string") {
10819
+ return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerHtml" });
10820
+ }
10821
+ return applyNode({ ...selectorOrOptions, position: "innerHtml" });
10725
10822
  }
10726
- function afterBeginLightNodeThis(targetOrOptions, propertyKey, descriptor) {
10727
- const option = { position: "afterBegin", root: "light" };
10728
- if (propertyKey !== void 0) return applyNode("$this", option)(targetOrOptions, propertyKey, descriptor);
10729
- const opt = targetOrOptions || {};
10730
- return applyNode("$this", { ...opt, ...option });
10823
+ function innerHtmlLight(selectorOrOptions, maybeOptions, descriptor) {
10824
+ if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
10825
+ return applyNode({ position: "innerHtml", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
10826
+ }
10827
+ if (typeof selectorOrOptions === "string") {
10828
+ return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerHtml", root: "light" });
10829
+ }
10830
+ return applyNode({ ...selectorOrOptions, position: "innerHtml", root: "light" });
10731
10831
  }
10732
- function innerHtmlNodeThis(targetOrOptions, propertyKey, descriptor) {
10733
- const option = { position: "innerHtml" };
10734
- if (propertyKey !== void 0) return applyNode("$this", option)(targetOrOptions, propertyKey, descriptor);
10735
- const opt = targetOrOptions || {};
10736
- return applyNode("$this", { ...opt, ...option });
10832
+ function innerHtmlShadow(selectorOrOptions, maybeOptions, descriptor) {
10833
+ if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
10834
+ return applyNode({ position: "innerHtml", root: "shadow" })(selectorOrOptions, maybeOptions, descriptor);
10835
+ }
10836
+ if (typeof selectorOrOptions === "string") {
10837
+ return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerHtml", root: "shadow" });
10838
+ }
10839
+ return applyNode({ ...selectorOrOptions, position: "innerHtml", root: "shadow" });
10737
10840
  }
10738
- function innerTextNodeThis(targetOrOptions, propertyKey, descriptor) {
10739
- const option = { position: "innerText" };
10740
- if (propertyKey !== void 0) return applyNode("$this", option)(targetOrOptions, propertyKey, descriptor);
10741
- const opt = targetOrOptions || {};
10742
- return applyNode("$this", { ...opt, ...option });
10841
+ function innerText(selectorOrOptions, maybeOptions, descriptor) {
10842
+ if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
10843
+ return applyNode({ position: "innerText" })(selectorOrOptions, maybeOptions, descriptor);
10844
+ }
10845
+ if (typeof selectorOrOptions === "string") {
10846
+ return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerText" });
10847
+ }
10848
+ return applyNode({ ...selectorOrOptions, position: "innerText" });
10743
10849
  }
10744
- function innerHtmlLightNodeThis(targetOrOptions, propertyKey, descriptor) {
10745
- const option = { position: "innerHtml", root: "light" };
10746
- if (propertyKey !== void 0) return applyNode("$this", option)(targetOrOptions, propertyKey, descriptor);
10747
- const opt = targetOrOptions || {};
10748
- return applyNode("$this", { ...opt, ...option });
10850
+ function innerTextLight(selectorOrOptions, maybeOptions, descriptor) {
10851
+ if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
10852
+ return applyNode({ position: "innerText", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
10853
+ }
10854
+ if (typeof selectorOrOptions === "string") {
10855
+ return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerText", root: "light" });
10856
+ }
10857
+ return applyNode({ ...selectorOrOptions, position: "innerText", root: "light" });
10749
10858
  }
10750
- function replaceChildrenLightNodeThis(targetOrOptions, propertyKey, descriptor) {
10751
- const option = { position: "replaceChildren", root: "light" };
10752
- if (propertyKey !== void 0) return applyNode("$this", option)(targetOrOptions, propertyKey, descriptor);
10753
- const opt = targetOrOptions || {};
10754
- return applyNode("$this", { ...opt, ...option });
10859
+ function innerTextShadow(selectorOrOptions, maybeOptions, descriptor) {
10860
+ if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
10861
+ return applyNode({ position: "innerText", root: "shadow" })(selectorOrOptions, maybeOptions, descriptor);
10862
+ }
10863
+ if (typeof selectorOrOptions === "string") {
10864
+ return applyNode(selectorOrOptions, { ...maybeOptions, position: "innerText", root: "shadow" });
10865
+ }
10866
+ return applyNode({ ...selectorOrOptions, position: "innerText", root: "shadow" });
10755
10867
  }
10756
- function replaceChildrenNode(selector, options = {}) {
10757
- return applyNode(selector, { ...options, position: "replaceChildren" });
10868
+ function insertBeforeEnd(selectorOrOptions, maybeOptions, descriptor) {
10869
+ if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
10870
+ return applyNode({ position: "beforeEnd" })(selectorOrOptions, maybeOptions, descriptor);
10871
+ }
10872
+ if (typeof selectorOrOptions === "string") {
10873
+ return applyNode(selectorOrOptions, { ...maybeOptions, position: "beforeEnd" });
10874
+ }
10875
+ return applyNode({ ...selectorOrOptions, position: "beforeEnd" });
10758
10876
  }
10759
- function innerHtmlNode(selector, options = {}) {
10760
- return applyNode(selector, { ...options, position: "innerHtml" });
10877
+ function insertBeforeEndLight(selectorOrOptions, maybeOptions, descriptor) {
10878
+ if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
10879
+ return applyNode({ position: "beforeEnd", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
10880
+ }
10881
+ if (typeof selectorOrOptions === "string") {
10882
+ return applyNode(selectorOrOptions, { ...maybeOptions, position: "beforeEnd", root: "light" });
10883
+ }
10884
+ return applyNode({ ...selectorOrOptions, position: "beforeEnd", root: "light" });
10761
10885
  }
10762
- function innerHtmlLightNode(selector, options = {}) {
10763
- return applyNode(selector, { ...options, position: "innerHtml", root: "light" });
10886
+ function insertBeforeEndShadow(selectorOrOptions, maybeOptions, descriptor) {
10887
+ if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
10888
+ return applyNode({ position: "beforeEnd", root: "shadow" })(selectorOrOptions, maybeOptions, descriptor);
10889
+ }
10890
+ if (typeof selectorOrOptions === "string") {
10891
+ return applyNode(selectorOrOptions, { ...maybeOptions, position: "beforeEnd", root: "shadow" });
10892
+ }
10893
+ return applyNode({ ...selectorOrOptions, position: "beforeEnd", root: "shadow" });
10764
10894
  }
10765
- function innerHtmlShadowNode(selector, options = {}) {
10766
- return applyNode(selector, { ...options, position: "innerHtml", root: "shadow" });
10895
+ function insertAfterBegin(selectorOrOptions, maybeOptions, descriptor) {
10896
+ if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
10897
+ return applyNode({ position: "afterBegin" })(selectorOrOptions, maybeOptions, descriptor);
10898
+ }
10899
+ if (typeof selectorOrOptions === "string") {
10900
+ return applyNode(selectorOrOptions, { ...maybeOptions, position: "afterBegin" });
10901
+ }
10902
+ return applyNode({ ...selectorOrOptions, position: "afterBegin" });
10767
10903
  }
10768
- function innerTextNode(selector, options = {}) {
10769
- return applyNode(selector, { ...options, position: "innerText" });
10904
+ function insertAfterBeginLight(selectorOrOptions, maybeOptions, descriptor) {
10905
+ if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
10906
+ return applyNode({ position: "afterBegin", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
10907
+ }
10908
+ if (typeof selectorOrOptions === "string") {
10909
+ return applyNode(selectorOrOptions, { ...maybeOptions, position: "afterBegin", root: "light" });
10910
+ }
10911
+ return applyNode({ ...selectorOrOptions, position: "afterBegin", root: "light" });
10770
10912
  }
10771
- function innerTextLightNode(selector, options = {}) {
10772
- return applyNode(selector, { ...options, position: "innerText", root: "light" });
10913
+ function replaceChildrenLight(selectorOrOptions, maybeOptions, descriptor) {
10914
+ if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
10915
+ return applyNode({ position: "replaceChildren", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
10916
+ }
10917
+ if (typeof selectorOrOptions === "string") {
10918
+ return applyNode(selectorOrOptions, { ...maybeOptions, position: "replaceChildren", root: "light" });
10919
+ }
10920
+ return applyNode({ ...selectorOrOptions, position: "replaceChildren", root: "light" });
10773
10921
  }
10774
- function innerTextShadowNode(selector, options = {}) {
10775
- return applyNode(selector, { ...options, position: "innerText", root: "shadow" });
10922
+ function clearChildrenLight(selectorOrOptions, maybeOptions, descriptor) {
10923
+ if (descriptor !== void 0 && (typeof maybeOptions === "symbol" || typeof maybeOptions === "string")) {
10924
+ return applyNode({ position: "clearChildren", root: "light" })(selectorOrOptions, maybeOptions, descriptor);
10925
+ }
10926
+ if (typeof selectorOrOptions === "string") {
10927
+ return applyNode(selectorOrOptions, { ...maybeOptions, position: "clearChildren", root: "light" });
10928
+ }
10929
+ return applyNode({ ...selectorOrOptions, position: "clearChildren", root: "light" });
10776
10930
  }
10777
10931
  var findAllApplyNodeMetadata = (target) => {
10778
10932
  const result = /* @__PURE__ */ new Map();
@@ -10903,22 +11057,64 @@ var dooboostoreSimpleWebComponent = (() => {
10903
11057
  };
10904
11058
  };
10905
11059
  }
10906
- function applyClass(selector, action = "update", options = {}) {
10907
- return createClassDecorator(action)(selector, options);
10908
- }
10909
- var setClass = (selector, classMapOrOptions, options = {}) => createClassDecorator("set")(selector, classMapOrOptions, options);
10910
- var updateClass = (selector, classMapOrOptions, options = {}) => createClassDecorator("update")(selector, classMapOrOptions, options);
10911
- var addClass = (selector, classMapOrOptions, options = {}) => createClassDecorator("add")(selector, classMapOrOptions, options);
10912
- var removeClass = (selector, classMapOrOptions, options = {}) => createClassDecorator("remove")(selector, classMapOrOptions, options);
10913
- var toggleClass = (selector, classMapOrOptions, options = {}) => createClassDecorator("toggle")(selector, classMapOrOptions, options);
10914
- function applyClassThis(action = "update", options = {}) {
11060
+ function applyClass(selectorOrTarget, actionOrPropertyKey, optionsOrDescriptor) {
11061
+ if (optionsOrDescriptor !== void 0 && (typeof actionOrPropertyKey === "string" || typeof actionOrPropertyKey === "symbol")) {
11062
+ return createClassDecorator("update")("$this", {})(selectorOrTarget, actionOrPropertyKey, optionsOrDescriptor);
11063
+ }
11064
+ if (typeof selectorOrTarget === "string") {
11065
+ const action2 = typeof actionOrPropertyKey === "string" ? actionOrPropertyKey : "update";
11066
+ const options2 = typeof actionOrPropertyKey === "object" ? actionOrPropertyKey : optionsOrDescriptor;
11067
+ return createClassDecorator(action2)(selectorOrTarget, options2);
11068
+ }
11069
+ const action = typeof selectorOrTarget === "string" ? selectorOrTarget : "update";
11070
+ const options = typeof selectorOrTarget === "object" ? selectorOrTarget : actionOrPropertyKey;
10915
11071
  return createClassDecorator(action)("$this", options);
10916
11072
  }
10917
- var setClassThis = (classMapOrOptions, options = {}) => createClassDecorator("set")("$this", classMapOrOptions, options);
10918
- var updateClassThis = (classMapOrOptions, options = {}) => createClassDecorator("update")("$this", classMapOrOptions, options);
10919
- var addClassThis = (classMapOrOptions, options = {}) => createClassDecorator("add")("$this", classMapOrOptions, options);
10920
- var removeClassThis = (classMapOrOptions, options = {}) => createClassDecorator("remove")("$this", classMapOrOptions, options);
10921
- var toggleClassThis = (classMapOrOptions, options = {}) => createClassDecorator("toggle")("$this", classMapOrOptions, options);
11073
+ function setClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
11074
+ if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
11075
+ return createClassDecorator("set")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
11076
+ }
11077
+ if (typeof selectorOrTarget === "string") {
11078
+ return createClassDecorator("set")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
11079
+ }
11080
+ return createClassDecorator("set")("$this", selectorOrTarget);
11081
+ }
11082
+ function updateClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
11083
+ if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
11084
+ return createClassDecorator("update")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
11085
+ }
11086
+ if (typeof selectorOrTarget === "string") {
11087
+ return createClassDecorator("update")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
11088
+ }
11089
+ return createClassDecorator("update")("$this", selectorOrTarget);
11090
+ }
11091
+ function addClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
11092
+ if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
11093
+ return createClassDecorator("add")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
11094
+ }
11095
+ if (typeof selectorOrTarget === "string") {
11096
+ return createClassDecorator("add")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
11097
+ }
11098
+ return createClassDecorator("add")("$this", selectorOrTarget);
11099
+ }
11100
+ function removeClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
11101
+ if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
11102
+ return createClassDecorator("remove")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
11103
+ }
11104
+ if (typeof selectorOrTarget === "string") {
11105
+ return createClassDecorator("remove")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
11106
+ }
11107
+ return createClassDecorator("remove")("$this", selectorOrTarget);
11108
+ }
11109
+ function toggleClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor) {
11110
+ if (optionsOrDescriptor !== void 0 && (typeof classMapOrOptionsOrPropertyKey === "string" || typeof classMapOrOptionsOrPropertyKey === "symbol")) {
11111
+ return createClassDecorator("toggle")("$this", {})(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
11112
+ }
11113
+ if (typeof selectorOrTarget === "string") {
11114
+ return createClassDecorator("toggle")(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor);
11115
+ }
11116
+ return createClassDecorator("toggle")("$this", selectorOrTarget);
11117
+ }
10922
11118
  var findAllClassMetadata = (target) => {
10923
11119
  const result = /* @__PURE__ */ new Map();
10924
11120
  const maps = ReflectUtils.findAllMetadata(CLASS_METADATA_KEY, target);
@@ -11027,18 +11223,46 @@ var dooboostoreSimpleWebComponent = (() => {
11027
11223
  };
11028
11224
  };
11029
11225
  }
11030
- function applyStyle(selector, action = "update", options = {}) {
11031
- return createStyleDecorator(action)(selector, options);
11032
- }
11033
- var setStyle = (selector, options = {}) => createStyleDecorator("set")(selector, options);
11034
- var updateStyle = (selector, options = {}) => createStyleDecorator("update")(selector, options);
11035
- var removeStyle = (selector, options = {}) => createStyleDecorator("remove")(selector, options);
11036
- function applyStyleThis(action = "update", options = {}) {
11226
+ function applyStyle(selectorOrTarget, actionOrPropertyKey, optionsOrDescriptor) {
11227
+ if (optionsOrDescriptor !== void 0 && (typeof actionOrPropertyKey === "string" || typeof actionOrPropertyKey === "symbol")) {
11228
+ return createStyleDecorator("update")("$this", {})(selectorOrTarget, actionOrPropertyKey, optionsOrDescriptor);
11229
+ }
11230
+ if (typeof selectorOrTarget === "string") {
11231
+ const action2 = typeof actionOrPropertyKey === "string" ? actionOrPropertyKey : "update";
11232
+ const options2 = typeof actionOrPropertyKey === "object" ? actionOrPropertyKey : optionsOrDescriptor;
11233
+ return createStyleDecorator(action2)(selectorOrTarget, options2);
11234
+ }
11235
+ const action = typeof selectorOrTarget === "string" ? selectorOrTarget : "update";
11236
+ const options = typeof selectorOrTarget === "object" ? selectorOrTarget : actionOrPropertyKey;
11037
11237
  return createStyleDecorator(action)("$this", options);
11038
11238
  }
11039
- var setStyleThis = (options = {}) => createStyleDecorator("set")("$this", options);
11040
- var updateStyleThis = (options = {}) => createStyleDecorator("update")("$this", options);
11041
- var removeStyleThis = (options = {}) => createStyleDecorator("remove")("$this", options);
11239
+ function setStyle(selectorOrTarget, optionsOrPropertyKey, descriptor) {
11240
+ if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
11241
+ return createStyleDecorator("set")("$this", {})(selectorOrTarget, optionsOrPropertyKey, descriptor);
11242
+ }
11243
+ if (typeof selectorOrTarget === "string") {
11244
+ return createStyleDecorator("set")(selectorOrTarget, optionsOrPropertyKey);
11245
+ }
11246
+ return createStyleDecorator("set")("$this", selectorOrTarget);
11247
+ }
11248
+ function updateStyle(selectorOrTarget, optionsOrPropertyKey, descriptor) {
11249
+ if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
11250
+ return createStyleDecorator("update")("$this", {})(selectorOrTarget, optionsOrPropertyKey, descriptor);
11251
+ }
11252
+ if (typeof selectorOrTarget === "string") {
11253
+ return createStyleDecorator("update")(selectorOrTarget, optionsOrPropertyKey);
11254
+ }
11255
+ return createStyleDecorator("update")("$this", selectorOrTarget);
11256
+ }
11257
+ function removeStyle(selectorOrTarget, optionsOrPropertyKey, descriptor) {
11258
+ if (descriptor !== void 0 && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol")) {
11259
+ return createStyleDecorator("remove")("$this", {})(selectorOrTarget, optionsOrPropertyKey, descriptor);
11260
+ }
11261
+ if (typeof selectorOrTarget === "string") {
11262
+ return createStyleDecorator("remove")(selectorOrTarget, optionsOrPropertyKey);
11263
+ }
11264
+ return createStyleDecorator("remove")("$this", selectorOrTarget);
11265
+ }
11042
11266
  var findAllStyleMetadata = (target) => {
11043
11267
  const result = /* @__PURE__ */ new Map();
11044
11268
  const maps = ReflectUtils.findAllMetadata(STYLE_METADATA_KEY, target);
@@ -11086,6 +11310,7 @@ var dooboostoreSimpleWebComponent = (() => {
11086
11310
  }
11087
11311
  return createSubscribeSwcAppRouteChangeWhileConnected(options);
11088
11312
  }
11313
+ var changedRoute = subscribeSwcAppRouteChangeWhileConnected;
11089
11314
  var getSubscribeSwcAppRouteChangeWhileConnectedMetadata = (target) => {
11090
11315
  const constructor = target instanceof Function ? target : target.constructor;
11091
11316
  const results = ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor);
@@ -11126,6 +11351,7 @@ var dooboostoreSimpleWebComponent = (() => {
11126
11351
  }
11127
11352
  return createSubscribeSwcAppMessageWhileConnected(options, messageType);
11128
11353
  }
11354
+ var receiveMessage = subscribeSwcAppMessageWhileConnected;
11129
11355
  var getSubscribeSwcAppMessageWhileConnectedMetadata = (target) => {
11130
11356
  const constructor = target instanceof Function ? target : target.constructor;
11131
11357
  return ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY, constructor);
@@ -11155,7 +11381,7 @@ var dooboostoreSimpleWebComponent = (() => {
11155
11381
  }
11156
11382
  return v;
11157
11383
  };
11158
- const publishMessage = (data) => {
11384
+ const publishMessage2 = (data) => {
11159
11385
  const appHost = SwcUtils.getAppHost(this);
11160
11386
  if (appHost) {
11161
11387
  appHost.publishMessage({
@@ -11168,13 +11394,13 @@ var dooboostoreSimpleWebComponent = (() => {
11168
11394
  if (result instanceof Promise) {
11169
11395
  result.then((data) => {
11170
11396
  const extracted = extractValue(data);
11171
- publishMessage(extracted);
11397
+ publishMessage2(extracted);
11172
11398
  }).catch((err) => {
11173
11399
  console.warn("publishSwcAppMessage async error:", err);
11174
11400
  });
11175
11401
  } else {
11176
11402
  const extracted = extractValue(result);
11177
- publishMessage(extracted);
11403
+ publishMessage2(extracted);
11178
11404
  }
11179
11405
  return result;
11180
11406
  };
@@ -11199,7 +11425,7 @@ var dooboostoreSimpleWebComponent = (() => {
11199
11425
  }
11200
11426
  return createPublishSwcAppMessage(messageType, options);
11201
11427
  }
11202
- var publish = publishSwcAppMessage;
11428
+ var publishMessage = publishSwcAppMessage;
11203
11429
  var getPublishSwcAppMessageMetadata = (target) => {
11204
11430
  const constructor = target instanceof Function ? target : target.constructor;
11205
11431
  return ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, constructor);
@@ -13316,6 +13542,10 @@ var dooboostoreSimpleWebComponent = (() => {
13316
13542
  super(config);
13317
13543
  __publicField(this, "_history", []);
13318
13544
  __publicField(this, "_currentIndex", -1);
13545
+ if (config.firstUrl) {
13546
+ this._history.push({ url: config.firstUrl, data: null, title: void 0 });
13547
+ this._currentIndex = 0;
13548
+ }
13319
13549
  }
13320
13550
  // Override pushState to manage internal history
13321
13551
  pushState(data, title, path, config) {
@@ -13487,7 +13717,9 @@ var dooboostoreSimpleWebComponent = (() => {
13487
13717
  if (this.router) otherInstanceSim.set(Router, this.router);
13488
13718
  this.simpleApplication.run(otherInstanceSim);
13489
13719
  if (this._config.onStartedLazyDefineComponent) {
13490
- await Promise.all(this._config.onStartedLazyDefineComponent.map((it) => it(this._config.window)));
13720
+ await Promise.all(this._config.onStartedLazyDefineComponent.map((it) => {
13721
+ it(this._config.window);
13722
+ }));
13491
13723
  }
13492
13724
  if (this._config.onEngineStarted) {
13493
13725
  await this._config.onEngineStarted(this.simpleApplication, this.host);
@@ -13564,6 +13796,13 @@ var dooboostoreSimpleWebComponent = (() => {
13564
13796
  const methodName = metadata.propertyKey;
13565
13797
  let pathPattern = metadata.options?.path;
13566
13798
  const filter = metadata.options?.filter;
13799
+ const extractValue = (v) => {
13800
+ const keyToUse = metadata.options?.valueKey ?? SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY;
13801
+ if (v && typeof v === "object" && keyToUse in v) {
13802
+ return v[keyToUse];
13803
+ }
13804
+ return v;
13805
+ };
13567
13806
  if (typeof pathPattern === "function") {
13568
13807
  pathPattern = pathPattern(instance);
13569
13808
  }
@@ -13588,7 +13827,7 @@ var dooboostoreSimpleWebComponent = (() => {
13588
13827
  const hostSet = SwcUtils.getHelperAndHostSet(this.config.window, this);
13589
13828
  const filterPassed = !filter || filter(this.router, { helper: hostSet, currentThis: instance });
13590
13829
  if (pathMatched && filterPassed && instance[methodName]) {
13591
- const result = await instance[methodName]({ ...re, pathData });
13830
+ const result = extractValue(await instance[methodName]({ ...re, pathData }));
13592
13831
  if (result !== void 0 && result !== null) {
13593
13832
  break;
13594
13833
  }
@@ -13703,7 +13942,15 @@ var dooboostoreSimpleWebComponent = (() => {
13703
13942
  context: this,
13704
13943
  args: SwcUtils.getHelperAndHostSet(win, this)
13705
13944
  });
13706
- this.connect(userConfig);
13945
+ if (userConfig instanceof Promise) {
13946
+ userConfig.then((resolvedConfig) => {
13947
+ this.connect(resolvedConfig);
13948
+ }).catch((e) => {
13949
+ console.error("[SWC-MIXIN] Script execution failed:", e);
13950
+ });
13951
+ } else {
13952
+ this.connect(userConfig);
13953
+ }
13707
13954
  } catch (e) {
13708
13955
  console.error("[SWC-MIXIN] Script execution failed:", e);
13709
13956
  }