@vue/compat 3.5.0-alpha.5 → 3.5.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.0-alpha.5
2
+ * @vue/compat v3.5.0-beta.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -7,7 +7,7 @@
7
7
 
8
8
  var parser = require('@babel/parser');
9
9
  var estreeWalker = require('estree-walker');
10
- var decode_js = require('entities/lib/decode.js');
10
+ var decode_js = require('entities/dist/decode.js');
11
11
  var sourceMapJs = require('source-map-js');
12
12
 
13
13
  /*! #__NO_SIDE_EFFECTS__ */
@@ -68,9 +68,11 @@ const cacheStringFunction = (fn) => {
68
68
  };
69
69
  };
70
70
  const camelizeRE = /-(\w)/g;
71
- const camelize = cacheStringFunction((str) => {
72
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
73
- });
71
+ const camelize = cacheStringFunction(
72
+ (str) => {
73
+ return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
74
+ }
75
+ );
74
76
  const hyphenateRE = /\B([A-Z])/g;
75
77
  const hyphenate = cacheStringFunction(
76
78
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
@@ -78,10 +80,12 @@ const hyphenate = cacheStringFunction(
78
80
  const capitalize = cacheStringFunction((str) => {
79
81
  return str.charAt(0).toUpperCase() + str.slice(1);
80
82
  });
81
- const toHandlerKey = cacheStringFunction((str) => {
82
- const s = str ? `on${capitalize(str)}` : ``;
83
- return s;
84
- });
83
+ const toHandlerKey = cacheStringFunction(
84
+ (str) => {
85
+ const s = str ? `on${capitalize(str)}` : ``;
86
+ return s;
87
+ }
88
+ );
85
89
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
86
90
  const invokeArrayFns = (fns, ...arg) => {
87
91
  for (let i = 0; i < fns.length; i++) {
@@ -361,6 +365,7 @@ class EffectScope {
361
365
  * @internal
362
366
  */
363
367
  this.cleanups = [];
368
+ this._isPaused = false;
364
369
  this.parent = activeEffectScope;
365
370
  if (!detached && activeEffectScope) {
366
371
  this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
@@ -371,6 +376,37 @@ class EffectScope {
371
376
  get active() {
372
377
  return this._active;
373
378
  }
379
+ pause() {
380
+ if (this._active) {
381
+ this._isPaused = true;
382
+ if (this.scopes) {
383
+ for (let i = 0, l = this.scopes.length; i < l; i++) {
384
+ this.scopes[i].pause();
385
+ }
386
+ }
387
+ for (let i = 0, l = this.effects.length; i < l; i++) {
388
+ this.effects[i].pause();
389
+ }
390
+ }
391
+ }
392
+ /**
393
+ * Resumes the effect scope, including all child scopes and effects.
394
+ */
395
+ resume() {
396
+ if (this._active) {
397
+ if (this._isPaused) {
398
+ this._isPaused = false;
399
+ if (this.scopes) {
400
+ for (let i = 0, l = this.scopes.length; i < l; i++) {
401
+ this.scopes[i].resume();
402
+ }
403
+ }
404
+ for (let i = 0, l = this.effects.length; i < l; i++) {
405
+ this.effects[i].resume();
406
+ }
407
+ }
408
+ }
409
+ }
374
410
  run(fn) {
375
411
  if (this._active) {
376
412
  const currentEffectScope = activeEffectScope;
@@ -435,6 +471,7 @@ function onScopeDispose(fn, failSilently = false) {
435
471
  }
436
472
 
437
473
  let activeSub;
474
+ const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
438
475
  class ReactiveEffect {
439
476
  constructor(fn) {
440
477
  this.fn = fn;
@@ -463,6 +500,18 @@ class ReactiveEffect {
463
500
  activeEffectScope.effects.push(this);
464
501
  }
465
502
  }
503
+ pause() {
504
+ this.flags |= 128;
505
+ }
506
+ resume() {
507
+ if (this.flags & 128) {
508
+ this.flags &= ~128;
509
+ if (pausedQueueEffects.has(this)) {
510
+ pausedQueueEffects.delete(this);
511
+ this.trigger();
512
+ }
513
+ }
514
+ }
466
515
  /**
467
516
  * @internal
468
517
  */
@@ -511,7 +560,9 @@ class ReactiveEffect {
511
560
  }
512
561
  }
513
562
  trigger() {
514
- if (this.scheduler) {
563
+ if (this.flags & 128) {
564
+ pausedQueueEffects.add(this);
565
+ } else if (this.scheduler) {
515
566
  this.scheduler();
516
567
  } else {
517
568
  this.runIfDirty();
@@ -802,9 +853,15 @@ function addSub(link) {
802
853
  link.dep.subs = link;
803
854
  }
804
855
  const targetMap = /* @__PURE__ */ new WeakMap();
805
- const ITERATE_KEY = Symbol("");
806
- const MAP_KEY_ITERATE_KEY = Symbol("");
807
- const ARRAY_ITERATE_KEY = Symbol("");
856
+ const ITERATE_KEY = Symbol(
857
+ ""
858
+ );
859
+ const MAP_KEY_ITERATE_KEY = Symbol(
860
+ ""
861
+ );
862
+ const ARRAY_ITERATE_KEY = Symbol(
863
+ ""
864
+ );
808
865
  function track(target, type, key) {
809
866
  if (shouldTrack && activeSub) {
810
867
  let depsMap = targetMap.get(target);
@@ -1083,7 +1140,7 @@ class BaseReactiveHandler {
1083
1140
  return isShallow2;
1084
1141
  } else if (key === "__v_raw") {
1085
1142
  if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
1086
- // this means the reciever is a user proxy of the reactive proxy
1143
+ // this means the receiver is a user proxy of the reactive proxy
1087
1144
  Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
1088
1145
  return target;
1089
1146
  }
@@ -1195,9 +1252,7 @@ class ReadonlyReactiveHandler extends BaseReactiveHandler {
1195
1252
  }
1196
1253
  const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
1197
1254
  const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
1198
- const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
1199
- true
1200
- );
1255
+ const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
1201
1256
  const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
1202
1257
 
1203
1258
  const toShallow = (value) => value;
@@ -1649,13 +1704,14 @@ function proxyRefs(objectWithRefs) {
1649
1704
  class CustomRefImpl {
1650
1705
  constructor(factory) {
1651
1706
  this["__v_isRef"] = true;
1707
+ this._value = void 0;
1652
1708
  const dep = this.dep = new Dep();
1653
1709
  const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));
1654
1710
  this._get = get;
1655
1711
  this._set = set;
1656
1712
  }
1657
1713
  get value() {
1658
- return this._get();
1714
+ return this._value = this._get();
1659
1715
  }
1660
1716
  set value(newVal) {
1661
1717
  this._set(newVal);
@@ -1677,10 +1733,11 @@ class ObjectRefImpl {
1677
1733
  this._key = _key;
1678
1734
  this._defaultValue = _defaultValue;
1679
1735
  this["__v_isRef"] = true;
1736
+ this._value = void 0;
1680
1737
  }
1681
1738
  get value() {
1682
1739
  const val = this._object[this._key];
1683
- return val === void 0 ? this._defaultValue : val;
1740
+ return this._value = val === void 0 ? this._defaultValue : val;
1684
1741
  }
1685
1742
  set value(newVal) {
1686
1743
  this._object[this._key] = newVal;
@@ -1694,9 +1751,10 @@ class GetterRefImpl {
1694
1751
  this._getter = _getter;
1695
1752
  this["__v_isRef"] = true;
1696
1753
  this["__v_isReadonly"] = true;
1754
+ this._value = void 0;
1697
1755
  }
1698
1756
  get value() {
1699
- return this._getter();
1757
+ return this._value = this._getter();
1700
1758
  }
1701
1759
  }
1702
1760
  function toRef(source, key, defaultValue) {
@@ -1730,7 +1788,8 @@ class ComputedRefImpl {
1730
1788
  /**
1731
1789
  * @internal
1732
1790
  */
1733
- this["__v_isRef"] = true;
1791
+ this.__v_isRef = true;
1792
+ // TODO isolatedDeclarations "__v_isReadonly"
1734
1793
  // A computed is also a subscriber that tracks other deps
1735
1794
  /**
1736
1795
  * @internal
@@ -3410,9 +3469,10 @@ function createHydrationFunctions(rendererInternals) {
3410
3469
  }
3411
3470
  if (props) {
3412
3471
  if (forcePatch || !optimized || patchFlag & (16 | 32)) {
3472
+ const isCustomElement = el.tagName.includes("-");
3413
3473
  for (const key in props) {
3414
3474
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
3415
- key[0] === ".") {
3475
+ key[0] === "." || isCustomElement) {
3416
3476
  patchProp(el, key, null, props[key], void 0, parentComponent);
3417
3477
  }
3418
3478
  }
@@ -3612,24 +3672,19 @@ function isMismatchAllowed(el, allowedType) {
3612
3672
  }
3613
3673
  }
3614
3674
 
3615
- const hydrateOnIdle = () => (hydrate) => {
3616
- const id = requestIdleCallback(hydrate);
3675
+ const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
3676
+ const id = requestIdleCallback(hydrate, { timeout });
3617
3677
  return () => cancelIdleCallback(id);
3618
3678
  };
3619
- const hydrateOnVisible = (margin = 0) => (hydrate, forEach) => {
3620
- const ob = new IntersectionObserver(
3621
- (entries) => {
3622
- for (const e of entries) {
3623
- if (!e.isIntersecting) continue;
3624
- ob.disconnect();
3625
- hydrate();
3626
- break;
3627
- }
3628
- },
3629
- {
3630
- rootMargin: isString(margin) ? margin : margin + "px"
3679
+ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
3680
+ const ob = new IntersectionObserver((entries) => {
3681
+ for (const e of entries) {
3682
+ if (!e.isIntersecting) continue;
3683
+ ob.disconnect();
3684
+ hydrate();
3685
+ break;
3631
3686
  }
3632
- );
3687
+ }, opts);
3633
3688
  forEach((el) => ob.observe(el));
3634
3689
  return () => ob.disconnect();
3635
3690
  };
@@ -3927,7 +3982,7 @@ const KeepAliveImpl = {
3927
3982
  }
3928
3983
  function pruneCacheEntry(key) {
3929
3984
  const cached = cache.get(key);
3930
- if (!current || !isSameVNodeType(cached, current)) {
3985
+ if (cached && (!current || !isSameVNodeType(cached, current))) {
3931
3986
  unmount(cached);
3932
3987
  } else if (current) {
3933
3988
  resetShapeFlag(current);
@@ -3986,6 +4041,10 @@ const KeepAliveImpl = {
3986
4041
  return rawVNode;
3987
4042
  }
3988
4043
  let vnode = getInnerChild(rawVNode);
4044
+ if (vnode.type === Comment) {
4045
+ current = null;
4046
+ return vnode;
4047
+ }
3989
4048
  const comp = vnode.type;
3990
4049
  const name = getComponentName(
3991
4050
  isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
@@ -4113,17 +4172,19 @@ const createHook = (lifecycle) => (hook, target = currentInstance) => {
4113
4172
  };
4114
4173
  const onBeforeMount = createHook("bm");
4115
4174
  const onMounted = createHook("m");
4116
- const onBeforeUpdate = createHook("bu");
4175
+ const onBeforeUpdate = createHook(
4176
+ "bu"
4177
+ );
4117
4178
  const onUpdated = createHook("u");
4118
- const onBeforeUnmount = createHook("bum");
4119
- const onUnmounted = createHook("um");
4120
- const onServerPrefetch = createHook("sp");
4121
- const onRenderTriggered = createHook(
4122
- "rtg"
4179
+ const onBeforeUnmount = createHook(
4180
+ "bum"
4123
4181
  );
4124
- const onRenderTracked = createHook(
4125
- "rtc"
4182
+ const onUnmounted = createHook("um");
4183
+ const onServerPrefetch = createHook(
4184
+ "sp"
4126
4185
  );
4186
+ const onRenderTriggered = createHook("rtg");
4187
+ const onRenderTracked = createHook("rtc");
4127
4188
  function onErrorCaptured(hook, target = currentInstance) {
4128
4189
  injectHook("ec", hook, target);
4129
4190
  }
@@ -4525,9 +4586,14 @@ function createSlots(slots, dynamicSlots) {
4525
4586
  }
4526
4587
 
4527
4588
  function renderSlot(slots, name, props = {}, fallback, noSlotted) {
4528
- if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
4589
+ if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
4529
4590
  if (name !== "default") props.name = name;
4530
- return createVNode("slot", props, fallback && fallback());
4591
+ return openBlock(), createBlock(
4592
+ Fragment,
4593
+ null,
4594
+ [createVNode("slot", props, fallback && fallback())],
4595
+ 64
4596
+ );
4531
4597
  }
4532
4598
  let slot = slots[name];
4533
4599
  if (slot && slot._c) {
@@ -4813,6 +4879,7 @@ const publicPropertiesMap = (
4813
4879
  $refs: (i) => i.refs,
4814
4880
  $parent: (i) => getPublicInstance(i.parent),
4815
4881
  $root: (i) => getPublicInstance(i.root),
4882
+ $host: (i) => i.ce,
4816
4883
  $emit: (i) => i.emit,
4817
4884
  $options: (i) => resolveMergedOptions(i) ,
4818
4885
  $forceUpdate: (i) => i.f || (i.f = () => {
@@ -4931,22 +4998,18 @@ const PublicInstanceProxyHandlers = {
4931
4998
  return Reflect.defineProperty(target, key, descriptor);
4932
4999
  }
4933
5000
  };
4934
- const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend$1(
4935
- {},
4936
- PublicInstanceProxyHandlers,
4937
- {
4938
- get(target, key) {
4939
- if (key === Symbol.unscopables) {
4940
- return;
4941
- }
4942
- return PublicInstanceProxyHandlers.get(target, key, target);
4943
- },
4944
- has(_, key) {
4945
- const has = key[0] !== "_" && !isGloballyAllowed(key);
4946
- return has;
5001
+ const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend$1({}, PublicInstanceProxyHandlers, {
5002
+ get(target, key) {
5003
+ if (key === Symbol.unscopables) {
5004
+ return;
4947
5005
  }
5006
+ return PublicInstanceProxyHandlers.get(target, key, target);
5007
+ },
5008
+ has(_, key) {
5009
+ const has = key[0] !== "_" && !isGloballyAllowed(key);
5010
+ return has;
4948
5011
  }
4949
- );
5012
+ });
4950
5013
 
4951
5014
  function deepMergeData(to, from) {
4952
5015
  for (const key in from) {
@@ -5439,7 +5502,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5439
5502
  return vm;
5440
5503
  }
5441
5504
  }
5442
- Vue.version = `2.6.14-compat:${"3.5.0-alpha.5"}`;
5505
+ Vue.version = `2.6.14-compat:${"3.5.0-beta.1"}`;
5443
5506
  Vue.config = singletonApp.config;
5444
5507
  Vue.use = (plugin, ...options) => {
5445
5508
  if (plugin && isFunction(plugin.install)) {
@@ -5680,7 +5743,7 @@ function installCompatMount(app, context, render) {
5680
5743
  /* skip options */
5681
5744
  );
5682
5745
  }
5683
- container.innerHTML = "";
5746
+ container.textContent = "";
5684
5747
  render(vnode, container, namespace);
5685
5748
  if (container instanceof Element) {
5686
5749
  container.removeAttribute("v-cloak");
@@ -5852,7 +5915,7 @@ function createAppAPI(render, hydrate) {
5852
5915
  },
5853
5916
  mount(rootContainer, isHydrate, namespace) {
5854
5917
  if (!isMounted) {
5855
- const vnode = createVNode(rootComponent, rootProps);
5918
+ const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
5856
5919
  vnode.appContext = context;
5857
5920
  if (namespace === true) {
5858
5921
  namespace = "svg";
@@ -5919,7 +5982,7 @@ function provide(key, value) {
5919
5982
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
5920
5983
  const instance = currentInstance || currentRenderingInstance;
5921
5984
  if (instance || currentApp) {
5922
- const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
5985
+ const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
5923
5986
  if (provides && key in provides) {
5924
5987
  return provides[key];
5925
5988
  } else if (arguments.length > 1) {
@@ -6176,6 +6239,9 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
6176
6239
  } else {
6177
6240
  value = defaultValue;
6178
6241
  }
6242
+ if (instance.ce) {
6243
+ instance.ce._setProp(key, value);
6244
+ }
6179
6245
  }
6180
6246
  if (opt[0 /* shouldCast */]) {
6181
6247
  if (isAbsent && !hasDefault) {
@@ -6939,8 +7005,8 @@ function baseCreateRenderer(options, createHydrationFns) {
6939
7005
  const componentUpdateFn = () => {
6940
7006
  if (!instance.isMounted) {
6941
7007
  let vnodeHook;
6942
- const { el, props, type } = initialVNode;
6943
- const { bm, m, parent } = instance;
7008
+ const { el, props } = initialVNode;
7009
+ const { bm, m, parent, root, type } = instance;
6944
7010
  const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
6945
7011
  toggleRecurse(instance, false);
6946
7012
  if (bm) {
@@ -6974,6 +7040,9 @@ function baseCreateRenderer(options, createHydrationFns) {
6974
7040
  hydrateSubTree();
6975
7041
  }
6976
7042
  } else {
7043
+ if (root.ce) {
7044
+ root.ce._injectChildStyle(type);
7045
+ }
6977
7046
  const subTree = instance.subTree = renderComponentRoot(instance);
6978
7047
  patch(
6979
7048
  null,
@@ -7616,13 +7685,13 @@ function baseCreateRenderer(options, createHydrationFns) {
7616
7685
  namespace
7617
7686
  );
7618
7687
  }
7688
+ container._vnode = vnode;
7619
7689
  if (!isFlushing) {
7620
7690
  isFlushing = true;
7621
7691
  flushPreFlushCbs();
7622
7692
  flushPostFlushCbs();
7623
7693
  isFlushing = false;
7624
7694
  }
7625
- container._vnode = vnode;
7626
7695
  };
7627
7696
  const internals = {
7628
7697
  p: patch,
@@ -7783,14 +7852,16 @@ function doWatch(source, cb, {
7783
7852
  const _cb = cb;
7784
7853
  cb = (...args) => {
7785
7854
  _cb(...args);
7786
- unwatch();
7855
+ watchHandle();
7787
7856
  };
7788
7857
  }
7789
7858
  const instance = currentInstance;
7790
- const reactiveGetter = (source2) => deep === true ? source2 : (
7791
- // for deep: false, only traverse root-level properties
7792
- traverse(source2, deep === false ? 1 : void 0)
7793
- );
7859
+ const reactiveGetter = (source2) => {
7860
+ if (deep) return source2;
7861
+ if (isShallow(source2) || deep === false || deep === 0)
7862
+ return traverse(source2, 1);
7863
+ return traverse(source2);
7864
+ };
7794
7865
  let getter;
7795
7866
  let forceTrigger = false;
7796
7867
  let isMultiSource = false;
@@ -7843,7 +7914,8 @@ function doWatch(source, cb, {
7843
7914
  }
7844
7915
  if (cb && deep) {
7845
7916
  const baseGetter = getter;
7846
- getter = () => traverse(baseGetter());
7917
+ const depth = deep === true ? Infinity : deep;
7918
+ getter = () => traverse(baseGetter(), depth);
7847
7919
  }
7848
7920
  let cleanup;
7849
7921
  let onCleanup = (fn) => {
@@ -7868,7 +7940,12 @@ function doWatch(source, cb, {
7868
7940
  const ctx = useSSRContext();
7869
7941
  ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
7870
7942
  } else {
7871
- return NOOP;
7943
+ const watchHandle2 = () => {
7944
+ };
7945
+ watchHandle2.stop = NOOP;
7946
+ watchHandle2.resume = NOOP;
7947
+ watchHandle2.pause = NOOP;
7948
+ return watchHandle2;
7872
7949
  }
7873
7950
  }
7874
7951
  let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
@@ -7909,12 +7986,15 @@ function doWatch(source, cb, {
7909
7986
  }
7910
7987
  effect.scheduler = scheduler;
7911
7988
  const scope = getCurrentScope();
7912
- const unwatch = () => {
7989
+ const watchHandle = () => {
7913
7990
  effect.stop();
7914
7991
  if (scope) {
7915
7992
  remove(scope.effects, effect);
7916
7993
  }
7917
7994
  };
7995
+ watchHandle.pause = effect.pause.bind(effect);
7996
+ watchHandle.resume = effect.resume.bind(effect);
7997
+ watchHandle.stop = watchHandle;
7918
7998
  if (cb) {
7919
7999
  if (immediate) {
7920
8000
  job(true);
@@ -7929,8 +8009,8 @@ function doWatch(source, cb, {
7929
8009
  } else {
7930
8010
  effect.run();
7931
8011
  }
7932
- if (ssrCleanup) ssrCleanup.push(unwatch);
7933
- return unwatch;
8012
+ if (ssrCleanup) ssrCleanup.push(watchHandle);
8013
+ return watchHandle;
7934
8014
  }
7935
8015
  function instanceWatch(source, value, options) {
7936
8016
  const publicThis = this.proxy;
@@ -8012,7 +8092,8 @@ function useModel(props, name, options = EMPTY_OBJ) {
8012
8092
  return options.get ? options.get(localValue) : localValue;
8013
8093
  },
8014
8094
  set(value) {
8015
- if (!hasChanged(value, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
8095
+ const emittedValue = options.set ? options.set(value) : value;
8096
+ if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
8016
8097
  return;
8017
8098
  }
8018
8099
  const rawProps = i.vnode.props;
@@ -8021,7 +8102,6 @@ function useModel(props, name, options = EMPTY_OBJ) {
8021
8102
  localValue = value;
8022
8103
  trigger();
8023
8104
  }
8024
- const emittedValue = options.set ? options.set(value) : value;
8025
8105
  i.emit(`update:${name}`, emittedValue);
8026
8106
  if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
8027
8107
  trigger();
@@ -9649,11 +9729,13 @@ function useTemplateRef(key) {
9649
9729
  const r = shallowRef(null);
9650
9730
  if (i) {
9651
9731
  const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
9652
- Object.defineProperty(refs, key, {
9653
- enumerable: true,
9654
- get: () => r.value,
9655
- set: (val) => r.value = val
9656
- });
9732
+ {
9733
+ Object.defineProperty(refs, key, {
9734
+ enumerable: true,
9735
+ get: () => r.value,
9736
+ set: (val) => r.value = val
9737
+ });
9738
+ }
9657
9739
  }
9658
9740
  return r;
9659
9741
  }
@@ -9711,7 +9793,7 @@ function isMemoSame(cached, memo) {
9711
9793
  return true;
9712
9794
  }
9713
9795
 
9714
- const version = "3.5.0-alpha.5";
9796
+ const version = "3.5.0-beta.1";
9715
9797
  const warn$1 = NOOP;
9716
9798
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9717
9799
  const devtools = void 0;
@@ -9723,7 +9805,8 @@ const _ssrUtils = {
9723
9805
  setCurrentRenderingInstance,
9724
9806
  isVNode: isVNode,
9725
9807
  normalizeVNode,
9726
- getComponentPublicInstance
9808
+ getComponentPublicInstance,
9809
+ ensureValidVNode
9727
9810
  };
9728
9811
  const ssrUtils = _ssrUtils ;
9729
9812
  const resolveFilter = resolveFilter$1 ;
@@ -9737,6 +9820,17 @@ const _compatUtils = {
9737
9820
  const compatUtils = _compatUtils ;
9738
9821
  const DeprecationTypes = DeprecationTypes$1 ;
9739
9822
 
9823
+ let policy = void 0;
9824
+ const tt = typeof window !== "undefined" && window.trustedTypes;
9825
+ if (tt) {
9826
+ try {
9827
+ policy = /* @__PURE__ */ tt.createPolicy("vue", {
9828
+ createHTML: (val) => val
9829
+ });
9830
+ } catch (e) {
9831
+ }
9832
+ }
9833
+ const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
9740
9834
  const svgNS = "http://www.w3.org/2000/svg";
9741
9835
  const mathmlNS = "http://www.w3.org/1998/Math/MathML";
9742
9836
  const doc = typeof document !== "undefined" ? document : null;
@@ -9784,7 +9878,9 @@ const nodeOps = {
9784
9878
  if (start === end || !(start = start.nextSibling)) break;
9785
9879
  }
9786
9880
  } else {
9787
- templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
9881
+ templateContainer.innerHTML = unsafeToTrustedHTML(
9882
+ namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content
9883
+ );
9788
9884
  const template = templateContainer.content;
9789
9885
  if (namespace === "svg" || namespace === "mathml") {
9790
9886
  const wrapper = template.firstChild;
@@ -10497,16 +10593,24 @@ function shouldSetAsProp(el, key, value, isSVG) {
10497
10593
  if (isNativeOn(key) && isString(value)) {
10498
10594
  return false;
10499
10595
  }
10500
- return key in el;
10596
+ if (key in el) {
10597
+ return true;
10598
+ }
10599
+ if (el._isVueCE && (/[A-Z]/.test(key) || !isString(value))) {
10600
+ return true;
10601
+ }
10602
+ return false;
10501
10603
  }
10502
10604
 
10605
+ const REMOVAL = {};
10503
10606
  /*! #__NO_SIDE_EFFECTS__ */
10504
10607
  // @__NO_SIDE_EFFECTS__
10505
- function defineCustomElement(options, extraOptions, hydrate2) {
10608
+ function defineCustomElement(options, extraOptions, _createApp) {
10506
10609
  const Comp = defineComponent(options, extraOptions);
10610
+ if (isPlainObject(Comp)) extend$1(Comp, extraOptions);
10507
10611
  class VueCustomElement extends VueElement {
10508
10612
  constructor(initialProps) {
10509
- super(Comp, initialProps, hydrate2);
10613
+ super(Comp, initialProps, _createApp);
10510
10614
  }
10511
10615
  }
10512
10616
  VueCustomElement.def = Comp;
@@ -10514,42 +10618,83 @@ function defineCustomElement(options, extraOptions, hydrate2) {
10514
10618
  }
10515
10619
  /*! #__NO_SIDE_EFFECTS__ */
10516
10620
  const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
10517
- return /* @__PURE__ */ defineCustomElement(options, extraOptions, hydrate);
10621
+ return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
10518
10622
  };
10519
10623
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
10520
10624
  };
10521
10625
  class VueElement extends BaseClass {
10522
- constructor(_def, _props = {}, hydrate2) {
10626
+ constructor(_def, _props = {}, _createApp = createApp) {
10523
10627
  super();
10524
10628
  this._def = _def;
10525
10629
  this._props = _props;
10630
+ this._createApp = _createApp;
10631
+ this._isVueCE = true;
10526
10632
  /**
10527
10633
  * @internal
10528
10634
  */
10529
10635
  this._instance = null;
10636
+ /**
10637
+ * @internal
10638
+ */
10639
+ this._app = null;
10640
+ /**
10641
+ * @internal
10642
+ */
10643
+ this._nonce = this._def.nonce;
10530
10644
  this._connected = false;
10531
10645
  this._resolved = false;
10532
10646
  this._numberProps = null;
10647
+ this._styleChildren = /* @__PURE__ */ new WeakSet();
10533
10648
  this._ob = null;
10534
- if (this.shadowRoot && hydrate2) {
10535
- hydrate2(this._createVNode(), this.shadowRoot);
10649
+ if (this.shadowRoot && _createApp !== createApp) {
10650
+ this._root = this.shadowRoot;
10651
+ this._mount(_def);
10536
10652
  } else {
10537
- this.attachShadow({ mode: "open" });
10653
+ if (_def.shadowRoot !== false) {
10654
+ this.attachShadow({ mode: "open" });
10655
+ this._root = this.shadowRoot;
10656
+ } else {
10657
+ this._root = this;
10658
+ }
10538
10659
  if (!this._def.__asyncLoader) {
10539
10660
  this._resolveProps(this._def);
10540
10661
  }
10541
10662
  }
10542
10663
  }
10543
10664
  connectedCallback() {
10665
+ if (!this.shadowRoot) {
10666
+ this._parseSlots();
10667
+ }
10544
10668
  this._connected = true;
10669
+ let parent = this;
10670
+ while (parent = parent && (parent.parentNode || parent.host)) {
10671
+ if (parent instanceof VueElement) {
10672
+ this._parent = parent;
10673
+ break;
10674
+ }
10675
+ }
10545
10676
  if (!this._instance) {
10546
10677
  if (this._resolved) {
10678
+ this._setParent();
10547
10679
  this._update();
10548
10680
  } else {
10549
- this._resolveDef();
10681
+ if (parent && parent._pendingResolve) {
10682
+ this._pendingResolve = parent._pendingResolve.then(() => {
10683
+ this._pendingResolve = void 0;
10684
+ this._resolveDef();
10685
+ });
10686
+ } else {
10687
+ this._resolveDef();
10688
+ }
10550
10689
  }
10551
10690
  }
10552
10691
  }
10692
+ _setParent(parent = this._parent) {
10693
+ if (parent) {
10694
+ this._instance.parent = parent._instance;
10695
+ this._instance.provides = parent._instance.provides;
10696
+ }
10697
+ }
10553
10698
  disconnectedCallback() {
10554
10699
  this._connected = false;
10555
10700
  nextTick(() => {
@@ -10558,8 +10703,9 @@ class VueElement extends BaseClass {
10558
10703
  this._ob.disconnect();
10559
10704
  this._ob = null;
10560
10705
  }
10561
- render(null, this.shadowRoot);
10562
- this._instance = null;
10706
+ this._app && this._app.unmount();
10707
+ this._instance.ce = void 0;
10708
+ this._app = this._instance = null;
10563
10709
  }
10564
10710
  });
10565
10711
  }
@@ -10567,7 +10713,9 @@ class VueElement extends BaseClass {
10567
10713
  * resolve inner component definition (handle possible async component)
10568
10714
  */
10569
10715
  _resolveDef() {
10570
- this._resolved = true;
10716
+ if (this._pendingResolve) {
10717
+ return;
10718
+ }
10571
10719
  for (let i = 0; i < this.attributes.length; i++) {
10572
10720
  this._setAttr(this.attributes[i].name);
10573
10721
  }
@@ -10578,6 +10726,8 @@ class VueElement extends BaseClass {
10578
10726
  });
10579
10727
  this._ob.observe(this, { attributes: true });
10580
10728
  const resolve = (def, isAsync = false) => {
10729
+ this._resolved = true;
10730
+ this._pendingResolve = void 0;
10581
10731
  const { props, styles } = def;
10582
10732
  let numberProps;
10583
10733
  if (props && !isArray(props)) {
@@ -10595,22 +10745,44 @@ class VueElement extends BaseClass {
10595
10745
  if (isAsync) {
10596
10746
  this._resolveProps(def);
10597
10747
  }
10598
- this._applyStyles(styles);
10599
- this._update();
10748
+ if (this.shadowRoot) {
10749
+ this._applyStyles(styles);
10750
+ }
10751
+ this._mount(def);
10600
10752
  };
10601
10753
  const asyncDef = this._def.__asyncLoader;
10602
10754
  if (asyncDef) {
10603
- asyncDef().then((def) => resolve(def, true));
10755
+ this._pendingResolve = asyncDef().then(
10756
+ (def) => resolve(this._def = def, true)
10757
+ );
10604
10758
  } else {
10605
10759
  resolve(this._def);
10606
10760
  }
10607
10761
  }
10762
+ _mount(def) {
10763
+ this._app = this._createApp(def);
10764
+ if (def.configureApp) {
10765
+ def.configureApp(this._app);
10766
+ }
10767
+ this._app._ceVNode = this._createVNode();
10768
+ this._app.mount(this._root);
10769
+ const exposed = this._instance && this._instance.exposed;
10770
+ if (!exposed) return;
10771
+ for (const key in exposed) {
10772
+ if (!hasOwn(this, key)) {
10773
+ Object.defineProperty(this, key, {
10774
+ // unwrap ref to be consistent with public instance behavior
10775
+ get: () => unref(exposed[key])
10776
+ });
10777
+ }
10778
+ }
10779
+ }
10608
10780
  _resolveProps(def) {
10609
10781
  const { props } = def;
10610
10782
  const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
10611
10783
  for (const key of Object.keys(this)) {
10612
10784
  if (key[0] !== "_" && declaredPropKeys.includes(key)) {
10613
- this._setProp(key, this[key], true, false);
10785
+ this._setProp(key, this[key]);
10614
10786
  }
10615
10787
  }
10616
10788
  for (const key of declaredPropKeys.map(camelize)) {
@@ -10619,18 +10791,20 @@ class VueElement extends BaseClass {
10619
10791
  return this._getProp(key);
10620
10792
  },
10621
10793
  set(val) {
10622
- this._setProp(key, val);
10794
+ this._setProp(key, val, true, true);
10623
10795
  }
10624
10796
  });
10625
10797
  }
10626
10798
  }
10627
10799
  _setAttr(key) {
10628
- let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0;
10800
+ if (key.startsWith("data-v-")) return;
10801
+ const has = this.hasAttribute(key);
10802
+ let value = has ? this.getAttribute(key) : REMOVAL;
10629
10803
  const camelKey = camelize(key);
10630
- if (this._numberProps && this._numberProps[camelKey]) {
10804
+ if (has && this._numberProps && this._numberProps[camelKey]) {
10631
10805
  value = toNumber(value);
10632
10806
  }
10633
- this._setProp(camelKey, value, false);
10807
+ this._setProp(camelKey, value, false, true);
10634
10808
  }
10635
10809
  /**
10636
10810
  * @internal
@@ -10641,9 +10815,13 @@ class VueElement extends BaseClass {
10641
10815
  /**
10642
10816
  * @internal
10643
10817
  */
10644
- _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
10818
+ _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
10645
10819
  if (val !== this._props[key]) {
10646
- this._props[key] = val;
10820
+ if (val === REMOVAL) {
10821
+ delete this._props[key];
10822
+ } else {
10823
+ this._props[key] = val;
10824
+ }
10647
10825
  if (shouldUpdate && this._instance) {
10648
10826
  this._update();
10649
10827
  }
@@ -10659,19 +10837,24 @@ class VueElement extends BaseClass {
10659
10837
  }
10660
10838
  }
10661
10839
  _update() {
10662
- render(this._createVNode(), this.shadowRoot);
10840
+ render(this._createVNode(), this._root);
10663
10841
  }
10664
10842
  _createVNode() {
10665
- const vnode = createVNode(this._def, extend$1({}, this._props));
10843
+ const baseProps = {};
10844
+ if (!this.shadowRoot) {
10845
+ baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
10846
+ }
10847
+ const vnode = createVNode(this._def, extend$1(baseProps, this._props));
10666
10848
  if (!this._instance) {
10667
10849
  vnode.ce = (instance) => {
10668
10850
  this._instance = instance;
10669
- instance.isCE = true;
10851
+ instance.ce = this;
10670
10852
  const dispatch = (event, args) => {
10671
10853
  this.dispatchEvent(
10672
- new CustomEvent(event, {
10673
- detail: args
10674
- })
10854
+ new CustomEvent(
10855
+ event,
10856
+ isPlainObject(args[0]) ? extend$1({ detail: args }, args[0]) : { detail: args }
10857
+ )
10675
10858
  );
10676
10859
  };
10677
10860
  instance.emit = (event, ...args) => {
@@ -10680,27 +10863,92 @@ class VueElement extends BaseClass {
10680
10863
  dispatch(hyphenate(event), args);
10681
10864
  }
10682
10865
  };
10683
- let parent = this;
10684
- while (parent = parent && (parent.parentNode || parent.host)) {
10685
- if (parent instanceof VueElement) {
10686
- instance.parent = parent._instance;
10687
- instance.provides = parent._instance.provides;
10688
- break;
10689
- }
10690
- }
10866
+ this._setParent();
10691
10867
  };
10692
10868
  }
10693
10869
  return vnode;
10694
10870
  }
10695
- _applyStyles(styles) {
10696
- if (styles) {
10697
- styles.forEach((css) => {
10698
- const s = document.createElement("style");
10699
- s.textContent = css;
10700
- this.shadowRoot.appendChild(s);
10701
- });
10871
+ _applyStyles(styles, owner) {
10872
+ if (!styles) return;
10873
+ if (owner) {
10874
+ if (owner === this._def || this._styleChildren.has(owner)) {
10875
+ return;
10876
+ }
10877
+ this._styleChildren.add(owner);
10878
+ }
10879
+ const nonce = this._nonce;
10880
+ for (let i = styles.length - 1; i >= 0; i--) {
10881
+ const s = document.createElement("style");
10882
+ if (nonce) s.setAttribute("nonce", nonce);
10883
+ s.textContent = styles[i];
10884
+ this.shadowRoot.prepend(s);
10885
+ }
10886
+ }
10887
+ /**
10888
+ * Only called when shaddowRoot is false
10889
+ */
10890
+ _parseSlots() {
10891
+ const slots = this._slots = {};
10892
+ let n;
10893
+ while (n = this.firstChild) {
10894
+ const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
10895
+ (slots[slotName] || (slots[slotName] = [])).push(n);
10896
+ this.removeChild(n);
10897
+ }
10898
+ }
10899
+ /**
10900
+ * Only called when shaddowRoot is false
10901
+ */
10902
+ _renderSlots() {
10903
+ const outlets = this.querySelectorAll("slot");
10904
+ const scopeId = this._instance.type.__scopeId;
10905
+ for (let i = 0; i < outlets.length; i++) {
10906
+ const o = outlets[i];
10907
+ const slotName = o.getAttribute("name") || "default";
10908
+ const content = this._slots[slotName];
10909
+ const parent = o.parentNode;
10910
+ if (content) {
10911
+ for (const n of content) {
10912
+ if (scopeId && n.nodeType === 1) {
10913
+ const id = scopeId + "-s";
10914
+ const walker = document.createTreeWalker(n, 1);
10915
+ n.setAttribute(id, "");
10916
+ let child;
10917
+ while (child = walker.nextNode()) {
10918
+ child.setAttribute(id, "");
10919
+ }
10920
+ }
10921
+ parent.insertBefore(n, o);
10922
+ }
10923
+ } else {
10924
+ while (o.firstChild) parent.insertBefore(o.firstChild, o);
10925
+ }
10926
+ parent.removeChild(o);
10702
10927
  }
10703
10928
  }
10929
+ /**
10930
+ * @internal
10931
+ */
10932
+ _injectChildStyle(comp) {
10933
+ this._applyStyles(comp.styles, comp);
10934
+ }
10935
+ /**
10936
+ * @internal
10937
+ */
10938
+ _removeChildStyle(comp) {
10939
+ }
10940
+ }
10941
+ function useHost(caller) {
10942
+ const instance = getCurrentInstance();
10943
+ const el = instance && instance.ce;
10944
+ if (el) {
10945
+ return el;
10946
+ }
10947
+ return null;
10948
+ }
10949
+ function useShadowRoot() {
10950
+ const el = useHost();
10951
+ return el && el.shadowRoot;
10704
10952
  }
10705
10953
 
10706
10954
  function useCssModule(name = "$style") {
@@ -11242,7 +11490,9 @@ const createApp = (...args) => {
11242
11490
  if (!isFunction(component) && !component.render && !component.template) {
11243
11491
  component.template = container.innerHTML;
11244
11492
  }
11245
- container.innerHTML = "";
11493
+ if (container.nodeType === 1) {
11494
+ container.textContent = "";
11495
+ }
11246
11496
  const proxy = mount(container, false, resolveRootNamespace(container));
11247
11497
  if (container instanceof Element) {
11248
11498
  container.removeAttribute("v-cloak");
@@ -11427,9 +11677,11 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
11427
11677
  useAttrs: useAttrs,
11428
11678
  useCssModule: useCssModule,
11429
11679
  useCssVars: useCssVars,
11680
+ useHost: useHost,
11430
11681
  useId: useId,
11431
11682
  useModel: useModel,
11432
11683
  useSSRContext: useSSRContext,
11684
+ useShadowRoot: useShadowRoot,
11433
11685
  useSlots: useSlots,
11434
11686
  useTemplateRef: useTemplateRef,
11435
11687
  useTransitionState: useTransitionState,
@@ -11476,36 +11728,70 @@ const FRAGMENT = Symbol(``);
11476
11728
  const TELEPORT = Symbol(``);
11477
11729
  const SUSPENSE = Symbol(``);
11478
11730
  const KEEP_ALIVE = Symbol(``);
11479
- const BASE_TRANSITION = Symbol(``);
11731
+ const BASE_TRANSITION = Symbol(
11732
+ ``
11733
+ );
11480
11734
  const OPEN_BLOCK = Symbol(``);
11481
11735
  const CREATE_BLOCK = Symbol(``);
11482
- const CREATE_ELEMENT_BLOCK = Symbol(``);
11736
+ const CREATE_ELEMENT_BLOCK = Symbol(
11737
+ ``
11738
+ );
11483
11739
  const CREATE_VNODE = Symbol(``);
11484
- const CREATE_ELEMENT_VNODE = Symbol(``);
11485
- const CREATE_COMMENT = Symbol(``);
11486
- const CREATE_TEXT = Symbol(``);
11487
- const CREATE_STATIC = Symbol(``);
11488
- const RESOLVE_COMPONENT = Symbol(``);
11740
+ const CREATE_ELEMENT_VNODE = Symbol(
11741
+ ``
11742
+ );
11743
+ const CREATE_COMMENT = Symbol(
11744
+ ``
11745
+ );
11746
+ const CREATE_TEXT = Symbol(
11747
+ ``
11748
+ );
11749
+ const CREATE_STATIC = Symbol(
11750
+ ``
11751
+ );
11752
+ const RESOLVE_COMPONENT = Symbol(
11753
+ ``
11754
+ );
11489
11755
  const RESOLVE_DYNAMIC_COMPONENT = Symbol(
11490
11756
  ``
11491
11757
  );
11492
- const RESOLVE_DIRECTIVE = Symbol(``);
11493
- const RESOLVE_FILTER = Symbol(``);
11494
- const WITH_DIRECTIVES = Symbol(``);
11758
+ const RESOLVE_DIRECTIVE = Symbol(
11759
+ ``
11760
+ );
11761
+ const RESOLVE_FILTER = Symbol(
11762
+ ``
11763
+ );
11764
+ const WITH_DIRECTIVES = Symbol(
11765
+ ``
11766
+ );
11495
11767
  const RENDER_LIST = Symbol(``);
11496
11768
  const RENDER_SLOT = Symbol(``);
11497
11769
  const CREATE_SLOTS = Symbol(``);
11498
- const TO_DISPLAY_STRING = Symbol(``);
11770
+ const TO_DISPLAY_STRING = Symbol(
11771
+ ``
11772
+ );
11499
11773
  const MERGE_PROPS = Symbol(``);
11500
- const NORMALIZE_CLASS = Symbol(``);
11501
- const NORMALIZE_STYLE = Symbol(``);
11502
- const NORMALIZE_PROPS = Symbol(``);
11503
- const GUARD_REACTIVE_PROPS = Symbol(``);
11774
+ const NORMALIZE_CLASS = Symbol(
11775
+ ``
11776
+ );
11777
+ const NORMALIZE_STYLE = Symbol(
11778
+ ``
11779
+ );
11780
+ const NORMALIZE_PROPS = Symbol(
11781
+ ``
11782
+ );
11783
+ const GUARD_REACTIVE_PROPS = Symbol(
11784
+ ``
11785
+ );
11504
11786
  const TO_HANDLERS = Symbol(``);
11505
11787
  const CAMELIZE = Symbol(``);
11506
11788
  const CAPITALIZE = Symbol(``);
11507
- const TO_HANDLER_KEY = Symbol(``);
11508
- const SET_BLOCK_TRACKING = Symbol(``);
11789
+ const TO_HANDLER_KEY = Symbol(
11790
+ ``
11791
+ );
11792
+ const SET_BLOCK_TRACKING = Symbol(
11793
+ ``
11794
+ );
11509
11795
  const PUSH_SCOPE_ID = Symbol(``);
11510
11796
  const POP_SCOPE_ID = Symbol(``);
11511
11797
  const WITH_CTX = Symbol(``);
@@ -12699,6 +12985,16 @@ function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [
12699
12985
  (id) => markScopeIdentifier(node, id, knownIds)
12700
12986
  );
12701
12987
  }
12988
+ } else if (node.type === "CatchClause" && node.param) {
12989
+ for (const id of extractIdentifiers(node.param)) {
12990
+ markScopeIdentifier(node, id, knownIds);
12991
+ }
12992
+ } else if (isForStatement(node)) {
12993
+ walkForStatement(
12994
+ node,
12995
+ false,
12996
+ (id) => markScopeIdentifier(node, id, knownIds)
12997
+ );
12702
12998
  }
12703
12999
  },
12704
13000
  leave(node, parent) {
@@ -12779,14 +13075,20 @@ function walkBlockDeclarations(block, onIdent) {
12779
13075
  } else if (stmt.type === "FunctionDeclaration" || stmt.type === "ClassDeclaration") {
12780
13076
  if (stmt.declare || !stmt.id) continue;
12781
13077
  onIdent(stmt.id);
12782
- } else if (stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement") {
12783
- const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
12784
- if (variable && variable.type === "VariableDeclaration") {
12785
- for (const decl of variable.declarations) {
12786
- for (const id of extractIdentifiers(decl.id)) {
12787
- onIdent(id);
12788
- }
12789
- }
13078
+ } else if (isForStatement(stmt)) {
13079
+ walkForStatement(stmt, true, onIdent);
13080
+ }
13081
+ }
13082
+ }
13083
+ function isForStatement(stmt) {
13084
+ return stmt.type === "ForOfStatement" || stmt.type === "ForInStatement" || stmt.type === "ForStatement";
13085
+ }
13086
+ function walkForStatement(stmt, isVar, onIdent) {
13087
+ const variable = stmt.type === "ForStatement" ? stmt.init : stmt.left;
13088
+ if (variable && variable.type === "VariableDeclaration" && (variable.kind === "var" ? isVar : !isVar)) {
13089
+ for (const decl of variable.declarations) {
13090
+ for (const id of extractIdentifiers(decl.id)) {
13091
+ onIdent(id);
12790
13092
  }
12791
13093
  }
12792
13094
  }
@@ -16404,7 +16706,7 @@ function resolveComponentType(node, context, ssr = false) {
16404
16706
  } else {
16405
16707
  exp = isProp.exp;
16406
16708
  if (!exp) {
16407
- exp = createSimpleExpression(`is`, false, isProp.loc);
16709
+ exp = createSimpleExpression(`is`, false, isProp.arg.loc);
16408
16710
  {
16409
16711
  exp = isProp.exp = processExpression(exp, context);
16410
16712
  }
@@ -17473,15 +17775,27 @@ function baseCompile(source, options = {}) {
17473
17775
  const noopDirectiveTransform = () => ({ props: [] });
17474
17776
 
17475
17777
  const V_MODEL_RADIO = Symbol(``);
17476
- const V_MODEL_CHECKBOX = Symbol(``);
17778
+ const V_MODEL_CHECKBOX = Symbol(
17779
+ ``
17780
+ );
17477
17781
  const V_MODEL_TEXT = Symbol(``);
17478
- const V_MODEL_SELECT = Symbol(``);
17479
- const V_MODEL_DYNAMIC = Symbol(``);
17480
- const V_ON_WITH_MODIFIERS = Symbol(``);
17481
- const V_ON_WITH_KEYS = Symbol(``);
17782
+ const V_MODEL_SELECT = Symbol(
17783
+ ``
17784
+ );
17785
+ const V_MODEL_DYNAMIC = Symbol(
17786
+ ``
17787
+ );
17788
+ const V_ON_WITH_MODIFIERS = Symbol(
17789
+ ``
17790
+ );
17791
+ const V_ON_WITH_KEYS = Symbol(
17792
+ ``
17793
+ );
17482
17794
  const V_SHOW = Symbol(``);
17483
17795
  const TRANSITION = Symbol(``);
17484
- const TRANSITION_GROUP = Symbol(``);
17796
+ const TRANSITION_GROUP = Symbol(
17797
+ ``
17798
+ );
17485
17799
  registerRuntimeHelpers({
17486
17800
  [V_MODEL_RADIO]: `vModelRadio`,
17487
17801
  [V_MODEL_CHECKBOX]: `vModelCheckbox`,