@vue/compat 3.3.4 → 3.3.5

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);
@@ -628,10 +627,6 @@ const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`
628
627
  const builtInSymbols = new Set(
629
628
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
630
629
  );
631
- const get$1 = /* @__PURE__ */ createGetter();
632
- const shallowGet = /* @__PURE__ */ createGetter(false, true);
633
- const readonlyGet = /* @__PURE__ */ createGetter(true);
634
- const shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);
635
630
  const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
636
631
  function createArrayInstrumentations() {
637
632
  const instrumentations = {};
@@ -664,8 +659,13 @@ function hasOwnProperty(key) {
664
659
  track(obj, "has", key);
665
660
  return obj.hasOwnProperty(key);
666
661
  }
667
- function createGetter(isReadonly2 = false, shallow = false) {
668
- return function get2(target, key, receiver) {
662
+ class BaseReactiveHandler {
663
+ constructor(_isReadonly = false, _shallow = false) {
664
+ this._isReadonly = _isReadonly;
665
+ this._shallow = _shallow;
666
+ }
667
+ get(target, key, receiver) {
668
+ const isReadonly2 = this._isReadonly, shallow = this._shallow;
669
669
  if (key === "__v_isReactive") {
670
670
  return !isReadonly2;
671
671
  } else if (key === "__v_isReadonly") {
@@ -701,17 +701,18 @@ function createGetter(isReadonly2 = false, shallow = false) {
701
701
  return isReadonly2 ? readonly(res) : reactive(res);
702
702
  }
703
703
  return res;
704
- };
704
+ }
705
705
  }
706
- const set$1 = /* @__PURE__ */ createSetter();
707
- const shallowSet = /* @__PURE__ */ createSetter(true);
708
- function createSetter(shallow = false) {
709
- return function set2(target, key, value, receiver) {
706
+ class MutableReactiveHandler extends BaseReactiveHandler {
707
+ constructor(shallow = false) {
708
+ super(false, shallow);
709
+ }
710
+ set(target, key, value, receiver) {
710
711
  let oldValue = target[key];
711
712
  if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
712
713
  return false;
713
714
  }
714
- if (!shallow) {
715
+ if (!this._shallow) {
715
716
  if (!isShallow(value) && !isReadonly(value)) {
716
717
  oldValue = toRaw(oldValue);
717
718
  value = toRaw(value);
@@ -731,37 +732,36 @@ function createSetter(shallow = false) {
731
732
  }
732
733
  }
733
734
  return result;
734
- };
735
- }
736
- function deleteProperty(target, key) {
737
- const hadKey = hasOwn(target, key);
738
- const oldValue = target[key];
739
- const result = Reflect.deleteProperty(target, key);
740
- if (result && hadKey) {
741
- trigger(target, "delete", key, void 0, oldValue);
742
735
  }
743
- return result;
744
- }
745
- function has$1(target, key) {
746
- const result = Reflect.has(target, key);
747
- if (!isSymbol(key) || !builtInSymbols.has(key)) {
748
- track(target, "has", key);
736
+ deleteProperty(target, key) {
737
+ const hadKey = hasOwn(target, key);
738
+ const oldValue = target[key];
739
+ const result = Reflect.deleteProperty(target, key);
740
+ if (result && hadKey) {
741
+ trigger(target, "delete", key, void 0, oldValue);
742
+ }
743
+ return result;
744
+ }
745
+ has(target, key) {
746
+ const result = Reflect.has(target, key);
747
+ if (!isSymbol(key) || !builtInSymbols.has(key)) {
748
+ track(target, "has", key);
749
+ }
750
+ return result;
751
+ }
752
+ ownKeys(target) {
753
+ track(
754
+ target,
755
+ "iterate",
756
+ isArray(target) ? "length" : ITERATE_KEY
757
+ );
758
+ return Reflect.ownKeys(target);
749
759
  }
750
- return result;
751
- }
752
- function ownKeys(target) {
753
- track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY);
754
- return Reflect.ownKeys(target);
755
760
  }
756
- const mutableHandlers = {
757
- get: get$1,
758
- set: set$1,
759
- deleteProperty,
760
- has: has$1,
761
- ownKeys
762
- };
763
- const readonlyHandlers = {
764
- get: readonlyGet,
761
+ class ReadonlyReactiveHandler extends BaseReactiveHandler {
762
+ constructor(shallow = false) {
763
+ super(true, shallow);
764
+ }
765
765
  set(target, key) {
766
766
  {
767
767
  warn$1(
@@ -770,7 +770,7 @@ const readonlyHandlers = {
770
770
  );
771
771
  }
772
772
  return true;
773
- },
773
+ }
774
774
  deleteProperty(target, key) {
775
775
  {
776
776
  warn$1(
@@ -780,22 +780,13 @@ const readonlyHandlers = {
780
780
  }
781
781
  return true;
782
782
  }
783
- };
784
- const shallowReactiveHandlers = /* @__PURE__ */ extend(
785
- {},
786
- mutableHandlers,
787
- {
788
- get: shallowGet,
789
- set: shallowSet
790
- }
791
- );
792
- const shallowReadonlyHandlers = /* @__PURE__ */ extend(
793
- {},
794
- readonlyHandlers,
795
- {
796
- get: shallowReadonlyGet
797
- }
783
+ }
784
+ const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
785
+ const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
786
+ const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
787
+ true
798
788
  );
789
+ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
799
790
 
800
791
  const toShallow = (value) => value;
801
792
  const getProto = (v) => Reflect.getPrototypeOf(v);
@@ -804,7 +795,7 @@ function get(target, key, isReadonly = false, isShallow = false) {
804
795
  const rawTarget = toRaw(target);
805
796
  const rawKey = toRaw(key);
806
797
  if (!isReadonly) {
807
- if (key !== rawKey) {
798
+ if (hasChanged(key, rawKey)) {
808
799
  track(rawTarget, "get", key);
809
800
  }
810
801
  track(rawTarget, "get", rawKey);
@@ -824,7 +815,7 @@ function has(key, isReadonly = false) {
824
815
  const rawTarget = toRaw(target);
825
816
  const rawKey = toRaw(key);
826
817
  if (!isReadonly) {
827
- if (key !== rawKey) {
818
+ if (hasChanged(key, rawKey)) {
828
819
  track(rawTarget, "has", key);
829
820
  }
830
821
  track(rawTarget, "has", rawKey);
@@ -1354,11 +1345,7 @@ function toRef(source, key, defaultValue) {
1354
1345
  }
1355
1346
  function propertyToRef(source, key, defaultValue) {
1356
1347
  const val = source[key];
1357
- return isRef(val) ? val : new ObjectRefImpl(
1358
- source,
1359
- key,
1360
- defaultValue
1361
- );
1348
+ return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
1362
1349
  }
1363
1350
 
1364
1351
  class ComputedRefImpl {
@@ -3652,9 +3639,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3652
3639
  }
3653
3640
  if (cb) {
3654
3641
  const newValue = effect.run();
3655
- if (deep || forceTrigger || (isMultiSource ? newValue.some(
3656
- (v, i) => hasChanged(v, oldValue[i])
3657
- ) : hasChanged(newValue, oldValue)) || isArray(newValue) && isCompatEnabled("WATCH_ARRAY", instance)) {
3642
+ if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || isArray(newValue) && isCompatEnabled("WATCH_ARRAY", instance)) {
3658
3643
  if (cleanup) {
3659
3644
  cleanup();
3660
3645
  }
@@ -3828,6 +3813,8 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
3828
3813
  }
3829
3814
  }
3830
3815
 
3816
+ const leaveCbKey = Symbol("_leaveCb");
3817
+ const enterCbKey$1 = Symbol("_enterCb");
3831
3818
  function useTransitionState() {
3832
3819
  const state = {
3833
3820
  isMounted: false,
@@ -3948,9 +3935,9 @@ const BaseTransitionImpl = {
3948
3935
  oldInnerChild
3949
3936
  );
3950
3937
  leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
3951
- el._leaveCb = () => {
3938
+ el[leaveCbKey] = () => {
3952
3939
  earlyRemove();
3953
- el._leaveCb = void 0;
3940
+ el[leaveCbKey] = void 0;
3954
3941
  delete enterHooks.delayedLeave;
3955
3942
  };
3956
3943
  enterHooks.delayedLeave = delayedLeave;
@@ -4024,15 +4011,15 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4024
4011
  return;
4025
4012
  }
4026
4013
  }
4027
- if (el._leaveCb) {
4028
- el._leaveCb(
4014
+ if (el[leaveCbKey]) {
4015
+ el[leaveCbKey](
4029
4016
  true
4030
4017
  /* cancelled */
4031
4018
  );
4032
4019
  }
4033
4020
  const leavingVNode = leavingVNodesCache[key];
4034
- if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el._leaveCb) {
4035
- leavingVNode.el._leaveCb();
4021
+ if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
4022
+ leavingVNode.el[leaveCbKey]();
4036
4023
  }
4037
4024
  callHook(hook, [el]);
4038
4025
  },
@@ -4050,7 +4037,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4050
4037
  }
4051
4038
  }
4052
4039
  let called = false;
4053
- const done = el._enterCb = (cancelled) => {
4040
+ const done = el[enterCbKey$1] = (cancelled) => {
4054
4041
  if (called)
4055
4042
  return;
4056
4043
  called = true;
@@ -4062,7 +4049,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4062
4049
  if (hooks.delayedLeave) {
4063
4050
  hooks.delayedLeave();
4064
4051
  }
4065
- el._enterCb = void 0;
4052
+ el[enterCbKey$1] = void 0;
4066
4053
  };
4067
4054
  if (hook) {
4068
4055
  callAsyncHook(hook, [el, done]);
@@ -4072,8 +4059,8 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4072
4059
  },
4073
4060
  leave(el, remove) {
4074
4061
  const key2 = String(vnode.key);
4075
- if (el._enterCb) {
4076
- el._enterCb(
4062
+ if (el[enterCbKey$1]) {
4063
+ el[enterCbKey$1](
4077
4064
  true
4078
4065
  /* cancelled */
4079
4066
  );
@@ -4083,7 +4070,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4083
4070
  }
4084
4071
  callHook(onBeforeLeave, [el]);
4085
4072
  let called = false;
4086
- const done = el._leaveCb = (cancelled) => {
4073
+ const done = el[leaveCbKey] = (cancelled) => {
4087
4074
  if (called)
4088
4075
  return;
4089
4076
  called = true;
@@ -4093,7 +4080,7 @@ function resolveTransitionHooks(vnode, props, state, instance) {
4093
4080
  } else {
4094
4081
  callHook(onAfterLeave, [el]);
4095
4082
  }
4096
- el._leaveCb = void 0;
4083
+ el[leaveCbKey] = void 0;
4097
4084
  if (leavingVNodesCache[key2] === vnode) {
4098
4085
  delete leavingVNodesCache[key2];
4099
4086
  }
@@ -4155,6 +4142,8 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4155
4142
  return ret;
4156
4143
  }
4157
4144
 
4145
+ /*! #__NO_SIDE_EFFECTS__ */
4146
+ // @__NO_SIDE_EFFECTS__
4158
4147
  function defineComponent(options, extraOptions) {
4159
4148
  return isFunction(options) ? (
4160
4149
  // #8326: extend call and options.name access are considered side-effects
@@ -4164,6 +4153,8 @@ function defineComponent(options, extraOptions) {
4164
4153
  }
4165
4154
 
4166
4155
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
4156
+ /*! #__NO_SIDE_EFFECTS__ */
4157
+ // @__NO_SIDE_EFFECTS__
4167
4158
  function defineAsyncComponent(source) {
4168
4159
  if (isFunction(source)) {
4169
4160
  source = { loader: source };
@@ -5176,6 +5167,7 @@ function legacyPrependModifier(value, symbol) {
5176
5167
  function installCompatInstanceProperties(map) {
5177
5168
  const set = (target, key, val) => {
5178
5169
  target[key] = val;
5170
+ return target[key];
5179
5171
  };
5180
5172
  const del = (target, key) => {
5181
5173
  delete target[key];
@@ -5453,7 +5445,7 @@ const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ extend(
5453
5445
  return PublicInstanceProxyHandlers.get(target, key, target);
5454
5446
  },
5455
5447
  has(_, key) {
5456
- const has = key[0] !== "_" && !isGloballyWhitelisted(key);
5448
+ const has = key[0] !== "_" && !isGloballyAllowed(key);
5457
5449
  if (!has && PublicInstanceProxyHandlers.has(_, key)) {
5458
5450
  warn(
5459
5451
  `Property ${JSON.stringify(
@@ -6190,7 +6182,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6190
6182
  return vm;
6191
6183
  }
6192
6184
  }
6193
- Vue.version = `2.6.14-compat:${"3.3.4"}`;
6185
+ Vue.version = `2.6.14-compat:${"3.3.5"}`;
6194
6186
  Vue.config = singletonApp.config;
6195
6187
  Vue.use = (p, ...options) => {
6196
6188
  if (p && isFunction(p.install)) {
@@ -6598,7 +6590,7 @@ function createAppAPI(render, hydrate) {
6598
6590
  },
6599
6591
  set() {
6600
6592
  warn(
6601
- `app.config.unwrapInjectedRef has been deprecated. 3.3 now alawys unwraps injected refs in Options API.`
6593
+ `app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.`
6602
6594
  );
6603
6595
  }
6604
6596
  });
@@ -6685,10 +6677,7 @@ function createAppAPI(render, hydrate) {
6685
6677
  If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.`
6686
6678
  );
6687
6679
  }
6688
- const vnode = createVNode(
6689
- rootComponent,
6690
- rootProps
6691
- );
6680
+ const vnode = createVNode(rootComponent, rootProps);
6692
6681
  vnode.appContext = context;
6693
6682
  {
6694
6683
  context.reload = () => {
@@ -7511,8 +7500,10 @@ function createHydrationFunctions(rendererInternals) {
7511
7500
  hasMismatch = true;
7512
7501
  warn(
7513
7502
  `Hydration text mismatch:
7514
- - Client: ${JSON.stringify(node.data)}
7515
- - Server: ${JSON.stringify(vnode.children)}`
7503
+ - Server rendered: ${JSON.stringify(
7504
+ node.data
7505
+ )}
7506
+ - Client rendered: ${JSON.stringify(vnode.children)}`
7516
7507
  );
7517
7508
  node.data = vnode.children;
7518
7509
  }
@@ -7715,8 +7706,8 @@ function createHydrationFunctions(rendererInternals) {
7715
7706
  hasMismatch = true;
7716
7707
  warn(
7717
7708
  `Hydration text content mismatch in <${vnode.type}>:
7718
- - Client: ${el.textContent}
7719
- - Server: ${vnode.children}`
7709
+ - Server rendered: ${el.textContent}
7710
+ - Client rendered: ${vnode.children}`
7720
7711
  );
7721
7712
  el.textContent = vnode.children;
7722
7713
  }
@@ -9498,6 +9489,10 @@ const TeleportImpl = {
9498
9489
  internals,
9499
9490
  1
9500
9491
  );
9492
+ } else {
9493
+ if (n2.props && n1.props && n2.props.to !== n1.props.to) {
9494
+ n2.props.to = n1.props.to;
9495
+ }
9501
9496
  }
9502
9497
  } else {
9503
9498
  if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
@@ -10351,9 +10346,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
10351
10346
  if (!skipOptions) {
10352
10347
  setCurrentInstance(instance);
10353
10348
  pauseTracking();
10354
- applyOptions(instance);
10355
- resetTracking();
10356
- unsetCurrentInstance();
10349
+ try {
10350
+ applyOptions(instance);
10351
+ } finally {
10352
+ resetTracking();
10353
+ unsetCurrentInstance();
10354
+ }
10357
10355
  }
10358
10356
  if (!Component.render && instance.render === NOOP && !isSSR) {
10359
10357
  if (!compile && Component.template) {
@@ -10719,7 +10717,7 @@ function isMemoSame(cached, memo) {
10719
10717
  return true;
10720
10718
  }
10721
10719
 
10722
- const version = "3.3.4";
10720
+ const version = "3.3.5";
10723
10721
  const ssrUtils = null;
10724
10722
  const resolveFilter = resolveFilter$1 ;
10725
10723
  const _compatUtils = {
@@ -10798,934 +10796,989 @@ const nodeOps = {
10798
10796
  }
10799
10797
  };
10800
10798
 
10801
- function patchClass(el, value, isSVG) {
10802
- const transitionClasses = el._vtc;
10803
- if (transitionClasses) {
10804
- value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
10805
- }
10806
- if (value == null) {
10807
- el.removeAttribute("class");
10808
- } else if (isSVG) {
10809
- el.setAttribute("class", value);
10810
- } else {
10811
- el.className = value;
10812
- }
10799
+ const TRANSITION = "transition";
10800
+ const ANIMATION = "animation";
10801
+ const vtcKey = Symbol("_vtc");
10802
+ const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
10803
+ Transition.displayName = "Transition";
10804
+ {
10805
+ Transition.__isBuiltIn = true;
10813
10806
  }
10814
-
10815
- function patchStyle(el, prev, next) {
10816
- const style = el.style;
10817
- const isCssString = isString(next);
10818
- if (next && !isCssString) {
10819
- if (prev && !isString(prev)) {
10820
- for (const key in prev) {
10821
- if (next[key] == null) {
10822
- setStyle(style, key, "");
10823
- }
10824
- }
10825
- }
10826
- for (const key in next) {
10827
- setStyle(style, key, next[key]);
10828
- }
10829
- } else {
10830
- const currentDisplay = style.display;
10831
- if (isCssString) {
10832
- if (prev !== next) {
10833
- style.cssText = next;
10834
- }
10835
- } else if (prev) {
10836
- el.removeAttribute("style");
10837
- }
10838
- if ("_vod" in el) {
10839
- style.display = currentDisplay;
10840
- }
10807
+ const DOMTransitionPropsValidators = {
10808
+ name: String,
10809
+ type: String,
10810
+ css: {
10811
+ type: Boolean,
10812
+ default: true
10813
+ },
10814
+ duration: [String, Number, Object],
10815
+ enterFromClass: String,
10816
+ enterActiveClass: String,
10817
+ enterToClass: String,
10818
+ appearFromClass: String,
10819
+ appearActiveClass: String,
10820
+ appearToClass: String,
10821
+ leaveFromClass: String,
10822
+ leaveActiveClass: String,
10823
+ leaveToClass: String
10824
+ };
10825
+ const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
10826
+ {},
10827
+ BaseTransitionPropsValidators,
10828
+ DOMTransitionPropsValidators
10829
+ );
10830
+ const callHook = (hook, args = []) => {
10831
+ if (isArray(hook)) {
10832
+ hook.forEach((h2) => h2(...args));
10833
+ } else if (hook) {
10834
+ hook(...args);
10841
10835
  }
10842
- }
10843
- const semicolonRE = /[^\\];\s*$/;
10844
- const importantRE = /\s*!important$/;
10845
- function setStyle(style, name, val) {
10846
- if (isArray(val)) {
10847
- val.forEach((v) => setStyle(style, name, v));
10848
- } else {
10849
- if (val == null)
10850
- val = "";
10851
- {
10852
- if (semicolonRE.test(val)) {
10853
- warn(
10854
- `Unexpected semicolon at the end of '${name}' style value: '${val}'`
10855
- );
10856
- }
10857
- }
10858
- if (name.startsWith("--")) {
10859
- style.setProperty(name, val);
10860
- } else {
10861
- const prefixed = autoPrefix(style, name);
10862
- if (importantRE.test(val)) {
10863
- style.setProperty(
10864
- hyphenate(prefixed),
10865
- val.replace(importantRE, ""),
10866
- "important"
10867
- );
10868
- } else {
10869
- style[prefixed] = val;
10870
- }
10836
+ };
10837
+ const hasExplicitCallback = (hook) => {
10838
+ return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
10839
+ };
10840
+ function resolveTransitionProps(rawProps) {
10841
+ const baseProps = {};
10842
+ for (const key in rawProps) {
10843
+ if (!(key in DOMTransitionPropsValidators)) {
10844
+ baseProps[key] = rawProps[key];
10871
10845
  }
10872
10846
  }
10873
- }
10874
- const prefixes = ["Webkit", "Moz", "ms"];
10875
- const prefixCache = {};
10876
- function autoPrefix(style, rawName) {
10877
- const cached = prefixCache[rawName];
10878
- if (cached) {
10879
- return cached;
10880
- }
10881
- let name = camelize(rawName);
10882
- if (name !== "filter" && name in style) {
10883
- return prefixCache[rawName] = name;
10884
- }
10885
- name = capitalize(name);
10886
- for (let i = 0; i < prefixes.length; i++) {
10887
- const prefixed = prefixes[i] + name;
10888
- if (prefixed in style) {
10889
- return prefixCache[rawName] = prefixed;
10890
- }
10847
+ if (rawProps.css === false) {
10848
+ return baseProps;
10891
10849
  }
10892
- return rawName;
10893
- }
10894
-
10895
- const xlinkNS = "http://www.w3.org/1999/xlink";
10896
- function patchAttr(el, key, value, isSVG, instance) {
10897
- if (isSVG && key.startsWith("xlink:")) {
10898
- if (value == null) {
10899
- el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
10900
- } else {
10901
- el.setAttributeNS(xlinkNS, key, value);
10902
- }
10903
- } else {
10904
- if (compatCoerceAttr(el, key, value, instance)) {
10905
- return;
10850
+ const {
10851
+ name = "v",
10852
+ type,
10853
+ duration,
10854
+ enterFromClass = `${name}-enter-from`,
10855
+ enterActiveClass = `${name}-enter-active`,
10856
+ enterToClass = `${name}-enter-to`,
10857
+ appearFromClass = enterFromClass,
10858
+ appearActiveClass = enterActiveClass,
10859
+ appearToClass = enterToClass,
10860
+ leaveFromClass = `${name}-leave-from`,
10861
+ leaveActiveClass = `${name}-leave-active`,
10862
+ leaveToClass = `${name}-leave-to`
10863
+ } = rawProps;
10864
+ const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES", null);
10865
+ let legacyEnterFromClass;
10866
+ let legacyAppearFromClass;
10867
+ let legacyLeaveFromClass;
10868
+ if (legacyClassEnabled) {
10869
+ const toLegacyClass = (cls) => cls.replace(/-from$/, "");
10870
+ if (!rawProps.enterFromClass) {
10871
+ legacyEnterFromClass = toLegacyClass(enterFromClass);
10906
10872
  }
10907
- const isBoolean = isSpecialBooleanAttr(key);
10908
- if (value == null || isBoolean && !includeBooleanAttr(value)) {
10909
- el.removeAttribute(key);
10910
- } else {
10911
- el.setAttribute(key, isBoolean ? "" : value);
10873
+ if (!rawProps.appearFromClass) {
10874
+ legacyAppearFromClass = toLegacyClass(appearFromClass);
10912
10875
  }
10913
- }
10914
- }
10915
- const isEnumeratedAttr = /* @__PURE__ */ makeMap("contenteditable,draggable,spellcheck") ;
10916
- function compatCoerceAttr(el, key, value, instance = null) {
10917
- if (isEnumeratedAttr(key)) {
10918
- const v2CoercedValue = value === null ? "false" : typeof value !== "boolean" && value !== void 0 ? "true" : null;
10919
- if (v2CoercedValue && compatUtils.softAssertCompatEnabled(
10920
- "ATTR_ENUMERATED_COERCION",
10921
- instance,
10922
- key,
10923
- value,
10924
- v2CoercedValue
10925
- )) {
10926
- el.setAttribute(key, v2CoercedValue);
10927
- return true;
10876
+ if (!rawProps.leaveFromClass) {
10877
+ legacyLeaveFromClass = toLegacyClass(leaveFromClass);
10928
10878
  }
10929
- } else if (value === false && !isSpecialBooleanAttr(key) && compatUtils.softAssertCompatEnabled(
10930
- "ATTR_FALSE_VALUE",
10931
- instance,
10932
- key
10933
- )) {
10934
- el.removeAttribute(key);
10935
- return true;
10936
10879
  }
10937
- return false;
10938
- }
10939
-
10940
- function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
10941
- if (key === "innerHTML" || key === "textContent") {
10942
- if (prevChildren) {
10943
- unmountChildren(prevChildren, parentComponent, parentSuspense);
10944
- }
10945
- el[key] = value == null ? "" : value;
10946
- return;
10947
- }
10948
- const tag = el.tagName;
10949
- if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
10950
- !tag.includes("-")) {
10951
- el._value = value;
10952
- const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
10953
- const newValue = value == null ? "" : value;
10954
- if (oldValue !== newValue) {
10955
- el.value = newValue;
10956
- }
10957
- if (value == null) {
10958
- el.removeAttribute(key);
10959
- }
10960
- return;
10961
- }
10962
- let needRemove = false;
10963
- if (value === "" || value == null) {
10964
- const type = typeof el[key];
10965
- if (type === "boolean") {
10966
- value = includeBooleanAttr(value);
10967
- } else if (value == null && type === "string") {
10968
- value = "";
10969
- needRemove = true;
10970
- } else if (type === "number") {
10971
- value = 0;
10972
- needRemove = true;
10973
- }
10974
- } else {
10975
- if (value === false && compatUtils.isCompatEnabled(
10976
- "ATTR_FALSE_VALUE",
10977
- parentComponent
10978
- )) {
10979
- const type = typeof el[key];
10980
- if (type === "string" || type === "number") {
10981
- compatUtils.warnDeprecation(
10982
- "ATTR_FALSE_VALUE",
10983
- parentComponent,
10984
- key
10985
- );
10986
- value = type === "number" ? 0 : "";
10987
- needRemove = true;
10880
+ const durations = normalizeDuration(duration);
10881
+ const enterDuration = durations && durations[0];
10882
+ const leaveDuration = durations && durations[1];
10883
+ const {
10884
+ onBeforeEnter,
10885
+ onEnter,
10886
+ onEnterCancelled,
10887
+ onLeave,
10888
+ onLeaveCancelled,
10889
+ onBeforeAppear = onBeforeEnter,
10890
+ onAppear = onEnter,
10891
+ onAppearCancelled = onEnterCancelled
10892
+ } = baseProps;
10893
+ const finishEnter = (el, isAppear, done) => {
10894
+ removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
10895
+ removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
10896
+ done && done();
10897
+ };
10898
+ const finishLeave = (el, done) => {
10899
+ el._isLeaving = false;
10900
+ removeTransitionClass(el, leaveFromClass);
10901
+ removeTransitionClass(el, leaveToClass);
10902
+ removeTransitionClass(el, leaveActiveClass);
10903
+ done && done();
10904
+ };
10905
+ const makeEnterHook = (isAppear) => {
10906
+ return (el, done) => {
10907
+ const hook = isAppear ? onAppear : onEnter;
10908
+ const resolve = () => finishEnter(el, isAppear, done);
10909
+ callHook(hook, [el, resolve]);
10910
+ nextFrame(() => {
10911
+ removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
10912
+ if (legacyClassEnabled) {
10913
+ const legacyClass = isAppear ? legacyAppearFromClass : legacyEnterFromClass;
10914
+ if (legacyClass) {
10915
+ removeTransitionClass(el, legacyClass);
10916
+ }
10917
+ }
10918
+ addTransitionClass(el, isAppear ? appearToClass : enterToClass);
10919
+ if (!hasExplicitCallback(hook)) {
10920
+ whenTransitionEnds(el, type, enterDuration, resolve);
10921
+ }
10922
+ });
10923
+ };
10924
+ };
10925
+ return extend(baseProps, {
10926
+ onBeforeEnter(el) {
10927
+ callHook(onBeforeEnter, [el]);
10928
+ addTransitionClass(el, enterFromClass);
10929
+ if (legacyClassEnabled && legacyEnterFromClass) {
10930
+ addTransitionClass(el, legacyEnterFromClass);
10988
10931
  }
10932
+ addTransitionClass(el, enterActiveClass);
10933
+ },
10934
+ onBeforeAppear(el) {
10935
+ callHook(onBeforeAppear, [el]);
10936
+ addTransitionClass(el, appearFromClass);
10937
+ if (legacyClassEnabled && legacyAppearFromClass) {
10938
+ addTransitionClass(el, legacyAppearFromClass);
10939
+ }
10940
+ addTransitionClass(el, appearActiveClass);
10941
+ },
10942
+ onEnter: makeEnterHook(false),
10943
+ onAppear: makeEnterHook(true),
10944
+ onLeave(el, done) {
10945
+ el._isLeaving = true;
10946
+ const resolve = () => finishLeave(el, done);
10947
+ addTransitionClass(el, leaveFromClass);
10948
+ if (legacyClassEnabled && legacyLeaveFromClass) {
10949
+ addTransitionClass(el, legacyLeaveFromClass);
10950
+ }
10951
+ forceReflow();
10952
+ addTransitionClass(el, leaveActiveClass);
10953
+ nextFrame(() => {
10954
+ if (!el._isLeaving) {
10955
+ return;
10956
+ }
10957
+ removeTransitionClass(el, leaveFromClass);
10958
+ if (legacyClassEnabled && legacyLeaveFromClass) {
10959
+ removeTransitionClass(el, legacyLeaveFromClass);
10960
+ }
10961
+ addTransitionClass(el, leaveToClass);
10962
+ if (!hasExplicitCallback(onLeave)) {
10963
+ whenTransitionEnds(el, type, leaveDuration, resolve);
10964
+ }
10965
+ });
10966
+ callHook(onLeave, [el, resolve]);
10967
+ },
10968
+ onEnterCancelled(el) {
10969
+ finishEnter(el, false);
10970
+ callHook(onEnterCancelled, [el]);
10971
+ },
10972
+ onAppearCancelled(el) {
10973
+ finishEnter(el, true);
10974
+ callHook(onAppearCancelled, [el]);
10975
+ },
10976
+ onLeaveCancelled(el) {
10977
+ finishLeave(el);
10978
+ callHook(onLeaveCancelled, [el]);
10989
10979
  }
10980
+ });
10981
+ }
10982
+ function normalizeDuration(duration) {
10983
+ if (duration == null) {
10984
+ return null;
10985
+ } else if (isObject(duration)) {
10986
+ return [NumberOf(duration.enter), NumberOf(duration.leave)];
10987
+ } else {
10988
+ const n = NumberOf(duration);
10989
+ return [n, n];
10990
10990
  }
10991
- try {
10992
- el[key] = value;
10993
- } catch (e) {
10994
- if (!needRemove) {
10995
- warn(
10996
- `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
10997
- e
10998
- );
10999
- }
11000
- }
11001
- needRemove && el.removeAttribute(key);
11002
10991
  }
11003
-
11004
- function addEventListener(el, event, handler, options) {
11005
- el.addEventListener(event, handler, options);
10992
+ function NumberOf(val) {
10993
+ const res = toNumber(val);
10994
+ {
10995
+ assertNumber(res, "<transition> explicit duration");
10996
+ }
10997
+ return res;
11006
10998
  }
11007
- function removeEventListener(el, event, handler, options) {
11008
- el.removeEventListener(event, handler, options);
10999
+ function addTransitionClass(el, cls) {
11000
+ cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
11001
+ (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
11009
11002
  }
11010
- function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
11011
- const invokers = el._vei || (el._vei = {});
11012
- const existingInvoker = invokers[rawName];
11013
- if (nextValue && existingInvoker) {
11014
- existingInvoker.value = nextValue;
11015
- } else {
11016
- const [name, options] = parseName(rawName);
11017
- if (nextValue) {
11018
- const invoker = invokers[rawName] = createInvoker(nextValue, instance);
11019
- addEventListener(el, name, invoker, options);
11020
- } else if (existingInvoker) {
11021
- removeEventListener(el, name, existingInvoker, options);
11022
- invokers[rawName] = void 0;
11003
+ function removeTransitionClass(el, cls) {
11004
+ cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
11005
+ const _vtc = el[vtcKey];
11006
+ if (_vtc) {
11007
+ _vtc.delete(cls);
11008
+ if (!_vtc.size) {
11009
+ el[vtcKey] = void 0;
11023
11010
  }
11024
11011
  }
11025
11012
  }
11026
- const optionsModifierRE = /(?:Once|Passive|Capture)$/;
11027
- function parseName(name) {
11028
- let options;
11029
- if (optionsModifierRE.test(name)) {
11030
- options = {};
11031
- let m;
11032
- while (m = name.match(optionsModifierRE)) {
11033
- name = name.slice(0, name.length - m[0].length);
11034
- options[m[0].toLowerCase()] = true;
11013
+ function nextFrame(cb) {
11014
+ requestAnimationFrame(() => {
11015
+ requestAnimationFrame(cb);
11016
+ });
11017
+ }
11018
+ let endId = 0;
11019
+ function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
11020
+ const id = el._endId = ++endId;
11021
+ const resolveIfNotStale = () => {
11022
+ if (id === el._endId) {
11023
+ resolve();
11035
11024
  }
11025
+ };
11026
+ if (explicitTimeout) {
11027
+ return setTimeout(resolveIfNotStale, explicitTimeout);
11036
11028
  }
11037
- const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
11038
- return [event, options];
11039
- }
11040
- let cachedNow = 0;
11041
- const p = /* @__PURE__ */ Promise.resolve();
11042
- const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
11043
- function createInvoker(initialValue, instance) {
11044
- const invoker = (e) => {
11045
- if (!e._vts) {
11046
- e._vts = Date.now();
11047
- } else if (e._vts <= invoker.attached) {
11048
- return;
11029
+ const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
11030
+ if (!type) {
11031
+ return resolve();
11032
+ }
11033
+ const endEvent = type + "end";
11034
+ let ended = 0;
11035
+ const end = () => {
11036
+ el.removeEventListener(endEvent, onEnd);
11037
+ resolveIfNotStale();
11038
+ };
11039
+ const onEnd = (e) => {
11040
+ if (e.target === el && ++ended >= propCount) {
11041
+ end();
11049
11042
  }
11050
- callWithAsyncErrorHandling(
11051
- patchStopImmediatePropagation(e, invoker.value),
11052
- instance,
11053
- 5,
11054
- [e]
11055
- );
11056
11043
  };
11057
- invoker.value = initialValue;
11058
- invoker.attached = getNow();
11059
- return invoker;
11044
+ setTimeout(() => {
11045
+ if (ended < propCount) {
11046
+ end();
11047
+ }
11048
+ }, timeout + 1);
11049
+ el.addEventListener(endEvent, onEnd);
11060
11050
  }
11061
- function patchStopImmediatePropagation(e, value) {
11062
- if (isArray(value)) {
11063
- const originalStop = e.stopImmediatePropagation;
11064
- e.stopImmediatePropagation = () => {
11065
- originalStop.call(e);
11066
- e._stopped = true;
11067
- };
11068
- return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
11051
+ function getTransitionInfo(el, expectedType) {
11052
+ const styles = window.getComputedStyle(el);
11053
+ const getStyleProperties = (key) => (styles[key] || "").split(", ");
11054
+ const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
11055
+ const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
11056
+ const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
11057
+ const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
11058
+ const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
11059
+ const animationTimeout = getTimeout(animationDelays, animationDurations);
11060
+ let type = null;
11061
+ let timeout = 0;
11062
+ let propCount = 0;
11063
+ if (expectedType === TRANSITION) {
11064
+ if (transitionTimeout > 0) {
11065
+ type = TRANSITION;
11066
+ timeout = transitionTimeout;
11067
+ propCount = transitionDurations.length;
11068
+ }
11069
+ } else if (expectedType === ANIMATION) {
11070
+ if (animationTimeout > 0) {
11071
+ type = ANIMATION;
11072
+ timeout = animationTimeout;
11073
+ propCount = animationDurations.length;
11074
+ }
11069
11075
  } else {
11070
- return value;
11076
+ timeout = Math.max(transitionTimeout, animationTimeout);
11077
+ type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
11078
+ propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
11079
+ }
11080
+ const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
11081
+ getStyleProperties(`${TRANSITION}Property`).toString()
11082
+ );
11083
+ return {
11084
+ type,
11085
+ timeout,
11086
+ propCount,
11087
+ hasTransform
11088
+ };
11089
+ }
11090
+ function getTimeout(delays, durations) {
11091
+ while (delays.length < durations.length) {
11092
+ delays = delays.concat(delays);
11071
11093
  }
11094
+ return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
11095
+ }
11096
+ function toMs(s) {
11097
+ if (s === "auto")
11098
+ return 0;
11099
+ return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
11100
+ }
11101
+ function forceReflow() {
11102
+ return document.body.offsetHeight;
11072
11103
  }
11073
11104
 
11074
- const nativeOnRE = /^on[a-z]/;
11075
- const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11076
- if (key === "class") {
11077
- patchClass(el, nextValue, isSVG);
11078
- } else if (key === "style") {
11079
- patchStyle(el, prevValue, nextValue);
11080
- } else if (isOn(key)) {
11081
- if (!isModelListener(key)) {
11082
- patchEvent(el, key, prevValue, nextValue, parentComponent);
11083
- }
11084
- } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
11085
- patchDOMProp(
11086
- el,
11087
- key,
11088
- nextValue,
11089
- prevChildren,
11090
- parentComponent,
11091
- parentSuspense,
11092
- unmountChildren
11093
- );
11105
+ function patchClass(el, value, isSVG) {
11106
+ const transitionClasses = el[vtcKey];
11107
+ if (transitionClasses) {
11108
+ value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
11109
+ }
11110
+ if (value == null) {
11111
+ el.removeAttribute("class");
11112
+ } else if (isSVG) {
11113
+ el.setAttribute("class", value);
11094
11114
  } else {
11095
- if (key === "true-value") {
11096
- el._trueValue = nextValue;
11097
- } else if (key === "false-value") {
11098
- el._falseValue = nextValue;
11099
- }
11100
- patchAttr(el, key, nextValue, isSVG, parentComponent);
11115
+ el.className = value;
11101
11116
  }
11102
- };
11103
- function shouldSetAsProp(el, key, value, isSVG) {
11104
- if (isSVG) {
11105
- if (key === "innerHTML" || key === "textContent") {
11106
- return true;
11117
+ }
11118
+
11119
+ const vShowOldKey = Symbol("_vod");
11120
+ const vShow = {
11121
+ beforeMount(el, { value }, { transition }) {
11122
+ el[vShowOldKey] = el.style.display === "none" ? "" : el.style.display;
11123
+ if (transition && value) {
11124
+ transition.beforeEnter(el);
11125
+ } else {
11126
+ setDisplay(el, value);
11107
11127
  }
11108
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
11109
- return true;
11128
+ },
11129
+ mounted(el, { value }, { transition }) {
11130
+ if (transition && value) {
11131
+ transition.enter(el);
11110
11132
  }
11111
- return false;
11112
- }
11113
- if (key === "spellcheck" || key === "draggable" || key === "translate") {
11114
- return false;
11115
- }
11116
- if (key === "form") {
11117
- return false;
11118
- }
11119
- if (key === "list" && el.tagName === "INPUT") {
11120
- return false;
11121
- }
11122
- if (key === "type" && el.tagName === "TEXTAREA") {
11123
- return false;
11124
- }
11125
- if (nativeOnRE.test(key) && isString(value)) {
11126
- return false;
11133
+ },
11134
+ updated(el, { value, oldValue }, { transition }) {
11135
+ if (!value === !oldValue)
11136
+ return;
11137
+ if (transition) {
11138
+ if (value) {
11139
+ transition.beforeEnter(el);
11140
+ setDisplay(el, true);
11141
+ transition.enter(el);
11142
+ } else {
11143
+ transition.leave(el, () => {
11144
+ setDisplay(el, false);
11145
+ });
11146
+ }
11147
+ } else {
11148
+ setDisplay(el, value);
11149
+ }
11150
+ },
11151
+ beforeUnmount(el, { value }) {
11152
+ setDisplay(el, value);
11127
11153
  }
11128
- return key in el;
11154
+ };
11155
+ function setDisplay(el, value) {
11156
+ el.style.display = value ? el[vShowOldKey] : "none";
11129
11157
  }
11130
11158
 
11131
- function defineCustomElement(options, hydrate2) {
11132
- const Comp = defineComponent(options);
11133
- class VueCustomElement extends VueElement {
11134
- constructor(initialProps) {
11135
- super(Comp, initialProps, hydrate2);
11159
+ function patchStyle(el, prev, next) {
11160
+ const style = el.style;
11161
+ const isCssString = isString(next);
11162
+ if (next && !isCssString) {
11163
+ if (prev && !isString(prev)) {
11164
+ for (const key in prev) {
11165
+ if (next[key] == null) {
11166
+ setStyle(style, key, "");
11167
+ }
11168
+ }
11169
+ }
11170
+ for (const key in next) {
11171
+ setStyle(style, key, next[key]);
11172
+ }
11173
+ } else {
11174
+ const currentDisplay = style.display;
11175
+ if (isCssString) {
11176
+ if (prev !== next) {
11177
+ style.cssText = next;
11178
+ }
11179
+ } else if (prev) {
11180
+ el.removeAttribute("style");
11181
+ }
11182
+ if (vShowOldKey in el) {
11183
+ style.display = currentDisplay;
11136
11184
  }
11137
11185
  }
11138
- VueCustomElement.def = Comp;
11139
- return VueCustomElement;
11140
11186
  }
11141
- const defineSSRCustomElement = (options) => {
11142
- return defineCustomElement(options, hydrate);
11143
- };
11144
- const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
11145
- };
11146
- class VueElement extends BaseClass {
11147
- constructor(_def, _props = {}, hydrate2) {
11148
- super();
11149
- this._def = _def;
11150
- this._props = _props;
11151
- /**
11152
- * @internal
11153
- */
11154
- this._instance = null;
11155
- this._connected = false;
11156
- this._resolved = false;
11157
- this._numberProps = null;
11158
- if (this.shadowRoot && hydrate2) {
11159
- hydrate2(this._createVNode(), this.shadowRoot);
11160
- } else {
11161
- if (this.shadowRoot) {
11187
+ const semicolonRE = /[^\\];\s*$/;
11188
+ const importantRE = /\s*!important$/;
11189
+ function setStyle(style, name, val) {
11190
+ if (isArray(val)) {
11191
+ val.forEach((v) => setStyle(style, name, v));
11192
+ } else {
11193
+ if (val == null)
11194
+ val = "";
11195
+ {
11196
+ if (semicolonRE.test(val)) {
11162
11197
  warn(
11163
- `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
11198
+ `Unexpected semicolon at the end of '${name}' style value: '${val}'`
11164
11199
  );
11165
11200
  }
11166
- this.attachShadow({ mode: "open" });
11167
- if (!this._def.__asyncLoader) {
11168
- this._resolveProps(this._def);
11169
- }
11170
11201
  }
11171
- }
11172
- connectedCallback() {
11173
- this._connected = true;
11174
- if (!this._instance) {
11175
- if (this._resolved) {
11176
- this._update();
11202
+ if (name.startsWith("--")) {
11203
+ style.setProperty(name, val);
11204
+ } else {
11205
+ const prefixed = autoPrefix(style, name);
11206
+ if (importantRE.test(val)) {
11207
+ style.setProperty(
11208
+ hyphenate(prefixed),
11209
+ val.replace(importantRE, ""),
11210
+ "important"
11211
+ );
11177
11212
  } else {
11178
- this._resolveDef();
11213
+ style[prefixed] = val;
11179
11214
  }
11180
11215
  }
11181
11216
  }
11182
- disconnectedCallback() {
11183
- this._connected = false;
11184
- nextTick(() => {
11185
- if (!this._connected) {
11186
- render(null, this.shadowRoot);
11187
- this._instance = null;
11188
- }
11189
- });
11217
+ }
11218
+ const prefixes = ["Webkit", "Moz", "ms"];
11219
+ const prefixCache = {};
11220
+ function autoPrefix(style, rawName) {
11221
+ const cached = prefixCache[rawName];
11222
+ if (cached) {
11223
+ return cached;
11190
11224
  }
11191
- /**
11192
- * resolve inner component definition (handle possible async component)
11193
- */
11194
- _resolveDef() {
11195
- this._resolved = true;
11196
- for (let i = 0; i < this.attributes.length; i++) {
11197
- this._setAttr(this.attributes[i].name);
11225
+ let name = camelize(rawName);
11226
+ if (name !== "filter" && name in style) {
11227
+ return prefixCache[rawName] = name;
11228
+ }
11229
+ name = capitalize(name);
11230
+ for (let i = 0; i < prefixes.length; i++) {
11231
+ const prefixed = prefixes[i] + name;
11232
+ if (prefixed in style) {
11233
+ return prefixCache[rawName] = prefixed;
11198
11234
  }
11199
- new MutationObserver((mutations) => {
11200
- for (const m of mutations) {
11201
- this._setAttr(m.attributeName);
11202
- }
11203
- }).observe(this, { attributes: true });
11204
- const resolve = (def, isAsync = false) => {
11205
- const { props, styles } = def;
11206
- let numberProps;
11207
- if (props && !isArray(props)) {
11208
- for (const key in props) {
11209
- const opt = props[key];
11210
- if (opt === Number || opt && opt.type === Number) {
11211
- if (key in this._props) {
11212
- this._props[key] = toNumber(this._props[key]);
11213
- }
11214
- (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
11215
- }
11216
- }
11217
- }
11218
- this._numberProps = numberProps;
11219
- if (isAsync) {
11220
- this._resolveProps(def);
11221
- }
11222
- this._applyStyles(styles);
11223
- this._update();
11224
- };
11225
- const asyncDef = this._def.__asyncLoader;
11226
- if (asyncDef) {
11227
- asyncDef().then((def) => resolve(def, true));
11235
+ }
11236
+ return rawName;
11237
+ }
11238
+
11239
+ const xlinkNS = "http://www.w3.org/1999/xlink";
11240
+ function patchAttr(el, key, value, isSVG, instance) {
11241
+ if (isSVG && key.startsWith("xlink:")) {
11242
+ if (value == null) {
11243
+ el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
11228
11244
  } else {
11229
- resolve(this._def);
11245
+ el.setAttributeNS(xlinkNS, key, value);
11230
11246
  }
11231
- }
11232
- _resolveProps(def) {
11233
- const { props } = def;
11234
- const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
11235
- for (const key of Object.keys(this)) {
11236
- if (key[0] !== "_" && declaredPropKeys.includes(key)) {
11237
- this._setProp(key, this[key], true, false);
11238
- }
11247
+ } else {
11248
+ if (compatCoerceAttr(el, key, value, instance)) {
11249
+ return;
11239
11250
  }
11240
- for (const key of declaredPropKeys.map(camelize)) {
11241
- Object.defineProperty(this, key, {
11242
- get() {
11243
- return this._getProp(key);
11244
- },
11245
- set(val) {
11246
- this._setProp(key, val);
11247
- }
11248
- });
11251
+ const isBoolean = isSpecialBooleanAttr(key);
11252
+ if (value == null || isBoolean && !includeBooleanAttr(value)) {
11253
+ el.removeAttribute(key);
11254
+ } else {
11255
+ el.setAttribute(key, isBoolean ? "" : value);
11249
11256
  }
11250
11257
  }
11251
- _setAttr(key) {
11252
- let value = this.getAttribute(key);
11253
- const camelKey = camelize(key);
11254
- if (this._numberProps && this._numberProps[camelKey]) {
11255
- value = toNumber(value);
11258
+ }
11259
+ const isEnumeratedAttr = /* @__PURE__ */ makeMap("contenteditable,draggable,spellcheck") ;
11260
+ function compatCoerceAttr(el, key, value, instance = null) {
11261
+ if (isEnumeratedAttr(key)) {
11262
+ const v2CoercedValue = value === null ? "false" : typeof value !== "boolean" && value !== void 0 ? "true" : null;
11263
+ if (v2CoercedValue && compatUtils.softAssertCompatEnabled(
11264
+ "ATTR_ENUMERATED_COERCION",
11265
+ instance,
11266
+ key,
11267
+ value,
11268
+ v2CoercedValue
11269
+ )) {
11270
+ el.setAttribute(key, v2CoercedValue);
11271
+ return true;
11256
11272
  }
11257
- this._setProp(camelKey, value, false);
11258
- }
11259
- /**
11260
- * @internal
11261
- */
11262
- _getProp(key) {
11263
- return this._props[key];
11273
+ } else if (value === false && !isSpecialBooleanAttr(key) && compatUtils.softAssertCompatEnabled(
11274
+ "ATTR_FALSE_VALUE",
11275
+ instance,
11276
+ key
11277
+ )) {
11278
+ el.removeAttribute(key);
11279
+ return true;
11264
11280
  }
11265
- /**
11266
- * @internal
11267
- */
11268
- _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
11269
- if (val !== this._props[key]) {
11270
- this._props[key] = val;
11271
- if (shouldUpdate && this._instance) {
11272
- this._update();
11273
- }
11274
- if (shouldReflect) {
11275
- if (val === true) {
11276
- this.setAttribute(hyphenate(key), "");
11277
- } else if (typeof val === "string" || typeof val === "number") {
11278
- this.setAttribute(hyphenate(key), val + "");
11279
- } else if (!val) {
11280
- this.removeAttribute(hyphenate(key));
11281
- }
11282
- }
11281
+ return false;
11282
+ }
11283
+
11284
+ function patchDOMProp(el, key, value, prevChildren, parentComponent, parentSuspense, unmountChildren) {
11285
+ if (key === "innerHTML" || key === "textContent") {
11286
+ if (prevChildren) {
11287
+ unmountChildren(prevChildren, parentComponent, parentSuspense);
11283
11288
  }
11289
+ el[key] = value == null ? "" : value;
11290
+ return;
11284
11291
  }
11285
- _update() {
11286
- render(this._createVNode(), this.shadowRoot);
11287
- }
11288
- _createVNode() {
11289
- const vnode = createVNode(this._def, extend({}, this._props));
11290
- if (!this._instance) {
11291
- vnode.ce = (instance) => {
11292
- this._instance = instance;
11293
- instance.isCE = true;
11294
- {
11295
- instance.ceReload = (newStyles) => {
11296
- if (this._styles) {
11297
- this._styles.forEach((s) => this.shadowRoot.removeChild(s));
11298
- this._styles.length = 0;
11299
- }
11300
- this._applyStyles(newStyles);
11301
- this._instance = null;
11302
- this._update();
11303
- };
11304
- }
11305
- const dispatch = (event, args) => {
11306
- this.dispatchEvent(
11307
- new CustomEvent(event, {
11308
- detail: args
11309
- })
11310
- );
11311
- };
11312
- instance.emit = (event, ...args) => {
11313
- dispatch(event, args);
11314
- if (hyphenate(event) !== event) {
11315
- dispatch(hyphenate(event), args);
11316
- }
11317
- };
11318
- let parent = this;
11319
- while (parent = parent && (parent.parentNode || parent.host)) {
11320
- if (parent instanceof VueElement) {
11321
- instance.parent = parent._instance;
11322
- instance.provides = parent._instance.provides;
11323
- break;
11324
- }
11325
- }
11326
- };
11292
+ const tag = el.tagName;
11293
+ if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
11294
+ !tag.includes("-")) {
11295
+ el._value = value;
11296
+ const oldValue = tag === "OPTION" ? el.getAttribute("value") : el.value;
11297
+ const newValue = value == null ? "" : value;
11298
+ if (oldValue !== newValue) {
11299
+ el.value = newValue;
11327
11300
  }
11328
- return vnode;
11329
- }
11330
- _applyStyles(styles) {
11331
- if (styles) {
11332
- styles.forEach((css) => {
11333
- const s = document.createElement("style");
11334
- s.textContent = css;
11335
- this.shadowRoot.appendChild(s);
11336
- {
11337
- (this._styles || (this._styles = [])).push(s);
11338
- }
11339
- });
11301
+ if (value == null) {
11302
+ el.removeAttribute(key);
11340
11303
  }
11304
+ return;
11341
11305
  }
11342
- }
11343
-
11344
- function useCssModule(name = "$style") {
11345
- {
11346
- const instance = getCurrentInstance();
11347
- if (!instance) {
11348
- warn(`useCssModule must be called inside setup()`);
11349
- return EMPTY_OBJ;
11306
+ let needRemove = false;
11307
+ if (value === "" || value == null) {
11308
+ const type = typeof el[key];
11309
+ if (type === "boolean") {
11310
+ value = includeBooleanAttr(value);
11311
+ } else if (value == null && type === "string") {
11312
+ value = "";
11313
+ needRemove = true;
11314
+ } else if (type === "number") {
11315
+ value = 0;
11316
+ needRemove = true;
11350
11317
  }
11351
- const modules = instance.type.__cssModules;
11352
- if (!modules) {
11353
- warn(`Current instance does not have CSS modules injected.`);
11354
- return EMPTY_OBJ;
11318
+ } else {
11319
+ if (value === false && compatUtils.isCompatEnabled(
11320
+ "ATTR_FALSE_VALUE",
11321
+ parentComponent
11322
+ )) {
11323
+ const type = typeof el[key];
11324
+ if (type === "string" || type === "number") {
11325
+ compatUtils.warnDeprecation(
11326
+ "ATTR_FALSE_VALUE",
11327
+ parentComponent,
11328
+ key
11329
+ );
11330
+ value = type === "number" ? 0 : "";
11331
+ needRemove = true;
11332
+ }
11355
11333
  }
11356
- const mod = modules[name];
11357
- if (!mod) {
11358
- warn(`Current instance does not have CSS module named "${name}".`);
11359
- return EMPTY_OBJ;
11334
+ }
11335
+ try {
11336
+ el[key] = value;
11337
+ } catch (e) {
11338
+ if (!needRemove) {
11339
+ warn(
11340
+ `Failed setting prop "${key}" on <${tag.toLowerCase()}>: value ${value} is invalid.`,
11341
+ e
11342
+ );
11360
11343
  }
11361
- return mod;
11362
11344
  }
11345
+ needRemove && el.removeAttribute(key);
11363
11346
  }
11364
11347
 
11365
- function useCssVars(getter) {
11366
- const instance = getCurrentInstance();
11367
- if (!instance) {
11368
- warn(`useCssVars is called without current active component instance.`);
11369
- return;
11370
- }
11371
- const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
11372
- Array.from(
11373
- document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
11374
- ).forEach((node) => setVarsOnNode(node, vars));
11375
- };
11376
- const setVars = () => {
11377
- const vars = getter(instance.proxy);
11378
- setVarsOnVNode(instance.subTree, vars);
11379
- updateTeleports(vars);
11380
- };
11381
- watchPostEffect(setVars);
11382
- onMounted(() => {
11383
- const ob = new MutationObserver(setVars);
11384
- ob.observe(instance.subTree.el.parentNode, { childList: true });
11385
- onUnmounted(() => ob.disconnect());
11386
- });
11348
+ function addEventListener(el, event, handler, options) {
11349
+ el.addEventListener(event, handler, options);
11387
11350
  }
11388
- function setVarsOnVNode(vnode, vars) {
11389
- if (vnode.shapeFlag & 128) {
11390
- const suspense = vnode.suspense;
11391
- vnode = suspense.activeBranch;
11392
- if (suspense.pendingBranch && !suspense.isHydrating) {
11393
- suspense.effects.push(() => {
11394
- setVarsOnVNode(suspense.activeBranch, vars);
11395
- });
11351
+ function removeEventListener(el, event, handler, options) {
11352
+ el.removeEventListener(event, handler, options);
11353
+ }
11354
+ const veiKey = Symbol("_vei");
11355
+ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
11356
+ const invokers = el[veiKey] || (el[veiKey] = {});
11357
+ const existingInvoker = invokers[rawName];
11358
+ if (nextValue && existingInvoker) {
11359
+ existingInvoker.value = nextValue;
11360
+ } else {
11361
+ const [name, options] = parseName(rawName);
11362
+ if (nextValue) {
11363
+ const invoker = invokers[rawName] = createInvoker(nextValue, instance);
11364
+ addEventListener(el, name, invoker, options);
11365
+ } else if (existingInvoker) {
11366
+ removeEventListener(el, name, existingInvoker, options);
11367
+ invokers[rawName] = void 0;
11396
11368
  }
11397
11369
  }
11398
- while (vnode.component) {
11399
- vnode = vnode.component.subTree;
11400
- }
11401
- if (vnode.shapeFlag & 1 && vnode.el) {
11402
- setVarsOnNode(vnode.el, vars);
11403
- } else if (vnode.type === Fragment) {
11404
- vnode.children.forEach((c) => setVarsOnVNode(c, vars));
11405
- } else if (vnode.type === Static) {
11406
- let { el, anchor } = vnode;
11407
- while (el) {
11408
- setVarsOnNode(el, vars);
11409
- if (el === anchor)
11410
- break;
11411
- el = el.nextSibling;
11370
+ }
11371
+ const optionsModifierRE = /(?:Once|Passive|Capture)$/;
11372
+ function parseName(name) {
11373
+ let options;
11374
+ if (optionsModifierRE.test(name)) {
11375
+ options = {};
11376
+ let m;
11377
+ while (m = name.match(optionsModifierRE)) {
11378
+ name = name.slice(0, name.length - m[0].length);
11379
+ options[m[0].toLowerCase()] = true;
11412
11380
  }
11413
11381
  }
11382
+ const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
11383
+ return [event, options];
11414
11384
  }
11415
- function setVarsOnNode(el, vars) {
11416
- if (el.nodeType === 1) {
11417
- const style = el.style;
11418
- for (const key in vars) {
11419
- style.setProperty(`--${key}`, vars[key]);
11385
+ let cachedNow = 0;
11386
+ const p = /* @__PURE__ */ Promise.resolve();
11387
+ const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now());
11388
+ function createInvoker(initialValue, instance) {
11389
+ const invoker = (e) => {
11390
+ if (!e._vts) {
11391
+ e._vts = Date.now();
11392
+ } else if (e._vts <= invoker.attached) {
11393
+ return;
11420
11394
  }
11395
+ callWithAsyncErrorHandling(
11396
+ patchStopImmediatePropagation(e, invoker.value),
11397
+ instance,
11398
+ 5,
11399
+ [e]
11400
+ );
11401
+ };
11402
+ invoker.value = initialValue;
11403
+ invoker.attached = getNow();
11404
+ return invoker;
11405
+ }
11406
+ function patchStopImmediatePropagation(e, value) {
11407
+ if (isArray(value)) {
11408
+ const originalStop = e.stopImmediatePropagation;
11409
+ e.stopImmediatePropagation = () => {
11410
+ originalStop.call(e);
11411
+ e._stopped = true;
11412
+ };
11413
+ return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
11414
+ } else {
11415
+ return value;
11421
11416
  }
11422
11417
  }
11423
11418
 
11424
- const TRANSITION = "transition";
11425
- const ANIMATION = "animation";
11426
- const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
11427
- Transition.displayName = "Transition";
11428
- {
11429
- Transition.__isBuiltIn = true;
11430
- }
11431
- const DOMTransitionPropsValidators = {
11432
- name: String,
11433
- type: String,
11434
- css: {
11435
- type: Boolean,
11436
- default: true
11437
- },
11438
- duration: [String, Number, Object],
11439
- enterFromClass: String,
11440
- enterActiveClass: String,
11441
- enterToClass: String,
11442
- appearFromClass: String,
11443
- appearActiveClass: String,
11444
- appearToClass: String,
11445
- leaveFromClass: String,
11446
- leaveActiveClass: String,
11447
- leaveToClass: String
11448
- };
11449
- const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
11450
- {},
11451
- BaseTransitionPropsValidators,
11452
- DOMTransitionPropsValidators
11453
- );
11454
- const callHook = (hook, args = []) => {
11455
- if (isArray(hook)) {
11456
- hook.forEach((h2) => h2(...args));
11457
- } else if (hook) {
11458
- hook(...args);
11419
+ const nativeOnRE = /^on[a-z]/;
11420
+ const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11421
+ if (key === "class") {
11422
+ patchClass(el, nextValue, isSVG);
11423
+ } else if (key === "style") {
11424
+ patchStyle(el, prevValue, nextValue);
11425
+ } else if (isOn(key)) {
11426
+ if (!isModelListener(key)) {
11427
+ patchEvent(el, key, prevValue, nextValue, parentComponent);
11428
+ }
11429
+ } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) {
11430
+ patchDOMProp(
11431
+ el,
11432
+ key,
11433
+ nextValue,
11434
+ prevChildren,
11435
+ parentComponent,
11436
+ parentSuspense,
11437
+ unmountChildren
11438
+ );
11439
+ } else {
11440
+ if (key === "true-value") {
11441
+ el._trueValue = nextValue;
11442
+ } else if (key === "false-value") {
11443
+ el._falseValue = nextValue;
11444
+ }
11445
+ patchAttr(el, key, nextValue, isSVG, parentComponent);
11459
11446
  }
11460
11447
  };
11461
- const hasExplicitCallback = (hook) => {
11462
- return hook ? isArray(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
11463
- };
11464
- function resolveTransitionProps(rawProps) {
11465
- const baseProps = {};
11466
- for (const key in rawProps) {
11467
- if (!(key in DOMTransitionPropsValidators)) {
11468
- baseProps[key] = rawProps[key];
11448
+ function shouldSetAsProp(el, key, value, isSVG) {
11449
+ if (isSVG) {
11450
+ if (key === "innerHTML" || key === "textContent") {
11451
+ return true;
11452
+ }
11453
+ if (key in el && nativeOnRE.test(key) && isFunction(value)) {
11454
+ return true;
11469
11455
  }
11456
+ return false;
11470
11457
  }
11471
- if (rawProps.css === false) {
11472
- return baseProps;
11458
+ if (key === "spellcheck" || key === "draggable" || key === "translate") {
11459
+ return false;
11473
11460
  }
11474
- const {
11475
- name = "v",
11476
- type,
11477
- duration,
11478
- enterFromClass = `${name}-enter-from`,
11479
- enterActiveClass = `${name}-enter-active`,
11480
- enterToClass = `${name}-enter-to`,
11481
- appearFromClass = enterFromClass,
11482
- appearActiveClass = enterActiveClass,
11483
- appearToClass = enterToClass,
11484
- leaveFromClass = `${name}-leave-from`,
11485
- leaveActiveClass = `${name}-leave-active`,
11486
- leaveToClass = `${name}-leave-to`
11487
- } = rawProps;
11488
- const legacyClassEnabled = compatUtils.isCompatEnabled("TRANSITION_CLASSES", null);
11489
- let legacyEnterFromClass;
11490
- let legacyAppearFromClass;
11491
- let legacyLeaveFromClass;
11492
- if (legacyClassEnabled) {
11493
- const toLegacyClass = (cls) => cls.replace(/-from$/, "");
11494
- if (!rawProps.enterFromClass) {
11495
- legacyEnterFromClass = toLegacyClass(enterFromClass);
11461
+ if (key === "form") {
11462
+ return false;
11463
+ }
11464
+ if (key === "list" && el.tagName === "INPUT") {
11465
+ return false;
11466
+ }
11467
+ if (key === "type" && el.tagName === "TEXTAREA") {
11468
+ return false;
11469
+ }
11470
+ if (nativeOnRE.test(key) && isString(value)) {
11471
+ return false;
11472
+ }
11473
+ return key in el;
11474
+ }
11475
+
11476
+ /*! #__NO_SIDE_EFFECTS__ */
11477
+ // @__NO_SIDE_EFFECTS__
11478
+ function defineCustomElement(options, hydrate2) {
11479
+ const Comp = defineComponent(options);
11480
+ class VueCustomElement extends VueElement {
11481
+ constructor(initialProps) {
11482
+ super(Comp, initialProps, hydrate2);
11496
11483
  }
11497
- if (!rawProps.appearFromClass) {
11498
- legacyAppearFromClass = toLegacyClass(appearFromClass);
11484
+ }
11485
+ VueCustomElement.def = Comp;
11486
+ return VueCustomElement;
11487
+ }
11488
+ /*! #__NO_SIDE_EFFECTS__ */
11489
+ const defineSSRCustomElement = /* @__NO_SIDE_EFFECTS__ */ (options) => {
11490
+ return /* @__PURE__ */ defineCustomElement(options, hydrate);
11491
+ };
11492
+ const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
11493
+ };
11494
+ class VueElement extends BaseClass {
11495
+ constructor(_def, _props = {}, hydrate2) {
11496
+ super();
11497
+ this._def = _def;
11498
+ this._props = _props;
11499
+ /**
11500
+ * @internal
11501
+ */
11502
+ this._instance = null;
11503
+ this._connected = false;
11504
+ this._resolved = false;
11505
+ this._numberProps = null;
11506
+ this._ob = null;
11507
+ if (this.shadowRoot && hydrate2) {
11508
+ hydrate2(this._createVNode(), this.shadowRoot);
11509
+ } else {
11510
+ if (this.shadowRoot) {
11511
+ warn(
11512
+ `Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use \`defineSSRCustomElement\`.`
11513
+ );
11514
+ }
11515
+ this.attachShadow({ mode: "open" });
11516
+ if (!this._def.__asyncLoader) {
11517
+ this._resolveProps(this._def);
11518
+ }
11499
11519
  }
11500
- if (!rawProps.leaveFromClass) {
11501
- legacyLeaveFromClass = toLegacyClass(leaveFromClass);
11520
+ }
11521
+ connectedCallback() {
11522
+ this._connected = true;
11523
+ if (!this._instance) {
11524
+ if (this._resolved) {
11525
+ this._update();
11526
+ } else {
11527
+ this._resolveDef();
11528
+ }
11502
11529
  }
11503
11530
  }
11504
- const durations = normalizeDuration(duration);
11505
- const enterDuration = durations && durations[0];
11506
- const leaveDuration = durations && durations[1];
11507
- const {
11508
- onBeforeEnter,
11509
- onEnter,
11510
- onEnterCancelled,
11511
- onLeave,
11512
- onLeaveCancelled,
11513
- onBeforeAppear = onBeforeEnter,
11514
- onAppear = onEnter,
11515
- onAppearCancelled = onEnterCancelled
11516
- } = baseProps;
11517
- const finishEnter = (el, isAppear, done) => {
11518
- removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
11519
- removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
11520
- done && done();
11521
- };
11522
- const finishLeave = (el, done) => {
11523
- el._isLeaving = false;
11524
- removeTransitionClass(el, leaveFromClass);
11525
- removeTransitionClass(el, leaveToClass);
11526
- removeTransitionClass(el, leaveActiveClass);
11527
- done && done();
11528
- };
11529
- const makeEnterHook = (isAppear) => {
11530
- return (el, done) => {
11531
- const hook = isAppear ? onAppear : onEnter;
11532
- const resolve = () => finishEnter(el, isAppear, done);
11533
- callHook(hook, [el, resolve]);
11534
- nextFrame(() => {
11535
- removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
11536
- if (legacyClassEnabled) {
11537
- const legacyClass = isAppear ? legacyAppearFromClass : legacyEnterFromClass;
11538
- if (legacyClass) {
11539
- removeTransitionClass(el, legacyClass);
11531
+ disconnectedCallback() {
11532
+ this._connected = false;
11533
+ if (this._ob) {
11534
+ this._ob.disconnect();
11535
+ this._ob = null;
11536
+ }
11537
+ nextTick(() => {
11538
+ if (!this._connected) {
11539
+ render(null, this.shadowRoot);
11540
+ this._instance = null;
11541
+ }
11542
+ });
11543
+ }
11544
+ /**
11545
+ * resolve inner component definition (handle possible async component)
11546
+ */
11547
+ _resolveDef() {
11548
+ this._resolved = true;
11549
+ for (let i = 0; i < this.attributes.length; i++) {
11550
+ this._setAttr(this.attributes[i].name);
11551
+ }
11552
+ this._ob = new MutationObserver((mutations) => {
11553
+ for (const m of mutations) {
11554
+ this._setAttr(m.attributeName);
11555
+ }
11556
+ });
11557
+ this._ob.observe(this, { attributes: true });
11558
+ const resolve = (def, isAsync = false) => {
11559
+ const { props, styles } = def;
11560
+ let numberProps;
11561
+ if (props && !isArray(props)) {
11562
+ for (const key in props) {
11563
+ const opt = props[key];
11564
+ if (opt === Number || opt && opt.type === Number) {
11565
+ if (key in this._props) {
11566
+ this._props[key] = toNumber(this._props[key]);
11567
+ }
11568
+ (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
11540
11569
  }
11541
11570
  }
11542
- addTransitionClass(el, isAppear ? appearToClass : enterToClass);
11543
- if (!hasExplicitCallback(hook)) {
11544
- whenTransitionEnds(el, type, enterDuration, resolve);
11545
- }
11546
- });
11547
- };
11548
- };
11549
- return extend(baseProps, {
11550
- onBeforeEnter(el) {
11551
- callHook(onBeforeEnter, [el]);
11552
- addTransitionClass(el, enterFromClass);
11553
- if (legacyClassEnabled && legacyEnterFromClass) {
11554
- addTransitionClass(el, legacyEnterFromClass);
11555
11571
  }
11556
- addTransitionClass(el, enterActiveClass);
11557
- },
11558
- onBeforeAppear(el) {
11559
- callHook(onBeforeAppear, [el]);
11560
- addTransitionClass(el, appearFromClass);
11561
- if (legacyClassEnabled && legacyAppearFromClass) {
11562
- addTransitionClass(el, legacyAppearFromClass);
11572
+ this._numberProps = numberProps;
11573
+ if (isAsync) {
11574
+ this._resolveProps(def);
11563
11575
  }
11564
- addTransitionClass(el, appearActiveClass);
11565
- },
11566
- onEnter: makeEnterHook(false),
11567
- onAppear: makeEnterHook(true),
11568
- onLeave(el, done) {
11569
- el._isLeaving = true;
11570
- const resolve = () => finishLeave(el, done);
11571
- addTransitionClass(el, leaveFromClass);
11572
- if (legacyClassEnabled && legacyLeaveFromClass) {
11573
- addTransitionClass(el, legacyLeaveFromClass);
11576
+ this._applyStyles(styles);
11577
+ this._update();
11578
+ };
11579
+ const asyncDef = this._def.__asyncLoader;
11580
+ if (asyncDef) {
11581
+ asyncDef().then((def) => resolve(def, true));
11582
+ } else {
11583
+ resolve(this._def);
11584
+ }
11585
+ }
11586
+ _resolveProps(def) {
11587
+ const { props } = def;
11588
+ const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
11589
+ for (const key of Object.keys(this)) {
11590
+ if (key[0] !== "_" && declaredPropKeys.includes(key)) {
11591
+ this._setProp(key, this[key], true, false);
11574
11592
  }
11575
- forceReflow();
11576
- addTransitionClass(el, leaveActiveClass);
11577
- nextFrame(() => {
11578
- if (!el._isLeaving) {
11579
- return;
11593
+ }
11594
+ for (const key of declaredPropKeys.map(camelize)) {
11595
+ Object.defineProperty(this, key, {
11596
+ get() {
11597
+ return this._getProp(key);
11598
+ },
11599
+ set(val) {
11600
+ this._setProp(key, val);
11580
11601
  }
11581
- removeTransitionClass(el, leaveFromClass);
11582
- if (legacyClassEnabled && legacyLeaveFromClass) {
11583
- removeTransitionClass(el, legacyLeaveFromClass);
11602
+ });
11603
+ }
11604
+ }
11605
+ _setAttr(key) {
11606
+ let value = this.getAttribute(key);
11607
+ const camelKey = camelize(key);
11608
+ if (this._numberProps && this._numberProps[camelKey]) {
11609
+ value = toNumber(value);
11610
+ }
11611
+ this._setProp(camelKey, value, false);
11612
+ }
11613
+ /**
11614
+ * @internal
11615
+ */
11616
+ _getProp(key) {
11617
+ return this._props[key];
11618
+ }
11619
+ /**
11620
+ * @internal
11621
+ */
11622
+ _setProp(key, val, shouldReflect = true, shouldUpdate = true) {
11623
+ if (val !== this._props[key]) {
11624
+ this._props[key] = val;
11625
+ if (shouldUpdate && this._instance) {
11626
+ this._update();
11627
+ }
11628
+ if (shouldReflect) {
11629
+ if (val === true) {
11630
+ this.setAttribute(hyphenate(key), "");
11631
+ } else if (typeof val === "string" || typeof val === "number") {
11632
+ this.setAttribute(hyphenate(key), val + "");
11633
+ } else if (!val) {
11634
+ this.removeAttribute(hyphenate(key));
11635
+ }
11636
+ }
11637
+ }
11638
+ }
11639
+ _update() {
11640
+ render(this._createVNode(), this.shadowRoot);
11641
+ }
11642
+ _createVNode() {
11643
+ const vnode = createVNode(this._def, extend({}, this._props));
11644
+ if (!this._instance) {
11645
+ vnode.ce = (instance) => {
11646
+ this._instance = instance;
11647
+ instance.isCE = true;
11648
+ {
11649
+ instance.ceReload = (newStyles) => {
11650
+ if (this._styles) {
11651
+ this._styles.forEach((s) => this.shadowRoot.removeChild(s));
11652
+ this._styles.length = 0;
11653
+ }
11654
+ this._applyStyles(newStyles);
11655
+ this._instance = null;
11656
+ this._update();
11657
+ };
11584
11658
  }
11585
- addTransitionClass(el, leaveToClass);
11586
- if (!hasExplicitCallback(onLeave)) {
11587
- whenTransitionEnds(el, type, leaveDuration, resolve);
11659
+ const dispatch = (event, args) => {
11660
+ this.dispatchEvent(
11661
+ new CustomEvent(event, {
11662
+ detail: args
11663
+ })
11664
+ );
11665
+ };
11666
+ instance.emit = (event, ...args) => {
11667
+ dispatch(event, args);
11668
+ if (hyphenate(event) !== event) {
11669
+ dispatch(hyphenate(event), args);
11670
+ }
11671
+ };
11672
+ let parent = this;
11673
+ while (parent = parent && (parent.parentNode || parent.host)) {
11674
+ if (parent instanceof VueElement) {
11675
+ instance.parent = parent._instance;
11676
+ instance.provides = parent._instance.provides;
11677
+ break;
11678
+ }
11679
+ }
11680
+ };
11681
+ }
11682
+ return vnode;
11683
+ }
11684
+ _applyStyles(styles) {
11685
+ if (styles) {
11686
+ styles.forEach((css) => {
11687
+ const s = document.createElement("style");
11688
+ s.textContent = css;
11689
+ this.shadowRoot.appendChild(s);
11690
+ {
11691
+ (this._styles || (this._styles = [])).push(s);
11588
11692
  }
11589
11693
  });
11590
- callHook(onLeave, [el, resolve]);
11591
- },
11592
- onEnterCancelled(el) {
11593
- finishEnter(el, false);
11594
- callHook(onEnterCancelled, [el]);
11595
- },
11596
- onAppearCancelled(el) {
11597
- finishEnter(el, true);
11598
- callHook(onAppearCancelled, [el]);
11599
- },
11600
- onLeaveCancelled(el) {
11601
- finishLeave(el);
11602
- callHook(onLeaveCancelled, [el]);
11603
11694
  }
11604
- });
11605
- }
11606
- function normalizeDuration(duration) {
11607
- if (duration == null) {
11608
- return null;
11609
- } else if (isObject(duration)) {
11610
- return [NumberOf(duration.enter), NumberOf(duration.leave)];
11611
- } else {
11612
- const n = NumberOf(duration);
11613
- return [n, n];
11614
11695
  }
11615
11696
  }
11616
- function NumberOf(val) {
11617
- const res = toNumber(val);
11697
+
11698
+ function useCssModule(name = "$style") {
11618
11699
  {
11619
- assertNumber(res, "<transition> explicit duration");
11620
- }
11621
- return res;
11622
- }
11623
- function addTransitionClass(el, cls) {
11624
- cls.split(/\s+/).forEach((c) => c && el.classList.add(c));
11625
- (el._vtc || (el._vtc = /* @__PURE__ */ new Set())).add(cls);
11626
- }
11627
- function removeTransitionClass(el, cls) {
11628
- cls.split(/\s+/).forEach((c) => c && el.classList.remove(c));
11629
- const { _vtc } = el;
11630
- if (_vtc) {
11631
- _vtc.delete(cls);
11632
- if (!_vtc.size) {
11633
- el._vtc = void 0;
11700
+ const instance = getCurrentInstance();
11701
+ if (!instance) {
11702
+ warn(`useCssModule must be called inside setup()`);
11703
+ return EMPTY_OBJ;
11634
11704
  }
11635
- }
11636
- }
11637
- function nextFrame(cb) {
11638
- requestAnimationFrame(() => {
11639
- requestAnimationFrame(cb);
11640
- });
11641
- }
11642
- let endId = 0;
11643
- function whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {
11644
- const id = el._endId = ++endId;
11645
- const resolveIfNotStale = () => {
11646
- if (id === el._endId) {
11647
- resolve();
11705
+ const modules = instance.type.__cssModules;
11706
+ if (!modules) {
11707
+ warn(`Current instance does not have CSS modules injected.`);
11708
+ return EMPTY_OBJ;
11648
11709
  }
11649
- };
11650
- if (explicitTimeout) {
11651
- return setTimeout(resolveIfNotStale, explicitTimeout);
11710
+ const mod = modules[name];
11711
+ if (!mod) {
11712
+ warn(`Current instance does not have CSS module named "${name}".`);
11713
+ return EMPTY_OBJ;
11714
+ }
11715
+ return mod;
11652
11716
  }
11653
- const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
11654
- if (!type) {
11655
- return resolve();
11717
+ }
11718
+
11719
+ function useCssVars(getter) {
11720
+ const instance = getCurrentInstance();
11721
+ if (!instance) {
11722
+ warn(`useCssVars is called without current active component instance.`);
11723
+ return;
11656
11724
  }
11657
- const endEvent = type + "end";
11658
- let ended = 0;
11659
- const end = () => {
11660
- el.removeEventListener(endEvent, onEnd);
11661
- resolveIfNotStale();
11725
+ const updateTeleports = instance.ut = (vars = getter(instance.proxy)) => {
11726
+ Array.from(
11727
+ document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
11728
+ ).forEach((node) => setVarsOnNode(node, vars));
11662
11729
  };
11663
- const onEnd = (e) => {
11664
- if (e.target === el && ++ended >= propCount) {
11665
- end();
11666
- }
11730
+ const setVars = () => {
11731
+ const vars = getter(instance.proxy);
11732
+ setVarsOnVNode(instance.subTree, vars);
11733
+ updateTeleports(vars);
11667
11734
  };
11668
- setTimeout(() => {
11669
- if (ended < propCount) {
11670
- end();
11671
- }
11672
- }, timeout + 1);
11673
- el.addEventListener(endEvent, onEnd);
11735
+ watchPostEffect(setVars);
11736
+ onMounted(() => {
11737
+ const ob = new MutationObserver(setVars);
11738
+ ob.observe(instance.subTree.el.parentNode, { childList: true });
11739
+ onUnmounted(() => ob.disconnect());
11740
+ });
11674
11741
  }
11675
- function getTransitionInfo(el, expectedType) {
11676
- const styles = window.getComputedStyle(el);
11677
- const getStyleProperties = (key) => (styles[key] || "").split(", ");
11678
- const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
11679
- const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
11680
- const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
11681
- const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
11682
- const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
11683
- const animationTimeout = getTimeout(animationDelays, animationDurations);
11684
- let type = null;
11685
- let timeout = 0;
11686
- let propCount = 0;
11687
- if (expectedType === TRANSITION) {
11688
- if (transitionTimeout > 0) {
11689
- type = TRANSITION;
11690
- timeout = transitionTimeout;
11691
- propCount = transitionDurations.length;
11742
+ function setVarsOnVNode(vnode, vars) {
11743
+ if (vnode.shapeFlag & 128) {
11744
+ const suspense = vnode.suspense;
11745
+ vnode = suspense.activeBranch;
11746
+ if (suspense.pendingBranch && !suspense.isHydrating) {
11747
+ suspense.effects.push(() => {
11748
+ setVarsOnVNode(suspense.activeBranch, vars);
11749
+ });
11692
11750
  }
11693
- } else if (expectedType === ANIMATION) {
11694
- if (animationTimeout > 0) {
11695
- type = ANIMATION;
11696
- timeout = animationTimeout;
11697
- propCount = animationDurations.length;
11751
+ }
11752
+ while (vnode.component) {
11753
+ vnode = vnode.component.subTree;
11754
+ }
11755
+ if (vnode.shapeFlag & 1 && vnode.el) {
11756
+ setVarsOnNode(vnode.el, vars);
11757
+ } else if (vnode.type === Fragment) {
11758
+ vnode.children.forEach((c) => setVarsOnVNode(c, vars));
11759
+ } else if (vnode.type === Static) {
11760
+ let { el, anchor } = vnode;
11761
+ while (el) {
11762
+ setVarsOnNode(el, vars);
11763
+ if (el === anchor)
11764
+ break;
11765
+ el = el.nextSibling;
11698
11766
  }
11699
- } else {
11700
- timeout = Math.max(transitionTimeout, animationTimeout);
11701
- type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
11702
- propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
11703
11767
  }
11704
- const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
11705
- getStyleProperties(`${TRANSITION}Property`).toString()
11706
- );
11707
- return {
11708
- type,
11709
- timeout,
11710
- propCount,
11711
- hasTransform
11712
- };
11713
11768
  }
11714
- function getTimeout(delays, durations) {
11715
- while (delays.length < durations.length) {
11716
- delays = delays.concat(delays);
11769
+ function setVarsOnNode(el, vars) {
11770
+ if (el.nodeType === 1) {
11771
+ const style = el.style;
11772
+ for (const key in vars) {
11773
+ style.setProperty(`--${key}`, vars[key]);
11774
+ }
11717
11775
  }
11718
- return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));
11719
- }
11720
- function toMs(s) {
11721
- return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
11722
- }
11723
- function forceReflow() {
11724
- return document.body.offsetHeight;
11725
11776
  }
11726
11777
 
11727
11778
  const positionMap = /* @__PURE__ */ new WeakMap();
11728
11779
  const newPositionMap = /* @__PURE__ */ new WeakMap();
11780
+ const moveCbKey = Symbol("_moveCb");
11781
+ const enterCbKey = Symbol("_enterCb");
11729
11782
  const TransitionGroupImpl = {
11730
11783
  name: "TransitionGroup",
11731
11784
  props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
@@ -11758,13 +11811,13 @@ const TransitionGroupImpl = {
11758
11811
  const style = el.style;
11759
11812
  addTransitionClass(el, moveClass);
11760
11813
  style.transform = style.webkitTransform = style.transitionDuration = "";
11761
- const cb = el._moveCb = (e) => {
11814
+ const cb = el[moveCbKey] = (e) => {
11762
11815
  if (e && e.target !== el) {
11763
11816
  return;
11764
11817
  }
11765
11818
  if (!e || /transform$/.test(e.propertyName)) {
11766
11819
  el.removeEventListener("transitionend", cb);
11767
- el._moveCb = null;
11820
+ el[moveCbKey] = null;
11768
11821
  removeTransitionClass(el, moveClass);
11769
11822
  }
11770
11823
  };
@@ -11816,11 +11869,11 @@ const removeMode = (props) => delete props.mode;
11816
11869
  const TransitionGroup = TransitionGroupImpl;
11817
11870
  function callPendingCbs(c) {
11818
11871
  const el = c.el;
11819
- if (el._moveCb) {
11820
- el._moveCb();
11872
+ if (el[moveCbKey]) {
11873
+ el[moveCbKey]();
11821
11874
  }
11822
- if (el._enterCb) {
11823
- el._enterCb();
11875
+ if (el[enterCbKey]) {
11876
+ el[enterCbKey]();
11824
11877
  }
11825
11878
  }
11826
11879
  function recordPosition(c) {
@@ -11840,8 +11893,9 @@ function applyTranslation(c) {
11840
11893
  }
11841
11894
  function hasCSSTransform(el, root, moveClass) {
11842
11895
  const clone = el.cloneNode();
11843
- if (el._vtc) {
11844
- el._vtc.forEach((cls) => {
11896
+ const _vtc = el[vtcKey];
11897
+ if (_vtc) {
11898
+ _vtc.forEach((cls) => {
11845
11899
  cls.split(/\s+/).forEach((c) => c && clone.classList.remove(c));
11846
11900
  });
11847
11901
  }
@@ -11868,9 +11922,10 @@ function onCompositionEnd(e) {
11868
11922
  target.dispatchEvent(new Event("input"));
11869
11923
  }
11870
11924
  }
11925
+ const assignKey = Symbol("_assign");
11871
11926
  const vModelText = {
11872
11927
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
11873
- el._assign = getModelAssigner(vnode);
11928
+ el[assignKey] = getModelAssigner(vnode);
11874
11929
  const castToNumber = number || vnode.props && vnode.props.type === "number";
11875
11930
  addEventListener(el, lazy ? "change" : "input", (e) => {
11876
11931
  if (e.target.composing)
@@ -11882,7 +11937,7 @@ const vModelText = {
11882
11937
  if (castToNumber) {
11883
11938
  domValue = looseToNumber(domValue);
11884
11939
  }
11885
- el._assign(domValue);
11940
+ el[assignKey](domValue);
11886
11941
  });
11887
11942
  if (trim) {
11888
11943
  addEventListener(el, "change", () => {
@@ -11900,7 +11955,7 @@ const vModelText = {
11900
11955
  el.value = value == null ? "" : value;
11901
11956
  },
11902
11957
  beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {
11903
- el._assign = getModelAssigner(vnode);
11958
+ el[assignKey] = getModelAssigner(vnode);
11904
11959
  if (el.composing)
11905
11960
  return;
11906
11961
  if (document.activeElement === el && el.type !== "range") {
@@ -11924,12 +11979,12 @@ const vModelCheckbox = {
11924
11979
  // #4096 array checkboxes need to be deep traversed
11925
11980
  deep: true,
11926
11981
  created(el, _, vnode) {
11927
- el._assign = getModelAssigner(vnode);
11982
+ el[assignKey] = getModelAssigner(vnode);
11928
11983
  addEventListener(el, "change", () => {
11929
11984
  const modelValue = el._modelValue;
11930
11985
  const elementValue = getValue(el);
11931
11986
  const checked = el.checked;
11932
- const assign = el._assign;
11987
+ const assign = el[assignKey];
11933
11988
  if (isArray(modelValue)) {
11934
11989
  const index = looseIndexOf(modelValue, elementValue);
11935
11990
  const found = index !== -1;
@@ -11956,7 +12011,7 @@ const vModelCheckbox = {
11956
12011
  // set initial checked on mount to wait for true-value/false-value
11957
12012
  mounted: setChecked,
11958
12013
  beforeUpdate(el, binding, vnode) {
11959
- el._assign = getModelAssigner(vnode);
12014
+ el[assignKey] = getModelAssigner(vnode);
11960
12015
  setChecked(el, binding, vnode);
11961
12016
  }
11962
12017
  };
@@ -11973,13 +12028,13 @@ function setChecked(el, { value, oldValue }, vnode) {
11973
12028
  const vModelRadio = {
11974
12029
  created(el, { value }, vnode) {
11975
12030
  el.checked = looseEqual(value, vnode.props.value);
11976
- el._assign = getModelAssigner(vnode);
12031
+ el[assignKey] = getModelAssigner(vnode);
11977
12032
  addEventListener(el, "change", () => {
11978
- el._assign(getValue(el));
12033
+ el[assignKey](getValue(el));
11979
12034
  });
11980
12035
  },
11981
12036
  beforeUpdate(el, { value, oldValue }, vnode) {
11982
- el._assign = getModelAssigner(vnode);
12037
+ el[assignKey] = getModelAssigner(vnode);
11983
12038
  if (value !== oldValue) {
11984
12039
  el.checked = looseEqual(value, vnode.props.value);
11985
12040
  }
@@ -11994,11 +12049,11 @@ const vModelSelect = {
11994
12049
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
11995
12050
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
11996
12051
  );
11997
- el._assign(
12052
+ el[assignKey](
11998
12053
  el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
11999
12054
  );
12000
12055
  });
12001
- el._assign = getModelAssigner(vnode);
12056
+ el[assignKey] = getModelAssigner(vnode);
12002
12057
  },
12003
12058
  // set value in mounted & updated because <select> relies on its children
12004
12059
  // <option>s.
@@ -12006,7 +12061,7 @@ const vModelSelect = {
12006
12061
  setSelected(el, value);
12007
12062
  },
12008
12063
  beforeUpdate(el, _binding, vnode) {
12009
- el._assign = getModelAssigner(vnode);
12064
+ el[assignKey] = getModelAssigner(vnode);
12010
12065
  },
12011
12066
  updated(el, { value }) {
12012
12067
  setSelected(el, value);
@@ -12169,45 +12224,6 @@ const withKeys = (fn, modifiers) => {
12169
12224
  };
12170
12225
  };
12171
12226
 
12172
- const vShow = {
12173
- beforeMount(el, { value }, { transition }) {
12174
- el._vod = el.style.display === "none" ? "" : el.style.display;
12175
- if (transition && value) {
12176
- transition.beforeEnter(el);
12177
- } else {
12178
- setDisplay(el, value);
12179
- }
12180
- },
12181
- mounted(el, { value }, { transition }) {
12182
- if (transition && value) {
12183
- transition.enter(el);
12184
- }
12185
- },
12186
- updated(el, { value, oldValue }, { transition }) {
12187
- if (!value === !oldValue)
12188
- return;
12189
- if (transition) {
12190
- if (value) {
12191
- transition.beforeEnter(el);
12192
- setDisplay(el, true);
12193
- transition.enter(el);
12194
- } else {
12195
- transition.leave(el, () => {
12196
- setDisplay(el, false);
12197
- });
12198
- }
12199
- } else {
12200
- setDisplay(el, value);
12201
- }
12202
- },
12203
- beforeUnmount(el, { value }) {
12204
- setDisplay(el, value);
12205
- }
12206
- };
12207
- function setDisplay(el, value) {
12208
- el.style.display = value ? el._vod : "none";
12209
- }
12210
-
12211
12227
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
12212
12228
  let renderer;
12213
12229
  let enabledHydration = false;