1/******/ (function(modules) { // webpackBootstrap 2/******/ // install a JSONP callback for chunk loading 3/******/ var parentJsonpFunction = window["pluginWebpack"]; 4/******/ window["pluginWebpack"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) { 5/******/ // add "moreModules" to the modules object, 6/******/ // then flag all "chunkIds" as loaded and fire callback 7/******/ var moduleId, chunkId, i = 0, resolves = [], result; 8/******/ for(;i < chunkIds.length; i++) { 9/******/ chunkId = chunkIds[i]; 10/******/ if(installedChunks[chunkId]) { 11/******/ resolves.push(installedChunks[chunkId][0]); 12/******/ } 13/******/ installedChunks[chunkId] = 0; 14/******/ } 15/******/ for(moduleId in moreModules) { 16/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { 17/******/ modules[moduleId] = moreModules[moduleId]; 18/******/ } 19/******/ } 20/******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules); 21/******/ while(resolves.length) { 22/******/ resolves.shift()(); 23/******/ } 24/******/ if(executeModules) { 25/******/ for(i=0; i < executeModules.length; i++) { 26/******/ result = __webpack_require__(__webpack_require__.s = executeModules[i]); 27/******/ } 28/******/ } 29/******/ return result; 30/******/ }; 31/******/ 32/******/ // The module cache 33/******/ var installedModules = {}; 34/******/ 35/******/ // objects to store loaded and loading chunks 36/******/ var installedChunks = { 37/******/ 2: 0 38/******/ }; 39/******/ 40/******/ // The require function 41/******/ function __webpack_require__(moduleId) { 42/******/ 43/******/ // Check if module is in cache 44/******/ if(installedModules[moduleId]) { 45/******/ return installedModules[moduleId].exports; 46/******/ } 47/******/ // Create a new module (and put it into the cache) 48/******/ var module = installedModules[moduleId] = { 49/******/ i: moduleId, 50/******/ l: false, 51/******/ exports: {} 52/******/ }; 53/******/ 54/******/ // Execute the module function 55/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 56/******/ 57/******/ // Flag the module as loaded 58/******/ module.l = true; 59/******/ 60/******/ // Return the exports of the module 61/******/ return module.exports; 62/******/ } 63/******/ 64/******/ 65/******/ // expose the modules object (__webpack_modules__) 66/******/ __webpack_require__.m = modules; 67/******/ 68/******/ // expose the module cache 69/******/ __webpack_require__.c = installedModules; 70/******/ 71/******/ // define getter function for harmony exports 72/******/ __webpack_require__.d = function(exports, name, getter) { 73/******/ if(!__webpack_require__.o(exports, name)) { 74/******/ Object.defineProperty(exports, name, { 75/******/ configurable: false, 76/******/ enumerable: true, 77/******/ get: getter 78/******/ }); 79/******/ } 80/******/ }; 81/******/ 82/******/ // getDefaultExport function for compatibility with non-harmony modules 83/******/ __webpack_require__.n = function(module) { 84/******/ var getter = module && module.__esModule ? 85/******/ function getDefault() { return module['default']; } : 86/******/ function getModuleExports() { return module; }; 87/******/ __webpack_require__.d(getter, 'a', getter); 88/******/ return getter; 89/******/ }; 90/******/ 91/******/ // Object.prototype.hasOwnProperty.call 92/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 93/******/ 94/******/ // __webpack_public_path__ 95/******/ __webpack_require__.p = ""; 96/******/ 97/******/ // on error function for async loading 98/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; }; 99/******/ 100/******/ // Load entry module and return exports 101/******/ return __webpack_require__(__webpack_require__.s = 41); 102/******/ }) 103/************************************************************************/ 104/******/ ([ 105/* 0 */ 106/***/ (function(module, exports, __webpack_require__) { 107 108"use strict"; 109 110 111var bind = __webpack_require__(7); 112var isBuffer = __webpack_require__(22); 113 114/*global toString:true*/ 115 116// utils is a library of generic helper functions non-specific to axios 117 118var toString = Object.prototype.toString; 119 120/** 121 * Determine if a value is an Array 122 * 123 * @param {Object} val The value to test 124 * @returns {boolean} True if value is an Array, otherwise false 125 */ 126function isArray(val) { 127 return toString.call(val) === '[object Array]'; 128} 129
vendor: 5,985 bytes, lines 130-365
130/** 131 * Determine if a value is an ArrayBuffer 132 * 133 * @param {Object} val The value to test 134 * @returns {boolean} True if value is an ArrayBuffer, otherwise false 135 */ 136function isArrayBuffer(val) { 137 return toString.call(val) === '[object ArrayBuffer]'; 138} 139 140/** 141 * Determine if a value is a FormData 142 * 143 * @param {Object} val The value to test 144 * @returns {boolean} True if value is an FormData, otherwise false 145 */ 146function isFormData(val) { 147 return (typeof FormData !== 'undefined') && (val instanceof FormData); 148} 149 150/** 151 * Determine if a value is a view on an ArrayBuffer 152 * 153 * @param {Object} val The value to test 154 * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false 155 */ 156function isArrayBufferView(val) { 157 var result; 158 if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { 159 result = ArrayBuffer.isView(val); 160 } else { 161 result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); 162 } 163 return result; 164} 165 166/** 167 * Determine if a value is a String 168 * 169 * @param {Object} val The value to test 170 * @returns {boolean} True if value is a String, otherwise false 171 */ 172function isString(val) { 173 return typeof val === 'string'; 174} 175 176/** 177 * Determine if a value is a Number 178 * 179 * @param {Object} val The value to test 180 * @returns {boolean} True if value is a Number, otherwise false 181 */ 182function isNumber(val) { 183 return typeof val === 'number'; 184} 185 186/** 187 * Determine if a value is undefined 188 * 189 * @param {Object} val The value to test 190 * @returns {boolean} True if the value is undefined, otherwise false 191 */ 192function isUndefined(val) { 193 return typeof val === 'undefined'; 194} 195 196/** 197 * Determine if a value is an Object 198 * 199 * @param {Object} val The value to test 200 * @returns {boolean} True if value is an Object, otherwise false 201 */ 202function isObject(val) { 203 return val !== null && typeof val === 'object'; 204} 205 206/** 207 * Determine if a value is a Date 208 * 209 * @param {Object} val The value to test 210 * @returns {boolean} True if value is a Date, otherwise false 211 */ 212function isDate(val) { 213 return toString.call(val) === '[object Date]'; 214} 215 216/** 217 * Determine if a value is a File 218 * 219 * @param {Object} val The value to test 220 * @returns {boolean} True if value is a File, otherwise false 221 */ 222function isFile(val) { 223 return toString.call(val) === '[object File]'; 224} 225 226/** 227 * Determine if a value is a Blob 228 * 229 * @param {Object} val The value to test 230 * @returns {boolean} True if value is a Blob, otherwise false 231 */ 232function isBlob(val) { 233 return toString.call(val) === '[object Blob]'; 234} 235 236/** 237 * Determine if a value is a Function 238 * 239 * @param {Object} val The value to test 240 * @returns {boolean} True if value is a Function, otherwise false 241 */ 242function isFunction(val) { 243 return toString.call(val) === '[object Function]'; 244} 245 246/** 247 * Determine if a value is a Stream 248 * 249 * @param {Object} val The value to test 250 * @returns {boolean} True if value is a Stream, otherwise false 251 */ 252function isStream(val) { 253 return isObject(val) && isFunction(val.pipe); 254} 255 256/** 257 * Determine if a value is a URLSearchParams object 258 * 259 * @param {Object} val The value to test 260 * @returns {boolean} True if value is a URLSearchParams object, otherwise false 261 */ 262function isURLSearchParams(val) { 263 return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; 264} 265 266/** 267 * Trim excess whitespace off the beginning and end of a string 268 * 269 * @param {String} str The String to trim 270 * @returns {String} The String freed of excess whitespace 271 */ 272function trim(str) { 273 return str.replace(/^\s*/, '').replace(/\s*$/, ''); 274} 275 276/** 277 * Determine if we're running in a standard browser environment 278 * 279 * This allows axios to run in a web worker, and react-native. 280 * Both environments support XMLHttpRequest, but not fully standard globals. 281 * 282 * web workers: 283 * typeof window -> undefined 284 * typeof document -> undefined 285 * 286 * react-native: 287 * navigator.product -> 'ReactNative' 288 */ 289function isStandardBrowserEnv() { 290 if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') { 291 return false; 292 } 293 return ( 294 typeof window !== 'undefined' && 295 typeof document !== 'undefined' 296 ); 297} 298 299/** 300 * Iterate over an Array or an Object invoking a function for each item. 301 * 302 * If `obj` is an Array callback will be called passing 303 * the value, index, and complete array for each item. 304 * 305 * If 'obj' is an Object callback will be called passing 306 * the value, key, and complete object for each property. 307 * 308 * @param {Object|Array} obj The object to iterate 309 * @param {Function} fn The callback to invoke for each item 310 */ 311function forEach(obj, fn) { 312 // Don't bother if no value provided 313 if (obj === null || typeof obj === 'undefined') { 314 return; 315 } 316 317 // Force an array if not already something iterable 318 if (typeof obj !== 'object') { 319 /*eslint no-param-reassign:0*/ 320 obj = [obj]; 321 } 322 323 if (isArray(obj)) { 324 // Iterate over array values 325 for (var i = 0, l = obj.length; i < l; i++) { 326 fn.call(null, obj[i], i, obj); 327 } 328 } else { 329 // Iterate over object keys 330 for (var key in obj) { 331 if (Object.prototype.hasOwnProperty.call(obj, key)) { 332 fn.call(null, obj[key], key, obj); 333 } 334 } 335 } 336} 337 338/** 339 * Accepts varargs expecting each argument to be an object, then 340 * immutably merges the properties of each object and returns result. 341 * 342 * When multiple objects contain the same key the later object in 343 * the arguments list will take precedence. 344 * 345 * Example: 346 * 347 * ```js 348 * var result = merge({foo: 123}, {foo: 456}); 349 * console.log(result.foo); // outputs 456 350 * ``` 351 * 352 * @param {Object} obj1 Object to merge 353 * @returns {Object} Result of all merge properties 354 */ 355function merge(/* obj1, obj2, obj3, ... */) { 356 var result = {}; 357 function assignValue(val, key) { 358 if (typeof result[key] === 'object' && typeof val === 'object') { 359 result[key] = merge(result[key], val); 360 } else { 361 result[key] = val; 362 } 363 } 364 365 for (var i = 0, l = arguments.length; i < l; i++) {
vendor: 4,443 bytes, lines 366-508
366 forEach(arguments[i], assignValue); 367 } 368 return result; 369} 370 371/** 372 * Extends object a by mutably adding to it the properties of object b. 373 * 374 * @param {Object} a The object to be extended 375 * @param {Object} b The object to copy properties from 376 * @param {Object} thisArg The object to bind function to 377 * @return {Object} The resulting value of object a 378 */ 379function extend(a, b, thisArg) { 380 forEach(b, function assignValue(val, key) { 381 if (thisArg && typeof val === 'function') { 382 a[key] = bind(val, thisArg); 383 } else { 384 a[key] = val; 385 } 386 }); 387 return a; 388} 389 390module.exports = { 391 isArray: isArray, 392 isArrayBuffer: isArrayBuffer, 393 isBuffer: isBuffer, 394 isFormData: isFormData, 395 isArrayBufferView: isArrayBufferView, 396 isString: isString, 397 isNumber: isNumber, 398 isObject: isObject, 399 isUndefined: isUndefined, 400 isDate: isDate, 401 isFile: isFile, 402 isBlob: isBlob, 403 isFunction: isFunction, 404 isStream: isStream, 405 isURLSearchParams: isURLSearchParams, 406 isStandardBrowserEnv: isStandardBrowserEnv, 407 forEach: forEach, 408 merge: merge, 409 extend: extend, 410 trim: trim 411}; 412 413 414/***/ }), 415/* 1 */ 416/***/ (function(module, exports) { 417 418// shim for using process in browser 419var process = module.exports = {}; 420 421// cached from whatever global is present so that test runners that stub it 422// don't break things. But we need to wrap it in a try catch in case it is 423// wrapped in strict mode code which doesn't define any globals. It's inside a 424// function because try/catches deoptimize in certain engines. 425 426var cachedSetTimeout; 427var cachedClearTimeout; 428 429function defaultSetTimout() { 430 throw new Error('setTimeout has not been defined'); 431} 432function defaultClearTimeout () { 433 throw new Error('clearTimeout has not been defined'); 434} 435(function () { 436 try { 437 if (typeof setTimeout === 'function') { 438 cachedSetTimeout = setTimeout; 439 } else { 440 cachedSetTimeout = defaultSetTimout; 441 } 442 } catch (e) { 443 cachedSetTimeout = defaultSetTimout; 444 } 445 try { 446 if (typeof clearTimeout === 'function') { 447 cachedClearTimeout = clearTimeout; 448 } else { 449 cachedClearTimeout = defaultClearTimeout; 450 } 451 } catch (e) { 452 cachedClearTimeout = defaultClearTimeout; 453 } 454} ()) 455function runTimeout(fun) { 456 if (cachedSetTimeout === setTimeout) { 457 //normal enviroments in sane situations 458 return setTimeout(fun, 0); 459 } 460 // if setTimeout wasn't available but was latter defined 461 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { 462 cachedSetTimeout = setTimeout; 463 return setTimeout(fun, 0); 464 } 465 try { 466 // when when somebody has screwed with setTimeout but no I.E. maddness 467 return cachedSetTimeout(fun, 0); 468 } catch(e){ 469 try { 470 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 471 return cachedSetTimeout.call(null, fun, 0); 472 } catch(e){ 473 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error 474 return cachedSetTimeout.call(this, fun, 0); 475 } 476 } 477 478 479} 480function runClearTimeout(marker) { 481 if (cachedClearTimeout === clearTimeout) { 482 //normal enviroments in sane situations 483 return clearTimeout(marker); 484 } 485 // if clearTimeout wasn't available but was latter defined 486 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { 487 cachedClearTimeout = clearTimeout; 488 return clearTimeout(marker); 489 } 490 try { 491 // when when somebody has screwed with setTimeout but no I.E. maddness 492 return cachedClearTimeout(marker); 493 } catch (e){ 494 try { 495 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 496 return cachedClearTimeout.call(null, marker); 497 } catch (e){ 498 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. 499 // Some versions of I.E. have different rules for clearTimeout vs setTimeout 500 return cachedClearTimeout.call(this, marker); 501 } 502 } 503 504 505 506} 507var queue = []; 508var draining = false;
vendor: 5,167 bytes, lines 509-745
509var currentQueue; 510var queueIndex = -1; 511 512function cleanUpNextTick() { 513 if (!draining || !currentQueue) { 514 return; 515 } 516 draining = false; 517 if (currentQueue.length) { 518 queue = currentQueue.concat(queue); 519 } else { 520 queueIndex = -1; 521 } 522 if (queue.length) { 523 drainQueue(); 524 } 525} 526 527function drainQueue() { 528 if (draining) { 529 return; 530 } 531 var timeout = runTimeout(cleanUpNextTick); 532 draining = true; 533 534 var len = queue.length; 535 while(len) { 536 currentQueue = queue; 537 queue = []; 538 while (++queueIndex < len) { 539 if (currentQueue) { 540 currentQueue[queueIndex].run(); 541 } 542 } 543 queueIndex = -1; 544 len = queue.length; 545 } 546 currentQueue = null; 547 draining = false; 548 runClearTimeout(timeout); 549} 550 551process.nextTick = function (fun) { 552 var args = new Array(arguments.length - 1); 553 if (arguments.length > 1) { 554 for (var i = 1; i < arguments.length; i++) { 555 args[i - 1] = arguments[i]; 556 } 557 } 558 queue.push(new Item(fun, args)); 559 if (queue.length === 1 && !draining) { 560 runTimeout(drainQueue); 561 } 562}; 563 564// v8 likes predictible objects 565function Item(fun, array) { 566 this.fun = fun; 567 this.array = array; 568} 569Item.prototype.run = function () { 570 this.fun.apply(null, this.array); 571}; 572process.title = 'browser'; 573process.browser = true; 574process.env = {}; 575process.argv = []; 576process.version = ''; // empty string to avoid regexp issues 577process.versions = {}; 578 579function noop() {} 580 581process.on = noop; 582process.addListener = noop; 583process.once = noop; 584process.off = noop; 585process.removeListener = noop; 586process.removeAllListeners = noop; 587process.emit = noop; 588process.prependListener = noop; 589process.prependOnceListener = noop; 590 591process.listeners = function (name) { return [] } 592 593process.binding = function (name) { 594 throw new Error('process.binding is not supported'); 595}; 596 597process.cwd = function () { return '/' }; 598process.chdir = function (dir) { 599 throw new Error('process.chdir is not supported'); 600}; 601process.umask = function() { return 0; }; 602 603 604/***/ }), 605/* 2 */ 606/***/ (function(module, __webpack_exports__, __webpack_require__) { 607 608"use strict"; 609Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 610/* WEBPACK VAR INJECTION */(function(process, global, setImmediate) {/*! 611 * Vue.js v2.6.11 612 * (c) 2014-2019 Evan You 613 * Released under the MIT License. 614 */ 615/* */ 616 617var emptyObject = Object.freeze({}); 618 619// These helpers produce better VM code in JS engines due to their 620// explicitness and function inlining. 621function isUndef (v) { 622 return v === undefined || v === null 623} 624 625function isDef (v) { 626 return v !== undefined && v !== null 627} 628 629function isTrue (v) { 630 return v === true 631} 632 633function isFalse (v) { 634 return v === false 635} 636 637/** 638 * Check if value is primitive. 639 */ 640function isPrimitive (value) { 641 return ( 642 typeof value === 'string' || 643 typeof value === 'number' || 644 // $flow-disable-line 645 typeof value === 'symbol' || 646 typeof value === 'boolean' 647 ) 648} 649 650/** 651 * Quick object check - this is primarily used to tell 652 * Objects from primitive values when we know the value 653 * is a JSON-compliant type. 654 */ 655function isObject (obj) { 656 return obj !== null && typeof obj === 'object' 657} 658 659/** 660 * Get the raw type string of a value, e.g., [object Object]. 661 */ 662var _toString = Object.prototype.toString; 663 664function toRawType (value) { 665 return _toString.call(value).slice(8, -1) 666} 667 668/** 669 * Strict object type check. Only returns true 670 * for plain JavaScript objects. 671 */ 672function isPlainObject (obj) { 673 return _toString.call(obj) === '[object Object]' 674} 675 676function isRegExp (v) { 677 return _toString.call(v) === '[object RegExp]' 678} 679 680/** 681 * Check if val is a valid array index. 682 */ 683function isValidArrayIndex (val) { 684 var n = parseFloat(String(val)); 685 return n >= 0 && Math.floor(n) === n && isFinite(val) 686} 687 688function isPromise (val) { 689 return ( 690 isDef(val) && 691 typeof val.then === 'function' && 692 typeof val.catch === 'function' 693 ) 694} 695 696/** 697 * Convert a value to a string that is actually rendered. 698 */ 699function toString (val) { 700 return val == null 701 ? '' 702 : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString) 703 ? JSON.stringify(val, null, 2) 704 : String(val) 705} 706 707/** 708 * Convert an input value to a number for persistence. 709 * If the conversion fails, return original string. 710 */ 711function toNumber (val) { 712 var n = parseFloat(val); 713 return isNaN(n) ? val : n 714} 715 716/** 717 * Make a map and return a function for checking if a key 718 * is in that map. 719 */ 720function makeMap ( 721 str, 722 expectsLowerCase 723) { 724 var map = Object.create(null); 725 var list = str.split(','); 726 for (var i = 0; i < list.length; i++) { 727 map[list[i]] = true; 728 } 729 return expectsLowerCase 730 ? function (val) { return map[val.toLowerCase()]; } 731 : function (val) { return map[val]; } 732} 733 734/** 735 * Check if a tag is a built-in tag. 736 */ 737var isBuiltInTag = makeMap('slot,component', true); 738 739/** 740 * Check if an attribute is a reserved attribute. 741 */ 742var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is'); 743 744/** 745 * Remove an item from an array.
vendor: 8,864 bytes, lines 746-1145
746 */ 747function remove (arr, item) { 748 if (arr.length) { 749 var index = arr.indexOf(item); 750 if (index > -1) { 751 return arr.splice(index, 1) 752 } 753 } 754} 755 756/** 757 * Check whether an object has the property. 758 */ 759var hasOwnProperty = Object.prototype.hasOwnProperty; 760function hasOwn (obj, key) { 761 return hasOwnProperty.call(obj, key) 762} 763 764/** 765 * Create a cached version of a pure function. 766 */ 767function cached (fn) { 768 var cache = Object.create(null); 769 return (function cachedFn (str) { 770 var hit = cache[str]; 771 return hit || (cache[str] = fn(str)) 772 }) 773} 774 775/** 776 * Camelize a hyphen-delimited string. 777 */ 778var camelizeRE = /-(\w)/g; 779var camelize = cached(function (str) { 780 return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; }) 781}); 782 783/** 784 * Capitalize a string. 785 */ 786var capitalize = cached(function (str) { 787 return str.charAt(0).toUpperCase() + str.slice(1) 788}); 789 790/** 791 * Hyphenate a camelCase string. 792 */ 793var hyphenateRE = /\B([A-Z])/g; 794var hyphenate = cached(function (str) { 795 return str.replace(hyphenateRE, '-$1').toLowerCase() 796}); 797 798/** 799 * Simple bind polyfill for environments that do not support it, 800 * e.g., PhantomJS 1.x. Technically, we don't need this anymore 801 * since native bind is now performant enough in most browsers. 802 * But removing it would mean breaking code that was able to run in 803 * PhantomJS 1.x, so this must be kept for backward compatibility. 804 */ 805 806/* istanbul ignore next */ 807function polyfillBind (fn, ctx) { 808 function boundFn (a) { 809 var l = arguments.length; 810 return l 811 ? l > 1 812 ? fn.apply(ctx, arguments) 813 : fn.call(ctx, a) 814 : fn.call(ctx) 815 } 816 817 boundFn._length = fn.length; 818 return boundFn 819} 820 821function nativeBind (fn, ctx) { 822 return fn.bind(ctx) 823} 824 825var bind = Function.prototype.bind 826 ? nativeBind 827 : polyfillBind; 828 829/** 830 * Convert an Array-like object to a real Array. 831 */ 832function toArray (list, start) { 833 start = start || 0; 834 var i = list.length - start; 835 var ret = new Array(i); 836 while (i--) { 837 ret[i] = list[i + start]; 838 } 839 return ret 840} 841 842/** 843 * Mix properties into target object. 844 */ 845function extend (to, _from) { 846 for (var key in _from) { 847 to[key] = _from[key]; 848 } 849 return to 850} 851 852/** 853 * Merge an Array of Objects into a single Object. 854 */ 855function toObject (arr) { 856 var res = {}; 857 for (var i = 0; i < arr.length; i++) { 858 if (arr[i]) { 859 extend(res, arr[i]); 860 } 861 } 862 return res 863} 864 865/* eslint-disable no-unused-vars */ 866 867/** 868 * Perform no operation. 869 * Stubbing args to make Flow happy without leaving useless transpiled code 870 * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/). 871 */ 872function noop (a, b, c) {} 873 874/** 875 * Always return false. 876 */ 877var no = function (a, b, c) { return false; }; 878 879/* eslint-enable no-unused-vars */ 880 881/** 882 * Return the same value. 883 */ 884var identity = function (_) { return _; }; 885 886/** 887 * Generate a string containing static keys from compiler modules. 888 */ 889function genStaticKeys (modules) { 890 return modules.reduce(function (keys, m) { 891 return keys.concat(m.staticKeys || []) 892 }, []).join(',') 893} 894 895/** 896 * Check if two values are loosely equal - that is, 897 * if they are plain objects, do they have the same shape? 898 */ 899function looseEqual (a, b) { 900 if (a === b) { return true } 901 var isObjectA = isObject(a); 902 var isObjectB = isObject(b); 903 if (isObjectA && isObjectB) { 904 try { 905 var isArrayA = Array.isArray(a); 906 var isArrayB = Array.isArray(b); 907 if (isArrayA && isArrayB) { 908 return a.length === b.length && a.every(function (e, i) { 909 return looseEqual(e, b[i]) 910 }) 911 } else if (a instanceof Date && b instanceof Date) { 912 return a.getTime() === b.getTime() 913 } else if (!isArrayA && !isArrayB) { 914 var keysA = Object.keys(a); 915 var keysB = Object.keys(b); 916 return keysA.length === keysB.length && keysA.every(function (key) { 917 return looseEqual(a[key], b[key]) 918 }) 919 } else { 920 /* istanbul ignore next */ 921 return false 922 } 923 } catch (e) { 924 /* istanbul ignore next */ 925 return false 926 } 927 } else if (!isObjectA && !isObjectB) { 928 return String(a) === String(b) 929 } else { 930 return false 931 } 932} 933 934/** 935 * Return the first index at which a loosely equal value can be 936 * found in the array (if value is a plain object, the array must 937 * contain an object of the same shape), or -1 if it is not present. 938 */ 939function looseIndexOf (arr, val) { 940 for (var i = 0; i < arr.length; i++) { 941 if (looseEqual(arr[i], val)) { return i } 942 } 943 return -1 944} 945 946/** 947 * Ensure a function is called only once. 948 */ 949function once (fn) { 950 var called = false; 951 return function () { 952 if (!called) { 953 called = true; 954 fn.apply(this, arguments); 955 } 956 } 957} 958 959var SSR_ATTR = 'data-server-rendered'; 960 961var ASSET_TYPES = [ 962 'component', 963 'directive', 964 'filter' 965]; 966 967var LIFECYCLE_HOOKS = [ 968 'beforeCreate', 969 'created', 970 'beforeMount', 971 'mounted', 972 'beforeUpdate', 973 'updated', 974 'beforeDestroy', 975 'destroyed', 976 'activated', 977 'deactivated', 978 'errorCaptured', 979 'serverPrefetch' 980]; 981 982/* */ 983 984 985 986var config = ({ 987 /** 988 * Option merge strategies (used in core/util/options) 989 */ 990 // $flow-disable-line 991 optionMergeStrategies: Object.create(null), 992 993 /** 994 * Whether to suppress warnings. 995 */ 996 silent: false, 997 998 /** 999 * Show production mode tip message on boot? 1000 */ 1001 productionTip: process.env.NODE_ENV !== 'production', 1002 1003 /** 1004 * Whether to enable devtools 1005 */ 1006 devtools: process.env.NODE_ENV !== 'production', 1007 1008 /** 1009 * Whether to record perf 1010 */ 1011 performance: false, 1012 1013 /** 1014 * Error handler for watcher errors 1015 */ 1016 errorHandler: null, 1017 1018 /** 1019 * Warn handler for watcher warns 1020 */ 1021 warnHandler: null, 1022 1023 /** 1024 * Ignore certain custom elements 1025 */ 1026 ignoredElements: [], 1027 1028 /** 1029 * Custom user key aliases for v-on 1030 */ 1031 // $flow-disable-line 1032 keyCodes: Object.create(null), 1033 1034 /** 1035 * Check if a tag is reserved so that it cannot be registered as a 1036 * component. This is platform-dependent and may be overwritten. 1037 */ 1038 isReservedTag: no, 1039 1040 /** 1041 * Check if an attribute is reserved so that it cannot be used as a component 1042 * prop. This is platform-dependent and may be overwritten. 1043 */ 1044 isReservedAttr: no, 1045 1046 /** 1047 * Check if a tag is an unknown element. 1048 * Platform-dependent. 1049 */ 1050 isUnknownElement: no, 1051 1052 /** 1053 * Get the namespace of an element 1054 */ 1055 getTagNamespace: noop, 1056 1057 /** 1058 * Parse the real tag name for the specific platform. 1059 */ 1060 parsePlatformTagName: identity, 1061 1062 /** 1063 * Check if an attribute must be bound using property, e.g. value 1064 * Platform-dependent. 1065 */ 1066 mustUseProp: no, 1067 1068 /** 1069 * Perform updates asynchronously. Intended to be used by Vue Test Utils 1070 * This will significantly reduce performance if set to false. 1071 */ 1072 async: true, 1073 1074 /** 1075 * Exposed for legacy reasons 1076 */ 1077 _lifecycleHooks: LIFECYCLE_HOOKS 1078}); 1079 1080/* */ 1081 1082/** 1083 * unicode letters used for parsing html tags, component names and property paths. 1084 * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname 1085 * skipping \u10000-\uEFFFF due to it freezing up PhantomJS 1086 */ 1087var 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/; 1088 1089/** 1090 * Check if a string starts with $ or _ 1091 */ 1092function isReserved (str) { 1093 var c = (str + '').charCodeAt(0); 1094 return c === 0x24 || c === 0x5F 1095} 1096 1097/** 1098 * Define a property. 1099 */ 1100function def (obj, key, val, enumerable) { 1101 Object.defineProperty(obj, key, { 1102 value: val, 1103 enumerable: !!enumerable, 1104 writable: true, 1105 configurable: true 1106 }); 1107} 1108 1109/** 1110 * Parse simple path. 1111 */ 1112var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]")); 1113function parsePath (path) { 1114 if (bailRE.test(path)) { 1115 return 1116 } 1117 var segments = path.split('.'); 1118 return function (obj) { 1119 for (var i = 0; i < segments.length; i++) { 1120 if (!obj) { return } 1121 obj = obj[segments[i]]; 1122 } 1123 return obj 1124 } 1125} 1126 1127/* */ 1128 1129// can we use __proto__? 1130var hasProto = '__proto__' in {}; 1131 1132// Browser environment sniffing 1133var inBrowser = typeof window !== 'undefined'; 1134var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform; 1135var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase(); 1136var UA = inBrowser && window.navigator.userAgent.toLowerCase(); 1137var isIE = UA && /msie|trident/.test(UA); 1138var isIE9 = UA && UA.indexOf('msie 9.0') > 0; 1139var isEdge = UA && UA.indexOf('edge/') > 0; 1140var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android'); 1141var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios'); 1142var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge; 1143var isPhantomJS = UA && /phantomjs/.test(UA); 1144var isFF = UA && UA.match(/firefox\/(\d+)/); 1145
vendor: 4,989 bytes, lines 1146-1331
1146// Firefox has a "watch" function on Object.prototype... 1147var nativeWatch = ({}).watch; 1148 1149var supportsPassive = false; 1150if (inBrowser) { 1151 try { 1152 var opts = {}; 1153 Object.defineProperty(opts, 'passive', ({ 1154 get: function get () { 1155 /* istanbul ignore next */ 1156 supportsPassive = true; 1157 } 1158 })); // https://github.com/facebook/flow/issues/285 1159 window.addEventListener('test-passive', null, opts); 1160 } catch (e) {} 1161} 1162 1163// this needs to be lazy-evaled because vue may be required before 1164// vue-server-renderer can set VUE_ENV 1165var _isServer; 1166var isServerRendering = function () { 1167 if (_isServer === undefined) { 1168 /* istanbul ignore if */ 1169 if (!inBrowser && !inWeex && typeof global !== 'undefined') { 1170 // detect presence of vue-server-renderer and avoid 1171 // Webpack shimming the process 1172 _isServer = global['process'] && global['process'].env.VUE_ENV === 'server'; 1173 } else { 1174 _isServer = false; 1175 } 1176 } 1177 return _isServer 1178}; 1179 1180// detect devtools 1181var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__; 1182 1183/* istanbul ignore next */ 1184function isNative (Ctor) { 1185 return typeof Ctor === 'function' && /native code/.test(Ctor.toString()) 1186} 1187 1188var hasSymbol = 1189 typeof Symbol !== 'undefined' && isNative(Symbol) && 1190 typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys); 1191 1192var _Set; 1193/* istanbul ignore if */ // $flow-disable-line 1194if (typeof Set !== 'undefined' && isNative(Set)) { 1195 // use native Set when available. 1196 _Set = Set; 1197} else { 1198 // a non-standard Set polyfill that only works with primitive keys. 1199 _Set = /*@__PURE__*/(function () { 1200 function Set () { 1201 this.set = Object.create(null); 1202 } 1203 Set.prototype.has = function has (key) { 1204 return this.set[key] === true 1205 }; 1206 Set.prototype.add = function add (key) { 1207 this.set[key] = true; 1208 }; 1209 Set.prototype.clear = function clear () { 1210 this.set = Object.create(null); 1211 }; 1212 1213 return Set; 1214 }()); 1215} 1216 1217/* */ 1218 1219var warn = noop; 1220var tip = noop; 1221var generateComponentTrace = (noop); // work around flow check 1222var formatComponentName = (noop); 1223 1224if (process.env.NODE_ENV !== 'production') { 1225 var hasConsole = typeof console !== 'undefined'; 1226 var classifyRE = /(?:^|[-_])(\w)/g; 1227 var classify = function (str) { return str 1228 .replace(classifyRE, function (c) { return c.toUpperCase(); }) 1229 .replace(/[-_]/g, ''); }; 1230 1231 warn = function (msg, vm) { 1232 var trace = vm ? generateComponentTrace(vm) : ''; 1233 1234 if (config.warnHandler) { 1235 config.warnHandler.call(null, msg, vm, trace); 1236 } else if (hasConsole && (!config.silent)) { 1237 console.error(("[Vue warn]: " + msg + trace)); 1238 } 1239 }; 1240 1241 tip = function (msg, vm) { 1242 if (hasConsole && (!config.silent)) { 1243 console.warn("[Vue tip]: " + msg + ( 1244 vm ? generateComponentTrace(vm) : '' 1245 )); 1246 } 1247 }; 1248 1249 formatComponentName = function (vm, includeFile) { 1250 if (vm.$root === vm) { 1251 return '<Root>' 1252 } 1253 var options = typeof vm === 'function' && vm.cid != null 1254 ? vm.options 1255 : vm._isVue 1256 ? vm.$options || vm.constructor.options 1257 : vm; 1258 var name = options.name || options._componentTag; 1259 var file = options.__file; 1260 if (!name && file) { 1261 var match = file.match(/([^/\\]+)\.vue$/); 1262 name = match && match[1]; 1263 } 1264 1265 return ( 1266 (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") + 1267 (file && includeFile !== false ? (" at " + file) : '') 1268 ) 1269 }; 1270 1271 var repeat = function (str, n) { 1272 var res = ''; 1273 while (n) { 1274 if (n % 2 === 1) { res += str; } 1275 if (n > 1) { str += str; } 1276 n >>= 1; 1277 } 1278 return res 1279 }; 1280 1281 generateComponentTrace = function (vm) { 1282 if (vm._isVue && vm.$parent) { 1283 var tree = []; 1284 var currentRecursiveSequence = 0; 1285 while (vm) { 1286 if (tree.length > 0) { 1287 var last = tree[tree.length - 1]; 1288 if (last.constructor === vm.constructor) { 1289 currentRecursiveSequence++; 1290 vm = vm.$parent; 1291 continue 1292 } else if (currentRecursiveSequence > 0) { 1293 tree[tree.length - 1] = [last, currentRecursiveSequence]; 1294 currentRecursiveSequence = 0; 1295 } 1296 } 1297 tree.push(vm); 1298 vm = vm.$parent; 1299 } 1300 return '\n\nfound in\n\n' + tree 1301 .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) 1302 ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)") 1303 : formatComponentName(vm))); }) 1304 .join('\n') 1305 } else { 1306 return ("\n\n(found in " + (formatComponentName(vm)) + ")") 1307 } 1308 }; 1309} 1310 1311/* */ 1312 1313var uid = 0; 1314 1315/** 1316 * A dep is an observable that can have multiple 1317 * directives subscribing to it. 1318 */ 1319var Dep = function Dep () { 1320 this.id = uid++; 1321 this.subs = []; 1322}; 1323 1324Dep.prototype.addSub = function addSub (sub) { 1325 this.subs.push(sub); 1326}; 1327 1328Dep.prototype.removeSub = function removeSub (sub) { 1329 remove(this.subs, sub); 1330}; 1331
vendor: 21,188 bytes, lines 1332-2225
1332Dep.prototype.depend = function depend () { 1333 if (Dep.target) { 1334 Dep.target.addDep(this); 1335 } 1336}; 1337 1338Dep.prototype.notify = function notify () { 1339 // stabilize the subscriber list first 1340 var subs = this.subs.slice(); 1341 if (process.env.NODE_ENV !== 'production' && !config.async) { 1342 // subs aren't sorted in scheduler if not running async 1343 // we need to sort them now to make sure they fire in correct 1344 // order 1345 subs.sort(function (a, b) { return a.id - b.id; }); 1346 } 1347 for (var i = 0, l = subs.length; i < l; i++) { 1348 subs[i].update(); 1349 } 1350}; 1351 1352// The current target watcher being evaluated. 1353// This is globally unique because only one watcher 1354// can be evaluated at a time. 1355Dep.target = null; 1356var targetStack = []; 1357 1358function pushTarget (target) { 1359 targetStack.push(target); 1360 Dep.target = target; 1361} 1362 1363function popTarget () { 1364 targetStack.pop(); 1365 Dep.target = targetStack[targetStack.length - 1]; 1366} 1367 1368/* */ 1369 1370var VNode = function VNode ( 1371 tag, 1372 data, 1373 children, 1374 text, 1375 elm, 1376 context, 1377 componentOptions, 1378 asyncFactory 1379) { 1380 this.tag = tag; 1381 this.data = data; 1382 this.children = children; 1383 this.text = text; 1384 this.elm = elm; 1385 this.ns = undefined; 1386 this.context = context; 1387 this.fnContext = undefined; 1388 this.fnOptions = undefined; 1389 this.fnScopeId = undefined; 1390 this.key = data && data.key; 1391 this.componentOptions = componentOptions; 1392 this.componentInstance = undefined; 1393 this.parent = undefined; 1394 this.raw = false; 1395 this.isStatic = false; 1396 this.isRootInsert = true; 1397 this.isComment = false; 1398 this.isCloned = false; 1399 this.isOnce = false; 1400 this.asyncFactory = asyncFactory; 1401 this.asyncMeta = undefined; 1402 this.isAsyncPlaceholder = false; 1403}; 1404 1405var prototypeAccessors = { child: { configurable: true } }; 1406 1407// DEPRECATED: alias for componentInstance for backwards compat. 1408/* istanbul ignore next */ 1409prototypeAccessors.child.get = function () { 1410 return this.componentInstance 1411}; 1412 1413Object.defineProperties( VNode.prototype, prototypeAccessors ); 1414 1415var createEmptyVNode = function (text) { 1416 if ( text === void 0 ) text = ''; 1417 1418 var node = new VNode(); 1419 node.text = text; 1420 node.isComment = true; 1421 return node 1422}; 1423 1424function createTextVNode (val) { 1425 return new VNode(undefined, undefined, undefined, String(val)) 1426} 1427 1428// optimized shallow clone 1429// used for static nodes and slot nodes because they may be reused across 1430// multiple renders, cloning them avoids errors when DOM manipulations rely 1431// on their elm reference. 1432function cloneVNode (vnode) { 1433 var cloned = new VNode( 1434 vnode.tag, 1435 vnode.data, 1436 // #7975 1437 // clone children array to avoid mutating original in case of cloning 1438 // a child. 1439 vnode.children && vnode.children.slice(), 1440 vnode.text, 1441 vnode.elm, 1442 vnode.context, 1443 vnode.componentOptions, 1444 vnode.asyncFactory 1445 ); 1446 cloned.ns = vnode.ns; 1447 cloned.isStatic = vnode.isStatic; 1448 cloned.key = vnode.key; 1449 cloned.isComment = vnode.isComment; 1450 cloned.fnContext = vnode.fnContext; 1451 cloned.fnOptions = vnode.fnOptions; 1452 cloned.fnScopeId = vnode.fnScopeId; 1453 cloned.asyncMeta = vnode.asyncMeta; 1454 cloned.isCloned = true; 1455 return cloned 1456} 1457 1458/* 1459 * not type checking this file because flow doesn't play well with 1460 * dynamically accessing methods on Array prototype 1461 */ 1462 1463var arrayProto = Array.prototype; 1464var arrayMethods = Object.create(arrayProto); 1465 1466var methodsToPatch = [ 1467 'push', 1468 'pop', 1469 'shift', 1470 'unshift', 1471 'splice', 1472 'sort', 1473 'reverse' 1474]; 1475 1476/** 1477 * Intercept mutating methods and emit events 1478 */ 1479methodsToPatch.forEach(function (method) { 1480 // cache original method 1481 var original = arrayProto[method]; 1482 def(arrayMethods, method, function mutator () { 1483 var args = [], len = arguments.length; 1484 while ( len-- ) args[ len ] = arguments[ len ]; 1485 1486 var result = original.apply(this, args); 1487 var ob = this.__ob__; 1488 var inserted; 1489 switch (method) { 1490 case 'push': 1491 case 'unshift': 1492 inserted = args; 1493 break 1494 case 'splice': 1495 inserted = args.slice(2); 1496 break 1497 } 1498 if (inserted) { ob.observeArray(inserted); } 1499 // notify change 1500 ob.dep.notify(); 1501 return result 1502 }); 1503}); 1504 1505/* */ 1506 1507var arrayKeys = Object.getOwnPropertyNames(arrayMethods); 1508 1509/** 1510 * In some cases we may want to disable observation inside a component's 1511 * update computation. 1512 */ 1513var shouldObserve = true; 1514 1515function toggleObserving (value) { 1516 shouldObserve = value; 1517} 1518 1519/** 1520 * Observer class that is attached to each observed 1521 * object. Once attached, the observer converts the target 1522 * object's property keys into getter/setters that 1523 * collect dependencies and dispatch updates. 1524 */ 1525var Observer = function Observer (value) { 1526 this.value = value; 1527 this.dep = new Dep(); 1528 this.vmCount = 0; 1529 def(value, '__ob__', this); 1530 if (Array.isArray(value)) { 1531 if (hasProto) { 1532 protoAugment(value, arrayMethods); 1533 } else { 1534 copyAugment(value, arrayMethods, arrayKeys); 1535 } 1536 this.observeArray(value); 1537 } else { 1538 this.walk(value); 1539 } 1540}; 1541 1542/** 1543 * Walk through all properties and convert them into 1544 * getter/setters. This method should only be called when 1545 * value type is Object. 1546 */ 1547Observer.prototype.walk = function walk (obj) { 1548 var keys = Object.keys(obj); 1549 for (var i = 0; i < keys.length; i++) { 1550 defineReactive$$1(obj, keys[i]); 1551 } 1552}; 1553 1554/** 1555 * Observe a list of Array items. 1556 */ 1557Observer.prototype.observeArray = function observeArray (items) { 1558 for (var i = 0, l = items.length; i < l; i++) { 1559 observe(items[i]); 1560 } 1561}; 1562 1563// helpers 1564 1565/** 1566 * Augment a target Object or Array by intercepting 1567 * the prototype chain using __proto__ 1568 */ 1569function protoAugment (target, src) { 1570 /* eslint-disable no-proto */ 1571 target.__proto__ = src; 1572 /* eslint-enable no-proto */ 1573} 1574 1575/** 1576 * Augment a target Object or Array by defining 1577 * hidden properties. 1578 */ 1579/* istanbul ignore next */ 1580function copyAugment (target, src, keys) { 1581 for (var i = 0, l = keys.length; i < l; i++) { 1582 var key = keys[i]; 1583 def(target, key, src[key]); 1584 } 1585} 1586 1587/** 1588 * Attempt to create an observer instance for a value, 1589 * returns the new observer if successfully observed, 1590 * or the existing observer if the value already has one. 1591 */ 1592function observe (value, asRootData) { 1593 if (!isObject(value) || value instanceof VNode) { 1594 return 1595 } 1596 var ob; 1597 if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) { 1598 ob = value.__ob__; 1599 } else if ( 1600 shouldObserve && 1601 !isServerRendering() && 1602 (Array.isArray(value) || isPlainObject(value)) && 1603 Object.isExtensible(value) && 1604 !value._isVue 1605 ) { 1606 ob = new Observer(value); 1607 } 1608 if (asRootData && ob) { 1609 ob.vmCount++; 1610 } 1611 return ob 1612} 1613 1614/** 1615 * Define a reactive property on an Object. 1616 */ 1617function defineReactive$$1 ( 1618 obj, 1619 key, 1620 val, 1621 customSetter, 1622 shallow 1623) { 1624 var dep = new Dep(); 1625 1626 var property = Object.getOwnPropertyDescriptor(obj, key); 1627 if (property && property.configurable === false) { 1628 return 1629 } 1630 1631 // cater for pre-defined getter/setters 1632 var getter = property && property.get; 1633 var setter = property && property.set; 1634 if ((!getter || setter) && arguments.length === 2) { 1635 val = obj[key]; 1636 } 1637 1638 var childOb = !shallow && observe(val); 1639 Object.defineProperty(obj, key, { 1640 enumerable: true, 1641 configurable: true, 1642 get: function reactiveGetter () { 1643 var value = getter ? getter.call(obj) : val; 1644 if (Dep.target) { 1645 dep.depend(); 1646 if (childOb) { 1647 childOb.dep.depend(); 1648 if (Array.isArray(value)) { 1649 dependArray(value); 1650 } 1651 } 1652 } 1653 return value 1654 }, 1655 set: function reactiveSetter (newVal) { 1656 var value = getter ? getter.call(obj) : val; 1657 /* eslint-disable no-self-compare */ 1658 if (newVal === value || (newVal !== newVal && value !== value)) { 1659 return 1660 } 1661 /* eslint-enable no-self-compare */ 1662 if (process.env.NODE_ENV !== 'production' && customSetter) { 1663 customSetter(); 1664 } 1665 // #7981: for accessor properties without setter 1666 if (getter && !setter) { return } 1667 if (setter) { 1668 setter.call(obj, newVal); 1669 } else { 1670 val = newVal; 1671 } 1672 childOb = !shallow && observe(newVal); 1673 dep.notify(); 1674 } 1675 }); 1676} 1677 1678/** 1679 * Set a property on an object. Adds the new property and 1680 * triggers change notification if the property doesn't 1681 * already exist. 1682 */ 1683function set (target, key, val) { 1684 if (process.env.NODE_ENV !== 'production' && 1685 (isUndef(target) || isPrimitive(target)) 1686 ) { 1687 warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target)))); 1688 } 1689 if (Array.isArray(target) && isValidArrayIndex(key)) { 1690 target.length = Math.max(target.length, key); 1691 target.splice(key, 1, val); 1692 return val 1693 } 1694 if (key in target && !(key in Object.prototype)) { 1695 target[key] = val; 1696 return val 1697 } 1698 var ob = (target).__ob__; 1699 if (target._isVue || (ob && ob.vmCount)) { 1700 process.env.NODE_ENV !== 'production' && warn( 1701 'Avoid adding reactive properties to a Vue instance or its root $data ' + 1702 'at runtime - declare it upfront in the data option.' 1703 ); 1704 return val 1705 } 1706 if (!ob) { 1707 target[key] = val; 1708 return val 1709 } 1710 defineReactive$$1(ob.value, key, val); 1711 ob.dep.notify(); 1712 return val 1713} 1714 1715/** 1716 * Delete a property and trigger change if necessary. 1717 */ 1718function del (target, key) { 1719 if (process.env.NODE_ENV !== 'production' && 1720 (isUndef(target) || isPrimitive(target)) 1721 ) { 1722 warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target)))); 1723 } 1724 if (Array.isArray(target) && isValidArrayIndex(key)) { 1725 target.splice(key, 1); 1726 return 1727 } 1728 var ob = (target).__ob__; 1729 if (target._isVue || (ob && ob.vmCount)) { 1730 process.env.NODE_ENV !== 'production' && warn( 1731 'Avoid deleting properties on a Vue instance or its root $data ' + 1732 '- just set it to null.' 1733 ); 1734 return 1735 } 1736 if (!hasOwn(target, key)) { 1737 return 1738 } 1739 delete target[key]; 1740 if (!ob) { 1741 return 1742 } 1743 ob.dep.notify(); 1744} 1745 1746/** 1747 * Collect dependencies on array elements when the array is touched, since 1748 * we cannot intercept array element access like property getters. 1749 */ 1750function dependArray (value) { 1751 for (var e = (void 0), i = 0, l = value.length; i < l; i++) { 1752 e = value[i]; 1753 e && e.__ob__ && e.__ob__.dep.depend(); 1754 if (Array.isArray(e)) { 1755 dependArray(e); 1756 } 1757 } 1758} 1759 1760/* */ 1761 1762/** 1763 * Option overwriting strategies are functions that handle 1764 * how to merge a parent option value and a child option 1765 * value into the final value. 1766 */ 1767var strats = config.optionMergeStrategies; 1768 1769/** 1770 * Options with restrictions 1771 */ 1772if (process.env.NODE_ENV !== 'production') { 1773 strats.el = strats.propsData = function (parent, child, vm, key) { 1774 if (!vm) { 1775 warn( 1776 "option \"" + key + "\" can only be used during instance " + 1777 'creation with the `new` keyword.' 1778 ); 1779 } 1780 return defaultStrat(parent, child) 1781 }; 1782} 1783 1784/** 1785 * Helper that recursively merges two data objects together. 1786 */ 1787function mergeData (to, from) { 1788 if (!from) { return to } 1789 var key, toVal, fromVal; 1790 1791 var keys = hasSymbol 1792 ? Reflect.ownKeys(from) 1793 : Object.keys(from); 1794 1795 for (var i = 0; i < keys.length; i++) { 1796 key = keys[i]; 1797 // in case the object is already observed... 1798 if (key === '__ob__') { continue } 1799 toVal = to[key]; 1800 fromVal = from[key]; 1801 if (!hasOwn(to, key)) { 1802 set(to, key, fromVal); 1803 } else if ( 1804 toVal !== fromVal && 1805 isPlainObject(toVal) && 1806 isPlainObject(fromVal) 1807 ) { 1808 mergeData(toVal, fromVal); 1809 } 1810 } 1811 return to 1812} 1813 1814/** 1815 * Data 1816 */ 1817function mergeDataOrFn ( 1818 parentVal, 1819 childVal, 1820 vm 1821) { 1822 if (!vm) { 1823 // in a Vue.extend merge, both should be functions 1824 if (!childVal) { 1825 return parentVal 1826 } 1827 if (!parentVal) { 1828 return childVal 1829 } 1830 // when parentVal & childVal are both present, 1831 // we need to return a function that returns the 1832 // merged result of both functions... no need to 1833 // check if parentVal is a function here because 1834 // it has to be a function to pass previous merges. 1835 return function mergedDataFn () { 1836 return mergeData( 1837 typeof childVal === 'function' ? childVal.call(this, this) : childVal, 1838 typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal 1839 ) 1840 } 1841 } else { 1842 return function mergedInstanceDataFn () { 1843 // instance merge 1844 var instanceData = typeof childVal === 'function' 1845 ? childVal.call(vm, vm) 1846 : childVal; 1847 var defaultData = typeof parentVal === 'function' 1848 ? parentVal.call(vm, vm) 1849 : parentVal; 1850 if (instanceData) { 1851 return mergeData(instanceData, defaultData) 1852 } else { 1853 return defaultData 1854 } 1855 } 1856 } 1857} 1858 1859strats.data = function ( 1860 parentVal, 1861 childVal, 1862 vm 1863) { 1864 if (!vm) { 1865 if (childVal && typeof childVal !== 'function') { 1866 process.env.NODE_ENV !== 'production' && warn( 1867 'The "data" option should be a function ' + 1868 'that returns a per-instance value in component ' + 1869 'definitions.', 1870 vm 1871 ); 1872 1873 return parentVal 1874 } 1875 return mergeDataOrFn(parentVal, childVal) 1876 } 1877 1878 return mergeDataOrFn(parentVal, childVal, vm) 1879}; 1880 1881/** 1882 * Hooks and props are merged as arrays. 1883 */ 1884function mergeHook ( 1885 parentVal, 1886 childVal 1887) { 1888 var res = childVal 1889 ? parentVal 1890 ? parentVal.concat(childVal) 1891 : Array.isArray(childVal) 1892 ? childVal 1893 : [childVal] 1894 : parentVal; 1895 return res 1896 ? dedupeHooks(res) 1897 : res 1898} 1899 1900function dedupeHooks (hooks) { 1901 var res = []; 1902 for (var i = 0; i < hooks.length; i++) { 1903 if (res.indexOf(hooks[i]) === -1) { 1904 res.push(hooks[i]); 1905 } 1906 } 1907 return res 1908} 1909 1910LIFECYCLE_HOOKS.forEach(function (hook) { 1911 strats[hook] = mergeHook; 1912}); 1913 1914/** 1915 * Assets 1916 * 1917 * When a vm is present (instance creation), we need to do 1918 * a three-way merge between constructor options, instance 1919 * options and parent options. 1920 */ 1921function mergeAssets ( 1922 parentVal, 1923 childVal, 1924 vm, 1925 key 1926) { 1927 var res = Object.create(parentVal || null); 1928 if (childVal) { 1929 process.env.NODE_ENV !== 'production' && assertObjectType(key, childVal, vm); 1930 return extend(res, childVal) 1931 } else { 1932 return res 1933 } 1934} 1935 1936ASSET_TYPES.forEach(function (type) { 1937 strats[type + 's'] = mergeAssets; 1938}); 1939 1940/** 1941 * Watchers. 1942 * 1943 * Watchers hashes should not overwrite one 1944 * another, so we merge them as arrays. 1945 */ 1946strats.watch = function ( 1947 parentVal, 1948 childVal, 1949 vm, 1950 key 1951) { 1952 // work around Firefox's Object.prototype.watch... 1953 if (parentVal === nativeWatch) { parentVal = undefined; } 1954 if (childVal === nativeWatch) { childVal = undefined; } 1955 /* istanbul ignore if */ 1956 if (!childVal) { return Object.create(parentVal || null) } 1957 if (process.env.NODE_ENV !== 'production') { 1958 assertObjectType(key, childVal, vm); 1959 } 1960 if (!parentVal) { return childVal } 1961 var ret = {}; 1962 extend(ret, parentVal); 1963 for (var key$1 in childVal) { 1964 var parent = ret[key$1]; 1965 var child = childVal[key$1]; 1966 if (parent && !Array.isArray(parent)) { 1967 parent = [parent]; 1968 } 1969 ret[key$1] = parent 1970 ? parent.concat(child) 1971 : Array.isArray(child) ? child : [child]; 1972 } 1973 return ret 1974}; 1975 1976/** 1977 * Other object hashes. 1978 */ 1979strats.props = 1980strats.methods = 1981strats.inject = 1982strats.computed = function ( 1983 parentVal, 1984 childVal, 1985 vm, 1986 key 1987) { 1988 if (childVal && process.env.NODE_ENV !== 'production') { 1989 assertObjectType(key, childVal, vm); 1990 } 1991 if (!parentVal) { return childVal } 1992 var ret = Object.create(null); 1993 extend(ret, parentVal); 1994 if (childVal) { extend(ret, childVal); } 1995 return ret 1996}; 1997strats.provide = mergeDataOrFn; 1998 1999/** 2000 * Default strategy. 2001 */ 2002var defaultStrat = function (parentVal, childVal) { 2003 return childVal === undefined 2004 ? parentVal 2005 : childVal 2006}; 2007 2008/** 2009 * Validate component names 2010 */ 2011function checkComponents (options) { 2012 for (var key in options.components) { 2013 validateComponentName(key); 2014 } 2015} 2016 2017function validateComponentName (name) { 2018 if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) { 2019 warn( 2020 'Invalid component name: "' + name + '". Component names ' + 2021 'should conform to valid custom element name in html5 specification.' 2022 ); 2023 } 2024 if (isBuiltInTag(name) || config.isReservedTag(name)) { 2025 warn( 2026 'Do not use built-in or reserved HTML elements as component ' + 2027 'id: ' + name 2028 ); 2029 } 2030} 2031 2032/** 2033 * Ensure all props option syntax are normalized into the 2034 * Object-based format. 2035 */ 2036function normalizeProps (options, vm) { 2037 var props = options.props; 2038 if (!props) { return } 2039 var res = {}; 2040 var i, val, name; 2041 if (Array.isArray(props)) { 2042 i = props.length; 2043 while (i--) { 2044 val = props[i]; 2045 if (typeof val === 'string') { 2046 name = camelize(val); 2047 res[name] = { type: null }; 2048 } else if (process.env.NODE_ENV !== 'production') { 2049 warn('props must be strings when using array syntax.'); 2050 } 2051 } 2052 } else if (isPlainObject(props)) { 2053 for (var key in props) { 2054 val = props[key]; 2055 name = camelize(key); 2056 res[name] = isPlainObject(val) 2057 ? val 2058 : { type: val }; 2059 } 2060 } else if (process.env.NODE_ENV !== 'production') { 2061 warn( 2062 "Invalid value for option \"props\": expected an Array or an Object, " + 2063 "but got " + (toRawType(props)) + ".", 2064 vm 2065 ); 2066 } 2067 options.props = res; 2068} 2069 2070/** 2071 * Normalize all injections into Object-based format 2072 */ 2073function normalizeInject (options, vm) { 2074 var inject = options.inject; 2075 if (!inject) { return } 2076 var normalized = options.inject = {}; 2077 if (Array.isArray(inject)) { 2078 for (var i = 0; i < inject.length; i++) { 2079 normalized[inject[i]] = { from: inject[i] }; 2080 } 2081 } else if (isPlainObject(inject)) { 2082 for (var key in inject) { 2083 var val = inject[key]; 2084 normalized[key] = isPlainObject(val) 2085 ? extend({ from: key }, val) 2086 : { from: val }; 2087 } 2088 } else if (process.env.NODE_ENV !== 'production') { 2089 warn( 2090 "Invalid value for option \"inject\": expected an Array or an Object, " + 2091 "but got " + (toRawType(inject)) + ".", 2092 vm 2093 ); 2094 } 2095} 2096 2097/** 2098 * Normalize raw function directives into object format. 2099 */ 2100function normalizeDirectives (options) { 2101 var dirs = options.directives; 2102 if (dirs) { 2103 for (var key in dirs) { 2104 var def$$1 = dirs[key]; 2105 if (typeof def$$1 === 'function') { 2106 dirs[key] = { bind: def$$1, update: def$$1 }; 2107 } 2108 } 2109 } 2110} 2111 2112function assertObjectType (name, value, vm) { 2113 if (!isPlainObject(value)) { 2114 warn( 2115 "Invalid value for option \"" + name + "\": expected an Object, " + 2116 "but got " + (toRawType(value)) + ".", 2117 vm 2118 ); 2119 } 2120} 2121 2122/** 2123 * Merge two option objects into a new one. 2124 * Core utility used in both instantiation and inheritance. 2125 */ 2126function mergeOptions ( 2127 parent, 2128 child, 2129 vm 2130) { 2131 if (process.env.NODE_ENV !== 'production') { 2132 checkComponents(child); 2133 } 2134 2135 if (typeof child === 'function') { 2136 child = child.options; 2137 } 2138 2139 normalizeProps(child, vm); 2140 normalizeInject(child, vm); 2141 normalizeDirectives(child); 2142 2143 // Apply extends and mixins on the child options, 2144 // but only if it is a raw options object that isn't 2145 // the result of another mergeOptions call. 2146 // Only merged options has the _base property. 2147 if (!child._base) { 2148 if (child.extends) { 2149 parent = mergeOptions(parent, child.extends, vm); 2150 } 2151 if (child.mixins) { 2152 for (var i = 0, l = child.mixins.length; i < l; i++) { 2153 parent = mergeOptions(parent, child.mixins[i], vm); 2154 } 2155 } 2156 } 2157 2158 var options = {}; 2159 var key; 2160 for (key in parent) { 2161 mergeField(key); 2162 } 2163 for (key in child) { 2164 if (!hasOwn(parent, key)) { 2165 mergeField(key); 2166 } 2167 } 2168 function mergeField (key) { 2169 var strat = strats[key] || defaultStrat; 2170 options[key] = strat(parent[key], child[key], vm, key); 2171 } 2172 return options 2173} 2174 2175/** 2176 * Resolve an asset. 2177 * This function is used because child instances need access 2178 * to assets defined in its ancestor chain. 2179 */ 2180function resolveAsset ( 2181 options, 2182 type, 2183 id, 2184 warnMissing 2185) { 2186 /* istanbul ignore if */ 2187 if (typeof id !== 'string') { 2188 return 2189 } 2190 var assets = options[type]; 2191 // check local registration variations first 2192 if (hasOwn(assets, id)) { return assets[id] } 2193 var camelizedId = camelize(id); 2194 if (hasOwn(assets, camelizedId)) { return assets[camelizedId] } 2195 var PascalCaseId = capitalize(camelizedId); 2196 if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] } 2197 // fallback to prototype chain 2198 var res = assets[id] || assets[camelizedId] || assets[PascalCaseId]; 2199 if (process.env.NODE_ENV !== 'production' && warnMissing && !res) { 2200 warn( 2201 'Failed to resolve ' + type.slice(0, -1) + ': ' + id, 2202 options 2203 ); 2204 } 2205 return res 2206} 2207 2208/* */ 2209 2210 2211 2212function validateProp ( 2213 key, 2214 propOptions, 2215 propsData, 2216 vm 2217) { 2218 var prop = propOptions[key]; 2219 var absent = !hasOwn(propsData, key); 2220 var value = propsData[key]; 2221 // boolean casting 2222 var booleanIndex = getTypeIndex(Boolean, prop.type); 2223 if (booleanIndex > -1) { 2224 if (absent && !hasOwn(prop, 'default')) { 2225 value = false;
vendor: 7,553 bytes, lines 2226-2514
2226 } else if (value === '' || value === hyphenate(key)) { 2227 // only cast empty string / same name to boolean if 2228 // boolean has higher priority 2229 var stringIndex = getTypeIndex(String, prop.type); 2230 if (stringIndex < 0 || booleanIndex < stringIndex) { 2231 value = true; 2232 } 2233 } 2234 } 2235 // check default value 2236 if (value === undefined) { 2237 value = getPropDefaultValue(vm, prop, key); 2238 // since the default value is a fresh copy, 2239 // make sure to observe it. 2240 var prevShouldObserve = shouldObserve; 2241 toggleObserving(true); 2242 observe(value); 2243 toggleObserving(prevShouldObserve); 2244 } 2245 if ( 2246 process.env.NODE_ENV !== 'production' && 2247 // skip validation for weex recycle-list child component props 2248 !(false) 2249 ) { 2250 assertProp(prop, key, value, vm, absent); 2251 } 2252 return value 2253} 2254 2255/** 2256 * Get the default value of a prop. 2257 */ 2258function getPropDefaultValue (vm, prop, key) { 2259 // no default, return undefined 2260 if (!hasOwn(prop, 'default')) { 2261 return undefined 2262 } 2263 var def = prop.default; 2264 // warn against non-factory defaults for Object & Array 2265 if (process.env.NODE_ENV !== 'production' && isObject(def)) { 2266 warn( 2267 'Invalid default value for prop "' + key + '": ' + 2268 'Props with type Object/Array must use a factory function ' + 2269 'to return the default value.', 2270 vm 2271 ); 2272 } 2273 // the raw prop value was also undefined from previous render, 2274 // return previous default value to avoid unnecessary watcher trigger 2275 if (vm && vm.$options.propsData && 2276 vm.$options.propsData[key] === undefined && 2277 vm._props[key] !== undefined 2278 ) { 2279 return vm._props[key] 2280 } 2281 // call factory function for non-Function types 2282 // a value is Function if its prototype is function even across different execution context 2283 return typeof def === 'function' && getType(prop.type) !== 'Function' 2284 ? def.call(vm) 2285 : def 2286} 2287 2288/** 2289 * Assert whether a prop is valid. 2290 */ 2291function assertProp ( 2292 prop, 2293 name, 2294 value, 2295 vm, 2296 absent 2297) { 2298 if (prop.required && absent) { 2299 warn( 2300 'Missing required prop: "' + name + '"', 2301 vm 2302 ); 2303 return 2304 } 2305 if (value == null && !prop.required) { 2306 return 2307 } 2308 var type = prop.type; 2309 var valid = !type || type === true; 2310 var expectedTypes = []; 2311 if (type) { 2312 if (!Array.isArray(type)) { 2313 type = [type]; 2314 } 2315 for (var i = 0; i < type.length && !valid; i++) { 2316 var assertedType = assertType(value, type[i]); 2317 expectedTypes.push(assertedType.expectedType || ''); 2318 valid = assertedType.valid; 2319 } 2320 } 2321 2322 if (!valid) { 2323 warn( 2324 getInvalidTypeMessage(name, value, expectedTypes), 2325 vm 2326 ); 2327 return 2328 } 2329 var validator = prop.validator; 2330 if (validator) { 2331 if (!validator(value)) { 2332 warn( 2333 'Invalid prop: custom validator check failed for prop "' + name + '".', 2334 vm 2335 ); 2336 } 2337 } 2338} 2339 2340var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/; 2341 2342function assertType (value, type) { 2343 var valid; 2344 var expectedType = getType(type); 2345 if (simpleCheckRE.test(expectedType)) { 2346 var t = typeof value; 2347 valid = t === expectedType.toLowerCase(); 2348 // for primitive wrapper objects 2349 if (!valid && t === 'object') { 2350 valid = value instanceof type; 2351 } 2352 } else if (expectedType === 'Object') { 2353 valid = isPlainObject(value); 2354 } else if (expectedType === 'Array') { 2355 valid = Array.isArray(value); 2356 } else { 2357 valid = value instanceof type; 2358 } 2359 return { 2360 valid: valid, 2361 expectedType: expectedType 2362 } 2363} 2364 2365/** 2366 * Use function string name to check built-in types, 2367 * because a simple equality check will fail when running 2368 * across different vms / iframes. 2369 */ 2370function getType (fn) { 2371 var match = fn && fn.toString().match(/^\s*function (\w+)/); 2372 return match ? match[1] : '' 2373} 2374 2375function isSameType (a, b) { 2376 return getType(a) === getType(b) 2377} 2378 2379function getTypeIndex (type, expectedTypes) { 2380 if (!Array.isArray(expectedTypes)) { 2381 return isSameType(expectedTypes, type) ? 0 : -1 2382 } 2383 for (var i = 0, len = expectedTypes.length; i < len; i++) { 2384 if (isSameType(expectedTypes[i], type)) { 2385 return i 2386 } 2387 } 2388 return -1 2389} 2390 2391function getInvalidTypeMessage (name, value, expectedTypes) { 2392 var message = "Invalid prop: type check failed for prop \"" + name + "\"." + 2393 " Expected " + (expectedTypes.map(capitalize).join(', ')); 2394 var expectedType = expectedTypes[0]; 2395 var receivedType = toRawType(value); 2396 var expectedValue = styleValue(value, expectedType); 2397 var receivedValue = styleValue(value, receivedType); 2398 // check if we need to specify expected value 2399 if (expectedTypes.length === 1 && 2400 isExplicable(expectedType) && 2401 !isBoolean(expectedType, receivedType)) { 2402 message += " with value " + expectedValue; 2403 } 2404 message += ", got " + receivedType + " "; 2405 // check if we need to specify received value 2406 if (isExplicable(receivedType)) { 2407 message += "with value " + receivedValue + "."; 2408 } 2409 return message 2410} 2411 2412function styleValue (value, type) { 2413 if (type === 'String') { 2414 return ("\"" + value + "\"") 2415 } else if (type === 'Number') { 2416 return ("" + (Number(value))) 2417 } else { 2418 return ("" + value) 2419 } 2420} 2421 2422function isExplicable (value) { 2423 var explicitTypes = ['string', 'number', 'boolean']; 2424 return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; }) 2425} 2426 2427function isBoolean () { 2428 var args = [], len = arguments.length; 2429 while ( len-- ) args[ len ] = arguments[ len ]; 2430 2431 return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; }) 2432} 2433 2434/* */ 2435 2436function handleError (err, vm, info) { 2437 // Deactivate deps tracking while processing error handler to avoid possible infinite rendering. 2438 // See: https://github.com/vuejs/vuex/issues/1505 2439 pushTarget(); 2440 try { 2441 if (vm) { 2442 var cur = vm; 2443 while ((cur = cur.$parent)) { 2444 var hooks = cur.$options.errorCaptured; 2445 if (hooks) { 2446 for (var i = 0; i < hooks.length; i++) { 2447 try { 2448 var capture = hooks[i].call(cur, err, vm, info) === false; 2449 if (capture) { return } 2450 } catch (e) { 2451 globalHandleError(e, cur, 'errorCaptured hook'); 2452 } 2453 } 2454 } 2455 } 2456 } 2457 globalHandleError(err, vm, info); 2458 } finally { 2459 popTarget(); 2460 } 2461} 2462 2463function invokeWithErrorHandling ( 2464 handler, 2465 context, 2466 args, 2467 vm, 2468 info 2469) { 2470 var res; 2471 try { 2472 res = args ? handler.apply(context, args) : handler.call(context); 2473 if (res && !res._isVue && isPromise(res) && !res._handled) { 2474 res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); }); 2475 // issue #9511 2476 // avoid catch triggering multiple times when nested calls 2477 res._handled = true; 2478 } 2479 } catch (e) { 2480 handleError(e, vm, info); 2481 } 2482 return res 2483} 2484 2485function globalHandleError (err, vm, info) { 2486 if (config.errorHandler) { 2487 try { 2488 return config.errorHandler.call(null, err, vm, info) 2489 } catch (e) { 2490 // if the user intentionally throws the original error in the handler, 2491 // do not log it twice 2492 if (e !== err) { 2493 logError(e, null, 'config.errorHandler'); 2494 } 2495 } 2496 } 2497 logError(err, vm, info); 2498} 2499 2500function logError (err, vm, info) { 2501 if (process.env.NODE_ENV !== 'production') { 2502 warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm); 2503 } 2504 /* istanbul ignore else */ 2505 if ((inBrowser || inWeex) && typeof console !== 'undefined') { 2506 console.error(err); 2507 } else { 2508 throw err 2509 } 2510} 2511 2512/* */ 2513 2514var isUsingMicroTask = false;
vendor: 4,247 bytes, lines 2515-2649
2515 2516var callbacks = []; 2517var pending = false; 2518 2519function flushCallbacks () { 2520 pending = false; 2521 var copies = callbacks.slice(0); 2522 callbacks.length = 0; 2523 for (var i = 0; i < copies.length; i++) { 2524 copies[i](); 2525 } 2526} 2527 2528// Here we have async deferring wrappers using microtasks. 2529// In 2.5 we used (macro) tasks (in combination with microtasks). 2530// However, it has subtle problems when state is changed right before repaint 2531// (e.g. #6813, out-in transitions). 2532// Also, using (macro) tasks in event handler would cause some weird behaviors 2533// that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109). 2534// So we now use microtasks everywhere, again. 2535// A major drawback of this tradeoff is that there are some scenarios 2536// where microtasks have too high a priority and fire in between supposedly 2537// sequential events (e.g. #4521, #6690, which have workarounds) 2538// or even between bubbling of the same event (#6566). 2539var timerFunc; 2540 2541// The nextTick behavior leverages the microtask queue, which can be accessed 2542// via either native Promise.then or MutationObserver. 2543// MutationObserver has wider support, however it is seriously bugged in 2544// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It 2545// completely stops working after triggering a few times... so, if native 2546// Promise is available, we will use it: 2547/* istanbul ignore next, $flow-disable-line */ 2548if (typeof Promise !== 'undefined' && isNative(Promise)) { 2549 var p = Promise.resolve(); 2550 timerFunc = function () { 2551 p.then(flushCallbacks); 2552 // In problematic UIWebViews, Promise.then doesn't completely break, but 2553 // it can get stuck in a weird state where callbacks are pushed into the 2554 // microtask queue but the queue isn't being flushed, until the browser 2555 // needs to do some other work, e.g. handle a timer. Therefore we can 2556 // "force" the microtask queue to be flushed by adding an empty timer. 2557 if (isIOS) { setTimeout(noop); } 2558 }; 2559 isUsingMicroTask = true; 2560} else if (!isIE && typeof MutationObserver !== 'undefined' && ( 2561 isNative(MutationObserver) || 2562 // PhantomJS and iOS 7.x 2563 MutationObserver.toString() === '[object MutationObserverConstructor]' 2564)) { 2565 // Use MutationObserver where native Promise is not available, 2566 // e.g. PhantomJS, iOS7, Android 4.4 2567 // (#6466 MutationObserver is unreliable in IE11) 2568 var counter = 1; 2569 var observer = new MutationObserver(flushCallbacks); 2570 var textNode = document.createTextNode(String(counter)); 2571 observer.observe(textNode, { 2572 characterData: true 2573 }); 2574 timerFunc = function () { 2575 counter = (counter + 1) % 2; 2576 textNode.data = String(counter); 2577 }; 2578 isUsingMicroTask = true; 2579} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { 2580 // Fallback to setImmediate. 2581 // Technically it leverages the (macro) task queue, 2582 // but it is still a better choice than setTimeout. 2583 timerFunc = function () { 2584 setImmediate(flushCallbacks); 2585 }; 2586} else { 2587 // Fallback to setTimeout. 2588 timerFunc = function () { 2589 setTimeout(flushCallbacks, 0); 2590 }; 2591} 2592 2593function nextTick (cb, ctx) { 2594 var _resolve; 2595 callbacks.push(function () { 2596 if (cb) { 2597 try { 2598 cb.call(ctx); 2599 } catch (e) { 2600 handleError(e, ctx, 'nextTick'); 2601 } 2602 } else if (_resolve) { 2603 _resolve(ctx); 2604 } 2605 }); 2606 if (!pending) { 2607 pending = true; 2608 timerFunc(); 2609 } 2610 // $flow-disable-line 2611 if (!cb && typeof Promise !== 'undefined') { 2612 return new Promise(function (resolve) { 2613 _resolve = resolve; 2614 }) 2615 } 2616} 2617 2618/* */ 2619 2620var mark; 2621var measure; 2622 2623if (process.env.NODE_ENV !== 'production') { 2624 var perf = inBrowser && window.performance; 2625 /* istanbul ignore if */ 2626 if ( 2627 perf && 2628 perf.mark && 2629 perf.measure && 2630 perf.clearMarks && 2631 perf.clearMeasures 2632 ) { 2633 mark = function (tag) { return perf.mark(tag); }; 2634 measure = function (name, startTag, endTag) { 2635 perf.measure(name, startTag, endTag); 2636 perf.clearMarks(startTag); 2637 perf.clearMarks(endTag); 2638 // perf.clearMeasures(name) 2639 }; 2640 } 2641} 2642 2643/* not type checking this file because flow doesn't play well with Proxy */ 2644 2645var initProxy; 2646 2647if (process.env.NODE_ENV !== 'production') { 2648 var allowedGlobals = makeMap( 2649 'Infinity,undefined,NaN,isFinite,isNaN,' +
2650 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' + 2651 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' + 2652 'require' // for Webpack/Browserify 2653 ); 2654 2655 var warnNonPresent = function (target, key) { 2656 warn( 2657 "Property or method \"" + key + "\" is not defined on the instance but " + 2658 'referenced during render. Make sure that this property is reactive, ' + 2659 'either in the data option, or for class-based components, by ' + 2660 'initializing the property. ' + 2661 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', 2662 target 2663 ); 2664 }; 2665 2666 var warnReservedPrefix = function (target, key) { 2667 warn( 2668 "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + 2669 'properties starting with "$" or "_" are not proxied in the Vue instance to ' + 2670 'prevent conflicts with Vue internals. ' + 2671 'See: https://vuejs.org/v2/api/#data', 2672 target 2673 ); 2674 }; 2675 2676 var hasProxy = 2677 typeof Proxy !== 'undefined' && isNative(Proxy); 2678 2679 if (hasProxy) { 2680 var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact'); 2681 config.keyCodes = new Proxy(config.keyCodes, { 2682 set: function set (target, key, value) { 2683 if (isBuiltInModifier(key)) { 2684 warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key)); 2685 return false 2686 } else { 2687 target[key] = value; 2688 return true 2689 } 2690 } 2691 }); 2692 } 2693 2694 var hasHandler = { 2695 has: function has (target, key) { 2696 var has = key in target; 2697 var isAllowed = allowedGlobals(key) || 2698 (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data)); 2699 if (!has && !isAllowed) { 2700 if (key in target.$data) { warnReservedPrefix(target, key); } 2701 else { warnNonPresent(target, key); } 2702 } 2703 return has || !isAllowed 2704 } 2705 }; 2706 2707 var getHandler = { 2708 get: function get (target, key) { 2709 if (typeof key === 'string' && !(key in target)) { 2710 if (key in target.$data) { warnReservedPrefix(target, key); } 2711 else { warnNonPresent(target, key); } 2712 } 2713 return target[key] 2714 } 2715 }; 2716 2717 initProxy = function initProxy (vm) { 2718 if (hasProxy) { 2719 // determine which proxy handler to use 2720 var options = vm.$options; 2721 var handlers = options.render && options.render._withStripped 2722 ? getHandler 2723 : hasHandler; 2724 vm._renderProxy = new Proxy(vm, handlers); 2725 } else { 2726 vm._renderProxy = vm; 2727 } 2728 }; 2729} 2730 2731/* */ 2732 2733var seenObjects = new _Set(); 2734 2735/** 2736 * Recursively traverse an object to evoke all converted 2737 * getters, so that every nested property inside the object 2738 * is collected as a "deep" dependency. 2739 */ 2740function traverse (val) { 2741 _traverse(val, seenObjects); 2742 seenObjects.clear(); 2743} 2744 2745function _traverse (val, seen) { 2746 var i, keys; 2747 var isA = Array.isArray(val); 2748 if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) { 2749 return 2750 } 2751 if (val.__ob__) { 2752 var depId = val.__ob__.dep.id; 2753 if (seen.has(depId)) { 2754 return 2755 } 2756 seen.add(depId); 2757 } 2758 if (isA) { 2759 i = val.length; 2760 while (i--) { _traverse(val[i], seen); } 2761 } else { 2762 keys = Object.keys(val); 2763 i = keys.length; 2764 while (i--) { _traverse(val[keys[i]], seen); } 2765 } 2766} 2767 2768/* */ 2769 2770var normalizeEvent = cached(function (name) { 2771 var passive = name.charAt(0) === '&'; 2772 name = passive ? name.slice(1) : name; 2773 var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first 2774 name = once$$1 ? name.slice(1) : name; 2775 var capture = name.charAt(0) === '!'; 2776 name = capture ? name.slice(1) : name; 2777 return { 2778 name: name, 2779 once: once$$1, 2780 capture: capture, 2781 passive: passive 2782 } 2783}); 2784 2785function createFnInvoker (fns, vm) { 2786 function invoker () { 2787 var arguments$1 = arguments; 2788 2789 var fns = invoker.fns; 2790 if (Array.isArray(fns)) { 2791 var cloned = fns.slice(); 2792 for (var i = 0; i < cloned.length; i++) { 2793 invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler"); 2794 } 2795 } else { 2796 // return handler return value for single handlers 2797 return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler") 2798 } 2799 } 2800 invoker.fns = fns; 2801 return invoker 2802} 2803 2804function updateListeners ( 2805 on, 2806 oldOn, 2807 add, 2808 remove$$1, 2809 createOnceHandler, 2810 vm 2811) { 2812 var name, def$$1, cur, old, event; 2813 for (name in on) { 2814 def$$1 = cur = on[name]; 2815 old = oldOn[name]; 2816 event = normalizeEvent(name); 2817 if (isUndef(cur)) { 2818 process.env.NODE_ENV !== 'production' && warn( 2819 "Invalid handler for event \"" + (event.name) + "\": got " + String(cur), 2820 vm 2821 ); 2822 } else if (isUndef(old)) { 2823 if (isUndef(cur.fns)) { 2824 cur = on[name] = createFnInvoker(cur, vm); 2825 } 2826 if (isTrue(event.once)) { 2827 cur = on[name] = createOnceHandler(event.name, cur, event.capture); 2828 } 2829 add(event.name, cur, event.capture, event.passive, event.params); 2830 } else if (cur !== old) { 2831 old.fns = cur; 2832 on[name] = old; 2833 } 2834 } 2835 for (name in oldOn) { 2836 if (isUndef(on[name])) { 2837 event = normalizeEvent(name); 2838 remove$$1(event.name, oldOn[name], event.capture); 2839 } 2840 } 2841} 2842 2843/* */ 2844 2845function mergeVNodeHook (def, hookKey, hook) { 2846 if (def instanceof VNode) { 2847 def = def.data.hook || (def.data.hook = {}); 2848 } 2849 var invoker; 2850 var oldHook = def[hookKey]; 2851 2852 function wrappedHook () { 2853 hook.apply(this, arguments); 2854 // important: remove merged hook to ensure it's called only once 2855 // and prevent memory leak 2856 remove(invoker.fns, wrappedHook); 2857 } 2858 2859 if (isUndef(oldHook)) { 2860 // no existing hook 2861 invoker = createFnInvoker([wrappedHook]); 2862 } else { 2863 /* istanbul ignore if */ 2864 if (isDef(oldHook.fns) && isTrue(oldHook.merged)) { 2865 // already a merged invoker 2866 invoker = oldHook; 2867 invoker.fns.push(wrappedHook); 2868 } else { 2869 // existing plain hook 2870 invoker = createFnInvoker([oldHook, wrappedHook]); 2871 } 2872 } 2873 2874 invoker.merged = true; 2875 def[hookKey] = invoker; 2876} 2877 2878/* */ 2879 2880function extractPropsFromVNodeData ( 2881 data, 2882 Ctor, 2883 tag 2884) { 2885 // we are only extracting raw values here. 2886 // validation and default values are handled in the child 2887 // component itself. 2888 var propOptions = Ctor.options.props; 2889 if (isUndef(propOptions)) { 2890 return 2891 } 2892 var res = {}; 2893 var attrs = data.attrs; 2894 var props = data.props; 2895 if (isDef(attrs) || isDef(props)) { 2896 for (var key in propOptions) { 2897 var altKey = hyphenate(key); 2898 if (process.env.NODE_ENV !== 'production') { 2899 var keyInLowerCase = key.toLowerCase(); 2900 if ( 2901 key !== keyInLowerCase && 2902 attrs && hasOwn(attrs, keyInLowerCase) 2903 ) { 2904 tip( 2905 "Prop \"" + keyInLowerCase + "\" is passed to component " + 2906 (formatComponentName(tag || Ctor)) + ", but the declared prop name is" + 2907 " \"" + key + "\". " + 2908 "Note that HTML attributes are case-insensitive and camelCased " + 2909 "props need to use their kebab-case equivalents when using in-DOM " + 2910 "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"." 2911 ); 2912 } 2913 } 2914 checkProp(res, props, key, altKey, true) || 2915 checkProp(res, attrs, key, altKey, false); 2916 } 2917 } 2918 return res 2919} 2920 2921function checkProp ( 2922 res, 2923 hash, 2924 key, 2925 altKey, 2926 preserve 2927) {
vendor: 5,396 bytes, lines 2928-3096
2928 if (isDef(hash)) { 2929 if (hasOwn(hash, key)) { 2930 res[key] = hash[key]; 2931 if (!preserve) { 2932 delete hash[key]; 2933 } 2934 return true 2935 } else if (hasOwn(hash, altKey)) { 2936 res[key] = hash[altKey]; 2937 if (!preserve) { 2938 delete hash[altKey]; 2939 } 2940 return true 2941 } 2942 } 2943 return false 2944} 2945 2946/* */ 2947 2948// The template compiler attempts to minimize the need for normalization by 2949// statically analyzing the template at compile time. 2950// 2951// For plain HTML markup, normalization can be completely skipped because the 2952// generated render function is guaranteed to return Array<VNode>. There are 2953// two cases where extra normalization is needed: 2954 2955// 1. When the children contains components - because a functional component 2956// may return an Array instead of a single root. In this case, just a simple 2957// normalization is needed - if any child is an Array, we flatten the whole 2958// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep 2959// because functional components already normalize their own children. 2960function simpleNormalizeChildren (children) { 2961 for (var i = 0; i < children.length; i++) { 2962 if (Array.isArray(children[i])) { 2963 return Array.prototype.concat.apply([], children) 2964 } 2965 } 2966 return children 2967} 2968 2969// 2. When the children contains constructs that always generated nested Arrays, 2970// e.g. <template>, <slot>, v-for, or when the children is provided by user 2971// with hand-written render functions / JSX. In such cases a full normalization 2972// is needed to cater to all possible types of children values. 2973function normalizeChildren (children) { 2974 return isPrimitive(children) 2975 ? [createTextVNode(children)] 2976 : Array.isArray(children) 2977 ? normalizeArrayChildren(children) 2978 : undefined 2979} 2980 2981function isTextNode (node) { 2982 return isDef(node) && isDef(node.text) && isFalse(node.isComment) 2983} 2984 2985function normalizeArrayChildren (children, nestedIndex) { 2986 var res = []; 2987 var i, c, lastIndex, last; 2988 for (i = 0; i < children.length; i++) { 2989 c = children[i]; 2990 if (isUndef(c) || typeof c === 'boolean') { continue } 2991 lastIndex = res.length - 1; 2992 last = res[lastIndex]; 2993 // nested 2994 if (Array.isArray(c)) { 2995 if (c.length > 0) { 2996 c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)); 2997 // merge adjacent text nodes 2998 if (isTextNode(c[0]) && isTextNode(last)) { 2999 res[lastIndex] = createTextVNode(last.text + (c[0]).text); 3000 c.shift(); 3001 } 3002 res.push.apply(res, c); 3003 } 3004 } else if (isPrimitive(c)) { 3005 if (isTextNode(last)) { 3006 // merge adjacent text nodes 3007 // this is necessary for SSR hydration because text nodes are 3008 // essentially merged when rendered to HTML strings 3009 res[lastIndex] = createTextVNode(last.text + c); 3010 } else if (c !== '') { 3011 // convert primitive to vnode 3012 res.push(createTextVNode(c)); 3013 } 3014 } else { 3015 if (isTextNode(c) && isTextNode(last)) { 3016 // merge adjacent text nodes 3017 res[lastIndex] = createTextVNode(last.text + c.text); 3018 } else { 3019 // default key for nested array children (likely generated by v-for) 3020 if (isTrue(children._isVList) && 3021 isDef(c.tag) && 3022 isUndef(c.key) && 3023 isDef(nestedIndex)) { 3024 c.key = "__vlist" + nestedIndex + "_" + i + "__"; 3025 } 3026 res.push(c); 3027 } 3028 } 3029 } 3030 return res 3031} 3032 3033/* */ 3034 3035function initProvide (vm) { 3036 var provide = vm.$options.provide; 3037 if (provide) { 3038 vm._provided = typeof provide === 'function' 3039 ? provide.call(vm) 3040 : provide; 3041 } 3042} 3043 3044function initInjections (vm) { 3045 var result = resolveInject(vm.$options.inject, vm); 3046 if (result) { 3047 toggleObserving(false); 3048 Object.keys(result).forEach(function (key) { 3049 /* istanbul ignore else */ 3050 if (process.env.NODE_ENV !== 'production') { 3051 defineReactive$$1(vm, key, result[key], function () { 3052 warn( 3053 "Avoid mutating an injected value directly since the changes will be " + 3054 "overwritten whenever the provided component re-renders. " + 3055 "injection being mutated: \"" + key + "\"", 3056 vm 3057 ); 3058 }); 3059 } else { 3060 defineReactive$$1(vm, key, result[key]); 3061 } 3062 }); 3063 toggleObserving(true); 3064 } 3065} 3066 3067function resolveInject (inject, vm) { 3068 if (inject) { 3069 // inject is :any because flow is not smart enough to figure out cached 3070 var result = Object.create(null); 3071 var keys = hasSymbol 3072 ? Reflect.ownKeys(inject) 3073 : Object.keys(inject); 3074 3075 for (var i = 0; i < keys.length; i++) { 3076 var key = keys[i]; 3077 // #6574 in case the inject object is observed... 3078 if (key === '__ob__') { continue } 3079 var provideKey = inject[key].from; 3080 var source = vm; 3081 while (source) { 3082 if (source._provided && hasOwn(source._provided, provideKey)) { 3083 result[key] = source._provided[provideKey]; 3084 break 3085 } 3086 source = source.$parent; 3087 } 3088 if (!source) { 3089 if ('default' in inject[key]) { 3090 var provideDefault = inject[key].default; 3091 result[key] = typeof provideDefault === 'function' 3092 ? provideDefault.call(vm) 3093 : provideDefault; 3094 } else if (process.env.NODE_ENV !== 'production') { 3095 warn(("Injection \"" + key + "\" not found"), vm); 3096
vendor: 4,905 bytes, lines 3096-3296
3096} 3097 } 3098 } 3099 return result 3100 } 3101} 3102 3103/* */ 3104 3105 3106 3107/** 3108 * Runtime helper for resolving raw children VNodes into a slot object. 3109 */ 3110function resolveSlots ( 3111 children, 3112 context 3113) { 3114 if (!children || !children.length) { 3115 return {} 3116 } 3117 var slots = {}; 3118 for (var i = 0, l = children.length; i < l; i++) { 3119 var child = children[i]; 3120 var data = child.data; 3121 // remove slot attribute if the node is resolved as a Vue slot node 3122 if (data && data.attrs && data.attrs.slot) { 3123 delete data.attrs.slot; 3124 } 3125 // named slots should only be respected if the vnode was rendered in the 3126 // same context. 3127 if ((child.context === context || child.fnContext === context) && 3128 data && data.slot != null 3129 ) { 3130 var name = data.slot; 3131 var slot = (slots[name] || (slots[name] = [])); 3132 if (child.tag === 'template') { 3133 slot.push.apply(slot, child.children || []); 3134 } else { 3135 slot.push(child); 3136 } 3137 } else { 3138 (slots.default || (slots.default = [])).push(child); 3139 } 3140 } 3141 // ignore slots that contains only whitespace 3142 for (var name$1 in slots) { 3143 if (slots[name$1].every(isWhitespace)) { 3144 delete slots[name$1]; 3145 } 3146 } 3147 return slots 3148} 3149 3150function isWhitespace (node) { 3151 return (node.isComment && !node.asyncFactory) || node.text === ' ' 3152} 3153 3154/* */ 3155 3156function normalizeScopedSlots ( 3157 slots, 3158 normalSlots, 3159 prevSlots 3160) { 3161 var res; 3162 var hasNormalSlots = Object.keys(normalSlots).length > 0; 3163 var isStable = slots ? !!slots.$stable : !hasNormalSlots; 3164 var key = slots && slots.$key; 3165 if (!slots) { 3166 res = {}; 3167 } else if (slots._normalized) { 3168 // fast path 1: child component re-render only, parent did not change 3169 return slots._normalized 3170 } else if ( 3171 isStable && 3172 prevSlots && 3173 prevSlots !== emptyObject && 3174 key === prevSlots.$key && 3175 !hasNormalSlots && 3176 !prevSlots.$hasNormal 3177 ) { 3178 // fast path 2: stable scoped slots w/ no normal slots to proxy, 3179 // only need to normalize once 3180 return prevSlots 3181 } else { 3182 res = {}; 3183 for (var key$1 in slots) { 3184 if (slots[key$1] && key$1[0] !== '$') { 3185 res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]); 3186 } 3187 } 3188 } 3189 // expose normal slots on scopedSlots 3190 for (var key$2 in normalSlots) { 3191 if (!(key$2 in res)) { 3192 res[key$2] = proxyNormalSlot(normalSlots, key$2); 3193 } 3194 } 3195 // avoriaz seems to mock a non-extensible $scopedSlots object 3196 // and when that is passed down this would cause an error 3197 if (slots && Object.isExtensible(slots)) { 3198 (slots)._normalized = res; 3199 } 3200 def(res, '$stable', isStable); 3201 def(res, '$key', key); 3202 def(res, '$hasNormal', hasNormalSlots); 3203 return res 3204} 3205 3206function normalizeScopedSlot(normalSlots, key, fn) { 3207 var normalized = function () { 3208 var res = arguments.length ? fn.apply(null, arguments) : fn({}); 3209 res = res && typeof res === 'object' && !Array.isArray(res) 3210 ? [res] // single vnode 3211 : normalizeChildren(res); 3212 return res && ( 3213 res.length === 0 || 3214 (res.length === 1 && res[0].isComment) // #9658 3215 ) ? undefined 3216 : res 3217 }; 3218 // this is a slot using the new v-slot syntax without scope. although it is 3219 // compiled as a scoped slot, render fn users would expect it to be present 3220 // on this.$slots because the usage is semantically a normal slot. 3221 if (fn.proxy) { 3222 Object.defineProperty(normalSlots, key, { 3223 get: normalized, 3224 enumerable: true, 3225 configurable: true 3226 }); 3227 } 3228 return normalized 3229} 3230 3231function proxyNormalSlot(slots, key) { 3232 return function () { return slots[key]; } 3233} 3234 3235/* */ 3236 3237/** 3238 * Runtime helper for rendering v-for lists. 3239 */ 3240function renderList ( 3241 val, 3242 render 3243) { 3244 var ret, i, l, keys, key; 3245 if (Array.isArray(val) || typeof val === 'string') { 3246 ret = new Array(val.length); 3247 for (i = 0, l = val.length; i < l; i++) { 3248 ret[i] = render(val[i], i); 3249 } 3250 } else if (typeof val === 'number') { 3251 ret = new Array(val); 3252 for (i = 0; i < val; i++) { 3253 ret[i] = render(i + 1, i); 3254 } 3255 } else if (isObject(val)) { 3256 if (hasSymbol && val[Symbol.iterator]) { 3257 ret = []; 3258 var iterator = val[Symbol.iterator](); 3259 var result = iterator.next(); 3260 while (!result.done) { 3261 ret.push(render(result.value, ret.length)); 3262 result = iterator.next(); 3263 } 3264 } else { 3265 keys = Object.keys(val); 3266 ret = new Array(keys.length); 3267 for (i = 0, l = keys.length; i < l; i++) { 3268 key = keys[i]; 3269 ret[i] = render(val[key], key, i); 3270 } 3271 } 3272 } 3273 if (!isDef(ret)) { 3274 ret = []; 3275 } 3276 (ret)._isVList = true; 3277 return ret 3278} 3279 3280/* */ 3281 3282/** 3283 * Runtime helper for rendering <slot> 3284 */ 3285function renderSlot ( 3286 name, 3287 fallback, 3288 props, 3289 bindObject 3290) { 3291 var scopedSlotFn = this.$scopedSlots[name]; 3292 var nodes; 3293 if (scopedSlotFn) { // scoped slot 3294 props = props || {}; 3295 if (bindObject) { 3296 if (
vendor: 2,829 bytes, lines 3296-3418
3296process.env.NODE_ENV !== 'production' && !isObject(bindObject)) { 3297 warn( 3298 'slot v-bind without argument expects an Object', 3299 this 3300 ); 3301 } 3302 props = extend(extend({}, bindObject), props); 3303 } 3304 nodes = scopedSlotFn(props) || fallback; 3305 } else { 3306 nodes = this.$slots[name] || fallback; 3307 } 3308 3309 var target = props && props.slot; 3310 if (target) { 3311 return this.$createElement('template', { slot: target }, nodes) 3312 } else { 3313 return nodes 3314 } 3315} 3316 3317/* */ 3318 3319/** 3320 * Runtime helper for resolving filters 3321 */ 3322function resolveFilter (id) { 3323 return resolveAsset(this.$options, 'filters', id, true) || identity 3324} 3325 3326/* */ 3327 3328function isKeyNotMatch (expect, actual) { 3329 if (Array.isArray(expect)) { 3330 return expect.indexOf(actual) === -1 3331 } else { 3332 return expect !== actual 3333 } 3334} 3335 3336/** 3337 * Runtime helper for checking keyCodes from config. 3338 * exposed as Vue.prototype._k 3339 * passing in eventKeyName as last argument separately for backwards compat 3340 */ 3341function checkKeyCodes ( 3342 eventKeyCode, 3343 key, 3344 builtInKeyCode, 3345 eventKeyName, 3346 builtInKeyName 3347) { 3348 var mappedKeyCode = config.keyCodes[key] || builtInKeyCode; 3349 if (builtInKeyName && eventKeyName && !config.keyCodes[key]) { 3350 return isKeyNotMatch(builtInKeyName, eventKeyName) 3351 } else if (mappedKeyCode) { 3352 return isKeyNotMatch(mappedKeyCode, eventKeyCode) 3353 } else if (eventKeyName) { 3354 return hyphenate(eventKeyName) !== key 3355 } 3356} 3357 3358/* */ 3359 3360/** 3361 * Runtime helper for merging v-bind="object" into a VNode's data. 3362 */ 3363function bindObjectProps ( 3364 data, 3365 tag, 3366 value, 3367 asProp, 3368 isSync 3369) { 3370 if (value) { 3371 if (!isObject(value)) { 3372 process.env.NODE_ENV !== 'production' && warn( 3373 'v-bind without argument expects an Object or Array value', 3374 this 3375 ); 3376 } else { 3377 if (Array.isArray(value)) { 3378 value = toObject(value); 3379 } 3380 var hash; 3381 var loop = function ( key ) { 3382 if ( 3383 key === 'class' || 3384 key === 'style' || 3385 isReservedAttribute(key) 3386 ) { 3387 hash = data; 3388 } else { 3389 var type = data.attrs && data.attrs.type; 3390 hash = asProp || config.mustUseProp(tag, type, key) 3391 ? data.domProps || (data.domProps = {}) 3392 : data.attrs || (data.attrs = {}); 3393 } 3394 var camelizedKey = camelize(key); 3395 var hyphenatedKey = hyphenate(key); 3396 if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) { 3397 hash[key] = value[key]; 3398 3399 if (isSync) { 3400 var on = data.on || (data.on = {}); 3401 on[("update:" + key)] = function ($event) { 3402 value[key] = $event; 3403 }; 3404 } 3405 } 3406 }; 3407 3408 for (var key in value) loop( key ); 3409 } 3410 } 3411 return data 3412} 3413 3414/* */ 3415 3416/** 3417 * Runtime helper for rendering static trees. 3418 */
vendor: 7,104 bytes, lines 3419-3691
3419function renderStatic ( 3420 index, 3421 isInFor 3422) { 3423 var cached = this._staticTrees || (this._staticTrees = []); 3424 var tree = cached[index]; 3425 // if has already-rendered static tree and not inside v-for, 3426 // we can reuse the same tree. 3427 if (tree && !isInFor) { 3428 return tree 3429 } 3430 // otherwise, render a fresh tree. 3431 tree = cached[index] = this.$options.staticRenderFns[index].call( 3432 this._renderProxy, 3433 null, 3434 this // for render fns generated for functional component templates 3435 ); 3436 markStatic(tree, ("__static__" + index), false); 3437 return tree 3438} 3439 3440/** 3441 * Runtime helper for v-once. 3442 * Effectively it means marking the node as static with a unique key. 3443 */ 3444function markOnce ( 3445 tree, 3446 index, 3447 key 3448) { 3449 markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true); 3450 return tree 3451} 3452 3453function markStatic ( 3454 tree, 3455 key, 3456 isOnce 3457) { 3458 if (Array.isArray(tree)) { 3459 for (var i = 0; i < tree.length; i++) { 3460 if (tree[i] && typeof tree[i] !== 'string') { 3461 markStaticNode(tree[i], (key + "_" + i), isOnce); 3462 } 3463 } 3464 } else { 3465 markStaticNode(tree, key, isOnce); 3466 } 3467} 3468 3469function markStaticNode (node, key, isOnce) { 3470 node.isStatic = true; 3471 node.key = key; 3472 node.isOnce = isOnce; 3473} 3474 3475/* */ 3476 3477function bindObjectListeners (data, value) { 3478 if (value) { 3479 if (!isPlainObject(value)) { 3480 process.env.NODE_ENV !== 'production' && warn( 3481 'v-on without argument expects an Object value', 3482 this 3483 ); 3484 } else { 3485 var on = data.on = data.on ? extend({}, data.on) : {}; 3486 for (var key in value) { 3487 var existing = on[key]; 3488 var ours = value[key]; 3489 on[key] = existing ? [].concat(existing, ours) : ours; 3490 } 3491 } 3492 } 3493 return data 3494} 3495 3496/* */ 3497 3498function resolveScopedSlots ( 3499 fns, // see flow/vnode 3500 res, 3501 // the following are added in 2.6 3502 hasDynamicKeys, 3503 contentHashKey 3504) { 3505 res = res || { $stable: !hasDynamicKeys }; 3506 for (var i = 0; i < fns.length; i++) { 3507 var slot = fns[i]; 3508 if (Array.isArray(slot)) { 3509 resolveScopedSlots(slot, res, hasDynamicKeys); 3510 } else if (slot) { 3511 // marker for reverse proxying v-slot without scope on this.$slots 3512 if (slot.proxy) { 3513 slot.fn.proxy = true; 3514 } 3515 res[slot.key] = slot.fn; 3516 } 3517 } 3518 if (contentHashKey) { 3519 (res).$key = contentHashKey; 3520 } 3521 return res 3522} 3523 3524/* */ 3525 3526function bindDynamicKeys (baseObj, values) { 3527 for (var i = 0; i < values.length; i += 2) { 3528 var key = values[i]; 3529 if (typeof key === 'string' && key) { 3530 baseObj[values[i]] = values[i + 1]; 3531 } else if (process.env.NODE_ENV !== 'production' && key !== '' && key !== null) { 3532 // null is a special value for explicitly removing a binding 3533 warn( 3534 ("Invalid value for dynamic directive argument (expected string or null): " + key), 3535 this 3536 ); 3537 } 3538 } 3539 return baseObj 3540} 3541 3542// helper to dynamically append modifier runtime markers to event names. 3543// ensure only append when value is already string, otherwise it will be cast 3544// to string and cause the type check to miss. 3545function prependModifier (value, symbol) { 3546 return typeof value === 'string' ? symbol + value : value 3547} 3548 3549/* */ 3550 3551function installRenderHelpers (target) { 3552 target._o = markOnce; 3553 target._n = toNumber; 3554 target._s = toString; 3555 target._l = renderList; 3556 target._t = renderSlot; 3557 target._q = looseEqual; 3558 target._i = looseIndexOf; 3559 target._m = renderStatic; 3560 target._f = resolveFilter; 3561 target._k = checkKeyCodes; 3562 target._b = bindObjectProps; 3563 target._v = createTextVNode; 3564 target._e = createEmptyVNode; 3565 target._u = resolveScopedSlots; 3566 target._g = bindObjectListeners; 3567 target._d = bindDynamicKeys; 3568 target._p = prependModifier; 3569} 3570 3571/* */ 3572 3573function FunctionalRenderContext ( 3574 data, 3575 props, 3576 children, 3577 parent, 3578 Ctor 3579) { 3580 var this$1 = this; 3581 3582 var options = Ctor.options; 3583 // ensure the createElement function in functional components 3584 // gets a unique context - this is necessary for correct named slot check 3585 var contextVm; 3586 if (hasOwn(parent, '_uid')) { 3587 contextVm = Object.create(parent); 3588 // $flow-disable-line 3589 contextVm._original = parent; 3590 } else { 3591 // the context vm passed in is a functional context as well. 3592 // in this case we want to make sure we are able to get a hold to the 3593 // real context instance. 3594 contextVm = parent; 3595 // $flow-disable-line 3596 parent = parent._original; 3597 } 3598 var isCompiled = isTrue(options._compiled); 3599 var needNormalization = !isCompiled; 3600 3601 this.data = data; 3602 this.props = props; 3603 this.children = children; 3604 this.parent = parent; 3605 this.listeners = data.on || emptyObject; 3606 this.injections = resolveInject(options.inject, parent); 3607 this.slots = function () { 3608 if (!this$1.$slots) { 3609 normalizeScopedSlots( 3610 data.scopedSlots, 3611 this$1.$slots = resolveSlots(children, parent) 3612 ); 3613 } 3614 return this$1.$slots 3615 }; 3616 3617 Object.defineProperty(this, 'scopedSlots', ({ 3618 enumerable: true, 3619 get: function get () { 3620 return normalizeScopedSlots(data.scopedSlots, this.slots()) 3621 } 3622 })); 3623 3624 // support for compiled functional template 3625 if (isCompiled) { 3626 // exposing $options for renderStatic() 3627 this.$options = options; 3628 // pre-resolve slots for renderSlot() 3629 this.$slots = this.slots(); 3630 this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots); 3631 } 3632 3633 if (options._scopeId) { 3634 this._c = function (a, b, c, d) { 3635 var vnode = createElement(contextVm, a, b, c, d, needNormalization); 3636 if (vnode && !Array.isArray(vnode)) { 3637 vnode.fnScopeId = options._scopeId; 3638 vnode.fnContext = parent; 3639 } 3640 return vnode 3641 }; 3642 } else { 3643 this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); }; 3644 } 3645} 3646 3647installRenderHelpers(FunctionalRenderContext.prototype); 3648 3649function createFunctionalComponent ( 3650 Ctor, 3651 propsData, 3652 data, 3653 contextVm, 3654 children 3655) { 3656 var options = Ctor.options; 3657 var props = {}; 3658 var propOptions = options.props; 3659 if (isDef(propOptions)) { 3660 for (var key in propOptions) { 3661 props[key] = validateProp(key, propOptions, propsData || emptyObject); 3662 } 3663 } else { 3664 if (isDef(data.attrs)) { mergeProps(props, data.attrs); } 3665 if (isDef(data.props)) { mergeProps(props, data.props); } 3666 } 3667 3668 var renderContext = new FunctionalRenderContext( 3669 data, 3670 props, 3671 children, 3672 contextVm, 3673 Ctor 3674 ); 3675 3676 var vnode = options.render.call(null, renderContext._c, renderContext); 3677 3678 if (vnode instanceof VNode) { 3679 return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext) 3680 } else if (Array.isArray(vnode)) { 3681 var vnodes = normalizeChildren(vnode) || []; 3682 var res = new Array(vnodes.length); 3683 for (var i = 0; i < vnodes.length; i++) { 3684 res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext); 3685 } 3686 return res 3687 } 3688} 3689 3690function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) { 3691 // #7817 clone node before setting fnContext, otherwise if the node is reused
vendor: 4,904 bytes, lines 3692-3870
3692 // (e.g. it was from a cached normal slot) the fnContext causes named slots 3693 // that should not be matched to match. 3694 var clone = cloneVNode(vnode); 3695 clone.fnContext = contextVm; 3696 clone.fnOptions = options; 3697 if (process.env.NODE_ENV !== 'production') { 3698 (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext; 3699 } 3700 if (data.slot) { 3701 (clone.data || (clone.data = {})).slot = data.slot; 3702 } 3703 return clone 3704} 3705 3706function mergeProps (to, from) { 3707 for (var key in from) { 3708 to[camelize(key)] = from[key]; 3709 } 3710} 3711 3712/* */ 3713 3714/* */ 3715 3716/* */ 3717 3718/* */ 3719 3720// inline hooks to be invoked on component VNodes during patch 3721var componentVNodeHooks = { 3722 init: function init (vnode, hydrating) { 3723 if ( 3724 vnode.componentInstance && 3725 !vnode.componentInstance._isDestroyed && 3726 vnode.data.keepAlive 3727 ) { 3728 // kept-alive components, treat as a patch 3729 var mountedNode = vnode; // work around flow 3730 componentVNodeHooks.prepatch(mountedNode, mountedNode); 3731 } else { 3732 var child = vnode.componentInstance = createComponentInstanceForVnode( 3733 vnode, 3734 activeInstance 3735 ); 3736 child.$mount(hydrating ? vnode.elm : undefined, hydrating); 3737 } 3738 }, 3739 3740 prepatch: function prepatch (oldVnode, vnode) { 3741 var options = vnode.componentOptions; 3742 var child = vnode.componentInstance = oldVnode.componentInstance; 3743 updateChildComponent( 3744 child, 3745 options.propsData, // updated props 3746 options.listeners, // updated listeners 3747 vnode, // new parent vnode 3748 options.children // new children 3749 ); 3750 }, 3751 3752 insert: function insert (vnode) { 3753 var context = vnode.context; 3754 var componentInstance = vnode.componentInstance; 3755 if (!componentInstance._isMounted) { 3756 componentInstance._isMounted = true; 3757 callHook(componentInstance, 'mounted'); 3758 } 3759 if (vnode.data.keepAlive) { 3760 if (context._isMounted) { 3761 // vue-router#1212 3762 // During updates, a kept-alive component's child components may 3763 // change, so directly walking the tree here may call activated hooks 3764 // on incorrect children. Instead we push them into a queue which will 3765 // be processed after the whole patch process ended. 3766 queueActivatedComponent(componentInstance); 3767 } else { 3768 activateChildComponent(componentInstance, true /* direct */); 3769 } 3770 } 3771 }, 3772 3773 destroy: function destroy (vnode) { 3774 var componentInstance = vnode.componentInstance; 3775 if (!componentInstance._isDestroyed) { 3776 if (!vnode.data.keepAlive) { 3777 componentInstance.$destroy(); 3778 } else { 3779 deactivateChildComponent(componentInstance, true /* direct */); 3780 } 3781 } 3782 } 3783}; 3784 3785var hooksToMerge = Object.keys(componentVNodeHooks); 3786 3787function createComponent ( 3788 Ctor, 3789 data, 3790 context, 3791 children, 3792 tag 3793) { 3794 if (isUndef(Ctor)) { 3795 return 3796 } 3797 3798 var baseCtor = context.$options._base; 3799 3800 // plain options object: turn it into a constructor 3801 if (isObject(Ctor)) { 3802 Ctor = baseCtor.extend(Ctor); 3803 } 3804 3805 // if at this stage it's not a constructor or an async component factory, 3806 // reject. 3807 if (typeof Ctor !== 'function') { 3808 if (process.env.NODE_ENV !== 'production') { 3809 warn(("Invalid Component definition: " + (String(Ctor))), context); 3810 } 3811 return 3812 } 3813 3814 // async component 3815 var asyncFactory; 3816 if (isUndef(Ctor.cid)) { 3817 asyncFactory = Ctor; 3818 Ctor = resolveAsyncComponent(asyncFactory, baseCtor); 3819 if (Ctor === undefined) { 3820 // return a placeholder node for async component, which is rendered 3821 // as a comment node but preserves all the raw information for the node. 3822 // the information will be used for async server-rendering and hydration. 3823 return createAsyncPlaceholder( 3824 asyncFactory, 3825 data, 3826 context, 3827 children, 3828 tag 3829 ) 3830 } 3831 } 3832 3833 data = data || {}; 3834 3835 // resolve constructor options in case global mixins are applied after 3836 // component constructor creation 3837 resolveConstructorOptions(Ctor); 3838 3839 // transform component v-model data into props & events 3840 if (isDef(data.model)) { 3841 transformModel(Ctor.options, data); 3842 } 3843 3844 // extract props 3845 var propsData = extractPropsFromVNodeData(data, Ctor, tag); 3846 3847 // functional component 3848 if (isTrue(Ctor.options.functional)) { 3849 return createFunctionalComponent(Ctor, propsData, data, context, children) 3850 } 3851 3852 // extract listeners, since these needs to be treated as 3853 // child component listeners instead of DOM listeners 3854 var listeners = data.on; 3855 // replace with listeners with .native modifier 3856 // so it gets processed during parent component patch. 3857 data.on = data.nativeOn; 3858 3859 if (isTrue(Ctor.options.abstract)) { 3860 // abstract components do not keep anything 3861 // other than props & listeners & slot 3862 3863 // work around flow 3864 var slot = data.slot; 3865 data = {}; 3866 if (slot) { 3867 data.slot = slot; 3868 } 3869 } 3870
vendor: 11,086 bytes, lines 3871-4245
3871 // install component management hooks onto the placeholder node 3872 installComponentHooks(data); 3873 3874 // return a placeholder vnode 3875 var name = Ctor.options.name || tag; 3876 var vnode = new VNode( 3877 ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')), 3878 data, undefined, undefined, undefined, context, 3879 { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }, 3880 asyncFactory 3881 ); 3882 3883 return vnode 3884} 3885 3886function createComponentInstanceForVnode ( 3887 vnode, // we know it's MountedComponentVNode but flow doesn't 3888 parent // activeInstance in lifecycle state 3889) { 3890 var options = { 3891 _isComponent: true, 3892 _parentVnode: vnode, 3893 parent: parent 3894 }; 3895 // check inline-template render functions 3896 var inlineTemplate = vnode.data.inlineTemplate; 3897 if (isDef(inlineTemplate)) { 3898 options.render = inlineTemplate.render; 3899 options.staticRenderFns = inlineTemplate.staticRenderFns; 3900 } 3901 return new vnode.componentOptions.Ctor(options) 3902} 3903 3904function installComponentHooks (data) { 3905 var hooks = data.hook || (data.hook = {}); 3906 for (var i = 0; i < hooksToMerge.length; i++) { 3907 var key = hooksToMerge[i]; 3908 var existing = hooks[key]; 3909 var toMerge = componentVNodeHooks[key]; 3910 if (existing !== toMerge && !(existing && existing._merged)) { 3911 hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge; 3912 } 3913 } 3914} 3915 3916function mergeHook$1 (f1, f2) { 3917 var merged = function (a, b) { 3918 // flow complains about extra args which is why we use any 3919 f1(a, b); 3920 f2(a, b); 3921 }; 3922 merged._merged = true; 3923 return merged 3924} 3925 3926// transform component v-model info (value and callback) into 3927// prop and event handler respectively. 3928function transformModel (options, data) { 3929 var prop = (options.model && options.model.prop) || 'value'; 3930 var event = (options.model && options.model.event) || 'input' 3931 ;(data.attrs || (data.attrs = {}))[prop] = data.model.value; 3932 var on = data.on || (data.on = {}); 3933 var existing = on[event]; 3934 var callback = data.model.callback; 3935 if (isDef(existing)) { 3936 if ( 3937 Array.isArray(existing) 3938 ? existing.indexOf(callback) === -1 3939 : existing !== callback 3940 ) { 3941 on[event] = [callback].concat(existing); 3942 } 3943 } else { 3944 on[event] = callback; 3945 } 3946} 3947 3948/* */ 3949 3950var SIMPLE_NORMALIZE = 1; 3951var ALWAYS_NORMALIZE = 2; 3952 3953// wrapper function for providing a more flexible interface 3954// without getting yelled at by flow 3955function createElement ( 3956 context, 3957 tag, 3958 data, 3959 children, 3960 normalizationType, 3961 alwaysNormalize 3962) { 3963 if (Array.isArray(data) || isPrimitive(data)) { 3964 normalizationType = children; 3965 children = data; 3966 data = undefined; 3967 } 3968 if (isTrue(alwaysNormalize)) { 3969 normalizationType = ALWAYS_NORMALIZE; 3970 } 3971 return _createElement(context, tag, data, children, normalizationType) 3972} 3973 3974function _createElement ( 3975 context, 3976 tag, 3977 data, 3978 children, 3979 normalizationType 3980) { 3981 if (isDef(data) && isDef((data).__ob__)) { 3982 process.env.NODE_ENV !== 'production' && warn( 3983 "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" + 3984 'Always create fresh vnode data objects in each render!', 3985 context 3986 ); 3987 return createEmptyVNode() 3988 } 3989 // object syntax in v-bind 3990 if (isDef(data) && isDef(data.is)) { 3991 tag = data.is; 3992 } 3993 if (!tag) { 3994 // in case of component :is set to falsy value 3995 return createEmptyVNode() 3996 } 3997 // warn against non-primitive key 3998 if (process.env.NODE_ENV !== 'production' && 3999 isDef(data) && isDef(data.key) && !isPrimitive(data.key) 4000 ) { 4001 { 4002 warn( 4003 'Avoid using non-primitive value as key, ' + 4004 'use string/number value instead.', 4005 context 4006 ); 4007 } 4008 } 4009 // support single function children as default scoped slot 4010 if (Array.isArray(children) && 4011 typeof children[0] === 'function' 4012 ) { 4013 data = data || {}; 4014 data.scopedSlots = { default: children[0] }; 4015 children.length = 0; 4016 } 4017 if (normalizationType === ALWAYS_NORMALIZE) { 4018 children = normalizeChildren(children); 4019 } else if (normalizationType === SIMPLE_NORMALIZE) { 4020 children = simpleNormalizeChildren(children); 4021 } 4022 var vnode, ns; 4023 if (typeof tag === 'string') { 4024 var Ctor; 4025 ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag); 4026 if (config.isReservedTag(tag)) { 4027 // platform built-in elements 4028 if (process.env.NODE_ENV !== 'production' && isDef(data) && isDef(data.nativeOn)) { 4029 warn( 4030 ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."), 4031 context 4032 ); 4033 } 4034 vnode = new VNode( 4035 config.parsePlatformTagName(tag), data, children, 4036 undefined, undefined, context 4037 ); 4038 } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) { 4039 // component 4040 vnode = createComponent(Ctor, data, context, children, tag); 4041 } else { 4042 // unknown or unlisted namespaced elements 4043 // check at runtime because it may get assigned a namespace when its 4044 // parent normalizes children 4045 vnode = new VNode( 4046 tag, data, children, 4047 undefined, undefined, context 4048 ); 4049 } 4050 } else { 4051 // direct component options / constructor 4052 vnode = createComponent(tag, data, context, children); 4053 } 4054 if (Array.isArray(vnode)) { 4055 return vnode 4056 } else if (isDef(vnode)) { 4057 if (isDef(ns)) { applyNS(vnode, ns); } 4058 if (isDef(data)) { registerDeepBindings(data); } 4059 return vnode 4060 } else { 4061 return createEmptyVNode() 4062 } 4063} 4064 4065function applyNS (vnode, ns, force) { 4066 vnode.ns = ns; 4067 if (vnode.tag === 'foreignObject') { 4068 // use default namespace inside foreignObject 4069 ns = undefined; 4070 force = true; 4071 } 4072 if (isDef(vnode.children)) { 4073 for (var i = 0, l = vnode.children.length; i < l; i++) { 4074 var child = vnode.children[i]; 4075 if (isDef(child.tag) && ( 4076 isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) { 4077 applyNS(child, ns, force); 4078 } 4079 } 4080 } 4081} 4082 4083// ref #5318 4084// necessary to ensure parent re-render when deep bindings like :style and 4085// :class are used on slot nodes 4086function registerDeepBindings (data) { 4087 if (isObject(data.style)) { 4088 traverse(data.style); 4089 } 4090 if (isObject(data.class)) { 4091 traverse(data.class); 4092 } 4093} 4094 4095/* */ 4096 4097function initRender (vm) { 4098 vm._vnode = null; // the root of the child tree 4099 vm._staticTrees = null; // v-once cached trees 4100 var options = vm.$options; 4101 var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree 4102 var renderContext = parentVnode && parentVnode.context; 4103 vm.$slots = resolveSlots(options._renderChildren, renderContext); 4104 vm.$scopedSlots = emptyObject; 4105 // bind the createElement fn to this instance 4106 // so that we get proper render context inside it. 4107 // args order: tag, data, children, normalizationType, alwaysNormalize 4108 // internal version is used by render functions compiled from templates 4109 vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); }; 4110 // normalization is always applied for the public version, used in 4111 // user-written render functions. 4112 vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); }; 4113 4114 // $attrs & $listeners are exposed for easier HOC creation. 4115 // they need to be reactive so that HOCs using them are always updated 4116 var parentData = parentVnode && parentVnode.data; 4117 4118 /* istanbul ignore else */ 4119 if (process.env.NODE_ENV !== 'production') { 4120 defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () { 4121 !isUpdatingChildComponent && warn("$attrs is readonly.", vm); 4122 }, true); 4123 defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () { 4124 !isUpdatingChildComponent && warn("$listeners is readonly.", vm); 4125 }, true); 4126 } else { 4127 defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, null, true); 4128 defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, null, true); 4129 } 4130} 4131 4132var currentRenderingInstance = null; 4133 4134function renderMixin (Vue) { 4135 // install runtime convenience helpers 4136 installRenderHelpers(Vue.prototype); 4137 4138 Vue.prototype.$nextTick = function (fn) { 4139 return nextTick(fn, this) 4140 }; 4141 4142 Vue.prototype._render = function () { 4143 var vm = this; 4144 var ref = vm.$options; 4145 var render = ref.render; 4146 var _parentVnode = ref._parentVnode; 4147 4148 if (_parentVnode) { 4149 vm.$scopedSlots = normalizeScopedSlots( 4150 _parentVnode.data.scopedSlots, 4151 vm.$slots, 4152 vm.$scopedSlots 4153 ); 4154 } 4155 4156 // set parent vnode. this allows render functions to have access 4157 // to the data on the placeholder node. 4158 vm.$vnode = _parentVnode; 4159 // render self 4160 var vnode; 4161 try { 4162 // There's no need to maintain a stack because all render fns are called 4163 // separately from one another. Nested component's render fns are called 4164 // when parent component is patched. 4165 currentRenderingInstance = vm; 4166 vnode = render.call(vm._renderProxy, vm.$createElement); 4167 } catch (e) { 4168 handleError(e, vm, "render"); 4169 // return error render result, 4170 // or previous vnode to prevent render error causing blank component 4171 /* istanbul ignore else */ 4172 if (process.env.NODE_ENV !== 'production' && vm.$options.renderError) { 4173 try { 4174 vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e); 4175 } catch (e) { 4176 handleError(e, vm, "renderError"); 4177 vnode = vm._vnode; 4178 } 4179 } else { 4180 vnode = vm._vnode; 4181 } 4182 } finally { 4183 currentRenderingInstance = null; 4184 } 4185 // if the returned array contains only a single node, allow it 4186 if (Array.isArray(vnode) && vnode.length === 1) { 4187 vnode = vnode[0]; 4188 } 4189 // return empty vnode in case the render function errored out 4190 if (!(vnode instanceof VNode)) { 4191 if (process.env.NODE_ENV !== 'production' && Array.isArray(vnode)) { 4192 warn( 4193 'Multiple root nodes returned from render function. Render function ' + 4194 'should return a single root node.', 4195 vm 4196 ); 4197 } 4198 vnode = createEmptyVNode(); 4199 } 4200 // set parent 4201 vnode.parent = _parentVnode; 4202 return vnode 4203 }; 4204} 4205 4206/* */ 4207 4208function ensureCtor (comp, base) { 4209 if ( 4210 comp.__esModule || 4211 (hasSymbol && comp[Symbol.toStringTag] === 'Module') 4212 ) { 4213 comp = comp.default; 4214 } 4215 return isObject(comp) 4216 ? base.extend(comp) 4217 : comp 4218} 4219 4220function createAsyncPlaceholder ( 4221 factory, 4222 data, 4223 context, 4224 children, 4225 tag 4226) { 4227 var node = createEmptyVNode(); 4228 node.asyncFactory = factory; 4229 node.asyncMeta = { data: data, context: context, children: children, tag: tag }; 4230 return node 4231} 4232 4233function resolveAsyncComponent ( 4234 factory, 4235 baseCtor 4236) { 4237 if (isTrue(factory.error) && isDef(factory.errorComp)) { 4238 return factory.errorComp 4239 } 4240 4241 if (isDef(factory.resolved)) { 4242 return factory.resolved 4243 } 4244 4245 var owner = currentRenderingInstance;
vendor: 5,606 bytes, lines 4246-4477
4246 if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) { 4247 // already pending 4248 factory.owners.push(owner); 4249 } 4250 4251 if (isTrue(factory.loading) && isDef(factory.loadingComp)) { 4252 return factory.loadingComp 4253 } 4254 4255 if (owner && !isDef(factory.owners)) { 4256 var owners = factory.owners = [owner]; 4257 var sync = true; 4258 var timerLoading = null; 4259 var timerTimeout = null 4260 4261 ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); }); 4262 4263 var forceRender = function (renderCompleted) { 4264 for (var i = 0, l = owners.length; i < l; i++) { 4265 (owners[i]).$forceUpdate(); 4266 } 4267 4268 if (renderCompleted) { 4269 owners.length = 0; 4270 if (timerLoading !== null) { 4271 clearTimeout(timerLoading); 4272 timerLoading = null; 4273 } 4274 if (timerTimeout !== null) { 4275 clearTimeout(timerTimeout); 4276 timerTimeout = null; 4277 } 4278 } 4279 }; 4280 4281 var resolve = once(function (res) { 4282 // cache resolved 4283 factory.resolved = ensureCtor(res, baseCtor); 4284 // invoke callbacks only if this is not a synchronous resolve 4285 // (async resolves are shimmed as synchronous during SSR) 4286 if (!sync) { 4287 forceRender(true); 4288 } else { 4289 owners.length = 0; 4290 } 4291 }); 4292 4293 var reject = once(function (reason) { 4294 process.env.NODE_ENV !== 'production' && warn( 4295 "Failed to resolve async component: " + (String(factory)) + 4296 (reason ? ("\nReason: " + reason) : '') 4297 ); 4298 if (isDef(factory.errorComp)) { 4299 factory.error = true; 4300 forceRender(true); 4301 } 4302 }); 4303 4304 var res = factory(resolve, reject); 4305 4306 if (isObject(res)) { 4307 if (isPromise(res)) { 4308 // () => Promise 4309 if (isUndef(factory.resolved)) { 4310 res.then(resolve, reject); 4311 } 4312 } else if (isPromise(res.component)) { 4313 res.component.then(resolve, reject); 4314 4315 if (isDef(res.error)) { 4316 factory.errorComp = ensureCtor(res.error, baseCtor); 4317 } 4318 4319 if (isDef(res.loading)) { 4320 factory.loadingComp = ensureCtor(res.loading, baseCtor); 4321 if (res.delay === 0) { 4322 factory.loading = true; 4323 } else { 4324 timerLoading = setTimeout(function () { 4325 timerLoading = null; 4326 if (isUndef(factory.resolved) && isUndef(factory.error)) { 4327 factory.loading = true; 4328 forceRender(false); 4329 } 4330 }, res.delay || 200); 4331 } 4332 } 4333 4334 if (isDef(res.timeout)) { 4335 timerTimeout = setTimeout(function () { 4336 timerTimeout = null; 4337 if (isUndef(factory.resolved)) { 4338 reject( 4339 process.env.NODE_ENV !== 'production' 4340 ? ("timeout (" + (res.timeout) + "ms)") 4341 : null 4342 ); 4343 } 4344 }, res.timeout); 4345 } 4346 } 4347 } 4348 4349 sync = false; 4350 // return in case resolved synchronously 4351 return factory.loading 4352 ? factory.loadingComp 4353 : factory.resolved 4354 } 4355} 4356 4357/* */ 4358 4359function isAsyncPlaceholder (node) { 4360 return node.isComment && node.asyncFactory 4361} 4362 4363/* */ 4364 4365function getFirstComponentChild (children) { 4366 if (Array.isArray(children)) { 4367 for (var i = 0; i < children.length; i++) { 4368 var c = children[i]; 4369 if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) { 4370 return c 4371 } 4372 } 4373 } 4374} 4375 4376/* */ 4377 4378/* */ 4379 4380function initEvents (vm) { 4381 vm._events = Object.create(null); 4382 vm._hasHookEvent = false; 4383 // init parent attached events 4384 var listeners = vm.$options._parentListeners; 4385 if (listeners) { 4386 updateComponentListeners(vm, listeners); 4387 } 4388} 4389 4390var target; 4391 4392function add (event, fn) { 4393 target.$on(event, fn); 4394} 4395 4396function remove$1 (event, fn) { 4397 target.$off(event, fn); 4398} 4399 4400function createOnceHandler (event, fn) { 4401 var _target = target; 4402 return function onceHandler () { 4403 var res = fn.apply(null, arguments); 4404 if (res !== null) { 4405 _target.$off(event, onceHandler); 4406 } 4407 } 4408} 4409 4410function updateComponentListeners ( 4411 vm, 4412 listeners, 4413 oldListeners 4414) { 4415 target = vm; 4416 updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm); 4417 target = undefined; 4418} 4419 4420function eventsMixin (Vue) { 4421 var hookRE = /^hook:/; 4422 Vue.prototype.$on = function (event, fn) { 4423 var vm = this; 4424 if (Array.isArray(event)) { 4425 for (var i = 0, l = event.length; i < l; i++) { 4426 vm.$on(event[i], fn); 4427 } 4428 } else { 4429 (vm._events[event] || (vm._events[event] = [])).push(fn); 4430 // optimize hook:event cost by using a boolean flag marked at registration 4431 // instead of a hash lookup 4432 if (hookRE.test(event)) { 4433 vm._hasHookEvent = true; 4434 } 4435 } 4436 return vm 4437 }; 4438 4439 Vue.prototype.$once = function (event, fn) { 4440 var vm = this; 4441 function on () { 4442 vm.$off(event, on); 4443 fn.apply(vm, arguments); 4444 } 4445 on.fn = fn; 4446 vm.$on(event, on); 4447 return vm 4448 }; 4449 4450 Vue.prototype.$off = function (event, fn) { 4451 var vm = this; 4452 // all 4453 if (!arguments.length) { 4454 vm._events = Object.create(null); 4455 return vm 4456 } 4457 // array of events 4458 if (Array.isArray(event)) { 4459 for (var i$1 = 0, l = event.length; i$1 < l; i$1++) { 4460 vm.$off(event[i$1], fn); 4461 } 4462 return vm 4463 } 4464 // specific event 4465 var cbs = vm._events[event]; 4466 if (!cbs) { 4467 return vm 4468 } 4469 if (!fn) { 4470 vm._events[event] = null; 4471 return vm 4472 } 4473 // specific handler 4474 var cb; 4475 var i = cbs.length; 4476 while (i--) { 4477 cb = cbs[i];
vendor: 6,125 bytes, lines 4478-4698
4478 if (cb === fn || cb.fn === fn) { 4479 cbs.splice(i, 1); 4480 break 4481 } 4482 } 4483 return vm 4484 }; 4485 4486 Vue.prototype.$emit = function (event) { 4487 var vm = this; 4488 if (process.env.NODE_ENV !== 'production') { 4489 var lowerCaseEvent = event.toLowerCase(); 4490 if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) { 4491 tip( 4492 "Event \"" + lowerCaseEvent + "\" is emitted in component " + 4493 (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " + 4494 "Note that HTML attributes are case-insensitive and you cannot use " + 4495 "v-on to listen to camelCase events when using in-DOM templates. " + 4496 "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"." 4497 ); 4498 } 4499 } 4500 var cbs = vm._events[event]; 4501 if (cbs) { 4502 cbs = cbs.length > 1 ? toArray(cbs) : cbs; 4503 var args = toArray(arguments, 1); 4504 var info = "event handler for \"" + event + "\""; 4505 for (var i = 0, l = cbs.length; i < l; i++) { 4506 invokeWithErrorHandling(cbs[i], vm, args, vm, info); 4507 } 4508 } 4509 return vm 4510 }; 4511} 4512 4513/* */ 4514 4515var activeInstance = null; 4516var isUpdatingChildComponent = false; 4517 4518function setActiveInstance(vm) { 4519 var prevActiveInstance = activeInstance; 4520 activeInstance = vm; 4521 return function () { 4522 activeInstance = prevActiveInstance; 4523 } 4524} 4525 4526function initLifecycle (vm) { 4527 var options = vm.$options; 4528 4529 // locate first non-abstract parent 4530 var parent = options.parent; 4531 if (parent && !options.abstract) { 4532 while (parent.$options.abstract && parent.$parent) { 4533 parent = parent.$parent; 4534 } 4535 parent.$children.push(vm); 4536 } 4537 4538 vm.$parent = parent; 4539 vm.$root = parent ? parent.$root : vm; 4540 4541 vm.$children = []; 4542 vm.$refs = {}; 4543 4544 vm._watcher = null; 4545 vm._inactive = null; 4546 vm._directInactive = false; 4547 vm._isMounted = false; 4548 vm._isDestroyed = false; 4549 vm._isBeingDestroyed = false; 4550} 4551 4552function lifecycleMixin (Vue) { 4553 Vue.prototype._update = function (vnode, hydrating) { 4554 var vm = this; 4555 var prevEl = vm.$el; 4556 var prevVnode = vm._vnode; 4557 var restoreActiveInstance = setActiveInstance(vm); 4558 vm._vnode = vnode; 4559 // Vue.prototype.__patch__ is injected in entry points 4560 // based on the rendering backend used. 4561 if (!prevVnode) { 4562 // initial render 4563 vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */); 4564 } else { 4565 // updates 4566 vm.$el = vm.__patch__(prevVnode, vnode); 4567 } 4568 restoreActiveInstance(); 4569 // update __vue__ reference 4570 if (prevEl) { 4571 prevEl.__vue__ = null; 4572 } 4573 if (vm.$el) { 4574 vm.$el.__vue__ = vm; 4575 } 4576 // if parent is an HOC, update its $el as well 4577 if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) { 4578 vm.$parent.$el = vm.$el; 4579 } 4580 // updated hook is called by the scheduler to ensure that children are 4581 // updated in a parent's updated hook. 4582 }; 4583 4584 Vue.prototype.$forceUpdate = function () { 4585 var vm = this; 4586 if (vm._watcher) { 4587 vm._watcher.update(); 4588 } 4589 }; 4590 4591 Vue.prototype.$destroy = function () { 4592 var vm = this; 4593 if (vm._isBeingDestroyed) { 4594 return 4595 } 4596 callHook(vm, 'beforeDestroy'); 4597 vm._isBeingDestroyed = true; 4598 // remove self from parent 4599 var parent = vm.$parent; 4600 if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) { 4601 remove(parent.$children, vm); 4602 } 4603 // teardown watchers 4604 if (vm._watcher) { 4605 vm._watcher.teardown(); 4606 } 4607 var i = vm._watchers.length; 4608 while (i--) { 4609 vm._watchers[i].teardown(); 4610 } 4611 // remove reference from data ob 4612 // frozen object may not have observer. 4613 if (vm._data.__ob__) { 4614 vm._data.__ob__.vmCount--; 4615 } 4616 // call the last hook... 4617 vm._isDestroyed = true; 4618 // invoke destroy hooks on current rendered tree 4619 vm.__patch__(vm._vnode, null); 4620 // fire destroyed hook 4621 callHook(vm, 'destroyed'); 4622 // turn off all instance listeners. 4623 vm.$off(); 4624 // remove __vue__ reference 4625 if (vm.$el) { 4626 vm.$el.__vue__ = null; 4627 } 4628 // release circular reference (#6759) 4629 if (vm.$vnode) { 4630 vm.$vnode.parent = null; 4631 } 4632 }; 4633} 4634 4635function mountComponent ( 4636 vm, 4637 el, 4638 hydrating 4639) { 4640 vm.$el = el; 4641 if (!vm.$options.render) { 4642 vm.$options.render = createEmptyVNode; 4643 if (process.env.NODE_ENV !== 'production') { 4644 /* istanbul ignore if */ 4645 if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') || 4646 vm.$options.el || el) { 4647 warn( 4648 'You are using the runtime-only build of Vue where the template ' + 4649 'compiler is not available. Either pre-compile the templates into ' + 4650 'render functions, or use the compiler-included build.', 4651 vm 4652 ); 4653 } else { 4654 warn( 4655 'Failed to mount component: template or render function not defined.', 4656 vm 4657 ); 4658 } 4659 } 4660 } 4661 callHook(vm, 'beforeMount'); 4662 4663 var updateComponent; 4664 /* istanbul ignore if */ 4665 if (process.env.NODE_ENV !== 'production' && config.performance && mark) { 4666 updateComponent = function () { 4667 var name = vm._name; 4668 var id = vm._uid; 4669 var startTag = "vue-perf-start:" + id; 4670 var endTag = "vue-perf-end:" + id; 4671 4672 mark(startTag); 4673 var vnode = vm._render(); 4674 mark(endTag); 4675 measure(("vue " + name + " render"), startTag, endTag); 4676 4677 mark(startTag); 4678 vm._update(vnode, hydrating); 4679 mark(endTag); 4680 measure(("vue " + name + " patch"), startTag, endTag); 4681 }; 4682 } else { 4683 updateComponent = function () { 4684 vm._update(vm._render(), hydrating); 4685 }; 4686 } 4687 4688 // we set this to vm._watcher inside the watcher's constructor 4689 // since the watcher's initial patch may call $forceUpdate (e.g. inside child 4690 // component's mounted hook), which relies on vm._watcher being already defined 4691 new Watcher(vm, updateComponent, noop, { 4692 before: function before () { 4693 if (vm._isMounted && !vm._isDestroyed) { 4694 callHook(vm, 'beforeUpdate'); 4695 } 4696 } 4697 }, true /* isRenderWatcher */); 4698 hydrating = false;
vendor: 4,304 bytes, lines 4699-4854
4699 4700 // manually mounted instance, call mounted on self 4701 // mounted is called for render-created child components in its inserted hook 4702 if (vm.$vnode == null) { 4703 vm._isMounted = true; 4704 callHook(vm, 'mounted'); 4705 } 4706 return vm 4707} 4708 4709function updateChildComponent ( 4710 vm, 4711 propsData, 4712 listeners, 4713 parentVnode, 4714 renderChildren 4715) { 4716 if (process.env.NODE_ENV !== 'production') { 4717 isUpdatingChildComponent = true; 4718 } 4719 4720 // determine whether component has slot children 4721 // we need to do this before overwriting $options._renderChildren. 4722 4723 // check if there are dynamic scopedSlots (hand-written or compiled but with 4724 // dynamic slot names). Static scoped slots compiled from template has the 4725 // "$stable" marker. 4726 var newScopedSlots = parentVnode.data.scopedSlots; 4727 var oldScopedSlots = vm.$scopedSlots; 4728 var hasDynamicScopedSlot = !!( 4729 (newScopedSlots && !newScopedSlots.$stable) || 4730 (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) || 4731 (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) 4732 ); 4733 4734 // Any static slot children from the parent may have changed during parent's 4735 // update. Dynamic scoped slots may also have changed. In such cases, a forced 4736 // update is necessary to ensure correctness. 4737 var needsForceUpdate = !!( 4738 renderChildren || // has new static slots 4739 vm.$options._renderChildren || // has old static slots 4740 hasDynamicScopedSlot 4741 ); 4742 4743 vm.$options._parentVnode = parentVnode; 4744 vm.$vnode = parentVnode; // update vm's placeholder node without re-render 4745 4746 if (vm._vnode) { // update child tree's parent 4747 vm._vnode.parent = parentVnode; 4748 } 4749 vm.$options._renderChildren = renderChildren; 4750 4751 // update $attrs and $listeners hash 4752 // these are also reactive so they may trigger child update if the child 4753 // used them during render 4754 vm.$attrs = parentVnode.data.attrs || emptyObject; 4755 vm.$listeners = listeners || emptyObject; 4756 4757 // update props 4758 if (propsData && vm.$options.props) { 4759 toggleObserving(false); 4760 var props = vm._props; 4761 var propKeys = vm.$options._propKeys || []; 4762 for (var i = 0; i < propKeys.length; i++) { 4763 var key = propKeys[i]; 4764 var propOptions = vm.$options.props; // wtf flow? 4765 props[key] = validateProp(key, propOptions, propsData, vm); 4766 } 4767 toggleObserving(true); 4768 // keep a copy of raw propsData 4769 vm.$options.propsData = propsData; 4770 } 4771 4772 // update listeners 4773 listeners = listeners || emptyObject; 4774 var oldListeners = vm.$options._parentListeners; 4775 vm.$options._parentListeners = listeners; 4776 updateComponentListeners(vm, listeners, oldListeners); 4777 4778 // resolve slots + force update if has children 4779 if (needsForceUpdate) { 4780 vm.$slots = resolveSlots(renderChildren, parentVnode.context); 4781 vm.$forceUpdate(); 4782 } 4783 4784 if (process.env.NODE_ENV !== 'production') { 4785 isUpdatingChildComponent = false; 4786 } 4787} 4788 4789function isInInactiveTree (vm) { 4790 while (vm && (vm = vm.$parent)) { 4791 if (vm._inactive) { return true } 4792 } 4793 return false 4794} 4795 4796function activateChildComponent (vm, direct) { 4797 if (direct) { 4798 vm._directInactive = false; 4799 if (isInInactiveTree(vm)) { 4800 return 4801 } 4802 } else if (vm._directInactive) { 4803 return 4804 } 4805 if (vm._inactive || vm._inactive === null) { 4806 vm._inactive = false; 4807 for (var i = 0; i < vm.$children.length; i++) { 4808 activateChildComponent(vm.$children[i]); 4809 } 4810 callHook(vm, 'activated'); 4811 } 4812} 4813 4814function deactivateChildComponent (vm, direct) { 4815 if (direct) { 4816 vm._directInactive = true; 4817 if (isInInactiveTree(vm)) { 4818 return 4819 } 4820 } 4821 if (!vm._inactive) { 4822 vm._inactive = true; 4823 for (var i = 0; i < vm.$children.length; i++) { 4824 deactivateChildComponent(vm.$children[i]); 4825 } 4826 callHook(vm, 'deactivated'); 4827 } 4828} 4829 4830function callHook (vm, hook) { 4831 // #7573 disable dep collection when invoking lifecycle hooks 4832 pushTarget(); 4833 var handlers = vm.$options[hook]; 4834 var info = hook + " hook"; 4835 if (handlers) { 4836 for (var i = 0, j = handlers.length; i < j; i++) { 4837 invokeWithErrorHandling(handlers[i], vm, null, vm, info); 4838 } 4839 } 4840 if (vm._hasHookEvent) { 4841 vm.$emit('hook:' + hook); 4842 } 4843 popTarget(); 4844} 4845 4846/* */ 4847 4848var MAX_UPDATE_COUNT = 100; 4849 4850var queue = []; 4851var activatedChildren = []; 4852var has = {}; 4853var circular = {}; 4854var waiting = false;
vendor: 8,397 bytes, lines 4855-5174
4855var flushing = false; 4856var index = 0; 4857 4858/** 4859 * Reset the scheduler's state. 4860 */ 4861function resetSchedulerState () { 4862 index = queue.length = activatedChildren.length = 0; 4863 has = {}; 4864 if (process.env.NODE_ENV !== 'production') { 4865 circular = {}; 4866 } 4867 waiting = flushing = false; 4868} 4869 4870// Async edge case #6566 requires saving the timestamp when event listeners are 4871// attached. However, calling performance.now() has a perf overhead especially 4872// if the page has thousands of event listeners. Instead, we take a timestamp 4873// every time the scheduler flushes and use that for all event listeners 4874// attached during that flush. 4875var currentFlushTimestamp = 0; 4876 4877// Async edge case fix requires storing an event listener's attach timestamp. 4878var getNow = Date.now; 4879 4880// Determine what event timestamp the browser is using. Annoyingly, the 4881// timestamp can either be hi-res (relative to page load) or low-res 4882// (relative to UNIX epoch), so in order to compare time we have to use the 4883// same timestamp type when saving the flush timestamp. 4884// All IE versions use low-res event timestamps, and have problematic clock 4885// implementations (#9632) 4886if (inBrowser && !isIE) { 4887 var performance = window.performance; 4888 if ( 4889 performance && 4890 typeof performance.now === 'function' && 4891 getNow() > document.createEvent('Event').timeStamp 4892 ) { 4893 // if the event timestamp, although evaluated AFTER the Date.now(), is 4894 // smaller than it, it means the event is using a hi-res timestamp, 4895 // and we need to use the hi-res version for event listener timestamps as 4896 // well. 4897 getNow = function () { return performance.now(); }; 4898 } 4899} 4900 4901/** 4902 * Flush both queues and run the watchers. 4903 */ 4904function flushSchedulerQueue () { 4905 currentFlushTimestamp = getNow(); 4906 flushing = true; 4907 var watcher, id; 4908 4909 // Sort queue before flush. 4910 // This ensures that: 4911 // 1. Components are updated from parent to child. (because parent is always 4912 // created before the child) 4913 // 2. A component's user watchers are run before its render watcher (because 4914 // user watchers are created before the render watcher) 4915 // 3. If a component is destroyed during a parent component's watcher run, 4916 // its watchers can be skipped. 4917 queue.sort(function (a, b) { return a.id - b.id; }); 4918 4919 // do not cache length because more watchers might be pushed 4920 // as we run existing watchers 4921 for (index = 0; index < queue.length; index++) { 4922 watcher = queue[index]; 4923 if (watcher.before) { 4924 watcher.before(); 4925 } 4926 id = watcher.id; 4927 has[id] = null; 4928 watcher.run(); 4929 // in dev build, check and stop circular updates. 4930 if (process.env.NODE_ENV !== 'production' && has[id] != null) { 4931 circular[id] = (circular[id] || 0) + 1; 4932 if (circular[id] > MAX_UPDATE_COUNT) { 4933 warn( 4934 'You may have an infinite update loop ' + ( 4935 watcher.user 4936 ? ("in watcher with expression \"" + (watcher.expression) + "\"") 4937 : "in a component render function." 4938 ), 4939 watcher.vm 4940 ); 4941 break 4942 } 4943 } 4944 } 4945 4946 // keep copies of post queues before resetting state 4947 var activatedQueue = activatedChildren.slice(); 4948 var updatedQueue = queue.slice(); 4949 4950 resetSchedulerState(); 4951 4952 // call component updated and activated hooks 4953 callActivatedHooks(activatedQueue); 4954 callUpdatedHooks(updatedQueue); 4955 4956 // devtool hook 4957 /* istanbul ignore if */ 4958 if (devtools && config.devtools) { 4959 devtools.emit('flush'); 4960 } 4961} 4962 4963function callUpdatedHooks (queue) { 4964 var i = queue.length; 4965 while (i--) { 4966 var watcher = queue[i]; 4967 var vm = watcher.vm; 4968 if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) { 4969 callHook(vm, 'updated'); 4970 } 4971 } 4972} 4973 4974/** 4975 * Queue a kept-alive component that was activated during patch. 4976 * The queue will be processed after the entire tree has been patched. 4977 */ 4978function queueActivatedComponent (vm) { 4979 // setting _inactive to false here so that a render function can 4980 // rely on checking whether it's in an inactive tree (e.g. router-view) 4981 vm._inactive = false; 4982 activatedChildren.push(vm); 4983} 4984 4985function callActivatedHooks (queue) { 4986 for (var i = 0; i < queue.length; i++) { 4987 queue[i]._inactive = true; 4988 activateChildComponent(queue[i], true /* true */); 4989 } 4990} 4991 4992/** 4993 * Push a watcher into the watcher queue. 4994 * Jobs with duplicate IDs will be skipped unless it's 4995 * pushed when the queue is being flushed. 4996 */ 4997function queueWatcher (watcher) { 4998 var id = watcher.id; 4999 if (has[id] == null) { 5000 has[id] = true; 5001 if (!flushing) { 5002 queue.push(watcher); 5003 } else { 5004 // if already flushing, splice the watcher based on its id 5005 // if already past its id, it will be run next immediately. 5006 var i = queue.length - 1; 5007 while (i > index && queue[i].id > watcher.id) { 5008 i--; 5009 } 5010 queue.splice(i + 1, 0, watcher); 5011 } 5012 // queue the flush 5013 if (!waiting) { 5014 waiting = true; 5015 5016 if (process.env.NODE_ENV !== 'production' && !config.async) { 5017 flushSchedulerQueue(); 5018 return 5019 } 5020 nextTick(flushSchedulerQueue); 5021 } 5022 } 5023} 5024 5025/* */ 5026 5027 5028 5029var uid$2 = 0; 5030 5031/** 5032 * A watcher parses an expression, collects dependencies, 5033 * and fires callback when the expression value changes. 5034 * This is used for both the $watch() api and directives. 5035 */ 5036var Watcher = function Watcher ( 5037 vm, 5038 expOrFn, 5039 cb, 5040 options, 5041 isRenderWatcher 5042) { 5043 this.vm = vm; 5044 if (isRenderWatcher) { 5045 vm._watcher = this; 5046 } 5047 vm._watchers.push(this); 5048 // options 5049 if (options) { 5050 this.deep = !!options.deep; 5051 this.user = !!options.user; 5052 this.lazy = !!options.lazy; 5053 this.sync = !!options.sync; 5054 this.before = options.before; 5055 } else { 5056 this.deep = this.user = this.lazy = this.sync = false; 5057 } 5058 this.cb = cb; 5059 this.id = ++uid$2; // uid for batching 5060 this.active = true; 5061 this.dirty = this.lazy; // for lazy watchers 5062 this.deps = []; 5063 this.newDeps = []; 5064 this.depIds = new _Set(); 5065 this.newDepIds = new _Set(); 5066 this.expression = process.env.NODE_ENV !== 'production' 5067 ? expOrFn.toString() 5068 : ''; 5069 // parse expression for getter 5070 if (typeof expOrFn === 'function') { 5071 this.getter = expOrFn; 5072 } else { 5073 this.getter = parsePath(expOrFn); 5074 if (!this.getter) { 5075 this.getter = noop; 5076 process.env.NODE_ENV !== 'production' && warn( 5077 "Failed watching path: \"" + expOrFn + "\" " + 5078 'Watcher only accepts simple dot-delimited paths. ' + 5079 'For full control, use a function instead.', 5080 vm 5081 ); 5082 } 5083 } 5084 this.value = this.lazy 5085 ? undefined 5086 : this.get(); 5087}; 5088 5089/** 5090 * Evaluate the getter, and re-collect dependencies. 5091 */ 5092Watcher.prototype.get = function get () { 5093 pushTarget(this); 5094 var value; 5095 var vm = this.vm; 5096 try { 5097 value = this.getter.call(vm, vm); 5098 } catch (e) { 5099 if (this.user) { 5100 handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\"")); 5101 } else { 5102 throw e 5103 } 5104 } finally { 5105 // "touch" every property so they are all tracked as 5106 // dependencies for deep watching 5107 if (this.deep) { 5108 traverse(value); 5109 } 5110 popTarget(); 5111 this.cleanupDeps(); 5112 } 5113 return value 5114}; 5115 5116/** 5117 * Add a dependency to this directive. 5118 */ 5119Watcher.prototype.addDep = function addDep (dep) { 5120 var id = dep.id; 5121 if (!this.newDepIds.has(id)) { 5122 this.newDepIds.add(id); 5123 this.newDeps.push(dep); 5124 if (!this.depIds.has(id)) { 5125 dep.addSub(this); 5126 } 5127 } 5128}; 5129 5130/** 5131 * Clean up for dependency collection. 5132 */ 5133Watcher.prototype.cleanupDeps = function cleanupDeps () { 5134 var i = this.deps.length; 5135 while (i--) { 5136 var dep = this.deps[i]; 5137 if (!this.newDepIds.has(dep.id)) { 5138 dep.removeSub(this); 5139 } 5140 } 5141 var tmp = this.depIds; 5142 this.depIds = this.newDepIds; 5143 this.newDepIds = tmp; 5144 this.newDepIds.clear(); 5145 tmp = this.deps; 5146 this.deps = this.newDeps; 5147 this.newDeps = tmp; 5148 this.newDeps.length = 0; 5149}; 5150 5151/** 5152 * Subscriber interface. 5153 * Will be called when a dependency changes. 5154 */ 5155Watcher.prototype.update = function update () { 5156 /* istanbul ignore else */ 5157 if (this.lazy) { 5158 this.dirty = true; 5159 } else if (this.sync) { 5160 this.run(); 5161 } else { 5162 queueWatcher(this); 5163 } 5164}; 5165 5166/** 5167 * Scheduler job interface. 5168 * Will be called by the scheduler. 5169 */ 5170Watcher.prototype.run = function run () { 5171 if (this.active) { 5172 var value = this.get(); 5173 if ( 5174 value !== this.value ||
vendor: 7,940 bytes, lines 5175-5456
5175 // Deep watchers and watchers on Object/Arrays should fire even 5176 // when the value is the same, because the value may 5177 // have mutated. 5178 isObject(value) || 5179 this.deep 5180 ) { 5181 // set new value 5182 var oldValue = this.value; 5183 this.value = value; 5184 if (this.user) { 5185 try { 5186 this.cb.call(this.vm, value, oldValue); 5187 } catch (e) { 5188 handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\"")); 5189 } 5190 } else { 5191 this.cb.call(this.vm, value, oldValue); 5192 } 5193 } 5194 } 5195}; 5196 5197/** 5198 * Evaluate the value of the watcher. 5199 * This only gets called for lazy watchers. 5200 */ 5201Watcher.prototype.evaluate = function evaluate () { 5202 this.value = this.get(); 5203 this.dirty = false; 5204}; 5205 5206/** 5207 * Depend on all deps collected by this watcher. 5208 */ 5209Watcher.prototype.depend = function depend () { 5210 var i = this.deps.length; 5211 while (i--) { 5212 this.deps[i].depend(); 5213 } 5214}; 5215 5216/** 5217 * Remove self from all dependencies' subscriber list. 5218 */ 5219Watcher.prototype.teardown = function teardown () { 5220 if (this.active) { 5221 // remove self from vm's watcher list 5222 // this is a somewhat expensive operation so we skip it 5223 // if the vm is being destroyed. 5224 if (!this.vm._isBeingDestroyed) { 5225 remove(this.vm._watchers, this); 5226 } 5227 var i = this.deps.length; 5228 while (i--) { 5229 this.deps[i].removeSub(this); 5230 } 5231 this.active = false; 5232 } 5233}; 5234 5235/* */ 5236 5237var sharedPropertyDefinition = { 5238 enumerable: true, 5239 configurable: true, 5240 get: noop, 5241 set: noop 5242}; 5243 5244function proxy (target, sourceKey, key) { 5245 sharedPropertyDefinition.get = function proxyGetter () { 5246 return this[sourceKey][key] 5247 }; 5248 sharedPropertyDefinition.set = function proxySetter (val) { 5249 this[sourceKey][key] = val; 5250 }; 5251 Object.defineProperty(target, key, sharedPropertyDefinition); 5252} 5253 5254function initState (vm) { 5255 vm._watchers = []; 5256 var opts = vm.$options; 5257 if (opts.props) { initProps(vm, opts.props); } 5258 if (opts.methods) { initMethods(vm, opts.methods); } 5259 if (opts.data) { 5260 initData(vm); 5261 } else { 5262 observe(vm._data = {}, true /* asRootData */); 5263 } 5264 if (opts.computed) { initComputed(vm, opts.computed); } 5265 if (opts.watch && opts.watch !== nativeWatch) { 5266 initWatch(vm, opts.watch); 5267 } 5268} 5269 5270function initProps (vm, propsOptions) { 5271 var propsData = vm.$options.propsData || {}; 5272 var props = vm._props = {}; 5273 // cache prop keys so that future props updates can iterate using Array 5274 // instead of dynamic object key enumeration. 5275 var keys = vm.$options._propKeys = []; 5276 var isRoot = !vm.$parent; 5277 // root instance props should be converted 5278 if (!isRoot) { 5279 toggleObserving(false); 5280 } 5281 var loop = function ( key ) { 5282 keys.push(key); 5283 var value = validateProp(key, propsOptions, propsData, vm); 5284 /* istanbul ignore else */ 5285 if (process.env.NODE_ENV !== 'production') { 5286 var hyphenatedKey = hyphenate(key); 5287 if (isReservedAttribute(hyphenatedKey) || 5288 config.isReservedAttr(hyphenatedKey)) { 5289 warn( 5290 ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."), 5291 vm 5292 ); 5293 } 5294 defineReactive$$1(props, key, value, function () { 5295 if (!isRoot && !isUpdatingChildComponent) { 5296 warn( 5297 "Avoid mutating a prop directly since the value will be " + 5298 "overwritten whenever the parent component re-renders. " + 5299 "Instead, use a data or computed property based on the prop's " + 5300 "value. Prop being mutated: \"" + key + "\"", 5301 vm 5302 ); 5303 } 5304 }); 5305 } else { 5306 defineReactive$$1(props, key, value); 5307 } 5308 // static props are already proxied on the component's prototype 5309 // during Vue.extend(). We only need to proxy props defined at 5310 // instantiation here. 5311 if (!(key in vm)) { 5312 proxy(vm, "_props", key); 5313 } 5314 }; 5315 5316 for (var key in propsOptions) loop( key ); 5317 toggleObserving(true); 5318} 5319 5320function initData (vm) { 5321 var data = vm.$options.data; 5322 data = vm._data = typeof data === 'function' 5323 ? getData(data, vm) 5324 : data || {}; 5325 if (!isPlainObject(data)) { 5326 data = {}; 5327 process.env.NODE_ENV !== 'production' && warn( 5328 'data functions should return an object:\n' + 5329 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', 5330 vm 5331 ); 5332 } 5333 // proxy data on instance 5334 var keys = Object.keys(data); 5335 var props = vm.$options.props; 5336 var methods = vm.$options.methods; 5337 var i = keys.length; 5338 while (i--) { 5339 var key = keys[i]; 5340 if (process.env.NODE_ENV !== 'production') { 5341 if (methods && hasOwn(methods, key)) { 5342 warn( 5343 ("Method \"" + key + "\" has already been defined as a data property."), 5344 vm 5345 ); 5346 } 5347 } 5348 if (props && hasOwn(props, key)) { 5349 process.env.NODE_ENV !== 'production' && warn( 5350 "The data property \"" + key + "\" is already declared as a prop. " + 5351 "Use prop default value instead.", 5352 vm 5353 ); 5354 } else if (!isReserved(key)) { 5355 proxy(vm, "_data", key); 5356 } 5357 } 5358 // observe data 5359 observe(data, true /* asRootData */); 5360} 5361 5362function getData (data, vm) { 5363 // #7573 disable dep collection when invoking data getters 5364 pushTarget(); 5365 try { 5366 return data.call(vm, vm) 5367 } catch (e) { 5368 handleError(e, vm, "data()"); 5369 return {} 5370 } finally { 5371 popTarget(); 5372 } 5373} 5374 5375var computedWatcherOptions = { lazy: true }; 5376 5377function initComputed (vm, computed) { 5378 // $flow-disable-line 5379 var watchers = vm._computedWatchers = Object.create(null); 5380 // computed properties are just getters during SSR 5381 var isSSR = isServerRendering(); 5382 5383 for (var key in computed) { 5384 var userDef = computed[key]; 5385 var getter = typeof userDef === 'function' ? userDef : userDef.get; 5386 if (process.env.NODE_ENV !== 'production' && getter == null) { 5387 warn( 5388 ("Getter is missing for computed property \"" + key + "\"."), 5389 vm 5390 ); 5391 } 5392 5393 if (!isSSR) { 5394 // create internal watcher for the computed property. 5395 watchers[key] = new Watcher( 5396 vm, 5397 getter || noop, 5398 noop, 5399 computedWatcherOptions 5400 ); 5401 } 5402 5403 // component-defined computed properties are already defined on the 5404 // component prototype. We only need to define computed properties defined 5405 // at instantiation here. 5406 if (!(key in vm)) { 5407 defineComputed(vm, key, userDef); 5408 } else if (process.env.NODE_ENV !== 'production') { 5409 if (key in vm.$data) { 5410 warn(("The computed property \"" + key + "\" is already defined in data."), vm); 5411 } else if (vm.$options.props && key in vm.$options.props) { 5412 warn(("The computed property \"" + key + "\" is already defined as a prop."), vm); 5413 } 5414 } 5415 } 5416} 5417 5418function defineComputed ( 5419 target, 5420 key, 5421 userDef 5422) { 5423 var shouldCache = !isServerRendering(); 5424 if (typeof userDef === 'function') { 5425 sharedPropertyDefinition.get = shouldCache 5426 ? createComputedGetter(key) 5427 : createGetterInvoker(userDef); 5428 sharedPropertyDefinition.set = noop; 5429 } else { 5430 sharedPropertyDefinition.get = userDef.get 5431 ? shouldCache && userDef.cache !== false 5432 ? createComputedGetter(key) 5433 : createGetterInvoker(userDef.get) 5434 : noop; 5435 sharedPropertyDefinition.set = userDef.set || noop; 5436 } 5437 if (process.env.NODE_ENV !== 'production' && 5438 sharedPropertyDefinition.set === noop) { 5439 sharedPropertyDefinition.set = function () { 5440 warn( 5441 ("Computed property \"" + key + "\" was assigned to but it has no setter."), 5442 this 5443 ); 5444 }; 5445 } 5446 Object.defineProperty(target, key, sharedPropertyDefinition); 5447} 5448 5449function createComputedGetter (key) { 5450 return function computedGetter () { 5451 var watcher = this._computedWatchers && this._computedWatchers[key]; 5452 if (watcher) { 5453 if (watcher.dirty) { 5454 watcher.evaluate(); 5455 } 5456 if (Dep.target) {
5457 watcher.depend(); 5458 } 5459 return watcher.value 5460 } 5461 } 5462} 5463 5464function createGetterInvoker(fn) { 5465 return function computedGetter () { 5466 return fn.call(this, this) 5467 } 5468} 5469 5470function initMethods (vm, methods) { 5471 var props = vm.$options.props; 5472 for (var key in methods) { 5473 if (process.env.NODE_ENV !== 'production') { 5474 if (typeof methods[key] !== 'function') { 5475 warn( 5476 "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " + 5477 "Did you reference the function correctly?", 5478 vm 5479 ); 5480 } 5481 if (props && hasOwn(props, key)) { 5482 warn( 5483 ("Method \"" + key + "\" has already been defined as a prop."), 5484 vm 5485 ); 5486 } 5487 if ((key in vm) && isReserved(key)) { 5488 warn( 5489 "Method \"" + key + "\" conflicts with an existing Vue instance method. " + 5490 "Avoid defining component methods that start with _ or $." 5491 ); 5492 } 5493 } 5494 vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm); 5495 } 5496} 5497 5498function initWatch (vm, watch) { 5499 for (var key in watch) { 5500 var handler = watch[key]; 5501 if (Array.isArray(handler)) { 5502 for (var i = 0; i < handler.length; i++) { 5503 createWatcher(vm, key, handler[i]); 5504 } 5505 } else { 5506 createWatcher(vm, key, handler); 5507 } 5508 } 5509} 5510 5511function createWatcher ( 5512 vm, 5513 expOrFn, 5514 handler, 5515 options 5516) { 5517 if (isPlainObject(handler)) { 5518 options = handler; 5519 handler = handler.handler; 5520 } 5521 if (typeof handler === 'string') { 5522 handler = vm[handler]; 5523 } 5524 return vm.$watch(expOrFn, handler, options) 5525} 5526 5527function stateMixin (Vue) { 5528 // flow somehow has problems with directly declared definition object 5529 // when using Object.defineProperty, so we have to procedurally build up 5530 // the object here. 5531 var dataDef = {}; 5532 dataDef.get = function () { return this._data }; 5533 var propsDef = {}; 5534 propsDef.get = function () { return this._props }; 5535 if (process.env.NODE_ENV !== 'production') { 5536 dataDef.set = function () { 5537 warn( 5538 'Avoid replacing instance root $data. ' + 5539 'Use nested data properties instead.', 5540 this 5541 ); 5542 }; 5543 propsDef.set = function () { 5544 warn("$props is readonly.", this); 5545 }; 5546 } 5547 Object.defineProperty(Vue.prototype, '$data', dataDef); 5548 Object.defineProperty(Vue.prototype, '$props', propsDef); 5549 5550 Vue.prototype.$set = set; 5551 Vue.prototype.$delete = del; 5552 5553 Vue.prototype.$watch = function ( 5554 expOrFn, 5555 cb, 5556 options 5557 ) { 5558 var vm = this; 5559 if (isPlainObject(cb)) { 5560 return createWatcher(vm, expOrFn, cb, options) 5561 } 5562 options = options || {}; 5563 options.user = true; 5564 var watcher = new Watcher(vm, expOrFn, cb, options); 5565 if (options.immediate) { 5566 try { 5567 cb.call(vm, watcher.value); 5568 } catch (error) { 5569 handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\"")); 5570 } 5571 } 5572 return function unwatchFn () { 5573 watcher.teardown(); 5574 } 5575 }; 5576} 5577 5578/* */ 5579 5580var uid$3 = 0; 5581 5582function initMixin (Vue) { 5583 Vue.prototype._init = function (options) { 5584 var vm = this; 5585 // a uid 5586 vm._uid = uid$3++; 5587 5588 var startTag, endTag; 5589 /* istanbul ignore if */ 5590 if (process.env.NODE_ENV !== 'production' && config.performance && mark) { 5591 startTag = "vue-perf-start:" + (vm._uid); 5592 endTag = "vue-perf-end:" + (vm._uid); 5593 mark(startTag); 5594 } 5595 5596 // a flag to avoid this being observed 5597 vm._isVue = true; 5598 // merge options 5599 if (options && options._isComponent) { 5600 // optimize internal component instantiation 5601 // since dynamic options merging is pretty slow, and none of the 5602 // internal component options needs special treatment. 5603 initInternalComponent(vm, options); 5604 } else { 5605 vm.$options = mergeOptions( 5606 resolveConstructorOptions(vm.constructor), 5607 options || {}, 5608 vm 5609 ); 5610 } 5611 /* istanbul ignore else */ 5612 if (process.env.NODE_ENV !== 'production') { 5613 initProxy(vm); 5614 } else { 5615 vm._renderProxy = vm; 5616 } 5617 // expose real self 5618 vm._self = vm; 5619 initLifecycle(vm); 5620 initEvents(vm); 5621 initRender(vm); 5622 callHook(vm, 'beforeCreate'); 5623 initInjections(vm); // resolve injections before data/props 5624 initState(vm); 5625 initProvide(vm); // resolve provide after data/props 5626 callHook(vm, 'created'); 5627 5628 /* istanbul ignore if */ 5629 if (process.env.NODE_ENV !== 'production' && config.performance && mark) { 5630 vm._name = formatComponentName(vm, false); 5631 mark(endTag); 5632 measure(("vue " + (vm._name) + " init"), startTag, endTag); 5633 } 5634 5635 if (vm.$options.el) { 5636 vm.$mount(vm.$options.el); 5637 } 5638 }; 5639} 5640 5641function initInternalComponent (vm, options) { 5642 var opts = vm.$options = Object.create(vm.constructor.options); 5643 // doing this because it's faster than dynamic enumeration. 5644 var parentVnode = options._parentVnode; 5645 opts.parent = options.parent; 5646 opts._parentVnode = parentVnode; 5647 5648 var vnodeComponentOptions = parentVnode.componentOptions; 5649 opts.propsData = vnodeComponentOptions.propsData; 5650 opts._parentListeners = vnodeComponentOptions.listeners; 5651 opts._renderChildren = vnodeComponentOptions.children; 5652 opts._componentTag = vnodeComponentOptions.tag; 5653 5654 if (options.render) { 5655 opts.render = options.render; 5656 opts.staticRenderFns = options.staticRenderFns; 5657 } 5658} 5659
vendor: 4,158 bytes, lines 5660-5814
5660function resolveConstructorOptions (Ctor) { 5661 var options = Ctor.options; 5662 if (Ctor.super) { 5663 var superOptions = resolveConstructorOptions(Ctor.super); 5664 var cachedSuperOptions = Ctor.superOptions; 5665 if (superOptions !== cachedSuperOptions) { 5666 // super option changed, 5667 // need to resolve new options. 5668 Ctor.superOptions = superOptions; 5669 // check if there are any late-modified/attached options (#4976) 5670 var modifiedOptions = resolveModifiedOptions(Ctor); 5671 // update base extend options 5672 if (modifiedOptions) { 5673 extend(Ctor.extendOptions, modifiedOptions); 5674 } 5675 options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions); 5676 if (options.name) { 5677 options.components[options.name] = Ctor; 5678 } 5679 } 5680 } 5681 return options 5682} 5683 5684function resolveModifiedOptions (Ctor) { 5685 var modified; 5686 var latest = Ctor.options; 5687 var sealed = Ctor.sealedOptions; 5688 for (var key in latest) { 5689 if (latest[key] !== sealed[key]) { 5690 if (!modified) { modified = {}; } 5691 modified[key] = latest[key]; 5692 } 5693 } 5694 return modified 5695} 5696 5697function Vue (options) { 5698 if (process.env.NODE_ENV !== 'production' && 5699 !(this instanceof Vue) 5700 ) { 5701 warn('Vue is a constructor and should be called with the `new` keyword'); 5702 } 5703 this._init(options); 5704} 5705 5706initMixin(Vue); 5707stateMixin(Vue); 5708eventsMixin(Vue); 5709lifecycleMixin(Vue); 5710renderMixin(Vue); 5711 5712/* */ 5713 5714function initUse (Vue) { 5715 Vue.use = function (plugin) { 5716 var installedPlugins = (this._installedPlugins || (this._installedPlugins = [])); 5717 if (installedPlugins.indexOf(plugin) > -1) { 5718 return this 5719 } 5720 5721 // additional parameters 5722 var args = toArray(arguments, 1); 5723 args.unshift(this); 5724 if (typeof plugin.install === 'function') { 5725 plugin.install.apply(plugin, args); 5726 } else if (typeof plugin === 'function') { 5727 plugin.apply(null, args); 5728 } 5729 installedPlugins.push(plugin); 5730 return this 5731 }; 5732} 5733 5734/* */ 5735 5736function initMixin$1 (Vue) { 5737 Vue.mixin = function (mixin) { 5738 this.options = mergeOptions(this.options, mixin); 5739 return this 5740 }; 5741} 5742 5743/* */ 5744 5745function initExtend (Vue) { 5746 /** 5747 * Each instance constructor, including Vue, has a unique 5748 * cid. This enables us to create wrapped "child 5749 * constructors" for prototypal inheritance and cache them. 5750 */ 5751 Vue.cid = 0; 5752 var cid = 1; 5753 5754 /** 5755 * Class inheritance 5756 */ 5757 Vue.extend = function (extendOptions) { 5758 extendOptions = extendOptions || {}; 5759 var Super = this; 5760 var SuperId = Super.cid; 5761 var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {}); 5762 if (cachedCtors[SuperId]) { 5763 return cachedCtors[SuperId] 5764 } 5765 5766 var name = extendOptions.name || Super.options.name; 5767 if (process.env.NODE_ENV !== 'production' && name) { 5768 validateComponentName(name); 5769 } 5770 5771 var Sub = function VueComponent (options) { 5772 this._init(options); 5773 }; 5774 Sub.prototype = Object.create(Super.prototype); 5775 Sub.prototype.constructor = Sub; 5776 Sub.cid = cid++; 5777 Sub.options = mergeOptions( 5778 Super.options, 5779 extendOptions 5780 ); 5781 Sub['super'] = Super; 5782 5783 // For props and computed properties, we define the proxy getters on 5784 // the Vue instances at extension time, on the extended prototype. This 5785 // avoids Object.defineProperty calls for each instance created. 5786 if (Sub.options.props) { 5787 initProps$1(Sub); 5788 } 5789 if (Sub.options.computed) { 5790 initComputed$1(Sub); 5791 } 5792 5793 // allow further extension/mixin/plugin usage 5794 Sub.extend = Super.extend; 5795 Sub.mixin = Super.mixin; 5796 Sub.use = Super.use; 5797 5798 // create asset registers, so extended classes 5799 // can have their private assets too. 5800 ASSET_TYPES.forEach(function (type) { 5801 Sub[type] = Super[type]; 5802 }); 5803 // enable recursive self-lookup 5804 if (name) { 5805 Sub.options.components[name] = Sub; 5806 } 5807 5808 // keep a reference to the super options at extension time. 5809 // later at instantiation we can check if Super's options have 5810 // been updated. 5811 Sub.superOptions = Super.options; 5812 Sub.extendOptions = extendOptions; 5813 Sub.sealedOptions = extend({}, Sub.options); 5814
vendor: 12,461 bytes, lines 5815-6293
5815 // cache constructor 5816 cachedCtors[SuperId] = Sub; 5817 return Sub 5818 }; 5819} 5820 5821function initProps$1 (Comp) { 5822 var props = Comp.options.props; 5823 for (var key in props) { 5824 proxy(Comp.prototype, "_props", key); 5825 } 5826} 5827 5828function initComputed$1 (Comp) { 5829 var computed = Comp.options.computed; 5830 for (var key in computed) { 5831 defineComputed(Comp.prototype, key, computed[key]); 5832 } 5833} 5834 5835/* */ 5836 5837function initAssetRegisters (Vue) { 5838 /** 5839 * Create asset registration methods. 5840 */ 5841 ASSET_TYPES.forEach(function (type) { 5842 Vue[type] = function ( 5843 id, 5844 definition 5845 ) { 5846 if (!definition) { 5847 return this.options[type + 's'][id] 5848 } else { 5849 /* istanbul ignore if */ 5850 if (process.env.NODE_ENV !== 'production' && type === 'component') { 5851 validateComponentName(id); 5852 } 5853 if (type === 'component' && isPlainObject(definition)) { 5854 definition.name = definition.name || id; 5855 definition = this.options._base.extend(definition); 5856 } 5857 if (type === 'directive' && typeof definition === 'function') { 5858 definition = { bind: definition, update: definition }; 5859 } 5860 this.options[type + 's'][id] = definition; 5861 return definition 5862 } 5863 }; 5864 }); 5865} 5866 5867/* */ 5868 5869 5870 5871function getComponentName (opts) { 5872 return opts && (opts.Ctor.options.name || opts.tag) 5873} 5874 5875function matches (pattern, name) { 5876 if (Array.isArray(pattern)) { 5877 return pattern.indexOf(name) > -1 5878 } else if (typeof pattern === 'string') { 5879 return pattern.split(',').indexOf(name) > -1 5880 } else if (isRegExp(pattern)) { 5881 return pattern.test(name) 5882 } 5883 /* istanbul ignore next */ 5884 return false 5885} 5886 5887function pruneCache (keepAliveInstance, filter) { 5888 var cache = keepAliveInstance.cache; 5889 var keys = keepAliveInstance.keys; 5890 var _vnode = keepAliveInstance._vnode; 5891 for (var key in cache) { 5892 var cachedNode = cache[key]; 5893 if (cachedNode) { 5894 var name = getComponentName(cachedNode.componentOptions); 5895 if (name && !filter(name)) { 5896 pruneCacheEntry(cache, key, keys, _vnode); 5897 } 5898 } 5899 } 5900} 5901 5902function pruneCacheEntry ( 5903 cache, 5904 key, 5905 keys, 5906 current 5907) { 5908 var cached$$1 = cache[key]; 5909 if (cached$$1 && (!current || cached$$1.tag !== current.tag)) { 5910 cached$$1.componentInstance.$destroy(); 5911 } 5912 cache[key] = null; 5913 remove(keys, key); 5914} 5915 5916var patternTypes = [String, RegExp, Array]; 5917 5918var KeepAlive = { 5919 name: 'keep-alive', 5920 abstract: true, 5921 5922 props: { 5923 include: patternTypes, 5924 exclude: patternTypes, 5925 max: [String, Number] 5926 }, 5927 5928 created: function created () { 5929 this.cache = Object.create(null); 5930 this.keys = []; 5931 }, 5932 5933 destroyed: function destroyed () { 5934 for (var key in this.cache) { 5935 pruneCacheEntry(this.cache, key, this.keys); 5936 } 5937 }, 5938 5939 mounted: function mounted () { 5940 var this$1 = this; 5941 5942 this.$watch('include', function (val) { 5943 pruneCache(this$1, function (name) { return matches(val, name); }); 5944 }); 5945 this.$watch('exclude', function (val) { 5946 pruneCache(this$1, function (name) { return !matches(val, name); }); 5947 }); 5948 }, 5949 5950 render: function render () { 5951 var slot = this.$slots.default; 5952 var vnode = getFirstComponentChild(slot); 5953 var componentOptions = vnode && vnode.componentOptions; 5954 if (componentOptions) { 5955 // check pattern 5956 var name = getComponentName(componentOptions); 5957 var ref = this; 5958 var include = ref.include; 5959 var exclude = ref.exclude; 5960 if ( 5961 // not included 5962 (include && (!name || !matches(include, name))) || 5963 // excluded 5964 (exclude && name && matches(exclude, name)) 5965 ) { 5966 return vnode 5967 } 5968 5969 var ref$1 = this; 5970 var cache = ref$1.cache; 5971 var keys = ref$1.keys; 5972 var key = vnode.key == null 5973 // same constructor may get registered as different local components 5974 // so cid alone is not enough (#3269) 5975 ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '') 5976 : vnode.key; 5977 if (cache[key]) { 5978 vnode.componentInstance = cache[key].componentInstance; 5979 // make current key freshest 5980 remove(keys, key); 5981 keys.push(key); 5982 } else { 5983 cache[key] = vnode; 5984 keys.push(key); 5985 // prune oldest entry 5986 if (this.max && keys.length > parseInt(this.max)) { 5987 pruneCacheEntry(cache, keys[0], keys, this._vnode); 5988 } 5989 } 5990 5991 vnode.data.keepAlive = true; 5992 } 5993 return vnode || (slot && slot[0]) 5994 } 5995}; 5996 5997var builtInComponents = { 5998 KeepAlive: KeepAlive 5999}; 6000 6001/* */ 6002 6003function initGlobalAPI (Vue) { 6004 // config 6005 var configDef = {}; 6006 configDef.get = function () { return config; }; 6007 if (process.env.NODE_ENV !== 'production') { 6008 configDef.set = function () { 6009 warn( 6010 'Do not replace the Vue.config object, set individual fields instead.' 6011 ); 6012 }; 6013 } 6014 Object.defineProperty(Vue, 'config', configDef); 6015 6016 // exposed util methods. 6017 // NOTE: these are not considered part of the public API - avoid relying on 6018 // them unless you are aware of the risk. 6019 Vue.util = { 6020 warn: warn, 6021 extend: extend, 6022 mergeOptions: mergeOptions, 6023 defineReactive: defineReactive$$1 6024 }; 6025 6026 Vue.set = set; 6027 Vue.delete = del; 6028 Vue.nextTick = nextTick; 6029 6030 // 2.6 explicit observable API 6031 Vue.observable = function (obj) { 6032 observe(obj); 6033 return obj 6034 }; 6035 6036 Vue.options = Object.create(null); 6037 ASSET_TYPES.forEach(function (type) { 6038 Vue.options[type + 's'] = Object.create(null); 6039 }); 6040 6041 // this is used to identify the "base" constructor to extend all plain-object 6042 // components with in Weex's multi-instance scenarios. 6043 Vue.options._base = Vue; 6044 6045 extend(Vue.options.components, builtInComponents); 6046 6047 initUse(Vue); 6048 initMixin$1(Vue); 6049 initExtend(Vue); 6050 initAssetRegisters(Vue); 6051} 6052 6053initGlobalAPI(Vue); 6054 6055Object.defineProperty(Vue.prototype, '$isServer', { 6056 get: isServerRendering 6057}); 6058 6059Object.defineProperty(Vue.prototype, '$ssrContext', { 6060 get: function get () { 6061 /* istanbul ignore next */ 6062 return this.$vnode && this.$vnode.ssrContext 6063 } 6064}); 6065 6066// expose FunctionalRenderContext for ssr runtime helper installation 6067Object.defineProperty(Vue, 'FunctionalRenderContext', { 6068 value: FunctionalRenderContext 6069}); 6070 6071Vue.version = '2.6.11'; 6072 6073/* */ 6074 6075// these are reserved for web because they are directly compiled away 6076// during template compilation 6077var isReservedAttr = makeMap('style,class'); 6078 6079// attributes that should be using props for binding 6080var acceptValue = makeMap('input,textarea,option,select,progress'); 6081var mustUseProp = function (tag, type, attr) { 6082 return ( 6083 (attr === 'value' && acceptValue(tag)) && type !== 'button' || 6084 (attr === 'selected' && tag === 'option') || 6085 (attr === 'checked' && tag === 'input') || 6086 (attr === 'muted' && tag === 'video') 6087 ) 6088}; 6089 6090var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck'); 6091 6092var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only'); 6093 6094var convertEnumeratedValue = function (key, value) { 6095 return isFalsyAttrValue(value) || value === 'false' 6096 ? 'false' 6097 // allow arbitrary string value for contenteditable 6098 : key === 'contenteditable' && isValidContentEditableValue(value) 6099 ? value 6100 : 'true' 6101}; 6102 6103var isBooleanAttr = makeMap( 6104 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' + 6105 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' + 6106 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' + 6107 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' + 6108 'required,reversed,scoped,seamless,selected,sortable,translate,' + 6109 'truespeed,typemustmatch,visible' 6110); 6111 6112var xlinkNS = 'http://www.w3.org/1999/xlink'; 6113 6114var isXlink = function (name) { 6115 return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink' 6116}; 6117 6118var getXlinkProp = function (name) { 6119 return isXlink(name) ? name.slice(6, name.length) : '' 6120}; 6121 6122var isFalsyAttrValue = function (val) { 6123 return val == null || val === false 6124}; 6125 6126/* */ 6127 6128function genClassForVnode (vnode) { 6129 var data = vnode.data; 6130 var parentNode = vnode; 6131 var childNode = vnode; 6132 while (isDef(childNode.componentInstance)) { 6133 childNode = childNode.componentInstance._vnode; 6134 if (childNode && childNode.data) { 6135 data = mergeClassData(childNode.data, data); 6136 } 6137 } 6138 while (isDef(parentNode = parentNode.parent)) { 6139 if (parentNode && parentNode.data) { 6140 data = mergeClassData(data, parentNode.data); 6141 } 6142 } 6143 return renderClass(data.staticClass, data.class) 6144} 6145 6146function mergeClassData (child, parent) { 6147 return { 6148 staticClass: concat(child.staticClass, parent.staticClass), 6149 class: isDef(child.class) 6150 ? [child.class, parent.class] 6151 : parent.class 6152 } 6153} 6154 6155function renderClass ( 6156 staticClass, 6157 dynamicClass 6158) { 6159 if (isDef(staticClass) || isDef(dynamicClass)) { 6160 return concat(staticClass, stringifyClass(dynamicClass)) 6161 } 6162 /* istanbul ignore next */ 6163 return '' 6164} 6165 6166function concat (a, b) { 6167 return a ? b ? (a + ' ' + b) : a : (b || '') 6168} 6169 6170function stringifyClass (value) { 6171 if (Array.isArray(value)) { 6172 return stringifyArray(value) 6173 } 6174 if (isObject(value)) { 6175 return stringifyObject(value) 6176 } 6177 if (typeof value === 'string') { 6178 return value 6179 } 6180 /* istanbul ignore next */ 6181 return '' 6182} 6183 6184function stringifyArray (value) { 6185 var res = ''; 6186 var stringified; 6187 for (var i = 0, l = value.length; i < l; i++) { 6188 if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') { 6189 if (res) { res += ' '; } 6190 res += stringified; 6191 } 6192 } 6193 return res 6194} 6195 6196function stringifyObject (value) { 6197 var res = ''; 6198 for (var key in value) { 6199 if (value[key]) { 6200 if (res) { res += ' '; } 6201 res += key; 6202 } 6203 } 6204 return res 6205} 6206 6207/* */ 6208 6209var namespaceMap = { 6210 svg: 'http://www.w3.org/2000/svg', 6211 math: 'http://www.w3.org/1998/Math/MathML' 6212}; 6213 6214var isHTMLTag = makeMap( 6215 '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); 6227 6228// this map is intentionally selective, only covering SVG elements that may 6229// contain child elements. 6230var isSVG = makeMap( 6231 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' + 6232 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' + 6233 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', 6234 true 6235); 6236 6237var isPreTag = function (tag) { return tag === 'pre'; }; 6238 6239var isReservedTag = function (tag) { 6240 return isHTMLTag(tag) || isSVG(tag) 6241}; 6242 6243function getTagNamespace (tag) { 6244 if (isSVG(tag)) { 6245 return 'svg' 6246 } 6247 // basic support for MathML 6248 // note it doesn't support other MathML elements being component roots 6249 if (tag === 'math') { 6250 return 'math' 6251 } 6252} 6253 6254var unknownElementCache = Object.create(null); 6255function isUnknownElement (tag) { 6256 /* istanbul ignore if */ 6257 if (!inBrowser) { 6258 return true 6259 } 6260 if (isReservedTag(tag)) { 6261 return false 6262 } 6263 tag = tag.toLowerCase(); 6264 /* istanbul ignore if */ 6265 if (unknownElementCache[tag] != null) { 6266 return unknownElementCache[tag] 6267 } 6268 var el = document.createElement(tag); 6269 if (tag.indexOf('-') > -1) { 6270 // http://stackoverflow.com/a/28210364/1070244 6271 return (unknownElementCache[tag] = ( 6272 el.constructor === window.HTMLUnknownElement || 6273 el.constructor === window.HTMLElement 6274 )) 6275 } else { 6276 return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString())) 6277 } 6278} 6279 6280var isTextInputType = makeMap('text,number,password,search,email,tel,url'); 6281 6282/* */ 6283 6284/** 6285 * Query an element selector if it's not an element already. 6286 */ 6287function query (el) { 6288 if (typeof el === 'string') { 6289 var selected = document.querySelector(el); 6290 if (!selected) { 6291 process.env.NODE_ENV !== 'production' && warn( 6292 'Cannot find element: ' + el 6293 )
vendor: 6,151 bytes, lines 6293-6553
6293; 6294 return document.createElement('div') 6295 } 6296 return selected 6297 } else { 6298 return el 6299 } 6300} 6301 6302/* */ 6303 6304function createElement$1 (tagName, vnode) { 6305 var elm = document.createElement(tagName); 6306 if (tagName !== 'select') { 6307 return elm 6308 } 6309 // false or null will remove the attribute but undefined will not 6310 if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) { 6311 elm.setAttribute('multiple', 'multiple'); 6312 } 6313 return elm 6314} 6315 6316function createElementNS (namespace, tagName) { 6317 return document.createElementNS(namespaceMap[namespace], tagName) 6318} 6319 6320function createTextNode (text) { 6321 return document.createTextNode(text) 6322} 6323 6324function createComment (text) { 6325 return document.createComment(text) 6326} 6327 6328function insertBefore (parentNode, newNode, referenceNode) { 6329 parentNode.insertBefore(newNode, referenceNode); 6330} 6331 6332function removeChild (node, child) { 6333 node.removeChild(child); 6334} 6335 6336function appendChild (node, child) { 6337 node.appendChild(child); 6338} 6339 6340function parentNode (node) { 6341 return node.parentNode 6342} 6343 6344function nextSibling (node) { 6345 return node.nextSibling 6346} 6347 6348function tagName (node) { 6349 return node.tagName 6350} 6351 6352function setTextContent (node, text) { 6353 node.textContent = text; 6354} 6355 6356function setStyleScope (node, scopeId) { 6357 node.setAttribute(scopeId, ''); 6358} 6359 6360var nodeOps = /*#__PURE__*/Object.freeze({ 6361 createElement: createElement$1, 6362 createElementNS: createElementNS, 6363 createTextNode: createTextNode, 6364 createComment: createComment, 6365 insertBefore: insertBefore, 6366 removeChild: removeChild, 6367 appendChild: appendChild, 6368 parentNode: parentNode, 6369 nextSibling: nextSibling, 6370 tagName: tagName, 6371 setTextContent: setTextContent, 6372 setStyleScope: setStyleScope 6373}); 6374 6375/* */ 6376 6377var ref = { 6378 create: function create (_, vnode) { 6379 registerRef(vnode); 6380 }, 6381 update: function update (oldVnode, vnode) { 6382 if (oldVnode.data.ref !== vnode.data.ref) { 6383 registerRef(oldVnode, true); 6384 registerRef(vnode); 6385 } 6386 }, 6387 destroy: function destroy (vnode) { 6388 registerRef(vnode, true); 6389 } 6390}; 6391 6392function registerRef (vnode, isRemoval) { 6393 var key = vnode.data.ref; 6394 if (!isDef(key)) { return } 6395 6396 var vm = vnode.context; 6397 var ref = vnode.componentInstance || vnode.elm; 6398 var refs = vm.$refs; 6399 if (isRemoval) { 6400 if (Array.isArray(refs[key])) { 6401 remove(refs[key], ref); 6402 } else if (refs[key] === ref) { 6403 refs[key] = undefined; 6404 } 6405 } else { 6406 if (vnode.data.refInFor) { 6407 if (!Array.isArray(refs[key])) { 6408 refs[key] = [ref]; 6409 } else if (refs[key].indexOf(ref) < 0) { 6410 // $flow-disable-line 6411 refs[key].push(ref); 6412 } 6413 } else { 6414 refs[key] = ref; 6415 } 6416 } 6417} 6418 6419/** 6420 * Virtual DOM patching algorithm based on Snabbdom by 6421 * Simon Friis Vindum (@paldepind) 6422 * Licensed under the MIT License 6423 * https://github.com/paldepind/snabbdom/blob/master/LICENSE 6424 * 6425 * modified by Evan You (@yyx990803) 6426 * 6427 * Not type-checking this because this file is perf-critical and the cost 6428 * of making flow understand it is not worth it. 6429 */ 6430 6431var emptyNode = new VNode('', {}, []); 6432 6433var hooks = ['create', 'activate', 'update', 'remove', 'destroy']; 6434 6435function sameVnode (a, b) { 6436 return ( 6437 a.key === b.key && ( 6438 ( 6439 a.tag === b.tag && 6440 a.isComment === b.isComment && 6441 isDef(a.data) === isDef(b.data) && 6442 sameInputType(a, b) 6443 ) || ( 6444 isTrue(a.isAsyncPlaceholder) && 6445 a.asyncFactory === b.asyncFactory && 6446 isUndef(b.asyncFactory.error) 6447 ) 6448 ) 6449 ) 6450} 6451 6452function sameInputType (a, b) { 6453 if (a.tag !== 'input') { return true } 6454 var i; 6455 var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type; 6456 var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type; 6457 return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB) 6458} 6459 6460function createKeyToOldIdx (children, beginIdx, endIdx) { 6461 var i, key; 6462 var map = {}; 6463 for (i = beginIdx; i <= endIdx; ++i) { 6464 key = children[i].key; 6465 if (isDef(key)) { map[key] = i; } 6466 } 6467 return map 6468} 6469 6470function createPatchFunction (backend) { 6471 var i, j; 6472 var cbs = {}; 6473 6474 var modules = backend.modules; 6475 var nodeOps = backend.nodeOps; 6476 6477 for (i = 0; i < hooks.length; ++i) { 6478 cbs[hooks[i]] = []; 6479 for (j = 0; j < modules.length; ++j) { 6480 if (isDef(modules[j][hooks[i]])) { 6481 cbs[hooks[i]].push(modules[j][hooks[i]]); 6482 } 6483 } 6484 } 6485 6486 function emptyNodeAt (elm) { 6487 return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm) 6488 } 6489 6490 function createRmCb (childElm, listeners) { 6491 function remove$$1 () { 6492 if (--remove$$1.listeners === 0) { 6493 removeNode(childElm); 6494 } 6495 } 6496 remove$$1.listeners = listeners; 6497 return remove$$1 6498 } 6499 6500 function removeNode (el) { 6501 var parent = nodeOps.parentNode(el); 6502 // element may have already been removed due to v-html / v-text 6503 if (isDef(parent)) { 6504 nodeOps.removeChild(parent, el); 6505 } 6506 } 6507 6508 function isUnknownElement$$1 (vnode, inVPre) { 6509 return ( 6510 !inVPre && 6511 !vnode.ns && 6512 !( 6513 config.ignoredElements.length && 6514 config.ignoredElements.some(function (ignore) { 6515 return isRegExp(ignore) 6516 ? ignore.test(vnode.tag) 6517 : ignore === vnode.tag 6518 }) 6519 ) && 6520 config.isUnknownElement(vnode.tag) 6521 ) 6522 } 6523 6524 var creatingElmInVPre = 0; 6525 6526 function createElm ( 6527 vnode, 6528 insertedVnodeQueue, 6529 parentElm, 6530 refElm, 6531 nested, 6532 ownerArray, 6533 index 6534 ) { 6535 if (isDef(vnode.elm) && isDef(ownerArray)) { 6536 // This vnode was used in a previous render! 6537 // now it's used as a new node, overwriting its elm would cause 6538 // potential patch errors down the road when it's used as an insertion 6539 // reference node. Instead, we clone the node on-demand before creating 6540 // associated DOM element for it. 6541 vnode = ownerArray[index] = cloneVNode(vnode); 6542 } 6543 6544 vnode.isRootInsert = !nested; // for transition enter check 6545 if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) { 6546 return 6547 } 6548 6549 var data = vnode.data; 6550 var children = vnode.children; 6551 var tag = vnode.tag; 6552 if (isDef(tag)) { 6553 if (
vendor: 1,774 bytes, lines 6553-6603
6553process.env.NODE_ENV !== 'production') { 6554 if (data && data.pre) { 6555 creatingElmInVPre++; 6556 } 6557 if (isUnknownElement$$1(vnode, creatingElmInVPre)) { 6558 warn( 6559 'Unknown custom element: <' + tag + '> - did you ' + 6560 'register the component correctly? For recursive components, ' + 6561 'make sure to provide the "name" option.', 6562 vnode.context 6563 ); 6564 } 6565 } 6566 6567 vnode.elm = vnode.ns 6568 ? nodeOps.createElementNS(vnode.ns, tag) 6569 : nodeOps.createElement(tag, vnode); 6570 setScope(vnode); 6571 6572 /* istanbul ignore if */ 6573 { 6574 createChildren(vnode, children, insertedVnodeQueue); 6575 if (isDef(data)) { 6576 invokeCreateHooks(vnode, insertedVnodeQueue); 6577 } 6578 insert(parentElm, vnode.elm, refElm); 6579 } 6580 6581 if (process.env.NODE_ENV !== 'production' && data && data.pre) { 6582 creatingElmInVPre--; 6583 } 6584 } else if (isTrue(vnode.isComment)) { 6585 vnode.elm = nodeOps.createComment(vnode.text); 6586 insert(parentElm, vnode.elm, refElm); 6587 } else { 6588 vnode.elm = nodeOps.createTextNode(vnode.text); 6589 insert(parentElm, vnode.elm, refElm); 6590 } 6591 } 6592 6593 function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) { 6594 var i = vnode.data; 6595 if (isDef(i)) { 6596 var isReactivated = isDef(vnode.componentInstance) && i.keepAlive; 6597 if (isDef(i = i.hook) && isDef(i = i.init)) { 6598 i(vnode, false /* hydrating */); 6599 } 6600 // after calling the init hook, if the vnode is a child component 6601 // it should've created a child instance and mounted it. the child 6602 // component also has set the placeholder vnode's elm. 6603 // in that case we can just return the element and be done.
vendor: 15,080 bytes, lines 6604-7032
6604 if (isDef(vnode.componentInstance)) { 6605 initComponent(vnode, insertedVnodeQueue); 6606 insert(parentElm, vnode.elm, refElm); 6607 if (isTrue(isReactivated)) { 6608 reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm); 6609 } 6610 return true 6611 } 6612 } 6613 } 6614 6615 function initComponent (vnode, insertedVnodeQueue) { 6616 if (isDef(vnode.data.pendingInsert)) { 6617 insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert); 6618 vnode.data.pendingInsert = null; 6619 } 6620 vnode.elm = vnode.componentInstance.$el; 6621 if (isPatchable(vnode)) { 6622 invokeCreateHooks(vnode, insertedVnodeQueue); 6623 setScope(vnode); 6624 } else { 6625 // empty component root. 6626 // skip all element-related modules except for ref (#3455) 6627 registerRef(vnode); 6628 // make sure to invoke the insert hook 6629 insertedVnodeQueue.push(vnode); 6630 } 6631 } 6632 6633 function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) { 6634 var i; 6635 // hack for #4339: a reactivated component with inner transition 6636 // does not trigger because the inner node's created hooks are not called 6637 // again. It's not ideal to involve module-specific logic in here but 6638 // there doesn't seem to be a better way to do it. 6639 var innerNode = vnode; 6640 while (innerNode.componentInstance) { 6641 innerNode = innerNode.componentInstance._vnode; 6642 if (isDef(i = innerNode.data) && isDef(i = i.transition)) { 6643 for (i = 0; i < cbs.activate.length; ++i) { 6644 cbs.activate[i](emptyNode, innerNode); 6645 } 6646 insertedVnodeQueue.push(innerNode); 6647 break 6648 } 6649 } 6650 // unlike a newly created component, 6651 // a reactivated keep-alive component doesn't insert itself 6652 insert(parentElm, vnode.elm, refElm); 6653 } 6654 6655 function insert (parent, elm, ref$$1) { 6656 if (isDef(parent)) { 6657 if (isDef(ref$$1)) { 6658 if (nodeOps.parentNode(ref$$1) === parent) { 6659 nodeOps.insertBefore(parent, elm, ref$$1); 6660 } 6661 } else { 6662 nodeOps.appendChild(parent, elm); 6663 } 6664 } 6665 } 6666 6667 function createChildren (vnode, children, insertedVnodeQueue) { 6668 if (Array.isArray(children)) { 6669 if (process.env.NODE_ENV !== 'production') { 6670 checkDuplicateKeys(children); 6671 } 6672 for (var i = 0; i < children.length; ++i) { 6673 createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i); 6674 } 6675 } else if (isPrimitive(vnode.text)) { 6676 nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text))); 6677 } 6678 } 6679 6680 function isPatchable (vnode) { 6681 while (vnode.componentInstance) { 6682 vnode = vnode.componentInstance._vnode; 6683 } 6684 return isDef(vnode.tag) 6685 } 6686 6687 function invokeCreateHooks (vnode, insertedVnodeQueue) { 6688 for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) { 6689 cbs.create[i$1](emptyNode, vnode); 6690 } 6691 i = vnode.data.hook; // Reuse variable 6692 if (isDef(i)) { 6693 if (isDef(i.create)) { i.create(emptyNode, vnode); } 6694 if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); } 6695 } 6696 } 6697 6698 // set scope id attribute for scoped CSS. 6699 // this is implemented as a special case to avoid the overhead 6700 // of going through the normal attribute patching process. 6701 function setScope (vnode) { 6702 var i; 6703 if (isDef(i = vnode.fnScopeId)) { 6704 nodeOps.setStyleScope(vnode.elm, i); 6705 } else { 6706 var ancestor = vnode; 6707 while (ancestor) { 6708 if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) { 6709 nodeOps.setStyleScope(vnode.elm, i); 6710 } 6711 ancestor = ancestor.parent; 6712 } 6713 } 6714 // for slot content they should also get the scopeId from the host instance. 6715 if (isDef(i = activeInstance) && 6716 i !== vnode.context && 6717 i !== vnode.fnContext && 6718 isDef(i = i.$options._scopeId) 6719 ) { 6720 nodeOps.setStyleScope(vnode.elm, i); 6721 } 6722 } 6723 6724 function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) { 6725 for (; startIdx <= endIdx; ++startIdx) { 6726 createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx); 6727 } 6728 } 6729 6730 function invokeDestroyHook (vnode) { 6731 var i, j; 6732 var data = vnode.data; 6733 if (isDef(data)) { 6734 if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); } 6735 for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); } 6736 } 6737 if (isDef(i = vnode.children)) { 6738 for (j = 0; j < vnode.children.length; ++j) { 6739 invokeDestroyHook(vnode.children[j]); 6740 } 6741 } 6742 } 6743 6744 function removeVnodes (vnodes, startIdx, endIdx) { 6745 for (; startIdx <= endIdx; ++startIdx) { 6746 var ch = vnodes[startIdx]; 6747 if (isDef(ch)) { 6748 if (isDef(ch.tag)) { 6749 removeAndInvokeRemoveHook(ch); 6750 invokeDestroyHook(ch); 6751 } else { // Text node 6752 removeNode(ch.elm); 6753 } 6754 } 6755 } 6756 } 6757 6758 function removeAndInvokeRemoveHook (vnode, rm) { 6759 if (isDef(rm) || isDef(vnode.data)) { 6760 var i; 6761 var listeners = cbs.remove.length + 1; 6762 if (isDef(rm)) { 6763 // we have a recursively passed down rm callback 6764 // increase the listeners count 6765 rm.listeners += listeners; 6766 } else { 6767 // directly removing 6768 rm = createRmCb(vnode.elm, listeners); 6769 } 6770 // recursively invoke hooks on child component root node 6771 if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) { 6772 removeAndInvokeRemoveHook(i, rm); 6773 } 6774 for (i = 0; i < cbs.remove.length; ++i) { 6775 cbs.remove[i](vnode, rm); 6776 } 6777 if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) { 6778 i(vnode, rm); 6779 } else { 6780 rm(); 6781 } 6782 } else { 6783 removeNode(vnode.elm); 6784 } 6785 } 6786 6787 function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) { 6788 var oldStartIdx = 0; 6789 var newStartIdx = 0; 6790 var oldEndIdx = oldCh.length - 1; 6791 var oldStartVnode = oldCh[0]; 6792 var oldEndVnode = oldCh[oldEndIdx]; 6793 var newEndIdx = newCh.length - 1; 6794 var newStartVnode = newCh[0]; 6795 var newEndVnode = newCh[newEndIdx]; 6796 var oldKeyToIdx, idxInOld, vnodeToMove, refElm; 6797 6798 // removeOnly is a special flag used only by <transition-group> 6799 // to ensure removed elements stay in correct relative positions 6800 // during leaving transitions 6801 var canMove = !removeOnly; 6802 6803 if (process.env.NODE_ENV !== 'production') { 6804 checkDuplicateKeys(newCh); 6805 } 6806 6807 while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { 6808 if (isUndef(oldStartVnode)) { 6809 oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left 6810 } else if (isUndef(oldEndVnode)) { 6811 oldEndVnode = oldCh[--oldEndIdx]; 6812 } else if (sameVnode(oldStartVnode, newStartVnode)) { 6813 patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx); 6814 oldStartVnode = oldCh[++oldStartIdx]; 6815 newStartVnode = newCh[++newStartIdx]; 6816 } else if (sameVnode(oldEndVnode, newEndVnode)) { 6817 patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx); 6818 oldEndVnode = oldCh[--oldEndIdx]; 6819 newEndVnode = newCh[--newEndIdx]; 6820 } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right 6821 patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx); 6822 canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm)); 6823 oldStartVnode = oldCh[++oldStartIdx]; 6824 newEndVnode = newCh[--newEndIdx]; 6825 } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left 6826 patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx); 6827 canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm); 6828 oldEndVnode = oldCh[--oldEndIdx]; 6829 newStartVnode = newCh[++newStartIdx]; 6830 } else { 6831 if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); } 6832 idxInOld = isDef(newStartVnode.key) 6833 ? oldKeyToIdx[newStartVnode.key] 6834 : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx); 6835 if (isUndef(idxInOld)) { // New element 6836 createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx); 6837 } else { 6838 vnodeToMove = oldCh[idxInOld]; 6839 if (sameVnode(vnodeToMove, newStartVnode)) { 6840 patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx); 6841 oldCh[idxInOld] = undefined; 6842 canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm); 6843 } else { 6844 // same key but different element. treat as new element 6845 createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx); 6846 } 6847 } 6848 newStartVnode = newCh[++newStartIdx]; 6849 } 6850 } 6851 if (oldStartIdx > oldEndIdx) { 6852 refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; 6853 addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); 6854 } else if (newStartIdx > newEndIdx) { 6855 removeVnodes(oldCh, oldStartIdx, oldEndIdx); 6856 } 6857 } 6858 6859 function checkDuplicateKeys (children) { 6860 var seenKeys = {}; 6861 for (var i = 0; i < children.length; i++) { 6862 var vnode = children[i]; 6863 var key = vnode.key; 6864 if (isDef(key)) { 6865 if (seenKeys[key]) { 6866 warn( 6867 ("Duplicate keys detected: '" + key + "'. This may cause an update error."), 6868 vnode.context 6869 ); 6870 } else { 6871 seenKeys[key] = true; 6872 } 6873 } 6874 } 6875 } 6876 6877 function findIdxInOld (node, oldCh, start, end) { 6878 for (var i = start; i < end; i++) { 6879 var c = oldCh[i]; 6880 if (isDef(c) && sameVnode(node, c)) { return i } 6881 } 6882 } 6883 6884 function patchVnode ( 6885 oldVnode, 6886 vnode, 6887 insertedVnodeQueue, 6888 ownerArray, 6889 index, 6890 removeOnly 6891 ) { 6892 if (oldVnode === vnode) { 6893 return 6894 } 6895 6896 if (isDef(vnode.elm) && isDef(ownerArray)) { 6897 // clone reused vnode 6898 vnode = ownerArray[index] = cloneVNode(vnode); 6899 } 6900 6901 var elm = vnode.elm = oldVnode.elm; 6902 6903 if (isTrue(oldVnode.isAsyncPlaceholder)) { 6904 if (isDef(vnode.asyncFactory.resolved)) { 6905 hydrate(oldVnode.elm, vnode, insertedVnodeQueue); 6906 } else { 6907 vnode.isAsyncPlaceholder = true; 6908 } 6909 return 6910 } 6911 6912 // reuse element for static trees. 6913 // note we only do this if the vnode is cloned - 6914 // if the new node is not cloned it means the render functions have been 6915 // reset by the hot-reload-api and we need to do a proper re-render. 6916 if (isTrue(vnode.isStatic) && 6917 isTrue(oldVnode.isStatic) && 6918 vnode.key === oldVnode.key && 6919 (isTrue(vnode.isCloned) || isTrue(vnode.isOnce)) 6920 ) { 6921 vnode.componentInstance = oldVnode.componentInstance; 6922 return 6923 } 6924 6925 var i; 6926 var data = vnode.data; 6927 if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) { 6928 i(oldVnode, vnode); 6929 } 6930 6931 var oldCh = oldVnode.children; 6932 var ch = vnode.children; 6933 if (isDef(data) && isPatchable(vnode)) { 6934 for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); } 6935 if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); } 6936 } 6937 if (isUndef(vnode.text)) { 6938 if (isDef(oldCh) && isDef(ch)) { 6939 if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); } 6940 } else if (isDef(ch)) { 6941 if (process.env.NODE_ENV !== 'production') { 6942 checkDuplicateKeys(ch); 6943 } 6944 if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } 6945 addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); 6946 } else if (isDef(oldCh)) { 6947 removeVnodes(oldCh, 0, oldCh.length - 1); 6948 } else if (isDef(oldVnode.text)) { 6949 nodeOps.setTextContent(elm, ''); 6950 } 6951 } else if (oldVnode.text !== vnode.text) { 6952 nodeOps.setTextContent(elm, vnode.text); 6953 } 6954 if (isDef(data)) { 6955 if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); } 6956 } 6957 } 6958 6959 function invokeInsertHook (vnode, queue, initial) { 6960 // delay insert hooks for component root nodes, invoke them after the 6961 // element is really inserted 6962 if (isTrue(initial) && isDef(vnode.parent)) { 6963 vnode.parent.data.pendingInsert = queue; 6964 } else { 6965 for (var i = 0; i < queue.length; ++i) { 6966 queue[i].data.hook.insert(queue[i]); 6967 } 6968 } 6969 } 6970 6971 var hydrationBailed = false; 6972 // list of modules that can skip create hook during hydration because they 6973 // are already rendered on the client or has no need for initialization 6974 // Note: style is excluded because it relies on initial clone for future 6975 // deep updates (#7063). 6976 var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key'); 6977 6978 // Note: this is a browser-only function so we can assume elms are DOM nodes. 6979 function hydrate (elm, vnode, insertedVnodeQueue, inVPre) { 6980 var i; 6981 var tag = vnode.tag; 6982 var data = vnode.data; 6983 var children = vnode.children; 6984 inVPre = inVPre || (data && data.pre); 6985 vnode.elm = elm; 6986 6987 if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) { 6988 vnode.isAsyncPlaceholder = true; 6989 return true 6990 } 6991 // assert node match 6992 if (process.env.NODE_ENV !== 'production') { 6993 if (!assertNodeMatch(elm, vnode, inVPre)) { 6994 return false 6995 } 6996 } 6997 if (isDef(data)) { 6998 if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); } 6999 if (isDef(i = vnode.componentInstance)) { 7000 // child component. it should have hydrated its own tree. 7001 initComponent(vnode, insertedVnodeQueue); 7002 return true 7003 } 7004 } 7005 if (isDef(tag)) { 7006 if (isDef(children)) { 7007 // empty element, allow client to pick up and populate children 7008 if (!elm.hasChildNodes()) { 7009 createChildren(vnode, children, insertedVnodeQueue); 7010 } else { 7011 // v-html and domProps: innerHTML 7012 if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) { 7013 if (i !== elm.innerHTML) { 7014 /* istanbul ignore if */ 7015 if (process.env.NODE_ENV !== 'production' && 7016 typeof console !== 'undefined' && 7017 !hydrationBailed 7018 ) { 7019 hydrationBailed = true; 7020 console.warn('Parent: ', elm); 7021 console.warn('server innerHTML: ', i); 7022 console.warn('client innerHTML: ', elm.innerHTML); 7023 } 7024 return false 7025 } 7026 } else { 7027 // iterate and compare children lists 7028 var childrenMatch = true; 7029 var childNode = elm.firstChild; 7030 for (var i$1 = 0; i$1 < children.length; i$1++) { 7031 if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) { 7032 childrenMatch = false;
7033 break 7034 } 7035 childNode = childNode.nextSibling; 7036 } 7037 // if childNode is not null, it means the actual childNodes list is 7038 // longer than the virtual children list. 7039 if (!childrenMatch || childNode) { 7040 /* istanbul ignore if */ 7041 if (process.env.NODE_ENV !== 'production' && 7042 typeof console !== 'undefined' && 7043 !hydrationBailed 7044 ) { 7045 hydrationBailed = true; 7046 console.warn('Parent: ', elm); 7047 console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children); 7048 } 7049 return false 7050 } 7051 } 7052 } 7053 } 7054 if (isDef(data)) { 7055 var fullInvoke = false; 7056 for (var key in data) { 7057 if (!isRenderedModule(key)) { 7058 fullInvoke = true; 7059 invokeCreateHooks(vnode, insertedVnodeQueue); 7060 break 7061 } 7062 } 7063 if (!fullInvoke && data['class']) { 7064 // ensure collecting deps for deep class bindings for future updates 7065 traverse(data['class']); 7066 } 7067 } 7068 } else if (elm.data !== vnode.text) { 7069 elm.data = vnode.text; 7070 } 7071 return true 7072 } 7073 7074 function assertNodeMatch (node, vnode, inVPre) {
vendor: 1,987 bytes, lines 7075-7124
7075 if (isDef(vnode.tag)) { 7076 return vnode.tag.indexOf('vue-component') === 0 || ( 7077 !isUnknownElement$$1(vnode, inVPre) && 7078 vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase()) 7079 ) 7080 } else { 7081 return node.nodeType === (vnode.isComment ? 8 : 3) 7082 } 7083 } 7084 7085 return function patch (oldVnode, vnode, hydrating, removeOnly) { 7086 if (isUndef(vnode)) { 7087 if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); } 7088 return 7089 } 7090 7091 var isInitialPatch = false; 7092 var insertedVnodeQueue = []; 7093 7094 if (isUndef(oldVnode)) { 7095 // empty mount (likely as component), create new root element 7096 isInitialPatch = true; 7097 createElm(vnode, insertedVnodeQueue); 7098 } else { 7099 var isRealElement = isDef(oldVnode.nodeType); 7100 if (!isRealElement && sameVnode(oldVnode, vnode)) { 7101 // patch existing root node 7102 patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly); 7103 } else { 7104 if (isRealElement) { 7105 // mounting to a real element 7106 // check if this is server-rendered content and if we can perform 7107 // a successful hydration. 7108 if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) { 7109 oldVnode.removeAttribute(SSR_ATTR); 7110 hydrating = true; 7111 } 7112 if (isTrue(hydrating)) { 7113 if (hydrate(oldVnode, vnode, insertedVnodeQueue)) { 7114 invokeInsertHook(vnode, insertedVnodeQueue, true); 7115 return oldVnode 7116 } else if (process.env.NODE_ENV !== 'production') { 7117 warn( 7118 'The client-side rendered virtual DOM tree is not matching ' + 7119 'server-rendered content. This is likely caused by incorrect ' + 7120 'HTML markup, for example nesting block-level elements inside ' + 7121 '<p>, or missing <tbody>. Bailing hydration and performing ' + 7122 'full client-side render.' 7123 ); 7124
vendor: 8,707 bytes, lines 7124-7453
7124} 7125 } 7126 // either not server-rendered, or hydration failed. 7127 // create an empty node and replace it 7128 oldVnode = emptyNodeAt(oldVnode); 7129 } 7130 7131 // replacing existing element 7132 var oldElm = oldVnode.elm; 7133 var parentElm = nodeOps.parentNode(oldElm); 7134 7135 // create new node 7136 createElm( 7137 vnode, 7138 insertedVnodeQueue, 7139 // extremely rare edge case: do not insert if old element is in a 7140 // leaving transition. Only happens when combining transition + 7141 // keep-alive + HOCs. (#4590) 7142 oldElm._leaveCb ? null : parentElm, 7143 nodeOps.nextSibling(oldElm) 7144 ); 7145 7146 // update parent placeholder node element, recursively 7147 if (isDef(vnode.parent)) { 7148 var ancestor = vnode.parent; 7149 var patchable = isPatchable(vnode); 7150 while (ancestor) { 7151 for (var i = 0; i < cbs.destroy.length; ++i) { 7152 cbs.destroy[i](ancestor); 7153 } 7154 ancestor.elm = vnode.elm; 7155 if (patchable) { 7156 for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) { 7157 cbs.create[i$1](emptyNode, ancestor); 7158 } 7159 // #6513 7160 // invoke insert hooks that may have been merged by create hooks. 7161 // e.g. for directives that uses the "inserted" hook. 7162 var insert = ancestor.data.hook.insert; 7163 if (insert.merged) { 7164 // start at index 1 to avoid re-invoking component mounted hook 7165 for (var i$2 = 1; i$2 < insert.fns.length; i$2++) { 7166 insert.fns[i$2](); 7167 } 7168 } 7169 } else { 7170 registerRef(ancestor); 7171 } 7172 ancestor = ancestor.parent; 7173 } 7174 } 7175 7176 // destroy old node 7177 if (isDef(parentElm)) { 7178 removeVnodes([oldVnode], 0, 0); 7179 } else if (isDef(oldVnode.tag)) { 7180 invokeDestroyHook(oldVnode); 7181 } 7182 } 7183 } 7184 7185 invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch); 7186 return vnode.elm 7187 } 7188} 7189 7190/* */ 7191 7192var directives = { 7193 create: updateDirectives, 7194 update: updateDirectives, 7195 destroy: function unbindDirectives (vnode) { 7196 updateDirectives(vnode, emptyNode); 7197 } 7198}; 7199 7200function updateDirectives (oldVnode, vnode) { 7201 if (oldVnode.data.directives || vnode.data.directives) { 7202 _update(oldVnode, vnode); 7203 } 7204} 7205 7206function _update (oldVnode, vnode) { 7207 var isCreate = oldVnode === emptyNode; 7208 var isDestroy = vnode === emptyNode; 7209 var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context); 7210 var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context); 7211 7212 var dirsWithInsert = []; 7213 var dirsWithPostpatch = []; 7214 7215 var key, oldDir, dir; 7216 for (key in newDirs) { 7217 oldDir = oldDirs[key]; 7218 dir = newDirs[key]; 7219 if (!oldDir) { 7220 // new directive, bind 7221 callHook$1(dir, 'bind', vnode, oldVnode); 7222 if (dir.def && dir.def.inserted) { 7223 dirsWithInsert.push(dir); 7224 } 7225 } else { 7226 // existing directive, update 7227 dir.oldValue = oldDir.value; 7228 dir.oldArg = oldDir.arg; 7229 callHook$1(dir, 'update', vnode, oldVnode); 7230 if (dir.def && dir.def.componentUpdated) { 7231 dirsWithPostpatch.push(dir); 7232 } 7233 } 7234 } 7235 7236 if (dirsWithInsert.length) { 7237 var callInsert = function () { 7238 for (var i = 0; i < dirsWithInsert.length; i++) { 7239 callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode); 7240 } 7241 }; 7242 if (isCreate) { 7243 mergeVNodeHook(vnode, 'insert', callInsert); 7244 } else { 7245 callInsert(); 7246 } 7247 } 7248 7249 if (dirsWithPostpatch.length) { 7250 mergeVNodeHook(vnode, 'postpatch', function () { 7251 for (var i = 0; i < dirsWithPostpatch.length; i++) { 7252 callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode); 7253 } 7254 }); 7255 } 7256 7257 if (!isCreate) { 7258 for (key in oldDirs) { 7259 if (!newDirs[key]) { 7260 // no longer present, unbind 7261 callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy); 7262 } 7263 } 7264 } 7265} 7266 7267var emptyModifiers = Object.create(null); 7268 7269function normalizeDirectives$1 ( 7270 dirs, 7271 vm 7272) { 7273 var res = Object.create(null); 7274 if (!dirs) { 7275 // $flow-disable-line 7276 return res 7277 } 7278 var i, dir; 7279 for (i = 0; i < dirs.length; i++) { 7280 dir = dirs[i]; 7281 if (!dir.modifiers) { 7282 // $flow-disable-line 7283 dir.modifiers = emptyModifiers; 7284 } 7285 res[getRawDirName(dir)] = dir; 7286 dir.def = resolveAsset(vm.$options, 'directives', dir.name, true); 7287 } 7288 // $flow-disable-line 7289 return res 7290} 7291 7292function getRawDirName (dir) { 7293 return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.'))) 7294} 7295 7296function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) { 7297 var fn = dir.def && dir.def[hook]; 7298 if (fn) { 7299 try { 7300 fn(vnode.elm, dir, vnode, oldVnode, isDestroy); 7301 } catch (e) { 7302 handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook")); 7303 } 7304 } 7305} 7306 7307var baseModules = [ 7308 ref, 7309 directives 7310]; 7311 7312/* */ 7313 7314function updateAttrs (oldVnode, vnode) { 7315 var opts = vnode.componentOptions; 7316 if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) { 7317 return 7318 } 7319 if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) { 7320 return 7321 } 7322 var key, cur, old; 7323 var elm = vnode.elm; 7324 var oldAttrs = oldVnode.data.attrs || {}; 7325 var attrs = vnode.data.attrs || {}; 7326 // clone observed objects, as the user probably wants to mutate it 7327 if (isDef(attrs.__ob__)) { 7328 attrs = vnode.data.attrs = extend({}, attrs); 7329 } 7330 7331 for (key in attrs) { 7332 cur = attrs[key]; 7333 old = oldAttrs[key]; 7334 if (old !== cur) { 7335 setAttr(elm, key, cur); 7336 } 7337 } 7338 // #4391: in IE9, setting type can reset value for input[type=radio] 7339 // #6666: IE/Edge forces progress value down to 1 before setting a max 7340 /* istanbul ignore if */ 7341 if ((isIE || isEdge) && attrs.value !== oldAttrs.value) { 7342 setAttr(elm, 'value', attrs.value); 7343 } 7344 for (key in oldAttrs) { 7345 if (isUndef(attrs[key])) { 7346 if (isXlink(key)) { 7347 elm.removeAttributeNS(xlinkNS, getXlinkProp(key)); 7348 } else if (!isEnumeratedAttr(key)) { 7349 elm.removeAttribute(key); 7350 } 7351 } 7352 } 7353} 7354 7355function setAttr (el, key, value) { 7356 if (el.tagName.indexOf('-') > -1) { 7357 baseSetAttr(el, key, value); 7358 } else if (isBooleanAttr(key)) { 7359 // set attribute for blank value 7360 // e.g. <option disabled>Select one</option> 7361 if (isFalsyAttrValue(value)) { 7362 el.removeAttribute(key); 7363 } else { 7364 // technically allowfullscreen is a boolean attribute for <iframe>, 7365 // but Flash expects a value of "true" when used on <embed> tag 7366 value = key === 'allowfullscreen' && el.tagName === 'EMBED' 7367 ? 'true' 7368 : key; 7369 el.setAttribute(key, value); 7370 } 7371 } else if (isEnumeratedAttr(key)) { 7372 el.setAttribute(key, convertEnumeratedValue(key, value)); 7373 } else if (isXlink(key)) { 7374 if (isFalsyAttrValue(value)) { 7375 el.removeAttributeNS(xlinkNS, getXlinkProp(key)); 7376 } else { 7377 el.setAttributeNS(xlinkNS, key, value); 7378 } 7379 } else { 7380 baseSetAttr(el, key, value); 7381 } 7382} 7383 7384function baseSetAttr (el, key, value) { 7385 if (isFalsyAttrValue(value)) { 7386 el.removeAttribute(key); 7387 } else { 7388 // #7138: IE10 & 11 fires input event when setting placeholder on 7389 // <textarea>... block the first input event and remove the blocker 7390 // immediately. 7391 /* istanbul ignore if */ 7392 if ( 7393 isIE && !isIE9 && 7394 el.tagName === 'TEXTAREA' && 7395 key === 'placeholder' && value !== '' && !el.__ieph 7396 ) { 7397 var blocker = function (e) { 7398 e.stopImmediatePropagation(); 7399 el.removeEventListener('input', blocker); 7400 }; 7401 el.addEventListener('input', blocker); 7402 // $flow-disable-line 7403 el.__ieph = true; /* IE placeholder patched */ 7404 } 7405 el.setAttribute(key, value); 7406 } 7407} 7408 7409var attrs = { 7410 create: updateAttrs, 7411 update: updateAttrs 7412}; 7413 7414/* */ 7415 7416function updateClass (oldVnode, vnode) { 7417 var el = vnode.elm; 7418 var data = vnode.data; 7419 var oldData = oldVnode.data; 7420 if ( 7421 isUndef(data.staticClass) && 7422 isUndef(data.class) && ( 7423 isUndef(oldData) || ( 7424 isUndef(oldData.staticClass) && 7425 isUndef(oldData.class) 7426 ) 7427 ) 7428 ) { 7429 return 7430 } 7431 7432 var cls = genClassForVnode(vnode); 7433 7434 // handle transition classes 7435 var transitionClass = el._transitionClasses; 7436 if (isDef(transitionClass)) { 7437 cls = concat(cls, stringifyClass(transitionClass)); 7438 } 7439 7440 // set the class 7441 if (cls !== el._prevClass) { 7442 el.setAttribute('class', cls); 7443 el._prevClass = cls; 7444 } 7445} 7446 7447var klass = { 7448 create: updateClass, 7449 update: updateClass 7450}; 7451 7452/* */ 7453
7454var validDivisionCharRE = /[\w).+\-_$\]]/; 7455 7456function parseFilters (exp) { 7457 var inSingle = false; 7458 var inDouble = false; 7459 var inTemplateString = false; 7460 var inRegex = false; 7461 var curly = 0; 7462 var square = 0; 7463 var paren = 0; 7464 var lastFilterIndex = 0; 7465 var c, prev, i, expression, filters; 7466 7467 for (i = 0; i < exp.length; i++) { 7468 prev = c; 7469 c = exp.charCodeAt(i); 7470 if (inSingle) { 7471 if (c === 0x27 && prev !== 0x5C) { inSingle = false; } 7472 } else if (inDouble) { 7473 if (c === 0x22 && prev !== 0x5C) { inDouble = false; } 7474 } else if (inTemplateString) { 7475 if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; } 7476 } else if (inRegex) { 7477 if (c === 0x2f && prev !== 0x5C) { inRegex = false; } 7478 } else if ( 7479 c === 0x7C && // pipe 7480 exp.charCodeAt(i + 1) !== 0x7C && 7481 exp.charCodeAt(i - 1) !== 0x7C && 7482 !curly && !square && !paren 7483 ) { 7484 if (expression === undefined) { 7485 // first filter, end of expression 7486 lastFilterIndex = i + 1; 7487 expression = exp.slice(0, i).trim(); 7488 } else { 7489 pushFilter(); 7490 } 7491 } else { 7492 switch (c) { 7493 case 0x22: inDouble = true; break // " 7494 case 0x27: inSingle = true; break // ' 7495 case 0x60: inTemplateString = true; break // ` 7496 case 0x28: paren++; break // ( 7497 case 0x29: paren--; break // ) 7498 case 0x5B: square++; break // [ 7499 case 0x5D: square--; break // ] 7500 case 0x7B: curly++; break // { 7501 case 0x7D: curly--; break // } 7502 } 7503 if (c === 0x2f) { // / 7504 var j = i - 1; 7505 var p = (void 0); 7506 // find first non-whitespace prev char 7507 for (; j >= 0; j--) { 7508 p = exp.charAt(j); 7509 if (p !== ' ') { break } 7510 } 7511 if (!p || !validDivisionCharRE.test(p)) { 7512 inRegex = true; 7513 } 7514 } 7515 } 7516 } 7517 7518 if (expression === undefined) { 7519 expression = exp.slice(0, i).trim(); 7520 } else if (lastFilterIndex !== 0) { 7521 pushFilter(); 7522 } 7523 7524 function pushFilter () { 7525 (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim()); 7526 lastFilterIndex = i + 1; 7527 } 7528 7529 if (filters) { 7530 for (i = 0; i < filters.length; i++) { 7531 expression = wrapFilter(expression, filters[i]); 7532 } 7533 } 7534 7535 return expression 7536} 7537 7538function wrapFilter (exp, filter) { 7539 var i = filter.indexOf('('); 7540 if (i < 0) { 7541 // _f: resolveFilter 7542 return ("_f(\"" + filter + "\")(" + exp + ")") 7543 } else { 7544 var name = filter.slice(0, i); 7545 var args = filter.slice(i + 1); 7546 return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args)) 7547 } 7548} 7549 7550/* */ 7551 7552 7553 7554/* eslint-disable no-unused-vars */ 7555function baseWarn (msg, range) { 7556 console.error(("[Vue compiler]: " + msg)); 7557} 7558/* eslint-enable no-unused-vars */ 7559 7560function pluckModuleFunction ( 7561 modules, 7562 key 7563) { 7564 return modules 7565 ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; }) 7566 : [] 7567} 7568 7569function addProp (el, name, value, range, dynamic) { 7570 (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range)); 7571 el.plain = false; 7572} 7573 7574function addAttr (el, name, value, range, dynamic) { 7575 var attrs = dynamic 7576 ? (el.dynamicAttrs || (el.dynamicAttrs = [])) 7577 : (el.attrs || (el.attrs = [])); 7578 attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range)); 7579 el.plain = false; 7580} 7581 7582// add a raw attr (use this in preTransforms) 7583function addRawAttr (el, name, value, range) { 7584 el.attrsMap[name] = value; 7585 el.attrsList.push(rangeSetItem({ name: name, value: value }, range)); 7586} 7587 7588function addDirective ( 7589 el, 7590 name, 7591 rawName, 7592 value, 7593 arg, 7594 isDynamicArg, 7595 modifiers, 7596 range 7597) { 7598 (el.directives || (el.directives = [])).push(rangeSetItem({ 7599 name: name, 7600 rawName: rawName, 7601 value: value, 7602 arg: arg, 7603 isDynamicArg: isDynamicArg, 7604 modifiers: modifiers 7605 }, range)); 7606 el.plain = false; 7607} 7608 7609function prependModifierMarker (symbol, name, dynamic) { 7610 return dynamic 7611 ? ("_p(" + name + ",\"" + symbol + "\")") 7612 : symbol + name // mark the event as captured 7613} 7614 7615function addHandler ( 7616 el, 7617 name, 7618 value, 7619 modifiers, 7620 important, 7621 warn, 7622 range, 7623 dynamic 7624) { 7625 modifiers = modifiers || emptyObject; 7626 // warn prevent and passive modifier 7627 /* istanbul ignore if */ 7628 if ( 7629 process.env.NODE_ENV !== 'production' && warn && 7630 modifiers.prevent && modifiers.passive 7631 ) { 7632 warn( 7633 'passive and prevent can\'t be used together. ' + 7634 'Passive handler can\'t prevent default event.', 7635 range 7636 ); 7637 } 7638 7639 // normalize click.right and click.middle since they don't actually fire 7640 // this is technically browser-specific, but at least for now browsers are 7641 // the only target envs that have right/middle clicks.
7642 if (modifiers.right) { 7643 if (dynamic) { 7644 name = "(" + name + ")==='click'?'contextmenu':(" + name + ")"; 7645 } else if (name === 'click') { 7646 name = 'contextmenu'; 7647 delete modifiers.right; 7648 } 7649 } else if (modifiers.middle) { 7650 if (dynamic) { 7651 name = "(" + name + ")==='click'?'mouseup':(" + name + ")"; 7652 } else if (name === 'click') { 7653 name = 'mouseup'; 7654 } 7655 } 7656 7657 // check capture modifier 7658 if (modifiers.capture) { 7659 delete modifiers.capture; 7660 name = prependModifierMarker('!', name, dynamic); 7661 } 7662 if (modifiers.once) { 7663 delete modifiers.once; 7664 name = prependModifierMarker('~', name, dynamic); 7665 } 7666 /* istanbul ignore if */ 7667 if (modifiers.passive) { 7668 delete modifiers.passive; 7669 name = prependModifierMarker('&', name, dynamic); 7670 } 7671 7672 var events; 7673 if (modifiers.native) { 7674 delete modifiers.native; 7675 events = el.nativeEvents || (el.nativeEvents = {}); 7676 } else { 7677 events = el.events || (el.events = {}); 7678 } 7679 7680 var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range); 7681 if (modifiers !== emptyObject) { 7682 newHandler.modifiers = modifiers; 7683 } 7684 7685 var handlers = events[name]; 7686 /* istanbul ignore if */ 7687 if (Array.isArray(handlers)) { 7688 important ? handlers.unshift(newHandler) : handlers.push(newHandler); 7689 } else if (handlers) { 7690 events[name] = important ? [newHandler, handlers] : [handlers, newHandler]; 7691 } else { 7692 events[name] = newHandler; 7693 } 7694 7695 el.plain = false; 7696} 7697 7698function getRawBindingAttr ( 7699 el, 7700 name 7701) { 7702 return el.rawAttrsMap[':' + name] || 7703 el.rawAttrsMap['v-bind:' + name] || 7704 el.rawAttrsMap[name] 7705} 7706 7707function getBindingAttr ( 7708 el, 7709 name, 7710 getStatic 7711) { 7712 var dynamicValue = 7713 getAndRemoveAttr(el, ':' + name) || 7714 getAndRemoveAttr(el, 'v-bind:' + name); 7715 if (dynamicValue != null) { 7716 return parseFilters(dynamicValue) 7717 } else if (getStatic !== false) { 7718 var staticValue = getAndRemoveAttr(el, name); 7719 if (staticValue != null) { 7720 return JSON.stringify(staticValue) 7721 } 7722 } 7723} 7724 7725// note: this only removes the attr from the Array (attrsList) so that it 7726// doesn't get processed by processAttrs. 7727// By default it does NOT remove it from the map (attrsMap) because the map is 7728// needed during codegen. 7729function getAndRemoveAttr ( 7730 el, 7731 name, 7732 removeFromMap 7733) { 7734 var val; 7735 if ((val = el.attrsMap[name]) != null) { 7736 var list = el.attrsList; 7737 for (var i = 0, l = list.length; i < l; i++) { 7738 if (list[i].name === name) { 7739 list.splice(i, 1); 7740 break 7741 } 7742 } 7743 } 7744 if (removeFromMap) { 7745 delete el.attrsMap[name]; 7746 } 7747 return val 7748} 7749 7750function getAndRemoveAttrByRegex ( 7751 el, 7752 name 7753) { 7754 var list = el.attrsList; 7755 for (var i = 0, l = list.length; i < l; i++) { 7756 var attr = list[i]; 7757 if (name.test(attr.name)) { 7758 list.splice(i, 1); 7759 return attr 7760 } 7761 } 7762} 7763 7764function rangeSetItem ( 7765 item, 7766 range 7767) { 7768 if (range) { 7769 if (range.start != null) { 7770 item.start = range.start; 7771 } 7772 if (range.end != null) { 7773 item.end = range.end; 7774 } 7775 } 7776 return item 7777} 7778 7779/* */ 7780 7781/** 7782 * Cross-platform code generation for component v-model 7783 */ 7784function genComponentModel ( 7785 el, 7786 value, 7787 modifiers 7788) { 7789 var ref = modifiers || {}; 7790 var number = ref.number; 7791 var trim = ref.trim; 7792 7793 var baseValueExpression = '$$v'; 7794 var valueExpression = baseValueExpression; 7795 if (trim) { 7796 valueExpression = 7797 "(typeof " + baseValueExpression + " === 'string'" + 7798 "? " + baseValueExpression + ".trim()" + 7799 ": " + baseValueExpression + ")"; 7800 } 7801 if (number) { 7802 valueExpression = "_n(" + valueExpression + ")"; 7803 } 7804 var assignment = genAssignmentCode(value, valueExpression); 7805 7806 el.model = { 7807 value: ("(" + value + ")"), 7808 expression: JSON.stringify(value), 7809 callback: ("function (" + baseValueExpression + ") {" + assignment + "}") 7810 }; 7811} 7812 7813/** 7814 * Cross-platform codegen helper for generating v-model value assignment code. 7815 */ 7816function genAssignmentCode ( 7817 value, 7818 assignment 7819) { 7820 var res = parseModel(value); 7821 if (res.key === null) { 7822 return (value + "=" + assignment) 7823 } else { 7824 return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")") 7825 } 7826} 7827 7828/** 7829 * Parse a v-model expression into a base path and a final key segment. 7830 * Handles both dot-path and possible square brackets. 7831 * 7832 * Possible cases: 7833 * 7834 * - test 7835 * - test[key] 7836 * - test[test1[key]] 7837 * - test["a"][key] 7838 * - xxx.test[a[a].test1[key]] 7839 * - test.xxx.a["asa"][test1[key]] 7840 * 7841 */ 7842 7843var len, str, chr, index$1, expressionPos, expressionEndPos; 7844 7845 7846 7847function parseModel (val) { 7848 // Fix https://github.com/vuejs/vue/pull/7730 7849 // allow v-model="obj.val " (trailing whitespace) 7850 val = val.trim(); 7851 len = val.length; 7852 7853 if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) { 7854 index$1 = val.lastIndexOf('.'); 7855 if (index$1 > -1) { 7856 return { 7857 exp: val.slice(0, index$1), 7858 key: '"' + val.slice(index$1 + 1) + '"' 7859 } 7860 } else { 7861 return { 7862 exp: val, 7863 key: null 7864 } 7865 } 7866 } 7867 7868 str = val; 7869 index$1 = expressionPos = expressionEndPos = 0; 7870 7871 while (!eof()) { 7872 chr = next(); 7873 /* istanbul ignore if */ 7874 if (isStringStart(chr)) { 7875 parseString(chr); 7876 } else if (chr === 0x5B) { 7877 parseBracket(chr); 7878 } 7879 } 7880 7881 return { 7882 exp: val.slice(0, expressionPos), 7883 key: val.slice(expressionPos + 1, expressionEndPos) 7884 } 7885} 7886 7887function next () { 7888 return str.charCodeAt(++index$1) 7889} 7890 7891function eof () { 7892 return index$1 >= len 7893} 7894 7895function isStringStart (chr) { 7896 return chr === 0x22 || chr === 0x27 7897} 7898 7899function parseBracket (chr) { 7900 var inBracket = 1; 7901 expressionPos = index$1; 7902 while (!eof()) { 7903 chr = next(); 7904 if (isStringStart(chr)) { 7905 parseString(chr); 7906 continue 7907 } 7908 if (chr === 0x5B) { inBracket++; } 7909 if (chr === 0x5D) { inBracket--; } 7910 if (inBracket === 0) { 7911 expressionEndPos = index$1; 7912 break 7913 } 7914 } 7915} 7916 7917function parseString (chr) { 7918 var stringQuote = chr; 7919 while (!eof()) { 7920 chr = next(); 7921 if (chr === stringQuote) { 7922 break 7923 } 7924 } 7925} 7926 7927/* */ 7928 7929var warn$1; 7930 7931// in some cases, the event used has to be determined at runtime 7932// so we used some reserved tokens during compile. 7933var RANGE_TOKEN = '__r'; 7934var CHECKBOX_RADIO_TOKEN = '__c'; 7935 7936function model ( 7937 el, 7938 dir, 7939 _warn 7940) { 7941 warn$1 = _warn; 7942 var value = dir.value; 7943 var modifiers = dir.modifiers; 7944 var tag = el.tag; 7945 var type = el.attrsMap.type; 7946 7947 if (process.env.NODE_ENV !== 'production') { 7948 // inputs with type="file" are read only and setting the input's 7949 // value will throw an error. 7950 if (tag === 'input' && type === 'file') { 7951 warn$1( 7952 "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" + 7953 "File inputs are read only. Use a v-on:change listener instead.", 7954 el.rawAttrsMap['v-model'] 7955 ); 7956 } 7957 } 7958 7959 if (el.component) { 7960 genComponentModel(el, value, modifiers); 7961 // component v-model doesn't need extra runtime 7962 return false 7963 } else if (tag === 'select') { 7964 genSelect(el, value, modifiers); 7965 } else if (tag === 'input' && type === 'checkbox') {
7966 genCheckboxModel(el, value, modifiers); 7967 } else if (tag === 'input' && type === 'radio') { 7968 genRadioModel(el, value, modifiers); 7969 } else if (tag === 'input' || tag === 'textarea') { 7970 genDefaultModel(el, value, modifiers); 7971 } else if (!config.isReservedTag(tag)) { 7972 genComponentModel(el, value, modifiers); 7973 // component v-model doesn't need extra runtime 7974 return false 7975 } else if (process.env.NODE_ENV !== 'production') { 7976 warn$1( 7977 "<" + (el.tag) + " v-model=\"" + value + "\">: " + 7978 "v-model is not supported on this element type. " + 7979 'If you are working with contenteditable, it\'s recommended to ' + 7980 'wrap a library dedicated for that purpose inside a custom component.', 7981 el.rawAttrsMap['v-model'] 7982 ); 7983 } 7984 7985 // ensure runtime directive metadata 7986 return true 7987} 7988 7989function genCheckboxModel ( 7990 el, 7991 value, 7992 modifiers 7993) { 7994 var number = modifiers && modifiers.number; 7995 var valueBinding = getBindingAttr(el, 'value') || 'null'; 7996 var trueValueBinding = getBindingAttr(el, 'true-value') || 'true'; 7997 var falseValueBinding = getBindingAttr(el, 'false-value') || 'false'; 7998 addProp(el, 'checked', 7999 "Array.isArray(" + value + ")" + 8000 "?_i(" + value + "," + valueBinding + ")>-1" + ( 8001 trueValueBinding === 'true' 8002 ? (":(" + value + ")") 8003 : (":_q(" + value + "," + trueValueBinding + ")") 8004 ) 8005 ); 8006 addHandler(el, 'change', 8007 "var $$a=" + value + "," + 8008 '$$el=$event.target,' + 8009 "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" + 8010 'if(Array.isArray($$a)){' + 8011 "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," + 8012 '$$i=_i($$a,$$v);' + 8013 "if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" + 8014 "else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" + 8015 "}else{" + (genAssignmentCode(value, '$$c')) + "}", 8016 null, true 8017 ); 8018} 8019 8020function genRadioModel ( 8021 el, 8022 value, 8023 modifiers 8024) { 8025 var number = modifiers && modifiers.number; 8026 var valueBinding = getBindingAttr(el, 'value') || 'null'; 8027 valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding; 8028 addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")")); 8029 addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true); 8030} 8031 8032function genSelect ( 8033 el, 8034 value, 8035 modifiers 8036) { 8037 var number = modifiers && modifiers.number; 8038 var selectedVal = "Array.prototype.filter" + 8039 ".call($event.target.options,function(o){return o.selected})" + 8040 ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" + 8041 "return " + (number ? '_n(val)' : 'val') + "})"; 8042 8043 var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]'; 8044 var code = "var $$selectedVal = " + selectedVal + ";"; 8045 code = code + " " + (genAssignmentCode(value, assignment)); 8046 addHandler(el, 'change', code, null, true); 8047} 8048 8049function genDefaultModel ( 8050 el, 8051 value, 8052 modifiers 8053) { 8054 var type = el.attrsMap.type; 8055 8056 // warn if v-bind:value conflicts with v-model 8057 // except for inputs with v-bind:type 8058 if (process.env.NODE_ENV !== 'production') { 8059 var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value']; 8060 var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type']; 8061 if (value$1 && !typeBinding) { 8062 var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value'; 8063 warn$1( 8064 binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " + 8065 'because the latter already expands to a value binding internally', 8066 el.rawAttrsMap[binding] 8067 ); 8068 } 8069 } 8070 8071 var ref = modifiers || {}; 8072 var lazy = ref.lazy; 8073 var number = ref.number; 8074 var trim = ref.trim; 8075 var needCompositionGuard = !lazy && type !== 'range'; 8076 var event = lazy 8077 ? 'change' 8078 : type === 'range' 8079 ? RANGE_TOKEN 8080 : 'input'; 8081 8082 var valueExpression = '$event.target.value'; 8083 if (trim) { 8084 valueExpression = "$event.target.value.trim()"; 8085 } 8086 if (number) { 8087 valueExpression = "_n(" + valueExpression + ")"; 8088 } 8089
8090 var code = genAssignmentCode(value, valueExpression); 8091 if (needCompositionGuard) { 8092 code = "if($event.target.composing)return;" + code; 8093 } 8094 8095 addProp(el, 'value', ("(" + value + ")")); 8096 addHandler(el, event, code, null, true); 8097 if (trim || number) { 8098 addHandler(el, 'blur', '$forceUpdate()'); 8099 } 8100}
vendor: 20,457 bytes, lines 8100-8826
8100 8101 8102/* */ 8103 8104// normalize v-model event tokens that can only be determined at runtime. 8105// it's important to place the event as the first in the array because 8106// the whole point is ensuring the v-model callback gets called before 8107// user-attached handlers. 8108function normalizeEvents (on) { 8109 /* istanbul ignore if */ 8110 if (isDef(on[RANGE_TOKEN])) { 8111 // IE input[type=range] only supports `change` event 8112 var event = isIE ? 'change' : 'input'; 8113 on[event] = [].concat(on[RANGE_TOKEN], on[event] || []); 8114 delete on[RANGE_TOKEN]; 8115 } 8116 // This was originally intended to fix #4521 but no longer necessary 8117 // after 2.5. Keeping it for backwards compat with generated code from < 2.4 8118 /* istanbul ignore if */ 8119 if (isDef(on[CHECKBOX_RADIO_TOKEN])) { 8120 on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []); 8121 delete on[CHECKBOX_RADIO_TOKEN]; 8122 } 8123} 8124 8125var target$1; 8126 8127function createOnceHandler$1 (event, handler, capture) { 8128 var _target = target$1; // save current target element in closure 8129 return function onceHandler () { 8130 var res = handler.apply(null, arguments); 8131 if (res !== null) { 8132 remove$2(event, onceHandler, capture, _target); 8133 } 8134 } 8135} 8136 8137// #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp 8138// implementation and does not fire microtasks in between event propagation, so 8139// safe to exclude. 8140var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53); 8141 8142function add$1 ( 8143 name, 8144 handler, 8145 capture, 8146 passive 8147) { 8148 // async edge case #6566: inner click event triggers patch, event handler 8149 // attached to outer element during patch, and triggered again. This 8150 // happens because browsers fire microtask ticks between event propagation. 8151 // the solution is simple: we save the timestamp when a handler is attached, 8152 // and the handler would only fire if the event passed to it was fired 8153 // AFTER it was attached. 8154 if (useMicrotaskFix) { 8155 var attachedTimestamp = currentFlushTimestamp; 8156 var original = handler; 8157 handler = original._wrapper = function (e) { 8158 if ( 8159 // no bubbling, should always fire. 8160 // this is just a safety net in case event.timeStamp is unreliable in 8161 // certain weird environments... 8162 e.target === e.currentTarget || 8163 // event is fired after handler attachment 8164 e.timeStamp >= attachedTimestamp || 8165 // bail for environments that have buggy event.timeStamp implementations 8166 // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState 8167 // #9681 QtWebEngine event.timeStamp is negative value 8168 e.timeStamp <= 0 || 8169 // #9448 bail if event is fired in another document in a multi-page 8170 // electron/nw.js app, since event.timeStamp will be using a different 8171 // starting reference 8172 e.target.ownerDocument !== document 8173 ) { 8174 return original.apply(this, arguments) 8175 } 8176 }; 8177 } 8178 target$1.addEventListener( 8179 name, 8180 handler, 8181 supportsPassive 8182 ? { capture: capture, passive: passive } 8183 : capture 8184 ); 8185} 8186 8187function remove$2 ( 8188 name, 8189 handler, 8190 capture, 8191 _target 8192) { 8193 (_target || target$1).removeEventListener( 8194 name, 8195 handler._wrapper || handler, 8196 capture 8197 ); 8198} 8199 8200function updateDOMListeners (oldVnode, vnode) { 8201 if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) { 8202 return 8203 } 8204 var on = vnode.data.on || {}; 8205 var oldOn = oldVnode.data.on || {}; 8206 target$1 = vnode.elm; 8207 normalizeEvents(on); 8208 updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context); 8209 target$1 = undefined; 8210} 8211 8212var events = { 8213 create: updateDOMListeners, 8214 update: updateDOMListeners 8215}; 8216 8217/* */ 8218 8219var svgContainer; 8220 8221function updateDOMProps (oldVnode, vnode) { 8222 if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) { 8223 return 8224 } 8225 var key, cur; 8226 var elm = vnode.elm; 8227 var oldProps = oldVnode.data.domProps || {}; 8228 var props = vnode.data.domProps || {}; 8229 // clone observed objects, as the user probably wants to mutate it 8230 if (isDef(props.__ob__)) { 8231 props = vnode.data.domProps = extend({}, props); 8232 } 8233 8234 for (key in oldProps) { 8235 if (!(key in props)) { 8236 elm[key] = ''; 8237 } 8238 } 8239 8240 for (key in props) { 8241 cur = props[key]; 8242 // ignore children if the node has textContent or innerHTML, 8243 // as these will throw away existing DOM nodes and cause removal errors 8244 // on subsequent patches (#3360) 8245 if (key === 'textContent' || key === 'innerHTML') { 8246 if (vnode.children) { vnode.children.length = 0; } 8247 if (cur === oldProps[key]) { continue } 8248 // #6601 work around Chrome version <= 55 bug where single textNode 8249 // replaced by innerHTML/textContent retains its parentNode property 8250 if (elm.childNodes.length === 1) { 8251 elm.removeChild(elm.childNodes[0]); 8252 } 8253 } 8254 8255 if (key === 'value' && elm.tagName !== 'PROGRESS') { 8256 // store value as _value as well since 8257 // non-string values will be stringified 8258 elm._value = cur; 8259 // avoid resetting cursor position when value is the same 8260 var strCur = isUndef(cur) ? '' : String(cur); 8261 if (shouldUpdateValue(elm, strCur)) { 8262 elm.value = strCur; 8263 } 8264 } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) { 8265 // IE doesn't support innerHTML for SVG elements 8266 svgContainer = svgContainer || document.createElement('div'); 8267 svgContainer.innerHTML = "<svg>" + cur + "</svg>"; 8268 var svg = svgContainer.firstChild; 8269 while (elm.firstChild) { 8270 elm.removeChild(elm.firstChild); 8271 } 8272 while (svg.firstChild) { 8273 elm.appendChild(svg.firstChild); 8274 } 8275 } else if ( 8276 // skip the update if old and new VDOM state is the same. 8277 // `value` is handled separately because the DOM value may be temporarily 8278 // out of sync with VDOM state due to focus, composition and modifiers. 8279 // This #4521 by skipping the unnecesarry `checked` update. 8280 cur !== oldProps[key] 8281 ) { 8282 // some property updates can throw 8283 // e.g. `value` on <progress> w/ non-finite value 8284 try { 8285 elm[key] = cur; 8286 } catch (e) {} 8287 } 8288 } 8289} 8290 8291// check platforms/web/util/attrs.js acceptValue 8292 8293 8294function shouldUpdateValue (elm, checkVal) { 8295 return (!elm.composing && ( 8296 elm.tagName === 'OPTION' || 8297 isNotInFocusAndDirty(elm, checkVal) || 8298 isDirtyWithModifiers(elm, checkVal) 8299 )) 8300} 8301 8302function isNotInFocusAndDirty (elm, checkVal) { 8303 // return true when textbox (.number and .trim) loses focus and its value is 8304 // not equal to the updated value 8305 var notInFocus = true; 8306 // #6157 8307 // work around IE bug when accessing document.activeElement in an iframe 8308 try { notInFocus = document.activeElement !== elm; } catch (e) {} 8309 return notInFocus && elm.value !== checkVal 8310} 8311 8312function isDirtyWithModifiers (elm, newVal) { 8313 var value = elm.value; 8314 var modifiers = elm._vModifiers; // injected by v-model runtime 8315 if (isDef(modifiers)) { 8316 if (modifiers.number) { 8317 return toNumber(value) !== toNumber(newVal) 8318 } 8319 if (modifiers.trim) { 8320 return value.trim() !== newVal.trim() 8321 } 8322 } 8323 return value !== newVal 8324} 8325 8326var domProps = { 8327 create: updateDOMProps, 8328 update: updateDOMProps 8329}; 8330 8331/* */ 8332 8333var parseStyleText = cached(function (cssText) { 8334 var res = {}; 8335 var listDelimiter = /;(?![^(]*\))/g; 8336 var propertyDelimiter = /:(.+)/; 8337 cssText.split(listDelimiter).forEach(function (item) { 8338 if (item) { 8339 var tmp = item.split(propertyDelimiter); 8340 tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim()); 8341 } 8342 }); 8343 return res 8344}); 8345 8346// merge static and dynamic style data on the same vnode 8347function normalizeStyleData (data) { 8348 var style = normalizeStyleBinding(data.style); 8349 // static style is pre-processed into an object during compilation 8350 // and is always a fresh object, so it's safe to merge into it 8351 return data.staticStyle 8352 ? extend(data.staticStyle, style) 8353 : style 8354} 8355 8356// normalize possible array / string values into Object 8357function normalizeStyleBinding (bindingStyle) { 8358 if (Array.isArray(bindingStyle)) { 8359 return toObject(bindingStyle) 8360 } 8361 if (typeof bindingStyle === 'string') { 8362 return parseStyleText(bindingStyle) 8363 } 8364 return bindingStyle 8365} 8366 8367/** 8368 * parent component style should be after child's 8369 * so that parent component's style could override it 8370 */ 8371function getStyle (vnode, checkChild) { 8372 var res = {}; 8373 var styleData; 8374 8375 if (checkChild) { 8376 var childNode = vnode; 8377 while (childNode.componentInstance) { 8378 childNode = childNode.componentInstance._vnode; 8379 if ( 8380 childNode && childNode.data && 8381 (styleData = normalizeStyleData(childNode.data)) 8382 ) { 8383 extend(res, styleData); 8384 } 8385 } 8386 } 8387 8388 if ((styleData = normalizeStyleData(vnode.data))) { 8389 extend(res, styleData); 8390 } 8391 8392 var parentNode = vnode; 8393 while ((parentNode = parentNode.parent)) { 8394 if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) { 8395 extend(res, styleData); 8396 } 8397 } 8398 return res 8399} 8400 8401/* */ 8402 8403var cssVarRE = /^--/; 8404var importantRE = /\s*!important$/; 8405var setProp = function (el, name, val) { 8406 /* istanbul ignore if */ 8407 if (cssVarRE.test(name)) { 8408 el.style.setProperty(name, val); 8409 } else if (importantRE.test(val)) { 8410 el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important'); 8411 } else { 8412 var normalizedName = normalize(name); 8413 if (Array.isArray(val)) { 8414 // Support values array created by autoprefixer, e.g. 8415 // {display: ["-webkit-box", "-ms-flexbox", "flex"]} 8416 // Set them one by one, and the browser will only set those it can recognize 8417 for (var i = 0, len = val.length; i < len; i++) { 8418 el.style[normalizedName] = val[i]; 8419 } 8420 } else { 8421 el.style[normalizedName] = val; 8422 } 8423 } 8424}; 8425 8426var vendorNames = ['Webkit', 'Moz', 'ms']; 8427 8428var emptyStyle; 8429var normalize = cached(function (prop) { 8430 emptyStyle = emptyStyle || document.createElement('div').style; 8431 prop = camelize(prop); 8432 if (prop !== 'filter' && (prop in emptyStyle)) { 8433 return prop 8434 } 8435 var capName = prop.charAt(0).toUpperCase() + prop.slice(1); 8436 for (var i = 0; i < vendorNames.length; i++) { 8437 var name = vendorNames[i] + capName; 8438 if (name in emptyStyle) { 8439 return name 8440 } 8441 } 8442}); 8443 8444function updateStyle (oldVnode, vnode) { 8445 var data = vnode.data; 8446 var oldData = oldVnode.data; 8447 8448 if (isUndef(data.staticStyle) && isUndef(data.style) && 8449 isUndef(oldData.staticStyle) && isUndef(oldData.style) 8450 ) { 8451 return 8452 } 8453 8454 var cur, name; 8455 var el = vnode.elm; 8456 var oldStaticStyle = oldData.staticStyle; 8457 var oldStyleBinding = oldData.normalizedStyle || oldData.style || {}; 8458 8459 // if static style exists, stylebinding already merged into it when doing normalizeStyleData 8460 var oldStyle = oldStaticStyle || oldStyleBinding; 8461 8462 var style = normalizeStyleBinding(vnode.data.style) || {}; 8463 8464 // store normalized style under a different key for next diff 8465 // make sure to clone it if it's reactive, since the user likely wants 8466 // to mutate it. 8467 vnode.data.normalizedStyle = isDef(style.__ob__) 8468 ? extend({}, style) 8469 : style; 8470 8471 var newStyle = getStyle(vnode, true); 8472 8473 for (name in oldStyle) { 8474 if (isUndef(newStyle[name])) { 8475 setProp(el, name, ''); 8476 } 8477 } 8478 for (name in newStyle) { 8479 cur = newStyle[name]; 8480 if (cur !== oldStyle[name]) { 8481 // ie9 setting to null has no effect, must use empty string 8482 setProp(el, name, cur == null ? '' : cur); 8483 } 8484 } 8485} 8486 8487var style = { 8488 create: updateStyle, 8489 update: updateStyle 8490}; 8491 8492/* */ 8493 8494var whitespaceRE = /\s+/; 8495 8496/** 8497 * Add class with compatibility for SVG since classList is not supported on 8498 * SVG elements in IE 8499 */ 8500function addClass (el, cls) { 8501 /* istanbul ignore if */ 8502 if (!cls || !(cls = cls.trim())) { 8503 return 8504 } 8505 8506 /* istanbul ignore else */ 8507 if (el.classList) { 8508 if (cls.indexOf(' ') > -1) { 8509 cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); }); 8510 } else { 8511 el.classList.add(cls); 8512 } 8513 } else { 8514 var cur = " " + (el.getAttribute('class') || '') + " "; 8515 if (cur.indexOf(' ' + cls + ' ') < 0) { 8516 el.setAttribute('class', (cur + cls).trim()); 8517 } 8518 } 8519} 8520 8521/** 8522 * Remove class with compatibility for SVG since classList is not supported on 8523 * SVG elements in IE 8524 */ 8525function removeClass (el, cls) { 8526 /* istanbul ignore if */ 8527 if (!cls || !(cls = cls.trim())) { 8528 return 8529 } 8530 8531 /* istanbul ignore else */ 8532 if (el.classList) { 8533 if (cls.indexOf(' ') > -1) { 8534 cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); }); 8535 } else { 8536 el.classList.remove(cls); 8537 } 8538 if (!el.classList.length) { 8539 el.removeAttribute('class'); 8540 } 8541 } else { 8542 var cur = " " + (el.getAttribute('class') || '') + " "; 8543 var tar = ' ' + cls + ' '; 8544 while (cur.indexOf(tar) >= 0) { 8545 cur = cur.replace(tar, ' '); 8546 } 8547 cur = cur.trim(); 8548 if (cur) { 8549 el.setAttribute('class', cur); 8550 } else { 8551 el.removeAttribute('class'); 8552 } 8553 } 8554} 8555 8556/* */ 8557 8558function resolveTransition (def$$1) { 8559 if (!def$$1) { 8560 return 8561 } 8562 /* istanbul ignore else */ 8563 if (typeof def$$1 === 'object') { 8564 var res = {}; 8565 if (def$$1.css !== false) { 8566 extend(res, autoCssTransition(def$$1.name || 'v')); 8567 } 8568 extend(res, def$$1); 8569 return res 8570 } else if (typeof def$$1 === 'string') { 8571 return autoCssTransition(def$$1) 8572 } 8573} 8574 8575var autoCssTransition = cached(function (name) { 8576 return { 8577 enterClass: (name + "-enter"), 8578 enterToClass: (name + "-enter-to"), 8579 enterActiveClass: (name + "-enter-active"), 8580 leaveClass: (name + "-leave"), 8581 leaveToClass: (name + "-leave-to"), 8582 leaveActiveClass: (name + "-leave-active") 8583 } 8584}); 8585 8586var hasTransition = inBrowser && !isIE9; 8587var TRANSITION = 'transition'; 8588var ANIMATION = 'animation'; 8589 8590// Transition property/event sniffing 8591var transitionProp = 'transition'; 8592var transitionEndEvent = 'transitionend'; 8593var animationProp = 'animation'; 8594var animationEndEvent = 'animationend'; 8595if (hasTransition) { 8596 /* istanbul ignore if */ 8597 if (window.ontransitionend === undefined && 8598 window.onwebkittransitionend !== undefined 8599 ) { 8600 transitionProp = 'WebkitTransition'; 8601 transitionEndEvent = 'webkitTransitionEnd'; 8602 } 8603 if (window.onanimationend === undefined && 8604 window.onwebkitanimationend !== undefined 8605 ) { 8606 animationProp = 'WebkitAnimation'; 8607 animationEndEvent = 'webkitAnimationEnd'; 8608 } 8609} 8610 8611// binding to window is necessary to make hot reload work in IE in strict mode 8612var raf = inBrowser 8613 ? window.requestAnimationFrame 8614 ? window.requestAnimationFrame.bind(window) 8615 : setTimeout 8616 : /* istanbul ignore next */ function (fn) { return fn(); }; 8617 8618function nextFrame (fn) { 8619 raf(function () { 8620 raf(fn); 8621 }); 8622} 8623 8624function addTransitionClass (el, cls) { 8625 var transitionClasses = el._transitionClasses || (el._transitionClasses = []); 8626 if (transitionClasses.indexOf(cls) < 0) { 8627 transitionClasses.push(cls); 8628 addClass(el, cls); 8629 } 8630} 8631 8632function removeTransitionClass (el, cls) { 8633 if (el._transitionClasses) { 8634 remove(el._transitionClasses, cls); 8635 } 8636 removeClass(el, cls); 8637} 8638 8639function whenTransitionEnds ( 8640 el, 8641 expectedType, 8642 cb 8643) { 8644 var ref = getTransitionInfo(el, expectedType); 8645 var type = ref.type; 8646 var timeout = ref.timeout; 8647 var propCount = ref.propCount; 8648 if (!type) { return cb() } 8649 var event = type === TRANSITION ? transitionEndEvent : animationEndEvent; 8650 var ended = 0; 8651 var end = function () { 8652 el.removeEventListener(event, onEnd); 8653 cb(); 8654 }; 8655 var onEnd = function (e) { 8656 if (e.target === el) { 8657 if (++ended >= propCount) { 8658 end(); 8659 } 8660 } 8661 }; 8662 setTimeout(function () { 8663 if (ended < propCount) { 8664 end(); 8665 } 8666 }, timeout + 1); 8667 el.addEventListener(event, onEnd); 8668} 8669 8670var transformRE = /\b(transform|all)(,|$)/; 8671 8672function getTransitionInfo (el, expectedType) { 8673 var styles = window.getComputedStyle(el); 8674 // JSDOM may return undefined for transition properties 8675 var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', '); 8676 var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', '); 8677 var transitionTimeout = getTimeout(transitionDelays, transitionDurations); 8678 var animationDelays = (styles[animationProp + 'Delay'] || '').split(', '); 8679 var animationDurations = (styles[animationProp + 'Duration'] || '').split(', '); 8680 var animationTimeout = getTimeout(animationDelays, animationDurations); 8681 8682 var type; 8683 var timeout = 0; 8684 var propCount = 0; 8685 /* istanbul ignore if */ 8686 if (expectedType === TRANSITION) { 8687 if (transitionTimeout > 0) { 8688 type = TRANSITION; 8689 timeout = transitionTimeout; 8690 propCount = transitionDurations.length; 8691 } 8692 } else if (expectedType === ANIMATION) { 8693 if (animationTimeout > 0) { 8694 type = ANIMATION; 8695 timeout = animationTimeout; 8696 propCount = animationDurations.length; 8697 } 8698 } else { 8699 timeout = Math.max(transitionTimeout, animationTimeout); 8700 type = timeout > 0 8701 ? transitionTimeout > animationTimeout 8702 ? TRANSITION 8703 : ANIMATION 8704 : null; 8705 propCount = type 8706 ? type === TRANSITION 8707 ? transitionDurations.length 8708 : animationDurations.length 8709 : 0; 8710 } 8711 var hasTransform = 8712 type === TRANSITION && 8713 transformRE.test(styles[transitionProp + 'Property']); 8714 return { 8715 type: type, 8716 timeout: timeout, 8717 propCount: propCount, 8718 hasTransform: hasTransform 8719 } 8720} 8721 8722function getTimeout (delays, durations) { 8723 /* istanbul ignore next */ 8724 while (delays.length < durations.length) { 8725 delays = delays.concat(delays); 8726 } 8727 8728 return Math.max.apply(null, durations.map(function (d, i) { 8729 return toMs(d) + toMs(delays[i]) 8730 })) 8731} 8732 8733// Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers 8734// in a locale-dependent way, using a comma instead of a dot. 8735// If comma is not replaced with a dot, the input will be rounded down (i.e. acting 8736// as a floor function) causing unexpected behaviors 8737function toMs (s) { 8738 return Number(s.slice(0, -1).replace(',', '.')) * 1000 8739} 8740 8741/* */ 8742 8743function enter (vnode, toggleDisplay) { 8744 var el = vnode.elm; 8745 8746 // call leave callback now 8747 if (isDef(el._leaveCb)) { 8748 el._leaveCb.cancelled = true; 8749 el._leaveCb(); 8750 } 8751 8752 var data = resolveTransition(vnode.data.transition); 8753 if (isUndef(data)) { 8754 return 8755 } 8756 8757 /* istanbul ignore if */ 8758 if (isDef(el._enterCb) || el.nodeType !== 1) { 8759 return 8760 } 8761 8762 var css = data.css; 8763 var type = data.type; 8764 var enterClass = data.enterClass; 8765 var enterToClass = data.enterToClass; 8766 var enterActiveClass = data.enterActiveClass; 8767 var appearClass = data.appearClass; 8768 var appearToClass = data.appearToClass; 8769 var appearActiveClass = data.appearActiveClass; 8770 var beforeEnter = data.beforeEnter; 8771 var enter = data.enter; 8772 var afterEnter = data.afterEnter; 8773 var enterCancelled = data.enterCancelled; 8774 var beforeAppear = data.beforeAppear; 8775 var appear = data.appear; 8776 var afterAppear = data.afterAppear; 8777 var appearCancelled = data.appearCancelled; 8778 var duration = data.duration; 8779 8780 // activeInstance will always be the <transition> component managing this 8781 // transition. One edge case to check is when the <transition> is placed 8782 // as the root node of a child component. In that case we need to check 8783 // <transition>'s parent for appear check. 8784 var context = activeInstance; 8785 var transitionNode = activeInstance.$vnode; 8786 while (transitionNode && transitionNode.parent) { 8787 context = transitionNode.context; 8788 transitionNode = transitionNode.parent; 8789 } 8790 8791 var isAppear = !context._isMounted || !vnode.isRootInsert; 8792 8793 if (isAppear && !appear && appear !== '') { 8794 return 8795 } 8796 8797 var startClass = isAppear && appearClass 8798 ? appearClass 8799 : enterClass; 8800 var activeClass = isAppear && appearActiveClass 8801 ? appearActiveClass 8802 : enterActiveClass; 8803 var toClass = isAppear && appearToClass 8804 ? appearToClass 8805 : enterToClass; 8806 8807 var beforeEnterHook = isAppear 8808 ? (beforeAppear || beforeEnter) 8809 : beforeEnter; 8810 var enterHook = isAppear 8811 ? (typeof appear === 'function' ? appear : enter) 8812 : enter; 8813 var afterEnterHook = isAppear 8814 ? (afterAppear || afterEnter) 8815 : afterEnter; 8816 var enterCancelledHook = isAppear 8817 ? (appearCancelled || enterCancelled) 8818 : enterCancelled; 8819 8820 var explicitEnterDuration = toNumber( 8821 isObject(duration) 8822 ? duration.enter 8823 : duration 8824 ); 8825 8826 if (
vendor: 18,801 bytes, lines 8826-9522
8826process.env.NODE_ENV !== 'production' && explicitEnterDuration != null) { 8827 checkDuration(explicitEnterDuration, 'enter', vnode); 8828 } 8829 8830 var expectsCSS = css !== false && !isIE9; 8831 var userWantsControl = getHookArgumentsLength(enterHook); 8832 8833 var cb = el._enterCb = once(function () { 8834 if (expectsCSS) { 8835 removeTransitionClass(el, toClass); 8836 removeTransitionClass(el, activeClass); 8837 } 8838 if (cb.cancelled) { 8839 if (expectsCSS) { 8840 removeTransitionClass(el, startClass); 8841 } 8842 enterCancelledHook && enterCancelledHook(el); 8843 } else { 8844 afterEnterHook && afterEnterHook(el); 8845 } 8846 el._enterCb = null; 8847 }); 8848 8849 if (!vnode.data.show) { 8850 // remove pending leave element on enter by injecting an insert hook 8851 mergeVNodeHook(vnode, 'insert', function () { 8852 var parent = el.parentNode; 8853 var pendingNode = parent && parent._pending && parent._pending[vnode.key]; 8854 if (pendingNode && 8855 pendingNode.tag === vnode.tag && 8856 pendingNode.elm._leaveCb 8857 ) { 8858 pendingNode.elm._leaveCb(); 8859 } 8860 enterHook && enterHook(el, cb); 8861 }); 8862 } 8863 8864 // start enter transition 8865 beforeEnterHook && beforeEnterHook(el); 8866 if (expectsCSS) { 8867 addTransitionClass(el, startClass); 8868 addTransitionClass(el, activeClass); 8869 nextFrame(function () { 8870 removeTransitionClass(el, startClass); 8871 if (!cb.cancelled) { 8872 addTransitionClass(el, toClass); 8873 if (!userWantsControl) { 8874 if (isValidDuration(explicitEnterDuration)) { 8875 setTimeout(cb, explicitEnterDuration); 8876 } else { 8877 whenTransitionEnds(el, type, cb); 8878 } 8879 } 8880 } 8881 }); 8882 } 8883 8884 if (vnode.data.show) { 8885 toggleDisplay && toggleDisplay(); 8886 enterHook && enterHook(el, cb); 8887 } 8888 8889 if (!expectsCSS && !userWantsControl) { 8890 cb(); 8891 } 8892} 8893 8894function leave (vnode, rm) { 8895 var el = vnode.elm; 8896 8897 // call enter callback now 8898 if (isDef(el._enterCb)) { 8899 el._enterCb.cancelled = true; 8900 el._enterCb(); 8901 } 8902 8903 var data = resolveTransition(vnode.data.transition); 8904 if (isUndef(data) || el.nodeType !== 1) { 8905 return rm() 8906 } 8907 8908 /* istanbul ignore if */ 8909 if (isDef(el._leaveCb)) { 8910 return 8911 } 8912 8913 var css = data.css; 8914 var type = data.type; 8915 var leaveClass = data.leaveClass; 8916 var leaveToClass = data.leaveToClass; 8917 var leaveActiveClass = data.leaveActiveClass; 8918 var beforeLeave = data.beforeLeave; 8919 var leave = data.leave; 8920 var afterLeave = data.afterLeave; 8921 var leaveCancelled = data.leaveCancelled; 8922 var delayLeave = data.delayLeave; 8923 var duration = data.duration; 8924 8925 var expectsCSS = css !== false && !isIE9; 8926 var userWantsControl = getHookArgumentsLength(leave); 8927 8928 var explicitLeaveDuration = toNumber( 8929 isObject(duration) 8930 ? duration.leave 8931 : duration 8932 ); 8933 8934 if (process.env.NODE_ENV !== 'production' && isDef(explicitLeaveDuration)) { 8935 checkDuration(explicitLeaveDuration, 'leave', vnode); 8936 } 8937 8938 var cb = el._leaveCb = once(function () { 8939 if (el.parentNode && el.parentNode._pending) { 8940 el.parentNode._pending[vnode.key] = null; 8941 } 8942 if (expectsCSS) { 8943 removeTransitionClass(el, leaveToClass); 8944 removeTransitionClass(el, leaveActiveClass); 8945 } 8946 if (cb.cancelled) { 8947 if (expectsCSS) { 8948 removeTransitionClass(el, leaveClass); 8949 } 8950 leaveCancelled && leaveCancelled(el); 8951 } else { 8952 rm(); 8953 afterLeave && afterLeave(el); 8954 } 8955 el._leaveCb = null; 8956 }); 8957 8958 if (delayLeave) { 8959 delayLeave(performLeave); 8960 } else { 8961 performLeave(); 8962 } 8963 8964 function performLeave () { 8965 // the delayed leave may have already been cancelled 8966 if (cb.cancelled) { 8967 return 8968 } 8969 // record leaving element 8970 if (!vnode.data.show && el.parentNode) { 8971 (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode; 8972 } 8973 beforeLeave && beforeLeave(el); 8974 if (expectsCSS) { 8975 addTransitionClass(el, leaveClass); 8976 addTransitionClass(el, leaveActiveClass); 8977 nextFrame(function () { 8978 removeTransitionClass(el, leaveClass); 8979 if (!cb.cancelled) { 8980 addTransitionClass(el, leaveToClass); 8981 if (!userWantsControl) { 8982 if (isValidDuration(explicitLeaveDuration)) { 8983 setTimeout(cb, explicitLeaveDuration); 8984 } else { 8985 whenTransitionEnds(el, type, cb); 8986 } 8987 } 8988 } 8989 }); 8990 } 8991 leave && leave(el, cb); 8992 if (!expectsCSS && !userWantsControl) { 8993 cb(); 8994 } 8995 } 8996} 8997 8998// only used in dev mode 8999function checkDuration (val, name, vnode) { 9000 if (typeof val !== 'number') { 9001 warn( 9002 "<transition> explicit " + name + " duration is not a valid number - " + 9003 "got " + (JSON.stringify(val)) + ".", 9004 vnode.context 9005 ); 9006 } else if (isNaN(val)) { 9007 warn( 9008 "<transition> explicit " + name + " duration is NaN - " + 9009 'the duration expression might be incorrect.', 9010 vnode.context 9011 ); 9012 } 9013} 9014 9015function isValidDuration (val) { 9016 return typeof val === 'number' && !isNaN(val) 9017} 9018 9019/** 9020 * Normalize a transition hook's argument length. The hook may be: 9021 * - a merged hook (invoker) with the original in .fns 9022 * - a wrapped component method (check ._length) 9023 * - a plain function (.length) 9024 */ 9025function getHookArgumentsLength (fn) { 9026 if (isUndef(fn)) { 9027 return false 9028 } 9029 var invokerFns = fn.fns; 9030 if (isDef(invokerFns)) { 9031 // invoker 9032 return getHookArgumentsLength( 9033 Array.isArray(invokerFns) 9034 ? invokerFns[0] 9035 : invokerFns 9036 ) 9037 } else { 9038 return (fn._length || fn.length) > 1 9039 } 9040} 9041 9042function _enter (_, vnode) { 9043 if (vnode.data.show !== true) { 9044 enter(vnode); 9045 } 9046} 9047 9048var transition = inBrowser ? { 9049 create: _enter, 9050 activate: _enter, 9051 remove: function remove$$1 (vnode, rm) { 9052 /* istanbul ignore else */ 9053 if (vnode.data.show !== true) { 9054 leave(vnode, rm); 9055 } else { 9056 rm(); 9057 } 9058 } 9059} : {}; 9060 9061var platformModules = [ 9062 attrs, 9063 klass, 9064 events, 9065 domProps, 9066 style, 9067 transition 9068]; 9069 9070/* */ 9071 9072// the directive module should be applied last, after all 9073// built-in modules have been applied. 9074var modules = platformModules.concat(baseModules); 9075 9076var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules }); 9077 9078/** 9079 * Not type checking this file because flow doesn't like attaching 9080 * properties to Elements. 9081 */ 9082 9083/* istanbul ignore if */ 9084if (isIE9) { 9085 // http://www.matts411.com/post/internet-explorer-9-oninput/ 9086 document.addEventListener('selectionchange', function () { 9087 var el = document.activeElement; 9088 if (el && el.vmodel) { 9089 trigger(el, 'input'); 9090 } 9091 }); 9092} 9093 9094var directive = { 9095 inserted: function inserted (el, binding, vnode, oldVnode) { 9096 if (vnode.tag === 'select') { 9097 // #6903 9098 if (oldVnode.elm && !oldVnode.elm._vOptions) { 9099 mergeVNodeHook(vnode, 'postpatch', function () { 9100 directive.componentUpdated(el, binding, vnode); 9101 }); 9102 } else { 9103 setSelected(el, binding, vnode.context); 9104 } 9105 el._vOptions = [].map.call(el.options, getValue); 9106 } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) { 9107 el._vModifiers = binding.modifiers; 9108 if (!binding.modifiers.lazy) { 9109 el.addEventListener('compositionstart', onCompositionStart); 9110 el.addEventListener('compositionend', onCompositionEnd); 9111 // Safari < 10.2 & UIWebView doesn't fire compositionend when 9112 // switching focus before confirming composition choice 9113 // this also fixes the issue where some browsers e.g. iOS Chrome 9114 // fires "change" instead of "input" on autocomplete. 9115 el.addEventListener('change', onCompositionEnd); 9116 /* istanbul ignore if */ 9117 if (isIE9) { 9118 el.vmodel = true; 9119 } 9120 } 9121 } 9122 }, 9123 9124 componentUpdated: function componentUpdated (el, binding, vnode) { 9125 if (vnode.tag === 'select') { 9126 setSelected(el, binding, vnode.context); 9127 // in case the options rendered by v-for have changed, 9128 // it's possible that the value is out-of-sync with the rendered options. 9129 // detect such cases and filter out values that no longer has a matching 9130 // option in the DOM. 9131 var prevOptions = el._vOptions; 9132 var curOptions = el._vOptions = [].map.call(el.options, getValue); 9133 if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) { 9134 // trigger change event if 9135 // no matching option found for at least one value 9136 var needReset = el.multiple 9137 ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); }) 9138 : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions); 9139 if (needReset) { 9140 trigger(el, 'change'); 9141 } 9142 } 9143 } 9144 } 9145}; 9146 9147function setSelected (el, binding, vm) { 9148 actuallySetSelected(el, binding, vm); 9149 /* istanbul ignore if */ 9150 if (isIE || isEdge) { 9151 setTimeout(function () { 9152 actuallySetSelected(el, binding, vm); 9153 }, 0); 9154 } 9155} 9156 9157function actuallySetSelected (el, binding, vm) { 9158 var value = binding.value; 9159 var isMultiple = el.multiple; 9160 if (isMultiple && !Array.isArray(value)) { 9161 process.env.NODE_ENV !== 'production' && warn( 9162 "<select multiple v-model=\"" + (binding.expression) + "\"> " + 9163 "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)), 9164 vm 9165 ); 9166 return 9167 } 9168 var selected, option; 9169 for (var i = 0, l = el.options.length; i < l; i++) { 9170 option = el.options[i]; 9171 if (isMultiple) { 9172 selected = looseIndexOf(value, getValue(option)) > -1; 9173 if (option.selected !== selected) { 9174 option.selected = selected; 9175 } 9176 } else { 9177 if (looseEqual(getValue(option), value)) { 9178 if (el.selectedIndex !== i) { 9179 el.selectedIndex = i; 9180 } 9181 return 9182 } 9183 } 9184 } 9185 if (!isMultiple) { 9186 el.selectedIndex = -1; 9187 } 9188} 9189 9190function hasNoMatchingOption (value, options) { 9191 return options.every(function (o) { return !looseEqual(o, value); }) 9192} 9193 9194function getValue (option) { 9195 return '_value' in option 9196 ? option._value 9197 : option.value 9198} 9199 9200function onCompositionStart (e) { 9201 e.target.composing = true; 9202} 9203 9204function onCompositionEnd (e) { 9205 // prevent triggering an input event for no reason 9206 if (!e.target.composing) { return } 9207 e.target.composing = false; 9208 trigger(e.target, 'input'); 9209} 9210 9211function trigger (el, type) { 9212 var e = document.createEvent('HTMLEvents'); 9213 e.initEvent(type, true, true); 9214 el.dispatchEvent(e); 9215} 9216 9217/* */ 9218 9219// recursively search for possible transition defined inside the component root 9220function locateNode (vnode) { 9221 return vnode.componentInstance && (!vnode.data || !vnode.data.transition) 9222 ? locateNode(vnode.componentInstance._vnode) 9223 : vnode 9224} 9225 9226var show = { 9227 bind: function bind (el, ref, vnode) { 9228 var value = ref.value; 9229 9230 vnode = locateNode(vnode); 9231 var transition$$1 = vnode.data && vnode.data.transition; 9232 var originalDisplay = el.__vOriginalDisplay = 9233 el.style.display === 'none' ? '' : el.style.display; 9234 if (value && transition$$1) { 9235 vnode.data.show = true; 9236 enter(vnode, function () { 9237 el.style.display = originalDisplay; 9238 }); 9239 } else { 9240 el.style.display = value ? originalDisplay : 'none'; 9241 } 9242 }, 9243 9244 update: function update (el, ref, vnode) { 9245 var value = ref.value; 9246 var oldValue = ref.oldValue; 9247 9248 /* istanbul ignore if */ 9249 if (!value === !oldValue) { return } 9250 vnode = locateNode(vnode); 9251 var transition$$1 = vnode.data && vnode.data.transition; 9252 if (transition$$1) { 9253 vnode.data.show = true; 9254 if (value) { 9255 enter(vnode, function () { 9256 el.style.display = el.__vOriginalDisplay; 9257 }); 9258 } else { 9259 leave(vnode, function () { 9260 el.style.display = 'none'; 9261 }); 9262 } 9263 } else { 9264 el.style.display = value ? el.__vOriginalDisplay : 'none'; 9265 } 9266 }, 9267 9268 unbind: function unbind ( 9269 el, 9270 binding, 9271 vnode, 9272 oldVnode, 9273 isDestroy 9274 ) { 9275 if (!isDestroy) { 9276 el.style.display = el.__vOriginalDisplay; 9277 } 9278 } 9279}; 9280 9281var platformDirectives = { 9282 model: directive, 9283 show: show 9284}; 9285 9286/* */ 9287 9288var transitionProps = { 9289 name: String, 9290 appear: Boolean, 9291 css: Boolean, 9292 mode: String, 9293 type: String, 9294 enterClass: String, 9295 leaveClass: String, 9296 enterToClass: String, 9297 leaveToClass: String, 9298 enterActiveClass: String, 9299 leaveActiveClass: String, 9300 appearClass: String, 9301 appearActiveClass: String, 9302 appearToClass: String, 9303 duration: [Number, String, Object] 9304}; 9305 9306// in case the child is also an abstract component, e.g. <keep-alive> 9307// we want to recursively retrieve the real component to be rendered 9308function getRealChild (vnode) { 9309 var compOptions = vnode && vnode.componentOptions; 9310 if (compOptions && compOptions.Ctor.options.abstract) { 9311 return getRealChild(getFirstComponentChild(compOptions.children)) 9312 } else { 9313 return vnode 9314 } 9315} 9316 9317function extractTransitionData (comp) { 9318 var data = {}; 9319 var options = comp.$options; 9320 // props 9321 for (var key in options.propsData) { 9322 data[key] = comp[key]; 9323 } 9324 // events. 9325 // extract listeners and pass them directly to the transition methods 9326 var listeners = options._parentListeners; 9327 for (var key$1 in listeners) { 9328 data[camelize(key$1)] = listeners[key$1]; 9329 } 9330 return data 9331} 9332 9333function placeholder (h, rawChild) { 9334 if (/\d-keep-alive$/.test(rawChild.tag)) { 9335 return h('keep-alive', { 9336 props: rawChild.componentOptions.propsData 9337 }) 9338 } 9339} 9340 9341function hasParentTransition (vnode) { 9342 while ((vnode = vnode.parent)) { 9343 if (vnode.data.transition) { 9344 return true 9345 } 9346 } 9347} 9348 9349function isSameChild (child, oldChild) { 9350 return oldChild.key === child.key && oldChild.tag === child.tag 9351} 9352 9353var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); }; 9354 9355var isVShowDirective = function (d) { return d.name === 'show'; }; 9356 9357var Transition = { 9358 name: 'transition', 9359 props: transitionProps, 9360 abstract: true, 9361 9362 render: function render (h) { 9363 var this$1 = this; 9364 9365 var children = this.$slots.default; 9366 if (!children) { 9367 return 9368 } 9369 9370 // filter out text nodes (possible whitespaces) 9371 children = children.filter(isNotTextNode); 9372 /* istanbul ignore if */ 9373 if (!children.length) { 9374 return 9375 } 9376 9377 // warn multiple elements 9378 if (process.env.NODE_ENV !== 'production' && children.length > 1) { 9379 warn( 9380 '<transition> can only be used on a single element. Use ' + 9381 '<transition-group> for lists.', 9382 this.$parent 9383 ); 9384 } 9385 9386 var mode = this.mode; 9387 9388 // warn invalid mode 9389 if (process.env.NODE_ENV !== 'production' && 9390 mode && mode !== 'in-out' && mode !== 'out-in' 9391 ) { 9392 warn( 9393 'invalid <transition> mode: ' + mode, 9394 this.$parent 9395 ); 9396 } 9397 9398 var rawChild = children[0]; 9399 9400 // if this is a component root node and the component's 9401 // parent container node also has transition, skip. 9402 if (hasParentTransition(this.$vnode)) { 9403 return rawChild 9404 } 9405 9406 // apply transition data to child 9407 // use getRealChild() to ignore abstract components e.g. keep-alive 9408 var child = getRealChild(rawChild); 9409 /* istanbul ignore if */ 9410 if (!child) { 9411 return rawChild 9412 } 9413 9414 if (this._leaving) { 9415 return placeholder(h, rawChild) 9416 } 9417 9418 // ensure a key that is unique to the vnode type and to this transition 9419 // component instance. This key will be used to remove pending leaving nodes 9420 // during entering. 9421 var id = "__transition-" + (this._uid) + "-"; 9422 child.key = child.key == null 9423 ? child.isComment 9424 ? id + 'comment' 9425 : id + child.tag 9426 : isPrimitive(child.key) 9427 ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key) 9428 : child.key; 9429 9430 var data = (child.data || (child.data = {})).transition = extractTransitionData(this); 9431 var oldRawChild = this._vnode; 9432 var oldChild = getRealChild(oldRawChild); 9433 9434 // mark v-show 9435 // so that the transition module can hand over the control to the directive 9436 if (child.data.directives && child.data.directives.some(isVShowDirective)) { 9437 child.data.show = true; 9438 } 9439 9440 if ( 9441 oldChild && 9442 oldChild.data && 9443 !isSameChild(child, oldChild) && 9444 !isAsyncPlaceholder(oldChild) && 9445 // #6687 component root is a comment node 9446 !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment) 9447 ) { 9448 // replace old child transition data with fresh one 9449 // important for dynamic transitions! 9450 var oldData = oldChild.data.transition = extend({}, data); 9451 // handle transition mode 9452 if (mode === 'out-in') { 9453 // return placeholder node and queue update when leave finishes 9454 this._leaving = true; 9455 mergeVNodeHook(oldData, 'afterLeave', function () { 9456 this$1._leaving = false; 9457 this$1.$forceUpdate(); 9458 }); 9459 return placeholder(h, rawChild) 9460 } else if (mode === 'in-out') { 9461 if (isAsyncPlaceholder(child)) { 9462 return oldRawChild 9463 } 9464 var delayedLeave; 9465 var performLeave = function () { delayedLeave(); }; 9466 mergeVNodeHook(data, 'afterEnter', performLeave); 9467 mergeVNodeHook(data, 'enterCancelled', performLeave); 9468 mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; }); 9469 } 9470 } 9471 9472 return rawChild 9473 } 9474}; 9475 9476/* */ 9477 9478var props = extend({ 9479 tag: String, 9480 moveClass: String 9481}, transitionProps); 9482 9483delete props.mode; 9484 9485var TransitionGroup = { 9486 props: props, 9487 9488 beforeMount: function beforeMount () { 9489 var this$1 = this; 9490 9491 var update = this._update; 9492 this._update = function (vnode, hydrating) { 9493 var restoreActiveInstance = setActiveInstance(this$1); 9494 // force removing pass 9495 this$1.__patch__( 9496 this$1._vnode, 9497 this$1.kept, 9498 false, // hydrating 9499 true // removeOnly (!important, avoids unnecessary moves) 9500 ); 9501 this$1._vnode = this$1.kept; 9502 restoreActiveInstance(); 9503 update.call(this$1, vnode, hydrating); 9504 }; 9505 }, 9506 9507 render: function render (h) { 9508 var tag = this.tag || this.$vnode.data.tag || 'span'; 9509 var map = Object.create(null); 9510 var prevChildren = this.prevChildren = this.children; 9511 var rawChildren = this.$slots.default || []; 9512 var children = this.children = []; 9513 var transitionData = extractTransitionData(this); 9514 9515 for (var i = 0; i < rawChildren.length; i++) { 9516 var c = rawChildren[i]; 9517 if (c.tag) { 9518 if (c.key != null && String(c.key).indexOf('__vlist') !== 0) { 9519 children.push(c); 9520 map[c.key] = c 9521 ;(c.data || (c.data = {})).transition = transitionData; 9522 } else if (process.env.NODE_ENV !== 'production') {
9523 var opts = c.componentOptions; 9524 var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag; 9525 warn(("<transition-group> children must be keyed: <" + name + ">")); 9526 } 9527 } 9528 } 9529 9530 if (prevChildren) { 9531 var kept = []; 9532 var removed = []; 9533 for (var i$1 = 0; i$1 < prevChildren.length; i$1++) { 9534 var c$1 = prevChildren[i$1]; 9535 c$1.data.transition = transitionData; 9536 c$1.data.pos = c$1.elm.getBoundingClientRect(); 9537 if (map[c$1.key]) { 9538 kept.push(c$1); 9539 } else { 9540 removed.push(c$1); 9541 } 9542 } 9543 this.kept = h(tag, null, kept); 9544 this.removed = removed; 9545 } 9546 9547 return h(tag, null, children) 9548 }, 9549 9550 updated: function updated () { 9551 var children = this.prevChildren; 9552 var moveClass = this.moveClass || ((this.name || 'v') + '-move'); 9553 if (!children.length || !this.hasMove(children[0].elm, moveClass)) { 9554 return 9555 } 9556 9557 // we divide the work into three loops to avoid mixing DOM reads and writes 9558 // in each iteration - which helps prevent layout thrashing. 9559 children.forEach(callPendingCbs); 9560 children.forEach(recordPosition); 9561 children.forEach(applyTranslation); 9562 9563 // force reflow to put everything in position 9564 // assign to this to avoid being removed in tree-shaking 9565 // $flow-disable-line 9566 this._reflow = document.body.offsetHeight; 9567 9568 children.forEach(function (c) { 9569 if (c.data.moved) { 9570 var el = c.elm; 9571 var s = el.style; 9572 addTransitionClass(el, moveClass); 9573 s.transform = s.WebkitTransform = s.transitionDuration = ''; 9574 el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) { 9575 if (e && e.target !== el) { 9576 return 9577 } 9578 if (!e || /transform$/.test(e.propertyName)) { 9579 el.removeEventListener(transitionEndEvent, cb); 9580 el._moveCb = null; 9581 removeTransitionClass(el, moveClass); 9582 } 9583 }); 9584 } 9585 }); 9586 }, 9587 9588 methods: { 9589 hasMove: function hasMove (el, moveClass) { 9590 /* istanbul ignore if */ 9591 if (!hasTransition) { 9592 return false 9593 } 9594 /* istanbul ignore if */ 9595 if (this._hasMove) { 9596 return this._hasMove 9597 } 9598 // Detect whether an element with the move class applied has 9599 // CSS transitions. Since the element may be inside an entering 9600 // transition at this very moment, we make a clone of it and remove 9601 // all other transition classes applied to ensure only the move class 9602 // is applied. 9603 var clone = el.cloneNode(); 9604 if (el._transitionClasses) { 9605 el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); }); 9606 } 9607 addClass(clone, moveClass); 9608 clone.style.display = 'none'; 9609 this.$el.appendChild(clone); 9610 var info = getTransitionInfo(clone); 9611 this.$el.removeChild(clone); 9612 return (this._hasMove = info.hasTransform) 9613 } 9614 } 9615}; 9616 9617function callPendingCbs (c) { 9618 /* istanbul ignore if */ 9619 if (c.elm._moveCb) { 9620 c.elm._moveCb(); 9621 } 9622 /* istanbul ignore if */ 9623 if (c.elm._enterCb) { 9624 c.elm._enterCb(); 9625 } 9626} 9627 9628function recordPosition (c) { 9629 c.data.newPos = c.elm.getBoundingClientRect(); 9630} 9631 9632function applyTranslation (c) { 9633 var oldPos = c.data.pos; 9634 var newPos = c.data.newPos; 9635 var dx = oldPos.left - newPos.left; 9636 var dy = oldPos.top - newPos.top; 9637 if (dx || dy) { 9638 c.data.moved = true; 9639 var s = c.elm.style; 9640 s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)"; 9641 s.transitionDuration = '0s'; 9642 } 9643} 9644 9645var platformComponents = { 9646 Transition: Transition, 9647 TransitionGroup: TransitionGroup 9648}; 9649 9650/* */ 9651 9652// install platform specific utils 9653Vue.config.mustUseProp = mustUseProp; 9654Vue.config.isReservedTag = isReservedTag; 9655Vue.config.isReservedAttr = isReservedAttr; 9656Vue.config.getTagNamespace = getTagNamespace; 9657Vue.config.isUnknownElement = isUnknownElement; 9658 9659// install platform runtime directives & components 9660extend(Vue.options.directives, platformDirectives); 9661extend(Vue.options.components, platformComponents); 9662 9663// install platform patch function 9664Vue.prototype.__patch__ = inBrowser ? patch : noop; 9665 9666// public mount method 9667Vue.prototype.$mount = function ( 9668 el, 9669 hydrating 9670) { 9671 el = el && inBrowser ? query(el) : undefined; 9672 return mountComponent(this, el, hydrating) 9673}; 9674 9675// devtools global hook 9676/* istanbul ignore next */ 9677if (inBrowser) { 9678 setTimeout(function () { 9679 if (config.devtools) { 9680 if (devtools) { 9681 devtools.emit('init', Vue); 9682 } else if ( 9683 process.env.NODE_ENV !== 'production' && 9684 process.env.NODE_ENV !== 'test' 9685 ) { 9686 console[console.info ? 'info' : 'log']( 9687 'Download the Vue Devtools extension for a better development experience:\n' + 9688 'https://github.com/vuejs/vue-devtools' 9689 ); 9690 } 9691 } 9692 if (process.env.NODE_ENV !== 'production' && 9693 process.env.NODE_ENV !== 'test' && 9694 config.productionTip !== false && 9695 typeof console !== 'undefined' 9696 ) { 9697 console[console.info ? 'info' : 'log']( 9698 "You are running Vue in development mode.\n" + 9699 "Make sure to turn on production mode when deploying for production.\n" + 9700 "See more tips at https://vuejs.org/guide/deployment.html" 9701 ); 9702 } 9703 }, 0); 9704} 9705 9706/* */ 9707 9708var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g; 9709var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g; 9710 9711var buildRegex = cached(function (delimiters) { 9712 var open = delimiters[0].replace(regexEscapeRE, '\\$&'); 9713 var close = delimiters[1].replace(regexEscapeRE, '\\$&'); 9714 return new RegExp(open + '((?:.|\\n)+?)' + close, 'g') 9715}); 9716 9717 9718 9719function parseText ( 9720 text, 9721 delimiters 9722) { 9723 var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE; 9724 if (!tagRE.test(text)) { 9725 return 9726 } 9727 var tokens = []; 9728 var rawTokens = []; 9729 var lastIndex = tagRE.lastIndex = 0; 9730 var match, index, tokenValue; 9731 while ((match = tagRE.exec(text))) { 9732 index = match.index; 9733 // push text token 9734 if (index > lastIndex) { 9735 rawTokens.push(tokenValue = text.slice(lastIndex, index)); 9736 tokens.push(JSON.stringify(tokenValue)); 9737 } 9738 // tag token 9739 var exp = parseFilters(match[1].trim()); 9740 tokens.push(("_s(" + exp + ")")); 9741 rawTokens.push({ '@binding': exp }); 9742 lastIndex = index + match[0].length; 9743 } 9744 if (lastIndex < text.length) { 9745 rawTokens.push(tokenValue = text.slice(lastIndex)); 9746 tokens.push(JSON.stringify(tokenValue)); 9747 } 9748 return { 9749 expression: tokens.join('+'), 9750 tokens: rawTokens 9751 } 9752} 9753 9754/* */ 9755 9756function transformNode (el, options) { 9757 var warn = options.warn || baseWarn; 9758 var staticClass = getAndRemoveAttr(el, 'class'); 9759 if (process.env.NODE_ENV !== 'production' && staticClass) { 9760 var res = parseText(staticClass, options.delimiters); 9761 if (res) { 9762 warn( 9763 "class=\"" + staticClass + "\": " + 9764 'Interpolation inside attributes has been removed. ' + 9765 'Use v-bind or the colon shorthand instead. For example, ' + 9766 'instead of <div class="{{ val }}">, use <div :class="val">.', 9767 el.rawAttrsMap['class'] 9768 ); 9769 } 9770 } 9771 if (staticClass) { 9772 el.staticClass = JSON.stringify(staticClass); 9773 } 9774 var classBinding = getBindingAttr(el, 'class', false /* getStatic */); 9775 if (classBinding) { 9776 el.classBinding = classBinding; 9777 } 9778} 9779 9780function genData (el) { 9781 var data = ''; 9782 if (el.staticClass) { 9783 data += "staticClass:" + (el.staticClass) + ","; 9784 } 9785 if (el.classBinding) { 9786 data += "class:" + (el.classBinding) + ","; 9787 } 9788 return data 9789} 9790 9791var klass$1 = { 9792 staticKeys: ['staticClass'], 9793 transformNode: transformNode, 9794 genData: genData 9795}; 9796 9797/* */ 9798 9799function transformNode$1 (el, options) { 9800 var warn = options.warn || baseWarn; 9801 var staticStyle = getAndRemoveAttr(el, 'style'); 9802 if (staticStyle) { 9803 /* istanbul ignore if */ 9804 if (process.env.NODE_ENV !== 'production') { 9805 var res = parseText(staticStyle, options.delimiters); 9806 if (res) { 9807 warn( 9808 "style=\"" + staticStyle + "\": " + 9809 'Interpolation inside attributes has been removed. ' + 9810 'Use v-bind or the colon shorthand instead. For example, ' + 9811 'instead of <div style="{{ val }}">, use <div :style="val">.', 9812 el.rawAttrsMap['style'] 9813 ); 9814 } 9815 } 9816 el.staticStyle = JSON.stringify(parseStyleText(staticStyle)); 9817 } 9818 9819 var styleBinding = getBindingAttr(el, 'style', false /* getStatic */); 9820 if (styleBinding) { 9821 el.styleBinding = styleBinding; 9822 } 9823} 9824 9825function genData$1 (el) { 9826 var data = ''; 9827 if (el.staticStyle) { 9828 data += "staticStyle:" + (el.staticStyle) + ","; 9829 } 9830 if (el.styleBinding) { 9831 data += "style:(" + (el.styleBinding) + "),"; 9832 } 9833 return data 9834} 9835 9836var style$1 = { 9837 staticKeys: ['staticStyle'], 9838 transformNode: transformNode$1, 9839 genData: genData$1 9840}; 9841 9842/* */ 9843 9844var decoder; 9845 9846var he = { 9847 decode: function decode (html) { 9848 decoder = decoder || document.createElement('div'); 9849 decoder.innerHTML = html; 9850 return decoder.textContent 9851 } 9852}; 9853 9854/* */ 9855 9856var isUnaryTag = makeMap( 9857 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' + 9858 'link,meta,param,source,track,wbr' 9859); 9860 9861// Elements that you can, intentionally, leave open 9862// (and which close themselves) 9863var canBeLeftOpenTag = makeMap( 9864 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source' 9865); 9866 9867// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3 9868// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content 9869var isNonPhrasingTag = makeMap( 9870 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' + 9871 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' + 9872 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' + 9873 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' + 9874 'title,tr,track' 9875); 9876 9877/** 9878 * Not type-checking this file because it's mostly vendor code. 9879 */ 9880 9881// Regular Expressions for parsing tags and attributes 9882var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/; 9883var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/; 9884var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*"; 9885var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")"; 9886var startTagOpen = new RegExp(("^<" + qnameCapture)); 9887var startTagClose = /^\s*(\/?)>/; 9888var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>")); 9889var doctype = /^<!DOCTYPE [^>]+>/i; 9890// #7298: escape - to avoid being passed as HTML comment when inlined in page 9891var comment = /^<!\--/; 9892var conditionalComment = /^<!\[/; 9893 9894// Special Elements (can contain anything) 9895var isPlainTextElement = makeMap('script,style,textarea', true); 9896var reCache = {}; 9897 9898var decodingMap = { 9899 '<': '<', 9900 '>': '>', 9901 '"': '"', 9902 '&': '&', 9903 ' ': '\n', 9904 '	': '\t', 9905 ''': "'" 9906}; 9907var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g; 9908var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g; 9909 9910// #5992 9911var isIgnoreNewlineTag = makeMap('pre,textarea', true); 9912var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; }; 9913 9914function decodeAttr (value, shouldDecodeNewlines) { 9915 var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr; 9916 return value.replace(re, function (match) { return decodingMap[match]; }) 9917} 9918 9919function parseHTML (html, options) { 9920 var stack = [];
9921 var expectHTML = options.expectHTML; 9922 var isUnaryTag$$1 = options.isUnaryTag || no; 9923 var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no; 9924 var index = 0; 9925 var last, lastTag; 9926 while (html) { 9927 last = html; 9928 // Make sure we're not in a plaintext content element like script/style 9929 if (!lastTag || !isPlainTextElement(lastTag)) { 9930 var textEnd = html.indexOf('<'); 9931 if (textEnd === 0) { 9932 // Comment: 9933 if (comment.test(html)) { 9934 var commentEnd = html.indexOf('-->'); 9935 9936 if (commentEnd >= 0) { 9937 if (options.shouldKeepComment) { 9938 options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3); 9939 } 9940 advance(commentEnd + 3); 9941 continue 9942 } 9943 } 9944 9945 // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment 9946 if (conditionalComment.test(html)) { 9947 var conditionalEnd = html.indexOf(']>'); 9948 9949 if (conditionalEnd >= 0) { 9950 advance(conditionalEnd + 2); 9951 continue 9952 } 9953 } 9954 9955 // Doctype: 9956 var doctypeMatch = html.match(doctype); 9957 if (doctypeMatch) { 9958 advance(doctypeMatch[0].length); 9959 continue 9960 } 9961 9962 // End tag: 9963 var endTagMatch = html.match(endTag); 9964 if (endTagMatch) { 9965 var curIndex = index; 9966 advance(endTagMatch[0].length); 9967 parseEndTag(endTagMatch[1], curIndex, index); 9968 continue 9969 } 9970 9971 // Start tag: 9972 var startTagMatch = parseStartTag(); 9973 if (startTagMatch) { 9974 handleStartTag(startTagMatch); 9975 if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) { 9976 advance(1); 9977 } 9978 continue 9979 } 9980 } 9981 9982 var text = (void 0), rest = (void 0), next = (void 0); 9983 if (textEnd >= 0) { 9984 rest = html.slice(textEnd); 9985 while ( 9986 !endTag.test(rest) && 9987 !startTagOpen.test(rest) && 9988 !comment.test(rest) && 9989 !conditionalComment.test(rest) 9990 ) { 9991 // < in plain text, be forgiving and treat it as text 9992 next = rest.indexOf('<', 1); 9993 if (next < 0) { break } 9994 textEnd += next; 9995 rest = html.slice(textEnd); 9996 } 9997 text = html.substring(0, textEnd); 9998 } 9999 10000 if (textEnd < 0) { 10001 text = html; 10002 } 10003 10004 if (text) { 10005 advance(text.length); 10006 } 10007 10008 if (options.chars && text) { 10009 options.chars(text, index - text.length, index); 10010 } 10011 } else { 10012 var endTagLength = 0; 10013 var stackedTag = lastTag.toLowerCase(); 10014 var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i')); 10015 var rest$1 = html.replace(reStackedTag, function (all, text, endTag) { 10016 endTagLength = endTag.length; 10017 if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') { 10018 text = text 10019 .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298 10020 .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1'); 10021 } 10022 if (shouldIgnoreFirstNewline(stackedTag, text)) { 10023 text = text.slice(1); 10024 } 10025 if (options.chars) { 10026 options.chars(text); 10027 } 10028 return '' 10029 }); 10030 index += html.length - rest$1.length; 10031 html = rest$1; 10032 parseEndTag(stackedTag, index - endTagLength, index); 10033 } 10034 10035 if (html === last) { 10036 options.chars && options.chars(html); 10037 if (process.env.NODE_ENV !== 'production' && !stack.length && options.warn) { 10038 options.warn(("Mal-formatted tag at end of template: \"" + html + "\""), { start: index + html.length }); 10039 } 10040 break 10041 } 10042 } 10043 10044 // Clean up any remaining tags 10045 parseEndTag(); 10046 10047 function advance (n) { 10048 index += n; 10049 html = html.substring(n); 10050 } 10051 10052 function parseStartTag () { 10053 var start = html.match(startTagOpen); 10054 if (start) { 10055 var match = { 10056 tagName: start[1], 10057 attrs: [], 10058 start: index 10059 }; 10060 advance(start[0].length); 10061 var end, attr; 10062 while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) { 10063 attr.start = index; 10064 advance(attr[0].length); 10065 attr.end = index; 10066 match.attrs.push(attr); 10067 } 10068 if (end) { 10069 match.unarySlash = end[1]; 10070 advance(end[0].length); 10071 match.end = index; 10072 return match 10073 } 10074 } 10075 } 10076 10077 function handleStartTag (match) { 10078 var tagName = match.tagName; 10079 var unarySlash = match.unarySlash; 10080 10081 if (expectHTML) { 10082 if (lastTag === 'p' && isNonPhrasingTag(tagName)) { 10083 parseEndTag(lastTag); 10084 } 10085 if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) { 10086 parseEndTag(tagName); 10087 } 10088 } 10089 10090 var unary = isUnaryTag$$1(tagName) || !!unarySlash; 10091 10092 var l = match.attrs.length; 10093 var attrs = new Array(l); 10094 for (var i = 0; i < l; i++) { 10095 var args = match.attrs[i]; 10096 var value = args[3] || args[4] || args[5] || ''; 10097 var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href' 10098 ? options.shouldDecodeNewlinesForHref 10099 : options.shouldDecodeNewlines; 10100 attrs[i] = { 10101 name: args[1], 10102 value: decodeAttr(value, shouldDecodeNewlines) 10103 }; 10104 if (process.env.NODE_ENV !== 'production' && options.outputSourceRange) { 10105 attrs[i].start = args.start + args[0].match(/^\s*/).length; 10106 attrs[i].end = args.end; 10107 } 10108 } 10109 10110 if (!unary) { 10111 stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end }); 10112 lastTag = tagName; 10113 } 10114 10115 if (options.start) { 10116 options.start(tagName, attrs, unary, match.start, match.end); 10117 } 10118 } 10119 10120 function parseEndTag (tagName, start, end) { 10121 var pos, lowerCasedTagName; 10122 if (start == null) { start = index; } 10123 if (end == null) { end = index; } 10124 10125 // Find the closest opened tag of the same type 10126 if (tagName) { 10127 lowerCasedTagName = tagName.toLowerCase(); 10128 for (pos = stack.length - 1; pos >= 0; pos--) { 10129 if (stack[pos].lowerCasedTag === lowerCasedTagName) { 10130 break 10131 } 10132 } 10133 } else { 10134 // If no tag name is provided, clean shop 10135 pos = 0; 10136 } 10137 10138 if (pos >= 0) { 10139 // Close all the open elements, up the stack 10140 for (var i = stack.length - 1; i >= pos; i--) { 10141 if (process.env.NODE_ENV !== 'production' && 10142 (i > pos || !tagName) && 10143 options.warn 10144 ) { 10145 options.warn( 10146 ("tag <" + (stack[i].tag) + "> has no matching end tag."), 10147 { start: stack[i].start, end: stack[i].end } 10148 ); 10149 } 10150 if (options.end) { 10151 options.end(stack[i].tag, start, end); 10152 } 10153 } 10154 10155 // Remove the open elements from the stack 10156 stack.length = pos; 10157 lastTag = pos && stack[pos - 1].tag; 10158 } else if (lowerCasedTagName === 'br') { 10159 if (options.start) { 10160 options.start(tagName, [], true, start, end); 10161 } 10162 } else if (lowerCasedTagName === 'p') { 10163 if (options.start) { 10164 options.start(tagName, [], false, start, end); 10165 } 10166 if (options.end) { 10167 options.end(tagName, start, end); 10168 } 10169 } 10170 } 10171} 10172 10173/* */ 10174 10175var onRE = /^@|^v-on:/; 10176var dirRE = /^v-|^@|^:|^#/; 10177var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; 10178var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; 10179var stripParensRE = /^\(|\)$/g; 10180var dynamicArgRE = /^\[.*\]$/; 10181 10182var argRE = /:(.*)$/; 10183var bindRE = /^:|^\.|^v-bind:/; 10184var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g; 10185 10186var slotRE = /^v-slot(:|$)|^#/; 10187 10188var lineBreakRE = /[\r\n]/; 10189var whitespaceRE$1 = /\s+/g; 10190 10191var invalidAttributeRE = /[\s"'<>\/=]/; 10192
10193var decodeHTMLCached = cached(he.decode); 10194 10195var emptySlotScopeToken = "_empty_"; 10196 10197// configurable state 10198var warn$2; 10199var delimiters; 10200var transforms; 10201var preTransforms; 10202var postTransforms; 10203var platformIsPreTag; 10204var platformMustUseProp; 10205var platformGetTagNamespace; 10206var maybeComponent; 10207 10208function createASTElement ( 10209 tag, 10210 attrs, 10211 parent 10212) { 10213 return { 10214 type: 1, 10215 tag: tag, 10216 attrsList: attrs, 10217 attrsMap: makeAttrsMap(attrs), 10218 rawAttrsMap: {}, 10219 parent: parent, 10220 children: [] 10221 } 10222} 10223 10224/** 10225 * Convert HTML string to AST. 10226 */ 10227function parse ( 10228 template, 10229 options 10230) { 10231 warn$2 = options.warn || baseWarn; 10232 10233 platformIsPreTag = options.isPreTag || no; 10234 platformMustUseProp = options.mustUseProp || no; 10235 platformGetTagNamespace = options.getTagNamespace || no; 10236 var isReservedTag = options.isReservedTag || no; 10237 maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); }; 10238 10239 transforms = pluckModuleFunction(options.modules, 'transformNode'); 10240 preTransforms = pluckModuleFunction(options.modules, 'preTransformNode'); 10241 postTransforms = pluckModuleFunction(options.modules, 'postTransformNode'); 10242 10243 delimiters = options.delimiters; 10244 10245 var stack = []; 10246 var preserveWhitespace = options.preserveWhitespace !== false; 10247 var whitespaceOption = options.whitespace; 10248 var root; 10249 var currentParent; 10250 var inVPre = false; 10251 var inPre = false; 10252 var warned = false; 10253 10254 function warnOnce (msg, range) { 10255 if (!warned) { 10256 warned = true; 10257 warn$2(msg, range); 10258 } 10259 } 10260 10261 function closeElement (element) { 10262 trimEndingWhitespace(element); 10263 if (!inVPre && !element.processed) { 10264 element = processElement(element, options); 10265 } 10266 // tree management 10267 if (!stack.length && element !== root) { 10268 // allow root elements with v-if, v-else-if and v-else 10269 if (root.if && (element.elseif || element.else)) { 10270 if (process.env.NODE_ENV !== 'production') { 10271 checkRootConstraints(element); 10272 } 10273 addIfCondition(root, { 10274 exp: element.elseif, 10275 block: element 10276 }); 10277 } else if (process.env.NODE_ENV !== 'production') { 10278 warnOnce( 10279 "Component template should contain exactly one root element. " + 10280 "If you are using v-if on multiple elements, " + 10281 "use v-else-if to chain them instead.", 10282 { start: element.start } 10283 ); 10284 } 10285 } 10286 if (currentParent && !element.forbidden) { 10287 if (element.elseif || element.else) { 10288 processIfConditions(element, currentParent); 10289 } else { 10290 if (element.slotScope) { 10291 // scoped slot 10292 // keep it in the children list so that v-else(-if) conditions can 10293 // find it as the prev node. 10294 var name = element.slotTarget || '"default"' 10295 ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element; 10296 } 10297 currentParent.children.push(element); 10298 element.parent = currentParent; 10299 } 10300 } 10301 10302 // final children cleanup 10303 // filter out scoped slots 10304 element.children = element.children.filter(function (c) { return !(c).slotScope; }); 10305 // remove trailing whitespace node again 10306 trimEndingWhitespace(element); 10307 10308 // check pre state 10309 if (element.pre) { 10310 inVPre = false; 10311 } 10312 if (platformIsPreTag(element.tag)) { 10313 inPre = false; 10314 } 10315 // apply post-transforms 10316 for (var i = 0; i < postTransforms.length; i++) { 10317 postTransforms[i](element, options); 10318 } 10319 } 10320 10321 function trimEndingWhitespace (el) { 10322 // remove trailing whitespace node 10323 if (!inPre) { 10324 var lastNode; 10325 while ( 10326 (lastNode = el.children[el.children.length - 1]) && 10327 lastNode.type === 3 && 10328 lastNode.text === ' ' 10329 ) { 10330 el.children.pop(); 10331 } 10332 } 10333 } 10334 10335 function checkRootConstraints (el) { 10336 if (el.tag === 'slot' || el.tag === 'template') { 10337 warnOnce( 10338 "Cannot use <" + (el.tag) + "> as component root element because it may " + 10339 'contain multiple nodes.', 10340 { start: el.start } 10341 ); 10342 } 10343 if (el.attrsMap.hasOwnProperty('v-for')) { 10344 warnOnce( 10345 'Cannot use v-for on stateful component root element because ' + 10346 'it renders multiple elements.', 10347 el.rawAttrsMap['v-for'] 10348 ); 10349 } 10350 } 10351 10352 parseHTML(template, { 10353 warn: warn$2, 10354 expectHTML: options.expectHTML, 10355 isUnaryTag: options.isUnaryTag, 10356 canBeLeftOpenTag: options.canBeLeftOpenTag, 10357 shouldDecodeNewlines: options.shouldDecodeNewlines, 10358 shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref, 10359 shouldKeepComment: options.comments, 10360 outputSourceRange: options.outputSourceRange, 10361 start: function start (tag, attrs, unary, start$1, end) { 10362 // check namespace. 10363 // inherit parent ns if there is one 10364 var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag); 10365 10366 // handle IE svg bug 10367 /* istanbul ignore if */ 10368 if (isIE && ns === 'svg') { 10369 attrs = guardIESVGBug(attrs); 10370 } 10371 10372 var element = createASTElement(tag, attrs, currentParent); 10373 if (ns) { 10374 element.ns = ns; 10375 } 10376 10377 if (process.env.NODE_ENV !== 'production') { 10378 if (options.outputSourceRange) { 10379 element.start = start$1; 10380 element.end = end; 10381 element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) { 10382 cumulated[attr.name] = attr; 10383 return cumulated 10384 }, {}); 10385 }
10386 attrs.forEach(function (attr) { 10387 if (invalidAttributeRE.test(attr.name)) { 10388 warn$2( 10389 "Invalid dynamic argument expression: attribute names cannot contain " + 10390 "spaces, quotes, <, >, / or =.", 10391 { 10392 start: attr.start + attr.name.indexOf("["), 10393 end: attr.start + attr.name.length 10394 } 10395 ); 10396 } 10397 }); 10398 } 10399 10400 if (isForbiddenTag(element) && !isServerRendering()) { 10401 element.forbidden = true; 10402 process.env.NODE_ENV !== 'production' && warn$2( 10403 'Templates should only be responsible for mapping the state to the ' + 10404 'UI. Avoid placing tags with side-effects in your templates, such as ' + 10405 "<" + tag + ">" + ', as they will not be parsed.', 10406 { start: element.start } 10407 ); 10408 } 10409 10410 // apply pre-transforms 10411 for (var i = 0; i < preTransforms.length; i++) { 10412 element = preTransforms[i](element, options) || element; 10413 } 10414 10415 if (!inVPre) { 10416 processPre(element); 10417 if (element.pre) { 10418 inVPre = true; 10419 } 10420 } 10421 if (platformIsPreTag(element.tag)) { 10422 inPre = true; 10423 } 10424 if (inVPre) { 10425 processRawAttrs(element); 10426 } else if (!element.processed) { 10427 // structural directives 10428 processFor(element); 10429 processIf(element); 10430 processOnce(element); 10431 } 10432 10433 if (!root) { 10434 root = element; 10435 if (process.env.NODE_ENV !== 'production') { 10436 checkRootConstraints(root); 10437 } 10438 } 10439 10440 if (!unary) { 10441 currentParent = element; 10442 stack.push(element); 10443 } else { 10444 closeElement(element); 10445 } 10446 }, 10447 10448 end: function end (tag, start, end$1) { 10449 var element = stack[stack.length - 1]; 10450 // pop stack 10451 stack.length -= 1; 10452 currentParent = stack[stack.length - 1]; 10453 if (process.env.NODE_ENV !== 'production' && options.outputSourceRange) { 10454 element.end = end$1; 10455 } 10456 closeElement(element); 10457 }, 10458 10459 chars: function chars (text, start, end) { 10460 if (!currentParent) { 10461 if (process.env.NODE_ENV !== 'production') { 10462 if (text === template) { 10463 warnOnce( 10464 'Component template requires a root element, rather than just text.', 10465 { start: start } 10466 ); 10467 } else if ((text = text.trim())) { 10468 warnOnce( 10469 ("text \"" + text + "\" outside root element will be ignored."), 10470 { start: start } 10471 ); 10472 } 10473 } 10474 return 10475 } 10476 // IE textarea placeholder bug 10477 /* istanbul ignore if */ 10478 if (isIE && 10479 currentParent.tag === 'textarea' && 10480 currentParent.attrsMap.placeholder === text 10481 ) { 10482 return 10483 } 10484 var children = currentParent.children; 10485 if (inPre || text.trim()) { 10486 text = isTextTag(currentParent) ? text : decodeHTMLCached(text); 10487 } else if (!children.length) { 10488 // remove the whitespace-only node right after an opening tag 10489 text = ''; 10490 } else if (whitespaceOption) { 10491 if (whitespaceOption === 'condense') { 10492 // in condense mode, remove the whitespace node if it contains 10493 // line break, otherwise condense to a single space 10494 text = lineBreakRE.test(text) ? '' : ' '; 10495 } else { 10496 text = ' '; 10497 } 10498 } else { 10499 text = preserveWhitespace ? ' ' : ''; 10500 } 10501 if (text) { 10502 if (!inPre && whitespaceOption === 'condense') { 10503 // condense consecutive whitespaces into single space 10504 text = text.replace(whitespaceRE$1, ' '); 10505 } 10506 var res; 10507 var child; 10508 if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) { 10509 child = { 10510 type: 2, 10511 expression: res.expression, 10512 tokens: res.tokens, 10513 text: text 10514 }; 10515 } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') { 10516 child = { 10517 type: 3, 10518 text: text 10519 }; 10520 } 10521 if (child) { 10522 if (process.env.NODE_ENV !== 'production' && options.outputSourceRange) { 10523 child.start = start; 10524 child.end = end; 10525 } 10526 children.push(child); 10527 } 10528 } 10529 }, 10530 comment: function comment (text, start, end) { 10531 // adding anyting as a sibling to the root node is forbidden 10532 // comments should still be allowed, but ignored 10533 if (currentParent) { 10534 var child = { 10535 type: 3, 10536 text: text, 10537 isComment: true 10538 }; 10539 if (process.env.NODE_ENV !== 'production' && options.outputSourceRange) { 10540 child.start = start; 10541 child.end = end; 10542 } 10543 currentParent.children.push(child); 10544 } 10545 } 10546 }); 10547 return root 10548} 10549 10550function processPre (el) { 10551 if (getAndRemoveAttr(el, 'v-pre') != null) { 10552 el.pre = true; 10553 } 10554} 10555 10556function processRawAttrs (el) { 10557 var list = el.attrsList; 10558 var len = list.length; 10559 if (len) { 10560 var attrs = el.attrs = new Array(len); 10561 for (var i = 0; i < len; i++) { 10562 attrs[i] = { 10563 name: list[i].name, 10564 value: JSON.stringify(list[i].value) 10565 }; 10566 if (list[i].start != null) { 10567 attrs[i].start = list[i].start; 10568 attrs[i].end = list[i].end; 10569 } 10570 } 10571 } else if (!el.pre) {
10572 // non root node in pre blocks with no attributes 10573 el.plain = true; 10574 } 10575} 10576 10577function processElement ( 10578 element, 10579 options 10580) { 10581 processKey(element); 10582 10583 // determine whether this is a plain element after 10584 // removing structural attributes 10585 element.plain = ( 10586 !element.key && 10587 !element.scopedSlots && 10588 !element.attrsList.length 10589 ); 10590 10591 processRef(element); 10592 processSlotContent(element); 10593 processSlotOutlet(element); 10594 processComponent(element); 10595 for (var i = 0; i < transforms.length; i++) { 10596 element = transforms[i](element, options) || element; 10597 } 10598 processAttrs(element); 10599 return element 10600} 10601 10602function processKey (el) { 10603 var exp = getBindingAttr(el, 'key'); 10604 if (exp) { 10605 if (process.env.NODE_ENV !== 'production') { 10606 if (el.tag === 'template') { 10607 warn$2( 10608 "<template> cannot be keyed. Place the key on real elements instead.", 10609 getRawBindingAttr(el, 'key') 10610 ); 10611 } 10612 if (el.for) { 10613 var iterator = el.iterator2 || el.iterator1; 10614 var parent = el.parent; 10615 if (iterator && iterator === exp && parent && parent.tag === 'transition-group') { 10616 warn$2( 10617 "Do not use v-for index as key on <transition-group> children, " + 10618 "this is the same as not using keys.", 10619 getRawBindingAttr(el, 'key'), 10620 true /* tip */ 10621 ); 10622 } 10623 } 10624 } 10625 el.key = exp; 10626 } 10627} 10628 10629function processRef (el) { 10630 var ref = getBindingAttr(el, 'ref'); 10631 if (ref) { 10632 el.ref = ref; 10633 el.refInFor = checkInFor(el); 10634 } 10635} 10636 10637function processFor (el) { 10638 var exp; 10639 if ((exp = getAndRemoveAttr(el, 'v-for'))) { 10640 var res = parseFor(exp); 10641 if (res) { 10642 extend(el, res); 10643 } else if (process.env.NODE_ENV !== 'production') { 10644 warn$2( 10645 ("Invalid v-for expression: " + exp), 10646 el.rawAttrsMap['v-for'] 10647 ); 10648 } 10649 } 10650} 10651 10652 10653 10654function parseFor (exp) { 10655 var inMatch = exp.match(forAliasRE); 10656 if (!inMatch) { return } 10657 var res = {}; 10658 res.for = inMatch[2].trim(); 10659 var alias = inMatch[1].trim().replace(stripParensRE, ''); 10660 var iteratorMatch = alias.match(forIteratorRE); 10661 if (iteratorMatch) { 10662 res.alias = alias.replace(forIteratorRE, '').trim(); 10663 res.iterator1 = iteratorMatch[1].trim(); 10664 if (iteratorMatch[2]) { 10665 res.iterator2 = iteratorMatch[2].trim(); 10666 } 10667 } else { 10668 res.alias = alias; 10669 } 10670 return res 10671} 10672 10673function processIf (el) { 10674 var exp = getAndRemoveAttr(el, 'v-if'); 10675 if (exp) { 10676 el.if = exp; 10677 addIfCondition(el, { 10678 exp: exp, 10679 block: el 10680 }); 10681 } else { 10682 if (getAndRemoveAttr(el, 'v-else') != null) { 10683 el.else = true; 10684 } 10685 var elseif = getAndRemoveAttr(el, 'v-else-if'); 10686 if (elseif) { 10687 el.elseif = elseif; 10688 } 10689 } 10690} 10691 10692function processIfConditions (el, parent) { 10693 var prev = findPrevElement(parent.children); 10694 if (prev && prev.if) { 10695 addIfCondition(prev, { 10696 exp: el.elseif, 10697 block: el 10698 }); 10699 } else if (process.env.NODE_ENV !== 'production') { 10700 warn$2( 10701 "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " + 10702 "used on element <" + (el.tag) + "> without corresponding v-if.", 10703 el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else'] 10704 ); 10705 } 10706} 10707 10708function findPrevElement (children) { 10709 var i = children.length; 10710 while (i--) { 10711 if (children[i].type === 1) { 10712 return children[i] 10713 } else { 10714 if (process.env.NODE_ENV !== 'production' && children[i].text !== ' ') { 10715 warn$2( 10716 "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " + 10717 "will be ignored.", 10718 children[i] 10719 ); 10720 } 10721 children.pop(); 10722 } 10723 } 10724} 10725 10726function addIfCondition (el, condition) { 10727 if (!el.ifConditions) { 10728 el.ifConditions = []; 10729 } 10730 el.ifConditions.push(condition); 10731} 10732 10733function processOnce (el) { 10734 var once$$1 = getAndRemoveAttr(el, 'v-once'); 10735 if (once$$1 != null) { 10736 el.once = true; 10737 } 10738} 10739 10740// handle content being passed to a component as slot, 10741// e.g. <template slot="xxx">, <div slot-scope="xxx"> 10742function processSlotContent (el) { 10743 var slotScope; 10744 if (el.tag === 'template') { 10745 slotScope = getAndRemoveAttr(el, 'scope'); 10746 /* istanbul ignore if */ 10747 if (process.env.NODE_ENV !== 'production' && slotScope) { 10748 warn$2( 10749 "the \"scope\" attribute for scoped slots have been deprecated and " + 10750 "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " + 10751 "can also be used on plain elements in addition to <template> to " + 10752 "denote scoped slots.", 10753 el.rawAttrsMap['scope'], 10754 true 10755 ); 10756 } 10757 el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope'); 10758 } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) { 10759 /* istanbul ignore if */ 10760 if (process.env.NODE_ENV !== 'production' && el.attrsMap['v-for']) { 10761 warn$2( 10762 "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " + 10763 "(v-for takes higher priority). Use a wrapper <template> for the " + 10764 "scoped slot to make it clearer.", 10765 el.rawAttrsMap['slot-scope'], 10766 true 10767 ); 10768 } 10769 el.slotScope = slotScope; 10770 } 10771
10772 // slot="xxx" 10773 var slotTarget = getBindingAttr(el, 'slot'); 10774 if (slotTarget) { 10775 el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget; 10776 el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']); 10777 // preserve slot as an attribute for native shadow DOM compat 10778 // only for non-scoped slots. 10779 if (el.tag !== 'template' && !el.slotScope) { 10780 addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot')); 10781 } 10782 } 10783 10784 // 2.6 v-slot syntax 10785 { 10786 if (el.tag === 'template') { 10787 // v-slot on <template> 10788 var slotBinding = getAndRemoveAttrByRegex(el, slotRE); 10789 if (slotBinding) { 10790 if (process.env.NODE_ENV !== 'production') { 10791 if (el.slotTarget || el.slotScope) { 10792 warn$2( 10793 "Unexpected mixed usage of different slot syntaxes.", 10794 el 10795 ); 10796 } 10797 if (el.parent && !maybeComponent(el.parent)) { 10798 warn$2( 10799 "<template v-slot> can only appear at the root level inside " + 10800 "the receiving component", 10801 el 10802 ); 10803 } 10804 } 10805 var ref = getSlotName(slotBinding); 10806 var name = ref.name; 10807 var dynamic = ref.dynamic; 10808 el.slotTarget = name; 10809 el.slotTargetDynamic = dynamic; 10810 el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf 10811 } 10812 } else { 10813 // v-slot on component, denotes default slot 10814 var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE); 10815 if (slotBinding$1) { 10816 if (process.env.NODE_ENV !== 'production') { 10817 if (!maybeComponent(el)) { 10818 warn$2( 10819 "v-slot can only be used on components or <template>.", 10820 slotBinding$1 10821 ); 10822 } 10823 if (el.slotScope || el.slotTarget) { 10824 warn$2( 10825 "Unexpected mixed usage of different slot syntaxes.", 10826 el 10827 ); 10828 } 10829 if (el.scopedSlots) { 10830 warn$2( 10831 "To avoid scope ambiguity, the default slot should also use " + 10832 "<template> syntax when there are other named slots.", 10833 slotBinding$1 10834 ); 10835 } 10836 } 10837 // add the component's children to its default slot 10838 var slots = el.scopedSlots || (el.scopedSlots = {}); 10839 var ref$1 = getSlotName(slotBinding$1); 10840 var name$1 = ref$1.name; 10841 var dynamic$1 = ref$1.dynamic; 10842 var slotContainer = slots[name$1] = createASTElement('template', [], el); 10843 slotContainer.slotTarget = name$1; 10844 slotContainer.slotTargetDynamic = dynamic$1; 10845 slotContainer.children = el.children.filter(function (c) { 10846 if (!c.slotScope) { 10847 c.parent = slotContainer; 10848 return true 10849 } 10850 }); 10851 slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken; 10852 // remove children as they are returned from scopedSlots now 10853 el.children = []; 10854 // mark el non-plain so data gets generated 10855 el.plain = false; 10856 } 10857 } 10858 } 10859} 10860 10861function getSlotName (binding) { 10862 var name = binding.name.replace(slotRE, ''); 10863 if (!name) { 10864 if (binding.name[0] !== '#') { 10865 name = 'default'; 10866 } else if (process.env.NODE_ENV !== 'production') { 10867 warn$2( 10868 "v-slot shorthand syntax requires a slot name.", 10869 binding 10870 ); 10871 } 10872 } 10873 return dynamicArgRE.test(name) 10874 // dynamic [name] 10875 ? { name: name.slice(1, -1), dynamic: true } 10876 // static name 10877 : { name: ("\"" + name + "\""), dynamic: false } 10878} 10879 10880// handle <slot/> outlets 10881function processSlotOutlet (el) { 10882 if (el.tag === 'slot') { 10883 el.slotName = getBindingAttr(el, 'name'); 10884 if (process.env.NODE_ENV !== 'production' && el.key) { 10885 warn$2( 10886 "`key` does not work on <slot> because slots are abstract outlets " + 10887 "and can possibly expand into multiple elements. " + 10888 "Use the key on a wrapping element instead.", 10889 getRawBindingAttr(el, 'key') 10890 ); 10891 } 10892 } 10893} 10894 10895function processComponent (el) { 10896 var binding; 10897 if ((binding = getBindingAttr(el, 'is'))) { 10898 el.component = binding; 10899 } 10900 if (getAndRemoveAttr(el, 'inline-template') != null) { 10901 el.inlineTemplate = true; 10902 } 10903} 10904 10905function processAttrs (el) { 10906 var list = el.attrsList; 10907 var i, l, name, rawName, value, modifiers, syncGen, isDynamic; 10908 for (i = 0, l = list.length; i < l; i++) { 10909 name = rawName = list[i].name; 10910 value = list[i].value; 10911 if (dirRE.test(name)) { 10912 // mark element as dynamic 10913 el.hasBindings = true; 10914 // modifiers 10915 modifiers = parseModifiers(name.replace(dirRE, '')); 10916 // support .foo shorthand syntax for the .prop modifier 10917 if (modifiers) { 10918 name = name.replace(modifierRE, ''); 10919 } 10920 if (bindRE.test(name)) { // v-bind 10921 name = name.replace(bindRE, ''); 10922 value = parseFilters(value); 10923 isDynamic = dynamicArgRE.test(name); 10924 if (isDynamic) { 10925 name = name.slice(1, -1); 10926 } 10927 if ( 10928 process.env.NODE_ENV !== 'production' && 10929 value.trim().length === 0 10930 ) { 10931 warn$2( 10932 ("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"") 10933 ); 10934 } 10935 if (modifiers) { 10936 if (modifiers.prop && !isDynamic) { 10937 name = camelize(name); 10938 if (name === 'innerHtml') { name = 'innerHTML'; } 10939 } 10940 if (modifiers.camel && !isDynamic) { 10941 name = camelize(name); 10942 } 10943 if (modifiers.sync) {
10944 syncGen = genAssignmentCode(value, "$event"); 10945 if (!isDynamic) { 10946 addHandler( 10947 el, 10948 ("update:" + (camelize(name))), 10949 syncGen, 10950 null, 10951 false, 10952 warn$2, 10953 list[i] 10954 ); 10955 if (hyphenate(name) !== camelize(name)) { 10956 addHandler( 10957 el, 10958 ("update:" + (hyphenate(name))), 10959 syncGen, 10960 null, 10961 false, 10962 warn$2, 10963 list[i] 10964 ); 10965 } 10966 } else { 10967 // handler w/ dynamic event name 10968 addHandler( 10969 el, 10970 ("\"update:\"+(" + name + ")"), 10971 syncGen, 10972 null, 10973 false, 10974 warn$2, 10975 list[i], 10976 true // dynamic 10977 ); 10978 } 10979 } 10980 } 10981 if ((modifiers && modifiers.prop) || ( 10982 !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name) 10983 )) { 10984 addProp(el, name, value, list[i], isDynamic); 10985 } else { 10986 addAttr(el, name, value, list[i], isDynamic); 10987 } 10988 } else if (onRE.test(name)) { // v-on 10989 name = name.replace(onRE, ''); 10990 isDynamic = dynamicArgRE.test(name); 10991 if (isDynamic) { 10992 name = name.slice(1, -1); 10993 } 10994 addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic); 10995 } else { // normal directives 10996 name = name.replace(dirRE, ''); 10997 // parse arg 10998 var argMatch = name.match(argRE); 10999 var arg = argMatch && argMatch[1]; 11000 isDynamic = false; 11001 if (arg) { 11002 name = name.slice(0, -(arg.length + 1)); 11003 if (dynamicArgRE.test(arg)) { 11004 arg = arg.slice(1, -1); 11005 isDynamic = true; 11006 } 11007 } 11008 addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]); 11009 if (process.env.NODE_ENV !== 'production' && name === 'model') { 11010 checkForAliasModel(el, value); 11011 } 11012 } 11013 } else { 11014 // literal attribute 11015 if (process.env.NODE_ENV !== 'production') { 11016 var res = parseText(value, delimiters); 11017 if (res) { 11018 warn$2( 11019 name + "=\"" + value + "\": " + 11020 'Interpolation inside attributes has been removed. ' + 11021 'Use v-bind or the colon shorthand instead. For example, ' + 11022 'instead of <div id="{{ val }}">, use <div :id="val">.', 11023 list[i] 11024 ); 11025 } 11026 } 11027 addAttr(el, name, JSON.stringify(value), list[i]); 11028 // #6887 firefox doesn't update muted state if set via attribute 11029 // even immediately after element creation 11030 if (!el.component && 11031 name === 'muted' && 11032 platformMustUseProp(el.tag, el.attrsMap.type, name)) { 11033 addProp(el, name, 'true', list[i]); 11034 } 11035 } 11036 } 11037} 11038 11039function checkInFor (el) { 11040 var parent = el; 11041 while (parent) { 11042 if (parent.for !== undefined) { 11043 return true 11044 } 11045 parent = parent.parent; 11046 } 11047 return false 11048} 11049 11050function parseModifiers (name) { 11051 var match = name.match(modifierRE); 11052 if (match) { 11053 var ret = {}; 11054 match.forEach(function (m) { ret[m.slice(1)] = true; }); 11055 return ret 11056 } 11057} 11058 11059function makeAttrsMap (attrs) { 11060 var map = {}; 11061 for (var i = 0, l = attrs.length; i < l; i++) { 11062 if ( 11063 process.env.NODE_ENV !== 'production' && 11064 map[attrs[i].name] && !isIE && !isEdge 11065 ) { 11066 warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]); 11067 } 11068 map[attrs[i].name] = attrs[i].value; 11069 } 11070 return map 11071} 11072 11073// for script (e.g. type="x/template") or style, do not decode content 11074function isTextTag (el) { 11075 return el.tag === 'script' || el.tag === 'style' 11076} 11077 11078function isForbiddenTag (el) { 11079 return ( 11080 el.tag === 'style' || 11081 (el.tag === 'script' && ( 11082 !el.attrsMap.type || 11083 el.attrsMap.type === 'text/javascript' 11084 )) 11085 ) 11086} 11087 11088var ieNSBug = /^xmlns:NS\d+/; 11089var ieNSPrefix = /^NS\d+:/; 11090 11091/* istanbul ignore next */ 11092function guardIESVGBug (attrs) { 11093 var res = []; 11094 for (var i = 0; i < attrs.length; i++) { 11095 var attr = attrs[i]; 11096 if (!ieNSBug.test(attr.name)) { 11097 attr.name = attr.name.replace(ieNSPrefix, ''); 11098 res.push(attr); 11099 } 11100 } 11101 return res 11102} 11103 11104function checkForAliasModel (el, value) { 11105 var _el = el; 11106 while (_el) { 11107 if (_el.for && _el.alias === value) { 11108 warn$2( 11109 "<" + (el.tag) + " v-model=\"" + value + "\">: " + 11110 "You are binding v-model directly to a v-for iteration alias. " + 11111 "This will not be able to modify the v-for source array because " + 11112 "writing to the alias is like modifying a function local variable. " + 11113 "Consider using an array of objects and use v-model on an object property instead.", 11114 el.rawAttrsMap['v-model'] 11115 ); 11116 } 11117 _el = _el.parent; 11118 } 11119} 11120 11121/* */ 11122 11123function preTransformNode (el, options) { 11124 if (el.tag === 'input') { 11125 var map = el.attrsMap; 11126 if (!map['v-model']) { 11127 return 11128 } 11129 11130 var typeBinding; 11131 if (map[':type'] || map['v-bind:type']) { 11132 typeBinding = getBindingAttr(el, 'type'); 11133 } 11134 if (!map.type && !typeBinding && map['v-bind']) { 11135 typeBinding = "(" + (map['v-bind']) + ").type"; 11136 } 11137 11138 if (typeBinding) { 11139 var ifCondition = getAndRemoveAttr(el, 'v-if', true); 11140 var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : ""; 11141 var hasElse = getAndRemoveAttr(el, 'v-else', true) != null; 11142 var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true); 11143 // 1. checkbox 11144 var branch0 = cloneASTElement(el); 11145 // process for on the main node 11146 processFor(branch0); 11147 addRawAttr(branch0, 'type', 'checkbox'); 11148 processElement(branch0, options); 11149 branch0.processed = true; // prevent it from double-processed 11150 branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra; 11151 addIfCondition(branch0, { 11152 exp: branch0.if, 11153 block: branch0 11154 }); 11155 // 2. add radio else-if condition 11156 var branch1 = cloneASTElement(el); 11157 getAndRemoveAttr(branch1, 'v-for', true); 11158 addRawAttr(branch1, 'type', 'radio'); 11159 processElement(branch1, options); 11160 addIfCondition(branch0, { 11161 exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra, 11162 block: branch1 11163 }); 11164 // 3. other 11165 var branch2 = cloneASTElement(el); 11166 getAndRemoveAttr(branch2, 'v-for', true); 11167 addRawAttr(branch2, ':type', typeBinding); 11168 processElement(branch2, options); 11169 addIfCondition(branch0, { 11170 exp: ifCondition, 11171 block: branch2 11172 }); 11173 11174 if (hasElse) { 11175 branch0.else = true; 11176 } else if (elseIfCondition) { 11177 branch0.elseif = elseIfCondition; 11178 } 11179 11180 return branch0 11181 } 11182 } 11183} 11184 11185function cloneASTElement (el) { 11186 return createASTElement(el.tag, el.attrsList.slice(), el.parent) 11187} 11188 11189var model$1 = { 11190 preTransformNode: preTransformNode 11191}; 11192 11193var modules$1 = [ 11194 klass$1, 11195 style$1, 11196 model$1 11197]; 11198 11199/* */ 11200 11201function text (el, dir) { 11202 if (dir.value) { 11203 addProp(el, 'textContent', ("_s(" + (dir.value) + ")"), dir); 11204 } 11205} 11206 11207/* */ 11208 11209function html (el, dir) { 11210 if (dir.value) { 11211 addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"), dir); 11212 } 11213} 11214 11215var directives$1 = { 11216 model: model, 11217 text: text, 11218 html: html 11219}; 11220 11221/* */ 11222 11223var baseOptions = { 11224 expectHTML: true, 11225 modules: modules$1, 11226 directives: directives$1, 11227 isPreTag: isPreTag, 11228 isUnaryTag: isUnaryTag, 11229 mustUseProp: mustUseProp, 11230 canBeLeftOpenTag: canBeLeftOpenTag, 11231 isReservedTag: isReservedTag, 11232 getTagNamespace: getTagNamespace, 11233 staticKeys: genStaticKeys(modules$1) 11234}; 11235 11236/* */ 11237 11238var isStaticKey; 11239var isPlatformReservedTag; 11240
11241var genStaticKeysCached = cached(genStaticKeys$1); 11242 11243/** 11244 * Goal of the optimizer: walk the generated template AST tree 11245 * and detect sub-trees that are purely static, i.e. parts of 11246 * the DOM that never needs to change. 11247 * 11248 * Once we detect these sub-trees, we can: 11249 * 11250 * 1. Hoist them into constants, so that we no longer need to 11251 * create fresh nodes for them on each re-render; 11252 * 2. Completely skip them in the patching process. 11253 */ 11254function optimize (root, options) { 11255 if (!root) { return } 11256 isStaticKey = genStaticKeysCached(options.staticKeys || ''); 11257 isPlatformReservedTag = options.isReservedTag || no; 11258 // first pass: mark all non-static nodes. 11259 markStatic$1(root); 11260 // second pass: mark static roots. 11261 markStaticRoots(root, false); 11262} 11263 11264function genStaticKeys$1 (keys) { 11265 return makeMap( 11266 'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' + 11267 (keys ? ',' + keys : '') 11268 ) 11269} 11270 11271function markStatic$1 (node) { 11272 node.static = isStatic(node); 11273 if (node.type === 1) { 11274 // do not make component slot content static. this avoids 11275 // 1. components not able to mutate slot nodes 11276 // 2. static slot content fails for hot-reloading 11277 if ( 11278 !isPlatformReservedTag(node.tag) && 11279 node.tag !== 'slot' && 11280 node.attrsMap['inline-template'] == null 11281 ) { 11282 return 11283 } 11284 for (var i = 0, l = node.children.length; i < l; i++) { 11285 var child = node.children[i]; 11286 markStatic$1(child); 11287 if (!child.static) { 11288 node.static = false; 11289 } 11290 } 11291 if (node.ifConditions) { 11292 for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) { 11293 var block = node.ifConditions[i$1].block; 11294 markStatic$1(block); 11295 if (!block.static) { 11296 node.static = false; 11297 } 11298 } 11299 } 11300 } 11301} 11302 11303function markStaticRoots (node, isInFor) { 11304 if (node.type === 1) { 11305 if (node.static || node.once) { 11306 node.staticInFor = isInFor; 11307 } 11308 // For a node to qualify as a static root, it should have children that 11309 // are not just static text. Otherwise the cost of hoisting out will 11310 // outweigh the benefits and it's better off to just always render it fresh. 11311 if (node.static && node.children.length && !( 11312 node.children.length === 1 && 11313 node.children[0].type === 3 11314 )) { 11315 node.staticRoot = true; 11316 return 11317 } else { 11318 node.staticRoot = false; 11319 } 11320 if (node.children) { 11321 for (var i = 0, l = node.children.length; i < l; i++) { 11322 markStaticRoots(node.children[i], isInFor || !!node.for); 11323 } 11324 } 11325 if (node.ifConditions) { 11326 for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) { 11327 markStaticRoots(node.ifConditions[i$1].block, isInFor); 11328 } 11329 } 11330 } 11331} 11332 11333function isStatic (node) { 11334 if (node.type === 2) { // expression 11335 return false 11336 } 11337 if (node.type === 3) { // text 11338 return true 11339 } 11340 return !!(node.pre || ( 11341 !node.hasBindings && // no dynamic bindings 11342 !node.if && !node.for && // not v-if or v-for or v-else 11343 !isBuiltInTag(node.tag) && // not a built-in 11344 isPlatformReservedTag(node.tag) && // not a component 11345 !isDirectChildOfTemplateFor(node) && 11346 Object.keys(node).every(isStaticKey) 11347 )) 11348} 11349 11350function isDirectChildOfTemplateFor (node) { 11351 while (node.parent) { 11352 node = node.parent; 11353 if (node.tag !== 'template') { 11354 return false 11355 } 11356 if (node.for) { 11357 return true 11358 } 11359 } 11360 return false 11361} 11362 11363/* */ 11364 11365var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/; 11366var fnInvokeRE = /\([^)]*?\);*$/; 11367var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; 11368 11369// KeyboardEvent.keyCode aliases 11370var keyCodes = { 11371 esc: 27, 11372 tab: 9, 11373 enter: 13, 11374 space: 32, 11375 up: 38, 11376 left: 37, 11377 right: 39, 11378 down: 40, 11379 'delete': [8, 46] 11380}; 11381 11382// KeyboardEvent.key aliases 11383var keyNames = { 11384 // #7880: IE11 and Edge use `Esc` for Escape key name. 11385 esc: ['Esc', 'Escape'], 11386 tab: 'Tab', 11387 enter: 'Enter', 11388 // #9112: IE11 uses `Spacebar` for Space key name. 11389 space: [' ', 'Spacebar'], 11390 // #7806: IE11 uses key names without `Arrow` prefix for arrow keys. 11391 up: ['Up', 'ArrowUp'], 11392 left: ['Left', 'ArrowLeft'], 11393 right: ['Right', 'ArrowRight'],
11394 down: ['Down', 'ArrowDown'], 11395 // #9112: IE11 uses `Del` for Delete key name. 11396 'delete': ['Backspace', 'Delete', 'Del'] 11397}; 11398 11399// #4868: modifiers that prevent the execution of the listener 11400// need to explicitly return null so that we can determine whether to remove 11401// the listener for .once 11402var genGuard = function (condition) { return ("if(" + condition + ")return null;"); }; 11403 11404var modifierCode = { 11405 stop: '$event.stopPropagation();', 11406 prevent: '$event.preventDefault();', 11407 self: genGuard("$event.target !== $event.currentTarget"), 11408 ctrl: genGuard("!$event.ctrlKey"), 11409 shift: genGuard("!$event.shiftKey"), 11410 alt: genGuard("!$event.altKey"), 11411 meta: genGuard("!$event.metaKey"), 11412 left: genGuard("'button' in $event && $event.button !== 0"), 11413 middle: genGuard("'button' in $event && $event.button !== 1"), 11414 right: genGuard("'button' in $event && $event.button !== 2") 11415}; 11416 11417function genHandlers ( 11418 events, 11419 isNative 11420) { 11421 var prefix = isNative ? 'nativeOn:' : 'on:'; 11422 var staticHandlers = ""; 11423 var dynamicHandlers = ""; 11424 for (var name in events) { 11425 var handlerCode = genHandler(events[name]); 11426 if (events[name] && events[name].dynamic) { 11427 dynamicHandlers += name + "," + handlerCode + ","; 11428 } else { 11429 staticHandlers += "\"" + name + "\":" + handlerCode + ","; 11430 } 11431 } 11432 staticHandlers = "{" + (staticHandlers.slice(0, -1)) + "}"; 11433 if (dynamicHandlers) { 11434 return prefix + "_d(" + staticHandlers + ",[" + (dynamicHandlers.slice(0, -1)) + "])" 11435 } else { 11436 return prefix + staticHandlers 11437 } 11438} 11439 11440function genHandler (handler) { 11441 if (!handler) { 11442 return 'function(){}' 11443 } 11444 11445 if (Array.isArray(handler)) { 11446 return ("[" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + "]") 11447 } 11448 11449 var isMethodPath = simplePathRE.test(handler.value); 11450 var isFunctionExpression = fnExpRE.test(handler.value); 11451 var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, '')); 11452 11453 if (!handler.modifiers) { 11454 if (isMethodPath || isFunctionExpression) { 11455 return handler.value 11456 } 11457 return ("function($event){" + (isFunctionInvocation ? ("return " + (handler.value)) : handler.value) + "}") // inline statement 11458 } else { 11459 var code = ''; 11460 var genModifierCode = ''; 11461 var keys = []; 11462 for (var key in handler.modifiers) { 11463 if (modifierCode[key]) { 11464 genModifierCode += modifierCode[key]; 11465 // left/right 11466 if (keyCodes[key]) { 11467 keys.push(key); 11468 } 11469 } else if (key === 'exact') { 11470 var modifiers = (handler.modifiers); 11471 genModifierCode += genGuard( 11472 ['ctrl', 'shift', 'alt', 'meta'] 11473 .filter(function (keyModifier) { return !modifiers[keyModifier]; }) 11474 .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); }) 11475 .join('||') 11476 ); 11477 } else { 11478 keys.push(key); 11479 } 11480 } 11481 if (keys.length) { 11482 code += genKeyFilter(keys); 11483 } 11484 // Make sure modifiers like prevent and stop get executed after key filtering 11485 if (genModifierCode) { 11486 code += genModifierCode; 11487 } 11488 var handlerCode = isMethodPath 11489 ? ("return " + (handler.value) + "($event)") 11490 : isFunctionExpression 11491 ? ("return (" + (handler.value) + ")($event)") 11492 : isFunctionInvocation 11493 ? ("return " + (handler.value)) 11494 : handler.value; 11495 return ("function($event){" + code + handlerCode + "}") 11496 } 11497} 11498 11499function genKeyFilter (keys) { 11500 return ( 11501 // make sure the key filters only apply to KeyboardEvents 11502 // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake 11503 // key events that do not have keyCode property... 11504 "if(!$event.type.indexOf('key')&&" + 11505 (keys.map(genFilterCode).join('&&')) + ")return null;" 11506 ) 11507} 11508 11509function genFilterCode (key) { 11510 var keyVal = parseInt(key, 10); 11511 if (keyVal) { 11512 return ("$event.keyCode!==" + keyVal) 11513 } 11514 var keyCode = keyCodes[key]; 11515 var keyName = keyNames[key]; 11516 return ( 11517 "_k($event.keyCode," + 11518 (JSON.stringify(key)) + "," + 11519 (JSON.stringify(keyCode)) + "," + 11520 "$event.key," + 11521 "" + (JSON.stringify(keyName)) + 11522 ")" 11523 ) 11524} 11525 11526/* */ 11527 11528function on (el, dir) { 11529 if (process.env.NODE_ENV !== 'production' && dir.modifiers) { 11530 warn("v-on without argument does not support modifiers."); 11531 } 11532 el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); }; 11533} 11534 11535/* */ 11536 11537function bind$1 (el, dir) { 11538 el.wrapData = function (code) { 11539 return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")") 11540 }; 11541} 11542 11543/* */ 11544 11545var baseDirectives = { 11546 on: on, 11547 bind: bind$1, 11548 cloak: noop 11549}; 11550 11551/* */ 11552 11553 11554 11555 11556 11557var CodegenState = function CodegenState (options) { 11558 this.options = options; 11559 this.warn = options.warn || baseWarn; 11560 this.transforms = pluckModuleFunction(options.modules, 'transformCode'); 11561 this.dataGenFns = pluckModuleFunction(options.modules, 'genData'); 11562 this.directives = extend(extend({}, baseDirectives), options.directives); 11563 var isReservedTag = options.isReservedTag || no; 11564 this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); }; 11565 this.onceId = 0; 11566 this.staticRenderFns = []; 11567 this.pre = false;
11568}; 11569 11570 11571 11572function generate ( 11573 ast, 11574 options 11575) { 11576 var state = new CodegenState(options); 11577 var code = ast ? genElement(ast, state) : '_c("div")'; 11578 return { 11579 render: ("with(this){return " + code + "}"), 11580 staticRenderFns: state.staticRenderFns 11581 } 11582} 11583 11584function genElement (el, state) { 11585 if (el.parent) { 11586 el.pre = el.pre || el.parent.pre; 11587 } 11588 11589 if (el.staticRoot && !el.staticProcessed) { 11590 return genStatic(el, state) 11591 } else if (el.once && !el.onceProcessed) { 11592 return genOnce(el, state) 11593 } else if (el.for && !el.forProcessed) { 11594 return genFor(el, state) 11595 } else if (el.if && !el.ifProcessed) { 11596 return genIf(el, state) 11597 } else if (el.tag === 'template' && !el.slotTarget && !state.pre) { 11598 return genChildren(el, state) || 'void 0' 11599 } else if (el.tag === 'slot') { 11600 return genSlot(el, state) 11601 } else { 11602 // component or element 11603 var code; 11604 if (el.component) { 11605 code = genComponent(el.component, el, state); 11606 } else { 11607 var data; 11608 if (!el.plain || (el.pre && state.maybeComponent(el))) { 11609 data = genData$2(el, state); 11610 } 11611 11612 var children = el.inlineTemplate ? null : genChildren(el, state, true); 11613 code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")"; 11614 } 11615 // module transforms 11616 for (var i = 0; i < state.transforms.length; i++) { 11617 code = state.transforms[i](el, code); 11618 } 11619 return code 11620 } 11621} 11622 11623// hoist static sub-trees out 11624function genStatic (el, state) { 11625 el.staticProcessed = true; 11626 // Some elements (templates) need to behave differently inside of a v-pre 11627 // node. All pre nodes are static roots, so we can use this as a location to 11628 // wrap a state change and reset it upon exiting the pre node. 11629 var originalPreState = state.pre; 11630 if (el.pre) { 11631 state.pre = el.pre; 11632 } 11633 state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}")); 11634 state.pre = originalPreState; 11635 return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")") 11636} 11637 11638// v-once 11639function genOnce (el, state) { 11640 el.onceProcessed = true; 11641 if (el.if && !el.ifProcessed) { 11642 return genIf(el, state) 11643 } else if (el.staticInFor) { 11644 var key = ''; 11645 var parent = el.parent; 11646 while (parent) { 11647 if (parent.for) { 11648 key = parent.key; 11649 break 11650 } 11651 parent = parent.parent; 11652 } 11653 if (!key) { 11654 process.env.NODE_ENV !== 'production' && state.warn( 11655 "v-once can only be used inside v-for that is keyed. ", 11656 el.rawAttrsMap['v-once'] 11657 ); 11658 return genElement(el, state) 11659 } 11660 return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")") 11661 } else { 11662 return genStatic(el, state) 11663 } 11664} 11665 11666function genIf ( 11667 el, 11668 state, 11669 altGen, 11670 altEmpty 11671) { 11672 el.ifProcessed = true; // avoid recursion 11673 return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty) 11674} 11675 11676function genIfConditions ( 11677 conditions, 11678 state, 11679 altGen, 11680 altEmpty 11681) { 11682 if (!conditions.length) { 11683 return altEmpty || '_e()' 11684 } 11685 11686 var condition = conditions.shift(); 11687 if (condition.exp) { 11688 return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty))) 11689 } else { 11690 return ("" + (genTernaryExp(condition.block))) 11691 } 11692 11693 // v-if with v-once should generate code like (a)?_m(0):_m(1) 11694 function genTernaryExp (el) { 11695 return altGen 11696 ? altGen(el, state) 11697 : el.once 11698 ? genOnce(el, state) 11699 : genElement(el, state) 11700 } 11701} 11702 11703function genFor ( 11704 el, 11705 state, 11706 altGen, 11707 altHelper 11708) { 11709 var exp = el.for; 11710 var alias = el.alias; 11711 var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : ''; 11712 var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : ''; 11713 11714 if (process.env.NODE_ENV !== 'production' && 11715 state.maybeComponent(el) && 11716 el.tag !== 'slot' && 11717 el.tag !== 'template' && 11718 !el.key 11719 ) { 11720 state.warn( 11721 "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " + 11722 "v-for should have explicit keys. " + 11723 "See https://vuejs.org/guide/list.html#key for more info.", 11724 el.rawAttrsMap['v-for'], 11725 true /* tip */ 11726 ); 11727 } 11728 11729 el.forProcessed = true; // avoid recursion 11730 return (altHelper || '_l') + "((" + exp + ")," + 11731 "function(" + alias + iterator1 + iterator2 + "){" + 11732 "return " + ((altGen || genElement)(el, state)) + 11733 '})' 11734} 11735 11736function genData$2 (el, state) { 11737 var data = '{'; 11738 11739 // directives first. 11740 // directives may mutate the el's other properties before they are generated. 11741 var dirs = genDirectives(el, state); 11742 if (dirs) { data += dirs + ','; } 11743 11744 // key 11745 if (el.key) { 11746 data += "key:" + (el.key) + ","; 11747 } 11748 // ref 11749 if (el.ref) { 11750 data += "ref:" + (el.ref) + ","; 11751 } 11752 if (el.refInFor) { 11753 data += "refInFor:true,"; 11754 } 11755 // pre 11756 if (el.pre) { 11757 data += "pre:true,"; 11758 } 11759 // record original tag name for components using "is" attribute 11760 if (el.component) { 11761 data += "tag:\"" + (el.tag) + "\","; 11762 } 11763 // module data generation functions 11764 for (var i = 0; i < state.dataGenFns.length; i++) { 11765 data += state.dataGenFns[i](el); 11766 } 11767 // attributes 11768 if (el.attrs) {
11769 data += "attrs:" + (genProps(el.attrs)) + ","; 11770 } 11771 // DOM props 11772 if (el.props) { 11773 data += "domProps:" + (genProps(el.props)) + ","; 11774 } 11775 // event handlers 11776 if (el.events) { 11777 data += (genHandlers(el.events, false)) + ","; 11778 } 11779 if (el.nativeEvents) { 11780 data += (genHandlers(el.nativeEvents, true)) + ","; 11781 } 11782 // slot target 11783 // only for non-scoped slots 11784 if (el.slotTarget && !el.slotScope) { 11785 data += "slot:" + (el.slotTarget) + ","; 11786 } 11787 // scoped slots 11788 if (el.scopedSlots) { 11789 data += (genScopedSlots(el, el.scopedSlots, state)) + ","; 11790 } 11791 // component v-model 11792 if (el.model) { 11793 data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},"; 11794 } 11795 // inline-template 11796 if (el.inlineTemplate) { 11797 var inlineTemplate = genInlineTemplate(el, state); 11798 if (inlineTemplate) { 11799 data += inlineTemplate + ","; 11800 } 11801 } 11802 data = data.replace(/,$/, '') + '}'; 11803 // v-bind dynamic argument wrap 11804 // v-bind with dynamic arguments must be applied using the same v-bind object 11805 // merge helper so that class/style/mustUseProp attrs are handled correctly. 11806 if (el.dynamicAttrs) { 11807 data = "_b(" + data + ",\"" + (el.tag) + "\"," + (genProps(el.dynamicAttrs)) + ")"; 11808 } 11809 // v-bind data wrap 11810 if (el.wrapData) { 11811 data = el.wrapData(data); 11812 } 11813 // v-on data wrap 11814 if (el.wrapListeners) { 11815 data = el.wrapListeners(data); 11816 } 11817 return data 11818} 11819 11820function genDirectives (el, state) { 11821 var dirs = el.directives; 11822 if (!dirs) { return } 11823 var res = 'directives:['; 11824 var hasRuntime = false; 11825 var i, l, dir, needRuntime; 11826 for (i = 0, l = dirs.length; i < l; i++) { 11827 dir = dirs[i]; 11828 needRuntime = true; 11829 var gen = state.directives[dir.name]; 11830 if (gen) { 11831 // compile-time directive that manipulates AST. 11832 // returns true if it also needs a runtime counterpart. 11833 needRuntime = !!gen(el, dir, state.warn); 11834 } 11835 if (needRuntime) { 11836 hasRuntime = true; 11837 res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:" + (dir.isDynamicArg ? dir.arg : ("\"" + (dir.arg) + "\""))) : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},"; 11838 } 11839 } 11840 if (hasRuntime) { 11841 return res.slice(0, -1) + ']' 11842 } 11843} 11844 11845function genInlineTemplate (el, state) { 11846 var ast = el.children[0]; 11847 if (process.env.NODE_ENV !== 'production' && ( 11848 el.children.length !== 1 || ast.type !== 1 11849 )) { 11850 state.warn( 11851 'Inline-template components must have exactly one child element.', 11852 { start: el.start } 11853 ); 11854 } 11855 if (ast && ast.type === 1) { 11856 var inlineRenderFns = generate(ast, state.options); 11857 return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}") 11858 } 11859} 11860 11861function genScopedSlots ( 11862 el, 11863 slots, 11864 state 11865) { 11866 // by default scoped slots are considered "stable", this allows child 11867 // components with only scoped slots to skip forced updates from parent. 11868 // but in some cases we have to bail-out of this optimization 11869 // for example if the slot contains dynamic names, has v-if or v-for on them... 11870 var needsForceUpdate = el.for || Object.keys(slots).some(function (key) { 11871 var slot = slots[key]; 11872 return ( 11873 slot.slotTargetDynamic || 11874 slot.if || 11875 slot.for || 11876 containsSlotChild(slot) // is passing down slot from parent which may be dynamic 11877 ) 11878 }); 11879 11880 // #9534: if a component with scoped slots is inside a conditional branch, 11881 // it's possible for the same component to be reused but with different 11882 // compiled slot content. To avoid that, we generate a unique key based on 11883 // the generated code of all the slot contents. 11884 var needsKey = !!el.if; 11885 11886 // OR when it is inside another scoped slot or v-for (the reactivity may be 11887 // disconnected due to the intermediate scope variable) 11888 // #9438, #9506 11889 // TODO: this can be further optimized by properly analyzing in-scope bindings 11890 // and skip force updating ones that do not actually use scope variables. 11891 if (!needsForceUpdate) { 11892 var parent = el.parent; 11893 while (parent) { 11894 if ( 11895 (parent.slotScope && parent.slotScope !== emptySlotScopeToken) || 11896 parent.for 11897 ) { 11898 needsForceUpdate = true; 11899 break 11900 } 11901 if (parent.if) { 11902 needsKey = true; 11903 } 11904 parent = parent.parent; 11905 } 11906 } 11907 11908 var generatedSlots = Object.keys(slots) 11909 .map(function (key) { return genScopedSlot(slots[key], state); }) 11910 .join(','); 11911 11912 return ("scopedSlots:_u([" + generatedSlots + "]" + (needsForceUpdate ? ",null,true" : "") + (!needsForceUpdate && needsKey ? (",null,fal
11912se," + (hash(generatedSlots))) : "") + ")") 11913} 11914 11915function hash(str) { 11916 var hash = 5381; 11917 var i = str.length; 11918 while(i) { 11919 hash = (hash * 33) ^ str.charCodeAt(--i); 11920 } 11921 return hash >>> 0 11922} 11923 11924function containsSlotChild (el) { 11925 if (el.type === 1) { 11926 if (el.tag === 'slot') { 11927 return true 11928 } 11929 return el.children.some(containsSlotChild) 11930 } 11931 return false 11932} 11933 11934function genScopedSlot ( 11935 el, 11936 state 11937) { 11938 var isLegacySyntax = el.attrsMap['slot-scope']; 11939 if (el.if && !el.ifProcessed && !isLegacySyntax) { 11940 return genIf(el, state, genScopedSlot, "null") 11941 } 11942 if (el.for && !el.forProcessed) { 11943 return genFor(el, state, genScopedSlot) 11944 } 11945 var slotScope = el.slotScope === emptySlotScopeToken 11946 ? "" 11947 : String(el.slotScope); 11948 var fn = "function(" + slotScope + "){" + 11949 "return " + (el.tag === 'template' 11950 ? el.if && isLegacySyntax 11951 ? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined") 11952 : genChildren(el, state) || 'undefined' 11953 : genElement(el, state)) + "}"; 11954 // reverse proxy v-slot without scope on this.$slots 11955 var reverseProxy = slotScope ? "" : ",proxy:true"; 11956 return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + reverseProxy + "}") 11957} 11958 11959function genChildren ( 11960 el, 11961 state, 11962 checkSkip, 11963 altGenElement, 11964 altGenNode 11965) { 11966 var children = el.children; 11967 if (children.length) { 11968 var el$1 = children[0]; 11969 // optimize single v-for 11970 if (children.length === 1 && 11971 el$1.for && 11972 el$1.tag !== 'template' && 11973 el$1.tag !== 'slot' 11974 ) { 11975 var normalizationType = checkSkip 11976 ? state.maybeComponent(el$1) ? ",1" : ",0" 11977 : ""; 11978 return ("" + ((altGenElement || genElement)(el$1, state)) + normalizationType) 11979 } 11980 var normalizationType$1 = checkSkip 11981 ? getNormalizationType(children, state.maybeComponent) 11982 : 0; 11983 var gen = altGenNode || genNode; 11984 return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType$1 ? ("," + normalizationType$1) : '')) 11985 } 11986} 11987 11988// determine the normalization needed for the children array. 11989// 0: no normalization needed 11990// 1: simple normalization needed (possible 1-level deep nested array) 11991// 2: full normalization needed 11992function getNormalizationType ( 11993 children, 11994 maybeComponent 11995) { 11996 var res = 0; 11997 for (var i = 0; i < children.length; i++) { 11998 var el = children[i]; 11999 if (el.type !== 1) { 12000 continue 12001 } 12002 if (needsNormalization(el) || 12003 (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) { 12004 res = 2; 12005 break 12006 } 12007 if (maybeComponent(el) || 12008 (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) { 12009 res = 1; 12010 } 12011 } 12012 return res 12013} 12014 12015function needsNormalization (el) { 12016 return el.for !== undefined || el.tag === 'template' || el.tag === 'slot' 12017} 12018 12019function genNode (node, state) { 12020 if (node.type === 1) { 12021 return genElement(node, state) 12022 } else if (node.type === 3 && node.isComment) { 12023 return genComment(node) 12024 } else { 12025 return genText(node) 12026 } 12027} 12028 12029function genText (text) { 12030 return ("_v(" + (text.type === 2 12031 ? text.expression // no need for () because already wrapped in _s() 12032 : transformSpecialNewlines(JSON.stringify(text.text))) + ")") 12033} 12034 12035function genComment (comment) { 12036 return ("_e(" + (JSON.stringify(comment.text)) + ")") 12037} 12038 12039function genSlot (el, state) { 12040 var slotName = el.slotName || '"default"'; 12041 var children = genChildren(el, state); 12042 var res = "_t(" + slotName + (children ? ("," + children) : ''); 12043 var attrs = el.attrs || el.dynamicAttrs 12044 ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({ 12045 // slot props are camelized 12046 name: camelize(attr.name), 12047 value: attr.value, 12048 dynamic: attr.dynamic 12049 }); })) 12050 : null; 12051 var bind$$1 = el.attrsMap['v-bind']; 12052 if ((attrs || bind$$1) && !children) { 12053 res += ",null"; 12054 } 12055 if (attrs) { 12056 res += "," + attrs; 12057 } 12058 if (bind$$1) { 12059 res += (attrs ? '' : ',null') + "," + bind$$1; 12060 } 12061 return res + ')' 12062} 12063 12064// componentName is el.component, take it as argument to shun flow's pessimistic refinement 12065function genComponent ( 12066 componentName, 12067 el, 12068 state 12069) { 12070 var children = el.inlineTemplate ? null : genChildren(el, state, true); 12071 return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")") 12072} 12073 12074function genProps (props) { 12075 var staticProps = ""; 12076 var dynamicProps = ""; 12077 for (var i = 0; i < props.length; i++) { 12078 var prop = props[i]; 12079 var value = transformSpecialNewlines(prop.value); 12080 if (prop.dynamic) { 12081 dynamicProps += (prop.name) + "," + value + ","; 12082 } else { 12083 staticProps += "\"" + (prop.name) + "\":" + value + ","; 12084 } 12085 } 12086 staticProps = "{" + (staticProps.slice(0, -1)) + "}"; 12087 if (dynamicProps) { 12088 return ("_d(" + staticProps + ",[" + (dynamicProps.slice(0, -1)) + "])") 12089 } else { 12090 return staticProps 12091 } 12092} 12093 12094// #3895, #4268 12095function transformSpecialNewlines (text) { 12096 return text 12097 .replace(/\u2028/g, '\\u2028') 12098 .replace(/\u2029/g, '\\u2029') 12099} 12100 12101/* */ 12102 12103 12104 12105// these keywords should not appear inside expressions, but operators like 12106// typeof, instanceof and in are allowed 12107var prohibitedKeywordRE = new RegExp('\\b' + ( 12108 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' + 12109 'super,throw,while,yield,delete,export,import,return,switch,default,' + 12110 'extends,finally,continue,debugger,function,arguments' 12111).split(',').join('\\b|\\b') + '\\b'); 12112 12113// these unary operators should not be used as property/method names 12114var unaryOperatorsRE = new RegExp('\\b' + ( 12115 'delete,typeof,void' 12116).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)'); 12117 12118// strip strings in expressions 12119var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; 12120 12121// detect problematic expressions in a template 12122function detectErrors (ast, warn) { 12123 if (ast) { 12124 checkNode(ast, warn); 12125 } 12126} 12127 12128function checkNode (node, warn) { 12129 if (node.type === 1) { 12130 for (var name in node.attrsMap) { 12131 if (dirRE.test(name)) { 12132 var value = node.attrsMap[name]; 12133 if (value) { 12134 var range = node.rawAttrsMap[name]; 12135 if (name === 'v-for') { 12136 checkFor(node, ("v-for=\"" + value + "\""), warn, range); 12137 } else if (name === 'v-slot' || name[0] === '#') { 12138 checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range); 12139 } else if (onRE.test(name)) { 12140 checkEvent(value, (name + "=\"" + value + "\""), warn, range); 12141 } else { 12142 checkExpression(value, (name + "=\"" + value + "\""), warn, range); 12143 } 12144 } 12145 } 12146 } 12147 if (node.children) { 12148 for (var i = 0; i < node.children.length; i++) { 12149 checkNode(node.children[i], warn); 12150 } 12151 } 12152 } else if (node.type === 2) { 12153 checkExpression(node.expression, node.text, warn, node); 12154 } 12155} 12156 12157function checkEvent (exp, text, warn, range) { 12158 var stripped = exp.replace(stripStringRE, ''); 12159 var keywordMatch = stripped.match(unaryOperatorsRE); 12160 if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') { 12161 warn( 12162 "avoid using JavaScript unary operator as property name: " + 12163 "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()), 12164 range 12165 ); 12166 } 12167 checkExpression(exp, text, warn, range); 12168} 12169 12170function checkFor (node, text, warn, range) { 12171 checkExpression(node.for || '', text, warn, range); 12172 checkIdentifier(node.alias, 'v-for alias', text, warn, range); 12173 checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range); 12174 checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range); 12175} 12176 12177function checkIdentifier ( 12178 ident, 12179 type, 12180 text, 12181 warn, 12182 range 12183) { 12184 if (typeof ident === 'string') { 12185 try { 12186 new Function(("var " + ident + "=_")); 12187 } catch (e) { 12188 warn(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())), range); 12189 } 12190 } 12191} 12192 12193function checkExpression (exp, text, warn, range) { 12194 try { 12195 new Function(("return " + exp)); 12196 } catch (e) { 12197 var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE); 12198 if (keywordMatch) { 12199 warn( 12200 "avoid using JavaScript keyword as property name: " + 12201 "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim()), 12202 range 12203 ); 12204 } else { 12205 warn( 12206 "invalid expression: " + (e.message) + " in\n\n" + 12207 " " + exp + "\n\n" + 12208 " Raw expression: " + (text.trim()) + "\n", 12209 range 12210 ); 12211 } 12212 } 12213} 12214 12215function checkFunctionParameterExpression (exp, text, warn, range) { 12216 try { 12217 new Function(exp, ''); 12218 } catch (e) { 12219 warn( 12220 "invalid function parameter expression: " + (e.message) + " in\n\n" + 12221 " " + exp + "\n\n" + 12222 " Raw expression: " + (text.trim()) + "\n", 12223 range 12224 ); 12225 } 12226} 12227 12228/* */ 12229 12230var range = 2; 12231 12232function generateCodeFrame ( 12233 source, 12234 start, 12235 end 12236) { 12237 if ( start === void 0 ) start = 0; 12238 if ( end === void 0 ) end = source.length; 12239 12240 var lines = source.split(/\r?\n/); 12241 var count = 0; 12242 var res = []; 12243 for (var i = 0; i < lines.length; i++) { 12244 count += lines[i].length + 1; 12245 if (count >= start) {
12246 for (var j = i - range; j <= i + range || end > count; j++) { 12247 if (j < 0 || j >= lines.length) { continue } 12248 res.push(("" + (j + 1) + (repeat$1(" ", 3 - String(j + 1).length)) + "| " + (lines[j]))); 12249 var lineLength = lines[j].length; 12250 if (j === i) { 12251 // push underline 12252 var pad = start - (count - lineLength) + 1; 12253 var length = end > count ? lineLength - pad : end - start; 12254 res.push(" | " + repeat$1(" ", pad) + repeat$1("^", length)); 12255 } else if (j > i) { 12256 if (end > count) { 12257 var length$1 = Math.min(end - count, lineLength); 12258 res.push(" | " + repeat$1("^", length$1)); 12259 } 12260 count += lineLength + 1; 12261 } 12262 } 12263 break 12264 } 12265 } 12266 return res.join('\n') 12267} 12268 12269function repeat$1 (str, n) { 12270 var result = ''; 12271 if (n > 0) { 12272 while (true) { // eslint-disable-line 12273 if (n & 1) { result += str; } 12274 n >>>= 1; 12275 if (n <= 0) { break } 12276 str += str; 12277 } 12278 } 12279 return result 12280} 12281 12282/* */ 12283 12284 12285 12286function createFunction (code, errors) { 12287 try { 12288 return new Function(code) 12289 } catch (err) { 12290 errors.push({ err: err, code: code }); 12291 return noop 12292 } 12293} 12294 12295function createCompileToFunctionFn (compile) { 12296 var cache = Object.create(null); 12297 12298 return function compileToFunctions ( 12299 template, 12300 options, 12301 vm 12302 ) { 12303 options = extend({}, options); 12304 var warn$$1 = options.warn || warn; 12305 delete options.warn; 12306 12307 /* istanbul ignore if */ 12308 if (process.env.NODE_ENV !== 'production') { 12309 // detect possible CSP restriction 12310 try { 12311 new Function('return 1'); 12312 } catch (e) { 12313 if (e.toString().match(/unsafe-eval|CSP/)) { 12314 warn$$1( 12315 'It seems you are using the standalone build of Vue.js in an ' + 12316 'environment with Content Security Policy that prohibits unsafe-eval. ' + 12317 'The template compiler cannot work in this environment. Consider ' + 12318 'relaxing the policy to allow unsafe-eval or pre-compiling your ' + 12319 'templates into render functions.' 12320 ); 12321 } 12322 } 12323 } 12324 12325 // check cache 12326 var key = options.delimiters 12327 ? String(options.delimiters) + template 12328 : template; 12329 if (cache[key]) { 12330 return cache[key] 12331 } 12332 12333 // compile 12334 var compiled = compile(template, options); 12335 12336 // check compilation errors/tips 12337 if (process.env.NODE_ENV !== 'production') { 12338 if (compiled.errors && compiled.errors.length) { 12339 if (options.outputSourceRange) { 12340 compiled.errors.forEach(function (e) { 12341 warn$$1( 12342 "Error compiling template:\n\n" + (e.msg) + "\n\n" + 12343 generateCodeFrame(template, e.start, e.end), 12344 vm 12345 ); 12346 }); 12347 } else { 12348 warn$$1( 12349 "Error compiling template:\n\n" + template + "\n\n" + 12350 compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n', 12351 vm 12352 ); 12353 } 12354 } 12355 if (compiled.tips && compiled.tips.length) { 12356 if (options.outputSourceRange) { 12357 compiled.tips.forEach(function (e) { return tip(e.msg, vm); }); 12358 } else { 12359 compiled.tips.forEach(function (msg) { return tip(msg, vm); }); 12360 } 12361 } 12362 } 12363 12364 // turn code into functions 12365 var res = {}; 12366 var fnGenErrors = []; 12367 res.render = createFunction(compiled.render, fnGenErrors); 12368 res.staticRenderFns = compiled.staticRenderFns.map(function (code) { 12369 return createFunction(code, fnGenErrors) 12370 }); 12371 12372 // check function generation errors. 12373 // this should only happen if there is a bug in the compiler itself. 12374 // mostly for codegen development use 12375 /* istanbul ignore if */ 12376 if (process.env.NODE_ENV !== 'production') { 12377 if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) { 12378 warn$$1( 12379 "Failed to generate render function:\n\n" + 12380 fnGenErrors.map(function (ref) { 12381 var err = ref.err; 12382 var code = ref.code; 12383 12384 return ((err.toString()) + " in\n\n" + code + "\n"); 12385 }).join('\n'), 12386 vm 12387 ); 12388 } 12389 } 12390 12391 return (cache[key] = res) 12392 } 12393} 12394 12395/* */ 12396 12397function createCompilerCreator (baseCompile) { 12398 return function createCompiler (baseOptions) { 12399 function compile ( 12400 template, 12401 options 12402 ) { 12403 var finalOptions = Object.create(baseOptions); 12404 var errors = []; 12405 var tips = []; 12406 12407 var warn = function (msg, range, tip) { 12408 (tip ? tips : errors).push(msg); 12409 }; 12410 12411 if (options) { 12412 if (process.env.NODE_ENV !== 'production' && options.outputSourceRange) { 12413 // $flow-disable-line
12414 var leadingSpaceLength = template.match(/^\s*/)[0].length; 12415 12416 warn = function (msg, range, tip) { 12417 var data = { msg: msg }; 12418 if (range) { 12419 if (range.start != null) { 12420 data.start = range.start + leadingSpaceLength; 12421 } 12422 if (range.end != null) { 12423 data.end = range.end + leadingSpaceLength; 12424 } 12425 } 12426 (tip ? tips : errors).push(data); 12427 }; 12428 } 12429 // merge custom modules 12430 if (options.modules) { 12431 finalOptions.modules = 12432 (baseOptions.modules || []).concat(options.modules); 12433 } 12434 // merge custom directives 12435 if (options.directives) { 12436 finalOptions.directives = extend( 12437 Object.create(baseOptions.directives || null), 12438 options.directives 12439 ); 12440 } 12441 // copy other options 12442 for (var key in options) { 12443 if (key !== 'modules' && key !== 'directives') { 12444 finalOptions[key] = options[key]; 12445 } 12446 } 12447 } 12448 12449 finalOptions.warn = warn; 12450 12451 var compiled = baseCompile(template.trim(), finalOptions); 12452 if (process.env.NODE_ENV !== 'production') { 12453 detectErrors(compiled.ast, warn); 12454 } 12455 compiled.errors = errors; 12456 compiled.tips = tips; 12457 return compiled 12458 } 12459 12460 return { 12461 compile: compile, 12462 compileToFunctions: createCompileToFunctionFn(compile) 12463 } 12464 } 12465} 12466 12467/* */ 12468 12469// `createCompilerCreator` allows creating compilers that use alternative 12470// parser/optimizer/codegen, e.g the SSR optimizing compiler. 12471// Here we just export a default compiler using the default parts. 12472var createCompiler = createCompilerCreator(function baseCompile ( 12473 template, 12474 options 12475) { 12476 var ast = parse(template.trim(), options); 12477 if (options.optimize !== false) { 12478 optimize(ast, options); 12479 } 12480 var code = generate(ast, options); 12481 return { 12482 ast: ast, 12483 render: code.render, 12484 staticRenderFns: code.staticRenderFns 12485 } 12486}); 12487 12488/* */ 12489 12490var ref$1 = createCompiler(baseOptions); 12491var compile = ref$1.compile; 12492var compileToFunctions = ref$1.compileToFunctions; 12493 12494/* */ 12495 12496// check whether current browser encodes a char inside attribute values 12497var div; 12498function getShouldDecode (href) { 12499 div = div || document.createElement('div'); 12500 div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>"; 12501 return div.innerHTML.indexOf(' ') > 0 12502} 12503 12504// #3663: IE encodes newlines inside attribute values while other browsers don't 12505var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false; 12506// #6828: chrome encodes content in a[href] 12507var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false; 12508 12509/* */ 12510 12511var idToTemplate = cached(function (id) { 12512 var el = query(id); 12513 return el && el.innerHTML 12514}); 12515 12516var mount = Vue.prototype.$mount; 12517Vue.prototype.$mount = function ( 12518 el, 12519 hydrating 12520) { 12521 el = el && query(el); 12522 12523 /* istanbul ignore if */ 12524 if (el === document.body || el === document.documentElement) { 12525 process.env.NODE_ENV !== 'production' && warn( 12526 "Do not mount Vue to <html> or <body> - mount to normal elements instead." 12527 ); 12528 return this 12529 } 12530 12531 var options = this.$options; 12532 // resolve template/el and convert to render function 12533 if (!options.render) { 12534 var template = options.template; 12535 if (template) { 12536 if (typeof template === 'string') { 12537 if (template.charAt(0) === '#') { 12538 template = idToTemplate(template); 12539 /* istanbul ignore if */ 12540 if (process.env.NODE_ENV !== 'production' && !template) { 12541 warn( 12542 ("Template element not found or is empty: " + (options.template)), 12543 this 12544 ); 12545 } 12546 } 12547 } else if (template.nodeType) { 12548 template = template.innerHTML; 12549 } else { 12550 if (process.env.NODE_ENV !== 'production') { 12551 warn('invalid template option:' + template, this); 12552 } 12553 return this 12554 } 12555 } else if (el) { 12556 template = getOuterHTML(el); 12557 } 12558 if (template) { 12559 /* istanbul ignore if */ 12560 if (process.env.NODE_ENV !== 'production' && config.performance && mark) { 12561 mark('compile'); 12562 } 12563 12564 var ref = compileToFunctions(template, { 12565 outputSourceRange: process.env.NODE_ENV !== 'production', 12566 shouldDecodeNewlines: shouldDecodeNewlines, 12567 shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref, 12568 delimiters: options.delimiters, 12569 comments: options.comments 12570 }, this); 12571 var render = ref.render; 12572 var staticRenderFns = ref.staticRenderFns; 12573 options.render = render; 12574 options.staticRenderFns = staticRenderFns; 12575 12576 /* istanbul ignore if */ 12577 if (process.env.NODE_ENV !== 'production' && config.performance && mark) { 12578 mark('compile end'); 12579 measure(("vue " + (this._name) + " compile"), 'compile', 'compile end'); 12580 } 12581 } 12582 } 12583 return mount.call(this, el, hydrating) 12584}; 12585 12586/** 12587 * Get outerHTML of elements, taking care 12588 * of SVG elements in IE as well. 12589 */ 12590function getOuterHTML (el) { 12591 if (el.outerHTML) { 12592 return el.outerHTML 12593 } else { 12594 var container = document.createElement('div'); 12595 container.appendChild(el.cloneNode(true)); 12596 return container.innerHTML 12597 } 12598} 12599 12600Vue.compile = compileToFunctions; 12601 12602/* harmony default export */ __webpack_exports__["default"] = (Vue); 12603 12604/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1), __webpack_require__(3), __webpack_require__(15).setImmediate)) 12605 12606/***/ }), 12607/* 3 */
vendor: 5,012 bytes, lines 12608-12806
12608/***/ (function(module, exports) { 12609 12610var g; 12611 12612// This works in non-strict mode 12613g = (function() { 12614 return this; 12615})(); 12616 12617try { 12618 // This works if eval is allowed (see CSP) 12619 g = g || Function("return this")() || (1,eval)("this"); 12620} catch(e) { 12621 // This works if the window reference is available 12622 if(typeof window === "object") 12623 g = window; 12624} 12625 12626// g can still be undefined, but nothing to do about it... 12627// We return undefined, instead of nothing here, so it's 12628// easier to handle this case. if(!global) { ...} 12629 12630module.exports = g; 12631 12632 12633/***/ }), 12634/* 4 */ 12635/***/ (function(module, exports, __webpack_require__) { 12636 12637"use strict"; 12638/* WEBPACK VAR INJECTION */(function(process) { 12639 12640var utils = __webpack_require__(0); 12641var normalizeHeaderName = __webpack_require__(24); 12642 12643var DEFAULT_CONTENT_TYPE = { 12644 'Content-Type': 'application/x-www-form-urlencoded' 12645}; 12646 12647function setContentTypeIfUnset(headers, value) { 12648 if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { 12649 headers['Content-Type'] = value; 12650 } 12651} 12652 12653function getDefaultAdapter() { 12654 var adapter; 12655 if (typeof XMLHttpRequest !== 'undefined') { 12656 // For browsers use XHR adapter 12657 adapter = __webpack_require__(8); 12658 } else if (typeof process !== 'undefined') { 12659 // For node use HTTP adapter 12660 adapter = __webpack_require__(8); 12661 } 12662 return adapter; 12663} 12664 12665var defaults = { 12666 adapter: getDefaultAdapter(), 12667 12668 transformRequest: [function transformRequest(data, headers) { 12669 normalizeHeaderName(headers, 'Content-Type'); 12670 if (utils.isFormData(data) || 12671 utils.isArrayBuffer(data) || 12672 utils.isBuffer(data) || 12673 utils.isStream(data) || 12674 utils.isFile(data) || 12675 utils.isBlob(data) 12676 ) { 12677 return data; 12678 } 12679 if (utils.isArrayBufferView(data)) { 12680 return data.buffer; 12681 } 12682 if (utils.isURLSearchParams(data)) { 12683 setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); 12684 return data.toString(); 12685 } 12686 if (utils.isObject(data)) { 12687 setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); 12688 return JSON.stringify(data); 12689 } 12690 return data; 12691 }], 12692 12693 transformResponse: [function transformResponse(data) { 12694 /*eslint no-param-reassign:0*/ 12695 if (typeof data === 'string') { 12696 try { 12697 data = JSON.parse(data); 12698 } catch (e) { /* Ignore */ } 12699 } 12700 return data; 12701 }], 12702 12703 /** 12704 * A timeout in milliseconds to abort a request. If set to 0 (default) a 12705 * timeout is not created. 12706 */ 12707 timeout: 0, 12708 12709 xsrfCookieName: 'XSRF-TOKEN', 12710 xsrfHeaderName: 'X-XSRF-TOKEN', 12711 12712 maxContentLength: -1, 12713 12714 validateStatus: function validateStatus(status) { 12715 return status >= 200 && status < 300; 12716 } 12717}; 12718 12719defaults.headers = { 12720 common: { 12721 'Accept': 'application/json, text/plain, */*' 12722 } 12723}; 12724 12725utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { 12726 defaults.headers[method] = {}; 12727}); 12728 12729utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { 12730 defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); 12731}); 12732 12733module.exports = defaults; 12734 12735/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) 12736 12737/***/ }), 12738/* 5 */, 12739/* 6 */ 12740/***/ (function(module, exports, __webpack_require__) { 12741 12742module.exports = __webpack_require__(21); 12743 12744/***/ }), 12745/* 7 */ 12746/***/ (function(module, exports, __webpack_require__) { 12747 12748"use strict"; 12749 12750 12751module.exports = function bind(fn, thisArg) { 12752 return function wrap() { 12753 var args = new Array(arguments.length); 12754 for (var i = 0; i < args.length; i++) { 12755 args[i] = arguments[i]; 12756 } 12757 return fn.apply(thisArg, args); 12758 }; 12759}; 12760 12761 12762/***/ }), 12763/* 8 */ 12764/***/ (function(module, exports, __webpack_require__) { 12765 12766"use strict"; 12767 12768 12769var utils = __webpack_require__(0); 12770var settle = __webpack_require__(25); 12771var buildURL = __webpack_require__(27); 12772var parseHeaders = __webpack_require__(28); 12773var isURLSameOrigin = __webpack_require__(29); 12774var createError = __webpack_require__(9); 12775 12776module.exports = function xhrAdapter(config) { 12777 return new Promise(function dispatchXhrRequest(resolve, reject) { 12778 var requestData = config.data; 12779 var requestHeaders = config.headers; 12780 12781 if (utils.isFormData(requestData)) { 12782 delete requestHeaders['Content-Type']; // Let the browser set it 12783 } 12784 12785 var request = new XMLHttpRequest(); 12786 12787 // HTTP basic authentication 12788 if (config.auth) { 12789 var username = config.auth.username || ''; 12790 var password = config.auth.password || ''; 12791 requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); 12792 } 12793 12794 request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true); 12795 12796 // Set the request timeout in MS 12797 request.timeout = config.timeout; 12798 12799 // Listen for ready state 12800 request.onreadystatechange = function handleLoad() { 12801 if (!request || request.readyState !== 4) { 12802 return; 12803 } 12804 12805 // The request errored out and we didn't get a response, this will be 12806 // handled by onerror instead
vendor: 5,123 bytes, lines 12807-12988
12807 // With one exception: request that using file: protocol, most browsers 12808 // will return status as 0 even though it's a successful request 12809 if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { 12810 return; 12811 } 12812 12813 // Prepare the response 12814 var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; 12815 var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; 12816 var response = { 12817 data: responseData, 12818 status: request.status, 12819 statusText: request.statusText, 12820 headers: responseHeaders, 12821 config: config, 12822 request: request 12823 }; 12824 12825 settle(resolve, reject, response); 12826 12827 // Clean up request 12828 request = null; 12829 }; 12830 12831 // Handle low level network errors 12832 request.onerror = function handleError() { 12833 // Real errors are hidden from us by the browser 12834 // onerror should only fire if it's a network error 12835 reject(createError('Network Error', config, null, request)); 12836 12837 // Clean up request 12838 request = null; 12839 }; 12840 12841 // Handle timeout 12842 request.ontimeout = function handleTimeout() { 12843 reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', 12844 request)); 12845 12846 // Clean up request 12847 request = null; 12848 }; 12849 12850 // Add xsrf header 12851 // This is only done if running in a standard browser environment. 12852 // Specifically not if we're in a web worker, or react-native. 12853 if (utils.isStandardBrowserEnv()) { 12854 var cookies = __webpack_require__(30); 12855 12856 // Add xsrf header 12857 var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ? 12858 cookies.read(config.xsrfCookieName) : 12859 undefined; 12860 12861 if (xsrfValue) { 12862 requestHeaders[config.xsrfHeaderName] = xsrfValue; 12863 } 12864 } 12865 12866 // Add headers to the request 12867 if ('setRequestHeader' in request) { 12868 utils.forEach(requestHeaders, function setRequestHeader(val, key) { 12869 if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { 12870 // Remove Content-Type if data is undefined 12871 delete requestHeaders[key]; 12872 } else { 12873 // Otherwise add header to the request 12874 request.setRequestHeader(key, val); 12875 } 12876 }); 12877 } 12878 12879 // Add withCredentials to request if needed 12880 if (config.withCredentials) { 12881 request.withCredentials = true; 12882 } 12883 12884 // Add responseType to request if needed 12885 if (config.responseType) { 12886 try { 12887 request.responseType = config.responseType; 12888 } catch (e) { 12889 // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. 12890 // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. 12891 if (config.responseType !== 'json') { 12892 throw e; 12893 } 12894 } 12895 } 12896 12897 // Handle progress if needed 12898 if (typeof config.onDownloadProgress === 'function') { 12899 request.addEventListener('progress', config.onDownloadProgress); 12900 } 12901 12902 // Not all browsers support upload events 12903 if (typeof config.onUploadProgress === 'function' && request.upload) { 12904 request.upload.addEventListener('progress', config.onUploadProgress); 12905 } 12906 12907 if (config.cancelToken) { 12908 // Handle cancellation 12909 config.cancelToken.promise.then(function onCanceled(cancel) { 12910 if (!request) { 12911 return; 12912 } 12913 12914 request.abort(); 12915 reject(cancel); 12916 // Clean up request 12917 request = null; 12918 }); 12919 } 12920 12921 if (requestData === undefined) { 12922 requestData = null; 12923 } 12924 12925 // Send the request 12926 request.send(requestData); 12927 }); 12928}; 12929 12930 12931/***/ }), 12932/* 9 */ 12933/***/ (function(module, exports, __webpack_require__) { 12934 12935"use strict"; 12936 12937 12938var enhanceError = __webpack_require__(26); 12939 12940/** 12941 * Create an Error with the specified message, config, error code, request and response. 12942 * 12943 * @param {string} message The error message. 12944 * @param {Object} config The config. 12945 * @param {string} [code] The error code (for example, 'ECONNABORTED'). 12946 * @param {Object} [request] The request. 12947 * @param {Object} [response] The response. 12948 * @returns {Error} The created error. 12949 */ 12950module.exports = function createError(message, config, code, request, response) { 12951 var error = new Error(message); 12952 return enhanceError(error, config, code, request, response); 12953}; 12954 12955 12956/***/ }), 12957/* 10 */ 12958/***/ (function(module, exports, __webpack_require__) { 12959 12960"use strict"; 12961 12962 12963module.exports = function isCancel(value) { 12964 return !!(value && value.__CANCEL__); 12965}; 12966 12967 12968/***/ }), 12969/* 11 */ 12970/***/ (function(module, exports, __webpack_require__) { 12971 12972"use strict"; 12973 12974 12975/** 12976 * A `Cancel` is an object that is thrown when an operation is canceled. 12977 * 12978 * @class 12979 * @param {string=} message The message. 12980 */ 12981function Cancel(message) { 12982 this.message = message; 12983} 12984 12985Cancel.prototype.toString = function toString() { 12986 return 'Cancel' + (this.message ? ': ' + this.message : ''); 12987}; 12988
12989Cancel.prototype.__CANCEL__ = true; 12990 12991module.exports = Cancel; 12992 12993 12994/***/ }), 12995/* 12 */ 12996/***/ (function(module, exports, __webpack_require__) { 12997 12998"use strict"; 12999 13000var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 13001 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 13002 return new (P || (P = Promise))(function (resolve, reject) { 13003 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 13004 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 13005 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 13006 step((generator = generator.apply(thisArg, _arguments || [])).next()); 13007 }); 13008}; 13009var __generator = (this && this.__generator) || function (thisArg, body) { 13010 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 13011 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 13012 function verb(n) { return function (v) { return step([n, v]); }; } 13013 function step(op) { 13014 if (f) throw new TypeError("Generator is already executing."); 13015 while (_) try { 13016 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 13017 if (y = 0, t) op = [op[0] & 2, t.value]; 13018 switch (op[0]) { 13019 case 0: case 1: t = op; break; 13020 case 4: _.label++; return { value: op[1], done: false }; 13021 case 5: _.label++; y = op[1]; op = [0]; continue; 13022 case 7: op = _.ops.pop(); _.trys.pop(); continue; 13023 default: 13024 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 13025 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 13026 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 13027 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 13028 if (t[2]) _.ops.pop(); 13029 _.trys.pop(); continue; 13030 } 13031 op = body.call(thisArg, _); 13032 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 13033 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 13034 } 13035}; 13036Object.defineProperty(exports, "__esModule", { value: true }); 13037var recaptcha_v3_1 = __webpack_require__(38); 13038function VueReCaptcha(Vue, options) { 13039 var _this = this; 13040 var plugin = new ReCaptchaVuePlugin(); 13041 var recaptchaLoaded = false; 13042 var recaptchaError = null; 13043 var loadedWaiters = []; 13044 Vue.prototype.$recaptchaLoaded = function () { return new Promise(function (resolve, reject) { 13045 if (recaptchaError !== null) { 13046 return reject(recaptchaError); 13047 } 13048 if (recaptchaLoaded === true) { 13049 return resolve(true); 13050 } 13051 loadedWaiters.push({ resolve: resolve, reject: reject }); 13052 }); }; 13053 plugin.initializeReCaptcha(options).then(function (wrapper) { 13054 recaptchaLoaded = true; 13055 Vue.prototype.$recaptcha = function (action) { return __awaiter(_this, void 0, void 0, function () { 13056 return __generator(this, function (_a) { 13057 return [2, wrapper.execute(action)]; 13058 }); 13059 }); }; 13060 Vue.prototype.$recaptchaInstance = wrapper; 13061 loadedWaiters.forEach(function (v) { return v.resolve(true); }); 13062 }).catch(function (error) { 13063 recaptchaError = error; 13064 loadedWaiters.forEach(function (v) { return v.reject(error); }); 13065 }); 13066} 13067exports.VueReCaptcha = VueReCaptcha; 13068var ReCaptchaVuePlugin = (function () { 13069 function ReCaptchaVuePlugin() { 13070 } 13071 ReCaptchaVuePlugin.prototype.initializeReCaptcha = function (options) { 13072 return __awaiter(this, void 0, void 0, function () { 13073 return __generator(this, function (_a) { 13074 return [2, recaptcha_v3_1.load(options.siteKey, options.loaderOptions)]; 13075 }); 13076 }); 13077 }; 13078 return ReCaptchaVuePlugin; 13079}()); 13080 13081 13082/***/ }), 13083/* 13 */ 13084/***/ (function(module, exports, __webpack_require__) { 13085 13086"use strict"; 13087 13088var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 13089 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 13090 return new (P || (P = Promise))(function (resolve, reject) { 13091 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 13092 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 13093 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 13094 step((generator = generator.apply(thisArg, _arguments || [])).next()); 13095 }); 13096}; 13097var __generator = (this && this.__generator) || function (thisArg, body) { 13098 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; 13099 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 13100 function verb(n) { return function (v) { return step([n, v]); }; } 13101 function step(op) { 13102 if (f) throw new TypeError("Generator is already executing."); 13103 while (_) try {
vendor: 5,207 bytes, lines 13104-13246
13104 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 13105 if (y = 0, t) op = [op[0] & 2, t.value]; 13106 switch (op[0]) { 13107 case 0: case 1: t = op; break; 13108 case 4: _.label++; return { value: op[1], done: false }; 13109 case 5: _.label++; y = op[1]; op = [0]; continue; 13110 case 7: op = _.ops.pop(); _.trys.pop(); continue; 13111 default: 13112 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 13113 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 13114 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 13115 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 13116 if (t[2]) _.ops.pop(); 13117 _.trys.pop(); continue; 13118 } 13119 op = body.call(thisArg, _); 13120 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 13121 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 13122 } 13123}; 13124Object.defineProperty(exports, "__esModule", { value: true }); 13125var ReCaptchaInstance = (function () { 13126 function ReCaptchaInstance(siteKey, recaptchaID, recaptcha) { 13127 this.siteKey = siteKey; 13128 this.recaptchaID = recaptchaID; 13129 this.recaptcha = recaptcha; 13130 this.styleContainer = null; 13131 } 13132 ReCaptchaInstance.prototype.execute = function (action) { 13133 return __awaiter(this, void 0, void 0, function () { 13134 return __generator(this, function (_a) { 13135 return [2, this.recaptcha.execute(this.recaptchaID, { action: action })]; 13136 }); 13137 }); 13138 }; 13139 ReCaptchaInstance.prototype.getSiteKey = function () { 13140 return this.siteKey; 13141 }; 13142 ReCaptchaInstance.prototype.hideBadge = function () { 13143 if (this.styleContainer !== null) { 13144 return; 13145 } 13146 this.styleContainer = document.createElement('style'); 13147 this.styleContainer.innerHTML = '.grecaptcha-badge{display:none !important;}'; 13148 document.head.appendChild(this.styleContainer); 13149 }; 13150 ReCaptchaInstance.prototype.showBadge = function () { 13151 if (this.styleContainer === null) { 13152 return; 13153 } 13154 document.head.removeChild(this.styleContainer); 13155 this.styleContainer = null; 13156 }; 13157 return ReCaptchaInstance; 13158}()); 13159exports.ReCaptchaInstance = ReCaptchaInstance; 13160 13161 13162/***/ }), 13163/* 14 */, 13164/* 15 */ 13165/***/ (function(module, exports, __webpack_require__) { 13166 13167/* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) || 13168 (typeof self !== "undefined" && self) || 13169 window; 13170var apply = Function.prototype.apply; 13171 13172// DOM APIs, for completeness 13173 13174exports.setTimeout = function() { 13175 return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout); 13176}; 13177exports.setInterval = function() { 13178 return new Timeout(apply.call(setInterval, scope, arguments), clearInterval); 13179}; 13180exports.clearTimeout = 13181exports.clearInterval = function(timeout) { 13182 if (timeout) { 13183 timeout.close(); 13184 } 13185}; 13186 13187function Timeout(id, clearFn) { 13188 this._id = id; 13189 this._clearFn = clearFn; 13190} 13191Timeout.prototype.unref = Timeout.prototype.ref = function() {}; 13192Timeout.prototype.close = function() { 13193 this._clearFn.call(scope, this._id); 13194}; 13195 13196// Does not start the time, just sets up the members needed. 13197exports.enroll = function(item, msecs) { 13198 clearTimeout(item._idleTimeoutId); 13199 item._idleTimeout = msecs; 13200}; 13201 13202exports.unenroll = function(item) { 13203 clearTimeout(item._idleTimeoutId); 13204 item._idleTimeout = -1; 13205}; 13206 13207exports._unrefActive = exports.active = function(item) { 13208 clearTimeout(item._idleTimeoutId); 13209 13210 var msecs = item._idleTimeout; 13211 if (msecs >= 0) { 13212 item._idleTimeoutId = setTimeout(function onTimeout() { 13213 if (item._onTimeout) 13214 item._onTimeout(); 13215 }, msecs); 13216 } 13217}; 13218 13219// setimmediate attaches itself to the global object 13220__webpack_require__(16); 13221// On some exotic environments, it's not clear which object `setimmediate` was 13222// able to install onto. Search each possibility in the same order as the 13223// `setimmediate` library. 13224exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) || 13225 (typeof global !== "undefined" && global.setImmediate) || 13226 (this && this.setImmediate); 13227exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) || 13228 (typeof global !== "undefined" && global.clearImmediate) || 13229 (this && this.clearImmediate); 13230 13231/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) 13232 13233/***/ }), 13234/* 16 */ 13235/***/ (function(module, exports, __webpack_require__) { 13236 13237/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) { 13238 "use strict"; 13239 13240 if (global.setImmediate) { 13241 return; 13242 } 13243 13244 var nextHandle = 1; // Spec says greater than zero 13245 var tasksByHandle = {}; 13246 var currentlyRunningATask = false;
vendor: 5,701 bytes, lines 13247-13407
13247 var doc = global.document; 13248 var registerImmediate; 13249 13250 function setImmediate(callback) { 13251 // Callback can either be a function or a string 13252 if (typeof callback !== "function") { 13253 callback = new Function("" + callback); 13254 } 13255 // Copy function arguments 13256 var args = new Array(arguments.length - 1); 13257 for (var i = 0; i < args.length; i++) { 13258 args[i] = arguments[i + 1]; 13259 } 13260 // Store and register the task 13261 var task = { callback: callback, args: args }; 13262 tasksByHandle[nextHandle] = task; 13263 registerImmediate(nextHandle); 13264 return nextHandle++; 13265 } 13266 13267 function clearImmediate(handle) { 13268 delete tasksByHandle[handle]; 13269 } 13270 13271 function run(task) { 13272 var callback = task.callback; 13273 var args = task.args; 13274 switch (args.length) { 13275 case 0: 13276 callback(); 13277 break; 13278 case 1: 13279 callback(args[0]); 13280 break; 13281 case 2: 13282 callback(args[0], args[1]); 13283 break; 13284 case 3: 13285 callback(args[0], args[1], args[2]); 13286 break; 13287 default: 13288 callback.apply(undefined, args); 13289 break; 13290 } 13291 } 13292 13293 function runIfPresent(handle) { 13294 // From the spec: "Wait until any invocations of this algorithm started before this one have completed." 13295 // So if we're currently running a task, we'll need to delay this invocation. 13296 if (currentlyRunningATask) { 13297 // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a 13298 // "too much recursion" error. 13299 setTimeout(runIfPresent, 0, handle); 13300 } else { 13301 var task = tasksByHandle[handle]; 13302 if (task) { 13303 currentlyRunningATask = true; 13304 try { 13305 run(task); 13306 } finally { 13307 clearImmediate(handle); 13308 currentlyRunningATask = false; 13309 } 13310 } 13311 } 13312 } 13313 13314 function installNextTickImplementation() { 13315 registerImmediate = function(handle) { 13316 process.nextTick(function () { runIfPresent(handle); }); 13317 }; 13318 } 13319 13320 function canUsePostMessage() { 13321 // The test against `importScripts` prevents this implementation from being installed inside a web worker, 13322 // where `global.postMessage` means something completely different and can't be used for this purpose. 13323 if (global.postMessage && !global.importScripts) { 13324 var postMessageIsAsynchronous = true; 13325 var oldOnMessage = global.onmessage; 13326 global.onmessage = function() { 13327 postMessageIsAsynchronous = false; 13328 }; 13329 global.postMessage("", "*"); 13330 global.onmessage = oldOnMessage; 13331 return postMessageIsAsynchronous; 13332 } 13333 } 13334 13335 function installPostMessageImplementation() { 13336 // Installs an event handler on `global` for the `message` event: see 13337 // * https://developer.mozilla.org/en/DOM/window.postMessage 13338 // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages 13339 13340 var messagePrefix = "setImmediate$" + Math.random() + "$"; 13341 var onGlobalMessage = function(event) { 13342 if (event.source === global && 13343 typeof event.data === "string" && 13344 event.data.indexOf(messagePrefix) === 0) { 13345 runIfPresent(+event.data.slice(messagePrefix.length)); 13346 } 13347 }; 13348 13349 if (global.addEventListener) { 13350 global.addEventListener("message", onGlobalMessage, false); 13351 } else { 13352 global.attachEvent("onmessage", onGlobalMessage); 13353 } 13354 13355 registerImmediate = function(handle) { 13356 global.postMessage(messagePrefix + handle, "*"); 13357 }; 13358 } 13359 13360 function installMessageChannelImplementation() { 13361 var channel = new MessageChannel(); 13362 channel.port1.onmessage = function(event) { 13363 var handle = event.data; 13364 runIfPresent(handle); 13365 }; 13366 13367 registerImmediate = function(handle) { 13368 channel.port2.postMessage(handle); 13369 }; 13370 } 13371 13372 function installReadyStateChangeImplementation() { 13373 var html = doc.documentElement; 13374 registerImmediate = function(handle) { 13375 // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted 13376 // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called. 13377 var script = doc.createElement("script"); 13378 script.onreadystatechange = function () { 13379 runIfPresent(handle); 13380 script.onreadystatechange = null; 13381 html.removeChild(script); 13382 script = null; 13383 }; 13384 html.appendChild(script); 13385 }; 13386 } 13387 13388 function installSetTimeoutImplementation() { 13389 registerImmediate = function(handle) { 13390 setTimeout(runIfPresent, 0, handle); 13391 }; 13392 } 13393 13394 // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live. 13395 var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global); 13396 attachTo = attachTo && attachTo.setTimeout ? attachTo : global; 13397 13398 // Don't get fooled by e.g. browserify environments. 13399 if ({}.toString.call(global.process) === "[object process]") { 13400 // For Node.js before 0.9 13401 installNextTickImplementation(); 13402 13403 } else if (canUsePostMessage()) { 13404 // For non-IE10 modern browsers 13405 installPostMessageImplementation(); 13406 13407 }
vendor: 5,758 bytes, lines 13407-13630
13407 else if (global.MessageChannel) { 13408 // For web workers, where supported 13409 installMessageChannelImplementation(); 13410 13411 } else if (doc && "onreadystatechange" in doc.createElement("script")) { 13412 // For IE 6–8 13413 installReadyStateChangeImplementation(); 13414 13415 } else { 13416 // For older browsers 13417 installSetTimeoutImplementation(); 13418 } 13419 13420 attachTo.setImmediate = setImmediate; 13421 attachTo.clearImmediate = clearImmediate; 13422}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self)); 13423 13424/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3), __webpack_require__(1))) 13425 13426/***/ }), 13427/* 17 */, 13428/* 18 */, 13429/* 19 */ 13430/***/ (function(module, exports) { 13431 13432/** 13433 * Translates the list format produced by css-loader into something 13434 * easier to manipulate. 13435 */ 13436module.exports = function listToStyles (parentId, list) { 13437 var styles = [] 13438 var newStyles = {} 13439 for (var i = 0; i < list.length; i++) { 13440 var item = list[i] 13441 var id = item[0] 13442 var css = item[1] 13443 var media = item[2] 13444 var sourceMap = item[3] 13445 var part = { 13446 id: parentId + ':' + i, 13447 css: css, 13448 media: media, 13449 sourceMap: sourceMap 13450 } 13451 if (!newStyles[id]) { 13452 styles.push(newStyles[id] = { id: id, parts: [part] }) 13453 } else { 13454 newStyles[id].parts.push(part) 13455 } 13456 } 13457 return styles 13458} 13459 13460 13461/***/ }), 13462/* 20 */ 13463/***/ (function(module, exports) { 13464 13465/* globals __VUE_SSR_CONTEXT__ */ 13466 13467// IMPORTANT: Do NOT use ES2015 features in this file. 13468// This module is a runtime utility for cleaner component module output and will 13469// be included in the final webpack user bundle. 13470 13471module.exports = function normalizeComponent ( 13472 rawScriptExports, 13473 compiledTemplate, 13474 functionalTemplate, 13475 injectStyles, 13476 scopeId, 13477 moduleIdentifier /* server only */ 13478) { 13479 var esModule 13480 var scriptExports = rawScriptExports = rawScriptExports || {} 13481 13482 // ES6 modules interop 13483 var type = typeof rawScriptExports.default 13484 if (type === 'object' || type === 'function') { 13485 esModule = rawScriptExports 13486 scriptExports = rawScriptExports.default 13487 } 13488 13489 // Vue.extend constructor export interop 13490 var options = typeof scriptExports === 'function' 13491 ? scriptExports.options 13492 : scriptExports 13493 13494 // render functions 13495 if (compiledTemplate) { 13496 options.render = compiledTemplate.render 13497 options.staticRenderFns = compiledTemplate.staticRenderFns 13498 options._compiled = true 13499 } 13500 13501 // functional template 13502 if (functionalTemplate) { 13503 options.functional = true 13504 } 13505 13506 // scopedId 13507 if (scopeId) { 13508 options._scopeId = scopeId 13509 } 13510 13511 var hook 13512 if (moduleIdentifier) { // server build 13513 hook = function (context) { 13514 // 2.3 injection 13515 context = 13516 context || // cached call 13517 (this.$vnode && this.$vnode.ssrContext) || // stateful 13518 (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional 13519 // 2.2 with runInNewContext: true 13520 if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { 13521 context = __VUE_SSR_CONTEXT__ 13522 } 13523 // inject component styles 13524 if (injectStyles) { 13525 injectStyles.call(this, context) 13526 } 13527 // register component module identifier for async chunk inferrence 13528 if (context && context._registeredComponents) { 13529 context._registeredComponents.add(moduleIdentifier) 13530 } 13531 } 13532 // used by ssr in case component is cached and beforeCreate 13533 // never gets called 13534 options._ssrRegister = hook 13535 } else if (injectStyles) { 13536 hook = injectStyles 13537 } 13538 13539 if (hook) { 13540 var functional = options.functional 13541 var existing = functional 13542 ? options.render 13543 : options.beforeCreate 13544 13545 if (!functional) { 13546 // inject component registration as beforeCreate hook 13547 options.beforeCreate = existing 13548 ? [].concat(existing, hook) 13549 : [hook] 13550 } else { 13551 // for template-only hot-reload because in that case the render fn doesn't 13552 // go through the normalizer 13553 options._injectStyles = hook 13554 // register for functioal component in vue file 13555 options.render = function renderWithStyleInjection (h, context) { 13556 hook.call(context) 13557 return existing(h, context) 13558 } 13559 } 13560 } 13561 13562 return { 13563 esModule: esModule, 13564 exports: scriptExports, 13565 options: options 13566 } 13567} 13568 13569 13570/***/ }), 13571/* 21 */ 13572/***/ (function(module, exports, __webpack_require__) { 13573 13574"use strict"; 13575 13576 13577var utils = __webpack_require__(0); 13578var bind = __webpack_require__(7); 13579var Axios = __webpack_require__(23); 13580var defaults = __webpack_require__(4); 13581 13582/** 13583 * Create an instance of Axios 13584 * 13585 * @param {Object} defaultConfig The default config for the instance 13586 * @return {Axios} A new instance of Axios 13587 */ 13588function createInstance(defaultConfig) { 13589 var context = new Axios(defaultConfig); 13590 var instance = bind(Axios.prototype.request, context); 13591 13592 // Copy axios.prototype to instance 13593 utils.extend(instance, Axios.prototype, context); 13594 13595 // Copy context to instance 13596 utils.extend(instance, context); 13597 13598 return instance; 13599} 13600 13601// Create the default instance to be exported 13602var axios = createInstance(defaults); 13603 13604// Expose Axios class to allow class inheritance 13605axios.Axios = Axios; 13606 13607// Factory for creating new instances 13608axios.create = function create(instanceConfig) { 13609 return createInstance(utils.merge(defaults, instanceConfig)); 13610}; 13611 13612// Expose Cancel & CancelToken 13613axios.Cancel = __webpack_require__(11); 13614axios.CancelToken = __webpack_require__(36); 13615axios.isCancel = __webpack_require__(10); 13616 13617// Expose all/spread 13618axios.all = function all(promises) { 13619 return Promise.all(promises); 13620}; 13621axios.spread = __webpack_require__(37); 13622 13623module.exports = axios; 13624 13625// Allow use of default import syntax in TypeScript 13626module.exports.default = axios; 13627 13628 13629/***/ }), 13630/* 22 */
vendor: 4,915 bytes, lines 13631-13832
13631/***/ (function(module, exports) { 13632 13633/*! 13634 * Determine if an object is a Buffer 13635 * 13636 * @author Feross Aboukhadijeh <https://feross.org> 13637 * @license MIT 13638 */ 13639 13640module.exports = function isBuffer (obj) { 13641 return obj != null && obj.constructor != null && 13642 typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) 13643} 13644 13645 13646/***/ }), 13647/* 23 */ 13648/***/ (function(module, exports, __webpack_require__) { 13649 13650"use strict"; 13651 13652 13653var defaults = __webpack_require__(4); 13654var utils = __webpack_require__(0); 13655var InterceptorManager = __webpack_require__(31); 13656var dispatchRequest = __webpack_require__(32); 13657 13658/** 13659 * Create a new instance of Axios 13660 * 13661 * @param {Object} instanceConfig The default config for the instance 13662 */ 13663function Axios(instanceConfig) { 13664 this.defaults = instanceConfig; 13665 this.interceptors = { 13666 request: new InterceptorManager(), 13667 response: new InterceptorManager() 13668 }; 13669} 13670 13671/** 13672 * Dispatch a request 13673 * 13674 * @param {Object} config The config specific for this request (merged with this.defaults) 13675 */ 13676Axios.prototype.request = function request(config) { 13677 /*eslint no-param-reassign:0*/ 13678 // Allow for axios('example/url'[, config]) a la fetch API 13679 if (typeof config === 'string') { 13680 config = utils.merge({ 13681 url: arguments[0] 13682 }, arguments[1]); 13683 } 13684 13685 config = utils.merge(defaults, {method: 'get'}, this.defaults, config); 13686 config.method = config.method.toLowerCase(); 13687 13688 // Hook up interceptors middleware 13689 var chain = [dispatchRequest, undefined]; 13690 var promise = Promise.resolve(config); 13691 13692 this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { 13693 chain.unshift(interceptor.fulfilled, interceptor.rejected); 13694 }); 13695 13696 this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { 13697 chain.push(interceptor.fulfilled, interceptor.rejected); 13698 }); 13699 13700 while (chain.length) { 13701 promise = promise.then(chain.shift(), chain.shift()); 13702 } 13703 13704 return promise; 13705}; 13706 13707// Provide aliases for supported request methods 13708utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { 13709 /*eslint func-names:0*/ 13710 Axios.prototype[method] = function(url, config) { 13711 return this.request(utils.merge(config || {}, { 13712 method: method, 13713 url: url 13714 })); 13715 }; 13716}); 13717 13718utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { 13719 /*eslint func-names:0*/ 13720 Axios.prototype[method] = function(url, data, config) { 13721 return this.request(utils.merge(config || {}, { 13722 method: method, 13723 url: url, 13724 data: data 13725 })); 13726 }; 13727}); 13728 13729module.exports = Axios; 13730 13731 13732/***/ }), 13733/* 24 */ 13734/***/ (function(module, exports, __webpack_require__) { 13735 13736"use strict"; 13737 13738 13739var utils = __webpack_require__(0); 13740 13741module.exports = function normalizeHeaderName(headers, normalizedName) { 13742 utils.forEach(headers, function processHeader(value, name) { 13743 if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { 13744 headers[normalizedName] = value; 13745 delete headers[name]; 13746 } 13747 }); 13748}; 13749 13750 13751/***/ }), 13752/* 25 */ 13753/***/ (function(module, exports, __webpack_require__) { 13754 13755"use strict"; 13756 13757 13758var createError = __webpack_require__(9); 13759 13760/** 13761 * Resolve or reject a Promise based on response status. 13762 * 13763 * @param {Function} resolve A function that resolves the promise. 13764 * @param {Function} reject A function that rejects the promise. 13765 * @param {object} response The response. 13766 */ 13767module.exports = function settle(resolve, reject, response) { 13768 var validateStatus = response.config.validateStatus; 13769 // Note: status is not exposed by XDomainRequest 13770 if (!response.status || !validateStatus || validateStatus(response.status)) { 13771 resolve(response); 13772 } else { 13773 reject(createError( 13774 'Request failed with status code ' + response.status, 13775 response.config, 13776 null, 13777 response.request, 13778 response 13779 )); 13780 } 13781}; 13782 13783 13784/***/ }), 13785/* 26 */ 13786/***/ (function(module, exports, __webpack_require__) { 13787 13788"use strict"; 13789 13790 13791/** 13792 * Update an Error with the specified config, error code, and response. 13793 * 13794 * @param {Error} error The error to update. 13795 * @param {Object} config The config. 13796 * @param {string} [code] The error code (for example, 'ECONNABORTED'). 13797 * @param {Object} [request] The request. 13798 * @param {Object} [response] The response. 13799 * @returns {Error} The error. 13800 */ 13801module.exports = function enhanceError(error, config, code, request, response) { 13802 error.config = config; 13803 if (code) { 13804 error.code = code; 13805 } 13806 error.request = request; 13807 error.response = response; 13808 return error; 13809}; 13810 13811 13812/***/ }), 13813/* 27 */ 13814/***/ (function(module, exports, __webpack_require__) { 13815 13816"use strict"; 13817 13818 13819var utils = __webpack_require__(0); 13820 13821function encode(val) { 13822 return encodeURIComponent(val). 13823 replace(/%40/gi, '@'). 13824 replace(/%3A/gi, ':'). 13825 replace(/%24/g, '$'). 13826 replace(/%2C/gi, ','). 13827 replace(/%20/g, '+'). 13828 replace(/%5B/gi, '['). 13829 replace(/%5D/gi, ']'); 13830} 13831 13832/**
vendor: 7,673 bytes, lines 13833-14128
13833 * Build a URL by appending params to the end 13834 * 13835 * @param {string} url The base of the url (e.g., http://www.google.com) 13836 * @param {object} [params] The params to be appended 13837 * @returns {string} The formatted url 13838 */ 13839module.exports = function buildURL(url, params, paramsSerializer) { 13840 /*eslint no-param-reassign:0*/ 13841 if (!params) { 13842 return url; 13843 } 13844 13845 var serializedParams; 13846 if (paramsSerializer) { 13847 serializedParams = paramsSerializer(params); 13848 } else if (utils.isURLSearchParams(params)) { 13849 serializedParams = params.toString(); 13850 } else { 13851 var parts = []; 13852 13853 utils.forEach(params, function serialize(val, key) { 13854 if (val === null || typeof val === 'undefined') { 13855 return; 13856 } 13857 13858 if (utils.isArray(val)) { 13859 key = key + '[]'; 13860 } else { 13861 val = [val]; 13862 } 13863 13864 utils.forEach(val, function parseValue(v) { 13865 if (utils.isDate(v)) { 13866 v = v.toISOString(); 13867 } else if (utils.isObject(v)) { 13868 v = JSON.stringify(v); 13869 } 13870 parts.push(encode(key) + '=' + encode(v)); 13871 }); 13872 }); 13873 13874 serializedParams = parts.join('&'); 13875 } 13876 13877 if (serializedParams) { 13878 url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; 13879 } 13880 13881 return url; 13882}; 13883 13884 13885/***/ }), 13886/* 28 */ 13887/***/ (function(module, exports, __webpack_require__) { 13888 13889"use strict"; 13890 13891 13892var utils = __webpack_require__(0); 13893 13894// Headers whose duplicates are ignored by node 13895// c.f. https://nodejs.org/api/http.html#http_message_headers 13896var ignoreDuplicateOf = [ 13897 'age', 'authorization', 'content-length', 'content-type', 'etag', 13898 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 13899 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 13900 'referer', 'retry-after', 'user-agent' 13901]; 13902 13903/** 13904 * Parse headers into an object 13905 * 13906 * ``` 13907 * Date: Wed, 27 Aug 2014 08:58:49 GMT 13908 * Content-Type: application/json 13909 * Connection: keep-alive 13910 * Transfer-Encoding: chunked 13911 * ``` 13912 * 13913 * @param {String} headers Headers needing to be parsed 13914 * @returns {Object} Headers parsed into an object 13915 */ 13916module.exports = function parseHeaders(headers) { 13917 var parsed = {}; 13918 var key; 13919 var val; 13920 var i; 13921 13922 if (!headers) { return parsed; } 13923 13924 utils.forEach(headers.split('\n'), function parser(line) { 13925 i = line.indexOf(':'); 13926 key = utils.trim(line.substr(0, i)).toLowerCase(); 13927 val = utils.trim(line.substr(i + 1)); 13928 13929 if (key) { 13930 if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { 13931 return; 13932 } 13933 if (key === 'set-cookie') { 13934 parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); 13935 } else { 13936 parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; 13937 } 13938 } 13939 }); 13940 13941 return parsed; 13942}; 13943 13944 13945/***/ }), 13946/* 29 */ 13947/***/ (function(module, exports, __webpack_require__) { 13948 13949"use strict"; 13950 13951 13952var utils = __webpack_require__(0); 13953 13954module.exports = ( 13955 utils.isStandardBrowserEnv() ? 13956 13957 // Standard browser envs have full support of the APIs needed to test 13958 // whether the request URL is of the same origin as current location. 13959 (function standardBrowserEnv() { 13960 var msie = /(msie|trident)/i.test(navigator.userAgent); 13961 var urlParsingNode = document.createElement('a'); 13962 var originURL; 13963 13964 /** 13965 * Parse a URL to discover it's components 13966 * 13967 * @param {String} url The URL to be parsed 13968 * @returns {Object} 13969 */ 13970 function resolveURL(url) { 13971 var href = url; 13972 13973 if (msie) { 13974 // IE needs attribute set twice to normalize properties 13975 urlParsingNode.setAttribute('href', href); 13976 href = urlParsingNode.href; 13977 } 13978 13979 urlParsingNode.setAttribute('href', href); 13980 13981 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils 13982 return { 13983 href: urlParsingNode.href, 13984 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', 13985 host: urlParsingNode.host, 13986 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', 13987 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', 13988 hostname: urlParsingNode.hostname, 13989 port: urlParsingNode.port, 13990 pathname: (urlParsingNode.pathname.charAt(0) === '/') ? 13991 urlParsingNode.pathname : 13992 '/' + urlParsingNode.pathname 13993 }; 13994 } 13995 13996 originURL = resolveURL(window.location.href); 13997 13998 /** 13999 * Determine if a URL shares the same origin as the current location 14000 * 14001 * @param {String} requestURL The URL to test 14002 * @returns {boolean} True if URL shares the same origin, otherwise false 14003 */ 14004 return function isURLSameOrigin(requestURL) { 14005 var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; 14006 return (parsed.protocol === originURL.protocol && 14007 parsed.host === originURL.host); 14008 }; 14009 })() : 14010 14011 // Non standard browser envs (web workers, react-native) lack needed support. 14012 (function nonStandardBrowserEnv() { 14013 return function isURLSameOrigin() { 14014 return true; 14015 }; 14016 })() 14017); 14018 14019 14020/***/ }), 14021/* 30 */ 14022/***/ (function(module, exports, __webpack_require__) { 14023 14024"use strict"; 14025 14026 14027var utils = __webpack_require__(0); 14028 14029module.exports = ( 14030 utils.isStandardBrowserEnv() ? 14031 14032 // Standard browser envs support document.cookie 14033 (function standardBrowserEnv() { 14034 return { 14035 write: function write(name, value, expires, path, domain, secure) { 14036 var cookie = []; 14037 cookie.push(name + '=' + encodeURIComponent(value)); 14038 14039 if (utils.isNumber(expires)) { 14040 cookie.push('expires=' + new Date(expires).toGMTString()); 14041 } 14042 14043 if (utils.isString(path)) { 14044 cookie.push('path=' + path); 14045 } 14046 14047 if (utils.isString(domain)) { 14048 cookie.push('domain=' + domain); 14049 } 14050 14051 if (secure === true) { 14052 cookie.push('secure'); 14053 } 14054 14055 document.cookie = cookie.join('; '); 14056 }, 14057 14058 read: function read(name) { 14059 var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); 14060 return (match ? decodeURIComponent(match[3]) : null); 14061 }, 14062 14063 remove: function remove(name) { 14064 this.write(name, '', Date.now() - 86400000); 14065 } 14066 }; 14067 })() : 14068 14069 // Non standard browser env (web workers, react-native) lack needed support. 14070 (function nonStandardBrowserEnv() { 14071 return { 14072 write: function write() {}, 14073 read: function read() { return null; }, 14074 remove: function remove() {} 14075 }; 14076 })() 14077); 14078 14079 14080/***/ }), 14081/* 31 */ 14082/***/ (function(module, exports, __webpack_require__) { 14083 14084"use strict"; 14085 14086 14087var utils = __webpack_require__(0); 14088 14089function InterceptorManager() { 14090 this.handlers = []; 14091} 14092 14093/** 14094 * Add a new interceptor to the stack 14095 * 14096 * @param {Function} fulfilled The function to handle `then` for a `Promise` 14097 * @param {Function} rejected The function to handle `reject` for a `Promise` 14098 * 14099 * @return {Number} An ID used to remove interceptor later 14100 */ 14101InterceptorManager.prototype.use = function use(fulfilled, rejected) { 14102 this.handlers.push({ 14103 fulfilled: fulfilled, 14104 rejected: rejected 14105 }); 14106 return this.handlers.length - 1; 14107}; 14108 14109/** 14110 * Remove an interceptor from the stack 14111 * 14112 * @param {Number} id The ID that was returned by `use` 14113 */ 14114InterceptorManager.prototype.eject = function eject(id) { 14115 if (this.handlers[id]) { 14116 this.handlers[id] = null; 14117 } 14118}; 14119 14120/** 14121 * Iterate over all the registered interceptors 14122 * 14123 * This method is particularly useful for skipping over any 14124 * interceptors that may have become `null` calling `eject`. 14125 * 14126 * @param {Function} fn The function to call for each interceptor 14127 */ 14128InterceptorManager.prototype.forEach = function forEach(fn) {
vendor: 5,757 bytes, lines 14129-14379
14129 utils.forEach(this.handlers, function forEachHandler(h) { 14130 if (h !== null) { 14131 fn(h); 14132 } 14133 }); 14134}; 14135 14136module.exports = InterceptorManager; 14137 14138 14139/***/ }), 14140/* 32 */ 14141/***/ (function(module, exports, __webpack_require__) { 14142 14143"use strict"; 14144 14145 14146var utils = __webpack_require__(0); 14147var transformData = __webpack_require__(33); 14148var isCancel = __webpack_require__(10); 14149var defaults = __webpack_require__(4); 14150var isAbsoluteURL = __webpack_require__(34); 14151var combineURLs = __webpack_require__(35); 14152 14153/** 14154 * Throws a `Cancel` if cancellation has been requested. 14155 */ 14156function throwIfCancellationRequested(config) { 14157 if (config.cancelToken) { 14158 config.cancelToken.throwIfRequested(); 14159 } 14160} 14161 14162/** 14163 * Dispatch a request to the server using the configured adapter. 14164 * 14165 * @param {object} config The config that is to be used for the request 14166 * @returns {Promise} The Promise to be fulfilled 14167 */ 14168module.exports = function dispatchRequest(config) { 14169 throwIfCancellationRequested(config); 14170 14171 // Support baseURL config 14172 if (config.baseURL && !isAbsoluteURL(config.url)) { 14173 config.url = combineURLs(config.baseURL, config.url); 14174 } 14175 14176 // Ensure headers exist 14177 config.headers = config.headers || {}; 14178 14179 // Transform request data 14180 config.data = transformData( 14181 config.data, 14182 config.headers, 14183 config.transformRequest 14184 ); 14185 14186 // Flatten headers 14187 config.headers = utils.merge( 14188 config.headers.common || {}, 14189 config.headers[config.method] || {}, 14190 config.headers || {} 14191 ); 14192 14193 utils.forEach( 14194 ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], 14195 function cleanHeaderConfig(method) { 14196 delete config.headers[method]; 14197 } 14198 ); 14199 14200 var adapter = config.adapter || defaults.adapter; 14201 14202 return adapter(config).then(function onAdapterResolution(response) { 14203 throwIfCancellationRequested(config); 14204 14205 // Transform response data 14206 response.data = transformData( 14207 response.data, 14208 response.headers, 14209 config.transformResponse 14210 ); 14211 14212 return response; 14213 }, function onAdapterRejection(reason) { 14214 if (!isCancel(reason)) { 14215 throwIfCancellationRequested(config); 14216 14217 // Transform response data 14218 if (reason && reason.response) { 14219 reason.response.data = transformData( 14220 reason.response.data, 14221 reason.response.headers, 14222 config.transformResponse 14223 ); 14224 } 14225 } 14226 14227 return Promise.reject(reason); 14228 }); 14229}; 14230 14231 14232/***/ }), 14233/* 33 */ 14234/***/ (function(module, exports, __webpack_require__) { 14235 14236"use strict"; 14237 14238 14239var utils = __webpack_require__(0); 14240 14241/** 14242 * Transform the data for a request or a response 14243 * 14244 * @param {Object|String} data The data to be transformed 14245 * @param {Array} headers The headers for the request or response 14246 * @param {Array|Function} fns A single function or Array of functions 14247 * @returns {*} The resulting transformed data 14248 */ 14249module.exports = function transformData(data, headers, fns) { 14250 /*eslint no-param-reassign:0*/ 14251 utils.forEach(fns, function transform(fn) { 14252 data = fn(data, headers); 14253 }); 14254 14255 return data; 14256}; 14257 14258 14259/***/ }), 14260/* 34 */ 14261/***/ (function(module, exports, __webpack_require__) { 14262 14263"use strict"; 14264 14265 14266/** 14267 * Determines whether the specified URL is absolute 14268 * 14269 * @param {string} url The URL to test 14270 * @returns {boolean} True if the specified URL is absolute, otherwise false 14271 */ 14272module.exports = function isAbsoluteURL(url) { 14273 // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). 14274 // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed 14275 // by any combination of letters, digits, plus, period, or hyphen. 14276 return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); 14277}; 14278 14279 14280/***/ }), 14281/* 35 */ 14282/***/ (function(module, exports, __webpack_require__) { 14283 14284"use strict"; 14285 14286 14287/** 14288 * Creates a new URL by combining the specified URLs 14289 * 14290 * @param {string} baseURL The base URL 14291 * @param {string} relativeURL The relative URL 14292 * @returns {string} The combined URL 14293 */ 14294module.exports = function combineURLs(baseURL, relativeURL) { 14295 return relativeURL 14296 ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') 14297 : baseURL; 14298}; 14299 14300 14301/***/ }), 14302/* 36 */ 14303/***/ (function(module, exports, __webpack_require__) { 14304 14305"use strict"; 14306 14307 14308var Cancel = __webpack_require__(11); 14309 14310/** 14311 * A `CancelToken` is an object that can be used to request cancellation of an operation. 14312 * 14313 * @class 14314 * @param {Function} executor The executor function. 14315 */ 14316function CancelToken(executor) { 14317 if (typeof executor !== 'function') { 14318 throw new TypeError('executor must be a function.'); 14319 } 14320 14321 var resolvePromise; 14322 this.promise = new Promise(function promiseExecutor(resolve) { 14323 resolvePromise = resolve; 14324 }); 14325 14326 var token = this; 14327 executor(function cancel(message) { 14328 if (token.reason) { 14329 // Cancellation has already been requested 14330 return; 14331 } 14332 14333 token.reason = new Cancel(message); 14334 resolvePromise(token.reason); 14335 }); 14336} 14337 14338/** 14339 * Throws a `Cancel` if cancellation has been requested. 14340 */ 14341CancelToken.prototype.throwIfRequested = function throwIfRequested() { 14342 if (this.reason) { 14343 throw this.reason; 14344 } 14345}; 14346 14347/** 14348 * Returns an object that contains a new `CancelToken` and a function that, when called, 14349 * cancels the `CancelToken`. 14350 */ 14351CancelToken.source = function source() { 14352 var cancel; 14353 var token = new CancelToken(function executor(c) { 14354 cancel = c; 14355 }); 14356 return { 14357 token: token, 14358 cancel: cancel 14359 }; 14360}; 14361 14362module.exports = CancelToken; 14363 14364 14365/***/ }), 14366/* 37 */ 14367/***/ (function(module, exports, __webpack_require__) { 14368 14369"use strict"; 14370 14371 14372/** 14373 * Syntactic sugar for invoking a function and expanding an array for arguments. 14374 * 14375 * Common use case would be to use `Function.prototype.apply`. 14376 * 14377 * ```js 14378 * function f(x, y, z) {} 14379 * var args = [1, 2, 3];
14380 * f.apply(null, args); 14381 * ``` 14382 * 14383 * With `spread` this example can be re-written. 14384 * 14385 * ```js 14386 * spread(function(x, y, z) {})([1, 2, 3]); 14387 * ``` 14388 * 14389 * @param {Function} callback 14390 * @returns {Function} 14391 */ 14392module.exports = function spread(callback) { 14393 return function wrap(arr) { 14394 return callback.apply(null, arr); 14395 }; 14396}; 14397 14398 14399/***/ }), 14400/* 38 */ 14401/***/ (function(module, exports, __webpack_require__) { 14402 14403"use strict"; 14404 14405Object.defineProperty(exports, "__esModule", { value: true }); 14406var ReCaptchaLoader_1 = __webpack_require__(39); 14407exports.load = ReCaptchaLoader_1.load; 14408exports.getInstance = ReCaptchaLoader_1.getInstance; 14409var ReCaptchaInstance_1 = __webpack_require__(13); 14410exports.ReCaptchaInstance = ReCaptchaInstance_1.ReCaptchaInstance; 14411 14412 14413/***/ }), 14414/* 39 */ 14415/***/ (function(module, exports, __webpack_require__) { 14416 14417"use strict"; 14418 14419Object.defineProperty(exports, "__esModule", { value: true }); 14420var ReCaptchaInstance_1 = __webpack_require__(13); 14421var ELoadingState; 14422(function (ELoadingState) { 14423 ELoadingState[ELoadingState["NOT_LOADED"] = 0] = "NOT_LOADED"; 14424 ELoadingState[ELoadingState["LOADING"] = 1] = "LOADING"; 14425 ELoadingState[ELoadingState["LOADED"] = 2] = "LOADED"; 14426})(ELoadingState || (ELoadingState = {})); 14427var ReCaptchaLoader = (function () { 14428 function ReCaptchaLoader() { 14429 } 14430 ReCaptchaLoader.load = function (siteKey, options) { 14431 if (options === void 0) { options = {}; } 14432 if (typeof document === 'undefined') { 14433 return Promise.reject(new Error('This is a library for the browser!')); 14434 } 14435 if (ReCaptchaLoader.getLoadingState() === ELoadingState.LOADED) { 14436 if (ReCaptchaLoader.instance.getSiteKey() === siteKey) { 14437 return Promise.resolve(ReCaptchaLoader.instance); 14438 } 14439 else { 14440 return Promise.reject(new Error('reCAPTCHA already loaded with different site key!')); 14441 } 14442 } 14443 if (ReCaptchaLoader.getLoadingState() === ELoadingState.LOADING) { 14444 if (siteKey !== ReCaptchaLoader.instanceSiteKey) { 14445 return Promise.reject(new Error('reCAPTCHA already loaded with different site key!')); 14446 } 14447 return new Promise(function (resolve, reject) { 14448 ReCaptchaLoader.successfulLoadingConsumers.push(function (instance) { return resolve(instance); }); 14449 ReCaptchaLoader.errorLoadingRunnable.push(function (reason) { return reject(reason); }); 14450 }); 14451 } 14452 ReCaptchaLoader.instanceSiteKey = siteKey; 14453 ReCaptchaLoader.setLoadingState(ELoadingState.LOADING); 14454 var loader = new ReCaptchaLoader(); 14455 return new Promise(function (resolve, reject) { 14456 loader.loadScript(siteKey, options.useRecaptchaNet || false, options.renderParameters ? options.renderParameters : {}, options.customUrl).then(function () { 14457 ReCaptchaLoader.setLoadingState(ELoadingState.LOADED); 14458 var widgetID = loader.doExplicitRender(grecaptcha, siteKey, options.explicitRenderParameters ? options.explicitRenderParameters : {}); 14459 var instance = new ReCaptchaInstance_1.ReCaptchaInstance(siteKey, widgetID, grecaptcha); 14460 ReCaptchaLoader.successfulLoadingConsumers.forEach(function (v) { return v(instance); }); 14461 ReCaptchaLoader.successfulLoadingConsumers = []; 14462 if (options.autoHideBadge) { 14463 instance.hideBadge(); 14464 } 14465 ReCaptchaLoader.instance = instance; 14466 resolve(instance); 14467 }).catch(function (error) { 14468 ReCaptchaLoader.errorLoadingRunnable.forEach(function (v) { return v(error); }); 14469 ReCaptchaLoader.errorLoadingRunnable = []; 14470 reject(error); 14471 }); 14472 }); 14473 }; 14474 ReCaptchaLoader.getInstance = function () { 14475 return ReCaptchaLoader.instance; 14476 }; 14477 ReCaptchaLoader.setLoadingState = function (state) { 14478 ReCaptchaLoader.loadingState = state; 14479 }; 14480 ReCaptchaLoader.getLoadingState = function () { 14481 if (ReCaptchaLoader.loadingState === null) { 14482 return ELoadingState.NOT_LOADED; 14483 } 14484 else { 14485 return ReCaptchaLoader.loadingState; 14486 } 14487 }; 14488 ReCaptchaLoader.prototype.loadScript = function (siteKey, useRecaptchaNet, renderParameters, customUrl) { 14489 var _this = this; 14490 if (useRecaptchaNet === void 0) { useRecaptchaNet = false; } 14491 if (renderParameters === void 0) { renderParameters = {}; } 14492 if (customUrl === void 0) { customUrl = ''; } 14493 var scriptElement = document.createElement('script'); 14494 scriptElement.setAttribute('recaptcha-v3-script', ''); 14495 var scriptBase = 'https://www.google.com/recaptcha/api.js'; 14496 if (useRecaptchaNet) { 14497 scriptBase = 'https://recaptcha.net/recaptcha/api.js'; 14498 } 14499 if (customUrl) { 14500 scriptBase = customUrl; 14501 } 14502 if (renderParameters.render) { 14503 renderParameters.render = undefined; 14504 } 14505 var parametersQuery = this.buildQueryString(renderParameters); 14506 scriptElement.src = scriptBase + '?render=explicit' + parametersQuery; 14507 return new Promise(function (resolve, reject) { 14508 scriptElement.addEventListener('load', _this.waitForScriptToLoad(function () { 14509 resolve(scriptElement); 14510 }), false); 14511 scriptElement.onerror = function (error) { 14512 ReCaptchaLoader.setLoadingState(ELoadingState.NOT_LOADED); 14513 reject(error); 14514 }; 14515 document.head.appendChild(scriptElement); 14516 }); 14517 }; 14518 ReCaptchaLoader.prototype.buildQueryString = function (parameters) { 14519 var parameterKeys = Object.keys(parameters); 14520 if (parameterKeys.length < 1) { 14521 return ''; 14522 } 14523 return '&' + Object.keys(parameters) 14524 .filter(function (parameterKey) { 14525 return !!parameters[parameterKey]; 14526 }) 14527 .map(function (parameterKey) { 14528 return parameterKey + '=' + parameters[parameterKey]; 14529 }).join('&'); 14530 }; 14531 ReCaptchaLoader.prototype.waitForScriptToLoad = function (callback) { 14532 var _this = this; 14533 return function () { 14534 if (window.grecaptcha === undefined) { 14535 setTimeout(function () { 14536 _this.waitForScriptToLoad(callback); 14537 }, ReCaptchaLoader.SCRIPT_LOAD_DELAY); 14538 } 14539 else { 14540 window.grecaptcha.ready(function () { 14541 callback(); 14542 }); 14543 } 14544 }; 14545 }; 14546 ReCaptchaLoader.prototype.doExplicitRender = function (grecaptcha, siteKey, parameters) { 14547 var augmentedParameters = { 14548 sitekey: siteKey, 14549 badge: parameters.badge, 14550 size: parameters.size, 14551 tabindex: parameters.tabindex 14552 }; 14553 if (parameters.container) { 14554 return grecaptcha.render(parameters.container, augmentedParameters); 14555 } 14556 else { 14557 return grecaptcha.render(augmentedParameters); 14558 } 14559 }; 14560 ReCaptchaLoader.loadingState = null; 14561 ReCaptchaLoader.instance = null; 14562 ReCaptchaLoader.instanceSiteKey = null; 14563 ReCaptchaLoader.successfulLoadingConsumers = []; 14564 ReCaptchaLoader.errorLoadingRunnable = []; 14565 ReCaptchaLoader.SCRIPT_LOAD_DELAY = 25; 14566 return ReCaptchaLoader; 14567}()); 14568exports.load = ReCaptchaLoader.load; 14569exports.getInstance = ReCaptchaLoader.getInstance; 14570 14571 14572/***/ }), 14573/* 40 */, 14574/* 41 */ 14575/***/ (function(module, exports, __webpack_require__) { 14576 14577__webpack_require__(6); 14578__webpack_require__(2); 14579__webpack_require__(12); 14580module.exports = __webpack_require__(42); 14581 14582 14583/***/ }), 14584/* 42 */ 14585/***/ (function(module, __webpack_exports__, __webpack_require__) { 14586 14587"use strict"; 14588Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); 14589/* WEBPACK VAR INJECTION */(function(process) {/*! 14590 * vue-router v3.4.3
14591 * (c) 2020 Evan You 14592 * @license MIT 14593 */ 14594/* */ 14595 14596function assert (condition, message) { 14597 if (!condition) { 14598 throw new Error(("[vue-router] " + message)) 14599 } 14600} 14601 14602function warn (condition, message) { 14603 if (process.env.NODE_ENV !== 'production' && !condition) { 14604 typeof console !== 'undefined' && console.warn(("[vue-router] " + message)); 14605 } 14606} 14607 14608function extend (a, b) { 14609 for (var key in b) { 14610 a[key] = b[key]; 14611 } 14612 return a 14613} 14614 14615var View = { 14616 name: 'RouterView', 14617 functional: true, 14618 props: { 14619 name: { 14620 type: String, 14621 default: 'default' 14622 } 14623 }, 14624 render: function render (_, ref) { 14625 var props = ref.props; 14626 var children = ref.children; 14627 var parent = ref.parent; 14628 var data = ref.data; 14629 14630 // used by devtools to display a router-view badge 14631 data.routerView = true; 14632 14633 // directly use parent context's createElement() function 14634 // so that components rendered by router-view can resolve named slots 14635 var h = parent.$createElement; 14636 var name = props.name; 14637 var route = parent.$route; 14638 var cache = parent._routerViewCache || (parent._routerViewCache = {}); 14639 14640 // determine current view depth, also check to see if the tree 14641 // has been toggled inactive but kept-alive. 14642 var depth = 0; 14643 var inactive = false; 14644 while (parent && parent._routerRoot !== parent) { 14645 var vnodeData = parent.$vnode ? parent.$vnode.data : {}; 14646 if (vnodeData.routerView) { 14647 depth++; 14648 } 14649 if (vnodeData.keepAlive && parent._directInactive && parent._inactive) { 14650 inactive = true; 14651 } 14652 parent = parent.$parent; 14653 } 14654 data.routerViewDepth = depth; 14655 14656 // render previous view if the tree is inactive and kept-alive 14657 if (inactive) { 14658 var cachedData = cache[name]; 14659 var cachedComponent = cachedData && cachedData.component; 14660 if (cachedComponent) { 14661 // #2301 14662 // pass props 14663 if (cachedData.configProps) { 14664 fillPropsinData(cachedComponent, data, cachedData.route, cachedData.configProps); 14665 } 14666 return h(cachedComponent, data, children) 14667 } else { 14668 // render previous empty view 14669 return h() 14670 } 14671 } 14672 14673 var matched = route.matched[depth]; 14674 var component = matched && matched.components[name]; 14675 14676 // render empty node if no matched route or no config component 14677 if (!matched || !component) { 14678 cache[name] = null; 14679 return h() 14680 } 14681
14682 // cache component 14683 cache[name] = { component: component }; 14684 14685 // attach instance registration hook 14686 // this will be called in the instance's injected lifecycle hooks 14687 data.registerRouteInstance = function (vm, val) { 14688 // val could be undefined for unregistration 14689 var current = matched.instances[name]; 14690 if ( 14691 (val && current !== vm) || 14692 (!val && current === vm) 14693 ) { 14694 matched.instances[name] = val; 14695 } 14696 } 14697 14698 // also register instance in prepatch hook 14699 // in case the same component instance is reused across different routes 14700 ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) { 14701 matched.instances[name] = vnode.componentInstance; 14702 }; 14703 14704 // register instance in init hook 14705 // in case kept-alive component be actived when routes changed 14706 data.hook.init = function (vnode) { 14707 if (vnode.data.keepAlive && 14708 vnode.componentInstance && 14709 vnode.componentInstance !== matched.instances[name] 14710 ) { 14711 matched.instances[name] = vnode.componentInstance; 14712 } 14713 }; 14714 14715 var configProps = matched.props && matched.props[name]; 14716 // save route and configProps in cache 14717 if (configProps) { 14718 extend(cache[name], { 14719 route: route, 14720 configProps: configProps 14721 }); 14722 fillPropsinData(component, data, route, configProps); 14723 } 14724 14725 return h(component, data, children) 14726 } 14727}; 14728 14729function fillPropsinData (component, data, route, configProps) { 14730 // resolve props 14731 var propsToPass = data.props = resolveProps(route, configProps); 14732 if (propsToPass) { 14733 // clone to prevent mutation 14734 propsToPass = data.props = extend({}, propsToPass); 14735 // pass non-declared props as attrs 14736 var attrs = data.attrs = data.attrs || {}; 14737 for (var key in propsToPass) { 14738 if (!component.props || !(key in component.props)) { 14739 attrs[key] = propsToPass[key]; 14740 delete propsToPass[key]; 14741 } 14742 } 14743 } 14744} 14745 14746function resolveProps (route, config) { 14747 switch (typeof config) { 14748 case 'undefined': 14749 return 14750 case 'object': 14751 return config 14752 case 'function': 14753 return config(route) 14754 case 'boolean': 14755 return config ? route.params : undefined 14756 default: 14757 if (process.env.NODE_ENV !== 'production') { 14758 warn( 14759 false, 14760 "props in \"" + (route.path) + "\" is a " + (typeof config) + ", " + 14761 "expecting an object, function or boolean." 14762 ); 14763 } 14764 } 14765} 14766 14767/* */ 14768 14769var encodeReserveRE = /[!'()*]/g; 14770var encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); }; 14771var commaRE = /%2C/g; 14772 14773// fixed encodeURIComponent which is more conformant to RFC3986: 14774// - escapes [!'()*] 14775// - preserve commas 14776var encode = function (str) { return encodeURIComponent(str) 14777 .replace(encodeReserveRE, encodeReserveReplacer) 14778 .replace(commaRE, ','); }; 14779 14780var decode = decodeURIComponent; 14781 14782function resolveQuery ( 14783 query, 14784 extraQuery, 14785 _parseQuery 14786) { 14787 if ( extraQuery === void 0 ) extraQuery = {}; 14788 14789 var parse = _parseQuery || parseQuery; 14790 var parsedQuery; 14791 try { 14792 parsedQuery = parse(query || ''); 14793 } catch (e) { 14794 process.env.NODE_ENV !== 'production' && warn(false, e.message); 14795 parsedQuery = {}; 14796 } 14797 for (var key in extraQuery) { 14798 var value = extraQuery[key]; 14799 parsedQuery[key] = Array.isArray(value) 14800 ? value.map(castQueryParamValue) 14801 : castQueryParamValue(value); 14802 } 14803 return parsedQuery 14804} 14805 14806var castQueryParamValue = function (value) { return (value == null || typeof value === 'object' ? value : String(value)); }; 14807 14808function parseQuery (query) { 14809 var res = {}; 14810 14811 query = query.trim().replace(/^(\?|#|&)/, ''); 14812 14813 if (!query) { 14814 return res 14815 } 14816 14817 query.split('&').forEach(function (param) { 14818 var parts = param.replace(/\+/g, ' ').split('='); 14819 var key = decode(parts.shift()); 14820 var val = parts.length > 0 ? decode(parts.join('=')) : null; 14821 14822 if (res[key] === undefined) { 14823 res[key] = val; 14824 } else if (Array.isArray(res[key])) { 14825 res[key].push(val); 14826 } else { 14827 res[key] = [res[key], val]; 14828 } 14829 }); 14830 14831 return res 14832} 14833 14834function stringifyQuery (obj) { 14835 var res = obj 14836 ? Object.keys(obj) 14837 .map(function (key) { 14838 var val = obj[key]; 14839 14840 if (val === undefined) { 14841 return '' 14842 } 14843 14844 if (val === null) { 14845 return encode(key) 14846 } 14847 14848 if (Array.isArray(val)) { 14849 var result = []; 14850 val.forEach(function (val2) { 14851 if (val2 === undefined) { 14852 return 14853 } 14854 if (val2 === null) { 14855 result.push(encode(key)); 14856 } else { 14857 result.push(encode(key) + '=' + encode(val2)); 14858 } 14859 }); 14860 return result.join('&') 14861 } 14862 14863 return encode(key) + '=' + encode(val) 14864 }) 14865 .filter(function (x) { return x.length > 0; }) 14866 .join('&') 14867 : null; 14868 return res ? ("?" + res) : '' 14869} 14870 14871/* */ 14872 14873var trailingSlashRE = /\/?$/; 14874 14875function createRoute ( 14876 record, 14877 location, 14878 redirectedFrom, 14879 router 14880) { 14881 var stringifyQuery = router && router.options.stringifyQuery; 14882 14883 var query = location.query || {}; 14884 try { 14885 query = clone(query); 14886 } catch (e) {} 14887 14888 var route = { 14889 name: location.name || (record && record.name), 14890 meta: (record && record.meta) || {}, 14891 path: location.path || '/', 14892 hash: location.hash || '', 14893 query: query, 14894 params: location.params || {}, 14895 fullPath: getFullPath(location, stringifyQuery), 14896 matched: record ? formatMatch(record) : [] 14897 }; 14898 if (redirectedFrom) { 14899 route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery); 14900 } 14901 return Object.freeze(route) 14902} 14903 14904function clone (value) { 14905 if (Array.isArray(value)) { 14906 return value.map(clone) 14907 } else if (value && typeof value === 'object') { 14908 var res = {}; 14909 for (var key in value) { 14910 res[key] = clone(value[key]); 14911 } 14912 return res 14913 } else { 14914 return value 14915 } 14916} 14917 14918// the starting route that represents the initial state 14919var START = createRoute(null, { 14920 path: '/' 14921}); 14922 14923function formatMatch (record) { 14924 var res = []; 14925 while (record) { 14926 res.unshift(record); 14927 record = record.parent; 14928 } 14929 return res 14930} 14931 14932function getFullPath ( 14933 ref, 14934 _stringifyQuery 14935) { 14936 var path = ref.path; 14937 var query = ref.query; if ( query === void 0 ) query = {}; 14938 var hash = ref.hash; if ( hash === void 0 ) hash = ''; 14939 14940 var stringify = _stringifyQuery || stringifyQuery; 14941 return (path || '/') + stringify(query) + hash 14942} 14943 14944function isSameRoute (a, b) { 14945 if (b === START) { 14946 return a === b 14947 } else if (!b) { 14948 return false 14949 } else if (a.path && b.path) { 14950 return ( 14951 a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') && 14952 a.hash === b.hash && 14953 isObjectEqual(a.query, b.query) 14954 ) 14955 } else if (a.name && b.name) { 14956 return ( 14957 a.name === b.name && 14958 a.hash === b.hash && 14959 isObjectEqual(a.query, b.query) && 14960 isObjectEqual(a.params, b.params) 14961 ) 14962 } else { 14963 return false 14964 } 14965} 14966 14967function isObjectEqual (a, b) { 14968 if ( a === void 0 ) a = {}; 14969 if ( b === void 0 ) b = {}; 14970 14971 // handle null value #1566 14972 if (!a || !b) { return a === b } 14973 var aKeys = Object.keys(a); 14974 var bKeys = Object.keys(b); 14975 if (aKeys.length !== bKeys.length) { 14976 return false 14977 } 14978 return aKeys.every(function (key) { 14979 var aVal = a[key]; 14980 var bVal = b[key]; 14981 // query values can be null and undefined 14982 if (aVal == null || bVal == null) { return aVal === bVal } 14983 // check nested equality 14984 if (typeof aVal === 'object' && typeof bVal === 'object') { 14985 return isObjectEqual(aVal, bVal) 14986 } 14987 return String(aVal) === String(bVal) 14988 }) 14989} 14990 14991function isIncludedRoute (current, target) { 14992 return ( 14993 current.path.replace(trailingSlashRE, '/').indexOf( 14994 target.path.replace(trailingSlashRE, '/') 14995 ) === 0 && 14996 (!target.hash || current.hash === target.hash) && 14997 queryIncludes(current.query, target.query) 14998 ) 14999} 15000 15001function queryIncludes (current, target) { 15002 for (var key in target) { 15003 if (!(key in current)) { 15004 return false 15005 } 15006 } 15007 return true 15008} 15009
15010/* */ 15011 15012function resolvePath ( 15013 relative, 15014 base, 15015 append 15016) { 15017 var firstChar = relative.charAt(0); 15018 if (firstChar === '/') { 15019 return relative 15020 } 15021 15022 if (firstChar === '?' || firstChar === '#') { 15023 return base + relative 15024 } 15025 15026 var stack = base.split('/'); 15027 15028 // remove trailing segment if: 15029 // - not appending 15030 // - appending to trailing slash (last segment is empty) 15031 if (!append || !stack[stack.length - 1]) { 15032 stack.pop(); 15033 } 15034 15035 // resolve relative path 15036 var segments = relative.replace(/^\//, '').split('/'); 15037 for (var i = 0; i < segments.length; i++) { 15038 var segment = segments[i]; 15039 if (segment === '..') { 15040 stack.pop(); 15041 } else if (segment !== '.') { 15042 stack.push(segment); 15043 } 15044 } 15045 15046 // ensure leading slash 15047 if (stack[0] !== '') { 15048 stack.unshift(''); 15049 } 15050 15051 return stack.join('/') 15052} 15053 15054function parsePath (path) { 15055 var hash = ''; 15056 var query = ''; 15057 15058 var hashIndex = path.indexOf('#'); 15059 if (hashIndex >= 0) { 15060 hash = path.slice(hashIndex); 15061 path = path.slice(0, hashIndex); 15062 } 15063 15064 var queryIndex = path.indexOf('?'); 15065 if (queryIndex >= 0) { 15066 query = path.slice(queryIndex + 1); 15067 path = path.slice(0, queryIndex); 15068 } 15069 15070 return { 15071 path: path, 15072 query: query, 15073 hash: hash 15074 } 15075} 15076 15077function cleanPath (path) { 15078 return path.replace(/\/\//g, '/') 15079} 15080 15081var isarray = Array.isArray || function (arr) { 15082 return Object.prototype.toString.call(arr) == '[object Array]'; 15083}; 15084 15085/** 15086 * Expose `pathToRegexp`. 15087 */ 15088var pathToRegexp_1 = pathToRegexp; 15089var parse_1 = parse; 15090var compile_1 = compile; 15091var tokensToFunction_1 = tokensToFunction; 15092var tokensToRegExp_1 = tokensToRegExp; 15093 15094/** 15095 * The main path matching regexp utility. 15096 * 15097 * @type {RegExp} 15098 */ 15099var PATH_REGEXP = new RegExp([ 15100 // Match escaped characters that would otherwise appear in future matches. 15101 // This allows the user to escape special characters that won't transform. 15102 '(\\\\.)', 15103 // Match Express-style parameters and un-named parameters with a prefix 15104 // and optional suffixes. Matches appear as: 15105 // 15106 // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] 15107 // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] 15108 // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] 15109 '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))' 15110].join('|'), 'g'); 15111 15112/** 15113 * Parse a string for the raw tokens. 15114 * 15115 * @param {string} str 15116 * @param {Object=} options 15117 * @return {!Array} 15118 */ 15119function parse (str, options) { 15120 var tokens = []; 15121 var key = 0; 15122 var index = 0; 15123 var path = ''; 15124 var defaultDelimiter = options && options.delimiter || '/'; 15125 var res; 15126 15127 while ((res = PATH_REGEXP.exec(str)) != null) { 15128 var m = res[0]; 15129 var escaped = res[1]; 15130 var offset = res.index; 15131 path += str.slice(index, offset); 15132 index = offset + m.length; 15133 15134 // Ignore already escaped sequences. 15135 if (escaped) { 15136 path += escaped[1]; 15137 continue 15138 } 15139 15140 var next = str[index]; 15141 var prefix = res[2]; 15142 var name = res[3]; 15143 var capture = res[4]; 15144 var group = res[5]; 15145 var modifier = res[6]; 15146 var asterisk = res[7]; 15147 15148 // Push the current path onto the tokens. 15149 if (path) { 15150 tokens.push(path); 15151 path = ''; 15152 } 15153 15154 var partial = prefix != null && next != null && next !== prefix; 15155 var repeat = modifier === '+' || modifier === '*'; 15156 var optional = modifier === '?' || modifier === '*'; 15157 var delimiter = res[2] || defaultDelimiter; 15158 var pattern = capture || group; 15159 15160 tokens.push({ 15161 name: name || key++, 15162 prefix: prefix || '', 15163 delimiter: delimiter, 15164 optional: optional, 15165 repeat: repeat, 15166 partial: partial, 15167 asterisk: !!asterisk, 15168 pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?') 15169 }); 15170 } 15171 15172 // Match any characters still remaining. 15173 if (index < str.length) { 15174 path += str.substr(index); 15175 } 15176 15177 // If the path exists, push it onto the end. 15178 if (path) { 15179 tokens.push(path); 15180 } 15181 15182 return tokens 15183} 15184 15185/** 15186 * Compile a string to a template function for the path.
15187 * 15188 * @param {string} str 15189 * @param {Object=} options 15190 * @return {!function(Object=, Object=)} 15191 */ 15192function compile (str, options) { 15193 return tokensToFunction(parse(str, options), options) 15194} 15195 15196/** 15197 * Prettier encoding of URI path segments. 15198 * 15199 * @param {string} 15200 * @return {string} 15201 */ 15202function encodeURIComponentPretty (str) { 15203 return encodeURI(str).replace(/[\/?#]/g, function (c) { 15204 return '%' + c.charCodeAt(0).toString(16).toUpperCase() 15205 }) 15206} 15207 15208/** 15209 * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. 15210 * 15211 * @param {string} 15212 * @return {string} 15213 */ 15214function encodeAsterisk (str) { 15215 return encodeURI(str).replace(/[?#]/g, function (c) { 15216 return '%' + c.charCodeAt(0).toString(16).toUpperCase() 15217 }) 15218} 15219 15220/** 15221 * Expose a method for transforming tokens into the path function. 15222 */ 15223function tokensToFunction (tokens, options) { 15224 // Compile all the tokens into regexps. 15225 var matches = new Array(tokens.length); 15226 15227 // Compile all the patterns before compilation. 15228 for (var i = 0; i < tokens.length; i++) { 15229 if (typeof tokens[i] === 'object') { 15230 matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options)); 15231 } 15232 } 15233 15234 return function (obj, opts) { 15235 var path = ''; 15236 var data = obj || {}; 15237 var options = opts || {}; 15238 var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent; 15239 15240 for (var i = 0; i < tokens.length; i++) { 15241 var token = tokens[i]; 15242 15243 if (typeof token === 'string') { 15244 path += token; 15245 15246 continue 15247 } 15248 15249 var value = data[token.name]; 15250 var segment; 15251 15252 if (value == null) { 15253 if (token.optional) { 15254 // Prepend partial segment prefixes. 15255 if (token.partial) { 15256 path += token.prefix; 15257 } 15258 15259 continue 15260 } else { 15261 throw new TypeError('Expected "' + token.name + '" to be defined') 15262 } 15263 } 15264 15265 if (isarray(value)) { 15266 if (!token.repeat) { 15267 throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`') 15268 } 15269 15270 if (value.length === 0) { 15271 if (token.optional) { 15272 continue 15273 } else { 15274 throw new TypeError('Expected "' + token.name + '" to not be empty') 15275 } 15276 } 15277 15278 for (var j = 0; j < value.length; j++) { 15279 segment = encode(value[j]); 15280 15281 if (!matches[i].test(segment)) { 15282 throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`') 15283 } 15284 15285 path += (j === 0 ? token.prefix : token.delimiter) + segment; 15286 } 15287 15288 continue 15289 } 15290 15291 segment = token.asterisk ? encodeAsterisk(value) : encode(value); 15292 15293 if (!matches[i].test(segment)) { 15294 throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') 15295 } 15296 15297 path += token.prefix + segment; 15298 } 15299 15300 return path 15301 } 15302} 15303 15304/** 15305 * Escape a regular expression string. 15306 * 15307 * @param {string} str 15308 * @return {string} 15309 */ 15310function escapeString (str) { 15311 return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1') 15312} 15313 15314/** 15315 * Escape the capturing group by escaping special characters and meaning. 15316 * 15317 * @param {string} group 15318 * @return {string} 15319 */ 15320function escapeGroup (group) { 15321 return group.replace(/([=!:$\/()])/g, '\\$1') 15322} 15323 15324/** 15325 * Attach the keys as a property of the regexp. 15326 * 15327 * @param {!RegExp} re 15328 * @param {Array} keys 15329 * @return {!RegExp} 15330 */ 15331function attachKeys (re, keys) { 15332 re.keys = keys; 15333 return re 15334} 15335 15336/** 15337 * Get the flags for a regexp from the options. 15338 * 15339 * @param {Object} options 15340 * @return {string} 15341 */ 15342function flags (options) { 15343 return options && options.sensitive ? '' : 'i' 15344} 15345 15346/** 15347 * Pull out keys from a regexp. 15348 * 15349 * @param {!RegExp} path 15350 * @param {!Array} keys 15351 * @return {!RegExp} 15352 */ 15353function regexpToRegexp (path, keys) { 15354 // Use a negative lookahead to match only capturing groups. 15355 var groups = path.source.match(/\((?!\?)/g); 15356 15357 if (groups) { 15358 for (var i = 0; i < groups.length; i++) { 15359 keys.push({ 15360 name: i, 15361 prefix: null, 15362 delimiter: null, 15363 optional: false, 15364 repeat: false, 15365 partial: false, 15366 asterisk: false, 15367 pattern: null 15368 }); 15369 } 15370 } 15371 15372 return attachKeys(path, keys) 15373} 15374 15375/** 15376 * Transform an array into a regexp. 15377 * 15378 * @param {!Array} path 15379 * @param {Array} keys 15380 * @param {!Object} options 15381 * @return {!RegExp} 15382 */ 15383function arrayToRegexp (path, keys, options) { 15384 var parts = []; 15385 15386 for (var i = 0; i < path.length; i++) { 15387 parts.push(pathToRegexp(path[i], keys, options).source); 15388 } 15389 15390 var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)); 15391 15392 return attachKeys(regexp, keys) 15393} 15394 15395/** 15396 * Create a path regexp from string input. 15397 * 15398 * @param {string} path 15399 * @param {!Array} keys 15400 * @param {!Object} options 15401 * @return {!RegExp} 15402 */ 15403function stringToRegexp (path, keys, options) { 15404 return tokensToRegExp(parse(path, options), keys, options) 15405} 15406 15407/** 15408 * Expose a function for taking tokens and returning a RegExp. 15409 * 15410 * @param {!Array} tokens 15411 * @param {(Array|Object)=} keys 15412 * @param {Object=} options 15413 * @return {!RegExp} 15414 */ 15415function tokensToRegExp (tokens, keys, options) { 15416 if (!isarray(keys)) {
15417 options = /** @type {!Object} */ (keys || options); 15418 keys = []; 15419 } 15420 15421 options = options || {}; 15422 15423 var strict = options.strict; 15424 var end = options.end !== false; 15425 var route = ''; 15426 15427 // Iterate over the tokens and create our regexp string. 15428 for (var i = 0; i < tokens.length; i++) { 15429 var token = tokens[i]; 15430 15431 if (typeof token === 'string') { 15432 route += escapeString(token); 15433 } else { 15434 var prefix = escapeString(token.prefix); 15435 var capture = '(?:' + token.pattern + ')'; 15436 15437 keys.push(token); 15438 15439 if (token.repeat) { 15440 capture += '(?:' + prefix + capture + ')*'; 15441 } 15442 15443 if (token.optional) { 15444 if (!token.partial) { 15445 capture = '(?:' + prefix + '(' + capture + '))?'; 15446 } else { 15447 capture = prefix + '(' + capture + ')?'; 15448 } 15449 } else { 15450 capture = prefix + '(' + capture + ')'; 15451 } 15452 15453 route += capture; 15454 } 15455 } 15456 15457 var delimiter = escapeString(options.delimiter || '/'); 15458 var endsWithDelimiter = route.slice(-delimiter.length) === delimiter; 15459 15460 // In non-strict mode we allow a slash at the end of match. If the path to 15461 // match already ends with a slash, we remove it for consistency. The slash 15462 // is valid at the end of a path match, not in the middle. This is important 15463 // in non-ending mode, where "/test/" shouldn't match "/test//route". 15464 if (!strict) { 15465 route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'; 15466 } 15467 15468 if (end) { 15469 route += '$'; 15470 } else { 15471 // In non-ending mode, we need the capturing groups to match as much as 15472 // possible by using a positive lookahead to the end or next path segment. 15473 route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'; 15474 } 15475 15476 return attachKeys(new RegExp('^' + route, flags(options)), keys) 15477} 15478 15479/** 15480 * Normalize the given path string, returning a regular expression. 15481 * 15482 * An empty array can be passed in for the keys, which will hold the 15483 * placeholder key descriptions. For example, using `/user/:id`, `keys` will 15484 * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. 15485 * 15486 * @param {(string|RegExp|Array)} path 15487 * @param {(Array|Object)=} keys 15488 * @param {Object=} options 15489 * @return {!RegExp} 15490 */ 15491function pathToRegexp (path, keys, options) { 15492 if (!isarray(keys)) {
15493 options = /** @type {!Object} */ (keys || options); 15494 keys = []; 15495 } 15496 15497 options = options || {}; 15498 15499 if (path instanceof RegExp) { 15500 return regexpToRegexp(path, /** @type {!Array} */ (keys)) 15501 } 15502 15503 if (isarray(path)) { 15504 return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options) 15505 } 15506 15507 return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options) 15508} 15509pathToRegexp_1.parse = parse_1; 15510pathToRegexp_1.compile = compile_1; 15511pathToRegexp_1.tokensToFunction = tokensToFunction_1; 15512pathToRegexp_1.tokensToRegExp = tokensToRegExp_1; 15513 15514/* */ 15515 15516// $flow-disable-line 15517var regexpCompileCache = Object.create(null); 15518 15519function fillParams ( 15520 path, 15521 params, 15522 routeMsg 15523) { 15524 params = params || {}; 15525 try { 15526 var filler = 15527 regexpCompileCache[path] || 15528 (regexpCompileCache[path] = pathToRegexp_1.compile(path)); 15529 15530 // Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }} 15531 // and fix #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string 15532 if (typeof params.pathMatch === 'string') { params[0] = params.pathMatch; } 15533 15534 return filler(params, { pretty: true }) 15535 } catch (e) { 15536 if (process.env.NODE_ENV !== 'production') { 15537 // Fix #3072 no warn if `pathMatch` is string 15538 warn(typeof params.pathMatch === 'string', ("missing param for " + routeMsg + ": " + (e.message))); 15539 } 15540 return '' 15541 } finally { 15542 // delete the 0 if it was added 15543 delete params[0]; 15544 } 15545} 15546 15547/* */ 15548 15549function normalizeLocation ( 15550 raw, 15551 current, 15552 append, 15553 router 15554) { 15555 var next = typeof raw === 'string' ? { path: raw } : raw; 15556 // named target 15557 if (next._normalized) { 15558 return next 15559 } else if (next.name) { 15560 next = extend({}, raw); 15561 var params = next.params; 15562 if (params && typeof params === 'object') { 15563 next.params = extend({}, params); 15564 } 15565 return next 15566 } 15567 15568 // relative params 15569 if (!next.path && next.params && current) { 15570 next = extend({}, next); 15571 next._normalized = true; 15572 var params$1 = extend(extend({}, current.params), next.params); 15573 if (current.name) { 15574 next.name = current.name; 15575 next.params = params$1; 15576 } else if (current.matched.length) { 15577 var rawPath = current.matched[current.matched.length - 1].path; 15578 next.path = fillParams(rawPath, params$1, ("path " + (current.path))); 15579 } else if (process.env.NODE_ENV !== 'production') { 15580 warn(false, "relative params navigation requires a current route."); 15581 } 15582 return next 15583 } 15584 15585 var parsedPath = parsePath(next.path || ''); 15586 var basePath = (current && current.path) || '/'; 15587 var path = parsedPath.path 15588 ? resolvePath(parsedPath.path, basePath, append || next.append) 15589 : basePath; 15590 15591 var query = resolveQuery( 15592 parsedPath.query, 15593 next.query, 15594 router && router.options.parseQuery 15595 ); 15596 15597 var hash = next.hash || parsedPath.hash; 15598 if (hash && hash.charAt(0) !== '#') { 15599 hash = "#" + hash; 15600 } 15601 15602 return { 15603 _normalized: true, 15604 path: path, 15605 query: query, 15606 hash: hash 15607 } 15608} 15609 15610/* */ 15611 15612// work around weird flow bug 15613var toTypes = [String, Object]; 15614var eventTypes = [String, Array]; 15615 15616var noop = function () {}; 15617 15618var Link = { 15619 name: 'RouterLink', 15620 props: { 15621 to: { 15622 type: toTypes, 15623 required: true 15624 }, 15625 tag: { 15626 type: String, 15627 default: 'a' 15628 }, 15629 exact: Boolean, 15630 append: Boolean, 15631 replace: Boolean, 15632 activeClass: String, 15633 exactActiveClass: String, 15634 ariaCurrentValue: { 15635 type: String, 15636 default: 'page' 15637 }, 15638 event: { 15639 type: eventTypes, 15640 default: 'click' 15641 } 15642 }, 15643 render: function render (h) { 15644 var this$1 = this; 15645 15646 var router = this.$router; 15647 var current = this.$route; 15648 var ref = router.resolve( 15649 this.to, 15650 current, 15651 this.append 15652 ); 15653 var location = ref.location; 15654 var route = ref.route; 15655 var href = ref.href; 15656 15657 var classes = {}; 15658 var globalActiveClass = router.options.linkActiveClass; 15659 var globalExactActiveClass = router.options.linkExactActiveClass;
15660 // Support global empty active class 15661 var activeClassFallback = 15662 globalActiveClass == null ? 'router-link-active' : globalActiveClass; 15663 var exactActiveClassFallback = 15664 globalExactActiveClass == null 15665 ? 'router-link-exact-active' 15666 : globalExactActiveClass; 15667 var activeClass = 15668 this.activeClass == null ? activeClassFallback : this.activeClass; 15669 var exactActiveClass = 15670 this.exactActiveClass == null 15671 ? exactActiveClassFallback 15672 : this.exactActiveClass; 15673 15674 var compareTarget = route.redirectedFrom 15675 ? createRoute(null, normalizeLocation(route.redirectedFrom), null, router) 15676 : route; 15677 15678 classes[exactActiveClass] = isSameRoute(current, compareTarget); 15679 classes[activeClass] = this.exact 15680 ? classes[exactActiveClass] 15681 : isIncludedRoute(current, compareTarget); 15682 15683 var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null; 15684 15685 var handler = function (e) { 15686 if (guardEvent(e)) { 15687 if (this$1.replace) { 15688 router.replace(location, noop); 15689 } else { 15690 router.push(location, noop); 15691 } 15692 } 15693 }; 15694 15695 var on = { click: guardEvent }; 15696 if (Array.isArray(this.event)) { 15697 this.event.forEach(function (e) { 15698 on[e] = handler; 15699 }); 15700 } else { 15701 on[this.event] = handler; 15702 } 15703 15704 var data = { class: classes }; 15705 15706 var scopedSlot = 15707 !this.$scopedSlots.$hasNormal && 15708 this.$scopedSlots.default && 15709 this.$scopedSlots.default({ 15710 href: href, 15711 route: route, 15712 navigate: handler, 15713 isActive: classes[activeClass], 15714 isExactActive: classes[exactActiveClass] 15715 }); 15716 15717 if (scopedSlot) { 15718 if (scopedSlot.length === 1) { 15719 return scopedSlot[0] 15720 } else if (scopedSlot.length > 1 || !scopedSlot.length) { 15721 if (process.env.NODE_ENV !== 'production') { 15722 warn( 15723 false, 15724 ("RouterLink with to=\"" + (this.to) + "\" is trying to use a scoped slot but it didn't provide exactly one child. Wrapping the content with a span element.") 15725 ); 15726 } 15727 return scopedSlot.length === 0 ? h() : h('span', {}, scopedSlot) 15728 } 15729 } 15730 15731 if (this.tag === 'a') { 15732 data.on = on; 15733 data.attrs = { href: href, 'aria-current': ariaCurrentValue }; 15734 } else { 15735 // find the first <a> child and apply listener and href 15736 var a = findAnchor(this.$slots.default); 15737 if (a) { 15738 // in case the <a> is a static node 15739 a.isStatic = false; 15740 var aData = (a.data = extend({}, a.data)); 15741 aData.on = aData.on || {}; 15742 // transform existing events in both objects into arrays so we can push later 15743 for (var event in aData.on) { 15744 var handler$1 = aData.on[event]; 15745 if (event in on) { 15746 aData.on[event] = Array.isArray(handler$1) ? handler$1 : [handler$1]; 15747 } 15748 } 15749 // append new listeners for router-link 15750 for (var event$1 in on) { 15751 if (event$1 in aData.on) { 15752 // on[event] is always a function 15753 aData.on[event$1].push(on[event$1]); 15754 } else { 15755 aData.on[event$1] = handler; 15756 } 15757 } 15758 15759 var aAttrs = (a.data.attrs = extend({}, a.data.attrs)); 15760 aAttrs.href = href; 15761 aAttrs['aria-current'] = ariaCurrentValue; 15762 } else { 15763 // doesn't have <a> child, apply listener to self 15764 data.on = on; 15765 } 15766 } 15767 15768 return h(this.tag, data, this.$slots.default) 15769 } 15770}; 15771 15772function guardEvent (e) { 15773 // don't redirect with control keys 15774 if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return } 15775 // don't redirect when preventDefault called 15776 if (e.defaultPrevented) { return } 15777 // don't redirect on right click 15778 if (e.button !== undefined && e.button !== 0) { return } 15779 // don't redirect if `target="_blank"` 15780 if (e.currentTarget && e.currentTarget.getAttribute) { 15781 var target = e.currentTarget.getAttribute('target'); 15782 if (/\b_blank\b/i.test(target)) { return } 15783 } 15784 // this may be a Weex event which doesn't have this method 15785 if (e.preventDefault) { 15786 e.preventDefault(); 15787 } 15788 return true 15789} 15790 15791function findAnchor (children) { 15792 if (children) { 15793 var child; 15794 for (var i = 0; i < children.length; i++) { 15795 child = children[i]; 15796 if (child.tag === 'a') { 15797 return child 15798 } 15799 if (child.children && (child = findAnchor(child.children))) { 15800 return child 15801 } 15802 } 15803 } 15804} 15805 15806var _Vue; 15807 15808function install (Vue) { 15809 if (install.installed && _Vue === Vue) { return } 15810 install.installed = true; 15811 15812 _Vue = Vue; 15813 15814 var isDef = function (v) { return v !== undefined; }; 15815 15816 var registerInstance = function (vm, callVal) { 15817 var i = vm.$options._parentVnode; 15818 if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) { 15819 i(vm, callVal); 15820 } 15821 }; 15822 15823 Vue.mixin({ 15824 beforeCreate: function beforeCreate () { 15825 if (isDef(this.$options.router)) { 15826 this._routerRoot = this; 15827 this._router = this.$options.router; 15828 this._router.init(this); 15829 Vue.util.defineReactive(this, '_route', this._router.history.current); 15830 } else { 15831 this._routerRoot = (this.$parent && this.$parent._routerRoot) || this; 15832 } 15833 registerInstance(this, this); 15834 }, 15835 destroyed: function destroyed () { 15836 registerInstance(this); 15837 } 15838 }); 15839 15840 Object.defineProperty(Vue.prototype, '$router', { 15841 get: function get () { return this._routerRoot._router } 15842 }); 15843 15844 Object.defineProperty(Vue.prototype, '$route', { 15845 get: function get () { return this._routerRoot._route } 15846 }); 15847 15848 Vue.component('RouterView', View); 15849 Vue.component('RouterLink', Link); 15850 15851 var strats = Vue.config.optionMergeStrategies; 15852 // use the same hook merging strategy for route hooks 15853 strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created; 15854} 15855 15856/* */ 15857 15858var inBrowser = typeof window !== 'undefined'; 15859 15860/* */ 15861 15862function createRouteMap ( 15863 routes, 15864 oldPathList, 15865 oldPathMap, 15866 oldNameMap 15867) { 15868 // the path list is used to control path matching priority 15869 var pathList = oldPathList || []; 15870 // $flow-disable-line 15871 var pathMap = oldPathMap || Object.create(null); 15872 // $flow-disable-line 15873 var nameMap = oldNameMap || Object.create(null); 15874
15875 routes.forEach(function (route) { 15876 addRouteRecord(pathList, pathMap, nameMap, route); 15877 }); 15878 15879 // ensure wildcard routes are always at the end 15880 for (var i = 0, l = pathList.length; i < l; i++) { 15881 if (pathList[i] === '*') { 15882 pathList.push(pathList.splice(i, 1)[0]); 15883 l--; 15884 i--; 15885 } 15886 } 15887 15888 if (process.env.NODE_ENV === 'development') { 15889 // warn if routes do not include leading slashes 15890 var found = pathList 15891 // check for missing leading slash 15892 .filter(function (path) { return path && path.charAt(0) !== '*' && path.charAt(0) !== '/'; }); 15893 15894 if (found.length > 0) { 15895 var pathNames = found.map(function (path) { return ("- " + path); }).join('\n'); 15896 warn(false, ("Non-nested routes must include a leading slash character. Fix the following routes: \n" + pathNames)); 15897 } 15898 } 15899 15900 return { 15901 pathList: pathList, 15902 pathMap: pathMap, 15903 nameMap: nameMap 15904 } 15905} 15906 15907function addRouteRecord ( 15908 pathList, 15909 pathMap, 15910 nameMap, 15911 route, 15912 parent, 15913 matchAs 15914) { 15915 var path = route.path; 15916 var name = route.name; 15917 if (process.env.NODE_ENV !== 'production') { 15918 assert(path != null, "\"path\" is required in a route configuration."); 15919 assert( 15920 typeof route.component !== 'string', 15921 "route config \"component\" for path: " + (String( 15922 path || name 15923 )) + " cannot be a " + "string id. Use an actual component instead." 15924 ); 15925 } 15926 15927 var pathToRegexpOptions = 15928 route.pathToRegexpOptions || {}; 15929 var normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict); 15930 15931 if (typeof route.caseSensitive === 'boolean') { 15932 pathToRegexpOptions.sensitive = route.caseSensitive; 15933 } 15934 15935 var record = { 15936 path: normalizedPath, 15937 regex: compileRouteRegex(normalizedPath, pathToRegexpOptions), 15938 components: route.components || { default: route.component }, 15939 instances: {}, 15940 name: name, 15941 parent: parent, 15942 matchAs: matchAs, 15943 redirect: route.redirect, 15944 beforeEnter: route.beforeEnter, 15945 meta: route.meta || {}, 15946 props: 15947 route.props == null 15948 ? {} 15949 : route.components 15950 ? route.props 15951 : { default: route.props } 15952 }; 15953 15954 if (route.children) { 15955 // Warn if route is named, does not redirect and has a default child route. 15956 // If users navigate to this route by name, the default child will 15957 // not be rendered (GH Issue #629) 15958 if (process.env.NODE_ENV !== 'production') { 15959 if ( 15960 route.name && 15961 !route.redirect && 15962 route.children.some(function (child) { return /^\/?$/.test(child.path); }) 15963 ) { 15964 warn( 15965 false, 15966 "Named Route '" + (route.name) + "' has a default child route. " + 15967 "When navigating to this named route (:to=\"{name: '" + (route.name) + "'\"), " + 15968 "the default child route will not be rendered. Remove the name from " + 15969 "this route and use the name of the default child route for named " + 15970 "links instead." 15971 ); 15972 } 15973 } 15974 route.children.forEach(function (child) { 15975 var childMatchAs = matchAs 15976 ? cleanPath((matchAs + "/" + (child.path))) 15977 : undefined; 15978 addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs); 15979 }); 15980 } 15981 15982 if (!pathMap[record.path]) { 15983 pathList.push(record.path); 15984 pathMap[record.path] = record; 15985 } 15986 15987 if (route.alias !== undefined) { 15988 var aliases = Array.isArray(route.alias) ? route.alias : [route.alias]; 15989 for (var i = 0; i < aliases.length; ++i) { 15990 var alias = aliases[i]; 15991 if (process.env.NODE_ENV !== 'production' && alias === path) { 15992 warn( 15993 false, 15994 ("Found an alias with the same value as the path: \"" + path + "\". You have to remove that alias. It will be ignored in development.") 15995 ); 15996 // skip in dev to make it work 15997 continue 15998 } 15999 16000 var aliasRoute = { 16001 path: alias, 16002 children: route.children 16003 }; 16004 addRouteRecord( 16005 pathList, 16006 pathMap, 16007 nameMap, 16008 aliasRoute, 16009 parent, 16010 record.path || '/' // matchAs 16011 ); 16012 } 16013 } 16014 16015 if (name) { 16016 if (!nameMap[name]) { 16017 nameMap[name] = record; 16018 } else if (process.env.NODE_ENV !== 'production' && !matchAs) { 16019 warn( 16020 false, 16021 "Duplicate named routes definition: " + 16022 "{ name: \"" + name + "\", path: \"" + (record.path) + "\" }" 16023 ); 16024 } 16025 } 16026} 16027 16028function compileRouteRegex ( 16029 path, 16030 pathToRegexpOptions 16031) { 16032 var regex = pathToRegexp_1(path, [], pathToRegexpOptions); 16033 if (process.env.NODE_ENV !== 'production') { 16034 var keys = Object.create(null); 16035 regex.keys.forEach(function (key) { 16036 warn( 16037 !keys[key.name], 16038 ("Duplicate param keys in route with path: \"" + path + "\"") 16039 ); 16040 keys[key.name] = true; 16041 }); 16042 } 16043 return regex 16044} 16045 16046function normalizePath ( 16047 path, 16048 parent, 16049 strict 16050) { 16051 if (!strict) { path = path.replace(/\/$/, ''); } 16052 if (path[0] === '/') { return path } 16053 if (parent == null) { return path } 16054 return cleanPath(((parent.path) + "/" + path)) 16055} 16056 16057/* */ 16058 16059 16060 16061function createMatcher ( 16062 routes, 16063 router 16064) { 16065 var ref = createRouteMap(routes); 16066 var pathList = ref.pathList; 16067 var pathMap = ref.pathMap; 16068 var nameMap = ref.nameMap; 16069 16070 function addRoutes (routes) { 16071 createRouteMap(routes, pathList, pathMap, nameMap); 16072 } 16073 16074 function match ( 16075 raw, 16076 currentRoute, 16077 redirectedFrom 16078 ) { 16079 var location = normalizeLocation(raw, currentRoute, false, router); 16080 var name = location.name; 16081 16082 if (name) { 16083 var record = nameMap[name]; 16084 if (process.env.NODE_ENV !== 'production') {
16085 warn(record, ("Route with name '" + name + "' does not exist")); 16086 } 16087 if (!record) { return _createRoute(null, location) } 16088 var paramNames = record.regex.keys 16089 .filter(function (key) { return !key.optional; }) 16090 .map(function (key) { return key.name; }); 16091 16092 if (typeof location.params !== 'object') { 16093 location.params = {}; 16094 } 16095 16096 if (currentRoute && typeof currentRoute.params === 'object') { 16097 for (var key in currentRoute.params) { 16098 if (!(key in location.params) && paramNames.indexOf(key) > -1) { 16099 location.params[key] = currentRoute.params[key]; 16100 } 16101 } 16102 } 16103 16104 location.path = fillParams(record.path, location.params, ("named route \"" + name + "\"")); 16105 return _createRoute(record, location, redirectedFrom) 16106 } else if (location.path) { 16107 location.params = {}; 16108 for (var i = 0; i < pathList.length; i++) { 16109 var path = pathList[i]; 16110 var record$1 = pathMap[path]; 16111 if (matchRoute(record$1.regex, location.path, location.params)) { 16112 return _createRoute(record$1, location, redirectedFrom) 16113 } 16114 } 16115 } 16116 // no match 16117 return _createRoute(null, location) 16118 } 16119 16120 function redirect ( 16121 record, 16122 location 16123 ) { 16124 var originalRedirect = record.redirect; 16125 var redirect = typeof originalRedirect === 'function' 16126 ? originalRedirect(createRoute(record, location, null, router)) 16127 : originalRedirect; 16128 16129 if (typeof redirect === 'string') { 16130 redirect = { path: redirect }; 16131 } 16132 16133 if (!redirect || typeof redirect !== 'object') { 16134 if (process.env.NODE_ENV !== 'production') { 16135 warn( 16136 false, ("invalid redirect option: " + (JSON.stringify(redirect))) 16137 ); 16138 } 16139 return _createRoute(null, location) 16140 } 16141 16142 var re = redirect; 16143 var name = re.name; 16144 var path = re.path; 16145 var query = location.query; 16146 var hash = location.hash; 16147 var params = location.params; 16148 query = re.hasOwnProperty('query') ? re.query : query; 16149 hash = re.hasOwnProperty('hash') ? re.hash : hash; 16150 params = re.hasOwnProperty('params') ? re.params : params; 16151 16152 if (name) { 16153 // resolved named direct 16154 var targetRecord = nameMap[name]; 16155 if (process.env.NODE_ENV !== 'production') { 16156 assert(targetRecord, ("redirect failed: named route \"" + name + "\" not found.")); 16157 } 16158 return match({ 16159 _normalized: true, 16160 name: name, 16161 query: query, 16162 hash: hash, 16163 params: params 16164 }, undefined, location) 16165 } else if (path) { 16166 // 1. resolve relative redirect 16167 var rawPath = resolveRecordPath(path, record); 16168 // 2. resolve params 16169 var resolvedPath = fillParams(rawPath, params, ("redirect route with path \"" + rawPath + "\"")); 16170 // 3. rematch with existing query and hash 16171 return match({ 16172 _normalized: true, 16173 path: resolvedPath, 16174 query: query, 16175 hash: hash 16176 }, undefined, location) 16177 } else { 16178 if (process.env.NODE_ENV !== 'production') { 16179 warn(false, ("invalid redirect option: " + (JSON.stringify(redirect)))); 16180 } 16181 return _createRoute(null, location) 16182 } 16183 } 16184 16185 function alias ( 16186 record, 16187 location, 16188 matchAs 16189 ) { 16190 var aliasedPath = fillParams(matchAs, location.params, ("aliased route with path \"" + matchAs + "\"")); 16191 var aliasedMatch = match({ 16192 _normalized: true, 16193 path: aliasedPath 16194 }); 16195 if (aliasedMatch) { 16196 var matched = aliasedMatch.matched; 16197 var aliasedRecord = matched[matched.length - 1]; 16198 location.params = aliasedMatch.params; 16199 return _createRoute(aliasedRecord, location) 16200 } 16201 return _createRoute(null, location) 16202 } 16203 16204 function _createRoute ( 16205 record, 16206 location, 16207 redirectedFrom 16208 ) { 16209 if (record && record.redirect) { 16210 return redirect(record, redirectedFrom || location) 16211 } 16212 if (record && record.matchAs) { 16213 return alias(record, location, record.matchAs) 16214 } 16215 return createRoute(record, location, redirectedFrom, router) 16216 } 16217 16218 return { 16219 match: match, 16220 addRoutes: addRoutes 16221 } 16222} 16223 16224function matchRoute ( 16225 regex, 16226 path, 16227 params 16228) { 16229 var m = path.match(regex); 16230 16231 if (!m) { 16232 return false 16233 } else if (!params) { 16234 return true 16235 } 16236 16237 for (var i = 1, len = m.length; i < len; ++i) { 16238 var key = regex.keys[i - 1]; 16239 var val = typeof m[i] === 'string' ? decodeURIComponent(m[i]) : m[i]; 16240 if (key) { 16241 // Fix #1994: using * with props: true generates a param named 0 16242 params[key.name || 'pathMatch'] = val; 16243 } 16244 } 16245 16246 return true 16247} 16248 16249function resolveRecordPath (path, record) { 16250 return resolvePath(path, record.parent ? record.parent.path : '/', true) 16251} 16252 16253/* */ 16254 16255// use User Timing api (if present) for more accurate key precision 16256var Time = 16257 inBrowser && window.performance && window.performance.now 16258 ? window.performance 16259 : Date; 16260 16261function genStateKey () { 16262 return Time.now().toFixed(3) 16263} 16264 16265var _key = genStateKey(); 16266 16267function getStateKey () { 16268 return _key 16269} 16270 16271function setStateKey (key) { 16272 return (_key = key) 16273} 16274 16275/* */ 16276 16277var positionStore = Object.create(null); 16278 16279function setupScroll () { 16280 // Prevent browser scroll behavior on History popstate 16281 if ('scrollRestoration' in window.history) { 16282 window.history.scrollRestoration = 'manual'; 16283 } 16284 // Fix for #1585 for Firefox 16285 // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678 16286 // Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with 16287 // window.location.protocol + '//' + window.location.host 16288 // location.host contains the port and location.hostname doesn't 16289 var protocolAndPath = window.location.protocol + '//' + window.location.host; 16290 var absolutePath = window.location.href.replace(protocolAndPath, ''); 16291 // preserve existing history state as it could be overriden by the user 16292 var stateCopy = extend({}, window.history.state); 16293 stateCopy.key = getStateKey(); 16294 window.history.replaceState(stateCopy, '', absolutePath); 16295 window.addEventListener('popstate', handlePopState); 16296 return function () { 16297 window.removeEventListener('popstate', handlePopState); 16298 } 16299} 16300 16301function handleScroll ( 16302 router, 16303 to, 16304 from, 16305 isPop 16306) { 16307 if (!router.app) { 16308 return 16309 } 16310 16311 var behavior = router.options.scrollBehavior; 16312 if (!behavior) { 16313 return 16314 } 16315 16316 if (process.env.NODE_ENV !== 'production') { 16317 assert(typeof behavior === 'function', "scrollBehavior must be a function"); 16318 } 16319
16320 // wait until re-render finishes before scrolling 16321 router.app.$nextTick(function () { 16322 var position = getScrollPosition(); 16323 var shouldScroll = behavior.call( 16324 router, 16325 to, 16326 from, 16327 isPop ? position : null 16328 ); 16329 16330 if (!shouldScroll) { 16331 return 16332 } 16333 16334 if (typeof shouldScroll.then === 'function') { 16335 shouldScroll 16336 .then(function (shouldScroll) { 16337 scrollToPosition((shouldScroll), position); 16338 }) 16339 .catch(function (err) { 16340 if (process.env.NODE_ENV !== 'production') { 16341 assert(false, err.toString()); 16342 } 16343 }); 16344 } else { 16345 scrollToPosition(shouldScroll, position); 16346 } 16347 }); 16348} 16349 16350function saveScrollPosition () { 16351 var key = getStateKey(); 16352 if (key) { 16353 positionStore[key] = { 16354 x: window.pageXOffset, 16355 y: window.pageYOffset 16356 }; 16357 } 16358} 16359 16360function handlePopState (e) { 16361 saveScrollPosition(); 16362 if (e.state && e.state.key) { 16363 setStateKey(e.state.key); 16364 } 16365} 16366 16367function getScrollPosition () { 16368 var key = getStateKey(); 16369 if (key) { 16370 return positionStore[key] 16371 } 16372} 16373 16374function getElementPosition (el, offset) { 16375 var docEl = document.documentElement; 16376 var docRect = docEl.getBoundingClientRect(); 16377 var elRect = el.getBoundingClientRect(); 16378 return { 16379 x: elRect.left - docRect.left - offset.x, 16380 y: elRect.top - docRect.top - offset.y 16381 } 16382} 16383 16384function isValidPosition (obj) { 16385 return isNumber(obj.x) || isNumber(obj.y) 16386} 16387 16388function normalizePosition (obj) { 16389 return { 16390 x: isNumber(obj.x) ? obj.x : window.pageXOffset, 16391 y: isNumber(obj.y) ? obj.y : window.pageYOffset 16392 } 16393} 16394 16395function normalizeOffset (obj) { 16396 return { 16397 x: isNumber(obj.x) ? obj.x : 0, 16398 y: isNumber(obj.y) ? obj.y : 0 16399 } 16400} 16401 16402function isNumber (v) { 16403 return typeof v === 'number' 16404} 16405 16406var hashStartsWithNumberRE = /^#\d/; 16407 16408function scrollToPosition (shouldScroll, position) { 16409 var isObject = typeof shouldScroll === 'object'; 16410 if (isObject && typeof shouldScroll.selector === 'string') { 16411 // getElementById would still fail if the selector contains a more complicated query like #main[data-attr] 16412 // but at the same time, it doesn't make much sense to select an element with an id and an extra selector 16413 var el = hashStartsWithNumberRE.test(shouldScroll.selector) // $flow-disable-line 16414 ? document.getElementById(shouldScroll.selector.slice(1)) // $flow-disable-line 16415 : document.querySelector(shouldScroll.selector); 16416 16417 if (el) { 16418 var offset = 16419 shouldScroll.offset && typeof shouldScroll.offset === 'object' 16420 ? shouldScroll.offset 16421 : {}; 16422 offset = normalizeOffset(offset); 16423 position = getElementPosition(el, offset); 16424 } else if (isValidPosition(shouldScroll)) { 16425 position = normalizePosition(shouldScroll); 16426 } 16427 } else if (isObject && isValidPosition(shouldScroll)) { 16428 position = normalizePosition(shouldScroll); 16429 } 16430 16431 if (position) { 16432 window.scrollTo(position.x, position.y); 16433 } 16434} 16435 16436/* */ 16437 16438var supportsPushState = 16439 inBrowser && 16440 (function () { 16441 var ua = window.navigator.userAgent; 16442 16443 if ( 16444 (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && 16445 ua.indexOf('Mobile Safari') !== -1 && 16446 ua.indexOf('Chrome') === -1 && 16447 ua.indexOf('Windows Phone') === -1 16448 ) { 16449 return false 16450 } 16451 16452 return window.history && typeof window.history.pushState === 'function' 16453 })(); 16454 16455function pushState (url, replace) { 16456 saveScrollPosition(); 16457 // try...catch the pushState call to get around Safari 16458 // DOM Exception 18 where it limits to 100 pushState calls 16459 var history = window.history; 16460 try { 16461 if (replace) { 16462 // preserve existing history state as it could be overriden by the user 16463 var stateCopy = extend({}, history.state); 16464 stateCopy.key = getStateKey(); 16465 history.replaceState(stateCopy, '', url); 16466 } else { 16467 history.pushState({ key: setStateKey(genStateKey()) }, '', url); 16468 } 16469 } catch (e) { 16470 window.location[replace ? 'replace' : 'assign'](url); 16471 } 16472} 16473 16474function replaceState (url) { 16475 pushState(url, true); 16476} 16477 16478/* */ 16479 16480function runQueue (queue, fn, cb) { 16481 var step = function (index) { 16482 if (index >= queue.length) { 16483 cb(); 16484 } else { 16485 if (queue[index]) { 16486 fn(queue[index], function () { 16487 step(index + 1); 16488 }); 16489 } else { 16490 step(index + 1); 16491 } 16492 } 16493 }; 16494 step(0); 16495} 16496 16497var NavigationFailureType = { 16498 redirected: 2, 16499 aborted: 4, 16500 cancelled: 8, 16501 duplicated: 16 16502}; 16503 16504function createNavigationRedirectedError (from, to) { 16505 return createRouterError( 16506 from, 16507 to, 16508 NavigationFailureType.redirected, 16509 ("Redirected when going from \"" + (from.fullPath) + "\" to \"" + (stringifyRoute( 16510 to 16511 )) + "\" via a navigation guard.") 16512 ) 16513} 16514
16515function createNavigationDuplicatedError (from, to) { 16516 var error = createRouterError( 16517 from, 16518 to, 16519 NavigationFailureType.duplicated, 16520 ("Avoided redundant navigation to current location: \"" + (from.fullPath) + "\".") 16521 ); 16522 // backwards compatible with the first introduction of Errors 16523 error.name = 'NavigationDuplicated'; 16524 return error 16525} 16526 16527function createNavigationCancelledError (from, to) { 16528 return createRouterError( 16529 from, 16530 to, 16531 NavigationFailureType.cancelled, 16532 ("Navigation cancelled from \"" + (from.fullPath) + "\" to \"" + (to.fullPath) + "\" with a new navigation.") 16533 ) 16534} 16535 16536function createNavigationAbortedError (from, to) { 16537 return createRouterError( 16538 from, 16539 to, 16540 NavigationFailureType.aborted, 16541 ("Navigation aborted from \"" + (from.fullPath) + "\" to \"" + (to.fullPath) + "\" via a navigation guard.") 16542 ) 16543} 16544 16545function createRouterError (from, to, type, message) { 16546 var error = new Error(message); 16547 error._isRouter = true; 16548 error.from = from; 16549 error.to = to; 16550 error.type = type; 16551 16552 return error 16553} 16554 16555var propertiesToLog = ['params', 'query', 'hash']; 16556 16557function stringifyRoute (to) { 16558 if (typeof to === 'string') { return to } 16559 if ('path' in to) { return to.path } 16560 var location = {}; 16561 propertiesToLog.forEach(function (key) { 16562 if (key in to) { location[key] = to[key]; } 16563 }); 16564 return JSON.stringify(location, null, 2) 16565} 16566 16567function isError (err) { 16568 return Object.prototype.toString.call(err).indexOf('Error') > -1 16569} 16570 16571function isNavigationFailure (err, errorType) { 16572 return ( 16573 isError(err) && 16574 err._isRouter && 16575 (errorType == null || err.type === errorType) 16576 ) 16577} 16578 16579/* */ 16580 16581function resolveAsyncComponents (matched) { 16582 return function (to, from, next) { 16583 var hasAsync = false; 16584 var pending = 0; 16585 var error = null; 16586 16587 flatMapComponents(matched, function (def, _, match, key) { 16588 // if it's a function and doesn't have cid attached, 16589 // assume it's an async component resolve function. 16590 // we are not using Vue's default async resolving mechanism because 16591 // we want to halt the navigation until the incoming component has been 16592 // resolved. 16593 if (typeof def === 'function' && def.cid === undefined) { 16594 hasAsync = true; 16595 pending++; 16596 16597 var resolve = once(function (resolvedDef) { 16598 if (isESModule(resolvedDef)) { 16599 resolvedDef = resolvedDef.default; 16600 } 16601 // save resolved on async factory in case it's used elsewhere 16602 def.resolved = typeof resolvedDef === 'function' 16603 ? resolvedDef 16604 : _Vue.extend(resolvedDef); 16605 match.components[key] = resolvedDef; 16606 pending--; 16607 if (pending <= 0) { 16608 next(); 16609 } 16610 }); 16611 16612 var reject = once(function (reason) { 16613 var msg = "Failed to resolve async component " + key + ": " + reason; 16614 process.env.NODE_ENV !== 'production' && warn(false, msg); 16615 if (!error) { 16616 error = isError(reason) 16617 ? reason 16618 : new Error(msg); 16619 next(error); 16620 } 16621 }); 16622 16623 var res; 16624 try { 16625 res = def(resolve, reject); 16626 } catch (e) { 16627 reject(e); 16628 } 16629 if (res) { 16630 if (typeof res.then === 'function') { 16631 res.then(resolve, reject); 16632 } else { 16633 // new syntax in Vue 2.3 16634 var comp = res.component; 16635 if (comp && typeof comp.then === 'function') { 16636 comp.then(resolve, reject); 16637 } 16638 } 16639 } 16640 } 16641 }); 16642 16643 if (!hasAsync) { next(); } 16644 } 16645} 16646 16647function flatMapComponents ( 16648 matched, 16649 fn 16650) { 16651 return flatten(matched.map(function (m) { 16652 return Object.keys(m.components).map(function (key) { return fn( 16653 m.components[key], 16654 m.instances[key], 16655 m, key 16656 ); }) 16657 })) 16658} 16659 16660function flatten (arr) { 16661 return Array.prototype.concat.apply([], arr) 16662} 16663 16664var hasSymbol = 16665 typeof Symbol === 'function' && 16666 typeof Symbol.toStringTag === 'symbol'; 16667 16668function isESModule (obj) { 16669 return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module') 16670} 16671 16672// in Webpack 2, require.ensure now also returns a Promise 16673// so the resolve/reject functions may get called an extra time
16674// if the user uses an arrow function shorthand that happens to 16675// return that Promise. 16676function once (fn) { 16677 var called = false; 16678 return function () { 16679 var args = [], len = arguments.length; 16680 while ( len-- ) args[ len ] = arguments[ len ]; 16681 16682 if (called) { return } 16683 called = true; 16684 return fn.apply(this, args) 16685 } 16686} 16687 16688/* */ 16689 16690var History = function History (router, base) { 16691 this.router = router; 16692 this.base = normalizeBase(base); 16693 // start with a route object that stands for "nowhere" 16694 this.current = START; 16695 this.pending = null; 16696 this.ready = false; 16697 this.readyCbs = []; 16698 this.readyErrorCbs = []; 16699 this.errorCbs = []; 16700 this.listeners = []; 16701}; 16702 16703History.prototype.listen = function listen (cb) { 16704 this.cb = cb; 16705}; 16706 16707History.prototype.onReady = function onReady (cb, errorCb) { 16708 if (this.ready) { 16709 cb(); 16710 } else { 16711 this.readyCbs.push(cb); 16712 if (errorCb) { 16713 this.readyErrorCbs.push(errorCb); 16714 } 16715 } 16716}; 16717 16718History.prototype.onError = function onError (errorCb) { 16719 this.errorCbs.push(errorCb); 16720}; 16721 16722History.prototype.transitionTo = function transitionTo ( 16723 location, 16724 onComplete, 16725 onAbort 16726) { 16727 var this$1 = this; 16728 16729 var route; 16730 // catch redirect option https://github.com/vuejs/vue-router/issues/3201 16731 try { 16732 route = this.router.match(location, this.current); 16733 } catch (e) { 16734 this.errorCbs.forEach(function (cb) { 16735 cb(e); 16736 }); 16737 // Exception should still be thrown 16738 throw e 16739 } 16740 this.confirmTransition( 16741 route, 16742 function () { 16743 var prev = this$1.current; 16744 this$1.updateRoute(route); 16745 onComplete && onComplete(route); 16746 this$1.ensureURL(); 16747 this$1.router.afterHooks.forEach(function (hook) { 16748 hook && hook(route, prev); 16749 }); 16750 16751 // fire ready cbs once 16752 if (!this$1.ready) { 16753 this$1.ready = true; 16754 this$1.readyCbs.forEach(function (cb) { 16755 cb(route); 16756 }); 16757 } 16758 }, 16759 function (err) { 16760 if (onAbort) { 16761 onAbort(err); 16762 } 16763 if (err && !this$1.ready) { 16764 this$1.ready = true; 16765 // Initial redirection should still trigger the onReady onSuccess 16766 // https://github.com/vuejs/vue-router/issues/3225 16767 if (!isNavigationFailure(err, NavigationFailureType.redirected)) { 16768 this$1.readyErrorCbs.forEach(function (cb) { 16769 cb(err); 16770 }); 16771 } else { 16772 this$1.readyCbs.forEach(function (cb) { 16773 cb(route); 16774 }); 16775 } 16776 } 16777 } 16778 ); 16779}; 16780 16781History.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) { 16782 var this$1 = this; 16783 16784 var current = this.current; 16785 var abort = function (err) { 16786 // changed after adding errors with 16787 // https://github.com/vuejs/vue-router/pull/3047 before that change, 16788 // redirect and aborted navigation would produce an err == null 16789 if (!isNavigationFailure(err) && isError(err)) { 16790 if (this$1.errorCbs.length) { 16791 this$1.errorCbs.forEach(function (cb) { 16792 cb(err); 16793 }); 16794 } else { 16795 warn(false, 'uncaught error during route navigation:'); 16796 console.error(err); 16797 } 16798 } 16799 onAbort && onAbort(err); 16800 }; 16801 var lastRouteIndex = route.matched.length - 1; 16802 var lastCurrentIndex = current.matched.length - 1; 16803 if ( 16804 isSameRoute(route, current) && 16805 // in the case the route map has been dynamically appended to 16806 lastRouteIndex === lastCurrentIndex && 16807 route.matched[lastRouteIndex] === current.matched[lastCurrentIndex] 16808 ) { 16809 this.ensureURL(); 16810 return abort(createNavigationDuplicatedError(current, route)) 16811 } 16812 16813 var ref = resolveQueue( 16814 this.current.matched, 16815 route.matched 16816 ); 16817 var updated = ref.updated; 16818 var deactivated = ref.deactivated; 16819 var activated = ref.activated; 16820 16821 var queue = [].concat( 16822 // in-component leave guards 16823 extractLeaveGuards(deactivated), 16824 // global before hooks 16825 this.router.beforeHooks, 16826 // in-component update hooks 16827 extractUpdateHooks(updated), 16828 // in-config enter guards 16829 activated.map(function (m) { return m.beforeEnter; }), 16830 // async components 16831 resolveAsyncComponents(activated) 16832 ); 16833 16834 this.pending = route; 16835 var iterator = function (hook, next) { 16836 if (this$1.pending !== route) { 16837 return abort(createNavigationCancelledError(current, route)) 16838 } 16839 try { 16840 hook(route, current, function (to) { 16841 if (to === false) { 16842 // next(false) -> abort navigation, ensure current URL 16843 this$1.ensureURL(true); 16844 abort(createNavigationAbortedError(current, route)); 16845 } else if (isError(to)) { 16846 this$1.ensureURL(true); 16847 abort(to); 16848 } else if ( 16849 typeof to === 'string' || 16850 (typeof to === 'object' && 16851 (typeof to.path === 'string' || typeof to.name === 'string')) 16852 ) { 16853 // next('/') or next({ path: '/' }) -> redirect 16854 abort(createNavigationRedirectedError(current, route)); 16855 if (typeof to === 'object' && to.replace) { 16856 this$1.replace(to); 16857 } else { 16858 this$1.push(to); 16859 } 16860 } else { 16861 // confirm transition and pass on the value 16862 next(to); 16863 } 16864 }); 16865 } catch (e) { 16866 abort(e); 16867 } 16868 }; 16869 16870 runQueue(queue, iterator, function () { 16871 var postEnterCbs = []; 16872 var isValid = function () { return this$1.current === route; }; 16873 // wait until async components are resolved before 16874 // extracting in-component enter guards 16875 var enterGuards = extractEnterGuards(activated, postEnterCbs, isValid); 16876 var queue = enterGuards.concat(this$1.router.resolveHooks); 16877 runQueue(queue, iterator, function () { 16878 if (this$1.pending !== route) { 16879 return abort(createNavigationCancelledError(current, route)) 16880 } 16881 this$1.pending = null; 16882 onComplete(route); 16883 if (this$1.router.app) { 16884 this$1.router.app.$nextTick(function () {
16885 postEnterCbs.forEach(function (cb) { 16886 cb(); 16887 }); 16888 }); 16889 } 16890 }); 16891 }); 16892}; 16893 16894History.prototype.updateRoute = function updateRoute (route) { 16895 this.current = route; 16896 this.cb && this.cb(route); 16897}; 16898 16899History.prototype.setupListeners = function setupListeners () { 16900 // Default implementation is empty 16901}; 16902 16903History.prototype.teardownListeners = function teardownListeners () { 16904 this.listeners.forEach(function (cleanupListener) { 16905 cleanupListener(); 16906 }); 16907 this.listeners = []; 16908}; 16909 16910function normalizeBase (base) { 16911 if (!base) { 16912 if (inBrowser) { 16913 // respect <base> tag 16914 var baseEl = document.querySelector('base'); 16915 base = (baseEl && baseEl.getAttribute('href')) || '/'; 16916 // strip full URL origin 16917 base = base.replace(/^https?:\/\/[^\/]+/, ''); 16918 } else { 16919 base = '/'; 16920 } 16921 } 16922 // make sure there's the starting slash 16923 if (base.charAt(0) !== '/') { 16924 base = '/' + base; 16925 } 16926 // remove trailing slash 16927 return base.replace(/\/$/, '') 16928} 16929 16930function resolveQueue ( 16931 current, 16932 next 16933) { 16934 var i; 16935 var max = Math.max(current.length, next.length); 16936 for (i = 0; i < max; i++) { 16937 if (current[i] !== next[i]) { 16938 break 16939 } 16940 } 16941 return { 16942 updated: next.slice(0, i), 16943 activated: next.slice(i), 16944 deactivated: current.slice(i) 16945 } 16946} 16947 16948function extractGuards ( 16949 records, 16950 name, 16951 bind, 16952 reverse 16953) { 16954 var guards = flatMapComponents(records, function (def, instance, match, key) { 16955 var guard = extractGuard(def, name); 16956 if (guard) { 16957 return Array.isArray(guard) 16958 ? guard.map(function (guard) { return bind(guard, instance, match, key); }) 16959 : bind(guard, instance, match, key) 16960 } 16961 }); 16962 return flatten(reverse ? guards.reverse() : guards) 16963} 16964 16965function extractGuard ( 16966 def, 16967 key 16968) { 16969 if (typeof def !== 'function') { 16970 // extend now so that global mixins are applied. 16971 def = _Vue.extend(def); 16972 } 16973 return def.options[key] 16974} 16975 16976function extractLeaveGuards (deactivated) { 16977 return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true) 16978} 16979 16980function extractUpdateHooks (updated) { 16981 return extractGuards(updated, 'beforeRouteUpdate', bindGuard) 16982} 16983 16984function bindGuard (guard, instance) { 16985 if (instance) { 16986 return function boundRouteGuard () { 16987 return guard.apply(instance, arguments) 16988 } 16989 } 16990} 16991 16992function extractEnterGuards ( 16993 activated, 16994 cbs, 16995 isValid 16996) { 16997 return extractGuards( 16998 activated, 16999 'beforeRouteEnter', 17000 function (guard, _, match, key) { 17001 return bindEnterGuard(guard, match, key, cbs, isValid) 17002 } 17003 ) 17004} 17005 17006function bindEnterGuard ( 17007 guard, 17008 match, 17009 key, 17010 cbs, 17011 isValid 17012) { 17013 return function routeEnterGuard (to, from, next) { 17014 return guard(to, from, function (cb) { 17015 if (typeof cb === 'function') { 17016 cbs.push(function () { 17017 // #750 17018 // if a router-view is wrapped with an out-in transition, 17019 // the instance may not have been registered at this time. 17020 // we will need to poll for registration until current route 17021 // is no longer valid. 17022 poll(cb, match.instances, key, isValid); 17023 }); 17024 } 17025 next(cb); 17026 }) 17027 } 17028} 17029 17030function poll ( 17031 cb, // somehow flow cannot infer this is a function 17032 instances, 17033 key, 17034 isValid 17035) { 17036 if ( 17037 instances[key] && 17038 !instances[key]._isBeingDestroyed // do not reuse being destroyed instance 17039 ) { 17040 cb(instances[key]); 17041 } else if (isValid()) { 17042 setTimeout(function () { 17043 poll(cb, instances, key, isValid); 17044 }, 16); 17045 } 17046} 17047 17048/* */ 17049 17050var HTML5History = /*@__PURE__*/(function (History) { 17051 function HTML5History (router, base) { 17052 History.call(this, router, base); 17053 17054 this._startLocation = getLocation(this.base); 17055 } 17056 17057 if ( History ) HTML5History.__proto__ = History; 17058 HTML5History.prototype = Object.create( History && History.prototype ); 17059 HTML5History.prototype.constructor = HTML5History; 17060 17061 HTML5History.prototype.setupListeners = function setupListeners () { 17062 var this$1 = this; 17063 17064 if (this.listeners.length > 0) { 17065 return 17066 } 17067 17068 var router = this.router; 17069 var expectScroll = router.options.scrollBehavior; 17070 var supportsScroll = supportsPushState && expectScroll; 17071 17072 if (supportsScroll) { 17073 this.listeners.push(setupScroll()); 17074 } 17075 17076 var handleRoutingEvent = function () { 17077 var current = this$1.current; 17078 17079 // Avoiding first `popstate` event dispatched in some browsers but first 17080 // history route not updated since async guard at the same time. 17081 var location = getLocation(this$1.base); 17082 if (this$1.current === START && location === this$1._startLocation) { 17083 return 17084 } 17085 17086 this$1.transitionTo(location, function (route) { 17087 if (supportsScroll) { 17088 handleScroll(router, route, current, true); 17089 } 17090 }); 17091 }; 17092 window.addEventListener('popstate', handleRoutingEvent); 17093 this.listeners.push(function () { 17094 window.removeEventListener('popstate', handleRoutingEvent); 17095 }); 17096 }; 17097 17098 HTML5History.prototype.go = function go (n) { 17099 window.history.go(n); 17100 }; 17101 17102 HTML5History.prototype.push = function push (location, onComplete, onAbort) { 17103 var this$1 = this; 17104 17105 var ref = this; 17106 var fromRoute = ref.current; 17107 this.transitionTo(location, function (route) { 17108 pushState(cleanPath(this$1.base + route.fullPath)); 17109 handleScroll(this$1.router, route, fromRoute, false); 17110 onComplete && onComplete(route); 17111 }, onAbort); 17112 }; 17113 17114 HTML5History.prototype.replace = function replace (location, onComplete, onAbort) { 17115 var this$1 = this; 17116 17117 var ref = this; 17118 var fromRoute = ref.current; 17119 this.transitionTo(location, function (route) { 17120 replaceState(cleanPath(this$1.base + route.fullPath)); 17121 handleScroll(this$1.router, route, fromRoute, false); 17122 onComplete && onComplete(route); 17123 }, onAbort); 17124 }; 17125 17126 HTML5History.prototype.ensureURL = function ensureURL (push) { 17127 if (getLocation(this.base) !== this.current.fullPath) { 17128 var current = cleanPath(this.base + this.current.fullPath); 17129 push ? pushState(current) : replaceState(current); 17130 } 17131 }; 17132 17133 HTML5History.prototype.getCurrentLocation = function getCurrentLocation () { 17134 return getLocation(this.base) 17135 }; 17136 17137 return HTML5History; 17138}
17138(History)); 17139 17140function getLocation (base) { 17141 var path = decodeURI(window.location.pathname); 17142 if (base && path.toLowerCase().indexOf(base.toLowerCase()) === 0) { 17143 path = path.slice(base.length); 17144 } 17145 return (path || '/') + window.location.search + window.location.hash 17146} 17147 17148/* */ 17149 17150var HashHistory = /*@__PURE__*/(function (History) { 17151 function HashHistory (router, base, fallback) { 17152 History.call(this, router, base); 17153 // check history fallback deeplinking 17154 if (fallback && checkFallback(this.base)) { 17155 return 17156 } 17157 ensureSlash(); 17158 } 17159 17160 if ( History ) HashHistory.__proto__ = History; 17161 HashHistory.prototype = Object.create( History && History.prototype ); 17162 HashHistory.prototype.constructor = HashHistory; 17163 17164 // this is delayed until the app mounts 17165 // to avoid the hashchange listener being fired too early 17166 HashHistory.prototype.setupListeners = function setupListeners () { 17167 var this$1 = this; 17168 17169 if (this.listeners.length > 0) { 17170 return 17171 } 17172 17173 var router = this.router; 17174 var expectScroll = router.options.scrollBehavior; 17175 var supportsScroll = supportsPushState && expectScroll; 17176 17177 if (supportsScroll) { 17178 this.listeners.push(setupScroll()); 17179 } 17180 17181 var handleRoutingEvent = function () { 17182 var current = this$1.current; 17183 if (!ensureSlash()) { 17184 return 17185 } 17186 this$1.transitionTo(getHash(), function (route) { 17187 if (supportsScroll) { 17188 handleScroll(this$1.router, route, current, true); 17189 } 17190 if (!supportsPushState) { 17191 replaceHash(route.fullPath); 17192 } 17193 }); 17194 }; 17195 var eventType = supportsPushState ? 'popstate' : 'hashchange'; 17196 window.addEventListener( 17197 eventType, 17198 handleRoutingEvent 17199 ); 17200 this.listeners.push(function () { 17201 window.removeEventListener(eventType, handleRoutingEvent); 17202 }); 17203 }; 17204 17205 HashHistory.prototype.push = function push (location, onComplete, onAbort) { 17206 var this$1 = this; 17207 17208 var ref = this; 17209 var fromRoute = ref.current; 17210 this.transitionTo( 17211 location, 17212 function (route) { 17213 pushHash(route.fullPath); 17214 handleScroll(this$1.router, route, fromRoute, false); 17215 onComplete && onComplete(route); 17216 }, 17217 onAbort 17218 ); 17219 }; 17220 17221 HashHistory.prototype.replace = function replace (location, onComplete, onAbort) { 17222 var this$1 = this; 17223 17224 var ref = this; 17225 var fromRoute = ref.current; 17226 this.transitionTo( 17227 location, 17228 function (route) { 17229 replaceHash(route.fullPath); 17230 handleScroll(this$1.router, route, fromRoute, false); 17231 onComplete && onComplete(route); 17232 }, 17233 onAbort 17234 ); 17235 }; 17236 17237 HashHistory.prototype.go = function go (n) { 17238 window.history.go(n); 17239 }; 17240 17241 HashHistory.prototype.ensureURL = function ensureURL (push) { 17242 var current = this.current.fullPath; 17243 if (getHash() !== current) { 17244 push ? pushHash(current) : replaceHash(current); 17245 } 17246 }; 17247 17248 HashHistory.prototype.getCurrentLocation = function getCurrentLocation () { 17249 return getHash() 17250 }; 17251 17252 return HashHistory; 17253}(History)); 17254 17255function checkFallback (base) { 17256 var location = getLocation(base); 17257 if (!/^\/#/.test(location)) { 17258 window.location.replace(cleanPath(base + '/#' + location)); 17259 return true 17260 } 17261} 17262 17263function ensureSlash () { 17264 var path = getHash(); 17265 if (path.charAt(0) === '/') { 17266 return true 17267 } 17268 replaceHash('/' + path); 17269 return false 17270} 17271 17272function getHash () { 17273 // We can't use window.location.hash here because it's not 17274 // consistent across browsers - Firefox will pre-decode it! 17275 var href = window.location.href; 17276 var index = href.indexOf('#'); 17277 // empty path 17278 if (index < 0) { return '' } 17279 17280 href = href.slice(index + 1); 17281 // decode the hash but not the search or hash 17282 // as search(query) is already decoded 17283 // https://github.com/vuejs/vue-router/issues/2708 17284 var searchIndex = href.indexOf('?'); 17285 if (searchIndex < 0) { 17286 var hashIndex = href.indexOf('#'); 17287 if (hashIndex > -1) { 17288 href = decodeURI(href.slice(0, hashIndex)) + href.slice(hashIndex); 17289 } else { href = decodeURI(href); } 17290 } else { 17291 href = decodeURI(href.slice(0, searchIndex)) + href.slice(searchIndex); 17292 } 17293 17294 return href 17295} 17296 17297function getUrl (path) { 17298 var href = window.location.href; 17299 var i = href.indexOf('#'); 17300 var base = i >= 0 ? href.slice(0, i) : href; 17301 return (base + "#" + path) 17302} 17303 17304function pushHash (path) { 17305 if (supportsPushState) { 17306 pushState(getUrl(path)); 17307 } else { 17308 window.location.hash = path; 17309 } 17310} 17311 17312function replaceHash (path) { 17313 if (supportsPushState) { 17314 replaceState(getUrl(path)); 17315 } else { 17316 window.location.replace(getUrl(path)); 17317 } 17318} 17319 17320/* */ 17321 17322var AbstractHistory = /*@__PURE__*/(function (History) { 17323 function AbstractHistory (router, base) { 17324 History.call(this, router, base); 17325 this.stack = []; 17326 this.index = -1; 17327 } 17328 17329 if ( History ) AbstractHistory.__proto__ = History; 17330 AbstractHistory.prototype = Object.create( History && History.prototype ); 17331 AbstractHistory.prototype.constructor = AbstractHistory; 17332 17333 AbstractHistory.prototype.push = function push (location, onComplete, onAbort) { 17334 var this$1 = this; 17335 17336 this.transitionTo( 17337 location, 17338 function (route) { 17339 this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route); 17340 this$1.index++; 17341 onComplete && onComplete(route); 17342 }, 17343 onAbort 17344 ); 17345 }; 17346 17347 AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) { 17348 var this$1 = this; 17349 17350 this.transitionTo( 17351 location, 17352 function (route) { 17353 this$1.stack = this$1.stack.slice(0, this$1.index).concat(route); 17354 onComplete && onComplete(route); 17355 }, 17356 onAbort 17357 ); 17358 }; 17359 17360 AbstractHistory.prototype.go = function go (n) { 17361 var this$1 = this; 17362 17363 var targetIndex = this.index + n; 17364 if (targetIndex < 0 || targetIndex >= this.stack.length) { 17365 return 17366 } 17367 var route = this.stack[targetIndex]; 17368 this.confirmTransition( 17369 route, 17370 function () { 17371 this$1.index = targetIndex; 17372 this$1.updateRoute(route); 17373 }, 17374 function (err) { 17375 if (isNavigationFailure(err, NavigationFailureType.duplicated)) { 17376 this$1.index = targetIndex; 17377 } 17378 } 17379 ); 17380 }; 17381 17382 AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () { 17383 var current = this.stack[this.stack.length - 1]; 17384 return current ? current.fullPath : '/' 17385 }; 17386 17387 AbstractHistory.prototype.ensureURL = function ensureURL () { 17388 // noop 17389 }; 17390 17391 return AbstractHistory; 17392}
17392(History)); 17393 17394/* */ 17395 17396var VueRouter = function VueRouter (options) { 17397 if ( options === void 0 ) options = {}; 17398 17399 this.app = null; 17400 this.apps = []; 17401 this.options = options; 17402 this.beforeHooks = []; 17403 this.resolveHooks = []; 17404 this.afterHooks = []; 17405 this.matcher = createMatcher(options.routes || [], this); 17406 17407 var mode = options.mode || 'hash'; 17408 this.fallback = 17409 mode === 'history' && !supportsPushState && options.fallback !== false; 17410 if (this.fallback) { 17411 mode = 'hash'; 17412 } 17413 if (!inBrowser) { 17414 mode = 'abstract'; 17415 } 17416 this.mode = mode; 17417 17418 switch (mode) { 17419 case 'history': 17420 this.history = new HTML5History(this, options.base); 17421 break 17422 case 'hash': 17423 this.history = new HashHistory(this, options.base, this.fallback); 17424 break 17425 case 'abstract': 17426 this.history = new AbstractHistory(this, options.base); 17427 break 17428 default: 17429 if (process.env.NODE_ENV !== 'production') { 17430 assert(false, ("invalid mode: " + mode)); 17431 } 17432 } 17433}; 17434 17435var prototypeAccessors = { currentRoute: { configurable: true } }; 17436 17437VueRouter.prototype.match = function match (raw, current, redirectedFrom) { 17438 return this.matcher.match(raw, current, redirectedFrom) 17439}; 17440 17441prototypeAccessors.currentRoute.get = function () { 17442 return this.history && this.history.current 17443}; 17444 17445VueRouter.prototype.init = function init (app /* Vue component instance */) { 17446 var this$1 = this; 17447 17448 process.env.NODE_ENV !== 'production' && 17449 assert( 17450 install.installed, 17451 "not installed. Make sure to call `Vue.use(VueRouter)` " + 17452 "before creating root instance." 17453 ); 17454 17455 this.apps.push(app); 17456 17457 // set up app destroyed handler 17458 // https://github.com/vuejs/vue-router/issues/2639 17459 app.$once('hook:destroyed', function () { 17460 // clean out app from this.apps array once destroyed 17461 var index = this$1.apps.indexOf(app); 17462 if (index > -1) { this$1.apps.splice(index, 1); } 17463 // ensure we still have a main app or null if no apps 17464 // we do not release the router so it can be reused 17465 if (this$1.app === app) { this$1.app = this$1.apps[0] || null; } 17466 17467 if (!this$1.app) { 17468 // clean up event listeners 17469 // https://github.com/vuejs/vue-router/issues/2341 17470 this$1.history.teardownListeners(); 17471 } 17472 }); 17473 17474 // main app previously initialized 17475 // return as we don't need to set up new history listener 17476 if (this.app) { 17477 return 17478 } 17479 17480 this.app = app; 17481 17482 var history = this.history; 17483 17484 if (history instanceof HTML5History || history instanceof HashHistory) { 17485 var handleInitialScroll = function (routeOrError) { 17486 var from = history.current; 17487 var expectScroll = this$1.options.scrollBehavior; 17488 var supportsScroll = supportsPushState && expectScroll; 17489 17490 if (supportsScroll && 'fullPath' in routeOrError) { 17491 handleScroll(this$1, routeOrError, from, false); 17492 } 17493 }; 17494 var setupListeners = function (routeOrError) { 17495 history.setupListeners(); 17496 handleInitialScroll(routeOrError); 17497 }; 17498 history.transitionTo( 17499 history.getCurrentLocation(), 17500 setupListeners, 17501 setupListeners 17502 ); 17503 } 17504 17505 history.listen(function (route) { 17506 this$1.apps.forEach(function (app) { 17507 app._route = route; 17508 }); 17509 }); 17510}; 17511 17512VueRouter.prototype.beforeEach = function beforeEach (fn) { 17513 return registerHook(this.beforeHooks, fn) 17514}; 17515 17516VueRouter.prototype.beforeResolve = function beforeResolve (fn) { 17517 return registerHook(this.resolveHooks, fn) 17518}; 17519 17520VueRouter.prototype.afterEach = function afterEach (fn) { 17521 return registerHook(this.afterHooks, fn) 17522}; 17523 17524VueRouter.prototype.onReady = function onReady (cb, errorCb) { 17525 this.history.onReady(cb, errorCb); 17526}; 17527 17528VueRouter.prototype.onError = function onError (errorCb) { 17529 this.history.onError(errorCb); 17530}; 17531 17532VueRouter.prototype.push = function push (location, onComplete, onAbort) { 17533 var this$1 = this; 17534 17535 // $flow-disable-line 17536 if (!onComplete && !onAbort && typeof Promise !== 'undefined') { 17537 return new Promise(function (resolve, reject) { 17538 this$1.history.push(location, resolve, reject); 17539 }) 17540 } else { 17541 this.history.push(location, onComplete, onAbort); 17542 } 17543}; 17544 17545VueRouter.prototype.replace = function replace (location, onComplete, onAbort) { 17546 var this$1 = this; 17547 17548 // $flow-disable-line 17549 if (!onComplete && !onAbort && typeof Promise !== 'undefined') { 17550 return new Promise(function (resolve, reject) { 17551 this$1.history.replace(location, resolve, reject); 17552 }) 17553 } else { 17554 this.history.replace(location, onComplete, onAbort); 17555 } 17556}; 17557 17558VueRouter.prototype.go = function go (n) { 17559 this.history.go(n); 17560}; 17561 17562VueRouter.prototype.back = function back () { 17563 this.go(-1); 17564}; 17565 17566VueRouter.prototype.forward = function forward () { 17567 this.go(1); 17568}; 17569 17570VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) { 17571 var route = to 17572 ? to.matched 17573 ? to 17574 : this.resolve(to).route 17575 : this.currentRoute; 17576 if (!route) { 17577 return [] 17578 } 17579 return [].concat.apply( 17580 [], 17581 route.matched.map(function (m) { 17582 return Object.keys(m.components).map(function (key) { 17583 return m.components[key] 17584 }) 17585 }) 17586 ) 17587}; 17588 17589VueRouter.prototype.resolve = function resolve ( 17590 to,
vendor: 9,802 bytes, lines 17591-17942
17591 current, 17592 append 17593) { 17594 current = current || this.history.current; 17595 var location = normalizeLocation(to, current, append, this); 17596 var route = this.match(location, current); 17597 var fullPath = route.redirectedFrom || route.fullPath; 17598 var base = this.history.base; 17599 var href = createHref(base, fullPath, this.mode); 17600 return { 17601 location: location, 17602 route: route, 17603 href: href, 17604 // for backwards compat 17605 normalizedTo: location, 17606 resolved: route 17607 } 17608}; 17609 17610VueRouter.prototype.addRoutes = function addRoutes (routes) { 17611 this.matcher.addRoutes(routes); 17612 if (this.history.current !== START) { 17613 this.history.transitionTo(this.history.getCurrentLocation()); 17614 } 17615}; 17616 17617Object.defineProperties( VueRouter.prototype, prototypeAccessors ); 17618 17619function registerHook (list, fn) { 17620 list.push(fn); 17621 return function () { 17622 var i = list.indexOf(fn); 17623 if (i > -1) { list.splice(i, 1); } 17624 } 17625} 17626 17627function createHref (base, fullPath, mode) { 17628 var path = mode === 'hash' ? '#' + fullPath : fullPath; 17629 return base ? cleanPath(base + '/' + path) : path 17630} 17631 17632VueRouter.install = install; 17633VueRouter.version = '3.4.3'; 17634VueRouter.isNavigationFailure = isNavigationFailure; 17635VueRouter.NavigationFailureType = NavigationFailureType; 17636 17637if (inBrowser && window.Vue) { 17638 window.Vue.use(VueRouter); 17639} 17640 17641/* harmony default export */ __webpack_exports__["default"] = (VueRouter); 17642 17643/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1))) 17644 17645/***/ }), 17646/* 43 */, 17647/* 44 */ 17648/***/ (function(module, exports) { 17649 17650/* 17651 MIT License http://www.opensource.org/licenses/mit-license.php 17652 Author Tobias Koppers @sokra 17653*/ 17654// css base code, injected by the css-loader 17655module.exports = function(useSourceMap) { 17656 var list = []; 17657 17658 // return the list of modules as css string 17659 list.toString = function toString() { 17660 return this.map(function (item) { 17661 var content = cssWithMappingToString(item, useSourceMap); 17662 if(item[2]) { 17663 return "@media " + item[2] + "{" + content + "}"; 17664 } else { 17665 return content; 17666 } 17667 }).join(""); 17668 }; 17669 17670 // import a list of modules into the list 17671 list.i = function(modules, mediaQuery) { 17672 if(typeof modules === "string") 17673 modules = [[null, modules, ""]]; 17674 var alreadyImportedModules = {}; 17675 for(var i = 0; i < this.length; i++) { 17676 var id = this[i][0]; 17677 if(typeof id === "number") 17678 alreadyImportedModules[id] = true; 17679 } 17680 for(i = 0; i < modules.length; i++) { 17681 var item = modules[i]; 17682 // skip already imported module 17683 // this implementation is not 100% perfect for weird media query combinations 17684 // when a module is imported multiple times with different media queries. 17685 // I hope this will never occur (Hey this way we have smaller bundles) 17686 if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { 17687 if(mediaQuery && !item[2]) { 17688 item[2] = mediaQuery; 17689 } else if(mediaQuery) { 17690 item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; 17691 } 17692 list.push(item); 17693 } 17694 } 17695 }; 17696 return list; 17697}; 17698 17699function cssWithMappingToString(item, useSourceMap) { 17700 var content = item[1] || ''; 17701 var cssMapping = item[3]; 17702 if (!cssMapping) { 17703 return content; 17704 } 17705 17706 if (useSourceMap && typeof btoa === 'function') { 17707 var sourceMapping = toComment(cssMapping); 17708 var sourceURLs = cssMapping.sources.map(function (source) { 17709 return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' 17710 }); 17711 17712 return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); 17713 } 17714 17715 return [content].join('\n'); 17716} 17717 17718// Adapted from convert-source-map (MIT) 17719function toComment(sourceMap) { 17720 // eslint-disable-next-line no-undef 17721 var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); 17722 var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; 17723 17724 return '/*# ' + data + ' */'; 17725} 17726 17727 17728/***/ }), 17729/* 45 */ 17730/***/ (function(module, exports, __webpack_require__) { 17731 17732/* 17733 MIT License http://www.opensource.org/licenses/mit-license.php 17734 Author Tobias Koppers @sokra 17735 Modified by Evan You @yyx990803 17736*/ 17737 17738var hasDocument = typeof document !== 'undefined' 17739 17740if (typeof DEBUG !== 'undefined' && DEBUG) { 17741 if (!hasDocument) { 17742 throw new Error( 17743 'vue-style-loader cannot be used in a non-browser environment. ' + 17744 "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment." 17745 ) } 17746} 17747 17748var listToStyles = __webpack_require__(19) 17749 17750/* 17751type StyleObject = { 17752 id: number; 17753 parts: Array<StyleObjectPart> 17754} 17755 17756type StyleObjectPart = { 17757 css: string; 17758 media: string; 17759 sourceMap: ?string 17760} 17761*/ 17762 17763var stylesInDom = {/* 17764 [id: number]: { 17765 id: number, 17766 refs: number, 17767 parts: Array<(obj?: StyleObjectPart) => void> 17768 } 17769*/} 17770 17771var head = hasDocument && (document.head || document.getElementsByTagName('head')[0]) 17772var singletonElement = null 17773var singletonCounter = 0 17774var isProduction = false 17775var noop = function () {} 17776var options = null 17777var ssrIdKey = 'data-vue-ssr-id' 17778 17779// Force single-tag solution on IE6-9, which has a hard limit on the # of <style> 17780// tags it will allow on a page 17781var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase()) 17782 17783module.exports = function (parentId, list, _isProduction, _options) { 17784 isProduction = _isProduction 17785 17786 options = _options || {} 17787 17788 var styles = listToStyles(parentId, list) 17789 addStylesToDom(styles) 17790 17791 return function update (newList) { 17792 var mayRemove = [] 17793 for (var i = 0; i < styles.length; i++) { 17794 var item = styles[i] 17795 var domStyle = stylesInDom[item.id] 17796 domStyle.refs-- 17797 mayRemove.push(domStyle) 17798 } 17799 if (newList) { 17800 styles = listToStyles(parentId, newList) 17801 addStylesToDom(styles) 17802 } else { 17803 styles = [] 17804 } 17805 for (var i = 0; i < mayRemove.length; i++) { 17806 var domStyle = mayRemove[i] 17807 if (domStyle.refs === 0) { 17808 for (var j = 0; j < domStyle.parts.length; j++) { 17809 domStyle.parts[j]() 17810 } 17811 delete stylesInDom[domStyle.id] 17812 } 17813 } 17814 } 17815} 17816 17817function addStylesToDom (styles /* Array<StyleObject> */) { 17818 for (var i = 0; i < styles.length; i++) { 17819 var item = styles[i] 17820 var domStyle = stylesInDom[item.id] 17821 if (domStyle) { 17822 domStyle.refs++ 17823 for (var j = 0; j < domStyle.parts.length; j++) { 17824 domStyle.parts[j](item.parts[j]) 17825 } 17826 for (; j < item.parts.length; j++) { 17827 domStyle.parts.push(addStyle(item.parts[j])) 17828 } 17829 if (domStyle.parts.length > item.parts.length) { 17830 domStyle.parts.length = item.parts.length 17831 } 17832 } else { 17833 var parts = [] 17834 for (var j = 0; j < item.parts.length; j++) { 17835 parts.push(addStyle(item.parts[j])) 17836 } 17837 stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts } 17838 } 17839 } 17840} 17841 17842function createStyleElement () { 17843 var styleElement = document.createElement('style') 17844 styleElement.type = 'text/css' 17845 head.appendChild(styleElement) 17846 return styleElement 17847} 17848 17849function addStyle (obj /* StyleObjectPart */) { 17850 var update, remove 17851 var styleElement = document.querySelector('style[' + ssrIdKey + '~="' + obj.id + '"]') 17852 17853 if (styleElement) { 17854 if (isProduction) { 17855 // has SSR styles and in production mode. 17856 // simply do nothing. 17857 return noop 17858 } else { 17859 // has SSR styles but in dev mode. 17860 // for some reason Chrome can't handle source map in server-rendered 17861 // style tags - source maps in <style> only works if the style tag is 17862 // created and inserted dynamically. So we remove the server rendered 17863 // styles and inject new ones. 17864 styleElement.parentNode.removeChild(styleElement) 17865 } 17866 } 17867 17868 if (isOldIE) { 17869 // use singleton mode for IE9. 17870 var styleIndex = singletonCounter++ 17871 styleElement = singletonElement || (singletonElement = createStyleElement()) 17872 update = applyToSingletonTag.bind(null, styleElement, styleIndex, false) 17873 remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true) 17874 } else { 17875 // use multi-style-tag mode in all other cases 17876 styleElement = createStyleElement() 17877 update = applyToTag.bind(null, styleElement) 17878 remove = function () { 17879 styleElement.parentNode.removeChild(styleElement) 17880 } 17881 } 17882 17883 update(obj) 17884 17885 return function updateStyle (newObj /* StyleObjectPart */) { 17886 if (newObj) { 17887 if (newObj.css === obj.css && 17888 newObj.media === obj.media && 17889 newObj.sourceMap === obj.sourceMap) { 17890 return 17891 } 17892 update(obj = newObj) 17893 } else { 17894 remove() 17895 } 17896 } 17897} 17898 17899var replaceText = (function () { 17900 var textStore = [] 17901 17902 return function (index, replacement) { 17903 textStore[index] = replacement 17904 return textStore.filter(Boolean).join('\n') 17905 } 17906})() 17907 17908function applyToSingletonTag (styleElement, index, remove, obj) { 17909 var css = remove ? '' : obj.css 17910 17911 if (styleElement.styleSheet) { 17912 styleElement.styleSheet.cssText = replaceText(index, css) 17913 } else { 17914 var cssNode = document.createTextNode(css) 17915 var childNodes = styleElement.childNodes 17916 if (childNodes[index]) styleElement.removeChild(childNodes[index]) 17917 if (childNodes.length) { 17918 styleElement.insertBefore(cssNode, childNodes[index]) 17919 } else { 17920 styleElement.appendChild(cssNode) 17921 } 17922 } 17923} 17924 17925function applyToTag (styleElement, obj) { 17926 var css = obj.css 17927 var media = obj.media 17928 var sourceMap = obj.sourceMap 17929 17930 if (media) { 17931 styleElement.setAttribute('media', media) 17932 } 17933 if (options.ssrId) { 17934 styleElement.setAttribute(ssrIdKey, obj.id) 17935 } 17936 17937 if (sourceMap) { 17938 // https://developer.chrome.com/devtools/docs/javascript-debugging 17939 // this makes source maps inside style tags work properly in Chrome 17940 css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */' 17941 // http://stackoverflow.com/a/26603875 17942 css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)
17942))) + ' */' 17943 } 17944 17945 if (styleElement.styleSheet) { 17946 styleElement.styleSheet.cssText = css 17947 } else { 17948 while (styleElement.firstChild) { 17949 styleElement.removeChild(styleElement.firstChild) 17950 } 17951 styleElement.appendChild(document.createTextNode(css)) 17952 } 17953} 17954 17955 17956/***/ }) 17957/******/ ]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.