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

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.2
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -64,9 +64,11 @@ var Vue = (function () {
64
64
  };
65
65
  };
66
66
  const camelizeRE = /-(\w)/g;
67
- const camelize = cacheStringFunction((str) => {
68
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
69
- });
67
+ const camelize = cacheStringFunction(
68
+ (str) => {
69
+ return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
70
+ }
71
+ );
70
72
  const hyphenateRE = /\B([A-Z])/g;
71
73
  const hyphenate = cacheStringFunction(
72
74
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
@@ -74,10 +76,12 @@ var Vue = (function () {
74
76
  const capitalize = cacheStringFunction((str) => {
75
77
  return str.charAt(0).toUpperCase() + str.slice(1);
76
78
  });
77
- const toHandlerKey = cacheStringFunction((str) => {
78
- const s = str ? `on${capitalize(str)}` : ``;
79
- return s;
80
- });
79
+ const toHandlerKey = cacheStringFunction(
80
+ (str) => {
81
+ const s = str ? `on${capitalize(str)}` : ``;
82
+ return s;
83
+ }
84
+ );
81
85
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
82
86
  const invokeArrayFns = (fns, ...arg) => {
83
87
  for (let i = 0; i < fns.length; i++) {
@@ -389,6 +393,7 @@ var Vue = (function () {
389
393
  * @internal
390
394
  */
391
395
  this.cleanups = [];
396
+ this._isPaused = false;
392
397
  this.parent = activeEffectScope;
393
398
  if (!detached && activeEffectScope) {
394
399
  this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
@@ -399,6 +404,37 @@ var Vue = (function () {
399
404
  get active() {
400
405
  return this._active;
401
406
  }
407
+ pause() {
408
+ if (this._active) {
409
+ this._isPaused = true;
410
+ if (this.scopes) {
411
+ for (let i = 0, l = this.scopes.length; i < l; i++) {
412
+ this.scopes[i].pause();
413
+ }
414
+ }
415
+ for (let i = 0, l = this.effects.length; i < l; i++) {
416
+ this.effects[i].pause();
417
+ }
418
+ }
419
+ }
420
+ /**
421
+ * Resumes the effect scope, including all child scopes and effects.
422
+ */
423
+ resume() {
424
+ if (this._active) {
425
+ if (this._isPaused) {
426
+ this._isPaused = false;
427
+ if (this.scopes) {
428
+ for (let i = 0, l = this.scopes.length; i < l; i++) {
429
+ this.scopes[i].resume();
430
+ }
431
+ }
432
+ for (let i = 0, l = this.effects.length; i < l; i++) {
433
+ this.effects[i].resume();
434
+ }
435
+ }
436
+ }
437
+ }
402
438
  run(fn) {
403
439
  if (this._active) {
404
440
  const currentEffectScope = activeEffectScope;
@@ -469,6 +505,7 @@ var Vue = (function () {
469
505
  }
470
506
 
471
507
  let activeSub;
508
+ const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
472
509
  class ReactiveEffect {
473
510
  constructor(fn) {
474
511
  this.fn = fn;
@@ -497,6 +534,18 @@ var Vue = (function () {
497
534
  activeEffectScope.effects.push(this);
498
535
  }
499
536
  }
537
+ pause() {
538
+ this.flags |= 64;
539
+ }
540
+ resume() {
541
+ if (this.flags & 64) {
542
+ this.flags &= ~64;
543
+ if (pausedQueueEffects.has(this)) {
544
+ pausedQueueEffects.delete(this);
545
+ this.trigger();
546
+ }
547
+ }
548
+ }
500
549
  /**
501
550
  * @internal
502
551
  */
@@ -504,9 +553,6 @@ var Vue = (function () {
504
553
  if (this.flags & 2 && !(this.flags & 32)) {
505
554
  return;
506
555
  }
507
- if (this.flags & 64) {
508
- return this.trigger();
509
- }
510
556
  if (!(this.flags & 8)) {
511
557
  this.flags |= 8;
512
558
  this.nextEffect = batchedEffect;
@@ -550,7 +596,9 @@ var Vue = (function () {
550
596
  }
551
597
  }
552
598
  trigger() {
553
- if (this.scheduler) {
599
+ if (this.flags & 64) {
600
+ pausedQueueEffects.add(this);
601
+ } else if (this.scheduler) {
554
602
  this.scheduler();
555
603
  } else {
556
604
  this.runIfDirty();
@@ -578,6 +626,7 @@ var Vue = (function () {
578
626
  batchDepth--;
579
627
  return;
580
628
  }
629
+ batchDepth--;
581
630
  let error;
582
631
  while (batchedEffect) {
583
632
  let e = batchedEffect;
@@ -596,7 +645,6 @@ var Vue = (function () {
596
645
  e = next;
597
646
  }
598
647
  }
599
- batchDepth--;
600
648
  if (error) throw error;
601
649
  }
602
650
  function prepareDeps(sub) {
@@ -870,9 +918,15 @@ var Vue = (function () {
870
918
  link.dep.subs = link;
871
919
  }
872
920
  const targetMap = /* @__PURE__ */ new WeakMap();
873
- const ITERATE_KEY = Symbol("Object iterate" );
874
- const MAP_KEY_ITERATE_KEY = Symbol("Map keys iterate" );
875
- const ARRAY_ITERATE_KEY = Symbol("Array iterate" );
921
+ const ITERATE_KEY = Symbol(
922
+ "Object iterate"
923
+ );
924
+ const MAP_KEY_ITERATE_KEY = Symbol(
925
+ "Map keys iterate"
926
+ );
927
+ const ARRAY_ITERATE_KEY = Symbol(
928
+ "Array iterate"
929
+ );
876
930
  function track(target, type, key) {
877
931
  if (shouldTrack && activeSub) {
878
932
  let depsMap = targetMap.get(target);
@@ -993,26 +1047,26 @@ var Vue = (function () {
993
1047
  });
994
1048
  },
995
1049
  every(fn, thisArg) {
996
- return apply(this, "every", fn, thisArg);
1050
+ return apply(this, "every", fn, thisArg, void 0, arguments);
997
1051
  },
998
1052
  filter(fn, thisArg) {
999
- return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive));
1053
+ return apply(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments);
1000
1054
  },
1001
1055
  find(fn, thisArg) {
1002
- return apply(this, "find", fn, thisArg, toReactive);
1056
+ return apply(this, "find", fn, thisArg, toReactive, arguments);
1003
1057
  },
1004
1058
  findIndex(fn, thisArg) {
1005
- return apply(this, "findIndex", fn, thisArg);
1059
+ return apply(this, "findIndex", fn, thisArg, void 0, arguments);
1006
1060
  },
1007
1061
  findLast(fn, thisArg) {
1008
- return apply(this, "findLast", fn, thisArg, toReactive);
1062
+ return apply(this, "findLast", fn, thisArg, toReactive, arguments);
1009
1063
  },
1010
1064
  findLastIndex(fn, thisArg) {
1011
- return apply(this, "findLastIndex", fn, thisArg);
1065
+ return apply(this, "findLastIndex", fn, thisArg, void 0, arguments);
1012
1066
  },
1013
1067
  // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
1014
1068
  forEach(fn, thisArg) {
1015
- return apply(this, "forEach", fn, thisArg);
1069
+ return apply(this, "forEach", fn, thisArg, void 0, arguments);
1016
1070
  },
1017
1071
  includes(...args) {
1018
1072
  return searchProxy(this, "includes", args);
@@ -1028,7 +1082,7 @@ var Vue = (function () {
1028
1082
  return searchProxy(this, "lastIndexOf", args);
1029
1083
  },
1030
1084
  map(fn, thisArg) {
1031
- return apply(this, "map", fn, thisArg);
1085
+ return apply(this, "map", fn, thisArg, void 0, arguments);
1032
1086
  },
1033
1087
  pop() {
1034
1088
  return noTracking(this, "pop");
@@ -1047,7 +1101,7 @@ var Vue = (function () {
1047
1101
  },
1048
1102
  // slice could use ARRAY_ITERATE but also seems to beg for range tracking
1049
1103
  some(fn, thisArg) {
1050
- return apply(this, "some", fn, thisArg);
1104
+ return apply(this, "some", fn, thisArg, void 0, arguments);
1051
1105
  },
1052
1106
  splice(...args) {
1053
1107
  return noTracking(this, "splice", args);
@@ -1083,8 +1137,13 @@ var Vue = (function () {
1083
1137
  }
1084
1138
  return iter;
1085
1139
  }
1086
- function apply(self, method, fn, thisArg, wrappedRetFn) {
1140
+ const arrayProto = Array.prototype;
1141
+ function apply(self, method, fn, thisArg, wrappedRetFn, args) {
1087
1142
  const arr = shallowReadArray(self);
1143
+ let methodFn;
1144
+ if ((methodFn = arr[method]) !== arrayProto[method]) {
1145
+ return methodFn.apply(arr, args);
1146
+ }
1088
1147
  let needsWrap = false;
1089
1148
  let wrappedFn = fn;
1090
1149
  if (arr !== self) {
@@ -1099,7 +1158,7 @@ var Vue = (function () {
1099
1158
  };
1100
1159
  }
1101
1160
  }
1102
- const result = arr[method](wrappedFn, thisArg);
1161
+ const result = methodFn.call(arr, wrappedFn, thisArg);
1103
1162
  return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
1104
1163
  }
1105
1164
  function reduce(self, method, fn, args) {
@@ -1162,7 +1221,7 @@ var Vue = (function () {
1162
1221
  return isShallow2;
1163
1222
  } else if (key === "__v_raw") {
1164
1223
  if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
1165
- // this means the reciever is a user proxy of the reactive proxy
1224
+ // this means the receiver is a user proxy of the reactive proxy
1166
1225
  Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
1167
1226
  return target;
1168
1227
  }
@@ -1286,9 +1345,7 @@ var Vue = (function () {
1286
1345
  }
1287
1346
  const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
1288
1347
  const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
1289
- const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
1290
- true
1291
- );
1348
+ const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
1292
1349
  const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
1293
1350
 
1294
1351
  const toShallow = (value) => value;
@@ -1783,13 +1840,14 @@ var Vue = (function () {
1783
1840
  class CustomRefImpl {
1784
1841
  constructor(factory) {
1785
1842
  this["__v_isRef"] = true;
1843
+ this._value = void 0;
1786
1844
  const dep = this.dep = new Dep();
1787
1845
  const { get, set } = factory(dep.track.bind(dep), dep.trigger.bind(dep));
1788
1846
  this._get = get;
1789
1847
  this._set = set;
1790
1848
  }
1791
1849
  get value() {
1792
- return this._get();
1850
+ return this._value = this._get();
1793
1851
  }
1794
1852
  set value(newVal) {
1795
1853
  this._set(newVal);
@@ -1814,10 +1872,11 @@ var Vue = (function () {
1814
1872
  this._key = _key;
1815
1873
  this._defaultValue = _defaultValue;
1816
1874
  this["__v_isRef"] = true;
1875
+ this._value = void 0;
1817
1876
  }
1818
1877
  get value() {
1819
1878
  const val = this._object[this._key];
1820
- return val === void 0 ? this._defaultValue : val;
1879
+ return this._value = val === void 0 ? this._defaultValue : val;
1821
1880
  }
1822
1881
  set value(newVal) {
1823
1882
  this._object[this._key] = newVal;
@@ -1831,9 +1890,10 @@ var Vue = (function () {
1831
1890
  this._getter = _getter;
1832
1891
  this["__v_isRef"] = true;
1833
1892
  this["__v_isReadonly"] = true;
1893
+ this._value = void 0;
1834
1894
  }
1835
1895
  get value() {
1836
- return this._getter();
1896
+ return this._value = this._getter();
1837
1897
  }
1838
1898
  }
1839
1899
  function toRef(source, key, defaultValue) {
@@ -1867,7 +1927,8 @@ var Vue = (function () {
1867
1927
  /**
1868
1928
  * @internal
1869
1929
  */
1870
- this["__v_isRef"] = true;
1930
+ this.__v_isRef = true;
1931
+ // TODO isolatedDeclarations "__v_isReadonly"
1871
1932
  // A computed is also a subscriber that tracks other deps
1872
1933
  /**
1873
1934
  * @internal
@@ -2492,6 +2553,9 @@ var Vue = (function () {
2492
2553
  "[HMR] Root or manually mounted instance modified. Full reload required."
2493
2554
  );
2494
2555
  }
2556
+ if (instance.root.ce && instance !== instance.root) {
2557
+ instance.root.ce._removeChildStyle(oldComp);
2558
+ }
2495
2559
  }
2496
2560
  queuePostFlushCb(() => {
2497
2561
  hmrDirtyComponents.clear();
@@ -2571,9 +2635,7 @@ var Vue = (function () {
2571
2635
  function devtoolsUnmountApp(app) {
2572
2636
  emit$2("app:unmount" /* APP_UNMOUNT */, app);
2573
2637
  }
2574
- const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
2575
- "component:added" /* COMPONENT_ADDED */
2576
- );
2638
+ const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook("component:added" /* COMPONENT_ADDED */);
2577
2639
  const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook("component:updated" /* COMPONENT_UPDATED */);
2578
2640
  const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
2579
2641
  "component:removed" /* COMPONENT_REMOVED */
@@ -2597,12 +2659,8 @@ var Vue = (function () {
2597
2659
  );
2598
2660
  };
2599
2661
  }
2600
- const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
2601
- "perf:start" /* PERFORMANCE_START */
2602
- );
2603
- const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
2604
- "perf:end" /* PERFORMANCE_END */
2605
- );
2662
+ const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:start" /* PERFORMANCE_START */);
2663
+ const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook("perf:end" /* PERFORMANCE_END */);
2606
2664
  function createDevtoolsPerformanceHook(hook) {
2607
2665
  return (component, type, time) => {
2608
2666
  emit$2(hook, component.appContext.app, component.uid, component, type, time);
@@ -4036,6 +4094,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4036
4094
  const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
4037
4095
  const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
4038
4096
  const getContainerType = (container) => {
4097
+ if (container.nodeType !== 1) return void 0;
4039
4098
  if (isSVGContainer(container)) return "svg";
4040
4099
  if (isMathMLContainer(container)) return "mathml";
4041
4100
  return void 0;
@@ -4311,6 +4370,7 @@ Server rendered element contains more child nodes than client vdom.`
4311
4370
  }
4312
4371
  if (props) {
4313
4372
  {
4373
+ const isCustomElement = el.tagName.includes("-");
4314
4374
  for (const key in props) {
4315
4375
  if (// #11189 skip if this node has directives that have created hooks
4316
4376
  // as it could have mutated the DOM in any possible way
@@ -4318,7 +4378,7 @@ Server rendered element contains more child nodes than client vdom.`
4318
4378
  logMismatchError();
4319
4379
  }
4320
4380
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4321
- key[0] === ".") {
4381
+ key[0] === "." || isCustomElement) {
4322
4382
  patchProp(el, key, null, props[key], void 0, parentComponent);
4323
4383
  }
4324
4384
  }
@@ -4643,24 +4703,19 @@ Server rendered element contains fewer child nodes than client vdom.`
4643
4703
  }
4644
4704
  }
4645
4705
 
4646
- const hydrateOnIdle = () => (hydrate) => {
4647
- const id = requestIdleCallback(hydrate);
4706
+ const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
4707
+ const id = requestIdleCallback(hydrate, { timeout });
4648
4708
  return () => cancelIdleCallback(id);
4649
4709
  };
4650
- const hydrateOnVisible = (margin = 0) => (hydrate, forEach) => {
4651
- const ob = new IntersectionObserver(
4652
- (entries) => {
4653
- for (const e of entries) {
4654
- if (!e.isIntersecting) continue;
4655
- ob.disconnect();
4656
- hydrate();
4657
- break;
4658
- }
4659
- },
4660
- {
4661
- rootMargin: isString(margin) ? margin : margin + "px"
4710
+ const hydrateOnVisible = (opts) => (hydrate, forEach) => {
4711
+ const ob = new IntersectionObserver((entries) => {
4712
+ for (const e of entries) {
4713
+ if (!e.isIntersecting) continue;
4714
+ ob.disconnect();
4715
+ hydrate();
4716
+ break;
4662
4717
  }
4663
- );
4718
+ }, opts);
4664
4719
  forEach((el) => ob.observe(el));
4665
4720
  return () => ob.disconnect();
4666
4721
  };
@@ -4962,14 +5017,14 @@ Server rendered element contains fewer child nodes than client vdom.`
4962
5017
  function pruneCache(filter) {
4963
5018
  cache.forEach((vnode, key) => {
4964
5019
  const name = getComponentName(vnode.type);
4965
- if (name && (!filter || !filter(name))) {
5020
+ if (name && !filter(name)) {
4966
5021
  pruneCacheEntry(key);
4967
5022
  }
4968
5023
  });
4969
5024
  }
4970
5025
  function pruneCacheEntry(key) {
4971
5026
  const cached = cache.get(key);
4972
- if (!current || !isSameVNodeType(cached, current)) {
5027
+ if (cached && (!current || !isSameVNodeType(cached, current))) {
4973
5028
  unmount(cached);
4974
5029
  } else if (current) {
4975
5030
  resetShapeFlag(current);
@@ -5031,6 +5086,10 @@ Server rendered element contains fewer child nodes than client vdom.`
5031
5086
  return rawVNode;
5032
5087
  }
5033
5088
  let vnode = getInnerChild(rawVNode);
5089
+ if (vnode.type === Comment) {
5090
+ current = null;
5091
+ return vnode;
5092
+ }
5034
5093
  const comp = vnode.type;
5035
5094
  const name = getComponentName(
5036
5095
  isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
@@ -5080,6 +5139,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5080
5139
  } else if (isString(pattern)) {
5081
5140
  return pattern.split(",").includes(name);
5082
5141
  } else if (isRegExp(pattern)) {
5142
+ pattern.lastIndex = 0;
5083
5143
  return pattern.test(name);
5084
5144
  }
5085
5145
  return false;
@@ -5163,17 +5223,19 @@ Server rendered element contains fewer child nodes than client vdom.`
5163
5223
  };
5164
5224
  const onBeforeMount = createHook("bm");
5165
5225
  const onMounted = createHook("m");
5166
- const onBeforeUpdate = createHook("bu");
5226
+ const onBeforeUpdate = createHook(
5227
+ "bu"
5228
+ );
5167
5229
  const onUpdated = createHook("u");
5168
- const onBeforeUnmount = createHook("bum");
5169
- const onUnmounted = createHook("um");
5170
- const onServerPrefetch = createHook("sp");
5171
- const onRenderTriggered = createHook(
5172
- "rtg"
5230
+ const onBeforeUnmount = createHook(
5231
+ "bum"
5173
5232
  );
5174
- const onRenderTracked = createHook(
5175
- "rtc"
5233
+ const onUnmounted = createHook("um");
5234
+ const onServerPrefetch = createHook(
5235
+ "sp"
5176
5236
  );
5237
+ const onRenderTriggered = createHook("rtg");
5238
+ const onRenderTracked = createHook("rtc");
5177
5239
  function onErrorCaptured(hook, target = currentInstance) {
5178
5240
  injectHook("ec", hook, target);
5179
5241
  }
@@ -5587,9 +5649,14 @@ If this is a native custom element, make sure to exclude it from component resol
5587
5649
  }
5588
5650
 
5589
5651
  function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5590
- if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
5652
+ if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
5591
5653
  if (name !== "default") props.name = name;
5592
- return createVNode("slot", props, fallback && fallback());
5654
+ return openBlock(), createBlock(
5655
+ Fragment,
5656
+ null,
5657
+ [createVNode("slot", props, fallback && fallback())],
5658
+ 64
5659
+ );
5593
5660
  }
5594
5661
  let slot = slots[name];
5595
5662
  if (slot && slot.length > 1) {
@@ -5891,6 +5958,7 @@ If this is a native custom element, make sure to exclude it from component resol
5891
5958
  $refs: (i) => shallowReadonly(i.refs) ,
5892
5959
  $parent: (i) => getPublicInstance(i.parent),
5893
5960
  $root: (i) => getPublicInstance(i.root),
5961
+ $host: (i) => i.ce,
5894
5962
  $emit: (i) => i.emit,
5895
5963
  $options: (i) => resolveMergedOptions(i) ,
5896
5964
  $forceUpdate: (i) => i.f || (i.f = () => {
@@ -6051,29 +6119,25 @@ If this is a native custom element, make sure to exclude it from component resol
6051
6119
  return Reflect.ownKeys(target);
6052
6120
  };
6053
6121
  }
6054
- const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend(
6055
- {},
6056
- PublicInstanceProxyHandlers,
6057
- {
6058
- get(target, key) {
6059
- if (key === Symbol.unscopables) {
6060
- return;
6061
- }
6062
- return PublicInstanceProxyHandlers.get(target, key, target);
6063
- },
6064
- has(_, key) {
6065
- const has = key[0] !== "_" && !isGloballyAllowed(key);
6066
- if (!has && PublicInstanceProxyHandlers.has(_, key)) {
6067
- warn$1(
6068
- `Property ${JSON.stringify(
6069
- key
6070
- )} should not start with _ which is a reserved prefix for Vue internals.`
6071
- );
6072
- }
6073
- return has;
6122
+ const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend({}, PublicInstanceProxyHandlers, {
6123
+ get(target, key) {
6124
+ if (key === Symbol.unscopables) {
6125
+ return;
6126
+ }
6127
+ return PublicInstanceProxyHandlers.get(target, key, target);
6128
+ },
6129
+ has(_, key) {
6130
+ const has = key[0] !== "_" && !isGloballyAllowed(key);
6131
+ if (!has && PublicInstanceProxyHandlers.has(_, key)) {
6132
+ warn$1(
6133
+ `Property ${JSON.stringify(
6134
+ key
6135
+ )} should not start with _ which is a reserved prefix for Vue internals.`
6136
+ );
6074
6137
  }
6138
+ return has;
6075
6139
  }
6076
- );
6140
+ });
6077
6141
  function createDevRenderContext(instance) {
6078
6142
  const target = {};
6079
6143
  Object.defineProperty(target, `_`, {
@@ -6757,7 +6821,7 @@ If this is a native custom element, make sure to exclude it from component resol
6757
6821
  return vm;
6758
6822
  }
6759
6823
  }
6760
- Vue.version = `2.6.14-compat:${"3.5.0-alpha.5"}`;
6824
+ Vue.version = `2.6.14-compat:${"3.5.0-beta.2"}`;
6761
6825
  Vue.config = singletonApp.config;
6762
6826
  Vue.use = (plugin, ...options) => {
6763
6827
  if (plugin && isFunction(plugin.install)) {
@@ -7030,7 +7094,7 @@ If this is a native custom element, make sure to exclude it from component resol
7030
7094
  /* skip options */
7031
7095
  );
7032
7096
  }
7033
- container.innerHTML = "";
7097
+ container.textContent = "";
7034
7098
  render(vnode, container, namespace);
7035
7099
  if (container instanceof Element) {
7036
7100
  container.removeAttribute("v-cloak");
@@ -7242,7 +7306,7 @@ If this is a native custom element, make sure to exclude it from component resol
7242
7306
  If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
7243
7307
  );
7244
7308
  }
7245
- const vnode = createVNode(rootComponent, rootProps);
7309
+ const vnode = app._ceVNode || createVNode(rootComponent, rootProps);
7246
7310
  vnode.appContext = context;
7247
7311
  if (namespace === true) {
7248
7312
  namespace = "svg";
@@ -7347,7 +7411,7 @@ If you want to remount the same app, move your app creation logic into a factory
7347
7411
  function inject(key, defaultValue, treatDefaultAsFactory = false) {
7348
7412
  const instance = currentInstance || currentRenderingInstance;
7349
7413
  if (instance || currentApp) {
7350
- const provides = instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : currentApp._context.provides;
7414
+ const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
7351
7415
  if (provides && key in provides) {
7352
7416
  return provides[key];
7353
7417
  } else if (arguments.length > 1) {
@@ -7621,6 +7685,9 @@ If you want to remount the same app, move your app creation logic into a factory
7621
7685
  } else {
7622
7686
  value = defaultValue;
7623
7687
  }
7688
+ if (instance.ce) {
7689
+ instance.ce._setProp(key, value);
7690
+ }
7624
7691
  }
7625
7692
  if (opt[0 /* shouldCast */]) {
7626
7693
  if (isAbsent && !hasDefault) {
@@ -8623,8 +8690,8 @@ If you want to remount the same app, move your app creation logic into a factory
8623
8690
  const componentUpdateFn = () => {
8624
8691
  if (!instance.isMounted) {
8625
8692
  let vnodeHook;
8626
- const { el, props, type } = initialVNode;
8627
- const { bm, m, parent } = instance;
8693
+ const { el, props } = initialVNode;
8694
+ const { bm, m, parent, root, type } = instance;
8628
8695
  const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
8629
8696
  toggleRecurse(instance, false);
8630
8697
  if (bm) {
@@ -8670,6 +8737,9 @@ If you want to remount the same app, move your app creation logic into a factory
8670
8737
  hydrateSubTree();
8671
8738
  }
8672
8739
  } else {
8740
+ if (root.ce) {
8741
+ root.ce._injectChildStyle(type);
8742
+ }
8673
8743
  {
8674
8744
  startMeasure(instance, `render`);
8675
8745
  }
@@ -9373,13 +9443,13 @@ If you want to remount the same app, move your app creation logic into a factory
9373
9443
  namespace
9374
9444
  );
9375
9445
  }
9446
+ container._vnode = vnode;
9376
9447
  if (!isFlushing) {
9377
9448
  isFlushing = true;
9378
9449
  flushPreFlushCbs();
9379
9450
  flushPostFlushCbs();
9380
9451
  isFlushing = false;
9381
9452
  }
9382
- container._vnode = vnode;
9383
9453
  };
9384
9454
  const internals = {
9385
9455
  p: patch,
@@ -9547,14 +9617,9 @@ If you want to remount the same app, move your app creation logic into a factory
9547
9617
  const _cb = cb;
9548
9618
  cb = (...args) => {
9549
9619
  _cb(...args);
9550
- unwatch();
9620
+ watchHandle();
9551
9621
  };
9552
9622
  }
9553
- if (deep !== void 0 && typeof deep === "number") {
9554
- warn$1(
9555
- `watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
9556
- );
9557
- }
9558
9623
  if (!cb) {
9559
9624
  if (immediate !== void 0) {
9560
9625
  warn$1(
@@ -9580,10 +9645,12 @@ If you want to remount the same app, move your app creation logic into a factory
9580
9645
  );
9581
9646
  };
9582
9647
  const instance = currentInstance;
9583
- const reactiveGetter = (source2) => deep === true ? source2 : (
9584
- // for deep: false, only traverse root-level properties
9585
- traverse(source2, deep === false ? 1 : void 0)
9586
- );
9648
+ const reactiveGetter = (source2) => {
9649
+ if (deep) return source2;
9650
+ if (isShallow(source2) || deep === false || deep === 0)
9651
+ return traverse(source2, 1);
9652
+ return traverse(source2);
9653
+ };
9587
9654
  let getter;
9588
9655
  let forceTrigger = false;
9589
9656
  let isMultiSource = false;
@@ -9639,7 +9706,8 @@ If you want to remount the same app, move your app creation logic into a factory
9639
9706
  }
9640
9707
  if (cb && deep) {
9641
9708
  const baseGetter = getter;
9642
- getter = () => traverse(baseGetter());
9709
+ const depth = deep === true ? Infinity : deep;
9710
+ getter = () => traverse(baseGetter(), depth);
9643
9711
  }
9644
9712
  let cleanup;
9645
9713
  let onCleanup = (fn) => {
@@ -9675,7 +9743,6 @@ If you want to remount the same app, move your app creation logic into a factory
9675
9743
  const effect = new ReactiveEffect(getter);
9676
9744
  let scheduler;
9677
9745
  if (flush === "sync") {
9678
- effect.flags |= 64;
9679
9746
  scheduler = job;
9680
9747
  } else if (flush === "post") {
9681
9748
  scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
@@ -9686,12 +9753,15 @@ If you want to remount the same app, move your app creation logic into a factory
9686
9753
  }
9687
9754
  effect.scheduler = scheduler;
9688
9755
  const scope = getCurrentScope();
9689
- const unwatch = () => {
9756
+ const watchHandle = () => {
9690
9757
  effect.stop();
9691
9758
  if (scope) {
9692
9759
  remove(scope.effects, effect);
9693
9760
  }
9694
9761
  };
9762
+ watchHandle.pause = effect.pause.bind(effect);
9763
+ watchHandle.resume = effect.resume.bind(effect);
9764
+ watchHandle.stop = watchHandle;
9695
9765
  {
9696
9766
  effect.onTrack = onTrack;
9697
9767
  effect.onTrigger = onTrigger;
@@ -9710,7 +9780,7 @@ If you want to remount the same app, move your app creation logic into a factory
9710
9780
  } else {
9711
9781
  effect.run();
9712
9782
  }
9713
- return unwatch;
9783
+ return watchHandle;
9714
9784
  }
9715
9785
  function instanceWatch(source, value, options) {
9716
9786
  const publicThis = this.proxy;
@@ -9800,7 +9870,8 @@ If you want to remount the same app, move your app creation logic into a factory
9800
9870
  return options.get ? options.get(localValue) : localValue;
9801
9871
  },
9802
9872
  set(value) {
9803
- if (!hasChanged(value, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
9873
+ const emittedValue = options.set ? options.set(value) : value;
9874
+ if (!hasChanged(emittedValue, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
9804
9875
  return;
9805
9876
  }
9806
9877
  const rawProps = i.vnode.props;
@@ -9809,7 +9880,6 @@ If you want to remount the same app, move your app creation logic into a factory
9809
9880
  localValue = value;
9810
9881
  trigger();
9811
9882
  }
9812
- const emittedValue = options.set ? options.set(value) : value;
9813
9883
  i.emit(`update:${name}`, emittedValue);
9814
9884
  if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
9815
9885
  trigger();
@@ -9847,9 +9917,9 @@ If you want to remount the same app, move your app creation logic into a factory
9847
9917
  } = instance;
9848
9918
  if (emitsOptions) {
9849
9919
  if (!(event in emitsOptions) && !(event.startsWith("hook:") || event.startsWith(compatModelEventPrefix))) {
9850
- if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
9920
+ if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) {
9851
9921
  warn$1(
9852
- `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
9922
+ `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.`
9853
9923
  );
9854
9924
  }
9855
9925
  } else {
@@ -11766,11 +11836,16 @@ Component that was made reactive: `,
11766
11836
  const r = shallowRef(null);
11767
11837
  if (i) {
11768
11838
  const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
11769
- Object.defineProperty(refs, key, {
11770
- enumerable: true,
11771
- get: () => r.value,
11772
- set: (val) => r.value = val
11773
- });
11839
+ let desc;
11840
+ if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
11841
+ warn$1(`useTemplateRef('${key}') already exists.`);
11842
+ } else {
11843
+ Object.defineProperty(refs, key, {
11844
+ enumerable: true,
11845
+ get: () => r.value,
11846
+ set: (val) => r.value = val
11847
+ });
11848
+ }
11774
11849
  } else {
11775
11850
  warn$1(
11776
11851
  `useTemplateRef() is called when there is no active component instance to be associated with.`
@@ -12004,7 +12079,7 @@ Component that was made reactive: `,
12004
12079
  return true;
12005
12080
  }
12006
12081
 
12007
- const version = "3.5.0-alpha.5";
12082
+ const version = "3.5.0-beta.2";
12008
12083
  const warn = warn$1 ;
12009
12084
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12010
12085
  const devtools = devtools$1 ;
@@ -12021,6 +12096,18 @@ Component that was made reactive: `,
12021
12096
  const compatUtils = _compatUtils ;
12022
12097
  const DeprecationTypes = DeprecationTypes$1 ;
12023
12098
 
12099
+ let policy = void 0;
12100
+ const tt = typeof window !== "undefined" && window.trustedTypes;
12101
+ if (tt) {
12102
+ try {
12103
+ policy = /* @__PURE__ */ tt.createPolicy("vue", {
12104
+ createHTML: (val) => val
12105
+ });
12106
+ } catch (e) {
12107
+ warn(`Error creating trusted types policy: ${e}`);
12108
+ }
12109
+ }
12110
+ const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
12024
12111
  const svgNS = "http://www.w3.org/2000/svg";
12025
12112
  const mathmlNS = "http://www.w3.org/1998/Math/MathML";
12026
12113
  const doc = typeof document !== "undefined" ? document : null;
@@ -12068,7 +12155,9 @@ Component that was made reactive: `,
12068
12155
  if (start === end || !(start = start.nextSibling)) break;
12069
12156
  }
12070
12157
  } else {
12071
- templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
12158
+ templateContainer.innerHTML = unsafeToTrustedHTML(
12159
+ namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content
12160
+ );
12072
12161
  const template = templateContainer.content;
12073
12162
  if (namespace === "svg" || namespace === "mathml") {
12074
12163
  const wrapper = template.firstChild;
@@ -12468,11 +12557,17 @@ Component that was made reactive: `,
12468
12557
  }
12469
12558
  const setVars = () => {
12470
12559
  const vars = getter(instance.proxy);
12471
- setVarsOnVNode(instance.subTree, vars);
12560
+ if (instance.ce) {
12561
+ setVarsOnNode(instance.ce, vars);
12562
+ } else {
12563
+ setVarsOnVNode(instance.subTree, vars);
12564
+ }
12472
12565
  updateTeleports(vars);
12473
12566
  };
12474
- onMounted(() => {
12567
+ onBeforeMount(() => {
12475
12568
  watchPostEffect(setVars);
12569
+ });
12570
+ onMounted(() => {
12476
12571
  const ob = new MutationObserver(setVars);
12477
12572
  ob.observe(instance.subTree.el.parentNode, { childList: true });
12478
12573
  onUnmounted(() => ob.disconnect());
@@ -12869,16 +12964,24 @@ Expected function or array of functions, received type ${typeof value}.`
12869
12964
  if (isNativeOn(key) && isString(value)) {
12870
12965
  return false;
12871
12966
  }
12872
- return key in el;
12967
+ if (key in el) {
12968
+ return true;
12969
+ }
12970
+ if (el._isVueCE && (/[A-Z]/.test(key) || !isString(value))) {
12971
+ return true;
12972
+ }
12973
+ return false;
12873
12974
  }
12874
12975
 
12976
+ const REMOVAL = {};
12875
12977
  /*! #__NO_SIDE_EFFECTS__ */
12876
12978
  // @__NO_SIDE_EFFECTS__
12877
- function defineCustomElement(options, extraOptions, hydrate2) {
12979
+ function defineCustomElement(options, extraOptions, _createApp) {
12878
12980
  const Comp = defineComponent(options, extraOptions);
12981
+ if (isPlainObject(Comp)) extend(Comp, extraOptions);
12879
12982
  class VueCustomElement extends VueElement {
12880
12983
  constructor(initialProps) {
12881
- super(Comp, initialProps, hydrate2);
12984
+ super(Comp, initialProps, _createApp);
12882
12985
  }
12883
12986
  }
12884
12987
  VueCustomElement.def = Comp;
@@ -12886,47 +12989,87 @@ Expected function or array of functions, received type ${typeof value}.`
12886
12989
  }
12887
12990
  /*! #__NO_SIDE_EFFECTS__ */
12888
12991
  const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options, extraOptions) => {
12889
- return /* @__PURE__ */ defineCustomElement(options, extraOptions, hydrate);
12992
+ return /* @__PURE__ */ defineCustomElement(options, extraOptions, createSSRApp);
12890
12993
  };
12891
12994
  const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
12892
12995
  };
12893
12996
  class VueElement extends BaseClass {
12894
- constructor(_def, _props = {}, hydrate2) {
12997
+ constructor(_def, _props = {}, _createApp = createApp) {
12895
12998
  super();
12896
12999
  this._def = _def;
12897
13000
  this._props = _props;
13001
+ this._createApp = _createApp;
13002
+ this._isVueCE = true;
12898
13003
  /**
12899
13004
  * @internal
12900
13005
  */
12901
13006
  this._instance = null;
13007
+ /**
13008
+ * @internal
13009
+ */
13010
+ this._app = null;
13011
+ /**
13012
+ * @internal
13013
+ */
13014
+ this._nonce = this._def.nonce;
12902
13015
  this._connected = false;
12903
13016
  this._resolved = false;
12904
13017
  this._numberProps = null;
13018
+ this._styleChildren = /* @__PURE__ */ new WeakSet();
12905
13019
  this._ob = null;
12906
- if (this.shadowRoot && hydrate2) {
12907
- hydrate2(this._createVNode(), this.shadowRoot);
13020
+ if (this.shadowRoot && _createApp !== createApp) {
13021
+ this._root = this.shadowRoot;
12908
13022
  } else {
12909
13023
  if (this.shadowRoot) {
12910
13024
  warn(
12911
13025
  `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
12912
13026
  );
12913
13027
  }
12914
- this.attachShadow({ mode: "open" });
12915
- if (!this._def.__asyncLoader) {
12916
- this._resolveProps(this._def);
13028
+ if (_def.shadowRoot !== false) {
13029
+ this.attachShadow({ mode: "open" });
13030
+ this._root = this.shadowRoot;
13031
+ } else {
13032
+ this._root = this;
12917
13033
  }
12918
13034
  }
13035
+ if (!this._def.__asyncLoader) {
13036
+ this._resolveProps(this._def);
13037
+ }
12919
13038
  }
12920
13039
  connectedCallback() {
13040
+ if (!this.shadowRoot) {
13041
+ this._parseSlots();
13042
+ }
12921
13043
  this._connected = true;
13044
+ let parent = this;
13045
+ while (parent = parent && (parent.parentNode || parent.host)) {
13046
+ if (parent instanceof VueElement) {
13047
+ this._parent = parent;
13048
+ break;
13049
+ }
13050
+ }
12922
13051
  if (!this._instance) {
12923
13052
  if (this._resolved) {
13053
+ this._setParent();
12924
13054
  this._update();
12925
13055
  } else {
12926
- this._resolveDef();
13056
+ if (parent && parent._pendingResolve) {
13057
+ this._pendingResolve = parent._pendingResolve.then(() => {
13058
+ this._pendingResolve = void 0;
13059
+ this._resolveDef();
13060
+ });
13061
+ } else {
13062
+ this._resolveDef();
13063
+ }
12927
13064
  }
12928
13065
  }
12929
13066
  }
13067
+ _setParent(parent = this._parent) {
13068
+ if (parent) {
13069
+ this._instance.parent = parent._instance;
13070
+ this._instance.provides = parent._instance.provides;
13071
+ }
13072
+ }
12930
13073
  disconnectedCallback() {
12931
13074
  this._connected = false;
12932
13075
  nextTick(() => {
@@ -12935,8 +13078,9 @@ Expected function or array of functions, received type ${typeof value}.`
12935
13078
  this._ob.disconnect();
12936
13079
  this._ob = null;
12937
13080
  }
12938
- render(null, this.shadowRoot);
12939
- this._instance = null;
13081
+ this._app && this._app.unmount();
13082
+ this._instance.ce = void 0;
13083
+ this._app = this._instance = null;
12940
13084
  }
12941
13085
  });
12942
13086
  }
@@ -12944,7 +13088,9 @@ Expected function or array of functions, received type ${typeof value}.`
12944
13088
  * resolve inner component definition (handle possible async component)
12945
13089
  */
12946
13090
  _resolveDef() {
12947
- this._resolved = true;
13091
+ if (this._pendingResolve) {
13092
+ return;
13093
+ }
12948
13094
  for (let i = 0; i < this.attributes.length; i++) {
12949
13095
  this._setAttr(this.attributes[i].name);
12950
13096
  }
@@ -12955,6 +13101,8 @@ Expected function or array of functions, received type ${typeof value}.`
12955
13101
  });
12956
13102
  this._ob.observe(this, { attributes: true });
12957
13103
  const resolve = (def, isAsync = false) => {
13104
+ this._resolved = true;
13105
+ this._pendingResolve = void 0;
12958
13106
  const { props, styles } = def;
12959
13107
  let numberProps;
12960
13108
  if (props && !isArray(props)) {
@@ -12972,22 +13120,53 @@ Expected function or array of functions, received type ${typeof value}.`
12972
13120
  if (isAsync) {
12973
13121
  this._resolveProps(def);
12974
13122
  }
12975
- this._applyStyles(styles);
12976
- this._update();
13123
+ if (this.shadowRoot) {
13124
+ this._applyStyles(styles);
13125
+ } else if (styles) {
13126
+ warn(
13127
+ "Custom element style injection is not supported when using shadowRoot: false"
13128
+ );
13129
+ }
13130
+ this._mount(def);
12977
13131
  };
12978
13132
  const asyncDef = this._def.__asyncLoader;
12979
13133
  if (asyncDef) {
12980
- asyncDef().then((def) => resolve(def, true));
13134
+ this._pendingResolve = asyncDef().then(
13135
+ (def) => resolve(this._def = def, true)
13136
+ );
12981
13137
  } else {
12982
13138
  resolve(this._def);
12983
13139
  }
12984
13140
  }
13141
+ _mount(def) {
13142
+ if (!def.name) {
13143
+ def.name = "VueElement";
13144
+ }
13145
+ this._app = this._createApp(def);
13146
+ if (def.configureApp) {
13147
+ def.configureApp(this._app);
13148
+ }
13149
+ this._app._ceVNode = this._createVNode();
13150
+ this._app.mount(this._root);
13151
+ const exposed = this._instance && this._instance.exposed;
13152
+ if (!exposed) return;
13153
+ for (const key in exposed) {
13154
+ if (!hasOwn(this, key)) {
13155
+ Object.defineProperty(this, key, {
13156
+ // unwrap ref to be consistent with public instance behavior
13157
+ get: () => unref(exposed[key])
13158
+ });
13159
+ } else {
13160
+ warn(`Exposed property "${key}" already exists on custom element.`);
13161
+ }
13162
+ }
13163
+ }
12985
13164
  _resolveProps(def) {
12986
13165
  const { props } = def;
12987
13166
  const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
12988
13167
  for (const key of Object.keys(this)) {
12989
13168
  if (key[0] !== "_" && declaredPropKeys.includes(key)) {
12990
- this._setProp(key, this[key], true, false);
13169
+ this._setProp(key, this[key]);
12991
13170
  }
12992
13171
  }
12993
13172
  for (const key of declaredPropKeys.map(camelize)) {
@@ -12996,18 +13175,20 @@ Expected function or array of functions, received type ${typeof value}.`
12996
13175
  return this._getProp(key);
12997
13176
  },
12998
13177
  set(val) {
12999
- this._setProp(key, val);
13178
+ this._setProp(key, val, true, true);
13000
13179
  }
13001
13180
  });
13002
13181
  }
13003
13182
  }
13004
13183
  _setAttr(key) {
13005
- let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0;
13184
+ if (key.startsWith("data-v-")) return;
13185
+ const has = this.hasAttribute(key);
13186
+ let value = has ? this.getAttribute(key) : REMOVAL;
13006
13187
  const camelKey = camelize(key);
13007
- if (this._numberProps && this._numberProps[camelKey]) {
13188
+ if (has && this._numberProps && this._numberProps[camelKey]) {
13008
13189
  value = toNumber(value);
13009
13190
  }
13010
- this._setProp(camelKey, value, false);
13191
+ this._setProp(camelKey, value, false, true);
13011
13192
  }
13012
13193
  /**
13013
13194
  * @internal
@@ -13018,9 +13199,13 @@ Expected function or array of functions, received type ${typeof value}.`
13018
13199
  /**
13019
13200
  * @internal
13020
13201
  */
13021
- _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
13202
+ _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
13022
13203
  if (val !== this._props[key]) {
13023
- this._props[key] = val;
13204
+ if (val === REMOVAL) {
13205
+ delete this._props[key];
13206
+ } else {
13207
+ this._props[key] = val;
13208
+ }
13024
13209
  if (shouldUpdate && this._instance) {
13025
13210
  this._update();
13026
13211
  }
@@ -13036,18 +13221,23 @@ Expected function or array of functions, received type ${typeof value}.`
13036
13221
  }
13037
13222
  }
13038
13223
  _update() {
13039
- render(this._createVNode(), this.shadowRoot);
13224
+ render(this._createVNode(), this._root);
13040
13225
  }
13041
13226
  _createVNode() {
13042
- const vnode = createVNode(this._def, extend({}, this._props));
13227
+ const baseProps = {};
13228
+ if (!this.shadowRoot) {
13229
+ baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
13230
+ }
13231
+ const vnode = createVNode(this._def, extend(baseProps, this._props));
13043
13232
  if (!this._instance) {
13044
13233
  vnode.ce = (instance) => {
13045
13234
  this._instance = instance;
13235
+ instance.ce = this;
13046
13236
  instance.isCE = true;
13047
13237
  {
13048
13238
  instance.ceReload = (newStyles) => {
13049
13239
  if (this._styles) {
13050
- this._styles.forEach((s) => this.shadowRoot.removeChild(s));
13240
+ this._styles.forEach((s) => this._root.removeChild(s));
13051
13241
  this._styles.length = 0;
13052
13242
  }
13053
13243
  this._applyStyles(newStyles);
@@ -13057,9 +13247,10 @@ Expected function or array of functions, received type ${typeof value}.`
13057
13247
  }
13058
13248
  const dispatch = (event, args) => {
13059
13249
  this.dispatchEvent(
13060
- new CustomEvent(event, {
13061
- detail: args
13062
- })
13250
+ new CustomEvent(
13251
+ event,
13252
+ isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
13253
+ )
13063
13254
  );
13064
13255
  };
13065
13256
  instance.emit = (event, ...args) => {
@@ -13068,30 +13259,126 @@ Expected function or array of functions, received type ${typeof value}.`
13068
13259
  dispatch(hyphenate(event), args);
13069
13260
  }
13070
13261
  };
13071
- let parent = this;
13072
- while (parent = parent && (parent.parentNode || parent.host)) {
13073
- if (parent instanceof VueElement) {
13074
- instance.parent = parent._instance;
13075
- instance.provides = parent._instance.provides;
13076
- break;
13077
- }
13078
- }
13262
+ this._setParent();
13079
13263
  };
13080
13264
  }
13081
13265
  return vnode;
13082
13266
  }
13083
- _applyStyles(styles) {
13084
- if (styles) {
13085
- styles.forEach((css) => {
13086
- const s = document.createElement("style");
13087
- s.textContent = css;
13088
- this.shadowRoot.appendChild(s);
13089
- {
13267
+ _applyStyles(styles, owner) {
13268
+ if (!styles) return;
13269
+ if (owner) {
13270
+ if (owner === this._def || this._styleChildren.has(owner)) {
13271
+ return;
13272
+ }
13273
+ this._styleChildren.add(owner);
13274
+ }
13275
+ const nonce = this._nonce;
13276
+ for (let i = styles.length - 1; i >= 0; i--) {
13277
+ const s = document.createElement("style");
13278
+ if (nonce) s.setAttribute("nonce", nonce);
13279
+ s.textContent = styles[i];
13280
+ this.shadowRoot.prepend(s);
13281
+ {
13282
+ if (owner) {
13283
+ if (owner.__hmrId) {
13284
+ if (!this._childStyles) this._childStyles = /* @__PURE__ */ new Map();
13285
+ let entry = this._childStyles.get(owner.__hmrId);
13286
+ if (!entry) {
13287
+ this._childStyles.set(owner.__hmrId, entry = []);
13288
+ }
13289
+ entry.push(s);
13290
+ }
13291
+ } else {
13090
13292
  (this._styles || (this._styles = [])).push(s);
13091
13293
  }
13092
- });
13294
+ }
13295
+ }
13296
+ }
13297
+ /**
13298
+ * Only called when shaddowRoot is false
13299
+ */
13300
+ _parseSlots() {
13301
+ const slots = this._slots = {};
13302
+ let n;
13303
+ while (n = this.firstChild) {
13304
+ const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
13305
+ (slots[slotName] || (slots[slotName] = [])).push(n);
13306
+ this.removeChild(n);
13093
13307
  }
13094
13308
  }
13309
+ /**
13310
+ * Only called when shaddowRoot is false
13311
+ */
13312
+ _renderSlots() {
13313
+ const outlets = this.querySelectorAll("slot");
13314
+ const scopeId = this._instance.type.__scopeId;
13315
+ for (let i = 0; i < outlets.length; i++) {
13316
+ const o = outlets[i];
13317
+ const slotName = o.getAttribute("name") || "default";
13318
+ const content = this._slots[slotName];
13319
+ const parent = o.parentNode;
13320
+ if (content) {
13321
+ for (const n of content) {
13322
+ if (scopeId && n.nodeType === 1) {
13323
+ const id = scopeId + "-s";
13324
+ const walker = document.createTreeWalker(n, 1);
13325
+ n.setAttribute(id, "");
13326
+ let child;
13327
+ while (child = walker.nextNode()) {
13328
+ child.setAttribute(id, "");
13329
+ }
13330
+ }
13331
+ parent.insertBefore(n, o);
13332
+ }
13333
+ } else {
13334
+ while (o.firstChild) parent.insertBefore(o.firstChild, o);
13335
+ }
13336
+ parent.removeChild(o);
13337
+ }
13338
+ }
13339
+ /**
13340
+ * @internal
13341
+ */
13342
+ _injectChildStyle(comp) {
13343
+ this._applyStyles(comp.styles, comp);
13344
+ }
13345
+ /**
13346
+ * @internal
13347
+ */
13348
+ _removeChildStyle(comp) {
13349
+ {
13350
+ this._styleChildren.delete(comp);
13351
+ if (this._childStyles && comp.__hmrId) {
13352
+ const oldStyles = this._childStyles.get(comp.__hmrId);
13353
+ if (oldStyles) {
13354
+ oldStyles.forEach((s) => this._root.removeChild(s));
13355
+ oldStyles.length = 0;
13356
+ }
13357
+ }
13358
+ }
13359
+ }
13360
+ }
13361
+ function useHost(caller) {
13362
+ const instance = getCurrentInstance();
13363
+ const el = instance && instance.ce;
13364
+ if (el) {
13365
+ return el;
13366
+ } else {
13367
+ if (!instance) {
13368
+ warn(
13369
+ `${caller || "useHost"} called without an active component instance.`
13370
+ );
13371
+ } else {
13372
+ warn(
13373
+ `${caller || "useHost"} can only be used in components defined via defineCustomElement.`
13374
+ );
13375
+ }
13376
+ }
13377
+ return null;
13378
+ }
13379
+ function useShadowRoot() {
13380
+ const el = useHost("useShadowRoot") ;
13381
+ return el && el.shadowRoot;
13095
13382
  }
13096
13383
 
13097
13384
  function useCssModule(name = "$style") {
@@ -13604,7 +13891,7 @@ Expected function or array of functions, received type ${typeof value}.`
13604
13891
  const component = app._component;
13605
13892
  if (!isFunction(component) && !component.render && !component.template) {
13606
13893
  component.template = container.innerHTML;
13607
- {
13894
+ if (container.nodeType === 1) {
13608
13895
  for (let i = 0; i < container.attributes.length; i++) {
13609
13896
  const attr = container.attributes[i];
13610
13897
  if (attr.name !== "v-cloak" && /^(v-|:|@)/.test(attr.name)) {
@@ -13617,7 +13904,9 @@ Expected function or array of functions, received type ${typeof value}.`
13617
13904
  }
13618
13905
  }
13619
13906
  }
13620
- container.innerHTML = "";
13907
+ if (container.nodeType === 1) {
13908
+ container.textContent = "";
13909
+ }
13621
13910
  const proxy = mount(container, false, resolveRootNamespace(container));
13622
13911
  if (container instanceof Element) {
13623
13912
  container.removeAttribute("v-cloak");
@@ -13844,9 +14133,11 @@ Expected function or array of functions, received type ${typeof value}.`
13844
14133
  useAttrs: useAttrs,
13845
14134
  useCssModule: useCssModule,
13846
14135
  useCssVars: useCssVars,
14136
+ useHost: useHost,
13847
14137
  useId: useId,
13848
14138
  useModel: useModel,
13849
14139
  useSSRContext: useSSRContext,
14140
+ useShadowRoot: useShadowRoot,
13850
14141
  useSlots: useSlots,
13851
14142
  useTemplateRef: useTemplateRef,
13852
14143
  useTransitionState: useTransitionState,
@@ -13908,36 +14199,70 @@ Make sure to use the production build (*.prod.js) when deploying for production.
13908
14199
  const TELEPORT = Symbol(`Teleport` );
13909
14200
  const SUSPENSE = Symbol(`Suspense` );
13910
14201
  const KEEP_ALIVE = Symbol(`KeepAlive` );
13911
- const BASE_TRANSITION = Symbol(`BaseTransition` );
14202
+ const BASE_TRANSITION = Symbol(
14203
+ `BaseTransition`
14204
+ );
13912
14205
  const OPEN_BLOCK = Symbol(`openBlock` );
13913
14206
  const CREATE_BLOCK = Symbol(`createBlock` );
13914
- const CREATE_ELEMENT_BLOCK = Symbol(`createElementBlock` );
14207
+ const CREATE_ELEMENT_BLOCK = Symbol(
14208
+ `createElementBlock`
14209
+ );
13915
14210
  const CREATE_VNODE = Symbol(`createVNode` );
13916
- const CREATE_ELEMENT_VNODE = Symbol(`createElementVNode` );
13917
- const CREATE_COMMENT = Symbol(`createCommentVNode` );
13918
- const CREATE_TEXT = Symbol(`createTextVNode` );
13919
- const CREATE_STATIC = Symbol(`createStaticVNode` );
13920
- const RESOLVE_COMPONENT = Symbol(`resolveComponent` );
14211
+ const CREATE_ELEMENT_VNODE = Symbol(
14212
+ `createElementVNode`
14213
+ );
14214
+ const CREATE_COMMENT = Symbol(
14215
+ `createCommentVNode`
14216
+ );
14217
+ const CREATE_TEXT = Symbol(
14218
+ `createTextVNode`
14219
+ );
14220
+ const CREATE_STATIC = Symbol(
14221
+ `createStaticVNode`
14222
+ );
14223
+ const RESOLVE_COMPONENT = Symbol(
14224
+ `resolveComponent`
14225
+ );
13921
14226
  const RESOLVE_DYNAMIC_COMPONENT = Symbol(
13922
14227
  `resolveDynamicComponent`
13923
14228
  );
13924
- const RESOLVE_DIRECTIVE = Symbol(`resolveDirective` );
13925
- const RESOLVE_FILTER = Symbol(`resolveFilter` );
13926
- const WITH_DIRECTIVES = Symbol(`withDirectives` );
14229
+ const RESOLVE_DIRECTIVE = Symbol(
14230
+ `resolveDirective`
14231
+ );
14232
+ const RESOLVE_FILTER = Symbol(
14233
+ `resolveFilter`
14234
+ );
14235
+ const WITH_DIRECTIVES = Symbol(
14236
+ `withDirectives`
14237
+ );
13927
14238
  const RENDER_LIST = Symbol(`renderList` );
13928
14239
  const RENDER_SLOT = Symbol(`renderSlot` );
13929
14240
  const CREATE_SLOTS = Symbol(`createSlots` );
13930
- const TO_DISPLAY_STRING = Symbol(`toDisplayString` );
14241
+ const TO_DISPLAY_STRING = Symbol(
14242
+ `toDisplayString`
14243
+ );
13931
14244
  const MERGE_PROPS = Symbol(`mergeProps` );
13932
- const NORMALIZE_CLASS = Symbol(`normalizeClass` );
13933
- const NORMALIZE_STYLE = Symbol(`normalizeStyle` );
13934
- const NORMALIZE_PROPS = Symbol(`normalizeProps` );
13935
- const GUARD_REACTIVE_PROPS = Symbol(`guardReactiveProps` );
14245
+ const NORMALIZE_CLASS = Symbol(
14246
+ `normalizeClass`
14247
+ );
14248
+ const NORMALIZE_STYLE = Symbol(
14249
+ `normalizeStyle`
14250
+ );
14251
+ const NORMALIZE_PROPS = Symbol(
14252
+ `normalizeProps`
14253
+ );
14254
+ const GUARD_REACTIVE_PROPS = Symbol(
14255
+ `guardReactiveProps`
14256
+ );
13936
14257
  const TO_HANDLERS = Symbol(`toHandlers` );
13937
14258
  const CAMELIZE = Symbol(`camelize` );
13938
14259
  const CAPITALIZE = Symbol(`capitalize` );
13939
- const TO_HANDLER_KEY = Symbol(`toHandlerKey` );
13940
- const SET_BLOCK_TRACKING = Symbol(`setBlockTracking` );
14260
+ const TO_HANDLER_KEY = Symbol(
14261
+ `toHandlerKey`
14262
+ );
14263
+ const SET_BLOCK_TRACKING = Symbol(
14264
+ `setBlockTracking`
14265
+ );
13941
14266
  const PUSH_SCOPE_ID = Symbol(`pushScopeId` );
13942
14267
  const POP_SCOPE_ID = Symbol(`popScopeId` );
13943
14268
  const WITH_CTX = Symbol(`withCtx` );
@@ -15106,8 +15431,9 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15106
15431
  const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
15107
15432
  const validIdentCharRE = /[\.\?\w$\xA0-\uFFFF]/;
15108
15433
  const whitespaceRE = /\s+[.[]\s*|\s*[.[]\s+/g;
15109
- const isMemberExpressionBrowser = (path) => {
15110
- path = path.trim().replace(whitespaceRE, (s) => s.trim());
15434
+ const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
15435
+ const isMemberExpressionBrowser = (exp) => {
15436
+ const path = getExpSource(exp).trim().replace(whitespaceRE, (s) => s.trim());
15111
15437
  let state = 0 /* inMemberExp */;
15112
15438
  let stateStack = [];
15113
15439
  let currentOpenBracketCount = 0;
@@ -15169,6 +15495,9 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15169
15495
  return !currentOpenBracketCount && !currentOpenParensCount;
15170
15496
  };
15171
15497
  const isMemberExpression = isMemberExpressionBrowser ;
15498
+ const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
15499
+ const isFnExpressionBrowser = (exp) => fnExpRE.test(getExpSource(exp));
15500
+ const isFnExpression = isFnExpressionBrowser ;
15172
15501
  function assert(condition, msg) {
15173
15502
  if (!condition) {
15174
15503
  throw new Error(msg || `unexpected compiler condition`);
@@ -18159,7 +18488,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
18159
18488
  } else {
18160
18489
  exp = isProp.exp;
18161
18490
  if (!exp) {
18162
- exp = createSimpleExpression(`is`, false, isProp.loc);
18491
+ exp = createSimpleExpression(`is`, false, isProp.arg.loc);
18163
18492
  }
18164
18493
  }
18165
18494
  if (exp) {
@@ -18663,7 +18992,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
18663
18992
  };
18664
18993
  }
18665
18994
 
18666
- const fnExpRE = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
18667
18995
  const transformOn$1 = (dir, node, context, augmentor) => {
18668
18996
  const { loc, modifiers, arg } = dir;
18669
18997
  if (!dir.exp && !modifiers.length) {
@@ -18707,8 +19035,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
18707
19035
  }
18708
19036
  let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;
18709
19037
  if (exp) {
18710
- const isMemberExp = isMemberExpression(exp.content);
18711
- const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content));
19038
+ const isMemberExp = isMemberExpression(exp);
19039
+ const isInlineStatement = !(isMemberExp || isFnExpression(exp));
18712
19040
  const hasMultipleStatements = exp.content.includes(`;`);
18713
19041
  {
18714
19042
  validateBrowserExpression(
@@ -18856,7 +19184,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
18856
19184
  return createTransformProps();
18857
19185
  }
18858
19186
  const maybeRef = false;
18859
- if (!expString.trim() || !isMemberExpression(expString) && !maybeRef) {
19187
+ if (!expString.trim() || !isMemberExpression(exp) && !maybeRef) {
18860
19188
  context.onError(
18861
19189
  createCompilerError(42, exp.loc)
18862
19190
  );
@@ -19132,15 +19460,27 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19132
19460
  const noopDirectiveTransform = () => ({ props: [] });
19133
19461
 
19134
19462
  const V_MODEL_RADIO = Symbol(`vModelRadio` );
19135
- const V_MODEL_CHECKBOX = Symbol(`vModelCheckbox` );
19463
+ const V_MODEL_CHECKBOX = Symbol(
19464
+ `vModelCheckbox`
19465
+ );
19136
19466
  const V_MODEL_TEXT = Symbol(`vModelText` );
19137
- const V_MODEL_SELECT = Symbol(`vModelSelect` );
19138
- const V_MODEL_DYNAMIC = Symbol(`vModelDynamic` );
19139
- const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard` );
19140
- const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard` );
19467
+ const V_MODEL_SELECT = Symbol(
19468
+ `vModelSelect`
19469
+ );
19470
+ const V_MODEL_DYNAMIC = Symbol(
19471
+ `vModelDynamic`
19472
+ );
19473
+ const V_ON_WITH_MODIFIERS = Symbol(
19474
+ `vOnModifiersGuard`
19475
+ );
19476
+ const V_ON_WITH_KEYS = Symbol(
19477
+ `vOnKeysGuard`
19478
+ );
19141
19479
  const V_SHOW = Symbol(`vShow` );
19142
19480
  const TRANSITION = Symbol(`Transition` );
19143
- const TRANSITION_GROUP = Symbol(`TransitionGroup` );
19481
+ const TRANSITION_GROUP = Symbol(
19482
+ `TransitionGroup`
19483
+ );
19144
19484
  registerRuntimeHelpers({
19145
19485
  [V_MODEL_RADIO]: `vModelRadio`,
19146
19486
  [V_MODEL_CHECKBOX]: `vModelCheckbox`,