/*! * vue.js v2.7.15 * (c) 2014-2023 evan you * released under the mit license. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalthis !== 'undefined' ? globalthis : global || self, global.vue = factory()); })(this, (function () { 'use strict'; var emptyobject = object.freeze({}); var isarray = array.isarray; // these helpers produce better vm code in js engines due to their // explicitness and function inlining. function isundef(v) { return v === undefined || v === null; } function isdef(v) { return v !== undefined && v !== null; } function istrue(v) { return v === true; } function isfalse(v) { return v === false; } /** * check if value is primitive. */ function isprimitive(value) { return (typeof value === 'string' || typeof value === 'number' || // $flow-disable-line typeof value === 'symbol' || typeof value === 'boolean'); } function isfunction(value) { return typeof value === 'function'; } /** * quick object check - this is primarily used to tell * objects from primitive values when we know the value * is a json-compliant type. */ function isobject(obj) { return obj !== null && typeof obj === 'object'; } /** * get the raw type string of a value, e.g., [object object]. */ var _tostring = object.prototype.tostring; function torawtype(value) { return _tostring.call(value).slice(8, -1); } /** * strict object type check. only returns true * for plain javascript objects. */ function isplainobject(obj) { return _tostring.call(obj) === '[object object]'; } function isregexp(v) { return _tostring.call(v) === '[object regexp]'; } /** * check if val is a valid array index. */ function isvalidarrayindex(val) { var n = parsefloat(string(val)); return n >= 0 && math.floor(n) === n && isfinite(val); } function ispromise(val) { return (isdef(val) && typeof val.then === 'function' && typeof val.catch === 'function'); } /** * convert a value to a string that is actually rendered. */ function tostring(val) { return val == null ? '' : array.isarray(val) || (isplainobject(val) && val.tostring === _tostring) ? json.stringify(val, null, 2) : string(val); } /** * convert an input value to a number for persistence. * if the conversion fails, return original string. */ function tonumber(val) { var n = parsefloat(val); return isnan(n) ? val : n; } /** * make a map and return a function for checking if a key * is in that map. */ function makemap(str, expectslowercase) { var map = object.create(null); var list = str.split(','); for (var i = 0; i < list.length; i++) { map[list[i]] = true; } return expectslowercase ? function (val) { return map[val.tolowercase()]; } : function (val) { return map[val]; }; } /** * check if a tag is a built-in tag. */ var isbuiltintag = makemap('slot,component', true); /** * check if an attribute is a reserved attribute. */ var isreservedattribute = makemap('key,ref,slot,slot-scope,is'); /** * remove an item from an array. */ function remove$2(arr, item) { var len = arr.length; if (len) { // fast path for the only / last item if (item === arr[len - 1]) { arr.length = len - 1; return; } var index = arr.indexof(item); if (index > -1) { return arr.splice(index, 1); } } } /** * check whether an object has the property. */ var hasownproperty = object.prototype.hasownproperty; function hasown(obj, key) { return hasownproperty.call(obj, key); } /** * create a cached version of a pure function. */ function cached(fn) { var cache = object.create(null); return function cachedfn(str) { var hit = cache[str]; return hit || (cache[str] = fn(str)); }; } /** * camelize a hyphen-delimited string. */ var camelizere = /-(\w)/g; var camelize = cached(function (str) { return str.replace(camelizere, function (_, c) { return (c ? c.touppercase() : ''); }); }); /** * capitalize a string. */ var capitalize = cached(function (str) { return str.charat(0).touppercase() + str.slice(1); }); /** * hyphenate a camelcase string. */ var hyphenatere = /\b([a-z])/g; var hyphenate = cached(function (str) { return str.replace(hyphenatere, '-$1').tolowercase(); }); /** * simple bind polyfill for environments that do not support it, * e.g., phantomjs 1.x. technically, we don't need this anymore * since native bind is now performant enough in most browsers. * but removing it would mean breaking code that was able to run in * phantomjs 1.x, so this must be kept for backward compatibility. */ /* istanbul ignore next */ function polyfillbind(fn, ctx) { function boundfn(a) { var l = arguments.length; return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx); } boundfn._length = fn.length; return boundfn; } function nativebind(fn, ctx) { return fn.bind(ctx); } // @ts-expect-error bind cannot be `undefined` var bind$1 = function.prototype.bind ? nativebind : polyfillbind; /** * convert an array-like object to a real array. */ function toarray(list, start) { start = start || 0; var i = list.length - start; var ret = new array(i); while (i--) { ret[i] = list[i + start]; } return ret; } /** * mix properties into target object. */ function extend(to, _from) { for (var key in _from) { to[key] = _from[key]; } return to; } /** * merge an array of objects into a single object. */ function toobject(arr) { var res = {}; for (var i = 0; i < arr.length; i++) { if (arr[i]) { extend(res, arr[i]); } } return res; } /* eslint-disable no-unused-vars */ /** * perform no operation. * stubbing args to make flow happy without leaving useless transpiled code * with ...rest (https://flow.org/blog/2017/05/07/strict-function-call-arity/). */ function noop(a, b, c) { } /** * always return false. */ var no = function (a, b, c) { return false; }; /* eslint-enable no-unused-vars */ /** * return the same value. */ var identity = function (_) { return _; }; /** * generate a string containing static keys from compiler modules. */ function genstatickeys$1(modules) { return modules .reduce(function (keys, m) { return keys.concat(m.statickeys || []); }, []) .join(','); } /** * check if two values are loosely equal - that is, * if they are plain objects, do they have the same shape? */ function looseequal(a, b) { if (a === b) return true; var isobjecta = isobject(a); var isobjectb = isobject(b); if (isobjecta && isobjectb) { try { var isarraya = array.isarray(a); var isarrayb = array.isarray(b); if (isarraya && isarrayb) { return (a.length === b.length && a.every(function (e, i) { return looseequal(e, b[i]); })); } else if (a instanceof date && b instanceof date) { return a.gettime() === b.gettime(); } else if (!isarraya && !isarrayb) { var keysa = object.keys(a); var keysb = object.keys(b); return (keysa.length === keysb.length && keysa.every(function (key) { return looseequal(a[key], b[key]); })); } else { /* istanbul ignore next */ return false; } } catch (e) { /* istanbul ignore next */ return false; } } else if (!isobjecta && !isobjectb) { return string(a) === string(b); } else { return false; } } /** * return the first index at which a loosely equal value can be * found in the array (if value is a plain object, the array must * contain an object of the same shape), or -1 if it is not present. */ function looseindexof(arr, val) { for (var i = 0; i < arr.length; i++) { if (looseequal(arr[i], val)) return i; } return -1; } /** * ensure a function is called only once. */ function once(fn) { var called = false; return function () { if (!called) { called = true; fn.apply(this, arguments); } }; } // https://developer.mozilla.org/en-us/docs/web/javascript/reference/global_objects/object/is#polyfill function haschanged(x, y) { if (x === y) { return x === 0 && 1 / x !== 1 / y; } else { return x === x || y === y; } } var ssr_attr = 'data-server-rendered'; var asset_types = ['component', 'directive', 'filter']; var lifecycle_hooks = [ 'beforecreate', 'created', 'beforemount', 'mounted', 'beforeupdate', 'updated', 'beforedestroy', 'destroyed', 'activated', 'deactivated', 'errorcaptured', 'serverprefetch', 'rendertracked', 'rendertriggered' ]; var config = { /** * option merge strategies (used in core/util/options) */ // $flow-disable-line optionmergestrategies: object.create(null), /** * whether to suppress warnings. */ silent: false, /** * show production mode tip message on boot? */ productiontip: true, /** * whether to enable devtools */ devtools: true, /** * whether to record perf */ performance: false, /** * error handler for watcher errors */ errorhandler: null, /** * warn handler for watcher warns */ warnhandler: null, /** * ignore certain custom elements */ ignoredelements: [], /** * custom user key aliases for v-on */ // $flow-disable-line keycodes: object.create(null), /** * check if a tag is reserved so that it cannot be registered as a * component. this is platform-dependent and may be overwritten. */ isreservedtag: no, /** * check if an attribute is reserved so that it cannot be used as a component * prop. this is platform-dependent and may be overwritten. */ isreservedattr: no, /** * check if a tag is an unknown element. * platform-dependent. */ isunknownelement: no, /** * get the namespace of an element */ gettagnamespace: noop, /** * parse the real tag name for the specific platform. */ parseplatformtagname: identity, /** * check if an attribute must be bound using property, e.g. value * platform-dependent. */ mustuseprop: no, /** * perform updates asynchronously. intended to be used by vue test utils * this will significantly reduce performance if set to false. */ async: true, /** * exposed for legacy reasons */ _lifecyclehooks: lifecycle_hooks }; /** * unicode letters used for parsing html tags, component names and property paths. * using https://www.w3.org/tr/html53/semantics-scripting.html#potentialcustomelementname * skipping \u10000-\ueffff due to it freezing up phantomjs */ var 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/; /** * check if a string starts with $ or _ */ function isreserved(str) { var c = (str + '').charcodeat(0); return c === 0x24 || c === 0x5f; } /** * define a property. */ function def(obj, key, val, enumerable) { object.defineproperty(obj, key, { value: val, enumerable: !!enumerable, writable: true, configurable: true }); } /** * parse simple path. */ var bailre = new regexp("[^".concat(unicoderegexp.source, ".$_\\d]")); function parsepath(path) { if (bailre.test(path)) { return; } var segments = path.split('.'); return function (obj) { for (var i = 0; i < segments.length; i++) { if (!obj) return; obj = obj[segments[i]]; } return obj; }; } // can we use __proto__? var hasproto = '__proto__' in {}; // browser environment sniffing var inbrowser = typeof window !== 'undefined'; var ua = inbrowser && window.navigator.useragent.tolowercase(); var isie = ua && /msie|trident/.test(ua); var isie9 = ua && ua.indexof('msie 9.0') > 0; var isedge = ua && ua.indexof('edge/') > 0; ua && ua.indexof('android') > 0; var isios = ua && /iphone|ipad|ipod|ios/.test(ua); ua && /chrome\/\d+/.test(ua) && !isedge; ua && /phantomjs/.test(ua); var isff = ua && ua.match(/firefox\/(\d+)/); // firefox has a "watch" function on object.prototype... // @ts-expect-error firebox support var nativewatch = {}.watch; var supportspassive = false; if (inbrowser) { try { var opts = {}; object.defineproperty(opts, 'passive', { get: function () { /* istanbul ignore next */ supportspassive = true; } }); // https://github.com/facebook/flow/issues/285 window.addeventlistener('test-passive', null, opts); } catch (e) { } } // this needs to be lazy-evaled because vue may be required before // vue-server-renderer can set vue_env var _isserver; var isserverrendering = function () { if (_isserver === undefined) { /* istanbul ignore if */ if (!inbrowser && typeof global !== 'undefined') { // detect presence of vue-server-renderer and avoid // webpack shimming the process _isserver = global['process'] && global['process'].env.vue_env === 'server'; } else { _isserver = false; } } return _isserver; }; // detect devtools var devtools = inbrowser && window.__vue_devtools_global_hook__; /* istanbul ignore next */ function isnative(ctor) { return typeof ctor === 'function' && /native code/.test(ctor.tostring()); } var hassymbol = typeof symbol !== 'undefined' && isnative(symbol) && typeof reflect !== 'undefined' && isnative(reflect.ownkeys); var _set; // $flow-disable-line /* istanbul ignore if */ if (typeof set !== 'undefined' && isnative(set)) { // use native set when available. _set = set; } else { // a non-standard set polyfill that only works with primitive keys. _set = /** @class */ (function () { function set() { this.set = object.create(null); } set.prototype.has = function (key) { return this.set[key] === true; }; set.prototype.add = function (key) { this.set[key] = true; }; set.prototype.clear = function () { this.set = object.create(null); }; return set; }()); } var currentinstance = null; /** * this is exposed for compatibility with v3 (e.g. some functions in vueuse * relies on it). do not use this internally, just use `currentinstance`. * * @internal this function needs manual type declaration because it relies * on previously manually authored types from vue 2 */ function getcurrentinstance() { return currentinstance && { proxy: currentinstance }; } /** * @internal */ function setcurrentinstance(vm) { if (vm === void 0) { vm = null; } if (!vm) currentinstance && currentinstance._scope.off(); currentinstance = vm; vm && vm._scope.on(); } /** * @internal */ var vnode = /** @class */ (function () { function vnode(tag, data, children, text, elm, context, componentoptions, asyncfactory) { this.tag = tag; this.data = data; this.children = children; this.text = text; this.elm = elm; this.ns = undefined; this.context = context; this.fncontext = undefined; this.fnoptions = undefined; this.fnscopeid = undefined; this.key = data && data.key; this.componentoptions = componentoptions; this.componentinstance = undefined; this.parent = undefined; this.raw = false; this.isstatic = false; this.isrootinsert = true; this.iscomment = false; this.iscloned = false; this.isonce = false; this.asyncfactory = asyncfactory; this.asyncmeta = undefined; this.isasyncplaceholder = false; } object.defineproperty(vnode.prototype, "child", { // deprecated: alias for componentinstance for backwards compat. /* istanbul ignore next */ get: function () { return this.componentinstance; }, enumerable: false, configurable: true }); return vnode; }()); var createemptyvnode = function (text) { if (text === void 0) { text = ''; } var node = new vnode(); node.text = text; node.iscomment = true; return node; }; function createtextvnode(val) { return new vnode(undefined, undefined, undefined, string(val)); } // optimized shallow clone // used for static nodes and slot nodes because they may be reused across // multiple renders, cloning them avoids errors when dom manipulations rely // on their elm reference. function clonevnode(vnode) { var cloned = new vnode(vnode.tag, vnode.data, // #7975 // clone children array to avoid mutating original in case of cloning // a child. vnode.children && vnode.children.slice(), vnode.text, vnode.elm, vnode.context, vnode.componentoptions, vnode.asyncfactory); cloned.ns = vnode.ns; cloned.isstatic = vnode.isstatic; cloned.key = vnode.key; cloned.iscomment = vnode.iscomment; cloned.fncontext = vnode.fncontext; cloned.fnoptions = vnode.fnoptions; cloned.fnscopeid = vnode.fnscopeid; cloned.asyncmeta = vnode.asyncmeta; cloned.iscloned = true; return cloned; } /* not type checking this file because flow doesn't play well with proxy */ var initproxy; { var allowedglobals_1 = makemap('infinity,undefined,nan,isfinite,isnan,' + 'parsefloat,parseint,decodeuri,decodeuricomponent,encodeuri,encodeuricomponent,' + 'math,number,date,array,object,boolean,string,regexp,map,set,json,intl,bigint,' + 'require' // for webpack/browserify ); var warnnonpresent_1 = function (target, key) { warn$2("property or method \"".concat(key, "\" is not defined on the instance but ") + 'referenced during render. make sure that this property is reactive, ' + 'either in the data option, or for class-based components, by ' + 'initializing the property. ' + 'see: https://v2.vuejs.org/v2/guide/reactivity.html#declaring-reactive-properties.', target); }; var warnreservedprefix_1 = function (target, key) { warn$2("property \"".concat(key, "\" must be accessed with \"$data.").concat(key, "\" because ") + 'properties starting with "$" or "_" are not proxied in the vue instance to ' + 'prevent conflicts with vue internals. ' + 'see: https://v2.vuejs.org/v2/api/#data', target); }; var hasproxy_1 = typeof proxy !== 'undefined' && isnative(proxy); if (hasproxy_1) { var isbuiltinmodifier_1 = makemap('stop,prevent,self,ctrl,shift,alt,meta,exact'); config.keycodes = new proxy(config.keycodes, { set: function (target, key, value) { if (isbuiltinmodifier_1(key)) { warn$2("avoid overwriting built-in modifier in config.keycodes: .".concat(key)); return false; } else { target[key] = value; return true; } } }); } var hashandler_1 = { has: function (target, key) { var has = key in target; var isallowed = allowedglobals_1(key) || (typeof key === 'string' && key.charat(0) === '_' && !(key in target.$data)); if (!has && !isallowed) { if (key in target.$data) warnreservedprefix_1(target, key); else warnnonpresent_1(target, key); } return has || !isallowed; } }; var gethandler_1 = { get: function (target, key) { if (typeof key === 'string' && !(key in target)) { if (key in target.$data) warnreservedprefix_1(target, key); else warnnonpresent_1(target, key); } return target[key]; } }; initproxy = function initproxy(vm) { if (hasproxy_1) { // determine which proxy handler to use var options = vm.$options; var handlers = options.render && options.render._withstripped ? gethandler_1 : hashandler_1; vm._renderproxy = new proxy(vm, handlers); } else { vm._renderproxy = vm; } }; } /****************************************************************************** copyright (c) microsoft corporation. permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. the software is provided "as is" and the author disclaims all warranties with regard to this software including all implied warranties of merchantability and fitness. in no event shall the author be liable for any special, direct, indirect, or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of this software. ***************************************************************************** */ var __assign = function() { __assign = object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (object.prototype.hasownproperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var uid$2 = 0; var pendingcleanupdeps = []; var cleanupdeps = function () { for (var i = 0; i < pendingcleanupdeps.length; i++) { var dep = pendingcleanupdeps[i]; dep.subs = dep.subs.filter(function (s) { return s; }); dep._pending = false; } pendingcleanupdeps.length = 0; }; /** * a dep is an observable that can have multiple * directives subscribing to it. * @internal */ var dep = /** @class */ (function () { function dep() { // pending subs cleanup this._pending = false; this.id = uid$2++; this.subs = []; } dep.prototype.addsub = function (sub) { this.subs.push(sub); }; dep.prototype.removesub = function (sub) { // #12696 deps with massive amount of subscribers are extremely slow to // clean up in chromium // to workaround this, we unset the sub for now, and clear them on // next scheduler flush. this.subs[this.subs.indexof(sub)] = null; if (!this._pending) { this._pending = true; pendingcleanupdeps.push(this); } }; dep.prototype.depend = function (info) { if (dep.target) { dep.target.adddep(this); if (info && dep.target.ontrack) { dep.target.ontrack(__assign({ effect: dep.target }, info)); } } }; dep.prototype.notify = function (info) { // stabilize the subscriber list first var subs = this.subs.filter(function (s) { return s; }); if (!config.async) { // subs aren't sorted in scheduler if not running async // we need to sort them now to make sure they fire in correct // order subs.sort(function (a, b) { return a.id - b.id; }); } for (var i = 0, l = subs.length; i < l; i++) { var sub = subs[i]; if (info) { sub.ontrigger && sub.ontrigger(__assign({ effect: subs[i] }, info)); } sub.update(); } }; return dep; }()); // the current target watcher being evaluated. // this is globally unique because only one watcher // can be evaluated at a time. dep.target = null; var targetstack = []; function pushtarget(target) { targetstack.push(target); dep.target = target; } function poptarget() { targetstack.pop(); dep.target = targetstack[targetstack.length - 1]; } /* * not type checking this file because flow doesn't play well with * dynamically accessing methods on array prototype */ var arrayproto = array.prototype; var arraymethods = object.create(arrayproto); var methodstopatch = [ 'push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse' ]; /** * intercept mutating methods and emit events */ methodstopatch.foreach(function (method) { // cache original method var original = arrayproto[method]; def(arraymethods, method, function mutator() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } var result = original.apply(this, args); var ob = this.__ob__; var inserted; switch (method) { case 'push': case 'unshift': inserted = args; break; case 'splice': inserted = args.slice(2); break; } if (inserted) ob.observearray(inserted); // notify change { ob.dep.notify({ type: "array mutation" /* triggeroptypes.array_mutation */, target: this, key: method }); } return result; }); }); var arraykeys = object.getownpropertynames(arraymethods); var no_initial_value = {}; /** * in some cases we may want to disable observation inside a component's * update computation. */ var shouldobserve = true; function toggleobserving(value) { shouldobserve = value; } // ssr mock dep var mockdep = { notify: noop, depend: noop, addsub: noop, removesub: noop }; /** * observer class that is attached to each observed * object. once attached, the observer converts the target * object's property keys into getter/setters that * collect dependencies and dispatch updates. */ var observer = /** @class */ (function () { function observer(value, shallow, mock) { if (shallow === void 0) { shallow = false; } if (mock === void 0) { mock = false; } this.value = value; this.shallow = shallow; this.mock = mock; // this.value = value this.dep = mock ? mockdep : new dep(); this.vmcount = 0; def(value, '__ob__', this); if (isarray(value)) { if (!mock) { if (hasproto) { value.__proto__ = arraymethods; /* eslint-enable no-proto */ } else { for (var i = 0, l = arraykeys.length; i < l; i++) { var key = arraykeys[i]; def(value, key, arraymethods[key]); } } } if (!shallow) { this.observearray(value); } } else { /** * walk through all properties and convert them into * getter/setters. this method should only be called when * value type is object. */ var keys = object.keys(value); for (var i = 0; i < keys.length; i++) { var key = keys[i]; definereactive(value, key, no_initial_value, undefined, shallow, mock); } } } /** * observe a list of array items. */ observer.prototype.observearray = function (value) { for (var i = 0, l = value.length; i < l; i++) { observe(value[i], false, this.mock); } }; return observer; }()); // helpers /** * attempt to create an observer instance for a value, * returns the new observer if successfully observed, * or the existing observer if the value already has one. */ function observe(value, shallow, ssrmockreactivity) { if (value && hasown(value, '__ob__') && value.__ob__ instanceof observer) { return value.__ob__; } if (shouldobserve && (ssrmockreactivity || !isserverrendering()) && (isarray(value) || isplainobject(value)) && object.isextensible(value) && !value.__v_skip /* reactiveflags.skip */ && !isref(value) && !(value instanceof vnode)) { return new observer(value, shallow, ssrmockreactivity); } } /** * define a reactive property on an object. */ function definereactive(obj, key, val, customsetter, shallow, mock) { var dep = new dep(); var property = object.getownpropertydescriptor(obj, key); if (property && property.configurable === false) { return; } // cater for pre-defined getter/setters var getter = property && property.get; var setter = property && property.set; if ((!getter || setter) && (val === no_initial_value || arguments.length === 2)) { val = obj[key]; } var childob = !shallow && observe(val, false, mock); object.defineproperty(obj, key, { enumerable: true, configurable: true, get: function reactivegetter() { var value = getter ? getter.call(obj) : val; if (dep.target) { { dep.depend({ target: obj, type: "get" /* trackoptypes.get */, key: key }); } if (childob) { childob.dep.depend(); if (isarray(value)) { dependarray(value); } } } return isref(value) && !shallow ? value.value : value; }, set: function reactivesetter(newval) { var value = getter ? getter.call(obj) : val; if (!haschanged(value, newval)) { return; } if (customsetter) { customsetter(); } if (setter) { setter.call(obj, newval); } else if (getter) { // #7981: for accessor properties without setter return; } else if (!shallow && isref(value) && !isref(newval)) { value.value = newval; return; } else { val = newval; } childob = !shallow && observe(newval, false, mock); { dep.notify({ type: "set" /* triggeroptypes.set */, target: obj, key: key, newvalue: newval, oldvalue: value }); } } }); return dep; } function set(target, key, val) { if ((isundef(target) || isprimitive(target))) { warn$2("cannot set reactive property on undefined, null, or primitive value: ".concat(target)); } if (isreadonly(target)) { warn$2("set operation on key \"".concat(key, "\" failed: target is readonly.")); return; } var ob = target.__ob__; if (isarray(target) && isvalidarrayindex(key)) { target.length = math.max(target.length, key); target.splice(key, 1, val); // when mocking for ssr, array methods are not hijacked if (ob && !ob.shallow && ob.mock) { observe(val, false, true); } return val; } if (key in target && !(key in object.prototype)) { target[key] = val; return val; } if (target._isvue || (ob && ob.vmcount)) { warn$2('avoid adding reactive properties to a vue instance or its root $data ' + 'at runtime - declare it upfront in the data option.'); return val; } if (!ob) { target[key] = val; return val; } definereactive(ob.value, key, val, undefined, ob.shallow, ob.mock); { ob.dep.notify({ type: "add" /* triggeroptypes.add */, target: target, key: key, newvalue: val, oldvalue: undefined }); } return val; } function del(target, key) { if ((isundef(target) || isprimitive(target))) { warn$2("cannot delete reactive property on undefined, null, or primitive value: ".concat(target)); } if (isarray(target) && isvalidarrayindex(key)) { target.splice(key, 1); return; } var ob = target.__ob__; if (target._isvue || (ob && ob.vmcount)) { warn$2('avoid deleting properties on a vue instance or its root $data ' + '- just set it to null.'); return; } if (isreadonly(target)) { warn$2("delete operation on key \"".concat(key, "\" failed: target is readonly.")); return; } if (!hasown(target, key)) { return; } delete target[key]; if (!ob) { return; } { ob.dep.notify({ type: "delete" /* triggeroptypes.delete */, target: target, key: key }); } } /** * collect dependencies on array elements when the array is touched, since * we cannot intercept array element access like property getters. */ function dependarray(value) { for (var e = void 0, i = 0, l = value.length; i < l; i++) { e = value[i]; if (e && e.__ob__) { e.__ob__.dep.depend(); } if (isarray(e)) { dependarray(e); } } } function reactive(target) { makereactive(target, false); return target; } /** * return a shallowly-reactive copy of the original object, where only the root * level properties are reactive. it also does not auto-unwrap refs (even at the * root level). */ function shallowreactive(target) { makereactive(target, true); def(target, "__v_isshallow" /* reactiveflags.is_shallow */, true); return target; } function makereactive(target, shallow) { // if trying to observe a readonly proxy, return the readonly version. if (!isreadonly(target)) { { if (isarray(target)) { warn$2("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.")); } var existingob = target && target.__ob__; if (existingob && existingob.shallow !== shallow) { warn$2("target is already a ".concat(existingob.shallow ? "" : "non-", "shallow reactive object, and cannot be converted to ").concat(shallow ? "" : "non-", "shallow.")); } } var ob = observe(target, shallow, isserverrendering() /* ssr mock reactivity */); if (!ob) { if (target == null || isprimitive(target)) { warn$2("value cannot be made reactive: ".concat(string(target))); } if (iscollectiontype(target)) { warn$2("vue 2 does not support reactive collection types such as map or set."); } } } } function isreactive(value) { if (isreadonly(value)) { return isreactive(value["__v_raw" /* reactiveflags.raw */]); } return !!(value && value.__ob__); } function isshallow(value) { return !!(value && value.__v_isshallow); } function isreadonly(value) { return !!(value && value.__v_isreadonly); } function isproxy(value) { return isreactive(value) || isreadonly(value); } function toraw(observed) { var raw = observed && observed["__v_raw" /* reactiveflags.raw */]; return raw ? toraw(raw) : observed; } function markraw(value) { // non-extensible objects won't be observed anyway if (object.isextensible(value)) { def(value, "__v_skip" /* reactiveflags.skip */, true); } return value; } /** * @internal */ function iscollectiontype(value) { var type = torawtype(value); return (type === 'map' || type === 'weakmap' || type === 'set' || type === 'weakset'); } /** * @internal */ var refflag = "__v_isref"; function isref(r) { return !!(r && r.__v_isref === true); } function ref$1(value) { return createref(value, false); } function shallowref(value) { return createref(value, true); } function createref(rawvalue, shallow) { if (isref(rawvalue)) { return rawvalue; } var ref = {}; def(ref, refflag, true); def(ref, "__v_isshallow" /* reactiveflags.is_shallow */, shallow); def(ref, 'dep', definereactive(ref, 'value', rawvalue, null, shallow, isserverrendering())); return ref; } function triggerref(ref) { if (!ref.dep) { warn$2("received object is not a triggerable ref."); } { ref.dep && ref.dep.notify({ type: "set" /* triggeroptypes.set */, target: ref, key: 'value' }); } } function unref(ref) { return isref(ref) ? ref.value : ref; } function proxyrefs(objectwithrefs) { if (isreactive(objectwithrefs)) { return objectwithrefs; } var proxy = {}; var keys = object.keys(objectwithrefs); for (var i = 0; i < keys.length; i++) { proxywithrefunwrap(proxy, objectwithrefs, keys[i]); } return proxy; } function proxywithrefunwrap(target, source, key) { object.defineproperty(target, key, { enumerable: true, configurable: true, get: function () { var val = source[key]; if (isref(val)) { return val.value; } else { var ob = val && val.__ob__; if (ob) ob.dep.depend(); return val; } }, set: function (value) { var oldvalue = source[key]; if (isref(oldvalue) && !isref(value)) { oldvalue.value = value; } else { source[key] = value; } } }); } function customref(factory) { var dep = new dep(); var _a = factory(function () { { dep.depend({ target: ref, type: "get" /* trackoptypes.get */, key: 'value' }); } }, function () { { dep.notify({ target: ref, type: "set" /* triggeroptypes.set */, key: 'value' }); } }), get = _a.get, set = _a.set; var ref = { get value() { return get(); }, set value(newval) { set(newval); } }; def(ref, refflag, true); return ref; } function torefs(object) { if (!isreactive(object)) { warn$2("torefs() expects a reactive object but received a plain one."); } var ret = isarray(object) ? new array(object.length) : {}; for (var key in object) { ret[key] = toref(object, key); } return ret; } function toref(object, key, defaultvalue) { var val = object[key]; if (isref(val)) { return val; } var ref = { get value() { var val = object[key]; return val === undefined ? defaultvalue : val; }, set value(newval) { object[key] = newval; } }; def(ref, refflag, true); return ref; } var rawtoreadonlyflag = "__v_rawtoreadonly"; var rawtoshallowreadonlyflag = "__v_rawtoshallowreadonly"; function readonly(target) { return createreadonly(target, false); } function createreadonly(target, shallow) { if (!isplainobject(target)) { { if (isarray(target)) { warn$2("vue 2 does not support readonly arrays."); } else if (iscollectiontype(target)) { warn$2("vue 2 does not support readonly collection types such as map or set."); } else { warn$2("value cannot be made readonly: ".concat(typeof target)); } } return target; } if (!object.isextensible(target)) { warn$2("vue 2 does not support creating readonly proxy for non-extensible object."); } // already a readonly object if (isreadonly(target)) { return target; } // already has a readonly proxy var existingflag = shallow ? rawtoshallowreadonlyflag : rawtoreadonlyflag; var existingproxy = target[existingflag]; if (existingproxy) { return existingproxy; } var proxy = object.create(object.getprototypeof(target)); def(target, existingflag, proxy); def(proxy, "__v_isreadonly" /* reactiveflags.is_readonly */, true); def(proxy, "__v_raw" /* reactiveflags.raw */, target); if (isref(target)) { def(proxy, refflag, true); } if (shallow || isshallow(target)) { def(proxy, "__v_isshallow" /* reactiveflags.is_shallow */, true); } var keys = object.keys(target); for (var i = 0; i < keys.length; i++) { definereadonlyproperty(proxy, target, keys[i], shallow); } return proxy; } function definereadonlyproperty(proxy, target, key, shallow) { object.defineproperty(proxy, key, { enumerable: true, configurable: true, get: function () { var val = target[key]; return shallow || !isplainobject(val) ? val : readonly(val); }, set: function () { warn$2("set operation on key \"".concat(key, "\" failed: target is readonly.")); } }); } /** * returns a reactive-copy of the original object, where only the root level * properties are readonly, and does not unwrap refs nor recursively convert * returned properties. * this is used for creating the props proxy object for stateful components. */ function shallowreadonly(target) { return createreadonly(target, true); } function computed(getteroroptions, debugoptions) { var getter; var setter; var onlygetter = isfunction(getteroroptions); if (onlygetter) { getter = getteroroptions; setter = function () { warn$2('write operation failed: computed value is readonly'); } ; } else { getter = getteroroptions.get; setter = getteroroptions.set; } var watcher = isserverrendering() ? null : new watcher(currentinstance, getter, noop, { lazy: true }); if (watcher && debugoptions) { watcher.ontrack = debugoptions.ontrack; watcher.ontrigger = debugoptions.ontrigger; } var ref = { // some libs rely on the presence effect for checking computed refs // from normal refs, but the implementation doesn't matter effect: watcher, get value() { if (watcher) { if (watcher.dirty) { watcher.evaluate(); } if (dep.target) { if (dep.target.ontrack) { dep.target.ontrack({ effect: dep.target, target: ref, type: "get" /* trackoptypes.get */, key: 'value' }); } watcher.depend(); } return watcher.value; } else { return getter(); } }, set value(newval) { setter(newval); } }; def(ref, refflag, true); def(ref, "__v_isreadonly" /* reactiveflags.is_readonly */, onlygetter); return ref; } var mark; var measure; { var perf_1 = inbrowser && window.performance; /* istanbul ignore if */ if (perf_1 && // @ts-ignore perf_1.mark && // @ts-ignore perf_1.measure && // @ts-ignore perf_1.clearmarks && // @ts-ignore perf_1.clearmeasures) { mark = function (tag) { return perf_1.mark(tag); }; measure = function (name, starttag, endtag) { perf_1.measure(name, starttag, endtag); perf_1.clearmarks(starttag); perf_1.clearmarks(endtag); // perf.clearmeasures(name) }; } } var normalizeevent = cached(function (name) { var passive = name.charat(0) === '&'; name = passive ? name.slice(1) : name; var once = name.charat(0) === '~'; // prefixed last, checked first name = once ? name.slice(1) : name; var capture = name.charat(0) === '!'; name = capture ? name.slice(1) : name; return { name: name, once: once, capture: capture, passive: passive }; }); function createfninvoker(fns, vm) { function invoker() { var fns = invoker.fns; if (isarray(fns)) { var cloned = fns.slice(); for (var i = 0; i < cloned.length; i++) { invokewitherrorhandling(cloned[i], null, arguments, vm, "v-on handler"); } } else { // return handler return value for single handlers return invokewitherrorhandling(fns, null, arguments, vm, "v-on handler"); } } invoker.fns = fns; return invoker; } function updatelisteners(on, oldon, add, remove, createoncehandler, vm) { var name, cur, old, event; for (name in on) { cur = on[name]; old = oldon[name]; event = normalizeevent(name); if (isundef(cur)) { warn$2("invalid handler for event \"".concat(event.name, "\": got ") + string(cur), vm); } else if (isundef(old)) { if (isundef(cur.fns)) { cur = on[name] = createfninvoker(cur, vm); } if (istrue(event.once)) { cur = on[name] = createoncehandler(event.name, cur, event.capture); } add(event.name, cur, event.capture, event.passive, event.params); } else if (cur !== old) { old.fns = cur; on[name] = old; } } for (name in oldon) { if (isundef(on[name])) { event = normalizeevent(name); remove(event.name, oldon[name], event.capture); } } } function mergevnodehook(def, hookkey, hook) { if (def instanceof vnode) { def = def.data.hook || (def.data.hook = {}); } var invoker; var oldhook = def[hookkey]; function wrappedhook() { hook.apply(this, arguments); // important: remove merged hook to ensure it's called only once // and prevent memory leak remove$2(invoker.fns, wrappedhook); } if (isundef(oldhook)) { // no existing hook invoker = createfninvoker([wrappedhook]); } else { /* istanbul ignore if */ if (isdef(oldhook.fns) && istrue(oldhook.merged)) { // already a merged invoker invoker = oldhook; invoker.fns.push(wrappedhook); } else { // existing plain hook invoker = createfninvoker([oldhook, wrappedhook]); } } invoker.merged = true; def[hookkey] = invoker; } function extractpropsfromvnodedata(data, ctor, tag) { // we are only extracting raw values here. // validation and default values are handled in the child // component itself. var propoptions = ctor.options.props; if (isundef(propoptions)) { return; } var res = {}; var attrs = data.attrs, props = data.props; if (isdef(attrs) || isdef(props)) { for (var key in propoptions) { var altkey = hyphenate(key); { var keyinlowercase = key.tolowercase(); if (key !== keyinlowercase && attrs && hasown(attrs, keyinlowercase)) { tip("prop \"".concat(keyinlowercase, "\" is passed to component ") + "".concat(formatcomponentname( // @ts-expect-error tag is string tag || ctor), ", but the declared prop name is") + " \"".concat(key, "\". ") + "note that html attributes are case-insensitive and camelcased " + "props need to use their kebab-case equivalents when using in-dom " + "templates. you should probably use \"".concat(altkey, "\" instead of \"").concat(key, "\".")); } } checkprop(res, props, key, altkey, true) || checkprop(res, attrs, key, altkey, false); } } return res; } function checkprop(res, hash, key, altkey, preserve) { if (isdef(hash)) { if (hasown(hash, key)) { res[key] = hash[key]; if (!preserve) { delete hash[key]; } return true; } else if (hasown(hash, altkey)) { res[key] = hash[altkey]; if (!preserve) { delete hash[altkey]; } return true; } } return false; } // the template compiler attempts to minimize the need for normalization by // statically analyzing the template at compile time. // // for plain html markup, normalization can be completely skipped because the // generated render function is guaranteed to return array. there are // two cases where extra normalization is needed: // 1. when the children contains components - because a functional component // may return an array instead of a single root. in this case, just a simple // normalization is needed - if any child is an array, we flatten the whole // thing with array.prototype.concat. it is guaranteed to be only 1-level deep // because functional components already normalize their own children. function simplenormalizechildren(children) { for (var i = 0; i < children.length; i++) { if (isarray(children[i])) { return array.prototype.concat.apply([], children); } } return children; } // 2. when the children contains constructs that always generated nested arrays, // e.g.