wevu 7.2.1 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (466) hide show
  1. package/README.md +6 -0
  2. package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/defineProperty.mjs +1 -1
  3. package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPrimitive.mjs +1 -1
  4. package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPropertyKey.mjs +1 -1
  5. package/dist/dev/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/typeof.mjs +1 -1
  6. package/dist/dev/api/vitest/setup.d.mts +1 -0
  7. package/dist/dev/api/vitest.d.mts +1 -0
  8. package/dist/dev/api.d.mts +1 -0
  9. package/dist/dev/compiler.d.mts +1 -0
  10. package/dist/dev/fetch.d.mts +9 -0
  11. package/dist/dev/index.d.mts +72 -0
  12. package/dist/dev/internal-reactivity.d.mts +18 -0
  13. package/dist/dev/internal-runtime.d.mts +45 -0
  14. package/dist/dev/internal-runtime.mjs +3 -2
  15. package/dist/dev/internal-template.d.mts +2 -0
  16. package/dist/dev/jsxTypes.d.mts +9 -0
  17. package/dist/dev/macros/shared.d.mts +83 -0
  18. package/dist/dev/macros.d.mts +71 -0
  19. package/dist/dev/package.mjs +1 -1
  20. package/dist/dev/reactivity/asyncDerivation.d.mts +41 -0
  21. package/dist/dev/reactivity/asyncDerivation.mjs +8 -10
  22. package/dist/dev/reactivity/asyncDerivation.mjs.map +1 -1
  23. package/dist/dev/reactivity/computed.d.mts +25 -0
  24. package/dist/dev/reactivity/core.d.mts +35 -0
  25. package/dist/dev/reactivity/core.mjs +5 -8
  26. package/dist/dev/reactivity/core.mjs.map +1 -1
  27. package/dist/dev/reactivity/index.d.mts +16 -0
  28. package/dist/dev/reactivity/reactive/mutation.d.mts +21 -0
  29. package/dist/dev/reactivity/reactive/patch.d.mts +18 -0
  30. package/dist/dev/reactivity/reactive/patch.mjs +3 -3
  31. package/dist/dev/reactivity/reactive/patch.mjs.map +1 -1
  32. package/dist/dev/reactivity/reactive/patchState.mjs +4 -8
  33. package/dist/dev/reactivity/reactive/patchState.mjs.map +1 -1
  34. package/dist/dev/reactivity/reactive/shallow.d.mts +22 -0
  35. package/dist/dev/reactivity/reactive/shared.d.mts +4 -0
  36. package/dist/dev/reactivity/reactive/shared.mjs +1 -2
  37. package/dist/dev/reactivity/reactive/shared.mjs.map +1 -1
  38. package/dist/dev/reactivity/reactive.d.mts +42 -0
  39. package/dist/dev/reactivity/reactive.mjs +5 -10
  40. package/dist/dev/reactivity/reactive.mjs.map +1 -1
  41. package/dist/dev/reactivity/readonly.d.mts +27 -0
  42. package/dist/dev/reactivity/ref.d.mts +27 -0
  43. package/dist/dev/reactivity/ref.mjs +2 -2
  44. package/dist/dev/reactivity/ref.mjs.map +1 -1
  45. package/dist/dev/reactivity/shallowRef.d.mts +19 -0
  46. package/dist/dev/reactivity/shallowRef.mjs +1 -1
  47. package/dist/dev/reactivity/shallowRef.mjs.map +1 -1
  48. package/dist/dev/reactivity/toRefs.d.mts +43 -0
  49. package/dist/dev/reactivity/traverse.d.mts +8 -0
  50. package/dist/dev/reactivity/watch/helpers.mjs +1 -1
  51. package/dist/dev/reactivity/watch/helpers.mjs.map +1 -1
  52. package/dist/dev/reactivity/watch/types.d.mts +43 -0
  53. package/dist/dev/reactivity/watch.d.mts +22 -0
  54. package/dist/dev/reactivity/watch.mjs +6 -8
  55. package/dist/dev/reactivity/watch.mjs.map +1 -1
  56. package/dist/dev/router/auto-routes.d.mts +8 -0
  57. package/dist/dev/router/createRouter.d.mts +9 -0
  58. package/dist/dev/router/createRouter.mjs +17 -24
  59. package/dist/dev/router/createRouter.mjs.map +1 -1
  60. package/dist/dev/router/initialNavigation.mjs +18 -16
  61. package/dist/dev/router/initialNavigation.mjs.map +1 -1
  62. package/dist/dev/router/instance.mjs +1 -2
  63. package/dist/dev/router/instance.mjs.map +1 -1
  64. package/dist/dev/router/navigationCore.d.mts +7 -0
  65. package/dist/dev/router/navigationCore.mjs +2 -2
  66. package/dist/dev/router/navigationCore.mjs.map +1 -1
  67. package/dist/dev/router/navigationResult.mjs +7 -10
  68. package/dist/dev/router/navigationResult.mjs.map +1 -1
  69. package/dist/dev/router/navigationTarget.mjs +1 -3
  70. package/dist/dev/router/navigationTarget.mjs.map +1 -1
  71. package/dist/dev/router/resolve.d.mts +7 -0
  72. package/dist/dev/router/resolve.mjs +3 -4
  73. package/dist/dev/router/resolve.mjs.map +1 -1
  74. package/dist/dev/router/routeRegistry.mjs +1 -1
  75. package/dist/dev/router/routeRegistry.mjs.map +1 -1
  76. package/dist/dev/router/routeSync.d.mts +2 -0
  77. package/dist/dev/router/routeSync.mjs +1 -1
  78. package/dist/dev/router/routeSync.mjs.map +1 -1
  79. package/dist/dev/router/types.d.mts +267 -0
  80. package/dist/dev/router/useRoute.d.mts +20 -0
  81. package/dist/dev/router/useRoute.mjs +12 -19
  82. package/dist/dev/router/useRoute.mjs.map +1 -1
  83. package/dist/dev/router/useRouter.d.mts +9 -0
  84. package/dist/dev/router.d.mts +26 -0
  85. package/dist/dev/routerInternal/location.d.mts +2 -0
  86. package/dist/dev/routerInternal/location.mjs +2 -3
  87. package/dist/dev/routerInternal/location.mjs.map +1 -1
  88. package/dist/dev/routerInternal/matching.d.mts +2 -0
  89. package/dist/dev/routerInternal/params.d.mts +2 -0
  90. package/dist/dev/routerInternal/params.mjs +2 -3
  91. package/dist/dev/routerInternal/params.mjs.map +1 -1
  92. package/dist/dev/routerInternal/query.d.mts +7 -0
  93. package/dist/dev/routerInternal/records.d.mts +2 -0
  94. package/dist/dev/routerInternal/records.mjs +1 -1
  95. package/dist/dev/routerInternal/records.mjs.map +1 -1
  96. package/dist/dev/routerInternal/recordsWarnings.d.mts +2 -0
  97. package/dist/dev/routerInternal/recordsWarnings.mjs +1 -2
  98. package/dist/dev/routerInternal/recordsWarnings.mjs.map +1 -1
  99. package/dist/dev/routerInternal/shared.d.mts +9 -0
  100. package/dist/dev/routerInternal/snapshots.d.mts +2 -0
  101. package/dist/dev/routerInternal/types.d.mts +9 -0
  102. package/dist/dev/runtime/app/context.mjs +13 -26
  103. package/dist/dev/runtime/app/context.mjs.map +1 -1
  104. package/dist/dev/runtime/app/diagnostics.mjs +2 -4
  105. package/dist/dev/runtime/app/diagnostics.mjs.map +1 -1
  106. package/dist/dev/runtime/app/mount.mjs +27 -33
  107. package/dist/dev/runtime/app/mount.mjs.map +1 -1
  108. package/dist/dev/runtime/app/pending.d.mts +10 -0
  109. package/dist/dev/runtime/app/setData/commitTracker.d.mts +13 -0
  110. package/dist/dev/runtime/app/setData/commitTracker.mjs +5 -9
  111. package/dist/dev/runtime/app/setData/commitTracker.mjs.map +1 -1
  112. package/dist/dev/runtime/app/setData/patchScheduler.mjs +2 -4
  113. package/dist/dev/runtime/app/setData/patchScheduler.mjs.map +1 -1
  114. package/dist/dev/runtime/app/setData/payload.mjs +2 -3
  115. package/dist/dev/runtime/app/setData/payload.mjs.map +1 -1
  116. package/dist/dev/runtime/app/setData/scheduler.d.mts +51 -0
  117. package/dist/dev/runtime/app/setData/scheduler.mjs +7 -9
  118. package/dist/dev/runtime/app/setData/scheduler.mjs.map +1 -1
  119. package/dist/dev/runtime/app/setData/snapshot.mjs +5 -6
  120. package/dist/dev/runtime/app/setData/snapshot.mjs.map +1 -1
  121. package/dist/dev/runtime/app/setDataOptions.mjs +26 -27
  122. package/dist/dev/runtime/app/setDataOptions.mjs.map +1 -1
  123. package/dist/dev/runtime/app.d.mts +8 -0
  124. package/dist/dev/runtime/app.mjs +9 -9
  125. package/dist/dev/runtime/app.mjs.map +1 -1
  126. package/dist/dev/runtime/bindingManifest.mjs +6 -14
  127. package/dist/dev/runtime/bindingManifest.mjs.map +1 -1
  128. package/dist/dev/runtime/capabilities.d.mts +78 -0
  129. package/dist/dev/runtime/capabilities.mjs.map +1 -1
  130. package/dist/dev/runtime/css.d.mts +14 -0
  131. package/dist/dev/runtime/css.mjs +4 -8
  132. package/dist/dev/runtime/css.mjs.map +1 -1
  133. package/dist/dev/runtime/defaults.d.mts +12 -0
  134. package/dist/dev/runtime/defaults.mjs +4 -4
  135. package/dist/dev/runtime/defaults.mjs.map +1 -1
  136. package/dist/dev/runtime/define/initialComputed.mjs +5 -5
  137. package/dist/dev/runtime/define/initialComputed.mjs.map +1 -1
  138. package/dist/dev/runtime/define/options.mjs +10 -12
  139. package/dist/dev/runtime/define/options.mjs.map +1 -1
  140. package/dist/dev/runtime/define/props.mjs +4 -5
  141. package/dist/dev/runtime/define/props.mjs.map +1 -1
  142. package/dist/dev/runtime/define/scopedSlotOptions.mjs +43 -61
  143. package/dist/dev/runtime/define/scopedSlotOptions.mjs.map +1 -1
  144. package/dist/dev/runtime/define/setupResult.mjs +17 -28
  145. package/dist/dev/runtime/define/setupResult.mjs.map +1 -1
  146. package/dist/dev/runtime/define.d.mts +118 -0
  147. package/dist/dev/runtime/define.mjs +9 -12
  148. package/dist/dev/runtime/define.mjs.map +1 -1
  149. package/dist/dev/runtime/diff.mjs +9 -11
  150. package/dist/dev/runtime/diff.mjs.map +1 -1
  151. package/dist/dev/runtime/disposables.d.mts +31 -0
  152. package/dist/dev/runtime/disposables.mjs +2 -2
  153. package/dist/dev/runtime/disposables.mjs.map +1 -1
  154. package/dist/dev/runtime/elementIntersectionObserver.d.mts +26 -0
  155. package/dist/dev/runtime/elementIntersectionObserver.mjs +16 -24
  156. package/dist/dev/runtime/elementIntersectionObserver.mjs.map +1 -1
  157. package/dist/dev/runtime/features/inlineEvents.d.mts +7 -0
  158. package/dist/dev/runtime/features/inlineEvents.mjs +2 -3
  159. package/dist/dev/runtime/features/inlineEvents.mjs.map +1 -1
  160. package/dist/dev/runtime/features/jsxIslands.d.mts +7 -0
  161. package/dist/dev/runtime/features/jsxIslands.mjs +20 -0
  162. package/dist/dev/runtime/features/jsxIslands.mjs.map +1 -0
  163. package/dist/dev/runtime/features/layout.d.mts +7 -0
  164. package/dist/dev/runtime/features/layout.mjs +2 -3
  165. package/dist/dev/runtime/features/layout.mjs.map +1 -1
  166. package/dist/dev/runtime/features/patchStrategy.d.mts +7 -0
  167. package/dist/dev/runtime/features/publicLayout.d.mts +24 -0
  168. package/dist/dev/runtime/features/publicLayout.mjs +2 -6
  169. package/dist/dev/runtime/features/publicLayout.mjs.map +1 -1
  170. package/dist/dev/runtime/features/scopedSlots.d.mts +23 -0
  171. package/dist/dev/runtime/features/scopedSlots.mjs +5 -9
  172. package/dist/dev/runtime/features/scopedSlots.mjs.map +1 -1
  173. package/dist/dev/runtime/features/setDataHighFrequencyWarning.d.mts +7 -0
  174. package/dist/dev/runtime/features/templateRefs.d.mts +7 -0
  175. package/dist/dev/runtime/features/templateRefs.mjs +1 -1
  176. package/dist/dev/runtime/features/templateRefs.mjs.map +1 -1
  177. package/dist/dev/runtime/hooks/base.d.mts +27 -0
  178. package/dist/dev/runtime/hooks/base.mjs +21 -32
  179. package/dist/dev/runtime/hooks/base.mjs.map +1 -1
  180. package/dist/dev/runtime/hooks/register.d.mts +30 -0
  181. package/dist/dev/runtime/hooks/vue.d.mts +52 -0
  182. package/dist/dev/runtime/hooks.d.mts +4 -0
  183. package/dist/dev/runtime/index.d.mts +46 -0
  184. package/dist/dev/runtime/inlineDataset.mjs +1 -2
  185. package/dist/dev/runtime/inlineDataset.mjs.map +1 -1
  186. package/dist/dev/runtime/intersectionObserver.d.mts +14 -0
  187. package/dist/dev/runtime/intersectionObserver.mjs +6 -6
  188. package/dist/dev/runtime/intersectionObserver.mjs.map +1 -1
  189. package/dist/dev/runtime/jsxIsland.d.mts +37 -0
  190. package/dist/dev/runtime/jsxIsland.mjs +16 -33
  191. package/dist/dev/runtime/jsxIsland.mjs.map +1 -1
  192. package/dist/dev/runtime/layoutBridge.d.mts +55 -0
  193. package/dist/dev/runtime/layoutBridge.mjs +32 -62
  194. package/dist/dev/runtime/layoutBridge.mjs.map +1 -1
  195. package/dist/dev/runtime/nativeBridge.mjs +1 -1
  196. package/dist/dev/runtime/nativeBridge.mjs.map +1 -1
  197. package/dist/dev/runtime/navigationLifecycle.mjs +24 -0
  198. package/dist/dev/runtime/navigationLifecycle.mjs.map +1 -0
  199. package/dist/dev/runtime/noSetData.d.mts +5 -0
  200. package/dist/dev/runtime/pageEnvironment.d.mts +50 -0
  201. package/dist/dev/runtime/pageEnvironment.mjs +15 -18
  202. package/dist/dev/runtime/pageEnvironment.mjs.map +1 -1
  203. package/dist/dev/runtime/pageLayout.d.mts +25 -0
  204. package/dist/dev/runtime/pageLayout.mjs +7 -11
  205. package/dist/dev/runtime/pageLayout.mjs.map +1 -1
  206. package/dist/dev/runtime/pageScroll.d.mts +29 -0
  207. package/dist/dev/runtime/pageScroll.mjs +2 -3
  208. package/dist/dev/runtime/pageScroll.mjs.map +1 -1
  209. package/dist/dev/runtime/platform/current.mjs +12 -0
  210. package/dist/dev/runtime/platform/current.mjs.map +1 -0
  211. package/dist/dev/runtime/platform/generic.mjs +36 -0
  212. package/dist/dev/runtime/platform/generic.mjs.map +1 -0
  213. package/dist/dev/runtime/platform/globals.mjs +29 -0
  214. package/dist/dev/runtime/platform/globals.mjs.map +1 -0
  215. package/dist/dev/runtime/platform.mjs +15 -60
  216. package/dist/dev/runtime/platform.mjs.map +1 -1
  217. package/dist/dev/runtime/provide.d.mts +60 -0
  218. package/dist/dev/runtime/provideContext.mjs +7 -9
  219. package/dist/dev/runtime/provideContext.mjs.map +1 -1
  220. package/dist/dev/runtime/provideStore.d.mts +7 -0
  221. package/dist/dev/runtime/publicRuntime.d.mts +22 -0
  222. package/dist/dev/runtime/publicRuntime.mjs +4 -0
  223. package/dist/dev/runtime/publicRuntime.mjs.map +1 -1
  224. package/dist/dev/runtime/pullDownRefresh.d.mts +12 -0
  225. package/dist/dev/runtime/pullDownRefresh.mjs +2 -4
  226. package/dist/dev/runtime/pullDownRefresh.mjs.map +1 -1
  227. package/dist/dev/runtime/register/app.d.mts +14 -0
  228. package/dist/dev/runtime/register/app.mjs +18 -19
  229. package/dist/dev/runtime/register/app.mjs.map +1 -1
  230. package/dist/dev/runtime/register/component/alipay.mjs +9 -18
  231. package/dist/dev/runtime/register/component/alipay.mjs.map +1 -1
  232. package/dist/dev/runtime/register/component/alipayRegistration.mjs +60 -0
  233. package/dist/dev/runtime/register/component/alipayRegistration.mjs.map +1 -0
  234. package/dist/dev/runtime/register/component/lifecycle/platform.mjs +8 -9
  235. package/dist/dev/runtime/register/component/lifecycle/platform.mjs.map +1 -1
  236. package/dist/dev/runtime/register/component/lifecycle.mjs +7 -12
  237. package/dist/dev/runtime/register/component/lifecycle.mjs.map +1 -1
  238. package/dist/dev/runtime/register/component/methods.mjs +13 -18
  239. package/dist/dev/runtime/register/component/methods.mjs.map +1 -1
  240. package/dist/dev/runtime/register/component/options.mjs +3 -4
  241. package/dist/dev/runtime/register/component/options.mjs.map +1 -1
  242. package/dist/dev/runtime/register/component/props.mjs +25 -31
  243. package/dist/dev/runtime/register/component/props.mjs.map +1 -1
  244. package/dist/dev/runtime/register/component/registerDefinition.mjs +18 -40
  245. package/dist/dev/runtime/register/component/registerDefinition.mjs.map +1 -1
  246. package/dist/dev/runtime/register/component/registerNativeDefinition.mjs +18 -60
  247. package/dist/dev/runtime/register/component/registerNativeDefinition.mjs.map +1 -1
  248. package/dist/dev/runtime/register/component.d.mts +17 -0
  249. package/dist/dev/runtime/register/component.mjs +3 -5
  250. package/dist/dev/runtime/register/component.mjs.map +1 -1
  251. package/dist/dev/runtime/register/inline.d.mts +15 -0
  252. package/dist/dev/runtime/register/inline.mjs +8 -10
  253. package/dist/dev/runtime/register/inline.mjs.map +1 -1
  254. package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs +7 -8
  255. package/dist/dev/runtime/register/runtimeInstance/methodBridge.mjs.map +1 -1
  256. package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs +1 -1
  257. package/dist/dev/runtime/register/runtimeInstance/provideContext.mjs.map +1 -1
  258. package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs +25 -34
  259. package/dist/dev/runtime/register/runtimeInstance/setupContext.mjs.map +1 -1
  260. package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs +6 -13
  261. package/dist/dev/runtime/register/runtimeInstance/setupPhase.mjs.map +1 -1
  262. package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs +2 -2
  263. package/dist/dev/runtime/register/runtimeInstance/setupSnapshot.mjs.map +1 -1
  264. package/dist/dev/runtime/register/runtimeInstance/utils.mjs +9 -9
  265. package/dist/dev/runtime/register/runtimeInstance/utils.mjs.map +1 -1
  266. package/dist/dev/runtime/register/runtimeInstance.d.mts +26 -0
  267. package/dist/dev/runtime/register/runtimeInstance.mjs +74 -100
  268. package/dist/dev/runtime/register/runtimeInstance.mjs.map +1 -1
  269. package/dist/dev/runtime/register/setDataFrequencyWarning.mjs +12 -15
  270. package/dist/dev/runtime/register/setDataFrequencyWarning.mjs.map +1 -1
  271. package/dist/dev/runtime/register/setup.d.mts +11 -0
  272. package/dist/dev/runtime/register/setup.mjs +2 -3
  273. package/dist/dev/runtime/register/setup.mjs.map +1 -1
  274. package/dist/dev/runtime/register/snapshot.mjs +1 -4
  275. package/dist/dev/runtime/register/snapshot.mjs.map +1 -1
  276. package/dist/dev/runtime/register/watch.d.mts +12 -0
  277. package/dist/dev/runtime/register/watch.mjs +3 -5
  278. package/dist/dev/runtime/register/watch.mjs.map +1 -1
  279. package/dist/dev/runtime/register.d.mts +5 -0
  280. package/dist/dev/runtime/scopedSlots.mjs +14 -21
  281. package/dist/dev/runtime/scopedSlots.mjs.map +1 -1
  282. package/dist/dev/runtime/selectorQuery.d.mts +54 -0
  283. package/dist/dev/runtime/selectorQuery.mjs +5 -9
  284. package/dist/dev/runtime/selectorQuery.mjs.map +1 -1
  285. package/dist/dev/runtime/template.d.mts +6 -0
  286. package/dist/dev/runtime/template.mjs +1 -1
  287. package/dist/dev/runtime/template.mjs.map +1 -1
  288. package/dist/dev/runtime/templateRefTypes.d.mts +12 -0
  289. package/dist/dev/runtime/templateRefs/helpers.mjs +14 -24
  290. package/dist/dev/runtime/templateRefs/helpers.mjs.map +1 -1
  291. package/dist/dev/runtime/templateRefs.mjs +8 -15
  292. package/dist/dev/runtime/templateRefs.mjs.map +1 -1
  293. package/dist/dev/runtime/types/core.d.mts +35 -0
  294. package/dist/dev/runtime/types/miniprogram.d.mts +84 -0
  295. package/dist/dev/runtime/types/miniprogramHost.d.mts +45 -0
  296. package/dist/dev/runtime/types/miniprogramHostSources.d.mts +112 -0
  297. package/dist/dev/runtime/types/options.d.mts +138 -0
  298. package/dist/dev/runtime/types/props/propTypes.d.mts +79 -0
  299. package/dist/dev/runtime/types/props/router.d.mts +51 -0
  300. package/dist/dev/runtime/types/props/setup.d.mts +96 -0
  301. package/dist/dev/runtime/types/props.d.mts +4 -0
  302. package/dist/dev/runtime/types/runtime.d.mts +59 -0
  303. package/dist/dev/runtime/types/setData.d.mts +237 -0
  304. package/dist/dev/runtime/types.d.mts +29 -0
  305. package/dist/dev/runtime/uniAppHost.d.mts +8 -0
  306. package/dist/dev/runtime/uniAppHost.mjs +6 -14
  307. package/dist/dev/runtime/uniAppHost.mjs.map +1 -1
  308. package/dist/dev/runtime/updatePerformance.d.mts +13 -0
  309. package/dist/dev/runtime/updatePerformance.mjs +1 -1
  310. package/dist/dev/runtime/updatePerformance.mjs.map +1 -1
  311. package/dist/dev/runtime/use.d.mts +13 -0
  312. package/dist/dev/runtime/use.mjs +1 -1
  313. package/dist/dev/runtime/use.mjs.map +1 -1
  314. package/dist/dev/runtime/vueCompat/context.d.mts +8 -0
  315. package/dist/dev/runtime/vueCompat/context.mjs +3 -5
  316. package/dist/dev/runtime/vueCompat/context.mjs.map +1 -1
  317. package/dist/dev/runtime/vueCompat/model.d.mts +30 -0
  318. package/dist/dev/runtime/vueCompat/model.mjs +9 -13
  319. package/dist/dev/runtime/vueCompat/model.mjs.map +1 -1
  320. package/dist/dev/runtime/vueCompat/router.d.mts +29 -0
  321. package/dist/dev/runtime/vueCompat/router.mjs +4 -4
  322. package/dist/dev/runtime/vueCompat/router.mjs.map +1 -1
  323. package/dist/dev/runtime/vueCompat/templateRef.d.mts +9 -0
  324. package/dist/dev/runtime/vueCompat/templateRef.mjs +1 -1
  325. package/dist/dev/runtime/vueCompat/templateRef.mjs.map +1 -1
  326. package/dist/dev/runtime/vueCompat.d.mts +5 -0
  327. package/dist/dev/scheduler.d.mts +4 -0
  328. package/dist/dev/scheduler.mjs +3 -4
  329. package/dist/dev/scheduler.mjs.map +1 -1
  330. package/dist/dev/store/base.mjs +1 -2
  331. package/dist/dev/store/base.mjs.map +1 -1
  332. package/dist/dev/store/define/create.mjs +11 -22
  333. package/dist/dev/store/define/create.mjs.map +1 -1
  334. package/dist/dev/store/define.d.mts +8 -0
  335. package/dist/dev/store/define.mjs +1 -1
  336. package/dist/dev/store/define.mjs.map +1 -1
  337. package/dist/dev/store/manager.d.mts +16 -0
  338. package/dist/dev/store/storeToRefs.d.mts +11 -0
  339. package/dist/dev/store/types.d.mts +106 -0
  340. package/dist/dev/store/view.mjs +1 -1
  341. package/dist/dev/store/view.mjs.map +1 -1
  342. package/dist/dev/store.d.mts +5 -0
  343. package/dist/dev/version.d.mts +4 -0
  344. package/dist/dev/vue-augment.d.mts +8 -0
  345. package/dist/dev/vue-demi.d.mts +87 -0
  346. package/dist/dev/vue-types.d.mts +19 -0
  347. package/dist/dev/web-apis.d.mts +3 -0
  348. package/dist/internal-runtime.d.mts +2 -1
  349. package/dist/internal-runtime.mjs +1 -1
  350. package/dist/package.mjs +1 -1
  351. package/dist/reactivity/asyncDerivation.mjs +1 -1
  352. package/dist/reactivity/core.mjs +1 -1
  353. package/dist/reactivity/reactive/patch.mjs +1 -1
  354. package/dist/reactivity/reactive/patchState.mjs +1 -1
  355. package/dist/reactivity/reactive/shared.mjs +1 -1
  356. package/dist/reactivity/reactive.mjs +1 -1
  357. package/dist/reactivity/ref.mjs +1 -1
  358. package/dist/reactivity/shallowRef.mjs +1 -1
  359. package/dist/reactivity/watch/helpers.mjs +1 -1
  360. package/dist/reactivity/watch.mjs +1 -1
  361. package/dist/router/createRouter.mjs +1 -1
  362. package/dist/router/initialNavigation.mjs +1 -1
  363. package/dist/router/instance.mjs +1 -1
  364. package/dist/router/navigationCore.mjs +1 -1
  365. package/dist/router/navigationResult.mjs +1 -1
  366. package/dist/router/navigationTarget.mjs +1 -1
  367. package/dist/router/resolve.mjs +1 -1
  368. package/dist/router/routeRegistry.mjs +1 -1
  369. package/dist/router/routeSync.mjs +1 -1
  370. package/dist/router/useRoute.mjs +1 -1
  371. package/dist/routerInternal/location.mjs +1 -1
  372. package/dist/routerInternal/params.mjs +1 -1
  373. package/dist/routerInternal/records.mjs +1 -1
  374. package/dist/routerInternal/recordsWarnings.mjs +1 -1
  375. package/dist/runtime/app/context.mjs +1 -1
  376. package/dist/runtime/app/diagnostics.mjs +1 -1
  377. package/dist/runtime/app/mount.mjs +1 -1
  378. package/dist/runtime/app/setData/commitTracker.mjs +1 -1
  379. package/dist/runtime/app/setData/patchScheduler.mjs +1 -1
  380. package/dist/runtime/app/setData/payload.mjs +1 -1
  381. package/dist/runtime/app/setData/scheduler.mjs +1 -1
  382. package/dist/runtime/app/setData/snapshot.mjs +1 -1
  383. package/dist/runtime/app/setDataOptions.mjs +1 -1
  384. package/dist/runtime/app.mjs +1 -1
  385. package/dist/runtime/bindingManifest.mjs +1 -1
  386. package/dist/runtime/capabilities.d.mts +4 -1
  387. package/dist/runtime/css.mjs +1 -1
  388. package/dist/runtime/defaults.mjs +1 -1
  389. package/dist/runtime/define/initialComputed.mjs +1 -1
  390. package/dist/runtime/define/options.mjs +1 -1
  391. package/dist/runtime/define/props.mjs +1 -1
  392. package/dist/runtime/define/scopedSlotOptions.mjs +1 -1
  393. package/dist/runtime/define/setupResult.mjs +1 -1
  394. package/dist/runtime/define.mjs +1 -1
  395. package/dist/runtime/diff.mjs +1 -1
  396. package/dist/runtime/disposables.mjs +1 -1
  397. package/dist/runtime/elementIntersectionObserver.mjs +1 -1
  398. package/dist/runtime/features/inlineEvents.mjs +1 -1
  399. package/dist/runtime/features/jsxIslands.d.mts +6 -0
  400. package/dist/runtime/features/jsxIslands.mjs +1 -0
  401. package/dist/runtime/features/layout.mjs +1 -1
  402. package/dist/runtime/features/publicLayout.mjs +1 -1
  403. package/dist/runtime/features/scopedSlots.mjs +1 -1
  404. package/dist/runtime/features/templateRefs.mjs +1 -1
  405. package/dist/runtime/hooks/base.mjs +1 -1
  406. package/dist/runtime/inlineDataset.mjs +1 -1
  407. package/dist/runtime/intersectionObserver.mjs +1 -1
  408. package/dist/runtime/jsxIsland.mjs +1 -1
  409. package/dist/runtime/layoutBridge.mjs +1 -1
  410. package/dist/runtime/nativeBridge.mjs +1 -1
  411. package/dist/runtime/navigationLifecycle.mjs +1 -0
  412. package/dist/runtime/pageEnvironment.mjs +1 -1
  413. package/dist/runtime/pageLayout.mjs +1 -1
  414. package/dist/runtime/pageScroll.mjs +1 -1
  415. package/dist/runtime/platform/current.mjs +1 -0
  416. package/dist/runtime/platform/generic.mjs +1 -0
  417. package/dist/runtime/platform/globals.mjs +1 -0
  418. package/dist/runtime/platform.mjs +1 -1
  419. package/dist/runtime/provideContext.mjs +1 -1
  420. package/dist/runtime/publicRuntime.mjs +1 -1
  421. package/dist/runtime/pullDownRefresh.mjs +1 -1
  422. package/dist/runtime/register/app.mjs +1 -1
  423. package/dist/runtime/register/component/alipay.mjs +1 -1
  424. package/dist/runtime/register/component/alipayRegistration.mjs +1 -0
  425. package/dist/runtime/register/component/lifecycle/platform.mjs +1 -1
  426. package/dist/runtime/register/component/lifecycle.mjs +1 -1
  427. package/dist/runtime/register/component/methods.mjs +1 -1
  428. package/dist/runtime/register/component/options.mjs +1 -1
  429. package/dist/runtime/register/component/props.mjs +1 -1
  430. package/dist/runtime/register/component/registerDefinition.mjs +1 -1
  431. package/dist/runtime/register/component/registerNativeDefinition.mjs +1 -1
  432. package/dist/runtime/register/component.mjs +1 -1
  433. package/dist/runtime/register/inline.mjs +1 -1
  434. package/dist/runtime/register/runtimeInstance/methodBridge.mjs +1 -1
  435. package/dist/runtime/register/runtimeInstance/provideContext.mjs +1 -1
  436. package/dist/runtime/register/runtimeInstance/setupContext.mjs +1 -1
  437. package/dist/runtime/register/runtimeInstance/setupPhase.mjs +1 -1
  438. package/dist/runtime/register/runtimeInstance/setupSnapshot.mjs +1 -1
  439. package/dist/runtime/register/runtimeInstance/utils.mjs +1 -1
  440. package/dist/runtime/register/runtimeInstance.mjs +1 -1
  441. package/dist/runtime/register/setDataFrequencyWarning.mjs +1 -1
  442. package/dist/runtime/register/setup.mjs +1 -1
  443. package/dist/runtime/register/snapshot.mjs +1 -1
  444. package/dist/runtime/register/watch.mjs +1 -1
  445. package/dist/runtime/scopedSlots.mjs +1 -1
  446. package/dist/runtime/selectorQuery.mjs +1 -1
  447. package/dist/runtime/template.mjs +1 -1
  448. package/dist/runtime/templateRefs/helpers.mjs +1 -1
  449. package/dist/runtime/templateRefs.mjs +1 -1
  450. package/dist/runtime/uniAppHost.mjs +1 -1
  451. package/dist/runtime/updatePerformance.mjs +1 -1
  452. package/dist/runtime/use.mjs +1 -1
  453. package/dist/runtime/vueCompat/context.mjs +1 -1
  454. package/dist/runtime/vueCompat/model.mjs +1 -1
  455. package/dist/runtime/vueCompat/router.mjs +1 -1
  456. package/dist/runtime/vueCompat/templateRef.mjs +1 -1
  457. package/dist/scheduler.mjs +1 -1
  458. package/dist/store/base.mjs +1 -1
  459. package/dist/store/define/create.mjs +1 -1
  460. package/dist/store/define.mjs +1 -1
  461. package/dist/store/view.mjs +1 -1
  462. package/package.json +7 -7
  463. /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/defineProperty.mjs +0 -0
  464. /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPrimitive.mjs +0 -0
  465. /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/toPropertyKey.mjs +0 -0
  466. /package/dist/_virtual/{_@oxc-project_runtime@0.150.0 → _@oxc-project_runtime@0.151.0}/helpers/esm/typeof.mjs +0 -0
@@ -1 +1 @@
1
- import{getActiveRouter as e}from"./instance.mjs";import{WEVU_INITIAL_NAVIGATION_TIMEOUT_MARKER as t}from"@weapp-core/constants";import{queueMicrotaskPolyfill as n}from"@wevu/web-apis";const r=1e4,i=/* @__PURE__ */ new WeakMap,a=/* @__PURE__ */ new WeakMap;function o(e){return Number.isFinite(e)&&e>0?Math.max(1,Math.trunc(e)):r}function s(e){return{route:typeof e.route==`string`?e.route:void 0,__route__:typeof e.__route__==`string`?e.__route__:void 0,options:e.options&&typeof e.options==`object`?{...e.options}:void 0}}function c(e){if(!e||typeof e!=`object`)return;let t={};for(let[n,r]of Object.entries(e))t[n]=Array.isArray(r)?[...r]:r;return t}function l(e,t,n=r,a=`blocking`){i.set(e,{runner:t,mode:a,timeoutMs:o(n)})}function u(){var t,n;let a=e();return a?(t=(n=i.get(a))==null?void 0:n.timeoutMs)==null?r:t:r}function d(e){return!!(e&&typeof e==`object`&&e.__wevuNavigationFailure)}function f(r,o,l={}){let f=a.get(r);if(f)return l.onComplete&&f.blocking&&f.subscribe(l.onComplete),l.start!==!1&&f.start(o),f.blocking?f.promise:void 0;let p=e(),m=p?i.get(p):void 0,h=m==null?void 0:m.runner;if(!h)return;let g=(m==null?void 0:m.mode)===`blocking`,_=s(r),v=c(o),y=`idle`,b,x=u(),S,C=/* @__PURE__ */ new Set,w=new Promise(e=>{S=e}),T=(e,t)=>{if(y!==`idle`&&y!==`running`)return;y=e,b!==void 0&&(clearTimeout(b),b=void 0);let r=[...C];C.clear(),h=void 0,_=void 0,v=void 0,S(t),n(()=>{if(y===`allowed`||y===`timed-out`)for(let e of r)e.active&&(e.callback(t),e.active=!1)})},E={promise:w,blocking:g,status:()=>y,subscribe(e){let t={callback:e,active:!0};return y!==`idle`&&y!==`running`?n(()=>{t.active&&(y===`allowed`||y===`timed-out`)&&(e(y===`allowed`||y===`timed-out`),t.active=!1)}):C.add(t),()=>{t.active=!1,C.delete(t)}},start(e){if(y!==`idle`)return;y=`running`,g&&(b=setTimeout(()=>{var e,n;y===`running`&&(console.warn(`${t} initial navigation exceeded ${x}ms; mounting page`,(e=(n=_==null?void 0:_.route)==null?_==null?void 0:_.__route__:n)==null?``:e),T(`timed-out`,!0))},x));let n=_,r=c(e==null?v:e),i=h;if(h=void 0,!i||!n){T(`aborted`,!1);return}i(n,r,()=>y===`running`).then(e=>{let t=d(e);T(t?`aborted`:`allowed`,!t)},()=>{T(`aborted`,!1)})},cancel(){T(`cancelled`,!1)}};return a.set(r,E),l.onComplete&&g&&E.subscribe(l.onComplete),l.start!==!1&&E.start(o),g?w:void 0}function p(e){var t;(t=a.get(e))==null||t.cancel()}export{r as DEFAULT_INITIAL_NAVIGATION_TIMEOUT,p as cancelInitialNavigation,f as ensureInitialNavigation,u as getInitialNavigationTimeout,l as registerInitialNavigationRunner};
1
+ import{registerInitialNavigationLifecycle as e}from"../runtime/navigationLifecycle.mjs";import{getActiveRouter as t}from"./instance.mjs";import{WEVU_INITIAL_NAVIGATION_TIMEOUT_MARKER as n}from"@weapp-core/constants";import{queueMicrotaskPolyfill as r}from"@wevu/web-apis";const i=1e4,a=/* @__PURE__ */ new WeakMap,o=/* @__PURE__ */ new WeakMap;function s(e){return Number.isFinite(e)&&e>0?Math.max(1,Math.trunc(e)):i}function c(e){return{route:typeof e.route==`string`?e.route:void 0,__route__:typeof e.__route__==`string`?e.__route__:void 0,options:e.options&&typeof e.options==`object`?{...e.options}:void 0}}function l(e){if(!e||typeof e!=`object`)return;let t={};for(let[n,r]of Object.entries(e))t[n]=Array.isArray(r)?[...r]:r;return t}function u(){let e=t();return e?a.get(e)?.timeoutMs??1e4:i}function d(e){return!!(e&&typeof e==`object`&&e.__wevuNavigationFailure)}function f(e,i,s={}){let f=o.get(e);if(f)return s.onComplete&&f.blocking&&f.subscribe(s.onComplete),s.start!==!1&&f.start(i),f.blocking?f.promise:void 0;let p=t(),m=p?a.get(p):void 0,h=m?.runner;if(!h)return;let g=m?.mode===`blocking`,_=c(e),v=l(i),y=`idle`,b,x=u(),S,C=/* @__PURE__ */ new Set,w=new Promise(e=>{S=e}),T=(e,t)=>{if(y!==`idle`&&y!==`running`)return;y=e,b!==void 0&&(clearTimeout(b),b=void 0);let n=[...C];C.clear(),h=void 0,_=void 0,v=void 0,S(t),r(()=>{if(y===`allowed`||y===`timed-out`)for(let e of n)e.active&&(e.callback(t),e.active=!1)})},E={promise:w,blocking:g,status:()=>y,subscribe(e){let t={callback:e,active:!0};return y!==`idle`&&y!==`running`?r(()=>{t.active&&(y===`allowed`||y===`timed-out`)&&(e(y===`allowed`||y===`timed-out`),t.active=!1)}):C.add(t),()=>{t.active=!1,C.delete(t)}},start(e){if(y!==`idle`)return;y=`running`,g&&(b=setTimeout(()=>{y===`running`&&(console.warn(`${n} initial navigation exceeded ${x}ms; mounting page`,_?.route??_?.__route__??``),T(`timed-out`,!0))},x));let t=_,r=l(e??v),i=h;if(h=void 0,!i||!t){T(`aborted`,!1);return}i(t,r,()=>y===`running`).then(e=>{let t=d(e);T(t?`aborted`:`allowed`,!t)},()=>{T(`aborted`,!1)})},cancel(){T(`cancelled`,!1)}};return o.set(e,E),s.onComplete&&g&&E.subscribe(s.onComplete),s.start!==!1&&E.start(i),g?w:void 0}function p(e){o.get(e)?.cancel()}function m(t,n,r=i,o=`blocking`){e({ensure:f,cancel:p}),a.set(t,{runner:n,mode:o,timeoutMs:s(r)})}export{i as DEFAULT_INITIAL_NAVIGATION_TIMEOUT,p as cancelInitialNavigation,f as ensureInitialNavigation,u as getInitialNavigationTimeout,m as registerInitialNavigationRunner};
@@ -1 +1 @@
1
- import{injectGlobal as e,provideGlobal as t}from"../runtime/provide.mjs";const n=Symbol(`wevu.router.instance`);let r;function i(e){r=e,t(n,e)}function a(){var t;return(t=r)==null?e(n,void 0):t}export{a as getActiveRouter,i as setActiveRouter};
1
+ import{injectGlobal as e,provideGlobal as t}from"../runtime/provide.mjs";const n=Symbol(`wevu.router.instance`);let r;function i(e){r=e,t(n,e)}function a(){return r??e(n,void 0)}export{a as getActiveRouter,i as setActiveRouter};
@@ -1 +1 @@
1
- import{NavigationFailureType as e}from"./types.mjs";const t=/already|same|duplicat|重复/,n=/cancel|取消/,r=/abort|interrupt|中断/;function i(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e.errMsg;if(typeof t==`string`)return t;if(e instanceof Error)return e.message}return``}function a(a){let o=i(a).toLowerCase();return t.test(o)?e.duplicated:n.test(o)?e.cancelled:r.test(o)?e.aborted:e.unknown}function o(e,t,n,r){let a=i(r)||`Navigation failed`;return Object.assign(Error(a),{__wevuNavigationFailure:!0,type:e,to:t,from:n,cause:r})}function s(e,t){if(!e||typeof e!=`object`)return!1;let n=e;return n.__wevuNavigationFailure===!0?t===void 0||n.type===t:!1}function c(e){return!e||typeof e!=`object`?!1:`to`in e}function l(e){if(typeof e==`string`)return!0;if(!e||typeof e!=`object`)return!1;let t=e;return`path`in t||`fullPath`in t||`query`in t||`hash`in t||`name`in t||`params`in t}async function u(t,n,r){for(let i of t)try{let t=await i(n.to,n.from,n);if(s(t))return{status:`failure`,failure:t};if(t===!1)return{status:`failure`,failure:o(e.aborted,n.to,n.from,`Navigation aborted by guard`)};if(c(t))return n.to?{status:`redirect`,target:r(t.to,n.to.path),replace:t.replace}:{status:`failure`,failure:o(e.aborted,n.to,n.from,`Redirect is not supported in back navigation guards`)};if(l(t))return n.to?{status:`redirect`,target:r(t,n.to.path)}:{status:`failure`,failure:o(e.aborted,n.to,n.from,`Redirect is not supported in back navigation guards`)}}catch(t){return{status:`failure`,failure:o(e.aborted,n.to,n.from,t)}}return{status:`continue`}}function d(e,t,n,r){return new Promise(i=>{let s=!1,c=e=>{s||(s=!0,i(e))};try{let i=e({...t,success:()=>c(),fail:e=>{c(o(a(e),n,r,e))}});i&&typeof i.then==`function`&&i.then(()=>c(),e=>c(o(a(e),n,r,e)))}catch(e){c(o(a(e),n,r,e))}})}async function f(e,t){for(let n of e)try{await n(t.to,t.from,t.failure,t)}catch(e){}}async function p(e,t,n){for(let r of e)try{await r(t,n)}catch(e){}}function m(e){return!e||typeof e!=`object`?!1:typeof e.errMsg==`string`}function h(t){return t.type===e.unknown||t.cause instanceof Error||t.type===e.aborted&&t.cause!==void 0&&!(typeof t.cause==`string`||m(t.cause))}export{o as createNavigationFailure,d as executeNavigationMethod,s as isNavigationFailure,c as isNavigationRedirectCandidate,f as runAfterEachHooks,p as runNavigationErrorHooks,u as runNavigationGuards,h as shouldEmitNavigationError};
1
+ import{NavigationFailureType as e}from"./types.mjs";const t=/already|same|duplicat|重复/,n=/cancel|取消/,r=/abort|interrupt|中断/;function i(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e.errMsg;if(typeof t==`string`)return t;if(e instanceof Error)return e.message}return``}function a(a){let o=i(a).toLowerCase();return t.test(o)?e.duplicated:n.test(o)?e.cancelled:r.test(o)?e.aborted:e.unknown}function o(e,t,n,r){let a=i(r)||`Navigation failed`;return Object.assign(Error(a),{__wevuNavigationFailure:!0,type:e,to:t,from:n,cause:r})}function s(e,t){if(!e||typeof e!=`object`)return!1;let n=e;return n.__wevuNavigationFailure===!0?t===void 0||n.type===t:!1}function c(e){return!e||typeof e!=`object`?!1:`to`in e}function l(e){if(typeof e==`string`)return!0;if(!e||typeof e!=`object`)return!1;let t=e;return`path`in t||`fullPath`in t||`query`in t||`hash`in t||`name`in t||`params`in t}async function u(t,n,r){for(let i of t)try{let t=await i(n.to,n.from,n);if(s(t))return{status:`failure`,failure:t};if(t===!1)return{status:`failure`,failure:o(e.aborted,n.to,n.from,`Navigation aborted by guard`)};if(c(t))return n.to?{status:`redirect`,target:r(t.to,n.to.path),replace:t.replace}:{status:`failure`,failure:o(e.aborted,n.to,n.from,`Redirect is not supported in back navigation guards`)};if(l(t))return n.to?{status:`redirect`,target:r(t,n.to.path)}:{status:`failure`,failure:o(e.aborted,n.to,n.from,`Redirect is not supported in back navigation guards`)}}catch(t){return{status:`failure`,failure:o(e.aborted,n.to,n.from,t)}}return{status:`continue`}}function d(e,t,n,r){return new Promise(i=>{let s=!1,c=e=>{s||(s=!0,i(e))};try{let i=e({...t,success:()=>c(),fail:e=>{c(o(a(e),n,r,e))}});i&&typeof i.then==`function`&&i.then(()=>c(),e=>c(o(a(e),n,r,e)))}catch(e){c(o(a(e),n,r,e))}})}async function f(e,t){for(let n of e)try{await n(t.to,t.from,t.failure,t)}catch{}}async function p(e,t,n){for(let r of e)try{await r(t,n)}catch{}}function m(e){return!e||typeof e!=`object`?!1:typeof e.errMsg==`string`}function h(t){return t.type===e.unknown||t.cause instanceof Error||t.type===e.aborted&&t.cause!==void 0&&!(typeof t.cause==`string`||m(t.cause))}export{o as createNavigationFailure,d as executeNavigationMethod,s as isNavigationFailure,c as isNavigationRedirectCandidate,f as runAfterEachHooks,p as runNavigationErrorHooks,u as runNavigationGuards,h as shouldEmitNavigationError};
@@ -1 +1 @@
1
- import{notifyRouteStateSync as e}from"./routeSync.mjs";import{runAfterEachHooks as t,runNavigationErrorHooks as n,shouldEmitNavigationError as r}from"./navigationCore.mjs";function i(e,t,n,r){return{mode:e,from:t,to:n,failure:r}}function a(i){let{afterEachHooks:a,errorHandlers:o,nativeRouter:s,rejectOnError:c}=i;async function l(e){if(await t(a,{mode:e.mode,to:e.to,from:e.from,nativeRouter:s,failure:e.failure}),e.failure&&r(e.failure)){var i;await n(o,(i=e.failure.cause)==null?e.failure:i,{mode:e.mode,to:e.to,from:e.from,nativeRouter:s,failure:e.failure})}}function u(e){return c&&r(e)}async function d(t){if(t.failure||e(t.to?{route:t.to,source:`router`}:void 0),await l(t),t.failure&&u(t.failure))throw t.failure;return t.failure}return{emitNavigationAfterEach:l,settleNavigationResult:d}}export{a as createNavigationResultController,i as createNavigationRunResult};
1
+ import{notifyRouteStateSync as e}from"./routeSync.mjs";import{runAfterEachHooks as t,runNavigationErrorHooks as n,shouldEmitNavigationError as r}from"./navigationCore.mjs";function i(e,t,n,r){return{mode:e,from:t,to:n,failure:r}}function a(i){let{afterEachHooks:a,errorHandlers:o,nativeRouter:s,rejectOnError:c}=i;async function l(e){await t(a,{mode:e.mode,to:e.to,from:e.from,nativeRouter:s,failure:e.failure}),e.failure&&r(e.failure)&&await n(o,e.failure.cause??e.failure,{mode:e.mode,to:e.to,from:e.from,nativeRouter:s,failure:e.failure})}function u(e){return c&&r(e)}async function d(t){if(t.failure||e(t.to?{route:t.to,source:`router`}:void 0),await l(t),t.failure&&u(t.failure))throw t.failure;return t.failure}return{emitNavigationAfterEach:l,settleNavigationResult:d}}export{a as createNavigationResultController,i as createNavigationRunResult};
@@ -1 +1 @@
1
- import{createAbsoluteRoutePath as e}from"../routerInternal/path.mjs";import{resolveMatchedRouteRecord as t}from"../routerInternal/matching.mjs";import{createNativeRouteUrl as n,hasLocationQuery as r}from"../routerInternal/snapshots.mjs";import{NavigationFailureType as i}from"./types.mjs";import{createNavigationFailure as a,executeNavigationMethod as o,isNavigationFailure as s,runNavigationGuards as c}from"./navigationCore.mjs";import{createNavigationRunResult as l}from"./navigationResult.mjs";import{applyRedirectedFrom as u,createDuplicatedFailure as d,createHashOnlyNavigationFailure as f,createTabBarQueryFailure as p,createTooManyRedirectsFailure as m,resolveRouteRecordRedirect as h}from"./navigationTargetHelpers.mjs";async function g(g){let{mode:_,target:v,from:y,nativeRouter:b,routeResolveCodec:x,namedRouteLookup:S,beforeEachGuards:C,beforeResolveGuards:w,maxRedirects:T,tabBarPathSet:E,resolveWithCodec:D,executeNative:O=!0,allowSameLocation:k=!1}=g,A=v,j=_,M=0;for(;;){var N;let g=E.has(A.path);if(n(A,x.stringifyQuery)===n(y,x.stringifyQuery)&&A.hash!==y.hash)return l(j,y,A,f(A,y));if(!k&&(g?A.path===y.path:A.fullPath===y.fullPath))return l(j,y,A,d(A,y));if(g&&r(A.query))return l(j,y,A,p(A,y));let _=await c(C,{mode:j,to:A,from:y,nativeRouter:b},D);if(_.status===`failure`)return l(j,y,A,_.failure);if(_.status===`redirect`){let e=_.target,t=_.replace===!0?`replace`:_.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||t!==j){if(u(e,A),A=e,j=t,M+=1,M>T)return l(j,y,A,m(A,y,T));continue}}let v=t(A,S),P=(N=v==null?void 0:v.matchedRecords)==null?[]:N,F=!1;for(let e of P){if(e.redirect===void 0)continue;let t;try{t=await h(e.redirect,A,y,D)}catch(e){return l(j,y,A,a(i.aborted,A,y,e))}let n=t.replace===!1?`push`:`replace`,r=t.target;if(r.fullPath!==A.fullPath||n!==j){if(u(r,A),A=r,j=n,M+=1,M>T)return l(j,y,A,m(A,y,T));F=!0;break}}if(F)continue;let I=!1;for(let e of P){if(e.beforeEnterGuards.length===0)continue;let t=await c(new Set(e.beforeEnterGuards),{mode:j,to:A,from:y,nativeRouter:b},D);if(t.status===`failure`)return l(j,y,A,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||n!==j){if(u(e,A),A=e,j=n,M+=1,M>T)return l(j,y,A,m(A,y,T));I=!0;break}}}if(I)continue;let L=await c(w,{mode:j,to:A,from:y,nativeRouter:b},D);if(L.status===`failure`)return l(j,y,A,L.failure);if(L.status===`redirect`){let e=L.target,t=L.replace===!0?`replace`:L.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||t!==j){if(u(e,A),A=e,j=t,M+=1,M>T)return l(j,y,A,m(A,y,T));continue}}if(!O)return l(j,y,A);if(g){let t=await o(b.switchTab,{url:e(A.path)},A,y);return s(t)?l(j,y,A,t):l(j,y,A)}let R=j===`push`?b.navigateTo:b.redirectTo,z=await o(R,{url:n(A,x.stringifyQuery)},A,y);return s(z)?l(j,y,A,z):l(j,y,A)}}export{g as navigateWithTarget};
1
+ import{createAbsoluteRoutePath as e}from"../routerInternal/path.mjs";import{resolveMatchedRouteRecord as t}from"../routerInternal/matching.mjs";import{createNativeRouteUrl as n,hasLocationQuery as r}from"../routerInternal/snapshots.mjs";import{NavigationFailureType as i}from"./types.mjs";import{createNavigationFailure as a,executeNavigationMethod as o,isNavigationFailure as s,runNavigationGuards as c}from"./navigationCore.mjs";import{createNavigationRunResult as l}from"./navigationResult.mjs";import{applyRedirectedFrom as u,createDuplicatedFailure as d,createHashOnlyNavigationFailure as f,createTabBarQueryFailure as p,createTooManyRedirectsFailure as m,resolveRouteRecordRedirect as h}from"./navigationTargetHelpers.mjs";async function g(g){let{mode:_,target:v,from:y,nativeRouter:b,routeResolveCodec:x,namedRouteLookup:S,beforeEachGuards:C,beforeResolveGuards:w,maxRedirects:T,tabBarPathSet:E,resolveWithCodec:D,executeNative:O=!0,allowSameLocation:k=!1}=g,A=v,j=_,M=0;for(;;){let g=E.has(A.path);if(n(A,x.stringifyQuery)===n(y,x.stringifyQuery)&&A.hash!==y.hash)return l(j,y,A,f(A,y));if(!k&&(g?A.path===y.path:A.fullPath===y.fullPath))return l(j,y,A,d(A,y));if(g&&r(A.query))return l(j,y,A,p(A,y));let _=await c(C,{mode:j,to:A,from:y,nativeRouter:b},D);if(_.status===`failure`)return l(j,y,A,_.failure);if(_.status===`redirect`){let e=_.target,t=_.replace===!0?`replace`:_.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||t!==j){if(u(e,A),A=e,j=t,M+=1,M>T)return l(j,y,A,m(A,y,T));continue}}let v=t(A,S)?.matchedRecords??[],N=!1;for(let e of v){if(e.redirect===void 0)continue;let t;try{t=await h(e.redirect,A,y,D)}catch(e){return l(j,y,A,a(i.aborted,A,y,e))}let n=t.replace===!1?`push`:`replace`,r=t.target;if(r.fullPath!==A.fullPath||n!==j){if(u(r,A),A=r,j=n,M+=1,M>T)return l(j,y,A,m(A,y,T));N=!0;break}}if(N)continue;let P=!1;for(let e of v){if(e.beforeEnterGuards.length===0)continue;let t=await c(new Set(e.beforeEnterGuards),{mode:j,to:A,from:y,nativeRouter:b},D);if(t.status===`failure`)return l(j,y,A,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||n!==j){if(u(e,A),A=e,j=n,M+=1,M>T)return l(j,y,A,m(A,y,T));P=!0;break}}}if(P)continue;let F=await c(w,{mode:j,to:A,from:y,nativeRouter:b},D);if(F.status===`failure`)return l(j,y,A,F.failure);if(F.status===`redirect`){let e=F.target,t=F.replace===!0?`replace`:F.replace===!1?`push`:j;if(e.fullPath!==A.fullPath||t!==j){if(u(e,A),A=e,j=t,M+=1,M>T)return l(j,y,A,m(A,y,T));continue}}if(!O)return l(j,y,A);if(g){let t=await o(b.switchTab,{url:e(A.path)},A,y);return s(t)?l(j,y,A,t):l(j,y,A)}let I=j===`push`?b.navigateTo:b.redirectTo,L=await o(I,{url:n(A,x.stringifyQuery)},A,y);return s(L)?l(j,y,A,L):l(j,y,A)}}export{g as navigateWithTarget};
@@ -1 +1 @@
1
- import{resolvePath as e}from"../routerInternal/path.mjs";import{normalizeHash as t,normalizeQuery as n,normalizeRouteParams as r,parseQuery as i,stringifyQuery as a}from"../routerInternal/query.mjs";import{createRouteLocation as o,parsePathInput as s}from"../routerInternal/location.mjs";const c={parseQuery:i,stringifyQuery:a};function l(i,a=``,l=c){var u,d,f,p;if(typeof i==`string`){let t=s(i,l),n=e(t.path,a);return o(n,t.query,t.hash,void 0,{},l.stringifyQuery)}let m=typeof i.fullPath==`string`?s(i.fullPath,l):void 0,h=(u=(d=i.path)==null?m==null?void 0:m.path:d)==null?a:u,g=e(h,a),_=i.query?n(i.query):(f=m==null?void 0:m.query)==null?{}:f,v=t((p=i.hash)==null?m==null?void 0:m.hash:p),y=typeof i.name==`string`?i.name:void 0,b=i.params?r(i.params):{};return o(g,_,v,y,b,l.stringifyQuery)}export{c as DEFAULT_ROUTE_RESOLVE_CODEC,l as resolveRouteLocation};
1
+ import{resolvePath as e}from"../routerInternal/path.mjs";import{normalizeHash as t,normalizeQuery as n,normalizeRouteParams as r,parseQuery as i,stringifyQuery as a}from"../routerInternal/query.mjs";import{createRouteLocation as o,parsePathInput as s}from"../routerInternal/location.mjs";const c={parseQuery:i,stringifyQuery:a};function l(i,a=``,l=c){if(typeof i==`string`){let t=s(i,l),n=e(t.path,a);return o(n,t.query,t.hash,void 0,{},l.stringifyQuery)}let u=typeof i.fullPath==`string`?s(i.fullPath,l):void 0,d=i.path??u?.path??a,f=e(d,a),p=i.query?n(i.query):u?.query??{},m=t(i.hash??u?.hash),h=typeof i.name==`string`?i.name:void 0,g=i.params?r(i.params):{};return o(f,p,m,h,g,l.stringifyQuery)}export{c as DEFAULT_ROUTE_RESOLVE_CODEC,l as resolveRouteLocation};
@@ -1 +1 @@
1
- import{createAbsoluteRoutePath as e}from"../routerInternal/path.mjs";import{collectRouteNamesForRemoval as t}from"../routerInternal/matching.mjs";import{assertValidAddRouteInput as n,warnRouteConfig as r}from"../routerInternal/recordsWarnings.mjs";import{createNamedRouteNameByStaticPath as i,flattenNamedRouteRecords as a,normalizeRouteRecordRaw as o}from"../routerInternal/records.mjs";import{cloneRouteMeta as s}from"../routerInternal/snapshots.mjs";function c(t){let n={name:t.name,path:t.path?`/${t.path}`:`/`};return t.meta!==void 0&&(n.meta=s(t.meta)),t.aliasPaths.length===1?n.alias=e(t.aliasPaths[0]):t.aliasPaths.length>1&&(n.alias=t.aliasPaths.map(t=>e(t))),t.beforeEnterGuards.length===1?n.beforeEnter=t.beforeEnterGuards[0]:t.beforeEnterGuards.length>1&&(n.beforeEnter=t.beforeEnterGuards.slice()),t.redirect!==void 0&&(n.redirect=t.redirect),n}function l(s){let l=e=>s.recordByName.has(e),u=()=>Array.from(s.recordByName.values(),c),d=((c,l)=>{let u=typeof c==`string`?l:c;if(!u)throw Error(`Route record is required when adding a child route`);n(u);let d=typeof c==`string`?c:void 0,f=d?s.recordByName.get(d):void 0;if(d&&!f)throw Error(`Parent route "${d}" is not defined in createRouter({ routes | namedRoutes })`);let p=a([u],f==null?void 0:f.path,d,f==null?void 0:f.aliasPaths,void 0,`addRoute`);if(p.length===0)throw Error(`Route name and path are required when adding a named route`);let m=[];for(let n of p){let i=o(n.route,n.parentName);if(!i)continue;let a=s.recordByName.get(i.name);if(a){let n=t(a.name,s.recordByName);for(let e of n)s.recordByName.delete(e);r(`addRoute() replaced existing route "${i.name}" (${e(a.path)} -> ${e(i.path)}) and removed ${n.size-1} nested route(s)`)}s.recordByName.set(i.name,i),m.push(i)}return s.nameByStaticPath=i(s.recordByName),()=>{let e=!1;for(let t of m)s.recordByName.get(t.name)===t&&(s.recordByName.delete(t.name),e=!0);e&&(s.nameByStaticPath=i(s.recordByName))}});function f(e){let n=t(e,s.recordByName);if(n.size===0)return;let r=!1;for(let e of n)r=s.recordByName.delete(e)||r;r&&(s.nameByStaticPath=i(s.recordByName))}function p(){s.recordByName.clear(),s.nameByStaticPath.clear()}return{hasRoute:l,getRoutes:u,addRoute:d,removeRoute:f,clearRoutes:p}}export{l as createRouteRegistry};
1
+ import{createAbsoluteRoutePath as e}from"../routerInternal/path.mjs";import{collectRouteNamesForRemoval as t}from"../routerInternal/matching.mjs";import{assertValidAddRouteInput as n,warnRouteConfig as r}from"../routerInternal/recordsWarnings.mjs";import{createNamedRouteNameByStaticPath as i,flattenNamedRouteRecords as a,normalizeRouteRecordRaw as o}from"../routerInternal/records.mjs";import{cloneRouteMeta as s}from"../routerInternal/snapshots.mjs";function c(t){let n={name:t.name,path:t.path?`/${t.path}`:`/`};return t.meta!==void 0&&(n.meta=s(t.meta)),t.aliasPaths.length===1?n.alias=e(t.aliasPaths[0]):t.aliasPaths.length>1&&(n.alias=t.aliasPaths.map(t=>e(t))),t.beforeEnterGuards.length===1?n.beforeEnter=t.beforeEnterGuards[0]:t.beforeEnterGuards.length>1&&(n.beforeEnter=t.beforeEnterGuards.slice()),t.redirect!==void 0&&(n.redirect=t.redirect),n}function l(s){let l=e=>s.recordByName.has(e),u=()=>Array.from(s.recordByName.values(),c),d=((c,l)=>{let u=typeof c==`string`?l:c;if(!u)throw Error(`Route record is required when adding a child route`);n(u);let d=typeof c==`string`?c:void 0,f=d?s.recordByName.get(d):void 0;if(d&&!f)throw Error(`Parent route "${d}" is not defined in createRouter({ routes | namedRoutes })`);let p=a([u],f?.path,d,f?.aliasPaths,void 0,`addRoute`);if(p.length===0)throw Error(`Route name and path are required when adding a named route`);let m=[];for(let n of p){let i=o(n.route,n.parentName);if(!i)continue;let a=s.recordByName.get(i.name);if(a){let n=t(a.name,s.recordByName);for(let e of n)s.recordByName.delete(e);r(`addRoute() replaced existing route "${i.name}" (${e(a.path)} -> ${e(i.path)}) and removed ${n.size-1} nested route(s)`)}s.recordByName.set(i.name,i),m.push(i)}return s.nameByStaticPath=i(s.recordByName),()=>{let e=!1;for(let t of m)s.recordByName.get(t.name)===t&&(s.recordByName.delete(t.name),e=!0);e&&(s.nameByStaticPath=i(s.recordByName))}});function f(e){let n=t(e,s.recordByName);if(n.size===0)return;let r=!1;for(let e of n)r=s.recordByName.delete(e)||r;r&&(s.nameByStaticPath=i(s.recordByName))}function p(){s.recordByName.clear(),s.nameByStaticPath.clear()}return{hasRoute:l,getRoutes:u,addRoute:d,removeRoute:f,clearRoutes:p}}export{l as createRouteRegistry};
@@ -1 +1 @@
1
- import{getCurrentMiniProgramPages as e}from"../runtime/platform.mjs";const t=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`],n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new WeakSet;function i(e){return n.add(e),()=>{n.delete(e)}}function a(e){for(let t of n)try{t(e)}catch(e){}}function o(e,t,n){if(e===`navigateBack`)return{method:e,source:`native`};if(t&&typeof t==`object`){let r=t.url;if(typeof r==`string`)return{method:e,page:n,source:`native`,url:r}}return{method:e,page:n,source:`native`}}function s(n){if(!n||typeof n!=`object`)return;let i=n;if(!r.has(i)){r.add(i);for(let n of t){let t=i[n];typeof t==`function`&&(i[n]=function(r,...i){let s=e(),c=s[s.length-1],l=!1,u=()=>{l||(l=!0,a(o(n,r,c)))},d=r&&typeof r==`object`?{...r,success:(...e)=>{u();let t=r.success;return typeof t==`function`?t(...e):void 0}}:r,f=t.call(this,d,...i);return f&&typeof f.then==`function`&&f.then(u,()=>{}),f})}}}export{s as installRouteStateSyncOnNativeRouter,a as notifyRouteStateSync,i as registerRouteStateSyncHandler};
1
+ import{getCurrentMiniProgramPages as e}from"../runtime/platform.mjs";const t=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`],n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new WeakSet;function i(e){return n.add(e),()=>{n.delete(e)}}function a(e){for(let t of n)try{t(e)}catch{}}function o(e,t,n){if(e===`navigateBack`)return{method:e,source:`native`};if(t&&typeof t==`object`){let r=t.url;if(typeof r==`string`)return{method:e,page:n,source:`native`,url:r}}return{method:e,page:n,source:`native`}}function s(n){if(!n||typeof n!=`object`)return;let i=n;if(!r.has(i)){r.add(i);for(let n of t){let t=i[n];typeof t==`function`&&(i[n]=function(r,...i){let s=e(),c=s[s.length-1],l=!1,u=()=>{l||(l=!0,a(o(n,r,c)))},d=r&&typeof r==`object`?{...r,success:(...e)=>{u();let t=r.success;return typeof t==`function`?t(...e):void 0}}:r,f=t.call(this,d,...i);return f&&typeof f.then==`function`&&f.then(u,()=>{}),f})}}}export{s as installRouteStateSyncOnNativeRouter,a as notifyRouteStateSync,i as registerRouteStateSyncHandler};
@@ -1 +1 @@
1
- import{reactive as e}from"../reactivity/reactive.mjs";import{readonly as t}from"../reactivity/readonly.mjs";import{getCurrentMiniProgramPages as n}from"../runtime/platform.mjs";import{getCurrentSetupContext as r}from"../runtime/hooks/base.mjs";import{onLoad as i,onReady as a,onRouteDone as o,onShow as s,onUnload as c}from"../runtime/hooks/register.mjs";import{getActiveRouter as l}from"./instance.mjs";import{registerRouteStateSyncHandler as u}from"./routeSync.mjs";import{resolveCurrentRoute as d,resolvePageRoute as f}from"../routerInternal/location.mjs";import{cloneLocationQuery as p,cloneRouteLocationRedirectedFrom as m,cloneRouteMeta as h,cloneRouteParams as g,cloneRouteRecordMatchedList as _}from"../routerInternal/snapshots.mjs";import{useNativePageRouter as v,useNativeRouter as y}from"../runtime/vueCompat/router.mjs";import{resolveRouteLocation as b}from"./resolve.mjs";import{WEVU_NATIVE_INSTANCE_KEY as x}from"@weapp-core/constants";function S(e){return typeof e.route==`string`||typeof e.__route__==`string`}function C(e){let t=e[x];return t&&typeof t==`object`?t:e}function w(e,t,r){if((r==null?void 0:r.source)===`router`||!t)return!0;let i=C(e);if(r!=null&&r.page)return r.page===i;let a=n();return a[a.length-1]===i}function T(e,t){e.path=t.path,e.fullPath=t.fullPath,e.query=p(t.query),e.hash=t.hash,e.params=g(t.params),t.name===void 0?delete e.name:e.name=t.name,t.meta===void 0?delete e.meta:e.meta=h(t.meta),t.href===void 0?delete e.href:e.href=t.href,t.matched===void 0?delete e.matched:e.matched=_(t.matched),t.redirectedFrom===void 0?delete e.redirectedFrom:e.redirectedFrom=m(t.redirectedFrom)}function E(m={}){var h;let _=r(),v=_!=null&&_.instance&&typeof _.instance==`object`?_.instance:void 0,y=(h=m.resolveRoute)==null?(e=>{var t,n;return(t=(n=l())==null?void 0:n.resolve(e))==null?e:t}):h,x=y(d(void 0,v)),E=e({path:x.path,fullPath:x.fullPath,query:p(x.query),hash:x.hash,params:g(x.params)});T(E,x);function D(e,t,n){let r=y(t||d(e,v));if(n){var i;(i=m.beforeRouteStateSync)==null||i.call(m,r,n)}T(E,r)}if(!v)return u(e=>{if(e!=null&&e.route){D(void 0,e.route,e);return}if(e!=null&&e.url){D(void 0,b(e.url,E.path),e);return}if(e!=null&&e.page){D(void 0,f(e.page),e);return}D(void 0,void 0,e)}),{route:t(E)};let O=v,k=C(O),A=S(k)||n().includes(k);i(e=>{D(e)}),a(()=>{D()}),s(()=>{D()}),o(()=>{D()});let j=u(e=>{if(w(O,A,e)){if(e!=null&&e.route){D(void 0,e.route,e);return}if(e!=null&&e.url){D(void 0,b(e.url,E.path),e);return}if(e!=null&&e.page){D(void 0,f(e.page),e);return}D(void 0,void 0,e)}});return c(()=>{j()}),{route:t(E)}}function D(e={}){return E(e).route}function O(){return y()}function k(){return v()}export{E as createRouteStateController,k as useNativePageRouter,O as useNativeRouter,D as useRoute};
1
+ import{reactive as e}from"../reactivity/reactive.mjs";import{readonly as t}from"../reactivity/readonly.mjs";import{getCurrentMiniProgramPages as n}from"../runtime/platform.mjs";import{getCurrentSetupContext as r}from"../runtime/hooks/base.mjs";import{onLoad as i,onReady as a,onRouteDone as o,onShow as s,onUnload as c}from"../runtime/hooks/register.mjs";import{registerRouteStateSyncHandler as l}from"./routeSync.mjs";import{resolveCurrentRoute as u,resolvePageRoute as d}from"../routerInternal/location.mjs";import{cloneLocationQuery as f,cloneRouteLocationRedirectedFrom as p,cloneRouteMeta as m,cloneRouteParams as h,cloneRouteRecordMatchedList as g}from"../routerInternal/snapshots.mjs";import{useNativePageRouter as _,useNativeRouter as v}from"../runtime/vueCompat/router.mjs";import{getActiveRouter as y}from"./instance.mjs";import{resolveRouteLocation as b}from"./resolve.mjs";import{WEVU_NATIVE_INSTANCE_KEY as x}from"@weapp-core/constants";function S(e){return typeof e.route==`string`||typeof e.__route__==`string`}function C(e){let t=e[x];return t&&typeof t==`object`?t:e}function w(e,t,r){if(r?.source===`router`||!t)return!0;let i=C(e);if(r?.page)return r.page===i;let a=n();return a[a.length-1]===i}function T(e,t){e.path=t.path,e.fullPath=t.fullPath,e.query=f(t.query),e.hash=t.hash,e.params=h(t.params),t.name===void 0?delete e.name:e.name=t.name,t.meta===void 0?delete e.meta:e.meta=m(t.meta),t.href===void 0?delete e.href:e.href=t.href,t.matched===void 0?delete e.matched:e.matched=g(t.matched),t.redirectedFrom===void 0?delete e.redirectedFrom:e.redirectedFrom=p(t.redirectedFrom)}function E(p={}){let m=r(),g=m?.instance&&typeof m.instance==`object`?m.instance:void 0,_=p.resolveRoute??(e=>y()?.resolve(e)??e),v=_(u(void 0,g)),x=e({path:v.path,fullPath:v.fullPath,query:f(v.query),hash:v.hash,params:h(v.params)});T(x,v);function E(e,t,n){let r=_(t||u(e,g));n&&p.beforeRouteStateSync?.(r,n),T(x,r)}if(!g)return l(e=>{if(e?.route){E(void 0,e.route,e);return}if(e?.url){E(void 0,b(e.url,x.path),e);return}if(e?.page){E(void 0,d(e.page),e);return}E(void 0,void 0,e)}),{route:t(x)};let D=g,O=C(D),k=S(O)||n().includes(O);i(e=>{E(e)}),a(()=>{E()}),s(()=>{E()}),o(()=>{E()});let A=l(e=>{if(w(D,k,e)){if(e?.route){E(void 0,e.route,e);return}if(e?.url){E(void 0,b(e.url,x.path),e);return}if(e?.page){E(void 0,d(e.page),e);return}E(void 0,void 0,e)}});return c(()=>{A()}),{route:t(x)}}function D(e={}){return E(e).route}function O(){return v()}function k(){return _()}export{E as createRouteStateController,k as useNativePageRouter,O as useNativeRouter,D as useRoute};
@@ -1 +1 @@
1
- import{getCurrentMiniProgramPages as e}from"../runtime/platform.mjs";import{getCurrentPageInstance as t}from"../runtime/register/component/lifecycle/platform.mjs";import{createAbsoluteRoutePath as n,resolvePath as r}from"./path.mjs";import{normalizeHash as i,normalizeQuery as a,parseQuery as o,stringifyQuery as s}from"./query.mjs";const c={parseQuery:o,stringifyQuery:s};function l(e,t=c){let n=e.indexOf(`#`),r=n>=0?e.slice(0,n):e,o=n>=0?i(e.slice(n+1)):``,s=r.indexOf(`?`);return s<0?{path:r,query:{},hash:o}:{path:r.slice(0,s),query:a(t.parseQuery(r.slice(s+1))),hash:o}}function u(e,t,a=``,o,c={},l=s){let u=r(e,``),d=l(t),f=n(u),p=i(a),m=d?`${f}?${d}`:f,h={path:u,fullPath:p?`${m}${p}`:m,query:t,hash:p,params:c};return o!==void 0&&(h.name=o),h}function d(e){return typeof(e==null?void 0:e.route)==`string`&&e.route.length>0||typeof(e==null?void 0:e.__route__)==`string`&&e.__route__.length>0}function f(n){let r=e();if(Array.isArray(r)&&r.length>0){let e=r[r.length-1];if(d(e))return e}let i=t();return d(i)?i:n}function p(e,t){var n;if(!e)return u(``,{});let r=typeof e.route==`string`?e.route:typeof e.__route__==`string`?e.__route__:``,i=t==null?(n=e.options)==null?{}:n:t;return u(r,a(i),``,void 0,{})}function m(e,t){return p(f(t),e)}export{u as createRouteLocation,l as parsePathInput,m as resolveCurrentRoute,p as resolvePageRoute};
1
+ import{getCurrentMiniProgramPages as e}from"../runtime/platform.mjs";import{getCurrentPageInstance as t}from"../runtime/register/component/lifecycle/platform.mjs";import{createAbsoluteRoutePath as n,resolvePath as r}from"./path.mjs";import{normalizeHash as i,normalizeQuery as a,parseQuery as o,stringifyQuery as s}from"./query.mjs";const c={parseQuery:o,stringifyQuery:s};function l(e,t=c){let n=e.indexOf(`#`),r=n>=0?e.slice(0,n):e,o=n>=0?i(e.slice(n+1)):``,s=r.indexOf(`?`);return s<0?{path:r,query:{},hash:o}:{path:r.slice(0,s),query:a(t.parseQuery(r.slice(s+1))),hash:o}}function u(e,t,a=``,o,c={},l=s){let u=r(e,``),d=l(t),f=n(u),p=i(a),m=d?`${f}?${d}`:f,h={path:u,fullPath:p?`${m}${p}`:m,query:t,hash:p,params:c};return o!==void 0&&(h.name=o),h}function d(e){return typeof e?.route==`string`&&e.route.length>0||typeof e?.__route__==`string`&&e.__route__.length>0}function f(n){let r=e();if(Array.isArray(r)&&r.length>0){let e=r[r.length-1];if(d(e))return e}let i=t();return d(i)?i:n}function p(e,t){if(!e)return u(``,{});let n=typeof e.route==`string`?e.route:typeof e.__route__==`string`?e.__route__:``,r=t??e.options??{};return u(n,a(r),``,void 0,{})}function m(e,t){return p(f(t),e)}export{u as createRouteLocation,l as parsePathInput,m as resolveCurrentRoute,p as resolvePageRoute};
@@ -1 +1 @@
1
- import{normalizeRouteParams as e}from"./query.mjs";const t=/^:(\w+)(?:\([^)]*\))?([+*?])?$/;function n(e){var n;let r=t.exec(e);if(r)return{key:r[1],modifier:(n=r[2])==null?``:n}}function r(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function i(e){return encodeURIComponent(e)}function a(e){try{return decodeURIComponent(e)}catch(t){return e}}function o(e,t,a){let o=[],s=/* @__PURE__ */ new Set;for(let c of e.split(`/`)){if(!c)continue;let e=n(c);if(!e){o.push(c);continue}let l=r(t[e.key]);if(e.modifier===``){if(l.length!==1)throw Error(`Missing required param "${e.key}" for named route "${a}"`);s.add(e.key),o.push(i(l[0]));continue}if(e.modifier===`?`){if(l.length===0)continue;if(l.length>1)throw Error(`Param "${e.key}" for named route "${a}" must be a single value`);s.add(e.key),o.push(i(l[0]));continue}if(e.modifier===`+`){if(l.length===0)throw Error(`Missing required repeatable param "${e.key}" for named route "${a}"`);s.add(e.key);for(let e of l)o.push(i(e));continue}l.length>0&&s.add(e.key);for(let e of l)o.push(i(e))}return{path:o.join(`/`),consumedKeys:s}}function s(e){return e===void 0?!1:!Array.isArray(e)||e.length>0}function c(e,t,n){let r=Object.keys(e).filter(e=>!t.has(e)).filter(t=>s(e[t]));if(r.length!==0)throw Error(`Unexpected params for named route "${n}": ${r.join(`, `)}`)}function l(t,n,r){let i=t.name;if(typeof i!=`string`||!i||t.path!==void 0||t.fullPath!==void 0)return t;let a=n.recordByName.get(i);if(!a)throw Error(`Named route "${i}" is not defined in createRouter({ routes | namedRoutes })`);let s=t.params?e(t.params):{},l=o(a.path,s,i);return r===`strict`&&c(s,l.consumedKeys,i),{...t,path:l.path?`/${l.path}`:`/`,params:s}}export{a as decodeRouteParamSegment,n as parsePathParamToken,l as resolveNamedRouteLocation};
1
+ import{normalizeRouteParams as e}from"./query.mjs";const t=/^:(\w+)(?:\([^)]*\))?([+*?])?$/;function n(e){let n=t.exec(e);if(n)return{key:n[1],modifier:n[2]??``}}function r(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function i(e){return encodeURIComponent(e)}function a(e){try{return decodeURIComponent(e)}catch{return e}}function o(e,t,a){let o=[],s=/* @__PURE__ */ new Set;for(let c of e.split(`/`)){if(!c)continue;let e=n(c);if(!e){o.push(c);continue}let l=r(t[e.key]);if(e.modifier===``){if(l.length!==1)throw Error(`Missing required param "${e.key}" for named route "${a}"`);s.add(e.key),o.push(i(l[0]));continue}if(e.modifier===`?`){if(l.length===0)continue;if(l.length>1)throw Error(`Param "${e.key}" for named route "${a}" must be a single value`);s.add(e.key),o.push(i(l[0]));continue}if(e.modifier===`+`){if(l.length===0)throw Error(`Missing required repeatable param "${e.key}" for named route "${a}"`);s.add(e.key);for(let e of l)o.push(i(e));continue}l.length>0&&s.add(e.key);for(let e of l)o.push(i(e))}return{path:o.join(`/`),consumedKeys:s}}function s(e){return e===void 0?!1:!Array.isArray(e)||e.length>0}function c(e,t,n){let r=Object.keys(e).filter(e=>!t.has(e)).filter(t=>s(e[t]));if(r.length!==0)throw Error(`Unexpected params for named route "${n}": ${r.join(`, `)}`)}function l(t,n,r){let i=t.name;if(typeof i!=`string`||!i||t.path!==void 0||t.fullPath!==void 0)return t;let a=n.recordByName.get(i);if(!a)throw Error(`Named route "${i}" is not defined in createRouter({ routes | namedRoutes })`);let s=t.params?e(t.params):{},l=o(a.path,s,i);return r===`strict`&&c(s,l.consumedKeys,i),{...t,path:l.path?`/${l.path}`:`/`,params:s}}export{a as decodeRouteParamSegment,n as parsePathParamToken,l as resolveNamedRouteLocation};
@@ -1 +1 @@
1
- import{createAbsoluteRoutePath as e,isDynamicRoutePath as t,resolvePath as n}from"./path.mjs";import{warnRouteConfig as r}from"./recordsWarnings.mjs";function i(e){return e?Array.isArray(e)?e:[e]:[]}function a(e,t,n=`namedRoutes`){return typeof e.name==`string`&&e.name.trim()?e.name.trim():n===`routes`?t||`/`:``}function o(e,t){if(!e)return[];let r=Array.isArray(e)?e:[e],i=[];for(let e of r){if(typeof e!=`string`)continue;let r=n(e,``);r&&r!==t&&(i.includes(r)||i.push(r))}return i}function s(e,t,r=`namedRoutes`){let s=n(e.path,``);if(!s&&e.path!==`/`)return;let c=a(e,s,r);if(c)return{name:c,path:s,aliasPaths:o(e.alias,s),parentName:t,meta:e.meta,beforeEnterGuards:i(e.beforeEnter),redirect:e.redirect}}function c(t,r){return!r||t.startsWith(`/`)?n(t,``):n(`${e(r)}/${t}`,``)}function l(e){return e?Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):typeof e==`string`&&e.length>0?[e]:[]:[]}function u(e){let t=[];for(let n of e)n&&!t.includes(n)&&t.push(n);return t}function d(t){if(t.length!==0)return t.length===1?e(t[0]):t.map(t=>e(t))}function f(t,n,i,o=[],s,p=`namedRoutes`,m=/* @__PURE__ */ new Set){let h=[];for(let[g,_]of t.entries()){let t=`${p}[${g}]`;if(m.has(_)){r(`ignored route record at ${t}: detected circular children reference`);continue}if(typeof _.path!=`string`||!_.path){let e=typeof(_==null?void 0:_.name)==`string`?_.name.trim():``;r(`ignored route record "${e}" at ${t}: route path is required`);continue}let v=c(_.path,n),y=a(_,v,s);if(!y){r(`ignored route record at ${t}: route name is required`);continue}let b=[],x=/* @__PURE__ */ new Map;for(let i of l(_.alias)){let a=c(i,n);if(!a)continue;if(a===v){r(`ignored alias "${e(a)}" for route "${y}" at ${t}: alias is same as route path`);continue}let o=x.get(a);if(o){r(`ignored duplicate alias "${e(a)}" for route "${y}" at ${t}: already declared by "${o}"`);continue}x.set(a,i),b.push(a)}let S=_.path.startsWith(`/`)?[]:o.map(e=>c(_.path,e)).filter(Boolean).filter(e=>e!==v),C=u([...b,...S]),w={name:y,path:v?e(v):`/`,alias:d(C),meta:_.meta,beforeEnter:_.beforeEnter,redirect:_.redirect};if(h.push({route:w,parentName:i,source:s}),Array.isArray(_.children)&&_.children.length>0){let e=new Set(m);e.add(_),h.push(...f(_.children,v,y,C,s,`${t}.children`,e))}}return h}function p(e,t=`namedRoutes`){if(!e)return[];if(Array.isArray(e))return f(e,void 0,void 0,[],t,t);let n=[];for(let[i,a]of Object.entries(e)){let e=typeof i==`string`?i.trim():``;if(!e){r(`ignored route record at ${t}: route name is required`);continue}if(typeof a!=`string`||!a){r(`ignored route record "${e}" at ${t}: route path is required`);continue}n.push({route:{name:e,path:a},source:t})}return n}function m(e){return[...p(e.routes,`routes`),...p(e.namedRoutes,`namedRoutes`)]}function h(e){let n=/* @__PURE__ */ new Map;for(let[r,i]of e.entries()){!t(i.path)&&!n.has(i.path)&&n.set(i.path,r);for(let e of i.aliasPaths)!t(e)&&!n.has(e)&&n.set(e,r)}return n}function g(e){let t=/* @__PURE__ */ new Map;for(let n of e){let e=s(n.route,n.parentName,n.source);e&&t.set(e.name,e)}return{recordByName:t,nameByStaticPath:h(t)}}export{g as createNamedRouteLookup,h as createNamedRouteNameByStaticPath,d as createRouteRecordAliasValue,f as flattenNamedRouteRecords,s as normalizeRouteRecordRaw,m as resolveRouteOptionEntries};
1
+ import{createAbsoluteRoutePath as e,isDynamicRoutePath as t,resolvePath as n}from"./path.mjs";import{warnRouteConfig as r}from"./recordsWarnings.mjs";function i(e){return e?Array.isArray(e)?e:[e]:[]}function a(e,t,n=`namedRoutes`){return typeof e.name==`string`&&e.name.trim()?e.name.trim():n===`routes`?t||`/`:``}function o(e,t){if(!e)return[];let r=Array.isArray(e)?e:[e],i=[];for(let e of r){if(typeof e!=`string`)continue;let r=n(e,``);r&&r!==t&&(i.includes(r)||i.push(r))}return i}function s(e,t,r=`namedRoutes`){let s=n(e.path,``);if(!s&&e.path!==`/`)return;let c=a(e,s,r);if(c)return{name:c,path:s,aliasPaths:o(e.alias,s),parentName:t,meta:e.meta,beforeEnterGuards:i(e.beforeEnter),redirect:e.redirect}}function c(t,r){return!r||t.startsWith(`/`)?n(t,``):n(`${e(r)}/${t}`,``)}function l(e){return e?Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):typeof e==`string`&&e.length>0?[e]:[]:[]}function u(e){let t=[];for(let n of e)n&&!t.includes(n)&&t.push(n);return t}function d(t){if(t.length!==0)return t.length===1?e(t[0]):t.map(t=>e(t))}function f(t,n,i,o=[],s,p=`namedRoutes`,m=/* @__PURE__ */ new Set){let h=[];for(let[g,_]of t.entries()){let t=`${p}[${g}]`;if(m.has(_)){r(`ignored route record at ${t}: detected circular children reference`);continue}if(typeof _.path!=`string`||!_.path){let e=typeof _?.name==`string`?_.name.trim():``;r(`ignored route record "${e}" at ${t}: route path is required`);continue}let v=c(_.path,n),y=a(_,v,s);if(!y){r(`ignored route record at ${t}: route name is required`);continue}let b=[],x=/* @__PURE__ */ new Map;for(let i of l(_.alias)){let a=c(i,n);if(!a)continue;if(a===v){r(`ignored alias "${e(a)}" for route "${y}" at ${t}: alias is same as route path`);continue}let o=x.get(a);if(o){r(`ignored duplicate alias "${e(a)}" for route "${y}" at ${t}: already declared by "${o}"`);continue}x.set(a,i),b.push(a)}let S=_.path.startsWith(`/`)?[]:o.map(e=>c(_.path,e)).filter(Boolean).filter(e=>e!==v),C=u([...b,...S]),w={name:y,path:v?e(v):`/`,alias:d(C),meta:_.meta,beforeEnter:_.beforeEnter,redirect:_.redirect};if(h.push({route:w,parentName:i,source:s}),Array.isArray(_.children)&&_.children.length>0){let e=new Set(m);e.add(_),h.push(...f(_.children,v,y,C,s,`${t}.children`,e))}}return h}function p(e,t=`namedRoutes`){if(!e)return[];if(Array.isArray(e))return f(e,void 0,void 0,[],t,t);let n=[];for(let[i,a]of Object.entries(e)){let e=typeof i==`string`?i.trim():``;if(!e){r(`ignored route record at ${t}: route name is required`);continue}if(typeof a!=`string`||!a){r(`ignored route record "${e}" at ${t}: route path is required`);continue}n.push({route:{name:e,path:a},source:t})}return n}function m(e){return[...p(e.routes,`routes`),...p(e.namedRoutes,`namedRoutes`)]}function h(e){let n=/* @__PURE__ */ new Map;for(let[r,i]of e.entries()){!t(i.path)&&!n.has(i.path)&&n.set(i.path,r);for(let e of i.aliasPaths)!t(e)&&!n.has(e)&&n.set(e,r)}return n}function g(e){let t=/* @__PURE__ */ new Map;for(let n of e){let e=s(n.route,n.parentName,n.source);e&&t.set(e.name,e)}return{recordByName:t,nameByStaticPath:h(t)}}export{g as createNamedRouteLookup,h as createNamedRouteNameByStaticPath,d as createRouteRecordAliasValue,f as flattenNamedRouteRecords,s as normalizeRouteRecordRaw,m as resolveRouteOptionEntries};
@@ -1 +1 @@
1
- import{createAbsoluteRoutePath as e,resolvePath as t}from"./path.mjs";function n(e){typeof console<`u`&&typeof console.warn==`function`&&console.warn(`[wevu/router] ${e}`)}function r(n){let r=t(n,``);return r?e(r):`/`}function i(e,t=/* @__PURE__ */ new Set){if(t.has(e))return!0;if(!Array.isArray(e.children)||e.children.length===0)return!1;let n=new Set(t);n.add(e);for(let t of e.children)if(i(t,n))return!0;return!1}function a(e){let t=typeof e.name==`string`?e.name.trim():``;if(!t)throw Error(`Route name is required when adding a named route`);if(typeof e.path!=`string`||!e.path)throw Error(`Route path is required when adding named route "${t}"`);if(i(e))throw Error(`Circular children reference detected when adding named route "${t}"`)}function o(e){let t=/* @__PURE__ */ new Map,i=[];for(let n of e){var a;let e=typeof n.route.name==`string`?n.route.name.trim():``;if(!e)continue;let o=(a=n.source)==null?`namedRoutes`:a,s=r(n.route.path),c=t.get(e);c&&i.push(`"${e}" (${c.source}:${c.path} -> ${o}:${s})`),t.set(e,{source:o,path:s})}i.length!==0&&n(`duplicate route names detected, later entries override earlier ones: ${i.join(`, `)}`)}export{a as assertValidAddRouteInput,o as warnDuplicateRouteEntries,n as warnRouteConfig};
1
+ import{createAbsoluteRoutePath as e,resolvePath as t}from"./path.mjs";function n(e){typeof console<`u`&&typeof console.warn==`function`&&console.warn(`[wevu/router] ${e}`)}function r(n){let r=t(n,``);return r?e(r):`/`}function i(e,t=/* @__PURE__ */ new Set){if(t.has(e))return!0;if(!Array.isArray(e.children)||e.children.length===0)return!1;let n=new Set(t);n.add(e);for(let t of e.children)if(i(t,n))return!0;return!1}function a(e){let t=typeof e.name==`string`?e.name.trim():``;if(!t)throw Error(`Route name is required when adding a named route`);if(typeof e.path!=`string`||!e.path)throw Error(`Route path is required when adding named route "${t}"`);if(i(e))throw Error(`Circular children reference detected when adding named route "${t}"`)}function o(e){let t=/* @__PURE__ */ new Map,i=[];for(let n of e){let e=typeof n.route.name==`string`?n.route.name.trim():``;if(!e)continue;let a=n.source??`namedRoutes`,o=r(n.route.path),s=t.get(e);s&&i.push(`"${e}" (${s.source}:${s.path} -> ${a}:${o})`),t.set(e,{source:a,path:o})}i.length!==0&&n(`duplicate route names detected, later entries override earlier ones: ${i.join(`, `)}`)}export{a as assertValidAddRouteInput,o as warnDuplicateRouteEntries,n as warnRouteConfig};
@@ -1 +1 @@
1
- import{nextTick as e}from"../../scheduler.mjs";import{toRaw as t}from"../../reactivity/reactive/shared.mjs";import{isRef as n,ref as r}from"../../reactivity/ref.mjs";import{hasOwn as i}from"../../utils.mjs";import{setComputedValue as a}from"../internal.mjs";import{normalizeEmitEventName as o,normalizeEmitPayload as s}from"../emit.mjs";import{isNativeBridgeMethod as c,markNativeBridgeMethod as l}from"../nativeBridge.mjs";import{createComputedAccessors as u}from"./computed.mjs";import{WEVU_COMPONENT_NAME_KEY as d,WEVU_HOST_COMMIT_PROMISE_KEY as f,WEVU_INLINE_MAP_KEY as p,WEVU_NATIVE_INSTANCE_KEY as m,WEVU_PARENT_INSTANCE_KEY as h,WEVU_PROPS_KEY as g,WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD as _,WEVU_RUNTIME_APP_KEY as v,WEVU_RUNTIME_KEY as y}from"@weapp-core/constants";function b(b){let{state:x,setupState:S,computedDefs:C,methodDefs:w,appConfig:T,includeComputed:E,setDataStrategy:D}=b,O={},{computedRefs:k,computedSetters:A,dirtyComputedKeys:j,createTrackedComputed:M,computedProxy:N}=u({includeComputed:E,setDataStrategy:D}),P=r(0),F=Object.create(null),I=(e,n)=>{let r=t(e),i=r[y],a=i==null?void 0:i.proxy,o=(e,t)=>{let n=e[t];return c(n)},s=t=>!(!t||typeof t!=`object`||t===e||t===n||t===a||o(t,`triggerEvent`)||o(t,`createSelectorQuery`)||o(t,`createIntersectionObserver`)||o(t,`setData`)),l=r[m];if(s(l))return l;let u=i==null?void 0:i.instance;if(s(u))return u},L=e=>{if(i(O,e))return;let t=(...t)=>{let n=I(x,x);if(!n)return;let r=Reflect.get(n,e);if(typeof r==`function`)return r.apply(n,t)};l(t),O[e]=t},R=(e,t)=>{let n=/* @__PURE__ */ new Set,r=e;for(;r&&!n.has(r);){var a;n.add(r);let e=(a=r[v])==null||(a=a.config)==null?void 0:a.globalProperties;if(e&&i(e,t))return{found:!0,value:e[t]};r=r[h]}let o=typeof globalThis<`u`?globalThis.getApp:void 0;if(typeof o==`function`)try{var s;let e=o(),n=e==null||(s=e[v])==null||(s=s.config)==null?void 0:s.globalProperties;if(n&&i(n,t))return{found:!0,value:n[t]}}catch(e){}return{found:!1,value:void 0}},z=e=>{let t=e&&Reflect.get(e,`selectOwnerComponent`);if(typeof t==`function`)try{var n,r,i,a;let o=t.call(e);if(!o||typeof o!=`object`)return;let s=Reflect.get(o,_);if(typeof s==`function`){let e=s.call(o);if(e)return e}return(n=(r=(i=o[y])==null?void 0:i.proxy)==null?(a=o.__wevu)==null?void 0:a.proxy:r)==null?o:n}catch(e){return}},B=new Proxy(x,{get(n,r,a){if(typeof r==`string`){if(P.value,i(S,r))return Reflect.get(S,r,a);if(r===`props`){let e=n[g];if(e&&typeof e==`object`)return e}if(r===`$props`){let e=n[g];if(e&&typeof e==`object`)return e}let m=n[g];if(m&&typeof m==`object`&&i(m,r))return Reflect.get(m,r);if(r===`data`||r===`$state`)return x;if(r===`$computed`)return N;if(r===`$emit`)return(e,...t)=>{let r=I(n,a),i=r&&Reflect.get(r,`triggerEvent`);if(typeof i!=`function`)return;let{detail:c,options:l}=s(t);return i.call(r,o(e),c,l)};if(r===`$nextTick`)return async t=>{await e();let r=I(n,a),i=r&&Reflect.get(r,f);if(i&&(typeof i==`object`||typeof i==`function`)&&`then`in i&&typeof i.then==`function`&&await i,t)return t.call(B)};if(r===`$set`)return(e,t,n)=>(Reflect.set(e,t,n),n);if(r===`$delete`)return(e,t)=>Reflect.deleteProperty(e,t);if(r===`$slots`){var c;return(c=t(n).$slots)==null?Object.freeze(Object.create(null)):c}if(r===`$refs`){var l;return(l=t(n).$refs)==null?Object.create(null):l}if(r===`$parent`)return z(I(n,a));if(r===`$options`){var u,p;let e=I(n,a);return{name:(u=(p=e==null?void 0:e[d])==null?e==null?void 0:e.name:p)==null?e==null?void 0:e.is:u}}if(i(F,r))return Reflect.get(F,r);if(i(O,r))return O[r];if(k[r])return k[r].value;if(i(T.globalProperties,r))return T.globalProperties[r];let h=R(I(n,a),r);if(h.found)return h.value}if(!Reflect.has(n,r)){let e=I(n,a);if(e&&Reflect.has(e,r)){let t=Reflect.get(e,r);return typeof t==`function`?t.bind(e):t}}let m=Reflect.get(n,r,a);return typeof r==`string`&&i(S,r)?Reflect.get(S,r,a):m},set(e,t,r,o){if(typeof t==`string`&&k[t])return a(A,t,r),!0;if(i(S,t)){let e=Reflect.get(S,t,o);return n(e)&&!n(r)?(e.value=r,!0):Reflect.set(S,t,r,o)}if(i(F,t))return Reflect.set(F,t,r);if(Reflect.has(e,t)){var s;let a=Reflect.get(e,t,o);return n(a)&&!n(r)?(a.value=r,!0):i((s=e[g])==null?{}:s,t)?Reflect.set(S,t,r,o):Reflect.set(e,t,r,o)}return Reflect.set(F,t,r)},has(e,t){if(t===`data`||t===`$emit`||t===`$nextTick`||t===`$set`||t===`$delete`||t===`$slots`||t===`$refs`||t===`$parent`||t===`$options`||typeof t==`string`&&(i(S,t)||k[t]||i(O,t))||i(F,t))return!0;let n=I(e,e);return typeof t==`string`&&R(n,t).found||n&&Reflect.has(n,t)?!0:Reflect.has(e,t)},ownKeys(e){let t=/* @__PURE__ */ new Set;return Reflect.ownKeys(e).forEach(e=>{t.add(e)}),Reflect.ownKeys(S).forEach(e=>{t.add(e)}),Reflect.ownKeys(F).forEach(e=>t.add(e)),Object.keys(O).forEach(e=>t.add(e)),Object.keys(k).forEach(e=>t.add(e)),[...t]},getOwnPropertyDescriptor(e,t){if(typeof t==`string`&&i(S,t))return Object.getOwnPropertyDescriptor(S,t);if(i(F,t))return Object.getOwnPropertyDescriptor(F,t);if(Reflect.has(e,t))return Object.getOwnPropertyDescriptor(e,t);if(typeof t==`string`){if(t===`data`)return{configurable:!0,enumerable:!1,get(){return x}};if(k[t])return{configurable:!0,enumerable:!0,get(){return k[t].value},set(e){a(A,t,e)}};if(i(O,t))return{configurable:!0,enumerable:!1,value:O[t]}}}});return Object.keys(w).forEach(e=>{let t=w[e];if(typeof t==`function`){O[e]=(...e)=>t.apply(B,e);return}e===p&&t&&typeof t==`object`&&(O[e]=t)}),L(`triggerEvent`),L(`createSelectorQuery`),L(`createIntersectionObserver`),L(`setData`),Object.keys(C).forEach(e=>{let t=C[e];if(typeof t==`function`)k[e]=M(e,()=>t.call(B));else{var n,r;let i=(n=t.get)==null?void 0:n.bind(B);if(!i)throw Error(`计算属性 "${e}" 需要提供 getter`);let a=(r=t.set)==null?void 0:r.bind(B);a?(A[e]=a,k[e]=M(e,i,a)):k[e]=M(e,i)}}),{boundMethods:O,computedRefs:k,computedSetters:A,dirtyComputedKeys:j,computedProxy:N,publicInstance:B,touchSetupMethodsVersion(){P.value+=1}}}export{b as createRuntimeContext};
1
+ import{nextTick as e}from"../../scheduler.mjs";import{toRaw as t}from"../../reactivity/reactive/shared.mjs";import{isRef as n,ref as r}from"../../reactivity/ref.mjs";import{hasOwn as i}from"../../utils.mjs";import{setComputedValue as a}from"../internal.mjs";import{normalizeEmitEventName as o,normalizeEmitPayload as s}from"../emit.mjs";import{isNativeBridgeMethod as c,markNativeBridgeMethod as l}from"../nativeBridge.mjs";import{createComputedAccessors as u}from"./computed.mjs";import{WEVU_COMPONENT_NAME_KEY as d,WEVU_HOST_COMMIT_PROMISE_KEY as f,WEVU_INLINE_MAP_KEY as p,WEVU_NATIVE_INSTANCE_KEY as m,WEVU_PARENT_INSTANCE_KEY as h,WEVU_PROPS_KEY as g,WEVU_RESOLVE_PUBLIC_INSTANCE_METHOD as _,WEVU_RUNTIME_APP_KEY as v,WEVU_RUNTIME_KEY as y}from"@weapp-core/constants";function b(b){let{state:x,setupState:S,computedDefs:C,methodDefs:w,appConfig:T,includeComputed:E,setDataStrategy:D}=b,O={},{computedRefs:k,computedSetters:A,dirtyComputedKeys:j,createTrackedComputed:M,computedProxy:N}=u({includeComputed:E,setDataStrategy:D}),P=r(0),F=Object.create(null),I=(e,n)=>{let r=t(e),i=r[y],a=i?.proxy,o=(e,t)=>{let n=e[t];return c(n)},s=t=>!(!t||typeof t!=`object`||t===e||t===n||t===a||o(t,`triggerEvent`)||o(t,`createSelectorQuery`)||o(t,`createIntersectionObserver`)||o(t,`setData`)),l=r[m];if(s(l))return l;let u=i?.instance;if(s(u))return u},L=e=>{if(i(O,e))return;let t=(...t)=>{let n=I(x,x);if(!n)return;let r=Reflect.get(n,e);if(typeof r==`function`)return r.apply(n,t)};l(t),O[e]=t},R=(e,t)=>{let n=/* @__PURE__ */ new Set,r=e;for(;r&&!n.has(r);){n.add(r);let e=r[v]?.config?.globalProperties;if(e&&i(e,t))return{found:!0,value:e[t]};r=r[h]}let a=typeof globalThis<`u`?globalThis.getApp:void 0;if(typeof a==`function`)try{let e=a()?.[v]?.config?.globalProperties;if(e&&i(e,t))return{found:!0,value:e[t]}}catch{}return{found:!1,value:void 0}},z=e=>{let t=e&&Reflect.get(e,`selectOwnerComponent`);if(typeof t==`function`)try{let n=t.call(e);if(!n||typeof n!=`object`)return;let r=Reflect.get(n,_);if(typeof r==`function`){let e=r.call(n);if(e)return e}return n[y]?.proxy??n.__wevu?.proxy??n}catch{return}},B=new Proxy(x,{get(n,r,a){if(typeof r==`string`){if(P.value,i(S,r))return Reflect.get(S,r,a);if(r===`props`){let e=n[g];if(e&&typeof e==`object`)return e}if(r===`$props`){let e=n[g];if(e&&typeof e==`object`)return e}let c=n[g];if(c&&typeof c==`object`&&i(c,r))return Reflect.get(c,r);if(r===`data`||r===`$state`)return x;if(r===`$computed`)return N;if(r===`$emit`)return(e,...t)=>{let r=I(n,a),i=r&&Reflect.get(r,`triggerEvent`);if(typeof i!=`function`)return;let{detail:c,options:l}=s(t);return i.call(r,o(e),c,l)};if(r===`$nextTick`)return async t=>{await e();let r=I(n,a),i=r&&Reflect.get(r,f);if(i&&(typeof i==`object`||typeof i==`function`)&&`then`in i&&typeof i.then==`function`&&await i,t)return t.call(B)};if(r===`$set`)return(e,t,n)=>(Reflect.set(e,t,n),n);if(r===`$delete`)return(e,t)=>Reflect.deleteProperty(e,t);if(r===`$slots`)return t(n).$slots??Object.freeze(Object.create(null));if(r===`$refs`)return t(n).$refs??Object.create(null);if(r===`$parent`)return z(I(n,a));if(r===`$options`){let e=I(n,a);return{name:e?.[d]??e?.name??e?.is}}if(i(F,r))return Reflect.get(F,r);if(i(O,r))return O[r];if(k[r])return k[r].value;if(i(T.globalProperties,r))return T.globalProperties[r];let l=R(I(n,a),r);if(l.found)return l.value}if(!Reflect.has(n,r)){let e=I(n,a);if(e&&Reflect.has(e,r)){let t=Reflect.get(e,r);return typeof t==`function`?t.bind(e):t}}let c=Reflect.get(n,r,a);return typeof r==`string`&&i(S,r)?Reflect.get(S,r,a):c},set(e,t,r,o){if(typeof t==`string`&&k[t])return a(A,t,r),!0;if(i(S,t)){let e=Reflect.get(S,t,o);return n(e)&&!n(r)?(e.value=r,!0):Reflect.set(S,t,r,o)}if(i(F,t))return Reflect.set(F,t,r);if(Reflect.has(e,t)){let a=Reflect.get(e,t,o);return n(a)&&!n(r)?(a.value=r,!0):i(e[g]??{},t)?Reflect.set(S,t,r,o):Reflect.set(e,t,r,o)}return Reflect.set(F,t,r)},has(e,t){if(t===`data`||t===`$emit`||t===`$nextTick`||t===`$set`||t===`$delete`||t===`$slots`||t===`$refs`||t===`$parent`||t===`$options`||typeof t==`string`&&(i(S,t)||k[t]||i(O,t))||i(F,t))return!0;let n=I(e,e);return typeof t==`string`&&R(n,t).found||n&&Reflect.has(n,t)?!0:Reflect.has(e,t)},ownKeys(e){let t=/* @__PURE__ */ new Set;return Reflect.ownKeys(e).forEach(e=>{t.add(e)}),Reflect.ownKeys(S).forEach(e=>{t.add(e)}),Reflect.ownKeys(F).forEach(e=>t.add(e)),Object.keys(O).forEach(e=>t.add(e)),Object.keys(k).forEach(e=>t.add(e)),[...t]},getOwnPropertyDescriptor(e,t){if(typeof t==`string`&&i(S,t))return Object.getOwnPropertyDescriptor(S,t);if(i(F,t))return Object.getOwnPropertyDescriptor(F,t);if(Reflect.has(e,t))return Object.getOwnPropertyDescriptor(e,t);if(typeof t==`string`){if(t===`data`)return{configurable:!0,enumerable:!1,get(){return x}};if(k[t])return{configurable:!0,enumerable:!0,get(){return k[t].value},set(e){a(A,t,e)}};if(i(O,t))return{configurable:!0,enumerable:!1,value:O[t]}}}});return Object.keys(w).forEach(e=>{let t=w[e];if(typeof t==`function`){O[e]=(...e)=>t.apply(B,e);return}e===p&&t&&typeof t==`object`&&(O[e]=t)}),L(`triggerEvent`),L(`createSelectorQuery`),L(`createIntersectionObserver`),L(`setData`),Object.keys(C).forEach(e=>{let t=C[e];if(typeof t==`function`)k[e]=M(e,()=>t.call(B));else{let n=t.get?.bind(B);if(!n)throw Error(`计算属性 "${e}" 需要提供 getter`);let r=t.set?.bind(B);r?(A[e]=r,k[e]=M(e,n,r)):k[e]=M(e,n)}}),{boundMethods:O,computedRefs:k,computedSetters:A,dirtyComputedKeys:j,computedProxy:N,publicInstance:B,touchSetupMethodsVersion(){P.value+=1}}}export{b as createRuntimeContext};
@@ -1 +1 @@
1
- function e(e){return e!==`patch`&&e!==`diff`}function t(t){if(t!==`off`)return n=>{var r;if(t===`fallback`&&!e(n.reason))return;let i=typeof n.bytes==`number`?n.bytes:n.estimatedBytes,a=typeof i==`number`?`${i}B`:`unknown`,o=[`mode=${n.mode}`,`reason=${n.reason}`,`pending=${n.pendingPatchKeys}`,`keys=${n.payloadKeys}`,`bytes=${a}`];if(typeof n.revision==`number`&&o.push(`revision=${n.revision}`),typeof n.committedRevision==`number`&&o.push(`committedRevision=${n.committedRevision}`),typeof n.mergedSiblingParents==`number`&&o.push(`mergedParents=${n.mergedSiblingParents}`),typeof n.computedDirtyKeys==`number`&&o.push(`computedDirty=${n.computedDirtyKeys}`),typeof n.flushCount==`number`&&o.push(`flushes=${n.flushCount}`),typeof n.windowMs==`number`&&o.push(`window=${n.windowMs}ms`),n.targetLabel&&o.push(`target=${n.targetLabel}`),(r=n.bindings)!=null&&r.length){let e=n.bindings.map(e=>{var t;let n=(t=e.sourceLocation)==null?void 0:t.start;return n?`${e.id}@${e.sourceFile}:${n.line}:${n.column}`:`${e.id}@${e.sourceFile}`});o.push(`bindings=${e.join(`,`)}`)}n.message&&o.push(`message=${n.message}`);let s=`[wevu:setData] ${o.join(` `)}`;if(e(n.reason)){console.warn(s);return}console.info(s)}}export{t as createDiagnosticsLogger};
1
+ function e(e){return e!==`patch`&&e!==`diff`}function t(t){if(t!==`off`)return n=>{if(t===`fallback`&&!e(n.reason))return;let r=typeof n.bytes==`number`?n.bytes:n.estimatedBytes,i=typeof r==`number`?`${r}B`:`unknown`,a=[`mode=${n.mode}`,`reason=${n.reason}`,`pending=${n.pendingPatchKeys}`,`keys=${n.payloadKeys}`,`bytes=${i}`];if(typeof n.revision==`number`&&a.push(`revision=${n.revision}`),typeof n.committedRevision==`number`&&a.push(`committedRevision=${n.committedRevision}`),typeof n.mergedSiblingParents==`number`&&a.push(`mergedParents=${n.mergedSiblingParents}`),typeof n.computedDirtyKeys==`number`&&a.push(`computedDirty=${n.computedDirtyKeys}`),typeof n.flushCount==`number`&&a.push(`flushes=${n.flushCount}`),typeof n.windowMs==`number`&&a.push(`window=${n.windowMs}ms`),n.targetLabel&&a.push(`target=${n.targetLabel}`),n.bindings?.length){let e=n.bindings.map(e=>{let t=e.sourceLocation?.start;return t?`${e.id}@${e.sourceFile}:${t.line}:${t.column}`:`${e.id}@${e.sourceFile}`});a.push(`bindings=${e.join(`,`)}`)}n.message&&a.push(`message=${n.message}`);let o=`[wevu:setData] ${a.join(` `)}`;if(e(n.reason)){console.warn(o);return}console.info(o)}}export{t as createDiagnosticsLogger};
@@ -1 +1 @@
1
- import{queueJob as e}from"../../scheduler.mjs";import{effect as t,stop as n}from"../../reactivity/core.mjs";import{touchReactive as r}from"../../reactivity/reactive/patch.mjs";import{shallowReactive as i}from"../../reactivity/reactive/shallow.mjs";import{isReactive as a,reactive as o}from"../../reactivity/reactive.mjs";import{watch as ee}from"../../reactivity/watch.mjs";import{requireRuntimeCapability as s}from"../capabilities.mjs";import{hasOwn as c}from"../../utils.mjs";import{createBindModel as te}from"../bindModel.mjs";import{hasTrackableSetupBinding as ne,touchSetupBinding as re}from"../setupTracking.mjs";import{createRuntimeContext as ie}from"./context.mjs";import{createDiagnosticsLogger as l}from"./diagnostics.mjs";import{createSetDataScheduler as u}from"./setData/scheduler.mjs";import{resolveSetDataOptions as ae}from"./setDataOptions.mjs";import{WEVU_ATTRS_KEY as oe,WEVU_PROPS_DERIVED_KEYS_KEY as d,WEVU_PROPS_KEY as f,WEVU_SETUP_STATE_KEY as p}from"@weapp-core/constants";function m(e,t){let n=(()=>{e()});return n.stop=()=>n(),n.pause=()=>{var e;t==null||(e=t.pause)==null||e.call(t)},n.resume=()=>{var e;t==null||(e=t.resume)==null||e.call(t)},n}function se(e){return typeof e==`function`?e():e==null?{}:e}function h(h){let{data:ce,resolvedComputed:le,resolvedMethods:ue,appConfig:de,setDataOptions:g,bindingManifest:_}=h;return h=>{var v;(g==null?void 0:g.strategy)===`patch`&&s(`patchStrategy`,`createRuntimeMount(setData.strategy="patch")`);let y=se(ce),b=h==null?void 0:h.__wevu_initialProps;if(y&&typeof y==`object`&&!c(y,f))try{Object.defineProperty(y,f,{value:i(Object.create(null)),configurable:!0,enumerable:!1,writable:!1})}catch(e){}let x=y&&typeof y==`object`?y[f]:void 0;x&&typeof x==`object`&&b&&typeof b==`object`&&Object.assign(x,b);let S=o(y),C=o(Object.create(null)),w=h==null?void 0:h.__wevu_snapshotOmitKeys,fe=!!(h!=null&&h.__wevu_deferInitialSnapshot),T=h==null?void 0:h.__wevu_initialSnapshot,E=h==null?void 0:h.__wevu_initialState,D=new Set(w instanceof Set||Array.isArray(w)?w:[]);if(y&&typeof y==`object`&&!c(y,p))try{Object.defineProperty(y,p,{value:C,configurable:!0,enumerable:!1,writable:!1})}catch(e){}if(y&&typeof y==`object`&&E&&typeof E==`object`)for(let[e,t]of Object.entries(E))D.has(e)||(y[e]=t);let pe=le,me=ue,O=!0,k=[],A=/* @__PURE__ */ new Set;Object.keys(S).forEach(e=>{let t=S[e];ne(t)&&A.add(e)});let{includeComputed:j,setDataStrategy:M,maxPatchKeys:N,maxPayloadBytes:P,mergeSiblingThreshold:F,mergeSiblingMaxInflationRatio:I,mergeSiblingMaxParentBytes:L,mergeSiblingSkipArray:R,computedCompare:z,computedCompareMaxDepth:he,computedCompareMaxKeys:ge,prelinkMaxDepth:_e,prelinkMaxKeys:ve,debug:B,diagnostics:V,loopWarning:H,debugWhen:ye,debugSampleRate:be,elevateTopKeyThreshold:xe,toPlainMaxDepth:Se,toPlainMaxKeys:Ce,includeFunctions:we,functionPaths:Te,shouldIncludeKey:Ee}=ae(g),U=l(V),W=V===`off`&&H?l(`fallback`):void 0,De=B||U||W?e=>{if(typeof B==`function`)try{B(e)}catch(e){}U==null||U(e),e.reason===`loopWarning`&&(W==null||W(e))}:void 0,Oe=V===`always`?`always`:ye,{boundMethods:ke,computedRefs:G,computedSetters:Ae,dirtyComputedKeys:je,computedProxy:Me,publicInstance:K,touchSetupMethodsVersion:q}=ie({state:S,setupState:C,computedDefs:pe,methodDefs:me,appConfig:de,includeComputed:j,setDataStrategy:M}),J=h==null?{setData:()=>{}}:h,Ne=J.__wevu_targetLabel,Y,X={state:S,setupState:C,snapshotOmitKeys:D,computedRefs:G,dirtyComputedKeys:je,includeComputed:j,setDataStrategy:M,computedCompare:z,computedCompareMaxDepth:he,computedCompareMaxKeys:ge,currentAdapter:J,shouldIncludeKey:Ee,maxPatchKeys:N,maxPayloadBytes:P,mergeSiblingThreshold:F,mergeSiblingMaxInflationRatio:I,mergeSiblingMaxParentBytes:L,mergeSiblingSkipArray:R,elevateTopKeyThreshold:xe,prelinkMaxDepth:_e,prelinkMaxKeys:ve,toPlainMaxDepth:Se,toPlainMaxKeys:Ce,includeFunctions:we,functionPaths:Te,debug:De,debugWhen:Oe,debugSampleRate:be,bindingManifest:_,loopWarning:H,targetLabel:Ne,runTracker:()=>Y==null?void 0:Y(),isMounted:()=>O,initialSnapshot:T&&typeof T==`object`?T:void 0,initialState:E&&typeof E==`object`?E:void 0},Z=M===`patch`?s(`patchStrategy`,`createRuntimeMount(setData.strategy="patch")`).createScheduler(X):u(X),Q=()=>Z.job();Y=t(()=>{r(S);let e=S[f];a(e)&&r(e);let t=S[oe];a(t)&&r(t),A.forEach(e=>{var t;let n=(t=C[e])==null?S[e]:t;re(n)})},{lazy:!0,scheduler:()=>e(Q)}),fe||Q(),k.push(m(()=>n(Y))),(v=Z.start)==null||v.call(Z),Z.dispose&&k.push(m(Z.dispose));function Pe(e,t,n){let r=ee(e,(e,n)=>t(e,n),n);return k.push(r),m(()=>{r();let e=k.indexOf(r);e>=0&&k.splice(e,1)},r)}let $={get state(){return S},get setupState(){return C},get proxy(){return K},get methods(){return ke},get computed(){return Me},get adapter(){return J},bindModel:te(K,S,G,Ae,C),watch:Pe,snapshot:()=>Z.snapshot(),unmount:()=>{var e;if(O){O=!1,(e=Z.dispose)==null||e.call(Z);try{var t;(t=J.__wevu_disposeSetData)==null||t.call(J)}catch(e){}k.forEach(e=>{try{e()}catch(e){}}),k.length=0}}};try{Object.defineProperty($,"__wevu_touchSetupMethodsVersion",{value:q,configurable:!0,enumerable:!1,writable:!1})}catch(e){$.__wevu_touchSetupMethodsVersion=q}try{Object.defineProperty($,"__wevu_flushSetupSnapshotSync",{value:Q,configurable:!0,enumerable:!1,writable:!1})}catch(e){$.__wevu_flushSetupSnapshotSync=Q}try{Object.defineProperty($,"__wevu_cloneDispatchedSnapshot",{value:Z.cloneLatestSnapshot,configurable:!0,enumerable:!1,writable:!1})}catch(e){$.__wevu_cloneDispatchedSnapshot=Z.cloneLatestSnapshot}try{Object.defineProperty($,"__wevu_trackSetupReactiveKey",{value:e=>{A.add(e)},configurable:!0,enumerable:!1,writable:!1})}catch(e){$.__wevu_trackSetupReactiveKey=e=>{A.add(e)}}try{Object.defineProperty($,d,{value:D,configurable:!0,enumerable:!1,writable:!1})}catch(e){$[d]=D}return $}}export{h as createRuntimeMount};
1
+ import{queueJob as e}from"../../scheduler.mjs";import{effect as t,stop as n}from"../../reactivity/core.mjs";import{touchReactive as r}from"../../reactivity/reactive/patch.mjs";import{shallowReactive as i}from"../../reactivity/reactive/shallow.mjs";import{isReactive as a,reactive as o}from"../../reactivity/reactive.mjs";import{watch as ee}from"../../reactivity/watch.mjs";import{requireRuntimeCapability as s}from"../capabilities.mjs";import{hasOwn as c}from"../../utils.mjs";import{createBindModel as te}from"../bindModel.mjs";import{hasTrackableSetupBinding as ne,touchSetupBinding as re}from"../setupTracking.mjs";import{createRuntimeContext as ie}from"./context.mjs";import{createDiagnosticsLogger as l}from"./diagnostics.mjs";import{createSetDataScheduler as ae}from"./setData/scheduler.mjs";import{resolveSetDataOptions as oe}from"./setDataOptions.mjs";import{WEVU_ATTRS_KEY as se,WEVU_PROPS_DERIVED_KEYS_KEY as u,WEVU_PROPS_KEY as d,WEVU_SETUP_STATE_KEY as f}from"@weapp-core/constants";function p(e,t){let n=(()=>{e()});return n.stop=()=>n(),n.pause=()=>{t?.pause?.()},n.resume=()=>{t?.resume?.()},n}function ce(e){return typeof e==`function`?e():e??{}}function m(m){let{data:le,resolvedComputed:ue,resolvedMethods:de,appConfig:h,setDataOptions:g,bindingManifest:_}=m;return m=>{g?.strategy===`patch`&&s(`patchStrategy`,`createRuntimeMount(setData.strategy="patch")`);let v=ce(le),y=m?.__wevu_initialProps;if(v&&typeof v==`object`&&!c(v,d))try{Object.defineProperty(v,d,{value:i(Object.create(null)),configurable:!0,enumerable:!1,writable:!1})}catch{}let b=v&&typeof v==`object`?v[d]:void 0;b&&typeof b==`object`&&y&&typeof y==`object`&&Object.assign(b,y);let x=o(v),S=o(Object.create(null)),C=m?.__wevu_snapshotOmitKeys,fe=!!m?.__wevu_deferInitialSnapshot,w=m?.__wevu_initialSnapshot,T=m?.__wevu_initialState,E=new Set(C instanceof Set||Array.isArray(C)?C:[]);if(v&&typeof v==`object`&&!c(v,f))try{Object.defineProperty(v,f,{value:S,configurable:!0,enumerable:!1,writable:!1})}catch{}if(v&&typeof v==`object`&&T&&typeof T==`object`)for(let[e,t]of Object.entries(T))E.has(e)||(v[e]=t);let pe=ue,me=de,D=!0,O=[],k=/* @__PURE__ */ new Set;Object.keys(x).forEach(e=>{let t=x[e];ne(t)&&k.add(e)});let{includeComputed:A,setDataStrategy:j,maxPatchKeys:M,maxPayloadBytes:N,mergeSiblingThreshold:P,mergeSiblingMaxInflationRatio:F,mergeSiblingMaxParentBytes:I,mergeSiblingSkipArray:L,computedCompare:R,computedCompareMaxDepth:z,computedCompareMaxKeys:he,prelinkMaxDepth:ge,prelinkMaxKeys:_e,debug:B,diagnostics:V,loopWarning:H,debugWhen:ve,debugSampleRate:ye,elevateTopKeyThreshold:be,toPlainMaxDepth:xe,toPlainMaxKeys:Se,includeFunctions:Ce,functionPaths:we,shouldIncludeKey:Te}=oe(g),U=l(V),W=V===`off`&&H?l(`fallback`):void 0,Ee=B||U||W?e=>{if(typeof B==`function`)try{B(e)}catch{}U?.(e),e.reason===`loopWarning`&&W?.(e)}:void 0,De=V===`always`?`always`:ve,{boundMethods:Oe,computedRefs:G,computedSetters:ke,dirtyComputedKeys:Ae,computedProxy:je,publicInstance:K,touchSetupMethodsVersion:q}=ie({state:x,setupState:S,computedDefs:pe,methodDefs:me,appConfig:h,includeComputed:A,setDataStrategy:j}),J=m??{setData:()=>{}},Me=J.__wevu_targetLabel,Y,X={state:x,setupState:S,snapshotOmitKeys:E,computedRefs:G,dirtyComputedKeys:Ae,includeComputed:A,setDataStrategy:j,computedCompare:R,computedCompareMaxDepth:z,computedCompareMaxKeys:he,currentAdapter:J,shouldIncludeKey:Te,maxPatchKeys:M,maxPayloadBytes:N,mergeSiblingThreshold:P,mergeSiblingMaxInflationRatio:F,mergeSiblingMaxParentBytes:I,mergeSiblingSkipArray:L,elevateTopKeyThreshold:be,prelinkMaxDepth:ge,prelinkMaxKeys:_e,toPlainMaxDepth:xe,toPlainMaxKeys:Se,includeFunctions:Ce,functionPaths:we,debug:Ee,debugWhen:De,debugSampleRate:ye,bindingManifest:_,loopWarning:H,targetLabel:Me,runTracker:()=>Y?.(),isMounted:()=>D,initialSnapshot:w&&typeof w==`object`?w:void 0,initialState:T&&typeof T==`object`?T:void 0},Z=j===`patch`?s(`patchStrategy`,`createRuntimeMount(setData.strategy="patch")`).createScheduler(X):ae(X),Q=()=>Z.job();Y=t(()=>{r(x);let e=x[d];a(e)&&r(e);let t=x[se];a(t)&&r(t),k.forEach(e=>{let t=S[e]??x[e];re(t)})},{lazy:!0,scheduler:()=>e(Q)}),fe||Q(),O.push(p(()=>n(Y))),Z.start?.(),Z.dispose&&O.push(p(Z.dispose));function Ne(e,t,n){let r=ee(e,(e,n)=>t(e,n),n);return O.push(r),p(()=>{r();let e=O.indexOf(r);e>=0&&O.splice(e,1)},r)}let $={get state(){return x},get setupState(){return S},get proxy(){return K},get methods(){return Oe},get computed(){return je},get adapter(){return J},bindModel:te(K,x,G,ke,S),watch:Ne,snapshot:()=>Z.snapshot(),unmount:()=>{if(D){D=!1,Z.dispose?.();try{J.__wevu_disposeSetData?.()}catch{}O.forEach(e=>{try{e()}catch{}}),O.length=0}}};try{Object.defineProperty($,"__wevu_touchSetupMethodsVersion",{value:q,configurable:!0,enumerable:!1,writable:!1})}catch{$.__wevu_touchSetupMethodsVersion=q}try{Object.defineProperty($,"__wevu_flushSetupSnapshotSync",{value:Q,configurable:!0,enumerable:!1,writable:!1})}catch{$.__wevu_flushSetupSnapshotSync=Q}try{Object.defineProperty($,"__wevu_cloneDispatchedSnapshot",{value:Z.cloneLatestSnapshot,configurable:!0,enumerable:!1,writable:!1})}catch{$.__wevu_cloneDispatchedSnapshot=Z.cloneLatestSnapshot}try{Object.defineProperty($,"__wevu_trackSetupReactiveKey",{value:e=>{k.add(e)},configurable:!0,enumerable:!1,writable:!1})}catch{$.__wevu_trackSetupReactiveKey=e=>{k.add(e)}}try{Object.defineProperty($,u,{value:E,configurable:!0,enumerable:!1,writable:!1})}catch{$[u]=E}return $}}export{m as createRuntimeMount};
@@ -1 +1 @@
1
- import{cloneSnapshotValue as e}from"./snapshot.mjs";const t=Promise.resolve();function n(e){return!(!e||typeof e!=`object`&&typeof e!=`function`||typeof e.then!=`function`)}function r(e){try{return e instanceof Error?e.message:String(e)}catch(e){return`<unprintable cause>`}}function i(e,t,n){let i=r(n),a=/* @__PURE__ */ Error(`[wevu] setData commit failed (${e===`adapter`?`adapter failure`:`out-of-order completion`}, revision=${t.revision}, mode=${t.mode}, kind=${t.kind}): ${i}`);return a.cause=n,a}function a(e){let t=!1,r=!0,i=!1,a=!1,o=(n,r)=>{t||(t=!0,e.settle(n,r))},s=()=>{if(r){i=!0;return}a||e.completion===`callback`&&o(`committed`)};try{let t=e.invoke(s),c=n(t);if(a=c,r=!1,c){t.then(()=>o(`committed`),e=>o(`failed`,e));return}(e.completion===`return`||i)&&o(`committed`)}catch(e){r=!1,o(`failed`,e)}}function o(n){let r=n.initialSnapshot?e(n.initialSnapshot):{},o=new Set(Object.keys(r)),s=0,c=0,l,u;function d(e){return e.inLedger?(e.commitPromise||(e.commitPromise=new Promise(t=>{e.resolveCommit=t})),e.commitPromise):t}let f={preparedSnapshot:r,dispatchedSnapshot:r,committedSnapshot:r,revision:0,committedRevision:0,failedRevision:void 0,needsFullSnapshot:!1,get commitPromise(){return u?d(u):t},disposed:!1},p=(e,t,r)=>{let a=i(e,t,r);try{n.onFailure({kind:e,revision:t.revision,committedRevision:f.committedRevision,mode:t.mode,cause:r,error:a,payloadKeys:t.payloadKeys,pendingPatchKeys:t.pendingPatchKeys})}catch(e){}},m=e=>{var t;(t=e.resolveCommit)==null||t.call(e),e.resolveCommit=void 0},h=e=>{let t=l;for(;t;){let n=t.next;if(t.inLedger=!1,t.next=void 0,m(t),t===e){l=n,l||(u=void 0);return}t=n}},g=()=>{let e=l;for(;e;){let t=e.next;e.inLedger=!1,e.next=void 0,e.physicalSettled||(e.status=`abandoned`),m(e),e=t}l=void 0,u=void 0,s+=1,c=f.committedRevision},_=()=>{f.needsFullSnapshot=!0},v=(e,t,n)=>{t.status=`failed`,f.failedRevision=t.revision,_(),g(),p(e,t,n)},y=()=>{for(;(l==null?void 0:l.status)===`succeeded`;){let e=l;f.committedSnapshot=e.snapshot,f.committedRevision=e.revision,l=e.next,e.inLedger=!1,e.next=void 0,m(e)}l||(u=void 0)},b=e=>{f.committedSnapshot=e.snapshot,f.committedRevision=e.revision,f.failedRevision=void 0,f.needsFullSnapshot=!1,h(e),y()},x=(e,t,n)=>{if(t===`failed`){p(`adapter`,e,n);return}t===`committed`&&f.committedRevision>e.revision&&(l&&g(),_(),p(`out-of-order`,e,`revision ${e.revision} completed after committed revision ${f.committedRevision}`))},S=(e,t,n)=>{if(!(f.disposed||e.physicalSettled)){if(e.physicalSettled=!0,!e.inLedger||e.epoch!==s){x(e,t,n);return}if(t===`abandoned`){e.status=`abandoned`,_(),g();return}if(t===`failed`){v(`adapter`,e,n);return}if(e.status=`succeeded`,c>e.revision){v(`out-of-order`,e,`revision ${e.revision} completed after revision ${c}`);return}if(c=e.revision,e.kind===`full`){b(e);return}y()}};return{state:f,dispatch:t=>{if(f.disposed)return f.revision;let r=f.revision+1;f.revision=r,f.preparedSnapshot=t.snapshot;let i={revision:r,epoch:s,mode:t.mode,kind:t.kind,snapshot:t.snapshot,payloadKeys:Object.keys(t.payload).length,pendingPatchKeys:t.pendingPatchKeys,status:`dispatched`,physicalSettled:!1,inLedger:!0,next:void 0};u?u.next=i:l=i,u=i,f.dispatchedSnapshot=t.snapshot;for(let e of Object.keys(t.payload))o.add(e.split(`.`,1)[0]);let c=(e,t)=>{S(i,e,t)},d=e(t.payload);if(typeof n.adapter.__wevu_dispatchSetData==`function`)try{n.adapter.__wevu_dispatchSetData(d,c)}catch(e){c(`failed`,e)}else a({invoke:()=>{var e,t;return(e=(t=n.adapter).setData)==null?void 0:e.call(t,d)},completion:`return`,settle:c});return r},createFullPayload:e=>{let t={},n=new Set(Object.keys(e));for(let[n,r]of Object.entries(e))t[n]=r===void 0?null:r;for(let e of o)n.has(e)||(t[e]=null);return t},dispose:()=>{f.disposed||(f.disposed=!0,g())}}}export{o as createSetDataCommitTracker,a as observeSetDataCompletion};
1
+ import{cloneSnapshotValue as e}from"./snapshot.mjs";const t=Promise.resolve();function n(e){return!(!e||typeof e!=`object`&&typeof e!=`function`||typeof e.then!=`function`)}function r(e){try{return e instanceof Error?e.message:String(e)}catch{return`<unprintable cause>`}}function i(e,t,n){let i=r(n),a=/* @__PURE__ */ Error(`[wevu] setData commit failed (${e===`adapter`?`adapter failure`:`out-of-order completion`}, revision=${t.revision}, mode=${t.mode}, kind=${t.kind}): ${i}`);return a.cause=n,a}function a(e){let t=!1,r=!0,i=!1,a=!1,o=(n,r)=>{t||(t=!0,e.settle(n,r))},s=()=>{if(r){i=!0;return}a||e.completion===`callback`&&o(`committed`)};try{let t=e.invoke(s),c=n(t);if(a=c,r=!1,c){t.then(()=>o(`committed`),e=>o(`failed`,e));return}(e.completion===`return`||i)&&o(`committed`)}catch(e){r=!1,o(`failed`,e)}}function o(n){let r=n.initialSnapshot?e(n.initialSnapshot):{},o=new Set(Object.keys(r)),s=0,c=0,l,u;function d(e){return e.inLedger?(e.commitPromise||(e.commitPromise=new Promise(t=>{e.resolveCommit=t})),e.commitPromise):t}let f={preparedSnapshot:r,dispatchedSnapshot:r,committedSnapshot:r,revision:0,committedRevision:0,failedRevision:void 0,needsFullSnapshot:!1,get commitPromise(){return u?d(u):t},disposed:!1},p=(e,t,r)=>{let a=i(e,t,r);try{n.onFailure({kind:e,revision:t.revision,committedRevision:f.committedRevision,mode:t.mode,cause:r,error:a,payloadKeys:t.payloadKeys,pendingPatchKeys:t.pendingPatchKeys})}catch{}},m=e=>{e.resolveCommit?.(),e.resolveCommit=void 0},h=e=>{let t=l;for(;t;){let n=t.next;if(t.inLedger=!1,t.next=void 0,m(t),t===e){l=n,l||(u=void 0);return}t=n}},g=()=>{let e=l;for(;e;){let t=e.next;e.inLedger=!1,e.next=void 0,e.physicalSettled||(e.status=`abandoned`),m(e),e=t}l=void 0,u=void 0,s+=1,c=f.committedRevision},_=()=>{f.needsFullSnapshot=!0},v=(e,t,n)=>{t.status=`failed`,f.failedRevision=t.revision,_(),g(),p(e,t,n)},y=()=>{for(;l?.status===`succeeded`;){let e=l;f.committedSnapshot=e.snapshot,f.committedRevision=e.revision,l=e.next,e.inLedger=!1,e.next=void 0,m(e)}l||(u=void 0)},b=e=>{f.committedSnapshot=e.snapshot,f.committedRevision=e.revision,f.failedRevision=void 0,f.needsFullSnapshot=!1,h(e),y()},x=(e,t,n)=>{if(t===`failed`){p(`adapter`,e,n);return}t===`committed`&&f.committedRevision>e.revision&&(l&&g(),_(),p(`out-of-order`,e,`revision ${e.revision} completed after committed revision ${f.committedRevision}`))},S=(e,t,n)=>{if(!(f.disposed||e.physicalSettled)){if(e.physicalSettled=!0,!e.inLedger||e.epoch!==s){x(e,t,n);return}if(t===`abandoned`){e.status=`abandoned`,_(),g();return}if(t===`failed`){v(`adapter`,e,n);return}if(e.status=`succeeded`,c>e.revision){v(`out-of-order`,e,`revision ${e.revision} completed after revision ${c}`);return}if(c=e.revision,e.kind===`full`){b(e);return}y()}};return{state:f,dispatch:t=>{if(f.disposed)return f.revision;let r=f.revision+1;f.revision=r,f.preparedSnapshot=t.snapshot;let i={revision:r,epoch:s,mode:t.mode,kind:t.kind,snapshot:t.snapshot,payloadKeys:Object.keys(t.payload).length,pendingPatchKeys:t.pendingPatchKeys,status:`dispatched`,physicalSettled:!1,inLedger:!0,next:void 0};u?u.next=i:l=i,u=i,f.dispatchedSnapshot=t.snapshot;for(let e of Object.keys(t.payload))o.add(e.split(`.`,1)[0]);let c=(e,t)=>{S(i,e,t)},d=e(t.payload);if(typeof n.adapter.__wevu_dispatchSetData==`function`)try{n.adapter.__wevu_dispatchSetData(d,c)}catch(e){c(`failed`,e)}else a({invoke:()=>n.adapter.setData?.(d),completion:`return`,settle:c});return r},createFullPayload:e=>{let t={},n=new Set(Object.keys(e));for(let[n,r]of Object.entries(e))t[n]=r===void 0?null:r;for(let e of o)n.has(e)||(t[e]=null);return t},dispose:()=>{f.disposed||(f.disposed=!0,g())}}}export{o as createSetDataCommitTracker,a as observeSetDataCompletion};
@@ -1 +1 @@
1
- import{toPlain as e}from"../../diff.mjs";import{applySnapshotUpdate as t,cloneSnapshotValue as n,isDeepEqualValue as r,isShallowEqualValue as i,normalizeSetDataValue as a}from"./snapshot.mjs";import{checkPayloadSize as o,collapsePayload as s,mergeSiblingPayload as c}from"./payload.mjs";function l(l){let{state:u,computedRefs:d,dirtyComputedKeys:f,includeComputed:p,computedCompare:m,computedCompareMaxDepth:h,computedCompareMaxKeys:g,shouldIncludeKey:_,maxPatchKeys:v,maxPayloadBytes:y,mergeSiblingThreshold:b,mergeSiblingMaxInflationRatio:x,mergeSiblingMaxParentBytes:S,mergeSiblingSkipArray:C,elevateTopKeyThreshold:w,toPlainMaxDepth:T,toPlainMaxKeys:E,includeFunctions:D=!1,functionPaths:O,plainCache:k,plainCacheEligibility:A,pendingPatches:j,fallbackTopKeys:M,dispatchedSnapshot:N,dispatchedComputedSnapshot:P}=l;if(j.size>v){let e=j.size;return j.clear(),f.clear(),{type:`fallback`,reason:`maxPatchKeys`,debug:{mode:`diff`,reason:`maxPatchKeys`,pendingPatchKeys:e,payloadKeys:0}}}let F=/* @__PURE__ */ new WeakMap,I=/* @__PURE__ */ new Map,L=Object.create(null),R=[...j.entries()];if(Number.isFinite(w)&&w>0){let e=/* @__PURE__ */ new Map;for(let[t]of R){var z;let n=t.split(`.`,1)[0];e.set(n,((z=e.get(n))==null?0:z)+1)}for(let[t,n]of e)n>=w&&M.add(t)}let B=R.filter(([e])=>{for(let t of M)if(e===t||e.startsWith(`${t}.`))return!1;return!0}),V=new Map(B);j.clear();let H=e=>{let t=e.split(`.`).filter(Boolean),n=u;for(let e of t){if(typeof n!=`object`||!n)return n;n=Reflect.get(n,e)}return n},U=t=>{if(I.has(t))return I.get(t);let n=a(e(H(t),F,{cache:k,cacheEligibility:A,maxDepth:T,maxKeys:E,includeFunctions:D,functionPaths:O,_path:t}));return I.set(t,n),n};if(M.size){for(let e of M)_(e)&&(L[e]=U(e),V.set(e,{kind:`property`,op:`set`}));M.clear()}for(let[e,t]of B)L[e]=(t.kind===`array`?`set`:t.op)===`delete`?null:U(e);let W=0,G=Object.create(null);if(p&&f.size){let t=[...f];f.clear(),W=t.length;for(let o of t){if(!_(o))continue;let t=e(d[o].value,F,{cache:k,cacheEligibility:A,maxDepth:T,maxKeys:E,includeFunctions:D,functionPaths:O,_path:o}),s=P[o];(m===`deep`?r(s,t,h,{keys:g}):m===`shallow`?i(s,t):Object.is(s,t))||(L[o]=a(t),G[o]=n(t))}}let K=s(L),q=0;if(b){let e=c({input:K,entryMap:V,getPlainByPath:U,mergeSiblingThreshold:b,mergeSiblingSkipArray:C,mergeSiblingMaxParentBytes:S,mergeSiblingMaxInflationRatio:x});q=e.merged,K=s(e.out)}let J=o(K,y),Y=Object.keys(K).length,X={mode:J.fallback?`diff`:`patch`,reason:J.fallback?`maxPayloadBytes`:`patch`,pendingPatchKeys:B.length,payloadKeys:Y,mergedSiblingParents:q||void 0,computedDirtyKeys:W||void 0,estimatedBytes:J.estimatedBytes,bytes:J.bytes};if(J.fallback)return{type:`fallback`,reason:`maxPayloadBytes`,debug:X};if(!Y)return;let Z={...N},Q=/* @__PURE__ */ new WeakSet;for(let[e,n]of Object.entries(K)){var $;let r=V.get(e);t(Z,e,n,(r==null?void 0:r.kind)===`array`||($=r==null?void 0:r.op)==null?`set`:$,{cloneValue:!1,clonedParents:Q})}return{type:`patch`,payload:K,snapshot:Z,computedUpdates:Object.keys(G).length?G:void 0,debug:X}}export{l as preparePatchUpdate};
1
+ import{toPlain as e}from"../../diff.mjs";import{applySnapshotUpdate as t,cloneSnapshotValue as n,isDeepEqualValue as r,isShallowEqualValue as i,normalizeSetDataValue as a}from"./snapshot.mjs";import{checkPayloadSize as o,collapsePayload as s,mergeSiblingPayload as c}from"./payload.mjs";function l(l){let{state:u,computedRefs:d,dirtyComputedKeys:f,includeComputed:p,computedCompare:m,computedCompareMaxDepth:h,computedCompareMaxKeys:g,shouldIncludeKey:_,maxPatchKeys:v,maxPayloadBytes:y,mergeSiblingThreshold:b,mergeSiblingMaxInflationRatio:x,mergeSiblingMaxParentBytes:S,mergeSiblingSkipArray:C,elevateTopKeyThreshold:w,toPlainMaxDepth:T,toPlainMaxKeys:E,includeFunctions:D=!1,functionPaths:O,plainCache:k,plainCacheEligibility:A,pendingPatches:j,fallbackTopKeys:M,dispatchedSnapshot:N,dispatchedComputedSnapshot:P}=l;if(j.size>v){let e=j.size;return j.clear(),f.clear(),{type:`fallback`,reason:`maxPatchKeys`,debug:{mode:`diff`,reason:`maxPatchKeys`,pendingPatchKeys:e,payloadKeys:0}}}let F=/* @__PURE__ */ new WeakMap,I=/* @__PURE__ */ new Map,L=Object.create(null),R=[...j.entries()];if(Number.isFinite(w)&&w>0){let e=/* @__PURE__ */ new Map;for(let[t]of R){let n=t.split(`.`,1)[0];e.set(n,(e.get(n)??0)+1)}for(let[t,n]of e)n>=w&&M.add(t)}let z=R.filter(([e])=>{for(let t of M)if(e===t||e.startsWith(`${t}.`))return!1;return!0}),B=new Map(z);j.clear();let V=e=>{let t=e.split(`.`).filter(Boolean),n=u;for(let e of t){if(typeof n!=`object`||!n)return n;n=Reflect.get(n,e)}return n},H=t=>{if(I.has(t))return I.get(t);let n=a(e(V(t),F,{cache:k,cacheEligibility:A,maxDepth:T,maxKeys:E,includeFunctions:D,functionPaths:O,_path:t}));return I.set(t,n),n};if(M.size){for(let e of M)_(e)&&(L[e]=H(e),B.set(e,{kind:`property`,op:`set`}));M.clear()}for(let[e,t]of z)L[e]=(t.kind===`array`?`set`:t.op)===`delete`?null:H(e);let U=0,W=Object.create(null);if(p&&f.size){let t=[...f];f.clear(),U=t.length;for(let o of t){if(!_(o))continue;let t=e(d[o].value,F,{cache:k,cacheEligibility:A,maxDepth:T,maxKeys:E,includeFunctions:D,functionPaths:O,_path:o}),s=P[o];(m===`deep`?r(s,t,h,{keys:g}):m===`shallow`?i(s,t):Object.is(s,t))||(L[o]=a(t),W[o]=n(t))}}let G=s(L),K=0;if(b){let e=c({input:G,entryMap:B,getPlainByPath:H,mergeSiblingThreshold:b,mergeSiblingSkipArray:C,mergeSiblingMaxParentBytes:S,mergeSiblingMaxInflationRatio:x});K=e.merged,G=s(e.out)}let q=o(G,y),J=Object.keys(G).length,Y={mode:q.fallback?`diff`:`patch`,reason:q.fallback?`maxPayloadBytes`:`patch`,pendingPatchKeys:z.length,payloadKeys:J,mergedSiblingParents:K||void 0,computedDirtyKeys:U||void 0,estimatedBytes:q.estimatedBytes,bytes:q.bytes};if(q.fallback)return{type:`fallback`,reason:`maxPayloadBytes`,debug:Y};if(!J)return;let X={...N},Z=/* @__PURE__ */ new WeakSet;for(let[e,n]of Object.entries(G)){let r=B.get(e);t(X,e,n,r?.kind===`array`?`set`:r?.op??`set`,{cloneValue:!1,clonedParents:Z})}return{type:`patch`,payload:G,snapshot:X,computedUpdates:Object.keys(W).length?W:void 0,debug:Y}}export{l as preparePatchUpdate};
@@ -1 +1 @@
1
- import{hasOwn as e}from"../../../utils.mjs";function t(e){let t=Object.keys(e).sort();if(t.length<=1)return e;let n={},r=[];for(let i of t){for(;r.length;){let e=r[r.length-1];if(i.startsWith(e))break;r.pop()}r.length||(n[i]=e[i],r.push(`${i}.`))}return n}function n(e,t,r){if(t<=0)return t+1;if(e===null)return 4;let i=typeof e;if(i===`string`)return 2+e.length;if(i===`number`)return Number.isFinite(e)?String(e).length:4;if(i===`boolean`)return e?4:5;if(i===`undefined`||i===`function`||i===`symbol`||i!==`object`||r.has(e))return 4;if(r.add(e),Array.isArray(e)){let i=2;for(let a=0;a<e.length;a++)if(a&&(i+=1),i+=n(e[a],t-i,r),i>t)return i;return i}let a=2;for(let[i,o]of Object.entries(e))if(a>2&&(a+=1),a+=2+i.length+1,a+=n(o,t-a,r),a>t)return a;return a}function r(e,t){if(t===1/0)return{fallback:!1,estimatedBytes:void 0,bytes:void 0};let r=t,i=Object.keys(e).length,a=n(e,r+1,/* @__PURE__ */ new WeakSet);if(a>r)return{fallback:!0,estimatedBytes:a,bytes:void 0};if(a>=r*.85&&i>2)try{let t=JSON.stringify(e).length;return{fallback:t>r,estimatedBytes:a,bytes:t}}catch(e){return{fallback:!1,estimatedBytes:a,bytes:void 0}}return{fallback:!1,estimatedBytes:a,bytes:void 0}}function i(t){let{input:r,entryMap:i,getPlainByPath:a,mergeSiblingThreshold:o,mergeSiblingSkipArray:s,mergeSiblingMaxParentBytes:c,mergeSiblingMaxInflationRatio:l}=t;if(!o)return{out:r,merged:0};let u=Object.keys(r);if(u.length<o)return{out:r,merged:0};let d=/* @__PURE__ */ new Map,f=/* @__PURE__ */ new Set;for(let e of u){var p;let t=i.get(e);if(!t)continue;if(r[e]===null||t.op===`delete`){let t=e.lastIndexOf(`.`);t>0&&f.add(e.slice(0,t));continue}let n=e.lastIndexOf(`.`);if(n<=0)continue;let a=e.slice(0,n),o=(p=d.get(a))==null?[]:p;o.push(e),d.set(a,o)}let m=[...d.entries()].filter(([e,t])=>t.length>=o&&!f.has(e)).sort((e,t)=>t[0].split(`.`).length-e[0].split(`.`).length);if(!m.length)return{out:r,merged:0};let h={};Object.assign(h,r);let g=0,_=/* @__PURE__ */ new WeakMap,v=e=>{if(e&&typeof e==`object`){let t=_.get(e);if(t!==void 0)return t;let r=n(e,1/0,/* @__PURE__ */ new WeakSet);return _.set(e,r),r}return n(e,1/0,/* @__PURE__ */ new WeakSet)},y=(e,t)=>2+e.length+1+v(t);for(let[t,n]of m){if(e(h,t))continue;let r=n.filter(t=>e(h,t));if(r.length<o)continue;let i=a(t);if(!(s&&Array.isArray(i))&&!(c!==1/0&&y(t,i)>c)){if(l!==1/0){let e=0;for(let t of r)e+=y(t,h[t]);if(y(t,i)>e*l)continue}h[t]=i;for(let e of r)delete h[e];g+=1}}return{out:h,merged:g}}export{r as checkPayloadSize,t as collapsePayload,n as estimateJsonSize,i as mergeSiblingPayload};
1
+ import{hasOwn as e}from"../../../utils.mjs";function t(e){let t=Object.keys(e).sort();if(t.length<=1)return e;let n={},r=[];for(let i of t){for(;r.length;){let e=r[r.length-1];if(i.startsWith(e))break;r.pop()}r.length||(n[i]=e[i],r.push(`${i}.`))}return n}function n(e,t,r){if(t<=0)return t+1;if(e===null)return 4;let i=typeof e;if(i===`string`)return 2+e.length;if(i===`number`)return Number.isFinite(e)?String(e).length:4;if(i===`boolean`)return e?4:5;if(i===`undefined`||i===`function`||i===`symbol`||i!==`object`||r.has(e))return 4;if(r.add(e),Array.isArray(e)){let i=2;for(let a=0;a<e.length;a++)if(a&&(i+=1),i+=n(e[a],t-i,r),i>t)return i;return i}let a=2;for(let[i,o]of Object.entries(e))if(a>2&&(a+=1),a+=2+i.length+1,a+=n(o,t-a,r),a>t)return a;return a}function r(e,t){if(t===1/0)return{fallback:!1,estimatedBytes:void 0,bytes:void 0};let r=t,i=Object.keys(e).length,a=n(e,r+1,/* @__PURE__ */ new WeakSet);if(a>r)return{fallback:!0,estimatedBytes:a,bytes:void 0};if(a>=r*.85&&i>2)try{let t=JSON.stringify(e).length;return{fallback:t>r,estimatedBytes:a,bytes:t}}catch{return{fallback:!1,estimatedBytes:a,bytes:void 0}}return{fallback:!1,estimatedBytes:a,bytes:void 0}}function i(t){let{input:r,entryMap:i,getPlainByPath:a,mergeSiblingThreshold:o,mergeSiblingSkipArray:s,mergeSiblingMaxParentBytes:c,mergeSiblingMaxInflationRatio:l}=t;if(!o)return{out:r,merged:0};let u=Object.keys(r);if(u.length<o)return{out:r,merged:0};let d=/* @__PURE__ */ new Map,f=/* @__PURE__ */ new Set;for(let e of u){let t=i.get(e);if(!t)continue;if(r[e]===null||t.op===`delete`){let t=e.lastIndexOf(`.`);t>0&&f.add(e.slice(0,t));continue}let n=e.lastIndexOf(`.`);if(n<=0)continue;let a=e.slice(0,n),o=d.get(a)??[];o.push(e),d.set(a,o)}let p=[...d.entries()].filter(([e,t])=>t.length>=o&&!f.has(e)).sort((e,t)=>t[0].split(`.`).length-e[0].split(`.`).length);if(!p.length)return{out:r,merged:0};let m={};Object.assign(m,r);let h=0,g=/* @__PURE__ */ new WeakMap,_=e=>{if(e&&typeof e==`object`){let t=g.get(e);if(t!==void 0)return t;let r=n(e,1/0,/* @__PURE__ */ new WeakSet);return g.set(e,r),r}return n(e,1/0,/* @__PURE__ */ new WeakSet)},v=(e,t)=>2+e.length+1+_(t);for(let[t,n]of p){if(e(m,t))continue;let r=n.filter(t=>e(m,t));if(r.length<o)continue;let i=a(t);if(!(s&&Array.isArray(i))&&!(c!==1/0&&v(t,i)>c)){if(l!==1/0){let e=0;for(let t of r)e+=v(t,m[t]);if(v(t,i)>e*l)continue}m[t]=i;for(let e of r)delete m[e];h+=1}}return{out:m,merged:h}}export{r as checkPayloadSize,t as collapsePayload,n as estimateJsonSize,i as mergeSiblingPayload};
@@ -1 +1 @@
1
- import{toRaw as e}from"../../../reactivity/reactive/shared.mjs";import{getReactiveVersion as t,isReactive as n}from"../../../reactivity/reactive.mjs";import{isRef as r}from"../../../reactivity/ref.mjs";import{hasOwn as i}from"../../../utils.mjs";import{hasTrackableSetupBinding as a}from"../../setupTracking.mjs";import{resolveBindingDiagnostics as o}from"../../bindingManifest.mjs";import{diffSnapshots as s,toPlain as c}from"../../diff.mjs";import{collectSnapshot as l}from"./snapshot.mjs";import{createSetDataCommitTracker as u}from"./commitTracker.mjs";function d(d){let{state:f,setupState:p,snapshotOmitKeys:m,computedRefs:h,dirtyComputedKeys:g,includeComputed:_,setDataStrategy:v,currentAdapter:y,shouldIncludeKey:b,toPlainMaxDepth:x,toPlainMaxKeys:S,includeFunctions:C=!1,functionPaths:w,debug:T,debugWhen:E,debugSampleRate:D,bindingManifest:O,loopWarning:k,targetLabel:A,runTracker:j,isMounted:M,initialSnapshot:N,initialState:P}=d,F=/* @__PURE__ */ new WeakMap,I=/* @__PURE__ */ new WeakMap,L={},R=Object.create(null),z=Object.create(null),B=[],V=-1/0,H=new Set(P&&typeof P==`object`?Object.keys(P):[]),U=e=>{if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype},W=(e,t)=>{if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>W(e,t[n]));if(U(e)&&U(t)){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>i(t,n)&&W(e[n],t[n]))}return!1},G=i=>{let o=r(i)?i.value:i;if(typeof o!=`object`||!o)return o;if(!n(o)&&a(o))return{snapshot:c(o,/* @__PURE__ */ new WeakMap,{cacheEligibility:I,maxDepth:x,maxKeys:S,includeFunctions:C,functionPaths:w})};let s=n(o)?e(o):o;return{raw:s,version:t(s)}},K=(e,t)=>Object.is(e,t)?!0:!e||!t||typeof e!=`object`||typeof t!=`object`||!i(e,`raw`)||!i(t,`raw`)?e&&t&&typeof e==`object`&&typeof t==`object`&&i(e,`snapshot`)&&i(t,`snapshot`)?W(e.snapshot,t.snapshot):!1:e.raw===t.raw&&e.version===t.version,q=e=>b(e)&&!(m!=null&&m.has(e));if(N)for(let[e,t]of Object.entries(N))q(e)&&(L[e]=t);let J=()=>{if(!N)return;let t=n(f)?e(f):f,r=p&&typeof p==`object`?n(p)?e(p):p:void 0;for(let e of Object.keys(N))if(q(e)){if(r&&i(r,e)){R[e]=G(r[e]);continue}if(i(t,e)){if(H.has(e))continue;t[e]=N[e],R[e]=G(t[e])}}},ee=t=>{let a=[],o=p&&typeof p==`object`?n(p)?e(p):p:void 0;for(let n of/* @__PURE__ */ new Set([...Object.keys(f),...o?Object.keys(o):[]])){if(!q(n))continue;let s=o&&i(o,n)?o[n]:f[n],c=r(s)?s.value:s;c&&typeof c==`object`&&e(c)===t&&a.push(n)}return a},Y=(e,t)=>{if(!T)return;let n=e.reason!==`patch`&&e.reason!==`diff`;if(E===`fallback`&&!n||e.reason!==`commitFailure`&&D<1&&Math.random()>D)return;let r=e;if(O){let n=typeof t==`function`?t():t==null?[]:t,i=e.reason===`needsFullSnapshot`||e.reason===`maxPatchKeys`||e.reason===`maxPayloadBytes`;r={...e,bindings:o(O,n,i)}}try{T(r)}catch(e){}},X=u({initialSnapshot:L,adapter:y,onFailure:e=>{Y({mode:e.mode,reason:`commitFailure`,pendingPatchKeys:e.pendingPatchKeys,payloadKeys:e.payloadKeys,revision:e.revision,committedRevision:e.committedRevision,targetLabel:A,message:e.error.message});try{var t;(t=y.__wevu_reportSetDataError)==null||t.call(y,e.error)}catch(e){}}}),te=(e=0,t)=>{if(!k)return;let n=Date.now();B.push(n);let r=n-k.sampleWindowMs;for(;B.length&&B[0]<r;)B.shift();B.length<=k.maxFlushes||k.coolDownMs>0&&n-V<k.coolDownMs||(V=n,Y({mode:v,reason:`loopWarning`,pendingPatchKeys:e,payloadKeys:0,computedDirtyKeys:_?g.size:0,flushCount:B.length,windowMs:k.sampleWindowMs,targetLabel:A,message:`${A?`${A} `:``}疑似运行时更新循环:${B.length} 次 setData flush/${k.sampleWindowMs}ms`},t))},Z=()=>l({state:f,setupState:p,computedRefs:h,includeComputed:_,shouldIncludeKey:q,plainCache:F,plainCacheEligibility:I,toPlainMaxDepth:x,toPlainMaxKeys:S,includeFunctions:C,functionPaths:w});J();let ne=()=>{let t=n(f)?e(f):f,r=p&&typeof p==`object`?n(p)?e(p):p:void 0,a=X.state.dispatchedSnapshot,o={...a},s=/* @__PURE__ */ new WeakMap,l=/* @__PURE__ */ new Set,u=/* @__PURE__ */ new Set,d=/* @__PURE__ */ new Set;for(let e of/* @__PURE__ */ new Set([...Object.keys(t),...r?Object.keys(r):[]])){if(!q(e))continue;l.add(e);let n=r&&i(r,e)?r:t,u=G(n[e]),f=R[e];f&&u&&typeof f==`object`&&typeof u==`object`&&i(f,`raw`)&&i(u,`raw`)&&Array.isArray(f.raw)&&Array.isArray(u.raw)&&f.raw!==u.raw&&d.add(e),(!K(f,u)||!i(a,e))&&(o[e]=c(n[e],s,{cache:F,cacheEligibility:I,maxDepth:x,maxKeys:S,includeFunctions:C,functionPaths:w,_path:e})),R[e]=u}for(let e of Object.keys(R))l.has(e)||(delete R[e],(!_||!i(h,e))&&delete o[e]);if(!_){for(let e of Object.keys(z))delete z[e];return{snapshot:o,replacedTopLevelKeys:d}}for(let e of Object.keys(h)){if(!q(e))continue;u.add(e);let t=h[e].value,n=G(t);(!K(z[e],n)||!i(a,e))&&(o[e]=c(t,s,{cache:F,cacheEligibility:I,maxDepth:x,maxKeys:S,includeFunctions:C,functionPaths:w,_path:e})),z[e]=n}for(let e of Object.keys(z))u.has(e)||(delete z[e],(!i(t,e)||!q(e))&&delete o[e]);return{snapshot:o,replacedTopLevelKeys:d}},Q=(e=`diff`,t=0,n)=>{var r;let i=v===`diff`?ne():void 0,a=(r=i==null?void 0:i.snapshot)==null?Z():r,o=X.state.dispatchedSnapshot,c=X.state.needsFullSnapshot,l=c?X.createFullPayload(a):i?(()=>{let e={};for(let t of i.replacedTopLevelKeys)e[t]=a[t];return{...s(o,a,{skipKeys:i.replacedTopLevelKeys}),...e}})():s(o,a);n==null||n(a);let u=Object.keys(l).length;if(!u&&!c)return;let d=c?`needsFullSnapshot`:e;Y({mode:`diff`,reason:d,pendingPatchKeys:t,payloadKeys:u},Object.keys(l)),X.dispatch({mode:`diff`,kind:c?`full`:`delta`,reason:d,snapshot:a,payload:l,pendingPatchKeys:t})},$=(e=0,t)=>M()?(te(e,t),j(),!0):!1;return{collect:Z,emitDebug:Y,getLatestSnapshot:()=>X.state.dispatchedSnapshot,dispatchUpdate:X.dispatch,needsFullSnapshot:()=>X.state.needsFullSnapshot,job:e=>{if($())return Q(`diff`)},plainCache:F,plainCacheEligibility:I,prepareJob:$,resolveTopKeysByRoot:ee,runDiffUpdate:Q,shouldIncludeSnapshotKey:q,snapshot:()=>v===`patch`?Z():{...X.state.dispatchedSnapshot},cloneLatestSnapshot:()=>({...X.state.dispatchedSnapshot}),dispose:X.dispose}}export{d as createSetDataScheduler};
1
+ import{toRaw as e}from"../../../reactivity/reactive/shared.mjs";import{getReactiveVersion as t,isReactive as n}from"../../../reactivity/reactive.mjs";import{isRef as r}from"../../../reactivity/ref.mjs";import{hasOwn as i}from"../../../utils.mjs";import{hasTrackableSetupBinding as a}from"../../setupTracking.mjs";import{resolveBindingDiagnostics as o}from"../../bindingManifest.mjs";import{diffSnapshots as s,toPlain as c}from"../../diff.mjs";import{collectSnapshot as l}from"./snapshot.mjs";import{createSetDataCommitTracker as u}from"./commitTracker.mjs";function d(d){let{state:f,setupState:p,snapshotOmitKeys:m,computedRefs:h,dirtyComputedKeys:g,includeComputed:_,setDataStrategy:v,currentAdapter:y,shouldIncludeKey:b,toPlainMaxDepth:x,toPlainMaxKeys:S,includeFunctions:C=!1,functionPaths:w,debug:T,debugWhen:ee,debugSampleRate:E,bindingManifest:D,loopWarning:O,targetLabel:k,runTracker:A,isMounted:j,initialSnapshot:M,initialState:N}=d,P=/* @__PURE__ */ new WeakMap,F=/* @__PURE__ */ new WeakMap,I={},L=Object.create(null),R=Object.create(null),z=[],B=-1/0,V=new Set(N&&typeof N==`object`?Object.keys(N):[]),H=e=>{if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype},U=(e,t)=>{if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>U(e,t[n]));if(H(e)&&H(t)){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>i(t,n)&&U(e[n],t[n]))}return!1},W=i=>{let o=r(i)?i.value:i;if(typeof o!=`object`||!o)return o;if(!n(o)&&a(o))return{snapshot:c(o,/* @__PURE__ */ new WeakMap,{cacheEligibility:F,maxDepth:x,maxKeys:S,includeFunctions:C,functionPaths:w})};let s=n(o)?e(o):o;return{raw:s,version:t(s)}},G=(e,t)=>Object.is(e,t)?!0:!e||!t||typeof e!=`object`||typeof t!=`object`||!i(e,`raw`)||!i(t,`raw`)?e&&t&&typeof e==`object`&&typeof t==`object`&&i(e,`snapshot`)&&i(t,`snapshot`)?U(e.snapshot,t.snapshot):!1:e.raw===t.raw&&e.version===t.version,K=e=>b(e)&&!m?.has(e);if(M)for(let[e,t]of Object.entries(M))K(e)&&(I[e]=t);let q=()=>{if(!M)return;let t=n(f)?e(f):f,r=p&&typeof p==`object`?n(p)?e(p):p:void 0;for(let e of Object.keys(M))if(K(e)){if(r&&i(r,e)){L[e]=W(r[e]);continue}if(i(t,e)){if(V.has(e))continue;t[e]=M[e],L[e]=W(t[e])}}},J=t=>{let a=[],o=p&&typeof p==`object`?n(p)?e(p):p:void 0;for(let n of/* @__PURE__ */ new Set([...Object.keys(f),...o?Object.keys(o):[]])){if(!K(n))continue;let s=o&&i(o,n)?o[n]:f[n],c=r(s)?s.value:s;c&&typeof c==`object`&&e(c)===t&&a.push(n)}return a},Y=(e,t)=>{if(!T)return;let n=e.reason!==`patch`&&e.reason!==`diff`;if(ee===`fallback`&&!n||e.reason!==`commitFailure`&&E<1&&Math.random()>E)return;let r=e;if(D){let n=typeof t==`function`?t():t??[],i=e.reason===`needsFullSnapshot`||e.reason===`maxPatchKeys`||e.reason===`maxPayloadBytes`;r={...e,bindings:o(D,n,i)}}try{T(r)}catch{}},X=u({initialSnapshot:I,adapter:y,onFailure:e=>{Y({mode:e.mode,reason:`commitFailure`,pendingPatchKeys:e.pendingPatchKeys,payloadKeys:e.payloadKeys,revision:e.revision,committedRevision:e.committedRevision,targetLabel:k,message:e.error.message});try{y.__wevu_reportSetDataError?.(e.error)}catch{}}}),te=(e=0,t)=>{if(!O)return;let n=Date.now();z.push(n);let r=n-O.sampleWindowMs;for(;z.length&&z[0]<r;)z.shift();z.length<=O.maxFlushes||O.coolDownMs>0&&n-B<O.coolDownMs||(B=n,Y({mode:v,reason:`loopWarning`,pendingPatchKeys:e,payloadKeys:0,computedDirtyKeys:_?g.size:0,flushCount:z.length,windowMs:O.sampleWindowMs,targetLabel:k,message:`${k?`${k} `:``}疑似运行时更新循环:${z.length} 次 setData flush/${O.sampleWindowMs}ms`},t))},Z=()=>l({state:f,setupState:p,computedRefs:h,includeComputed:_,shouldIncludeKey:K,plainCache:P,plainCacheEligibility:F,toPlainMaxDepth:x,toPlainMaxKeys:S,includeFunctions:C,functionPaths:w});q();let ne=()=>{let t=n(f)?e(f):f,r=p&&typeof p==`object`?n(p)?e(p):p:void 0,a=X.state.dispatchedSnapshot,o={...a},s=/* @__PURE__ */ new WeakMap,l=/* @__PURE__ */ new Set,u=/* @__PURE__ */ new Set,d=/* @__PURE__ */ new Set;for(let e of/* @__PURE__ */ new Set([...Object.keys(t),...r?Object.keys(r):[]])){if(!K(e))continue;l.add(e);let n=r&&i(r,e)?r:t,u=W(n[e]),f=L[e];f&&u&&typeof f==`object`&&typeof u==`object`&&i(f,`raw`)&&i(u,`raw`)&&Array.isArray(f.raw)&&Array.isArray(u.raw)&&f.raw!==u.raw&&d.add(e),(!G(f,u)||!i(a,e))&&(o[e]=c(n[e],s,{cache:P,cacheEligibility:F,maxDepth:x,maxKeys:S,includeFunctions:C,functionPaths:w,_path:e})),L[e]=u}for(let e of Object.keys(L))l.has(e)||(delete L[e],(!_||!i(h,e))&&delete o[e]);if(!_){for(let e of Object.keys(R))delete R[e];return{snapshot:o,replacedTopLevelKeys:d}}for(let e of Object.keys(h)){if(!K(e))continue;u.add(e);let t=h[e].value,n=W(t);(!G(R[e],n)||!i(a,e))&&(o[e]=c(t,s,{cache:P,cacheEligibility:F,maxDepth:x,maxKeys:S,includeFunctions:C,functionPaths:w,_path:e})),R[e]=n}for(let e of Object.keys(R))u.has(e)||(delete R[e],(!i(t,e)||!K(e))&&delete o[e]);return{snapshot:o,replacedTopLevelKeys:d}},Q=(e=`diff`,t=0,n)=>{let r=v===`diff`?ne():void 0,i=r?.snapshot??Z(),a=X.state.dispatchedSnapshot,o=X.state.needsFullSnapshot,c=o?X.createFullPayload(i):r?(()=>{let e={};for(let t of r.replacedTopLevelKeys)e[t]=i[t];return{...s(a,i,{skipKeys:r.replacedTopLevelKeys}),...e}})():s(a,i);n?.(i);let l=Object.keys(c).length;if(!l&&!o)return;let u=o?`needsFullSnapshot`:e;Y({mode:`diff`,reason:u,pendingPatchKeys:t,payloadKeys:l},Object.keys(c)),X.dispatch({mode:`diff`,kind:o?`full`:`delta`,reason:u,snapshot:i,payload:c,pendingPatchKeys:t})},$=(e=0,t)=>j()?(te(e,t),A(),!0):!1;return{collect:Z,emitDebug:Y,getLatestSnapshot:()=>X.state.dispatchedSnapshot,dispatchUpdate:X.dispatch,needsFullSnapshot:()=>X.state.needsFullSnapshot,job:e=>{if($())return Q(`diff`)},plainCache:P,plainCacheEligibility:F,prepareJob:$,resolveTopKeysByRoot:J,runDiffUpdate:Q,shouldIncludeSnapshotKey:K,snapshot:()=>v===`patch`?Z():{...X.state.dispatchedSnapshot},cloneLatestSnapshot:()=>({...X.state.dispatchedSnapshot}),dispose:X.dispose}}export{d as createSetDataScheduler};
@@ -1 +1 @@
1
- import{toRaw as e}from"../../../reactivity/reactive/shared.mjs";import{isReactive as t}from"../../../reactivity/reactive.mjs";import{hasOwn as n}from"../../../utils.mjs";import{toPlain as r}from"../../diff.mjs";function i(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function a(e){return e===void 0?null:e}function o(e){if(Array.isArray(e))return e.map(e=>o(e));if(!i(e))return e;let t={};for(let n of Object.keys(e))t[n]=o(e[n]);return t}function s(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}if(!i(e)||!i(t))return!1;let r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(let i of r)if(!n(t,i)||!Object.is(e[i],t[i]))return!1;return!0}function c(e,t,r,a){if(Object.is(e,t))return!0;if(r<=0)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!c(e[n],t[n],r-1,a))return!1;return!0}if(!i(e)||!i(t))return!1;let o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;for(let i of o)if(--a.keys,a.keys<=0||!n(t,i)||!c(e[i],t[i],r-1,a))return!1;return!0}function l(e,t,n,r,i){var a;let s=(a=i==null?void 0:i.cloneValue)==null||a,c=i==null?void 0:i.clonedParents,l=t.split(`.`).filter(Boolean);if(!l.length)return;c==null||c.add(e);let u=e;for(let e=0;e<l.length-1;e++){let t=l[e],n=u[t];if(typeof n!=`object`||!n)u[t]={},c==null||c.add(u[t]);else if(c&&!c.has(n)){let e=Array.isArray(n)?n.slice():{...n};u[t]=e,c.add(e)}u=u[t]}let d=l[l.length-1];if(r===`delete`)try{delete u[d]}catch(e){u[d]=null}else u[d]=s?o(n):n}function u(n){let{state:i,setupState:a,computedRefs:o,includeComputed:s,shouldIncludeKey:c,plainCache:l,plainCacheEligibility:u,toPlainMaxDepth:d,toPlainMaxKeys:f,includeFunctions:p=!1,functionPaths:m=[]}=n,h=/* @__PURE__ */ new WeakMap,g={},_=Number.isFinite(f)?{keys:f}:void 0,v=t(i)?e(i):i,y=a&&typeof a==`object`?t(a)?e(a):a:void 0,b=Object.keys(v),x=y?Object.keys(y):[],S=s?Object.keys(o):[];for(let e of b)c(e)&&(g[e]=r(v[e],h,{cache:l,cacheEligibility:u,maxDepth:d,includeFunctions:p,functionPaths:m,_budget:_,_path:e}));for(let e of x)c(e)&&(g[e]=r(y[e],h,{cache:l,cacheEligibility:u,maxDepth:d,includeFunctions:p,functionPaths:m,_budget:_,_path:e}));for(let e of S)c(e)&&(g[e]=r(o[e].value,h,{cache:l,cacheEligibility:u,maxDepth:d,includeFunctions:p,functionPaths:m,_budget:_,_path:e}));return g}export{l as applySnapshotUpdate,o as cloneSnapshotValue,u as collectSnapshot,c as isDeepEqualValue,i as isPlainObjectLike,s as isShallowEqualValue,a as normalizeSetDataValue};
1
+ import{toRaw as e}from"../../../reactivity/reactive/shared.mjs";import{isReactive as t}from"../../../reactivity/reactive.mjs";import{hasOwn as n}from"../../../utils.mjs";import{toPlain as r}from"../../diff.mjs";function i(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function a(e){return e===void 0?null:e}function o(e){if(Array.isArray(e))return e.map(e=>o(e));if(!i(e))return e;let t={};for(let n of Object.keys(e))t[n]=o(e[n]);return t}function s(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}if(!i(e)||!i(t))return!1;let r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(let i of r)if(!n(t,i)||!Object.is(e[i],t[i]))return!1;return!0}function c(e,t,r,a){if(Object.is(e,t))return!0;if(r<=0)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!c(e[n],t[n],r-1,a))return!1;return!0}if(!i(e)||!i(t))return!1;let o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;for(let i of o)if(--a.keys,a.keys<=0||!n(t,i)||!c(e[i],t[i],r-1,a))return!1;return!0}function l(e,t,n,r,i){let a=i?.cloneValue??!0,s=i?.clonedParents,c=t.split(`.`).filter(Boolean);if(!c.length)return;s?.add(e);let l=e;for(let e=0;e<c.length-1;e++){let t=c[e],n=l[t];if(typeof n!=`object`||!n)l[t]={},s?.add(l[t]);else if(s&&!s.has(n)){let e=Array.isArray(n)?n.slice():{...n};l[t]=e,s.add(e)}l=l[t]}let u=c[c.length-1];if(r===`delete`)try{delete l[u]}catch{l[u]=null}else l[u]=a?o(n):n}function u(n){let{state:i,setupState:a,computedRefs:o,includeComputed:s,shouldIncludeKey:c,plainCache:l,plainCacheEligibility:u,toPlainMaxDepth:d,toPlainMaxKeys:f,includeFunctions:p=!1,functionPaths:m=[]}=n,h=/* @__PURE__ */ new WeakMap,g={},_=Number.isFinite(f)?{keys:f}:void 0,v=t(i)?e(i):i,y=a&&typeof a==`object`?t(a)?e(a):a:void 0,b=Object.keys(v),x=y?Object.keys(y):[],S=s?Object.keys(o):[];for(let e of b)c(e)&&(g[e]=r(v[e],h,{cache:l,cacheEligibility:u,maxDepth:d,includeFunctions:p,functionPaths:m,_budget:_,_path:e}));for(let e of x)c(e)&&(g[e]=r(y[e],h,{cache:l,cacheEligibility:u,maxDepth:d,includeFunctions:p,functionPaths:m,_budget:_,_path:e}));for(let e of S)c(e)&&(g[e]=r(o[e].value,h,{cache:l,cacheEligibility:u,maxDepth:d,includeFunctions:p,functionPaths:m,_budget:_,_path:e}));return g}export{l as applySnapshotUpdate,o as cloneSnapshotValue,u as collectSnapshot,c as isDeepEqualValue,i as isPlainObjectLike,s as isShallowEqualValue,a as normalizeSetDataValue};
@@ -1 +1 @@
1
- function e(e){var t,n,r,i,a,o,s;let c=(t=e==null?void 0:e.includeComputed)==null||t,l=(n=e==null?void 0:e.suspendWhenHidden)!=null&&n,u=(r=e==null?void 0:e.strategy)==null?`diff`:r,d=typeof(e==null?void 0:e.maxPatchKeys)==`number`?Math.max(0,e.maxPatchKeys):1/0,f=typeof(e==null?void 0:e.maxPayloadBytes)==`number`?Math.max(0,e.maxPayloadBytes):1/0,p=typeof(e==null?void 0:e.mergeSiblingThreshold)==`number`?Math.max(2,Math.floor(e.mergeSiblingThreshold)):0,m=typeof(e==null?void 0:e.mergeSiblingMaxInflationRatio)==`number`?Math.max(0,e.mergeSiblingMaxInflationRatio):1.25,h=typeof(e==null?void 0:e.mergeSiblingMaxParentBytes)==`number`?Math.max(0,e.mergeSiblingMaxParentBytes):1/0,g=(i=e==null?void 0:e.mergeSiblingSkipArray)==null||i,_=(a=e==null?void 0:e.computedCompare)==null?u===`patch`?`deep`:`reference`:a,v=typeof(e==null?void 0:e.computedCompareMaxDepth)==`number`?Math.max(0,Math.floor(e.computedCompareMaxDepth)):4,y=typeof(e==null?void 0:e.computedCompareMaxKeys)==`number`?Math.max(0,Math.floor(e.computedCompareMaxKeys)):200,b=e==null?void 0:e.prelinkMaxDepth,x=e==null?void 0:e.prelinkMaxKeys,S=e==null?void 0:e.debug,C=(o=e==null?void 0:e.diagnostics)==null?`off`:o,w=e==null?void 0:e.loopWarning,T=w===!1||w&&typeof w==`object`&&w.enabled===!1?!1:{sampleWindowMs:typeof w==`object`&&typeof w.sampleWindowMs==`number`?Math.max(100,Math.floor(w.sampleWindowMs)):1e3,maxFlushes:typeof w==`object`&&typeof w.maxFlushes==`number`?Math.max(1,Math.floor(w.maxFlushes)):50,coolDownMs:typeof w==`object`&&typeof w.coolDownMs==`number`?Math.max(0,Math.floor(w.coolDownMs)):5e3},E=(s=e==null?void 0:e.debugWhen)==null?`fallback`:s,D=typeof(e==null?void 0:e.debugSampleRate)==`number`?Math.min(1,Math.max(0,e.debugSampleRate)):1,O=typeof(e==null?void 0:e.elevateTopKeyThreshold)==`number`?Math.max(0,Math.floor(e.elevateTopKeyThreshold)):1/0,k=typeof(e==null?void 0:e.toPlainMaxDepth)==`number`?Math.max(0,Math.floor(e.toPlainMaxDepth)):1/0,A=typeof(e==null?void 0:e.toPlainMaxKeys)==`number`?Math.max(0,Math.floor(e.toPlainMaxKeys)):1/0,j=!!(e!=null&&e.includeFunctions),M=Array.isArray(e==null?void 0:e.functionPaths)?[...new Set(e.functionPaths.filter(e=>typeof e==`string`&&e.length>0))]:[],N=Array.isArray(e==null?void 0:e.pick)&&e.pick.length>0?new Set(e.pick):void 0,P=Array.isArray(e==null?void 0:e.omit)&&e.omit.length>0?new Set(e.omit):void 0;return{includeComputed:c,suspendWhenHidden:l,setDataStrategy:u,maxPatchKeys:d,maxPayloadBytes:f,mergeSiblingThreshold:p,mergeSiblingMaxInflationRatio:m,mergeSiblingMaxParentBytes:h,mergeSiblingSkipArray:g,computedCompare:_,computedCompareMaxDepth:v,computedCompareMaxKeys:y,prelinkMaxDepth:b,prelinkMaxKeys:x,debug:S,diagnostics:C,loopWarning:T,debugWhen:E,debugSampleRate:D,elevateTopKeyThreshold:O,toPlainMaxDepth:k,toPlainMaxKeys:A,includeFunctions:j,functionPaths:M,pickSet:N,omitSet:P,shouldIncludeKey:e=>!(N&&!N.has(e)||P&&P.has(e))}}export{e as resolveSetDataOptions};
1
+ function e(e){let t=e?.includeComputed??!0,n=e?.suspendWhenHidden??!1,r=e?.strategy??`diff`,i=typeof e?.maxPatchKeys==`number`?Math.max(0,e.maxPatchKeys):1/0,a=typeof e?.maxPayloadBytes==`number`?Math.max(0,e.maxPayloadBytes):1/0,o=typeof e?.mergeSiblingThreshold==`number`?Math.max(2,Math.floor(e.mergeSiblingThreshold)):0,s=typeof e?.mergeSiblingMaxInflationRatio==`number`?Math.max(0,e.mergeSiblingMaxInflationRatio):1.25,c=typeof e?.mergeSiblingMaxParentBytes==`number`?Math.max(0,e.mergeSiblingMaxParentBytes):1/0,l=e?.mergeSiblingSkipArray??!0,u=e?.computedCompare??(r===`patch`?`deep`:`reference`),d=typeof e?.computedCompareMaxDepth==`number`?Math.max(0,Math.floor(e.computedCompareMaxDepth)):4,f=typeof e?.computedCompareMaxKeys==`number`?Math.max(0,Math.floor(e.computedCompareMaxKeys)):200,p=e?.prelinkMaxDepth,m=e?.prelinkMaxKeys,h=e?.debug,g=e?.diagnostics??`off`,_=e?.loopWarning,v=_===!1||_&&typeof _==`object`&&_.enabled===!1?!1:{sampleWindowMs:typeof _==`object`&&typeof _.sampleWindowMs==`number`?Math.max(100,Math.floor(_.sampleWindowMs)):1e3,maxFlushes:typeof _==`object`&&typeof _.maxFlushes==`number`?Math.max(1,Math.floor(_.maxFlushes)):50,coolDownMs:typeof _==`object`&&typeof _.coolDownMs==`number`?Math.max(0,Math.floor(_.coolDownMs)):5e3},y=e?.debugWhen??`fallback`,b=typeof e?.debugSampleRate==`number`?Math.min(1,Math.max(0,e.debugSampleRate)):1,x=typeof e?.elevateTopKeyThreshold==`number`?Math.max(0,Math.floor(e.elevateTopKeyThreshold)):1/0,S=typeof e?.toPlainMaxDepth==`number`?Math.max(0,Math.floor(e.toPlainMaxDepth)):1/0,C=typeof e?.toPlainMaxKeys==`number`?Math.max(0,Math.floor(e.toPlainMaxKeys)):1/0,w=!!e?.includeFunctions,T=Array.isArray(e?.functionPaths)?[...new Set(e.functionPaths.filter(e=>typeof e==`string`&&e.length>0))]:[],E=Array.isArray(e?.pick)&&e.pick.length>0?new Set(e.pick):void 0,D=Array.isArray(e?.omit)&&e.omit.length>0?new Set(e.omit):void 0;return{includeComputed:t,suspendWhenHidden:n,setDataStrategy:r,maxPatchKeys:i,maxPayloadBytes:a,mergeSiblingThreshold:o,mergeSiblingMaxInflationRatio:s,mergeSiblingMaxParentBytes:c,mergeSiblingSkipArray:l,computedCompare:u,computedCompareMaxDepth:d,computedCompareMaxKeys:f,prelinkMaxDepth:p,prelinkMaxKeys:m,debug:h,diagnostics:g,loopWarning:v,debugWhen:y,debugSampleRate:b,elevateTopKeyThreshold:x,toPlainMaxDepth:S,toPlainMaxKeys:C,includeFunctions:w,functionPaths:T,pickSet:E,omitSet:D,shouldIncludeKey:e=>!(E&&!E.has(e)||D&&D.has(e))}}export{e as resolveSetDataOptions};
@@ -1 +1 @@
1
- import{getMiniProgramGlobalObject as e}from"./platform.mjs";import{INTERNAL_DEFAULTS_SCOPE_KEY as t,applyWevuAppDefaults as n}from"./defaults.mjs";import{isSetDataHighFrequencyWarningRequested as r,requireRuntimeCapability as i}from"./capabilities.mjs";import{ensureRuntimeAppProvides as a,setRuntimeAppProvidedValue as o}from"./provideContext.mjs";import{version as s}from"../version.mjs";import{resolveBindingManifest as c}from"./bindingManifest.mjs";import{createRuntimeMount as l}from"./app/mount.mjs";import{setPendingRuntimeAppRegistration as u}from"./app/pending.mjs";import{registerApp as d}from"./register/app.mjs";import{WEVU_BINDING_MANIFEST_KEY as f,WEVU_INLINE_HANDLER as p,WEVU_INLINE_MAP_KEY as m,WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY as h,WEVU_SLOT_OWNER_ID_KEY as g}from"@weapp-core/constants";function _(_){let v=_[t],{[t]:y,[f]:b,[h]:x,data:S,computed:C,methods:w,setData:T,watch:E,setup:D,...O}=v===`component`?_:n(_),k=c(b),A=w==null?{}:w,j=C==null?{}:C,M=x===!0||Array.isArray(T==null?void 0:T.pick)&&T.pick.includes(g),N=A,P=N[m];Object.prototype.hasOwnProperty.call(N,m)&&P&&typeof P==`object`&&Object.keys(P).length>0&&typeof N[p]!=`function`&&typeof O[p]!=`function`&&i(`inlineEvents`,`createApp(inline event metadata)`),(T==null?void 0:T.strategy)===`patch`&&i(`patchStrategy`,`createApp(setData.strategy="patch")`),r(T==null?void 0:T.highFrequencyWarning)&&i(`setDataHighFrequencyWarning`,`createApp(setData.highFrequencyWarning)`),M&&i(`scopedSlots`,`createApp(scoped-slot bindings)`);let F=/* @__PURE__ */ new Set,I=/* @__PURE__ */ new Set,L=!1,R={globalProperties:{}},z={mount:l({data:S,resolvedComputed:j,resolvedMethods:A,appConfig:R,setDataOptions:T,bindingManifest:k}),use(e,...t){if(!e||F.has(e))return z;if(F.add(e),typeof e==`function`)e(z,...t);else if(typeof e.install==`function`)e.install(z,...t);else throw TypeError(`插件必须是函数,或包含 install 方法的对象`);return z},provide(e,t){return o(z,e,t,{syncGlobal:v!==`component`}),z},onUnmount(e){if(typeof e!=`function`)throw TypeError(`onUnmount 只接受函数`);return L?(e(),z):(I.add(e),z)},unmount(){if(!L){L=!0;for(let e of I)e();I.clear()}},config:R,version:s};try{a(z),Object.defineProperty(z,"__wevuSetDataOptions",{value:T,configurable:!0,enumerable:!1,writable:!1}),Object.defineProperty(z,"__wevuHasTemplateRuntimeBindings",{value:M,configurable:!0,enumerable:!1,writable:!1})}catch(e){z.__wevuSetDataOptions=T,z.__wevuHasTemplateRuntimeBindings=M}let B=()=>{let t=e(),n=`__wevuAppRegistered`;t&&t[n]||(t&&(t[n]=!0),d(z,w==null?{}:w,E,D,O))};return v!==`component`&&typeof App==`function`?B():v!==`component`&&u({app:z,register:B}),z}export{_ as createApp};
1
+ import{getCurrentMiniProgramGlobalObject as e}from"./platform/current.mjs";import{INTERNAL_DEFAULTS_SCOPE_KEY as t,applyWevuAppDefaults as n}from"./defaults.mjs";import{isSetDataHighFrequencyWarningRequested as r,requireRuntimeCapability as i}from"./capabilities.mjs";import{ensureRuntimeAppProvides as a,setRuntimeAppProvidedValue as o}from"./provideContext.mjs";import{version as s}from"../version.mjs";import{resolveBindingManifest as c}from"./bindingManifest.mjs";import{createRuntimeMount as l}from"./app/mount.mjs";import{setPendingRuntimeAppRegistration as u}from"./app/pending.mjs";import{registerApp as d}from"./register/app.mjs";import{WEVU_BINDING_MANIFEST_KEY as f,WEVU_INLINE_HANDLER as p,WEVU_INLINE_MAP_KEY as m,WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY as h,WEVU_SLOT_OWNER_ID_KEY as g}from"@weapp-core/constants";function _(_){let v=_[t],{[t]:y,[f]:b,[h]:x,data:S,computed:C,methods:w,setData:T,watch:E,setup:D,...O}=v===`component`?_:n(_),k=c(b),A=w??{},j=C??{},M=x===!0||Array.isArray(T?.pick)&&T.pick.includes(g),N=A,P=N[m];Object.prototype.hasOwnProperty.call(N,m)&&P&&typeof P==`object`&&Object.keys(P).length>0&&typeof N[p]!=`function`&&typeof O[p]!=`function`&&i(`inlineEvents`,`createApp(inline event metadata)`),T?.strategy===`patch`&&i(`patchStrategy`,`createApp(setData.strategy="patch")`),r(T?.highFrequencyWarning)&&i(`setDataHighFrequencyWarning`,`createApp(setData.highFrequencyWarning)`),M&&i(`scopedSlots`,`createApp(scoped-slot bindings)`);let F=/* @__PURE__ */ new Set,I=/* @__PURE__ */ new Set,L=!1,R={globalProperties:{}},z={mount:l({data:S,resolvedComputed:j,resolvedMethods:A,appConfig:R,setDataOptions:T,bindingManifest:k}),use(e,...t){if(!e||F.has(e))return z;if(F.add(e),typeof e==`function`)e(z,...t);else if(typeof e.install==`function`)e.install(z,...t);else throw TypeError(`插件必须是函数,或包含 install 方法的对象`);return z},provide(e,t){return o(z,e,t,{syncGlobal:v!==`component`}),z},onUnmount(e){if(typeof e!=`function`)throw TypeError(`onUnmount 只接受函数`);return L?(e(),z):(I.add(e),z)},unmount(){if(!L){L=!0;for(let e of I)e();I.clear()}},config:R,version:s};try{a(z),Object.defineProperty(z,"__wevuSetDataOptions",{value:T,configurable:!0,enumerable:!1,writable:!1}),Object.defineProperty(z,"__wevuHasTemplateRuntimeBindings",{value:M,configurable:!0,enumerable:!1,writable:!1})}catch{z.__wevuSetDataOptions=T,z.__wevuHasTemplateRuntimeBindings=M}let B=()=>{let t=e(),n=`__wevuAppRegistered`;t&&t[n]||(t&&(t[n]=!0),d(z,w??{},E,D,O))};return v!==`component`&&typeof App==`function`?B():v!==`component`&&u({app:z,register:B}),z}export{_ as createApp};
@@ -1 +1 @@
1
- const e={"exact-path":!0,"snapshot-fallback":!0,"top-level":!0};function t(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function n(e){return typeof e==`number`&&Number.isFinite(e)&&Number.isInteger(e)}function r(e){if(!e||typeof e!=`object`)return!1;let t=e;return n(t.offset)&&t.offset>=0&&n(t.line)&&t.line>=1&&n(t.column)&&t.column>=1}function i(e){if(!e||typeof e!=`object`)return!1;let t=e,n=t.start,i=t.end;return r(n)&&r(i)&&i.offset>=n.offset}function a(e){return Object.values(e).every(e=>e===!0)}function o(n){if(!n||typeof n!=`object`)return!1;let r=n;return typeof r.id==`string`&&r.id.length>0&&typeof r.outputPath==`string`&&r.outputPath.length>0&&(r.sourceFile===void 0||typeof r.sourceFile==`string`&&r.sourceFile.length>0)&&(r.updateMode===void 0||typeof r.updateMode==`string`&&e[r.updateMode]===!0)&&(r.sourceRoots===void 0||t(r.sourceRoots))&&(r.sourceLocation===void 0||i(r.sourceLocation))}function s(e){if(!e||typeof e!=`object`)return;let t=e;if(t.version===1&&typeof t.sourceFile==`string`&&Array.isArray(t.bindings)&&t.bindings.every(o)&&(t.features===void 0||t.features&&typeof t.features==`object`&&!Array.isArray(t.features)&&a(t.features)))return t}function c(e,t){var n;return(n=e==null?void 0:e.bindings.some(e=>e.outputPath===t))!=null&&n}function l(e){return e.replace(/\[(?:'([^']+)'|"([^"]+)"|([^\]]+))\]/g,(e,t,n,r)=>{var i;return`.${(i=t==null?n:t)==null?r:i}`}).replace(/^\./,``)}function u(e){var t;return(t=l(e).split(`.`,1)[0])==null?``:t}function d(e,t){let n=l(e),r=l(t);return n===r||n.startsWith(`${r}.`)||r.startsWith(`${n}.`)}function f(e){var t;return(t=e.updateMode)==null?`exact-path`:t}function p(e,t){var n;if(!t)return!1;let r=f(e);if(r===`snapshot-fallback`&&e.outputPath===`*`)return!0;if(r===`exact-path`)return d(e.outputPath,t);let i=u(t);return u(e.outputPath)===i||r===`snapshot-fallback`&&((n=e.sourceRoots)==null?[]:n).some(e=>u(e)===i)}function m(e,t,n=!1){let r=[...t],i=/* @__PURE__ */ new Set,a=[];for(let t of e.bindings){var o;if(i.has(t.id))continue;let s=f(t);if(!(r.length>0?r.some(e=>p(t,e)):n&&s===`snapshot-fallback`))continue;i.add(t.id);let c={id:t.id,outputPath:t.outputPath,updateMode:s,sourceFile:(o=t.sourceFile)==null?e.sourceFile:o};t.sourceLocation&&(c.sourceLocation=t.sourceLocation),a.push(c)}return a}export{c as hasBindingOutputPath,m as resolveBindingDiagnostics,s as resolveBindingManifest};
1
+ const e={"exact-path":!0,"snapshot-fallback":!0,"top-level":!0};function t(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function n(e){return typeof e==`number`&&Number.isFinite(e)&&Number.isInteger(e)}function r(e){if(!e||typeof e!=`object`)return!1;let t=e;return n(t.offset)&&t.offset>=0&&n(t.line)&&t.line>=1&&n(t.column)&&t.column>=1}function i(e){if(!e||typeof e!=`object`)return!1;let t=e,n=t.start,i=t.end;return r(n)&&r(i)&&i.offset>=n.offset}function a(e){return Object.values(e).every(e=>e===!0)}function o(n){if(!n||typeof n!=`object`)return!1;let r=n;return typeof r.id==`string`&&r.id.length>0&&typeof r.outputPath==`string`&&r.outputPath.length>0&&(r.sourceFile===void 0||typeof r.sourceFile==`string`&&r.sourceFile.length>0)&&(r.updateMode===void 0||typeof r.updateMode==`string`&&e[r.updateMode]===!0)&&(r.sourceRoots===void 0||t(r.sourceRoots))&&(r.sourceLocation===void 0||i(r.sourceLocation))}function s(e){if(!e||typeof e!=`object`)return;let t=e;if(t.version===1&&typeof t.sourceFile==`string`&&Array.isArray(t.bindings)&&t.bindings.every(o)&&(t.features===void 0||t.features&&typeof t.features==`object`&&!Array.isArray(t.features)&&a(t.features)))return t}function c(e,t){return e?.bindings.some(e=>e.outputPath===t)??!1}function l(e){return e.replace(/\[(?:'([^']+)'|"([^"]+)"|([^\]]+))\]/g,(e,t,n,r)=>`.${t??n??r}`).replace(/^\./,``)}function u(e){return l(e).split(`.`,1)[0]??``}function d(e,t){let n=l(e),r=l(t);return n===r||n.startsWith(`${r}.`)||r.startsWith(`${n}.`)}function f(e){return e.updateMode??`exact-path`}function p(e,t){if(!t)return!1;let n=f(e);if(n===`snapshot-fallback`&&e.outputPath===`*`)return!0;if(n===`exact-path`)return d(e.outputPath,t);let r=u(t);return u(e.outputPath)===r||n===`snapshot-fallback`&&(e.sourceRoots??[]).some(e=>u(e)===r)}function m(e,t,n=!1){let r=[...t],i=/* @__PURE__ */ new Set,a=[];for(let t of e.bindings){if(i.has(t.id))continue;let o=f(t);if(!(r.length>0?r.some(e=>p(t,e)):n&&o===`snapshot-fallback`))continue;i.add(t.id);let s={id:t.id,outputPath:t.outputPath,updateMode:o,sourceFile:t.sourceFile??e.sourceFile};t.sourceLocation&&(s.sourceLocation=t.sourceLocation),a.push(s)}return a}export{c as hasBindingOutputPath,m as resolveBindingDiagnostics,s as resolveBindingManifest};
@@ -5,7 +5,7 @@ import "./types.mjs";
5
5
  import { SetDataSchedulerOptions } from "./app/setData/scheduler.mjs";
6
6
  import { InlineExpressionMap } from "./register/inline.mjs";
7
7
  //#region src/runtime/capabilities.d.ts
8
- export type RuntimeCapabilityName = 'patchStrategy' | 'templateRefs' | 'inlineEvents' | 'setDataHighFrequencyWarning' | 'scopedSlots' | 'layout';
8
+ export type RuntimeCapabilityName = 'patchStrategy' | 'templateRefs' | 'inlineEvents' | 'setDataHighFrequencyWarning' | 'scopedSlots' | 'layout' | 'jsxIslands';
9
9
  export interface TemplateRefBinding {
10
10
  selector: string;
11
11
  inFor: boolean;
@@ -69,6 +69,9 @@ export interface RuntimeCapabilityRegistry {
69
69
  attachHosts: (bindings: readonly LayoutHostBinding[], target: InternalRuntimeState) => void;
70
70
  detachHosts: (bindings: readonly LayoutHostBinding[], target: InternalRuntimeState) => void;
71
71
  };
72
+ jsxIslands?: {
73
+ attachMethods: (methods: Record<string, (...args: any[]) => any>) => void;
74
+ };
72
75
  }
73
76
  //#endregion
74
77
  export type { SetDataSchedulerOptions };
@@ -1 +1 @@
1
- import{unref as e}from"../reactivity/ref.mjs";import{computed as t}from"../reactivity/computed.mjs";import{assertInSetup as n}from"./hooks/base.mjs";import{WEVU_CSS_MODULES_KEY as r,WEVU_CSS_VARS_STYLE_KEY as i}from"@weapp-core/constants";function a(t){return Object.entries(t).map(([t,n])=>`--${t}:${n==null?``:String(e(n))}`).join(`;`)}function o(e=`$style`){let t=n(`useCssModule`)[r],i=t==null?void 0:t[e];if(!i||typeof i!=`object`)throw Error(`useCssModule() 找不到名为 ${JSON.stringify(e)} 的 CSS Module`);return i}function s(e){let r=n(`useCssVars`),o=r.__wevu,s=t(()=>{var t;return a(e((t=o==null?void 0:o.proxy)==null?r:t))});return o!=null&&o.state&&typeof o.state==`object`&&(o.state[i]=s),o!=null&&o.setupState&&typeof o.setupState==`object`&&(o.setupState[i]=s),s}export{o as useCssModule,s as useCssVars};
1
+ import{unref as e}from"../reactivity/ref.mjs";import{computed as t}from"../reactivity/computed.mjs";import{assertInSetup as n}from"./hooks/base.mjs";import{WEVU_CSS_MODULES_KEY as r,WEVU_CSS_VARS_STYLE_KEY as i}from"@weapp-core/constants";function a(t){return Object.entries(t).map(([t,n])=>`--${t}:${n==null?``:String(e(n))}`).join(`;`)}function o(e=`$style`){let t=n(`useCssModule`)[r]?.[e];if(!t||typeof t!=`object`)throw Error(`useCssModule() 找不到名为 ${JSON.stringify(e)} 的 CSS Module`);return t}function s(e){let r=n(`useCssVars`),o=r.__wevu,s=t(()=>a(e(o?.proxy??r)));return o?.state&&typeof o.state==`object`&&(o.state[i]=s),o?.setupState&&typeof o.setupState==`object`&&(o.setupState[i]=s),s}export{o as useCssModule,s as useCssVars};
@@ -1 +1 @@
1
- const e=`__wevuDefaultsScope`;let t={};function n(e){if(e&&typeof e==`object`&&!Array.isArray(e))return e}function r(e,t){if(!e)return t;if(!t)return e;let r={...e,...t},i=n(e.setData),a=n(t.setData);(i||a)&&(r.setData={...i==null?{}:i,...a==null?{}:a});let o=n(e.options),s=n(t.options);return(o||s)&&(r.options={...o==null?{}:o,...s==null?{}:s}),r}function i(e,t){return r(e,t)}function a(e,t){return{app:r(e.app,t.app),component:r(e.component,t.component)}}function o(e){t=a(t,e)}function s(){t={}}function c(e){return i(t.app,e)}function l(e){return i(t.component,e)}export{e as INTERNAL_DEFAULTS_SCOPE_KEY,c as applyWevuAppDefaults,l as applyWevuComponentDefaults,s as resetWevuDefaults,o as setWevuDefaults};
1
+ const e=`__wevuDefaultsScope`;let t={};function n(e){if(e&&typeof e==`object`&&!Array.isArray(e))return e}function r(e,t){if(!e)return t;if(!t)return e;let r={...e,...t},i=n(e.setData),a=n(t.setData);(i||a)&&(r.setData={...i??{},...a??{}});let o=n(e.options),s=n(t.options);return(o||s)&&(r.options={...o??{},...s??{}}),r}function i(e,t){return r(e,t)}function a(e,t){return{app:r(e.app,t.app),component:r(e.component,t.component)}}function o(e){t=a(t,e)}function s(){t={}}function c(e){return i(t.app,e)}function l(e){return i(t.component,e)}export{e as INTERNAL_DEFAULTS_SCOPE_KEY,c as applyWevuAppDefaults,l as applyWevuComponentDefaults,s as resetWevuDefaults,o as setWevuDefaults};
@@ -1 +1 @@
1
- import{hasOwn as e}from"../../utils.mjs";import{toPlain as t}from"../diff.mjs";import{resolveSetDataOptions as n}from"../app/setDataOptions.mjs";import{WEVU_SLOT_OWNER_ID_KEY as r}from"@weapp-core/constants";var i=class extends Error{};function a(e){if(typeof e==`function`)return e;let t=e==null?void 0:e.get;return typeof t==`function`?t:void 0}function o(e){return e.startsWith(`__wv_bind_`)||e.startsWith(`__wv_cls_`)||e.startsWith(`__wv_style_`)}function s(e,t){if(!e.startsWith(`__wv_bind_`))return!1;try{return!/\bthis\b/.test(Function.prototype.toString.call(t))}catch(e){return!1}}function c(e){if(e===r)return``;if(e.startsWith(`__wv_bind_`))return null;if(e.startsWith(`__wv_cls_`)||e.startsWith(`__wv_style_`))return``}function l(t,n){let r=Array.isArray(n==null?void 0:n.pick)?n.pick:[];if(!r.length)return;let i=new Set(Array.isArray(n==null?void 0:n.omit)?n.omit:[]),a={};for(let n of r){if(i.has(n)||e(t,n))continue;let r=c(n);r!==void 0&&(a[n]=r)}return Object.keys(a).length?a:void 0}function u(r){let{data:c,computed:l,methods:u,setData:d}=r,f=l?Object.keys(l):[];if(!f.length)return;let{includeComputed:p,shouldIncludeKey:m,toPlainMaxDepth:h,toPlainMaxKeys:g,includeFunctions:_,functionPaths:v}=n(d);if(!p)return;let y={},b=/* @__PURE__ */ new Set,x,S=n=>{if(e(c,n)||!m(n))return{ok:!1};if(e(y,n))return{ok:!0,value:y[n]};if(b.has(n))return{ok:!1};let r=a(l[n]);if(!r)return{ok:!1};b.add(n);try{let e=r.call(x);if(e===void 0)return{ok:!1};let i=t(e,/* @__PURE__ */ new WeakMap,{maxDepth:h,maxKeys:g,includeFunctions:_,functionPaths:v,_path:n});return i===void 0?{ok:!1}:(y[n]=i,{ok:!0,value:i})}catch(e){return{ok:!1}}finally{b.delete(n)}};x=new Proxy(c,{get(t,n,r){if(typeof n==`string`){if(n===`data`||n===`$state`)return c;if(n===`props`||n===`$props`||n===`$attrs`)throw new i;if(e(c,n))return Reflect.get(t,n,r);if(u&&e(u,n)){let e=u[n];return typeof e==`function`?e.bind(x):e}if(l&&e(l,n)){let e=S(n);if(e.ok)return e.value;throw new i}throw new i}return Reflect.get(t,n,r)},has(t,n){return Reflect.has(t,n)||typeof n==`string`&&!!(l&&e(l,n))}});for(let e of f){let t=a(l[e]);(!o(e)||t&&s(e,t))&&S(e)}return Object.keys(y).length?y:void 0}function d(e,t,n,r){if(!e||typeof e!=`object`)return e;let i=u({data:e,computed:t,methods:r,setData:n}),a=l(e,n);return i||a?{...e,...a,...i}:e}export{u as resolveInitialComputedData,d as resolveNativeInitialData};
1
+ import{hasOwn as e}from"../../utils.mjs";import{toPlain as t}from"../diff.mjs";import{resolveSetDataOptions as n}from"../app/setDataOptions.mjs";import{WEVU_SLOT_OWNER_ID_KEY as r}from"@weapp-core/constants";var i=class extends Error{};function a(e){if(typeof e==`function`)return e;let t=e?.get;return typeof t==`function`?t:void 0}function o(e){return e.startsWith(`__wv_bind_`)||e.startsWith(`__wv_cls_`)||e.startsWith(`__wv_style_`)}function s(e,t){if(!e.startsWith(`__wv_bind_`))return!1;try{return!/\bthis\b/.test(Function.prototype.toString.call(t))}catch{return!1}}function c(e){if(e===r)return``;if(e.startsWith(`__wv_bind_`))return null;if(e.startsWith(`__wv_cls_`)||e.startsWith(`__wv_style_`))return``}function l(t,n){let r=Array.isArray(n?.pick)?n.pick:[];if(!r.length)return;let i=new Set(Array.isArray(n?.omit)?n.omit:[]),a={};for(let n of r){if(i.has(n)||e(t,n))continue;let r=c(n);r!==void 0&&(a[n]=r)}return Object.keys(a).length?a:void 0}function u(r){let{data:c,computed:l,methods:u,setData:d}=r,f=l?Object.keys(l):[];if(!f.length)return;let{includeComputed:p,shouldIncludeKey:m,toPlainMaxDepth:h,toPlainMaxKeys:g,includeFunctions:_,functionPaths:v}=n(d);if(!p)return;let y={},b=/* @__PURE__ */ new Set,x,S=n=>{if(e(c,n)||!m(n))return{ok:!1};if(e(y,n))return{ok:!0,value:y[n]};if(b.has(n))return{ok:!1};let r=a(l[n]);if(!r)return{ok:!1};b.add(n);try{let e=r.call(x);if(e===void 0)return{ok:!1};let i=t(e,/* @__PURE__ */ new WeakMap,{maxDepth:h,maxKeys:g,includeFunctions:_,functionPaths:v,_path:n});return i===void 0?{ok:!1}:(y[n]=i,{ok:!0,value:i})}catch{return{ok:!1}}finally{b.delete(n)}};x=new Proxy(c,{get(t,n,r){if(typeof n==`string`){if(n===`data`||n===`$state`)return c;if(n===`props`||n===`$props`||n===`$attrs`)throw new i;if(e(c,n))return Reflect.get(t,n,r);if(u&&e(u,n)){let e=u[n];return typeof e==`function`?e.bind(x):e}if(l&&e(l,n)){let e=S(n);if(e.ok)return e.value;throw new i}throw new i}return Reflect.get(t,n,r)},has(t,n){return Reflect.has(t,n)||typeof n==`string`&&!!(l&&e(l,n))}});for(let e of f){let t=a(l[e]);(!o(e)||t&&s(e,t))&&S(e)}return Object.keys(y).length?y:void 0}function d(e,t,n,r){if(!e||typeof e!=`object`)return e;let i=u({data:e,computed:t,methods:r,setData:n}),a=l(e,n);return i||a?{...e,...a,...i}:e}export{u as resolveInitialComputedData,d as resolveNativeInitialData};
@@ -1 +1 @@
1
- const e=[`components`,`computed`,`directives`,`inject`,`methods`,`props`,`provide`],t=/* @__PURE__ */ new Set(/* @__PURE__ */ `activated.attached.beforeCreate.beforeDestroy.beforeMount.beforeUnmount.beforeUpdate.created.deactivated.destroyed.detached.errorCaptured.hide.mounted.moved.onAddToFavorites.onHide.onLoad.onPageScroll.onPullDownRefresh.onReachBottom.onReady.onResize.onRouteDone.onSaveExitState.onShareAppMessage.onShareTimeline.onShow.onTabItemTap.onUnload.ready.renderTracked.renderTriggered.serverPrefetch.show.unmounted.updated`.split(`.`));function n(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:void 0}function r(e,t){return typeof e==`function`?typeof t==`function`?function(...n){return e.apply(this,n),t.apply(this,n)}:e:t}function i(e,t){let i=n(e),a=n(t);if(!i)return a;if(!a)return i;let o={...i,...a};for(let e of/* @__PURE__ */ new Set([...Object.keys(i),...Object.keys(a)]))o[e]=r(i[e],a[e]);return o}function a(e,t){return e===void 0?t:t===void 0?e:function(){var r,i;let a=typeof e==`function`?e.call(this):e,o=typeof t==`function`?t.call(this):t;return{...(r=n(a))==null?{}:r,...(i=n(o))==null?{}:i}}}function o(e,t){if(typeof e==`function`)return e;if(typeof e==`string`){let n=t[e];return typeof n==`function`?n:void 0}let r=n(e);return r?o(r.handler,t):void 0}function s(e,t){if(e===void 0)return t;if(t===void 0)return e;let r=n(e),i=n(t);return{...r==null?{}:r,...i==null?{}:i,handler(...n){var r,i;return(r=o(e,this))==null||r.apply(this,n),(i=o(t,this))==null?void 0:i.apply(this,n)},immediate:!!(r!=null&&r.immediate||i!=null&&i.immediate),deep:!!(r!=null&&r.deep||i!=null&&i.deep)}}function c(e,t){let r=n(e),i=n(t);if(!r)return i;if(!i)return r;let a={...r,...i};for(let e of/* @__PURE__ */ new Set([...Object.keys(r),...Object.keys(i)]))a[e]=s(r[e],i[e]);return a}function l(e,t){let n=[...Array.isArray(e)?e:[],...Array.isArray(t)?t:[]];return[...new Set(n)]}function u(o,s){let u={...o,...s};for(let t of e){let e=n(o[t]),r=n(s[t]);(e||r)&&(u[t]={...e==null?{}:e,...r==null?{}:r})}u.data=a(o.data,s.data),u.watch=c(o.watch,s.watch),u.lifetimes=i(o.lifetimes,s.lifetimes),u.pageLifetimes=i(o.pageLifetimes,s.pageLifetimes);for(let e of/* @__PURE__ */ new Set([...Object.keys(o),...Object.keys(s)]))t.has(e)&&(u[e]=r(o[e],s[e]));return(Array.isArray(o.emits)||Array.isArray(s.emits))&&(u.emits=l(o.emits,s.emits)),(Array.isArray(o.expose)||Array.isArray(s.expose))&&(u.expose=l(o.expose,s.expose)),u}function d(e,t,r){let i=n(t);if(!i||r.has(i))return e;r.add(i);let a=e;if(a=d(a,i.extends,r),Array.isArray(i.mixins))for(let e of i.mixins)a=d(a,e,r);let{extends:o,mixins:s,...c}=i;return u(a,c)}function f(e){return d({},e,/* @__PURE__ */ new WeakSet)}export{f as resolveVueComponentOptions};
1
+ const e=[`components`,`computed`,`directives`,`inject`,`methods`,`props`,`provide`],t=/* @__PURE__ */ new Set(/* @__PURE__ */ `activated.attached.beforeCreate.beforeDestroy.beforeMount.beforeUnmount.beforeUpdate.created.deactivated.destroyed.detached.errorCaptured.hide.mounted.moved.onAddToFavorites.onHide.onLoad.onPageScroll.onPullDownRefresh.onReachBottom.onReady.onResize.onRouteDone.onSaveExitState.onShareAppMessage.onShareTimeline.onShow.onTabItemTap.onUnload.ready.renderTracked.renderTriggered.serverPrefetch.show.unmounted.updated`.split(`.`));function n(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:void 0}function r(e,t){return typeof e==`function`?typeof t==`function`?function(...n){return e.apply(this,n),t.apply(this,n)}:e:t}function i(e,t){let i=n(e),a=n(t);if(!i)return a;if(!a)return i;let o={...i,...a};for(let e of/* @__PURE__ */ new Set([...Object.keys(i),...Object.keys(a)]))o[e]=r(i[e],a[e]);return o}function a(e,t){return e===void 0?t:t===void 0?e:function(){let r=typeof e==`function`?e.call(this):e,i=typeof t==`function`?t.call(this):t;return{...n(r)??{},...n(i)??{}}}}function o(e,t){if(typeof e==`function`)return e;if(typeof e==`string`){let n=t[e];return typeof n==`function`?n:void 0}let r=n(e);return r?o(r.handler,t):void 0}function s(e,t){if(e===void 0)return t;if(t===void 0)return e;let r=n(e),i=n(t);return{...r??{},...i??{},handler(...n){return o(e,this)?.apply(this,n),o(t,this)?.apply(this,n)},immediate:!!(r?.immediate||i?.immediate),deep:!!(r?.deep||i?.deep)}}function c(e,t){let r=n(e),i=n(t);if(!r)return i;if(!i)return r;let a={...r,...i};for(let e of/* @__PURE__ */ new Set([...Object.keys(r),...Object.keys(i)]))a[e]=s(r[e],i[e]);return a}function l(e,t){let n=[...Array.isArray(e)?e:[],...Array.isArray(t)?t:[]];return[...new Set(n)]}function u(o,s){let u={...o,...s};for(let t of e){let e=n(o[t]),r=n(s[t]);(e||r)&&(u[t]={...e??{},...r??{}})}u.data=a(o.data,s.data),u.watch=c(o.watch,s.watch),u.lifetimes=i(o.lifetimes,s.lifetimes),u.pageLifetimes=i(o.pageLifetimes,s.pageLifetimes);for(let e of/* @__PURE__ */ new Set([...Object.keys(o),...Object.keys(s)]))t.has(e)&&(u[e]=r(o[e],s[e]));return(Array.isArray(o.emits)||Array.isArray(s.emits))&&(u.emits=l(o.emits,s.emits)),(Array.isArray(o.expose)||Array.isArray(s.expose))&&(u.expose=l(o.expose,s.expose)),u}function d(e,t,r){let i=n(t);if(!i||r.has(i))return e;r.add(i);let a=e;if(a=d(a,i.extends,r),Array.isArray(i.mixins))for(let e of i.mixins)a=d(a,e,r);let{extends:o,mixins:s,...c}=i;return u(a,c)}function f(e){return d({},e,/* @__PURE__ */ new WeakSet)}export{f as resolveVueComponentOptions};
@@ -1 +1 @@
1
- import{hasOwn as e}from"../../utils.mjs";import{WEVU_SLOT_NAMES_PROP as t,WEVU_SLOT_OWNER_ID_PROP as n,WEVU_SLOT_SCOPE_KEY as r}from"@weapp-core/constants";const i=`__wevu_allowNullPropInput`,a=`allowNullPropInput`,o=/* @__PURE__ */ new Map([[String,String],[Number,Number],[Boolean,Boolean],[Object,Object],[Array,Array],[Function,Function],[`String`,String],[`Number`,Number],[`Boolean`,Boolean],[`Object`,Object],[`Array`,Array],[`Function`,Function],[null,null],[`null`,null],[`Null`,null]]);function s(e){return o.get(e)}function c(e,t=[]){if(Array.isArray(e)){for(let n of e)c(n,t);return t}let n=s(e);return n!==void 0&&!t.includes(n)&&t.push(n),t}function l(e){if(e===void 0)return[];let t=c(e).filter(e=>e!==null);return t.length>0?t:[null]}function u(e,t){let n=l(t);if(n.length!==0&&(e.type=n[0],n.length>1)){let t=[];for(let e of n.slice(1))t.includes(e)||t.push(e);t.length>0&&(e.optionalTypes=t)}}function d(t){e(t,`value`)||(t.type===String?t.value=``:t.type===Number?t.value=0:t.type===Boolean?t.value=!1:t.type===Array&&(t.value=[]))}function f(e,t,n){if(!n||e.type===null)return;let r=t&&typeof t==`object`&&!Array.isArray(t)?t:void 0,i=c(r?[r.type,r.optionalTypes]:t),a=i.includes(null),o=i.filter(e=>e!==null).length>1,s=(r==null?void 0:r.required)!==!0;(a||o||s)&&(a||d(e),e.type=null,delete e.optionalTypes)}function p(t,n){let r={};return t&&Object.entries(t).forEach(([t,i])=>{if(i!==void 0){if(i===null){r[t]={type:null};return}if(Array.isArray(i)||typeof i==`function`){let a={};u(a,i),e(a,`type`)||(a.type=null),f(a,i,n),r[t]=a;return}if(typeof i==`object`){if(t.endsWith(`Modifiers`)&&Object.keys(i).length===0){r[t]={type:Object,value:{}};return}let a={};if(`type`in i&&i.type!==void 0&&u(a,i.type),Array.isArray(i.optionalTypes)){let e=i.optionalTypes.map(e=>s(e)).filter(e=>e!=null);if(e.length>0){let t=Array.isArray(a.optionalTypes)?a.optionalTypes:[];for(let n of e)n!==a.type&&(t.includes(n)||t.push(n));t.length>0&&(a.optionalTypes=t)}}`observer`in i&&(typeof i.observer==`function`||typeof i.observer==`string`)&&(a.observer=i.observer);let o=`default`in i?i.default:i.value;o!==void 0&&(a.value=typeof o==`function`?o():o),e(a,`type`)||(a.type=null),f(a,i,n),r[t]=a}}}),r}function m(o,s,c){var l;let u=!!((l=o[i])==null?o[a]:l),{[i]:d,[a]:f,...m}=o,h=o.properties,g=h&&typeof h==`object`&&Object.keys(h).length>0?h:void 0,_=c==null?g:c,v=!!(s||_),y=i=>{let a={...i==null?{}:i};return v?(e(a,n)||(a[n]={type:String,value:``}),e(a,r)||(a[r]={type:null,value:null}),e(a,t)||(a[t]={type:null,value:null}),a):a};if(_){let{properties:e,...t}=m,n=_,r=p(s,u);return{...t,properties:y({...r,...n})}}return{...m,properties:y(p(s,u))}}export{m as normalizeProps};
1
+ import{hasOwn as e}from"../../utils.mjs";import{WEVU_SLOT_NAMES_PROP as t,WEVU_SLOT_OWNER_ID_PROP as n,WEVU_SLOT_SCOPE_KEY as r}from"@weapp-core/constants";const i=`__wevu_allowNullPropInput`,a=`allowNullPropInput`,o=/* @__PURE__ */ new Map([[String,String],[Number,Number],[Boolean,Boolean],[Object,Object],[Array,Array],[Function,Function],[`String`,String],[`Number`,Number],[`Boolean`,Boolean],[`Object`,Object],[`Array`,Array],[`Function`,Function],[null,null],[`null`,null],[`Null`,null]]);function s(e){return o.get(e)}function c(e,t=[]){if(Array.isArray(e)){for(let n of e)c(n,t);return t}let n=s(e);return n!==void 0&&!t.includes(n)&&t.push(n),t}function l(e){if(e===void 0)return[];let t=c(e).filter(e=>e!==null);return t.length>0?t:[null]}function u(e,t){let n=l(t);if(n.length!==0&&(e.type=n[0],n.length>1)){let t=[];for(let e of n.slice(1))t.includes(e)||t.push(e);t.length>0&&(e.optionalTypes=t)}}function d(t){e(t,`value`)||(t.type===String?t.value=``:t.type===Number?t.value=0:t.type===Boolean?t.value=!1:t.type===Array&&(t.value=[]))}function f(e,t,n){if(!n||e.type===null)return;let r=t&&typeof t==`object`&&!Array.isArray(t)?t:void 0,i=c(r?[r.type,r.optionalTypes]:t),a=i.includes(null),o=i.filter(e=>e!==null).length>1,s=r?.required!==!0;(a||o||s)&&(a||d(e),e.type=null,delete e.optionalTypes)}function p(t,n){let r={};return t&&Object.entries(t).forEach(([t,i])=>{if(i!==void 0){if(i===null){r[t]={type:null};return}if(Array.isArray(i)||typeof i==`function`){let a={};u(a,i),e(a,`type`)||(a.type=null),f(a,i,n),r[t]=a;return}if(typeof i==`object`){if(t.endsWith(`Modifiers`)&&Object.keys(i).length===0){r[t]={type:Object,value:{}};return}let a={};if(`type`in i&&i.type!==void 0&&u(a,i.type),Array.isArray(i.optionalTypes)){let e=i.optionalTypes.map(e=>s(e)).filter(e=>e!=null);if(e.length>0){let t=Array.isArray(a.optionalTypes)?a.optionalTypes:[];for(let n of e)n!==a.type&&(t.includes(n)||t.push(n));t.length>0&&(a.optionalTypes=t)}}`observer`in i&&(typeof i.observer==`function`||typeof i.observer==`string`)&&(a.observer=i.observer);let o=`default`in i?i.default:i.value;o!==void 0&&(a.value=typeof o==`function`?o():o),e(a,`type`)||(a.type=null),f(a,i,n),r[t]=a}}}),r}function m(o,s,c){let l=!!(o[i]??o[a]),{[i]:u,[a]:d,...f}=o,m=o.properties,h=m&&typeof m==`object`&&Object.keys(m).length>0?m:void 0,g=c??h,_=!!(s||g),v=i=>{let a={...i??{}};return _?(e(a,n)||(a[n]={type:String,value:``}),e(a,r)||(a[r]={type:null,value:null}),e(a,t)||(a[t]={type:null,value:null}),a):a};if(g){let{properties:e,...t}=f,n=g,r=p(s,l);return{...t,properties:v({...r,...n})}}return{...f,properties:v(p(s,l))}}export{m as normalizeProps};
@@ -1 +1 @@
1
- import{requireRuntimeCapability as e,runtimeCapabilityRegistry as t}from"../capabilities.mjs";import{runTeardownSteps as n}from"../teardown.mjs";import{hasOwn as r}from"../../utils.mjs";import{cloneSnapshotValue as i,isDeepEqualValue as a}from"../app/setData/snapshot.mjs";import{decodeWxmlEntities as o,resolveDatasetEventValue as s}from"../inlineDataset.mjs";import{getOwnerProxy as c,getOwnerSnapshot as l,getOwnerTarget as u,subscribeOwner as d}from"../scopedSlots.mjs";import{WEVU_BINDING_MANIFEST_KEY as f,WEVU_INLINE_HANDLER as p,WEVU_INLINE_MAP_KEY as m,WEVU_LAYOUT_HOSTS_KEY as h,WEVU_OWNER_HANDLER as g,WEVU_PROPS_DERIVED_KEYS_KEY as _,WEVU_PUBLIC_RUNTIME_KEY as v,WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY as y,WEVU_SLOT_FUNCTION_TOKEN as b,WEVU_SLOT_OWNER_ID_KEY as x,WEVU_SLOT_OWNER_ID_PROP as S,WEVU_SLOT_OWNER_KEY as C,WEVU_SLOT_OWNER_PROXY_KEY as w,WEVU_SLOT_PROPS_DATA_KEY as T,WEVU_SLOT_PROPS_KEY as E,WEVU_SLOT_SCOPE_KEY as D,WEVU_TEMPLATE_REFS_KEY as O}from"@weapp-core/constants";const k=[x,S,w,C,T,E,D];function A(e){var t,n,r,i;let a=(t=(n=e==null||(r=e.currentTarget)==null?void 0:r.dataset)==null?e==null||(i=e.target)==null?void 0:i.dataset:n)==null?{}:t,c=s(a,`wvArgs`,e),l=[];if(Array.isArray(c))l=c;else if(typeof c==`string`)try{l=JSON.parse(c)}catch(e){try{l=JSON.parse(o(c))}catch(e){l=[]}}return Array.isArray(l)||(l=[]),l.map(t=>t===`$event`?e:t)}function j(e){if(!e||typeof e!=`object`)return{};if(Array.isArray(e)){let t={};for(let n=0;n<e.length;n+=2){let r=e[n];typeof r==`string`&&r&&(t[r]=e[n+1])}return t}return e}function M(e){return Array.isArray(e)&&e[0]===b&&typeof e[1]==`string`}function N(e,t){return(...n)=>{var r;let i=e==null||(r=e.selectOwnerComponent)==null?void 0:r.call(e),a=i==null?void 0:i[p];if(typeof a!=`function`)return;let o={wd:1,wi:t[1]},s=Array.isArray(t[2])?t[2]:[],c=Array.isArray(t[3])?t[3]:[];s.forEach((e,t)=>o[`wvS${t}`]=e),c.forEach((e,t)=>o[`wvI${t}`]=e);let l={type:`wv-slot-function`,detail:n,currentTarget:{dataset:o},target:{dataset:o}};return a.call(i,l)}}function P(e,t){let n={};for(let[r,i]of Object.entries(t))n[r]=M(i)?N(e,i):i;return n}function F(e){var t,n,r,i;return(t=(n=e==null||(r=e.__wevu)==null?void 0:r.proxy)==null?e==null||(i=e[v])==null?void 0:i.proxy:n)==null?e:t}function I(e,t){if(!t||Object.keys(t).length===0)return;let n=F(e),r={};for(let[e,i]of Object.entries(t))try{let t;typeof i==`function`?t=i.call(n):typeof(i==null?void 0:i.get)==`function`&&(t=i.get.call(n)),t!==void 0&&(r[e]=t)}catch(e){}return r}function L(e){var t,n;e==null||(t=e.__wevu)==null||(n=t.__wevu_flushSetupSnapshotSync)==null||n.call(t)}function R(e,t,n){var o;L(e);let s=I(e,t);if(!s||typeof(e==null?void 0:e.setData)!=`function`)return;let c=r(e,`__wvScopedSlotComputedSnapshot`),l=(o=e.__wvScopedSlotComputedSnapshot)==null?{}:o,u={},d={};for(let[e,t]of Object.entries(s))u[e]=i(t),(n!=null&&n.force||!c||!r(l,e)||!a(l[e],t,20,{keys:1e4}))&&(d[e]=t);for(let e of Object.keys(l))r(s,e)||(d[e]=null);e.__wvScopedSlotComputedSnapshot=u,Object.keys(d).length>0&&e.setData(d)}function z(e,t){var n,o,s,c,l;let u=r(t==null?{}:t,D)?t[D]:e==null||(n=e.properties)==null?void 0:n[D],d=r(t==null?{}:t,E)?t[E]:e==null||(o=e.properties)==null?void 0:o[E],f=j(u),p=j(d),m={...f,...p},h=!r(e,`__wvSlotPropsSnapshot`)||!a((s=e.__wvSlotPropsSnapshot)==null?{}:s,m,20,{keys:1e4}),g=h||!e[T]?P(e,m):e[T];h&&(e.__wvSlotPropsSnapshot=i(m)),e[T]=g;let _=e==null||(c=e.__wevu)==null?void 0:c.state,v=!(!_||typeof _!=`object`||r(_,T)&&a((l=_[T])==null?{}:l,m,20,{keys:1e4}));return _&&typeof _==`object`&&(_[T]=g),{merged:g,runtimeSnapshotChanged:v,snapshot:m,snapshotChanged:h}}function B(e,t,n){let{runtimeSnapshotChanged:r,snapshot:i,snapshotChanged:a}=z(e,n);(a||r)&&typeof(e==null?void 0:e.setData)==`function`&&e.setData({[T]:i}),a&&R(e,t)}function V(e,t){var n;let r=!1;e[w]!==t&&(e[w]=t,r=!0);let i=e==null?void 0:e.data;if(i&&typeof i==`object`&&i[w]!==t){try{Object.defineProperty(i,w,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){i[w]=t}r=!0}let a=e==null||(n=e.__wevu)==null?void 0:n.state;return a&&typeof a==`object`&&a[w]!==t&&(a[w]=t,r=!0),r}function H(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function U(e,t,n,r){if(typeof e==`function`){n[t]=e;return}if(typeof e!=`object`||!e)return e;if(r.has(e))return;if(Array.isArray(e)){r.add(e);let i=e.map((e,i)=>{let a=U(e,`${t}.${i}`,n,r);return a===void 0?null:a});return r.delete(e),i}if(!H(e))return i(e);r.add(e);let a={};for(let[i,o]of Object.entries(e)){let e=U(o,`${t}.${i}`,n,r);e!==void 0&&(a[i]=e)}return r.delete(e),a}function W(e){let t={},n=U(e,C,t,/* @__PURE__ */ new WeakSet);return{[C]:n,...t}}function G(e,t,n,o){var s;let c=V(e,n),{snapshotChanged:l}=z(e),u=t||{},d=!r(e,`__wvOwnerSnapshot`)||!a((s=e.__wvOwnerSnapshot)==null?{}:s,u,20,{keys:1e4});if(d){var f;e.__wvOwnerSnapshot=i(u),e[C]=u;let t=e==null||(f=e.__wevu)==null?void 0:f.state;t&&typeof t==`object`&&(t[C]=u)}d&&typeof(e==null?void 0:e.setData)==`function`&&e.setData(W(u)),(d||c||l)&&R(e,o)}function K(e,t,n){if(!t){typeof(e==null?void 0:e.__wvOwnerUnsub)==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerUnsub=void 0,e.__wvOwnerBoundId=``,V(e,void 0);return}let r=(t,r)=>{G(e,t,r,n)};e.__wvOwnerBoundId!==t&&(typeof e.__wvOwnerUnsub==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerBoundId=t,e.__wvOwnerUnsub=d(t,r));let i=l(t);i&&r(i,c(t))}function q(e){var t,n,r,i;return(t=(n=e==null||(r=e.properties)==null?void 0:r[S])==null?e==null||(i=e.properties)==null?void 0:i[x]:n)==null?``:t}function J(e,t){B(e,t);let n=q(e);n&&K(e,n,t)}function Y(){let e={[C]:{},[T]:{}};return Object.defineProperty(e,w,{value:void 0,configurable:!0,enumerable:!1,writable:!0}),e}function X(r){let i=r==null?void 0:r.computed,a=r==null?void 0:r.layoutHosts,o=r==null?void 0:r.templateRefs;o!=null&&o.length&&e(`templateRefs`,`createWevuScopedSlotComponent(templateRefs)`);let c=!!(r!=null&&r.inlineMap&&Object.keys(r.inlineMap).length);c&&e(`inlineEvents`,`createWevuScopedSlotComponent(inlineMap)`),a!=null&&a.length&&e(`layout`,`createWevuScopedSlotComponent(layoutHosts)`);let l=e=>{let t=q(e);return t?u(t):void 0},d={[y]:!0,options:{virtualHost:!0},setData:{omit:k},[_]:k,properties:{[S]:{type:String,value:``,observer(e){K(this,e||``,i)}},[x]:{type:String,value:``,observer(e){K(this,e||``,i)}},[E]:{type:null,value:null,observer(e){B(this,i,{[E]:e})}},[D]:{type:null,value:null,observer(e){B(this,i,{[D]:e})}}},data:Y,lifetimes:{attached(){J(this,i)},ready(){J(this,i),R(this,i,{force:!0});let e=l(this);if(e&&o!=null&&o.length){var n;(n=t.templateRefs)==null||n.schedule(this,void 0,e)}},detached(){let e=l(this);n([()=>{if(e&&o!=null&&o.length){var n;(n=t.templateRefs)==null||n.clear(this,e)}},()=>{typeof this.__wvOwnerUnsub==`function`&&this.__wvOwnerUnsub()},()=>{this.__wvOwnerUnsub=void 0,this.__wvOwnerBoundId=``},()=>V(this,void 0)])}},methods:{[g](e){var n,r,i,a,o;let l=this[w],u=(n=this.__wevu)==null||(n=n.methods)==null?void 0:n[m];if(c){var d;let n=(d=t.inlineEvents)==null?void 0:d.run(l,void 0,e,u);if(n!==void 0)return n}if(!l)return;let f=(r=(i=e==null||(a=e.currentTarget)==null?void 0:a.dataset)==null?e==null||(o=e.target)==null?void 0:o.dataset:i)==null?{}:r,p=s(f,`wvHandler`,e);if(typeof p!=`string`||!p)return;let h=l==null?void 0:l[p];if(typeof h!=`function`)return;let g=A(e);return h.apply(l,g)}}};return r!=null&&r.computed&&Object.keys(r.computed).length>0&&(d.computed=r.computed),r!=null&&r.inlineMap&&Object.keys(r.inlineMap).length>0&&(d.methods={...d.methods,[m]:r.inlineMap}),o!=null&&o.length&&(d[O]=o),a!=null&&a.length&&(d[h]=a),r!=null&&r[f]&&(d[f]=r[f]),d}export{X as createScopedSlotOptions};
1
+ import{requireRuntimeCapability as e,runtimeCapabilityRegistry as t}from"../capabilities.mjs";import{runTeardownSteps as n}from"../teardown.mjs";import{hasOwn as r}from"../../utils.mjs";import{cloneSnapshotValue as i,isDeepEqualValue as a}from"../app/setData/snapshot.mjs";import{decodeWxmlEntities as o,resolveDatasetEventValue as s}from"../inlineDataset.mjs";import{getOwnerProxy as c,getOwnerSnapshot as l,getOwnerTarget as u,subscribeOwner as d}from"../scopedSlots.mjs";import{WEVU_BINDING_MANIFEST_KEY as f,WEVU_INLINE_HANDLER as p,WEVU_INLINE_MAP_KEY as m,WEVU_LAYOUT_HOSTS_KEY as h,WEVU_OWNER_HANDLER as g,WEVU_PROPS_DERIVED_KEYS_KEY as _,WEVU_PUBLIC_RUNTIME_KEY as v,WEVU_SCOPED_SLOT_OWNER_REQUIRED_KEY as y,WEVU_SLOT_FUNCTION_TOKEN as b,WEVU_SLOT_OWNER_ID_KEY as x,WEVU_SLOT_OWNER_ID_PROP as S,WEVU_SLOT_OWNER_KEY as C,WEVU_SLOT_OWNER_PROXY_KEY as w,WEVU_SLOT_PROPS_DATA_KEY as T,WEVU_SLOT_PROPS_KEY as E,WEVU_SLOT_SCOPE_KEY as D,WEVU_TEMPLATE_REFS_KEY as O}from"@weapp-core/constants";const k=[x,S,w,C,T,E,D];function A(e){let t=e?.currentTarget?.dataset??e?.target?.dataset??{},n=s(t,`wvArgs`,e),r=[];if(Array.isArray(n))r=n;else if(typeof n==`string`)try{r=JSON.parse(n)}catch{try{r=JSON.parse(o(n))}catch{r=[]}}return Array.isArray(r)||(r=[]),r.map(t=>t===`$event`?e:t)}function j(e){if(!e||typeof e!=`object`)return{};if(Array.isArray(e)){let t={};for(let n=0;n<e.length;n+=2){let r=e[n];typeof r==`string`&&r&&(t[r]=e[n+1])}return t}return e}function M(e){return Array.isArray(e)&&e[0]===b&&typeof e[1]==`string`}function N(e,t){return(...n)=>{let r=e?.selectOwnerComponent?.(),i=r?.[p];if(typeof i!=`function`)return;let a={wd:1,wi:t[1]},o=Array.isArray(t[2])?t[2]:[],s=Array.isArray(t[3])?t[3]:[];o.forEach((e,t)=>a[`wvS${t}`]=e),s.forEach((e,t)=>a[`wvI${t}`]=e);let c={type:`wv-slot-function`,detail:n,currentTarget:{dataset:a},target:{dataset:a}};return i.call(r,c)}}function P(e,t){let n={};for(let[r,i]of Object.entries(t))n[r]=M(i)?N(e,i):i;return n}function F(e){return e?.__wevu?.proxy??e?.[v]?.proxy??e}function I(e,t){if(!t||Object.keys(t).length===0)return;let n=F(e),r={};for(let[e,i]of Object.entries(t))try{let t;typeof i==`function`?t=i.call(n):typeof i?.get==`function`&&(t=i.get.call(n)),t!==void 0&&(r[e]=t)}catch{}return r}function L(e){e?.__wevu?.__wevu_flushSetupSnapshotSync?.()}function R(e,t,n){L(e);let o=I(e,t);if(!o||typeof e?.setData!=`function`)return;let s=r(e,`__wvScopedSlotComputedSnapshot`),c=e.__wvScopedSlotComputedSnapshot??{},l={},u={};for(let[e,t]of Object.entries(o))l[e]=i(t),(n?.force||!s||!r(c,e)||!a(c[e],t,20,{keys:1e4}))&&(u[e]=t);for(let e of Object.keys(c))r(o,e)||(u[e]=null);e.__wvScopedSlotComputedSnapshot=l,Object.keys(u).length>0&&e.setData(u)}function z(e,t){let n=r(t??{},D)?t[D]:e?.properties?.[D],o=r(t??{},E)?t[E]:e?.properties?.[E],s=j(n),c=j(o),l={...s,...c},u=!r(e,`__wvSlotPropsSnapshot`)||!a(e.__wvSlotPropsSnapshot??{},l,20,{keys:1e4}),d=u||!e[T]?P(e,l):e[T];u&&(e.__wvSlotPropsSnapshot=i(l)),e[T]=d;let f=e?.__wevu?.state,p=!(!f||typeof f!=`object`||r(f,T)&&a(f[T]??{},l,20,{keys:1e4}));return f&&typeof f==`object`&&(f[T]=d),{merged:d,runtimeSnapshotChanged:p,snapshot:l,snapshotChanged:u}}function B(e,t,n){let{runtimeSnapshotChanged:r,snapshot:i,snapshotChanged:a}=z(e,n);(a||r)&&typeof e?.setData==`function`&&e.setData({[T]:i}),a&&R(e,t)}function V(e,t){let n=!1;e[w]!==t&&(e[w]=t,n=!0);let r=e?.data;if(r&&typeof r==`object`&&r[w]!==t){try{Object.defineProperty(r,w,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch{r[w]=t}n=!0}let i=e?.__wevu?.state;return i&&typeof i==`object`&&i[w]!==t&&(i[w]=t,n=!0),n}function H(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function U(e,t,n,r){if(typeof e==`function`){n[t]=e;return}if(typeof e!=`object`||!e)return e;if(r.has(e))return;if(Array.isArray(e)){r.add(e);let i=e.map((e,i)=>{let a=U(e,`${t}.${i}`,n,r);return a===void 0?null:a});return r.delete(e),i}if(!H(e))return i(e);r.add(e);let a={};for(let[i,o]of Object.entries(e)){let e=U(o,`${t}.${i}`,n,r);e!==void 0&&(a[i]=e)}return r.delete(e),a}function W(e){let t={},n=U(e,C,t,/* @__PURE__ */ new WeakSet);return{[C]:n,...t}}function G(e,t,n,o){let s=V(e,n),{snapshotChanged:c}=z(e),l=t||{},u=!r(e,`__wvOwnerSnapshot`)||!a(e.__wvOwnerSnapshot??{},l,20,{keys:1e4});if(u){e.__wvOwnerSnapshot=i(l),e[C]=l;let t=e?.__wevu?.state;t&&typeof t==`object`&&(t[C]=l)}u&&typeof e?.setData==`function`&&e.setData(W(l)),(u||s||c)&&R(e,o)}function K(e,t,n){if(!t){typeof e?.__wvOwnerUnsub==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerUnsub=void 0,e.__wvOwnerBoundId=``,V(e,void 0);return}let r=(t,r)=>{G(e,t,r,n)};e.__wvOwnerBoundId!==t&&(typeof e.__wvOwnerUnsub==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerBoundId=t,e.__wvOwnerUnsub=d(t,r));let i=l(t);i&&r(i,c(t))}function q(e){return e?.properties?.[S]??e?.properties?.[x]??``}function J(e,t){B(e,t);let n=q(e);n&&K(e,n,t)}function Y(){let e={[C]:{},[T]:{}};return Object.defineProperty(e,w,{value:void 0,configurable:!0,enumerable:!1,writable:!0}),e}function X(r){let i=r?.computed,a=r?.layoutHosts,o=r?.templateRefs;o?.length&&e(`templateRefs`,`createWevuScopedSlotComponent(templateRefs)`);let c=!!(r?.inlineMap&&Object.keys(r.inlineMap).length);c&&e(`inlineEvents`,`createWevuScopedSlotComponent(inlineMap)`),a?.length&&e(`layout`,`createWevuScopedSlotComponent(layoutHosts)`);let l=e=>{let t=q(e);return t?u(t):void 0},d={[y]:!0,options:{virtualHost:!0},setData:{omit:k},[_]:k,properties:{[S]:{type:String,value:``,observer(e){K(this,e||``,i)}},[x]:{type:String,value:``,observer(e){K(this,e||``,i)}},[E]:{type:null,value:null,observer(e){B(this,i,{[E]:e})}},[D]:{type:null,value:null,observer(e){B(this,i,{[D]:e})}}},data:Y,lifetimes:{attached(){J(this,i)},ready(){J(this,i),R(this,i,{force:!0});let e=l(this);e&&o?.length&&t.templateRefs?.schedule(this,void 0,e)},detached(){let e=l(this);n([()=>{e&&o?.length&&t.templateRefs?.clear(this,e)},()=>{typeof this.__wvOwnerUnsub==`function`&&this.__wvOwnerUnsub()},()=>{this.__wvOwnerUnsub=void 0,this.__wvOwnerBoundId=``},()=>V(this,void 0)])}},methods:{[g](e){let n=this[w],r=this.__wevu?.methods?.[m];if(c){let i=t.inlineEvents?.run(n,void 0,e,r);if(i!==void 0)return i}if(!n)return;let i=e?.currentTarget?.dataset??e?.target?.dataset??{},a=s(i,`wvHandler`,e);if(typeof a!=`string`||!a)return;let o=n?.[a];if(typeof o!=`function`)return;let l=A(e);return o.apply(n,l)}}};return r?.computed&&Object.keys(r.computed).length>0&&(d.computed=r.computed),r?.inlineMap&&Object.keys(r.inlineMap).length>0&&(d.methods={...d.methods,[m]:r.inlineMap}),o?.length&&(d[O]=o),a?.length&&(d[h]=a),r?.[f]&&(d[f]=r[f]),d}export{X as createScopedSlotOptions};