UNPKG

304 kBJavaScriptView Raw
1/*!
2 * Vue.js v2.7.15
3 * (c) 2014-2023 Evan You
4 * Released under the MIT License.
5 */
6var emptyObject = Object.freeze({});
7var isArray = Array.isArray;
8// These helpers produce better VM code in JS engines due to their
9// explicitness and function inlining.
10function isUndef(v) {
11 return v === undefined || v === null;
12}
13function isDef(v) {
14 return v !== undefined && v !== null;
15}
16function isTrue(v) {
17 return v === true;
18}
19function isFalse(v) {
20 return v === false;
21}
22/**
23 * Check if value is primitive.
24 */
25function isPrimitive(value) {
26 return (typeof value === 'string' ||
27 typeof value === 'number' ||
28 // $flow-disable-line
29 typeof value === 'symbol' ||
30 typeof value === 'boolean');
31}
32function isFunction(value) {
33 return typeof value === 'function';
34}
35/**
36 * Quick object check - this is primarily used to tell
37 * objects from primitive values when we know the value
38 * is a JSON-compliant type.
39 */
40function isObject(obj) {
41 return obj !== null && typeof obj === 'object';
42}
43/**
44 * Get the raw type string of a value, e.g., [object Object].
45 */
46var _toString = Object.prototype.toString;
47function toRawType(value) {
48 return _toString.call(value).slice(8, -1);
49}
50/**
51 * Strict object type check. Only returns true
52 * for plain JavaScript objects.
53 */
54function isPlainObject(obj) {
55 return _toString.call(obj) === '[object Object]';
56}
57function isRegExp(v) {
58 return _toString.call(v) === '[object RegExp]';
59}
60/**
61 * Check if val is a valid array index.
62 */
63function isValidArrayIndex(val) {
64 var n = parseFloat(String(val));
65 return n >= 0 && Math.floor(n) === n && isFinite(val);
66}
67function isPromise(val) {
68 return (isDef(val) &&
69 typeof val.then === 'function' &&
70 typeof val.catch === 'function');
71}
72/**
73 * Convert a value to a string that is actually rendered.
74 */
75function toString(val) {
76 return val == null
77 ? ''
78 : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
79 ? JSON.stringify(val, null, 2)
80 : String(val);
81}
82/**
83 * Convert an input value to a number for persistence.
84 * If the conversion fails, return original string.
85 */
86function toNumber(val) {
87 var n = parseFloat(val);
88 return isNaN(n) ? val : n;
89}
90/**
91 * Make a map and return a function for checking if a key
92 * is in that map.
93 */
94function makeMap(str, expectsLowerCase) {
95 var map = Object.create(null);
96 var list = str.split(',');
97 for (var i = 0; i < list.length; i++) {
98 map[list[i]] = true;
99 }
100 return expectsLowerCase ? function (val) { return map[val.toLowerCase()]; } : function (val) { return map[val]; };
101}
102/**
103 * Check if a tag is a built-in tag.
104 */
105var isBuiltInTag = makeMap('slot,component', true);
106/**
107 * Check if an attribute is a reserved attribute.
108 */
109var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
110/**
111 * Remove an item from an array.
112 */
113function remove$2(arr, item) {
114 var len = arr.length;
115 if (len) {
116 // fast path for the only / last item
117 if (item === arr[len - 1]) {
118 arr.length = len - 1;
119 return;
120 }
121 var index = arr.indexOf(item);
122 if (index > -1) {
123 return arr.splice(index, 1);
124 }
125 }
126}
127/**
128 * Check whether an object has the property.
129 */
130var hasOwnProperty = Object.prototype.hasOwnProperty;
131function hasOwn(obj, key) {
132 return hasOwnProperty.call(obj, key);
133}
134/**
135 * Create a cached version of a pure function.
136 */
137function cached(fn) {
138 var cache = Object.create(null);
139 return function cachedFn(str) {
140 var hit = cache[str];
141 return hit || (cache[str] = fn(str));
142 };
143}
144/**
145 * Camelize a hyphen-delimited string.
146 */
147var camelizeRE = /-(\w)/g;
148var camelize = cached(function (str) {
149 return str.replace(camelizeRE, function (_, c) { return (c ? c.toUpperCase() : ''); });
150});
151/**
152 * Capitalize a string.
153 */
154var capitalize = cached(function (str) {
155 return str.charAt(0).toUpperCase() + str.slice(1);
156});
157/**
158 * Hyphenate a camelCase string.
159 */
160var hyphenateRE = /\B([A-Z])/g;
161var hyphenate = cached(function (str) {
162 return str.replace(hyphenateRE, '-$1').toLowerCase();
163});
164/**
165 * Simple bind polyfill for environments that do not support it,
166 * e.g., PhantomJS 1.x. Technically, we don't need this anymore
167 * since native bind is now performant enough in most browsers.
168 * But removing it would mean breaking code that was able to run in
169 * PhantomJS 1.x, so this must be kept for backward compatibility.
170 */
171/* istanbul ignore next */
172function polyfillBind(fn, ctx) {
173 function boundFn(a) {
174 var l = arguments.length;
175 return l
176 ? l > 1
177 ? fn.apply(ctx, arguments)
178 : fn.call(ctx, a)
179 : fn.call(ctx);
180 }
181 boundFn._length = fn.length;
182 return boundFn;
183}
184function nativeBind(fn, ctx) {
185 return fn.bind(ctx);
186}
187// @ts-expect-error bind cannot be `undefined`
188var bind = Function.prototype.bind ? nativeBind : polyfillBind;
189/**
190 * Convert an Array-like object to a real Array.
191 */
192function toArray(list, start) {
193 start = start || 0;
194 var i = list.length - start;
195 var ret = new Array(i);
196 while (i--) {
197 ret[i] = list[i + start];
198 }
199 return ret;
200}
201/**
202 * Mix properties into target object.
203 */
204function extend(to, _from) {
205 for (var key in _from) {
206 to[key] = _from[key];
207 }
208 return to;
209}
210/**
211 * Merge an Array of Objects into a single Object.
212 */
213function toObject(arr) {
214 var res = {};
215 for (var i = 0; i < arr.length; i++) {
216 if (arr[i]) {
217 extend(res, arr[i]);
218 }
219 }
220 return res;
221}
222/* eslint-disable no-unused-vars */
223/**
224 * Perform no operation.
225 * Stubbing args to make Flow happy without leaving useless transpiled code
226 * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
227 */
228function noop(a, b, c) { }
229/**
230 * Always return false.
231 */
232var no = function (a, b, c) { return false; };
233/* eslint-enable no-unused-vars */
234/**
235 * Return the same value.
236 */
237var identity = function (_) { return _; };
238/**
239 * Check if two values are loosely equal - that is,
240 * if they are plain objects, do they have the same shape?
241 */
242function looseEqual(a, b) {
243 if (a === b)
244 return true;
245 var isObjectA = isObject(a);
246 var isObjectB = isObject(b);
247 if (isObjectA && isObjectB) {
248 try {
249 var isArrayA = Array.isArray(a);
250 var isArrayB = Array.isArray(b);
251 if (isArrayA && isArrayB) {
252 return (a.length === b.length &&
253 a.every(function (e, i) {
254 return looseEqual(e, b[i]);
255 }));
256 }
257 else if (a instanceof Date && b instanceof Date) {
258 return a.getTime() === b.getTime();
259 }
260 else if (!isArrayA && !isArrayB) {
261 var keysA = Object.keys(a);
262 var keysB = Object.keys(b);
263 return (keysA.length === keysB.length &&
264 keysA.every(function (key) {
265 return looseEqual(a[key], b[key]);
266 }));
267 }
268 else {
269 /* istanbul ignore next */
270 return false;
271 }
272 }
273 catch (e) {
274 /* istanbul ignore next */
275 return false;
276 }
277 }
278 else if (!isObjectA && !isObjectB) {
279 return String(a) === String(b);
280 }
281 else {
282 return false;
283 }
284}
285/**
286 * Return the first index at which a loosely equal value can be
287 * found in the array (if value is a plain object, the array must
288 * contain an object of the same shape), or -1 if it is not present.
289 */
290function looseIndexOf(arr, val) {
291 for (var i = 0; i < arr.length; i++) {
292 if (looseEqual(arr[i], val))
293 return i;
294 }
295 return -1;
296}
297/**
298 * Ensure a function is called only once.
299 */
300function once(fn) {
301 var called = false;
302 return function () {
303 if (!called) {
304 called = true;
305 fn.apply(this, arguments);
306 }
307 };
308}
309// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is#polyfill
310function hasChanged(x, y) {
311 if (x === y) {
312 return x === 0 && 1 / x !== 1 / y;
313 }
314 else {
315 return x === x || y === y;
316 }
317}
318
319var SSR_ATTR = 'data-server-rendered';
320var ASSET_TYPES = ['component', 'directive', 'filter'];
321var LIFECYCLE_HOOKS = [
322 'beforeCreate',
323 'created',
324 'beforeMount',
325 'mounted',
326 'beforeUpdate',
327 'updated',
328 'beforeDestroy',
329 'destroyed',
330 'activated',
331 'deactivated',
332 'errorCaptured',
333 'serverPrefetch',
334 'renderTracked',
335 'renderTriggered'
336];
337
338var config = {
339 /**
340 * Option merge strategies (used in core/util/options)
341 */
342 // $flow-disable-line
343 optionMergeStrategies: Object.create(null),
344 /**
345 * Whether to suppress warnings.
346 */
347 silent: false,
348 /**
349 * Show production mode tip message on boot?
350 */
351 productionTip: process.env.NODE_ENV !== 'production',
352 /**
353 * Whether to enable devtools
354 */
355 devtools: process.env.NODE_ENV !== 'production',
356 /**
357 * Whether to record perf
358 */
359 performance: false,
360 /**
361 * Error handler for watcher errors
362 */
363 errorHandler: null,
364 /**
365 * Warn handler for watcher warns
366 */
367 warnHandler: null,
368 /**
369 * Ignore certain custom elements
370 */
371 ignoredElements: [],
372 /**
373 * Custom user key aliases for v-on
374 */
375 // $flow-disable-line
376 keyCodes: Object.create(null),
377 /**
378 * Check if a tag is reserved so that it cannot be registered as a
379 * component. This is platform-dependent and may be overwritten.
380 */
381 isReservedTag: no,
382 /**
383 * Check if an attribute is reserved so that it cannot be used as a component
384 * prop. This is platform-dependent and may be overwritten.
385 */
386 isReservedAttr: no,
387 /**
388 * Check if a tag is an unknown element.
389 * Platform-dependent.
390 */
391 isUnknownElement: no,
392 /**
393 * Get the namespace of an element
394 */
395 getTagNamespace: noop,
396 /**
397 * Parse the real tag name for the specific platform.
398 */
399 parsePlatformTagName: identity,
400 /**
401 * Check if an attribute must be bound using property, e.g. value
402 * Platform-dependent.
403 */
404 mustUseProp: no,
405 /**
406 * Perform updates asynchronously. Intended to be used by Vue Test Utils
407 * This will significantly reduce performance if set to false.
408 */
409 async: true,
410 /**
411 * Exposed for legacy reasons
412 */
413 _lifecycleHooks: LIFECYCLE_HOOKS
414};
415
416/**
417 * unicode letters used for parsing html tags, component names and property paths.
418 * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
419 * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
420 */
421var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
422/**
423 * Check if a string starts with $ or _
424 */
425function isReserved(str) {
426 var c = (str + '').charCodeAt(0);
427 return c === 0x24 || c === 0x5f;
428}
429/**
430 * Define a property.
431 */
432function def(obj, key, val, enumerable) {
433 Object.defineProperty(obj, key, {
434 value: val,
435 enumerable: !!enumerable,
436 writable: true,
437 configurable: true
438 });
439}
440/**
441 * Parse simple path.
442 */
443var bailRE = new RegExp("[^".concat(unicodeRegExp.source, ".$_\\d]"));
444function parsePath(path) {
445 if (bailRE.test(path)) {
446 return;
447 }
448 var segments = path.split('.');
449 return function (obj) {
450 for (var i = 0; i < segments.length; i++) {
451 if (!obj)
452 return;
453 obj = obj[segments[i]];
454 }
455 return obj;
456 };
457}
458
459// can we use __proto__?
460var hasProto = '__proto__' in {};
461// Browser environment sniffing
462var inBrowser = typeof window !== 'undefined';
463var UA = inBrowser && window.navigator.userAgent.toLowerCase();
464var isIE = UA && /msie|trident/.test(UA);
465var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
466var isEdge = UA && UA.indexOf('edge/') > 0;
467UA && UA.indexOf('android') > 0;
468var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
469UA && /chrome\/\d+/.test(UA) && !isEdge;
470UA && /phantomjs/.test(UA);
471var isFF = UA && UA.match(/firefox\/(\d+)/);
472// Firefox has a "watch" function on Object.prototype...
473// @ts-expect-error firebox support
474var nativeWatch = {}.watch;
475var supportsPassive = false;
476if (inBrowser) {
477 try {
478 var opts = {};
479 Object.defineProperty(opts, 'passive', {
480 get: function () {
481 /* istanbul ignore next */
482 supportsPassive = true;
483 }
484 }); // https://github.com/facebook/flow/issues/285
485 window.addEventListener('test-passive', null, opts);
486 }
487 catch (e) { }
488}
489// this needs to be lazy-evaled because vue may be required before
490// vue-server-renderer can set VUE_ENV
491var _isServer;
492var isServerRendering = function () {
493 if (_isServer === undefined) {
494 /* istanbul ignore if */
495 if (!inBrowser && typeof global !== 'undefined') {
496 // detect presence of vue-server-renderer and avoid
497 // Webpack shimming the process
498 _isServer =
499 global['process'] && global['process'].env.VUE_ENV === 'server';
500 }
501 else {
502 _isServer = false;
503 }
504 }
505 return _isServer;
506};
507// detect devtools
508var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
509/* istanbul ignore next */
510function isNative(Ctor) {
511 return typeof Ctor === 'function' && /native code/.test(Ctor.toString());
512}
513var hasSymbol = typeof Symbol !== 'undefined' &&
514 isNative(Symbol) &&
515 typeof Reflect !== 'undefined' &&
516 isNative(Reflect.ownKeys);
517var _Set; // $flow-disable-line
518/* istanbul ignore if */ if (typeof Set !== 'undefined' && isNative(Set)) {
519 // use native Set when available.
520 _Set = Set;
521}
522else {
523 // a non-standard Set polyfill that only works with primitive keys.
524 _Set = /** @class */ (function () {
525 function Set() {
526 this.set = Object.create(null);
527 }
528 Set.prototype.has = function (key) {
529 return this.set[key] === true;
530 };
531 Set.prototype.add = function (key) {
532 this.set[key] = true;
533 };
534 Set.prototype.clear = function () {
535 this.set = Object.create(null);
536 };
537 return Set;
538 }());
539}
540
541var currentInstance = null;
542/**
543 * This is exposed for compatibility with v3 (e.g. some functions in VueUse
544 * relies on it). Do not use this internally, just use `currentInstance`.
545 *
546 * @internal this function needs manual type declaration because it relies
547 * on previously manually authored types from Vue 2
548 */
549function getCurrentInstance() {
550 return currentInstance && { proxy: currentInstance };
551}
552/**
553 * @internal
554 */
555function setCurrentInstance(vm) {
556 if (vm === void 0) { vm = null; }
557 if (!vm)
558 currentInstance && currentInstance._scope.off();
559 currentInstance = vm;
560 vm && vm._scope.on();
561}
562
563/**
564 * @internal
565 */
566var VNode = /** @class */ (function () {
567 function VNode(tag, data, children, text, elm, context, componentOptions, asyncFactory) {
568 this.tag = tag;
569 this.data = data;
570 this.children = children;
571 this.text = text;
572 this.elm = elm;
573 this.ns = undefined;
574 this.context = context;
575 this.fnContext = undefined;
576 this.fnOptions = undefined;
577 this.fnScopeId = undefined;
578 this.key = data && data.key;
579 this.componentOptions = componentOptions;
580 this.componentInstance = undefined;
581 this.parent = undefined;
582 this.raw = false;
583 this.isStatic = false;
584 this.isRootInsert = true;
585 this.isComment = false;
586 this.isCloned = false;
587 this.isOnce = false;
588 this.asyncFactory = asyncFactory;
589 this.asyncMeta = undefined;
590 this.isAsyncPlaceholder = false;
591 }
592 Object.defineProperty(VNode.prototype, "child", {
593 // DEPRECATED: alias for componentInstance for backwards compat.
594 /* istanbul ignore next */
595 get: function () {
596 return this.componentInstance;
597 },
598 enumerable: false,
599 configurable: true
600 });
601 return VNode;
602}());
603var createEmptyVNode = function (text) {
604 if (text === void 0) { text = ''; }
605 var node = new VNode();
606 node.text = text;
607 node.isComment = true;
608 return node;
609};
610function createTextVNode(val) {
611 return new VNode(undefined, undefined, undefined, String(val));
612}
613// optimized shallow clone
614// used for static nodes and slot nodes because they may be reused across
615// multiple renders, cloning them avoids errors when DOM manipulations rely
616// on their elm reference.
617function cloneVNode(vnode) {
618 var cloned = new VNode(vnode.tag, vnode.data,
619 // #7975
620 // clone children array to avoid mutating original in case of cloning
621 // a child.
622 vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentOptions, vnode.asyncFactory);
623 cloned.ns = vnode.ns;
624 cloned.isStatic = vnode.isStatic;
625 cloned.key = vnode.key;
626 cloned.isComment = vnode.isComment;
627 cloned.fnContext = vnode.fnContext;
628 cloned.fnOptions = vnode.fnOptions;
629 cloned.fnScopeId = vnode.fnScopeId;
630 cloned.asyncMeta = vnode.asyncMeta;
631 cloned.isCloned = true;
632 return cloned;
633}
634
635/******************************************************************************
636Copyright (c) Microsoft Corporation.
637
638Permission to use, copy, modify, and/or distribute this software for any
639purpose with or without fee is hereby granted.
640
641THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
642REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
643AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
644INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
645LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
646OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
647PERFORMANCE OF THIS SOFTWARE.
648***************************************************************************** */
649
650var __assign = function() {
651 __assign = Object.assign || function __assign(t) {
652 for (var s, i = 1, n = arguments.length; i < n; i++) {
653 s = arguments[i];
654 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
655 }
656 return t;
657 };
658 return __assign.apply(this, arguments);
659};
660
661var uid$2 = 0;
662var pendingCleanupDeps = [];
663var cleanupDeps = function () {
664 for (var i = 0; i < pendingCleanupDeps.length; i++) {
665 var dep = pendingCleanupDeps[i];
666 dep.subs = dep.subs.filter(function (s) { return s; });
667 dep._pending = false;
668 }
669 pendingCleanupDeps.length = 0;
670};
671/**
672 * A dep is an observable that can have multiple
673 * directives subscribing to it.
674 * @internal
675 */
676var Dep = /** @class */ (function () {
677 function Dep() {
678 // pending subs cleanup
679 this._pending = false;
680 this.id = uid$2++;
681 this.subs = [];
682 }
683 Dep.prototype.addSub = function (sub) {
684 this.subs.push(sub);
685 };
686 Dep.prototype.removeSub = function (sub) {
687 // #12696 deps with massive amount of subscribers are extremely slow to
688 // clean up in Chromium
689 // to workaround this, we unset the sub for now, and clear them on
690 // next scheduler flush.
691 this.subs[this.subs.indexOf(sub)] = null;
692 if (!this._pending) {
693 this._pending = true;
694 pendingCleanupDeps.push(this);
695 }
696 };
697 Dep.prototype.depend = function (info) {
698 if (Dep.target) {
699 Dep.target.addDep(this);
700 if (process.env.NODE_ENV !== 'production' && info && Dep.target.onTrack) {
701 Dep.target.onTrack(__assign({ effect: Dep.target }, info));
702 }
703 }
704 };
705 Dep.prototype.notify = function (info) {
706 // stabilize the subscriber list first
707 var subs = this.subs.filter(function (s) { return s; });
708 if (process.env.NODE_ENV !== 'production' && !config.async) {
709 // subs aren't sorted in scheduler if not running async
710 // we need to sort them now to make sure they fire in correct
711 // order
712 subs.sort(function (a, b) { return a.id - b.id; });
713 }
714 for (var i = 0, l = subs.length; i < l; i++) {
715 var sub = subs[i];
716 if (process.env.NODE_ENV !== 'production' && info) {
717 sub.onTrigger &&
718 sub.onTrigger(__assign({ effect: subs[i] }, info));
719 }
720 sub.update();
721 }
722 };
723 return Dep;
724}());
725// The current target watcher being evaluated.
726// This is globally unique because only one watcher
727// can be evaluated at a time.
728Dep.target = null;
729var targetStack = [];
730function pushTarget(target) {
731 targetStack.push(target);
732 Dep.target = target;
733}
734function popTarget() {
735 targetStack.pop();
736 Dep.target = targetStack[targetStack.length - 1];
737}
738
739/*
740 * not type checking this file because flow doesn't play well with
741 * dynamically accessing methods on Array prototype
742 */
743var arrayProto = Array.prototype;
744var arrayMethods = Object.create(arrayProto);
745var methodsToPatch = [
746 'push',
747 'pop',
748 'shift',
749 'unshift',
750 'splice',
751 'sort',
752 'reverse'
753];
754/**
755 * Intercept mutating methods and emit events
756 */
757methodsToPatch.forEach(function (method) {
758 // cache original method
759 var original = arrayProto[method];
760 def(arrayMethods, method, function mutator() {
761 var args = [];
762 for (var _i = 0; _i < arguments.length; _i++) {
763 args[_i] = arguments[_i];
764 }
765 var result = original.apply(this, args);
766 var ob = this.__ob__;
767 var inserted;
768 switch (method) {
769 case 'push':
770 case 'unshift':
771 inserted = args;
772 break;
773 case 'splice':
774 inserted = args.slice(2);
775 break;
776 }
777 if (inserted)
778 ob.observeArray(inserted);
779 // notify change
780 if (process.env.NODE_ENV !== 'production') {
781 ob.dep.notify({
782 type: "array mutation" /* TriggerOpTypes.ARRAY_MUTATION */,
783 target: this,
784 key: method
785 });
786 }
787 else {
788 ob.dep.notify();
789 }
790 return result;
791 });
792});
793
794var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
795var NO_INITIAL_VALUE = {};
796/**
797 * In some cases we may want to disable observation inside a component's
798 * update computation.
799 */
800var shouldObserve = true;
801function toggleObserving(value) {
802 shouldObserve = value;
803}
804// ssr mock dep
805var mockDep = {
806 notify: noop,
807 depend: noop,
808 addSub: noop,
809 removeSub: noop
810};
811/**
812 * Observer class that is attached to each observed
813 * object. Once attached, the observer converts the target
814 * object's property keys into getter/setters that
815 * collect dependencies and dispatch updates.
816 */
817var Observer = /** @class */ (function () {
818 function Observer(value, shallow, mock) {
819 if (shallow === void 0) { shallow = false; }
820 if (mock === void 0) { mock = false; }
821 this.value = value;
822 this.shallow = shallow;
823 this.mock = mock;
824 // this.value = value
825 this.dep = mock ? mockDep : new Dep();
826 this.vmCount = 0;
827 def(value, '__ob__', this);
828 if (isArray(value)) {
829 if (!mock) {
830 if (hasProto) {
831 value.__proto__ = arrayMethods;
832 /* eslint-enable no-proto */
833 }
834 else {
835 for (var i = 0, l = arrayKeys.length; i < l; i++) {
836 var key = arrayKeys[i];
837 def(value, key, arrayMethods[key]);
838 }
839 }
840 }
841 if (!shallow) {
842 this.observeArray(value);
843 }
844 }
845 else {
846 /**
847 * Walk through all properties and convert them into
848 * getter/setters. This method should only be called when
849 * value type is Object.
850 */
851 var keys = Object.keys(value);
852 for (var i = 0; i < keys.length; i++) {
853 var key = keys[i];
854 defineReactive(value, key, NO_INITIAL_VALUE, undefined, shallow, mock);
855 }
856 }
857 }
858 /**
859 * Observe a list of Array items.
860 */
861 Observer.prototype.observeArray = function (value) {
862 for (var i = 0, l = value.length; i < l; i++) {
863 observe(value[i], false, this.mock);
864 }
865 };
866 return Observer;
867}());
868// helpers
869/**
870 * Attempt to create an observer instance for a value,
871 * returns the new observer if successfully observed,
872 * or the existing observer if the value already has one.
873 */
874function observe(value, shallow, ssrMockReactivity) {
875 if (value && hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
876 return value.__ob__;
877 }
878 if (shouldObserve &&
879 (ssrMockReactivity || !isServerRendering()) &&
880 (isArray(value) || isPlainObject(value)) &&
881 Object.isExtensible(value) &&
882 !value.__v_skip /* ReactiveFlags.SKIP */ &&
883 !isRef(value) &&
884 !(value instanceof VNode)) {
885 return new Observer(value, shallow, ssrMockReactivity);
886 }
887}
888/**
889 * Define a reactive property on an Object.
890 */
891function defineReactive(obj, key, val, customSetter, shallow, mock) {
892 var dep = new Dep();
893 var property = Object.getOwnPropertyDescriptor(obj, key);
894 if (property && property.configurable === false) {
895 return;
896 }
897 // cater for pre-defined getter/setters
898 var getter = property && property.get;
899 var setter = property && property.set;
900 if ((!getter || setter) &&
901 (val === NO_INITIAL_VALUE || arguments.length === 2)) {
902 val = obj[key];
903 }
904 var childOb = !shallow && observe(val, false, mock);
905 Object.defineProperty(obj, key, {
906 enumerable: true,
907 configurable: true,
908 get: function reactiveGetter() {
909 var value = getter ? getter.call(obj) : val;
910 if (Dep.target) {
911 if (process.env.NODE_ENV !== 'production') {
912 dep.depend({
913 target: obj,
914 type: "get" /* TrackOpTypes.GET */,
915 key: key
916 });
917 }
918 else {
919 dep.depend();
920 }
921 if (childOb) {
922 childOb.dep.depend();
923 if (isArray(value)) {
924 dependArray(value);
925 }
926 }
927 }
928 return isRef(value) && !shallow ? value.value : value;
929 },
930 set: function reactiveSetter(newVal) {
931 var value = getter ? getter.call(obj) : val;
932 if (!hasChanged(value, newVal)) {
933 return;
934 }
935 if (process.env.NODE_ENV !== 'production' && customSetter) {
936 customSetter();
937 }
938 if (setter) {
939 setter.call(obj, newVal);
940 }
941 else if (getter) {
942 // #7981: for accessor properties without setter
943 return;
944 }
945 else if (!shallow && isRef(value) && !isRef(newVal)) {
946 value.value = newVal;
947 return;
948 }
949 else {
950 val = newVal;
951 }
952 childOb = !shallow && observe(newVal, false, mock);
953 if (process.env.NODE_ENV !== 'production') {
954 dep.notify({
955 type: "set" /* TriggerOpTypes.SET */,
956 target: obj,
957 key: key,
958 newValue: newVal,
959 oldValue: value
960 });
961 }
962 else {
963 dep.notify();
964 }
965 }
966 });
967 return dep;
968}
969function set(target, key, val) {
970 if (process.env.NODE_ENV !== 'production' && (isUndef(target) || isPrimitive(target))) {
971 warn("Cannot set reactive property on undefined, null, or primitive value: ".concat(target));
972 }
973 if (isReadonly(target)) {
974 process.env.NODE_ENV !== 'production' && warn("Set operation on key \"".concat(key, "\" failed: target is readonly."));
975 return;
976 }
977 var ob = target.__ob__;
978 if (isArray(target) && isValidArrayIndex(key)) {
979 target.length = Math.max(target.length, key);
980 target.splice(key, 1, val);
981 // when mocking for SSR, array methods are not hijacked
982 if (ob && !ob.shallow && ob.mock) {
983 observe(val, false, true);
984 }
985 return val;
986 }
987 if (key in target && !(key in Object.prototype)) {
988 target[key] = val;
989 return val;
990 }
991 if (target._isVue || (ob && ob.vmCount)) {
992 process.env.NODE_ENV !== 'production' &&
993 warn('Avoid adding reactive properties to a Vue instance or its root $data ' +
994 'at runtime - declare it upfront in the data option.');
995 return val;
996 }
997 if (!ob) {
998 target[key] = val;
999 return val;
1000 }
1001 defineReactive(ob.value, key, val, undefined, ob.shallow, ob.mock);
1002 if (process.env.NODE_ENV !== 'production') {
1003 ob.dep.notify({
1004 type: "add" /* TriggerOpTypes.ADD */,
1005 target: target,
1006 key: key,
1007 newValue: val,
1008 oldValue: undefined
1009 });
1010 }
1011 else {
1012 ob.dep.notify();
1013 }
1014 return val;
1015}
1016function del(target, key) {
1017 if (process.env.NODE_ENV !== 'production' && (isUndef(target) || isPrimitive(target))) {
1018 warn("Cannot delete reactive property on undefined, null, or primitive value: ".concat(target));
1019 }
1020 if (isArray(target) && isValidArrayIndex(key)) {
1021 target.splice(key, 1);
1022 return;
1023 }
1024 var ob = target.__ob__;
1025 if (target._isVue || (ob && ob.vmCount)) {
1026 process.env.NODE_ENV !== 'production' &&
1027 warn('Avoid deleting properties on a Vue instance or its root $data ' +
1028 '- just set it to null.');
1029 return;
1030 }
1031 if (isReadonly(target)) {
1032 process.env.NODE_ENV !== 'production' &&
1033 warn("Delete operation on key \"".concat(key, "\" failed: target is readonly."));
1034 return;
1035 }
1036 if (!hasOwn(target, key)) {
1037 return;
1038 }
1039 delete target[key];
1040 if (!ob) {
1041 return;
1042 }
1043 if (process.env.NODE_ENV !== 'production') {
1044 ob.dep.notify({
1045 type: "delete" /* TriggerOpTypes.DELETE */,
1046 target: target,
1047 key: key
1048 });
1049 }
1050 else {
1051 ob.dep.notify();
1052 }
1053}
1054/**
1055 * Collect dependencies on array elements when the array is touched, since
1056 * we cannot intercept array element access like property getters.
1057 */
1058function dependArray(value) {
1059 for (var e = void 0, i = 0, l = value.length; i < l; i++) {
1060 e = value[i];
1061 if (e && e.__ob__) {
1062 e.__ob__.dep.depend();
1063 }
1064 if (isArray(e)) {
1065 dependArray(e);
1066 }
1067 }
1068}
1069
1070function reactive(target) {
1071 makeReactive(target, false);
1072 return target;
1073}
1074/**
1075 * Return a shallowly-reactive copy of the original object, where only the root
1076 * level properties are reactive. It also does not auto-unwrap refs (even at the
1077 * root level).
1078 */
1079function shallowReactive(target) {
1080 makeReactive(target, true);
1081 def(target, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
1082 return target;
1083}
1084function makeReactive(target, shallow) {
1085 // if trying to observe a readonly proxy, return the readonly version.
1086 if (!isReadonly(target)) {
1087 if (process.env.NODE_ENV !== 'production') {
1088 if (isArray(target)) {
1089 warn("Avoid using Array as root value for ".concat(shallow ? "shallowReactive()" : "reactive()", " as it cannot be tracked in watch() or watchEffect(). Use ").concat(shallow ? "shallowRef()" : "ref()", " instead. This is a Vue-2-only limitation."));
1090 }
1091 var existingOb = target && target.__ob__;
1092 if (existingOb && existingOb.shallow !== shallow) {
1093 warn("Target is already a ".concat(existingOb.shallow ? "" : "non-", "shallow reactive object, and cannot be converted to ").concat(shallow ? "" : "non-", "shallow."));
1094 }
1095 }
1096 var ob = observe(target, shallow, isServerRendering() /* ssr mock reactivity */);
1097 if (process.env.NODE_ENV !== 'production' && !ob) {
1098 if (target == null || isPrimitive(target)) {
1099 warn("value cannot be made reactive: ".concat(String(target)));
1100 }
1101 if (isCollectionType(target)) {
1102 warn("Vue 2 does not support reactive collection types such as Map or Set.");
1103 }
1104 }
1105 }
1106}
1107function isReactive(value) {
1108 if (isReadonly(value)) {
1109 return isReactive(value["__v_raw" /* ReactiveFlags.RAW */]);
1110 }
1111 return !!(value && value.__ob__);
1112}
1113function isShallow(value) {
1114 return !!(value && value.__v_isShallow);
1115}
1116function isReadonly(value) {
1117 return !!(value && value.__v_isReadonly);
1118}
1119function isProxy(value) {
1120 return isReactive(value) || isReadonly(value);
1121}
1122function toRaw(observed) {
1123 var raw = observed && observed["__v_raw" /* ReactiveFlags.RAW */];
1124 return raw ? toRaw(raw) : observed;
1125}
1126function markRaw(value) {
1127 // non-extensible objects won't be observed anyway
1128 if (Object.isExtensible(value)) {
1129 def(value, "__v_skip" /* ReactiveFlags.SKIP */, true);
1130 }
1131 return value;
1132}
1133/**
1134 * @internal
1135 */
1136function isCollectionType(value) {
1137 var type = toRawType(value);
1138 return (type === 'Map' || type === 'WeakMap' || type === 'Set' || type === 'WeakSet');
1139}
1140
1141/**
1142 * @internal
1143 */
1144var RefFlag = "__v_isRef";
1145function isRef(r) {
1146 return !!(r && r.__v_isRef === true);
1147}
1148function ref$1(value) {
1149 return createRef(value, false);
1150}
1151function shallowRef(value) {
1152 return createRef(value, true);
1153}
1154function createRef(rawValue, shallow) {
1155 if (isRef(rawValue)) {
1156 return rawValue;
1157 }
1158 var ref = {};
1159 def(ref, RefFlag, true);
1160 def(ref, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, shallow);
1161 def(ref, 'dep', defineReactive(ref, 'value', rawValue, null, shallow, isServerRendering()));
1162 return ref;
1163}
1164function triggerRef(ref) {
1165 if (process.env.NODE_ENV !== 'production' && !ref.dep) {
1166 warn("received object is not a triggerable ref.");
1167 }
1168 if (process.env.NODE_ENV !== 'production') {
1169 ref.dep &&
1170 ref.dep.notify({
1171 type: "set" /* TriggerOpTypes.SET */,
1172 target: ref,
1173 key: 'value'
1174 });
1175 }
1176 else {
1177 ref.dep && ref.dep.notify();
1178 }
1179}
1180function unref(ref) {
1181 return isRef(ref) ? ref.value : ref;
1182}
1183function proxyRefs(objectWithRefs) {
1184 if (isReactive(objectWithRefs)) {
1185 return objectWithRefs;
1186 }
1187 var proxy = {};
1188 var keys = Object.keys(objectWithRefs);
1189 for (var i = 0; i < keys.length; i++) {
1190 proxyWithRefUnwrap(proxy, objectWithRefs, keys[i]);
1191 }
1192 return proxy;
1193}
1194function proxyWithRefUnwrap(target, source, key) {
1195 Object.defineProperty(target, key, {
1196 enumerable: true,
1197 configurable: true,
1198 get: function () {
1199 var val = source[key];
1200 if (isRef(val)) {
1201 return val.value;
1202 }
1203 else {
1204 var ob = val && val.__ob__;
1205 if (ob)
1206 ob.dep.depend();
1207 return val;
1208 }
1209 },
1210 set: function (value) {
1211 var oldValue = source[key];
1212 if (isRef(oldValue) && !isRef(value)) {
1213 oldValue.value = value;
1214 }
1215 else {
1216 source[key] = value;
1217 }
1218 }
1219 });
1220}
1221function customRef(factory) {
1222 var dep = new Dep();
1223 var _a = factory(function () {
1224 if (process.env.NODE_ENV !== 'production') {
1225 dep.depend({
1226 target: ref,
1227 type: "get" /* TrackOpTypes.GET */,
1228 key: 'value'
1229 });
1230 }
1231 else {
1232 dep.depend();
1233 }
1234 }, function () {
1235 if (process.env.NODE_ENV !== 'production') {
1236 dep.notify({
1237 target: ref,
1238 type: "set" /* TriggerOpTypes.SET */,
1239 key: 'value'
1240 });
1241 }
1242 else {
1243 dep.notify();
1244 }
1245 }), get = _a.get, set = _a.set;
1246 var ref = {
1247 get value() {
1248 return get();
1249 },
1250 set value(newVal) {
1251 set(newVal);
1252 }
1253 };
1254 def(ref, RefFlag, true);
1255 return ref;
1256}
1257function toRefs(object) {
1258 if (process.env.NODE_ENV !== 'production' && !isReactive(object)) {
1259 warn("toRefs() expects a reactive object but received a plain one.");
1260 }
1261 var ret = isArray(object) ? new Array(object.length) : {};
1262 for (var key in object) {
1263 ret[key] = toRef(object, key);
1264 }
1265 return ret;
1266}
1267function toRef(object, key, defaultValue) {
1268 var val = object[key];
1269 if (isRef(val)) {
1270 return val;
1271 }
1272 var ref = {
1273 get value() {
1274 var val = object[key];
1275 return val === undefined ? defaultValue : val;
1276 },
1277 set value(newVal) {
1278 object[key] = newVal;
1279 }
1280 };
1281 def(ref, RefFlag, true);
1282 return ref;
1283}
1284
1285var rawToReadonlyFlag = "__v_rawToReadonly";
1286var rawToShallowReadonlyFlag = "__v_rawToShallowReadonly";
1287function readonly(target) {
1288 return createReadonly(target, false);
1289}
1290function createReadonly(target, shallow) {
1291 if (!isPlainObject(target)) {
1292 if (process.env.NODE_ENV !== 'production') {
1293 if (isArray(target)) {
1294 warn("Vue 2 does not support readonly arrays.");
1295 }
1296 else if (isCollectionType(target)) {
1297 warn("Vue 2 does not support readonly collection types such as Map or Set.");
1298 }
1299 else {
1300 warn("value cannot be made readonly: ".concat(typeof target));
1301 }
1302 }
1303 return target;
1304 }
1305 if (process.env.NODE_ENV !== 'production' && !Object.isExtensible(target)) {
1306 warn("Vue 2 does not support creating readonly proxy for non-extensible object.");
1307 }
1308 // already a readonly object
1309 if (isReadonly(target)) {
1310 return target;
1311 }
1312 // already has a readonly proxy
1313 var existingFlag = shallow ? rawToShallowReadonlyFlag : rawToReadonlyFlag;
1314 var existingProxy = target[existingFlag];
1315 if (existingProxy) {
1316 return existingProxy;
1317 }
1318 var proxy = Object.create(Object.getPrototypeOf(target));
1319 def(target, existingFlag, proxy);
1320 def(proxy, "__v_isReadonly" /* ReactiveFlags.IS_READONLY */, true);
1321 def(proxy, "__v_raw" /* ReactiveFlags.RAW */, target);
1322 if (isRef(target)) {
1323 def(proxy, RefFlag, true);
1324 }
1325 if (shallow || isShallow(target)) {
1326 def(proxy, "__v_isShallow" /* ReactiveFlags.IS_SHALLOW */, true);
1327 }
1328 var keys = Object.keys(target);
1329 for (var i = 0; i < keys.length; i++) {
1330 defineReadonlyProperty(proxy, target, keys[i], shallow);
1331 }
1332 return proxy;
1333}
1334function defineReadonlyProperty(proxy, target, key, shallow) {
1335 Object.defineProperty(proxy, key, {
1336 enumerable: true,
1337 configurable: true,
1338 get: function () {
1339 var val = target[key];
1340 return shallow || !isPlainObject(val) ? val : readonly(val);
1341 },
1342 set: function () {
1343 process.env.NODE_ENV !== 'production' &&
1344 warn("Set operation on key \"".concat(key, "\" failed: target is readonly."));
1345 }
1346 });
1347}
1348/**
1349 * Returns a reactive-copy of the original object, where only the root level
1350 * properties are readonly, and does NOT unwrap refs nor recursively convert
1351 * returned properties.
1352 * This is used for creating the props proxy object for stateful components.
1353 */
1354function shallowReadonly(target) {
1355 return createReadonly(target, true);
1356}
1357
1358function computed(getterOrOptions, debugOptions) {
1359 var getter;
1360 var setter;
1361 var onlyGetter = isFunction(getterOrOptions);
1362 if (onlyGetter) {
1363 getter = getterOrOptions;
1364 setter = process.env.NODE_ENV !== 'production'
1365 ? function () {
1366 warn('Write operation failed: computed value is readonly');
1367 }
1368 : noop;
1369 }
1370 else {
1371 getter = getterOrOptions.get;
1372 setter = getterOrOptions.set;
1373 }
1374 var watcher = isServerRendering()
1375 ? null
1376 : new Watcher(currentInstance, getter, noop, { lazy: true });
1377 if (process.env.NODE_ENV !== 'production' && watcher && debugOptions) {
1378 watcher.onTrack = debugOptions.onTrack;
1379 watcher.onTrigger = debugOptions.onTrigger;
1380 }
1381 var ref = {
1382 // some libs rely on the presence effect for checking computed refs
1383 // from normal refs, but the implementation doesn't matter
1384 effect: watcher,
1385 get value() {
1386 if (watcher) {
1387 if (watcher.dirty) {
1388 watcher.evaluate();
1389 }
1390 if (Dep.target) {
1391 if (process.env.NODE_ENV !== 'production' && Dep.target.onTrack) {
1392 Dep.target.onTrack({
1393 effect: Dep.target,
1394 target: ref,
1395 type: "get" /* TrackOpTypes.GET */,
1396 key: 'value'
1397 });
1398 }
1399 watcher.depend();
1400 }
1401 return watcher.value;
1402 }
1403 else {
1404 return getter();
1405 }
1406 },
1407 set value(newVal) {
1408 setter(newVal);
1409 }
1410 };
1411 def(ref, RefFlag, true);
1412 def(ref, "__v_isReadonly" /* ReactiveFlags.IS_READONLY */, onlyGetter);
1413 return ref;
1414}
1415
1416var WATCHER = "watcher";
1417var WATCHER_CB = "".concat(WATCHER, " callback");
1418var WATCHER_GETTER = "".concat(WATCHER, " getter");
1419var WATCHER_CLEANUP = "".concat(WATCHER, " cleanup");
1420// Simple effect.
1421function watchEffect(effect, options) {
1422 return doWatch(effect, null, options);
1423}
1424function watchPostEffect(effect, options) {
1425 return doWatch(effect, null, (process.env.NODE_ENV !== 'production'
1426 ? __assign(__assign({}, options), { flush: 'post' }) : { flush: 'post' }));
1427}
1428function watchSyncEffect(effect, options) {
1429 return doWatch(effect, null, (process.env.NODE_ENV !== 'production'
1430 ? __assign(__assign({}, options), { flush: 'sync' }) : { flush: 'sync' }));
1431}
1432// initial value for watchers to trigger on undefined initial values
1433var INITIAL_WATCHER_VALUE = {};
1434// implementation
1435function watch(source, cb, options) {
1436 if (process.env.NODE_ENV !== 'production' && typeof cb !== 'function') {
1437 warn("`watch(fn, options?)` signature has been moved to a separate API. " +
1438 "Use `watchEffect(fn, options?)` instead. `watch` now only " +
1439 "supports `watch(source, cb, options?) signature.");
1440 }
1441 return doWatch(source, cb, options);
1442}
1443function doWatch(source, cb, _a) {
1444 var _b = _a === void 0 ? emptyObject : _a, immediate = _b.immediate, deep = _b.deep, _c = _b.flush, flush = _c === void 0 ? 'pre' : _c, onTrack = _b.onTrack, onTrigger = _b.onTrigger;
1445 if (process.env.NODE_ENV !== 'production' && !cb) {
1446 if (immediate !== undefined) {
1447 warn("watch() \"immediate\" option is only respected when using the " +
1448 "watch(source, callback, options?) signature.");
1449 }
1450 if (deep !== undefined) {
1451 warn("watch() \"deep\" option is only respected when using the " +
1452 "watch(source, callback, options?) signature.");
1453 }
1454 }
1455 var warnInvalidSource = function (s) {
1456 warn("Invalid watch source: ".concat(s, ". A watch source can only be a getter/effect ") +
1457 "function, a ref, a reactive object, or an array of these types.");
1458 };
1459 var instance = currentInstance;
1460 var call = function (fn, type, args) {
1461 if (args === void 0) { args = null; }
1462 return invokeWithErrorHandling(fn, null, args, instance, type);
1463 };
1464 var getter;
1465 var forceTrigger = false;
1466 var isMultiSource = false;
1467 if (isRef(source)) {
1468 getter = function () { return source.value; };
1469 forceTrigger = isShallow(source);
1470 }
1471 else if (isReactive(source)) {
1472 getter = function () {
1473 source.__ob__.dep.depend();
1474 return source;
1475 };
1476 deep = true;
1477 }
1478 else if (isArray(source)) {
1479 isMultiSource = true;
1480 forceTrigger = source.some(function (s) { return isReactive(s) || isShallow(s); });
1481 getter = function () {
1482 return source.map(function (s) {
1483 if (isRef(s)) {
1484 return s.value;
1485 }
1486 else if (isReactive(s)) {
1487 return traverse(s);
1488 }
1489 else if (isFunction(s)) {
1490 return call(s, WATCHER_GETTER);
1491 }
1492 else {
1493 process.env.NODE_ENV !== 'production' && warnInvalidSource(s);
1494 }
1495 });
1496 };
1497 }
1498 else if (isFunction(source)) {
1499 if (cb) {
1500 // getter with cb
1501 getter = function () { return call(source, WATCHER_GETTER); };
1502 }
1503 else {
1504 // no cb -> simple effect
1505 getter = function () {
1506 if (instance && instance._isDestroyed) {
1507 return;
1508 }
1509 if (cleanup) {
1510 cleanup();
1511 }
1512 return call(source, WATCHER, [onCleanup]);
1513 };
1514 }
1515 }
1516 else {
1517 getter = noop;
1518 process.env.NODE_ENV !== 'production' && warnInvalidSource(source);
1519 }
1520 if (cb && deep) {
1521 var baseGetter_1 = getter;
1522 getter = function () { return traverse(baseGetter_1()); };
1523 }
1524 var cleanup;
1525 var onCleanup = function (fn) {
1526 cleanup = watcher.onStop = function () {
1527 call(fn, WATCHER_CLEANUP);
1528 };
1529 };
1530 // in SSR there is no need to setup an actual effect, and it should be noop
1531 // unless it's eager
1532 if (isServerRendering()) {
1533 // we will also not call the invalidate callback (+ runner is not set up)
1534 onCleanup = noop;
1535 if (!cb) {
1536 getter();
1537 }
1538 else if (immediate) {
1539 call(cb, WATCHER_CB, [
1540 getter(),
1541 isMultiSource ? [] : undefined,
1542 onCleanup
1543 ]);
1544 }
1545 return noop;
1546 }
1547 var watcher = new Watcher(currentInstance, getter, noop, {
1548 lazy: true
1549 });
1550 watcher.noRecurse = !cb;
1551 var oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
1552 // overwrite default run
1553 watcher.run = function () {
1554 if (!watcher.active) {
1555 return;
1556 }
1557 if (cb) {
1558 // watch(source, cb)
1559 var newValue = watcher.get();
1560 if (deep ||
1561 forceTrigger ||
1562 (isMultiSource
1563 ? newValue.some(function (v, i) {
1564 return hasChanged(v, oldValue[i]);
1565 })
1566 : hasChanged(newValue, oldValue))) {
1567 // cleanup before running cb again
1568 if (cleanup) {
1569 cleanup();
1570 }
1571 call(cb, WATCHER_CB, [
1572 newValue,
1573 // pass undefined as the old value when it's changed for the first time
1574 oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
1575 onCleanup
1576 ]);
1577 oldValue = newValue;
1578 }
1579 }
1580 else {
1581 // watchEffect
1582 watcher.get();
1583 }
1584 };
1585 if (flush === 'sync') {
1586 watcher.update = watcher.run;
1587 }
1588 else if (flush === 'post') {
1589 watcher.post = true;
1590 watcher.update = function () { return queueWatcher(watcher); };
1591 }
1592 else {
1593 // pre
1594 watcher.update = function () {
1595 if (instance && instance === currentInstance && !instance._isMounted) {
1596 // pre-watcher triggered before
1597 var buffer = instance._preWatchers || (instance._preWatchers = []);
1598 if (buffer.indexOf(watcher) < 0)
1599 buffer.push(watcher);
1600 }
1601 else {
1602 queueWatcher(watcher);
1603 }
1604 };
1605 }
1606 if (process.env.NODE_ENV !== 'production') {
1607 watcher.onTrack = onTrack;
1608 watcher.onTrigger = onTrigger;
1609 }
1610 // initial run
1611 if (cb) {
1612 if (immediate) {
1613 watcher.run();
1614 }
1615 else {
1616 oldValue = watcher.get();
1617 }
1618 }
1619 else if (flush === 'post' && instance) {
1620 instance.$once('hook:mounted', function () { return watcher.get(); });
1621 }
1622 else {
1623 watcher.get();
1624 }
1625 return function () {
1626 watcher.teardown();
1627 };
1628}
1629
1630var activeEffectScope;
1631var EffectScope = /** @class */ (function () {
1632 function EffectScope(detached) {
1633 if (detached === void 0) { detached = false; }
1634 this.detached = detached;
1635 /**
1636 * @internal
1637 */
1638 this.active = true;
1639 /**
1640 * @internal
1641 */
1642 this.effects = [];
1643 /**
1644 * @internal
1645 */
1646 this.cleanups = [];
1647 this.parent = activeEffectScope;
1648 if (!detached && activeEffectScope) {
1649 this.index =
1650 (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
1651 }
1652 }
1653 EffectScope.prototype.run = function (fn) {
1654 if (this.active) {
1655 var currentEffectScope = activeEffectScope;
1656 try {
1657 activeEffectScope = this;
1658 return fn();
1659 }
1660 finally {
1661 activeEffectScope = currentEffectScope;
1662 }
1663 }
1664 else if (process.env.NODE_ENV !== 'production') {
1665 warn("cannot run an inactive effect scope.");
1666 }
1667 };
1668 /**
1669 * This should only be called on non-detached scopes
1670 * @internal
1671 */
1672 EffectScope.prototype.on = function () {
1673 activeEffectScope = this;
1674 };
1675 /**
1676 * This should only be called on non-detached scopes
1677 * @internal
1678 */
1679 EffectScope.prototype.off = function () {
1680 activeEffectScope = this.parent;
1681 };
1682 EffectScope.prototype.stop = function (fromParent) {
1683 if (this.active) {
1684 var i = void 0, l = void 0;
1685 for (i = 0, l = this.effects.length; i < l; i++) {
1686 this.effects[i].teardown();
1687 }
1688 for (i = 0, l = this.cleanups.length; i < l; i++) {
1689 this.cleanups[i]();
1690 }
1691 if (this.scopes) {
1692 for (i = 0, l = this.scopes.length; i < l; i++) {
1693 this.scopes[i].stop(true);
1694 }
1695 }
1696 // nested scope, dereference from parent to avoid memory leaks
1697 if (!this.detached && this.parent && !fromParent) {
1698 // optimized O(1) removal
1699 var last = this.parent.scopes.pop();
1700 if (last && last !== this) {
1701 this.parent.scopes[this.index] = last;
1702 last.index = this.index;
1703 }
1704 }
1705 this.parent = undefined;
1706 this.active = false;
1707 }
1708 };
1709 return EffectScope;
1710}());
1711function effectScope(detached) {
1712 return new EffectScope(detached);
1713}
1714/**
1715 * @internal
1716 */
1717function recordEffectScope(effect, scope) {
1718 if (scope === void 0) { scope = activeEffectScope; }
1719 if (scope && scope.active) {
1720 scope.effects.push(effect);
1721 }
1722}
1723function getCurrentScope() {
1724 return activeEffectScope;
1725}
1726function onScopeDispose(fn) {
1727 if (activeEffectScope) {
1728 activeEffectScope.cleanups.push(fn);
1729 }
1730 else if (process.env.NODE_ENV !== 'production') {
1731 warn("onScopeDispose() is called when there is no active effect scope" +
1732 " to be associated with.");
1733 }
1734}
1735
1736function provide(key, value) {
1737 if (!currentInstance) {
1738 if (process.env.NODE_ENV !== 'production') {
1739 warn("provide() can only be used inside setup().");
1740 }
1741 }
1742 else {
1743 // TS doesn't allow symbol as index type
1744 resolveProvided(currentInstance)[key] = value;
1745 }
1746}
1747function resolveProvided(vm) {
1748 // by default an instance inherits its parent's provides object
1749 // but when it needs to provide values of its own, it creates its
1750 // own provides object using parent provides object as prototype.
1751 // this way in `inject` we can simply look up injections from direct
1752 // parent and let the prototype chain do the work.
1753 var existing = vm._provided;
1754 var parentProvides = vm.$parent && vm.$parent._provided;
1755 if (parentProvides === existing) {
1756 return (vm._provided = Object.create(parentProvides));
1757 }
1758 else {
1759 return existing;
1760 }
1761}
1762function inject(key, defaultValue, treatDefaultAsFactory) {
1763 if (treatDefaultAsFactory === void 0) { treatDefaultAsFactory = false; }
1764 // fallback to `currentRenderingInstance` so that this can be called in
1765 // a functional component
1766 var instance = currentInstance;
1767 if (instance) {
1768 // #2400
1769 // to support `app.use` plugins,
1770 // fallback to appContext's `provides` if the instance is at root
1771 var provides = instance.$parent && instance.$parent._provided;
1772 if (provides && key in provides) {
1773 // TS doesn't allow symbol as index type
1774 return provides[key];
1775 }
1776 else if (arguments.length > 1) {
1777 return treatDefaultAsFactory && isFunction(defaultValue)
1778 ? defaultValue.call(instance)
1779 : defaultValue;
1780 }
1781 else if (process.env.NODE_ENV !== 'production') {
1782 warn("injection \"".concat(String(key), "\" not found."));
1783 }
1784 }
1785 else if (process.env.NODE_ENV !== 'production') {
1786 warn("inject() can only be used inside setup() or functional components.");
1787 }
1788}
1789
1790var normalizeEvent = cached(function (name) {
1791 var passive = name.charAt(0) === '&';
1792 name = passive ? name.slice(1) : name;
1793 var once = name.charAt(0) === '~'; // Prefixed last, checked first
1794 name = once ? name.slice(1) : name;
1795 var capture = name.charAt(0) === '!';
1796 name = capture ? name.slice(1) : name;
1797 return {
1798 name: name,
1799 once: once,
1800 capture: capture,
1801 passive: passive
1802 };
1803});
1804function createFnInvoker(fns, vm) {
1805 function invoker() {
1806 var fns = invoker.fns;
1807 if (isArray(fns)) {
1808 var cloned = fns.slice();
1809 for (var i = 0; i < cloned.length; i++) {
1810 invokeWithErrorHandling(cloned[i], null, arguments, vm, "v-on handler");
1811 }
1812 }
1813 else {
1814 // return handler return value for single handlers
1815 return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler");
1816 }
1817 }
1818 invoker.fns = fns;
1819 return invoker;
1820}
1821function updateListeners(on, oldOn, add, remove, createOnceHandler, vm) {
1822 var name, cur, old, event;
1823 for (name in on) {
1824 cur = on[name];
1825 old = oldOn[name];
1826 event = normalizeEvent(name);
1827 if (isUndef(cur)) {
1828 process.env.NODE_ENV !== 'production' &&
1829 warn("Invalid handler for event \"".concat(event.name, "\": got ") + String(cur), vm);
1830 }
1831 else if (isUndef(old)) {
1832 if (isUndef(cur.fns)) {
1833 cur = on[name] = createFnInvoker(cur, vm);
1834 }
1835 if (isTrue(event.once)) {
1836 cur = on[name] = createOnceHandler(event.name, cur, event.capture);
1837 }
1838 add(event.name, cur, event.capture, event.passive, event.params);
1839 }
1840 else if (cur !== old) {
1841 old.fns = cur;
1842 on[name] = old;
1843 }
1844 }
1845 for (name in oldOn) {
1846 if (isUndef(on[name])) {
1847 event = normalizeEvent(name);
1848 remove(event.name, oldOn[name], event.capture);
1849 }
1850 }
1851}
1852
1853function mergeVNodeHook(def, hookKey, hook) {
1854 if (def instanceof VNode) {
1855 def = def.data.hook || (def.data.hook = {});
1856 }
1857 var invoker;
1858 var oldHook = def[hookKey];
1859 function wrappedHook() {
1860 hook.apply(this, arguments);
1861 // important: remove merged hook to ensure it's called only once
1862 // and prevent memory leak
1863 remove$2(invoker.fns, wrappedHook);
1864 }
1865 if (isUndef(oldHook)) {
1866 // no existing hook
1867 invoker = createFnInvoker([wrappedHook]);
1868 }
1869 else {
1870 /* istanbul ignore if */
1871 if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
1872 // already a merged invoker
1873 invoker = oldHook;
1874 invoker.fns.push(wrappedHook);
1875 }
1876 else {
1877 // existing plain hook
1878 invoker = createFnInvoker([oldHook, wrappedHook]);
1879 }
1880 }
1881 invoker.merged = true;
1882 def[hookKey] = invoker;
1883}
1884
1885function extractPropsFromVNodeData(data, Ctor, tag) {
1886 // we are only extracting raw values here.
1887 // validation and default values are handled in the child
1888 // component itself.
1889 var propOptions = Ctor.options.props;
1890 if (isUndef(propOptions)) {
1891 return;
1892 }
1893 var res = {};
1894 var attrs = data.attrs, props = data.props;
1895 if (isDef(attrs) || isDef(props)) {
1896 for (var key in propOptions) {
1897 var altKey = hyphenate(key);
1898 if (process.env.NODE_ENV !== 'production') {
1899 var keyInLowerCase = key.toLowerCase();
1900 if (key !== keyInLowerCase && attrs && hasOwn(attrs, keyInLowerCase)) {
1901 tip("Prop \"".concat(keyInLowerCase, "\" is passed to component ") +
1902 "".concat(formatComponentName(
1903 // @ts-expect-error tag is string
1904 tag || Ctor), ", but the declared prop name is") +
1905 " \"".concat(key, "\". ") +
1906 "Note that HTML attributes are case-insensitive and camelCased " +
1907 "props need to use their kebab-case equivalents when using in-DOM " +
1908 "templates. You should probably use \"".concat(altKey, "\" instead of \"").concat(key, "\"."));
1909 }
1910 }
1911 checkProp(res, props, key, altKey, true) ||
1912 checkProp(res, attrs, key, altKey, false);
1913 }
1914 }
1915 return res;
1916}
1917function checkProp(res, hash, key, altKey, preserve) {
1918 if (isDef(hash)) {
1919 if (hasOwn(hash, key)) {
1920 res[key] = hash[key];
1921 if (!preserve) {
1922 delete hash[key];
1923 }
1924 return true;
1925 }
1926 else if (hasOwn(hash, altKey)) {
1927 res[key] = hash[altKey];
1928 if (!preserve) {
1929 delete hash[altKey];
1930 }
1931 return true;
1932 }
1933 }
1934 return false;
1935}
1936
1937// The template compiler attempts to minimize the need for normalization by
1938// statically analyzing the template at compile time.
1939//
1940// For plain HTML markup, normalization can be completely skipped because the
1941// generated render function is guaranteed to return Array<VNode>. There are
1942// two cases where extra normalization is needed:
1943// 1. When the children contains components - because a functional component
1944// may return an Array instead of a single root. In this case, just a simple
1945// normalization is needed - if any child is an Array, we flatten the whole
1946// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
1947// because functional components already normalize their own children.
1948function simpleNormalizeChildren(children) {
1949 for (var i = 0; i < children.length; i++) {
1950 if (isArray(children[i])) {
1951 return Array.prototype.concat.apply([], children);
1952 }
1953 }
1954 return children;
1955}
1956// 2. When the children contains constructs that always generated nested Arrays,
1957// e.g. <template>, <slot>, v-for, or when the children is provided by user
1958// with hand-written render functions / JSX. In such cases a full normalization
1959// is needed to cater to all possible types of children values.
1960function normalizeChildren(children) {
1961 return isPrimitive(children)
1962 ? [createTextVNode(children)]
1963 : isArray(children)
1964 ? normalizeArrayChildren(children)
1965 : undefined;
1966}
1967function isTextNode(node) {
1968 return isDef(node) && isDef(node.text) && isFalse(node.isComment);
1969}
1970function normalizeArrayChildren(children, nestedIndex) {
1971 var res = [];
1972 var i, c, lastIndex, last;
1973 for (i = 0; i < children.length; i++) {
1974 c = children[i];
1975 if (isUndef(c) || typeof c === 'boolean')
1976 continue;
1977 lastIndex = res.length - 1;
1978 last = res[lastIndex];
1979 // nested
1980 if (isArray(c)) {
1981 if (c.length > 0) {
1982 c = normalizeArrayChildren(c, "".concat(nestedIndex || '', "_").concat(i));
1983 // merge adjacent text nodes
1984 if (isTextNode(c[0]) && isTextNode(last)) {
1985 res[lastIndex] = createTextVNode(last.text + c[0].text);
1986 c.shift();
1987 }
1988 res.push.apply(res, c);
1989 }
1990 }
1991 else if (isPrimitive(c)) {
1992 if (isTextNode(last)) {
1993 // merge adjacent text nodes
1994 // this is necessary for SSR hydration because text nodes are
1995 // essentially merged when rendered to HTML strings
1996 res[lastIndex] = createTextVNode(last.text + c);
1997 }
1998 else if (c !== '') {
1999 // convert primitive to vnode
2000 res.push(createTextVNode(c));
2001 }
2002 }
2003 else {
2004 if (isTextNode(c) && isTextNode(last)) {
2005 // merge adjacent text nodes
2006 res[lastIndex] = createTextVNode(last.text + c.text);
2007 }
2008 else {
2009 // default key for nested array children (likely generated by v-for)
2010 if (isTrue(children._isVList) &&
2011 isDef(c.tag) &&
2012 isUndef(c.key) &&
2013 isDef(nestedIndex)) {
2014 c.key = "__vlist".concat(nestedIndex, "_").concat(i, "__");
2015 }
2016 res.push(c);
2017 }
2018 }
2019 }
2020 return res;
2021}
2022
2023/**
2024 * Runtime helper for rendering v-for lists.
2025 */
2026function renderList(val, render) {
2027 var ret = null, i, l, keys, key;
2028 if (isArray(val) || typeof val === 'string') {
2029 ret = new Array(val.length);
2030 for (i = 0, l = val.length; i < l; i++) {
2031 ret[i] = render(val[i], i);
2032 }
2033 }
2034 else if (typeof val === 'number') {
2035 ret = new Array(val);
2036 for (i = 0; i < val; i++) {
2037 ret[i] = render(i + 1, i);
2038 }
2039 }
2040 else if (isObject(val)) {
2041 if (hasSymbol && val[Symbol.iterator]) {
2042 ret = [];
2043 var iterator = val[Symbol.iterator]();
2044 var result = iterator.next();
2045 while (!result.done) {
2046 ret.push(render(result.value, ret.length));
2047 result = iterator.next();
2048 }
2049 }
2050 else {
2051 keys = Object.keys(val);
2052 ret = new Array(keys.length);
2053 for (i = 0, l = keys.length; i < l; i++) {
2054 key = keys[i];
2055 ret[i] = render(val[key], key, i);
2056 }
2057 }
2058 }
2059 if (!isDef(ret)) {
2060 ret = [];
2061 }
2062 ret._isVList = true;
2063 return ret;
2064}
2065
2066/**
2067 * Runtime helper for rendering <slot>
2068 */
2069function renderSlot(name, fallbackRender, props, bindObject) {
2070 var scopedSlotFn = this.$scopedSlots[name];
2071 var nodes;
2072 if (scopedSlotFn) {
2073 // scoped slot
2074 props = props || {};
2075 if (bindObject) {
2076 if (process.env.NODE_ENV !== 'production' && !isObject(bindObject)) {
2077 warn('slot v-bind without argument expects an Object', this);
2078 }
2079 props = extend(extend({}, bindObject), props);
2080 }
2081 nodes =
2082 scopedSlotFn(props) ||
2083 (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);
2084 }
2085 else {
2086 nodes =
2087 this.$slots[name] ||
2088 (isFunction(fallbackRender) ? fallbackRender() : fallbackRender);
2089 }
2090 var target = props && props.slot;
2091 if (target) {
2092 return this.$createElement('template', { slot: target }, nodes);
2093 }
2094 else {
2095 return nodes;
2096 }
2097}
2098
2099/**
2100 * Runtime helper for resolving filters
2101 */
2102function resolveFilter(id) {
2103 return resolveAsset(this.$options, 'filters', id, true) || identity;
2104}
2105
2106function isKeyNotMatch(expect, actual) {
2107 if (isArray(expect)) {
2108 return expect.indexOf(actual) === -1;
2109 }
2110 else {
2111 return expect !== actual;
2112 }
2113}
2114/**
2115 * Runtime helper for checking keyCodes from config.
2116 * exposed as Vue.prototype._k
2117 * passing in eventKeyName as last argument separately for backwards compat
2118 */
2119function checkKeyCodes(eventKeyCode, key, builtInKeyCode, eventKeyName, builtInKeyName) {
2120 var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
2121 if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
2122 return isKeyNotMatch(builtInKeyName, eventKeyName);
2123 }
2124 else if (mappedKeyCode) {
2125 return isKeyNotMatch(mappedKeyCode, eventKeyCode);
2126 }
2127 else if (eventKeyName) {
2128 return hyphenate(eventKeyName) !== key;
2129 }
2130 return eventKeyCode === undefined;
2131}
2132
2133/**
2134 * Runtime helper for merging v-bind="object" into a VNode's data.
2135 */
2136function bindObjectProps(data, tag, value, asProp, isSync) {
2137 if (value) {
2138 if (!isObject(value)) {
2139 process.env.NODE_ENV !== 'production' &&
2140 warn('v-bind without argument expects an Object or Array value', this);
2141 }
2142 else {
2143 if (isArray(value)) {
2144 value = toObject(value);
2145 }
2146 var hash = void 0;
2147 var _loop_1 = function (key) {
2148 if (key === 'class' || key === 'style' || isReservedAttribute(key)) {
2149 hash = data;
2150 }
2151 else {
2152 var type = data.attrs && data.attrs.type;
2153 hash =
2154 asProp || config.mustUseProp(tag, type, key)
2155 ? data.domProps || (data.domProps = {})
2156 : data.attrs || (data.attrs = {});
2157 }
2158 var camelizedKey = camelize(key);
2159 var hyphenatedKey = hyphenate(key);
2160 if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
2161 hash[key] = value[key];
2162 if (isSync) {
2163 var on = data.on || (data.on = {});
2164 on["update:".concat(key)] = function ($event) {
2165 value[key] = $event;
2166 };
2167 }
2168 }
2169 };
2170 for (var key in value) {
2171 _loop_1(key);
2172 }
2173 }
2174 }
2175 return data;
2176}
2177
2178/**
2179 * Runtime helper for rendering static trees.
2180 */
2181function renderStatic(index, isInFor) {
2182 var cached = this._staticTrees || (this._staticTrees = []);
2183 var tree = cached[index];
2184 // if has already-rendered static tree and not inside v-for,
2185 // we can reuse the same tree.
2186 if (tree && !isInFor) {
2187 return tree;
2188 }
2189 // otherwise, render a fresh tree.
2190 tree = cached[index] = this.$options.staticRenderFns[index].call(this._renderProxy, this._c, this // for render fns generated for functional component templates
2191 );
2192 markStatic(tree, "__static__".concat(index), false);
2193 return tree;
2194}
2195/**
2196 * Runtime helper for v-once.
2197 * Effectively it means marking the node as static with a unique key.
2198 */
2199function markOnce(tree, index, key) {
2200 markStatic(tree, "__once__".concat(index).concat(key ? "_".concat(key) : ""), true);
2201 return tree;
2202}
2203function markStatic(tree, key, isOnce) {
2204 if (isArray(tree)) {
2205 for (var i = 0; i < tree.length; i++) {
2206 if (tree[i] && typeof tree[i] !== 'string') {
2207 markStaticNode(tree[i], "".concat(key, "_").concat(i), isOnce);
2208 }
2209 }
2210 }
2211 else {
2212 markStaticNode(tree, key, isOnce);
2213 }
2214}
2215function markStaticNode(node, key, isOnce) {
2216 node.isStatic = true;
2217 node.key = key;
2218 node.isOnce = isOnce;
2219}
2220
2221function bindObjectListeners(data, value) {
2222 if (value) {
2223 if (!isPlainObject(value)) {
2224 process.env.NODE_ENV !== 'production' && warn('v-on without argument expects an Object value', this);
2225 }
2226 else {
2227 var on = (data.on = data.on ? extend({}, data.on) : {});
2228 for (var key in value) {
2229 var existing = on[key];
2230 var ours = value[key];
2231 on[key] = existing ? [].concat(existing, ours) : ours;
2232 }
2233 }
2234 }
2235 return data;
2236}
2237
2238function resolveScopedSlots(fns, res,
2239// the following are added in 2.6
2240hasDynamicKeys, contentHashKey) {
2241 res = res || { $stable: !hasDynamicKeys };
2242 for (var i = 0; i < fns.length; i++) {
2243 var slot = fns[i];
2244 if (isArray(slot)) {
2245 resolveScopedSlots(slot, res, hasDynamicKeys);
2246 }
2247 else if (slot) {
2248 // marker for reverse proxying v-slot without scope on this.$slots
2249 // @ts-expect-error
2250 if (slot.proxy) {
2251 // @ts-expect-error
2252 slot.fn.proxy = true;
2253 }
2254 res[slot.key] = slot.fn;
2255 }
2256 }
2257 if (contentHashKey) {
2258 res.$key = contentHashKey;
2259 }
2260 return res;
2261}
2262
2263// helper to process dynamic keys for dynamic arguments in v-bind and v-on.
2264function bindDynamicKeys(baseObj, values) {
2265 for (var i = 0; i < values.length; i += 2) {
2266 var key = values[i];
2267 if (typeof key === 'string' && key) {
2268 baseObj[values[i]] = values[i + 1];
2269 }
2270 else if (process.env.NODE_ENV !== 'production' && key !== '' && key !== null) {
2271 // null is a special value for explicitly removing a binding
2272 warn("Invalid value for dynamic directive argument (expected string or null): ".concat(key), this);
2273 }
2274 }
2275 return baseObj;
2276}
2277// helper to dynamically append modifier runtime markers to event names.
2278// ensure only append when value is already string, otherwise it will be cast
2279// to string and cause the type check to miss.
2280function prependModifier(value, symbol) {
2281 return typeof value === 'string' ? symbol + value : value;
2282}
2283
2284function installRenderHelpers(target) {
2285 target._o = markOnce;
2286 target._n = toNumber;
2287 target._s = toString;
2288 target._l = renderList;
2289 target._t = renderSlot;
2290 target._q = looseEqual;
2291 target._i = looseIndexOf;
2292 target._m = renderStatic;
2293 target._f = resolveFilter;
2294 target._k = checkKeyCodes;
2295 target._b = bindObjectProps;
2296 target._v = createTextVNode;
2297 target._e = createEmptyVNode;
2298 target._u = resolveScopedSlots;
2299 target._g = bindObjectListeners;
2300 target._d = bindDynamicKeys;
2301 target._p = prependModifier;
2302}
2303
2304/**
2305 * Runtime helper for resolving raw children VNodes into a slot object.
2306 */
2307function resolveSlots(children, context) {
2308 if (!children || !children.length) {
2309 return {};
2310 }
2311 var slots = {};
2312 for (var i = 0, l = children.length; i < l; i++) {
2313 var child = children[i];
2314 var data = child.data;
2315 // remove slot attribute if the node is resolved as a Vue slot node
2316 if (data && data.attrs && data.attrs.slot) {
2317 delete data.attrs.slot;
2318 }
2319 // named slots should only be respected if the vnode was rendered in the
2320 // same context.
2321 if ((child.context === context || child.fnContext === context) &&
2322 data &&
2323 data.slot != null) {
2324 var name_1 = data.slot;
2325 var slot = slots[name_1] || (slots[name_1] = []);
2326 if (child.tag === 'template') {
2327 slot.push.apply(slot, child.children || []);
2328 }
2329 else {
2330 slot.push(child);
2331 }
2332 }
2333 else {
2334 (slots.default || (slots.default = [])).push(child);
2335 }
2336 }
2337 // ignore slots that contains only whitespace
2338 for (var name_2 in slots) {
2339 if (slots[name_2].every(isWhitespace)) {
2340 delete slots[name_2];
2341 }
2342 }
2343 return slots;
2344}
2345function isWhitespace(node) {
2346 return (node.isComment && !node.asyncFactory) || node.text === ' ';
2347}
2348
2349function isAsyncPlaceholder(node) {
2350 // @ts-expect-error not really boolean type
2351 return node.isComment && node.asyncFactory;
2352}
2353
2354function normalizeScopedSlots(ownerVm, scopedSlots, normalSlots, prevScopedSlots) {
2355 var res;
2356 var hasNormalSlots = Object.keys(normalSlots).length > 0;
2357 var isStable = scopedSlots ? !!scopedSlots.$stable : !hasNormalSlots;
2358 var key = scopedSlots && scopedSlots.$key;
2359 if (!scopedSlots) {
2360 res = {};
2361 }
2362 else if (scopedSlots._normalized) {
2363 // fast path 1: child component re-render only, parent did not change
2364 return scopedSlots._normalized;
2365 }
2366 else if (isStable &&
2367 prevScopedSlots &&
2368 prevScopedSlots !== emptyObject &&
2369 key === prevScopedSlots.$key &&
2370 !hasNormalSlots &&
2371 !prevScopedSlots.$hasNormal) {
2372 // fast path 2: stable scoped slots w/ no normal slots to proxy,
2373 // only need to normalize once
2374 return prevScopedSlots;
2375 }
2376 else {
2377 res = {};
2378 for (var key_1 in scopedSlots) {
2379 if (scopedSlots[key_1] && key_1[0] !== '$') {
2380 res[key_1] = normalizeScopedSlot(ownerVm, normalSlots, key_1, scopedSlots[key_1]);
2381 }
2382 }
2383 }
2384 // expose normal slots on scopedSlots
2385 for (var key_2 in normalSlots) {
2386 if (!(key_2 in res)) {
2387 res[key_2] = proxyNormalSlot(normalSlots, key_2);
2388 }
2389 }
2390 // avoriaz seems to mock a non-extensible $scopedSlots object
2391 // and when that is passed down this would cause an error
2392 if (scopedSlots && Object.isExtensible(scopedSlots)) {
2393 scopedSlots._normalized = res;
2394 }
2395 def(res, '$stable', isStable);
2396 def(res, '$key', key);
2397 def(res, '$hasNormal', hasNormalSlots);
2398 return res;
2399}
2400function normalizeScopedSlot(vm, normalSlots, key, fn) {
2401 var normalized = function () {
2402 var cur = currentInstance;
2403 setCurrentInstance(vm);
2404 var res = arguments.length ? fn.apply(null, arguments) : fn({});
2405 res =
2406 res && typeof res === 'object' && !isArray(res)
2407 ? [res] // single vnode
2408 : normalizeChildren(res);
2409 var vnode = res && res[0];
2410 setCurrentInstance(cur);
2411 return res &&
2412 (!vnode ||
2413 (res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode))) // #9658, #10391
2414 ? undefined
2415 : res;
2416 };
2417 // this is a slot using the new v-slot syntax without scope. although it is
2418 // compiled as a scoped slot, render fn users would expect it to be present
2419 // on this.$slots because the usage is semantically a normal slot.
2420 if (fn.proxy) {
2421 Object.defineProperty(normalSlots, key, {
2422 get: normalized,
2423 enumerable: true,
2424 configurable: true
2425 });
2426 }
2427 return normalized;
2428}
2429function proxyNormalSlot(slots, key) {
2430 return function () { return slots[key]; };
2431}
2432
2433function initSetup(vm) {
2434 var options = vm.$options;
2435 var setup = options.setup;
2436 if (setup) {
2437 var ctx = (vm._setupContext = createSetupContext(vm));
2438 setCurrentInstance(vm);
2439 pushTarget();
2440 var setupResult = invokeWithErrorHandling(setup, null, [vm._props || shallowReactive({}), ctx], vm, "setup");
2441 popTarget();
2442 setCurrentInstance();
2443 if (isFunction(setupResult)) {
2444 // render function
2445 // @ts-ignore
2446 options.render = setupResult;
2447 }
2448 else if (isObject(setupResult)) {
2449 // bindings
2450 if (process.env.NODE_ENV !== 'production' && setupResult instanceof VNode) {
2451 warn("setup() should not return VNodes directly - " +
2452 "return a render function instead.");
2453 }
2454 vm._setupState = setupResult;
2455 // __sfc indicates compiled bindings from <script setup>
2456 if (!setupResult.__sfc) {
2457 for (var key in setupResult) {
2458 if (!isReserved(key)) {
2459 proxyWithRefUnwrap(vm, setupResult, key);
2460 }
2461 else if (process.env.NODE_ENV !== 'production') {
2462 warn("Avoid using variables that start with _ or $ in setup().");
2463 }
2464 }
2465 }
2466 else {
2467 // exposed for compiled render fn
2468 var proxy = (vm._setupProxy = {});
2469 for (var key in setupResult) {
2470 if (key !== '__sfc') {
2471 proxyWithRefUnwrap(proxy, setupResult, key);
2472 }
2473 }
2474 }
2475 }
2476 else if (process.env.NODE_ENV !== 'production' && setupResult !== undefined) {
2477 warn("setup() should return an object. Received: ".concat(setupResult === null ? 'null' : typeof setupResult));
2478 }
2479 }
2480}
2481function createSetupContext(vm) {
2482 var exposeCalled = false;
2483 return {
2484 get attrs() {
2485 if (!vm._attrsProxy) {
2486 var proxy = (vm._attrsProxy = {});
2487 def(proxy, '_v_attr_proxy', true);
2488 syncSetupProxy(proxy, vm.$attrs, emptyObject, vm, '$attrs');
2489 }
2490 return vm._attrsProxy;
2491 },
2492 get listeners() {
2493 if (!vm._listenersProxy) {
2494 var proxy = (vm._listenersProxy = {});
2495 syncSetupProxy(proxy, vm.$listeners, emptyObject, vm, '$listeners');
2496 }
2497 return vm._listenersProxy;
2498 },
2499 get slots() {
2500 return initSlotsProxy(vm);
2501 },
2502 emit: bind(vm.$emit, vm),
2503 expose: function (exposed) {
2504 if (process.env.NODE_ENV !== 'production') {
2505 if (exposeCalled) {
2506 warn("expose() should be called only once per setup().", vm);
2507 }
2508 exposeCalled = true;
2509 }
2510 if (exposed) {
2511 Object.keys(exposed).forEach(function (key) {
2512 return proxyWithRefUnwrap(vm, exposed, key);
2513 });
2514 }
2515 }
2516 };
2517}
2518function syncSetupProxy(to, from, prev, instance, type) {
2519 var changed = false;
2520 for (var key in from) {
2521 if (!(key in to)) {
2522 changed = true;
2523 defineProxyAttr(to, key, instance, type);
2524 }
2525 else if (from[key] !== prev[key]) {
2526 changed = true;
2527 }
2528 }
2529 for (var key in to) {
2530 if (!(key in from)) {
2531 changed = true;
2532 delete to[key];
2533 }
2534 }
2535 return changed;
2536}
2537function defineProxyAttr(proxy, key, instance, type) {
2538 Object.defineProperty(proxy, key, {
2539 enumerable: true,
2540 configurable: true,
2541 get: function () {
2542 return instance[type][key];
2543 }
2544 });
2545}
2546function initSlotsProxy(vm) {
2547 if (!vm._slotsProxy) {
2548 syncSetupSlots((vm._slotsProxy = {}), vm.$scopedSlots);
2549 }
2550 return vm._slotsProxy;
2551}
2552function syncSetupSlots(to, from) {
2553 for (var key in from) {
2554 to[key] = from[key];
2555 }
2556 for (var key in to) {
2557 if (!(key in from)) {
2558 delete to[key];
2559 }
2560 }
2561}
2562/**
2563 * @internal use manual type def because public setup context type relies on
2564 * legacy VNode types
2565 */
2566function useSlots() {
2567 return getContext().slots;
2568}
2569/**
2570 * @internal use manual type def because public setup context type relies on
2571 * legacy VNode types
2572 */
2573function useAttrs() {
2574 return getContext().attrs;
2575}
2576/**
2577 * Vue 2 only
2578 * @internal use manual type def because public setup context type relies on
2579 * legacy VNode types
2580 */
2581function useListeners() {
2582 return getContext().listeners;
2583}
2584function getContext() {
2585 if (process.env.NODE_ENV !== 'production' && !currentInstance) {
2586 warn("useContext() called without active instance.");
2587 }
2588 var vm = currentInstance;
2589 return vm._setupContext || (vm._setupContext = createSetupContext(vm));
2590}
2591/**
2592 * Runtime helper for merging default declarations. Imported by compiled code
2593 * only.
2594 * @internal
2595 */
2596function mergeDefaults(raw, defaults) {
2597 var props = isArray(raw)
2598 ? raw.reduce(function (normalized, p) { return ((normalized[p] = {}), normalized); }, {})
2599 : raw;
2600 for (var key in defaults) {
2601 var opt = props[key];
2602 if (opt) {
2603 if (isArray(opt) || isFunction(opt)) {
2604 props[key] = { type: opt, default: defaults[key] };
2605 }
2606 else {
2607 opt.default = defaults[key];
2608 }
2609 }
2610 else if (opt === null) {
2611 props[key] = { default: defaults[key] };
2612 }
2613 else if (process.env.NODE_ENV !== 'production') {
2614 warn("props default key \"".concat(key, "\" has no corresponding declaration."));
2615 }
2616 }
2617 return props;
2618}
2619
2620function initRender(vm) {
2621 vm._vnode = null; // the root of the child tree
2622 vm._staticTrees = null; // v-once cached trees
2623 var options = vm.$options;
2624 var parentVnode = (vm.$vnode = options._parentVnode); // the placeholder node in parent tree
2625 var renderContext = parentVnode && parentVnode.context;
2626 vm.$slots = resolveSlots(options._renderChildren, renderContext);
2627 vm.$scopedSlots = parentVnode
2628 ? normalizeScopedSlots(vm.$parent, parentVnode.data.scopedSlots, vm.$slots)
2629 : emptyObject;
2630 // bind the createElement fn to this instance
2631 // so that we get proper render context inside it.
2632 // args order: tag, data, children, normalizationType, alwaysNormalize
2633 // internal version is used by render functions compiled from templates
2634 // @ts-expect-error
2635 vm._c = function (a, b, c, d) { return createElement$1(vm, a, b, c, d, false); };
2636 // normalization is always applied for the public version, used in
2637 // user-written render functions.
2638 // @ts-expect-error
2639 vm.$createElement = function (a, b, c, d) { return createElement$1(vm, a, b, c, d, true); };
2640 // $attrs & $listeners are exposed for easier HOC creation.
2641 // they need to be reactive so that HOCs using them are always updated
2642 var parentData = parentVnode && parentVnode.data;
2643 /* istanbul ignore else */
2644 if (process.env.NODE_ENV !== 'production') {
2645 defineReactive(vm, '$attrs', (parentData && parentData.attrs) || emptyObject, function () {
2646 !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
2647 }, true);
2648 defineReactive(vm, '$listeners', options._parentListeners || emptyObject, function () {
2649 !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
2650 }, true);
2651 }
2652 else {
2653 defineReactive(vm, '$attrs', (parentData && parentData.attrs) || emptyObject, null, true);
2654 defineReactive(vm, '$listeners', options._parentListeners || emptyObject, null, true);
2655 }
2656}
2657var currentRenderingInstance = null;
2658function renderMixin(Vue) {
2659 // install runtime convenience helpers
2660 installRenderHelpers(Vue.prototype);
2661 Vue.prototype.$nextTick = function (fn) {
2662 return nextTick(fn, this);
2663 };
2664 Vue.prototype._render = function () {
2665 var vm = this;
2666 var _a = vm.$options, render = _a.render, _parentVnode = _a._parentVnode;
2667 if (_parentVnode && vm._isMounted) {
2668 vm.$scopedSlots = normalizeScopedSlots(vm.$parent, _parentVnode.data.scopedSlots, vm.$slots, vm.$scopedSlots);
2669 if (vm._slotsProxy) {
2670 syncSetupSlots(vm._slotsProxy, vm.$scopedSlots);
2671 }
2672 }
2673 // set parent vnode. this allows render functions to have access
2674 // to the data on the placeholder node.
2675 vm.$vnode = _parentVnode;
2676 // render self
2677 var vnode;
2678 try {
2679 // There's no need to maintain a stack because all render fns are called
2680 // separately from one another. Nested component's render fns are called
2681 // when parent component is patched.
2682 setCurrentInstance(vm);
2683 currentRenderingInstance = vm;
2684 vnode = render.call(vm._renderProxy, vm.$createElement);
2685 }
2686 catch (e) {
2687 handleError(e, vm, "render");
2688 // return error render result,
2689 // or previous vnode to prevent render error causing blank component
2690 /* istanbul ignore else */
2691 if (process.env.NODE_ENV !== 'production' && vm.$options.renderError) {
2692 try {
2693 vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
2694 }
2695 catch (e) {
2696 handleError(e, vm, "renderError");
2697 vnode = vm._vnode;
2698 }
2699 }
2700 else {
2701 vnode = vm._vnode;
2702 }
2703 }
2704 finally {
2705 currentRenderingInstance = null;
2706 setCurrentInstance();
2707 }
2708 // if the returned array contains only a single node, allow it
2709 if (isArray(vnode) && vnode.length === 1) {
2710 vnode = vnode[0];
2711 }
2712 // return empty vnode in case the render function errored out
2713 if (!(vnode instanceof VNode)) {
2714 if (process.env.NODE_ENV !== 'production' && isArray(vnode)) {
2715 warn('Multiple root nodes returned from render function. Render function ' +
2716 'should return a single root node.', vm);
2717 }
2718 vnode = createEmptyVNode();
2719 }
2720 // set parent
2721 vnode.parent = _parentVnode;
2722 return vnode;
2723 };
2724}
2725
2726function ensureCtor(comp, base) {
2727 if (comp.__esModule || (hasSymbol && comp[Symbol.toStringTag] === 'Module')) {
2728 comp = comp.default;
2729 }
2730 return isObject(comp) ? base.extend(comp) : comp;
2731}
2732function createAsyncPlaceholder(factory, data, context, children, tag) {
2733 var node = createEmptyVNode();
2734 node.asyncFactory = factory;
2735 node.asyncMeta = { data: data, context: context, children: children, tag: tag };
2736 return node;
2737}
2738function resolveAsyncComponent(factory, baseCtor) {
2739 if (isTrue(factory.error) && isDef(factory.errorComp)) {
2740 return factory.errorComp;
2741 }
2742 if (isDef(factory.resolved)) {
2743 return factory.resolved;
2744 }
2745 var owner = currentRenderingInstance;
2746 if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
2747 // already pending
2748 factory.owners.push(owner);
2749 }
2750 if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
2751 return factory.loadingComp;
2752 }
2753 if (owner && !isDef(factory.owners)) {
2754 var owners_1 = (factory.owners = [owner]);
2755 var sync_1 = true;
2756 var timerLoading_1 = null;
2757 var timerTimeout_1 = null;
2758 owner.$on('hook:destroyed', function () { return remove$2(owners_1, owner); });
2759 var forceRender_1 = function (renderCompleted) {
2760 for (var i = 0, l = owners_1.length; i < l; i++) {
2761 owners_1[i].$forceUpdate();
2762 }
2763 if (renderCompleted) {
2764 owners_1.length = 0;
2765 if (timerLoading_1 !== null) {
2766 clearTimeout(timerLoading_1);
2767 timerLoading_1 = null;
2768 }
2769 if (timerTimeout_1 !== null) {
2770 clearTimeout(timerTimeout_1);
2771 timerTimeout_1 = null;
2772 }
2773 }
2774 };
2775 var resolve = once(function (res) {
2776 // cache resolved
2777 factory.resolved = ensureCtor(res, baseCtor);
2778 // invoke callbacks only if this is not a synchronous resolve
2779 // (async resolves are shimmed as synchronous during SSR)
2780 if (!sync_1) {
2781 forceRender_1(true);
2782 }
2783 else {
2784 owners_1.length = 0;
2785 }
2786 });
2787 var reject_1 = once(function (reason) {
2788 process.env.NODE_ENV !== 'production' &&
2789 warn("Failed to resolve async component: ".concat(String(factory)) +
2790 (reason ? "\nReason: ".concat(reason) : ''));
2791 if (isDef(factory.errorComp)) {
2792 factory.error = true;
2793 forceRender_1(true);
2794 }
2795 });
2796 var res_1 = factory(resolve, reject_1);
2797 if (isObject(res_1)) {
2798 if (isPromise(res_1)) {
2799 // () => Promise
2800 if (isUndef(factory.resolved)) {
2801 res_1.then(resolve, reject_1);
2802 }
2803 }
2804 else if (isPromise(res_1.component)) {
2805 res_1.component.then(resolve, reject_1);
2806 if (isDef(res_1.error)) {
2807 factory.errorComp = ensureCtor(res_1.error, baseCtor);
2808 }
2809 if (isDef(res_1.loading)) {
2810 factory.loadingComp = ensureCtor(res_1.loading, baseCtor);
2811 if (res_1.delay === 0) {
2812 factory.loading = true;
2813 }
2814 else {
2815 // @ts-expect-error NodeJS timeout type
2816 timerLoading_1 = setTimeout(function () {
2817 timerLoading_1 = null;
2818 if (isUndef(factory.resolved) && isUndef(factory.error)) {
2819 factory.loading = true;
2820 forceRender_1(false);
2821 }
2822 }, res_1.delay || 200);
2823 }
2824 }
2825 if (isDef(res_1.timeout)) {
2826 // @ts-expect-error NodeJS timeout type
2827 timerTimeout_1 = setTimeout(function () {
2828 timerTimeout_1 = null;
2829 if (isUndef(factory.resolved)) {
2830 reject_1(process.env.NODE_ENV !== 'production' ? "timeout (".concat(res_1.timeout, "ms)") : null);
2831 }
2832 }, res_1.timeout);
2833 }
2834 }
2835 }
2836 sync_1 = false;
2837 // return in case resolved synchronously
2838 return factory.loading ? factory.loadingComp : factory.resolved;
2839 }
2840}
2841
2842function getFirstComponentChild(children) {
2843 if (isArray(children)) {
2844 for (var i = 0; i < children.length; i++) {
2845 var c = children[i];
2846 if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
2847 return c;
2848 }
2849 }
2850 }
2851}
2852
2853var SIMPLE_NORMALIZE = 1;
2854var ALWAYS_NORMALIZE = 2;
2855// wrapper function for providing a more flexible interface
2856// without getting yelled at by flow
2857function createElement$1(context, tag, data, children, normalizationType, alwaysNormalize) {
2858 if (isArray(data) || isPrimitive(data)) {
2859 normalizationType = children;
2860 children = data;
2861 data = undefined;
2862 }
2863 if (isTrue(alwaysNormalize)) {
2864 normalizationType = ALWAYS_NORMALIZE;
2865 }
2866 return _createElement(context, tag, data, children, normalizationType);
2867}
2868function _createElement(context, tag, data, children, normalizationType) {
2869 if (isDef(data) && isDef(data.__ob__)) {
2870 process.env.NODE_ENV !== 'production' &&
2871 warn("Avoid using observed data object as vnode data: ".concat(JSON.stringify(data), "\n") + 'Always create fresh vnode data objects in each render!', context);
2872 return createEmptyVNode();
2873 }
2874 // object syntax in v-bind
2875 if (isDef(data) && isDef(data.is)) {
2876 tag = data.is;
2877 }
2878 if (!tag) {
2879 // in case of component :is set to falsy value
2880 return createEmptyVNode();
2881 }
2882 // warn against non-primitive key
2883 if (process.env.NODE_ENV !== 'production' && isDef(data) && isDef(data.key) && !isPrimitive(data.key)) {
2884 warn('Avoid using non-primitive value as key, ' +
2885 'use string/number value instead.', context);
2886 }
2887 // support single function children as default scoped slot
2888 if (isArray(children) && isFunction(children[0])) {
2889 data = data || {};
2890 data.scopedSlots = { default: children[0] };
2891 children.length = 0;
2892 }
2893 if (normalizationType === ALWAYS_NORMALIZE) {
2894 children = normalizeChildren(children);
2895 }
2896 else if (normalizationType === SIMPLE_NORMALIZE) {
2897 children = simpleNormalizeChildren(children);
2898 }
2899 var vnode, ns;
2900 if (typeof tag === 'string') {
2901 var Ctor = void 0;
2902 ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
2903 if (config.isReservedTag(tag)) {
2904 // platform built-in elements
2905 if (process.env.NODE_ENV !== 'production' &&
2906 isDef(data) &&
2907 isDef(data.nativeOn) &&
2908 data.tag !== 'component') {
2909 warn("The .native modifier for v-on is only valid on components but it was used on <".concat(tag, ">."), context);
2910 }
2911 vnode = new VNode(config.parsePlatformTagName(tag), data, children, undefined, undefined, context);
2912 }
2913 else if ((!data || !data.pre) &&
2914 isDef((Ctor = resolveAsset(context.$options, 'components', tag)))) {
2915 // component
2916 vnode = createComponent(Ctor, data, context, children, tag);
2917 }
2918 else {
2919 // unknown or unlisted namespaced elements
2920 // check at runtime because it may get assigned a namespace when its
2921 // parent normalizes children
2922 vnode = new VNode(tag, data, children, undefined, undefined, context);
2923 }
2924 }
2925 else {
2926 // direct component options / constructor
2927 vnode = createComponent(tag, data, context, children);
2928 }
2929 if (isArray(vnode)) {
2930 return vnode;
2931 }
2932 else if (isDef(vnode)) {
2933 if (isDef(ns))
2934 applyNS(vnode, ns);
2935 if (isDef(data))
2936 registerDeepBindings(data);
2937 return vnode;
2938 }
2939 else {
2940 return createEmptyVNode();
2941 }
2942}
2943function applyNS(vnode, ns, force) {
2944 vnode.ns = ns;
2945 if (vnode.tag === 'foreignObject') {
2946 // use default namespace inside foreignObject
2947 ns = undefined;
2948 force = true;
2949 }
2950 if (isDef(vnode.children)) {
2951 for (var i = 0, l = vnode.children.length; i < l; i++) {
2952 var child = vnode.children[i];
2953 if (isDef(child.tag) &&
2954 (isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
2955 applyNS(child, ns, force);
2956 }
2957 }
2958 }
2959}
2960// ref #5318
2961// necessary to ensure parent re-render when deep bindings like :style and
2962// :class are used on slot nodes
2963function registerDeepBindings(data) {
2964 if (isObject(data.style)) {
2965 traverse(data.style);
2966 }
2967 if (isObject(data.class)) {
2968 traverse(data.class);
2969 }
2970}
2971
2972/**
2973 * @internal this function needs manual public type declaration because it relies
2974 * on previously manually authored types from Vue 2
2975 */
2976function h(type, props, children) {
2977 if (!currentInstance) {
2978 process.env.NODE_ENV !== 'production' &&
2979 warn("globally imported h() can only be invoked when there is an active " +
2980 "component instance, e.g. synchronously in a component's render or setup function.");
2981 }
2982 return createElement$1(currentInstance, type, props, children, 2, true);
2983}
2984
2985function handleError(err, vm, info) {
2986 // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
2987 // See: https://github.com/vuejs/vuex/issues/1505
2988 pushTarget();
2989 try {
2990 if (vm) {
2991 var cur = vm;
2992 while ((cur = cur.$parent)) {
2993 var hooks = cur.$options.errorCaptured;
2994 if (hooks) {
2995 for (var i = 0; i < hooks.length; i++) {
2996 try {
2997 var capture = hooks[i].call(cur, err, vm, info) === false;
2998 if (capture)
2999 return;
3000 }
3001 catch (e) {
3002 globalHandleError(e, cur, 'errorCaptured hook');
3003 }
3004 }
3005 }
3006 }
3007 }
3008 globalHandleError(err, vm, info);
3009 }
3010 finally {
3011 popTarget();
3012 }
3013}
3014function invokeWithErrorHandling(handler, context, args, vm, info) {
3015 var res;
3016 try {
3017 res = args ? handler.apply(context, args) : handler.call(context);
3018 if (res && !res._isVue && isPromise(res) && !res._handled) {
3019 res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
3020 res._handled = true;
3021 }
3022 }
3023 catch (e) {
3024 handleError(e, vm, info);
3025 }
3026 return res;
3027}
3028function globalHandleError(err, vm, info) {
3029 if (config.errorHandler) {
3030 try {
3031 return config.errorHandler.call(null, err, vm, info);
3032 }
3033 catch (e) {
3034 // if the user intentionally throws the original error in the handler,
3035 // do not log it twice
3036 if (e !== err) {
3037 logError(e, null, 'config.errorHandler');
3038 }
3039 }
3040 }
3041 logError(err, vm, info);
3042}
3043function logError(err, vm, info) {
3044 if (process.env.NODE_ENV !== 'production') {
3045 warn("Error in ".concat(info, ": \"").concat(err.toString(), "\""), vm);
3046 }
3047 /* istanbul ignore else */
3048 if (inBrowser && typeof console !== 'undefined') {
3049 console.error(err);
3050 }
3051 else {
3052 throw err;
3053 }
3054}
3055
3056/* globals MutationObserver */
3057var isUsingMicroTask = false;
3058var callbacks = [];
3059var pending = false;
3060function flushCallbacks() {
3061 pending = false;
3062 var copies = callbacks.slice(0);
3063 callbacks.length = 0;
3064 for (var i = 0; i < copies.length; i++) {
3065 copies[i]();
3066 }
3067}
3068// Here we have async deferring wrappers using microtasks.
3069// In 2.5 we used (macro) tasks (in combination with microtasks).
3070// However, it has subtle problems when state is changed right before repaint
3071// (e.g. #6813, out-in transitions).
3072// Also, using (macro) tasks in event handler would cause some weird behaviors
3073// that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
3074// So we now use microtasks everywhere, again.
3075// A major drawback of this tradeoff is that there are some scenarios
3076// where microtasks have too high a priority and fire in between supposedly
3077// sequential events (e.g. #4521, #6690, which have workarounds)
3078// or even between bubbling of the same event (#6566).
3079var timerFunc;
3080// The nextTick behavior leverages the microtask queue, which can be accessed
3081// via either native Promise.then or MutationObserver.
3082// MutationObserver has wider support, however it is seriously bugged in
3083// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
3084// completely stops working after triggering a few times... so, if native
3085// Promise is available, we will use it:
3086/* istanbul ignore next, $flow-disable-line */
3087if (typeof Promise !== 'undefined' && isNative(Promise)) {
3088 var p_1 = Promise.resolve();
3089 timerFunc = function () {
3090 p_1.then(flushCallbacks);
3091 // In problematic UIWebViews, Promise.then doesn't completely break, but
3092 // it can get stuck in a weird state where callbacks are pushed into the
3093 // microtask queue but the queue isn't being flushed, until the browser
3094 // needs to do some other work, e.g. handle a timer. Therefore we can
3095 // "force" the microtask queue to be flushed by adding an empty timer.
3096 if (isIOS)
3097 setTimeout(noop);
3098 };
3099 isUsingMicroTask = true;
3100}
3101else if (!isIE &&
3102 typeof MutationObserver !== 'undefined' &&
3103 (isNative(MutationObserver) ||
3104 // PhantomJS and iOS 7.x
3105 MutationObserver.toString() === '[object MutationObserverConstructor]')) {
3106 // Use MutationObserver where native Promise is not available,
3107 // e.g. PhantomJS, iOS7, Android 4.4
3108 // (#6466 MutationObserver is unreliable in IE11)
3109 var counter_1 = 1;
3110 var observer = new MutationObserver(flushCallbacks);
3111 var textNode_1 = document.createTextNode(String(counter_1));
3112 observer.observe(textNode_1, {
3113 characterData: true
3114 });
3115 timerFunc = function () {
3116 counter_1 = (counter_1 + 1) % 2;
3117 textNode_1.data = String(counter_1);
3118 };
3119 isUsingMicroTask = true;
3120}
3121else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
3122 // Fallback to setImmediate.
3123 // Technically it leverages the (macro) task queue,
3124 // but it is still a better choice than setTimeout.
3125 timerFunc = function () {
3126 setImmediate(flushCallbacks);
3127 };
3128}
3129else {
3130 // Fallback to setTimeout.
3131 timerFunc = function () {
3132 setTimeout(flushCallbacks, 0);
3133 };
3134}
3135/**
3136 * @internal
3137 */
3138function nextTick(cb, ctx) {
3139 var _resolve;
3140 callbacks.push(function () {
3141 if (cb) {
3142 try {
3143 cb.call(ctx);
3144 }
3145 catch (e) {
3146 handleError(e, ctx, 'nextTick');
3147 }
3148 }
3149 else if (_resolve) {
3150 _resolve(ctx);
3151 }
3152 });
3153 if (!pending) {
3154 pending = true;
3155 timerFunc();
3156 }
3157 // $flow-disable-line
3158 if (!cb && typeof Promise !== 'undefined') {
3159 return new Promise(function (resolve) {
3160 _resolve = resolve;
3161 });
3162 }
3163}
3164
3165function useCssModule(name) {
3166 if (name === void 0) { name = '$style'; }
3167 /* istanbul ignore else */
3168 {
3169 if (!currentInstance) {
3170 process.env.NODE_ENV !== 'production' && warn("useCssModule must be called inside setup()");
3171 return emptyObject;
3172 }
3173 var mod = currentInstance[name];
3174 if (!mod) {
3175 process.env.NODE_ENV !== 'production' &&
3176 warn("Current instance does not have CSS module named \"".concat(name, "\"."));
3177 return emptyObject;
3178 }
3179 return mod;
3180 }
3181}
3182
3183/**
3184 * Runtime helper for SFC's CSS variable injection feature.
3185 * @private
3186 */
3187function useCssVars(getter) {
3188 if (!inBrowser && !false)
3189 return;
3190 var instance = currentInstance;
3191 if (!instance) {
3192 process.env.NODE_ENV !== 'production' &&
3193 warn("useCssVars is called without current active component instance.");
3194 return;
3195 }
3196 watchPostEffect(function () {
3197 var el = instance.$el;
3198 var vars = getter(instance, instance._setupProxy);
3199 if (el && el.nodeType === 1) {
3200 var style = el.style;
3201 for (var key in vars) {
3202 style.setProperty("--".concat(key), vars[key]);
3203 }
3204 }
3205 });
3206}
3207
3208/**
3209 * v3-compatible async component API.
3210 * @internal the type is manually declared in <root>/types/v3-define-async-component.d.ts
3211 * because it relies on existing manual types
3212 */
3213function defineAsyncComponent(source) {
3214 if (isFunction(source)) {
3215 source = { loader: source };
3216 }
3217 var loader = source.loader, loadingComponent = source.loadingComponent, errorComponent = source.errorComponent, _a = source.delay, delay = _a === void 0 ? 200 : _a, timeout = source.timeout, // undefined = never times out
3218 _b = source.suspensible, // undefined = never times out
3219 suspensible = _b === void 0 ? false : _b, // in Vue 3 default is true
3220 userOnError = source.onError;
3221 if (process.env.NODE_ENV !== 'production' && suspensible) {
3222 warn("The suspensible option for async components is not supported in Vue2. It is ignored.");
3223 }
3224 var pendingRequest = null;
3225 var retries = 0;
3226 var retry = function () {
3227 retries++;
3228 pendingRequest = null;
3229 return load();
3230 };
3231 var load = function () {
3232 var thisRequest;
3233 return (pendingRequest ||
3234 (thisRequest = pendingRequest =
3235 loader()
3236 .catch(function (err) {
3237 err = err instanceof Error ? err : new Error(String(err));
3238 if (userOnError) {
3239 return new Promise(function (resolve, reject) {
3240 var userRetry = function () { return resolve(retry()); };
3241 var userFail = function () { return reject(err); };
3242 userOnError(err, userRetry, userFail, retries + 1);
3243 });
3244 }
3245 else {
3246 throw err;
3247 }
3248 })
3249 .then(function (comp) {
3250 if (thisRequest !== pendingRequest && pendingRequest) {
3251 return pendingRequest;
3252 }
3253 if (process.env.NODE_ENV !== 'production' && !comp) {
3254 warn("Async component loader resolved to undefined. " +
3255 "If you are using retry(), make sure to return its return value.");
3256 }
3257 // interop module default
3258 if (comp &&
3259 (comp.__esModule || comp[Symbol.toStringTag] === 'Module')) {
3260 comp = comp.default;
3261 }
3262 if (process.env.NODE_ENV !== 'production' && comp && !isObject(comp) && !isFunction(comp)) {
3263 throw new Error("Invalid async component load result: ".concat(comp));
3264 }
3265 return comp;
3266 })));
3267 };
3268 return function () {
3269 var component = load();
3270 return {
3271 component: component,
3272 delay: delay,
3273 timeout: timeout,
3274 error: errorComponent,
3275 loading: loadingComponent
3276 };
3277 };
3278}
3279
3280function createLifeCycle(hookName) {
3281 return function (fn, target) {
3282 if (target === void 0) { target = currentInstance; }
3283 if (!target) {
3284 process.env.NODE_ENV !== 'production' &&
3285 warn("".concat(formatName(hookName), " is called when there is no active component instance to be ") +
3286 "associated with. " +
3287 "Lifecycle injection APIs can only be used during execution of setup().");
3288 return;
3289 }
3290 return injectHook(target, hookName, fn);
3291 };
3292}
3293function formatName(name) {
3294 if (name === 'beforeDestroy') {
3295 name = 'beforeUnmount';
3296 }
3297 else if (name === 'destroyed') {
3298 name = 'unmounted';
3299 }
3300 return "on".concat(name[0].toUpperCase() + name.slice(1));
3301}
3302function injectHook(instance, hookName, fn) {
3303 var options = instance.$options;
3304 options[hookName] = mergeLifecycleHook(options[hookName], fn);
3305}
3306var onBeforeMount = createLifeCycle('beforeMount');
3307var onMounted = createLifeCycle('mounted');
3308var onBeforeUpdate = createLifeCycle('beforeUpdate');
3309var onUpdated = createLifeCycle('updated');
3310var onBeforeUnmount = createLifeCycle('beforeDestroy');
3311var onUnmounted = createLifeCycle('destroyed');
3312var onActivated = createLifeCycle('activated');
3313var onDeactivated = createLifeCycle('deactivated');
3314var onServerPrefetch = createLifeCycle('serverPrefetch');
3315var onRenderTracked = createLifeCycle('renderTracked');
3316var onRenderTriggered = createLifeCycle('renderTriggered');
3317var injectErrorCapturedHook = createLifeCycle('errorCaptured');
3318function onErrorCaptured(hook, target) {
3319 if (target === void 0) { target = currentInstance; }
3320 injectErrorCapturedHook(hook, target);
3321}
3322
3323/**
3324 * Note: also update dist/vue.runtime.mjs when adding new exports to this file.
3325 */
3326var version = '2.7.15';
3327/**
3328 * @internal type is manually declared in <root>/types/v3-define-component.d.ts
3329 */
3330function defineComponent(options) {
3331 return options;
3332}
3333
3334var seenObjects = new _Set();
3335/**
3336 * Recursively traverse an object to evoke all converted
3337 * getters, so that every nested property inside the object
3338 * is collected as a "deep" dependency.
3339 */
3340function traverse(val) {
3341 _traverse(val, seenObjects);
3342 seenObjects.clear();
3343 return val;
3344}
3345function _traverse(val, seen) {
3346 var i, keys;
3347 var isA = isArray(val);
3348 if ((!isA && !isObject(val)) ||
3349 val.__v_skip /* ReactiveFlags.SKIP */ ||
3350 Object.isFrozen(val) ||
3351 val instanceof VNode) {
3352 return;
3353 }
3354 if (val.__ob__) {
3355 var depId = val.__ob__.dep.id;
3356 if (seen.has(depId)) {
3357 return;
3358 }
3359 seen.add(depId);
3360 }
3361 if (isA) {
3362 i = val.length;
3363 while (i--)
3364 _traverse(val[i], seen);
3365 }
3366 else if (isRef(val)) {
3367 _traverse(val.value, seen);
3368 }
3369 else {
3370 keys = Object.keys(val);
3371 i = keys.length;
3372 while (i--)
3373 _traverse(val[keys[i]], seen);
3374 }
3375}
3376
3377var uid$1 = 0;
3378/**
3379 * A watcher parses an expression, collects dependencies,
3380 * and fires callback when the expression value changes.
3381 * This is used for both the $watch() api and directives.
3382 * @internal
3383 */
3384var Watcher = /** @class */ (function () {
3385 function Watcher(vm, expOrFn, cb, options, isRenderWatcher) {
3386 recordEffectScope(this,
3387 // if the active effect scope is manually created (not a component scope),
3388 // prioritize it
3389 activeEffectScope && !activeEffectScope._vm
3390 ? activeEffectScope
3391 : vm
3392 ? vm._scope
3393 : undefined);
3394 if ((this.vm = vm) && isRenderWatcher) {
3395 vm._watcher = this;
3396 }
3397 // options
3398 if (options) {
3399 this.deep = !!options.deep;
3400 this.user = !!options.user;
3401 this.lazy = !!options.lazy;
3402 this.sync = !!options.sync;
3403 this.before = options.before;
3404 if (process.env.NODE_ENV !== 'production') {
3405 this.onTrack = options.onTrack;
3406 this.onTrigger = options.onTrigger;
3407 }
3408 }
3409 else {
3410 this.deep = this.user = this.lazy = this.sync = false;
3411 }
3412 this.cb = cb;
3413 this.id = ++uid$1; // uid for batching
3414 this.active = true;
3415 this.post = false;
3416 this.dirty = this.lazy; // for lazy watchers
3417 this.deps = [];
3418 this.newDeps = [];
3419 this.depIds = new _Set();
3420 this.newDepIds = new _Set();
3421 this.expression = process.env.NODE_ENV !== 'production' ? expOrFn.toString() : '';
3422 // parse expression for getter
3423 if (isFunction(expOrFn)) {
3424 this.getter = expOrFn;
3425 }
3426 else {
3427 this.getter = parsePath(expOrFn);
3428 if (!this.getter) {
3429 this.getter = noop;
3430 process.env.NODE_ENV !== 'production' &&
3431 warn("Failed watching path: \"".concat(expOrFn, "\" ") +
3432 'Watcher only accepts simple dot-delimited paths. ' +
3433 'For full control, use a function instead.', vm);
3434 }
3435 }
3436 this.value = this.lazy ? undefined : this.get();
3437 }
3438 /**
3439 * Evaluate the getter, and re-collect dependencies.
3440 */
3441 Watcher.prototype.get = function () {
3442 pushTarget(this);
3443 var value;
3444 var vm = this.vm;
3445 try {
3446 value = this.getter.call(vm, vm);
3447 }
3448 catch (e) {
3449 if (this.user) {
3450 handleError(e, vm, "getter for watcher \"".concat(this.expression, "\""));
3451 }
3452 else {
3453 throw e;
3454 }
3455 }
3456 finally {
3457 // "touch" every property so they are all tracked as
3458 // dependencies for deep watching
3459 if (this.deep) {
3460 traverse(value);
3461 }
3462 popTarget();
3463 this.cleanupDeps();
3464 }
3465 return value;
3466 };
3467 /**
3468 * Add a dependency to this directive.
3469 */
3470 Watcher.prototype.addDep = function (dep) {
3471 var id = dep.id;
3472 if (!this.newDepIds.has(id)) {
3473 this.newDepIds.add(id);
3474 this.newDeps.push(dep);
3475 if (!this.depIds.has(id)) {
3476 dep.addSub(this);
3477 }
3478 }
3479 };
3480 /**
3481 * Clean up for dependency collection.
3482 */
3483 Watcher.prototype.cleanupDeps = function () {
3484 var i = this.deps.length;
3485 while (i--) {
3486 var dep = this.deps[i];
3487 if (!this.newDepIds.has(dep.id)) {
3488 dep.removeSub(this);
3489 }
3490 }
3491 var tmp = this.depIds;
3492 this.depIds = this.newDepIds;
3493 this.newDepIds = tmp;
3494 this.newDepIds.clear();
3495 tmp = this.deps;
3496 this.deps = this.newDeps;
3497 this.newDeps = tmp;
3498 this.newDeps.length = 0;
3499 };
3500 /**
3501 * Subscriber interface.
3502 * Will be called when a dependency changes.
3503 */
3504 Watcher.prototype.update = function () {
3505 /* istanbul ignore else */
3506 if (this.lazy) {
3507 this.dirty = true;
3508 }
3509 else if (this.sync) {
3510 this.run();
3511 }
3512 else {
3513 queueWatcher(this);
3514 }
3515 };
3516 /**
3517 * Scheduler job interface.
3518 * Will be called by the scheduler.
3519 */
3520 Watcher.prototype.run = function () {
3521 if (this.active) {
3522 var value = this.get();
3523 if (value !== this.value ||
3524 // Deep watchers and watchers on Object/Arrays should fire even
3525 // when the value is the same, because the value may
3526 // have mutated.
3527 isObject(value) ||
3528 this.deep) {
3529 // set new value
3530 var oldValue = this.value;
3531 this.value = value;
3532 if (this.user) {
3533 var info = "callback for watcher \"".concat(this.expression, "\"");
3534 invokeWithErrorHandling(this.cb, this.vm, [value, oldValue], this.vm, info);
3535 }
3536 else {
3537 this.cb.call(this.vm, value, oldValue);
3538 }
3539 }
3540 }
3541 };
3542 /**
3543 * Evaluate the value of the watcher.
3544 * This only gets called for lazy watchers.
3545 */
3546 Watcher.prototype.evaluate = function () {
3547 this.value = this.get();
3548 this.dirty = false;
3549 };
3550 /**
3551 * Depend on all deps collected by this watcher.
3552 */
3553 Watcher.prototype.depend = function () {
3554 var i = this.deps.length;
3555 while (i--) {
3556 this.deps[i].depend();
3557 }
3558 };
3559 /**
3560 * Remove self from all dependencies' subscriber list.
3561 */
3562 Watcher.prototype.teardown = function () {
3563 if (this.vm && !this.vm._isBeingDestroyed) {
3564 remove$2(this.vm._scope.effects, this);
3565 }
3566 if (this.active) {
3567 var i = this.deps.length;
3568 while (i--) {
3569 this.deps[i].removeSub(this);
3570 }
3571 this.active = false;
3572 if (this.onStop) {
3573 this.onStop();
3574 }
3575 }
3576 };
3577 return Watcher;
3578}());
3579
3580var mark;
3581var measure;
3582if (process.env.NODE_ENV !== 'production') {
3583 var perf_1 = inBrowser && window.performance;
3584 /* istanbul ignore if */
3585 if (perf_1 &&
3586 // @ts-ignore
3587 perf_1.mark &&
3588 // @ts-ignore
3589 perf_1.measure &&
3590 // @ts-ignore
3591 perf_1.clearMarks &&
3592 // @ts-ignore
3593 perf_1.clearMeasures) {
3594 mark = function (tag) { return perf_1.mark(tag); };
3595 measure = function (name, startTag, endTag) {
3596 perf_1.measure(name, startTag, endTag);
3597 perf_1.clearMarks(startTag);
3598 perf_1.clearMarks(endTag);
3599 // perf.clearMeasures(name)
3600 };
3601 }
3602}
3603
3604function initEvents(vm) {
3605 vm._events = Object.create(null);
3606 vm._hasHookEvent = false;
3607 // init parent attached events
3608 var listeners = vm.$options._parentListeners;
3609 if (listeners) {
3610 updateComponentListeners(vm, listeners);
3611 }
3612}
3613var target$1;
3614function add$1(event, fn) {
3615 target$1.$on(event, fn);
3616}
3617function remove$1(event, fn) {
3618 target$1.$off(event, fn);
3619}
3620function createOnceHandler$1(event, fn) {
3621 var _target = target$1;
3622 return function onceHandler() {
3623 var res = fn.apply(null, arguments);
3624 if (res !== null) {
3625 _target.$off(event, onceHandler);
3626 }
3627 };
3628}
3629function updateComponentListeners(vm, listeners, oldListeners) {
3630 target$1 = vm;
3631 updateListeners(listeners, oldListeners || {}, add$1, remove$1, createOnceHandler$1, vm);
3632 target$1 = undefined;
3633}
3634function eventsMixin(Vue) {
3635 var hookRE = /^hook:/;
3636 Vue.prototype.$on = function (event, fn) {
3637 var vm = this;
3638 if (isArray(event)) {
3639 for (var i = 0, l = event.length; i < l; i++) {
3640 vm.$on(event[i], fn);
3641 }
3642 }
3643 else {
3644 (vm._events[event] || (vm._events[event] = [])).push(fn);
3645 // optimize hook:event cost by using a boolean flag marked at registration
3646 // instead of a hash lookup
3647 if (hookRE.test(event)) {
3648 vm._hasHookEvent = true;
3649 }
3650 }
3651 return vm;
3652 };
3653 Vue.prototype.$once = function (event, fn) {
3654 var vm = this;
3655 function on() {
3656 vm.$off(event, on);
3657 fn.apply(vm, arguments);
3658 }
3659 on.fn = fn;
3660 vm.$on(event, on);
3661 return vm;
3662 };
3663 Vue.prototype.$off = function (event, fn) {
3664 var vm = this;
3665 // all
3666 if (!arguments.length) {
3667 vm._events = Object.create(null);
3668 return vm;
3669 }
3670 // array of events
3671 if (isArray(event)) {
3672 for (var i_1 = 0, l = event.length; i_1 < l; i_1++) {
3673 vm.$off(event[i_1], fn);
3674 }
3675 return vm;
3676 }
3677 // specific event
3678 var cbs = vm._events[event];
3679 if (!cbs) {
3680 return vm;
3681 }
3682 if (!fn) {
3683 vm._events[event] = null;
3684 return vm;
3685 }
3686 // specific handler
3687 var cb;
3688 var i = cbs.length;
3689 while (i--) {
3690 cb = cbs[i];
3691 if (cb === fn || cb.fn === fn) {
3692 cbs.splice(i, 1);
3693 break;
3694 }
3695 }
3696 return vm;
3697 };
3698 Vue.prototype.$emit = function (event) {
3699 var vm = this;
3700 if (process.env.NODE_ENV !== 'production') {
3701 var lowerCaseEvent = event.toLowerCase();
3702 if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
3703 tip("Event \"".concat(lowerCaseEvent, "\" is emitted in component ") +
3704 "".concat(formatComponentName(vm), " but the handler is registered for \"").concat(event, "\". ") +
3705 "Note that HTML attributes are case-insensitive and you cannot use " +
3706 "v-on to listen to camelCase events when using in-DOM templates. " +
3707 "You should probably use \"".concat(hyphenate(event), "\" instead of \"").concat(event, "\"."));
3708 }
3709 }
3710 var cbs = vm._events[event];
3711 if (cbs) {
3712 cbs = cbs.length > 1 ? toArray(cbs) : cbs;
3713 var args = toArray(arguments, 1);
3714 var info = "event handler for \"".concat(event, "\"");
3715 for (var i = 0, l = cbs.length; i < l; i++) {
3716 invokeWithErrorHandling(cbs[i], vm, args, vm, info);
3717 }
3718 }
3719 return vm;
3720 };
3721}
3722
3723var activeInstance = null;
3724var isUpdatingChildComponent = false;
3725function setActiveInstance(vm) {
3726 var prevActiveInstance = activeInstance;
3727 activeInstance = vm;
3728 return function () {
3729 activeInstance = prevActiveInstance;
3730 };
3731}
3732function initLifecycle(vm) {
3733 var options = vm.$options;
3734 // locate first non-abstract parent
3735 var parent = options.parent;
3736 if (parent && !options.abstract) {
3737 while (parent.$options.abstract && parent.$parent) {
3738 parent = parent.$parent;
3739 }
3740 parent.$children.push(vm);
3741 }
3742 vm.$parent = parent;
3743 vm.$root = parent ? parent.$root : vm;
3744 vm.$children = [];
3745 vm.$refs = {};
3746 vm._provided = parent ? parent._provided : Object.create(null);
3747 vm._watcher = null;
3748 vm._inactive = null;
3749 vm._directInactive = false;
3750 vm._isMounted = false;
3751 vm._isDestroyed = false;
3752 vm._isBeingDestroyed = false;
3753}
3754function lifecycleMixin(Vue) {
3755 Vue.prototype._update = function (vnode, hydrating) {
3756 var vm = this;
3757 var prevEl = vm.$el;
3758 var prevVnode = vm._vnode;
3759 var restoreActiveInstance = setActiveInstance(vm);
3760 vm._vnode = vnode;
3761 // Vue.prototype.__patch__ is injected in entry points
3762 // based on the rendering backend used.
3763 if (!prevVnode) {
3764 // initial render
3765 vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
3766 }
3767 else {
3768 // updates
3769 vm.$el = vm.__patch__(prevVnode, vnode);
3770 }
3771 restoreActiveInstance();
3772 // update __vue__ reference
3773 if (prevEl) {
3774 prevEl.__vue__ = null;
3775 }
3776 if (vm.$el) {
3777 vm.$el.__vue__ = vm;
3778 }
3779 // if parent is an HOC, update its $el as well
3780 var wrapper = vm;
3781 while (wrapper &&
3782 wrapper.$vnode &&
3783 wrapper.$parent &&
3784 wrapper.$vnode === wrapper.$parent._vnode) {
3785 wrapper.$parent.$el = wrapper.$el;
3786 wrapper = wrapper.$parent;
3787 }
3788 // updated hook is called by the scheduler to ensure that children are
3789 // updated in a parent's updated hook.
3790 };
3791 Vue.prototype.$forceUpdate = function () {
3792 var vm = this;
3793 if (vm._watcher) {
3794 vm._watcher.update();
3795 }
3796 };
3797 Vue.prototype.$destroy = function () {
3798 var vm = this;
3799 if (vm._isBeingDestroyed) {
3800 return;
3801 }
3802 callHook$1(vm, 'beforeDestroy');
3803 vm._isBeingDestroyed = true;
3804 // remove self from parent
3805 var parent = vm.$parent;
3806 if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
3807 remove$2(parent.$children, vm);
3808 }
3809 // teardown scope. this includes both the render watcher and other
3810 // watchers created
3811 vm._scope.stop();
3812 // remove reference from data ob
3813 // frozen object may not have observer.
3814 if (vm._data.__ob__) {
3815 vm._data.__ob__.vmCount--;
3816 }
3817 // call the last hook...
3818 vm._isDestroyed = true;
3819 // invoke destroy hooks on current rendered tree
3820 vm.__patch__(vm._vnode, null);
3821 // fire destroyed hook
3822 callHook$1(vm, 'destroyed');
3823 // turn off all instance listeners.
3824 vm.$off();
3825 // remove __vue__ reference
3826 if (vm.$el) {
3827 vm.$el.__vue__ = null;
3828 }
3829 // release circular reference (#6759)
3830 if (vm.$vnode) {
3831 vm.$vnode.parent = null;
3832 }
3833 };
3834}
3835function mountComponent(vm, el, hydrating) {
3836 vm.$el = el;
3837 if (!vm.$options.render) {
3838 // @ts-expect-error invalid type
3839 vm.$options.render = createEmptyVNode;
3840 if (process.env.NODE_ENV !== 'production') {
3841 /* istanbul ignore if */
3842 if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
3843 vm.$options.el ||
3844 el) {
3845 warn('You are using the runtime-only build of Vue where the template ' +
3846 'compiler is not available. Either pre-compile the templates into ' +
3847 'render functions, or use the compiler-included build.', vm);
3848 }
3849 else {
3850 warn('Failed to mount component: template or render function not defined.', vm);
3851 }
3852 }
3853 }
3854 callHook$1(vm, 'beforeMount');
3855 var updateComponent;
3856 /* istanbul ignore if */
3857 if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
3858 updateComponent = function () {
3859 var name = vm._name;
3860 var id = vm._uid;
3861 var startTag = "vue-perf-start:".concat(id);
3862 var endTag = "vue-perf-end:".concat(id);
3863 mark(startTag);
3864 var vnode = vm._render();
3865 mark(endTag);
3866 measure("vue ".concat(name, " render"), startTag, endTag);
3867 mark(startTag);
3868 vm._update(vnode, hydrating);
3869 mark(endTag);
3870 measure("vue ".concat(name, " patch"), startTag, endTag);
3871 };
3872 }
3873 else {
3874 updateComponent = function () {
3875 vm._update(vm._render(), hydrating);
3876 };
3877 }
3878 var watcherOptions = {
3879 before: function () {
3880 if (vm._isMounted && !vm._isDestroyed) {
3881 callHook$1(vm, 'beforeUpdate');
3882 }
3883 }
3884 };
3885 if (process.env.NODE_ENV !== 'production') {
3886 watcherOptions.onTrack = function (e) { return callHook$1(vm, 'renderTracked', [e]); };
3887 watcherOptions.onTrigger = function (e) { return callHook$1(vm, 'renderTriggered', [e]); };
3888 }
3889 // we set this to vm._watcher inside the watcher's constructor
3890 // since the watcher's initial patch may call $forceUpdate (e.g. inside child
3891 // component's mounted hook), which relies on vm._watcher being already defined
3892 new Watcher(vm, updateComponent, noop, watcherOptions, true /* isRenderWatcher */);
3893 hydrating = false;
3894 // flush buffer for flush: "pre" watchers queued in setup()
3895 var preWatchers = vm._preWatchers;
3896 if (preWatchers) {
3897 for (var i = 0; i < preWatchers.length; i++) {
3898 preWatchers[i].run();
3899 }
3900 }
3901 // manually mounted instance, call mounted on self
3902 // mounted is called for render-created child components in its inserted hook
3903 if (vm.$vnode == null) {
3904 vm._isMounted = true;
3905 callHook$1(vm, 'mounted');
3906 }
3907 return vm;
3908}
3909function updateChildComponent(vm, propsData, listeners, parentVnode, renderChildren) {
3910 if (process.env.NODE_ENV !== 'production') {
3911 isUpdatingChildComponent = true;
3912 }
3913 // determine whether component has slot children
3914 // we need to do this before overwriting $options._renderChildren.
3915 // check if there are dynamic scopedSlots (hand-written or compiled but with
3916 // dynamic slot names). Static scoped slots compiled from template has the
3917 // "$stable" marker.
3918 var newScopedSlots = parentVnode.data.scopedSlots;
3919 var oldScopedSlots = vm.$scopedSlots;
3920 var hasDynamicScopedSlot = !!((newScopedSlots && !newScopedSlots.$stable) ||
3921 (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
3922 (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) ||
3923 (!newScopedSlots && vm.$scopedSlots.$key));
3924 // Any static slot children from the parent may have changed during parent's
3925 // update. Dynamic scoped slots may also have changed. In such cases, a forced
3926 // update is necessary to ensure correctness.
3927 var needsForceUpdate = !!(renderChildren || // has new static slots
3928 vm.$options._renderChildren || // has old static slots
3929 hasDynamicScopedSlot);
3930 var prevVNode = vm.$vnode;
3931 vm.$options._parentVnode = parentVnode;
3932 vm.$vnode = parentVnode; // update vm's placeholder node without re-render
3933 if (vm._vnode) {
3934 // update child tree's parent
3935 vm._vnode.parent = parentVnode;
3936 }
3937 vm.$options._renderChildren = renderChildren;
3938 // update $attrs and $listeners hash
3939 // these are also reactive so they may trigger child update if the child
3940 // used them during render
3941 var attrs = parentVnode.data.attrs || emptyObject;
3942 if (vm._attrsProxy) {
3943 // force update if attrs are accessed and has changed since it may be
3944 // passed to a child component.
3945 if (syncSetupProxy(vm._attrsProxy, attrs, (prevVNode.data && prevVNode.data.attrs) || emptyObject, vm, '$attrs')) {
3946 needsForceUpdate = true;
3947 }
3948 }
3949 vm.$attrs = attrs;
3950 // update listeners
3951 listeners = listeners || emptyObject;
3952 var prevListeners = vm.$options._parentListeners;
3953 if (vm._listenersProxy) {
3954 syncSetupProxy(vm._listenersProxy, listeners, prevListeners || emptyObject, vm, '$listeners');
3955 }
3956 vm.$listeners = vm.$options._parentListeners = listeners;
3957 updateComponentListeners(vm, listeners, prevListeners);
3958 // update props
3959 if (propsData && vm.$options.props) {
3960 toggleObserving(false);
3961 var props = vm._props;
3962 var propKeys = vm.$options._propKeys || [];
3963 for (var i = 0; i < propKeys.length; i++) {
3964 var key = propKeys[i];
3965 var propOptions = vm.$options.props; // wtf flow?
3966 props[key] = validateProp(key, propOptions, propsData, vm);
3967 }
3968 toggleObserving(true);
3969 // keep a copy of raw propsData
3970 vm.$options.propsData = propsData;
3971 }
3972 // resolve slots + force update if has children
3973 if (needsForceUpdate) {
3974 vm.$slots = resolveSlots(renderChildren, parentVnode.context);
3975 vm.$forceUpdate();
3976 }
3977 if (process.env.NODE_ENV !== 'production') {
3978 isUpdatingChildComponent = false;
3979 }
3980}
3981function isInInactiveTree(vm) {
3982 while (vm && (vm = vm.$parent)) {
3983 if (vm._inactive)
3984 return true;
3985 }
3986 return false;
3987}
3988function activateChildComponent(vm, direct) {
3989 if (direct) {
3990 vm._directInactive = false;
3991 if (isInInactiveTree(vm)) {
3992 return;
3993 }
3994 }
3995 else if (vm._directInactive) {
3996 return;
3997 }
3998 if (vm._inactive || vm._inactive === null) {
3999 vm._inactive = false;
4000 for (var i = 0; i < vm.$children.length; i++) {
4001 activateChildComponent(vm.$children[i]);
4002 }
4003 callHook$1(vm, 'activated');
4004 }
4005}
4006function deactivateChildComponent(vm, direct) {
4007 if (direct) {
4008 vm._directInactive = true;
4009 if (isInInactiveTree(vm)) {
4010 return;
4011 }
4012 }
4013 if (!vm._inactive) {
4014 vm._inactive = true;
4015 for (var i = 0; i < vm.$children.length; i++) {
4016 deactivateChildComponent(vm.$children[i]);
4017 }
4018 callHook$1(vm, 'deactivated');
4019 }
4020}
4021function callHook$1(vm, hook, args, setContext) {
4022 if (setContext === void 0) { setContext = true; }
4023 // #7573 disable dep collection when invoking lifecycle hooks
4024 pushTarget();
4025 var prevInst = currentInstance;
4026 var prevScope = getCurrentScope();
4027 setContext && setCurrentInstance(vm);
4028 var handlers = vm.$options[hook];
4029 var info = "".concat(hook, " hook");
4030 if (handlers) {
4031 for (var i = 0, j = handlers.length; i < j; i++) {
4032 invokeWithErrorHandling(handlers[i], vm, args || null, vm, info);
4033 }
4034 }
4035 if (vm._hasHookEvent) {
4036 vm.$emit('hook:' + hook);
4037 }
4038 if (setContext) {
4039 setCurrentInstance(prevInst);
4040 prevScope && prevScope.on();
4041 }
4042 popTarget();
4043}
4044
4045var MAX_UPDATE_COUNT = 100;
4046var queue = [];
4047var activatedChildren = [];
4048var has = {};
4049var circular = {};
4050var waiting = false;
4051var flushing = false;
4052var index = 0;
4053/**
4054 * Reset the scheduler's state.
4055 */
4056function resetSchedulerState() {
4057 index = queue.length = activatedChildren.length = 0;
4058 has = {};
4059 if (process.env.NODE_ENV !== 'production') {
4060 circular = {};
4061 }
4062 waiting = flushing = false;
4063}
4064// Async edge case #6566 requires saving the timestamp when event listeners are
4065// attached. However, calling performance.now() has a perf overhead especially
4066// if the page has thousands of event listeners. Instead, we take a timestamp
4067// every time the scheduler flushes and use that for all event listeners
4068// attached during that flush.
4069var currentFlushTimestamp = 0;
4070// Async edge case fix requires storing an event listener's attach timestamp.
4071var getNow = Date.now;
4072// Determine what event timestamp the browser is using. Annoyingly, the
4073// timestamp can either be hi-res (relative to page load) or low-res
4074// (relative to UNIX epoch), so in order to compare time we have to use the
4075// same timestamp type when saving the flush timestamp.
4076// All IE versions use low-res event timestamps, and have problematic clock
4077// implementations (#9632)
4078if (inBrowser && !isIE) {
4079 var performance_1 = window.performance;
4080 if (performance_1 &&
4081 typeof performance_1.now === 'function' &&
4082 getNow() > document.createEvent('Event').timeStamp) {
4083 // if the event timestamp, although evaluated AFTER the Date.now(), is
4084 // smaller than it, it means the event is using a hi-res timestamp,
4085 // and we need to use the hi-res version for event listener timestamps as
4086 // well.
4087 getNow = function () { return performance_1.now(); };
4088 }
4089}
4090var sortCompareFn = function (a, b) {
4091 if (a.post) {
4092 if (!b.post)
4093 return 1;
4094 }
4095 else if (b.post) {
4096 return -1;
4097 }
4098 return a.id - b.id;
4099};
4100/**
4101 * Flush both queues and run the watchers.
4102 */
4103function flushSchedulerQueue() {
4104 currentFlushTimestamp = getNow();
4105 flushing = true;
4106 var watcher, id;
4107 // Sort queue before flush.
4108 // This ensures that:
4109 // 1. Components are updated from parent to child. (because parent is always
4110 // created before the child)
4111 // 2. A component's user watchers are run before its render watcher (because
4112 // user watchers are created before the render watcher)
4113 // 3. If a component is destroyed during a parent component's watcher run,
4114 // its watchers can be skipped.
4115 queue.sort(sortCompareFn);
4116 // do not cache length because more watchers might be pushed
4117 // as we run existing watchers
4118 for (index = 0; index < queue.length; index++) {
4119 watcher = queue[index];
4120 if (watcher.before) {
4121 watcher.before();
4122 }
4123 id = watcher.id;
4124 has[id] = null;
4125 watcher.run();
4126 // in dev build, check and stop circular updates.
4127 if (process.env.NODE_ENV !== 'production' && has[id] != null) {
4128 circular[id] = (circular[id] || 0) + 1;
4129 if (circular[id] > MAX_UPDATE_COUNT) {
4130 warn('You may have an infinite update loop ' +
4131 (watcher.user
4132 ? "in watcher with expression \"".concat(watcher.expression, "\"")
4133 : "in a component render function."), watcher.vm);
4134 break;
4135 }
4136 }
4137 }
4138 // keep copies of post queues before resetting state
4139 var activatedQueue = activatedChildren.slice();
4140 var updatedQueue = queue.slice();
4141 resetSchedulerState();
4142 // call component updated and activated hooks
4143 callActivatedHooks(activatedQueue);
4144 callUpdatedHooks(updatedQueue);
4145 cleanupDeps();
4146 // devtool hook
4147 /* istanbul ignore if */
4148 if (devtools && config.devtools) {
4149 devtools.emit('flush');
4150 }
4151}
4152function callUpdatedHooks(queue) {
4153 var i = queue.length;
4154 while (i--) {
4155 var watcher = queue[i];
4156 var vm = watcher.vm;
4157 if (vm && vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
4158 callHook$1(vm, 'updated');
4159 }
4160 }
4161}
4162/**
4163 * Queue a kept-alive component that was activated during patch.
4164 * The queue will be processed after the entire tree has been patched.
4165 */
4166function queueActivatedComponent(vm) {
4167 // setting _inactive to false here so that a render function can
4168 // rely on checking whether it's in an inactive tree (e.g. router-view)
4169 vm._inactive = false;
4170 activatedChildren.push(vm);
4171}
4172function callActivatedHooks(queue) {
4173 for (var i = 0; i < queue.length; i++) {
4174 queue[i]._inactive = true;
4175 activateChildComponent(queue[i], true /* true */);
4176 }
4177}
4178/**
4179 * Push a watcher into the watcher queue.
4180 * Jobs with duplicate IDs will be skipped unless it's
4181 * pushed when the queue is being flushed.
4182 */
4183function queueWatcher(watcher) {
4184 var id = watcher.id;
4185 if (has[id] != null) {
4186 return;
4187 }
4188 if (watcher === Dep.target && watcher.noRecurse) {
4189 return;
4190 }
4191 has[id] = true;
4192 if (!flushing) {
4193 queue.push(watcher);
4194 }
4195 else {
4196 // if already flushing, splice the watcher based on its id
4197 // if already past its id, it will be run next immediately.
4198 var i = queue.length - 1;
4199 while (i > index && queue[i].id > watcher.id) {
4200 i--;
4201 }
4202 queue.splice(i + 1, 0, watcher);
4203 }
4204 // queue the flush
4205 if (!waiting) {
4206 waiting = true;
4207 if (process.env.NODE_ENV !== 'production' && !config.async) {
4208 flushSchedulerQueue();
4209 return;
4210 }
4211 nextTick(flushSchedulerQueue);
4212 }
4213}
4214
4215function initProvide(vm) {
4216 var provideOption = vm.$options.provide;
4217 if (provideOption) {
4218 var provided = isFunction(provideOption)
4219 ? provideOption.call(vm)
4220 : provideOption;
4221 if (!isObject(provided)) {
4222 return;
4223 }
4224 var source = resolveProvided(vm);
4225 // IE9 doesn't support Object.getOwnPropertyDescriptors so we have to
4226 // iterate the keys ourselves.
4227 var keys = hasSymbol ? Reflect.ownKeys(provided) : Object.keys(provided);
4228 for (var i = 0; i < keys.length; i++) {
4229 var key = keys[i];
4230 Object.defineProperty(source, key, Object.getOwnPropertyDescriptor(provided, key));
4231 }
4232 }
4233}
4234function initInjections(vm) {
4235 var result = resolveInject(vm.$options.inject, vm);
4236 if (result) {
4237 toggleObserving(false);
4238 Object.keys(result).forEach(function (key) {
4239 /* istanbul ignore else */
4240 if (process.env.NODE_ENV !== 'production') {
4241 defineReactive(vm, key, result[key], function () {
4242 warn("Avoid mutating an injected value directly since the changes will be " +
4243 "overwritten whenever the provided component re-renders. " +
4244 "injection being mutated: \"".concat(key, "\""), vm);
4245 });
4246 }
4247 else {
4248 defineReactive(vm, key, result[key]);
4249 }
4250 });
4251 toggleObserving(true);
4252 }
4253}
4254function resolveInject(inject, vm) {
4255 if (inject) {
4256 // inject is :any because flow is not smart enough to figure out cached
4257 var result = Object.create(null);
4258 var keys = hasSymbol ? Reflect.ownKeys(inject) : Object.keys(inject);
4259 for (var i = 0; i < keys.length; i++) {
4260 var key = keys[i];
4261 // #6574 in case the inject object is observed...
4262 if (key === '__ob__')
4263 continue;
4264 var provideKey = inject[key].from;
4265 if (provideKey in vm._provided) {
4266 result[key] = vm._provided[provideKey];
4267 }
4268 else if ('default' in inject[key]) {
4269 var provideDefault = inject[key].default;
4270 result[key] = isFunction(provideDefault)
4271 ? provideDefault.call(vm)
4272 : provideDefault;
4273 }
4274 else if (process.env.NODE_ENV !== 'production') {
4275 warn("Injection \"".concat(key, "\" not found"), vm);
4276 }
4277 }
4278 return result;
4279 }
4280}
4281
4282function FunctionalRenderContext(data, props, children, parent, Ctor) {
4283 var _this = this;
4284 var options = Ctor.options;
4285 // ensure the createElement function in functional components
4286 // gets a unique context - this is necessary for correct named slot check
4287 var contextVm;
4288 if (hasOwn(parent, '_uid')) {
4289 contextVm = Object.create(parent);
4290 contextVm._original = parent;
4291 }
4292 else {
4293 // the context vm passed in is a functional context as well.
4294 // in this case we want to make sure we are able to get a hold to the
4295 // real context instance.
4296 contextVm = parent;
4297 // @ts-ignore
4298 parent = parent._original;
4299 }
4300 var isCompiled = isTrue(options._compiled);
4301 var needNormalization = !isCompiled;
4302 this.data = data;
4303 this.props = props;
4304 this.children = children;
4305 this.parent = parent;
4306 this.listeners = data.on || emptyObject;
4307 this.injections = resolveInject(options.inject, parent);
4308 this.slots = function () {
4309 if (!_this.$slots) {
4310 normalizeScopedSlots(parent, data.scopedSlots, (_this.$slots = resolveSlots(children, parent)));
4311 }
4312 return _this.$slots;
4313 };
4314 Object.defineProperty(this, 'scopedSlots', {
4315 enumerable: true,
4316 get: function () {
4317 return normalizeScopedSlots(parent, data.scopedSlots, this.slots());
4318 }
4319 });
4320 // support for compiled functional template
4321 if (isCompiled) {
4322 // exposing $options for renderStatic()
4323 this.$options = options;
4324 // pre-resolve slots for renderSlot()
4325 this.$slots = this.slots();
4326 this.$scopedSlots = normalizeScopedSlots(parent, data.scopedSlots, this.$slots);
4327 }
4328 if (options._scopeId) {
4329 this._c = function (a, b, c, d) {
4330 var vnode = createElement$1(contextVm, a, b, c, d, needNormalization);
4331 if (vnode && !isArray(vnode)) {
4332 vnode.fnScopeId = options._scopeId;
4333 vnode.fnContext = parent;
4334 }
4335 return vnode;
4336 };
4337 }
4338 else {
4339 this._c = function (a, b, c, d) {
4340 return createElement$1(contextVm, a, b, c, d, needNormalization);
4341 };
4342 }
4343}
4344installRenderHelpers(FunctionalRenderContext.prototype);
4345function createFunctionalComponent(Ctor, propsData, data, contextVm, children) {
4346 var options = Ctor.options;
4347 var props = {};
4348 var propOptions = options.props;
4349 if (isDef(propOptions)) {
4350 for (var key in propOptions) {
4351 props[key] = validateProp(key, propOptions, propsData || emptyObject);
4352 }
4353 }
4354 else {
4355 if (isDef(data.attrs))
4356 mergeProps(props, data.attrs);
4357 if (isDef(data.props))
4358 mergeProps(props, data.props);
4359 }
4360 var renderContext = new FunctionalRenderContext(data, props, children, contextVm, Ctor);
4361 var vnode = options.render.call(null, renderContext._c, renderContext);
4362 if (vnode instanceof VNode) {
4363 return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext);
4364 }
4365 else if (isArray(vnode)) {
4366 var vnodes = normalizeChildren(vnode) || [];
4367 var res = new Array(vnodes.length);
4368 for (var i = 0; i < vnodes.length; i++) {
4369 res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
4370 }
4371 return res;
4372 }
4373}
4374function cloneAndMarkFunctionalResult(vnode, data, contextVm, options, renderContext) {
4375 // #7817 clone node before setting fnContext, otherwise if the node is reused
4376 // (e.g. it was from a cached normal slot) the fnContext causes named slots
4377 // that should not be matched to match.
4378 var clone = cloneVNode(vnode);
4379 clone.fnContext = contextVm;
4380 clone.fnOptions = options;
4381 if (process.env.NODE_ENV !== 'production') {
4382 (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext =
4383 renderContext;
4384 }
4385 if (data.slot) {
4386 (clone.data || (clone.data = {})).slot = data.slot;
4387 }
4388 return clone;
4389}
4390function mergeProps(to, from) {
4391 for (var key in from) {
4392 to[camelize(key)] = from[key];
4393 }
4394}
4395
4396function getComponentName(options) {
4397 return options.name || options.__name || options._componentTag;
4398}
4399// inline hooks to be invoked on component VNodes during patch
4400var componentVNodeHooks = {
4401 init: function (vnode, hydrating) {
4402 if (vnode.componentInstance &&
4403 !vnode.componentInstance._isDestroyed &&
4404 vnode.data.keepAlive) {
4405 // kept-alive components, treat as a patch
4406 var mountedNode = vnode; // work around flow
4407 componentVNodeHooks.prepatch(mountedNode, mountedNode);
4408 }
4409 else {
4410 var child = (vnode.componentInstance = createComponentInstanceForVnode(vnode, activeInstance));
4411 child.$mount(hydrating ? vnode.elm : undefined, hydrating);
4412 }
4413 },
4414 prepatch: function (oldVnode, vnode) {
4415 var options = vnode.componentOptions;
4416 var child = (vnode.componentInstance = oldVnode.componentInstance);
4417 updateChildComponent(child, options.propsData, // updated props
4418 options.listeners, // updated listeners
4419 vnode, // new parent vnode
4420 options.children // new children
4421 );
4422 },
4423 insert: function (vnode) {
4424 var context = vnode.context, componentInstance = vnode.componentInstance;
4425 if (!componentInstance._isMounted) {
4426 componentInstance._isMounted = true;
4427 callHook$1(componentInstance, 'mounted');
4428 }
4429 if (vnode.data.keepAlive) {
4430 if (context._isMounted) {
4431 // vue-router#1212
4432 // During updates, a kept-alive component's child components may
4433 // change, so directly walking the tree here may call activated hooks
4434 // on incorrect children. Instead we push them into a queue which will
4435 // be processed after the whole patch process ended.
4436 queueActivatedComponent(componentInstance);
4437 }
4438 else {
4439 activateChildComponent(componentInstance, true /* direct */);
4440 }
4441 }
4442 },
4443 destroy: function (vnode) {
4444 var componentInstance = vnode.componentInstance;
4445 if (!componentInstance._isDestroyed) {
4446 if (!vnode.data.keepAlive) {
4447 componentInstance.$destroy();
4448 }
4449 else {
4450 deactivateChildComponent(componentInstance, true /* direct */);
4451 }
4452 }
4453 }
4454};
4455var hooksToMerge = Object.keys(componentVNodeHooks);
4456function createComponent(Ctor, data, context, children, tag) {
4457 if (isUndef(Ctor)) {
4458 return;
4459 }
4460 var baseCtor = context.$options._base;
4461 // plain options object: turn it into a constructor
4462 if (isObject(Ctor)) {
4463 Ctor = baseCtor.extend(Ctor);
4464 }
4465 // if at this stage it's not a constructor or an async component factory,
4466 // reject.
4467 if (typeof Ctor !== 'function') {
4468 if (process.env.NODE_ENV !== 'production') {
4469 warn("Invalid Component definition: ".concat(String(Ctor)), context);
4470 }
4471 return;
4472 }
4473 // async component
4474 var asyncFactory;
4475 // @ts-expect-error
4476 if (isUndef(Ctor.cid)) {
4477 asyncFactory = Ctor;
4478 Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
4479 if (Ctor === undefined) {
4480 // return a placeholder node for async component, which is rendered
4481 // as a comment node but preserves all the raw information for the node.
4482 // the information will be used for async server-rendering and hydration.
4483 return createAsyncPlaceholder(asyncFactory, data, context, children, tag);
4484 }
4485 }
4486 data = data || {};
4487 // resolve constructor options in case global mixins are applied after
4488 // component constructor creation
4489 resolveConstructorOptions(Ctor);
4490 // transform component v-model data into props & events
4491 if (isDef(data.model)) {
4492 // @ts-expect-error
4493 transformModel(Ctor.options, data);
4494 }
4495 // extract props
4496 // @ts-expect-error
4497 var propsData = extractPropsFromVNodeData(data, Ctor, tag);
4498 // functional component
4499 // @ts-expect-error
4500 if (isTrue(Ctor.options.functional)) {
4501 return createFunctionalComponent(Ctor, propsData, data, context, children);
4502 }
4503 // extract listeners, since these needs to be treated as
4504 // child component listeners instead of DOM listeners
4505 var listeners = data.on;
4506 // replace with listeners with .native modifier
4507 // so it gets processed during parent component patch.
4508 data.on = data.nativeOn;
4509 // @ts-expect-error
4510 if (isTrue(Ctor.options.abstract)) {
4511 // abstract components do not keep anything
4512 // other than props & listeners & slot
4513 // work around flow
4514 var slot = data.slot;
4515 data = {};
4516 if (slot) {
4517 data.slot = slot;
4518 }
4519 }
4520 // install component management hooks onto the placeholder node
4521 installComponentHooks(data);
4522 // return a placeholder vnode
4523 // @ts-expect-error
4524 var name = getComponentName(Ctor.options) || tag;
4525 var vnode = new VNode(
4526 // @ts-expect-error
4527 "vue-component-".concat(Ctor.cid).concat(name ? "-".concat(name) : ''), data, undefined, undefined, undefined, context,
4528 // @ts-expect-error
4529 { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }, asyncFactory);
4530 return vnode;
4531}
4532function createComponentInstanceForVnode(
4533// we know it's MountedComponentVNode but flow doesn't
4534vnode,
4535// activeInstance in lifecycle state
4536parent) {
4537 var options = {
4538 _isComponent: true,
4539 _parentVnode: vnode,
4540 parent: parent
4541 };
4542 // check inline-template render functions
4543 var inlineTemplate = vnode.data.inlineTemplate;
4544 if (isDef(inlineTemplate)) {
4545 options.render = inlineTemplate.render;
4546 options.staticRenderFns = inlineTemplate.staticRenderFns;
4547 }
4548 return new vnode.componentOptions.Ctor(options);
4549}
4550function installComponentHooks(data) {
4551 var hooks = data.hook || (data.hook = {});
4552 for (var i = 0; i < hooksToMerge.length; i++) {
4553 var key = hooksToMerge[i];
4554 var existing = hooks[key];
4555 var toMerge = componentVNodeHooks[key];
4556 // @ts-expect-error
4557 if (existing !== toMerge && !(existing && existing._merged)) {
4558 hooks[key] = existing ? mergeHook(toMerge, existing) : toMerge;
4559 }
4560 }
4561}
4562function mergeHook(f1, f2) {
4563 var merged = function (a, b) {
4564 // flow complains about extra args which is why we use any
4565 f1(a, b);
4566 f2(a, b);
4567 };
4568 merged._merged = true;
4569 return merged;
4570}
4571// transform component v-model info (value and callback) into
4572// prop and event handler respectively.
4573function transformModel(options, data) {
4574 var prop = (options.model && options.model.prop) || 'value';
4575 var event = (options.model && options.model.event) || 'input';
4576 (data.attrs || (data.attrs = {}))[prop] = data.model.value;
4577 var on = data.on || (data.on = {});
4578 var existing = on[event];
4579 var callback = data.model.callback;
4580 if (isDef(existing)) {
4581 if (isArray(existing)
4582 ? existing.indexOf(callback) === -1
4583 : existing !== callback) {
4584 on[event] = [callback].concat(existing);
4585 }
4586 }
4587 else {
4588 on[event] = callback;
4589 }
4590}
4591
4592var warn = noop;
4593var tip = noop;
4594var generateComponentTrace; // work around flow check
4595var formatComponentName;
4596if (process.env.NODE_ENV !== 'production') {
4597 var hasConsole_1 = typeof console !== 'undefined';
4598 var classifyRE_1 = /(?:^|[-_])(\w)/g;
4599 var classify_1 = function (str) {
4600 return str.replace(classifyRE_1, function (c) { return c.toUpperCase(); }).replace(/[-_]/g, '');
4601 };
4602 warn = function (msg, vm) {
4603 if (vm === void 0) { vm = currentInstance; }
4604 var trace = vm ? generateComponentTrace(vm) : '';
4605 if (config.warnHandler) {
4606 config.warnHandler.call(null, msg, vm, trace);
4607 }
4608 else if (hasConsole_1 && !config.silent) {
4609 console.error("[Vue warn]: ".concat(msg).concat(trace));
4610 }
4611 };
4612 tip = function (msg, vm) {
4613 if (hasConsole_1 && !config.silent) {
4614 console.warn("[Vue tip]: ".concat(msg) + (vm ? generateComponentTrace(vm) : ''));
4615 }
4616 };
4617 formatComponentName = function (vm, includeFile) {
4618 if (vm.$root === vm) {
4619 return '<Root>';
4620 }
4621 var options = isFunction(vm) && vm.cid != null
4622 ? vm.options
4623 : vm._isVue
4624 ? vm.$options || vm.constructor.options
4625 : vm;
4626 var name = getComponentName(options);
4627 var file = options.__file;
4628 if (!name && file) {
4629 var match = file.match(/([^/\\]+)\.vue$/);
4630 name = match && match[1];
4631 }
4632 return ((name ? "<".concat(classify_1(name), ">") : "<Anonymous>") +
4633 (file && includeFile !== false ? " at ".concat(file) : ''));
4634 };
4635 var repeat_1 = function (str, n) {
4636 var res = '';
4637 while (n) {
4638 if (n % 2 === 1)
4639 res += str;
4640 if (n > 1)
4641 str += str;
4642 n >>= 1;
4643 }
4644 return res;
4645 };
4646 generateComponentTrace = function (vm) {
4647 if (vm._isVue && vm.$parent) {
4648 var tree = [];
4649 var currentRecursiveSequence = 0;
4650 while (vm) {
4651 if (tree.length > 0) {
4652 var last = tree[tree.length - 1];
4653 if (last.constructor === vm.constructor) {
4654 currentRecursiveSequence++;
4655 vm = vm.$parent;
4656 continue;
4657 }
4658 else if (currentRecursiveSequence > 0) {
4659 tree[tree.length - 1] = [last, currentRecursiveSequence];
4660 currentRecursiveSequence = 0;
4661 }
4662 }
4663 tree.push(vm);
4664 vm = vm.$parent;
4665 }
4666 return ('\n\nfound in\n\n' +
4667 tree
4668 .map(function (vm, i) {
4669 return "".concat(i === 0 ? '---> ' : repeat_1(' ', 5 + i * 2)).concat(isArray(vm)
4670 ? "".concat(formatComponentName(vm[0]), "... (").concat(vm[1], " recursive calls)")
4671 : formatComponentName(vm));
4672 })
4673 .join('\n'));
4674 }
4675 else {
4676 return "\n\n(found in ".concat(formatComponentName(vm), ")");
4677 }
4678 };
4679}
4680
4681/**
4682 * Option overwriting strategies are functions that handle
4683 * how to merge a parent option value and a child option
4684 * value into the final value.
4685 */
4686var strats = config.optionMergeStrategies;
4687/**
4688 * Options with restrictions
4689 */
4690if (process.env.NODE_ENV !== 'production') {
4691 strats.el = strats.propsData = function (parent, child, vm, key) {
4692 if (!vm) {
4693 warn("option \"".concat(key, "\" can only be used during instance ") +
4694 'creation with the `new` keyword.');
4695 }
4696 return defaultStrat(parent, child);
4697 };
4698}
4699/**
4700 * Helper that recursively merges two data objects together.
4701 */
4702function mergeData(to, from, recursive) {
4703 if (recursive === void 0) { recursive = true; }
4704 if (!from)
4705 return to;
4706 var key, toVal, fromVal;
4707 var keys = hasSymbol
4708 ? Reflect.ownKeys(from)
4709 : Object.keys(from);
4710 for (var i = 0; i < keys.length; i++) {
4711 key = keys[i];
4712 // in case the object is already observed...
4713 if (key === '__ob__')
4714 continue;
4715 toVal = to[key];
4716 fromVal = from[key];
4717 if (!recursive || !hasOwn(to, key)) {
4718 set(to, key, fromVal);
4719 }
4720 else if (toVal !== fromVal &&
4721 isPlainObject(toVal) &&
4722 isPlainObject(fromVal)) {
4723 mergeData(toVal, fromVal);
4724 }
4725 }
4726 return to;
4727}
4728/**
4729 * Data
4730 */
4731function mergeDataOrFn(parentVal, childVal, vm) {
4732 if (!vm) {
4733 // in a Vue.extend merge, both should be functions
4734 if (!childVal) {
4735 return parentVal;
4736 }
4737 if (!parentVal) {
4738 return childVal;
4739 }
4740 // when parentVal & childVal are both present,
4741 // we need to return a function that returns the
4742 // merged result of both functions... no need to
4743 // check if parentVal is a function here because
4744 // it has to be a function to pass previous merges.
4745 return function mergedDataFn() {
4746 return mergeData(isFunction(childVal) ? childVal.call(this, this) : childVal, isFunction(parentVal) ? parentVal.call(this, this) : parentVal);
4747 };
4748 }
4749 else {
4750 return function mergedInstanceDataFn() {
4751 // instance merge
4752 var instanceData = isFunction(childVal)
4753 ? childVal.call(vm, vm)
4754 : childVal;
4755 var defaultData = isFunction(parentVal)
4756 ? parentVal.call(vm, vm)
4757 : parentVal;
4758 if (instanceData) {
4759 return mergeData(instanceData, defaultData);
4760 }
4761 else {
4762 return defaultData;
4763 }
4764 };
4765 }
4766}
4767strats.data = function (parentVal, childVal, vm) {
4768 if (!vm) {
4769 if (childVal && typeof childVal !== 'function') {
4770 process.env.NODE_ENV !== 'production' &&
4771 warn('The "data" option should be a function ' +
4772 'that returns a per-instance value in component ' +
4773 'definitions.', vm);
4774 return parentVal;
4775 }
4776 return mergeDataOrFn(parentVal, childVal);
4777 }
4778 return mergeDataOrFn(parentVal, childVal, vm);
4779};
4780/**
4781 * Hooks and props are merged as arrays.
4782 */
4783function mergeLifecycleHook(parentVal, childVal) {
4784 var res = childVal
4785 ? parentVal
4786 ? parentVal.concat(childVal)
4787 : isArray(childVal)
4788 ? childVal
4789 : [childVal]
4790 : parentVal;
4791 return res ? dedupeHooks(res) : res;
4792}
4793function dedupeHooks(hooks) {
4794 var res = [];
4795 for (var i = 0; i < hooks.length; i++) {
4796 if (res.indexOf(hooks[i]) === -1) {
4797 res.push(hooks[i]);
4798 }
4799 }
4800 return res;
4801}
4802LIFECYCLE_HOOKS.forEach(function (hook) {
4803 strats[hook] = mergeLifecycleHook;
4804});
4805/**
4806 * Assets
4807 *
4808 * When a vm is present (instance creation), we need to do
4809 * a three-way merge between constructor options, instance
4810 * options and parent options.
4811 */
4812function mergeAssets(parentVal, childVal, vm, key) {
4813 var res = Object.create(parentVal || null);
4814 if (childVal) {
4815 process.env.NODE_ENV !== 'production' && assertObjectType(key, childVal, vm);
4816 return extend(res, childVal);
4817 }
4818 else {
4819 return res;
4820 }
4821}
4822ASSET_TYPES.forEach(function (type) {
4823 strats[type + 's'] = mergeAssets;
4824});
4825/**
4826 * Watchers.
4827 *
4828 * Watchers hashes should not overwrite one
4829 * another, so we merge them as arrays.
4830 */
4831strats.watch = function (parentVal, childVal, vm, key) {
4832 // work around Firefox's Object.prototype.watch...
4833 //@ts-expect-error work around
4834 if (parentVal === nativeWatch)
4835 parentVal = undefined;
4836 //@ts-expect-error work around
4837 if (childVal === nativeWatch)
4838 childVal = undefined;
4839 /* istanbul ignore if */
4840 if (!childVal)
4841 return Object.create(parentVal || null);
4842 if (process.env.NODE_ENV !== 'production') {
4843 assertObjectType(key, childVal, vm);
4844 }
4845 if (!parentVal)
4846 return childVal;
4847 var ret = {};
4848 extend(ret, parentVal);
4849 for (var key_1 in childVal) {
4850 var parent_1 = ret[key_1];
4851 var child = childVal[key_1];
4852 if (parent_1 && !isArray(parent_1)) {
4853 parent_1 = [parent_1];
4854 }
4855 ret[key_1] = parent_1 ? parent_1.concat(child) : isArray(child) ? child : [child];
4856 }
4857 return ret;
4858};
4859/**
4860 * Other object hashes.
4861 */
4862strats.props =
4863 strats.methods =
4864 strats.inject =
4865 strats.computed =
4866 function (parentVal, childVal, vm, key) {
4867 if (childVal && process.env.NODE_ENV !== 'production') {
4868 assertObjectType(key, childVal, vm);
4869 }
4870 if (!parentVal)
4871 return childVal;
4872 var ret = Object.create(null);
4873 extend(ret, parentVal);
4874 if (childVal)
4875 extend(ret, childVal);
4876 return ret;
4877 };
4878strats.provide = function (parentVal, childVal) {
4879 if (!parentVal)
4880 return childVal;
4881 return function () {
4882 var ret = Object.create(null);
4883 mergeData(ret, isFunction(parentVal) ? parentVal.call(this) : parentVal);
4884 if (childVal) {
4885 mergeData(ret, isFunction(childVal) ? childVal.call(this) : childVal, false // non-recursive
4886 );
4887 }
4888 return ret;
4889 };
4890};
4891/**
4892 * Default strategy.
4893 */
4894var defaultStrat = function (parentVal, childVal) {
4895 return childVal === undefined ? parentVal : childVal;
4896};
4897/**
4898 * Validate component names
4899 */
4900function checkComponents(options) {
4901 for (var key in options.components) {
4902 validateComponentName(key);
4903 }
4904}
4905function validateComponentName(name) {
4906 if (!new RegExp("^[a-zA-Z][\\-\\.0-9_".concat(unicodeRegExp.source, "]*$")).test(name)) {
4907 warn('Invalid component name: "' +
4908 name +
4909 '". Component names ' +
4910 'should conform to valid custom element name in html5 specification.');
4911 }
4912 if (isBuiltInTag(name) || config.isReservedTag(name)) {
4913 warn('Do not use built-in or reserved HTML elements as component ' +
4914 'id: ' +
4915 name);
4916 }
4917}
4918/**
4919 * Ensure all props option syntax are normalized into the
4920 * Object-based format.
4921 */
4922function normalizeProps(options, vm) {
4923 var props = options.props;
4924 if (!props)
4925 return;
4926 var res = {};
4927 var i, val, name;
4928 if (isArray(props)) {
4929 i = props.length;
4930 while (i--) {
4931 val = props[i];
4932 if (typeof val === 'string') {
4933 name = camelize(val);
4934 res[name] = { type: null };
4935 }
4936 else if (process.env.NODE_ENV !== 'production') {
4937 warn('props must be strings when using array syntax.');
4938 }
4939 }
4940 }
4941 else if (isPlainObject(props)) {
4942 for (var key in props) {
4943 val = props[key];
4944 name = camelize(key);
4945 res[name] = isPlainObject(val) ? val : { type: val };
4946 }
4947 }
4948 else if (process.env.NODE_ENV !== 'production') {
4949 warn("Invalid value for option \"props\": expected an Array or an Object, " +
4950 "but got ".concat(toRawType(props), "."), vm);
4951 }
4952 options.props = res;
4953}
4954/**
4955 * Normalize all injections into Object-based format
4956 */
4957function normalizeInject(options, vm) {
4958 var inject = options.inject;
4959 if (!inject)
4960 return;
4961 var normalized = (options.inject = {});
4962 if (isArray(inject)) {
4963 for (var i = 0; i < inject.length; i++) {
4964 normalized[inject[i]] = { from: inject[i] };
4965 }
4966 }
4967 else if (isPlainObject(inject)) {
4968 for (var key in inject) {
4969 var val = inject[key];
4970 normalized[key] = isPlainObject(val)
4971 ? extend({ from: key }, val)
4972 : { from: val };
4973 }
4974 }
4975 else if (process.env.NODE_ENV !== 'production') {
4976 warn("Invalid value for option \"inject\": expected an Array or an Object, " +
4977 "but got ".concat(toRawType(inject), "."), vm);
4978 }
4979}
4980/**
4981 * Normalize raw function directives into object format.
4982 */
4983function normalizeDirectives$1(options) {
4984 var dirs = options.directives;
4985 if (dirs) {
4986 for (var key in dirs) {
4987 var def = dirs[key];
4988 if (isFunction(def)) {
4989 dirs[key] = { bind: def, update: def };
4990 }
4991 }
4992 }
4993}
4994function assertObjectType(name, value, vm) {
4995 if (!isPlainObject(value)) {
4996 warn("Invalid value for option \"".concat(name, "\": expected an Object, ") +
4997 "but got ".concat(toRawType(value), "."), vm);
4998 }
4999}
5000/**
5001 * Merge two option objects into a new one.
5002 * Core utility used in both instantiation and inheritance.
5003 */
5004function mergeOptions(parent, child, vm) {
5005 if (process.env.NODE_ENV !== 'production') {
5006 checkComponents(child);
5007 }
5008 if (isFunction(child)) {
5009 // @ts-expect-error
5010 child = child.options;
5011 }
5012 normalizeProps(child, vm);
5013 normalizeInject(child, vm);
5014 normalizeDirectives$1(child);
5015 // Apply extends and mixins on the child options,
5016 // but only if it is a raw options object that isn't
5017 // the result of another mergeOptions call.
5018 // Only merged options has the _base property.
5019 if (!child._base) {
5020 if (child.extends) {
5021 parent = mergeOptions(parent, child.extends, vm);
5022 }
5023 if (child.mixins) {
5024 for (var i = 0, l = child.mixins.length; i < l; i++) {
5025 parent = mergeOptions(parent, child.mixins[i], vm);
5026 }
5027 }
5028 }
5029 var options = {};
5030 var key;
5031 for (key in parent) {
5032 mergeField(key);
5033 }
5034 for (key in child) {
5035 if (!hasOwn(parent, key)) {
5036 mergeField(key);
5037 }
5038 }
5039 function mergeField(key) {
5040 var strat = strats[key] || defaultStrat;
5041 options[key] = strat(parent[key], child[key], vm, key);
5042 }
5043 return options;
5044}
5045/**
5046 * Resolve an asset.
5047 * This function is used because child instances need access
5048 * to assets defined in its ancestor chain.
5049 */
5050function resolveAsset(options, type, id, warnMissing) {
5051 /* istanbul ignore if */
5052 if (typeof id !== 'string') {
5053 return;
5054 }
5055 var assets = options[type];
5056 // check local registration variations first
5057 if (hasOwn(assets, id))
5058 return assets[id];
5059 var camelizedId = camelize(id);
5060 if (hasOwn(assets, camelizedId))
5061 return assets[camelizedId];
5062 var PascalCaseId = capitalize(camelizedId);
5063 if (hasOwn(assets, PascalCaseId))
5064 return assets[PascalCaseId];
5065 // fallback to prototype chain
5066 var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
5067 if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
5068 warn('Failed to resolve ' + type.slice(0, -1) + ': ' + id);
5069 }
5070 return res;
5071}
5072
5073function validateProp(key, propOptions, propsData, vm) {
5074 var prop = propOptions[key];
5075 var absent = !hasOwn(propsData, key);
5076 var value = propsData[key];
5077 // boolean casting
5078 var booleanIndex = getTypeIndex(Boolean, prop.type);
5079 if (booleanIndex > -1) {
5080 if (absent && !hasOwn(prop, 'default')) {
5081 value = false;
5082 }
5083 else if (value === '' || value === hyphenate(key)) {
5084 // only cast empty string / same name to boolean if
5085 // boolean has higher priority
5086 var stringIndex = getTypeIndex(String, prop.type);
5087 if (stringIndex < 0 || booleanIndex < stringIndex) {
5088 value = true;
5089 }
5090 }
5091 }
5092 // check default value
5093 if (value === undefined) {
5094 value = getPropDefaultValue(vm, prop, key);
5095 // since the default value is a fresh copy,
5096 // make sure to observe it.
5097 var prevShouldObserve = shouldObserve;
5098 toggleObserving(true);
5099 observe(value);
5100 toggleObserving(prevShouldObserve);
5101 }
5102 if (process.env.NODE_ENV !== 'production') {
5103 assertProp(prop, key, value, vm, absent);
5104 }
5105 return value;
5106}
5107/**
5108 * Get the default value of a prop.
5109 */
5110function getPropDefaultValue(vm, prop, key) {
5111 // no default, return undefined
5112 if (!hasOwn(prop, 'default')) {
5113 return undefined;
5114 }
5115 var def = prop.default;
5116 // warn against non-factory defaults for Object & Array
5117 if (process.env.NODE_ENV !== 'production' && isObject(def)) {
5118 warn('Invalid default value for prop "' +
5119 key +
5120 '": ' +
5121 'Props with type Object/Array must use a factory function ' +
5122 'to return the default value.', vm);
5123 }
5124 // the raw prop value was also undefined from previous render,
5125 // return previous default value to avoid unnecessary watcher trigger
5126 if (vm &&
5127 vm.$options.propsData &&
5128 vm.$options.propsData[key] === undefined &&
5129 vm._props[key] !== undefined) {
5130 return vm._props[key];
5131 }
5132 // call factory function for non-Function types
5133 // a value is Function if its prototype is function even across different execution context
5134 return isFunction(def) && getType(prop.type) !== 'Function'
5135 ? def.call(vm)
5136 : def;
5137}
5138/**
5139 * Assert whether a prop is valid.
5140 */
5141function assertProp(prop, name, value, vm, absent) {
5142 if (prop.required && absent) {
5143 warn('Missing required prop: "' + name + '"', vm);
5144 return;
5145 }
5146 if (value == null && !prop.required) {
5147 return;
5148 }
5149 var type = prop.type;
5150 var valid = !type || type === true;
5151 var expectedTypes = [];
5152 if (type) {
5153 if (!isArray(type)) {
5154 type = [type];
5155 }
5156 for (var i = 0; i < type.length && !valid; i++) {
5157 var assertedType = assertType(value, type[i], vm);
5158 expectedTypes.push(assertedType.expectedType || '');
5159 valid = assertedType.valid;
5160 }
5161 }
5162 var haveExpectedTypes = expectedTypes.some(function (t) { return t; });
5163 if (!valid && haveExpectedTypes) {
5164 warn(getInvalidTypeMessage(name, value, expectedTypes), vm);
5165 return;
5166 }
5167 var validator = prop.validator;
5168 if (validator) {
5169 if (!validator(value)) {
5170 warn('Invalid prop: custom validator check failed for prop "' + name + '".', vm);
5171 }
5172 }
5173}
5174var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/;
5175function assertType(value, type, vm) {
5176 var valid;
5177 var expectedType = getType(type);
5178 if (simpleCheckRE.test(expectedType)) {
5179 var t = typeof value;
5180 valid = t === expectedType.toLowerCase();
5181 // for primitive wrapper objects
5182 if (!valid && t === 'object') {
5183 valid = value instanceof type;
5184 }
5185 }
5186 else if (expectedType === 'Object') {
5187 valid = isPlainObject(value);
5188 }
5189 else if (expectedType === 'Array') {
5190 valid = isArray(value);
5191 }
5192 else {
5193 try {
5194 valid = value instanceof type;
5195 }
5196 catch (e) {
5197 warn('Invalid prop type: "' + String(type) + '" is not a constructor', vm);
5198 valid = false;
5199 }
5200 }
5201 return {
5202 valid: valid,
5203 expectedType: expectedType
5204 };
5205}
5206var functionTypeCheckRE = /^\s*function (\w+)/;
5207/**
5208 * Use function string name to check built-in types,
5209 * because a simple equality check will fail when running
5210 * across different vms / iframes.
5211 */
5212function getType(fn) {
5213 var match = fn && fn.toString().match(functionTypeCheckRE);
5214 return match ? match[1] : '';
5215}
5216function isSameType(a, b) {
5217 return getType(a) === getType(b);
5218}
5219function getTypeIndex(type, expectedTypes) {
5220 if (!isArray(expectedTypes)) {
5221 return isSameType(expectedTypes, type) ? 0 : -1;
5222 }
5223 for (var i = 0, len = expectedTypes.length; i < len; i++) {
5224 if (isSameType(expectedTypes[i], type)) {
5225 return i;
5226 }
5227 }
5228 return -1;
5229}
5230function getInvalidTypeMessage(name, value, expectedTypes) {
5231 var message = "Invalid prop: type check failed for prop \"".concat(name, "\".") +
5232 " Expected ".concat(expectedTypes.map(capitalize).join(', '));
5233 var expectedType = expectedTypes[0];
5234 var receivedType = toRawType(value);
5235 // check if we need to specify expected value
5236 if (expectedTypes.length === 1 &&
5237 isExplicable(expectedType) &&
5238 isExplicable(typeof value) &&
5239 !isBoolean(expectedType, receivedType)) {
5240 message += " with value ".concat(styleValue(value, expectedType));
5241 }
5242 message += ", got ".concat(receivedType, " ");
5243 // check if we need to specify received value
5244 if (isExplicable(receivedType)) {
5245 message += "with value ".concat(styleValue(value, receivedType), ".");
5246 }
5247 return message;
5248}
5249function styleValue(value, type) {
5250 if (type === 'String') {
5251 return "\"".concat(value, "\"");
5252 }
5253 else if (type === 'Number') {
5254 return "".concat(Number(value));
5255 }
5256 else {
5257 return "".concat(value);
5258 }
5259}
5260var EXPLICABLE_TYPES = ['string', 'number', 'boolean'];
5261function isExplicable(value) {
5262 return EXPLICABLE_TYPES.some(function (elem) { return value.toLowerCase() === elem; });
5263}
5264function isBoolean() {
5265 var args = [];
5266 for (var _i = 0; _i < arguments.length; _i++) {
5267 args[_i] = arguments[_i];
5268 }
5269 return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; });
5270}
5271
5272/* not type checking this file because flow doesn't play well with Proxy */
5273var initProxy;
5274if (process.env.NODE_ENV !== 'production') {
5275 var allowedGlobals_1 = makeMap('Infinity,undefined,NaN,isFinite,isNaN,' +
5276 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
5277 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,' +
5278 'require' // for Webpack/Browserify
5279 );
5280 var warnNonPresent_1 = function (target, key) {
5281 warn("Property or method \"".concat(key, "\" is not defined on the instance but ") +
5282 'referenced during render. Make sure that this property is reactive, ' +
5283 'either in the data option, or for class-based components, by ' +
5284 'initializing the property. ' +
5285 'See: https://v2.vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', target);
5286 };
5287 var warnReservedPrefix_1 = function (target, key) {
5288 warn("Property \"".concat(key, "\" must be accessed with \"$data.").concat(key, "\" because ") +
5289 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
5290 'prevent conflicts with Vue internals. ' +
5291 'See: https://v2.vuejs.org/v2/api/#data', target);
5292 };
5293 var hasProxy_1 = typeof Proxy !== 'undefined' && isNative(Proxy);
5294 if (hasProxy_1) {
5295 var isBuiltInModifier_1 = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
5296 config.keyCodes = new Proxy(config.keyCodes, {
5297 set: function (target, key, value) {
5298 if (isBuiltInModifier_1(key)) {
5299 warn("Avoid overwriting built-in modifier in config.keyCodes: .".concat(key));
5300 return false;
5301 }
5302 else {
5303 target[key] = value;
5304 return true;
5305 }
5306 }
5307 });
5308 }
5309 var hasHandler_1 = {
5310 has: function (target, key) {
5311 var has = key in target;
5312 var isAllowed = allowedGlobals_1(key) ||
5313 (typeof key === 'string' &&
5314 key.charAt(0) === '_' &&
5315 !(key in target.$data));
5316 if (!has && !isAllowed) {
5317 if (key in target.$data)
5318 warnReservedPrefix_1(target, key);
5319 else
5320 warnNonPresent_1(target, key);
5321 }
5322 return has || !isAllowed;
5323 }
5324 };
5325 var getHandler_1 = {
5326 get: function (target, key) {
5327 if (typeof key === 'string' && !(key in target)) {
5328 if (key in target.$data)
5329 warnReservedPrefix_1(target, key);
5330 else
5331 warnNonPresent_1(target, key);
5332 }
5333 return target[key];
5334 }
5335 };
5336 initProxy = function initProxy(vm) {
5337 if (hasProxy_1) {
5338 // determine which proxy handler to use
5339 var options = vm.$options;
5340 var handlers = options.render && options.render._withStripped ? getHandler_1 : hasHandler_1;
5341 vm._renderProxy = new Proxy(vm, handlers);
5342 }
5343 else {
5344 vm._renderProxy = vm;
5345 }
5346 };
5347}
5348
5349var sharedPropertyDefinition = {
5350 enumerable: true,
5351 configurable: true,
5352 get: noop,
5353 set: noop
5354};
5355function proxy(target, sourceKey, key) {
5356 sharedPropertyDefinition.get = function proxyGetter() {
5357 return this[sourceKey][key];
5358 };
5359 sharedPropertyDefinition.set = function proxySetter(val) {
5360 this[sourceKey][key] = val;
5361 };
5362 Object.defineProperty(target, key, sharedPropertyDefinition);
5363}
5364function initState(vm) {
5365 var opts = vm.$options;
5366 if (opts.props)
5367 initProps$1(vm, opts.props);
5368 // Composition API
5369 initSetup(vm);
5370 if (opts.methods)
5371 initMethods(vm, opts.methods);
5372 if (opts.data) {
5373 initData(vm);
5374 }
5375 else {
5376 var ob = observe((vm._data = {}));
5377 ob && ob.vmCount++;
5378 }
5379 if (opts.computed)
5380 initComputed$1(vm, opts.computed);
5381 if (opts.watch && opts.watch !== nativeWatch) {
5382 initWatch(vm, opts.watch);
5383 }
5384}
5385function initProps$1(vm, propsOptions) {
5386 var propsData = vm.$options.propsData || {};
5387 var props = (vm._props = shallowReactive({}));
5388 // cache prop keys so that future props updates can iterate using Array
5389 // instead of dynamic object key enumeration.
5390 var keys = (vm.$options._propKeys = []);
5391 var isRoot = !vm.$parent;
5392 // root instance props should be converted
5393 if (!isRoot) {
5394 toggleObserving(false);
5395 }
5396 var _loop_1 = function (key) {
5397 keys.push(key);
5398 var value = validateProp(key, propsOptions, propsData, vm);
5399 /* istanbul ignore else */
5400 if (process.env.NODE_ENV !== 'production') {
5401 var hyphenatedKey = hyphenate(key);
5402 if (isReservedAttribute(hyphenatedKey) ||
5403 config.isReservedAttr(hyphenatedKey)) {
5404 warn("\"".concat(hyphenatedKey, "\" is a reserved attribute and cannot be used as component prop."), vm);
5405 }
5406 defineReactive(props, key, value, function () {
5407 if (!isRoot && !isUpdatingChildComponent) {
5408 warn("Avoid mutating a prop directly since the value will be " +
5409 "overwritten whenever the parent component re-renders. " +
5410 "Instead, use a data or computed property based on the prop's " +
5411 "value. Prop being mutated: \"".concat(key, "\""), vm);
5412 }
5413 });
5414 }
5415 else {
5416 defineReactive(props, key, value);
5417 }
5418 // static props are already proxied on the component's prototype
5419 // during Vue.extend(). We only need to proxy props defined at
5420 // instantiation here.
5421 if (!(key in vm)) {
5422 proxy(vm, "_props", key);
5423 }
5424 };
5425 for (var key in propsOptions) {
5426 _loop_1(key);
5427 }
5428 toggleObserving(true);
5429}
5430function initData(vm) {
5431 var data = vm.$options.data;
5432 data = vm._data = isFunction(data) ? getData(data, vm) : data || {};
5433 if (!isPlainObject(data)) {
5434 data = {};
5435 process.env.NODE_ENV !== 'production' &&
5436 warn('data functions should return an object:\n' +
5437 'https://v2.vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', vm);
5438 }
5439 // proxy data on instance
5440 var keys = Object.keys(data);
5441 var props = vm.$options.props;
5442 var methods = vm.$options.methods;
5443 var i = keys.length;
5444 while (i--) {
5445 var key = keys[i];
5446 if (process.env.NODE_ENV !== 'production') {
5447 if (methods && hasOwn(methods, key)) {
5448 warn("Method \"".concat(key, "\" has already been defined as a data property."), vm);
5449 }
5450 }
5451 if (props && hasOwn(props, key)) {
5452 process.env.NODE_ENV !== 'production' &&
5453 warn("The data property \"".concat(key, "\" is already declared as a prop. ") +
5454 "Use prop default value instead.", vm);
5455 }
5456 else if (!isReserved(key)) {
5457 proxy(vm, "_data", key);
5458 }
5459 }
5460 // observe data
5461 var ob = observe(data);
5462 ob && ob.vmCount++;
5463}
5464function getData(data, vm) {
5465 // #7573 disable dep collection when invoking data getters
5466 pushTarget();
5467 try {
5468 return data.call(vm, vm);
5469 }
5470 catch (e) {
5471 handleError(e, vm, "data()");
5472 return {};
5473 }
5474 finally {
5475 popTarget();
5476 }
5477}
5478var computedWatcherOptions = { lazy: true };
5479function initComputed$1(vm, computed) {
5480 // $flow-disable-line
5481 var watchers = (vm._computedWatchers = Object.create(null));
5482 // computed properties are just getters during SSR
5483 var isSSR = isServerRendering();
5484 for (var key in computed) {
5485 var userDef = computed[key];
5486 var getter = isFunction(userDef) ? userDef : userDef.get;
5487 if (process.env.NODE_ENV !== 'production' && getter == null) {
5488 warn("Getter is missing for computed property \"".concat(key, "\"."), vm);
5489 }
5490 if (!isSSR) {
5491 // create internal watcher for the computed property.
5492 watchers[key] = new Watcher(vm, getter || noop, noop, computedWatcherOptions);
5493 }
5494 // component-defined computed properties are already defined on the
5495 // component prototype. We only need to define computed properties defined
5496 // at instantiation here.
5497 if (!(key in vm)) {
5498 defineComputed(vm, key, userDef);
5499 }
5500 else if (process.env.NODE_ENV !== 'production') {
5501 if (key in vm.$data) {
5502 warn("The computed property \"".concat(key, "\" is already defined in data."), vm);
5503 }
5504 else if (vm.$options.props && key in vm.$options.props) {
5505 warn("The computed property \"".concat(key, "\" is already defined as a prop."), vm);
5506 }
5507 else if (vm.$options.methods && key in vm.$options.methods) {
5508 warn("The computed property \"".concat(key, "\" is already defined as a method."), vm);
5509 }
5510 }
5511 }
5512}
5513function defineComputed(target, key, userDef) {
5514 var shouldCache = !isServerRendering();
5515 if (isFunction(userDef)) {
5516 sharedPropertyDefinition.get = shouldCache
5517 ? createComputedGetter(key)
5518 : createGetterInvoker(userDef);
5519 sharedPropertyDefinition.set = noop;
5520 }
5521 else {
5522 sharedPropertyDefinition.get = userDef.get
5523 ? shouldCache && userDef.cache !== false
5524 ? createComputedGetter(key)
5525 : createGetterInvoker(userDef.get)
5526 : noop;
5527 sharedPropertyDefinition.set = userDef.set || noop;
5528 }
5529 if (process.env.NODE_ENV !== 'production' && sharedPropertyDefinition.set === noop) {
5530 sharedPropertyDefinition.set = function () {
5531 warn("Computed property \"".concat(key, "\" was assigned to but it has no setter."), this);
5532 };
5533 }
5534 Object.defineProperty(target, key, sharedPropertyDefinition);
5535}
5536function createComputedGetter(key) {
5537 return function computedGetter() {
5538 var watcher = this._computedWatchers && this._computedWatchers[key];
5539 if (watcher) {
5540 if (watcher.dirty) {
5541 watcher.evaluate();
5542 }
5543 if (Dep.target) {
5544 if (process.env.NODE_ENV !== 'production' && Dep.target.onTrack) {
5545 Dep.target.onTrack({
5546 effect: Dep.target,
5547 target: this,
5548 type: "get" /* TrackOpTypes.GET */,
5549 key: key
5550 });
5551 }
5552 watcher.depend();
5553 }
5554 return watcher.value;
5555 }
5556 };
5557}
5558function createGetterInvoker(fn) {
5559 return function computedGetter() {
5560 return fn.call(this, this);
5561 };
5562}
5563function initMethods(vm, methods) {
5564 var props = vm.$options.props;
5565 for (var key in methods) {
5566 if (process.env.NODE_ENV !== 'production') {
5567 if (typeof methods[key] !== 'function') {
5568 warn("Method \"".concat(key, "\" has type \"").concat(typeof methods[key], "\" in the component definition. ") +
5569 "Did you reference the function correctly?", vm);
5570 }
5571 if (props && hasOwn(props, key)) {
5572 warn("Method \"".concat(key, "\" has already been defined as a prop."), vm);
5573 }
5574 if (key in vm && isReserved(key)) {
5575 warn("Method \"".concat(key, "\" conflicts with an existing Vue instance method. ") +
5576 "Avoid defining component methods that start with _ or $.");
5577 }
5578 }
5579 vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
5580 }
5581}
5582function initWatch(vm, watch) {
5583 for (var key in watch) {
5584 var handler = watch[key];
5585 if (isArray(handler)) {
5586 for (var i = 0; i < handler.length; i++) {
5587 createWatcher(vm, key, handler[i]);
5588 }
5589 }
5590 else {
5591 createWatcher(vm, key, handler);
5592 }
5593 }
5594}
5595function createWatcher(vm, expOrFn, handler, options) {
5596 if (isPlainObject(handler)) {
5597 options = handler;
5598 handler = handler.handler;
5599 }
5600 if (typeof handler === 'string') {
5601 handler = vm[handler];
5602 }
5603 return vm.$watch(expOrFn, handler, options);
5604}
5605function stateMixin(Vue) {
5606 // flow somehow has problems with directly declared definition object
5607 // when using Object.defineProperty, so we have to procedurally build up
5608 // the object here.
5609 var dataDef = {};
5610 dataDef.get = function () {
5611 return this._data;
5612 };
5613 var propsDef = {};
5614 propsDef.get = function () {
5615 return this._props;
5616 };
5617 if (process.env.NODE_ENV !== 'production') {
5618 dataDef.set = function () {
5619 warn('Avoid replacing instance root $data. ' +
5620 'Use nested data properties instead.', this);
5621 };
5622 propsDef.set = function () {
5623 warn("$props is readonly.", this);
5624 };
5625 }
5626 Object.defineProperty(Vue.prototype, '$data', dataDef);
5627 Object.defineProperty(Vue.prototype, '$props', propsDef);
5628 Vue.prototype.$set = set;
5629 Vue.prototype.$delete = del;
5630 Vue.prototype.$watch = function (expOrFn, cb, options) {
5631 var vm = this;
5632 if (isPlainObject(cb)) {
5633 return createWatcher(vm, expOrFn, cb, options);
5634 }
5635 options = options || {};
5636 options.user = true;
5637 var watcher = new Watcher(vm, expOrFn, cb, options);
5638 if (options.immediate) {
5639 var info = "callback for immediate watcher \"".concat(watcher.expression, "\"");
5640 pushTarget();
5641 invokeWithErrorHandling(cb, vm, [watcher.value], vm, info);
5642 popTarget();
5643 }
5644 return function unwatchFn() {
5645 watcher.teardown();
5646 };
5647 };
5648}
5649
5650var uid = 0;
5651function initMixin$1(Vue) {
5652 Vue.prototype._init = function (options) {
5653 var vm = this;
5654 // a uid
5655 vm._uid = uid++;
5656 var startTag, endTag;
5657 /* istanbul ignore if */
5658 if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
5659 startTag = "vue-perf-start:".concat(vm._uid);
5660 endTag = "vue-perf-end:".concat(vm._uid);
5661 mark(startTag);
5662 }
5663 // a flag to mark this as a Vue instance without having to do instanceof
5664 // check
5665 vm._isVue = true;
5666 // avoid instances from being observed
5667 vm.__v_skip = true;
5668 // effect scope
5669 vm._scope = new EffectScope(true /* detached */);
5670 vm._scope._vm = true;
5671 // merge options
5672 if (options && options._isComponent) {
5673 // optimize internal component instantiation
5674 // since dynamic options merging is pretty slow, and none of the
5675 // internal component options needs special treatment.
5676 initInternalComponent(vm, options);
5677 }
5678 else {
5679 vm.$options = mergeOptions(resolveConstructorOptions(vm.constructor), options || {}, vm);
5680 }
5681 /* istanbul ignore else */
5682 if (process.env.NODE_ENV !== 'production') {
5683 initProxy(vm);
5684 }
5685 else {
5686 vm._renderProxy = vm;
5687 }
5688 // expose real self
5689 vm._self = vm;
5690 initLifecycle(vm);
5691 initEvents(vm);
5692 initRender(vm);
5693 callHook$1(vm, 'beforeCreate', undefined, false /* setContext */);
5694 initInjections(vm); // resolve injections before data/props
5695 initState(vm);
5696 initProvide(vm); // resolve provide after data/props
5697 callHook$1(vm, 'created');
5698 /* istanbul ignore if */
5699 if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
5700 vm._name = formatComponentName(vm, false);
5701 mark(endTag);
5702 measure("vue ".concat(vm._name, " init"), startTag, endTag);
5703 }
5704 if (vm.$options.el) {
5705 vm.$mount(vm.$options.el);
5706 }
5707 };
5708}
5709function initInternalComponent(vm, options) {
5710 var opts = (vm.$options = Object.create(vm.constructor.options));
5711 // doing this because it's faster than dynamic enumeration.
5712 var parentVnode = options._parentVnode;
5713 opts.parent = options.parent;
5714 opts._parentVnode = parentVnode;
5715 var vnodeComponentOptions = parentVnode.componentOptions;
5716 opts.propsData = vnodeComponentOptions.propsData;
5717 opts._parentListeners = vnodeComponentOptions.listeners;
5718 opts._renderChildren = vnodeComponentOptions.children;
5719 opts._componentTag = vnodeComponentOptions.tag;
5720 if (options.render) {
5721 opts.render = options.render;
5722 opts.staticRenderFns = options.staticRenderFns;
5723 }
5724}
5725function resolveConstructorOptions(Ctor) {
5726 var options = Ctor.options;
5727 if (Ctor.super) {
5728 var superOptions = resolveConstructorOptions(Ctor.super);
5729 var cachedSuperOptions = Ctor.superOptions;
5730 if (superOptions !== cachedSuperOptions) {
5731 // super option changed,
5732 // need to resolve new options.
5733 Ctor.superOptions = superOptions;
5734 // check if there are any late-modified/attached options (#4976)
5735 var modifiedOptions = resolveModifiedOptions(Ctor);
5736 // update base extend options
5737 if (modifiedOptions) {
5738 extend(Ctor.extendOptions, modifiedOptions);
5739 }
5740 options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
5741 if (options.name) {
5742 options.components[options.name] = Ctor;
5743 }
5744 }
5745 }
5746 return options;
5747}
5748function resolveModifiedOptions(Ctor) {
5749 var modified;
5750 var latest = Ctor.options;
5751 var sealed = Ctor.sealedOptions;
5752 for (var key in latest) {
5753 if (latest[key] !== sealed[key]) {
5754 if (!modified)
5755 modified = {};
5756 modified[key] = latest[key];
5757 }
5758 }
5759 return modified;
5760}
5761
5762function Vue(options) {
5763 if (process.env.NODE_ENV !== 'production' && !(this instanceof Vue)) {
5764 warn('Vue is a constructor and should be called with the `new` keyword');
5765 }
5766 this._init(options);
5767}
5768//@ts-expect-error Vue has function type
5769initMixin$1(Vue);
5770//@ts-expect-error Vue has function type
5771stateMixin(Vue);
5772//@ts-expect-error Vue has function type
5773eventsMixin(Vue);
5774//@ts-expect-error Vue has function type
5775lifecycleMixin(Vue);
5776//@ts-expect-error Vue has function type
5777renderMixin(Vue);
5778
5779function initUse(Vue) {
5780 Vue.use = function (plugin) {
5781 var installedPlugins = this._installedPlugins || (this._installedPlugins = []);
5782 if (installedPlugins.indexOf(plugin) > -1) {
5783 return this;
5784 }
5785 // additional parameters
5786 var args = toArray(arguments, 1);
5787 args.unshift(this);
5788 if (isFunction(plugin.install)) {
5789 plugin.install.apply(plugin, args);
5790 }
5791 else if (isFunction(plugin)) {
5792 plugin.apply(null, args);
5793 }
5794 installedPlugins.push(plugin);
5795 return this;
5796 };
5797}
5798
5799function initMixin(Vue) {
5800 Vue.mixin = function (mixin) {
5801 this.options = mergeOptions(this.options, mixin);
5802 return this;
5803 };
5804}
5805
5806function initExtend(Vue) {
5807 /**
5808 * Each instance constructor, including Vue, has a unique
5809 * cid. This enables us to create wrapped "child
5810 * constructors" for prototypal inheritance and cache them.
5811 */
5812 Vue.cid = 0;
5813 var cid = 1;
5814 /**
5815 * Class inheritance
5816 */
5817 Vue.extend = function (extendOptions) {
5818 extendOptions = extendOptions || {};
5819 var Super = this;
5820 var SuperId = Super.cid;
5821 var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
5822 if (cachedCtors[SuperId]) {
5823 return cachedCtors[SuperId];
5824 }
5825 var name = getComponentName(extendOptions) || getComponentName(Super.options);
5826 if (process.env.NODE_ENV !== 'production' && name) {
5827 validateComponentName(name);
5828 }
5829 var Sub = function VueComponent(options) {
5830 this._init(options);
5831 };
5832 Sub.prototype = Object.create(Super.prototype);
5833 Sub.prototype.constructor = Sub;
5834 Sub.cid = cid++;
5835 Sub.options = mergeOptions(Super.options, extendOptions);
5836 Sub['super'] = Super;
5837 // For props and computed properties, we define the proxy getters on
5838 // the Vue instances at extension time, on the extended prototype. This
5839 // avoids Object.defineProperty calls for each instance created.
5840 if (Sub.options.props) {
5841 initProps(Sub);
5842 }
5843 if (Sub.options.computed) {
5844 initComputed(Sub);
5845 }
5846 // allow further extension/mixin/plugin usage
5847 Sub.extend = Super.extend;
5848 Sub.mixin = Super.mixin;
5849 Sub.use = Super.use;
5850 // create asset registers, so extended classes
5851 // can have their private assets too.
5852 ASSET_TYPES.forEach(function (type) {
5853 Sub[type] = Super[type];
5854 });
5855 // enable recursive self-lookup
5856 if (name) {
5857 Sub.options.components[name] = Sub;
5858 }
5859 // keep a reference to the super options at extension time.
5860 // later at instantiation we can check if Super's options have
5861 // been updated.
5862 Sub.superOptions = Super.options;
5863 Sub.extendOptions = extendOptions;
5864 Sub.sealedOptions = extend({}, Sub.options);
5865 // cache constructor
5866 cachedCtors[SuperId] = Sub;
5867 return Sub;
5868 };
5869}
5870function initProps(Comp) {
5871 var props = Comp.options.props;
5872 for (var key in props) {
5873 proxy(Comp.prototype, "_props", key);
5874 }
5875}
5876function initComputed(Comp) {
5877 var computed = Comp.options.computed;
5878 for (var key in computed) {
5879 defineComputed(Comp.prototype, key, computed[key]);
5880 }
5881}
5882
5883function initAssetRegisters(Vue) {
5884 /**
5885 * Create asset registration methods.
5886 */
5887 ASSET_TYPES.forEach(function (type) {
5888 // @ts-expect-error function is not exact same type
5889 Vue[type] = function (id, definition) {
5890 if (!definition) {
5891 return this.options[type + 's'][id];
5892 }
5893 else {
5894 /* istanbul ignore if */
5895 if (process.env.NODE_ENV !== 'production' && type === 'component') {
5896 validateComponentName(id);
5897 }
5898 if (type === 'component' && isPlainObject(definition)) {
5899 // @ts-expect-error
5900 definition.name = definition.name || id;
5901 definition = this.options._base.extend(definition);
5902 }
5903 if (type === 'directive' && isFunction(definition)) {
5904 definition = { bind: definition, update: definition };
5905 }
5906 this.options[type + 's'][id] = definition;
5907 return definition;
5908 }
5909 };
5910 });
5911}
5912
5913function _getComponentName(opts) {
5914 return opts && (getComponentName(opts.Ctor.options) || opts.tag);
5915}
5916function matches(pattern, name) {
5917 if (isArray(pattern)) {
5918 return pattern.indexOf(name) > -1;
5919 }
5920 else if (typeof pattern === 'string') {
5921 return pattern.split(',').indexOf(name) > -1;
5922 }
5923 else if (isRegExp(pattern)) {
5924 return pattern.test(name);
5925 }
5926 /* istanbul ignore next */
5927 return false;
5928}
5929function pruneCache(keepAliveInstance, filter) {
5930 var cache = keepAliveInstance.cache, keys = keepAliveInstance.keys, _vnode = keepAliveInstance._vnode;
5931 for (var key in cache) {
5932 var entry = cache[key];
5933 if (entry) {
5934 var name_1 = entry.name;
5935 if (name_1 && !filter(name_1)) {
5936 pruneCacheEntry(cache, key, keys, _vnode);
5937 }
5938 }
5939 }
5940}
5941function pruneCacheEntry(cache, key, keys, current) {
5942 var entry = cache[key];
5943 if (entry && (!current || entry.tag !== current.tag)) {
5944 // @ts-expect-error can be undefined
5945 entry.componentInstance.$destroy();
5946 }
5947 cache[key] = null;
5948 remove$2(keys, key);
5949}
5950var patternTypes = [String, RegExp, Array];
5951// TODO defineComponent
5952var KeepAlive = {
5953 name: 'keep-alive',
5954 abstract: true,
5955 props: {
5956 include: patternTypes,
5957 exclude: patternTypes,
5958 max: [String, Number]
5959 },
5960 methods: {
5961 cacheVNode: function () {
5962 var _a = this, cache = _a.cache, keys = _a.keys, vnodeToCache = _a.vnodeToCache, keyToCache = _a.keyToCache;
5963 if (vnodeToCache) {
5964 var tag = vnodeToCache.tag, componentInstance = vnodeToCache.componentInstance, componentOptions = vnodeToCache.componentOptions;
5965 cache[keyToCache] = {
5966 name: _getComponentName(componentOptions),
5967 tag: tag,
5968 componentInstance: componentInstance
5969 };
5970 keys.push(keyToCache);
5971 // prune oldest entry
5972 if (this.max && keys.length > parseInt(this.max)) {
5973 pruneCacheEntry(cache, keys[0], keys, this._vnode);
5974 }
5975 this.vnodeToCache = null;
5976 }
5977 }
5978 },
5979 created: function () {
5980 this.cache = Object.create(null);
5981 this.keys = [];
5982 },
5983 destroyed: function () {
5984 for (var key in this.cache) {
5985 pruneCacheEntry(this.cache, key, this.keys);
5986 }
5987 },
5988 mounted: function () {
5989 var _this = this;
5990 this.cacheVNode();
5991 this.$watch('include', function (val) {
5992 pruneCache(_this, function (name) { return matches(val, name); });
5993 });
5994 this.$watch('exclude', function (val) {
5995 pruneCache(_this, function (name) { return !matches(val, name); });
5996 });
5997 },
5998 updated: function () {
5999 this.cacheVNode();
6000 },
6001 render: function () {
6002 var slot = this.$slots.default;
6003 var vnode = getFirstComponentChild(slot);
6004 var componentOptions = vnode && vnode.componentOptions;
6005 if (componentOptions) {
6006 // check pattern
6007 var name_2 = _getComponentName(componentOptions);
6008 var _a = this, include = _a.include, exclude = _a.exclude;
6009 if (
6010 // not included
6011 (include && (!name_2 || !matches(include, name_2))) ||
6012 // excluded
6013 (exclude && name_2 && matches(exclude, name_2))) {
6014 return vnode;
6015 }
6016 var _b = this, cache = _b.cache, keys = _b.keys;
6017 var key = vnode.key == null
6018 ? // same constructor may get registered as different local components
6019 // so cid alone is not enough (#3269)
6020 componentOptions.Ctor.cid +
6021 (componentOptions.tag ? "::".concat(componentOptions.tag) : '')
6022 : vnode.key;
6023 if (cache[key]) {
6024 vnode.componentInstance = cache[key].componentInstance;
6025 // make current key freshest
6026 remove$2(keys, key);
6027 keys.push(key);
6028 }
6029 else {
6030 // delay setting the cache until update
6031 this.vnodeToCache = vnode;
6032 this.keyToCache = key;
6033 }
6034 // @ts-expect-error can vnode.data can be undefined
6035 vnode.data.keepAlive = true;
6036 }
6037 return vnode || (slot && slot[0]);
6038 }
6039};
6040
6041var builtInComponents = {
6042 KeepAlive: KeepAlive
6043};
6044
6045function initGlobalAPI(Vue) {
6046 // config
6047 var configDef = {};
6048 configDef.get = function () { return config; };
6049 if (process.env.NODE_ENV !== 'production') {
6050 configDef.set = function () {
6051 warn('Do not replace the Vue.config object, set individual fields instead.');
6052 };
6053 }
6054 Object.defineProperty(Vue, 'config', configDef);
6055 // exposed util methods.
6056 // NOTE: these are not considered part of the public API - avoid relying on
6057 // them unless you are aware of the risk.
6058 Vue.util = {
6059 warn: warn,
6060 extend: extend,
6061 mergeOptions: mergeOptions,
6062 defineReactive: defineReactive
6063 };
6064 Vue.set = set;
6065 Vue.delete = del;
6066 Vue.nextTick = nextTick;
6067 // 2.6 explicit observable API
6068 Vue.observable = function (obj) {
6069 observe(obj);
6070 return obj;
6071 };
6072 Vue.options = Object.create(null);
6073 ASSET_TYPES.forEach(function (type) {
6074 Vue.options[type + 's'] = Object.create(null);
6075 });
6076 // this is used to identify the "base" constructor to extend all plain-object
6077 // components with in Weex's multi-instance scenarios.
6078 Vue.options._base = Vue;
6079 extend(Vue.options.components, builtInComponents);
6080 initUse(Vue);
6081 initMixin(Vue);
6082 initExtend(Vue);
6083 initAssetRegisters(Vue);
6084}
6085
6086initGlobalAPI(Vue);
6087Object.defineProperty(Vue.prototype, '$isServer', {
6088 get: isServerRendering
6089});
6090Object.defineProperty(Vue.prototype, '$ssrContext', {
6091 get: function () {
6092 /* istanbul ignore next */
6093 return this.$vnode && this.$vnode.ssrContext;
6094 }
6095});
6096// expose FunctionalRenderContext for ssr runtime helper installation
6097Object.defineProperty(Vue, 'FunctionalRenderContext', {
6098 value: FunctionalRenderContext
6099});
6100Vue.version = version;
6101
6102// these are reserved for web because they are directly compiled away
6103// during template compilation
6104var isReservedAttr = makeMap('style,class');
6105// attributes that should be using props for binding
6106var acceptValue = makeMap('input,textarea,option,select,progress');
6107var mustUseProp = function (tag, type, attr) {
6108 return ((attr === 'value' && acceptValue(tag) && type !== 'button') ||
6109 (attr === 'selected' && tag === 'option') ||
6110 (attr === 'checked' && tag === 'input') ||
6111 (attr === 'muted' && tag === 'video'));
6112};
6113var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
6114var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
6115var convertEnumeratedValue = function (key, value) {
6116 return isFalsyAttrValue(value) || value === 'false'
6117 ? 'false'
6118 : // allow arbitrary string value for contenteditable
6119 key === 'contenteditable' && isValidContentEditableValue(value)
6120 ? value
6121 : 'true';
6122};
6123var isBooleanAttr = makeMap('allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
6124 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
6125 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
6126 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
6127 'required,reversed,scoped,seamless,selected,sortable,' +
6128 'truespeed,typemustmatch,visible');
6129var xlinkNS = 'http://www.w3.org/1999/xlink';
6130var isXlink = function (name) {
6131 return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink';
6132};
6133var getXlinkProp = function (name) {
6134 return isXlink(name) ? name.slice(6, name.length) : '';
6135};
6136var isFalsyAttrValue = function (val) {
6137 return val == null || val === false;
6138};
6139
6140function genClassForVnode(vnode) {
6141 var data = vnode.data;
6142 var parentNode = vnode;
6143 var childNode = vnode;
6144 while (isDef(childNode.componentInstance)) {
6145 childNode = childNode.componentInstance._vnode;
6146 if (childNode && childNode.data) {
6147 data = mergeClassData(childNode.data, data);
6148 }
6149 }
6150 // @ts-expect-error parentNode.parent not VNodeWithData
6151 while (isDef((parentNode = parentNode.parent))) {
6152 if (parentNode && parentNode.data) {
6153 data = mergeClassData(data, parentNode.data);
6154 }
6155 }
6156 return renderClass(data.staticClass, data.class);
6157}
6158function mergeClassData(child, parent) {
6159 return {
6160 staticClass: concat(child.staticClass, parent.staticClass),
6161 class: isDef(child.class) ? [child.class, parent.class] : parent.class
6162 };
6163}
6164function renderClass(staticClass, dynamicClass) {
6165 if (isDef(staticClass) || isDef(dynamicClass)) {
6166 return concat(staticClass, stringifyClass(dynamicClass));
6167 }
6168 /* istanbul ignore next */
6169 return '';
6170}
6171function concat(a, b) {
6172 return a ? (b ? a + ' ' + b : a) : b || '';
6173}
6174function stringifyClass(value) {
6175 if (Array.isArray(value)) {
6176 return stringifyArray(value);
6177 }
6178 if (isObject(value)) {
6179 return stringifyObject(value);
6180 }
6181 if (typeof value === 'string') {
6182 return value;
6183 }
6184 /* istanbul ignore next */
6185 return '';
6186}
6187function stringifyArray(value) {
6188 var res = '';
6189 var stringified;
6190 for (var i = 0, l = value.length; i < l; i++) {
6191 if (isDef((stringified = stringifyClass(value[i]))) && stringified !== '') {
6192 if (res)
6193 res += ' ';
6194 res += stringified;
6195 }
6196 }
6197 return res;
6198}
6199function stringifyObject(value) {
6200 var res = '';
6201 for (var key in value) {
6202 if (value[key]) {
6203 if (res)
6204 res += ' ';
6205 res += key;
6206 }
6207 }
6208 return res;
6209}
6210
6211var namespaceMap = {
6212 svg: 'http://www.w3.org/2000/svg',
6213 math: 'http://www.w3.org/1998/Math/MathML'
6214};
6215var isHTMLTag = makeMap('html,body,base,head,link,meta,style,title,' +
6216 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
6217 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
6218 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
6219 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
6220 'embed,object,param,source,canvas,script,noscript,del,ins,' +
6221 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
6222 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
6223 'output,progress,select,textarea,' +
6224 'details,dialog,menu,menuitem,summary,' +
6225 'content,element,shadow,template,blockquote,iframe,tfoot');
6226// this map is intentionally selective, only covering SVG elements that may
6227// contain child elements.
6228var isSVG = makeMap('svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
6229 'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
6230 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', true);
6231var isReservedTag = function (tag) {
6232 return isHTMLTag(tag) || isSVG(tag);
6233};
6234function getTagNamespace(tag) {
6235 if (isSVG(tag)) {
6236 return 'svg';
6237 }
6238 // basic support for MathML
6239 // note it doesn't support other MathML elements being component roots
6240 if (tag === 'math') {
6241 return 'math';
6242 }
6243}
6244var unknownElementCache = Object.create(null);
6245function isUnknownElement(tag) {
6246 /* istanbul ignore if */
6247 if (!inBrowser) {
6248 return true;
6249 }
6250 if (isReservedTag(tag)) {
6251 return false;
6252 }
6253 tag = tag.toLowerCase();
6254 /* istanbul ignore if */
6255 if (unknownElementCache[tag] != null) {
6256 return unknownElementCache[tag];
6257 }
6258 var el = document.createElement(tag);
6259 if (tag.indexOf('-') > -1) {
6260 // https://stackoverflow.com/a/28210364/1070244
6261 return (unknownElementCache[tag] =
6262 el.constructor === window.HTMLUnknownElement ||
6263 el.constructor === window.HTMLElement);
6264 }
6265 else {
6266 return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()));
6267 }
6268}
6269var isTextInputType = makeMap('text,number,password,search,email,tel,url');
6270
6271/**
6272 * Query an element selector if it's not an element already.
6273 */
6274function query(el) {
6275 if (typeof el === 'string') {
6276 var selected = document.querySelector(el);
6277 if (!selected) {
6278 process.env.NODE_ENV !== 'production' && warn('Cannot find element: ' + el);
6279 return document.createElement('div');
6280 }
6281 return selected;
6282 }
6283 else {
6284 return el;
6285 }
6286}
6287
6288function createElement(tagName, vnode) {
6289 var elm = document.createElement(tagName);
6290 if (tagName !== 'select') {
6291 return elm;
6292 }
6293 // false or null will remove the attribute but undefined will not
6294 if (vnode.data &&
6295 vnode.data.attrs &&
6296 vnode.data.attrs.multiple !== undefined) {
6297 elm.setAttribute('multiple', 'multiple');
6298 }
6299 return elm;
6300}
6301function createElementNS(namespace, tagName) {
6302 return document.createElementNS(namespaceMap[namespace], tagName);
6303}
6304function createTextNode(text) {
6305 return document.createTextNode(text);
6306}
6307function createComment(text) {
6308 return document.createComment(text);
6309}
6310function insertBefore(parentNode, newNode, referenceNode) {
6311 parentNode.insertBefore(newNode, referenceNode);
6312}
6313function removeChild(node, child) {
6314 node.removeChild(child);
6315}
6316function appendChild(node, child) {
6317 node.appendChild(child);
6318}
6319function parentNode(node) {
6320 return node.parentNode;
6321}
6322function nextSibling(node) {
6323 return node.nextSibling;
6324}
6325function tagName(node) {
6326 return node.tagName;
6327}
6328function setTextContent(node, text) {
6329 node.textContent = text;
6330}
6331function setStyleScope(node, scopeId) {
6332 node.setAttribute(scopeId, '');
6333}
6334
6335var nodeOps = /*#__PURE__*/Object.freeze({
6336 __proto__: null,
6337 createElement: createElement,
6338 createElementNS: createElementNS,
6339 createTextNode: createTextNode,
6340 createComment: createComment,
6341 insertBefore: insertBefore,
6342 removeChild: removeChild,
6343 appendChild: appendChild,
6344 parentNode: parentNode,
6345 nextSibling: nextSibling,
6346 tagName: tagName,
6347 setTextContent: setTextContent,
6348 setStyleScope: setStyleScope
6349});
6350
6351var ref = {
6352 create: function (_, vnode) {
6353 registerRef(vnode);
6354 },
6355 update: function (oldVnode, vnode) {
6356 if (oldVnode.data.ref !== vnode.data.ref) {
6357 registerRef(oldVnode, true);
6358 registerRef(vnode);
6359 }
6360 },
6361 destroy: function (vnode) {
6362 registerRef(vnode, true);
6363 }
6364};
6365function registerRef(vnode, isRemoval) {
6366 var ref = vnode.data.ref;
6367 if (!isDef(ref))
6368 return;
6369 var vm = vnode.context;
6370 var refValue = vnode.componentInstance || vnode.elm;
6371 var value = isRemoval ? null : refValue;
6372 var $refsValue = isRemoval ? undefined : refValue;
6373 if (isFunction(ref)) {
6374 invokeWithErrorHandling(ref, vm, [value], vm, "template ref function");
6375 return;
6376 }
6377 var isFor = vnode.data.refInFor;
6378 var _isString = typeof ref === 'string' || typeof ref === 'number';
6379 var _isRef = isRef(ref);
6380 var refs = vm.$refs;
6381 if (_isString || _isRef) {
6382 if (isFor) {
6383 var existing = _isString ? refs[ref] : ref.value;
6384 if (isRemoval) {
6385 isArray(existing) && remove$2(existing, refValue);
6386 }
6387 else {
6388 if (!isArray(existing)) {
6389 if (_isString) {
6390 refs[ref] = [refValue];
6391 setSetupRef(vm, ref, refs[ref]);
6392 }
6393 else {
6394 ref.value = [refValue];
6395 }
6396 }
6397 else if (!existing.includes(refValue)) {
6398 existing.push(refValue);
6399 }
6400 }
6401 }
6402 else if (_isString) {
6403 if (isRemoval && refs[ref] !== refValue) {
6404 return;
6405 }
6406 refs[ref] = $refsValue;
6407 setSetupRef(vm, ref, value);
6408 }
6409 else if (_isRef) {
6410 if (isRemoval && ref.value !== refValue) {
6411 return;
6412 }
6413 ref.value = value;
6414 }
6415 else if (process.env.NODE_ENV !== 'production') {
6416 warn("Invalid template ref type: ".concat(typeof ref));
6417 }
6418 }
6419}
6420function setSetupRef(_a, key, val) {
6421 var _setupState = _a._setupState;
6422 if (_setupState && hasOwn(_setupState, key)) {
6423 if (isRef(_setupState[key])) {
6424 _setupState[key].value = val;
6425 }
6426 else {
6427 _setupState[key] = val;
6428 }
6429 }
6430}
6431
6432/**
6433 * Virtual DOM patching algorithm based on Snabbdom by
6434 * Simon Friis Vindum (@paldepind)
6435 * Licensed under the MIT License
6436 * https://github.com/paldepind/snabbdom/blob/master/LICENSE
6437 *
6438 * modified by Evan You (@yyx990803)
6439 *
6440 * Not type-checking this because this file is perf-critical and the cost
6441 * of making flow understand it is not worth it.
6442 */
6443var emptyNode = new VNode('', {}, []);
6444var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
6445function sameVnode(a, b) {
6446 return (a.key === b.key &&
6447 a.asyncFactory === b.asyncFactory &&
6448 ((a.tag === b.tag &&
6449 a.isComment === b.isComment &&
6450 isDef(a.data) === isDef(b.data) &&
6451 sameInputType(a, b)) ||
6452 (isTrue(a.isAsyncPlaceholder) && isUndef(b.asyncFactory.error))));
6453}
6454function sameInputType(a, b) {
6455 if (a.tag !== 'input')
6456 return true;
6457 var i;
6458 var typeA = isDef((i = a.data)) && isDef((i = i.attrs)) && i.type;
6459 var typeB = isDef((i = b.data)) && isDef((i = i.attrs)) && i.type;
6460 return typeA === typeB || (isTextInputType(typeA) && isTextInputType(typeB));
6461}
6462function createKeyToOldIdx(children, beginIdx, endIdx) {
6463 var i, key;
6464 var map = {};
6465 for (i = beginIdx; i <= endIdx; ++i) {
6466 key = children[i].key;
6467 if (isDef(key))
6468 map[key] = i;
6469 }
6470 return map;
6471}
6472function createPatchFunction(backend) {
6473 var i, j;
6474 var cbs = {};
6475 var modules = backend.modules, nodeOps = backend.nodeOps;
6476 for (i = 0; i < hooks.length; ++i) {
6477 cbs[hooks[i]] = [];
6478 for (j = 0; j < modules.length; ++j) {
6479 if (isDef(modules[j][hooks[i]])) {
6480 cbs[hooks[i]].push(modules[j][hooks[i]]);
6481 }
6482 }
6483 }
6484 function emptyNodeAt(elm) {
6485 return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm);
6486 }
6487 function createRmCb(childElm, listeners) {
6488 function remove() {
6489 if (--remove.listeners === 0) {
6490 removeNode(childElm);
6491 }
6492 }
6493 remove.listeners = listeners;
6494 return remove;
6495 }
6496 function removeNode(el) {
6497 var parent = nodeOps.parentNode(el);
6498 // element may have already been removed due to v-html / v-text
6499 if (isDef(parent)) {
6500 nodeOps.removeChild(parent, el);
6501 }
6502 }
6503 function isUnknownElement(vnode, inVPre) {
6504 return (!inVPre &&
6505 !vnode.ns &&
6506 !(config.ignoredElements.length &&
6507 config.ignoredElements.some(function (ignore) {
6508 return isRegExp(ignore)
6509 ? ignore.test(vnode.tag)
6510 : ignore === vnode.tag;
6511 })) &&
6512 config.isUnknownElement(vnode.tag));
6513 }
6514 var creatingElmInVPre = 0;
6515 function createElm(vnode, insertedVnodeQueue, parentElm, refElm, nested, ownerArray, index) {
6516 if (isDef(vnode.elm) && isDef(ownerArray)) {
6517 // This vnode was used in a previous render!
6518 // now it's used as a new node, overwriting its elm would cause
6519 // potential patch errors down the road when it's used as an insertion
6520 // reference node. Instead, we clone the node on-demand before creating
6521 // associated DOM element for it.
6522 vnode = ownerArray[index] = cloneVNode(vnode);
6523 }
6524 vnode.isRootInsert = !nested; // for transition enter check
6525 if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
6526 return;
6527 }
6528 var data = vnode.data;
6529 var children = vnode.children;
6530 var tag = vnode.tag;
6531 if (isDef(tag)) {
6532 if (process.env.NODE_ENV !== 'production') {
6533 if (data && data.pre) {
6534 creatingElmInVPre++;
6535 }
6536 if (isUnknownElement(vnode, creatingElmInVPre)) {
6537 warn('Unknown custom element: <' +
6538 tag +
6539 '> - did you ' +
6540 'register the component correctly? For recursive components, ' +
6541 'make sure to provide the "name" option.', vnode.context);
6542 }
6543 }
6544 vnode.elm = vnode.ns
6545 ? nodeOps.createElementNS(vnode.ns, tag)
6546 : nodeOps.createElement(tag, vnode);
6547 setScope(vnode);
6548 createChildren(vnode, children, insertedVnodeQueue);
6549 if (isDef(data)) {
6550 invokeCreateHooks(vnode, insertedVnodeQueue);
6551 }
6552 insert(parentElm, vnode.elm, refElm);
6553 if (process.env.NODE_ENV !== 'production' && data && data.pre) {
6554 creatingElmInVPre--;
6555 }
6556 }
6557 else if (isTrue(vnode.isComment)) {
6558 vnode.elm = nodeOps.createComment(vnode.text);
6559 insert(parentElm, vnode.elm, refElm);
6560 }
6561 else {
6562 vnode.elm = nodeOps.createTextNode(vnode.text);
6563 insert(parentElm, vnode.elm, refElm);
6564 }
6565 }
6566 function createComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
6567 var i = vnode.data;
6568 if (isDef(i)) {
6569 var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
6570 if (isDef((i = i.hook)) && isDef((i = i.init))) {
6571 i(vnode, false /* hydrating */);
6572 }
6573 // after calling the init hook, if the vnode is a child component
6574 // it should've created a child instance and mounted it. the child
6575 // component also has set the placeholder vnode's elm.
6576 // in that case we can just return the element and be done.
6577 if (isDef(vnode.componentInstance)) {
6578 initComponent(vnode, insertedVnodeQueue);
6579 insert(parentElm, vnode.elm, refElm);
6580 if (isTrue(isReactivated)) {
6581 reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
6582 }
6583 return true;
6584 }
6585 }
6586 }
6587 function initComponent(vnode, insertedVnodeQueue) {
6588 if (isDef(vnode.data.pendingInsert)) {
6589 insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
6590 vnode.data.pendingInsert = null;
6591 }
6592 vnode.elm = vnode.componentInstance.$el;
6593 if (isPatchable(vnode)) {
6594 invokeCreateHooks(vnode, insertedVnodeQueue);
6595 setScope(vnode);
6596 }
6597 else {
6598 // empty component root.
6599 // skip all element-related modules except for ref (#3455)
6600 registerRef(vnode);
6601 // make sure to invoke the insert hook
6602 insertedVnodeQueue.push(vnode);
6603 }
6604 }
6605 function reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm) {
6606 var i;
6607 // hack for #4339: a reactivated component with inner transition
6608 // does not trigger because the inner node's created hooks are not called
6609 // again. It's not ideal to involve module-specific logic in here but
6610 // there doesn't seem to be a better way to do it.
6611 var innerNode = vnode;
6612 while (innerNode.componentInstance) {
6613 innerNode = innerNode.componentInstance._vnode;
6614 if (isDef((i = innerNode.data)) && isDef((i = i.transition))) {
6615 for (i = 0; i < cbs.activate.length; ++i) {
6616 cbs.activate[i](emptyNode, innerNode);
6617 }
6618 insertedVnodeQueue.push(innerNode);
6619 break;
6620 }
6621 }
6622 // unlike a newly created component,
6623 // a reactivated keep-alive component doesn't insert itself
6624 insert(parentElm, vnode.elm, refElm);
6625 }
6626 function insert(parent, elm, ref) {
6627 if (isDef(parent)) {
6628 if (isDef(ref)) {
6629 if (nodeOps.parentNode(ref) === parent) {
6630 nodeOps.insertBefore(parent, elm, ref);
6631 }
6632 }
6633 else {
6634 nodeOps.appendChild(parent, elm);
6635 }
6636 }
6637 }
6638 function createChildren(vnode, children, insertedVnodeQueue) {
6639 if (isArray(children)) {
6640 if (process.env.NODE_ENV !== 'production') {
6641 checkDuplicateKeys(children);
6642 }
6643 for (var i_1 = 0; i_1 < children.length; ++i_1) {
6644 createElm(children[i_1], insertedVnodeQueue, vnode.elm, null, true, children, i_1);
6645 }
6646 }
6647 else if (isPrimitive(vnode.text)) {
6648 nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
6649 }
6650 }
6651 function isPatchable(vnode) {
6652 while (vnode.componentInstance) {
6653 vnode = vnode.componentInstance._vnode;
6654 }
6655 return isDef(vnode.tag);
6656 }
6657 function invokeCreateHooks(vnode, insertedVnodeQueue) {
6658 for (var i_2 = 0; i_2 < cbs.create.length; ++i_2) {
6659 cbs.create[i_2](emptyNode, vnode);
6660 }
6661 i = vnode.data.hook; // Reuse variable
6662 if (isDef(i)) {
6663 if (isDef(i.create))
6664 i.create(emptyNode, vnode);
6665 if (isDef(i.insert))
6666 insertedVnodeQueue.push(vnode);
6667 }
6668 }
6669 // set scope id attribute for scoped CSS.
6670 // this is implemented as a special case to avoid the overhead
6671 // of going through the normal attribute patching process.
6672 function setScope(vnode) {
6673 var i;
6674 if (isDef((i = vnode.fnScopeId))) {
6675 nodeOps.setStyleScope(vnode.elm, i);
6676 }
6677 else {
6678 var ancestor = vnode;
6679 while (ancestor) {
6680 if (isDef((i = ancestor.context)) && isDef((i = i.$options._scopeId))) {
6681 nodeOps.setStyleScope(vnode.elm, i);
6682 }
6683 ancestor = ancestor.parent;
6684 }
6685 }
6686 // for slot content they should also get the scopeId from the host instance.
6687 if (isDef((i = activeInstance)) &&
6688 i !== vnode.context &&
6689 i !== vnode.fnContext &&
6690 isDef((i = i.$options._scopeId))) {
6691 nodeOps.setStyleScope(vnode.elm, i);
6692 }
6693 }
6694 function addVnodes(parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
6695 for (; startIdx <= endIdx; ++startIdx) {
6696 createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
6697 }
6698 }
6699 function invokeDestroyHook(vnode) {
6700 var i, j;
6701 var data = vnode.data;
6702 if (isDef(data)) {
6703 if (isDef((i = data.hook)) && isDef((i = i.destroy)))
6704 i(vnode);
6705 for (i = 0; i < cbs.destroy.length; ++i)
6706 cbs.destroy[i](vnode);
6707 }
6708 if (isDef((i = vnode.children))) {
6709 for (j = 0; j < vnode.children.length; ++j) {
6710 invokeDestroyHook(vnode.children[j]);
6711 }
6712 }
6713 }
6714 function removeVnodes(vnodes, startIdx, endIdx) {
6715 for (; startIdx <= endIdx; ++startIdx) {
6716 var ch = vnodes[startIdx];
6717 if (isDef(ch)) {
6718 if (isDef(ch.tag)) {
6719 removeAndInvokeRemoveHook(ch);
6720 invokeDestroyHook(ch);
6721 }
6722 else {
6723 // Text node
6724 removeNode(ch.elm);
6725 }
6726 }
6727 }
6728 }
6729 function removeAndInvokeRemoveHook(vnode, rm) {
6730 if (isDef(rm) || isDef(vnode.data)) {
6731 var i_3;
6732 var listeners = cbs.remove.length + 1;
6733 if (isDef(rm)) {
6734 // we have a recursively passed down rm callback
6735 // increase the listeners count
6736 rm.listeners += listeners;
6737 }
6738 else {
6739 // directly removing
6740 rm = createRmCb(vnode.elm, listeners);
6741 }
6742 // recursively invoke hooks on child component root node
6743 if (isDef((i_3 = vnode.componentInstance)) &&
6744 isDef((i_3 = i_3._vnode)) &&
6745 isDef(i_3.data)) {
6746 removeAndInvokeRemoveHook(i_3, rm);
6747 }
6748 for (i_3 = 0; i_3 < cbs.remove.length; ++i_3) {
6749 cbs.remove[i_3](vnode, rm);
6750 }
6751 if (isDef((i_3 = vnode.data.hook)) && isDef((i_3 = i_3.remove))) {
6752 i_3(vnode, rm);
6753 }
6754 else {
6755 rm();
6756 }
6757 }
6758 else {
6759 removeNode(vnode.elm);
6760 }
6761 }
6762 function updateChildren(parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
6763 var oldStartIdx = 0;
6764 var newStartIdx = 0;
6765 var oldEndIdx = oldCh.length - 1;
6766 var oldStartVnode = oldCh[0];
6767 var oldEndVnode = oldCh[oldEndIdx];
6768 var newEndIdx = newCh.length - 1;
6769 var newStartVnode = newCh[0];
6770 var newEndVnode = newCh[newEndIdx];
6771 var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
6772 // removeOnly is a special flag used only by <transition-group>
6773 // to ensure removed elements stay in correct relative positions
6774 // during leaving transitions
6775 var canMove = !removeOnly;
6776 if (process.env.NODE_ENV !== 'production') {
6777 checkDuplicateKeys(newCh);
6778 }
6779 while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
6780 if (isUndef(oldStartVnode)) {
6781 oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
6782 }
6783 else if (isUndef(oldEndVnode)) {
6784 oldEndVnode = oldCh[--oldEndIdx];
6785 }
6786 else if (sameVnode(oldStartVnode, newStartVnode)) {
6787 patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
6788 oldStartVnode = oldCh[++oldStartIdx];
6789 newStartVnode = newCh[++newStartIdx];
6790 }
6791 else if (sameVnode(oldEndVnode, newEndVnode)) {
6792 patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
6793 oldEndVnode = oldCh[--oldEndIdx];
6794 newEndVnode = newCh[--newEndIdx];
6795 }
6796 else if (sameVnode(oldStartVnode, newEndVnode)) {
6797 // Vnode moved right
6798 patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
6799 canMove &&
6800 nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
6801 oldStartVnode = oldCh[++oldStartIdx];
6802 newEndVnode = newCh[--newEndIdx];
6803 }
6804 else if (sameVnode(oldEndVnode, newStartVnode)) {
6805 // Vnode moved left
6806 patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
6807 canMove &&
6808 nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
6809 oldEndVnode = oldCh[--oldEndIdx];
6810 newStartVnode = newCh[++newStartIdx];
6811 }
6812 else {
6813 if (isUndef(oldKeyToIdx))
6814 oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
6815 idxInOld = isDef(newStartVnode.key)
6816 ? oldKeyToIdx[newStartVnode.key]
6817 : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
6818 if (isUndef(idxInOld)) {
6819 // New element
6820 createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
6821 }
6822 else {
6823 vnodeToMove = oldCh[idxInOld];
6824 if (sameVnode(vnodeToMove, newStartVnode)) {
6825 patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
6826 oldCh[idxInOld] = undefined;
6827 canMove &&
6828 nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
6829 }
6830 else {
6831 // same key but different element. treat as new element
6832 createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
6833 }
6834 }
6835 newStartVnode = newCh[++newStartIdx];
6836 }
6837 }
6838 if (oldStartIdx > oldEndIdx) {
6839 refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
6840 addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
6841 }
6842 else if (newStartIdx > newEndIdx) {
6843 removeVnodes(oldCh, oldStartIdx, oldEndIdx);
6844 }
6845 }
6846 function checkDuplicateKeys(children) {
6847 var seenKeys = {};
6848 for (var i_4 = 0; i_4 < children.length; i_4++) {
6849 var vnode = children[i_4];
6850 var key = vnode.key;
6851 if (isDef(key)) {
6852 if (seenKeys[key]) {
6853 warn("Duplicate keys detected: '".concat(key, "'. This may cause an update error."), vnode.context);
6854 }
6855 else {
6856 seenKeys[key] = true;
6857 }
6858 }
6859 }
6860 }
6861 function findIdxInOld(node, oldCh, start, end) {
6862 for (var i_5 = start; i_5 < end; i_5++) {
6863 var c = oldCh[i_5];
6864 if (isDef(c) && sameVnode(node, c))
6865 return i_5;
6866 }
6867 }
6868 function patchVnode(oldVnode, vnode, insertedVnodeQueue, ownerArray, index, removeOnly) {
6869 if (oldVnode === vnode) {
6870 return;
6871 }
6872 if (isDef(vnode.elm) && isDef(ownerArray)) {
6873 // clone reused vnode
6874 vnode = ownerArray[index] = cloneVNode(vnode);
6875 }
6876 var elm = (vnode.elm = oldVnode.elm);
6877 if (isTrue(oldVnode.isAsyncPlaceholder)) {
6878 if (isDef(vnode.asyncFactory.resolved)) {
6879 hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
6880 }
6881 else {
6882 vnode.isAsyncPlaceholder = true;
6883 }
6884 return;
6885 }
6886 // reuse element for static trees.
6887 // note we only do this if the vnode is cloned -
6888 // if the new node is not cloned it means the render functions have been
6889 // reset by the hot-reload-api and we need to do a proper re-render.
6890 if (isTrue(vnode.isStatic) &&
6891 isTrue(oldVnode.isStatic) &&
6892 vnode.key === oldVnode.key &&
6893 (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))) {
6894 vnode.componentInstance = oldVnode.componentInstance;
6895 return;
6896 }
6897 var i;
6898 var data = vnode.data;
6899 if (isDef(data) && isDef((i = data.hook)) && isDef((i = i.prepatch))) {
6900 i(oldVnode, vnode);
6901 }
6902 var oldCh = oldVnode.children;
6903 var ch = vnode.children;
6904 if (isDef(data) && isPatchable(vnode)) {
6905 for (i = 0; i < cbs.update.length; ++i)
6906 cbs.update[i](oldVnode, vnode);
6907 if (isDef((i = data.hook)) && isDef((i = i.update)))
6908 i(oldVnode, vnode);
6909 }
6910 if (isUndef(vnode.text)) {
6911 if (isDef(oldCh) && isDef(ch)) {
6912 if (oldCh !== ch)
6913 updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly);
6914 }
6915 else if (isDef(ch)) {
6916 if (process.env.NODE_ENV !== 'production') {
6917 checkDuplicateKeys(ch);
6918 }
6919 if (isDef(oldVnode.text))
6920 nodeOps.setTextContent(elm, '');
6921 addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
6922 }
6923 else if (isDef(oldCh)) {
6924 removeVnodes(oldCh, 0, oldCh.length - 1);
6925 }
6926 else if (isDef(oldVnode.text)) {
6927 nodeOps.setTextContent(elm, '');
6928 }
6929 }
6930 else if (oldVnode.text !== vnode.text) {
6931 nodeOps.setTextContent(elm, vnode.text);
6932 }
6933 if (isDef(data)) {
6934 if (isDef((i = data.hook)) && isDef((i = i.postpatch)))
6935 i(oldVnode, vnode);
6936 }
6937 }
6938 function invokeInsertHook(vnode, queue, initial) {
6939 // delay insert hooks for component root nodes, invoke them after the
6940 // element is really inserted
6941 if (isTrue(initial) && isDef(vnode.parent)) {
6942 vnode.parent.data.pendingInsert = queue;
6943 }
6944 else {
6945 for (var i_6 = 0; i_6 < queue.length; ++i_6) {
6946 queue[i_6].data.hook.insert(queue[i_6]);
6947 }
6948 }
6949 }
6950 var hydrationBailed = false;
6951 // list of modules that can skip create hook during hydration because they
6952 // are already rendered on the client or has no need for initialization
6953 // Note: style is excluded because it relies on initial clone for future
6954 // deep updates (#7063).
6955 var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
6956 // Note: this is a browser-only function so we can assume elms are DOM nodes.
6957 function hydrate(elm, vnode, insertedVnodeQueue, inVPre) {
6958 var i;
6959 var tag = vnode.tag, data = vnode.data, children = vnode.children;
6960 inVPre = inVPre || (data && data.pre);
6961 vnode.elm = elm;
6962 if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
6963 vnode.isAsyncPlaceholder = true;
6964 return true;
6965 }
6966 // assert node match
6967 if (process.env.NODE_ENV !== 'production') {
6968 if (!assertNodeMatch(elm, vnode, inVPre)) {
6969 return false;
6970 }
6971 }
6972 if (isDef(data)) {
6973 if (isDef((i = data.hook)) && isDef((i = i.init)))
6974 i(vnode, true /* hydrating */);
6975 if (isDef((i = vnode.componentInstance))) {
6976 // child component. it should have hydrated its own tree.
6977 initComponent(vnode, insertedVnodeQueue);
6978 return true;
6979 }
6980 }
6981 if (isDef(tag)) {
6982 if (isDef(children)) {
6983 // empty element, allow client to pick up and populate children
6984 if (!elm.hasChildNodes()) {
6985 createChildren(vnode, children, insertedVnodeQueue);
6986 }
6987 else {
6988 // v-html and domProps: innerHTML
6989 if (isDef((i = data)) &&
6990 isDef((i = i.domProps)) &&
6991 isDef((i = i.innerHTML))) {
6992 if (i !== elm.innerHTML) {
6993 /* istanbul ignore if */
6994 if (process.env.NODE_ENV !== 'production' &&
6995 typeof console !== 'undefined' &&
6996 !hydrationBailed) {
6997 hydrationBailed = true;
6998 console.warn('Parent: ', elm);
6999 console.warn('server innerHTML: ', i);
7000 console.warn('client innerHTML: ', elm.innerHTML);
7001 }
7002 return false;
7003 }
7004 }
7005 else {
7006 // iterate and compare children lists
7007 var childrenMatch = true;
7008 var childNode = elm.firstChild;
7009 for (var i_7 = 0; i_7 < children.length; i_7++) {
7010 if (!childNode ||
7011 !hydrate(childNode, children[i_7], insertedVnodeQueue, inVPre)) {
7012 childrenMatch = false;
7013 break;
7014 }
7015 childNode = childNode.nextSibling;
7016 }
7017 // if childNode is not null, it means the actual childNodes list is
7018 // longer than the virtual children list.
7019 if (!childrenMatch || childNode) {
7020 /* istanbul ignore if */
7021 if (process.env.NODE_ENV !== 'production' &&
7022 typeof console !== 'undefined' &&
7023 !hydrationBailed) {
7024 hydrationBailed = true;
7025 console.warn('Parent: ', elm);
7026 console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
7027 }
7028 return false;
7029 }
7030 }
7031 }
7032 }
7033 if (isDef(data)) {
7034 var fullInvoke = false;
7035 for (var key in data) {
7036 if (!isRenderedModule(key)) {
7037 fullInvoke = true;
7038 invokeCreateHooks(vnode, insertedVnodeQueue);
7039 break;
7040 }
7041 }
7042 if (!fullInvoke && data['class']) {
7043 // ensure collecting deps for deep class bindings for future updates
7044 traverse(data['class']);
7045 }
7046 }
7047 }
7048 else if (elm.data !== vnode.text) {
7049 elm.data = vnode.text;
7050 }
7051 return true;
7052 }
7053 function assertNodeMatch(node, vnode, inVPre) {
7054 if (isDef(vnode.tag)) {
7055 return (vnode.tag.indexOf('vue-component') === 0 ||
7056 (!isUnknownElement(vnode, inVPre) &&
7057 vnode.tag.toLowerCase() ===
7058 (node.tagName && node.tagName.toLowerCase())));
7059 }
7060 else {
7061 return node.nodeType === (vnode.isComment ? 8 : 3);
7062 }
7063 }
7064 return function patch(oldVnode, vnode, hydrating, removeOnly) {
7065 if (isUndef(vnode)) {
7066 if (isDef(oldVnode))
7067 invokeDestroyHook(oldVnode);
7068 return;
7069 }
7070 var isInitialPatch = false;
7071 var insertedVnodeQueue = [];
7072 if (isUndef(oldVnode)) {
7073 // empty mount (likely as component), create new root element
7074 isInitialPatch = true;
7075 createElm(vnode, insertedVnodeQueue);
7076 }
7077 else {
7078 var isRealElement = isDef(oldVnode.nodeType);
7079 if (!isRealElement && sameVnode(oldVnode, vnode)) {
7080 // patch existing root node
7081 patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
7082 }
7083 else {
7084 if (isRealElement) {
7085 // mounting to a real element
7086 // check if this is server-rendered content and if we can perform
7087 // a successful hydration.
7088 if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
7089 oldVnode.removeAttribute(SSR_ATTR);
7090 hydrating = true;
7091 }
7092 if (isTrue(hydrating)) {
7093 if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
7094 invokeInsertHook(vnode, insertedVnodeQueue, true);
7095 return oldVnode;
7096 }
7097 else if (process.env.NODE_ENV !== 'production') {
7098 warn('The client-side rendered virtual DOM tree is not matching ' +
7099 'server-rendered content. This is likely caused by incorrect ' +
7100 'HTML markup, for example nesting block-level elements inside ' +
7101 '<p>, or missing <tbody>. Bailing hydration and performing ' +
7102 'full client-side render.');
7103 }
7104 }
7105 // either not server-rendered, or hydration failed.
7106 // create an empty node and replace it
7107 oldVnode = emptyNodeAt(oldVnode);
7108 }
7109 // replacing existing element
7110 var oldElm = oldVnode.elm;
7111 var parentElm = nodeOps.parentNode(oldElm);
7112 // create new node
7113 createElm(vnode, insertedVnodeQueue,
7114 // extremely rare edge case: do not insert if old element is in a
7115 // leaving transition. Only happens when combining transition +
7116 // keep-alive + HOCs. (#4590)
7117 oldElm._leaveCb ? null : parentElm, nodeOps.nextSibling(oldElm));
7118 // update parent placeholder node element, recursively
7119 if (isDef(vnode.parent)) {
7120 var ancestor = vnode.parent;
7121 var patchable = isPatchable(vnode);
7122 while (ancestor) {
7123 for (var i_8 = 0; i_8 < cbs.destroy.length; ++i_8) {
7124 cbs.destroy[i_8](ancestor);
7125 }
7126 ancestor.elm = vnode.elm;
7127 if (patchable) {
7128 for (var i_9 = 0; i_9 < cbs.create.length; ++i_9) {
7129 cbs.create[i_9](emptyNode, ancestor);
7130 }
7131 // #6513
7132 // invoke insert hooks that may have been merged by create hooks.
7133 // e.g. for directives that uses the "inserted" hook.
7134 var insert_1 = ancestor.data.hook.insert;
7135 if (insert_1.merged) {
7136 // start at index 1 to avoid re-invoking component mounted hook
7137 // clone insert hooks to avoid being mutated during iteration.
7138 // e.g. for customed directives under transition group.
7139 var cloned = insert_1.fns.slice(1);
7140 for (var i_10 = 0; i_10 < cloned.length; i_10++) {
7141 cloned[i_10]();
7142 }
7143 }
7144 }
7145 else {
7146 registerRef(ancestor);
7147 }
7148 ancestor = ancestor.parent;
7149 }
7150 }
7151 // destroy old node
7152 if (isDef(parentElm)) {
7153 removeVnodes([oldVnode], 0, 0);
7154 }
7155 else if (isDef(oldVnode.tag)) {
7156 invokeDestroyHook(oldVnode);
7157 }
7158 }
7159 }
7160 invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
7161 return vnode.elm;
7162 };
7163}
7164
7165var directives = {
7166 create: updateDirectives,
7167 update: updateDirectives,
7168 destroy: function unbindDirectives(vnode) {
7169 // @ts-expect-error emptyNode is not VNodeWithData
7170 updateDirectives(vnode, emptyNode);
7171 }
7172};
7173function updateDirectives(oldVnode, vnode) {
7174 if (oldVnode.data.directives || vnode.data.directives) {
7175 _update(oldVnode, vnode);
7176 }
7177}
7178function _update(oldVnode, vnode) {
7179 var isCreate = oldVnode === emptyNode;
7180 var isDestroy = vnode === emptyNode;
7181 var oldDirs = normalizeDirectives(oldVnode.data.directives, oldVnode.context);
7182 var newDirs = normalizeDirectives(vnode.data.directives, vnode.context);
7183 var dirsWithInsert = [];
7184 var dirsWithPostpatch = [];
7185 var key, oldDir, dir;
7186 for (key in newDirs) {
7187 oldDir = oldDirs[key];
7188 dir = newDirs[key];
7189 if (!oldDir) {
7190 // new directive, bind
7191 callHook(dir, 'bind', vnode, oldVnode);
7192 if (dir.def && dir.def.inserted) {
7193 dirsWithInsert.push(dir);
7194 }
7195 }
7196 else {
7197 // existing directive, update
7198 dir.oldValue = oldDir.value;
7199 dir.oldArg = oldDir.arg;
7200 callHook(dir, 'update', vnode, oldVnode);
7201 if (dir.def && dir.def.componentUpdated) {
7202 dirsWithPostpatch.push(dir);
7203 }
7204 }
7205 }
7206 if (dirsWithInsert.length) {
7207 var callInsert = function () {
7208 for (var i = 0; i < dirsWithInsert.length; i++) {
7209 callHook(dirsWithInsert[i], 'inserted', vnode, oldVnode);
7210 }
7211 };
7212 if (isCreate) {
7213 mergeVNodeHook(vnode, 'insert', callInsert);
7214 }
7215 else {
7216 callInsert();
7217 }
7218 }
7219 if (dirsWithPostpatch.length) {
7220 mergeVNodeHook(vnode, 'postpatch', function () {
7221 for (var i = 0; i < dirsWithPostpatch.length; i++) {
7222 callHook(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
7223 }
7224 });
7225 }
7226 if (!isCreate) {
7227 for (key in oldDirs) {
7228 if (!newDirs[key]) {
7229 // no longer present, unbind
7230 callHook(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
7231 }
7232 }
7233 }
7234}
7235var emptyModifiers = Object.create(null);
7236function normalizeDirectives(dirs, vm) {
7237 var res = Object.create(null);
7238 if (!dirs) {
7239 // $flow-disable-line
7240 return res;
7241 }
7242 var i, dir;
7243 for (i = 0; i < dirs.length; i++) {
7244 dir = dirs[i];
7245 if (!dir.modifiers) {
7246 // $flow-disable-line
7247 dir.modifiers = emptyModifiers;
7248 }
7249 res[getRawDirName(dir)] = dir;
7250 if (vm._setupState && vm._setupState.__sfc) {
7251 var setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name);
7252 if (typeof setupDef === 'function') {
7253 dir.def = {
7254 bind: setupDef,
7255 update: setupDef,
7256 };
7257 }
7258 else {
7259 dir.def = setupDef;
7260 }
7261 }
7262 dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true);
7263 }
7264 // $flow-disable-line
7265 return res;
7266}
7267function getRawDirName(dir) {
7268 return (dir.rawName || "".concat(dir.name, ".").concat(Object.keys(dir.modifiers || {}).join('.')));
7269}
7270function callHook(dir, hook, vnode, oldVnode, isDestroy) {
7271 var fn = dir.def && dir.def[hook];
7272 if (fn) {
7273 try {
7274 fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
7275 }
7276 catch (e) {
7277 handleError(e, vnode.context, "directive ".concat(dir.name, " ").concat(hook, " hook"));
7278 }
7279 }
7280}
7281
7282var baseModules = [ref, directives];
7283
7284function updateAttrs(oldVnode, vnode) {
7285 var opts = vnode.componentOptions;
7286 if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
7287 return;
7288 }
7289 if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
7290 return;
7291 }
7292 var key, cur, old;
7293 var elm = vnode.elm;
7294 var oldAttrs = oldVnode.data.attrs || {};
7295 var attrs = vnode.data.attrs || {};
7296 // clone observed objects, as the user probably wants to mutate it
7297 if (isDef(attrs.__ob__) || isTrue(attrs._v_attr_proxy)) {
7298 attrs = vnode.data.attrs = extend({}, attrs);
7299 }
7300 for (key in attrs) {
7301 cur = attrs[key];
7302 old = oldAttrs[key];
7303 if (old !== cur) {
7304 setAttr(elm, key, cur, vnode.data.pre);
7305 }
7306 }
7307 // #4391: in IE9, setting type can reset value for input[type=radio]
7308 // #6666: IE/Edge forces progress value down to 1 before setting a max
7309 /* istanbul ignore if */
7310 if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
7311 setAttr(elm, 'value', attrs.value);
7312 }
7313 for (key in oldAttrs) {
7314 if (isUndef(attrs[key])) {
7315 if (isXlink(key)) {
7316 elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
7317 }
7318 else if (!isEnumeratedAttr(key)) {
7319 elm.removeAttribute(key);
7320 }
7321 }
7322 }
7323}
7324function setAttr(el, key, value, isInPre) {
7325 if (isInPre || el.tagName.indexOf('-') > -1) {
7326 baseSetAttr(el, key, value);
7327 }
7328 else if (isBooleanAttr(key)) {
7329 // set attribute for blank value
7330 // e.g. <option disabled>Select one</option>
7331 if (isFalsyAttrValue(value)) {
7332 el.removeAttribute(key);
7333 }
7334 else {
7335 // technically allowfullscreen is a boolean attribute for <iframe>,
7336 // but Flash expects a value of "true" when used on <embed> tag
7337 value = key === 'allowfullscreen' && el.tagName === 'EMBED' ? 'true' : key;
7338 el.setAttribute(key, value);
7339 }
7340 }
7341 else if (isEnumeratedAttr(key)) {
7342 el.setAttribute(key, convertEnumeratedValue(key, value));
7343 }
7344 else if (isXlink(key)) {
7345 if (isFalsyAttrValue(value)) {
7346 el.removeAttributeNS(xlinkNS, getXlinkProp(key));
7347 }
7348 else {
7349 el.setAttributeNS(xlinkNS, key, value);
7350 }
7351 }
7352 else {
7353 baseSetAttr(el, key, value);
7354 }
7355}
7356function baseSetAttr(el, key, value) {
7357 if (isFalsyAttrValue(value)) {
7358 el.removeAttribute(key);
7359 }
7360 else {
7361 // #7138: IE10 & 11 fires input event when setting placeholder on
7362 // <textarea>... block the first input event and remove the blocker
7363 // immediately.
7364 /* istanbul ignore if */
7365 if (isIE &&
7366 !isIE9 &&
7367 el.tagName === 'TEXTAREA' &&
7368 key === 'placeholder' &&
7369 value !== '' &&
7370 !el.__ieph) {
7371 var blocker_1 = function (e) {
7372 e.stopImmediatePropagation();
7373 el.removeEventListener('input', blocker_1);
7374 };
7375 el.addEventListener('input', blocker_1);
7376 // $flow-disable-line
7377 el.__ieph = true; /* IE placeholder patched */
7378 }
7379 el.setAttribute(key, value);
7380 }
7381}
7382var attrs = {
7383 create: updateAttrs,
7384 update: updateAttrs
7385};
7386
7387function updateClass(oldVnode, vnode) {
7388 var el = vnode.elm;
7389 var data = vnode.data;
7390 var oldData = oldVnode.data;
7391 if (isUndef(data.staticClass) &&
7392 isUndef(data.class) &&
7393 (isUndef(oldData) ||
7394 (isUndef(oldData.staticClass) && isUndef(oldData.class)))) {
7395 return;
7396 }
7397 var cls = genClassForVnode(vnode);
7398 // handle transition classes
7399 var transitionClass = el._transitionClasses;
7400 if (isDef(transitionClass)) {
7401 cls = concat(cls, stringifyClass(transitionClass));
7402 }
7403 // set the class
7404 if (cls !== el._prevClass) {
7405 el.setAttribute('class', cls);
7406 el._prevClass = cls;
7407 }
7408}
7409var klass = {
7410 create: updateClass,
7411 update: updateClass
7412};
7413
7414// in some cases, the event used has to be determined at runtime
7415// so we used some reserved tokens during compile.
7416var RANGE_TOKEN = '__r';
7417var CHECKBOX_RADIO_TOKEN = '__c';
7418
7419// normalize v-model event tokens that can only be determined at runtime.
7420// it's important to place the event as the first in the array because
7421// the whole point is ensuring the v-model callback gets called before
7422// user-attached handlers.
7423function normalizeEvents(on) {
7424 /* istanbul ignore if */
7425 if (isDef(on[RANGE_TOKEN])) {
7426 // IE input[type=range] only supports `change` event
7427 var event_1 = isIE ? 'change' : 'input';
7428 on[event_1] = [].concat(on[RANGE_TOKEN], on[event_1] || []);
7429 delete on[RANGE_TOKEN];
7430 }
7431 // This was originally intended to fix #4521 but no longer necessary
7432 // after 2.5. Keeping it for backwards compat with generated code from < 2.4
7433 /* istanbul ignore if */
7434 if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
7435 on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
7436 delete on[CHECKBOX_RADIO_TOKEN];
7437 }
7438}
7439var target;
7440function createOnceHandler(event, handler, capture) {
7441 var _target = target; // save current target element in closure
7442 return function onceHandler() {
7443 var res = handler.apply(null, arguments);
7444 if (res !== null) {
7445 remove(event, onceHandler, capture, _target);
7446 }
7447 };
7448}
7449// #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
7450// implementation and does not fire microtasks in between event propagation, so
7451// safe to exclude.
7452var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
7453function add(name, handler, capture, passive) {
7454 // async edge case #6566: inner click event triggers patch, event handler
7455 // attached to outer element during patch, and triggered again. This
7456 // happens because browsers fire microtask ticks between event propagation.
7457 // the solution is simple: we save the timestamp when a handler is attached,
7458 // and the handler would only fire if the event passed to it was fired
7459 // AFTER it was attached.
7460 if (useMicrotaskFix) {
7461 var attachedTimestamp_1 = currentFlushTimestamp;
7462 var original_1 = handler;
7463 //@ts-expect-error
7464 handler = original_1._wrapper = function (e) {
7465 if (
7466 // no bubbling, should always fire.
7467 // this is just a safety net in case event.timeStamp is unreliable in
7468 // certain weird environments...
7469 e.target === e.currentTarget ||
7470 // event is fired after handler attachment
7471 e.timeStamp >= attachedTimestamp_1 ||
7472 // bail for environments that have buggy event.timeStamp implementations
7473 // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
7474 // #9681 QtWebEngine event.timeStamp is negative value
7475 e.timeStamp <= 0 ||
7476 // #9448 bail if event is fired in another document in a multi-page
7477 // electron/nw.js app, since event.timeStamp will be using a different
7478 // starting reference
7479 e.target.ownerDocument !== document) {
7480 return original_1.apply(this, arguments);
7481 }
7482 };
7483 }
7484 target.addEventListener(name, handler, supportsPassive ? { capture: capture, passive: passive } : capture);
7485}
7486function remove(name, handler, capture, _target) {
7487 (_target || target).removeEventListener(name,
7488 //@ts-expect-error
7489 handler._wrapper || handler, capture);
7490}
7491function updateDOMListeners(oldVnode, vnode) {
7492 if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
7493 return;
7494 }
7495 var on = vnode.data.on || {};
7496 var oldOn = oldVnode.data.on || {};
7497 // vnode is empty when removing all listeners,
7498 // and use old vnode dom element
7499 target = vnode.elm || oldVnode.elm;
7500 normalizeEvents(on);
7501 updateListeners(on, oldOn, add, remove, createOnceHandler, vnode.context);
7502 target = undefined;
7503}
7504var events = {
7505 create: updateDOMListeners,
7506 update: updateDOMListeners,
7507 // @ts-expect-error emptyNode has actually data
7508 destroy: function (vnode) { return updateDOMListeners(vnode, emptyNode); }
7509};
7510
7511var svgContainer;
7512function updateDOMProps(oldVnode, vnode) {
7513 if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
7514 return;
7515 }
7516 var key, cur;
7517 var elm = vnode.elm;
7518 var oldProps = oldVnode.data.domProps || {};
7519 var props = vnode.data.domProps || {};
7520 // clone observed objects, as the user probably wants to mutate it
7521 if (isDef(props.__ob__) || isTrue(props._v_attr_proxy)) {
7522 props = vnode.data.domProps = extend({}, props);
7523 }
7524 for (key in oldProps) {
7525 if (!(key in props)) {
7526 elm[key] = '';
7527 }
7528 }
7529 for (key in props) {
7530 cur = props[key];
7531 // ignore children if the node has textContent or innerHTML,
7532 // as these will throw away existing DOM nodes and cause removal errors
7533 // on subsequent patches (#3360)
7534 if (key === 'textContent' || key === 'innerHTML') {
7535 if (vnode.children)
7536 vnode.children.length = 0;
7537 if (cur === oldProps[key])
7538 continue;
7539 // #6601 work around Chrome version <= 55 bug where single textNode
7540 // replaced by innerHTML/textContent retains its parentNode property
7541 if (elm.childNodes.length === 1) {
7542 elm.removeChild(elm.childNodes[0]);
7543 }
7544 }
7545 if (key === 'value' && elm.tagName !== 'PROGRESS') {
7546 // store value as _value as well since
7547 // non-string values will be stringified
7548 elm._value = cur;
7549 // avoid resetting cursor position when value is the same
7550 var strCur = isUndef(cur) ? '' : String(cur);
7551 if (shouldUpdateValue(elm, strCur)) {
7552 elm.value = strCur;
7553 }
7554 }
7555 else if (key === 'innerHTML' &&
7556 isSVG(elm.tagName) &&
7557 isUndef(elm.innerHTML)) {
7558 // IE doesn't support innerHTML for SVG elements
7559 svgContainer = svgContainer || document.createElement('div');
7560 svgContainer.innerHTML = "<svg>".concat(cur, "</svg>");
7561 var svg = svgContainer.firstChild;
7562 while (elm.firstChild) {
7563 elm.removeChild(elm.firstChild);
7564 }
7565 while (svg.firstChild) {
7566 elm.appendChild(svg.firstChild);
7567 }
7568 }
7569 else if (
7570 // skip the update if old and new VDOM state is the same.
7571 // `value` is handled separately because the DOM value may be temporarily
7572 // out of sync with VDOM state due to focus, composition and modifiers.
7573 // This #4521 by skipping the unnecessary `checked` update.
7574 cur !== oldProps[key]) {
7575 // some property updates can throw
7576 // e.g. `value` on <progress> w/ non-finite value
7577 try {
7578 elm[key] = cur;
7579 }
7580 catch (e) { }
7581 }
7582 }
7583}
7584function shouldUpdateValue(elm, checkVal) {
7585 return (
7586 //@ts-expect-error
7587 !elm.composing &&
7588 (elm.tagName === 'OPTION' ||
7589 isNotInFocusAndDirty(elm, checkVal) ||
7590 isDirtyWithModifiers(elm, checkVal)));
7591}
7592function isNotInFocusAndDirty(elm, checkVal) {
7593 // return true when textbox (.number and .trim) loses focus and its value is
7594 // not equal to the updated value
7595 var notInFocus = true;
7596 // #6157
7597 // work around IE bug when accessing document.activeElement in an iframe
7598 try {
7599 notInFocus = document.activeElement !== elm;
7600 }
7601 catch (e) { }
7602 return notInFocus && elm.value !== checkVal;
7603}
7604function isDirtyWithModifiers(elm, newVal) {
7605 var value = elm.value;
7606 var modifiers = elm._vModifiers; // injected by v-model runtime
7607 if (isDef(modifiers)) {
7608 if (modifiers.number) {
7609 return toNumber(value) !== toNumber(newVal);
7610 }
7611 if (modifiers.trim) {
7612 return value.trim() !== newVal.trim();
7613 }
7614 }
7615 return value !== newVal;
7616}
7617var domProps = {
7618 create: updateDOMProps,
7619 update: updateDOMProps
7620};
7621
7622var parseStyleText = cached(function (cssText) {
7623 var res = {};
7624 var listDelimiter = /;(?![^(]*\))/g;
7625 var propertyDelimiter = /:(.+)/;
7626 cssText.split(listDelimiter).forEach(function (item) {
7627 if (item) {
7628 var tmp = item.split(propertyDelimiter);
7629 tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
7630 }
7631 });
7632 return res;
7633});
7634// merge static and dynamic style data on the same vnode
7635function normalizeStyleData(data) {
7636 var style = normalizeStyleBinding(data.style);
7637 // static style is pre-processed into an object during compilation
7638 // and is always a fresh object, so it's safe to merge into it
7639 return data.staticStyle ? extend(data.staticStyle, style) : style;
7640}
7641// normalize possible array / string values into Object
7642function normalizeStyleBinding(bindingStyle) {
7643 if (Array.isArray(bindingStyle)) {
7644 return toObject(bindingStyle);
7645 }
7646 if (typeof bindingStyle === 'string') {
7647 return parseStyleText(bindingStyle);
7648 }
7649 return bindingStyle;
7650}
7651/**
7652 * parent component style should be after child's
7653 * so that parent component's style could override it
7654 */
7655function getStyle(vnode, checkChild) {
7656 var res = {};
7657 var styleData;
7658 if (checkChild) {
7659 var childNode = vnode;
7660 while (childNode.componentInstance) {
7661 childNode = childNode.componentInstance._vnode;
7662 if (childNode &&
7663 childNode.data &&
7664 (styleData = normalizeStyleData(childNode.data))) {
7665 extend(res, styleData);
7666 }
7667 }
7668 }
7669 if ((styleData = normalizeStyleData(vnode.data))) {
7670 extend(res, styleData);
7671 }
7672 var parentNode = vnode;
7673 // @ts-expect-error parentNode.parent not VNodeWithData
7674 while ((parentNode = parentNode.parent)) {
7675 if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
7676 extend(res, styleData);
7677 }
7678 }
7679 return res;
7680}
7681
7682var cssVarRE = /^--/;
7683var importantRE = /\s*!important$/;
7684var setProp = function (el, name, val) {
7685 /* istanbul ignore if */
7686 if (cssVarRE.test(name)) {
7687 el.style.setProperty(name, val);
7688 }
7689 else if (importantRE.test(val)) {
7690 el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
7691 }
7692 else {
7693 var normalizedName = normalize(name);
7694 if (Array.isArray(val)) {
7695 // Support values array created by autoprefixer, e.g.
7696 // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
7697 // Set them one by one, and the browser will only set those it can recognize
7698 for (var i = 0, len = val.length; i < len; i++) {
7699 el.style[normalizedName] = val[i];
7700 }
7701 }
7702 else {
7703 el.style[normalizedName] = val;
7704 }
7705 }
7706};
7707var vendorNames = ['Webkit', 'Moz', 'ms'];
7708var emptyStyle;
7709var normalize = cached(function (prop) {
7710 emptyStyle = emptyStyle || document.createElement('div').style;
7711 prop = camelize(prop);
7712 if (prop !== 'filter' && prop in emptyStyle) {
7713 return prop;
7714 }
7715 var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
7716 for (var i = 0; i < vendorNames.length; i++) {
7717 var name_1 = vendorNames[i] + capName;
7718 if (name_1 in emptyStyle) {
7719 return name_1;
7720 }
7721 }
7722});
7723function updateStyle(oldVnode, vnode) {
7724 var data = vnode.data;
7725 var oldData = oldVnode.data;
7726 if (isUndef(data.staticStyle) &&
7727 isUndef(data.style) &&
7728 isUndef(oldData.staticStyle) &&
7729 isUndef(oldData.style)) {
7730 return;
7731 }
7732 var cur, name;
7733 var el = vnode.elm;
7734 var oldStaticStyle = oldData.staticStyle;
7735 var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
7736 // if static style exists, stylebinding already merged into it when doing normalizeStyleData
7737 var oldStyle = oldStaticStyle || oldStyleBinding;
7738 var style = normalizeStyleBinding(vnode.data.style) || {};
7739 // store normalized style under a different key for next diff
7740 // make sure to clone it if it's reactive, since the user likely wants
7741 // to mutate it.
7742 vnode.data.normalizedStyle = isDef(style.__ob__) ? extend({}, style) : style;
7743 var newStyle = getStyle(vnode, true);
7744 for (name in oldStyle) {
7745 if (isUndef(newStyle[name])) {
7746 setProp(el, name, '');
7747 }
7748 }
7749 for (name in newStyle) {
7750 cur = newStyle[name];
7751 if (cur !== oldStyle[name]) {
7752 // ie9 setting to null has no effect, must use empty string
7753 setProp(el, name, cur == null ? '' : cur);
7754 }
7755 }
7756}
7757var style = {
7758 create: updateStyle,
7759 update: updateStyle
7760};
7761
7762var whitespaceRE = /\s+/;
7763/**
7764 * Add class with compatibility for SVG since classList is not supported on
7765 * SVG elements in IE
7766 */
7767function addClass(el, cls) {
7768 /* istanbul ignore if */
7769 if (!cls || !(cls = cls.trim())) {
7770 return;
7771 }
7772 /* istanbul ignore else */
7773 if (el.classList) {
7774 if (cls.indexOf(' ') > -1) {
7775 cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });
7776 }
7777 else {
7778 el.classList.add(cls);
7779 }
7780 }
7781 else {
7782 var cur = " ".concat(el.getAttribute('class') || '', " ");
7783 if (cur.indexOf(' ' + cls + ' ') < 0) {
7784 el.setAttribute('class', (cur + cls).trim());
7785 }
7786 }
7787}
7788/**
7789 * Remove class with compatibility for SVG since classList is not supported on
7790 * SVG elements in IE
7791 */
7792function removeClass(el, cls) {
7793 /* istanbul ignore if */
7794 if (!cls || !(cls = cls.trim())) {
7795 return;
7796 }
7797 /* istanbul ignore else */
7798 if (el.classList) {
7799 if (cls.indexOf(' ') > -1) {
7800 cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });
7801 }
7802 else {
7803 el.classList.remove(cls);
7804 }
7805 if (!el.classList.length) {
7806 el.removeAttribute('class');
7807 }
7808 }
7809 else {
7810 var cur = " ".concat(el.getAttribute('class') || '', " ");
7811 var tar = ' ' + cls + ' ';
7812 while (cur.indexOf(tar) >= 0) {
7813 cur = cur.replace(tar, ' ');
7814 }
7815 cur = cur.trim();
7816 if (cur) {
7817 el.setAttribute('class', cur);
7818 }
7819 else {
7820 el.removeAttribute('class');
7821 }
7822 }
7823}
7824
7825function resolveTransition(def) {
7826 if (!def) {
7827 return;
7828 }
7829 /* istanbul ignore else */
7830 if (typeof def === 'object') {
7831 var res = {};
7832 if (def.css !== false) {
7833 extend(res, autoCssTransition(def.name || 'v'));
7834 }
7835 extend(res, def);
7836 return res;
7837 }
7838 else if (typeof def === 'string') {
7839 return autoCssTransition(def);
7840 }
7841}
7842var autoCssTransition = cached(function (name) {
7843 return {
7844 enterClass: "".concat(name, "-enter"),
7845 enterToClass: "".concat(name, "-enter-to"),
7846 enterActiveClass: "".concat(name, "-enter-active"),
7847 leaveClass: "".concat(name, "-leave"),
7848 leaveToClass: "".concat(name, "-leave-to"),
7849 leaveActiveClass: "".concat(name, "-leave-active")
7850 };
7851});
7852var hasTransition = inBrowser && !isIE9;
7853var TRANSITION = 'transition';
7854var ANIMATION = 'animation';
7855// Transition property/event sniffing
7856var transitionProp = 'transition';
7857var transitionEndEvent = 'transitionend';
7858var animationProp = 'animation';
7859var animationEndEvent = 'animationend';
7860if (hasTransition) {
7861 /* istanbul ignore if */
7862 if (window.ontransitionend === undefined &&
7863 window.onwebkittransitionend !== undefined) {
7864 transitionProp = 'WebkitTransition';
7865 transitionEndEvent = 'webkitTransitionEnd';
7866 }
7867 if (window.onanimationend === undefined &&
7868 window.onwebkitanimationend !== undefined) {
7869 animationProp = 'WebkitAnimation';
7870 animationEndEvent = 'webkitAnimationEnd';
7871 }
7872}
7873// binding to window is necessary to make hot reload work in IE in strict mode
7874var raf = inBrowser
7875 ? window.requestAnimationFrame
7876 ? window.requestAnimationFrame.bind(window)
7877 : setTimeout
7878 : /* istanbul ignore next */ function (/* istanbul ignore next */ fn) { return fn(); };
7879function nextFrame(fn) {
7880 raf(function () {
7881 // @ts-expect-error
7882 raf(fn);
7883 });
7884}
7885function addTransitionClass(el, cls) {
7886 var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
7887 if (transitionClasses.indexOf(cls) < 0) {
7888 transitionClasses.push(cls);
7889 addClass(el, cls);
7890 }
7891}
7892function removeTransitionClass(el, cls) {
7893 if (el._transitionClasses) {
7894 remove$2(el._transitionClasses, cls);
7895 }
7896 removeClass(el, cls);
7897}
7898function whenTransitionEnds(el, expectedType, cb) {
7899 var _a = getTransitionInfo(el, expectedType), type = _a.type, timeout = _a.timeout, propCount = _a.propCount;
7900 if (!type)
7901 return cb();
7902 var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
7903 var ended = 0;
7904 var end = function () {
7905 el.removeEventListener(event, onEnd);
7906 cb();
7907 };
7908 var onEnd = function (e) {
7909 if (e.target === el) {
7910 if (++ended >= propCount) {
7911 end();
7912 }
7913 }
7914 };
7915 setTimeout(function () {
7916 if (ended < propCount) {
7917 end();
7918 }
7919 }, timeout + 1);
7920 el.addEventListener(event, onEnd);
7921}
7922var transformRE = /\b(transform|all)(,|$)/;
7923function getTransitionInfo(el, expectedType) {
7924 var styles = window.getComputedStyle(el);
7925 // JSDOM may return undefined for transition properties
7926 var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
7927 var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
7928 var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
7929 var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
7930 var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
7931 var animationTimeout = getTimeout(animationDelays, animationDurations);
7932 var type;
7933 var timeout = 0;
7934 var propCount = 0;
7935 /* istanbul ignore if */
7936 if (expectedType === TRANSITION) {
7937 if (transitionTimeout > 0) {
7938 type = TRANSITION;
7939 timeout = transitionTimeout;
7940 propCount = transitionDurations.length;
7941 }
7942 }
7943 else if (expectedType === ANIMATION) {
7944 if (animationTimeout > 0) {
7945 type = ANIMATION;
7946 timeout = animationTimeout;
7947 propCount = animationDurations.length;
7948 }
7949 }
7950 else {
7951 timeout = Math.max(transitionTimeout, animationTimeout);
7952 type =
7953 timeout > 0
7954 ? transitionTimeout > animationTimeout
7955 ? TRANSITION
7956 : ANIMATION
7957 : null;
7958 propCount = type
7959 ? type === TRANSITION
7960 ? transitionDurations.length
7961 : animationDurations.length
7962 : 0;
7963 }
7964 var hasTransform = type === TRANSITION && transformRE.test(styles[transitionProp + 'Property']);
7965 return {
7966 type: type,
7967 timeout: timeout,
7968 propCount: propCount,
7969 hasTransform: hasTransform
7970 };
7971}
7972function getTimeout(delays, durations) {
7973 /* istanbul ignore next */
7974 while (delays.length < durations.length) {
7975 delays = delays.concat(delays);
7976 }
7977 return Math.max.apply(null, durations.map(function (d, i) {
7978 return toMs(d) + toMs(delays[i]);
7979 }));
7980}
7981// Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
7982// in a locale-dependent way, using a comma instead of a dot.
7983// If comma is not replaced with a dot, the input will be rounded down (i.e. acting
7984// as a floor function) causing unexpected behaviors
7985function toMs(s) {
7986 return Number(s.slice(0, -1).replace(',', '.')) * 1000;
7987}
7988
7989function enter(vnode, toggleDisplay) {
7990 var el = vnode.elm;
7991 // call leave callback now
7992 if (isDef(el._leaveCb)) {
7993 el._leaveCb.cancelled = true;
7994 el._leaveCb();
7995 }
7996 var data = resolveTransition(vnode.data.transition);
7997 if (isUndef(data)) {
7998 return;
7999 }
8000 /* istanbul ignore if */
8001 if (isDef(el._enterCb) || el.nodeType !== 1) {
8002 return;
8003 }
8004 var css = data.css, type = data.type, enterClass = data.enterClass, enterToClass = data.enterToClass, enterActiveClass = data.enterActiveClass, appearClass = data.appearClass, appearToClass = data.appearToClass, appearActiveClass = data.appearActiveClass, beforeEnter = data.beforeEnter, enter = data.enter, afterEnter = data.afterEnter, enterCancelled = data.enterCancelled, beforeAppear = data.beforeAppear, appear = data.appear, afterAppear = data.afterAppear, appearCancelled = data.appearCancelled, duration = data.duration;
8005 // activeInstance will always be the <transition> component managing this
8006 // transition. One edge case to check is when the <transition> is placed
8007 // as the root node of a child component. In that case we need to check
8008 // <transition>'s parent for appear check.
8009 var context = activeInstance;
8010 var transitionNode = activeInstance.$vnode;
8011 while (transitionNode && transitionNode.parent) {
8012 context = transitionNode.context;
8013 transitionNode = transitionNode.parent;
8014 }
8015 var isAppear = !context._isMounted || !vnode.isRootInsert;
8016 if (isAppear && !appear && appear !== '') {
8017 return;
8018 }
8019 var startClass = isAppear && appearClass ? appearClass : enterClass;
8020 var activeClass = isAppear && appearActiveClass ? appearActiveClass : enterActiveClass;
8021 var toClass = isAppear && appearToClass ? appearToClass : enterToClass;
8022 var beforeEnterHook = isAppear ? beforeAppear || beforeEnter : beforeEnter;
8023 var enterHook = isAppear ? (isFunction(appear) ? appear : enter) : enter;
8024 var afterEnterHook = isAppear ? afterAppear || afterEnter : afterEnter;
8025 var enterCancelledHook = isAppear
8026 ? appearCancelled || enterCancelled
8027 : enterCancelled;
8028 var explicitEnterDuration = toNumber(isObject(duration) ? duration.enter : duration);
8029 if (process.env.NODE_ENV !== 'production' && explicitEnterDuration != null) {
8030 checkDuration(explicitEnterDuration, 'enter', vnode);
8031 }
8032 var expectsCSS = css !== false && !isIE9;
8033 var userWantsControl = getHookArgumentsLength(enterHook);
8034 var cb = (el._enterCb = once(function () {
8035 if (expectsCSS) {
8036 removeTransitionClass(el, toClass);
8037 removeTransitionClass(el, activeClass);
8038 }
8039 // @ts-expect-error
8040 if (cb.cancelled) {
8041 if (expectsCSS) {
8042 removeTransitionClass(el, startClass);
8043 }
8044 enterCancelledHook && enterCancelledHook(el);
8045 }
8046 else {
8047 afterEnterHook && afterEnterHook(el);
8048 }
8049 el._enterCb = null;
8050 }));
8051 if (!vnode.data.show) {
8052 // remove pending leave element on enter by injecting an insert hook
8053 mergeVNodeHook(vnode, 'insert', function () {
8054 var parent = el.parentNode;
8055 var pendingNode = parent && parent._pending && parent._pending[vnode.key];
8056 if (pendingNode &&
8057 pendingNode.tag === vnode.tag &&
8058 pendingNode.elm._leaveCb) {
8059 pendingNode.elm._leaveCb();
8060 }
8061 enterHook && enterHook(el, cb);
8062 });
8063 }
8064 // start enter transition
8065 beforeEnterHook && beforeEnterHook(el);
8066 if (expectsCSS) {
8067 addTransitionClass(el, startClass);
8068 addTransitionClass(el, activeClass);
8069 nextFrame(function () {
8070 removeTransitionClass(el, startClass);
8071 // @ts-expect-error
8072 if (!cb.cancelled) {
8073 addTransitionClass(el, toClass);
8074 if (!userWantsControl) {
8075 if (isValidDuration(explicitEnterDuration)) {
8076 setTimeout(cb, explicitEnterDuration);
8077 }
8078 else {
8079 whenTransitionEnds(el, type, cb);
8080 }
8081 }
8082 }
8083 });
8084 }
8085 if (vnode.data.show) {
8086 toggleDisplay && toggleDisplay();
8087 enterHook && enterHook(el, cb);
8088 }
8089 if (!expectsCSS && !userWantsControl) {
8090 cb();
8091 }
8092}
8093function leave(vnode, rm) {
8094 var el = vnode.elm;
8095 // call enter callback now
8096 if (isDef(el._enterCb)) {
8097 el._enterCb.cancelled = true;
8098 el._enterCb();
8099 }
8100 var data = resolveTransition(vnode.data.transition);
8101 if (isUndef(data) || el.nodeType !== 1) {
8102 return rm();
8103 }
8104 /* istanbul ignore if */
8105 if (isDef(el._leaveCb)) {
8106 return;
8107 }
8108 var css = data.css, type = data.type, leaveClass = data.leaveClass, leaveToClass = data.leaveToClass, leaveActiveClass = data.leaveActiveClass, beforeLeave = data.beforeLeave, leave = data.leave, afterLeave = data.afterLeave, leaveCancelled = data.leaveCancelled, delayLeave = data.delayLeave, duration = data.duration;
8109 var expectsCSS = css !== false && !isIE9;
8110 var userWantsControl = getHookArgumentsLength(leave);
8111 var explicitLeaveDuration = toNumber(isObject(duration) ? duration.leave : duration);
8112 if (process.env.NODE_ENV !== 'production' && isDef(explicitLeaveDuration)) {
8113 checkDuration(explicitLeaveDuration, 'leave', vnode);
8114 }
8115 var cb = (el._leaveCb = once(function () {
8116 if (el.parentNode && el.parentNode._pending) {
8117 el.parentNode._pending[vnode.key] = null;
8118 }
8119 if (expectsCSS) {
8120 removeTransitionClass(el, leaveToClass);
8121 removeTransitionClass(el, leaveActiveClass);
8122 }
8123 // @ts-expect-error
8124 if (cb.cancelled) {
8125 if (expectsCSS) {
8126 removeTransitionClass(el, leaveClass);
8127 }
8128 leaveCancelled && leaveCancelled(el);
8129 }
8130 else {
8131 rm();
8132 afterLeave && afterLeave(el);
8133 }
8134 el._leaveCb = null;
8135 }));
8136 if (delayLeave) {
8137 delayLeave(performLeave);
8138 }
8139 else {
8140 performLeave();
8141 }
8142 function performLeave() {
8143 // the delayed leave may have already been cancelled
8144 // @ts-expect-error
8145 if (cb.cancelled) {
8146 return;
8147 }
8148 // record leaving element
8149 if (!vnode.data.show && el.parentNode) {
8150 (el.parentNode._pending || (el.parentNode._pending = {}))[vnode.key] =
8151 vnode;
8152 }
8153 beforeLeave && beforeLeave(el);
8154 if (expectsCSS) {
8155 addTransitionClass(el, leaveClass);
8156 addTransitionClass(el, leaveActiveClass);
8157 nextFrame(function () {
8158 removeTransitionClass(el, leaveClass);
8159 // @ts-expect-error
8160 if (!cb.cancelled) {
8161 addTransitionClass(el, leaveToClass);
8162 if (!userWantsControl) {
8163 if (isValidDuration(explicitLeaveDuration)) {
8164 setTimeout(cb, explicitLeaveDuration);
8165 }
8166 else {
8167 whenTransitionEnds(el, type, cb);
8168 }
8169 }
8170 }
8171 });
8172 }
8173 leave && leave(el, cb);
8174 if (!expectsCSS && !userWantsControl) {
8175 cb();
8176 }
8177 }
8178}
8179// only used in dev mode
8180function checkDuration(val, name, vnode) {
8181 if (typeof val !== 'number') {
8182 warn("<transition> explicit ".concat(name, " duration is not a valid number - ") +
8183 "got ".concat(JSON.stringify(val), "."), vnode.context);
8184 }
8185 else if (isNaN(val)) {
8186 warn("<transition> explicit ".concat(name, " duration is NaN - ") +
8187 'the duration expression might be incorrect.', vnode.context);
8188 }
8189}
8190function isValidDuration(val) {
8191 return typeof val === 'number' && !isNaN(val);
8192}
8193/**
8194 * Normalize a transition hook's argument length. The hook may be:
8195 * - a merged hook (invoker) with the original in .fns
8196 * - a wrapped component method (check ._length)
8197 * - a plain function (.length)
8198 */
8199function getHookArgumentsLength(fn) {
8200 if (isUndef(fn)) {
8201 return false;
8202 }
8203 // @ts-expect-error
8204 var invokerFns = fn.fns;
8205 if (isDef(invokerFns)) {
8206 // invoker
8207 return getHookArgumentsLength(Array.isArray(invokerFns) ? invokerFns[0] : invokerFns);
8208 }
8209 else {
8210 // @ts-expect-error
8211 return (fn._length || fn.length) > 1;
8212 }
8213}
8214function _enter(_, vnode) {
8215 if (vnode.data.show !== true) {
8216 enter(vnode);
8217 }
8218}
8219var transition = inBrowser
8220 ? {
8221 create: _enter,
8222 activate: _enter,
8223 remove: function (vnode, rm) {
8224 /* istanbul ignore else */
8225 if (vnode.data.show !== true) {
8226 // @ts-expect-error
8227 leave(vnode, rm);
8228 }
8229 else {
8230 rm();
8231 }
8232 }
8233 }
8234 : {};
8235
8236var platformModules = [attrs, klass, events, domProps, style, transition];
8237
8238// the directive module should be applied last, after all
8239// built-in modules have been applied.
8240var modules = platformModules.concat(baseModules);
8241var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
8242
8243/**
8244 * Not type checking this file because flow doesn't like attaching
8245 * properties to Elements.
8246 */
8247/* istanbul ignore if */
8248if (isIE9) {
8249 // http://www.matts411.com/post/internet-explorer-9-oninput/
8250 document.addEventListener('selectionchange', function () {
8251 var el = document.activeElement;
8252 // @ts-expect-error
8253 if (el && el.vmodel) {
8254 trigger(el, 'input');
8255 }
8256 });
8257}
8258var directive = {
8259 inserted: function (el, binding, vnode, oldVnode) {
8260 if (vnode.tag === 'select') {
8261 // #6903
8262 if (oldVnode.elm && !oldVnode.elm._vOptions) {
8263 mergeVNodeHook(vnode, 'postpatch', function () {
8264 directive.componentUpdated(el, binding, vnode);
8265 });
8266 }
8267 else {
8268 setSelected(el, binding, vnode.context);
8269 }
8270 el._vOptions = [].map.call(el.options, getValue);
8271 }
8272 else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
8273 el._vModifiers = binding.modifiers;
8274 if (!binding.modifiers.lazy) {
8275 el.addEventListener('compositionstart', onCompositionStart);
8276 el.addEventListener('compositionend', onCompositionEnd);
8277 // Safari < 10.2 & UIWebView doesn't fire compositionend when
8278 // switching focus before confirming composition choice
8279 // this also fixes the issue where some browsers e.g. iOS Chrome
8280 // fires "change" instead of "input" on autocomplete.
8281 el.addEventListener('change', onCompositionEnd);
8282 /* istanbul ignore if */
8283 if (isIE9) {
8284 el.vmodel = true;
8285 }
8286 }
8287 }
8288 },
8289 componentUpdated: function (el, binding, vnode) {
8290 if (vnode.tag === 'select') {
8291 setSelected(el, binding, vnode.context);
8292 // in case the options rendered by v-for have changed,
8293 // it's possible that the value is out-of-sync with the rendered options.
8294 // detect such cases and filter out values that no longer has a matching
8295 // option in the DOM.
8296 var prevOptions_1 = el._vOptions;
8297 var curOptions_1 = (el._vOptions = [].map.call(el.options, getValue));
8298 if (curOptions_1.some(function (o, i) { return !looseEqual(o, prevOptions_1[i]); })) {
8299 // trigger change event if
8300 // no matching option found for at least one value
8301 var needReset = el.multiple
8302 ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions_1); })
8303 : binding.value !== binding.oldValue &&
8304 hasNoMatchingOption(binding.value, curOptions_1);
8305 if (needReset) {
8306 trigger(el, 'change');
8307 }
8308 }
8309 }
8310 }
8311};
8312function setSelected(el, binding, vm) {
8313 actuallySetSelected(el, binding, vm);
8314 /* istanbul ignore if */
8315 if (isIE || isEdge) {
8316 setTimeout(function () {
8317 actuallySetSelected(el, binding, vm);
8318 }, 0);
8319 }
8320}
8321function actuallySetSelected(el, binding, vm) {
8322 var value = binding.value;
8323 var isMultiple = el.multiple;
8324 if (isMultiple && !Array.isArray(value)) {
8325 process.env.NODE_ENV !== 'production' &&
8326 warn("<select multiple v-model=\"".concat(binding.expression, "\"> ") +
8327 "expects an Array value for its binding, but got ".concat(Object.prototype.toString
8328 .call(value)
8329 .slice(8, -1)), vm);
8330 return;
8331 }
8332 var selected, option;
8333 for (var i = 0, l = el.options.length; i < l; i++) {
8334 option = el.options[i];
8335 if (isMultiple) {
8336 selected = looseIndexOf(value, getValue(option)) > -1;
8337 if (option.selected !== selected) {
8338 option.selected = selected;
8339 }
8340 }
8341 else {
8342 if (looseEqual(getValue(option), value)) {
8343 if (el.selectedIndex !== i) {
8344 el.selectedIndex = i;
8345 }
8346 return;
8347 }
8348 }
8349 }
8350 if (!isMultiple) {
8351 el.selectedIndex = -1;
8352 }
8353}
8354function hasNoMatchingOption(value, options) {
8355 return options.every(function (o) { return !looseEqual(o, value); });
8356}
8357function getValue(option) {
8358 return '_value' in option ? option._value : option.value;
8359}
8360function onCompositionStart(e) {
8361 e.target.composing = true;
8362}
8363function onCompositionEnd(e) {
8364 // prevent triggering an input event for no reason
8365 if (!e.target.composing)
8366 return;
8367 e.target.composing = false;
8368 trigger(e.target, 'input');
8369}
8370function trigger(el, type) {
8371 var e = document.createEvent('HTMLEvents');
8372 e.initEvent(type, true, true);
8373 el.dispatchEvent(e);
8374}
8375
8376// recursively search for possible transition defined inside the component root
8377function locateNode(vnode) {
8378 // @ts-expect-error
8379 return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
8380 ? locateNode(vnode.componentInstance._vnode)
8381 : vnode;
8382}
8383var show = {
8384 bind: function (el, _a, vnode) {
8385 var value = _a.value;
8386 vnode = locateNode(vnode);
8387 var transition = vnode.data && vnode.data.transition;
8388 var originalDisplay = (el.__vOriginalDisplay =
8389 el.style.display === 'none' ? '' : el.style.display);
8390 if (value && transition) {
8391 vnode.data.show = true;
8392 enter(vnode, function () {
8393 el.style.display = originalDisplay;
8394 });
8395 }
8396 else {
8397 el.style.display = value ? originalDisplay : 'none';
8398 }
8399 },
8400 update: function (el, _a, vnode) {
8401 var value = _a.value, oldValue = _a.oldValue;
8402 /* istanbul ignore if */
8403 if (!value === !oldValue)
8404 return;
8405 vnode = locateNode(vnode);
8406 var transition = vnode.data && vnode.data.transition;
8407 if (transition) {
8408 vnode.data.show = true;
8409 if (value) {
8410 enter(vnode, function () {
8411 el.style.display = el.__vOriginalDisplay;
8412 });
8413 }
8414 else {
8415 leave(vnode, function () {
8416 el.style.display = 'none';
8417 });
8418 }
8419 }
8420 else {
8421 el.style.display = value ? el.__vOriginalDisplay : 'none';
8422 }
8423 },
8424 unbind: function (el, binding, vnode, oldVnode, isDestroy) {
8425 if (!isDestroy) {
8426 el.style.display = el.__vOriginalDisplay;
8427 }
8428 }
8429};
8430
8431var platformDirectives = {
8432 model: directive,
8433 show: show
8434};
8435
8436// Provides transition support for a single element/component.
8437var transitionProps = {
8438 name: String,
8439 appear: Boolean,
8440 css: Boolean,
8441 mode: String,
8442 type: String,
8443 enterClass: String,
8444 leaveClass: String,
8445 enterToClass: String,
8446 leaveToClass: String,
8447 enterActiveClass: String,
8448 leaveActiveClass: String,
8449 appearClass: String,
8450 appearActiveClass: String,
8451 appearToClass: String,
8452 duration: [Number, String, Object]
8453};
8454// in case the child is also an abstract component, e.g. <keep-alive>
8455// we want to recursively retrieve the real component to be rendered
8456function getRealChild(vnode) {
8457 var compOptions = vnode && vnode.componentOptions;
8458 if (compOptions && compOptions.Ctor.options.abstract) {
8459 return getRealChild(getFirstComponentChild(compOptions.children));
8460 }
8461 else {
8462 return vnode;
8463 }
8464}
8465function extractTransitionData(comp) {
8466 var data = {};
8467 var options = comp.$options;
8468 // props
8469 for (var key in options.propsData) {
8470 data[key] = comp[key];
8471 }
8472 // events.
8473 // extract listeners and pass them directly to the transition methods
8474 var listeners = options._parentListeners;
8475 for (var key in listeners) {
8476 data[camelize(key)] = listeners[key];
8477 }
8478 return data;
8479}
8480function placeholder(h, rawChild) {
8481 // @ts-expect-error
8482 if (/\d-keep-alive$/.test(rawChild.tag)) {
8483 return h('keep-alive', {
8484 props: rawChild.componentOptions.propsData
8485 });
8486 }
8487}
8488function hasParentTransition(vnode) {
8489 while ((vnode = vnode.parent)) {
8490 if (vnode.data.transition) {
8491 return true;
8492 }
8493 }
8494}
8495function isSameChild(child, oldChild) {
8496 return oldChild.key === child.key && oldChild.tag === child.tag;
8497}
8498var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
8499var isVShowDirective = function (d) { return d.name === 'show'; };
8500var Transition = {
8501 name: 'transition',
8502 props: transitionProps,
8503 abstract: true,
8504 render: function (h) {
8505 var _this = this;
8506 var children = this.$slots.default;
8507 if (!children) {
8508 return;
8509 }
8510 // filter out text nodes (possible whitespaces)
8511 children = children.filter(isNotTextNode);
8512 /* istanbul ignore if */
8513 if (!children.length) {
8514 return;
8515 }
8516 // warn multiple elements
8517 if (process.env.NODE_ENV !== 'production' && children.length > 1) {
8518 warn('<transition> can only be used on a single element. Use ' +
8519 '<transition-group> for lists.', this.$parent);
8520 }
8521 var mode = this.mode;
8522 // warn invalid mode
8523 if (process.env.NODE_ENV !== 'production' && mode && mode !== 'in-out' && mode !== 'out-in') {
8524 warn('invalid <transition> mode: ' + mode, this.$parent);
8525 }
8526 var rawChild = children[0];
8527 // if this is a component root node and the component's
8528 // parent container node also has transition, skip.
8529 if (hasParentTransition(this.$vnode)) {
8530 return rawChild;
8531 }
8532 // apply transition data to child
8533 // use getRealChild() to ignore abstract components e.g. keep-alive
8534 var child = getRealChild(rawChild);
8535 /* istanbul ignore if */
8536 if (!child) {
8537 return rawChild;
8538 }
8539 if (this._leaving) {
8540 return placeholder(h, rawChild);
8541 }
8542 // ensure a key that is unique to the vnode type and to this transition
8543 // component instance. This key will be used to remove pending leaving nodes
8544 // during entering.
8545 var id = "__transition-".concat(this._uid, "-");
8546 child.key =
8547 child.key == null
8548 ? child.isComment
8549 ? id + 'comment'
8550 : id + child.tag
8551 : isPrimitive(child.key)
8552 ? String(child.key).indexOf(id) === 0
8553 ? child.key
8554 : id + child.key
8555 : child.key;
8556 var data = ((child.data || (child.data = {})).transition =
8557 extractTransitionData(this));
8558 var oldRawChild = this._vnode;
8559 var oldChild = getRealChild(oldRawChild);
8560 // mark v-show
8561 // so that the transition module can hand over the control to the directive
8562 if (child.data.directives && child.data.directives.some(isVShowDirective)) {
8563 child.data.show = true;
8564 }
8565 if (oldChild &&
8566 oldChild.data &&
8567 !isSameChild(child, oldChild) &&
8568 !isAsyncPlaceholder(oldChild) &&
8569 // #6687 component root is a comment node
8570 !(oldChild.componentInstance &&
8571 oldChild.componentInstance._vnode.isComment)) {
8572 // replace old child transition data with fresh one
8573 // important for dynamic transitions!
8574 var oldData = (oldChild.data.transition = extend({}, data));
8575 // handle transition mode
8576 if (mode === 'out-in') {
8577 // return placeholder node and queue update when leave finishes
8578 this._leaving = true;
8579 mergeVNodeHook(oldData, 'afterLeave', function () {
8580 _this._leaving = false;
8581 _this.$forceUpdate();
8582 });
8583 return placeholder(h, rawChild);
8584 }
8585 else if (mode === 'in-out') {
8586 if (isAsyncPlaceholder(child)) {
8587 return oldRawChild;
8588 }
8589 var delayedLeave_1;
8590 var performLeave = function () {
8591 delayedLeave_1();
8592 };
8593 mergeVNodeHook(data, 'afterEnter', performLeave);
8594 mergeVNodeHook(data, 'enterCancelled', performLeave);
8595 mergeVNodeHook(oldData, 'delayLeave', function (leave) {
8596 delayedLeave_1 = leave;
8597 });
8598 }
8599 }
8600 return rawChild;
8601 }
8602};
8603
8604// Provides transition support for list items.
8605var props = extend({
8606 tag: String,
8607 moveClass: String
8608}, transitionProps);
8609delete props.mode;
8610var TransitionGroup = {
8611 props: props,
8612 beforeMount: function () {
8613 var _this = this;
8614 var update = this._update;
8615 this._update = function (vnode, hydrating) {
8616 var restoreActiveInstance = setActiveInstance(_this);
8617 // force removing pass
8618 _this.__patch__(_this._vnode, _this.kept, false, // hydrating
8619 true // removeOnly (!important, avoids unnecessary moves)
8620 );
8621 _this._vnode = _this.kept;
8622 restoreActiveInstance();
8623 update.call(_this, vnode, hydrating);
8624 };
8625 },
8626 render: function (h) {
8627 var tag = this.tag || this.$vnode.data.tag || 'span';
8628 var map = Object.create(null);
8629 var prevChildren = (this.prevChildren = this.children);
8630 var rawChildren = this.$slots.default || [];
8631 var children = (this.children = []);
8632 var transitionData = extractTransitionData(this);
8633 for (var i = 0; i < rawChildren.length; i++) {
8634 var c = rawChildren[i];
8635 if (c.tag) {
8636 if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
8637 children.push(c);
8638 map[c.key] = c;
8639 (c.data || (c.data = {})).transition = transitionData;
8640 }
8641 else if (process.env.NODE_ENV !== 'production') {
8642 var opts = c.componentOptions;
8643 var name_1 = opts
8644 ? getComponentName(opts.Ctor.options) || opts.tag || ''
8645 : c.tag;
8646 warn("<transition-group> children must be keyed: <".concat(name_1, ">"));
8647 }
8648 }
8649 }
8650 if (prevChildren) {
8651 var kept = [];
8652 var removed = [];
8653 for (var i = 0; i < prevChildren.length; i++) {
8654 var c = prevChildren[i];
8655 c.data.transition = transitionData;
8656 // @ts-expect-error .getBoundingClientRect is not typed in Node
8657 c.data.pos = c.elm.getBoundingClientRect();
8658 if (map[c.key]) {
8659 kept.push(c);
8660 }
8661 else {
8662 removed.push(c);
8663 }
8664 }
8665 this.kept = h(tag, null, kept);
8666 this.removed = removed;
8667 }
8668 return h(tag, null, children);
8669 },
8670 updated: function () {
8671 var children = this.prevChildren;
8672 var moveClass = this.moveClass || (this.name || 'v') + '-move';
8673 if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
8674 return;
8675 }
8676 // we divide the work into three loops to avoid mixing DOM reads and writes
8677 // in each iteration - which helps prevent layout thrashing.
8678 children.forEach(callPendingCbs);
8679 children.forEach(recordPosition);
8680 children.forEach(applyTranslation);
8681 // force reflow to put everything in position
8682 // assign to this to avoid being removed in tree-shaking
8683 // $flow-disable-line
8684 this._reflow = document.body.offsetHeight;
8685 children.forEach(function (c) {
8686 if (c.data.moved) {
8687 var el_1 = c.elm;
8688 var s = el_1.style;
8689 addTransitionClass(el_1, moveClass);
8690 s.transform = s.WebkitTransform = s.transitionDuration = '';
8691 el_1.addEventListener(transitionEndEvent, (el_1._moveCb = function cb(e) {
8692 if (e && e.target !== el_1) {
8693 return;
8694 }
8695 if (!e || /transform$/.test(e.propertyName)) {
8696 el_1.removeEventListener(transitionEndEvent, cb);
8697 el_1._moveCb = null;
8698 removeTransitionClass(el_1, moveClass);
8699 }
8700 }));
8701 }
8702 });
8703 },
8704 methods: {
8705 hasMove: function (el, moveClass) {
8706 /* istanbul ignore if */
8707 if (!hasTransition) {
8708 return false;
8709 }
8710 /* istanbul ignore if */
8711 if (this._hasMove) {
8712 return this._hasMove;
8713 }
8714 // Detect whether an element with the move class applied has
8715 // CSS transitions. Since the element may be inside an entering
8716 // transition at this very moment, we make a clone of it and remove
8717 // all other transition classes applied to ensure only the move class
8718 // is applied.
8719 var clone = el.cloneNode();
8720 if (el._transitionClasses) {
8721 el._transitionClasses.forEach(function (cls) {
8722 removeClass(clone, cls);
8723 });
8724 }
8725 addClass(clone, moveClass);
8726 clone.style.display = 'none';
8727 this.$el.appendChild(clone);
8728 var info = getTransitionInfo(clone);
8729 this.$el.removeChild(clone);
8730 return (this._hasMove = info.hasTransform);
8731 }
8732 }
8733};
8734function callPendingCbs(c) {
8735 /* istanbul ignore if */
8736 if (c.elm._moveCb) {
8737 c.elm._moveCb();
8738 }
8739 /* istanbul ignore if */
8740 if (c.elm._enterCb) {
8741 c.elm._enterCb();
8742 }
8743}
8744function recordPosition(c) {
8745 c.data.newPos = c.elm.getBoundingClientRect();
8746}
8747function applyTranslation(c) {
8748 var oldPos = c.data.pos;
8749 var newPos = c.data.newPos;
8750 var dx = oldPos.left - newPos.left;
8751 var dy = oldPos.top - newPos.top;
8752 if (dx || dy) {
8753 c.data.moved = true;
8754 var s = c.elm.style;
8755 s.transform = s.WebkitTransform = "translate(".concat(dx, "px,").concat(dy, "px)");
8756 s.transitionDuration = '0s';
8757 }
8758}
8759
8760var platformComponents = {
8761 Transition: Transition,
8762 TransitionGroup: TransitionGroup
8763};
8764
8765// install platform specific utils
8766Vue.config.mustUseProp = mustUseProp;
8767Vue.config.isReservedTag = isReservedTag;
8768Vue.config.isReservedAttr = isReservedAttr;
8769Vue.config.getTagNamespace = getTagNamespace;
8770Vue.config.isUnknownElement = isUnknownElement;
8771// install platform runtime directives & components
8772extend(Vue.options.directives, platformDirectives);
8773extend(Vue.options.components, platformComponents);
8774// install platform patch function
8775Vue.prototype.__patch__ = inBrowser ? patch : noop;
8776// public mount method
8777Vue.prototype.$mount = function (el, hydrating) {
8778 el = el && inBrowser ? query(el) : undefined;
8779 return mountComponent(this, el, hydrating);
8780};
8781// devtools global hook
8782/* istanbul ignore next */
8783if (inBrowser) {
8784 setTimeout(function () {
8785 if (config.devtools) {
8786 if (devtools) {
8787 devtools.emit('init', Vue);
8788 }
8789 else if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {
8790 // @ts-expect-error
8791 console[console.info ? 'info' : 'log']('Download the Vue Devtools extension for a better development experience:\n' +
8792 'https://github.com/vuejs/vue-devtools');
8793 }
8794 }
8795 if (process.env.NODE_ENV !== 'production' &&
8796 process.env.NODE_ENV !== 'test' &&
8797 config.productionTip !== false &&
8798 typeof console !== 'undefined') {
8799 // @ts-expect-error
8800 console[console.info ? 'info' : 'log']("You are running Vue in development mode.\n" +
8801 "Make sure to turn on production mode when deploying for production.\n" +
8802 "See more tips at https://vuejs.org/guide/deployment.html");
8803 }
8804 }, 0);
8805}
8806
8807export { EffectScope, computed, customRef, Vue as default, defineAsyncComponent, defineComponent, del, effectScope, getCurrentInstance, getCurrentScope, h, inject, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, mergeDefaults, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, provide, proxyRefs, reactive, readonly, ref$1 as ref, set, shallowReactive, shallowReadonly, shallowRef, toRaw, toRef, toRefs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useListeners, useSlots, version, watch, watchEffect, watchPostEffect, watchSyncEffect };