wevu 6.16.40 → 6.16.42

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,11 +1,11 @@
1
- import "./src-HtRlku0K.mjs";
1
+ import "./src-CLv6p36Y.mjs";
2
2
  import { C as effect, D as onScopeDispose, E as getCurrentScope, N as nextTick, O as startBatch, S as batch, T as endBatch, a as toValue, b as addMutationRecorder, c as isRaw, d as reactive, f as isShallowReactive, g as touchReactive, h as prelinkReactiveTree, i as ref, k as stop, l as isReactive, n as isRef, o as unref, p as shallowReactive, s as getReactiveVersion, t as customRef, u as markRaw, w as effectScope, x as removeMutationRecorder, y as toRaw } from "./ref-DJZWB2im.mjs";
3
3
  import { t as computed } from "./computed-njo5yWBk.mjs";
4
4
  import { S as shallowReadonly, b as isReadonly, c as getCurrentSetupContext, d as setCurrentSetupContext, n as callHookList, r as callHookReturn, s as getCurrentInstance, u as setCurrentInstance, x as readonly, y as isProxy } from "./base-BPG0sDu-.mjs";
5
5
  import { a as getDeepWatchStrategy, c as isShallowRef, i as watchSyncEffect, l as shallowRef, n as watchEffect, o as setDeepWatchStrategy, r as watchPostEffect, s as traverse, t as watch, u as triggerRef } from "./watch-CJiD9u34.mjs";
6
6
  import { n as toRefs, t as toRef } from "./toRefs-C9gCs6N3.mjs";
7
7
  import { $ as onUnhandledRejection, A as setGlobalProvidedValue, B as onPageNotFound, F as onHide, G as onResize, H as onPullDownRefresh, I as onLaunch, J as onShareAppMessage, K as onRouteDone, L as onLoad, M as onAttached, N as onDetached, P as onError, Q as onThemeChange, R as onMemoryWarning, U as onReachBottom, V as onPageScroll, W as onReady, X as onShow, Y as onShareTimeline, Z as onTabItemTap, _ as provide, et as onUnload, g as injectGlobal, h as inject, j as onAddToFavorites, m as hasInjectionContext, n as useNativeRouter, q as onSaveExitState, t as useNativePageRouter, v as provideGlobal, z as onMoved } from "./router-pDQKAVqU.mjs";
8
- import { $ as version, A as registerPageLayoutBridge, B as mountRuntimeInstance, C as useElementIntersectionObserver, D as defineComponent, E as createWevuScopedSlotComponent, F as unregisterRuntimeLayoutHosts, G as setPageLayout, H as teardownRuntimeInstance, I as useLayoutBridge, J as usePageLayout, K as syncRuntimePageLayoutState, L as useLayoutHosts, M as resolveLayoutBridge, N as resolveLayoutHost, O as createApp, P as unregisterPageLayoutBridge, Q as markNoSetData, R as waitForLayoutHost, S as useIntersectionObserver, T as createWevuComponent, U as runSetupFunction, V as setRuntimeSetDataVisibility, W as resolveRuntimePageLayoutName, X as setWevuDefaults, Y as resetWevuDefaults, Z as isNoSetData, _ as usePageScrollThrottle, a as useModel, at as onDeactivated, b as useNavigationBarMetrics, c as useSlots, ct as onServerPrefetch, d as useUpdatePerformanceListener, et as callUpdateHooks, f as useBoundingClientRect, g as useAsyncPullDownRefresh, h as useSelectorQuery, i as useChangeModel, it as onBeforeUpdate, j as registerRuntimeLayoutHosts, k as registerComponent, l as defineAppSetup, lt as onUnmounted, m as useSelectorFields, n as mergeModels, nt as onBeforeMount, o as useAttrs, ot as onErrorCaptured, p as useScrollOffset, q as syncRuntimePageLayoutStateFromRuntime, r as useBindModel, rt as onBeforeUnmount, s as useNativeInstance, st as onMounted, t as useTemplateRef, tt as onActivated, u as use, ut as onUpdated, v as getCurrentPageStackSnapshot, w as useDisposables, x as usePageStack, y as getNavigationBarMetrics, z as registerApp } from "./templateRef-3tUik_sj.mjs";
8
+ import { $ as version, A as registerPageLayoutBridge, B as mountRuntimeInstance, C as useElementIntersectionObserver, D as defineComponent, E as createWevuScopedSlotComponent, F as unregisterRuntimeLayoutHosts, G as setPageLayout, H as teardownRuntimeInstance, I as useLayoutBridge, J as usePageLayout, K as syncRuntimePageLayoutState, L as useLayoutHosts, M as resolveLayoutBridge, N as resolveLayoutHost, O as createApp, P as unregisterPageLayoutBridge, Q as markNoSetData, R as waitForLayoutHost, S as useIntersectionObserver, T as createWevuComponent, U as runSetupFunction, V as setRuntimeSetDataVisibility, W as resolveRuntimePageLayoutName, X as setWevuDefaults, Y as resetWevuDefaults, Z as isNoSetData, _ as usePageScrollThrottle, a as useModel, at as onDeactivated, b as useNavigationBarMetrics, c as useSlots, ct as onServerPrefetch, d as useUpdatePerformanceListener, et as callUpdateHooks, f as useBoundingClientRect, g as useAsyncPullDownRefresh, h as useSelectorQuery, i as useChangeModel, it as onBeforeUpdate, j as registerRuntimeLayoutHosts, k as registerComponent, l as defineAppSetup, lt as onUnmounted, m as useSelectorFields, n as mergeModels, nt as onBeforeMount, o as useAttrs, ot as onErrorCaptured, p as useScrollOffset, q as syncRuntimePageLayoutStateFromRuntime, r as useBindModel, rt as onBeforeUnmount, s as useNativeInstance, st as onMounted, t as useTemplateRef, tt as onActivated, u as use, ut as onUpdated, v as getCurrentPageStackSnapshot, w as useDisposables, x as usePageStack, y as getNavigationBarMetrics, z as registerApp } from "./templateRef-DFq1B-ZH.mjs";
9
9
  import { n as normalizeStyle, r as resolvePropValue, t as normalizeClass } from "./template-D4K5xTD2.mjs";
10
10
  import { n as defineStore, r as createStore, t as storeToRefs } from "./store-D_seGoEN.mjs";
11
11
 
@@ -1,5 +1,5 @@
1
1
  import { c as getCurrentSetupContext, d as setCurrentSetupContext, n as callHookList, r as callHookReturn, s as getCurrentInstance, u as setCurrentInstance } from "./base-BPG0sDu-.mjs";
2
2
  import { $ as onUnhandledRejection, A as setGlobalProvidedValue, B as onPageNotFound, F as onHide, G as onResize, H as onPullDownRefresh, I as onLaunch, J as onShareAppMessage, K as onRouteDone, L as onLoad, M as onAttached, N as onDetached, P as onError, Q as onThemeChange, R as onMemoryWarning, U as onReachBottom, V as onPageScroll, W as onReady, X as onShow, Y as onShareTimeline, Z as onTabItemTap, _ as provide, et as onUnload, g as injectGlobal, h as inject, j as onAddToFavorites, m as hasInjectionContext, n as useNativeRouter, q as onSaveExitState, t as useNativePageRouter, v as provideGlobal, z as onMoved } from "./router-pDQKAVqU.mjs";
3
- import { $ as version, B as mountRuntimeInstance, C as useElementIntersectionObserver, D as defineComponent, E as createWevuScopedSlotComponent, G as setPageLayout, H as teardownRuntimeInstance, I as useLayoutBridge, J as usePageLayout, K as syncRuntimePageLayoutState, L as useLayoutHosts, M as resolveLayoutBridge, N as resolveLayoutHost, O as createApp, Q as markNoSetData, R as waitForLayoutHost, S as useIntersectionObserver, T as createWevuComponent, U as runSetupFunction, V as setRuntimeSetDataVisibility, W as resolveRuntimePageLayoutName, X as setWevuDefaults, Y as resetWevuDefaults, Z as isNoSetData, _ as usePageScrollThrottle, a as useModel, at as onDeactivated, b as useNavigationBarMetrics, c as useSlots, ct as onServerPrefetch, d as useUpdatePerformanceListener, f as useBoundingClientRect, g as useAsyncPullDownRefresh, h as useSelectorQuery, i as useChangeModel, it as onBeforeUpdate, k as registerComponent, l as defineAppSetup, lt as onUnmounted, m as useSelectorFields, n as mergeModels, nt as onBeforeMount, o as useAttrs, ot as onErrorCaptured, p as useScrollOffset, q as syncRuntimePageLayoutStateFromRuntime, r as useBindModel, rt as onBeforeUnmount, s as useNativeInstance, st as onMounted, t as useTemplateRef, tt as onActivated, u as use, ut as onUpdated, v as getCurrentPageStackSnapshot, w as useDisposables, x as usePageStack, y as getNavigationBarMetrics, z as registerApp } from "./templateRef-3tUik_sj.mjs";
3
+ import { $ as version, B as mountRuntimeInstance, C as useElementIntersectionObserver, D as defineComponent, E as createWevuScopedSlotComponent, G as setPageLayout, H as teardownRuntimeInstance, I as useLayoutBridge, J as usePageLayout, K as syncRuntimePageLayoutState, L as useLayoutHosts, M as resolveLayoutBridge, N as resolveLayoutHost, O as createApp, Q as markNoSetData, R as waitForLayoutHost, S as useIntersectionObserver, T as createWevuComponent, U as runSetupFunction, V as setRuntimeSetDataVisibility, W as resolveRuntimePageLayoutName, X as setWevuDefaults, Y as resetWevuDefaults, Z as isNoSetData, _ as usePageScrollThrottle, a as useModel, at as onDeactivated, b as useNavigationBarMetrics, c as useSlots, ct as onServerPrefetch, d as useUpdatePerformanceListener, f as useBoundingClientRect, g as useAsyncPullDownRefresh, h as useSelectorQuery, i as useChangeModel, it as onBeforeUpdate, k as registerComponent, l as defineAppSetup, lt as onUnmounted, m as useSelectorFields, n as mergeModels, nt as onBeforeMount, o as useAttrs, ot as onErrorCaptured, p as useScrollOffset, q as syncRuntimePageLayoutStateFromRuntime, r as useBindModel, rt as onBeforeUnmount, s as useNativeInstance, st as onMounted, t as useTemplateRef, tt as onActivated, u as use, ut as onUpdated, v as getCurrentPageStackSnapshot, w as useDisposables, x as usePageStack, y as getNavigationBarMetrics, z as registerApp } from "./templateRef-DFq1B-ZH.mjs";
4
4
 
5
5
  export { callHookList, callHookReturn, createApp, createWevuComponent, createWevuScopedSlotComponent, defineAppSetup, defineComponent, getCurrentInstance, getCurrentPageStackSnapshot, getCurrentSetupContext, getNavigationBarMetrics, hasInjectionContext, inject, injectGlobal, isNoSetData, markNoSetData, mergeModels, mountRuntimeInstance, onActivated, onAddToFavorites, onAttached, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onDetached, onError, onErrorCaptured, onHide, onLaunch, onLoad, onMemoryWarning, onMounted, onMoved, onPageNotFound, onPageScroll, onPullDownRefresh, onReachBottom, onReady, onResize, onRouteDone, onSaveExitState, onServerPrefetch, onShareAppMessage, onShareTimeline, onShow, onTabItemTap, onThemeChange, onUnhandledRejection, onUnload, onUnmounted, onUpdated, provide, provideGlobal, registerApp, registerComponent, resetWevuDefaults, resolveLayoutBridge, resolveLayoutHost, resolveRuntimePageLayoutName, runSetupFunction, setCurrentInstance, setCurrentSetupContext, setGlobalProvidedValue, setPageLayout, setRuntimeSetDataVisibility, setWevuDefaults, syncRuntimePageLayoutState, syncRuntimePageLayoutStateFromRuntime, teardownRuntimeInstance, use, useAsyncPullDownRefresh, useAttrs, useBindModel, useBoundingClientRect, useChangeModel, useDisposables, useElementIntersectionObserver, useIntersectionObserver, useLayoutBridge, useLayoutHosts, useModel, useNativeInstance, useNativePageRouter, useNativeRouter, useNavigationBarMetrics, usePageLayout, usePageScrollThrottle, usePageStack, useScrollOffset, useSelectorFields, useSelectorQuery, useSlots, useTemplateRef, useUpdatePerformanceListener, version, waitForLayoutHost };
@@ -4,7 +4,7 @@ import { S as shallowReadonly, b as isReadonly, c as getCurrentSetupContext, d a
4
4
  import { a as getDeepWatchStrategy, c as isShallowRef, i as watchSyncEffect, l as shallowRef, n as watchEffect, o as setDeepWatchStrategy, r as watchPostEffect, s as traverse, t as watch, u as triggerRef } from "./watch-CJiD9u34.mjs";
5
5
  import { n as toRefs, t as toRef } from "./toRefs-C9gCs6N3.mjs";
6
6
  import { $ as onUnhandledRejection, A as setGlobalProvidedValue, B as onPageNotFound, F as onHide, G as onResize, H as onPullDownRefresh, I as onLaunch, J as onShareAppMessage, K as onRouteDone, L as onLoad, M as onAttached, N as onDetached, P as onError, Q as onThemeChange, R as onMemoryWarning, U as onReachBottom, V as onPageScroll, W as onReady, X as onShow, Y as onShareTimeline, Z as onTabItemTap, _ as provide, et as onUnload, g as injectGlobal, h as inject, j as onAddToFavorites, m as hasInjectionContext, n as useNativeRouter, q as onSaveExitState, t as useNativePageRouter, v as provideGlobal, z as onMoved } from "./router-pDQKAVqU.mjs";
7
- import { $ as version, A as registerPageLayoutBridge, B as mountRuntimeInstance, C as useElementIntersectionObserver, D as defineComponent, E as createWevuScopedSlotComponent, F as unregisterRuntimeLayoutHosts, G as setPageLayout, H as teardownRuntimeInstance, I as useLayoutBridge, J as usePageLayout, K as syncRuntimePageLayoutState, L as useLayoutHosts, M as resolveLayoutBridge, N as resolveLayoutHost, O as createApp, P as unregisterPageLayoutBridge, Q as markNoSetData, R as waitForLayoutHost, S as useIntersectionObserver, T as createWevuComponent, U as runSetupFunction, V as setRuntimeSetDataVisibility, W as resolveRuntimePageLayoutName, X as setWevuDefaults, Y as resetWevuDefaults, Z as isNoSetData, _ as usePageScrollThrottle, a as useModel, at as onDeactivated, b as useNavigationBarMetrics, c as useSlots, ct as onServerPrefetch, d as useUpdatePerformanceListener, et as callUpdateHooks, f as useBoundingClientRect, g as useAsyncPullDownRefresh, h as useSelectorQuery, i as useChangeModel, it as onBeforeUpdate, j as registerRuntimeLayoutHosts, k as registerComponent, l as defineAppSetup, lt as onUnmounted, m as useSelectorFields, n as mergeModels, nt as onBeforeMount, o as useAttrs, ot as onErrorCaptured, p as useScrollOffset, q as syncRuntimePageLayoutStateFromRuntime, r as useBindModel, rt as onBeforeUnmount, s as useNativeInstance, st as onMounted, t as useTemplateRef, tt as onActivated, u as use, ut as onUpdated, v as getCurrentPageStackSnapshot, w as useDisposables, x as usePageStack, y as getNavigationBarMetrics, z as registerApp } from "./templateRef-3tUik_sj.mjs";
7
+ import { $ as version, A as registerPageLayoutBridge, B as mountRuntimeInstance, C as useElementIntersectionObserver, D as defineComponent, E as createWevuScopedSlotComponent, F as unregisterRuntimeLayoutHosts, G as setPageLayout, H as teardownRuntimeInstance, I as useLayoutBridge, J as usePageLayout, K as syncRuntimePageLayoutState, L as useLayoutHosts, M as resolveLayoutBridge, N as resolveLayoutHost, O as createApp, P as unregisterPageLayoutBridge, Q as markNoSetData, R as waitForLayoutHost, S as useIntersectionObserver, T as createWevuComponent, U as runSetupFunction, V as setRuntimeSetDataVisibility, W as resolveRuntimePageLayoutName, X as setWevuDefaults, Y as resetWevuDefaults, Z as isNoSetData, _ as usePageScrollThrottle, a as useModel, at as onDeactivated, b as useNavigationBarMetrics, c as useSlots, ct as onServerPrefetch, d as useUpdatePerformanceListener, et as callUpdateHooks, f as useBoundingClientRect, g as useAsyncPullDownRefresh, h as useSelectorQuery, i as useChangeModel, it as onBeforeUpdate, j as registerRuntimeLayoutHosts, k as registerComponent, l as defineAppSetup, lt as onUnmounted, m as useSelectorFields, n as mergeModels, nt as onBeforeMount, o as useAttrs, ot as onErrorCaptured, p as useScrollOffset, q as syncRuntimePageLayoutStateFromRuntime, r as useBindModel, rt as onBeforeUnmount, s as useNativeInstance, st as onMounted, t as useTemplateRef, tt as onActivated, u as use, ut as onUpdated, v as getCurrentPageStackSnapshot, w as useDisposables, x as usePageStack, y as getNavigationBarMetrics, z as registerApp } from "./templateRef-DFq1B-ZH.mjs";
8
8
  import { n as normalizeStyle, r as resolvePropValue, t as normalizeClass } from "./template-D4K5xTD2.mjs";
9
9
  import { n as defineStore, r as createStore, t as storeToRefs } from "./store-D_seGoEN.mjs";
10
10
 
@@ -84,7 +84,7 @@ function callUpdateHooks(target, phase) {
84
84
 
85
85
  //#endregion
86
86
  //#region package.json
87
- var version$1 = "6.16.40";
87
+ var version$1 = "6.16.42";
88
88
 
89
89
  //#endregion
90
90
  //#region src/version.ts
@@ -541,6 +541,8 @@ function createDiagnosticsLogger(mode) {
541
541
  ];
542
542
  if (typeof info.mergedSiblingParents === "number") parts.push(`mergedParents=${info.mergedSiblingParents}`);
543
543
  if (typeof info.computedDirtyKeys === "number") parts.push(`computedDirty=${info.computedDirtyKeys}`);
544
+ if (typeof info.flushCount === "number") parts.push(`flushes=${info.flushCount}`);
545
+ if (typeof info.windowMs === "number") parts.push(`window=${info.windowMs}ms`);
544
546
  const message = `[wevu:setData] ${parts.join(" ")}`;
545
547
  if (isFallbackReason(info.reason)) {
546
548
  console.warn(message);
@@ -1175,7 +1177,7 @@ function runPatchUpdate(options) {
1175
1177
  //#endregion
1176
1178
  //#region src/runtime/app/setData/scheduler.ts
1177
1179
  function createSetDataScheduler(options) {
1178
- const { state, setupState, snapshotOmitKeys, computedRefs, dirtyComputedKeys, includeComputed, setDataStrategy, computedCompare, computedCompareMaxDepth, computedCompareMaxKeys, currentAdapter, shouldIncludeKey, maxPatchKeys, maxPayloadBytes, mergeSiblingThreshold, mergeSiblingMaxInflationRatio, mergeSiblingMaxParentBytes, mergeSiblingSkipArray, elevateTopKeyThreshold, toPlainMaxDepth, toPlainMaxKeys, includeFunctions = false, functionPaths, debug, debugWhen, debugSampleRate, runTracker, isMounted, initialSnapshot } = options;
1180
+ const { state, setupState, snapshotOmitKeys, computedRefs, dirtyComputedKeys, includeComputed, setDataStrategy, computedCompare, computedCompareMaxDepth, computedCompareMaxKeys, currentAdapter, shouldIncludeKey, maxPatchKeys, maxPayloadBytes, mergeSiblingThreshold, mergeSiblingMaxInflationRatio, mergeSiblingMaxParentBytes, mergeSiblingSkipArray, elevateTopKeyThreshold, toPlainMaxDepth, toPlainMaxKeys, includeFunctions = false, functionPaths, debug, debugWhen, debugSampleRate, loopWarning, runTracker, isMounted, initialSnapshot, initialState } = options;
1179
1181
  const plainCache = /* @__PURE__ */ new WeakMap();
1180
1182
  const plainCacheEligibility = /* @__PURE__ */ new WeakMap();
1181
1183
  let latestSnapshot = {};
@@ -1185,6 +1187,9 @@ function createSetDataScheduler(options) {
1185
1187
  const needsFullSnapshot = { value: setDataStrategy === "patch" };
1186
1188
  const pendingPatches = /* @__PURE__ */ new Map();
1187
1189
  const fallbackTopKeys = /* @__PURE__ */ new Set();
1190
+ const flushTimes = [];
1191
+ let lastLoopWarningAt = Number.NEGATIVE_INFINITY;
1192
+ const initialStateKeys = new Set(initialState && typeof initialState === "object" ? Object.keys(initialState) : []);
1188
1193
  const isPlainObject = (value) => {
1189
1194
  if (Object.prototype.toString.call(value) !== "[object Object]") return false;
1190
1195
  const proto = Object.getPrototypeOf(value);
@@ -1243,6 +1248,7 @@ function createSetDataScheduler(options) {
1243
1248
  continue;
1244
1249
  }
1245
1250
  if (hasOwn(rawState, key)) {
1251
+ if (initialStateKeys.has(key)) continue;
1246
1252
  rawState[key] = initialSnapshot[key];
1247
1253
  latestStateTokens[key] = createValueToken(rawState[key]);
1248
1254
  }
@@ -1269,6 +1275,26 @@ function createSetDataScheduler(options) {
1269
1275
  debug(info);
1270
1276
  } catch (_unused) {}
1271
1277
  };
1278
+ const recordFlushForLoopWarning = () => {
1279
+ if (!loopWarning) return;
1280
+ const current = Date.now();
1281
+ flushTimes.push(current);
1282
+ const windowStart = current - loopWarning.sampleWindowMs;
1283
+ while (flushTimes.length && flushTimes[0] < windowStart) flushTimes.shift();
1284
+ if (flushTimes.length <= loopWarning.maxFlushes) return;
1285
+ if (loopWarning.coolDownMs > 0 && current - lastLoopWarningAt < loopWarning.coolDownMs) return;
1286
+ lastLoopWarningAt = current;
1287
+ emitDebug({
1288
+ mode: setDataStrategy,
1289
+ reason: "loopWarning",
1290
+ pendingPatchKeys: pendingPatches.size + fallbackTopKeys.size,
1291
+ payloadKeys: 0,
1292
+ computedDirtyKeys: includeComputed ? dirtyComputedKeys.size : 0,
1293
+ flushCount: flushTimes.length,
1294
+ windowMs: loopWarning.sampleWindowMs,
1295
+ message: `疑似运行时更新循环:${flushTimes.length} 次 setData flush/${loopWarning.sampleWindowMs}ms`
1296
+ });
1297
+ };
1272
1298
  const collect = () => collectSnapshot({
1273
1299
  state,
1274
1300
  setupState,
@@ -1401,6 +1427,7 @@ function createSetDataScheduler(options) {
1401
1427
  };
1402
1428
  const job = (_stateRootRaw) => {
1403
1429
  if (!isMounted()) return;
1430
+ recordFlushForLoopWarning();
1404
1431
  runTracker();
1405
1432
  if (setDataStrategy === "patch" && !needsFullSnapshot.value) {
1406
1433
  if (!(pendingPatches.size > 0 || fallbackTopKeys.size > 0 || includeComputed && dirtyComputedKeys.size > 0)) {
@@ -1471,6 +1498,12 @@ function resolveSetDataOptions(setDataOptions) {
1471
1498
  const prelinkMaxKeys = setDataOptions === null || setDataOptions === void 0 ? void 0 : setDataOptions.prelinkMaxKeys;
1472
1499
  const debug = setDataOptions === null || setDataOptions === void 0 ? void 0 : setDataOptions.debug;
1473
1500
  const diagnostics = (_setDataOptions$diagn = setDataOptions === null || setDataOptions === void 0 ? void 0 : setDataOptions.diagnostics) !== null && _setDataOptions$diagn !== void 0 ? _setDataOptions$diagn : "off";
1501
+ const loopWarningOption = setDataOptions === null || setDataOptions === void 0 ? void 0 : setDataOptions.loopWarning;
1502
+ const loopWarning = loopWarningOption === false || loopWarningOption && typeof loopWarningOption === "object" && loopWarningOption.enabled === false ? false : {
1503
+ sampleWindowMs: typeof loopWarningOption === "object" && typeof loopWarningOption.sampleWindowMs === "number" ? Math.max(100, Math.floor(loopWarningOption.sampleWindowMs)) : 1e3,
1504
+ maxFlushes: typeof loopWarningOption === "object" && typeof loopWarningOption.maxFlushes === "number" ? Math.max(1, Math.floor(loopWarningOption.maxFlushes)) : 50,
1505
+ coolDownMs: typeof loopWarningOption === "object" && typeof loopWarningOption.coolDownMs === "number" ? Math.max(0, Math.floor(loopWarningOption.coolDownMs)) : 5e3
1506
+ };
1474
1507
  const debugWhen = (_setDataOptions$debug = setDataOptions === null || setDataOptions === void 0 ? void 0 : setDataOptions.debugWhen) !== null && _setDataOptions$debug !== void 0 ? _setDataOptions$debug : "fallback";
1475
1508
  const debugSampleRate = typeof (setDataOptions === null || setDataOptions === void 0 ? void 0 : setDataOptions.debugSampleRate) === "number" ? Math.min(1, Math.max(0, setDataOptions.debugSampleRate)) : 1;
1476
1509
  const elevateTopKeyThreshold = typeof (setDataOptions === null || setDataOptions === void 0 ? void 0 : setDataOptions.elevateTopKeyThreshold) === "number" ? Math.max(0, Math.floor(setDataOptions.elevateTopKeyThreshold)) : Number.POSITIVE_INFINITY;
@@ -1502,6 +1535,7 @@ function resolveSetDataOptions(setDataOptions) {
1502
1535
  prelinkMaxKeys,
1503
1536
  debug,
1504
1537
  diagnostics,
1538
+ loopWarning,
1505
1539
  debugWhen,
1506
1540
  debugSampleRate,
1507
1541
  elevateTopKeyThreshold,
@@ -1553,6 +1587,7 @@ function createRuntimeMount(options) {
1553
1587
  const adapterSnapshotOmitKeys = adapter === null || adapter === void 0 ? void 0 : adapter.__wevu_snapshotOmitKeys;
1554
1588
  const deferInitialSnapshot = Boolean(adapter === null || adapter === void 0 ? void 0 : adapter.__wevu_deferInitialSnapshot);
1555
1589
  const adapterInitialSnapshot = adapter === null || adapter === void 0 ? void 0 : adapter.__wevu_initialSnapshot;
1590
+ const adapterInitialState = adapter === null || adapter === void 0 ? void 0 : adapter.__wevu_initialState;
1556
1591
  const snapshotOmitKeys = new Set(adapterSnapshotOmitKeys instanceof Set ? adapterSnapshotOmitKeys : Array.isArray(adapterSnapshotOmitKeys) ? adapterSnapshotOmitKeys : []);
1557
1592
  if (rawState && typeof rawState === "object" && !hasOwn(rawState, WEVU_SETUP_STATE_KEY)) try {
1558
1593
  Object.defineProperty(rawState, WEVU_SETUP_STATE_KEY, {
@@ -1562,6 +1597,10 @@ function createRuntimeMount(options) {
1562
1597
  writable: false
1563
1598
  });
1564
1599
  } catch (_unused2) {}
1600
+ if (rawState && typeof rawState === "object" && adapterInitialState && typeof adapterInitialState === "object") for (const [key, value] of Object.entries(adapterInitialState)) {
1601
+ if (snapshotOmitKeys.has(key)) continue;
1602
+ rawState[key] = value;
1603
+ }
1565
1604
  const computedDefs = resolvedComputed;
1566
1605
  const methodDefs = resolvedMethods;
1567
1606
  let mounted = true;
@@ -1571,11 +1610,13 @@ function createRuntimeMount(options) {
1571
1610
  const value = state[key];
1572
1611
  if (hasTrackableSetupBinding(value)) trackedSetupReactiveKeys.add(key);
1573
1612
  });
1574
- const { includeComputed, setDataStrategy, maxPatchKeys, maxPayloadBytes, mergeSiblingThreshold, mergeSiblingMaxInflationRatio, mergeSiblingMaxParentBytes, mergeSiblingSkipArray, computedCompare, computedCompareMaxDepth, computedCompareMaxKeys, prelinkMaxDepth, prelinkMaxKeys, debug, diagnostics, debugWhen, debugSampleRate, elevateTopKeyThreshold, toPlainMaxDepth, toPlainMaxKeys, includeFunctions, functionPaths, shouldIncludeKey } = resolveSetDataOptions(setDataOptions);
1613
+ const { includeComputed, setDataStrategy, maxPatchKeys, maxPayloadBytes, mergeSiblingThreshold, mergeSiblingMaxInflationRatio, mergeSiblingMaxParentBytes, mergeSiblingSkipArray, computedCompare, computedCompareMaxDepth, computedCompareMaxKeys, prelinkMaxDepth, prelinkMaxKeys, debug, diagnostics, loopWarning, debugWhen, debugSampleRate, elevateTopKeyThreshold, toPlainMaxDepth, toPlainMaxKeys, includeFunctions, functionPaths, shouldIncludeKey } = resolveSetDataOptions(setDataOptions);
1575
1614
  const diagnosticsLogger = createDiagnosticsLogger(diagnostics);
1576
- const mergedDebug = debug || diagnosticsLogger ? (info) => {
1615
+ const loopWarningLogger = diagnostics === "off" && loopWarning ? createDiagnosticsLogger("fallback") : void 0;
1616
+ const mergedDebug = debug || diagnosticsLogger || loopWarningLogger ? (info) => {
1577
1617
  if (typeof debug === "function") debug(info);
1578
1618
  diagnosticsLogger === null || diagnosticsLogger === void 0 || diagnosticsLogger(info);
1619
+ if (info.reason === "loopWarning") loopWarningLogger === null || loopWarningLogger === void 0 || loopWarningLogger(info);
1579
1620
  } : void 0;
1580
1621
  const mergedDebugWhen = diagnostics === "always" ? "always" : debugWhen;
1581
1622
  const { boundMethods, computedRefs, computedSetters, dirtyComputedKeys, computedProxy, publicInstance, touchSetupMethodsVersion } = createRuntimeContext({
@@ -1617,9 +1658,11 @@ function createRuntimeMount(options) {
1617
1658
  debug: mergedDebug,
1618
1659
  debugWhen: mergedDebugWhen,
1619
1660
  debugSampleRate,
1661
+ loopWarning,
1620
1662
  runTracker: () => tracker === null || tracker === void 0 ? void 0 : tracker(),
1621
1663
  isMounted: () => mounted,
1622
- initialSnapshot: adapterInitialSnapshot && typeof adapterInitialSnapshot === "object" ? adapterInitialSnapshot : void 0
1664
+ initialSnapshot: adapterInitialSnapshot && typeof adapterInitialSnapshot === "object" ? adapterInitialSnapshot : void 0,
1665
+ initialState: adapterInitialState && typeof adapterInitialState === "object" ? adapterInitialState : void 0
1623
1666
  });
1624
1667
  const job = () => scheduler.job(stateRootRaw);
1625
1668
  const mutationRecorder = (record) => scheduler.mutationRecorder(record, stateRootRaw);
@@ -3205,11 +3248,12 @@ function attachPageLayoutSetter(target) {
3205
3248
  * @internal
3206
3249
  */
3207
3250
  function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
3208
- var _wevuSetDataOptions, _wevuSetDataOptions2, _runtime$proxy, _runtime$state, _runtime$setupState, _computed, _runtime$methods, _watch, _bindModel, _snapshot, _unmount;
3251
+ var _data, _wevuSetDataOptions, _wevuSetDataOptions2, _runtime$proxy, _runtime$state, _runtime$setupState, _computed, _runtime$methods, _watch, _bindModel, _snapshot, _unmount;
3209
3252
  if (target.__wevu) return target.__wevu;
3210
3253
  attachRuntimeProvideParentContext(target, runtimeApp);
3211
3254
  safeMarkNoSetData(target);
3212
- const ownerId = allocateOwnerId();
3255
+ const initialNativeOwnerId = (_data = target.data) === null || _data === void 0 ? void 0 : _data[WEVU_SLOT_OWNER_ID_KEY];
3256
+ const ownerId = typeof initialNativeOwnerId === "string" && initialNativeOwnerId ? initialNativeOwnerId : allocateOwnerId();
3213
3257
  const suspendWhenHidden = Boolean(runtimeApp === null || runtimeApp === void 0 || (_wevuSetDataOptions = runtimeApp.__wevuSetDataOptions) === null || _wevuSetDataOptions === void 0 ? void 0 : _wevuSetDataOptions.suspendWhenHidden);
3214
3258
  const targetLabel = typeof target.route === "string" && target.route ? `page:${target.route}` : typeof target.is === "string" && target.is ? `component:${target.is}` : "unknown-target";
3215
3259
  const highFrequencyWarning = createSetDataHighFrequencyWarningMonitor({
@@ -3303,6 +3347,12 @@ function mountRuntimeInstance(target, runtimeApp, watchMap, setup, options) {
3303
3347
  value: initialSnapshot,
3304
3348
  writable: false
3305
3349
  });
3350
+ Object.defineProperty(baseMountAdapter, "__wevu_initialState", {
3351
+ configurable: true,
3352
+ enumerable: false,
3353
+ value: { [WEVU_SLOT_OWNER_ID_KEY]: ownerId },
3354
+ writable: false
3355
+ });
3306
3356
  const targetProperties = target.properties;
3307
3357
  if (Boolean(setup) || Boolean(targetProperties && typeof targetProperties === "object" && Object.keys(targetProperties).length > 0)) Object.defineProperty(baseMountAdapter, "__wevu_deferInitialSnapshot", {
3308
3358
  configurable: true,
@@ -4853,6 +4903,31 @@ function resolveComputedGetter(definition) {
4853
4903
  function isCompilerGeneratedTemplateComputedKey(key) {
4854
4904
  return key.startsWith("__wv_bind_") || key.startsWith("__wv_cls_") || key.startsWith("__wv_style_");
4855
4905
  }
4906
+ function canResolveInitialTemplateComputed(key, getter) {
4907
+ if (!key.startsWith("__wv_bind_")) return false;
4908
+ try {
4909
+ return !/\bthis\b/.test(Function.prototype.toString.call(getter));
4910
+ } catch (_unused) {
4911
+ return false;
4912
+ }
4913
+ }
4914
+ function resolveRuntimeBindingPlaceholder(key) {
4915
+ if (key === WEVU_SLOT_OWNER_ID_KEY) return "";
4916
+ if (key.startsWith("__wv_bind_")) return null;
4917
+ if (key.startsWith("__wv_cls_") || key.startsWith("__wv_style_")) return "";
4918
+ }
4919
+ function resolveRuntimeBindingPlaceholderData(data, setData) {
4920
+ const pickKeys = Array.isArray(setData === null || setData === void 0 ? void 0 : setData.pick) ? setData.pick : [];
4921
+ if (!pickKeys.length) return;
4922
+ const omitKeys = new Set(Array.isArray(setData === null || setData === void 0 ? void 0 : setData.omit) ? setData.omit : []);
4923
+ const resolved = {};
4924
+ for (const key of pickKeys) {
4925
+ if (omitKeys.has(key) || hasOwn(data, key)) continue;
4926
+ const placeholder = resolveRuntimeBindingPlaceholder(key);
4927
+ if (placeholder !== void 0) resolved[key] = placeholder;
4928
+ }
4929
+ return Object.keys(resolved).length ? resolved : void 0;
4930
+ }
4856
4931
  function resolveInitialComputedData(options) {
4857
4932
  const { data, computed, setData } = options;
4858
4933
  const computedKeys = computed ? Object.keys(computed) : [];
@@ -4888,7 +4963,7 @@ function resolveInitialComputedData(options) {
4888
4963
  ok: true,
4889
4964
  value
4890
4965
  };
4891
- } catch (_unused) {
4966
+ } catch (_unused2) {
4892
4967
  return { ok: false };
4893
4968
  } finally {
4894
4969
  resolving.delete(key);
@@ -4914,7 +4989,8 @@ function resolveInitialComputedData(options) {
4914
4989
  }
4915
4990
  });
4916
4991
  for (const key of computedKeys) {
4917
- if (isCompilerGeneratedTemplateComputedKey(key)) continue;
4992
+ const getter = resolveComputedGetter(computed[key]);
4993
+ if (isCompilerGeneratedTemplateComputedKey(key) && (!getter || !canResolveInitialTemplateComputed(key, getter))) continue;
4918
4994
  resolveComputedValue(key);
4919
4995
  }
4920
4996
  return Object.keys(resolved).length ? resolved : void 0;
@@ -4926,8 +5002,10 @@ function resolveNativeInitialData(data, computed, setData) {
4926
5002
  computed,
4927
5003
  setData
4928
5004
  });
4929
- return initialComputedData ? {
5005
+ const runtimeBindingPlaceholderData = resolveRuntimeBindingPlaceholderData(data, setData);
5006
+ return initialComputedData || runtimeBindingPlaceholderData ? {
4930
5007
  ...data,
5008
+ ...runtimeBindingPlaceholderData,
4931
5009
  ...initialComputedData
4932
5010
  } : data;
4933
5011
  }
@@ -5083,7 +5161,8 @@ function normalizeProps(baseOptions, props, explicitProperties) {
5083
5161
  const allowNullPropInput = Boolean((_ALLOW_NULL_PROP_INPU = baseOptions[ALLOW_NULL_PROP_INPUT_KEY]) !== null && _ALLOW_NULL_PROP_INPU !== void 0 ? _ALLOW_NULL_PROP_INPU : baseOptions[PUBLIC_ALLOW_NULL_PROP_INPUT_KEY]);
5084
5162
  const { [ALLOW_NULL_PROP_INPUT_KEY]: _ignoredAllowNullPropInput, [PUBLIC_ALLOW_NULL_PROP_INPUT_KEY]: _ignoredPublicAllowNullPropInput, ...normalizedBaseOptions } = baseOptions;
5085
5163
  const baseProperties = baseOptions.properties;
5086
- const resolvedExplicit = explicitProperties !== null && explicitProperties !== void 0 ? explicitProperties : baseProperties && typeof baseProperties === "object" ? baseProperties : void 0;
5164
+ const normalizedBaseProperties = baseProperties && typeof baseProperties === "object" && Object.keys(baseProperties).length > 0 ? baseProperties : void 0;
5165
+ const resolvedExplicit = explicitProperties !== null && explicitProperties !== void 0 ? explicitProperties : normalizedBaseProperties;
5087
5166
  const shouldAttachInternalProps = Boolean(props || resolvedExplicit);
5088
5167
  const attachInternalProps = (source) => {
5089
5168
  const next = { ...source !== null && source !== void 0 ? source : {} };
@@ -5437,20 +5516,34 @@ function ensureScopedSlotComponentGlobal() {
5437
5516
  const globalRecord = globalObject;
5438
5517
  if (scopedSlotCreator && globalRecord[WEVU_SCOPED_SLOT_CREATOR_KEY] !== scopedSlotCreator) globalRecord[WEVU_SCOPED_SLOT_CREATOR_KEY] = scopedSlotCreator;
5439
5518
  }
5519
+ function shouldSeedNativeSlotOwnerId(mpOptions, setData) {
5520
+ return Boolean(mpOptions.__wevu_isPage) && Array.isArray(setData === null || setData === void 0 ? void 0 : setData.pick) && setData.pick.includes(WEVU_SLOT_OWNER_ID_KEY);
5521
+ }
5522
+ function hasScopedSlotHostProperties(mpOptions) {
5523
+ const properties = mpOptions.properties;
5524
+ return Boolean(properties && typeof properties === "object" && (WEVU_SLOT_OWNER_ID_PROP in properties || WEVU_SLOT_SCOPE_KEY in properties));
5525
+ }
5526
+ function resolveScopedSlotHostSetData(mpOptions, setData) {
5527
+ if ((setData === null || setData === void 0 ? void 0 : setData.strategy) !== "patch" || !hasScopedSlotHostProperties(mpOptions)) return setData;
5528
+ return {
5529
+ ...setData,
5530
+ strategy: "diff"
5531
+ };
5532
+ }
5440
5533
  function defineComponent(options) {
5441
5534
  ensureScopedSlotComponentGlobal();
5442
5535
  const { __typeProps: _typeProps, data, computed, methods, setData, watch, setup, props, allowFunctionProps, ...mpOptions } = applyWevuComponentDefaults(options);
5443
5536
  const rawFunctionPropPaths = mpOptions[WEVU_FUNCTION_PROP_PATHS_KEY];
5444
5537
  const functionPropPaths = Array.isArray(rawFunctionPropPaths) ? [...new Set(rawFunctionPropPaths.filter((path) => typeof path === "string" && path.length > 0))] : [];
5445
5538
  delete mpOptions[WEVU_FUNCTION_PROP_PATHS_KEY];
5446
- const resolvedSetData = allowFunctionProps === true ? {
5539
+ const resolvedSetData = resolveScopedSlotHostSetData(mpOptions, allowFunctionProps === true ? {
5447
5540
  ...setData !== null && setData !== void 0 ? setData : {},
5448
5541
  includeFunctions: true,
5449
5542
  functionPaths: functionPropPaths
5450
5543
  } : allowFunctionProps === false ? setData : functionPropPaths.length ? {
5451
5544
  ...setData !== null && setData !== void 0 ? setData : {},
5452
5545
  functionPaths: functionPropPaths
5453
- } : setData;
5546
+ } : setData);
5454
5547
  const setupFunctionPropKeys = new Set(functionPropPaths.filter((path) => !path.includes(".")));
5455
5548
  const runtimeApp = createApp({
5456
5549
  data,
@@ -5467,7 +5560,11 @@ function defineComponent(options) {
5467
5560
  });
5468
5561
  return result;
5469
5562
  }) : void 0;
5470
- const nativeInitialData = resolveNativeInitialData(typeof data === "function" ? data() : data, computed, resolvedSetData);
5563
+ const nativeData = typeof data === "function" ? data() : data;
5564
+ const nativeInitialData = resolveNativeInitialData(shouldSeedNativeSlotOwnerId(mpOptions, resolvedSetData) ? {
5565
+ ...nativeData && typeof nativeData === "object" ? nativeData : {},
5566
+ [WEVU_SLOT_OWNER_ID_KEY]: (nativeData === null || nativeData === void 0 ? void 0 : nativeData[WEVU_SLOT_OWNER_ID_KEY]) || allocateOwnerId()
5567
+ } : nativeData, computed, resolvedSetData);
5471
5568
  const mpOptionsWithProps = normalizeProps(nativeInitialData !== void 0 ? {
5472
5569
  ...mpOptions,
5473
5570
  data: nativeInitialData
@@ -6181,4 +6278,4 @@ function useTemplateRef(name) {
6181
6278
 
6182
6279
  //#endregion
6183
6280
  export { version as $, registerPageLayoutBridge as A, mountRuntimeInstance as B, useElementIntersectionObserver as C, defineComponent as D, createWevuScopedSlotComponent as E, unregisterRuntimeLayoutHosts as F, setPageLayout as G, teardownRuntimeInstance as H, useLayoutBridge as I, usePageLayout as J, syncRuntimePageLayoutState as K, useLayoutHosts as L, resolveLayoutBridge as M, resolveLayoutHost as N, createApp as O, unregisterPageLayoutBridge as P, markNoSetData as Q, waitForLayoutHost as R, useIntersectionObserver as S, createWevuComponent as T, runSetupFunction as U, setRuntimeSetDataVisibility as V, resolveRuntimePageLayoutName as W, setWevuDefaults as X, resetWevuDefaults as Y, isNoSetData as Z, usePageScrollThrottle as _, useModel as a, onDeactivated as at, useNavigationBarMetrics as b, useSlots as c, onServerPrefetch as ct, useUpdatePerformanceListener as d, callUpdateHooks as et, useBoundingClientRect as f, useAsyncPullDownRefresh as g, useSelectorQuery as h, useChangeModel as i, onBeforeUpdate as it, registerRuntimeLayoutHosts as j, registerComponent as k, defineAppSetup as l, onUnmounted as lt, useSelectorFields as m, mergeModels as n, onBeforeMount as nt, useAttrs as o, onErrorCaptured as ot, useScrollOffset as p, syncRuntimePageLayoutStateFromRuntime as q, useBindModel as r, onBeforeUnmount as rt, useNativeInstance as s, onMounted as st, useTemplateRef as t, onActivated as tt, use as u, onUpdated as ut, getCurrentPageStackSnapshot as v, useDisposables as w, usePageStack as x, getNavigationBarMetrics as y, registerApp as z };
6184
- //# sourceMappingURL=templateRef-3tUik_sj.mjs.map
6281
+ //# sourceMappingURL=templateRef-DFq1B-ZH.mjs.map