@vue/compat 3.3.4 → 3.3.6

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.
@@ -34,7 +34,7 @@ const isString = (val) => typeof val === "string";
34
34
  const isSymbol = (val) => typeof val === "symbol";
35
35
  const isObject = (val) => val !== null && typeof val === "object";
36
36
  const isPromise = (val) => {
37
- return isObject(val) && isFunction(val.then) && isFunction(val.catch);
37
+ return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
38
38
  };
39
39
  const objectToString = Object.prototype.toString;
40
40
  const toTypeString = (value) => objectToString.call(value);
@@ -65,12 +65,13 @@ const hyphenateRE = /\B([A-Z])/g;
65
65
  const hyphenate = cacheStringFunction(
66
66
  (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
67
67
  );
68
- const capitalize = cacheStringFunction(
69
- (str) => str.charAt(0).toUpperCase() + str.slice(1)
70
- );
71
- const toHandlerKey = cacheStringFunction(
72
- (str) => str ? `on${capitalize(str)}` : ``
73
- );
68
+ const capitalize = cacheStringFunction((str) => {
69
+ return str.charAt(0).toUpperCase() + str.slice(1);
70
+ });
71
+ const toHandlerKey = cacheStringFunction((str) => {
72
+ const s = str ? `on${capitalize(str)}` : ``;
73
+ return s;
74
+ });
74
75
  const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
75
76
  const invokeArrayFns = (fns, arg) => {
76
77
  for (let i = 0; i < fns.length; i++) {
@@ -97,8 +98,8 @@ const getGlobalThis = () => {
97
98
  return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
98
99
  };
99
100
 
100
- const GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
101
- const isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);
101
+ const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
102
+ const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
102
103
 
103
104
  function normalizeStyle(value) {
104
105
  if (isArray(value)) {
@@ -113,9 +114,7 @@ function normalizeStyle(value) {
113
114
  }
114
115
  }
115
116
  return res;
116
- } else if (isString(value)) {
117
- return value;
118
- } else if (isObject(value)) {
117
+ } else if (isString(value) || isObject(value)) {
119
118
  return value;
120
119
  }
121
120
  }
@@ -462,7 +461,7 @@ function cleanupEffect(effect2) {
462
461
  }
463
462
  }
464
463
  function effect(fn, options) {
465
- if (fn.effect) {
464
+ if (fn.effect instanceof ReactiveEffect) {
466
465
  fn = fn.effect.fn;
467
466
  }
468
467
  const _effect = new ReactiveEffect(fn);
@@ -632,10 +631,6 @@ const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`
632
631
  const builtInSymbols = new Set(
633
632
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
634
633
  );
635
- const get$1 = /* @__PURE__ */ createGetter();
636
- const shallowGet = /* @__PURE__ */ createGetter(false, true);
637
- const readonlyGet = /* @__PURE__ */ createGetter(true);
638
- const shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
639
634
  const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
640
635
  function createArrayInstrumentations() {
641
636
  const instrumentations = {};
@@ -668,8 +663,13 @@ function hasOwnProperty(key) {
668
663
  track(obj, "has", key);
669
664
  return obj.hasOwnProperty(key);
670
665
  }
671
- function createGetter(isReadonly2 = false, shallow = false) {
672
- return function get2(target, key, receiver) {
666
+ class BaseReactiveHandler {
667
+ constructor(_isReadonly = false, _shallow = false) {
668
+ this._isReadonly = _isReadonly;
669
+ this._shallow = _shallow;
670
+ }
671
+ get(target, key, receiver) {
672
+ const isReadonly2 = this._isReadonly, shallow = this._shallow;
673
673
  if (key === "__v_isReactive") {
674
674
  return !isReadonly2;
675
675
  } else if (key === "__v_isReadonly") {
@@ -705,17 +705,18 @@ function createGetter(isReadonly2 = false, shallow = false) {
705
705
  return isReadonly2 ? readonly(res) : reactive(res);
706
706
  }
707
707
  return res;
708
- };
708
+ }
709
709
  }
710
- const set$1 = /* @__PURE__ */ createSetter();
711
- const shallowSet = /* @__PURE__ */ createSetter(true);
712
- function createSetter(shallow = false) {
713
- return function set2(target, key, value, receiver) {
710
+ class MutableReactiveHandler extends BaseReactiveHandler {
711
+ constructor(shallow = false) {
712
+ super(false, shallow);
713
+ }
714
+ set(target, key, value, receiver) {
714
715
  let oldValue = target[key];
715
716
  if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
716
717
  return false;
717
718
  }
718
- if (!shallow) {
719
+ if (!this._shallow) {
719
720
  if (!isShallow(value) && !isReadonly(value)) {
720
721
  oldValue = toRaw(oldValue);
721
722
  value = toRaw(value);
@@ -735,37 +736,36 @@ function createSetter(shallow = false) {
735
736
  }
736
737
  }
737
738
  return result;
738
- };
739
- }
740
- function deleteProperty(target, key) {
741
- const hadKey = hasOwn(target, key);
742
- const oldValue = target[key];
743
- const result = Reflect.deleteProperty(target, key);
744
- if (result && hadKey) {
745
- trigger(target, "delete", key, void 0, oldValue);
746
739
  }
747
- return result;
748
- }
749
- function has$1(target, key) {
750
- const result = Reflect.has(target, key);
751
- if (!isSymbol(key) || !builtInSymbols.has(key)) {
752
- track(target, "has", key);
740
+ deleteProperty(target, key) {
741
+ const hadKey = hasOwn(target, key);
742
+ const oldValue = target[key];
743
+ const result = Reflect.deleteProperty(target, key);
744
+ if (result && hadKey) {
745
+ trigger(target, "delete", key, void 0, oldValue);
746
+ }
747
+ return result;
748
+ }
749
+ has(target, key) {
750
+ const result = Reflect.has(target, key);
751
+ if (!isSymbol(key) || !builtInSymbols.has(key)) {
752
+ track(target, "has", key);
753
+ }
754
+ return result;
755
+ }
756
+ ownKeys(target) {
757
+ track(
758
+ target,
759
+ "iterate",
760
+ isArray(target) ? "length" : ITERATE_KEY
761
+ );
762
+ return Reflect.ownKeys(target);
753
763
  }
754
- return result;
755
- }
756
- function ownKeys(target) {
757
- track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY);
758
- return Reflect.ownKeys(target);
759
764
  }
760
- const mutableHandlers = {
761
- get: get$1,
762
- set: set$1,
763
- deleteProperty,
764
- has: has$1,
765
- ownKeys
766
- };
767
- const readonlyHandlers = {
768
- get: readonlyGet,
765
+ class ReadonlyReactiveHandler extends BaseReactiveHandler {
766
+ constructor(shallow = false) {
767
+ super(true, shallow);
768
+ }
769
769
  set(target, key) {
770
770
  if (!!(process.env.NODE_ENV !== "production")) {
771
771
  warn$1(
@@ -774,7 +774,7 @@ const readonlyHandlers = {
774
774
  );
775
775
  }
776
776
  return true;
777
- },
777
+ }
778
778
  deleteProperty(target, key) {
779
779
  if (!!(process.env.NODE_ENV !== "production")) {
780
780
  warn$1(
@@ -784,22 +784,13 @@ const readonlyHandlers = {
784
784
  }
785
785
  return true;
786
786
  }
787
- };
788
- const shallowReactiveHandlers = /* @__PURE__ */ extend(
789
- {},
790
- mutableHandlers,
791
- {
792
- get: shallowGet,
793
- set: shallowSet
794
- }
795
- );
796
- const shallowReadonlyHandlers = /* @__PURE__ */ extend(
797
- {},
798
- readonlyHandlers,
799
- {
800
- get: shallowReadonlyGet
801
- }
787
+ }
788
+ const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
789
+ const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
790
+ const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
791
+ true
802
792
  );
793
+ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
803
794
 
804
795
  const toShallow = (value) => value;
805
796
  const getProto = (v) => Reflect.getPrototypeOf(v);
@@ -808,7 +799,7 @@ function get(target, key, isReadonly = false, isShallow = false) {
808
799
  const rawTarget = toRaw(target);
809
800
  const rawKey = toRaw(key);
810
801
  if (!isReadonly) {
811
- if (key !== rawKey) {
802
+ if (hasChanged(key, rawKey)) {
812
803
  track(rawTarget, "get", key);
813
804
  }
814
805
  track(rawTarget, "get", rawKey);
@@ -828,7 +819,7 @@ function has(key, isReadonly = false) {
828
819
  const rawTarget = toRaw(target);
829
820
  const rawKey = toRaw(key);
830
821
  if (!isReadonly) {
831
- if (key !== rawKey) {
822
+ if (hasChanged(key, rawKey)) {
832
823
  track(rawTarget, "has", key);
833
824
  }
834
825
  track(rawTarget, "has", rawKey);
@@ -1362,11 +1353,7 @@ function toRef(source, key, defaultValue) {
1362
1353
  }
1363
1354
  function propertyToRef(source, key, defaultValue) {
1364
1355
  const val = source[key];
1365
- return isRef(val) ? val : new ObjectRefImpl(
1366
- source,
1367
- key,
1368
- defaultValue
1369
- );
1356
+ return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1370
1357
  }
1371
1358
 
1372
1359
  class ComputedRefImpl {
@@ -3688,9 +3675,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3688
3675
  }
3689
3676
  if (cb) {
3690
3677
  const newValue = effect.run();
3691
- if (deep || forceTrigger || (isMultiSource ? newValue.some(
3692
- (v, i) => hasChanged(v, oldValue[i])
3693
- ) : hasChanged(newValue, oldValue)) || isArray(newValue) && isCompatEnabled("WATCH_ARRAY", instance)) {
3678
+ if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || isArray(newValue) && isCompatEnabled("WATCH_ARRAY", instance)) {
3694
3679
  if (cleanup) {
3695
3680
  cleanup();
3696
3681
  }
@@ -3866,6 +3851,8 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3866
3851
  }
3867
3852
  }
3868
3853
 
3854
+ const leaveCbKey = Symbol("_leaveCb");
3855
+ const enterCbKey$1 = Symbol("_enterCb");
3869
3856
  function useTransitionState() {
3870
3857
  const state = {
3871
3858
  isMounted: false,
@@ -3988,9 +3975,9 @@ const BaseTransitionImpl = {
3988
3975
  oldInnerChild
3989
3976
  );
3990
3977
  leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
3991
- el._leaveCb = () => {
3978
+ el[leaveCbKey] = () => {
3992
3979
  earlyRemove();
3993
- el._leaveCb = void 0;
3980
+ el[leaveCbKey] = void 0;
3994
3981
  delete enterHooks.delayedLeave;
3995
3982
  };
3996
3983
  enterHooks.delayedLeave = delayedLeave;
@@ -4064,15 +4051,15 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4064
4051
  return;
4065
4052
  }
4066
4053
  }
4067
- if (el._leaveCb) {
4068
- el._leaveCb(
4054
+ if (el[leaveCbKey]) {
4055
+ el[leaveCbKey](
4069
4056
  true
4070
4057
  /* cancelled */
4071
4058
  );
4072
4059
  }
4073
4060
  const leavingVNode = leavingVNodesCache[key];
4074
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el._leaveCb) {
4075
- leavingVNode.el._leaveCb();
4061
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
4062
+ leavingVNode.el[leaveCbKey]();
4076
4063
  }
4077
4064
  callHook(hook, [el]);
4078
4065
  },
@@ -4090,7 +4077,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4090
4077
  }
4091
4078
  }
4092
4079
  let called = false;
4093
- const done = el._enterCb = (cancelled) => {
4080
+ const done = el[enterCbKey$1] = (cancelled) => {
4094
4081
  if (called)
4095
4082
  return;
4096
4083
  called = true;
@@ -4102,7 +4089,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4102
4089
  if (hooks.delayedLeave) {
4103
4090
  hooks.delayedLeave();
4104
4091
  }
4105
- el._enterCb = void 0;
4092
+ el[enterCbKey$1] = void 0;
4106
4093
  };
4107
4094
  if (hook) {
4108
4095
  callAsyncHook(hook, [el, done]);
@@ -4112,8 +4099,8 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4112
4099
  },
4113
4100
  leave(el, remove) {
4114
4101
  const key2 = String(vnode.key);
4115
- if (el._enterCb) {
4116
- el._enterCb(
4102
+ if (el[enterCbKey$1]) {
4103
+ el[enterCbKey$1](
4117
4104
  true
4118
4105
  /* cancelled */
4119
4106
  );
@@ -4123,7 +4110,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4123
4110
  }
4124
4111
  callHook(onBeforeLeave, [el]);
4125
4112
  let called = false;
4126
- const done = el._leaveCb = (cancelled) => {
4113
+ const done = el[leaveCbKey] = (cancelled) => {
4127
4114
  if (called)
4128
4115
  return;
4129
4116
  called = true;
@@ -4133,7 +4120,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4133
4120
  } else {
4134
4121
  callHook(onAfterLeave, [el]);
4135
4122
  }
4136
- el._leaveCb = void 0;
4123
+ el[leaveCbKey] = void 0;
4137
4124
  if (leavingVNodesCache[key2] === vnode) {
4138
4125
  delete leavingVNodesCache[key2];
4139
4126
  }
@@ -4195,6 +4182,8 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4195
4182
  return ret;
4196
4183
  }
4197
4184
 
4185
+ /*! #__NO_SIDE_EFFECTS__ */
4186
+ // @__NO_SIDE_EFFECTS__
4198
4187
  function defineComponent(options, extraOptions) {
4199
4188
  return isFunction(options) ? (
4200
4189
  // #8326: extend call and options.name access are considered side-effects
@@ -4204,6 +4193,8 @@ function defineComponent(options, extraOptions) {
4204
4193
  }
4205
4194
 
4206
4195
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
4196
+ /*! #__NO_SIDE_EFFECTS__ */
4197
+ // @__NO_SIDE_EFFECTS__
4207
4198
  function defineAsyncComponent(source) {
4208
4199
  if (isFunction(source)) {
4209
4200
  source = { loader: source };
@@ -4941,7 +4932,7 @@ function defineLegacyVNodeProperties(vnode) {
4941
4932
  }
4942
4933
  }
4943
4934
 
4944
- const normalizedFunctionalComponentMap = /* @__PURE__ */ new Map();
4935
+ const normalizedFunctionalComponentMap = /* @__PURE__ */ new WeakMap();
4945
4936
  const legacySlotProxyHandlers = {
4946
4937
  get(target, key) {
4947
4938
  const slot = target[key];
@@ -5222,6 +5213,7 @@ function legacyPrependModifier(value, symbol) {
5222
5213
  function installCompatInstanceProperties(map) {
5223
5214
  const set = (target, key, val) => {
5224
5215
  target[key] = val;
5216
+ return target[key];
5225
5217
  };
5226
5218
  const del = (target, key) => {
5227
5219
  delete target[key];
@@ -5499,7 +5491,7 @@ const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend(
5499
5491
  return PublicInstanceProxyHandlers.get(target, key, target);
5500
5492
  },
5501
5493
  has(_, key) {
5502
- const has = key[0] !== "_" && !isGloballyWhitelisted(key);
5494
+ const has = key[0] !== "_" && !isGloballyAllowed(key);
5503
5495
  if (!!(process.env.NODE_ENV !== "production") && !has && PublicInstanceProxyHandlers.has(_, key)) {
5504
5496
  warn(
5505
5497
  `Property ${JSON.stringify(
@@ -6238,7 +6230,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6238
6230
  return vm;
6239
6231
  }
6240
6232
  }
6241
- Vue.version = `2.6.14-compat:${"3.3.4"}`;
6233
+ Vue.version = `2.6.14-compat:${"3.3.6"}`;
6242
6234
  Vue.config = singletonApp.config;
6243
6235
  Vue.use = (p, ...options) => {
6244
6236
  if (p && isFunction(p.install)) {
@@ -6647,12 +6639,12 @@ function createAppAPI(render, hydrate) {
6647
6639
  },
6648
6640
  set() {
6649
6641
  warn(
6650
- `app.config.unwrapInjectedRef has been deprecated. 3.3 now alawys unwraps injected refs in Options API.`
6642
+ `app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.`
6651
6643
  );
6652
6644
  }
6653
6645
  });
6654
6646
  }
6655
- const installedPlugins = /* @__PURE__ */ new Set();
6647
+ const installedPlugins = /* @__PURE__ */ new WeakSet();
6656
6648
  let isMounted = false;
6657
6649
  const app = context.app = {
6658
6650
  _uid: uid$1++,
@@ -6736,10 +6728,7 @@ function createAppAPI(render, hydrate) {
6736
6728
  If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
6737
6729
  );
6738
6730
  }
6739
- const vnode = createVNode(
6740
- rootComponent,
6741
- rootProps
6742
- );
6731
+ const vnode = createVNode(rootComponent, rootProps);
6743
6732
  vnode.appContext = context;
6744
6733
  if (!!(process.env.NODE_ENV !== "production")) {
6745
6734
  context.reload = () => {
@@ -7398,7 +7387,7 @@ const updateSlots = (instance, children, optimized) => {
7398
7387
  }
7399
7388
  if (needDeletionCheck) {
7400
7389
  for (const key in slots) {
7401
- if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {
7390
+ if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
7402
7391
  delete slots[key];
7403
7392
  }
7404
7393
  }
@@ -7562,8 +7551,10 @@ function createHydrationFunctions(rendererInternals) {
7562
7551
  hasMismatch = true;
7563
7552
  !!(process.env.NODE_ENV !== "production") && warn(
7564
7553
  `Hydration text mismatch:
7565
- - Client: ${JSON.stringify(node.data)}
7566
- - Server: ${JSON.stringify(vnode.children)}`
7554
+ - Server rendered: ${JSON.stringify(
7555
+ node.data
7556
+ )}
7557
+ - Client rendered: ${JSON.stringify(vnode.children)}`
7567
7558
  );
7568
7559
  node.data = vnode.children;
7569
7560
  }
@@ -7766,8 +7757,8 @@ function createHydrationFunctions(rendererInternals) {
7766
7757
  hasMismatch = true;
7767
7758
  !!(process.env.NODE_ENV !== "production") && warn(
7768
7759
  `Hydration text content mismatch in <${vnode.type}>:
7769
- - Client: ${el.textContent}
7770
- - Server: ${vnode.children}`
7760
+ - Server rendered: ${el.textContent}
7761
+ - Client rendered: ${vnode.children}`
7771
7762
  );
7772
7763
  el.textContent = vnode.children;
7773
7764
  }
@@ -9583,6 +9574,10 @@ const TeleportImpl = {
9583
9574
  internals,
9584
9575
  1
9585
9576
  );
9577
+ } else {
9578
+ if (n2.props && n1.props && n2.props.to !== n1.props.to) {
9579
+ n2.props.to = n1.props.to;
9580
+ }
9586
9581
  }
9587
9582
  } else {
9588
9583
  if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
@@ -9623,19 +9618,18 @@ const TeleportImpl = {
9623
9618
  if (target) {
9624
9619
  hostRemove(targetAnchor);
9625
9620
  }
9626
- if (doRemove || !isTeleportDisabled(props)) {
9627
- hostRemove(anchor);
9628
- if (shapeFlag & 16) {
9629
- for (let i = 0; i < children.length; i++) {
9630
- const child = children[i];
9631
- unmount(
9632
- child,
9633
- parentComponent,
9634
- parentSuspense,
9635
- true,
9636
- !!child.dynamicChildren
9637
- );
9638
- }
9621
+ doRemove && hostRemove(anchor);
9622
+ if (shapeFlag & 16) {
9623
+ const shouldRemove = doRemove || !isTeleportDisabled(props);
9624
+ for (let i = 0; i < children.length; i++) {
9625
+ const child = children[i];
9626
+ unmount(
9627
+ child,
9628
+ parentComponent,
9629
+ parentSuspense,
9630
+ shouldRemove,
9631
+ !!child.dynamicChildren
9632
+ );
9639
9633
  }
9640
9634
  }
9641
9635
  },
@@ -9719,7 +9713,7 @@ function updateCssVars(vnode) {
9719
9713
  const ctx = vnode.ctx;
9720
9714
  if (ctx && ctx.ut) {
9721
9715
  let node = vnode.children[0].el;
9722
- while (node !== vnode.targetAnchor) {
9716
+ while (node && node !== vnode.targetAnchor) {
9723
9717
  if (node.nodeType === 1)
9724
9718
  node.setAttribute("data-v-owner", ctx.uid);
9725
9719
  node = node.nextSibling;
@@ -9728,7 +9722,7 @@ function updateCssVars(vnode) {
9728
9722
  }
9729
9723
  }
9730
9724
 
9731
- const normalizedAsyncComponentMap = /* @__PURE__ */ new Map();
9725
+ const normalizedAsyncComponentMap = /* @__PURE__ */ new WeakMap();
9732
9726
  function convertLegacyAsyncComponent(comp) {
9733
9727
  if (normalizedAsyncComponentMap.has(comp)) {
9734
9728
  return normalizedAsyncComponentMap.get(comp);
@@ -10450,9 +10444,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
10450
10444
  if (__VUE_OPTIONS_API__ && !skipOptions) {
10451
10445
  setCurrentInstance(instance);
10452
10446
  pauseTracking();
10453
- applyOptions(instance);
10454
- resetTracking();
10455
- unsetCurrentInstance();
10447
+ try {
10448
+ applyOptions(instance);
10449
+ } finally {
10450
+ resetTracking();
10451
+ unsetCurrentInstance();
10452
+ }
10456
10453
  }
10457
10454
  if (!!(process.env.NODE_ENV !== "production") && !Component.render && instance.render === NOOP && !isSSR) {
10458
10455
  if (!compile && Component.template) {
@@ -10832,7 +10829,7 @@ function isMemoSame(cached, memo) {
10832
10829
  return true;
10833
10830
  }
10834
10831
 
10835
- const version = "3.3.4";
10832
+ const version = "3.3.6";
10836
10833
  const _ssrUtils = {
10837
10834
  createComponentInstance,
10838
10835
  setupComponent,
@@ -10919,934 +10916,996 @@ const nodeOps = {
10919
10916
  }
10920
10917
  };
10921
10918
 
10922
- function patchClass(el, value, isSVG) {
10923
- const transitionClasses = el._vtc;
10924
- if (transitionClasses) {
10925
- value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
10926
- }
10927
- if (value == null) {
10928
- el.removeAttribute("class");
10929
- } else if (isSVG) {
10930
- el.setAttribute("class", value);
10931
- } else {
10932
- el.className = value;
10933
- }
10919
+ const TRANSITION = "transition";
10920
+ const ANIMATION = "animation";
10921
+ const vtcKey = Symbol("_vtc");
10922
+ const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
10923
+ Transition.displayName = "Transition";
10924
+ {
10925
+ Transition.__isBuiltIn = true;
10934
10926
  }
10935
-
10936
- function patchStyle(el, prev, next) {
10937
- const style = el.style;
10938
- const isCssString = isString(next);
10939
- if (next && !isCssString) {
10940
- if (prev && !isString(prev)) {
10941
- for (const key in prev) {
10942
- if (next[key] == null) {
10943
- setStyle(style, key, "");
10944
- }
10945
- }
10946
- }
10947
- for (const key in next) {
10948
- setStyle(style, key, next[key]);
10949
- }
10950
- } else {
10951
- const currentDisplay = style.display;
10952
- if (isCssString) {
10953
- if (prev !== next) {
10954
- style.cssText = next;
10955
- }
10956
- } else if (prev) {
10957
- el.removeAttribute("style");
10958
- }
10959
- if ("_vod" in el) {
10960
- style.display = currentDisplay;
10961
- }
10927
+ const DOMTransitionPropsValidators = {
10928
+ name: String,
10929
+ type: String,
10930
+ css: {
10931
+ type: Boolean,
10932
+ default: true
10933
+ },
10934
+ duration: [String, Number, Object],
10935
+ enterFromClass: String,
10936
+ enterActiveClass: String,
10937
+ enterToClass: String,
10938
+ appearFromClass: String,
10939
+ appearActiveClass: String,
10940
+ appearToClass: String,
10941
+ leaveFromClass: String,
10942
+ leaveActiveClass: String,
10943
+ leaveToClass: String
10944
+ };
10945
+ const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
10946
+ {},
10947
+ BaseTransitionPropsValidators,
10948
+ DOMTransitionPropsValidators
10949
+ );
10950
+ const callHook = (hook, args = []) => {
10951
+ if (isArray(hook)) {
10952
+ hook.forEach((h2) => h2(...args));
10953
+ } else if (hook) {
10954
+ hook(...args);
10962
10955
  }
10963
- }
10964
- const semicolonRE = /[^\\];\s*$/;
10965
- const importantRE = /\s*!important$/;
10966
- function setStyle(style, name, val) {
10967
- if (isArray(val)) {
10968
- val.forEach((v) => setStyle(style, name, v));
10969
- } else {
10970
- if (val == null)
10971
- val = "";
10972
- if (!!(process.env.NODE_ENV !== "production")) {
10973
- if (semicolonRE.test(val)) {
10974
- warn(
10975
- `Unexpected semicolon at the end of '${name}' style value: '${val}'`
10976
- );
10977
- }
10978
- }
10979
- if (name.startsWith("--")) {
10980
- style.setProperty(name, val);
10981
- } else {
10982
- const prefixed = autoPrefix(style, name);
10983
- if (importantRE.test(val)) {
10984
- style.setProperty(
10985
- hyphenate(prefixed),
10986
- val.replace(importantRE, ""),
10987
- "important"
10988
- );
10989
- } else {
10990
- style[prefixed] = val;
10991
- }
10956
+ };
10957
+ const hasExplicitCallback = (hook) => {
10958
+ return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
10959
+ };
10960
+ function resolveTransitionProps(rawProps) {
10961
+ const baseProps = {};
10962
+ for (const key in rawProps) {
10963
+ if (!(key in DOMTransitionPropsValidators)) {
10964
+ baseProps[key] = rawProps[key];
10992
10965
  }
10993
10966
  }
10994
- }
10995
- const prefixes = ["Webkit", "Moz", "ms"];
10996
- const prefixCache = {};
10997
- function autoPrefix(style, rawName) {
10998
- const cached = prefixCache[rawName];
10999
- if (cached) {
11000
- return cached;
11001
- }
11002
- let name = camelize(rawName);
11003
- if (name !== "filter" && name in style) {
11004
- return prefixCache[rawName] = name;
11005
- }
11006
- name = capitalize(name);
11007
- for (let i = 0; i < prefixes.length; i++) {
11008
- const prefixed = prefixes[i] + name;
11009
- if (prefixed in style) {
11010
- return prefixCache[rawName] = prefixed;
11011
- }
10967
+ if (rawProps.css === false) {
10968
+ return baseProps;
11012
10969
  }
11013
- return rawName;
11014
- }
11015
-
11016
- const xlinkNS = "http://www.w3.org/1999/xlink";
11017
- function patchAttr(el, key, value, isSVG, instance) {
11018
- if (isSVG && key.startsWith("xlink:")) {
11019
- if (value == null) {
11020
- el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
11021
- } else {
11022
- el.setAttributeNS(xlinkNS, key, value);
10970
+ const {
10971
+ name = "v",
10972
+ type,
10973
+ duration,
10974
+ enterFromClass = `${name}-enter-from`,
10975
+ enterActiveClass = `${name}-enter-active`,
10976
+ enterToClass = `${name}-enter-to`,
10977
+ appearFromClass = enterFromClass,
10978
+ appearActiveClass = enterActiveClass,
10979
+ appearToClass = enterToClass,
10980
+ leaveFromClass = `${name}-leave-from`,
10981
+ leaveActiveClass = `${name}-leave-active`,
10982
+ leaveToClass = `${name}-leave-to`
10983
+ } = rawProps;
10984
+ const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES", null);
10985
+ let legacyEnterFromClass;
10986
+ let legacyAppearFromClass;
10987
+ let legacyLeaveFromClass;
10988
+ if (legacyClassEnabled) {
10989
+ const toLegacyClass = (cls) => cls.replace(/-from$/, "");
10990
+ if (!rawProps.enterFromClass) {
10991
+ legacyEnterFromClass = toLegacyClass(enterFromClass);
11023
10992
  }
11024
- } else {
11025
- if (compatCoerceAttr(el, key, value, instance)) {
11026
- return;
10993
+ if (!rawProps.appearFromClass) {
10994
+ legacyAppearFromClass = toLegacyClass(appearFromClass);
11027
10995
  }
11028
- const isBoolean = isSpecialBooleanAttr(key);
11029
- if (value == null || isBoolean && !includeBooleanAttr(value)) {
11030
- el.removeAttribute(key);
11031
- } else {
11032
- el.setAttribute(key, isBoolean ? "" : value);
10996
+ if (!rawProps.leaveFromClass) {
10997
+ legacyLeaveFromClass = toLegacyClass(leaveFromClass);
11033
10998
  }
11034
10999
  }
11035
- }
11036
- const isEnumeratedAttr = /* @__PURE__ */ makeMap("contenteditable,draggable,spellcheck") ;
11037
- function compatCoerceAttr(el, key, value, instance = null) {
11038
- if (isEnumeratedAttr(key)) {
11039
- const v2CoercedValue = value === null ? "false" : typeof value !== "boolean" && value !== void 0 ? "true" : null;
11040
- if (v2CoercedValue && compatUtils.softAssertCompatEnabled(
11041
- "ATTR_ENUMERATED_COERCION",
11042
- instance,
11043
- key,
11044
- value,
11045
- v2CoercedValue
11046
- )) {
11047
- el.setAttribute(key, v2CoercedValue);
11048
- return true;
11049
- }
11050
- } else if (value === false && !isSpecialBooleanAttr(key) && compatUtils.softAssertCompatEnabled(
11051
- "ATTR_FALSE_VALUE",
11052
- instance,
11053
- key
11054
- )) {
11055
- el.removeAttribute(key);
11056
- return true;
11057
- }
11058
- return false;
11059
- }
11060
-
11061
- function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
11062
- if (key === "innerHTML" || key === "textContent") {
11063
- if (prevChildren) {
11064
- unmountChildren(prevChildren, parentComponent, parentSuspense);
11065
- }
11066
- el[key] = value == null ? "" : value;
11067
- return;
11068
- }
11069
- const tag = el.tagName;
11070
- if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
11071
- !tag.includes("-")) {
11072
- el._value = value;
11073
- const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
11074
- const newValue = value == null ? "" : value;
11075
- if (oldValue !== newValue) {
11076
- el.value = newValue;
11077
- }
11078
- if (value == null) {
11079
- el.removeAttribute(key);
11080
- }
11081
- return;
11082
- }
11083
- let needRemove = false;
11084
- if (value === "" || value == null) {
11085
- const type = typeof el[key];
11086
- if (type === "boolean") {
11087
- value = includeBooleanAttr(value);
11088
- } else if (value == null && type === "string") {
11089
- value = "";
11090
- needRemove = true;
11091
- } else if (type === "number") {
11092
- value = 0;
11093
- needRemove = true;
11094
- }
11095
- } else {
11096
- if (value === false && compatUtils.isCompatEnabled(
11097
- "ATTR_FALSE_VALUE",
11098
- parentComponent
11099
- )) {
11100
- const type = typeof el[key];
11101
- if (type === "string" || type === "number") {
11102
- !!(process.env.NODE_ENV !== "production") && compatUtils.warnDeprecation(
11103
- "ATTR_FALSE_VALUE",
11104
- parentComponent,
11105
- key
11106
- );
11107
- value = type === "number" ? 0 : "";
11108
- needRemove = true;
11000
+ const durations = normalizeDuration(duration);
11001
+ const enterDuration = durations && durations[0];
11002
+ const leaveDuration = durations && durations[1];
11003
+ const {
11004
+ onBeforeEnter,
11005
+ onEnter,
11006
+ onEnterCancelled,
11007
+ onLeave,
11008
+ onLeaveCancelled,
11009
+ onBeforeAppear = onBeforeEnter,
11010
+ onAppear = onEnter,
11011
+ onAppearCancelled = onEnterCancelled
11012
+ } = baseProps;
11013
+ const finishEnter = (el, isAppear, done) => {
11014
+ removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
11015
+ removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
11016
+ done && done();
11017
+ };
11018
+ const finishLeave = (el, done) => {
11019
+ el._isLeaving = false;
11020
+ removeTransitionClass(el, leaveFromClass);
11021
+ removeTransitionClass(el, leaveToClass);
11022
+ removeTransitionClass(el, leaveActiveClass);
11023
+ done && done();
11024
+ };
11025
+ const makeEnterHook = (isAppear) => {
11026
+ return (el, done) => {
11027
+ const hook = isAppear ? onAppear : onEnter;
11028
+ const resolve = () => finishEnter(el, isAppear, done);
11029
+ callHook(hook, [el, resolve]);
11030
+ nextFrame(() => {
11031
+ removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
11032
+ if (legacyClassEnabled) {
11033
+ const legacyClass = isAppear ? legacyAppearFromClass : legacyEnterFromClass;
11034
+ if (legacyClass) {
11035
+ removeTransitionClass(el, legacyClass);
11036
+ }
11037
+ }
11038
+ addTransitionClass(el, isAppear ? appearToClass : enterToClass);
11039
+ if (!hasExplicitCallback(hook)) {
11040
+ whenTransitionEnds(el, type, enterDuration, resolve);
11041
+ }
11042
+ });
11043
+ };
11044
+ };
11045
+ return extend(baseProps, {
11046
+ onBeforeEnter(el) {
11047
+ callHook(onBeforeEnter, [el]);
11048
+ addTransitionClass(el, enterFromClass);
11049
+ if (legacyClassEnabled && legacyEnterFromClass) {
11050
+ addTransitionClass(el, legacyEnterFromClass);
11109
11051
  }
11052
+ addTransitionClass(el, enterActiveClass);
11053
+ },
11054
+ onBeforeAppear(el) {
11055
+ callHook(onBeforeAppear, [el]);
11056
+ addTransitionClass(el, appearFromClass);
11057
+ if (legacyClassEnabled && legacyAppearFromClass) {
11058
+ addTransitionClass(el, legacyAppearFromClass);
11059
+ }
11060
+ addTransitionClass(el, appearActiveClass);
11061
+ },
11062
+ onEnter: makeEnterHook(false),
11063
+ onAppear: makeEnterHook(true),
11064
+ onLeave(el, done) {
11065
+ el._isLeaving = true;
11066
+ const resolve = () => finishLeave(el, done);
11067
+ addTransitionClass(el, leaveFromClass);
11068
+ if (legacyClassEnabled && legacyLeaveFromClass) {
11069
+ addTransitionClass(el, legacyLeaveFromClass);
11070
+ }
11071
+ forceReflow();
11072
+ addTransitionClass(el, leaveActiveClass);
11073
+ nextFrame(() => {
11074
+ if (!el._isLeaving) {
11075
+ return;
11076
+ }
11077
+ removeTransitionClass(el, leaveFromClass);
11078
+ if (legacyClassEnabled && legacyLeaveFromClass) {
11079
+ removeTransitionClass(el, legacyLeaveFromClass);
11080
+ }
11081
+ addTransitionClass(el, leaveToClass);
11082
+ if (!hasExplicitCallback(onLeave)) {
11083
+ whenTransitionEnds(el, type, leaveDuration, resolve);
11084
+ }
11085
+ });
11086
+ callHook(onLeave, [el, resolve]);
11087
+ },
11088
+ onEnterCancelled(el) {
11089
+ finishEnter(el, false);
11090
+ callHook(onEnterCancelled, [el]);
11091
+ },
11092
+ onAppearCancelled(el) {
11093
+ finishEnter(el, true);
11094
+ callHook(onAppearCancelled, [el]);
11095
+ },
11096
+ onLeaveCancelled(el) {
11097
+ finishLeave(el);
11098
+ callHook(onLeaveCancelled, [el]);
11110
11099
  }
11100
+ });
11101
+ }
11102
+ function normalizeDuration(duration) {
11103
+ if (duration == null) {
11104
+ return null;
11105
+ } else if (isObject(duration)) {
11106
+ return [NumberOf(duration.enter), NumberOf(duration.leave)];
11107
+ } else {
11108
+ const n = NumberOf(duration);
11109
+ return [n, n];
11111
11110
  }
11112
- try {
11113
- el[key] = value;
11114
- } catch (e) {
11115
- if (!!(process.env.NODE_ENV !== "production") && !needRemove) {
11116
- warn(
11117
- `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
11118
- e
11119
- );
11120
- }
11121
- }
11122
- needRemove && el.removeAttribute(key);
11123
11111
  }
11124
-
11125
- function addEventListener(el, event, handler, options) {
11126
- el.addEventListener(event, handler, options);
11112
+ function NumberOf(val) {
11113
+ const res = toNumber(val);
11114
+ if (!!(process.env.NODE_ENV !== "production")) {
11115
+ assertNumber(res, "<transition> explicit duration");
11116
+ }
11117
+ return res;
11127
11118
  }
11128
- function removeEventListener(el, event, handler, options) {
11129
- el.removeEventListener(event, handler, options);
11119
+ function addTransitionClass(el, cls) {
11120
+ cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
11121
+ (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
11130
11122
  }
11131
- function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
11132
- const invokers = el._vei || (el._vei = {});
11133
- const existingInvoker = invokers[rawName];
11134
- if (nextValue && existingInvoker) {
11135
- existingInvoker.value = nextValue;
11136
- } else {
11137
- const [name, options] = parseName(rawName);
11138
- if (nextValue) {
11139
- const invoker = invokers[rawName] = createInvoker(nextValue, instance);
11140
- addEventListener(el, name, invoker, options);
11141
- } else if (existingInvoker) {
11142
- removeEventListener(el, name, existingInvoker, options);
11143
- invokers[rawName] = void 0;
11123
+ function removeTransitionClass(el, cls) {
11124
+ cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
11125
+ const _vtc = el[vtcKey];
11126
+ if (_vtc) {
11127
+ _vtc.delete(cls);
11128
+ if (!_vtc.size) {
11129
+ el[vtcKey] = void 0;
11144
11130
  }
11145
11131
  }
11146
11132
  }
11147
- const optionsModifierRE = /(?:Once|Passive|Capture)$/;
11148
- function parseName(name) {
11149
- let options;
11150
- if (optionsModifierRE.test(name)) {
11151
- options = {};
11152
- let m;
11153
- while (m = name.match(optionsModifierRE)) {
11154
- name = name.slice(0, name.length - m[0].length);
11155
- options[m[0].toLowerCase()] = true;
11133
+ function nextFrame(cb) {
11134
+ requestAnimationFrame(() => {
11135
+ requestAnimationFrame(cb);
11136
+ });
11137
+ }
11138
+ let endId = 0;
11139
+ function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
11140
+ const id = el._endId = ++endId;
11141
+ const resolveIfNotStale = () => {
11142
+ if (id === el._endId) {
11143
+ resolve();
11156
11144
  }
11145
+ };
11146
+ if (explicitTimeout) {
11147
+ return setTimeout(resolveIfNotStale, explicitTimeout);
11157
11148
  }
11158
- const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
11159
- return [event, options];
11149
+ const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
11150
+ if (!type) {
11151
+ return resolve();
11152
+ }
11153
+ const endEvent = type + "end";
11154
+ let ended = 0;
11155
+ const end = () => {
11156
+ el.removeEventListener(endEvent, onEnd);
11157
+ resolveIfNotStale();
11158
+ };
11159
+ const onEnd = (e) => {
11160
+ if (e.target === el && ++ended >= propCount) {
11161
+ end();
11162
+ }
11163
+ };
11164
+ setTimeout(() => {
11165
+ if (ended < propCount) {
11166
+ end();
11167
+ }
11168
+ }, timeout + 1);
11169
+ el.addEventListener(endEvent, onEnd);
11160
11170
  }
11161
- let cachedNow = 0;
11162
- const p = /* @__PURE__ */ Promise.resolve();
11163
- const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
11164
- function createInvoker(initialValue, instance) {
11165
- const invoker = (e) => {
11166
- if (!e._vts) {
11167
- e._vts = Date.now();
11168
- } else if (e._vts <= invoker.attached) {
11169
- return;
11171
+ function getTransitionInfo(el, expectedType) {
11172
+ const styles = window.getComputedStyle(el);
11173
+ const getStyleProperties = (key) => (styles[key] || "").split(", ");
11174
+ const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
11175
+ const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
11176
+ const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
11177
+ const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
11178
+ const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
11179
+ const animationTimeout = getTimeout(animationDelays, animationDurations);
11180
+ let type = null;
11181
+ let timeout = 0;
11182
+ let propCount = 0;
11183
+ if (expectedType === TRANSITION) {
11184
+ if (transitionTimeout > 0) {
11185
+ type = TRANSITION;
11186
+ timeout = transitionTimeout;
11187
+ propCount = transitionDurations.length;
11170
11188
  }
11171
- callWithAsyncErrorHandling(
11172
- patchStopImmediatePropagation(e, invoker.value),
11173
- instance,
11174
- 5,
11175
- [e]
11176
- );
11189
+ } else if (expectedType === ANIMATION) {
11190
+ if (animationTimeout > 0) {
11191
+ type = ANIMATION;
11192
+ timeout = animationTimeout;
11193
+ propCount = animationDurations.length;
11194
+ }
11195
+ } else {
11196
+ timeout = Math.max(transitionTimeout, animationTimeout);
11197
+ type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
11198
+ propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
11199
+ }
11200
+ const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
11201
+ getStyleProperties(`${TRANSITION}Property`).toString()
11202
+ );
11203
+ return {
11204
+ type,
11205
+ timeout,
11206
+ propCount,
11207
+ hasTransform
11177
11208
  };
11178
- invoker.value = initialValue;
11179
- invoker.attached = getNow();
11180
- return invoker;
11181
11209
  }
11182
- function patchStopImmediatePropagation(e, value) {
11183
- if (isArray(value)) {
11184
- const originalStop = e.stopImmediatePropagation;
11185
- e.stopImmediatePropagation = () => {
11186
- originalStop.call(e);
11187
- e._stopped = true;
11188
- };
11189
- return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
11210
+ function getTimeout(delays, durations) {
11211
+ while (delays.length < durations.length) {
11212
+ delays = delays.concat(delays);
11213
+ }
11214
+ return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
11215
+ }
11216
+ function toMs(s) {
11217
+ if (s === "auto")
11218
+ return 0;
11219
+ return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
11220
+ }
11221
+ function forceReflow() {
11222
+ return document.body.offsetHeight;
11223
+ }
11224
+
11225
+ function patchClass(el, value, isSVG) {
11226
+ const transitionClasses = el[vtcKey];
11227
+ if (transitionClasses) {
11228
+ value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
11229
+ }
11230
+ if (value == null) {
11231
+ el.removeAttribute("class");
11232
+ } else if (isSVG) {
11233
+ el.setAttribute("class", value);
11190
11234
  } else {
11191
- return value;
11235
+ el.className = value;
11192
11236
  }
11193
11237
  }
11194
11238
 
11195
- const nativeOnRE = /^on[a-z]/;
11196
- const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11197
- if (key === "class") {
11198
- patchClass(el, nextValue, isSVG);
11199
- } else if (key === "style") {
11200
- patchStyle(el, prevValue, nextValue);
11201
- } else if (isOn(key)) {
11202
- if (!isModelListener(key)) {
11203
- patchEvent(el, key, prevValue, nextValue, parentComponent);
11239
+ const vShowOldKey = Symbol("_vod");
11240
+ const vShow = {
11241
+ beforeMount(el, { value }, { transition }) {
11242
+ el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display;
11243
+ if (transition && value) {
11244
+ transition.beforeEnter(el);
11245
+ } else {
11246
+ setDisplay(el, value);
11204
11247
  }
11205
- } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
11206
- patchDOMProp(
11207
- el,
11208
- key,
11209
- nextValue,
11210
- prevChildren,
11211
- parentComponent,
11212
- parentSuspense,
11213
- unmountChildren
11214
- );
11215
- } else {
11216
- if (key === "true-value") {
11217
- el._trueValue = nextValue;
11218
- } else if (key === "false-value") {
11219
- el._falseValue = nextValue;
11248
+ },
11249
+ mounted(el, { value }, { transition }) {
11250
+ if (transition && value) {
11251
+ transition.enter(el);
11220
11252
  }
11221
- patchAttr(el, key, nextValue, isSVG, parentComponent);
11253
+ },
11254
+ updated(el, { value, oldValue }, { transition }) {
11255
+ if (!value === !oldValue)
11256
+ return;
11257
+ if (transition) {
11258
+ if (value) {
11259
+ transition.beforeEnter(el);
11260
+ setDisplay(el, true);
11261
+ transition.enter(el);
11262
+ } else {
11263
+ transition.leave(el, () => {
11264
+ setDisplay(el, false);
11265
+ });
11266
+ }
11267
+ } else {
11268
+ setDisplay(el, value);
11269
+ }
11270
+ },
11271
+ beforeUnmount(el, { value }) {
11272
+ setDisplay(el, value);
11222
11273
  }
11223
11274
  };
11224
- function shouldSetAsProp(el, key, value, isSVG) {
11225
- if (isSVG) {
11226
- if (key === "innerHTML" || key === "textContent") {
11227
- return true;
11228
- }
11229
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
11230
- return true;
11275
+ function setDisplay(el, value) {
11276
+ el.style.display = value ? el[vShowOldKey] : "none";
11277
+ }
11278
+ function initVShowForSSR() {
11279
+ vShow.getSSRProps = ({ value }) => {
11280
+ if (!value) {
11281
+ return { style: { display: "none" } };
11231
11282
  }
11232
- return false;
11233
- }
11234
- if (key === "spellcheck" || key === "draggable" || key === "translate") {
11235
- return false;
11236
- }
11237
- if (key === "form") {
11238
- return false;
11239
- }
11240
- if (key === "list" && el.tagName === "INPUT") {
11241
- return false;
11242
- }
11243
- if (key === "type" && el.tagName === "TEXTAREA") {
11244
- return false;
11245
- }
11246
- if (nativeOnRE.test(key) && isString(value)) {
11247
- return false;
11248
- }
11249
- return key in el;
11283
+ };
11250
11284
  }
11251
11285
 
11252
- function defineCustomElement(options, hydrate2) {
11253
- const Comp = defineComponent(options);
11254
- class VueCustomElement extends VueElement {
11255
- constructor(initialProps) {
11256
- super(Comp, initialProps, hydrate2);
11286
+ function patchStyle(el, prev, next) {
11287
+ const style = el.style;
11288
+ const isCssString = isString(next);
11289
+ if (next && !isCssString) {
11290
+ if (prev && !isString(prev)) {
11291
+ for (const key in prev) {
11292
+ if (next[key] == null) {
11293
+ setStyle(style, key, "");
11294
+ }
11295
+ }
11296
+ }
11297
+ for (const key in next) {
11298
+ setStyle(style, key, next[key]);
11299
+ }
11300
+ } else {
11301
+ const currentDisplay = style.display;
11302
+ if (isCssString) {
11303
+ if (prev !== next) {
11304
+ style.cssText = next;
11305
+ }
11306
+ } else if (prev) {
11307
+ el.removeAttribute("style");
11308
+ }
11309
+ if (vShowOldKey in el) {
11310
+ style.display = currentDisplay;
11257
11311
  }
11258
11312
  }
11259
- VueCustomElement.def = Comp;
11260
- return VueCustomElement;
11261
11313
  }
11262
- const defineSSRCustomElement = (options) => {
11263
- return defineCustomElement(options, hydrate);
11264
- };
11265
- const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
11266
- };
11267
- class VueElement extends BaseClass {
11268
- constructor(_def, _props = {}, hydrate2) {
11269
- super();
11270
- this._def = _def;
11271
- this._props = _props;
11272
- /**
11273
- * @internal
11274
- */
11275
- this._instance = null;
11276
- this._connected = false;
11277
- this._resolved = false;
11278
- this._numberProps = null;
11279
- if (this.shadowRoot && hydrate2) {
11280
- hydrate2(this._createVNode(), this.shadowRoot);
11281
- } else {
11282
- if (!!(process.env.NODE_ENV !== "production") && this.shadowRoot) {
11314
+ const semicolonRE = /[^\\];\s*$/;
11315
+ const importantRE = /\s*!important$/;
11316
+ function setStyle(style, name, val) {
11317
+ if (isArray(val)) {
11318
+ val.forEach((v) => setStyle(style, name, v));
11319
+ } else {
11320
+ if (val == null)
11321
+ val = "";
11322
+ if (!!(process.env.NODE_ENV !== "production")) {
11323
+ if (semicolonRE.test(val)) {
11283
11324
  warn(
11284
- `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
11325
+ `Unexpected semicolon at the end of '${name}' style value: '${val}'`
11285
11326
  );
11286
11327
  }
11287
- this.attachShadow({ mode: "open" });
11288
- if (!this._def.__asyncLoader) {
11289
- this._resolveProps(this._def);
11290
- }
11291
11328
  }
11292
- }
11293
- connectedCallback() {
11294
- this._connected = true;
11295
- if (!this._instance) {
11296
- if (this._resolved) {
11297
- this._update();
11329
+ if (name.startsWith("--")) {
11330
+ style.setProperty(name, val);
11331
+ } else {
11332
+ const prefixed = autoPrefix(style, name);
11333
+ if (importantRE.test(val)) {
11334
+ style.setProperty(
11335
+ hyphenate(prefixed),
11336
+ val.replace(importantRE, ""),
11337
+ "important"
11338
+ );
11298
11339
  } else {
11299
- this._resolveDef();
11340
+ style[prefixed] = val;
11300
11341
  }
11301
11342
  }
11302
11343
  }
11303
- disconnectedCallback() {
11304
- this._connected = false;
11305
- nextTick(() => {
11306
- if (!this._connected) {
11307
- render(null, this.shadowRoot);
11308
- this._instance = null;
11309
- }
11310
- });
11344
+ }
11345
+ const prefixes = ["Webkit", "Moz", "ms"];
11346
+ const prefixCache = {};
11347
+ function autoPrefix(style, rawName) {
11348
+ const cached = prefixCache[rawName];
11349
+ if (cached) {
11350
+ return cached;
11311
11351
  }
11312
- /**
11313
- * resolve inner component definition (handle possible async component)
11314
- */
11315
- _resolveDef() {
11316
- this._resolved = true;
11317
- for (let i = 0; i < this.attributes.length; i++) {
11318
- this._setAttr(this.attributes[i].name);
11352
+ let name = camelize(rawName);
11353
+ if (name !== "filter" && name in style) {
11354
+ return prefixCache[rawName] = name;
11355
+ }
11356
+ name = capitalize(name);
11357
+ for (let i = 0; i < prefixes.length; i++) {
11358
+ const prefixed = prefixes[i] + name;
11359
+ if (prefixed in style) {
11360
+ return prefixCache[rawName] = prefixed;
11319
11361
  }
11320
- new MutationObserver((mutations) => {
11321
- for (const m of mutations) {
11322
- this._setAttr(m.attributeName);
11323
- }
11324
- }).observe(this, { attributes: true });
11325
- const resolve = (def, isAsync = false) => {
11326
- const { props, styles } = def;
11327
- let numberProps;
11328
- if (props && !isArray(props)) {
11329
- for (const key in props) {
11330
- const opt = props[key];
11331
- if (opt === Number || opt && opt.type === Number) {
11332
- if (key in this._props) {
11333
- this._props[key] = toNumber(this._props[key]);
11334
- }
11335
- (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
11336
- }
11337
- }
11338
- }
11339
- this._numberProps = numberProps;
11340
- if (isAsync) {
11341
- this._resolveProps(def);
11342
- }
11343
- this._applyStyles(styles);
11344
- this._update();
11345
- };
11346
- const asyncDef = this._def.__asyncLoader;
11347
- if (asyncDef) {
11348
- asyncDef().then((def) => resolve(def, true));
11362
+ }
11363
+ return rawName;
11364
+ }
11365
+
11366
+ const xlinkNS = "http://www.w3.org/1999/xlink";
11367
+ function patchAttr(el, key, value, isSVG, instance) {
11368
+ if (isSVG && key.startsWith("xlink:")) {
11369
+ if (value == null) {
11370
+ el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
11349
11371
  } else {
11350
- resolve(this._def);
11372
+ el.setAttributeNS(xlinkNS, key, value);
11351
11373
  }
11352
- }
11353
- _resolveProps(def) {
11354
- const { props } = def;
11355
- const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
11356
- for (const key of Object.keys(this)) {
11357
- if (key[0] !== "_" && declaredPropKeys.includes(key)) {
11358
- this._setProp(key, this[key], true, false);
11359
- }
11374
+ } else {
11375
+ if (compatCoerceAttr(el, key, value, instance)) {
11376
+ return;
11360
11377
  }
11361
- for (const key of declaredPropKeys.map(camelize)) {
11362
- Object.defineProperty(this, key, {
11363
- get() {
11364
- return this._getProp(key);
11365
- },
11366
- set(val) {
11367
- this._setProp(key, val);
11368
- }
11369
- });
11378
+ const isBoolean = isSpecialBooleanAttr(key);
11379
+ if (value == null || isBoolean && !includeBooleanAttr(value)) {
11380
+ el.removeAttribute(key);
11381
+ } else {
11382
+ el.setAttribute(key, isBoolean ? "" : value);
11370
11383
  }
11371
11384
  }
11372
- _setAttr(key) {
11373
- let value = this.getAttribute(key);
11374
- const camelKey = camelize(key);
11375
- if (this._numberProps && this._numberProps[camelKey]) {
11376
- value = toNumber(value);
11385
+ }
11386
+ const isEnumeratedAttr = /* @__PURE__ */ makeMap("contenteditable,draggable,spellcheck") ;
11387
+ function compatCoerceAttr(el, key, value, instance = null) {
11388
+ if (isEnumeratedAttr(key)) {
11389
+ const v2CoercedValue = value === null ? "false" : typeof value !== "boolean" && value !== void 0 ? "true" : null;
11390
+ if (v2CoercedValue && compatUtils.softAssertCompatEnabled(
11391
+ "ATTR_ENUMERATED_COERCION",
11392
+ instance,
11393
+ key,
11394
+ value,
11395
+ v2CoercedValue
11396
+ )) {
11397
+ el.setAttribute(key, v2CoercedValue);
11398
+ return true;
11377
11399
  }
11378
- this._setProp(camelKey, value, false);
11379
- }
11380
- /**
11381
- * @internal
11382
- */
11383
- _getProp(key) {
11384
- return this._props[key];
11400
+ } else if (value === false && !isSpecialBooleanAttr(key) && compatUtils.softAssertCompatEnabled(
11401
+ "ATTR_FALSE_VALUE",
11402
+ instance,
11403
+ key
11404
+ )) {
11405
+ el.removeAttribute(key);
11406
+ return true;
11385
11407
  }
11386
- /**
11387
- * @internal
11388
- */
11389
- _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
11390
- if (val !== this._props[key]) {
11391
- this._props[key] = val;
11392
- if (shouldUpdate && this._instance) {
11393
- this._update();
11394
- }
11395
- if (shouldReflect) {
11396
- if (val === true) {
11397
- this.setAttribute(hyphenate(key), "");
11398
- } else if (typeof val === "string" || typeof val === "number") {
11399
- this.setAttribute(hyphenate(key), val + "");
11400
- } else if (!val) {
11401
- this.removeAttribute(hyphenate(key));
11402
- }
11403
- }
11408
+ return false;
11409
+ }
11410
+
11411
+ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
11412
+ if (key === "innerHTML" || key === "textContent") {
11413
+ if (prevChildren) {
11414
+ unmountChildren(prevChildren, parentComponent, parentSuspense);
11404
11415
  }
11416
+ el[key] = value == null ? "" : value;
11417
+ return;
11405
11418
  }
11406
- _update() {
11407
- render(this._createVNode(), this.shadowRoot);
11419
+ const tag = el.tagName;
11420
+ if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
11421
+ !tag.includes("-")) {
11422
+ el._value = value;
11423
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
11424
+ const newValue = value == null ? "" : value;
11425
+ if (oldValue !== newValue) {
11426
+ el.value = newValue;
11427
+ }
11428
+ if (value == null) {
11429
+ el.removeAttribute(key);
11430
+ }
11431
+ return;
11408
11432
  }
11409
- _createVNode() {
11410
- const vnode = createVNode(this._def, extend({}, this._props));
11411
- if (!this._instance) {
11412
- vnode.ce = (instance) => {
11413
- this._instance = instance;
11414
- instance.isCE = true;
11415
- if (!!(process.env.NODE_ENV !== "production")) {
11416
- instance.ceReload = (newStyles) => {
11417
- if (this._styles) {
11418
- this._styles.forEach((s) => this.shadowRoot.removeChild(s));
11419
- this._styles.length = 0;
11420
- }
11421
- this._applyStyles(newStyles);
11422
- this._instance = null;
11423
- this._update();
11424
- };
11425
- }
11426
- const dispatch = (event, args) => {
11427
- this.dispatchEvent(
11428
- new CustomEvent(event, {
11429
- detail: args
11430
- })
11431
- );
11432
- };
11433
- instance.emit = (event, ...args) => {
11434
- dispatch(event, args);
11435
- if (hyphenate(event) !== event) {
11436
- dispatch(hyphenate(event), args);
11437
- }
11438
- };
11439
- let parent = this;
11440
- while (parent = parent && (parent.parentNode || parent.host)) {
11441
- if (parent instanceof VueElement) {
11442
- instance.parent = parent._instance;
11443
- instance.provides = parent._instance.provides;
11444
- break;
11445
- }
11446
- }
11447
- };
11433
+ let needRemove = false;
11434
+ if (value === "" || value == null) {
11435
+ const type = typeof el[key];
11436
+ if (type === "boolean") {
11437
+ value = includeBooleanAttr(value);
11438
+ } else if (value == null && type === "string") {
11439
+ value = "";
11440
+ needRemove = true;
11441
+ } else if (type === "number") {
11442
+ value = 0;
11443
+ needRemove = true;
11444
+ }
11445
+ } else {
11446
+ if (value === false && compatUtils.isCompatEnabled(
11447
+ "ATTR_FALSE_VALUE",
11448
+ parentComponent
11449
+ )) {
11450
+ const type = typeof el[key];
11451
+ if (type === "string" || type === "number") {
11452
+ !!(process.env.NODE_ENV !== "production") && compatUtils.warnDeprecation(
11453
+ "ATTR_FALSE_VALUE",
11454
+ parentComponent,
11455
+ key
11456
+ );
11457
+ value = type === "number" ? 0 : "";
11458
+ needRemove = true;
11459
+ }
11448
11460
  }
11449
- return vnode;
11450
11461
  }
11451
- _applyStyles(styles) {
11452
- if (styles) {
11453
- styles.forEach((css) => {
11454
- const s = document.createElement("style");
11455
- s.textContent = css;
11456
- this.shadowRoot.appendChild(s);
11457
- if (!!(process.env.NODE_ENV !== "production")) {
11458
- (this._styles || (this._styles = [])).push(s);
11459
- }
11460
- });
11462
+ try {
11463
+ el[key] = value;
11464
+ } catch (e) {
11465
+ if (!!(process.env.NODE_ENV !== "production") && !needRemove) {
11466
+ warn(
11467
+ `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
11468
+ e
11469
+ );
11461
11470
  }
11462
11471
  }
11472
+ needRemove && el.removeAttribute(key);
11463
11473
  }
11464
11474
 
11465
- function useCssModule(name = "$style") {
11466
- {
11467
- const instance = getCurrentInstance();
11468
- if (!instance) {
11469
- !!(process.env.NODE_ENV !== "production") && warn(`useCssModule must be called inside setup()`);
11470
- return EMPTY_OBJ;
11475
+ function addEventListener(el, event, handler, options) {
11476
+ el.addEventListener(event, handler, options);
11477
+ }
11478
+ function removeEventListener(el, event, handler, options) {
11479
+ el.removeEventListener(event, handler, options);
11480
+ }
11481
+ const veiKey = Symbol("_vei");
11482
+ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
11483
+ const invokers = el[veiKey] || (el[veiKey] = {});
11484
+ const existingInvoker = invokers[rawName];
11485
+ if (nextValue && existingInvoker) {
11486
+ existingInvoker.value = nextValue;
11487
+ } else {
11488
+ const [name, options] = parseName(rawName);
11489
+ if (nextValue) {
11490
+ const invoker = invokers[rawName] = createInvoker(nextValue, instance);
11491
+ addEventListener(el, name, invoker, options);
11492
+ } else if (existingInvoker) {
11493
+ removeEventListener(el, name, existingInvoker, options);
11494
+ invokers[rawName] = void 0;
11471
11495
  }
11472
- const modules = instance.type.__cssModules;
11473
- if (!modules) {
11474
- !!(process.env.NODE_ENV !== "production") && warn(`Current instance does not have CSS modules injected.`);
11475
- return EMPTY_OBJ;
11496
+ }
11497
+ }
11498
+ const optionsModifierRE = /(?:Once|Passive|Capture)$/;
11499
+ function parseName(name) {
11500
+ let options;
11501
+ if (optionsModifierRE.test(name)) {
11502
+ options = {};
11503
+ let m;
11504
+ while (m = name.match(optionsModifierRE)) {
11505
+ name = name.slice(0, name.length - m[0].length);
11506
+ options[m[0].toLowerCase()] = true;
11476
11507
  }
11477
- const mod = modules[name];
11478
- if (!mod) {
11479
- !!(process.env.NODE_ENV !== "production") && warn(`Current instance does not have CSS module named "${name}".`);
11480
- return EMPTY_OBJ;
11508
+ }
11509
+ const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
11510
+ return [event, options];
11511
+ }
11512
+ let cachedNow = 0;
11513
+ const p = /* @__PURE__ */ Promise.resolve();
11514
+ const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
11515
+ function createInvoker(initialValue, instance) {
11516
+ const invoker = (e) => {
11517
+ if (!e._vts) {
11518
+ e._vts = Date.now();
11519
+ } else if (e._vts <= invoker.attached) {
11520
+ return;
11481
11521
  }
11482
- return mod;
11522
+ callWithAsyncErrorHandling(
11523
+ patchStopImmediatePropagation(e, invoker.value),
11524
+ instance,
11525
+ 5,
11526
+ [e]
11527
+ );
11528
+ };
11529
+ invoker.value = initialValue;
11530
+ invoker.attached = getNow();
11531
+ return invoker;
11532
+ }
11533
+ function patchStopImmediatePropagation(e, value) {
11534
+ if (isArray(value)) {
11535
+ const originalStop = e.stopImmediatePropagation;
11536
+ e.stopImmediatePropagation = () => {
11537
+ originalStop.call(e);
11538
+ e._stopped = true;
11539
+ };
11540
+ return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
11541
+ } else {
11542
+ return value;
11483
11543
  }
11484
11544
  }
11485
11545
 
11486
- function useCssVars(getter) {
11487
- const instance = getCurrentInstance();
11488
- if (!instance) {
11489
- !!(process.env.NODE_ENV !== "production") && warn(`useCssVars is called without current active component instance.`);
11490
- return;
11546
+ const nativeOnRE = /^on[a-z]/;
11547
+ const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11548
+ if (key === "class") {
11549
+ patchClass(el, nextValue, isSVG);
11550
+ } else if (key === "style") {
11551
+ patchStyle(el, prevValue, nextValue);
11552
+ } else if (isOn(key)) {
11553
+ if (!isModelListener(key)) {
11554
+ patchEvent(el, key, prevValue, nextValue, parentComponent);
11555
+ }
11556
+ } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
11557
+ patchDOMProp(
11558
+ el,
11559
+ key,
11560
+ nextValue,
11561
+ prevChildren,
11562
+ parentComponent,
11563
+ parentSuspense,
11564
+ unmountChildren
11565
+ );
11566
+ } else {
11567
+ if (key === "true-value") {
11568
+ el._trueValue = nextValue;
11569
+ } else if (key === "false-value") {
11570
+ el._falseValue = nextValue;
11571
+ }
11572
+ patchAttr(el, key, nextValue, isSVG, parentComponent);
11491
11573
  }
11492
- const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
11493
- Array.from(
11494
- document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
11495
- ).forEach((node) => setVarsOnNode(node, vars));
11496
- };
11497
- const setVars = () => {
11498
- const vars = getter(instance.proxy);
11499
- setVarsOnVNode(instance.subTree, vars);
11500
- updateTeleports(vars);
11501
- };
11502
- watchPostEffect(setVars);
11503
- onMounted(() => {
11504
- const ob = new MutationObserver(setVars);
11505
- ob.observe(instance.subTree.el.parentNode, { childList: true });
11506
- onUnmounted(() => ob.disconnect());
11507
- });
11508
- }
11509
- function setVarsOnVNode(vnode, vars) {
11510
- if (vnode.shapeFlag & 128) {
11511
- const suspense = vnode.suspense;
11512
- vnode = suspense.activeBranch;
11513
- if (suspense.pendingBranch && !suspense.isHydrating) {
11514
- suspense.effects.push(() => {
11515
- setVarsOnVNode(suspense.activeBranch, vars);
11516
- });
11574
+ };
11575
+ function shouldSetAsProp(el, key, value, isSVG) {
11576
+ if (isSVG) {
11577
+ if (key === "innerHTML" || key === "textContent") {
11578
+ return true;
11517
11579
  }
11580
+ if (key in el && nativeOnRE.test(key) && isFunction(value)) {
11581
+ return true;
11582
+ }
11583
+ return false;
11518
11584
  }
11519
- while (vnode.component) {
11520
- vnode = vnode.component.subTree;
11585
+ if (key === "spellcheck" || key === "draggable" || key === "translate") {
11586
+ return false;
11521
11587
  }
11522
- if (vnode.shapeFlag & 1 && vnode.el) {
11523
- setVarsOnNode(vnode.el, vars);
11524
- } else if (vnode.type === Fragment) {
11525
- vnode.children.forEach((c) => setVarsOnVNode(c, vars));
11526
- } else if (vnode.type === Static) {
11527
- let { el, anchor } = vnode;
11528
- while (el) {
11529
- setVarsOnNode(el, vars);
11530
- if (el === anchor)
11531
- break;
11532
- el = el.nextSibling;
11533
- }
11588
+ if (key === "form") {
11589
+ return false;
11534
11590
  }
11535
- }
11536
- function setVarsOnNode(el, vars) {
11537
- if (el.nodeType === 1) {
11538
- const style = el.style;
11539
- for (const key in vars) {
11540
- style.setProperty(`--${key}`, vars[key]);
11541
- }
11591
+ if (key === "list" && el.tagName === "INPUT") {
11592
+ return false;
11593
+ }
11594
+ if (key === "type" && el.tagName === "TEXTAREA") {
11595
+ return false;
11596
+ }
11597
+ if (nativeOnRE.test(key) && isString(value)) {
11598
+ return false;
11542
11599
  }
11600
+ return key in el;
11543
11601
  }
11544
11602
 
11545
- const TRANSITION = "transition";
11546
- const ANIMATION = "animation";
11547
- const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
11548
- Transition.displayName = "Transition";
11549
- {
11550
- Transition.__isBuiltIn = true;
11551
- }
11552
- const DOMTransitionPropsValidators = {
11553
- name: String,
11554
- type: String,
11555
- css: {
11556
- type: Boolean,
11557
- default: true
11558
- },
11559
- duration: [String, Number, Object],
11560
- enterFromClass: String,
11561
- enterActiveClass: String,
11562
- enterToClass: String,
11563
- appearFromClass: String,
11564
- appearActiveClass: String,
11565
- appearToClass: String,
11566
- leaveFromClass: String,
11567
- leaveActiveClass: String,
11568
- leaveToClass: String
11569
- };
11570
- const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
11571
- {},
11572
- BaseTransitionPropsValidators,
11573
- DOMTransitionPropsValidators
11574
- );
11575
- const callHook = (hook, args = []) => {
11576
- if (isArray(hook)) {
11577
- hook.forEach((h2) => h2(...args));
11578
- } else if (hook) {
11579
- hook(...args);
11603
+ /*! #__NO_SIDE_EFFECTS__ */
11604
+ // @__NO_SIDE_EFFECTS__
11605
+ function defineCustomElement(options, hydrate2) {
11606
+ const Comp = defineComponent(options);
11607
+ class VueCustomElement extends VueElement {
11608
+ constructor(initialProps) {
11609
+ super(Comp, initialProps, hydrate2);
11610
+ }
11580
11611
  }
11612
+ VueCustomElement.def = Comp;
11613
+ return VueCustomElement;
11614
+ }
11615
+ /*! #__NO_SIDE_EFFECTS__ */
11616
+ const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options) => {
11617
+ return /* @__PURE__ */ defineCustomElement(options, hydrate);
11581
11618
  };
11582
- const hasExplicitCallback = (hook) => {
11583
- return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
11619
+ const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
11584
11620
  };
11585
- function resolveTransitionProps(rawProps) {
11586
- const baseProps = {};
11587
- for (const key in rawProps) {
11588
- if (!(key in DOMTransitionPropsValidators)) {
11589
- baseProps[key] = rawProps[key];
11621
+ class VueElement extends BaseClass {
11622
+ constructor(_def, _props = {}, hydrate2) {
11623
+ super();
11624
+ this._def = _def;
11625
+ this._props = _props;
11626
+ /**
11627
+ * @internal
11628
+ */
11629
+ this._instance = null;
11630
+ this._connected = false;
11631
+ this._resolved = false;
11632
+ this._numberProps = null;
11633
+ this._ob = null;
11634
+ if (this.shadowRoot && hydrate2) {
11635
+ hydrate2(this._createVNode(), this.shadowRoot);
11636
+ } else {
11637
+ if (!!(process.env.NODE_ENV !== "production") && this.shadowRoot) {
11638
+ warn(
11639
+ `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
11640
+ );
11641
+ }
11642
+ this.attachShadow({ mode: "open" });
11643
+ if (!this._def.__asyncLoader) {
11644
+ this._resolveProps(this._def);
11645
+ }
11590
11646
  }
11591
11647
  }
11592
- if (rawProps.css === false) {
11593
- return baseProps;
11594
- }
11595
- const {
11596
- name = "v",
11597
- type,
11598
- duration,
11599
- enterFromClass = `${name}-enter-from`,
11600
- enterActiveClass = `${name}-enter-active`,
11601
- enterToClass = `${name}-enter-to`,
11602
- appearFromClass = enterFromClass,
11603
- appearActiveClass = enterActiveClass,
11604
- appearToClass = enterToClass,
11605
- leaveFromClass = `${name}-leave-from`,
11606
- leaveActiveClass = `${name}-leave-active`,
11607
- leaveToClass = `${name}-leave-to`
11608
- } = rawProps;
11609
- const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES", null);
11610
- let legacyEnterFromClass;
11611
- let legacyAppearFromClass;
11612
- let legacyLeaveFromClass;
11613
- if (legacyClassEnabled) {
11614
- const toLegacyClass = (cls) => cls.replace(/-from$/, "");
11615
- if (!rawProps.enterFromClass) {
11616
- legacyEnterFromClass = toLegacyClass(enterFromClass);
11617
- }
11618
- if (!rawProps.appearFromClass) {
11619
- legacyAppearFromClass = toLegacyClass(appearFromClass);
11648
+ connectedCallback() {
11649
+ this._connected = true;
11650
+ if (!this._instance) {
11651
+ if (this._resolved) {
11652
+ this._update();
11653
+ } else {
11654
+ this._resolveDef();
11655
+ }
11620
11656
  }
11621
- if (!rawProps.leaveFromClass) {
11622
- legacyLeaveFromClass = toLegacyClass(leaveFromClass);
11657
+ }
11658
+ disconnectedCallback() {
11659
+ this._connected = false;
11660
+ if (this._ob) {
11661
+ this._ob.disconnect();
11662
+ this._ob = null;
11623
11663
  }
11664
+ nextTick(() => {
11665
+ if (!this._connected) {
11666
+ render(null, this.shadowRoot);
11667
+ this._instance = null;
11668
+ }
11669
+ });
11624
11670
  }
11625
- const durations = normalizeDuration(duration);
11626
- const enterDuration = durations && durations[0];
11627
- const leaveDuration = durations && durations[1];
11628
- const {
11629
- onBeforeEnter,
11630
- onEnter,
11631
- onEnterCancelled,
11632
- onLeave,
11633
- onLeaveCancelled,
11634
- onBeforeAppear = onBeforeEnter,
11635
- onAppear = onEnter,
11636
- onAppearCancelled = onEnterCancelled
11637
- } = baseProps;
11638
- const finishEnter = (el, isAppear, done) => {
11639
- removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
11640
- removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
11641
- done && done();
11642
- };
11643
- const finishLeave = (el, done) => {
11644
- el._isLeaving = false;
11645
- removeTransitionClass(el, leaveFromClass);
11646
- removeTransitionClass(el, leaveToClass);
11647
- removeTransitionClass(el, leaveActiveClass);
11648
- done && done();
11649
- };
11650
- const makeEnterHook = (isAppear) => {
11651
- return (el, done) => {
11652
- const hook = isAppear ? onAppear : onEnter;
11653
- const resolve = () => finishEnter(el, isAppear, done);
11654
- callHook(hook, [el, resolve]);
11655
- nextFrame(() => {
11656
- removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
11657
- if (legacyClassEnabled) {
11658
- const legacyClass = isAppear ? legacyAppearFromClass : legacyEnterFromClass;
11659
- if (legacyClass) {
11660
- removeTransitionClass(el, legacyClass);
11671
+ /**
11672
+ * resolve inner component definition (handle possible async component)
11673
+ */
11674
+ _resolveDef() {
11675
+ this._resolved = true;
11676
+ for (let i = 0; i < this.attributes.length; i++) {
11677
+ this._setAttr(this.attributes[i].name);
11678
+ }
11679
+ this._ob = new MutationObserver((mutations) => {
11680
+ for (const m of mutations) {
11681
+ this._setAttr(m.attributeName);
11682
+ }
11683
+ });
11684
+ this._ob.observe(this, { attributes: true });
11685
+ const resolve = (def, isAsync = false) => {
11686
+ const { props, styles } = def;
11687
+ let numberProps;
11688
+ if (props && !isArray(props)) {
11689
+ for (const key in props) {
11690
+ const opt = props[key];
11691
+ if (opt === Number || opt && opt.type === Number) {
11692
+ if (key in this._props) {
11693
+ this._props[key] = toNumber(this._props[key]);
11694
+ }
11695
+ (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
11661
11696
  }
11662
11697
  }
11663
- addTransitionClass(el, isAppear ? appearToClass : enterToClass);
11664
- if (!hasExplicitCallback(hook)) {
11665
- whenTransitionEnds(el, type, enterDuration, resolve);
11666
- }
11667
- });
11698
+ }
11699
+ this._numberProps = numberProps;
11700
+ if (isAsync) {
11701
+ this._resolveProps(def);
11702
+ }
11703
+ this._applyStyles(styles);
11704
+ this._update();
11668
11705
  };
11669
- };
11670
- return extend(baseProps, {
11671
- onBeforeEnter(el) {
11672
- callHook(onBeforeEnter, [el]);
11673
- addTransitionClass(el, enterFromClass);
11674
- if (legacyClassEnabled && legacyEnterFromClass) {
11675
- addTransitionClass(el, legacyEnterFromClass);
11706
+ const asyncDef = this._def.__asyncLoader;
11707
+ if (asyncDef) {
11708
+ asyncDef().then((def) => resolve(def, true));
11709
+ } else {
11710
+ resolve(this._def);
11711
+ }
11712
+ }
11713
+ _resolveProps(def) {
11714
+ const { props } = def;
11715
+ const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
11716
+ for (const key of Object.keys(this)) {
11717
+ if (key[0] !== "_" && declaredPropKeys.includes(key)) {
11718
+ this._setProp(key, this[key], true, false);
11676
11719
  }
11677
- addTransitionClass(el, enterActiveClass);
11678
- },
11679
- onBeforeAppear(el) {
11680
- callHook(onBeforeAppear, [el]);
11681
- addTransitionClass(el, appearFromClass);
11682
- if (legacyClassEnabled && legacyAppearFromClass) {
11683
- addTransitionClass(el, legacyAppearFromClass);
11720
+ }
11721
+ for (const key of declaredPropKeys.map(camelize)) {
11722
+ Object.defineProperty(this, key, {
11723
+ get() {
11724
+ return this._getProp(key);
11725
+ },
11726
+ set(val) {
11727
+ this._setProp(key, val);
11728
+ }
11729
+ });
11730
+ }
11731
+ }
11732
+ _setAttr(key) {
11733
+ let value = this.getAttribute(key);
11734
+ const camelKey = camelize(key);
11735
+ if (this._numberProps && this._numberProps[camelKey]) {
11736
+ value = toNumber(value);
11737
+ }
11738
+ this._setProp(camelKey, value, false);
11739
+ }
11740
+ /**
11741
+ * @internal
11742
+ */
11743
+ _getProp(key) {
11744
+ return this._props[key];
11745
+ }
11746
+ /**
11747
+ * @internal
11748
+ */
11749
+ _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
11750
+ if (val !== this._props[key]) {
11751
+ this._props[key] = val;
11752
+ if (shouldUpdate && this._instance) {
11753
+ this._update();
11684
11754
  }
11685
- addTransitionClass(el, appearActiveClass);
11686
- },
11687
- onEnter: makeEnterHook(false),
11688
- onAppear: makeEnterHook(true),
11689
- onLeave(el, done) {
11690
- el._isLeaving = true;
11691
- const resolve = () => finishLeave(el, done);
11692
- addTransitionClass(el, leaveFromClass);
11693
- if (legacyClassEnabled && legacyLeaveFromClass) {
11694
- addTransitionClass(el, legacyLeaveFromClass);
11755
+ if (shouldReflect) {
11756
+ if (val === true) {
11757
+ this.setAttribute(hyphenate(key), "");
11758
+ } else if (typeof val === "string" || typeof val === "number") {
11759
+ this.setAttribute(hyphenate(key), val + "");
11760
+ } else if (!val) {
11761
+ this.removeAttribute(hyphenate(key));
11762
+ }
11695
11763
  }
11696
- forceReflow();
11697
- addTransitionClass(el, leaveActiveClass);
11698
- nextFrame(() => {
11699
- if (!el._isLeaving) {
11700
- return;
11764
+ }
11765
+ }
11766
+ _update() {
11767
+ render(this._createVNode(), this.shadowRoot);
11768
+ }
11769
+ _createVNode() {
11770
+ const vnode = createVNode(this._def, extend({}, this._props));
11771
+ if (!this._instance) {
11772
+ vnode.ce = (instance) => {
11773
+ this._instance = instance;
11774
+ instance.isCE = true;
11775
+ if (!!(process.env.NODE_ENV !== "production")) {
11776
+ instance.ceReload = (newStyles) => {
11777
+ if (this._styles) {
11778
+ this._styles.forEach((s) => this.shadowRoot.removeChild(s));
11779
+ this._styles.length = 0;
11780
+ }
11781
+ this._applyStyles(newStyles);
11782
+ this._instance = null;
11783
+ this._update();
11784
+ };
11701
11785
  }
11702
- removeTransitionClass(el, leaveFromClass);
11703
- if (legacyClassEnabled && legacyLeaveFromClass) {
11704
- removeTransitionClass(el, legacyLeaveFromClass);
11786
+ const dispatch = (event, args) => {
11787
+ this.dispatchEvent(
11788
+ new CustomEvent(event, {
11789
+ detail: args
11790
+ })
11791
+ );
11792
+ };
11793
+ instance.emit = (event, ...args) => {
11794
+ dispatch(event, args);
11795
+ if (hyphenate(event) !== event) {
11796
+ dispatch(hyphenate(event), args);
11797
+ }
11798
+ };
11799
+ let parent = this;
11800
+ while (parent = parent && (parent.parentNode || parent.host)) {
11801
+ if (parent instanceof VueElement) {
11802
+ instance.parent = parent._instance;
11803
+ instance.provides = parent._instance.provides;
11804
+ break;
11805
+ }
11705
11806
  }
11706
- addTransitionClass(el, leaveToClass);
11707
- if (!hasExplicitCallback(onLeave)) {
11708
- whenTransitionEnds(el, type, leaveDuration, resolve);
11807
+ };
11808
+ }
11809
+ return vnode;
11810
+ }
11811
+ _applyStyles(styles) {
11812
+ if (styles) {
11813
+ styles.forEach((css) => {
11814
+ const s = document.createElement("style");
11815
+ s.textContent = css;
11816
+ this.shadowRoot.appendChild(s);
11817
+ if (!!(process.env.NODE_ENV !== "production")) {
11818
+ (this._styles || (this._styles = [])).push(s);
11709
11819
  }
11710
11820
  });
11711
- callHook(onLeave, [el, resolve]);
11712
- },
11713
- onEnterCancelled(el) {
11714
- finishEnter(el, false);
11715
- callHook(onEnterCancelled, [el]);
11716
- },
11717
- onAppearCancelled(el) {
11718
- finishEnter(el, true);
11719
- callHook(onAppearCancelled, [el]);
11720
- },
11721
- onLeaveCancelled(el) {
11722
- finishLeave(el);
11723
- callHook(onLeaveCancelled, [el]);
11724
11821
  }
11725
- });
11726
- }
11727
- function normalizeDuration(duration) {
11728
- if (duration == null) {
11729
- return null;
11730
- } else if (isObject(duration)) {
11731
- return [NumberOf(duration.enter), NumberOf(duration.leave)];
11732
- } else {
11733
- const n = NumberOf(duration);
11734
- return [n, n];
11735
- }
11736
- }
11737
- function NumberOf(val) {
11738
- const res = toNumber(val);
11739
- if (!!(process.env.NODE_ENV !== "production")) {
11740
- assertNumber(res, "<transition> explicit duration");
11741
11822
  }
11742
- return res;
11743
- }
11744
- function addTransitionClass(el, cls) {
11745
- cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
11746
- (el._vtc || (el._vtc = /* @__PURE__ */ new Set())).add(cls);
11747
11823
  }
11748
- function removeTransitionClass(el, cls) {
11749
- cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
11750
- const { _vtc } = el;
11751
- if (_vtc) {
11752
- _vtc.delete(cls);
11753
- if (!_vtc.size) {
11754
- el._vtc = void 0;
11824
+
11825
+ function useCssModule(name = "$style") {
11826
+ {
11827
+ const instance = getCurrentInstance();
11828
+ if (!instance) {
11829
+ !!(process.env.NODE_ENV !== "production") && warn(`useCssModule must be called inside setup()`);
11830
+ return EMPTY_OBJ;
11755
11831
  }
11756
- }
11757
- }
11758
- function nextFrame(cb) {
11759
- requestAnimationFrame(() => {
11760
- requestAnimationFrame(cb);
11761
- });
11762
- }
11763
- let endId = 0;
11764
- function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
11765
- const id = el._endId = ++endId;
11766
- const resolveIfNotStale = () => {
11767
- if (id === el._endId) {
11768
- resolve();
11832
+ const modules = instance.type.__cssModules;
11833
+ if (!modules) {
11834
+ !!(process.env.NODE_ENV !== "production") && warn(`Current instance does not have CSS modules injected.`);
11835
+ return EMPTY_OBJ;
11769
11836
  }
11770
- };
11771
- if (explicitTimeout) {
11772
- return setTimeout(resolveIfNotStale, explicitTimeout);
11837
+ const mod = modules[name];
11838
+ if (!mod) {
11839
+ !!(process.env.NODE_ENV !== "production") && warn(`Current instance does not have CSS module named "${name}".`);
11840
+ return EMPTY_OBJ;
11841
+ }
11842
+ return mod;
11773
11843
  }
11774
- const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
11775
- if (!type) {
11776
- return resolve();
11844
+ }
11845
+
11846
+ function useCssVars(getter) {
11847
+ const instance = getCurrentInstance();
11848
+ if (!instance) {
11849
+ !!(process.env.NODE_ENV !== "production") && warn(`useCssVars is called without current active component instance.`);
11850
+ return;
11777
11851
  }
11778
- const endEvent = type + "end";
11779
- let ended = 0;
11780
- const end = () => {
11781
- el.removeEventListener(endEvent, onEnd);
11782
- resolveIfNotStale();
11852
+ const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
11853
+ Array.from(
11854
+ document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
11855
+ ).forEach((node) => setVarsOnNode(node, vars));
11783
11856
  };
11784
- const onEnd = (e) => {
11785
- if (e.target === el && ++ended >= propCount) {
11786
- end();
11787
- }
11857
+ const setVars = () => {
11858
+ const vars = getter(instance.proxy);
11859
+ setVarsOnVNode(instance.subTree, vars);
11860
+ updateTeleports(vars);
11788
11861
  };
11789
- setTimeout(() => {
11790
- if (ended < propCount) {
11791
- end();
11792
- }
11793
- }, timeout + 1);
11794
- el.addEventListener(endEvent, onEnd);
11862
+ watchPostEffect(setVars);
11863
+ onMounted(() => {
11864
+ const ob = new MutationObserver(setVars);
11865
+ ob.observe(instance.subTree.el.parentNode, { childList: true });
11866
+ onUnmounted(() => ob.disconnect());
11867
+ });
11795
11868
  }
11796
- function getTransitionInfo(el, expectedType) {
11797
- const styles = window.getComputedStyle(el);
11798
- const getStyleProperties = (key) => (styles[key] || "").split(", ");
11799
- const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
11800
- const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
11801
- const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
11802
- const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
11803
- const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
11804
- const animationTimeout = getTimeout(animationDelays, animationDurations);
11805
- let type = null;
11806
- let timeout = 0;
11807
- let propCount = 0;
11808
- if (expectedType === TRANSITION) {
11809
- if (transitionTimeout > 0) {
11810
- type = TRANSITION;
11811
- timeout = transitionTimeout;
11812
- propCount = transitionDurations.length;
11869
+ function setVarsOnVNode(vnode, vars) {
11870
+ if (vnode.shapeFlag & 128) {
11871
+ const suspense = vnode.suspense;
11872
+ vnode = suspense.activeBranch;
11873
+ if (suspense.pendingBranch && !suspense.isHydrating) {
11874
+ suspense.effects.push(() => {
11875
+ setVarsOnVNode(suspense.activeBranch, vars);
11876
+ });
11813
11877
  }
11814
- } else if (expectedType === ANIMATION) {
11815
- if (animationTimeout > 0) {
11816
- type = ANIMATION;
11817
- timeout = animationTimeout;
11818
- propCount = animationDurations.length;
11878
+ }
11879
+ while (vnode.component) {
11880
+ vnode = vnode.component.subTree;
11881
+ }
11882
+ if (vnode.shapeFlag & 1 && vnode.el) {
11883
+ setVarsOnNode(vnode.el, vars);
11884
+ } else if (vnode.type === Fragment) {
11885
+ vnode.children.forEach((c) => setVarsOnVNode(c, vars));
11886
+ } else if (vnode.type === Static) {
11887
+ let { el, anchor } = vnode;
11888
+ while (el) {
11889
+ setVarsOnNode(el, vars);
11890
+ if (el === anchor)
11891
+ break;
11892
+ el = el.nextSibling;
11819
11893
  }
11820
- } else {
11821
- timeout = Math.max(transitionTimeout, animationTimeout);
11822
- type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
11823
- propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
11824
11894
  }
11825
- const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
11826
- getStyleProperties(`${TRANSITION}Property`).toString()
11827
- );
11828
- return {
11829
- type,
11830
- timeout,
11831
- propCount,
11832
- hasTransform
11833
- };
11834
11895
  }
11835
- function getTimeout(delays, durations) {
11836
- while (delays.length < durations.length) {
11837
- delays = delays.concat(delays);
11896
+ function setVarsOnNode(el, vars) {
11897
+ if (el.nodeType === 1) {
11898
+ const style = el.style;
11899
+ for (const key in vars) {
11900
+ style.setProperty(`--${key}`, vars[key]);
11901
+ }
11838
11902
  }
11839
- return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
11840
- }
11841
- function toMs(s) {
11842
- return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
11843
- }
11844
- function forceReflow() {
11845
- return document.body.offsetHeight;
11846
11903
  }
11847
11904
 
11848
11905
  const positionMap = /* @__PURE__ */ new WeakMap();
11849
11906
  const newPositionMap = /* @__PURE__ */ new WeakMap();
11907
+ const moveCbKey = Symbol("_moveCb");
11908
+ const enterCbKey = Symbol("_enterCb");
11850
11909
  const TransitionGroupImpl = {
11851
11910
  name: "TransitionGroup",
11852
11911
  props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
@@ -11879,13 +11938,13 @@ const TransitionGroupImpl = {
11879
11938
  const style = el.style;
11880
11939
  addTransitionClass(el, moveClass);
11881
11940
  style.transform = style.webkitTransform = style.transitionDuration = "";
11882
- const cb = el._moveCb = (e) => {
11941
+ const cb = el[moveCbKey] = (e) => {
11883
11942
  if (e && e.target !== el) {
11884
11943
  return;
11885
11944
  }
11886
11945
  if (!e || /transform$/.test(e.propertyName)) {
11887
11946
  el.removeEventListener("transitionend", cb);
11888
- el._moveCb = null;
11947
+ el[moveCbKey] = null;
11889
11948
  removeTransitionClass(el, moveClass);
11890
11949
  }
11891
11950
  };
@@ -11937,11 +11996,11 @@ const removeMode = (props) => delete props.mode;
11937
11996
  const TransitionGroup = TransitionGroupImpl;
11938
11997
  function callPendingCbs(c) {
11939
11998
  const el = c.el;
11940
- if (el._moveCb) {
11941
- el._moveCb();
11999
+ if (el[moveCbKey]) {
12000
+ el[moveCbKey]();
11942
12001
  }
11943
- if (el._enterCb) {
11944
- el._enterCb();
12002
+ if (el[enterCbKey]) {
12003
+ el[enterCbKey]();
11945
12004
  }
11946
12005
  }
11947
12006
  function recordPosition(c) {
@@ -11961,8 +12020,9 @@ function applyTranslation(c) {
11961
12020
  }
11962
12021
  function hasCSSTransform(el, root, moveClass) {
11963
12022
  const clone = el.cloneNode();
11964
- if (el._vtc) {
11965
- el._vtc.forEach((cls) => {
12023
+ const _vtc = el[vtcKey];
12024
+ if (_vtc) {
12025
+ _vtc.forEach((cls) => {
11966
12026
  cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
11967
12027
  });
11968
12028
  }
@@ -11989,9 +12049,10 @@ function onCompositionEnd(e) {
11989
12049
  target.dispatchEvent(new Event("input"));
11990
12050
  }
11991
12051
  }
12052
+ const assignKey = Symbol("_assign");
11992
12053
  const vModelText = {
11993
12054
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
11994
- el._assign = getModelAssigner(vnode);
12055
+ el[assignKey] = getModelAssigner(vnode);
11995
12056
  const castToNumber = number || vnode.props && vnode.props.type === "number";
11996
12057
  addEventListener(el, lazy ? "change" : "input", (e) => {
11997
12058
  if (e.target.composing)
@@ -12003,7 +12064,7 @@ const vModelText = {
12003
12064
  if (castToNumber) {
12004
12065
  domValue = looseToNumber(domValue);
12005
12066
  }
12006
- el._assign(domValue);
12067
+ el[assignKey](domValue);
12007
12068
  });
12008
12069
  if (trim) {
12009
12070
  addEventListener(el, "change", () => {
@@ -12021,7 +12082,7 @@ const vModelText = {
12021
12082
  el.value = value == null ? "" : value;
12022
12083
  },
12023
12084
  beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {
12024
- el._assign = getModelAssigner(vnode);
12085
+ el[assignKey] = getModelAssigner(vnode);
12025
12086
  if (el.composing)
12026
12087
  return;
12027
12088
  if (document.activeElement === el && el.type !== "range") {
@@ -12045,12 +12106,12 @@ const vModelCheckbox = {
12045
12106
  // #4096 array checkboxes need to be deep traversed
12046
12107
  deep: true,
12047
12108
  created(el, _, vnode) {
12048
- el._assign = getModelAssigner(vnode);
12109
+ el[assignKey] = getModelAssigner(vnode);
12049
12110
  addEventListener(el, "change", () => {
12050
12111
  const modelValue = el._modelValue;
12051
12112
  const elementValue = getValue(el);
12052
12113
  const checked = el.checked;
12053
- const assign = el._assign;
12114
+ const assign = el[assignKey];
12054
12115
  if (isArray(modelValue)) {
12055
12116
  const index = looseIndexOf(modelValue, elementValue);
12056
12117
  const found = index !== -1;
@@ -12077,7 +12138,7 @@ const vModelCheckbox = {
12077
12138
  // set initial checked on mount to wait for true-value/false-value
12078
12139
  mounted: setChecked,
12079
12140
  beforeUpdate(el, binding, vnode) {
12080
- el._assign = getModelAssigner(vnode);
12141
+ el[assignKey] = getModelAssigner(vnode);
12081
12142
  setChecked(el, binding, vnode);
12082
12143
  }
12083
12144
  };
@@ -12094,13 +12155,13 @@ function setChecked(el, { value, oldValue }, vnode) {
12094
12155
  const vModelRadio = {
12095
12156
  created(el, { value }, vnode) {
12096
12157
  el.checked = looseEqual(value, vnode.props.value);
12097
- el._assign = getModelAssigner(vnode);
12158
+ el[assignKey] = getModelAssigner(vnode);
12098
12159
  addEventListener(el, "change", () => {
12099
- el._assign(getValue(el));
12160
+ el[assignKey](getValue(el));
12100
12161
  });
12101
12162
  },
12102
12163
  beforeUpdate(el, { value, oldValue }, vnode) {
12103
- el._assign = getModelAssigner(vnode);
12164
+ el[assignKey] = getModelAssigner(vnode);
12104
12165
  if (value !== oldValue) {
12105
12166
  el.checked = looseEqual(value, vnode.props.value);
12106
12167
  }
@@ -12115,11 +12176,11 @@ const vModelSelect = {
12115
12176
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
12116
12177
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
12117
12178
  );
12118
- el._assign(
12179
+ el[assignKey](
12119
12180
  el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
12120
12181
  );
12121
12182
  });
12122
- el._assign = getModelAssigner(vnode);
12183
+ el[assignKey] = getModelAssigner(vnode);
12123
12184
  },
12124
12185
  // set value in mounted & updated because <select> relies on its children
12125
12186
  // <option>s.
@@ -12127,7 +12188,7 @@ const vModelSelect = {
12127
12188
  setSelected(el, value);
12128
12189
  },
12129
12190
  beforeUpdate(el, _binding, vnode) {
12130
- el._assign = getModelAssigner(vnode);
12191
+ el[assignKey] = getModelAssigner(vnode);
12131
12192
  },
12132
12193
  updated(el, { value }) {
12133
12194
  setSelected(el, value);
@@ -12324,52 +12385,6 @@ const withKeys = (fn, modifiers) => {
12324
12385
  };
12325
12386
  };
12326
12387
 
12327
- const vShow = {
12328
- beforeMount(el, { value }, { transition }) {
12329
- el._vod = el.style.display === "none" ? "" : el.style.display;
12330
- if (transition && value) {
12331
- transition.beforeEnter(el);
12332
- } else {
12333
- setDisplay(el, value);
12334
- }
12335
- },
12336
- mounted(el, { value }, { transition }) {
12337
- if (transition && value) {
12338
- transition.enter(el);
12339
- }
12340
- },
12341
- updated(el, { value, oldValue }, { transition }) {
12342
- if (!value === !oldValue)
12343
- return;
12344
- if (transition) {
12345
- if (value) {
12346
- transition.beforeEnter(el);
12347
- setDisplay(el, true);
12348
- transition.enter(el);
12349
- } else {
12350
- transition.leave(el, () => {
12351
- setDisplay(el, false);
12352
- });
12353
- }
12354
- } else {
12355
- setDisplay(el, value);
12356
- }
12357
- },
12358
- beforeUnmount(el, { value }) {
12359
- setDisplay(el, value);
12360
- }
12361
- };
12362
- function setDisplay(el, value) {
12363
- el.style.display = value ? el._vod : "none";
12364
- }
12365
- function initVShowForSSR() {
12366
- vShow.getSSRProps = ({ value }) => {
12367
- if (!value) {
12368
- return { style: { display: "none" } };
12369
- }
12370
- };
12371
- }
12372
-
12373
12388
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
12374
12389
  let renderer;
12375
12390
  let enabledHydration = false;