UNPKG

291 kBJavaScriptView Raw
1(function webpackUniversalModuleDefinition(root, factory) {
2 if(typeof exports === 'object' && typeof module === 'object')
3 module.exports = factory();
4 else if(typeof define === 'function' && define.amd)
5 define([], factory);
6 else if(typeof exports === 'object')
7 exports["Aimer"] = factory();
8 else
9 root["Aimer"] = factory();
10})(this, function() {
11return /******/ (function(modules) { // webpackBootstrap
12/******/ // The module cache
13/******/ var installedModules = {};
14/******/
15/******/ // The require function
16/******/ function __webpack_require__(moduleId) {
17/******/
18/******/ // Check if module is in cache
19/******/ if(installedModules[moduleId]) {
20/******/ return installedModules[moduleId].exports;
21/******/ }
22/******/ // Create a new module (and put it into the cache)
23/******/ var module = installedModules[moduleId] = {
24/******/ i: moduleId,
25/******/ l: false,
26/******/ exports: {}
27/******/ };
28/******/
29/******/ // Execute the module function
30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31/******/
32/******/ // Flag the module as loaded
33/******/ module.l = true;
34/******/
35/******/ // Return the exports of the module
36/******/ return module.exports;
37/******/ }
38/******/
39/******/
40/******/ // expose the modules object (__webpack_modules__)
41/******/ __webpack_require__.m = modules;
42/******/
43/******/ // expose the module cache
44/******/ __webpack_require__.c = installedModules;
45/******/
46/******/ // define getter function for harmony exports
47/******/ __webpack_require__.d = function(exports, name, getter) {
48/******/ if(!__webpack_require__.o(exports, name)) {
49/******/ Object.defineProperty(exports, name, {
50/******/ configurable: false,
51/******/ enumerable: true,
52/******/ get: getter
53/******/ });
54/******/ }
55/******/ };
56/******/
57/******/ // getDefaultExport function for compatibility with non-harmony modules
58/******/ __webpack_require__.n = function(module) {
59/******/ var getter = module && module.__esModule ?
60/******/ function getDefault() { return module['default']; } :
61/******/ function getModuleExports() { return module; };
62/******/ __webpack_require__.d(getter, 'a', getter);
63/******/ return getter;
64/******/ };
65/******/
66/******/ // Object.prototype.hasOwnProperty.call
67/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
68/******/
69/******/ // __webpack_public_path__
70/******/ __webpack_require__.p = "/";
71/******/
72/******/ // Load entry module and return exports
73/******/ return __webpack_require__(__webpack_require__.s = 5);
74/******/ })
75/************************************************************************/
76/******/ ([
77/* 0 */
78/*!***********************************!*\
79 !*** (webpack)/buildin/global.js ***!
80 \***********************************/
81/*! dynamic exports provided */
82/*! all exports used */
83/***/ (function(module, exports) {
84
85var g;
86
87// This works in non-strict mode
88g = (function() {
89 return this;
90})();
91
92try {
93 // This works if eval is allowed (see CSP)
94 g = g || Function("return this")() || (1,eval)("this");
95} catch(e) {
96 // This works if the window reference is available
97 if(typeof window === "object")
98 g = window;
99}
100
101// g can still be undefined, but nothing to do about it...
102// We return undefined, instead of nothing here, so it's
103// easier to handle this case. if(!global) { ...}
104
105module.exports = g;
106
107
108/***/ }),
109/* 1 */
110/*!**************************************************!*\
111 !*** ./node_modules/vue/dist/vue.runtime.esm.js ***!
112 \**************************************************/
113/*! exports provided: default */
114/*! exports used: default */
115/***/ (function(module, __webpack_exports__, __webpack_require__) {
116
117"use strict";
118/* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*!
119 * Vue.js v2.5.2
120 * (c) 2014-2017 Evan You
121 * Released under the MIT License.
122 */
123/* */
124
125// these helpers produces better vm code in JS engines due to their
126// explicitness and function inlining
127function isUndef (v) {
128 return v === undefined || v === null
129}
130
131function isDef (v) {
132 return v !== undefined && v !== null
133}
134
135function isTrue (v) {
136 return v === true
137}
138
139function isFalse (v) {
140 return v === false
141}
142
143/**
144 * Check if value is primitive
145 */
146function isPrimitive (value) {
147 return (
148 typeof value === 'string' ||
149 typeof value === 'number' ||
150 typeof value === 'boolean'
151 )
152}
153
154/**
155 * Quick object check - this is primarily used to tell
156 * Objects from primitive values when we know the value
157 * is a JSON-compliant type.
158 */
159function isObject (obj) {
160 return obj !== null && typeof obj === 'object'
161}
162
163/**
164 * Get the raw type string of a value e.g. [object Object]
165 */
166var _toString = Object.prototype.toString;
167
168function toRawType (value) {
169 return _toString.call(value).slice(8, -1)
170}
171
172/**
173 * Strict object type check. Only returns true
174 * for plain JavaScript objects.
175 */
176function isPlainObject (obj) {
177 return _toString.call(obj) === '[object Object]'
178}
179
180function isRegExp (v) {
181 return _toString.call(v) === '[object RegExp]'
182}
183
184/**
185 * Check if val is a valid array index.
186 */
187function isValidArrayIndex (val) {
188 var n = parseFloat(String(val));
189 return n >= 0 && Math.floor(n) === n && isFinite(val)
190}
191
192/**
193 * Convert a value to a string that is actually rendered.
194 */
195function toString (val) {
196 return val == null
197 ? ''
198 : typeof val === 'object'
199 ? JSON.stringify(val, null, 2)
200 : String(val)
201}
202
203/**
204 * Convert a input value to a number for persistence.
205 * If the conversion fails, return original string.
206 */
207function toNumber (val) {
208 var n = parseFloat(val);
209 return isNaN(n) ? val : n
210}
211
212/**
213 * Make a map and return a function for checking if a key
214 * is in that map.
215 */
216function makeMap (
217 str,
218 expectsLowerCase
219) {
220 var map = Object.create(null);
221 var list = str.split(',');
222 for (var i = 0; i < list.length; i++) {
223 map[list[i]] = true;
224 }
225 return expectsLowerCase
226 ? function (val) { return map[val.toLowerCase()]; }
227 : function (val) { return map[val]; }
228}
229
230/**
231 * Check if a tag is a built-in tag.
232 */
233var isBuiltInTag = makeMap('slot,component', true);
234
235/**
236 * Check if a attribute is a reserved attribute.
237 */
238var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
239
240/**
241 * Remove an item from an array
242 */
243function remove (arr, item) {
244 if (arr.length) {
245 var index = arr.indexOf(item);
246 if (index > -1) {
247 return arr.splice(index, 1)
248 }
249 }
250}
251
252/**
253 * Check whether the object has the property.
254 */
255var hasOwnProperty = Object.prototype.hasOwnProperty;
256function hasOwn (obj, key) {
257 return hasOwnProperty.call(obj, key)
258}
259
260/**
261 * Create a cached version of a pure function.
262 */
263function cached (fn) {
264 var cache = Object.create(null);
265 return (function cachedFn (str) {
266 var hit = cache[str];
267 return hit || (cache[str] = fn(str))
268 })
269}
270
271/**
272 * Camelize a hyphen-delimited string.
273 */
274var camelizeRE = /-(\w)/g;
275var camelize = cached(function (str) {
276 return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
277});
278
279/**
280 * Capitalize a string.
281 */
282var capitalize = cached(function (str) {
283 return str.charAt(0).toUpperCase() + str.slice(1)
284});
285
286/**
287 * Hyphenate a camelCase string.
288 */
289var hyphenateRE = /\B([A-Z])/g;
290var hyphenate = cached(function (str) {
291 return str.replace(hyphenateRE, '-$1').toLowerCase()
292});
293
294/**
295 * Simple bind, faster than native
296 */
297function bind (fn, ctx) {
298 function boundFn (a) {
299 var l = arguments.length;
300 return l
301 ? l > 1
302 ? fn.apply(ctx, arguments)
303 : fn.call(ctx, a)
304 : fn.call(ctx)
305 }
306 // record original fn length
307 boundFn._length = fn.length;
308 return boundFn
309}
310
311/**
312 * Convert an Array-like object to a real Array.
313 */
314function toArray (list, start) {
315 start = start || 0;
316 var i = list.length - start;
317 var ret = new Array(i);
318 while (i--) {
319 ret[i] = list[i + start];
320 }
321 return ret
322}
323
324/**
325 * Mix properties into target object.
326 */
327function extend (to, _from) {
328 for (var key in _from) {
329 to[key] = _from[key];
330 }
331 return to
332}
333
334/**
335 * Merge an Array of Objects into a single Object.
336 */
337function toObject (arr) {
338 var res = {};
339 for (var i = 0; i < arr.length; i++) {
340 if (arr[i]) {
341 extend(res, arr[i]);
342 }
343 }
344 return res
345}
346
347/**
348 * Perform no operation.
349 * Stubbing args to make Flow happy without leaving useless transpiled code
350 * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/)
351 */
352function noop (a, b, c) {}
353
354/**
355 * Always return false.
356 */
357var no = function (a, b, c) { return false; };
358
359/**
360 * Return same value
361 */
362var identity = function (_) { return _; };
363
364/**
365 * Generate a static keys string from compiler modules.
366 */
367
368
369/**
370 * Check if two values are loosely equal - that is,
371 * if they are plain objects, do they have the same shape?
372 */
373function looseEqual (a, b) {
374 if (a === b) { return true }
375 var isObjectA = isObject(a);
376 var isObjectB = isObject(b);
377 if (isObjectA && isObjectB) {
378 try {
379 var isArrayA = Array.isArray(a);
380 var isArrayB = Array.isArray(b);
381 if (isArrayA && isArrayB) {
382 return a.length === b.length && a.every(function (e, i) {
383 return looseEqual(e, b[i])
384 })
385 } else if (!isArrayA && !isArrayB) {
386 var keysA = Object.keys(a);
387 var keysB = Object.keys(b);
388 return keysA.length === keysB.length && keysA.every(function (key) {
389 return looseEqual(a[key], b[key])
390 })
391 } else {
392 /* istanbul ignore next */
393 return false
394 }
395 } catch (e) {
396 /* istanbul ignore next */
397 return false
398 }
399 } else if (!isObjectA && !isObjectB) {
400 return String(a) === String(b)
401 } else {
402 return false
403 }
404}
405
406function looseIndexOf (arr, val) {
407 for (var i = 0; i < arr.length; i++) {
408 if (looseEqual(arr[i], val)) { return i }
409 }
410 return -1
411}
412
413/**
414 * Ensure a function is called only once.
415 */
416function once (fn) {
417 var called = false;
418 return function () {
419 if (!called) {
420 called = true;
421 fn.apply(this, arguments);
422 }
423 }
424}
425
426var SSR_ATTR = 'data-server-rendered';
427
428var ASSET_TYPES = [
429 'component',
430 'directive',
431 'filter'
432];
433
434var LIFECYCLE_HOOKS = [
435 'beforeCreate',
436 'created',
437 'beforeMount',
438 'mounted',
439 'beforeUpdate',
440 'updated',
441 'beforeDestroy',
442 'destroyed',
443 'activated',
444 'deactivated',
445 'errorCaptured'
446];
447
448/* */
449
450var config = ({
451 /**
452 * Option merge strategies (used in core/util/options)
453 */
454 optionMergeStrategies: Object.create(null),
455
456 /**
457 * Whether to suppress warnings.
458 */
459 silent: false,
460
461 /**
462 * Show production mode tip message on boot?
463 */
464 productionTip: "production" !== 'production',
465
466 /**
467 * Whether to enable devtools
468 */
469 devtools: "production" !== 'production',
470
471 /**
472 * Whether to record perf
473 */
474 performance: false,
475
476 /**
477 * Error handler for watcher errors
478 */
479 errorHandler: null,
480
481 /**
482 * Warn handler for watcher warns
483 */
484 warnHandler: null,
485
486 /**
487 * Ignore certain custom elements
488 */
489 ignoredElements: [],
490
491 /**
492 * Custom user key aliases for v-on
493 */
494 keyCodes: Object.create(null),
495
496 /**
497 * Check if a tag is reserved so that it cannot be registered as a
498 * component. This is platform-dependent and may be overwritten.
499 */
500 isReservedTag: no,
501
502 /**
503 * Check if an attribute is reserved so that it cannot be used as a component
504 * prop. This is platform-dependent and may be overwritten.
505 */
506 isReservedAttr: no,
507
508 /**
509 * Check if a tag is an unknown element.
510 * Platform-dependent.
511 */
512 isUnknownElement: no,
513
514 /**
515 * Get the namespace of an element
516 */
517 getTagNamespace: noop,
518
519 /**
520 * Parse the real tag name for the specific platform.
521 */
522 parsePlatformTagName: identity,
523
524 /**
525 * Check if an attribute must be bound using property, e.g. value
526 * Platform-dependent.
527 */
528 mustUseProp: no,
529
530 /**
531 * Exposed for legacy reasons
532 */
533 _lifecycleHooks: LIFECYCLE_HOOKS
534});
535
536/* */
537
538var emptyObject = Object.freeze({});
539
540/**
541 * Check if a string starts with $ or _
542 */
543function isReserved (str) {
544 var c = (str + '').charCodeAt(0);
545 return c === 0x24 || c === 0x5F
546}
547
548/**
549 * Define a property.
550 */
551function def (obj, key, val, enumerable) {
552 Object.defineProperty(obj, key, {
553 value: val,
554 enumerable: !!enumerable,
555 writable: true,
556 configurable: true
557 });
558}
559
560/**
561 * Parse simple path.
562 */
563var bailRE = /[^\w.$]/;
564function parsePath (path) {
565 if (bailRE.test(path)) {
566 return
567 }
568 var segments = path.split('.');
569 return function (obj) {
570 for (var i = 0; i < segments.length; i++) {
571 if (!obj) { return }
572 obj = obj[segments[i]];
573 }
574 return obj
575 }
576}
577
578/* */
579
580// can we use __proto__?
581var hasProto = '__proto__' in {};
582
583// Browser environment sniffing
584var inBrowser = typeof window !== 'undefined';
585var UA = inBrowser && window.navigator.userAgent.toLowerCase();
586var isIE = UA && /msie|trident/.test(UA);
587var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
588var isEdge = UA && UA.indexOf('edge/') > 0;
589var isAndroid = UA && UA.indexOf('android') > 0;
590var isIOS = UA && /iphone|ipad|ipod|ios/.test(UA);
591var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
592
593// Firefox has a "watch" function on Object.prototype...
594var nativeWatch = ({}).watch;
595
596var supportsPassive = false;
597if (inBrowser) {
598 try {
599 var opts = {};
600 Object.defineProperty(opts, 'passive', ({
601 get: function get () {
602 /* istanbul ignore next */
603 supportsPassive = true;
604 }
605 })); // https://github.com/facebook/flow/issues/285
606 window.addEventListener('test-passive', null, opts);
607 } catch (e) {}
608}
609
610// this needs to be lazy-evaled because vue may be required before
611// vue-server-renderer can set VUE_ENV
612var _isServer;
613var isServerRendering = function () {
614 if (_isServer === undefined) {
615 /* istanbul ignore if */
616 if (!inBrowser && typeof global !== 'undefined') {
617 // detect presence of vue-server-renderer and avoid
618 // Webpack shimming the process
619 _isServer = global['process'].env.VUE_ENV === 'server';
620 } else {
621 _isServer = false;
622 }
623 }
624 return _isServer
625};
626
627// detect devtools
628var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
629
630/* istanbul ignore next */
631function isNative (Ctor) {
632 return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
633}
634
635var hasSymbol =
636 typeof Symbol !== 'undefined' && isNative(Symbol) &&
637 typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
638
639var _Set;
640/* istanbul ignore if */ // $flow-disable-line
641if (typeof Set !== 'undefined' && isNative(Set)) {
642 // use native Set when available.
643 _Set = Set;
644} else {
645 // a non-standard Set polyfill that only works with primitive keys.
646 _Set = (function () {
647 function Set () {
648 this.set = Object.create(null);
649 }
650 Set.prototype.has = function has (key) {
651 return this.set[key] === true
652 };
653 Set.prototype.add = function add (key) {
654 this.set[key] = true;
655 };
656 Set.prototype.clear = function clear () {
657 this.set = Object.create(null);
658 };
659
660 return Set;
661 }());
662}
663
664/* */
665
666var warn = noop;
667var tip = noop;
668var generateComponentTrace = (noop); // work around flow check
669var formatComponentName = (noop);
670
671if (false) {
672 var hasConsole = typeof console !== 'undefined';
673 var classifyRE = /(?:^|[-_])(\w)/g;
674 var classify = function (str) { return str
675 .replace(classifyRE, function (c) { return c.toUpperCase(); })
676 .replace(/[-_]/g, ''); };
677
678 warn = function (msg, vm) {
679 var trace = vm ? generateComponentTrace(vm) : '';
680
681 if (config.warnHandler) {
682 config.warnHandler.call(null, msg, vm, trace);
683 } else if (hasConsole && (!config.silent)) {
684 console.error(("[Vue warn]: " + msg + trace));
685 }
686 };
687
688 tip = function (msg, vm) {
689 if (hasConsole && (!config.silent)) {
690 console.warn("[Vue tip]: " + msg + (
691 vm ? generateComponentTrace(vm) : ''
692 ));
693 }
694 };
695
696 formatComponentName = function (vm, includeFile) {
697 if (vm.$root === vm) {
698 return '<Root>'
699 }
700 var options = typeof vm === 'function' && vm.cid != null
701 ? vm.options
702 : vm._isVue
703 ? vm.$options || vm.constructor.options
704 : vm || {};
705 var name = options.name || options._componentTag;
706 var file = options.__file;
707 if (!name && file) {
708 var match = file.match(/([^/\\]+)\.vue$/);
709 name = match && match[1];
710 }
711
712 return (
713 (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
714 (file && includeFile !== false ? (" at " + file) : '')
715 )
716 };
717
718 var repeat = function (str, n) {
719 var res = '';
720 while (n) {
721 if (n % 2 === 1) { res += str; }
722 if (n > 1) { str += str; }
723 n >>= 1;
724 }
725 return res
726 };
727
728 generateComponentTrace = function (vm) {
729 if (vm._isVue && vm.$parent) {
730 var tree = [];
731 var currentRecursiveSequence = 0;
732 while (vm) {
733 if (tree.length > 0) {
734 var last = tree[tree.length - 1];
735 if (last.constructor === vm.constructor) {
736 currentRecursiveSequence++;
737 vm = vm.$parent;
738 continue
739 } else if (currentRecursiveSequence > 0) {
740 tree[tree.length - 1] = [last, currentRecursiveSequence];
741 currentRecursiveSequence = 0;
742 }
743 }
744 tree.push(vm);
745 vm = vm.$parent;
746 }
747 return '\n\nfound in\n\n' + tree
748 .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
749 ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
750 : formatComponentName(vm))); })
751 .join('\n')
752 } else {
753 return ("\n\n(found in " + (formatComponentName(vm)) + ")")
754 }
755 };
756}
757
758/* */
759
760
761var uid$1 = 0;
762
763/**
764 * A dep is an observable that can have multiple
765 * directives subscribing to it.
766 */
767var Dep = function Dep () {
768 this.id = uid$1++;
769 this.subs = [];
770};
771
772Dep.prototype.addSub = function addSub (sub) {
773 this.subs.push(sub);
774};
775
776Dep.prototype.removeSub = function removeSub (sub) {
777 remove(this.subs, sub);
778};
779
780Dep.prototype.depend = function depend () {
781 if (Dep.target) {
782 Dep.target.addDep(this);
783 }
784};
785
786Dep.prototype.notify = function notify () {
787 // stabilize the subscriber list first
788 var subs = this.subs.slice();
789 for (var i = 0, l = subs.length; i < l; i++) {
790 subs[i].update();
791 }
792};
793
794// the current target watcher being evaluated.
795// this is globally unique because there could be only one
796// watcher being evaluated at any time.
797Dep.target = null;
798var targetStack = [];
799
800function pushTarget (_target) {
801 if (Dep.target) { targetStack.push(Dep.target); }
802 Dep.target = _target;
803}
804
805function popTarget () {
806 Dep.target = targetStack.pop();
807}
808
809/* */
810
811var VNode = function VNode (
812 tag,
813 data,
814 children,
815 text,
816 elm,
817 context,
818 componentOptions,
819 asyncFactory
820) {
821 this.tag = tag;
822 this.data = data;
823 this.children = children;
824 this.text = text;
825 this.elm = elm;
826 this.ns = undefined;
827 this.context = context;
828 this.functionalContext = undefined;
829 this.functionalOptions = undefined;
830 this.functionalScopeId = undefined;
831 this.key = data && data.key;
832 this.componentOptions = componentOptions;
833 this.componentInstance = undefined;
834 this.parent = undefined;
835 this.raw = false;
836 this.isStatic = false;
837 this.isRootInsert = true;
838 this.isComment = false;
839 this.isCloned = false;
840 this.isOnce = false;
841 this.asyncFactory = asyncFactory;
842 this.asyncMeta = undefined;
843 this.isAsyncPlaceholder = false;
844};
845
846var prototypeAccessors = { child: { configurable: true } };
847
848// DEPRECATED: alias for componentInstance for backwards compat.
849/* istanbul ignore next */
850prototypeAccessors.child.get = function () {
851 return this.componentInstance
852};
853
854Object.defineProperties( VNode.prototype, prototypeAccessors );
855
856var createEmptyVNode = function (text) {
857 if ( text === void 0 ) text = '';
858
859 var node = new VNode();
860 node.text = text;
861 node.isComment = true;
862 return node
863};
864
865function createTextVNode (val) {
866 return new VNode(undefined, undefined, undefined, String(val))
867}
868
869// optimized shallow clone
870// used for static nodes and slot nodes because they may be reused across
871// multiple renders, cloning them avoids errors when DOM manipulations rely
872// on their elm reference.
873function cloneVNode (vnode, deep) {
874 var cloned = new VNode(
875 vnode.tag,
876 vnode.data,
877 vnode.children,
878 vnode.text,
879 vnode.elm,
880 vnode.context,
881 vnode.componentOptions,
882 vnode.asyncFactory
883 );
884 cloned.ns = vnode.ns;
885 cloned.isStatic = vnode.isStatic;
886 cloned.key = vnode.key;
887 cloned.isComment = vnode.isComment;
888 cloned.isCloned = true;
889 if (deep && vnode.children) {
890 cloned.children = cloneVNodes(vnode.children);
891 }
892 return cloned
893}
894
895function cloneVNodes (vnodes, deep) {
896 var len = vnodes.length;
897 var res = new Array(len);
898 for (var i = 0; i < len; i++) {
899 res[i] = cloneVNode(vnodes[i], deep);
900 }
901 return res
902}
903
904/*
905 * not type checking this file because flow doesn't play well with
906 * dynamically accessing methods on Array prototype
907 */
908
909var arrayProto = Array.prototype;
910var arrayMethods = Object.create(arrayProto);[
911 'push',
912 'pop',
913 'shift',
914 'unshift',
915 'splice',
916 'sort',
917 'reverse'
918]
919.forEach(function (method) {
920 // cache original method
921 var original = arrayProto[method];
922 def(arrayMethods, method, function mutator () {
923 var args = [], len = arguments.length;
924 while ( len-- ) args[ len ] = arguments[ len ];
925
926 var result = original.apply(this, args);
927 var ob = this.__ob__;
928 var inserted;
929 switch (method) {
930 case 'push':
931 case 'unshift':
932 inserted = args;
933 break
934 case 'splice':
935 inserted = args.slice(2);
936 break
937 }
938 if (inserted) { ob.observeArray(inserted); }
939 // notify change
940 ob.dep.notify();
941 return result
942 });
943});
944
945/* */
946
947var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
948
949/**
950 * By default, when a reactive property is set, the new value is
951 * also converted to become reactive. However when passing down props,
952 * we don't want to force conversion because the value may be a nested value
953 * under a frozen data structure. Converting it would defeat the optimization.
954 */
955var observerState = {
956 shouldConvert: true
957};
958
959/**
960 * Observer class that are attached to each observed
961 * object. Once attached, the observer converts target
962 * object's property keys into getter/setters that
963 * collect dependencies and dispatches updates.
964 */
965var Observer = function Observer (value) {
966 this.value = value;
967 this.dep = new Dep();
968 this.vmCount = 0;
969 def(value, '__ob__', this);
970 if (Array.isArray(value)) {
971 var augment = hasProto
972 ? protoAugment
973 : copyAugment;
974 augment(value, arrayMethods, arrayKeys);
975 this.observeArray(value);
976 } else {
977 this.walk(value);
978 }
979};
980
981/**
982 * Walk through each property and convert them into
983 * getter/setters. This method should only be called when
984 * value type is Object.
985 */
986Observer.prototype.walk = function walk (obj) {
987 var keys = Object.keys(obj);
988 for (var i = 0; i < keys.length; i++) {
989 defineReactive(obj, keys[i], obj[keys[i]]);
990 }
991};
992
993/**
994 * Observe a list of Array items.
995 */
996Observer.prototype.observeArray = function observeArray (items) {
997 for (var i = 0, l = items.length; i < l; i++) {
998 observe(items[i]);
999 }
1000};
1001
1002// helpers
1003
1004/**
1005 * Augment an target Object or Array by intercepting
1006 * the prototype chain using __proto__
1007 */
1008function protoAugment (target, src, keys) {
1009 /* eslint-disable no-proto */
1010 target.__proto__ = src;
1011 /* eslint-enable no-proto */
1012}
1013
1014/**
1015 * Augment an target Object or Array by defining
1016 * hidden properties.
1017 */
1018/* istanbul ignore next */
1019function copyAugment (target, src, keys) {
1020 for (var i = 0, l = keys.length; i < l; i++) {
1021 var key = keys[i];
1022 def(target, key, src[key]);
1023 }
1024}
1025
1026/**
1027 * Attempt to create an observer instance for a value,
1028 * returns the new observer if successfully observed,
1029 * or the existing observer if the value already has one.
1030 */
1031function observe (value, asRootData) {
1032 if (!isObject(value) || value instanceof VNode) {
1033 return
1034 }
1035 var ob;
1036 if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
1037 ob = value.__ob__;
1038 } else if (
1039 observerState.shouldConvert &&
1040 !isServerRendering() &&
1041 (Array.isArray(value) || isPlainObject(value)) &&
1042 Object.isExtensible(value) &&
1043 !value._isVue
1044 ) {
1045 ob = new Observer(value);
1046 }
1047 if (asRootData && ob) {
1048 ob.vmCount++;
1049 }
1050 return ob
1051}
1052
1053/**
1054 * Define a reactive property on an Object.
1055 */
1056function defineReactive (
1057 obj,
1058 key,
1059 val,
1060 customSetter,
1061 shallow
1062) {
1063 var dep = new Dep();
1064
1065 var property = Object.getOwnPropertyDescriptor(obj, key);
1066 if (property && property.configurable === false) {
1067 return
1068 }
1069
1070 // cater for pre-defined getter/setters
1071 var getter = property && property.get;
1072 var setter = property && property.set;
1073
1074 var childOb = !shallow && observe(val);
1075 Object.defineProperty(obj, key, {
1076 enumerable: true,
1077 configurable: true,
1078 get: function reactiveGetter () {
1079 var value = getter ? getter.call(obj) : val;
1080 if (Dep.target) {
1081 dep.depend();
1082 if (childOb) {
1083 childOb.dep.depend();
1084 if (Array.isArray(value)) {
1085 dependArray(value);
1086 }
1087 }
1088 }
1089 return value
1090 },
1091 set: function reactiveSetter (newVal) {
1092 var value = getter ? getter.call(obj) : val;
1093 /* eslint-disable no-self-compare */
1094 if (newVal === value || (newVal !== newVal && value !== value)) {
1095 return
1096 }
1097 /* eslint-enable no-self-compare */
1098 if (false) {
1099 customSetter();
1100 }
1101 if (setter) {
1102 setter.call(obj, newVal);
1103 } else {
1104 val = newVal;
1105 }
1106 childOb = !shallow && observe(newVal);
1107 dep.notify();
1108 }
1109 });
1110}
1111
1112/**
1113 * Set a property on an object. Adds the new property and
1114 * triggers change notification if the property doesn't
1115 * already exist.
1116 */
1117function set (target, key, val) {
1118 if (Array.isArray(target) && isValidArrayIndex(key)) {
1119 target.length = Math.max(target.length, key);
1120 target.splice(key, 1, val);
1121 return val
1122 }
1123 if (hasOwn(target, key)) {
1124 target[key] = val;
1125 return val
1126 }
1127 var ob = (target).__ob__;
1128 if (target._isVue || (ob && ob.vmCount)) {
1129 "production" !== 'production' && warn(
1130 'Avoid adding reactive properties to a Vue instance or its root $data ' +
1131 'at runtime - declare it upfront in the data option.'
1132 );
1133 return val
1134 }
1135 if (!ob) {
1136 target[key] = val;
1137 return val
1138 }
1139 defineReactive(ob.value, key, val);
1140 ob.dep.notify();
1141 return val
1142}
1143
1144/**
1145 * Delete a property and trigger change if necessary.
1146 */
1147function del (target, key) {
1148 if (Array.isArray(target) && isValidArrayIndex(key)) {
1149 target.splice(key, 1);
1150 return
1151 }
1152 var ob = (target).__ob__;
1153 if (target._isVue || (ob && ob.vmCount)) {
1154 "production" !== 'production' && warn(
1155 'Avoid deleting properties on a Vue instance or its root $data ' +
1156 '- just set it to null.'
1157 );
1158 return
1159 }
1160 if (!hasOwn(target, key)) {
1161 return
1162 }
1163 delete target[key];
1164 if (!ob) {
1165 return
1166 }
1167 ob.dep.notify();
1168}
1169
1170/**
1171 * Collect dependencies on array elements when the array is touched, since
1172 * we cannot intercept array element access like property getters.
1173 */
1174function dependArray (value) {
1175 for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
1176 e = value[i];
1177 e && e.__ob__ && e.__ob__.dep.depend();
1178 if (Array.isArray(e)) {
1179 dependArray(e);
1180 }
1181 }
1182}
1183
1184/* */
1185
1186/**
1187 * Option overwriting strategies are functions that handle
1188 * how to merge a parent option value and a child option
1189 * value into the final value.
1190 */
1191var strats = config.optionMergeStrategies;
1192
1193/**
1194 * Options with restrictions
1195 */
1196if (false) {
1197 strats.el = strats.propsData = function (parent, child, vm, key) {
1198 if (!vm) {
1199 warn(
1200 "option \"" + key + "\" can only be used during instance " +
1201 'creation with the `new` keyword.'
1202 );
1203 }
1204 return defaultStrat(parent, child)
1205 };
1206}
1207
1208/**
1209 * Helper that recursively merges two data objects together.
1210 */
1211function mergeData (to, from) {
1212 if (!from) { return to }
1213 var key, toVal, fromVal;
1214 var keys = Object.keys(from);
1215 for (var i = 0; i < keys.length; i++) {
1216 key = keys[i];
1217 toVal = to[key];
1218 fromVal = from[key];
1219 if (!hasOwn(to, key)) {
1220 set(to, key, fromVal);
1221 } else if (isPlainObject(toVal) && isPlainObject(fromVal)) {
1222 mergeData(toVal, fromVal);
1223 }
1224 }
1225 return to
1226}
1227
1228/**
1229 * Data
1230 */
1231function mergeDataOrFn (
1232 parentVal,
1233 childVal,
1234 vm
1235) {
1236 if (!vm) {
1237 // in a Vue.extend merge, both should be functions
1238 if (!childVal) {
1239 return parentVal
1240 }
1241 if (!parentVal) {
1242 return childVal
1243 }
1244 // when parentVal & childVal are both present,
1245 // we need to return a function that returns the
1246 // merged result of both functions... no need to
1247 // check if parentVal is a function here because
1248 // it has to be a function to pass previous merges.
1249 return function mergedDataFn () {
1250 return mergeData(
1251 typeof childVal === 'function' ? childVal.call(this) : childVal,
1252 typeof parentVal === 'function' ? parentVal.call(this) : parentVal
1253 )
1254 }
1255 } else if (parentVal || childVal) {
1256 return function mergedInstanceDataFn () {
1257 // instance merge
1258 var instanceData = typeof childVal === 'function'
1259 ? childVal.call(vm)
1260 : childVal;
1261 var defaultData = typeof parentVal === 'function'
1262 ? parentVal.call(vm)
1263 : parentVal;
1264 if (instanceData) {
1265 return mergeData(instanceData, defaultData)
1266 } else {
1267 return defaultData
1268 }
1269 }
1270 }
1271}
1272
1273strats.data = function (
1274 parentVal,
1275 childVal,
1276 vm
1277) {
1278 if (!vm) {
1279 if (childVal && typeof childVal !== 'function') {
1280 "production" !== 'production' && warn(
1281 'The "data" option should be a function ' +
1282 'that returns a per-instance value in component ' +
1283 'definitions.',
1284 vm
1285 );
1286
1287 return parentVal
1288 }
1289 return mergeDataOrFn.call(this, parentVal, childVal)
1290 }
1291
1292 return mergeDataOrFn(parentVal, childVal, vm)
1293};
1294
1295/**
1296 * Hooks and props are merged as arrays.
1297 */
1298function mergeHook (
1299 parentVal,
1300 childVal
1301) {
1302 return childVal
1303 ? parentVal
1304 ? parentVal.concat(childVal)
1305 : Array.isArray(childVal)
1306 ? childVal
1307 : [childVal]
1308 : parentVal
1309}
1310
1311LIFECYCLE_HOOKS.forEach(function (hook) {
1312 strats[hook] = mergeHook;
1313});
1314
1315/**
1316 * Assets
1317 *
1318 * When a vm is present (instance creation), we need to do
1319 * a three-way merge between constructor options, instance
1320 * options and parent options.
1321 */
1322function mergeAssets (
1323 parentVal,
1324 childVal,
1325 vm,
1326 key
1327) {
1328 var res = Object.create(parentVal || null);
1329 if (childVal) {
1330 "production" !== 'production' && assertObjectType(key, childVal, vm);
1331 return extend(res, childVal)
1332 } else {
1333 return res
1334 }
1335}
1336
1337ASSET_TYPES.forEach(function (type) {
1338 strats[type + 's'] = mergeAssets;
1339});
1340
1341/**
1342 * Watchers.
1343 *
1344 * Watchers hashes should not overwrite one
1345 * another, so we merge them as arrays.
1346 */
1347strats.watch = function (
1348 parentVal,
1349 childVal,
1350 vm,
1351 key
1352) {
1353 // work around Firefox's Object.prototype.watch...
1354 if (parentVal === nativeWatch) { parentVal = undefined; }
1355 if (childVal === nativeWatch) { childVal = undefined; }
1356 /* istanbul ignore if */
1357 if (!childVal) { return Object.create(parentVal || null) }
1358 if (false) {
1359 assertObjectType(key, childVal, vm);
1360 }
1361 if (!parentVal) { return childVal }
1362 var ret = {};
1363 extend(ret, parentVal);
1364 for (var key$1 in childVal) {
1365 var parent = ret[key$1];
1366 var child = childVal[key$1];
1367 if (parent && !Array.isArray(parent)) {
1368 parent = [parent];
1369 }
1370 ret[key$1] = parent
1371 ? parent.concat(child)
1372 : Array.isArray(child) ? child : [child];
1373 }
1374 return ret
1375};
1376
1377/**
1378 * Other object hashes.
1379 */
1380strats.props =
1381strats.methods =
1382strats.inject =
1383strats.computed = function (
1384 parentVal,
1385 childVal,
1386 vm,
1387 key
1388) {
1389 if (childVal && "production" !== 'production') {
1390 assertObjectType(key, childVal, vm);
1391 }
1392 if (!parentVal) { return childVal }
1393 var ret = Object.create(null);
1394 extend(ret, parentVal);
1395 if (childVal) { extend(ret, childVal); }
1396 return ret
1397};
1398strats.provide = mergeDataOrFn;
1399
1400/**
1401 * Default strategy.
1402 */
1403var defaultStrat = function (parentVal, childVal) {
1404 return childVal === undefined
1405 ? parentVal
1406 : childVal
1407};
1408
1409/**
1410 * Validate component names
1411 */
1412function checkComponents (options) {
1413 for (var key in options.components) {
1414 var lower = key.toLowerCase();
1415 if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
1416 warn(
1417 'Do not use built-in or reserved HTML elements as component ' +
1418 'id: ' + key
1419 );
1420 }
1421 }
1422}
1423
1424/**
1425 * Ensure all props option syntax are normalized into the
1426 * Object-based format.
1427 */
1428function normalizeProps (options, vm) {
1429 var props = options.props;
1430 if (!props) { return }
1431 var res = {};
1432 var i, val, name;
1433 if (Array.isArray(props)) {
1434 i = props.length;
1435 while (i--) {
1436 val = props[i];
1437 if (typeof val === 'string') {
1438 name = camelize(val);
1439 res[name] = { type: null };
1440 } else if (false) {
1441 warn('props must be strings when using array syntax.');
1442 }
1443 }
1444 } else if (isPlainObject(props)) {
1445 for (var key in props) {
1446 val = props[key];
1447 name = camelize(key);
1448 res[name] = isPlainObject(val)
1449 ? val
1450 : { type: val };
1451 }
1452 } else if (false) {
1453 warn(
1454 "Invalid value for option \"props\": expected an Array or an Object, " +
1455 "but got " + (toRawType(props)) + ".",
1456 vm
1457 );
1458 }
1459 options.props = res;
1460}
1461
1462/**
1463 * Normalize all injections into Object-based format
1464 */
1465function normalizeInject (options, vm) {
1466 var inject = options.inject;
1467 var normalized = options.inject = {};
1468 if (Array.isArray(inject)) {
1469 for (var i = 0; i < inject.length; i++) {
1470 normalized[inject[i]] = { from: inject[i] };
1471 }
1472 } else if (isPlainObject(inject)) {
1473 for (var key in inject) {
1474 var val = inject[key];
1475 normalized[key] = isPlainObject(val)
1476 ? extend({ from: key }, val)
1477 : { from: val };
1478 }
1479 } else if (false) {
1480 warn(
1481 "Invalid value for option \"inject\": expected an Array or an Object, " +
1482 "but got " + (toRawType(inject)) + ".",
1483 vm
1484 );
1485 }
1486}
1487
1488/**
1489 * Normalize raw function directives into object format.
1490 */
1491function normalizeDirectives (options) {
1492 var dirs = options.directives;
1493 if (dirs) {
1494 for (var key in dirs) {
1495 var def = dirs[key];
1496 if (typeof def === 'function') {
1497 dirs[key] = { bind: def, update: def };
1498 }
1499 }
1500 }
1501}
1502
1503function assertObjectType (name, value, vm) {
1504 if (!isPlainObject(value)) {
1505 warn(
1506 "Invalid value for option \"" + name + "\": expected an Object, " +
1507 "but got " + (toRawType(value)) + ".",
1508 vm
1509 );
1510 }
1511}
1512
1513/**
1514 * Merge two option objects into a new one.
1515 * Core utility used in both instantiation and inheritance.
1516 */
1517function mergeOptions (
1518 parent,
1519 child,
1520 vm
1521) {
1522 if (false) {
1523 checkComponents(child);
1524 }
1525
1526 if (typeof child === 'function') {
1527 child = child.options;
1528 }
1529
1530 normalizeProps(child, vm);
1531 normalizeInject(child, vm);
1532 normalizeDirectives(child);
1533 var extendsFrom = child.extends;
1534 if (extendsFrom) {
1535 parent = mergeOptions(parent, extendsFrom, vm);
1536 }
1537 if (child.mixins) {
1538 for (var i = 0, l = child.mixins.length; i < l; i++) {
1539 parent = mergeOptions(parent, child.mixins[i], vm);
1540 }
1541 }
1542 var options = {};
1543 var key;
1544 for (key in parent) {
1545 mergeField(key);
1546 }
1547 for (key in child) {
1548 if (!hasOwn(parent, key)) {
1549 mergeField(key);
1550 }
1551 }
1552 function mergeField (key) {
1553 var strat = strats[key] || defaultStrat;
1554 options[key] = strat(parent[key], child[key], vm, key);
1555 }
1556 return options
1557}
1558
1559/**
1560 * Resolve an asset.
1561 * This function is used because child instances need access
1562 * to assets defined in its ancestor chain.
1563 */
1564function resolveAsset (
1565 options,
1566 type,
1567 id,
1568 warnMissing
1569) {
1570 /* istanbul ignore if */
1571 if (typeof id !== 'string') {
1572 return
1573 }
1574 var assets = options[type];
1575 // check local registration variations first
1576 if (hasOwn(assets, id)) { return assets[id] }
1577 var camelizedId = camelize(id);
1578 if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
1579 var PascalCaseId = capitalize(camelizedId);
1580 if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
1581 // fallback to prototype chain
1582 var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
1583 if (false) {
1584 warn(
1585 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
1586 options
1587 );
1588 }
1589 return res
1590}
1591
1592/* */
1593
1594function validateProp (
1595 key,
1596 propOptions,
1597 propsData,
1598 vm
1599) {
1600 var prop = propOptions[key];
1601 var absent = !hasOwn(propsData, key);
1602 var value = propsData[key];
1603 // handle boolean props
1604 if (isType(Boolean, prop.type)) {
1605 if (absent && !hasOwn(prop, 'default')) {
1606 value = false;
1607 } else if (!isType(String, prop.type) && (value === '' || value === hyphenate(key))) {
1608 value = true;
1609 }
1610 }
1611 // check default value
1612 if (value === undefined) {
1613 value = getPropDefaultValue(vm, prop, key);
1614 // since the default value is a fresh copy,
1615 // make sure to observe it.
1616 var prevShouldConvert = observerState.shouldConvert;
1617 observerState.shouldConvert = true;
1618 observe(value);
1619 observerState.shouldConvert = prevShouldConvert;
1620 }
1621 if (false) {
1622 assertProp(prop, key, value, vm, absent);
1623 }
1624 return value
1625}
1626
1627/**
1628 * Get the default value of a prop.
1629 */
1630function getPropDefaultValue (vm, prop, key) {
1631 // no default, return undefined
1632 if (!hasOwn(prop, 'default')) {
1633 return undefined
1634 }
1635 var def = prop.default;
1636 // warn against non-factory defaults for Object & Array
1637 if (false) {
1638 warn(
1639 'Invalid default value for prop "' + key + '": ' +
1640 'Props with type Object/Array must use a factory function ' +
1641 'to return the default value.',
1642 vm
1643 );
1644 }
1645 // the raw prop value was also undefined from previous render,
1646 // return previous default value to avoid unnecessary watcher trigger
1647 if (vm && vm.$options.propsData &&
1648 vm.$options.propsData[key] === undefined &&
1649 vm._props[key] !== undefined
1650 ) {
1651 return vm._props[key]
1652 }
1653 // call factory function for non-Function types
1654 // a value is Function if its prototype is function even across different execution context
1655 return typeof def === 'function' && getType(prop.type) !== 'Function'
1656 ? def.call(vm)
1657 : def
1658}
1659
1660/**
1661 * Assert whether a prop is valid.
1662 */
1663function assertProp (
1664 prop,
1665 name,
1666 value,
1667 vm,
1668 absent
1669) {
1670 if (prop.required && absent) {
1671 warn(
1672 'Missing required prop: "' + name + '"',
1673 vm
1674 );
1675 return
1676 }
1677 if (value == null && !prop.required) {
1678 return
1679 }
1680 var type = prop.type;
1681 var valid = !type || type === true;
1682 var expectedTypes = [];
1683 if (type) {
1684 if (!Array.isArray(type)) {
1685 type = [type];
1686 }
1687 for (var i = 0; i < type.length && !valid; i++) {
1688 var assertedType = assertType(value, type[i]);
1689 expectedTypes.push(assertedType.expectedType || '');
1690 valid = assertedType.valid;
1691 }
1692 }
1693 if (!valid) {
1694 warn(
1695 "Invalid prop: type check failed for prop \"" + name + "\"." +
1696 " Expected " + (expectedTypes.map(capitalize).join(', ')) +
1697 ", got " + (toRawType(value)) + ".",
1698 vm
1699 );
1700 return
1701 }
1702 var validator = prop.validator;
1703 if (validator) {
1704 if (!validator(value)) {
1705 warn(
1706 'Invalid prop: custom validator check failed for prop "' + name + '".',
1707 vm
1708 );
1709 }
1710 }
1711}
1712
1713var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
1714
1715function assertType (value, type) {
1716 var valid;
1717 var expectedType = getType(type);
1718 if (simpleCheckRE.test(expectedType)) {
1719 var t = typeof value;
1720 valid = t === expectedType.toLowerCase();
1721 // for primitive wrapper objects
1722 if (!valid && t === 'object') {
1723 valid = value instanceof type;
1724 }
1725 } else if (expectedType === 'Object') {
1726 valid = isPlainObject(value);
1727 } else if (expectedType === 'Array') {
1728 valid = Array.isArray(value);
1729 } else {
1730 valid = value instanceof type;
1731 }
1732 return {
1733 valid: valid,
1734 expectedType: expectedType
1735 }
1736}
1737
1738/**
1739 * Use function string name to check built-in types,
1740 * because a simple equality check will fail when running
1741 * across different vms / iframes.
1742 */
1743function getType (fn) {
1744 var match = fn && fn.toString().match(/^\s*function (\w+)/);
1745 return match ? match[1] : ''
1746}
1747
1748function isType (type, fn) {
1749 if (!Array.isArray(fn)) {
1750 return getType(fn) === getType(type)
1751 }
1752 for (var i = 0, len = fn.length; i < len; i++) {
1753 if (getType(fn[i]) === getType(type)) {
1754 return true
1755 }
1756 }
1757 /* istanbul ignore next */
1758 return false
1759}
1760
1761/* */
1762
1763function handleError (err, vm, info) {
1764 if (vm) {
1765 var cur = vm;
1766 while ((cur = cur.$parent)) {
1767 var hooks = cur.$options.errorCaptured;
1768 if (hooks) {
1769 for (var i = 0; i < hooks.length; i++) {
1770 try {
1771 var capture = hooks[i].call(cur, err, vm, info) === false;
1772 if (capture) { return }
1773 } catch (e) {
1774 globalHandleError(e, cur, 'errorCaptured hook');
1775 }
1776 }
1777 }
1778 }
1779 }
1780 globalHandleError(err, vm, info);
1781}
1782
1783function globalHandleError (err, vm, info) {
1784 if (config.errorHandler) {
1785 try {
1786 return config.errorHandler.call(null, err, vm, info)
1787 } catch (e) {
1788 logError(e, null, 'config.errorHandler');
1789 }
1790 }
1791 logError(err, vm, info);
1792}
1793
1794function logError (err, vm, info) {
1795 if (false) {
1796 warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
1797 }
1798 /* istanbul ignore else */
1799 if (inBrowser && typeof console !== 'undefined') {
1800 console.error(err);
1801 } else {
1802 throw err
1803 }
1804}
1805
1806/* */
1807/* globals MessageChannel */
1808
1809var callbacks = [];
1810var pending = false;
1811
1812function flushCallbacks () {
1813 pending = false;
1814 var copies = callbacks.slice(0);
1815 callbacks.length = 0;
1816 for (var i = 0; i < copies.length; i++) {
1817 copies[i]();
1818 }
1819}
1820
1821// Here we have async deferring wrappers using both micro and macro tasks.
1822// In < 2.4 we used micro tasks everywhere, but there are some scenarios where
1823// micro tasks have too high a priority and fires in between supposedly
1824// sequential events (e.g. #4521, #6690) or even between bubbling of the same
1825// event (#6566). However, using macro tasks everywhere also has subtle problems
1826// when state is changed right before repaint (e.g. #6813, out-in transitions).
1827// Here we use micro task by default, but expose a way to force macro task when
1828// needed (e.g. in event handlers attached by v-on).
1829var microTimerFunc;
1830var macroTimerFunc;
1831var useMacroTask = false;
1832
1833// Determine (macro) Task defer implementation.
1834// Technically setImmediate should be the ideal choice, but it's only available
1835// in IE. The only polyfill that consistently queues the callback after all DOM
1836// events triggered in the same loop is by using MessageChannel.
1837/* istanbul ignore if */
1838if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
1839 macroTimerFunc = function () {
1840 setImmediate(flushCallbacks);
1841 };
1842} else if (typeof MessageChannel !== 'undefined' && (
1843 isNative(MessageChannel) ||
1844 // PhantomJS
1845 MessageChannel.toString() === '[object MessageChannelConstructor]'
1846)) {
1847 var channel = new MessageChannel();
1848 var port = channel.port2;
1849 channel.port1.onmessage = flushCallbacks;
1850 macroTimerFunc = function () {
1851 port.postMessage(1);
1852 };
1853} else {
1854 /* istanbul ignore next */
1855 macroTimerFunc = function () {
1856 setTimeout(flushCallbacks, 0);
1857 };
1858}
1859
1860// Determine MicroTask defer implementation.
1861/* istanbul ignore next, $flow-disable-line */
1862if (typeof Promise !== 'undefined' && isNative(Promise)) {
1863 var p = Promise.resolve();
1864 microTimerFunc = function () {
1865 p.then(flushCallbacks);
1866 // in problematic UIWebViews, Promise.then doesn't completely break, but
1867 // it can get stuck in a weird state where callbacks are pushed into the
1868 // microtask queue but the queue isn't being flushed, until the browser
1869 // needs to do some other work, e.g. handle a timer. Therefore we can
1870 // "force" the microtask queue to be flushed by adding an empty timer.
1871 if (isIOS) { setTimeout(noop); }
1872 };
1873} else {
1874 // fallback to macro
1875 microTimerFunc = macroTimerFunc;
1876}
1877
1878/**
1879 * Wrap a function so that if any code inside triggers state change,
1880 * the changes are queued using a Task instead of a MicroTask.
1881 */
1882function withMacroTask (fn) {
1883 return fn._withTask || (fn._withTask = function () {
1884 useMacroTask = true;
1885 var res = fn.apply(null, arguments);
1886 useMacroTask = false;
1887 return res
1888 })
1889}
1890
1891function nextTick (cb, ctx) {
1892 var _resolve;
1893 callbacks.push(function () {
1894 if (cb) {
1895 try {
1896 cb.call(ctx);
1897 } catch (e) {
1898 handleError(e, ctx, 'nextTick');
1899 }
1900 } else if (_resolve) {
1901 _resolve(ctx);
1902 }
1903 });
1904 if (!pending) {
1905 pending = true;
1906 if (useMacroTask) {
1907 macroTimerFunc();
1908 } else {
1909 microTimerFunc();
1910 }
1911 }
1912 // $flow-disable-line
1913 if (!cb && typeof Promise !== 'undefined') {
1914 return new Promise(function (resolve) {
1915 _resolve = resolve;
1916 })
1917 }
1918}
1919
1920/* */
1921
1922/* not type checking this file because flow doesn't play well with Proxy */
1923
1924var initProxy;
1925
1926if (false) {
1927 var allowedGlobals = makeMap(
1928 'Infinity,undefined,NaN,isFinite,isNaN,' +
1929 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
1930 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
1931 'require' // for Webpack/Browserify
1932 );
1933
1934 var warnNonPresent = function (target, key) {
1935 warn(
1936 "Property or method \"" + key + "\" is not defined on the instance but " +
1937 'referenced during render. Make sure that this property is reactive, ' +
1938 'either in the data option, or for class-based components, by ' +
1939 'initializing the property. ' +
1940 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
1941 target
1942 );
1943 };
1944
1945 var hasProxy =
1946 typeof Proxy !== 'undefined' &&
1947 Proxy.toString().match(/native code/);
1948
1949 if (hasProxy) {
1950 var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
1951 config.keyCodes = new Proxy(config.keyCodes, {
1952 set: function set (target, key, value) {
1953 if (isBuiltInModifier(key)) {
1954 warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
1955 return false
1956 } else {
1957 target[key] = value;
1958 return true
1959 }
1960 }
1961 });
1962 }
1963
1964 var hasHandler = {
1965 has: function has (target, key) {
1966 var has = key in target;
1967 var isAllowed = allowedGlobals(key) || key.charAt(0) === '_';
1968 if (!has && !isAllowed) {
1969 warnNonPresent(target, key);
1970 }
1971 return has || !isAllowed
1972 }
1973 };
1974
1975 var getHandler = {
1976 get: function get (target, key) {
1977 if (typeof key === 'string' && !(key in target)) {
1978 warnNonPresent(target, key);
1979 }
1980 return target[key]
1981 }
1982 };
1983
1984 initProxy = function initProxy (vm) {
1985 if (hasProxy) {
1986 // determine which proxy handler to use
1987 var options = vm.$options;
1988 var handlers = options.render && options.render._withStripped
1989 ? getHandler
1990 : hasHandler;
1991 vm._renderProxy = new Proxy(vm, handlers);
1992 } else {
1993 vm._renderProxy = vm;
1994 }
1995 };
1996}
1997
1998var mark;
1999var measure;
2000
2001if (false) {
2002 var perf = inBrowser && window.performance;
2003 /* istanbul ignore if */
2004 if (
2005 perf &&
2006 perf.mark &&
2007 perf.measure &&
2008 perf.clearMarks &&
2009 perf.clearMeasures
2010 ) {
2011 mark = function (tag) { return perf.mark(tag); };
2012 measure = function (name, startTag, endTag) {
2013 perf.measure(name, startTag, endTag);
2014 perf.clearMarks(startTag);
2015 perf.clearMarks(endTag);
2016 perf.clearMeasures(name);
2017 };
2018 }
2019}
2020
2021/* */
2022
2023var normalizeEvent = cached(function (name) {
2024 var passive = name.charAt(0) === '&';
2025 name = passive ? name.slice(1) : name;
2026 var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
2027 name = once$$1 ? name.slice(1) : name;
2028 var capture = name.charAt(0) === '!';
2029 name = capture ? name.slice(1) : name;
2030 return {
2031 name: name,
2032 once: once$$1,
2033 capture: capture,
2034 passive: passive
2035 }
2036});
2037
2038function createFnInvoker (fns) {
2039 function invoker () {
2040 var arguments$1 = arguments;
2041
2042 var fns = invoker.fns;
2043 if (Array.isArray(fns)) {
2044 var cloned = fns.slice();
2045 for (var i = 0; i < cloned.length; i++) {
2046 cloned[i].apply(null, arguments$1);
2047 }
2048 } else {
2049 // return handler return value for single handlers
2050 return fns.apply(null, arguments)
2051 }
2052 }
2053 invoker.fns = fns;
2054 return invoker
2055}
2056
2057function updateListeners (
2058 on,
2059 oldOn,
2060 add,
2061 remove$$1,
2062 vm
2063) {
2064 var name, cur, old, event;
2065 for (name in on) {
2066 cur = on[name];
2067 old = oldOn[name];
2068 event = normalizeEvent(name);
2069 if (isUndef(cur)) {
2070 "production" !== 'production' && warn(
2071 "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
2072 vm
2073 );
2074 } else if (isUndef(old)) {
2075 if (isUndef(cur.fns)) {
2076 cur = on[name] = createFnInvoker(cur);
2077 }
2078 add(event.name, cur, event.once, event.capture, event.passive);
2079 } else if (cur !== old) {
2080 old.fns = cur;
2081 on[name] = old;
2082 }
2083 }
2084 for (name in oldOn) {
2085 if (isUndef(on[name])) {
2086 event = normalizeEvent(name);
2087 remove$$1(event.name, oldOn[name], event.capture);
2088 }
2089 }
2090}
2091
2092/* */
2093
2094function mergeVNodeHook (def, hookKey, hook) {
2095 var invoker;
2096 var oldHook = def[hookKey];
2097
2098 function wrappedHook () {
2099 hook.apply(this, arguments);
2100 // important: remove merged hook to ensure it's called only once
2101 // and prevent memory leak
2102 remove(invoker.fns, wrappedHook);
2103 }
2104
2105 if (isUndef(oldHook)) {
2106 // no existing hook
2107 invoker = createFnInvoker([wrappedHook]);
2108 } else {
2109 /* istanbul ignore if */
2110 if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
2111 // already a merged invoker
2112 invoker = oldHook;
2113 invoker.fns.push(wrappedHook);
2114 } else {
2115 // existing plain hook
2116 invoker = createFnInvoker([oldHook, wrappedHook]);
2117 }
2118 }
2119
2120 invoker.merged = true;
2121 def[hookKey] = invoker;
2122}
2123
2124/* */
2125
2126function extractPropsFromVNodeData (
2127 data,
2128 Ctor,
2129 tag
2130) {
2131 // we are only extracting raw values here.
2132 // validation and default values are handled in the child
2133 // component itself.
2134 var propOptions = Ctor.options.props;
2135 if (isUndef(propOptions)) {
2136 return
2137 }
2138 var res = {};
2139 var attrs = data.attrs;
2140 var props = data.props;
2141 if (isDef(attrs) || isDef(props)) {
2142 for (var key in propOptions) {
2143 var altKey = hyphenate(key);
2144 if (false) {
2145 var keyInLowerCase = key.toLowerCase();
2146 if (
2147 key !== keyInLowerCase &&
2148 attrs && hasOwn(attrs, keyInLowerCase)
2149 ) {
2150 tip(
2151 "Prop \"" + keyInLowerCase + "\" is passed to component " +
2152 (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
2153 " \"" + key + "\". " +
2154 "Note that HTML attributes are case-insensitive and camelCased " +
2155 "props need to use their kebab-case equivalents when using in-DOM " +
2156 "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
2157 );
2158 }
2159 }
2160 checkProp(res, props, key, altKey, true) ||
2161 checkProp(res, attrs, key, altKey, false);
2162 }
2163 }
2164 return res
2165}
2166
2167function checkProp (
2168 res,
2169 hash,
2170 key,
2171 altKey,
2172 preserve
2173) {
2174 if (isDef(hash)) {
2175 if (hasOwn(hash, key)) {
2176 res[key] = hash[key];
2177 if (!preserve) {
2178 delete hash[key];
2179 }
2180 return true
2181 } else if (hasOwn(hash, altKey)) {
2182 res[key] = hash[altKey];
2183 if (!preserve) {
2184 delete hash[altKey];
2185 }
2186 return true
2187 }
2188 }
2189 return false
2190}
2191
2192/* */
2193
2194// The template compiler attempts to minimize the need for normalization by
2195// statically analyzing the template at compile time.
2196//
2197// For plain HTML markup, normalization can be completely skipped because the
2198// generated render function is guaranteed to return Array<VNode>. There are
2199// two cases where extra normalization is needed:
2200
2201// 1. When the children contains components - because a functional component
2202// may return an Array instead of a single root. In this case, just a simple
2203// normalization is needed - if any child is an Array, we flatten the whole
2204// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
2205// because functional components already normalize their own children.
2206function simpleNormalizeChildren (children) {
2207 for (var i = 0; i < children.length; i++) {
2208 if (Array.isArray(children[i])) {
2209 return Array.prototype.concat.apply([], children)
2210 }
2211 }
2212 return children
2213}
2214
2215// 2. When the children contains constructs that always generated nested Arrays,
2216// e.g. <template>, <slot>, v-for, or when the children is provided by user
2217// with hand-written render functions / JSX. In such cases a full normalization
2218// is needed to cater to all possible types of children values.
2219function normalizeChildren (children) {
2220 return isPrimitive(children)
2221 ? [createTextVNode(children)]
2222 : Array.isArray(children)
2223 ? normalizeArrayChildren(children)
2224 : undefined
2225}
2226
2227function isTextNode (node) {
2228 return isDef(node) && isDef(node.text) && isFalse(node.isComment)
2229}
2230
2231function normalizeArrayChildren (children, nestedIndex) {
2232 var res = [];
2233 var i, c, lastIndex, last;
2234 for (i = 0; i < children.length; i++) {
2235 c = children[i];
2236 if (isUndef(c) || typeof c === 'boolean') { continue }
2237 lastIndex = res.length - 1;
2238 last = res[lastIndex];
2239 // nested
2240 if (Array.isArray(c)) {
2241 if (c.length > 0) {
2242 c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
2243 // merge adjacent text nodes
2244 if (isTextNode(c[0]) && isTextNode(last)) {
2245 res[lastIndex] = createTextVNode(last.text + (c[0]).text);
2246 c.shift();
2247 }
2248 res.push.apply(res, c);
2249 }
2250 } else if (isPrimitive(c)) {
2251 if (isTextNode(last)) {
2252 // merge adjacent text nodes
2253 // this is necessary for SSR hydration because text nodes are
2254 // essentially merged when rendered to HTML strings
2255 res[lastIndex] = createTextVNode(last.text + c);
2256 } else if (c !== '') {
2257 // convert primitive to vnode
2258 res.push(createTextVNode(c));
2259 }
2260 } else {
2261 if (isTextNode(c) && isTextNode(last)) {
2262 // merge adjacent text nodes
2263 res[lastIndex] = createTextVNode(last.text + c.text);
2264 } else {
2265 // default key for nested array children (likely generated by v-for)
2266 if (isTrue(children._isVList) &&
2267 isDef(c.tag) &&
2268 isUndef(c.key) &&
2269 isDef(nestedIndex)) {
2270 c.key = "__vlist" + nestedIndex + "_" + i + "__";
2271 }
2272 res.push(c);
2273 }
2274 }
2275 }
2276 return res
2277}
2278
2279/* */
2280
2281function ensureCtor (comp, base) {
2282 if (
2283 comp.__esModule ||
2284 (hasSymbol && comp[Symbol.toStringTag] === 'Module')
2285 ) {
2286 comp = comp.default;
2287 }
2288 return isObject(comp)
2289 ? base.extend(comp)
2290 : comp
2291}
2292
2293function createAsyncPlaceholder (
2294 factory,
2295 data,
2296 context,
2297 children,
2298 tag
2299) {
2300 var node = createEmptyVNode();
2301 node.asyncFactory = factory;
2302 node.asyncMeta = { data: data, context: context, children: children, tag: tag };
2303 return node
2304}
2305
2306function resolveAsyncComponent (
2307 factory,
2308 baseCtor,
2309 context
2310) {
2311 if (isTrue(factory.error) && isDef(factory.errorComp)) {
2312 return factory.errorComp
2313 }
2314
2315 if (isDef(factory.resolved)) {
2316 return factory.resolved
2317 }
2318
2319 if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
2320 return factory.loadingComp
2321 }
2322
2323 if (isDef(factory.contexts)) {
2324 // already pending
2325 factory.contexts.push(context);
2326 } else {
2327 var contexts = factory.contexts = [context];
2328 var sync = true;
2329
2330 var forceRender = function () {
2331 for (var i = 0, l = contexts.length; i < l; i++) {
2332 contexts[i].$forceUpdate();
2333 }
2334 };
2335
2336 var resolve = once(function (res) {
2337 // cache resolved
2338 factory.resolved = ensureCtor(res, baseCtor);
2339 // invoke callbacks only if this is not a synchronous resolve
2340 // (async resolves are shimmed as synchronous during SSR)
2341 if (!sync) {
2342 forceRender();
2343 }
2344 });
2345
2346 var reject = once(function (reason) {
2347 "production" !== 'production' && warn(
2348 "Failed to resolve async component: " + (String(factory)) +
2349 (reason ? ("\nReason: " + reason) : '')
2350 );
2351 if (isDef(factory.errorComp)) {
2352 factory.error = true;
2353 forceRender();
2354 }
2355 });
2356
2357 var res = factory(resolve, reject);
2358
2359 if (isObject(res)) {
2360 if (typeof res.then === 'function') {
2361 // () => Promise
2362 if (isUndef(factory.resolved)) {
2363 res.then(resolve, reject);
2364 }
2365 } else if (isDef(res.component) && typeof res.component.then === 'function') {
2366 res.component.then(resolve, reject);
2367
2368 if (isDef(res.error)) {
2369 factory.errorComp = ensureCtor(res.error, baseCtor);
2370 }
2371
2372 if (isDef(res.loading)) {
2373 factory.loadingComp = ensureCtor(res.loading, baseCtor);
2374 if (res.delay === 0) {
2375 factory.loading = true;
2376 } else {
2377 setTimeout(function () {
2378 if (isUndef(factory.resolved) && isUndef(factory.error)) {
2379 factory.loading = true;
2380 forceRender();
2381 }
2382 }, res.delay || 200);
2383 }
2384 }
2385
2386 if (isDef(res.timeout)) {
2387 setTimeout(function () {
2388 if (isUndef(factory.resolved)) {
2389 reject(
2390 false
2391 ? ("timeout (" + (res.timeout) + "ms)")
2392 : null
2393 );
2394 }
2395 }, res.timeout);
2396 }
2397 }
2398 }
2399
2400 sync = false;
2401 // return in case resolved synchronously
2402 return factory.loading
2403 ? factory.loadingComp
2404 : factory.resolved
2405 }
2406}
2407
2408/* */
2409
2410function isAsyncPlaceholder (node) {
2411 return node.isComment && node.asyncFactory
2412}
2413
2414/* */
2415
2416function getFirstComponentChild (children) {
2417 if (Array.isArray(children)) {
2418 for (var i = 0; i < children.length; i++) {
2419 var c = children[i];
2420 if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
2421 return c
2422 }
2423 }
2424 }
2425}
2426
2427/* */
2428
2429/* */
2430
2431function initEvents (vm) {
2432 vm._events = Object.create(null);
2433 vm._hasHookEvent = false;
2434 // init parent attached events
2435 var listeners = vm.$options._parentListeners;
2436 if (listeners) {
2437 updateComponentListeners(vm, listeners);
2438 }
2439}
2440
2441var target;
2442
2443function add (event, fn, once) {
2444 if (once) {
2445 target.$once(event, fn);
2446 } else {
2447 target.$on(event, fn);
2448 }
2449}
2450
2451function remove$1 (event, fn) {
2452 target.$off(event, fn);
2453}
2454
2455function updateComponentListeners (
2456 vm,
2457 listeners,
2458 oldListeners
2459) {
2460 target = vm;
2461 updateListeners(listeners, oldListeners || {}, add, remove$1, vm);
2462}
2463
2464function eventsMixin (Vue) {
2465 var hookRE = /^hook:/;
2466 Vue.prototype.$on = function (event, fn) {
2467 var this$1 = this;
2468
2469 var vm = this;
2470 if (Array.isArray(event)) {
2471 for (var i = 0, l = event.length; i < l; i++) {
2472 this$1.$on(event[i], fn);
2473 }
2474 } else {
2475 (vm._events[event] || (vm._events[event] = [])).push(fn);
2476 // optimize hook:event cost by using a boolean flag marked at registration
2477 // instead of a hash lookup
2478 if (hookRE.test(event)) {
2479 vm._hasHookEvent = true;
2480 }
2481 }
2482 return vm
2483 };
2484
2485 Vue.prototype.$once = function (event, fn) {
2486 var vm = this;
2487 function on () {
2488 vm.$off(event, on);
2489 fn.apply(vm, arguments);
2490 }
2491 on.fn = fn;
2492 vm.$on(event, on);
2493 return vm
2494 };
2495
2496 Vue.prototype.$off = function (event, fn) {
2497 var this$1 = this;
2498
2499 var vm = this;
2500 // all
2501 if (!arguments.length) {
2502 vm._events = Object.create(null);
2503 return vm
2504 }
2505 // array of events
2506 if (Array.isArray(event)) {
2507 for (var i = 0, l = event.length; i < l; i++) {
2508 this$1.$off(event[i], fn);
2509 }
2510 return vm
2511 }
2512 // specific event
2513 var cbs = vm._events[event];
2514 if (!cbs) {
2515 return vm
2516 }
2517 if (arguments.length === 1) {
2518 vm._events[event] = null;
2519 return vm
2520 }
2521 if (fn) {
2522 // specific handler
2523 var cb;
2524 var i$1 = cbs.length;
2525 while (i$1--) {
2526 cb = cbs[i$1];
2527 if (cb === fn || cb.fn === fn) {
2528 cbs.splice(i$1, 1);
2529 break
2530 }
2531 }
2532 }
2533 return vm
2534 };
2535
2536 Vue.prototype.$emit = function (event) {
2537 var vm = this;
2538 if (false) {
2539 var lowerCaseEvent = event.toLowerCase();
2540 if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
2541 tip(
2542 "Event \"" + lowerCaseEvent + "\" is emitted in component " +
2543 (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
2544 "Note that HTML attributes are case-insensitive and you cannot use " +
2545 "v-on to listen to camelCase events when using in-DOM templates. " +
2546 "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
2547 );
2548 }
2549 }
2550 var cbs = vm._events[event];
2551 if (cbs) {
2552 cbs = cbs.length > 1 ? toArray(cbs) : cbs;
2553 var args = toArray(arguments, 1);
2554 for (var i = 0, l = cbs.length; i < l; i++) {
2555 try {
2556 cbs[i].apply(vm, args);
2557 } catch (e) {
2558 handleError(e, vm, ("event handler for \"" + event + "\""));
2559 }
2560 }
2561 }
2562 return vm
2563 };
2564}
2565
2566/* */
2567
2568/**
2569 * Runtime helper for resolving raw children VNodes into a slot object.
2570 */
2571function resolveSlots (
2572 children,
2573 context
2574) {
2575 var slots = {};
2576 if (!children) {
2577 return slots
2578 }
2579 var defaultSlot = [];
2580 for (var i = 0, l = children.length; i < l; i++) {
2581 var child = children[i];
2582 var data = child.data;
2583 // remove slot attribute if the node is resolved as a Vue slot node
2584 if (data && data.attrs && data.attrs.slot) {
2585 delete data.attrs.slot;
2586 }
2587 // named slots should only be respected if the vnode was rendered in the
2588 // same context.
2589 if ((child.context === context || child.functionalContext === context) &&
2590 data && data.slot != null
2591 ) {
2592 var name = child.data.slot;
2593 var slot = (slots[name] || (slots[name] = []));
2594 if (child.tag === 'template') {
2595 slot.push.apply(slot, child.children);
2596 } else {
2597 slot.push(child);
2598 }
2599 } else {
2600 defaultSlot.push(child);
2601 }
2602 }
2603 // ignore whitespace
2604 if (!defaultSlot.every(isWhitespace)) {
2605 slots.default = defaultSlot;
2606 }
2607 return slots
2608}
2609
2610function isWhitespace (node) {
2611 return node.isComment || node.text === ' '
2612}
2613
2614function resolveScopedSlots (
2615 fns, // see flow/vnode
2616 res
2617) {
2618 res = res || {};
2619 for (var i = 0; i < fns.length; i++) {
2620 if (Array.isArray(fns[i])) {
2621 resolveScopedSlots(fns[i], res);
2622 } else {
2623 res[fns[i].key] = fns[i].fn;
2624 }
2625 }
2626 return res
2627}
2628
2629/* */
2630
2631var activeInstance = null;
2632var isUpdatingChildComponent = false;
2633
2634function initLifecycle (vm) {
2635 var options = vm.$options;
2636
2637 // locate first non-abstract parent
2638 var parent = options.parent;
2639 if (parent && !options.abstract) {
2640 while (parent.$options.abstract && parent.$parent) {
2641 parent = parent.$parent;
2642 }
2643 parent.$children.push(vm);
2644 }
2645
2646 vm.$parent = parent;
2647 vm.$root = parent ? parent.$root : vm;
2648
2649 vm.$children = [];
2650 vm.$refs = {};
2651
2652 vm._watcher = null;
2653 vm._inactive = null;
2654 vm._directInactive = false;
2655 vm._isMounted = false;
2656 vm._isDestroyed = false;
2657 vm._isBeingDestroyed = false;
2658}
2659
2660function lifecycleMixin (Vue) {
2661 Vue.prototype._update = function (vnode, hydrating) {
2662 var vm = this;
2663 if (vm._isMounted) {
2664 callHook(vm, 'beforeUpdate');
2665 }
2666 var prevEl = vm.$el;
2667 var prevVnode = vm._vnode;
2668 var prevActiveInstance = activeInstance;
2669 activeInstance = vm;
2670 vm._vnode = vnode;
2671 // Vue.prototype.__patch__ is injected in entry points
2672 // based on the rendering backend used.
2673 if (!prevVnode) {
2674 // initial render
2675 vm.$el = vm.__patch__(
2676 vm.$el, vnode, hydrating, false /* removeOnly */,
2677 vm.$options._parentElm,
2678 vm.$options._refElm
2679 );
2680 // no need for the ref nodes after initial patch
2681 // this prevents keeping a detached DOM tree in memory (#5851)
2682 vm.$options._parentElm = vm.$options._refElm = null;
2683 } else {
2684 // updates
2685 vm.$el = vm.__patch__(prevVnode, vnode);
2686 }
2687 activeInstance = prevActiveInstance;
2688 // update __vue__ reference
2689 if (prevEl) {
2690 prevEl.__vue__ = null;
2691 }
2692 if (vm.$el) {
2693 vm.$el.__vue__ = vm;
2694 }
2695 // if parent is an HOC, update its $el as well
2696 if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
2697 vm.$parent.$el = vm.$el;
2698 }
2699 // updated hook is called by the scheduler to ensure that children are
2700 // updated in a parent's updated hook.
2701 };
2702
2703 Vue.prototype.$forceUpdate = function () {
2704 var vm = this;
2705 if (vm._watcher) {
2706 vm._watcher.update();
2707 }
2708 };
2709
2710 Vue.prototype.$destroy = function () {
2711 var vm = this;
2712 if (vm._isBeingDestroyed) {
2713 return
2714 }
2715 callHook(vm, 'beforeDestroy');
2716 vm._isBeingDestroyed = true;
2717 // remove self from parent
2718 var parent = vm.$parent;
2719 if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
2720 remove(parent.$children, vm);
2721 }
2722 // teardown watchers
2723 if (vm._watcher) {
2724 vm._watcher.teardown();
2725 }
2726 var i = vm._watchers.length;
2727 while (i--) {
2728 vm._watchers[i].teardown();
2729 }
2730 // remove reference from data ob
2731 // frozen object may not have observer.
2732 if (vm._data.__ob__) {
2733 vm._data.__ob__.vmCount--;
2734 }
2735 // call the last hook...
2736 vm._isDestroyed = true;
2737 // invoke destroy hooks on current rendered tree
2738 vm.__patch__(vm._vnode, null);
2739 // fire destroyed hook
2740 callHook(vm, 'destroyed');
2741 // turn off all instance listeners.
2742 vm.$off();
2743 // remove __vue__ reference
2744 if (vm.$el) {
2745 vm.$el.__vue__ = null;
2746 }
2747 // release circular reference (#6759)
2748 if (vm.$vnode) {
2749 vm.$vnode.parent = null;
2750 }
2751 };
2752}
2753
2754function mountComponent (
2755 vm,
2756 el,
2757 hydrating
2758) {
2759 vm.$el = el;
2760 if (!vm.$options.render) {
2761 vm.$options.render = createEmptyVNode;
2762 if (false) {
2763 /* istanbul ignore if */
2764 if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
2765 vm.$options.el || el) {
2766 warn(
2767 'You are using the runtime-only build of Vue where the template ' +
2768 'compiler is not available. Either pre-compile the templates into ' +
2769 'render functions, or use the compiler-included build.',
2770 vm
2771 );
2772 } else {
2773 warn(
2774 'Failed to mount component: template or render function not defined.',
2775 vm
2776 );
2777 }
2778 }
2779 }
2780 callHook(vm, 'beforeMount');
2781
2782 var updateComponent;
2783 /* istanbul ignore if */
2784 if (false) {
2785 updateComponent = function () {
2786 var name = vm._name;
2787 var id = vm._uid;
2788 var startTag = "vue-perf-start:" + id;
2789 var endTag = "vue-perf-end:" + id;
2790
2791 mark(startTag);
2792 var vnode = vm._render();
2793 mark(endTag);
2794 measure(("vue " + name + " render"), startTag, endTag);
2795
2796 mark(startTag);
2797 vm._update(vnode, hydrating);
2798 mark(endTag);
2799 measure(("vue " + name + " patch"), startTag, endTag);
2800 };
2801 } else {
2802 updateComponent = function () {
2803 vm._update(vm._render(), hydrating);
2804 };
2805 }
2806
2807 vm._watcher = new Watcher(vm, updateComponent, noop);
2808 hydrating = false;
2809
2810 // manually mounted instance, call mounted on self
2811 // mounted is called for render-created child components in its inserted hook
2812 if (vm.$vnode == null) {
2813 vm._isMounted = true;
2814 callHook(vm, 'mounted');
2815 }
2816 return vm
2817}
2818
2819function updateChildComponent (
2820 vm,
2821 propsData,
2822 listeners,
2823 parentVnode,
2824 renderChildren
2825) {
2826 if (false) {
2827 isUpdatingChildComponent = true;
2828 }
2829
2830 // determine whether component has slot children
2831 // we need to do this before overwriting $options._renderChildren
2832 var hasChildren = !!(
2833 renderChildren || // has new static slots
2834 vm.$options._renderChildren || // has old static slots
2835 parentVnode.data.scopedSlots || // has new scoped slots
2836 vm.$scopedSlots !== emptyObject // has old scoped slots
2837 );
2838
2839 vm.$options._parentVnode = parentVnode;
2840 vm.$vnode = parentVnode; // update vm's placeholder node without re-render
2841
2842 if (vm._vnode) { // update child tree's parent
2843 vm._vnode.parent = parentVnode;
2844 }
2845 vm.$options._renderChildren = renderChildren;
2846
2847 // update $attrs and $listeners hash
2848 // these are also reactive so they may trigger child update if the child
2849 // used them during render
2850 vm.$attrs = (parentVnode.data && parentVnode.data.attrs) || emptyObject;
2851 vm.$listeners = listeners || emptyObject;
2852
2853 // update props
2854 if (propsData && vm.$options.props) {
2855 observerState.shouldConvert = false;
2856 var props = vm._props;
2857 var propKeys = vm.$options._propKeys || [];
2858 for (var i = 0; i < propKeys.length; i++) {
2859 var key = propKeys[i];
2860 props[key] = validateProp(key, vm.$options.props, propsData, vm);
2861 }
2862 observerState.shouldConvert = true;
2863 // keep a copy of raw propsData
2864 vm.$options.propsData = propsData;
2865 }
2866
2867 // update listeners
2868 if (listeners) {
2869 var oldListeners = vm.$options._parentListeners;
2870 vm.$options._parentListeners = listeners;
2871 updateComponentListeners(vm, listeners, oldListeners);
2872 }
2873 // resolve slots + force update if has children
2874 if (hasChildren) {
2875 vm.$slots = resolveSlots(renderChildren, parentVnode.context);
2876 vm.$forceUpdate();
2877 }
2878
2879 if (false) {
2880 isUpdatingChildComponent = false;
2881 }
2882}
2883
2884function isInInactiveTree (vm) {
2885 while (vm && (vm = vm.$parent)) {
2886 if (vm._inactive) { return true }
2887 }
2888 return false
2889}
2890
2891function activateChildComponent (vm, direct) {
2892 if (direct) {
2893 vm._directInactive = false;
2894 if (isInInactiveTree(vm)) {
2895 return
2896 }
2897 } else if (vm._directInactive) {
2898 return
2899 }
2900 if (vm._inactive || vm._inactive === null) {
2901 vm._inactive = false;
2902 for (var i = 0; i < vm.$children.length; i++) {
2903 activateChildComponent(vm.$children[i]);
2904 }
2905 callHook(vm, 'activated');
2906 }
2907}
2908
2909function deactivateChildComponent (vm, direct) {
2910 if (direct) {
2911 vm._directInactive = true;
2912 if (isInInactiveTree(vm)) {
2913 return
2914 }
2915 }
2916 if (!vm._inactive) {
2917 vm._inactive = true;
2918 for (var i = 0; i < vm.$children.length; i++) {
2919 deactivateChildComponent(vm.$children[i]);
2920 }
2921 callHook(vm, 'deactivated');
2922 }
2923}
2924
2925function callHook (vm, hook) {
2926 var handlers = vm.$options[hook];
2927 if (handlers) {
2928 for (var i = 0, j = handlers.length; i < j; i++) {
2929 try {
2930 handlers[i].call(vm);
2931 } catch (e) {
2932 handleError(e, vm, (hook + " hook"));
2933 }
2934 }
2935 }
2936 if (vm._hasHookEvent) {
2937 vm.$emit('hook:' + hook);
2938 }
2939}
2940
2941/* */
2942
2943
2944var MAX_UPDATE_COUNT = 100;
2945
2946var queue = [];
2947var activatedChildren = [];
2948var has = {};
2949var circular = {};
2950var waiting = false;
2951var flushing = false;
2952var index = 0;
2953
2954/**
2955 * Reset the scheduler's state.
2956 */
2957function resetSchedulerState () {
2958 index = queue.length = activatedChildren.length = 0;
2959 has = {};
2960 if (false) {
2961 circular = {};
2962 }
2963 waiting = flushing = false;
2964}
2965
2966/**
2967 * Flush both queues and run the watchers.
2968 */
2969function flushSchedulerQueue () {
2970 flushing = true;
2971 var watcher, id;
2972
2973 // Sort queue before flush.
2974 // This ensures that:
2975 // 1. Components are updated from parent to child. (because parent is always
2976 // created before the child)
2977 // 2. A component's user watchers are run before its render watcher (because
2978 // user watchers are created before the render watcher)
2979 // 3. If a component is destroyed during a parent component's watcher run,
2980 // its watchers can be skipped.
2981 queue.sort(function (a, b) { return a.id - b.id; });
2982
2983 // do not cache length because more watchers might be pushed
2984 // as we run existing watchers
2985 for (index = 0; index < queue.length; index++) {
2986 watcher = queue[index];
2987 id = watcher.id;
2988 has[id] = null;
2989 watcher.run();
2990 // in dev build, check and stop circular updates.
2991 if (false) {
2992 circular[id] = (circular[id] || 0) + 1;
2993 if (circular[id] > MAX_UPDATE_COUNT) {
2994 warn(
2995 'You may have an infinite update loop ' + (
2996 watcher.user
2997 ? ("in watcher with expression \"" + (watcher.expression) + "\"")
2998 : "in a component render function."
2999 ),
3000 watcher.vm
3001 );
3002 break
3003 }
3004 }
3005 }
3006
3007 // keep copies of post queues before resetting state
3008 var activatedQueue = activatedChildren.slice();
3009 var updatedQueue = queue.slice();
3010
3011 resetSchedulerState();
3012
3013 // call component updated and activated hooks
3014 callActivatedHooks(activatedQueue);
3015 callUpdatedHooks(updatedQueue);
3016
3017 // devtool hook
3018 /* istanbul ignore if */
3019 if (devtools && config.devtools) {
3020 devtools.emit('flush');
3021 }
3022}
3023
3024function callUpdatedHooks (queue) {
3025 var i = queue.length;
3026 while (i--) {
3027 var watcher = queue[i];
3028 var vm = watcher.vm;
3029 if (vm._watcher === watcher && vm._isMounted) {
3030 callHook(vm, 'updated');
3031 }
3032 }
3033}
3034
3035/**
3036 * Queue a kept-alive component that was activated during patch.
3037 * The queue will be processed after the entire tree has been patched.
3038 */
3039function queueActivatedComponent (vm) {
3040 // setting _inactive to false here so that a render function can
3041 // rely on checking whether it's in an inactive tree (e.g. router-view)
3042 vm._inactive = false;
3043 activatedChildren.push(vm);
3044}
3045
3046function callActivatedHooks (queue) {
3047 for (var i = 0; i < queue.length; i++) {
3048 queue[i]._inactive = true;
3049 activateChildComponent(queue[i], true /* true */);
3050 }
3051}
3052
3053/**
3054 * Push a watcher into the watcher queue.
3055 * Jobs with duplicate IDs will be skipped unless it's
3056 * pushed when the queue is being flushed.
3057 */
3058function queueWatcher (watcher) {
3059 var id = watcher.id;
3060 if (has[id] == null) {
3061 has[id] = true;
3062 if (!flushing) {
3063 queue.push(watcher);
3064 } else {
3065 // if already flushing, splice the watcher based on its id
3066 // if already past its id, it will be run next immediately.
3067 var i = queue.length - 1;
3068 while (i > index && queue[i].id > watcher.id) {
3069 i--;
3070 }
3071 queue.splice(i + 1, 0, watcher);
3072 }
3073 // queue the flush
3074 if (!waiting) {
3075 waiting = true;
3076 nextTick(flushSchedulerQueue);
3077 }
3078 }
3079}
3080
3081/* */
3082
3083var uid$2 = 0;
3084
3085/**
3086 * A watcher parses an expression, collects dependencies,
3087 * and fires callback when the expression value changes.
3088 * This is used for both the $watch() api and directives.
3089 */
3090var Watcher = function Watcher (
3091 vm,
3092 expOrFn,
3093 cb,
3094 options
3095) {
3096 this.vm = vm;
3097 vm._watchers.push(this);
3098 // options
3099 if (options) {
3100 this.deep = !!options.deep;
3101 this.user = !!options.user;
3102 this.lazy = !!options.lazy;
3103 this.sync = !!options.sync;
3104 } else {
3105 this.deep = this.user = this.lazy = this.sync = false;
3106 }
3107 this.cb = cb;
3108 this.id = ++uid$2; // uid for batching
3109 this.active = true;
3110 this.dirty = this.lazy; // for lazy watchers
3111 this.deps = [];
3112 this.newDeps = [];
3113 this.depIds = new _Set();
3114 this.newDepIds = new _Set();
3115 this.expression = false
3116 ? expOrFn.toString()
3117 : '';
3118 // parse expression for getter
3119 if (typeof expOrFn === 'function') {
3120 this.getter = expOrFn;
3121 } else {
3122 this.getter = parsePath(expOrFn);
3123 if (!this.getter) {
3124 this.getter = function () {};
3125 "production" !== 'production' && warn(
3126 "Failed watching path: \"" + expOrFn + "\" " +
3127 'Watcher only accepts simple dot-delimited paths. ' +
3128 'For full control, use a function instead.',
3129 vm
3130 );
3131 }
3132 }
3133 this.value = this.lazy
3134 ? undefined
3135 : this.get();
3136};
3137
3138/**
3139 * Evaluate the getter, and re-collect dependencies.
3140 */
3141Watcher.prototype.get = function get () {
3142 pushTarget(this);
3143 var value;
3144 var vm = this.vm;
3145 try {
3146 value = this.getter.call(vm, vm);
3147 } catch (e) {
3148 if (this.user) {
3149 handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
3150 } else {
3151 throw e
3152 }
3153 } finally {
3154 // "touch" every property so they are all tracked as
3155 // dependencies for deep watching
3156 if (this.deep) {
3157 traverse(value);
3158 }
3159 popTarget();
3160 this.cleanupDeps();
3161 }
3162 return value
3163};
3164
3165/**
3166 * Add a dependency to this directive.
3167 */
3168Watcher.prototype.addDep = function addDep (dep) {
3169 var id = dep.id;
3170 if (!this.newDepIds.has(id)) {
3171 this.newDepIds.add(id);
3172 this.newDeps.push(dep);
3173 if (!this.depIds.has(id)) {
3174 dep.addSub(this);
3175 }
3176 }
3177};
3178
3179/**
3180 * Clean up for dependency collection.
3181 */
3182Watcher.prototype.cleanupDeps = function cleanupDeps () {
3183 var this$1 = this;
3184
3185 var i = this.deps.length;
3186 while (i--) {
3187 var dep = this$1.deps[i];
3188 if (!this$1.newDepIds.has(dep.id)) {
3189 dep.removeSub(this$1);
3190 }
3191 }
3192 var tmp = this.depIds;
3193 this.depIds = this.newDepIds;
3194 this.newDepIds = tmp;
3195 this.newDepIds.clear();
3196 tmp = this.deps;
3197 this.deps = this.newDeps;
3198 this.newDeps = tmp;
3199 this.newDeps.length = 0;
3200};
3201
3202/**
3203 * Subscriber interface.
3204 * Will be called when a dependency changes.
3205 */
3206Watcher.prototype.update = function update () {
3207 /* istanbul ignore else */
3208 if (this.lazy) {
3209 this.dirty = true;
3210 } else if (this.sync) {
3211 this.run();
3212 } else {
3213 queueWatcher(this);
3214 }
3215};
3216
3217/**
3218 * Scheduler job interface.
3219 * Will be called by the scheduler.
3220 */
3221Watcher.prototype.run = function run () {
3222 if (this.active) {
3223 var value = this.get();
3224 if (
3225 value !== this.value ||
3226 // Deep watchers and watchers on Object/Arrays should fire even
3227 // when the value is the same, because the value may
3228 // have mutated.
3229 isObject(value) ||
3230 this.deep
3231 ) {
3232 // set new value
3233 var oldValue = this.value;
3234 this.value = value;
3235 if (this.user) {
3236 try {
3237 this.cb.call(this.vm, value, oldValue);
3238 } catch (e) {
3239 handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
3240 }
3241 } else {
3242 this.cb.call(this.vm, value, oldValue);
3243 }
3244 }
3245 }
3246};
3247
3248/**
3249 * Evaluate the value of the watcher.
3250 * This only gets called for lazy watchers.
3251 */
3252Watcher.prototype.evaluate = function evaluate () {
3253 this.value = this.get();
3254 this.dirty = false;
3255};
3256
3257/**
3258 * Depend on all deps collected by this watcher.
3259 */
3260Watcher.prototype.depend = function depend () {
3261 var this$1 = this;
3262
3263 var i = this.deps.length;
3264 while (i--) {
3265 this$1.deps[i].depend();
3266 }
3267};
3268
3269/**
3270 * Remove self from all dependencies' subscriber list.
3271 */
3272Watcher.prototype.teardown = function teardown () {
3273 var this$1 = this;
3274
3275 if (this.active) {
3276 // remove self from vm's watcher list
3277 // this is a somewhat expensive operation so we skip it
3278 // if the vm is being destroyed.
3279 if (!this.vm._isBeingDestroyed) {
3280 remove(this.vm._watchers, this);
3281 }
3282 var i = this.deps.length;
3283 while (i--) {
3284 this$1.deps[i].removeSub(this$1);
3285 }
3286 this.active = false;
3287 }
3288};
3289
3290/**
3291 * Recursively traverse an object to evoke all converted
3292 * getters, so that every nested property inside the object
3293 * is collected as a "deep" dependency.
3294 */
3295var seenObjects = new _Set();
3296function traverse (val) {
3297 seenObjects.clear();
3298 _traverse(val, seenObjects);
3299}
3300
3301function _traverse (val, seen) {
3302 var i, keys;
3303 var isA = Array.isArray(val);
3304 if ((!isA && !isObject(val)) || !Object.isExtensible(val)) {
3305 return
3306 }
3307 if (val.__ob__) {
3308 var depId = val.__ob__.dep.id;
3309 if (seen.has(depId)) {
3310 return
3311 }
3312 seen.add(depId);
3313 }
3314 if (isA) {
3315 i = val.length;
3316 while (i--) { _traverse(val[i], seen); }
3317 } else {
3318 keys = Object.keys(val);
3319 i = keys.length;
3320 while (i--) { _traverse(val[keys[i]], seen); }
3321 }
3322}
3323
3324/* */
3325
3326var sharedPropertyDefinition = {
3327 enumerable: true,
3328 configurable: true,
3329 get: noop,
3330 set: noop
3331};
3332
3333function proxy (target, sourceKey, key) {
3334 sharedPropertyDefinition.get = function proxyGetter () {
3335 return this[sourceKey][key]
3336 };
3337 sharedPropertyDefinition.set = function proxySetter (val) {
3338 this[sourceKey][key] = val;
3339 };
3340 Object.defineProperty(target, key, sharedPropertyDefinition);
3341}
3342
3343function initState (vm) {
3344 vm._watchers = [];
3345 var opts = vm.$options;
3346 if (opts.props) { initProps(vm, opts.props); }
3347 if (opts.methods) { initMethods(vm, opts.methods); }
3348 if (opts.data) {
3349 initData(vm);
3350 } else {
3351 observe(vm._data = {}, true /* asRootData */);
3352 }
3353 if (opts.computed) { initComputed(vm, opts.computed); }
3354 if (opts.watch && opts.watch !== nativeWatch) {
3355 initWatch(vm, opts.watch);
3356 }
3357}
3358
3359function initProps (vm, propsOptions) {
3360 var propsData = vm.$options.propsData || {};
3361 var props = vm._props = {};
3362 // cache prop keys so that future props updates can iterate using Array
3363 // instead of dynamic object key enumeration.
3364 var keys = vm.$options._propKeys = [];
3365 var isRoot = !vm.$parent;
3366 // root instance props should be converted
3367 observerState.shouldConvert = isRoot;
3368 var loop = function ( key ) {
3369 keys.push(key);
3370 var value = validateProp(key, propsOptions, propsData, vm);
3371 /* istanbul ignore else */
3372 if (false) {
3373 var hyphenatedKey = hyphenate(key);
3374 if (isReservedAttribute(hyphenatedKey) ||
3375 config.isReservedAttr(hyphenatedKey)) {
3376 warn(
3377 ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
3378 vm
3379 );
3380 }
3381 defineReactive(props, key, value, function () {
3382 if (vm.$parent && !isUpdatingChildComponent) {
3383 warn(
3384 "Avoid mutating a prop directly since the value will be " +
3385 "overwritten whenever the parent component re-renders. " +
3386 "Instead, use a data or computed property based on the prop's " +
3387 "value. Prop being mutated: \"" + key + "\"",
3388 vm
3389 );
3390 }
3391 });
3392 } else {
3393 defineReactive(props, key, value);
3394 }
3395 // static props are already proxied on the component's prototype
3396 // during Vue.extend(). We only need to proxy props defined at
3397 // instantiation here.
3398 if (!(key in vm)) {
3399 proxy(vm, "_props", key);
3400 }
3401 };
3402
3403 for (var key in propsOptions) loop( key );
3404 observerState.shouldConvert = true;
3405}
3406
3407function initData (vm) {
3408 var data = vm.$options.data;
3409 data = vm._data = typeof data === 'function'
3410 ? getData(data, vm)
3411 : data || {};
3412 if (!isPlainObject(data)) {
3413 data = {};
3414 "production" !== 'production' && warn(
3415 'data functions should return an object:\n' +
3416 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
3417 vm
3418 );
3419 }
3420 // proxy data on instance
3421 var keys = Object.keys(data);
3422 var props = vm.$options.props;
3423 var methods = vm.$options.methods;
3424 var i = keys.length;
3425 while (i--) {
3426 var key = keys[i];
3427 if (false) {
3428 if (methods && hasOwn(methods, key)) {
3429 warn(
3430 ("Method \"" + key + "\" has already been defined as a data property."),
3431 vm
3432 );
3433 }
3434 }
3435 if (props && hasOwn(props, key)) {
3436 "production" !== 'production' && warn(
3437 "The data property \"" + key + "\" is already declared as a prop. " +
3438 "Use prop default value instead.",
3439 vm
3440 );
3441 } else if (!isReserved(key)) {
3442 proxy(vm, "_data", key);
3443 }
3444 }
3445 // observe data
3446 observe(data, true /* asRootData */);
3447}
3448
3449function getData (data, vm) {
3450 try {
3451 return data.call(vm, vm)
3452 } catch (e) {
3453 handleError(e, vm, "data()");
3454 return {}
3455 }
3456}
3457
3458var computedWatcherOptions = { lazy: true };
3459
3460function initComputed (vm, computed) {
3461 var watchers = vm._computedWatchers = Object.create(null);
3462 // computed properties are just getters during SSR
3463 var isSSR = isServerRendering();
3464
3465 for (var key in computed) {
3466 var userDef = computed[key];
3467 var getter = typeof userDef === 'function' ? userDef : userDef.get;
3468 if (false) {
3469 warn(
3470 ("Getter is missing for computed property \"" + key + "\"."),
3471 vm
3472 );
3473 }
3474
3475 if (!isSSR) {
3476 // create internal watcher for the computed property.
3477 watchers[key] = new Watcher(
3478 vm,
3479 getter || noop,
3480 noop,
3481 computedWatcherOptions
3482 );
3483 }
3484
3485 // component-defined computed properties are already defined on the
3486 // component prototype. We only need to define computed properties defined
3487 // at instantiation here.
3488 if (!(key in vm)) {
3489 defineComputed(vm, key, userDef);
3490 } else if (false) {
3491 if (key in vm.$data) {
3492 warn(("The computed property \"" + key + "\" is already defined in data."), vm);
3493 } else if (vm.$options.props && key in vm.$options.props) {
3494 warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
3495 }
3496 }
3497 }
3498}
3499
3500function defineComputed (
3501 target,
3502 key,
3503 userDef
3504) {
3505 var shouldCache = !isServerRendering();
3506 if (typeof userDef === 'function') {
3507 sharedPropertyDefinition.get = shouldCache
3508 ? createComputedGetter(key)
3509 : userDef;
3510 sharedPropertyDefinition.set = noop;
3511 } else {
3512 sharedPropertyDefinition.get = userDef.get
3513 ? shouldCache && userDef.cache !== false
3514 ? createComputedGetter(key)
3515 : userDef.get
3516 : noop;
3517 sharedPropertyDefinition.set = userDef.set
3518 ? userDef.set
3519 : noop;
3520 }
3521 if (false) {
3522 sharedPropertyDefinition.set = function () {
3523 warn(
3524 ("Computed property \"" + key + "\" was assigned to but it has no setter."),
3525 this
3526 );
3527 };
3528 }
3529 Object.defineProperty(target, key, sharedPropertyDefinition);
3530}
3531
3532function createComputedGetter (key) {
3533 return function computedGetter () {
3534 var watcher = this._computedWatchers && this._computedWatchers[key];
3535 if (watcher) {
3536 if (watcher.dirty) {
3537 watcher.evaluate();
3538 }
3539 if (Dep.target) {
3540 watcher.depend();
3541 }
3542 return watcher.value
3543 }
3544 }
3545}
3546
3547function initMethods (vm, methods) {
3548 var props = vm.$options.props;
3549 for (var key in methods) {
3550 if (false) {
3551 if (methods[key] == null) {
3552 warn(
3553 "Method \"" + key + "\" has an undefined value in the component definition. " +
3554 "Did you reference the function correctly?",
3555 vm
3556 );
3557 }
3558 if (props && hasOwn(props, key)) {
3559 warn(
3560 ("Method \"" + key + "\" has already been defined as a prop."),
3561 vm
3562 );
3563 }
3564 if ((key in vm) && isReserved(key)) {
3565 warn(
3566 "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
3567 "Avoid defining component methods that start with _ or $."
3568 );
3569 }
3570 }
3571 vm[key] = methods[key] == null ? noop : bind(methods[key], vm);
3572 }
3573}
3574
3575function initWatch (vm, watch) {
3576 for (var key in watch) {
3577 var handler = watch[key];
3578 if (Array.isArray(handler)) {
3579 for (var i = 0; i < handler.length; i++) {
3580 createWatcher(vm, key, handler[i]);
3581 }
3582 } else {
3583 createWatcher(vm, key, handler);
3584 }
3585 }
3586}
3587
3588function createWatcher (
3589 vm,
3590 keyOrFn,
3591 handler,
3592 options
3593) {
3594 if (isPlainObject(handler)) {
3595 options = handler;
3596 handler = handler.handler;
3597 }
3598 if (typeof handler === 'string') {
3599 handler = vm[handler];
3600 }
3601 return vm.$watch(keyOrFn, handler, options)
3602}
3603
3604function stateMixin (Vue) {
3605 // flow somehow has problems with directly declared definition object
3606 // when using Object.defineProperty, so we have to procedurally build up
3607 // the object here.
3608 var dataDef = {};
3609 dataDef.get = function () { return this._data };
3610 var propsDef = {};
3611 propsDef.get = function () { return this._props };
3612 if (false) {
3613 dataDef.set = function (newData) {
3614 warn(
3615 'Avoid replacing instance root $data. ' +
3616 'Use nested data properties instead.',
3617 this
3618 );
3619 };
3620 propsDef.set = function () {
3621 warn("$props is readonly.", this);
3622 };
3623 }
3624 Object.defineProperty(Vue.prototype, '$data', dataDef);
3625 Object.defineProperty(Vue.prototype, '$props', propsDef);
3626
3627 Vue.prototype.$set = set;
3628 Vue.prototype.$delete = del;
3629
3630 Vue.prototype.$watch = function (
3631 expOrFn,
3632 cb,
3633 options
3634 ) {
3635 var vm = this;
3636 if (isPlainObject(cb)) {
3637 return createWatcher(vm, expOrFn, cb, options)
3638 }
3639 options = options || {};
3640 options.user = true;
3641 var watcher = new Watcher(vm, expOrFn, cb, options);
3642 if (options.immediate) {
3643 cb.call(vm, watcher.value);
3644 }
3645 return function unwatchFn () {
3646 watcher.teardown();
3647 }
3648 };
3649}
3650
3651/* */
3652
3653function initProvide (vm) {
3654 var provide = vm.$options.provide;
3655 if (provide) {
3656 vm._provided = typeof provide === 'function'
3657 ? provide.call(vm)
3658 : provide;
3659 }
3660}
3661
3662function initInjections (vm) {
3663 var result = resolveInject(vm.$options.inject, vm);
3664 if (result) {
3665 observerState.shouldConvert = false;
3666 Object.keys(result).forEach(function (key) {
3667 /* istanbul ignore else */
3668 if (false) {
3669 defineReactive(vm, key, result[key], function () {
3670 warn(
3671 "Avoid mutating an injected value directly since the changes will be " +
3672 "overwritten whenever the provided component re-renders. " +
3673 "injection being mutated: \"" + key + "\"",
3674 vm
3675 );
3676 });
3677 } else {
3678 defineReactive(vm, key, result[key]);
3679 }
3680 });
3681 observerState.shouldConvert = true;
3682 }
3683}
3684
3685function resolveInject (inject, vm) {
3686 if (inject) {
3687 // inject is :any because flow is not smart enough to figure out cached
3688 var result = Object.create(null);
3689 var keys = hasSymbol
3690 ? Reflect.ownKeys(inject).filter(function (key) {
3691 /* istanbul ignore next */
3692 return Object.getOwnPropertyDescriptor(inject, key).enumerable
3693 })
3694 : Object.keys(inject);
3695
3696 for (var i = 0; i < keys.length; i++) {
3697 var key = keys[i];
3698 var provideKey = inject[key].from;
3699 var source = vm;
3700 while (source) {
3701 if (source._provided && provideKey in source._provided) {
3702 result[key] = source._provided[provideKey];
3703 break
3704 }
3705 source = source.$parent;
3706 }
3707 if (!source) {
3708 if ('default' in inject[key]) {
3709 var provideDefault = inject[key].default;
3710 result[key] = typeof provideDefault === 'function'
3711 ? provideDefault.call(vm)
3712 : provideDefault;
3713 } else if (false) {
3714 warn(("Injection \"" + key + "\" not found"), vm);
3715 }
3716 }
3717 }
3718 return result
3719 }
3720}
3721
3722/* */
3723
3724/**
3725 * Runtime helper for rendering v-for lists.
3726 */
3727function renderList (
3728 val,
3729 render
3730) {
3731 var ret, i, l, keys, key;
3732 if (Array.isArray(val) || typeof val === 'string') {
3733 ret = new Array(val.length);
3734 for (i = 0, l = val.length; i < l; i++) {
3735 ret[i] = render(val[i], i);
3736 }
3737 } else if (typeof val === 'number') {
3738 ret = new Array(val);
3739 for (i = 0; i < val; i++) {
3740 ret[i] = render(i + 1, i);
3741 }
3742 } else if (isObject(val)) {
3743 keys = Object.keys(val);
3744 ret = new Array(keys.length);
3745 for (i = 0, l = keys.length; i < l; i++) {
3746 key = keys[i];
3747 ret[i] = render(val[key], key, i);
3748 }
3749 }
3750 if (isDef(ret)) {
3751 (ret)._isVList = true;
3752 }
3753 return ret
3754}
3755
3756/* */
3757
3758/**
3759 * Runtime helper for rendering <slot>
3760 */
3761function renderSlot (
3762 name,
3763 fallback,
3764 props,
3765 bindObject
3766) {
3767 var scopedSlotFn = this.$scopedSlots[name];
3768 if (scopedSlotFn) { // scoped slot
3769 props = props || {};
3770 if (bindObject) {
3771 if (false) {
3772 warn(
3773 'slot v-bind without argument expects an Object',
3774 this
3775 );
3776 }
3777 props = extend(extend({}, bindObject), props);
3778 }
3779 return scopedSlotFn(props) || fallback
3780 } else {
3781 var slotNodes = this.$slots[name];
3782 // warn duplicate slot usage
3783 if (slotNodes && "production" !== 'production') {
3784 slotNodes._rendered && warn(
3785 "Duplicate presence of slot \"" + name + "\" found in the same render tree " +
3786 "- this will likely cause render errors.",
3787 this
3788 );
3789 slotNodes._rendered = true;
3790 }
3791 return slotNodes || fallback
3792 }
3793}
3794
3795/* */
3796
3797/**
3798 * Runtime helper for resolving filters
3799 */
3800function resolveFilter (id) {
3801 return resolveAsset(this.$options, 'filters', id, true) || identity
3802}
3803
3804/* */
3805
3806/**
3807 * Runtime helper for checking keyCodes from config.
3808 * exposed as Vue.prototype._k
3809 * passing in eventKeyName as last argument separately for backwards compat
3810 */
3811function checkKeyCodes (
3812 eventKeyCode,
3813 key,
3814 builtInAlias,
3815 eventKeyName
3816) {
3817 var keyCodes = config.keyCodes[key] || builtInAlias;
3818 if (keyCodes) {
3819 if (Array.isArray(keyCodes)) {
3820 return keyCodes.indexOf(eventKeyCode) === -1
3821 } else {
3822 return keyCodes !== eventKeyCode
3823 }
3824 } else if (eventKeyName) {
3825 return hyphenate(eventKeyName) !== key
3826 }
3827}
3828
3829/* */
3830
3831/**
3832 * Runtime helper for merging v-bind="object" into a VNode's data.
3833 */
3834function bindObjectProps (
3835 data,
3836 tag,
3837 value,
3838 asProp,
3839 isSync
3840) {
3841 if (value) {
3842 if (!isObject(value)) {
3843 "production" !== 'production' && warn(
3844 'v-bind without argument expects an Object or Array value',
3845 this
3846 );
3847 } else {
3848 if (Array.isArray(value)) {
3849 value = toObject(value);
3850 }
3851 var hash;
3852 var loop = function ( key ) {
3853 if (
3854 key === 'class' ||
3855 key === 'style' ||
3856 isReservedAttribute(key)
3857 ) {
3858 hash = data;
3859 } else {
3860 var type = data.attrs && data.attrs.type;
3861 hash = asProp || config.mustUseProp(tag, type, key)
3862 ? data.domProps || (data.domProps = {})
3863 : data.attrs || (data.attrs = {});
3864 }
3865 if (!(key in hash)) {
3866 hash[key] = value[key];
3867
3868 if (isSync) {
3869 var on = data.on || (data.on = {});
3870 on[("update:" + key)] = function ($event) {
3871 value[key] = $event;
3872 };
3873 }
3874 }
3875 };
3876
3877 for (var key in value) loop( key );
3878 }
3879 }
3880 return data
3881}
3882
3883/* */
3884
3885/**
3886 * Runtime helper for rendering static trees.
3887 */
3888function renderStatic (
3889 index,
3890 isInFor
3891) {
3892 // static trees can be rendered once and cached on the contructor options
3893 // so every instance shares the same cached trees
3894 var renderFns = this.$options.staticRenderFns;
3895 var cached = renderFns.cached || (renderFns.cached = []);
3896 var tree = cached[index];
3897 // if has already-rendered static tree and not inside v-for,
3898 // we can reuse the same tree by doing a shallow clone.
3899 if (tree && !isInFor) {
3900 return Array.isArray(tree)
3901 ? cloneVNodes(tree)
3902 : cloneVNode(tree)
3903 }
3904 // otherwise, render a fresh tree.
3905 tree = cached[index] = renderFns[index].call(this._renderProxy, null, this);
3906 markStatic(tree, ("__static__" + index), false);
3907 return tree
3908}
3909
3910/**
3911 * Runtime helper for v-once.
3912 * Effectively it means marking the node as static with a unique key.
3913 */
3914function markOnce (
3915 tree,
3916 index,
3917 key
3918) {
3919 markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
3920 return tree
3921}
3922
3923function markStatic (
3924 tree,
3925 key,
3926 isOnce
3927) {
3928 if (Array.isArray(tree)) {
3929 for (var i = 0; i < tree.length; i++) {
3930 if (tree[i] && typeof tree[i] !== 'string') {
3931 markStaticNode(tree[i], (key + "_" + i), isOnce);
3932 }
3933 }
3934 } else {
3935 markStaticNode(tree, key, isOnce);
3936 }
3937}
3938
3939function markStaticNode (node, key, isOnce) {
3940 node.isStatic = true;
3941 node.key = key;
3942 node.isOnce = isOnce;
3943}
3944
3945/* */
3946
3947function bindObjectListeners (data, value) {
3948 if (value) {
3949 if (!isPlainObject(value)) {
3950 "production" !== 'production' && warn(
3951 'v-on without argument expects an Object value',
3952 this
3953 );
3954 } else {
3955 var on = data.on = data.on ? extend({}, data.on) : {};
3956 for (var key in value) {
3957 var existing = on[key];
3958 var ours = value[key];
3959 on[key] = existing ? [].concat(existing, ours) : ours;
3960 }
3961 }
3962 }
3963 return data
3964}
3965
3966/* */
3967
3968function installRenderHelpers (target) {
3969 target._o = markOnce;
3970 target._n = toNumber;
3971 target._s = toString;
3972 target._l = renderList;
3973 target._t = renderSlot;
3974 target._q = looseEqual;
3975 target._i = looseIndexOf;
3976 target._m = renderStatic;
3977 target._f = resolveFilter;
3978 target._k = checkKeyCodes;
3979 target._b = bindObjectProps;
3980 target._v = createTextVNode;
3981 target._e = createEmptyVNode;
3982 target._u = resolveScopedSlots;
3983 target._g = bindObjectListeners;
3984}
3985
3986/* */
3987
3988function FunctionalRenderContext (
3989 data,
3990 props,
3991 children,
3992 parent,
3993 Ctor
3994) {
3995 var options = Ctor.options;
3996 this.data = data;
3997 this.props = props;
3998 this.children = children;
3999 this.parent = parent;
4000 this.listeners = data.on || emptyObject;
4001 this.injections = resolveInject(options.inject, parent);
4002 this.slots = function () { return resolveSlots(children, parent); };
4003
4004 // ensure the createElement function in functional components
4005 // gets a unique context - this is necessary for correct named slot check
4006 var contextVm = Object.create(parent);
4007 var isCompiled = isTrue(options._compiled);
4008 var needNormalization = !isCompiled;
4009
4010 // support for compiled functional template
4011 if (isCompiled) {
4012 // exposing $options for renderStatic()
4013 this.$options = options;
4014 // pre-resolve slots for renderSlot()
4015 this.$slots = this.slots();
4016 this.$scopedSlots = data.scopedSlots || emptyObject;
4017 }
4018
4019 if (options._scopeId) {
4020 this._c = function (a, b, c, d) {
4021 var vnode = createElement(contextVm, a, b, c, d, needNormalization);
4022 if (vnode) {
4023 vnode.functionalScopeId = options._scopeId;
4024 vnode.functionalContext = parent;
4025 }
4026 return vnode
4027 };
4028 } else {
4029 this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
4030 }
4031}
4032
4033installRenderHelpers(FunctionalRenderContext.prototype);
4034
4035function createFunctionalComponent (
4036 Ctor,
4037 propsData,
4038 data,
4039 contextVm,
4040 children
4041) {
4042 var options = Ctor.options;
4043 var props = {};
4044 var propOptions = options.props;
4045 if (isDef(propOptions)) {
4046 for (var key in propOptions) {
4047 props[key] = validateProp(key, propOptions, propsData || emptyObject);
4048 }
4049 } else {
4050 if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
4051 if (isDef(data.props)) { mergeProps(props, data.props); }
4052 }
4053
4054 var renderContext = new FunctionalRenderContext(
4055 data,
4056 props,
4057 children,
4058 contextVm,
4059 Ctor
4060 );
4061
4062 var vnode = options.render.call(null, renderContext._c, renderContext);
4063
4064 if (vnode instanceof VNode) {
4065 vnode.functionalContext = contextVm;
4066 vnode.functionalOptions = options;
4067 if (data.slot) {
4068 (vnode.data || (vnode.data = {})).slot = data.slot;
4069 }
4070 }
4071
4072 return vnode
4073}
4074
4075function mergeProps (to, from) {
4076 for (var key in from) {
4077 to[camelize(key)] = from[key];
4078 }
4079}
4080
4081/* */
4082
4083// hooks to be invoked on component VNodes during patch
4084var componentVNodeHooks = {
4085 init: function init (
4086 vnode,
4087 hydrating,
4088 parentElm,
4089 refElm
4090 ) {
4091 if (!vnode.componentInstance || vnode.componentInstance._isDestroyed) {
4092 var child = vnode.componentInstance = createComponentInstanceForVnode(
4093 vnode,
4094 activeInstance,
4095 parentElm,
4096 refElm
4097 );
4098 child.$mount(hydrating ? vnode.elm : undefined, hydrating);
4099 } else if (vnode.data.keepAlive) {
4100 // kept-alive components, treat as a patch
4101 var mountedNode = vnode; // work around flow
4102 componentVNodeHooks.prepatch(mountedNode, mountedNode);
4103 }
4104 },
4105
4106 prepatch: function prepatch (oldVnode, vnode) {
4107 var options = vnode.componentOptions;
4108 var child = vnode.componentInstance = oldVnode.componentInstance;
4109 updateChildComponent(
4110 child,
4111 options.propsData, // updated props
4112 options.listeners, // updated listeners
4113 vnode, // new parent vnode
4114 options.children // new children
4115 );
4116 },
4117
4118 insert: function insert (vnode) {
4119 var context = vnode.context;
4120 var componentInstance = vnode.componentInstance;
4121 if (!componentInstance._isMounted) {
4122 componentInstance._isMounted = true;
4123 callHook(componentInstance, 'mounted');
4124 }
4125 if (vnode.data.keepAlive) {
4126 if (context._isMounted) {
4127 // vue-router#1212
4128 // During updates, a kept-alive component's child components may
4129 // change, so directly walking the tree here may call activated hooks
4130 // on incorrect children. Instead we push them into a queue which will
4131 // be processed after the whole patch process ended.
4132 queueActivatedComponent(componentInstance);
4133 } else {
4134 activateChildComponent(componentInstance, true /* direct */);
4135 }
4136 }
4137 },
4138
4139 destroy: function destroy (vnode) {
4140 var componentInstance = vnode.componentInstance;
4141 if (!componentInstance._isDestroyed) {
4142 if (!vnode.data.keepAlive) {
4143 componentInstance.$destroy();
4144 } else {
4145 deactivateChildComponent(componentInstance, true /* direct */);
4146 }
4147 }
4148 }
4149};
4150
4151var hooksToMerge = Object.keys(componentVNodeHooks);
4152
4153function createComponent (
4154 Ctor,
4155 data,
4156 context,
4157 children,
4158 tag
4159) {
4160 if (isUndef(Ctor)) {
4161 return
4162 }
4163
4164 var baseCtor = context.$options._base;
4165
4166 // plain options object: turn it into a constructor
4167 if (isObject(Ctor)) {
4168 Ctor = baseCtor.extend(Ctor);
4169 }
4170
4171 // if at this stage it's not a constructor or an async component factory,
4172 // reject.
4173 if (typeof Ctor !== 'function') {
4174 if (false) {
4175 warn(("Invalid Component definition: " + (String(Ctor))), context);
4176 }
4177 return
4178 }
4179
4180 // async component
4181 var asyncFactory;
4182 if (isUndef(Ctor.cid)) {
4183 asyncFactory = Ctor;
4184 Ctor = resolveAsyncComponent(asyncFactory, baseCtor, context);
4185 if (Ctor === undefined) {
4186 // return a placeholder node for async component, which is rendered
4187 // as a comment node but preserves all the raw information for the node.
4188 // the information will be used for async server-rendering and hydration.
4189 return createAsyncPlaceholder(
4190 asyncFactory,
4191 data,
4192 context,
4193 children,
4194 tag
4195 )
4196 }
4197 }
4198
4199 data = data || {};
4200
4201 // resolve constructor options in case global mixins are applied after
4202 // component constructor creation
4203 resolveConstructorOptions(Ctor);
4204
4205 // transform component v-model data into props & events
4206 if (isDef(data.model)) {
4207 transformModel(Ctor.options, data);
4208 }
4209
4210 // extract props
4211 var propsData = extractPropsFromVNodeData(data, Ctor, tag);
4212
4213 // functional component
4214 if (isTrue(Ctor.options.functional)) {
4215 return createFunctionalComponent(Ctor, propsData, data, context, children)
4216 }
4217
4218 // extract listeners, since these needs to be treated as
4219 // child component listeners instead of DOM listeners
4220 var listeners = data.on;
4221 // replace with listeners with .native modifier
4222 // so it gets processed during parent component patch.
4223 data.on = data.nativeOn;
4224
4225 if (isTrue(Ctor.options.abstract)) {
4226 // abstract components do not keep anything
4227 // other than props & listeners & slot
4228
4229 // work around flow
4230 var slot = data.slot;
4231 data = {};
4232 if (slot) {
4233 data.slot = slot;
4234 }
4235 }
4236
4237 // merge component management hooks onto the placeholder node
4238 mergeHooks(data);
4239
4240 // return a placeholder vnode
4241 var name = Ctor.options.name || tag;
4242 var vnode = new VNode(
4243 ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
4244 data, undefined, undefined, undefined, context,
4245 { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
4246 asyncFactory
4247 );
4248 return vnode
4249}
4250
4251function createComponentInstanceForVnode (
4252 vnode, // we know it's MountedComponentVNode but flow doesn't
4253 parent, // activeInstance in lifecycle state
4254 parentElm,
4255 refElm
4256) {
4257 var vnodeComponentOptions = vnode.componentOptions;
4258 var options = {
4259 _isComponent: true,
4260 parent: parent,
4261 propsData: vnodeComponentOptions.propsData,
4262 _componentTag: vnodeComponentOptions.tag,
4263 _parentVnode: vnode,
4264 _parentListeners: vnodeComponentOptions.listeners,
4265 _renderChildren: vnodeComponentOptions.children,
4266 _parentElm: parentElm || null,
4267 _refElm: refElm || null
4268 };
4269 // check inline-template render functions
4270 var inlineTemplate = vnode.data.inlineTemplate;
4271 if (isDef(inlineTemplate)) {
4272 options.render = inlineTemplate.render;
4273 options.staticRenderFns = inlineTemplate.staticRenderFns;
4274 }
4275 return new vnodeComponentOptions.Ctor(options)
4276}
4277
4278function mergeHooks (data) {
4279 if (!data.hook) {
4280 data.hook = {};
4281 }
4282 for (var i = 0; i < hooksToMerge.length; i++) {
4283 var key = hooksToMerge[i];
4284 var fromParent = data.hook[key];
4285 var ours = componentVNodeHooks[key];
4286 data.hook[key] = fromParent ? mergeHook$1(ours, fromParent) : ours;
4287 }
4288}
4289
4290function mergeHook$1 (one, two) {
4291 return function (a, b, c, d) {
4292 one(a, b, c, d);
4293 two(a, b, c, d);
4294 }
4295}
4296
4297// transform component v-model info (value and callback) into
4298// prop and event handler respectively.
4299function transformModel (options, data) {
4300 var prop = (options.model && options.model.prop) || 'value';
4301 var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;
4302 var on = data.on || (data.on = {});
4303 if (isDef(on[event])) {
4304 on[event] = [data.model.callback].concat(on[event]);
4305 } else {
4306 on[event] = data.model.callback;
4307 }
4308}
4309
4310/* */
4311
4312var SIMPLE_NORMALIZE = 1;
4313var ALWAYS_NORMALIZE = 2;
4314
4315// wrapper function for providing a more flexible interface
4316// without getting yelled at by flow
4317function createElement (
4318 context,
4319 tag,
4320 data,
4321 children,
4322 normalizationType,
4323 alwaysNormalize
4324) {
4325 if (Array.isArray(data) || isPrimitive(data)) {
4326 normalizationType = children;
4327 children = data;
4328 data = undefined;
4329 }
4330 if (isTrue(alwaysNormalize)) {
4331 normalizationType = ALWAYS_NORMALIZE;
4332 }
4333 return _createElement(context, tag, data, children, normalizationType)
4334}
4335
4336function _createElement (
4337 context,
4338 tag,
4339 data,
4340 children,
4341 normalizationType
4342) {
4343 if (isDef(data) && isDef((data).__ob__)) {
4344 "production" !== 'production' && warn(
4345 "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
4346 'Always create fresh vnode data objects in each render!',
4347 context
4348 );
4349 return createEmptyVNode()
4350 }
4351 // object syntax in v-bind
4352 if (isDef(data) && isDef(data.is)) {
4353 tag = data.is;
4354 }
4355 if (!tag) {
4356 // in case of component :is set to falsy value
4357 return createEmptyVNode()
4358 }
4359 // warn against non-primitive key
4360 if (false
4361 ) {
4362 warn(
4363 'Avoid using non-primitive value as key, ' +
4364 'use string/number value instead.',
4365 context
4366 );
4367 }
4368 // support single function children as default scoped slot
4369 if (Array.isArray(children) &&
4370 typeof children[0] === 'function'
4371 ) {
4372 data = data || {};
4373 data.scopedSlots = { default: children[0] };
4374 children.length = 0;
4375 }
4376 if (normalizationType === ALWAYS_NORMALIZE) {
4377 children = normalizeChildren(children);
4378 } else if (normalizationType === SIMPLE_NORMALIZE) {
4379 children = simpleNormalizeChildren(children);
4380 }
4381 var vnode, ns;
4382 if (typeof tag === 'string') {
4383 var Ctor;
4384 ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
4385 if (config.isReservedTag(tag)) {
4386 // platform built-in elements
4387 vnode = new VNode(
4388 config.parsePlatformTagName(tag), data, children,
4389 undefined, undefined, context
4390 );
4391 } else if (isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
4392 // component
4393 vnode = createComponent(Ctor, data, context, children, tag);
4394 } else {
4395 // unknown or unlisted namespaced elements
4396 // check at runtime because it may get assigned a namespace when its
4397 // parent normalizes children
4398 vnode = new VNode(
4399 tag, data, children,
4400 undefined, undefined, context
4401 );
4402 }
4403 } else {
4404 // direct component options / constructor
4405 vnode = createComponent(tag, data, context, children);
4406 }
4407 if (isDef(vnode)) {
4408 if (ns) { applyNS(vnode, ns); }
4409 return vnode
4410 } else {
4411 return createEmptyVNode()
4412 }
4413}
4414
4415function applyNS (vnode, ns, force) {
4416 vnode.ns = ns;
4417 if (vnode.tag === 'foreignObject') {
4418 // use default namespace inside foreignObject
4419 ns = undefined;
4420 force = true;
4421 }
4422 if (isDef(vnode.children)) {
4423 for (var i = 0, l = vnode.children.length; i < l; i++) {
4424 var child = vnode.children[i];
4425 if (isDef(child.tag) && (isUndef(child.ns) || isTrue(force))) {
4426 applyNS(child, ns, force);
4427 }
4428 }
4429 }
4430}
4431
4432/* */
4433
4434function initRender (vm) {
4435 vm._vnode = null; // the root of the child tree
4436 var options = vm.$options;
4437 var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
4438 var renderContext = parentVnode && parentVnode.context;
4439 vm.$slots = resolveSlots(options._renderChildren, renderContext);
4440 vm.$scopedSlots = emptyObject;
4441 // bind the createElement fn to this instance
4442 // so that we get proper render context inside it.
4443 // args order: tag, data, children, normalizationType, alwaysNormalize
4444 // internal version is used by render functions compiled from templates
4445 vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
4446 // normalization is always applied for the public version, used in
4447 // user-written render functions.
4448 vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
4449
4450 // $attrs & $listeners are exposed for easier HOC creation.
4451 // they need to be reactive so that HOCs using them are always updated
4452 var parentData = parentVnode && parentVnode.data;
4453
4454 /* istanbul ignore else */
4455 if (false) {
4456 defineReactive(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
4457 !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
4458 }, true);
4459 defineReactive(vm, '$listeners', options._parentListeners || emptyObject, function () {
4460 !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
4461 }, true);
4462 } else {
4463 defineReactive(vm, '$attrs', parentData && parentData.attrs || emptyObject, null, true);
4464 defineReactive(vm, '$listeners', options._parentListeners || emptyObject, null, true);
4465 }
4466}
4467
4468function renderMixin (Vue) {
4469 // install runtime convenience helpers
4470 installRenderHelpers(Vue.prototype);
4471
4472 Vue.prototype.$nextTick = function (fn) {
4473 return nextTick(fn, this)
4474 };
4475
4476 Vue.prototype._render = function () {
4477 var vm = this;
4478 var ref = vm.$options;
4479 var render = ref.render;
4480 var _parentVnode = ref._parentVnode;
4481
4482 if (vm._isMounted) {
4483 // if the parent didn't update, the slot nodes will be the ones from
4484 // last render. They need to be cloned to ensure "freshness" for this render.
4485 for (var key in vm.$slots) {
4486 var slot = vm.$slots[key];
4487 if (slot._rendered) {
4488 vm.$slots[key] = cloneVNodes(slot, true /* deep */);
4489 }
4490 }
4491 }
4492
4493 vm.$scopedSlots = (_parentVnode && _parentVnode.data.scopedSlots) || emptyObject;
4494
4495 // set parent vnode. this allows render functions to have access
4496 // to the data on the placeholder node.
4497 vm.$vnode = _parentVnode;
4498 // render self
4499 var vnode;
4500 try {
4501 vnode = render.call(vm._renderProxy, vm.$createElement);
4502 } catch (e) {
4503 handleError(e, vm, "render");
4504 // return error render result,
4505 // or previous vnode to prevent render error causing blank component
4506 /* istanbul ignore else */
4507 if (false) {
4508 if (vm.$options.renderError) {
4509 try {
4510 vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
4511 } catch (e) {
4512 handleError(e, vm, "renderError");
4513 vnode = vm._vnode;
4514 }
4515 } else {
4516 vnode = vm._vnode;
4517 }
4518 } else {
4519 vnode = vm._vnode;
4520 }
4521 }
4522 // return empty vnode in case the render function errored out
4523 if (!(vnode instanceof VNode)) {
4524 if (false) {
4525 warn(
4526 'Multiple root nodes returned from render function. Render function ' +
4527 'should return a single root node.',
4528 vm
4529 );
4530 }
4531 vnode = createEmptyVNode();
4532 }
4533 // set parent
4534 vnode.parent = _parentVnode;
4535 return vnode
4536 };
4537}
4538
4539/* */
4540
4541var uid = 0;
4542
4543function initMixin (Vue) {
4544 Vue.prototype._init = function (options) {
4545 var vm = this;
4546 // a uid
4547 vm._uid = uid++;
4548
4549 var startTag, endTag;
4550 /* istanbul ignore if */
4551 if (false) {
4552 startTag = "vue-perf-start:" + (vm._uid);
4553 endTag = "vue-perf-end:" + (vm._uid);
4554 mark(startTag);
4555 }
4556
4557 // a flag to avoid this being observed
4558 vm._isVue = true;
4559 // merge options
4560 if (options && options._isComponent) {
4561 // optimize internal component instantiation
4562 // since dynamic options merging is pretty slow, and none of the
4563 // internal component options needs special treatment.
4564 initInternalComponent(vm, options);
4565 } else {
4566 vm.$options = mergeOptions(
4567 resolveConstructorOptions(vm.constructor),
4568 options || {},
4569 vm
4570 );
4571 }
4572 /* istanbul ignore else */
4573 if (false) {
4574 initProxy(vm);
4575 } else {
4576 vm._renderProxy = vm;
4577 }
4578 // expose real self
4579 vm._self = vm;
4580 initLifecycle(vm);
4581 initEvents(vm);
4582 initRender(vm);
4583 callHook(vm, 'beforeCreate');
4584 initInjections(vm); // resolve injections before data/props
4585 initState(vm);
4586 initProvide(vm); // resolve provide after data/props
4587 callHook(vm, 'created');
4588
4589 /* istanbul ignore if */
4590 if (false) {
4591 vm._name = formatComponentName(vm, false);
4592 mark(endTag);
4593 measure(("vue " + (vm._name) + " init"), startTag, endTag);
4594 }
4595
4596 if (vm.$options.el) {
4597 vm.$mount(vm.$options.el);
4598 }
4599 };
4600}
4601
4602function initInternalComponent (vm, options) {
4603 var opts = vm.$options = Object.create(vm.constructor.options);
4604 // doing this because it's faster than dynamic enumeration.
4605 opts.parent = options.parent;
4606 opts.propsData = options.propsData;
4607 opts._parentVnode = options._parentVnode;
4608 opts._parentListeners = options._parentListeners;
4609 opts._renderChildren = options._renderChildren;
4610 opts._componentTag = options._componentTag;
4611 opts._parentElm = options._parentElm;
4612 opts._refElm = options._refElm;
4613 if (options.render) {
4614 opts.render = options.render;
4615 opts.staticRenderFns = options.staticRenderFns;
4616 }
4617}
4618
4619function resolveConstructorOptions (Ctor) {
4620 var options = Ctor.options;
4621 if (Ctor.super) {
4622 var superOptions = resolveConstructorOptions(Ctor.super);
4623 var cachedSuperOptions = Ctor.superOptions;
4624 if (superOptions !== cachedSuperOptions) {
4625 // super option changed,
4626 // need to resolve new options.
4627 Ctor.superOptions = superOptions;
4628 // check if there are any late-modified/attached options (#4976)
4629 var modifiedOptions = resolveModifiedOptions(Ctor);
4630 // update base extend options
4631 if (modifiedOptions) {
4632 extend(Ctor.extendOptions, modifiedOptions);
4633 }
4634 options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
4635 if (options.name) {
4636 options.components[options.name] = Ctor;
4637 }
4638 }
4639 }
4640 return options
4641}
4642
4643function resolveModifiedOptions (Ctor) {
4644 var modified;
4645 var latest = Ctor.options;
4646 var extended = Ctor.extendOptions;
4647 var sealed = Ctor.sealedOptions;
4648 for (var key in latest) {
4649 if (latest[key] !== sealed[key]) {
4650 if (!modified) { modified = {}; }
4651 modified[key] = dedupe(latest[key], extended[key], sealed[key]);
4652 }
4653 }
4654 return modified
4655}
4656
4657function dedupe (latest, extended, sealed) {
4658 // compare latest and sealed to ensure lifecycle hooks won't be duplicated
4659 // between merges
4660 if (Array.isArray(latest)) {
4661 var res = [];
4662 sealed = Array.isArray(sealed) ? sealed : [sealed];
4663 extended = Array.isArray(extended) ? extended : [extended];
4664 for (var i = 0; i < latest.length; i++) {
4665 // push original options and not sealed options to exclude duplicated options
4666 if (extended.indexOf(latest[i]) >= 0 || sealed.indexOf(latest[i]) < 0) {
4667 res.push(latest[i]);
4668 }
4669 }
4670 return res
4671 } else {
4672 return latest
4673 }
4674}
4675
4676function Vue$3 (options) {
4677 if (false
4678 ) {
4679 warn('Vue is a constructor and should be called with the `new` keyword');
4680 }
4681 this._init(options);
4682}
4683
4684initMixin(Vue$3);
4685stateMixin(Vue$3);
4686eventsMixin(Vue$3);
4687lifecycleMixin(Vue$3);
4688renderMixin(Vue$3);
4689
4690/* */
4691
4692function initUse (Vue) {
4693 Vue.use = function (plugin) {
4694 var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
4695 if (installedPlugins.indexOf(plugin) > -1) {
4696 return this
4697 }
4698
4699 // additional parameters
4700 var args = toArray(arguments, 1);
4701 args.unshift(this);
4702 if (typeof plugin.install === 'function') {
4703 plugin.install.apply(plugin, args);
4704 } else if (typeof plugin === 'function') {
4705 plugin.apply(null, args);
4706 }
4707 installedPlugins.push(plugin);
4708 return this
4709 };
4710}
4711
4712/* */
4713
4714function initMixin$1 (Vue) {
4715 Vue.mixin = function (mixin) {
4716 this.options = mergeOptions(this.options, mixin);
4717 return this
4718 };
4719}
4720
4721/* */
4722
4723function initExtend (Vue) {
4724 /**
4725 * Each instance constructor, including Vue, has a unique
4726 * cid. This enables us to create wrapped "child
4727 * constructors" for prototypal inheritance and cache them.
4728 */
4729 Vue.cid = 0;
4730 var cid = 1;
4731
4732 /**
4733 * Class inheritance
4734 */
4735 Vue.extend = function (extendOptions) {
4736 extendOptions = extendOptions || {};
4737 var Super = this;
4738 var SuperId = Super.cid;
4739 var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
4740 if (cachedCtors[SuperId]) {
4741 return cachedCtors[SuperId]
4742 }
4743
4744 var name = extendOptions.name || Super.options.name;
4745 if (false) {
4746 if (!/^[a-zA-Z][\w-]*$/.test(name)) {
4747 warn(
4748 'Invalid component name: "' + name + '". Component names ' +
4749 'can only contain alphanumeric characters and the hyphen, ' +
4750 'and must start with a letter.'
4751 );
4752 }
4753 }
4754
4755 var Sub = function VueComponent (options) {
4756 this._init(options);
4757 };
4758 Sub.prototype = Object.create(Super.prototype);
4759 Sub.prototype.constructor = Sub;
4760 Sub.cid = cid++;
4761 Sub.options = mergeOptions(
4762 Super.options,
4763 extendOptions
4764 );
4765 Sub['super'] = Super;
4766
4767 // For props and computed properties, we define the proxy getters on
4768 // the Vue instances at extension time, on the extended prototype. This
4769 // avoids Object.defineProperty calls for each instance created.
4770 if (Sub.options.props) {
4771 initProps$1(Sub);
4772 }
4773 if (Sub.options.computed) {
4774 initComputed$1(Sub);
4775 }
4776
4777 // allow further extension/mixin/plugin usage
4778 Sub.extend = Super.extend;
4779 Sub.mixin = Super.mixin;
4780 Sub.use = Super.use;
4781
4782 // create asset registers, so extended classes
4783 // can have their private assets too.
4784 ASSET_TYPES.forEach(function (type) {
4785 Sub[type] = Super[type];
4786 });
4787 // enable recursive self-lookup
4788 if (name) {
4789 Sub.options.components[name] = Sub;
4790 }
4791
4792 // keep a reference to the super options at extension time.
4793 // later at instantiation we can check if Super's options have
4794 // been updated.
4795 Sub.superOptions = Super.options;
4796 Sub.extendOptions = extendOptions;
4797 Sub.sealedOptions = extend({}, Sub.options);
4798
4799 // cache constructor
4800 cachedCtors[SuperId] = Sub;
4801 return Sub
4802 };
4803}
4804
4805function initProps$1 (Comp) {
4806 var props = Comp.options.props;
4807 for (var key in props) {
4808 proxy(Comp.prototype, "_props", key);
4809 }
4810}
4811
4812function initComputed$1 (Comp) {
4813 var computed = Comp.options.computed;
4814 for (var key in computed) {
4815 defineComputed(Comp.prototype, key, computed[key]);
4816 }
4817}
4818
4819/* */
4820
4821function initAssetRegisters (Vue) {
4822 /**
4823 * Create asset registration methods.
4824 */
4825 ASSET_TYPES.forEach(function (type) {
4826 Vue[type] = function (
4827 id,
4828 definition
4829 ) {
4830 if (!definition) {
4831 return this.options[type + 's'][id]
4832 } else {
4833 /* istanbul ignore if */
4834 if (false) {
4835 if (type === 'component' && config.isReservedTag(id)) {
4836 warn(
4837 'Do not use built-in or reserved HTML elements as component ' +
4838 'id: ' + id
4839 );
4840 }
4841 }
4842 if (type === 'component' && isPlainObject(definition)) {
4843 definition.name = definition.name || id;
4844 definition = this.options._base.extend(definition);
4845 }
4846 if (type === 'directive' && typeof definition === 'function') {
4847 definition = { bind: definition, update: definition };
4848 }
4849 this.options[type + 's'][id] = definition;
4850 return definition
4851 }
4852 };
4853 });
4854}
4855
4856/* */
4857
4858function getComponentName (opts) {
4859 return opts && (opts.Ctor.options.name || opts.tag)
4860}
4861
4862function matches (pattern, name) {
4863 if (Array.isArray(pattern)) {
4864 return pattern.indexOf(name) > -1
4865 } else if (typeof pattern === 'string') {
4866 return pattern.split(',').indexOf(name) > -1
4867 } else if (isRegExp(pattern)) {
4868 return pattern.test(name)
4869 }
4870 /* istanbul ignore next */
4871 return false
4872}
4873
4874function pruneCache (keepAliveInstance, filter) {
4875 var cache = keepAliveInstance.cache;
4876 var keys = keepAliveInstance.keys;
4877 var _vnode = keepAliveInstance._vnode;
4878 for (var key in cache) {
4879 var cachedNode = cache[key];
4880 if (cachedNode) {
4881 var name = getComponentName(cachedNode.componentOptions);
4882 if (name && !filter(name)) {
4883 pruneCacheEntry(cache, key, keys, _vnode);
4884 }
4885 }
4886 }
4887}
4888
4889function pruneCacheEntry (
4890 cache,
4891 key,
4892 keys,
4893 current
4894) {
4895 var cached$$1 = cache[key];
4896 if (cached$$1 && cached$$1 !== current) {
4897 cached$$1.componentInstance.$destroy();
4898 }
4899 cache[key] = null;
4900 remove(keys, key);
4901}
4902
4903var patternTypes = [String, RegExp, Array];
4904
4905var KeepAlive = {
4906 name: 'keep-alive',
4907 abstract: true,
4908
4909 props: {
4910 include: patternTypes,
4911 exclude: patternTypes,
4912 max: [String, Number]
4913 },
4914
4915 created: function created () {
4916 this.cache = Object.create(null);
4917 this.keys = [];
4918 },
4919
4920 destroyed: function destroyed () {
4921 var this$1 = this;
4922
4923 for (var key in this$1.cache) {
4924 pruneCacheEntry(this$1.cache, key, this$1.keys);
4925 }
4926 },
4927
4928 watch: {
4929 include: function include (val) {
4930 pruneCache(this, function (name) { return matches(val, name); });
4931 },
4932 exclude: function exclude (val) {
4933 pruneCache(this, function (name) { return !matches(val, name); });
4934 }
4935 },
4936
4937 render: function render () {
4938 var vnode = getFirstComponentChild(this.$slots.default);
4939 var componentOptions = vnode && vnode.componentOptions;
4940 if (componentOptions) {
4941 // check pattern
4942 var name = getComponentName(componentOptions);
4943 if (name && (
4944 (this.include && !matches(this.include, name)) ||
4945 (this.exclude && matches(this.exclude, name))
4946 )) {
4947 return vnode
4948 }
4949
4950 var ref = this;
4951 var cache = ref.cache;
4952 var keys = ref.keys;
4953 var key = vnode.key == null
4954 // same constructor may get registered as different local components
4955 // so cid alone is not enough (#3269)
4956 ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
4957 : vnode.key;
4958 if (cache[key]) {
4959 vnode.componentInstance = cache[key].componentInstance;
4960 // make current key freshest
4961 remove(keys, key);
4962 keys.push(key);
4963 } else {
4964 cache[key] = vnode;
4965 keys.push(key);
4966 // prune oldest entry
4967 if (this.max && keys.length > parseInt(this.max)) {
4968 pruneCacheEntry(cache, keys[0], keys, this._vnode);
4969 }
4970 }
4971
4972 vnode.data.keepAlive = true;
4973 }
4974 return vnode
4975 }
4976};
4977
4978var builtInComponents = {
4979 KeepAlive: KeepAlive
4980};
4981
4982/* */
4983
4984function initGlobalAPI (Vue) {
4985 // config
4986 var configDef = {};
4987 configDef.get = function () { return config; };
4988 if (false) {
4989 configDef.set = function () {
4990 warn(
4991 'Do not replace the Vue.config object, set individual fields instead.'
4992 );
4993 };
4994 }
4995 Object.defineProperty(Vue, 'config', configDef);
4996
4997 // exposed util methods.
4998 // NOTE: these are not considered part of the public API - avoid relying on
4999 // them unless you are aware of the risk.
5000 Vue.util = {
5001 warn: warn,
5002 extend: extend,
5003 mergeOptions: mergeOptions,
5004 defineReactive: defineReactive
5005 };
5006
5007 Vue.set = set;
5008 Vue.delete = del;
5009 Vue.nextTick = nextTick;
5010
5011 Vue.options = Object.create(null);
5012 ASSET_TYPES.forEach(function (type) {
5013 Vue.options[type + 's'] = Object.create(null);
5014 });
5015
5016 // this is used to identify the "base" constructor to extend all plain-object
5017 // components with in Weex's multi-instance scenarios.
5018 Vue.options._base = Vue;
5019
5020 extend(Vue.options.components, builtInComponents);
5021
5022 initUse(Vue);
5023 initMixin$1(Vue);
5024 initExtend(Vue);
5025 initAssetRegisters(Vue);
5026}
5027
5028initGlobalAPI(Vue$3);
5029
5030Object.defineProperty(Vue$3.prototype, '$isServer', {
5031 get: isServerRendering
5032});
5033
5034Object.defineProperty(Vue$3.prototype, '$ssrContext', {
5035 get: function get () {
5036 /* istanbul ignore next */
5037 return this.$vnode && this.$vnode.ssrContext
5038 }
5039});
5040
5041Vue$3.version = '2.5.2';
5042
5043/* */
5044
5045// these are reserved for web because they are directly compiled away
5046// during template compilation
5047var isReservedAttr = makeMap('style,class');
5048
5049// attributes that should be using props for binding
5050var acceptValue = makeMap('input,textarea,option,select,progress');
5051var mustUseProp = function (tag, type, attr) {
5052 return (
5053 (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
5054 (attr === 'selected' && tag === 'option') ||
5055 (attr === 'checked' && tag === 'input') ||
5056 (attr === 'muted' && tag === 'video')
5057 )
5058};
5059
5060var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
5061
5062var isBooleanAttr = makeMap(
5063 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
5064 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
5065 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
5066 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
5067 'required,reversed,scoped,seamless,selected,sortable,translate,' +
5068 'truespeed,typemustmatch,visible'
5069);
5070
5071var xlinkNS = 'http://www.w3.org/1999/xlink';
5072
5073var isXlink = function (name) {
5074 return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
5075};
5076
5077var getXlinkProp = function (name) {
5078 return isXlink(name) ? name.slice(6, name.length) : ''
5079};
5080
5081var isFalsyAttrValue = function (val) {
5082 return val == null || val === false
5083};
5084
5085/* */
5086
5087function genClassForVnode (vnode) {
5088 var data = vnode.data;
5089 var parentNode = vnode;
5090 var childNode = vnode;
5091 while (isDef(childNode.componentInstance)) {
5092 childNode = childNode.componentInstance._vnode;
5093 if (childNode.data) {
5094 data = mergeClassData(childNode.data, data);
5095 }
5096 }
5097 while (isDef(parentNode = parentNode.parent)) {
5098 if (parentNode.data) {
5099 data = mergeClassData(data, parentNode.data);
5100 }
5101 }
5102 return renderClass(data.staticClass, data.class)
5103}
5104
5105function mergeClassData (child, parent) {
5106 return {
5107 staticClass: concat(child.staticClass, parent.staticClass),
5108 class: isDef(child.class)
5109 ? [child.class, parent.class]
5110 : parent.class
5111 }
5112}
5113
5114function renderClass (
5115 staticClass,
5116 dynamicClass
5117) {
5118 if (isDef(staticClass) || isDef(dynamicClass)) {
5119 return concat(staticClass, stringifyClass(dynamicClass))
5120 }
5121 /* istanbul ignore next */
5122 return ''
5123}
5124
5125function concat (a, b) {
5126 return a ? b ? (a + ' ' + b) : a : (b || '')
5127}
5128
5129function stringifyClass (value) {
5130 if (Array.isArray(value)) {
5131 return stringifyArray(value)
5132 }
5133 if (isObject(value)) {
5134 return stringifyObject(value)
5135 }
5136 if (typeof value === 'string') {
5137 return value
5138 }
5139 /* istanbul ignore next */
5140 return ''
5141}
5142
5143function stringifyArray (value) {
5144 var res = '';
5145 var stringified;
5146 for (var i = 0, l = value.length; i < l; i++) {
5147 if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
5148 if (res) { res += ' '; }
5149 res += stringified;
5150 }
5151 }
5152 return res
5153}
5154
5155function stringifyObject (value) {
5156 var res = '';
5157 for (var key in value) {
5158 if (value[key]) {
5159 if (res) { res += ' '; }
5160 res += key;
5161 }
5162 }
5163 return res
5164}
5165
5166/* */
5167
5168var namespaceMap = {
5169 svg: 'http://www.w3.org/2000/svg',
5170 math: 'http://www.w3.org/1998/Math/MathML'
5171};
5172
5173var isHTMLTag = makeMap(
5174 'html,body,base,head,link,meta,style,title,' +
5175 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
5176 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
5177 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
5178 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
5179 'embed,object,param,source,canvas,script,noscript,del,ins,' +
5180 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
5181 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
5182 'output,progress,select,textarea,' +
5183 'details,dialog,menu,menuitem,summary,' +
5184 'content,element,shadow,template,blockquote,iframe,tfoot'
5185);
5186
5187// this map is intentionally selective, only covering SVG elements that may
5188// contain child elements.
5189var isSVG = makeMap(
5190 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
5191 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
5192 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
5193 true
5194);
5195
5196
5197
5198var isReservedTag = function (tag) {
5199 return isHTMLTag(tag) || isSVG(tag)
5200};
5201
5202function getTagNamespace (tag) {
5203 if (isSVG(tag)) {
5204 return 'svg'
5205 }
5206 // basic support for MathML
5207 // note it doesn't support other MathML elements being component roots
5208 if (tag === 'math') {
5209 return 'math'
5210 }
5211}
5212
5213var unknownElementCache = Object.create(null);
5214function isUnknownElement (tag) {
5215 /* istanbul ignore if */
5216 if (!inBrowser) {
5217 return true
5218 }
5219 if (isReservedTag(tag)) {
5220 return false
5221 }
5222 tag = tag.toLowerCase();
5223 /* istanbul ignore if */
5224 if (unknownElementCache[tag] != null) {
5225 return unknownElementCache[tag]
5226 }
5227 var el = document.createElement(tag);
5228 if (tag.indexOf('-') > -1) {
5229 // http://stackoverflow.com/a/28210364/1070244
5230 return (unknownElementCache[tag] = (
5231 el.constructor === window.HTMLUnknownElement ||
5232 el.constructor === window.HTMLElement
5233 ))
5234 } else {
5235 return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
5236 }
5237}
5238
5239var isTextInputType = makeMap('text,number,password,search,email,tel,url');
5240
5241/* */
5242
5243/**
5244 * Query an element selector if it's not an element already.
5245 */
5246function query (el) {
5247 if (typeof el === 'string') {
5248 var selected = document.querySelector(el);
5249 if (!selected) {
5250 "production" !== 'production' && warn(
5251 'Cannot find element: ' + el
5252 );
5253 return document.createElement('div')
5254 }
5255 return selected
5256 } else {
5257 return el
5258 }
5259}
5260
5261/* */
5262
5263function createElement$1 (tagName, vnode) {
5264 var elm = document.createElement(tagName);
5265 if (tagName !== 'select') {
5266 return elm
5267 }
5268 // false or null will remove the attribute but undefined will not
5269 if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
5270 elm.setAttribute('multiple', 'multiple');
5271 }
5272 return elm
5273}
5274
5275function createElementNS (namespace, tagName) {
5276 return document.createElementNS(namespaceMap[namespace], tagName)
5277}
5278
5279function createTextNode (text) {
5280 return document.createTextNode(text)
5281}
5282
5283function createComment (text) {
5284 return document.createComment(text)
5285}
5286
5287function insertBefore (parentNode, newNode, referenceNode) {
5288 parentNode.insertBefore(newNode, referenceNode);
5289}
5290
5291function removeChild (node, child) {
5292 node.removeChild(child);
5293}
5294
5295function appendChild (node, child) {
5296 node.appendChild(child);
5297}
5298
5299function parentNode (node) {
5300 return node.parentNode
5301}
5302
5303function nextSibling (node) {
5304 return node.nextSibling
5305}
5306
5307function tagName (node) {
5308 return node.tagName
5309}
5310
5311function setTextContent (node, text) {
5312 node.textContent = text;
5313}
5314
5315function setAttribute (node, key, val) {
5316 node.setAttribute(key, val);
5317}
5318
5319
5320var nodeOps = Object.freeze({
5321 createElement: createElement$1,
5322 createElementNS: createElementNS,
5323 createTextNode: createTextNode,
5324 createComment: createComment,
5325 insertBefore: insertBefore,
5326 removeChild: removeChild,
5327 appendChild: appendChild,
5328 parentNode: parentNode,
5329 nextSibling: nextSibling,
5330 tagName: tagName,
5331 setTextContent: setTextContent,
5332 setAttribute: setAttribute
5333});
5334
5335/* */
5336
5337var ref = {
5338 create: function create (_, vnode) {
5339 registerRef(vnode);
5340 },
5341 update: function update (oldVnode, vnode) {
5342 if (oldVnode.data.ref !== vnode.data.ref) {
5343 registerRef(oldVnode, true);
5344 registerRef(vnode);
5345 }
5346 },
5347 destroy: function destroy (vnode) {
5348 registerRef(vnode, true);
5349 }
5350};
5351
5352function registerRef (vnode, isRemoval) {
5353 var key = vnode.data.ref;
5354 if (!key) { return }
5355
5356 var vm = vnode.context;
5357 var ref = vnode.componentInstance || vnode.elm;
5358 var refs = vm.$refs;
5359 if (isRemoval) {
5360 if (Array.isArray(refs[key])) {
5361 remove(refs[key], ref);
5362 } else if (refs[key] === ref) {
5363 refs[key] = undefined;
5364 }
5365 } else {
5366 if (vnode.data.refInFor) {
5367 if (!Array.isArray(refs[key])) {
5368 refs[key] = [ref];
5369 } else if (refs[key].indexOf(ref) < 0) {
5370 // $flow-disable-line
5371 refs[key].push(ref);
5372 }
5373 } else {
5374 refs[key] = ref;
5375 }
5376 }
5377}
5378
5379/**
5380 * Virtual DOM patching algorithm based on Snabbdom by
5381 * Simon Friis Vindum (@paldepind)
5382 * Licensed under the MIT License
5383 * https://github.com/paldepind/snabbdom/blob/master/LICENSE
5384 *
5385 * modified by Evan You (@yyx990803)
5386 *
5387 * Not type-checking this because this file is perf-critical and the cost
5388 * of making flow understand it is not worth it.
5389 */
5390
5391var emptyNode = new VNode('', {}, []);
5392
5393var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
5394
5395function sameVnode (a, b) {
5396 return (
5397 a.key === b.key && (
5398 (
5399 a.tag === b.tag &&
5400 a.isComment === b.isComment &&
5401 isDef(a.data) === isDef(b.data) &&
5402 sameInputType(a, b)
5403 ) || (
5404 isTrue(a.isAsyncPlaceholder) &&
5405 a.asyncFactory === b.asyncFactory &&
5406 isUndef(b.asyncFactory.error)
5407 )
5408 )
5409 )
5410}
5411
5412function sameInputType (a, b) {
5413 if (a.tag !== 'input') { return true }
5414 var i;
5415 var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
5416 var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
5417 return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)
5418}
5419
5420function createKeyToOldIdx (children, beginIdx, endIdx) {
5421 var i, key;
5422 var map = {};
5423 for (i = beginIdx; i <= endIdx; ++i) {
5424 key = children[i].key;
5425 if (isDef(key)) { map[key] = i; }
5426 }
5427 return map
5428}
5429
5430function createPatchFunction (backend) {
5431 var i, j;
5432 var cbs = {};
5433
5434 var modules = backend.modules;
5435 var nodeOps = backend.nodeOps;
5436
5437 for (i = 0; i < hooks.length; ++i) {
5438 cbs[hooks[i]] = [];
5439 for (j = 0; j < modules.length; ++j) {
5440 if (isDef(modules[j][hooks[i]])) {
5441 cbs[hooks[i]].push(modules[j][hooks[i]]);
5442 }
5443 }
5444 }
5445
5446 function emptyNodeAt (elm) {
5447 return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
5448 }
5449
5450 function createRmCb (childElm, listeners) {
5451 function remove () {
5452 if (--remove.listeners === 0) {
5453 removeNode(childElm);
5454 }
5455 }
5456 remove.listeners = listeners;
5457 return remove
5458 }
5459
5460 function removeNode (el) {
5461 var parent = nodeOps.parentNode(el);
5462 // element may have already been removed due to v-html / v-text
5463 if (isDef(parent)) {
5464 nodeOps.removeChild(parent, el);
5465 }
5466 }
5467
5468 var inPre = 0;
5469 function createElm (vnode, insertedVnodeQueue, parentElm, refElm, nested) {
5470 vnode.isRootInsert = !nested; // for transition enter check
5471 if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
5472 return
5473 }
5474
5475 var data = vnode.data;
5476 var children = vnode.children;
5477 var tag = vnode.tag;
5478 if (isDef(tag)) {
5479 if (false) {
5480 if (data && data.pre) {
5481 inPre++;
5482 }
5483 if (
5484 !inPre &&
5485 !vnode.ns &&
5486 !(
5487 config.ignoredElements.length &&
5488 config.ignoredElements.some(function (ignore) {
5489 return isRegExp(ignore)
5490 ? ignore.test(tag)
5491 : ignore === tag
5492 })
5493 ) &&
5494 config.isUnknownElement(tag)
5495 ) {
5496 warn(
5497 'Unknown custom element: <' + tag + '> - did you ' +
5498 'register the component correctly? For recursive components, ' +
5499 'make sure to provide the "name" option.',
5500 vnode.context
5501 );
5502 }
5503 }
5504 vnode.elm = vnode.ns
5505 ? nodeOps.createElementNS(vnode.ns, tag)
5506 : nodeOps.createElement(tag, vnode);
5507 setScope(vnode);
5508
5509 /* istanbul ignore if */
5510 {
5511 createChildren(vnode, children, insertedVnodeQueue);
5512 if (isDef(data)) {
5513 invokeCreateHooks(vnode, insertedVnodeQueue);
5514 }
5515 insert(parentElm, vnode.elm, refElm);
5516 }
5517
5518 if (false) {
5519 inPre--;
5520 }
5521 } else if (isTrue(vnode.isComment)) {
5522 vnode.elm = nodeOps.createComment(vnode.text);
5523 insert(parentElm, vnode.elm, refElm);
5524 } else {
5525 vnode.elm = nodeOps.createTextNode(vnode.text);
5526 insert(parentElm, vnode.elm, refElm);
5527 }
5528 }
5529
5530 function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
5531 var i = vnode.data;
5532 if (isDef(i)) {
5533 var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
5534 if (isDef(i = i.hook) && isDef(i = i.init)) {
5535 i(vnode, false /* hydrating */, parentElm, refElm);
5536 }
5537 // after calling the init hook, if the vnode is a child component
5538 // it should've created a child instance and mounted it. the child
5539 // component also has set the placeholder vnode's elm.
5540 // in that case we can just return the element and be done.
5541 if (isDef(vnode.componentInstance)) {
5542 initComponent(vnode, insertedVnodeQueue);
5543 if (isTrue(isReactivated)) {
5544 reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
5545 }
5546 return true
5547 }
5548 }
5549 }
5550
5551 function initComponent (vnode, insertedVnodeQueue) {
5552 if (isDef(vnode.data.pendingInsert)) {
5553 insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
5554 vnode.data.pendingInsert = null;
5555 }
5556 vnode.elm = vnode.componentInstance.$el;
5557 if (isPatchable(vnode)) {
5558 invokeCreateHooks(vnode, insertedVnodeQueue);
5559 setScope(vnode);
5560 } else {
5561 // empty component root.
5562 // skip all element-related modules except for ref (#3455)
5563 registerRef(vnode);
5564 // make sure to invoke the insert hook
5565 insertedVnodeQueue.push(vnode);
5566 }
5567 }
5568
5569 function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
5570 var i;
5571 // hack for #4339: a reactivated component with inner transition
5572 // does not trigger because the inner node's created hooks are not called
5573 // again. It's not ideal to involve module-specific logic in here but
5574 // there doesn't seem to be a better way to do it.
5575 var innerNode = vnode;
5576 while (innerNode.componentInstance) {
5577 innerNode = innerNode.componentInstance._vnode;
5578 if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
5579 for (i = 0; i < cbs.activate.length; ++i) {
5580 cbs.activate[i](emptyNode, innerNode);
5581 }
5582 insertedVnodeQueue.push(innerNode);
5583 break
5584 }
5585 }
5586 // unlike a newly created component,
5587 // a reactivated keep-alive component doesn't insert itself
5588 insert(parentElm, vnode.elm, refElm);
5589 }
5590
5591 function insert (parent, elm, ref$$1) {
5592 if (isDef(parent)) {
5593 if (isDef(ref$$1)) {
5594 if (ref$$1.parentNode === parent) {
5595 nodeOps.insertBefore(parent, elm, ref$$1);
5596 }
5597 } else {
5598 nodeOps.appendChild(parent, elm);
5599 }
5600 }
5601 }
5602
5603 function createChildren (vnode, children, insertedVnodeQueue) {
5604 if (Array.isArray(children)) {
5605 for (var i = 0; i < children.length; ++i) {
5606 createElm(children[i], insertedVnodeQueue, vnode.elm, null, true);
5607 }
5608 } else if (isPrimitive(vnode.text)) {
5609 nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));
5610 }
5611 }
5612
5613 function isPatchable (vnode) {
5614 while (vnode.componentInstance) {
5615 vnode = vnode.componentInstance._vnode;
5616 }
5617 return isDef(vnode.tag)
5618 }
5619
5620 function invokeCreateHooks (vnode, insertedVnodeQueue) {
5621 for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
5622 cbs.create[i$1](emptyNode, vnode);
5623 }
5624 i = vnode.data.hook; // Reuse variable
5625 if (isDef(i)) {
5626 if (isDef(i.create)) { i.create(emptyNode, vnode); }
5627 if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
5628 }
5629 }
5630
5631 // set scope id attribute for scoped CSS.
5632 // this is implemented as a special case to avoid the overhead
5633 // of going through the normal attribute patching process.
5634 function setScope (vnode) {
5635 var i;
5636 if (isDef(i = vnode.functionalScopeId)) {
5637 nodeOps.setAttribute(vnode.elm, i, '');
5638 } else {
5639 var ancestor = vnode;
5640 while (ancestor) {
5641 if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
5642 nodeOps.setAttribute(vnode.elm, i, '');
5643 }
5644 ancestor = ancestor.parent;
5645 }
5646 }
5647 // for slot content they should also get the scopeId from the host instance.
5648 if (isDef(i = activeInstance) &&
5649 i !== vnode.context &&
5650 i !== vnode.functionalContext &&
5651 isDef(i = i.$options._scopeId)
5652 ) {
5653 nodeOps.setAttribute(vnode.elm, i, '');
5654 }
5655 }
5656
5657 function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
5658 for (; startIdx <= endIdx; ++startIdx) {
5659 createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm);
5660 }
5661 }
5662
5663 function invokeDestroyHook (vnode) {
5664 var i, j;
5665 var data = vnode.data;
5666 if (isDef(data)) {
5667 if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
5668 for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
5669 }
5670 if (isDef(i = vnode.children)) {
5671 for (j = 0; j < vnode.children.length; ++j) {
5672 invokeDestroyHook(vnode.children[j]);
5673 }
5674 }
5675 }
5676
5677 function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
5678 for (; startIdx <= endIdx; ++startIdx) {
5679 var ch = vnodes[startIdx];
5680 if (isDef(ch)) {
5681 if (isDef(ch.tag)) {
5682 removeAndInvokeRemoveHook(ch);
5683 invokeDestroyHook(ch);
5684 } else { // Text node
5685 removeNode(ch.elm);
5686 }
5687 }
5688 }
5689 }
5690
5691 function removeAndInvokeRemoveHook (vnode, rm) {
5692 if (isDef(rm) || isDef(vnode.data)) {
5693 var i;
5694 var listeners = cbs.remove.length + 1;
5695 if (isDef(rm)) {
5696 // we have a recursively passed down rm callback
5697 // increase the listeners count
5698 rm.listeners += listeners;
5699 } else {
5700 // directly removing
5701 rm = createRmCb(vnode.elm, listeners);
5702 }
5703 // recursively invoke hooks on child component root node
5704 if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
5705 removeAndInvokeRemoveHook(i, rm);
5706 }
5707 for (i = 0; i < cbs.remove.length; ++i) {
5708 cbs.remove[i](vnode, rm);
5709 }
5710 if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
5711 i(vnode, rm);
5712 } else {
5713 rm();
5714 }
5715 } else {
5716 removeNode(vnode.elm);
5717 }
5718 }
5719
5720 function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
5721 var oldStartIdx = 0;
5722 var newStartIdx = 0;
5723 var oldEndIdx = oldCh.length - 1;
5724 var oldStartVnode = oldCh[0];
5725 var oldEndVnode = oldCh[oldEndIdx];
5726 var newEndIdx = newCh.length - 1;
5727 var newStartVnode = newCh[0];
5728 var newEndVnode = newCh[newEndIdx];
5729 var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
5730
5731 // removeOnly is a special flag used only by <transition-group>
5732 // to ensure removed elements stay in correct relative positions
5733 // during leaving transitions
5734 var canMove = !removeOnly;
5735
5736 while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
5737 if (isUndef(oldStartVnode)) {
5738 oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
5739 } else if (isUndef(oldEndVnode)) {
5740 oldEndVnode = oldCh[--oldEndIdx];
5741 } else if (sameVnode(oldStartVnode, newStartVnode)) {
5742 patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue);
5743 oldStartVnode = oldCh[++oldStartIdx];
5744 newStartVnode = newCh[++newStartIdx];
5745 } else if (sameVnode(oldEndVnode, newEndVnode)) {
5746 patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue);
5747 oldEndVnode = oldCh[--oldEndIdx];
5748 newEndVnode = newCh[--newEndIdx];
5749 } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
5750 patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue);
5751 canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
5752 oldStartVnode = oldCh[++oldStartIdx];
5753 newEndVnode = newCh[--newEndIdx];
5754 } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
5755 patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue);
5756 canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
5757 oldEndVnode = oldCh[--oldEndIdx];
5758 newStartVnode = newCh[++newStartIdx];
5759 } else {
5760 if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
5761 idxInOld = isDef(newStartVnode.key)
5762 ? oldKeyToIdx[newStartVnode.key]
5763 : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
5764 if (isUndef(idxInOld)) { // New element
5765 createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
5766 } else {
5767 vnodeToMove = oldCh[idxInOld];
5768 /* istanbul ignore if */
5769 if (false) {
5770 warn(
5771 'It seems there are duplicate keys that is causing an update error. ' +
5772 'Make sure each v-for item has a unique key.'
5773 );
5774 }
5775 if (sameVnode(vnodeToMove, newStartVnode)) {
5776 patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue);
5777 oldCh[idxInOld] = undefined;
5778 canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
5779 } else {
5780 // same key but different element. treat as new element
5781 createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
5782 }
5783 }
5784 newStartVnode = newCh[++newStartIdx];
5785 }
5786 }
5787 if (oldStartIdx > oldEndIdx) {
5788 refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
5789 addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
5790 } else if (newStartIdx > newEndIdx) {
5791 removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
5792 }
5793 }
5794
5795 function findIdxInOld (node, oldCh, start, end) {
5796 for (var i = start; i < end; i++) {
5797 var c = oldCh[i];
5798 if (isDef(c) && sameVnode(node, c)) { return i }
5799 }
5800 }
5801
5802 function patchVnode (oldVnode, vnode, insertedVnodeQueue, removeOnly) {
5803 if (oldVnode === vnode) {
5804 return
5805 }
5806
5807 var elm = vnode.elm = oldVnode.elm;
5808
5809 if (isTrue(oldVnode.isAsyncPlaceholder)) {
5810 if (isDef(vnode.asyncFactory.resolved)) {
5811 hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
5812 } else {
5813 vnode.isAsyncPlaceholder = true;
5814 }
5815 return
5816 }
5817
5818 // reuse element for static trees.
5819 // note we only do this if the vnode is cloned -
5820 // if the new node is not cloned it means the render functions have been
5821 // reset by the hot-reload-api and we need to do a proper re-render.
5822 if (isTrue(vnode.isStatic) &&
5823 isTrue(oldVnode.isStatic) &&
5824 vnode.key === oldVnode.key &&
5825 (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
5826 ) {
5827 vnode.componentInstance = oldVnode.componentInstance;
5828 return
5829 }
5830
5831 var i;
5832 var data = vnode.data;
5833 if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
5834 i(oldVnode, vnode);
5835 }
5836
5837 var oldCh = oldVnode.children;
5838 var ch = vnode.children;
5839 if (isDef(data) && isPatchable(vnode)) {
5840 for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
5841 if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
5842 }
5843 if (isUndef(vnode.text)) {
5844 if (isDef(oldCh) && isDef(ch)) {
5845 if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
5846 } else if (isDef(ch)) {
5847 if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
5848 addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
5849 } else if (isDef(oldCh)) {
5850 removeVnodes(elm, oldCh, 0, oldCh.length - 1);
5851 } else if (isDef(oldVnode.text)) {
5852 nodeOps.setTextContent(elm, '');
5853 }
5854 } else if (oldVnode.text !== vnode.text) {
5855 nodeOps.setTextContent(elm, vnode.text);
5856 }
5857 if (isDef(data)) {
5858 if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
5859 }
5860 }
5861
5862 function invokeInsertHook (vnode, queue, initial) {
5863 // delay insert hooks for component root nodes, invoke them after the
5864 // element is really inserted
5865 if (isTrue(initial) && isDef(vnode.parent)) {
5866 vnode.parent.data.pendingInsert = queue;
5867 } else {
5868 for (var i = 0; i < queue.length; ++i) {
5869 queue[i].data.hook.insert(queue[i]);
5870 }
5871 }
5872 }
5873
5874 var bailed = false;
5875 // list of modules that can skip create hook during hydration because they
5876 // are already rendered on the client or has no need for initialization
5877 var isRenderedModule = makeMap('attrs,style,class,staticClass,staticStyle,key');
5878
5879 // Note: this is a browser-only function so we can assume elms are DOM nodes.
5880 function hydrate (elm, vnode, insertedVnodeQueue) {
5881 if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
5882 vnode.elm = elm;
5883 vnode.isAsyncPlaceholder = true;
5884 return true
5885 }
5886 if (false) {
5887 if (!assertNodeMatch(elm, vnode)) {
5888 return false
5889 }
5890 }
5891 vnode.elm = elm;
5892 var tag = vnode.tag;
5893 var data = vnode.data;
5894 var children = vnode.children;
5895 if (isDef(data)) {
5896 if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
5897 if (isDef(i = vnode.componentInstance)) {
5898 // child component. it should have hydrated its own tree.
5899 initComponent(vnode, insertedVnodeQueue);
5900 return true
5901 }
5902 }
5903 if (isDef(tag)) {
5904 if (isDef(children)) {
5905 // empty element, allow client to pick up and populate children
5906 if (!elm.hasChildNodes()) {
5907 createChildren(vnode, children, insertedVnodeQueue);
5908 } else {
5909 // v-html and domProps: innerHTML
5910 if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
5911 if (i !== elm.innerHTML) {
5912 /* istanbul ignore if */
5913 if (false
5914 ) {
5915 bailed = true;
5916 console.warn('Parent: ', elm);
5917 console.warn('server innerHTML: ', i);
5918 console.warn('client innerHTML: ', elm.innerHTML);
5919 }
5920 return false
5921 }
5922 } else {
5923 // iterate and compare children lists
5924 var childrenMatch = true;
5925 var childNode = elm.firstChild;
5926 for (var i$1 = 0; i$1 < children.length; i$1++) {
5927 if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue)) {
5928 childrenMatch = false;
5929 break
5930 }
5931 childNode = childNode.nextSibling;
5932 }
5933 // if childNode is not null, it means the actual childNodes list is
5934 // longer than the virtual children list.
5935 if (!childrenMatch || childNode) {
5936 /* istanbul ignore if */
5937 if (false
5938 ) {
5939 bailed = true;
5940 console.warn('Parent: ', elm);
5941 console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
5942 }
5943 return false
5944 }
5945 }
5946 }
5947 }
5948 if (isDef(data)) {
5949 for (var key in data) {
5950 if (!isRenderedModule(key)) {
5951 invokeCreateHooks(vnode, insertedVnodeQueue);
5952 break
5953 }
5954 }
5955 }
5956 } else if (elm.data !== vnode.text) {
5957 elm.data = vnode.text;
5958 }
5959 return true
5960 }
5961
5962 function assertNodeMatch (node, vnode) {
5963 if (isDef(vnode.tag)) {
5964 return (
5965 vnode.tag.indexOf('vue-component') === 0 ||
5966 vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
5967 )
5968 } else {
5969 return node.nodeType === (vnode.isComment ? 8 : 3)
5970 }
5971 }
5972
5973 return function patch (oldVnode, vnode, hydrating, removeOnly, parentElm, refElm) {
5974 if (isUndef(vnode)) {
5975 if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }
5976 return
5977 }
5978
5979 var isInitialPatch = false;
5980 var insertedVnodeQueue = [];
5981
5982 if (isUndef(oldVnode)) {
5983 // empty mount (likely as component), create new root element
5984 isInitialPatch = true;
5985 createElm(vnode, insertedVnodeQueue, parentElm, refElm);
5986 } else {
5987 var isRealElement = isDef(oldVnode.nodeType);
5988 if (!isRealElement && sameVnode(oldVnode, vnode)) {
5989 // patch existing root node
5990 patchVnode(oldVnode, vnode, insertedVnodeQueue, removeOnly);
5991 } else {
5992 if (isRealElement) {
5993 // mounting to a real element
5994 // check if this is server-rendered content and if we can perform
5995 // a successful hydration.
5996 if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
5997 oldVnode.removeAttribute(SSR_ATTR);
5998 hydrating = true;
5999 }
6000 if (isTrue(hydrating)) {
6001 if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
6002 invokeInsertHook(vnode, insertedVnodeQueue, true);
6003 return oldVnode
6004 } else if (false) {
6005 warn(
6006 'The client-side rendered virtual DOM tree is not matching ' +
6007 'server-rendered content. This is likely caused by incorrect ' +
6008 'HTML markup, for example nesting block-level elements inside ' +
6009 '<p>, or missing <tbody>. Bailing hydration and performing ' +
6010 'full client-side render.'
6011 );
6012 }
6013 }
6014 // either not server-rendered, or hydration failed.
6015 // create an empty node and replace it
6016 oldVnode = emptyNodeAt(oldVnode);
6017 }
6018 // replacing existing element
6019 var oldElm = oldVnode.elm;
6020 var parentElm$1 = nodeOps.parentNode(oldElm);
6021 createElm(
6022 vnode,
6023 insertedVnodeQueue,
6024 // extremely rare edge case: do not insert if old element is in a
6025 // leaving transition. Only happens when combining transition +
6026 // keep-alive + HOCs. (#4590)
6027 oldElm._leaveCb ? null : parentElm$1,
6028 nodeOps.nextSibling(oldElm)
6029 );
6030
6031 if (isDef(vnode.parent)) {
6032 // component root element replaced.
6033 // update parent placeholder node element, recursively
6034 var ancestor = vnode.parent;
6035 var patchable = isPatchable(vnode);
6036 while (ancestor) {
6037 for (var i = 0; i < cbs.destroy.length; ++i) {
6038 cbs.destroy[i](ancestor);
6039 }
6040 ancestor.elm = vnode.elm;
6041 if (patchable) {
6042 for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
6043 cbs.create[i$1](emptyNode, ancestor);
6044 }
6045 // #6513
6046 // invoke insert hooks that may have been merged by create hooks.
6047 // e.g. for directives that uses the "inserted" hook.
6048 var insert = ancestor.data.hook.insert;
6049 if (insert.merged) {
6050 // start at index 1 to avoid re-invoking component mounted hook
6051 for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {
6052 insert.fns[i$2]();
6053 }
6054 }
6055 } else {
6056 registerRef(ancestor);
6057 }
6058 ancestor = ancestor.parent;
6059 }
6060 }
6061
6062 if (isDef(parentElm$1)) {
6063 removeVnodes(parentElm$1, [oldVnode], 0, 0);
6064 } else if (isDef(oldVnode.tag)) {
6065 invokeDestroyHook(oldVnode);
6066 }
6067 }
6068 }
6069
6070 invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
6071 return vnode.elm
6072 }
6073}
6074
6075/* */
6076
6077var directives = {
6078 create: updateDirectives,
6079 update: updateDirectives,
6080 destroy: function unbindDirectives (vnode) {
6081 updateDirectives(vnode, emptyNode);
6082 }
6083};
6084
6085function updateDirectives (oldVnode, vnode) {
6086 if (oldVnode.data.directives || vnode.data.directives) {
6087 _update(oldVnode, vnode);
6088 }
6089}
6090
6091function _update (oldVnode, vnode) {
6092 var isCreate = oldVnode === emptyNode;
6093 var isDestroy = vnode === emptyNode;
6094 var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
6095 var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
6096
6097 var dirsWithInsert = [];
6098 var dirsWithPostpatch = [];
6099
6100 var key, oldDir, dir;
6101 for (key in newDirs) {
6102 oldDir = oldDirs[key];
6103 dir = newDirs[key];
6104 if (!oldDir) {
6105 // new directive, bind
6106 callHook$1(dir, 'bind', vnode, oldVnode);
6107 if (dir.def && dir.def.inserted) {
6108 dirsWithInsert.push(dir);
6109 }
6110 } else {
6111 // existing directive, update
6112 dir.oldValue = oldDir.value;
6113 callHook$1(dir, 'update', vnode, oldVnode);
6114 if (dir.def && dir.def.componentUpdated) {
6115 dirsWithPostpatch.push(dir);
6116 }
6117 }
6118 }
6119
6120 if (dirsWithInsert.length) {
6121 var callInsert = function () {
6122 for (var i = 0; i < dirsWithInsert.length; i++) {
6123 callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
6124 }
6125 };
6126 if (isCreate) {
6127 mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', callInsert);
6128 } else {
6129 callInsert();
6130 }
6131 }
6132
6133 if (dirsWithPostpatch.length) {
6134 mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'postpatch', function () {
6135 for (var i = 0; i < dirsWithPostpatch.length; i++) {
6136 callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
6137 }
6138 });
6139 }
6140
6141 if (!isCreate) {
6142 for (key in oldDirs) {
6143 if (!newDirs[key]) {
6144 // no longer present, unbind
6145 callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
6146 }
6147 }
6148 }
6149}
6150
6151var emptyModifiers = Object.create(null);
6152
6153function normalizeDirectives$1 (
6154 dirs,
6155 vm
6156) {
6157 var res = Object.create(null);
6158 if (!dirs) {
6159 return res
6160 }
6161 var i, dir;
6162 for (i = 0; i < dirs.length; i++) {
6163 dir = dirs[i];
6164 if (!dir.modifiers) {
6165 dir.modifiers = emptyModifiers;
6166 }
6167 res[getRawDirName(dir)] = dir;
6168 dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
6169 }
6170 return res
6171}
6172
6173function getRawDirName (dir) {
6174 return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
6175}
6176
6177function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
6178 var fn = dir.def && dir.def[hook];
6179 if (fn) {
6180 try {
6181 fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
6182 } catch (e) {
6183 handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
6184 }
6185 }
6186}
6187
6188var baseModules = [
6189 ref,
6190 directives
6191];
6192
6193/* */
6194
6195function updateAttrs (oldVnode, vnode) {
6196 var opts = vnode.componentOptions;
6197 if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
6198 return
6199 }
6200 if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
6201 return
6202 }
6203 var key, cur, old;
6204 var elm = vnode.elm;
6205 var oldAttrs = oldVnode.data.attrs || {};
6206 var attrs = vnode.data.attrs || {};
6207 // clone observed objects, as the user probably wants to mutate it
6208 if (isDef(attrs.__ob__)) {
6209 attrs = vnode.data.attrs = extend({}, attrs);
6210 }
6211
6212 for (key in attrs) {
6213 cur = attrs[key];
6214 old = oldAttrs[key];
6215 if (old !== cur) {
6216 setAttr(elm, key, cur);
6217 }
6218 }
6219 // #4391: in IE9, setting type can reset value for input[type=radio]
6220 // #6666: IE/Edge forces progress value down to 1 before setting a max
6221 /* istanbul ignore if */
6222 if ((isIE9 || isEdge) && attrs.value !== oldAttrs.value) {
6223 setAttr(elm, 'value', attrs.value);
6224 }
6225 for (key in oldAttrs) {
6226 if (isUndef(attrs[key])) {
6227 if (isXlink(key)) {
6228 elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
6229 } else if (!isEnumeratedAttr(key)) {
6230 elm.removeAttribute(key);
6231 }
6232 }
6233 }
6234}
6235
6236function setAttr (el, key, value) {
6237 if (isBooleanAttr(key)) {
6238 // set attribute for blank value
6239 // e.g. <option disabled>Select one</option>
6240 if (isFalsyAttrValue(value)) {
6241 el.removeAttribute(key);
6242 } else {
6243 // technically allowfullscreen is a boolean attribute for <iframe>,
6244 // but Flash expects a value of "true" when used on <embed> tag
6245 value = key === 'allowfullscreen' && el.tagName === 'EMBED'
6246 ? 'true'
6247 : key;
6248 el.setAttribute(key, value);
6249 }
6250 } else if (isEnumeratedAttr(key)) {
6251 el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');
6252 } else if (isXlink(key)) {
6253 if (isFalsyAttrValue(value)) {
6254 el.removeAttributeNS(xlinkNS, getXlinkProp(key));
6255 } else {
6256 el.setAttributeNS(xlinkNS, key, value);
6257 }
6258 } else {
6259 if (isFalsyAttrValue(value)) {
6260 el.removeAttribute(key);
6261 } else {
6262 el.setAttribute(key, value);
6263 }
6264 }
6265}
6266
6267var attrs = {
6268 create: updateAttrs,
6269 update: updateAttrs
6270};
6271
6272/* */
6273
6274function updateClass (oldVnode, vnode) {
6275 var el = vnode.elm;
6276 var data = vnode.data;
6277 var oldData = oldVnode.data;
6278 if (
6279 isUndef(data.staticClass) &&
6280 isUndef(data.class) && (
6281 isUndef(oldData) || (
6282 isUndef(oldData.staticClass) &&
6283 isUndef(oldData.class)
6284 )
6285 )
6286 ) {
6287 return
6288 }
6289
6290 var cls = genClassForVnode(vnode);
6291
6292 // handle transition classes
6293 var transitionClass = el._transitionClasses;
6294 if (isDef(transitionClass)) {
6295 cls = concat(cls, stringifyClass(transitionClass));
6296 }
6297
6298 // set the class
6299 if (cls !== el._prevClass) {
6300 el.setAttribute('class', cls);
6301 el._prevClass = cls;
6302 }
6303}
6304
6305var klass = {
6306 create: updateClass,
6307 update: updateClass
6308};
6309
6310/* */
6311
6312/* */
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328// note: this only removes the attr from the Array (attrsList) so that it
6329// doesn't get processed by processAttrs.
6330// By default it does NOT remove it from the map (attrsMap) because the map is
6331// needed during codegen.
6332
6333/* */
6334
6335/**
6336 * Cross-platform code generation for component v-model
6337 */
6338
6339
6340/**
6341 * Cross-platform codegen helper for generating v-model value assignment code.
6342 */
6343
6344/* */
6345
6346// in some cases, the event used has to be determined at runtime
6347// so we used some reserved tokens during compile.
6348var RANGE_TOKEN = '__r';
6349var CHECKBOX_RADIO_TOKEN = '__c';
6350
6351/* */
6352
6353// normalize v-model event tokens that can only be determined at runtime.
6354// it's important to place the event as the first in the array because
6355// the whole point is ensuring the v-model callback gets called before
6356// user-attached handlers.
6357function normalizeEvents (on) {
6358 /* istanbul ignore if */
6359 if (isDef(on[RANGE_TOKEN])) {
6360 // IE input[type=range] only supports `change` event
6361 var event = isIE ? 'change' : 'input';
6362 on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
6363 delete on[RANGE_TOKEN];
6364 }
6365 // This was originally intended to fix #4521 but no longer necessary
6366 // after 2.5. Keeping it for backwards compat with generated code from < 2.4
6367 /* istanbul ignore if */
6368 if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
6369 on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
6370 delete on[CHECKBOX_RADIO_TOKEN];
6371 }
6372}
6373
6374var target$1;
6375
6376function createOnceHandler (handler, event, capture) {
6377 var _target = target$1; // save current target element in closure
6378 return function onceHandler () {
6379 var res = handler.apply(null, arguments);
6380 if (res !== null) {
6381 remove$2(event, onceHandler, capture, _target);
6382 }
6383 }
6384}
6385
6386function add$1 (
6387 event,
6388 handler,
6389 once$$1,
6390 capture,
6391 passive
6392) {
6393 handler = withMacroTask(handler);
6394 if (once$$1) { handler = createOnceHandler(handler, event, capture); }
6395 target$1.addEventListener(
6396 event,
6397 handler,
6398 supportsPassive
6399 ? { capture: capture, passive: passive }
6400 : capture
6401 );
6402}
6403
6404function remove$2 (
6405 event,
6406 handler,
6407 capture,
6408 _target
6409) {
6410 (_target || target$1).removeEventListener(
6411 event,
6412 handler._withTask || handler,
6413 capture
6414 );
6415}
6416
6417function updateDOMListeners (oldVnode, vnode) {
6418 if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
6419 return
6420 }
6421 var on = vnode.data.on || {};
6422 var oldOn = oldVnode.data.on || {};
6423 target$1 = vnode.elm;
6424 normalizeEvents(on);
6425 updateListeners(on, oldOn, add$1, remove$2, vnode.context);
6426}
6427
6428var events = {
6429 create: updateDOMListeners,
6430 update: updateDOMListeners
6431};
6432
6433/* */
6434
6435function updateDOMProps (oldVnode, vnode) {
6436 if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
6437 return
6438 }
6439 var key, cur;
6440 var elm = vnode.elm;
6441 var oldProps = oldVnode.data.domProps || {};
6442 var props = vnode.data.domProps || {};
6443 // clone observed objects, as the user probably wants to mutate it
6444 if (isDef(props.__ob__)) {
6445 props = vnode.data.domProps = extend({}, props);
6446 }
6447
6448 for (key in oldProps) {
6449 if (isUndef(props[key])) {
6450 elm[key] = '';
6451 }
6452 }
6453 for (key in props) {
6454 cur = props[key];
6455 // ignore children if the node has textContent or innerHTML,
6456 // as these will throw away existing DOM nodes and cause removal errors
6457 // on subsequent patches (#3360)
6458 if (key === 'textContent' || key === 'innerHTML') {
6459 if (vnode.children) { vnode.children.length = 0; }
6460 if (cur === oldProps[key]) { continue }
6461 // #6601 work around Chrome version <= 55 bug where single textNode
6462 // replaced by innerHTML/textContent retains its parentNode property
6463 if (elm.childNodes.length === 1) {
6464 elm.removeChild(elm.childNodes[0]);
6465 }
6466 }
6467
6468 if (key === 'value') {
6469 // store value as _value as well since
6470 // non-string values will be stringified
6471 elm._value = cur;
6472 // avoid resetting cursor position when value is the same
6473 var strCur = isUndef(cur) ? '' : String(cur);
6474 if (shouldUpdateValue(elm, strCur)) {
6475 elm.value = strCur;
6476 }
6477 } else {
6478 elm[key] = cur;
6479 }
6480 }
6481}
6482
6483// check platforms/web/util/attrs.js acceptValue
6484
6485
6486function shouldUpdateValue (elm, checkVal) {
6487 return (!elm.composing && (
6488 elm.tagName === 'OPTION' ||
6489 isDirty(elm, checkVal) ||
6490 isInputChanged(elm, checkVal)
6491 ))
6492}
6493
6494function isDirty (elm, checkVal) {
6495 // return true when textbox (.number and .trim) loses focus and its value is
6496 // not equal to the updated value
6497 var notInFocus = true;
6498 // #6157
6499 // work around IE bug when accessing document.activeElement in an iframe
6500 try { notInFocus = document.activeElement !== elm; } catch (e) {}
6501 return notInFocus && elm.value !== checkVal
6502}
6503
6504function isInputChanged (elm, newVal) {
6505 var value = elm.value;
6506 var modifiers = elm._vModifiers; // injected by v-model runtime
6507 if (isDef(modifiers) && modifiers.number) {
6508 return toNumber(value) !== toNumber(newVal)
6509 }
6510 if (isDef(modifiers) && modifiers.trim) {
6511 return value.trim() !== newVal.trim()
6512 }
6513 return value !== newVal
6514}
6515
6516var domProps = {
6517 create: updateDOMProps,
6518 update: updateDOMProps
6519};
6520
6521/* */
6522
6523var parseStyleText = cached(function (cssText) {
6524 var res = {};
6525 var listDelimiter = /;(?![^(]*\))/g;
6526 var propertyDelimiter = /:(.+)/;
6527 cssText.split(listDelimiter).forEach(function (item) {
6528 if (item) {
6529 var tmp = item.split(propertyDelimiter);
6530 tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
6531 }
6532 });
6533 return res
6534});
6535
6536// merge static and dynamic style data on the same vnode
6537function normalizeStyleData (data) {
6538 var style = normalizeStyleBinding(data.style);
6539 // static style is pre-processed into an object during compilation
6540 // and is always a fresh object, so it's safe to merge into it
6541 return data.staticStyle
6542 ? extend(data.staticStyle, style)
6543 : style
6544}
6545
6546// normalize possible array / string values into Object
6547function normalizeStyleBinding (bindingStyle) {
6548 if (Array.isArray(bindingStyle)) {
6549 return toObject(bindingStyle)
6550 }
6551 if (typeof bindingStyle === 'string') {
6552 return parseStyleText(bindingStyle)
6553 }
6554 return bindingStyle
6555}
6556
6557/**
6558 * parent component style should be after child's
6559 * so that parent component's style could override it
6560 */
6561function getStyle (vnode, checkChild) {
6562 var res = {};
6563 var styleData;
6564
6565 if (checkChild) {
6566 var childNode = vnode;
6567 while (childNode.componentInstance) {
6568 childNode = childNode.componentInstance._vnode;
6569 if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {
6570 extend(res, styleData);
6571 }
6572 }
6573 }
6574
6575 if ((styleData = normalizeStyleData(vnode.data))) {
6576 extend(res, styleData);
6577 }
6578
6579 var parentNode = vnode;
6580 while ((parentNode = parentNode.parent)) {
6581 if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
6582 extend(res, styleData);
6583 }
6584 }
6585 return res
6586}
6587
6588/* */
6589
6590var cssVarRE = /^--/;
6591var importantRE = /\s*!important$/;
6592var setProp = function (el, name, val) {
6593 /* istanbul ignore if */
6594 if (cssVarRE.test(name)) {
6595 el.style.setProperty(name, val);
6596 } else if (importantRE.test(val)) {
6597 el.style.setProperty(name, val.replace(importantRE, ''), 'important');
6598 } else {
6599 var normalizedName = normalize(name);
6600 if (Array.isArray(val)) {
6601 // Support values array created by autoprefixer, e.g.
6602 // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
6603 // Set them one by one, and the browser will only set those it can recognize
6604 for (var i = 0, len = val.length; i < len; i++) {
6605 el.style[normalizedName] = val[i];
6606 }
6607 } else {
6608 el.style[normalizedName] = val;
6609 }
6610 }
6611};
6612
6613var vendorNames = ['Webkit', 'Moz', 'ms'];
6614
6615var emptyStyle;
6616var normalize = cached(function (prop) {
6617 emptyStyle = emptyStyle || document.createElement('div').style;
6618 prop = camelize(prop);
6619 if (prop !== 'filter' && (prop in emptyStyle)) {
6620 return prop
6621 }
6622 var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
6623 for (var i = 0; i < vendorNames.length; i++) {
6624 var name = vendorNames[i] + capName;
6625 if (name in emptyStyle) {
6626 return name
6627 }
6628 }
6629});
6630
6631function updateStyle (oldVnode, vnode) {
6632 var data = vnode.data;
6633 var oldData = oldVnode.data;
6634
6635 if (isUndef(data.staticStyle) && isUndef(data.style) &&
6636 isUndef(oldData.staticStyle) && isUndef(oldData.style)
6637 ) {
6638 return
6639 }
6640
6641 var cur, name;
6642 var el = vnode.elm;
6643 var oldStaticStyle = oldData.staticStyle;
6644 var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
6645
6646 // if static style exists, stylebinding already merged into it when doing normalizeStyleData
6647 var oldStyle = oldStaticStyle || oldStyleBinding;
6648
6649 var style = normalizeStyleBinding(vnode.data.style) || {};
6650
6651 // store normalized style under a different key for next diff
6652 // make sure to clone it if it's reactive, since the user likely wants
6653 // to mutate it.
6654 vnode.data.normalizedStyle = isDef(style.__ob__)
6655 ? extend({}, style)
6656 : style;
6657
6658 var newStyle = getStyle(vnode, true);
6659
6660 for (name in oldStyle) {
6661 if (isUndef(newStyle[name])) {
6662 setProp(el, name, '');
6663 }
6664 }
6665 for (name in newStyle) {
6666 cur = newStyle[name];
6667 if (cur !== oldStyle[name]) {
6668 // ie9 setting to null has no effect, must use empty string
6669 setProp(el, name, cur == null ? '' : cur);
6670 }
6671 }
6672}
6673
6674var style = {
6675 create: updateStyle,
6676 update: updateStyle
6677};
6678
6679/* */
6680
6681/**
6682 * Add class with compatibility for SVG since classList is not supported on
6683 * SVG elements in IE
6684 */
6685function addClass (el, cls) {
6686 /* istanbul ignore if */
6687 if (!cls || !(cls = cls.trim())) {
6688 return
6689 }
6690
6691 /* istanbul ignore else */
6692 if (el.classList) {
6693 if (cls.indexOf(' ') > -1) {
6694 cls.split(/\s+/).forEach(function (c) { return el.classList.add(c); });
6695 } else {
6696 el.classList.add(cls);
6697 }
6698 } else {
6699 var cur = " " + (el.getAttribute('class') || '') + " ";
6700 if (cur.indexOf(' ' + cls + ' ') < 0) {
6701 el.setAttribute('class', (cur + cls).trim());
6702 }
6703 }
6704}
6705
6706/**
6707 * Remove class with compatibility for SVG since classList is not supported on
6708 * SVG elements in IE
6709 */
6710function removeClass (el, cls) {
6711 /* istanbul ignore if */
6712 if (!cls || !(cls = cls.trim())) {
6713 return
6714 }
6715
6716 /* istanbul ignore else */
6717 if (el.classList) {
6718 if (cls.indexOf(' ') > -1) {
6719 cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); });
6720 } else {
6721 el.classList.remove(cls);
6722 }
6723 if (!el.classList.length) {
6724 el.removeAttribute('class');
6725 }
6726 } else {
6727 var cur = " " + (el.getAttribute('class') || '') + " ";
6728 var tar = ' ' + cls + ' ';
6729 while (cur.indexOf(tar) >= 0) {
6730 cur = cur.replace(tar, ' ');
6731 }
6732 cur = cur.trim();
6733 if (cur) {
6734 el.setAttribute('class', cur);
6735 } else {
6736 el.removeAttribute('class');
6737 }
6738 }
6739}
6740
6741/* */
6742
6743function resolveTransition (def) {
6744 if (!def) {
6745 return
6746 }
6747 /* istanbul ignore else */
6748 if (typeof def === 'object') {
6749 var res = {};
6750 if (def.css !== false) {
6751 extend(res, autoCssTransition(def.name || 'v'));
6752 }
6753 extend(res, def);
6754 return res
6755 } else if (typeof def === 'string') {
6756 return autoCssTransition(def)
6757 }
6758}
6759
6760var autoCssTransition = cached(function (name) {
6761 return {
6762 enterClass: (name + "-enter"),
6763 enterToClass: (name + "-enter-to"),
6764 enterActiveClass: (name + "-enter-active"),
6765 leaveClass: (name + "-leave"),
6766 leaveToClass: (name + "-leave-to"),
6767 leaveActiveClass: (name + "-leave-active")
6768 }
6769});
6770
6771var hasTransition = inBrowser && !isIE9;
6772var TRANSITION = 'transition';
6773var ANIMATION = 'animation';
6774
6775// Transition property/event sniffing
6776var transitionProp = 'transition';
6777var transitionEndEvent = 'transitionend';
6778var animationProp = 'animation';
6779var animationEndEvent = 'animationend';
6780if (hasTransition) {
6781 /* istanbul ignore if */
6782 if (window.ontransitionend === undefined &&
6783 window.onwebkittransitionend !== undefined
6784 ) {
6785 transitionProp = 'WebkitTransition';
6786 transitionEndEvent = 'webkitTransitionEnd';
6787 }
6788 if (window.onanimationend === undefined &&
6789 window.onwebkitanimationend !== undefined
6790 ) {
6791 animationProp = 'WebkitAnimation';
6792 animationEndEvent = 'webkitAnimationEnd';
6793 }
6794}
6795
6796// binding to window is necessary to make hot reload work in IE in strict mode
6797var raf = inBrowser
6798 ? window.requestAnimationFrame
6799 ? window.requestAnimationFrame.bind(window)
6800 : setTimeout
6801 : /* istanbul ignore next */ function (fn) { return fn(); };
6802
6803function nextFrame (fn) {
6804 raf(function () {
6805 raf(fn);
6806 });
6807}
6808
6809function addTransitionClass (el, cls) {
6810 var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
6811 if (transitionClasses.indexOf(cls) < 0) {
6812 transitionClasses.push(cls);
6813 addClass(el, cls);
6814 }
6815}
6816
6817function removeTransitionClass (el, cls) {
6818 if (el._transitionClasses) {
6819 remove(el._transitionClasses, cls);
6820 }
6821 removeClass(el, cls);
6822}
6823
6824function whenTransitionEnds (
6825 el,
6826 expectedType,
6827 cb
6828) {
6829 var ref = getTransitionInfo(el, expectedType);
6830 var type = ref.type;
6831 var timeout = ref.timeout;
6832 var propCount = ref.propCount;
6833 if (!type) { return cb() }
6834 var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
6835 var ended = 0;
6836 var end = function () {
6837 el.removeEventListener(event, onEnd);
6838 cb();
6839 };
6840 var onEnd = function (e) {
6841 if (e.target === el) {
6842 if (++ended >= propCount) {
6843 end();
6844 }
6845 }
6846 };
6847 setTimeout(function () {
6848 if (ended < propCount) {
6849 end();
6850 }
6851 }, timeout + 1);
6852 el.addEventListener(event, onEnd);
6853}
6854
6855var transformRE = /\b(transform|all)(,|$)/;
6856
6857function getTransitionInfo (el, expectedType) {
6858 var styles = window.getComputedStyle(el);
6859 var transitionDelays = styles[transitionProp + 'Delay'].split(', ');
6860 var transitionDurations = styles[transitionProp + 'Duration'].split(', ');
6861 var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
6862 var animationDelays = styles[animationProp + 'Delay'].split(', ');
6863 var animationDurations = styles[animationProp + 'Duration'].split(', ');
6864 var animationTimeout = getTimeout(animationDelays, animationDurations);
6865
6866 var type;
6867 var timeout = 0;
6868 var propCount = 0;
6869 /* istanbul ignore if */
6870 if (expectedType === TRANSITION) {
6871 if (transitionTimeout > 0) {
6872 type = TRANSITION;
6873 timeout = transitionTimeout;
6874 propCount = transitionDurations.length;
6875 }
6876 } else if (expectedType === ANIMATION) {
6877 if (animationTimeout > 0) {
6878 type = ANIMATION;
6879 timeout = animationTimeout;
6880 propCount = animationDurations.length;
6881 }
6882 } else {
6883 timeout = Math.max(transitionTimeout, animationTimeout);
6884 type = timeout > 0
6885 ? transitionTimeout > animationTimeout
6886 ? TRANSITION
6887 : ANIMATION
6888 : null;
6889 propCount = type
6890 ? type === TRANSITION
6891 ? transitionDurations.length
6892 : animationDurations.length
6893 : 0;
6894 }
6895 var hasTransform =
6896 type === TRANSITION &&
6897 transformRE.test(styles[transitionProp + 'Property']);
6898 return {
6899 type: type,
6900 timeout: timeout,
6901 propCount: propCount,
6902 hasTransform: hasTransform
6903 }
6904}
6905
6906function getTimeout (delays, durations) {
6907 /* istanbul ignore next */
6908 while (delays.length < durations.length) {
6909 delays = delays.concat(delays);
6910 }
6911
6912 return Math.max.apply(null, durations.map(function (d, i) {
6913 return toMs(d) + toMs(delays[i])
6914 }))
6915}
6916
6917function toMs (s) {
6918 return Number(s.slice(0, -1)) * 1000
6919}
6920
6921/* */
6922
6923function enter (vnode, toggleDisplay) {
6924 var el = vnode.elm;
6925
6926 // call leave callback now
6927 if (isDef(el._leaveCb)) {
6928 el._leaveCb.cancelled = true;
6929 el._leaveCb();
6930 }
6931
6932 var data = resolveTransition(vnode.data.transition);
6933 if (isUndef(data)) {
6934 return
6935 }
6936
6937 /* istanbul ignore if */
6938 if (isDef(el._enterCb) || el.nodeType !== 1) {
6939 return
6940 }
6941
6942 var css = data.css;
6943 var type = data.type;
6944 var enterClass = data.enterClass;
6945 var enterToClass = data.enterToClass;
6946 var enterActiveClass = data.enterActiveClass;
6947 var appearClass = data.appearClass;
6948 var appearToClass = data.appearToClass;
6949 var appearActiveClass = data.appearActiveClass;
6950 var beforeEnter = data.beforeEnter;
6951 var enter = data.enter;
6952 var afterEnter = data.afterEnter;
6953 var enterCancelled = data.enterCancelled;
6954 var beforeAppear = data.beforeAppear;
6955 var appear = data.appear;
6956 var afterAppear = data.afterAppear;
6957 var appearCancelled = data.appearCancelled;
6958 var duration = data.duration;
6959
6960 // activeInstance will always be the <transition> component managing this
6961 // transition. One edge case to check is when the <transition> is placed
6962 // as the root node of a child component. In that case we need to check
6963 // <transition>'s parent for appear check.
6964 var context = activeInstance;
6965 var transitionNode = activeInstance.$vnode;
6966 while (transitionNode && transitionNode.parent) {
6967 transitionNode = transitionNode.parent;
6968 context = transitionNode.context;
6969 }
6970
6971 var isAppear = !context._isMounted || !vnode.isRootInsert;
6972
6973 if (isAppear && !appear && appear !== '') {
6974 return
6975 }
6976
6977 var startClass = isAppear && appearClass
6978 ? appearClass
6979 : enterClass;
6980 var activeClass = isAppear && appearActiveClass
6981 ? appearActiveClass
6982 : enterActiveClass;
6983 var toClass = isAppear && appearToClass
6984 ? appearToClass
6985 : enterToClass;
6986
6987 var beforeEnterHook = isAppear
6988 ? (beforeAppear || beforeEnter)
6989 : beforeEnter;
6990 var enterHook = isAppear
6991 ? (typeof appear === 'function' ? appear : enter)
6992 : enter;
6993 var afterEnterHook = isAppear
6994 ? (afterAppear || afterEnter)
6995 : afterEnter;
6996 var enterCancelledHook = isAppear
6997 ? (appearCancelled || enterCancelled)
6998 : enterCancelled;
6999
7000 var explicitEnterDuration = toNumber(
7001 isObject(duration)
7002 ? duration.enter
7003 : duration
7004 );
7005
7006 if (false) {
7007 checkDuration(explicitEnterDuration, 'enter', vnode);
7008 }
7009
7010 var expectsCSS = css !== false && !isIE9;
7011 var userWantsControl = getHookArgumentsLength(enterHook);
7012
7013 var cb = el._enterCb = once(function () {
7014 if (expectsCSS) {
7015 removeTransitionClass(el, toClass);
7016 removeTransitionClass(el, activeClass);
7017 }
7018 if (cb.cancelled) {
7019 if (expectsCSS) {
7020 removeTransitionClass(el, startClass);
7021 }
7022 enterCancelledHook && enterCancelledHook(el);
7023 } else {
7024 afterEnterHook && afterEnterHook(el);
7025 }
7026 el._enterCb = null;
7027 });
7028
7029 if (!vnode.data.show) {
7030 // remove pending leave element on enter by injecting an insert hook
7031 mergeVNodeHook(vnode.data.hook || (vnode.data.hook = {}), 'insert', function () {
7032 var parent = el.parentNode;
7033 var pendingNode = parent && parent._pending && parent._pending[vnode.key];
7034 if (pendingNode &&
7035 pendingNode.tag === vnode.tag &&
7036 pendingNode.elm._leaveCb
7037 ) {
7038 pendingNode.elm._leaveCb();
7039 }
7040 enterHook && enterHook(el, cb);
7041 });
7042 }
7043
7044 // start enter transition
7045 beforeEnterHook && beforeEnterHook(el);
7046 if (expectsCSS) {
7047 addTransitionClass(el, startClass);
7048 addTransitionClass(el, activeClass);
7049 nextFrame(function () {
7050 addTransitionClass(el, toClass);
7051 removeTransitionClass(el, startClass);
7052 if (!cb.cancelled && !userWantsControl) {
7053 if (isValidDuration(explicitEnterDuration)) {
7054 setTimeout(cb, explicitEnterDuration);
7055 } else {
7056 whenTransitionEnds(el, type, cb);
7057 }
7058 }
7059 });
7060 }
7061
7062 if (vnode.data.show) {
7063 toggleDisplay && toggleDisplay();
7064 enterHook && enterHook(el, cb);
7065 }
7066
7067 if (!expectsCSS && !userWantsControl) {
7068 cb();
7069 }
7070}
7071
7072function leave (vnode, rm) {
7073 var el = vnode.elm;
7074
7075 // call enter callback now
7076 if (isDef(el._enterCb)) {
7077 el._enterCb.cancelled = true;
7078 el._enterCb();
7079 }
7080
7081 var data = resolveTransition(vnode.data.transition);
7082 if (isUndef(data)) {
7083 return rm()
7084 }
7085
7086 /* istanbul ignore if */
7087 if (isDef(el._leaveCb) || el.nodeType !== 1) {
7088 return
7089 }
7090
7091 var css = data.css;
7092 var type = data.type;
7093 var leaveClass = data.leaveClass;
7094 var leaveToClass = data.leaveToClass;
7095 var leaveActiveClass = data.leaveActiveClass;
7096 var beforeLeave = data.beforeLeave;
7097 var leave = data.leave;
7098 var afterLeave = data.afterLeave;
7099 var leaveCancelled = data.leaveCancelled;
7100 var delayLeave = data.delayLeave;
7101 var duration = data.duration;
7102
7103 var expectsCSS = css !== false && !isIE9;
7104 var userWantsControl = getHookArgumentsLength(leave);
7105
7106 var explicitLeaveDuration = toNumber(
7107 isObject(duration)
7108 ? duration.leave
7109 : duration
7110 );
7111
7112 if (false) {
7113 checkDuration(explicitLeaveDuration, 'leave', vnode);
7114 }
7115
7116 var cb = el._leaveCb = once(function () {
7117 if (el.parentNode && el.parentNode._pending) {
7118 el.parentNode._pending[vnode.key] = null;
7119 }
7120 if (expectsCSS) {
7121 removeTransitionClass(el, leaveToClass);
7122 removeTransitionClass(el, leaveActiveClass);
7123 }
7124 if (cb.cancelled) {
7125 if (expectsCSS) {
7126 removeTransitionClass(el, leaveClass);
7127 }
7128 leaveCancelled && leaveCancelled(el);
7129 } else {
7130 rm();
7131 afterLeave && afterLeave(el);
7132 }
7133 el._leaveCb = null;
7134 });
7135
7136 if (delayLeave) {
7137 delayLeave(performLeave);
7138 } else {
7139 performLeave();
7140 }
7141
7142 function performLeave () {
7143 // the delayed leave may have already been cancelled
7144 if (cb.cancelled) {
7145 return
7146 }
7147 // record leaving element
7148 if (!vnode.data.show) {
7149 (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;
7150 }
7151 beforeLeave && beforeLeave(el);
7152 if (expectsCSS) {
7153 addTransitionClass(el, leaveClass);
7154 addTransitionClass(el, leaveActiveClass);
7155 nextFrame(function () {
7156 addTransitionClass(el, leaveToClass);
7157 removeTransitionClass(el, leaveClass);
7158 if (!cb.cancelled && !userWantsControl) {
7159 if (isValidDuration(explicitLeaveDuration)) {
7160 setTimeout(cb, explicitLeaveDuration);
7161 } else {
7162 whenTransitionEnds(el, type, cb);
7163 }
7164 }
7165 });
7166 }
7167 leave && leave(el, cb);
7168 if (!expectsCSS && !userWantsControl) {
7169 cb();
7170 }
7171 }
7172}
7173
7174// only used in dev mode
7175function checkDuration (val, name, vnode) {
7176 if (typeof val !== 'number') {
7177 warn(
7178 "<transition> explicit " + name + " duration is not a valid number - " +
7179 "got " + (JSON.stringify(val)) + ".",
7180 vnode.context
7181 );
7182 } else if (isNaN(val)) {
7183 warn(
7184 "<transition> explicit " + name + " duration is NaN - " +
7185 'the duration expression might be incorrect.',
7186 vnode.context
7187 );
7188 }
7189}
7190
7191function isValidDuration (val) {
7192 return typeof val === 'number' && !isNaN(val)
7193}
7194
7195/**
7196 * Normalize a transition hook's argument length. The hook may be:
7197 * - a merged hook (invoker) with the original in .fns
7198 * - a wrapped component method (check ._length)
7199 * - a plain function (.length)
7200 */
7201function getHookArgumentsLength (fn) {
7202 if (isUndef(fn)) {
7203 return false
7204 }
7205 var invokerFns = fn.fns;
7206 if (isDef(invokerFns)) {
7207 // invoker
7208 return getHookArgumentsLength(
7209 Array.isArray(invokerFns)
7210 ? invokerFns[0]
7211 : invokerFns
7212 )
7213 } else {
7214 return (fn._length || fn.length) > 1
7215 }
7216}
7217
7218function _enter (_, vnode) {
7219 if (vnode.data.show !== true) {
7220 enter(vnode);
7221 }
7222}
7223
7224var transition = inBrowser ? {
7225 create: _enter,
7226 activate: _enter,
7227 remove: function remove$$1 (vnode, rm) {
7228 /* istanbul ignore else */
7229 if (vnode.data.show !== true) {
7230 leave(vnode, rm);
7231 } else {
7232 rm();
7233 }
7234 }
7235} : {};
7236
7237var platformModules = [
7238 attrs,
7239 klass,
7240 events,
7241 domProps,
7242 style,
7243 transition
7244];
7245
7246/* */
7247
7248// the directive module should be applied last, after all
7249// built-in modules have been applied.
7250var modules = platformModules.concat(baseModules);
7251
7252var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
7253
7254/**
7255 * Not type checking this file because flow doesn't like attaching
7256 * properties to Elements.
7257 */
7258
7259/* istanbul ignore if */
7260if (isIE9) {
7261 // http://www.matts411.com/post/internet-explorer-9-oninput/
7262 document.addEventListener('selectionchange', function () {
7263 var el = document.activeElement;
7264 if (el && el.vmodel) {
7265 trigger(el, 'input');
7266 }
7267 });
7268}
7269
7270var model$1 = {
7271 inserted: function inserted (el, binding, vnode) {
7272 if (vnode.tag === 'select') {
7273 setSelected(el, binding, vnode.context);
7274 el._vOptions = [].map.call(el.options, getValue);
7275 } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
7276 el._vModifiers = binding.modifiers;
7277 if (!binding.modifiers.lazy) {
7278 // Safari < 10.2 & UIWebView doesn't fire compositionend when
7279 // switching focus before confirming composition choice
7280 // this also fixes the issue where some browsers e.g. iOS Chrome
7281 // fires "change" instead of "input" on autocomplete.
7282 el.addEventListener('change', onCompositionEnd);
7283 if (!isAndroid) {
7284 el.addEventListener('compositionstart', onCompositionStart);
7285 el.addEventListener('compositionend', onCompositionEnd);
7286 }
7287 /* istanbul ignore if */
7288 if (isIE9) {
7289 el.vmodel = true;
7290 }
7291 }
7292 }
7293 },
7294 componentUpdated: function componentUpdated (el, binding, vnode) {
7295 if (vnode.tag === 'select') {
7296 setSelected(el, binding, vnode.context);
7297 // in case the options rendered by v-for have changed,
7298 // it's possible that the value is out-of-sync with the rendered options.
7299 // detect such cases and filter out values that no longer has a matching
7300 // option in the DOM.
7301 var prevOptions = el._vOptions;
7302 var curOptions = el._vOptions = [].map.call(el.options, getValue);
7303 if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) {
7304 // trigger change event if
7305 // no matching option found for at least one value
7306 var needReset = el.multiple
7307 ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); })
7308 : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);
7309 if (needReset) {
7310 trigger(el, 'change');
7311 }
7312 }
7313 }
7314 }
7315};
7316
7317function setSelected (el, binding, vm) {
7318 actuallySetSelected(el, binding, vm);
7319 /* istanbul ignore if */
7320 if (isIE || isEdge) {
7321 setTimeout(function () {
7322 actuallySetSelected(el, binding, vm);
7323 }, 0);
7324 }
7325}
7326
7327function actuallySetSelected (el, binding, vm) {
7328 var value = binding.value;
7329 var isMultiple = el.multiple;
7330 if (isMultiple && !Array.isArray(value)) {
7331 "production" !== 'production' && warn(
7332 "<select multiple v-model=\"" + (binding.expression) + "\"> " +
7333 "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
7334 vm
7335 );
7336 return
7337 }
7338 var selected, option;
7339 for (var i = 0, l = el.options.length; i < l; i++) {
7340 option = el.options[i];
7341 if (isMultiple) {
7342 selected = looseIndexOf(value, getValue(option)) > -1;
7343 if (option.selected !== selected) {
7344 option.selected = selected;
7345 }
7346 } else {
7347 if (looseEqual(getValue(option), value)) {
7348 if (el.selectedIndex !== i) {
7349 el.selectedIndex = i;
7350 }
7351 return
7352 }
7353 }
7354 }
7355 if (!isMultiple) {
7356 el.selectedIndex = -1;
7357 }
7358}
7359
7360function hasNoMatchingOption (value, options) {
7361 return options.every(function (o) { return !looseEqual(o, value); })
7362}
7363
7364function getValue (option) {
7365 return '_value' in option
7366 ? option._value
7367 : option.value
7368}
7369
7370function onCompositionStart (e) {
7371 e.target.composing = true;
7372}
7373
7374function onCompositionEnd (e) {
7375 // prevent triggering an input event for no reason
7376 if (!e.target.composing) { return }
7377 e.target.composing = false;
7378 trigger(e.target, 'input');
7379}
7380
7381function trigger (el, type) {
7382 var e = document.createEvent('HTMLEvents');
7383 e.initEvent(type, true, true);
7384 el.dispatchEvent(e);
7385}
7386
7387/* */
7388
7389// recursively search for possible transition defined inside the component root
7390function locateNode (vnode) {
7391 return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
7392 ? locateNode(vnode.componentInstance._vnode)
7393 : vnode
7394}
7395
7396var show = {
7397 bind: function bind (el, ref, vnode) {
7398 var value = ref.value;
7399
7400 vnode = locateNode(vnode);
7401 var transition$$1 = vnode.data && vnode.data.transition;
7402 var originalDisplay = el.__vOriginalDisplay =
7403 el.style.display === 'none' ? '' : el.style.display;
7404 if (value && transition$$1) {
7405 vnode.data.show = true;
7406 enter(vnode, function () {
7407 el.style.display = originalDisplay;
7408 });
7409 } else {
7410 el.style.display = value ? originalDisplay : 'none';
7411 }
7412 },
7413
7414 update: function update (el, ref, vnode) {
7415 var value = ref.value;
7416 var oldValue = ref.oldValue;
7417
7418 /* istanbul ignore if */
7419 if (value === oldValue) { return }
7420 vnode = locateNode(vnode);
7421 var transition$$1 = vnode.data && vnode.data.transition;
7422 if (transition$$1) {
7423 vnode.data.show = true;
7424 if (value) {
7425 enter(vnode, function () {
7426 el.style.display = el.__vOriginalDisplay;
7427 });
7428 } else {
7429 leave(vnode, function () {
7430 el.style.display = 'none';
7431 });
7432 }
7433 } else {
7434 el.style.display = value ? el.__vOriginalDisplay : 'none';
7435 }
7436 },
7437
7438 unbind: function unbind (
7439 el,
7440 binding,
7441 vnode,
7442 oldVnode,
7443 isDestroy
7444 ) {
7445 if (!isDestroy) {
7446 el.style.display = el.__vOriginalDisplay;
7447 }
7448 }
7449};
7450
7451var platformDirectives = {
7452 model: model$1,
7453 show: show
7454};
7455
7456/* */
7457
7458// Provides transition support for a single element/component.
7459// supports transition mode (out-in / in-out)
7460
7461var transitionProps = {
7462 name: String,
7463 appear: Boolean,
7464 css: Boolean,
7465 mode: String,
7466 type: String,
7467 enterClass: String,
7468 leaveClass: String,
7469 enterToClass: String,
7470 leaveToClass: String,
7471 enterActiveClass: String,
7472 leaveActiveClass: String,
7473 appearClass: String,
7474 appearActiveClass: String,
7475 appearToClass: String,
7476 duration: [Number, String, Object]
7477};
7478
7479// in case the child is also an abstract component, e.g. <keep-alive>
7480// we want to recursively retrieve the real component to be rendered
7481function getRealChild (vnode) {
7482 var compOptions = vnode && vnode.componentOptions;
7483 if (compOptions && compOptions.Ctor.options.abstract) {
7484 return getRealChild(getFirstComponentChild(compOptions.children))
7485 } else {
7486 return vnode
7487 }
7488}
7489
7490function extractTransitionData (comp) {
7491 var data = {};
7492 var options = comp.$options;
7493 // props
7494 for (var key in options.propsData) {
7495 data[key] = comp[key];
7496 }
7497 // events.
7498 // extract listeners and pass them directly to the transition methods
7499 var listeners = options._parentListeners;
7500 for (var key$1 in listeners) {
7501 data[camelize(key$1)] = listeners[key$1];
7502 }
7503 return data
7504}
7505
7506function placeholder (h, rawChild) {
7507 if (/\d-keep-alive$/.test(rawChild.tag)) {
7508 return h('keep-alive', {
7509 props: rawChild.componentOptions.propsData
7510 })
7511 }
7512}
7513
7514function hasParentTransition (vnode) {
7515 while ((vnode = vnode.parent)) {
7516 if (vnode.data.transition) {
7517 return true
7518 }
7519 }
7520}
7521
7522function isSameChild (child, oldChild) {
7523 return oldChild.key === child.key && oldChild.tag === child.tag
7524}
7525
7526var Transition = {
7527 name: 'transition',
7528 props: transitionProps,
7529 abstract: true,
7530
7531 render: function render (h) {
7532 var this$1 = this;
7533
7534 var children = this.$options._renderChildren;
7535 if (!children) {
7536 return
7537 }
7538
7539 // filter out text nodes (possible whitespaces)
7540 children = children.filter(function (c) { return c.tag || isAsyncPlaceholder(c); });
7541 /* istanbul ignore if */
7542 if (!children.length) {
7543 return
7544 }
7545
7546 // warn multiple elements
7547 if (false) {
7548 warn(
7549 '<transition> can only be used on a single element. Use ' +
7550 '<transition-group> for lists.',
7551 this.$parent
7552 );
7553 }
7554
7555 var mode = this.mode;
7556
7557 // warn invalid mode
7558 if (false
7559 ) {
7560 warn(
7561 'invalid <transition> mode: ' + mode,
7562 this.$parent
7563 );
7564 }
7565
7566 var rawChild = children[0];
7567
7568 // if this is a component root node and the component's
7569 // parent container node also has transition, skip.
7570 if (hasParentTransition(this.$vnode)) {
7571 return rawChild
7572 }
7573
7574 // apply transition data to child
7575 // use getRealChild() to ignore abstract components e.g. keep-alive
7576 var child = getRealChild(rawChild);
7577 /* istanbul ignore if */
7578 if (!child) {
7579 return rawChild
7580 }
7581
7582 if (this._leaving) {
7583 return placeholder(h, rawChild)
7584 }
7585
7586 // ensure a key that is unique to the vnode type and to this transition
7587 // component instance. This key will be used to remove pending leaving nodes
7588 // during entering.
7589 var id = "__transition-" + (this._uid) + "-";
7590 child.key = child.key == null
7591 ? child.isComment
7592 ? id + 'comment'
7593 : id + child.tag
7594 : isPrimitive(child.key)
7595 ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
7596 : child.key;
7597
7598 var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
7599 var oldRawChild = this._vnode;
7600 var oldChild = getRealChild(oldRawChild);
7601
7602 // mark v-show
7603 // so that the transition module can hand over the control to the directive
7604 if (child.data.directives && child.data.directives.some(function (d) { return d.name === 'show'; })) {
7605 child.data.show = true;
7606 }
7607
7608 if (
7609 oldChild &&
7610 oldChild.data &&
7611 !isSameChild(child, oldChild) &&
7612 !isAsyncPlaceholder(oldChild)
7613 ) {
7614 // replace old child transition data with fresh one
7615 // important for dynamic transitions!
7616 var oldData = oldChild.data.transition = extend({}, data);
7617 // handle transition mode
7618 if (mode === 'out-in') {
7619 // return placeholder node and queue update when leave finishes
7620 this._leaving = true;
7621 mergeVNodeHook(oldData, 'afterLeave', function () {
7622 this$1._leaving = false;
7623 this$1.$forceUpdate();
7624 });
7625 return placeholder(h, rawChild)
7626 } else if (mode === 'in-out') {
7627 if (isAsyncPlaceholder(child)) {
7628 return oldRawChild
7629 }
7630 var delayedLeave;
7631 var performLeave = function () { delayedLeave(); };
7632 mergeVNodeHook(data, 'afterEnter', performLeave);
7633 mergeVNodeHook(data, 'enterCancelled', performLeave);
7634 mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });
7635 }
7636 }
7637
7638 return rawChild
7639 }
7640};
7641
7642/* */
7643
7644// Provides transition support for list items.
7645// supports move transitions using the FLIP technique.
7646
7647// Because the vdom's children update algorithm is "unstable" - i.e.
7648// it doesn't guarantee the relative positioning of removed elements,
7649// we force transition-group to update its children into two passes:
7650// in the first pass, we remove all nodes that need to be removed,
7651// triggering their leaving transition; in the second pass, we insert/move
7652// into the final desired state. This way in the second pass removed
7653// nodes will remain where they should be.
7654
7655var props = extend({
7656 tag: String,
7657 moveClass: String
7658}, transitionProps);
7659
7660delete props.mode;
7661
7662var TransitionGroup = {
7663 props: props,
7664
7665 render: function render (h) {
7666 var tag = this.tag || this.$vnode.data.tag || 'span';
7667 var map = Object.create(null);
7668 var prevChildren = this.prevChildren = this.children;
7669 var rawChildren = this.$slots.default || [];
7670 var children = this.children = [];
7671 var transitionData = extractTransitionData(this);
7672
7673 for (var i = 0; i < rawChildren.length; i++) {
7674 var c = rawChildren[i];
7675 if (c.tag) {
7676 if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
7677 children.push(c);
7678 map[c.key] = c
7679 ;(c.data || (c.data = {})).transition = transitionData;
7680 } else if (false) {
7681 var opts = c.componentOptions;
7682 var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;
7683 warn(("<transition-group> children must be keyed: <" + name + ">"));
7684 }
7685 }
7686 }
7687
7688 if (prevChildren) {
7689 var kept = [];
7690 var removed = [];
7691 for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
7692 var c$1 = prevChildren[i$1];
7693 c$1.data.transition = transitionData;
7694 c$1.data.pos = c$1.elm.getBoundingClientRect();
7695 if (map[c$1.key]) {
7696 kept.push(c$1);
7697 } else {
7698 removed.push(c$1);
7699 }
7700 }
7701 this.kept = h(tag, null, kept);
7702 this.removed = removed;
7703 }
7704
7705 return h(tag, null, children)
7706 },
7707
7708 beforeUpdate: function beforeUpdate () {
7709 // force removing pass
7710 this.__patch__(
7711 this._vnode,
7712 this.kept,
7713 false, // hydrating
7714 true // removeOnly (!important, avoids unnecessary moves)
7715 );
7716 this._vnode = this.kept;
7717 },
7718
7719 updated: function updated () {
7720 var children = this.prevChildren;
7721 var moveClass = this.moveClass || ((this.name || 'v') + '-move');
7722 if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
7723 return
7724 }
7725
7726 // we divide the work into three loops to avoid mixing DOM reads and writes
7727 // in each iteration - which helps prevent layout thrashing.
7728 children.forEach(callPendingCbs);
7729 children.forEach(recordPosition);
7730 children.forEach(applyTranslation);
7731
7732 // force reflow to put everything in position
7733 // assign to this to avoid being removed in tree-shaking
7734 // $flow-disable-line
7735 this._reflow = document.body.offsetHeight;
7736
7737 children.forEach(function (c) {
7738 if (c.data.moved) {
7739 var el = c.elm;
7740 var s = el.style;
7741 addTransitionClass(el, moveClass);
7742 s.transform = s.WebkitTransform = s.transitionDuration = '';
7743 el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
7744 if (!e || /transform$/.test(e.propertyName)) {
7745 el.removeEventListener(transitionEndEvent, cb);
7746 el._moveCb = null;
7747 removeTransitionClass(el, moveClass);
7748 }
7749 });
7750 }
7751 });
7752 },
7753
7754 methods: {
7755 hasMove: function hasMove (el, moveClass) {
7756 /* istanbul ignore if */
7757 if (!hasTransition) {
7758 return false
7759 }
7760 /* istanbul ignore if */
7761 if (this._hasMove) {
7762 return this._hasMove
7763 }
7764 // Detect whether an element with the move class applied has
7765 // CSS transitions. Since the element may be inside an entering
7766 // transition at this very moment, we make a clone of it and remove
7767 // all other transition classes applied to ensure only the move class
7768 // is applied.
7769 var clone = el.cloneNode();
7770 if (el._transitionClasses) {
7771 el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });
7772 }
7773 addClass(clone, moveClass);
7774 clone.style.display = 'none';
7775 this.$el.appendChild(clone);
7776 var info = getTransitionInfo(clone);
7777 this.$el.removeChild(clone);
7778 return (this._hasMove = info.hasTransform)
7779 }
7780 }
7781};
7782
7783function callPendingCbs (c) {
7784 /* istanbul ignore if */
7785 if (c.elm._moveCb) {
7786 c.elm._moveCb();
7787 }
7788 /* istanbul ignore if */
7789 if (c.elm._enterCb) {
7790 c.elm._enterCb();
7791 }
7792}
7793
7794function recordPosition (c) {
7795 c.data.newPos = c.elm.getBoundingClientRect();
7796}
7797
7798function applyTranslation (c) {
7799 var oldPos = c.data.pos;
7800 var newPos = c.data.newPos;
7801 var dx = oldPos.left - newPos.left;
7802 var dy = oldPos.top - newPos.top;
7803 if (dx || dy) {
7804 c.data.moved = true;
7805 var s = c.elm.style;
7806 s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
7807 s.transitionDuration = '0s';
7808 }
7809}
7810
7811var platformComponents = {
7812 Transition: Transition,
7813 TransitionGroup: TransitionGroup
7814};
7815
7816/* */
7817
7818// install platform specific utils
7819Vue$3.config.mustUseProp = mustUseProp;
7820Vue$3.config.isReservedTag = isReservedTag;
7821Vue$3.config.isReservedAttr = isReservedAttr;
7822Vue$3.config.getTagNamespace = getTagNamespace;
7823Vue$3.config.isUnknownElement = isUnknownElement;
7824
7825// install platform runtime directives & components
7826extend(Vue$3.options.directives, platformDirectives);
7827extend(Vue$3.options.components, platformComponents);
7828
7829// install platform patch function
7830Vue$3.prototype.__patch__ = inBrowser ? patch : noop;
7831
7832// public mount method
7833Vue$3.prototype.$mount = function (
7834 el,
7835 hydrating
7836) {
7837 el = el && inBrowser ? query(el) : undefined;
7838 return mountComponent(this, el, hydrating)
7839};
7840
7841// devtools global hook
7842/* istanbul ignore next */
7843Vue$3.nextTick(function () {
7844 if (config.devtools) {
7845 if (devtools) {
7846 devtools.emit('init', Vue$3);
7847 } else if (false) {
7848 console[console.info ? 'info' : 'log'](
7849 'Download the Vue Devtools extension for a better development experience:\n' +
7850 'https://github.com/vuejs/vue-devtools'
7851 );
7852 }
7853 }
7854 if (false
7855 ) {
7856 console[console.info ? 'info' : 'log'](
7857 "You are running Vue in development mode.\n" +
7858 "Make sure to turn on production mode when deploying for production.\n" +
7859 "See more tips at https://vuejs.org/guide/deployment.html"
7860 );
7861 }
7862}, 0);
7863
7864/* */
7865
7866/* harmony default export */ __webpack_exports__["a"] = (Vue$3);
7867
7868/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 0), __webpack_require__(/*! ./../../timers-browserify/main.js */ 9).setImmediate))
7869
7870/***/ }),
7871/* 2 */
7872/*!*****************************************!*\
7873 !*** ./node_modules/process/browser.js ***!
7874 \*****************************************/
7875/*! dynamic exports provided */
7876/*! all exports used */
7877/***/ (function(module, exports) {
7878
7879// shim for using process in browser
7880var process = module.exports = {};
7881
7882// cached from whatever global is present so that test runners that stub it
7883// don't break things. But we need to wrap it in a try catch in case it is
7884// wrapped in strict mode code which doesn't define any globals. It's inside a
7885// function because try/catches deoptimize in certain engines.
7886
7887var cachedSetTimeout;
7888var cachedClearTimeout;
7889
7890function defaultSetTimout() {
7891 throw new Error('setTimeout has not been defined');
7892}
7893function defaultClearTimeout () {
7894 throw new Error('clearTimeout has not been defined');
7895}
7896(function () {
7897 try {
7898 if (typeof setTimeout === 'function') {
7899 cachedSetTimeout = setTimeout;
7900 } else {
7901 cachedSetTimeout = defaultSetTimout;
7902 }
7903 } catch (e) {
7904 cachedSetTimeout = defaultSetTimout;
7905 }
7906 try {
7907 if (typeof clearTimeout === 'function') {
7908 cachedClearTimeout = clearTimeout;
7909 } else {
7910 cachedClearTimeout = defaultClearTimeout;
7911 }
7912 } catch (e) {
7913 cachedClearTimeout = defaultClearTimeout;
7914 }
7915} ())
7916function runTimeout(fun) {
7917 if (cachedSetTimeout === setTimeout) {
7918 //normal enviroments in sane situations
7919 return setTimeout(fun, 0);
7920 }
7921 // if setTimeout wasn't available but was latter defined
7922 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
7923 cachedSetTimeout = setTimeout;
7924 return setTimeout(fun, 0);
7925 }
7926 try {
7927 // when when somebody has screwed with setTimeout but no I.E. maddness
7928 return cachedSetTimeout(fun, 0);
7929 } catch(e){
7930 try {
7931 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
7932 return cachedSetTimeout.call(null, fun, 0);
7933 } catch(e){
7934 // 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
7935 return cachedSetTimeout.call(this, fun, 0);
7936 }
7937 }
7938
7939
7940}
7941function runClearTimeout(marker) {
7942 if (cachedClearTimeout === clearTimeout) {
7943 //normal enviroments in sane situations
7944 return clearTimeout(marker);
7945 }
7946 // if clearTimeout wasn't available but was latter defined
7947 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
7948 cachedClearTimeout = clearTimeout;
7949 return clearTimeout(marker);
7950 }
7951 try {
7952 // when when somebody has screwed with setTimeout but no I.E. maddness
7953 return cachedClearTimeout(marker);
7954 } catch (e){
7955 try {
7956 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
7957 return cachedClearTimeout.call(null, marker);
7958 } catch (e){
7959 // 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.
7960 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
7961 return cachedClearTimeout.call(this, marker);
7962 }
7963 }
7964
7965
7966
7967}
7968var queue = [];
7969var draining = false;
7970var currentQueue;
7971var queueIndex = -1;
7972
7973function cleanUpNextTick() {
7974 if (!draining || !currentQueue) {
7975 return;
7976 }
7977 draining = false;
7978 if (currentQueue.length) {
7979 queue = currentQueue.concat(queue);
7980 } else {
7981 queueIndex = -1;
7982 }
7983 if (queue.length) {
7984 drainQueue();
7985 }
7986}
7987
7988function drainQueue() {
7989 if (draining) {
7990 return;
7991 }
7992 var timeout = runTimeout(cleanUpNextTick);
7993 draining = true;
7994
7995 var len = queue.length;
7996 while(len) {
7997 currentQueue = queue;
7998 queue = [];
7999 while (++queueIndex < len) {
8000 if (currentQueue) {
8001 currentQueue[queueIndex].run();
8002 }
8003 }
8004 queueIndex = -1;
8005 len = queue.length;
8006 }
8007 currentQueue = null;
8008 draining = false;
8009 runClearTimeout(timeout);
8010}
8011
8012process.nextTick = function (fun) {
8013 var args = new Array(arguments.length - 1);
8014 if (arguments.length > 1) {
8015 for (var i = 1; i < arguments.length; i++) {
8016 args[i - 1] = arguments[i];
8017 }
8018 }
8019 queue.push(new Item(fun, args));
8020 if (queue.length === 1 && !draining) {
8021 runTimeout(drainQueue);
8022 }
8023};
8024
8025// v8 likes predictible objects
8026function Item(fun, array) {
8027 this.fun = fun;
8028 this.array = array;
8029}
8030Item.prototype.run = function () {
8031 this.fun.apply(null, this.array);
8032};
8033process.title = 'browser';
8034process.browser = true;
8035process.env = {};
8036process.argv = [];
8037process.version = ''; // empty string to avoid regexp issues
8038process.versions = {};
8039
8040function noop() {}
8041
8042process.on = noop;
8043process.addListener = noop;
8044process.once = noop;
8045process.off = noop;
8046process.removeListener = noop;
8047process.removeAllListeners = noop;
8048process.emit = noop;
8049process.prependListener = noop;
8050process.prependOnceListener = noop;
8051
8052process.listeners = function (name) { return [] }
8053
8054process.binding = function (name) {
8055 throw new Error('process.binding is not supported');
8056};
8057
8058process.cwd = function () { return '/' };
8059process.chdir = function (dir) {
8060 throw new Error('process.chdir is not supported');
8061};
8062process.umask = function() { return 0; };
8063
8064
8065/***/ }),
8066/* 3 */
8067/*!*************************************************************!*\
8068 !*** ./node_modules/vue-loader/lib/component-normalizer.js ***!
8069 \*************************************************************/
8070/*! dynamic exports provided */
8071/*! all exports used */
8072/***/ (function(module, exports) {
8073
8074/* globals __VUE_SSR_CONTEXT__ */
8075
8076// IMPORTANT: Do NOT use ES2015 features in this file.
8077// This module is a runtime utility for cleaner component module output and will
8078// be included in the final webpack user bundle.
8079
8080module.exports = function normalizeComponent (
8081 rawScriptExports,
8082 compiledTemplate,
8083 functionalTemplate,
8084 injectStyles,
8085 scopeId,
8086 moduleIdentifier /* server only */
8087) {
8088 var esModule
8089 var scriptExports = rawScriptExports = rawScriptExports || {}
8090
8091 // ES6 modules interop
8092 var type = typeof rawScriptExports.default
8093 if (type === 'object' || type === 'function') {
8094 esModule = rawScriptExports
8095 scriptExports = rawScriptExports.default
8096 }
8097
8098 // Vue.extend constructor export interop
8099 var options = typeof scriptExports === 'function'
8100 ? scriptExports.options
8101 : scriptExports
8102
8103 // render functions
8104 if (compiledTemplate) {
8105 options.render = compiledTemplate.render
8106 options.staticRenderFns = compiledTemplate.staticRenderFns
8107 options._compiled = true
8108 }
8109
8110 // functional template
8111 if (functionalTemplate) {
8112 options.functional = true
8113 }
8114
8115 // scopedId
8116 if (scopeId) {
8117 options._scopeId = scopeId
8118 }
8119
8120 var hook
8121 if (moduleIdentifier) { // server build
8122 hook = function (context) {
8123 // 2.3 injection
8124 context =
8125 context || // cached call
8126 (this.$vnode && this.$vnode.ssrContext) || // stateful
8127 (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
8128 // 2.2 with runInNewContext: true
8129 if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
8130 context = __VUE_SSR_CONTEXT__
8131 }
8132 // inject component styles
8133 if (injectStyles) {
8134 injectStyles.call(this, context)
8135 }
8136 // register component module identifier for async chunk inferrence
8137 if (context && context._registeredComponents) {
8138 context._registeredComponents.add(moduleIdentifier)
8139 }
8140 }
8141 // used by ssr in case component is cached and beforeCreate
8142 // never gets called
8143 options._ssrRegister = hook
8144 } else if (injectStyles) {
8145 hook = injectStyles
8146 }
8147
8148 if (hook) {
8149 var functional = options.functional
8150 var existing = functional
8151 ? options.render
8152 : options.beforeCreate
8153
8154 if (!functional) {
8155 // inject component registration as beforeCreate hook
8156 options.beforeCreate = existing
8157 ? [].concat(existing, hook)
8158 : [hook]
8159 } else {
8160 // for template-only hot-reload because in that case the render fn doesn't
8161 // go through the normalizer
8162 options._injectStyles = hook
8163 // register for functioal component in vue file
8164 options.render = function renderWithStyleInjection (h, context) {
8165 hook.call(context)
8166 return existing(h, context)
8167 }
8168 }
8169 }
8170
8171 return {
8172 esModule: esModule,
8173 exports: scriptExports,
8174 options: options
8175 }
8176}
8177
8178
8179/***/ }),
8180/* 4 */
8181/*!****************************************************************!*\
8182 !*** ./node_modules/babel-helper-vue-jsx-merge-props/index.js ***!
8183 \****************************************************************/
8184/*! dynamic exports provided */
8185/*! exports used: default */
8186/***/ (function(module, exports) {
8187
8188var nestRE = /^(attrs|props|on|nativeOn|class|style|hook)$/
8189
8190module.exports = function mergeJSXProps (objs) {
8191 return objs.reduce(function (a, b) {
8192 var aa, bb, key, nestedKey, temp
8193 for (key in b) {
8194 aa = a[key]
8195 bb = b[key]
8196 if (aa && nestRE.test(key)) {
8197 // normalize class
8198 if (key === 'class') {
8199 if (typeof aa === 'string') {
8200 temp = aa
8201 a[key] = aa = {}
8202 aa[temp] = true
8203 }
8204 if (typeof bb === 'string') {
8205 temp = bb
8206 b[key] = bb = {}
8207 bb[temp] = true
8208 }
8209 }
8210 if (key === 'on' || key === 'nativeOn' || key === 'hook') {
8211 // merge functions
8212 for (nestedKey in bb) {
8213 aa[nestedKey] = mergeFn(aa[nestedKey], bb[nestedKey])
8214 }
8215 } else if (Array.isArray(aa)) {
8216 a[key] = aa.concat(bb)
8217 } else if (Array.isArray(bb)) {
8218 a[key] = [aa].concat(bb)
8219 } else {
8220 for (nestedKey in bb) {
8221 aa[nestedKey] = bb[nestedKey]
8222 }
8223 }
8224 } else {
8225 a[key] = b[key]
8226 }
8227 }
8228 return a
8229 }, {})
8230}
8231
8232function mergeFn (a, b) {
8233 return function () {
8234 a.apply(this, arguments)
8235 b.apply(this, arguments)
8236 }
8237}
8238
8239
8240/***/ }),
8241/* 5 */
8242/*!****************************!*\
8243 !*** multi ./src/index.js ***!
8244 \****************************/
8245/*! dynamic exports provided */
8246/*! all exports used */
8247/***/ (function(module, exports, __webpack_require__) {
8248
8249module.exports = __webpack_require__(/*! /Users/egoist/dev/aimer/packages/aimer/src/index.js */6);
8250
8251
8252/***/ }),
8253/* 6 */
8254/*!**********************!*\
8255 !*** ./src/index.js ***!
8256 \**********************/
8257/*! exports provided: default */
8258/*! all exports used */
8259/***/ (function(module, __webpack_exports__, __webpack_require__) {
8260
8261"use strict";
8262Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
8263/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__polyfills__ = __webpack_require__(/*! ./polyfills */ 7);
8264/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__polyfills___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__polyfills__);
8265/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue__ = __webpack_require__(/*! vue */ 1);
8266/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_slugo__ = __webpack_require__(/*! slugo */ 11);
8267/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_slugo___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_slugo__);
8268/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__AimerVue__ = __webpack_require__(/*! ./AimerVue */ 12);
8269/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Aimer_vue__ = __webpack_require__(/*! ./Aimer.vue */ 13);
8270var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8271
8272function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
8273
8274function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8275
8276// eslint-disable-next-line import/no-unassigned-import
8277
8278
8279
8280
8281
8282
8283if (typeof window !== 'undefined') {
8284 window.AIMER_VERSION = "2.0.4";
8285}
8286
8287var Aimer = function () {
8288 function Aimer() {
8289 var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8290
8291 var _ref$adapter = _ref.adapter,
8292 Adapter = _ref$adapter === undefined ? __WEBPACK_IMPORTED_MODULE_3__AimerVue__["a" /* default */] : _ref$adapter,
8293 config = _objectWithoutProperties(_ref, ['adapter']);
8294
8295 _classCallCheck(this, Aimer);
8296
8297 this.Adapter = Adapter;
8298 this.stories = [];
8299 this.config = config;
8300 }
8301
8302 _createClass(Aimer, [{
8303 key: 'add',
8304 value: function add(story) {
8305 this.stories.push(Object.assign({}, story, {
8306 slug: __WEBPACK_IMPORTED_MODULE_2_slugo___default()(story.title)
8307 }));
8308 return this;
8309 }
8310 }, {
8311 key: 'start',
8312 value: function start(target) {
8313 var _this = this;
8314
8315 if (typeof target === 'string') {
8316 target = document.querySelector(target);
8317 }
8318
8319 this.vm = new __WEBPACK_IMPORTED_MODULE_1_vue__["a" /* default */]({
8320 el: target,
8321 render: function render(h) {
8322 return h(__WEBPACK_IMPORTED_MODULE_4__Aimer_vue__["a" /* default */], {
8323 props: {
8324 Adapter: _this.Adapter,
8325 stories: _this.stories,
8326 config: _this.config
8327 }
8328 });
8329 }
8330 });
8331
8332 return this.vm;
8333 }
8334 }]);
8335
8336 return Aimer;
8337}();
8338
8339/* harmony default export */ __webpack_exports__["default"] = (Aimer);
8340
8341/***/ }),
8342/* 7 */
8343/*!**************************!*\
8344 !*** ./src/polyfills.js ***!
8345 \**************************/
8346/*! dynamic exports provided */
8347/***/ (function(module, exports, __webpack_require__) {
8348
8349Object.assign = Object.assign || __webpack_require__(/*! nano-assign */ 8);
8350
8351/***/ }),
8352/* 8 */
8353/*!*************************************************************!*\
8354 !*** ./node_modules/nano-assign/dist/nano-assign.common.js ***!
8355 \*************************************************************/
8356/*! dynamic exports provided */
8357/*! all exports used */
8358/***/ (function(module, exports, __webpack_require__) {
8359
8360"use strict";
8361/*!
8362 * nano-assign v1.0.0
8363 * (c) 2017-present egoist <0x142857@gmail.com>
8364 * Released under the MIT License.
8365 */
8366
8367
8368var index = function(obj) {
8369 var arguments$1 = arguments;
8370
8371 for (var i = 1; i < arguments.length; i++) {
8372 // eslint-disable-next-line guard-for-in, prefer-rest-params
8373 for (var p in arguments[i]) { obj[p] = arguments$1[i][p]; }
8374 }
8375 return obj
8376};
8377
8378module.exports = index;
8379
8380
8381/***/ }),
8382/* 9 */
8383/*!************************************************!*\
8384 !*** ./node_modules/timers-browserify/main.js ***!
8385 \************************************************/
8386/*! dynamic exports provided */
8387/*! all exports used */
8388/***/ (function(module, exports, __webpack_require__) {
8389
8390var apply = Function.prototype.apply;
8391
8392// DOM APIs, for completeness
8393
8394exports.setTimeout = function() {
8395 return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
8396};
8397exports.setInterval = function() {
8398 return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
8399};
8400exports.clearTimeout =
8401exports.clearInterval = function(timeout) {
8402 if (timeout) {
8403 timeout.close();
8404 }
8405};
8406
8407function Timeout(id, clearFn) {
8408 this._id = id;
8409 this._clearFn = clearFn;
8410}
8411Timeout.prototype.unref = Timeout.prototype.ref = function() {};
8412Timeout.prototype.close = function() {
8413 this._clearFn.call(window, this._id);
8414};
8415
8416// Does not start the time, just sets up the members needed.
8417exports.enroll = function(item, msecs) {
8418 clearTimeout(item._idleTimeoutId);
8419 item._idleTimeout = msecs;
8420};
8421
8422exports.unenroll = function(item) {
8423 clearTimeout(item._idleTimeoutId);
8424 item._idleTimeout = -1;
8425};
8426
8427exports._unrefActive = exports.active = function(item) {
8428 clearTimeout(item._idleTimeoutId);
8429
8430 var msecs = item._idleTimeout;
8431 if (msecs >= 0) {
8432 item._idleTimeoutId = setTimeout(function onTimeout() {
8433 if (item._onTimeout)
8434 item._onTimeout();
8435 }, msecs);
8436 }
8437};
8438
8439// setimmediate attaches itself to the global object
8440__webpack_require__(/*! setimmediate */ 10);
8441exports.setImmediate = setImmediate;
8442exports.clearImmediate = clearImmediate;
8443
8444
8445/***/ }),
8446/* 10 */
8447/*!***************************************************!*\
8448 !*** ./node_modules/setimmediate/setImmediate.js ***!
8449 \***************************************************/
8450/*! dynamic exports provided */
8451/*! all exports used */
8452/***/ (function(module, exports, __webpack_require__) {
8453
8454/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
8455 "use strict";
8456
8457 if (global.setImmediate) {
8458 return;
8459 }
8460
8461 var nextHandle = 1; // Spec says greater than zero
8462 var tasksByHandle = {};
8463 var currentlyRunningATask = false;
8464 var doc = global.document;
8465 var registerImmediate;
8466
8467 function setImmediate(callback) {
8468 // Callback can either be a function or a string
8469 if (typeof callback !== "function") {
8470 callback = new Function("" + callback);
8471 }
8472 // Copy function arguments
8473 var args = new Array(arguments.length - 1);
8474 for (var i = 0; i < args.length; i++) {
8475 args[i] = arguments[i + 1];
8476 }
8477 // Store and register the task
8478 var task = { callback: callback, args: args };
8479 tasksByHandle[nextHandle] = task;
8480 registerImmediate(nextHandle);
8481 return nextHandle++;
8482 }
8483
8484 function clearImmediate(handle) {
8485 delete tasksByHandle[handle];
8486 }
8487
8488 function run(task) {
8489 var callback = task.callback;
8490 var args = task.args;
8491 switch (args.length) {
8492 case 0:
8493 callback();
8494 break;
8495 case 1:
8496 callback(args[0]);
8497 break;
8498 case 2:
8499 callback(args[0], args[1]);
8500 break;
8501 case 3:
8502 callback(args[0], args[1], args[2]);
8503 break;
8504 default:
8505 callback.apply(undefined, args);
8506 break;
8507 }
8508 }
8509
8510 function runIfPresent(handle) {
8511 // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
8512 // So if we're currently running a task, we'll need to delay this invocation.
8513 if (currentlyRunningATask) {
8514 // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
8515 // "too much recursion" error.
8516 setTimeout(runIfPresent, 0, handle);
8517 } else {
8518 var task = tasksByHandle[handle];
8519 if (task) {
8520 currentlyRunningATask = true;
8521 try {
8522 run(task);
8523 } finally {
8524 clearImmediate(handle);
8525 currentlyRunningATask = false;
8526 }
8527 }
8528 }
8529 }
8530
8531 function installNextTickImplementation() {
8532 registerImmediate = function(handle) {
8533 process.nextTick(function () { runIfPresent(handle); });
8534 };
8535 }
8536
8537 function canUsePostMessage() {
8538 // The test against `importScripts` prevents this implementation from being installed inside a web worker,
8539 // where `global.postMessage` means something completely different and can't be used for this purpose.
8540 if (global.postMessage && !global.importScripts) {
8541 var postMessageIsAsynchronous = true;
8542 var oldOnMessage = global.onmessage;
8543 global.onmessage = function() {
8544 postMessageIsAsynchronous = false;
8545 };
8546 global.postMessage("", "*");
8547 global.onmessage = oldOnMessage;
8548 return postMessageIsAsynchronous;
8549 }
8550 }
8551
8552 function installPostMessageImplementation() {
8553 // Installs an event handler on `global` for the `message` event: see
8554 // * https://developer.mozilla.org/en/DOM/window.postMessage
8555 // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
8556
8557 var messagePrefix = "setImmediate$" + Math.random() + "$";
8558 var onGlobalMessage = function(event) {
8559 if (event.source === global &&
8560 typeof event.data === "string" &&
8561 event.data.indexOf(messagePrefix) === 0) {
8562 runIfPresent(+event.data.slice(messagePrefix.length));
8563 }
8564 };
8565
8566 if (global.addEventListener) {
8567 global.addEventListener("message", onGlobalMessage, false);
8568 } else {
8569 global.attachEvent("onmessage", onGlobalMessage);
8570 }
8571
8572 registerImmediate = function(handle) {
8573 global.postMessage(messagePrefix + handle, "*");
8574 };
8575 }
8576
8577 function installMessageChannelImplementation() {
8578 var channel = new MessageChannel();
8579 channel.port1.onmessage = function(event) {
8580 var handle = event.data;
8581 runIfPresent(handle);
8582 };
8583
8584 registerImmediate = function(handle) {
8585 channel.port2.postMessage(handle);
8586 };
8587 }
8588
8589 function installReadyStateChangeImplementation() {
8590 var html = doc.documentElement;
8591 registerImmediate = function(handle) {
8592 // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
8593 // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
8594 var script = doc.createElement("script");
8595 script.onreadystatechange = function () {
8596 runIfPresent(handle);
8597 script.onreadystatechange = null;
8598 html.removeChild(script);
8599 script = null;
8600 };
8601 html.appendChild(script);
8602 };
8603 }
8604
8605 function installSetTimeoutImplementation() {
8606 registerImmediate = function(handle) {
8607 setTimeout(runIfPresent, 0, handle);
8608 };
8609 }
8610
8611 // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
8612 var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
8613 attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
8614
8615 // Don't get fooled by e.g. browserify environments.
8616 if ({}.toString.call(global.process) === "[object process]") {
8617 // For Node.js before 0.9
8618 installNextTickImplementation();
8619
8620 } else if (canUsePostMessage()) {
8621 // For non-IE10 modern browsers
8622 installPostMessageImplementation();
8623
8624 } else if (global.MessageChannel) {
8625 // For web workers, where supported
8626 installMessageChannelImplementation();
8627
8628 } else if (doc && "onreadystatechange" in doc.createElement("script")) {
8629 // For IE 6–8
8630 installReadyStateChangeImplementation();
8631
8632 } else {
8633 // For older browsers
8634 installSetTimeoutImplementation();
8635 }
8636
8637 attachTo.setImmediate = setImmediate;
8638 attachTo.clearImmediate = clearImmediate;
8639}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
8640
8641/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../webpack/buildin/global.js */ 0), __webpack_require__(/*! ./../process/browser.js */ 2)))
8642
8643/***/ }),
8644/* 11 */
8645/*!******************************************!*\
8646 !*** ./node_modules/slugo/dist/slugo.js ***!
8647 \******************************************/
8648/*! dynamic exports provided */
8649/*! exports used: default */
8650/***/ (function(module, exports, __webpack_require__) {
8651
8652(function (global, factory) {
8653 true ? module.exports = factory() :
8654 typeof define === 'function' && define.amd ? define(factory) :
8655 (global.slugo = factory());
8656}(this, (function () { 'use strict';
8657
8658var index = function (input) {
8659 return input
8660 // Remove html tags
8661 .replace(/<(?:.|\n)*?>/gm, '')
8662 // Remove special characters
8663 .replace(/[!\"#$%&'\(\)\*\+,\/:;<=>\?\@\[\\\]\^`\{\|\}~]/g, '') // eslint-disable-line no-useless-escape
8664 // Replace dots and spaces with a sepeator
8665 .replace(/(\s|\.)/g, '-')
8666 // Make the whole thing lowercase
8667 .toLowerCase()
8668};
8669
8670return index;
8671
8672})));
8673
8674
8675/***/ }),
8676/* 12 */
8677/*!*************************!*\
8678 !*** ./src/AimerVue.js ***!
8679 \*************************/
8680/*! exports provided: default */
8681/*! exports used: default */
8682/***/ (function(module, __webpack_exports__, __webpack_require__) {
8683
8684"use strict";
8685/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(/*! vue */ 1);
8686var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8687
8688function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8689
8690
8691
8692var AimerVue = function () {
8693 function AimerVue() {
8694 _classCallCheck(this, AimerVue);
8695 }
8696
8697 _createClass(AimerVue, [{
8698 key: 'mount',
8699 value: function mount(component, target) {
8700 this.$el = new __WEBPACK_IMPORTED_MODULE_0_vue__["a" /* default */]({
8701 el: target,
8702 render: function render(h) {
8703 return h(component);
8704 }
8705 });
8706 return this;
8707 }
8708 }, {
8709 key: 'unmount',
8710 value: function unmount() {
8711 this.$el.$destroy();
8712 return this;
8713 }
8714 }, {
8715 key: 'isMount',
8716 value: function isMount() {
8717 return this.$el;
8718 }
8719 }]);
8720
8721 return AimerVue;
8722}();
8723
8724/* harmony default export */ __webpack_exports__["a"] = (AimerVue);
8725
8726/***/ }),
8727/* 13 */
8728/*!***********************!*\
8729 !*** ./src/Aimer.vue ***!
8730 \***********************/
8731/*! exports provided: default */
8732/*! exports used: default */
8733/***/ (function(module, __webpack_exports__, __webpack_require__) {
8734
8735"use strict";
8736/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_cacheDirectory_true_babelrc_false_presets_Users_egoist_dev_aimer_packages_aimer_node_modules_babel_preset_vue_app_dist_index_common_js_useBuiltIns_true_node_modules_vue_loader_lib_selector_type_script_index_0_Aimer_vue__ = __webpack_require__(/*! !babel-loader?{"cacheDirectory":true,"babelrc":false,"presets":[["/Users/egoist/dev/aimer/packages/aimer/node_modules/babel-preset-vue-app/dist/index.common.js",{"useBuiltIns":true}]]}!../node_modules/vue-loader/lib/selector?type=script&index=0!./Aimer.vue */ 16);
8737/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_96d8ad28_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Aimer_vue__ = __webpack_require__(/*! !../node_modules/vue-loader/lib/template-compiler/index?{"id":"data-v-96d8ad28","hasScoped":false,"buble":{"transforms":{}}}!../node_modules/vue-loader/lib/selector?type=template&index=0!./Aimer.vue */ 28);
8738function injectStyle (ssrContext) {
8739 __webpack_require__(/*! !../node_modules/extract-text-webpack-plugin/dist/loader.js?{"omit":1,"remove":true}!vue-style-loader!css-loader?{"autoprefixer":false,"sourceMap":false,"minimize":false}!../node_modules/vue-loader/lib/style-compiler/index?{"vue":true,"id":"data-v-96d8ad28","scoped":false,"hasInlineConfig":true}!github-markdown-css/github-markdown.css */ 14)
8740 __webpack_require__(/*! !../node_modules/extract-text-webpack-plugin/dist/loader.js?{"omit":1,"remove":true}!vue-style-loader!css-loader?{"autoprefixer":false,"sourceMap":false,"minimize":false}!../node_modules/vue-loader/lib/style-compiler/index?{"vue":true,"id":"data-v-96d8ad28","scoped":false,"hasInlineConfig":true}!../node_modules/vue-loader/lib/selector?type=styles&index=1!./Aimer.vue */ 15)
8741}
8742var normalizeComponent = __webpack_require__(/*! ../node_modules/vue-loader/lib/component-normalizer */ 3)
8743/* script */
8744
8745/* template */
8746
8747/* template functional */
8748 var __vue_template_functional__ = false
8749/* styles */
8750var __vue_styles__ = injectStyle
8751/* scopeId */
8752var __vue_scopeId__ = null
8753/* moduleIdentifier (server only) */
8754var __vue_module_identifier__ = null
8755var Component = normalizeComponent(
8756 __WEBPACK_IMPORTED_MODULE_0__babel_loader_cacheDirectory_true_babelrc_false_presets_Users_egoist_dev_aimer_packages_aimer_node_modules_babel_preset_vue_app_dist_index_common_js_useBuiltIns_true_node_modules_vue_loader_lib_selector_type_script_index_0_Aimer_vue__["a" /* default */],
8757 __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_96d8ad28_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Aimer_vue__["a" /* default */],
8758 __vue_template_functional__,
8759 __vue_styles__,
8760 __vue_scopeId__,
8761 __vue_module_identifier__
8762)
8763
8764/* harmony default export */ __webpack_exports__["a"] = (Component.exports);
8765
8766
8767/***/ }),
8768/* 14 */
8769/*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
8770 !*** ./node_modules/extract-text-webpack-plugin/dist/loader.js?{"omit":1,"remove":true}!./node_modules/vue-style-loader!./node_modules/css-loader?{"autoprefixer":false,"sourceMap":false,"minimize":false}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-96d8ad28","scoped":false,"hasInlineConfig":true}!./node_modules/github-markdown-css/github-markdown.css ***!
8771 \********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
8772/*! dynamic exports provided */
8773/*! all exports used */
8774/***/ (function(module, exports) {
8775
8776// removed by extract-text-webpack-plugin
8777
8778/***/ }),
8779/* 15 */
8780/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
8781 !*** ./node_modules/extract-text-webpack-plugin/dist/loader.js?{"omit":1,"remove":true}!./node_modules/vue-style-loader!./node_modules/css-loader?{"autoprefixer":false,"sourceMap":false,"minimize":false}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-96d8ad28","scoped":false,"hasInlineConfig":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=1!./src/Aimer.vue ***!
8782 \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
8783/*! dynamic exports provided */
8784/*! all exports used */
8785/***/ (function(module, exports) {
8786
8787// removed by extract-text-webpack-plugin
8788
8789/***/ }),
8790/* 16 */
8791/*!************************************************************************************************************************************************************************************************************************************************************************************************!*\
8792 !*** ./node_modules/babel-loader/lib?{"cacheDirectory":true,"babelrc":false,"presets":[["/Users/egoist/dev/aimer/packages/aimer/node_modules/babel-preset-vue-app/dist/index.common.js",{"useBuiltIns":true}]]}!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/Aimer.vue ***!
8793 \************************************************************************************************************************************************************************************************************************************************************************************************/
8794/*! exports provided: default */
8795/*! exports used: default */
8796/***/ (function(module, __webpack_exports__, __webpack_require__) {
8797
8798"use strict";
8799/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_nanoquery__ = __webpack_require__(/*! nanoquery */ 17);
8800/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_nanoquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_nanoquery__);
8801/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_Icons_vue__ = __webpack_require__(/*! ./components/Icons.vue */ 22);
8802//
8803//
8804//
8805//
8806//
8807//
8808//
8809//
8810//
8811//
8812//
8813//
8814//
8815//
8816//
8817//
8818//
8819//
8820//
8821//
8822//
8823//
8824//
8825//
8826//
8827//
8828//
8829//
8830//
8831//
8832//
8833//
8834//
8835//
8836//
8837//
8838//
8839//
8840//
8841//
8842//
8843//
8844//
8845//
8846//
8847//
8848//
8849//
8850//
8851//
8852//
8853//
8854//
8855//
8856//
8857//
8858//
8859//
8860//
8861//
8862//
8863//
8864//
8865
8866
8867
8868
8869function getCurrentTab(_ref) {
8870 var readme = _ref.readme;
8871
8872 return readme ? 'readme' : 'example';
8873}
8874
8875function updateURL(_ref2) {
8876 var title = _ref2.title,
8877 story = _ref2.story;
8878 var _window$location = window.location,
8879 host = _window$location.host,
8880 protocol = _window$location.protocol,
8881 pathname = _window$location.pathname;
8882
8883 var newUrl = protocol + '//' + host + pathname + '?story=' + story;
8884 // Update URL
8885 window.history.pushState({
8886 path: newUrl
8887 }, title, newUrl);
8888 // Update document title
8889 document.title = title;
8890}
8891
8892function mountComponent(adapter, targetWrapper, component) {
8893 if (adapter.isMount()) {
8894 adapter.unmount(targetWrapper.firstChild);
8895 targetWrapper.removeChild(targetWrapper.firstChild);
8896 }
8897 var target = document.createElement('div');
8898 targetWrapper.appendChild(target);
8899 adapter.mount(component, target);
8900}
8901
8902function getStoryBySlug(stories, slug) {
8903 return stories.filter(function (story) {
8904 return story.slug === slug;
8905 })[0];
8906}
8907
8908/* harmony default export */ __webpack_exports__["a"] = ({
8909 name: 'aimer',
8910
8911 props: {
8912 Adapter: {
8913 type: Function,
8914 required: true
8915 },
8916 stories: {
8917 type: Array,
8918 required: true
8919 },
8920 config: {
8921 type: Object
8922 }
8923 },
8924
8925 data: function data() {
8926 var kv = __WEBPACK_IMPORTED_MODULE_0_nanoquery___default()(window.location.search);
8927 var currentStorySlug = kv.story || this.stories[0].slug;
8928 return {
8929 currentTab: getCurrentTab(getStoryBySlug(this.stories, currentStorySlug)),
8930 currentStorySlug: currentStorySlug
8931 };
8932 },
8933
8934
8935 computed: {
8936 currentStory: function currentStory() {
8937 return getStoryBySlug(this.stories, this.currentStorySlug);
8938 }
8939 },
8940
8941 watch: {
8942 currentStory: function currentStory(story) {
8943 this.currentTab = getCurrentTab(story);
8944 }
8945 },
8946
8947 mounted: function mounted() {
8948 this.adapter = new this.Adapter();
8949 this.handleRender();
8950 },
8951
8952
8953 methods: {
8954 handleRender: function handleRender() {
8955 var targetWrapper = this.$refs.targetWrapper;
8956 var component = this.currentStory.component;
8957
8958 component = typeof component === 'function' ? component() : component;
8959 mountComponent(this.adapter, targetWrapper, component);
8960
8961 updateURL({
8962 title: this.currentStory.title + ' - ' + (this.config.title || 'Aimer'),
8963 story: this.currentStory.slug
8964 });
8965 },
8966 chooseTab: function chooseTab(tab) {
8967 this.currentTab = tab;
8968 }
8969 },
8970
8971 components: {
8972 Icons: __WEBPACK_IMPORTED_MODULE_1__components_Icons_vue__["a" /* default */]
8973 }
8974});
8975
8976/***/ }),
8977/* 17 */
8978/*!*******************************************!*\
8979 !*** ./node_modules/nanoquery/browser.js ***!
8980 \*******************************************/
8981/*! dynamic exports provided */
8982/*! exports used: default */
8983/***/ (function(module, exports, __webpack_require__) {
8984
8985var reg = new RegExp('([^?=&]+)(=([^&]*))?', 'g')
8986var assert = __webpack_require__(/*! assert */ 18)
8987
8988module.exports = qs
8989
8990function qs (url) {
8991 assert.equal(typeof url, 'string', 'nanoquery: url should be type string')
8992 assert.ok(typeof window !== 'undefined', 'nanoquery: expected window to exist')
8993
8994 var obj = {}
8995 url.replace(/^.*\?/, '').replace(reg, function (a0, a1, a2, a3) {
8996 obj[window.decodeURIComponent(a1)] = window.decodeURIComponent(a3)
8997 })
8998
8999 return obj
9000}
9001
9002
9003/***/ }),
9004/* 18 */
9005/*!***************************************!*\
9006 !*** ./node_modules/assert/assert.js ***!
9007 \***************************************/
9008/*! dynamic exports provided */
9009/*! all exports used */
9010/***/ (function(module, exports, __webpack_require__) {
9011
9012"use strict";
9013/* WEBPACK VAR INJECTION */(function(global) {
9014
9015// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js
9016// original notice:
9017
9018/*!
9019 * The buffer module from node.js, for the browser.
9020 *
9021 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
9022 * @license MIT
9023 */
9024function compare(a, b) {
9025 if (a === b) {
9026 return 0;
9027 }
9028
9029 var x = a.length;
9030 var y = b.length;
9031
9032 for (var i = 0, len = Math.min(x, y); i < len; ++i) {
9033 if (a[i] !== b[i]) {
9034 x = a[i];
9035 y = b[i];
9036 break;
9037 }
9038 }
9039
9040 if (x < y) {
9041 return -1;
9042 }
9043 if (y < x) {
9044 return 1;
9045 }
9046 return 0;
9047}
9048function isBuffer(b) {
9049 if (global.Buffer && typeof global.Buffer.isBuffer === 'function') {
9050 return global.Buffer.isBuffer(b);
9051 }
9052 return !!(b != null && b._isBuffer);
9053}
9054
9055// based on node assert, original notice:
9056
9057// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
9058//
9059// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
9060//
9061// Originally from narwhal.js (http://narwhaljs.org)
9062// Copyright (c) 2009 Thomas Robinson <280north.com>
9063//
9064// Permission is hereby granted, free of charge, to any person obtaining a copy
9065// of this software and associated documentation files (the 'Software'), to
9066// deal in the Software without restriction, including without limitation the
9067// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9068// sell copies of the Software, and to permit persons to whom the Software is
9069// furnished to do so, subject to the following conditions:
9070//
9071// The above copyright notice and this permission notice shall be included in
9072// all copies or substantial portions of the Software.
9073//
9074// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9075// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9076// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
9077// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
9078// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
9079// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9080
9081var util = __webpack_require__(/*! util/ */ 19);
9082var hasOwn = Object.prototype.hasOwnProperty;
9083var pSlice = Array.prototype.slice;
9084var functionsHaveNames = (function () {
9085 return function foo() {}.name === 'foo';
9086}());
9087function pToString (obj) {
9088 return Object.prototype.toString.call(obj);
9089}
9090function isView(arrbuf) {
9091 if (isBuffer(arrbuf)) {
9092 return false;
9093 }
9094 if (typeof global.ArrayBuffer !== 'function') {
9095 return false;
9096 }
9097 if (typeof ArrayBuffer.isView === 'function') {
9098 return ArrayBuffer.isView(arrbuf);
9099 }
9100 if (!arrbuf) {
9101 return false;
9102 }
9103 if (arrbuf instanceof DataView) {
9104 return true;
9105 }
9106 if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {
9107 return true;
9108 }
9109 return false;
9110}
9111// 1. The assert module provides functions that throw
9112// AssertionError's when particular conditions are not met. The
9113// assert module must conform to the following interface.
9114
9115var assert = module.exports = ok;
9116
9117// 2. The AssertionError is defined in assert.
9118// new assert.AssertionError({ message: message,
9119// actual: actual,
9120// expected: expected })
9121
9122var regex = /\s*function\s+([^\(\s]*)\s*/;
9123// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js
9124function getName(func) {
9125 if (!util.isFunction(func)) {
9126 return;
9127 }
9128 if (functionsHaveNames) {
9129 return func.name;
9130 }
9131 var str = func.toString();
9132 var match = str.match(regex);
9133 return match && match[1];
9134}
9135assert.AssertionError = function AssertionError(options) {
9136 this.name = 'AssertionError';
9137 this.actual = options.actual;
9138 this.expected = options.expected;
9139 this.operator = options.operator;
9140 if (options.message) {
9141 this.message = options.message;
9142 this.generatedMessage = false;
9143 } else {
9144 this.message = getMessage(this);
9145 this.generatedMessage = true;
9146 }
9147 var stackStartFunction = options.stackStartFunction || fail;
9148 if (Error.captureStackTrace) {
9149 Error.captureStackTrace(this, stackStartFunction);
9150 } else {
9151 // non v8 browsers so we can have a stacktrace
9152 var err = new Error();
9153 if (err.stack) {
9154 var out = err.stack;
9155
9156 // try to strip useless frames
9157 var fn_name = getName(stackStartFunction);
9158 var idx = out.indexOf('\n' + fn_name);
9159 if (idx >= 0) {
9160 // once we have located the function frame
9161 // we need to strip out everything before it (and its line)
9162 var next_line = out.indexOf('\n', idx + 1);
9163 out = out.substring(next_line + 1);
9164 }
9165
9166 this.stack = out;
9167 }
9168 }
9169};
9170
9171// assert.AssertionError instanceof Error
9172util.inherits(assert.AssertionError, Error);
9173
9174function truncate(s, n) {
9175 if (typeof s === 'string') {
9176 return s.length < n ? s : s.slice(0, n);
9177 } else {
9178 return s;
9179 }
9180}
9181function inspect(something) {
9182 if (functionsHaveNames || !util.isFunction(something)) {
9183 return util.inspect(something);
9184 }
9185 var rawname = getName(something);
9186 var name = rawname ? ': ' + rawname : '';
9187 return '[Function' + name + ']';
9188}
9189function getMessage(self) {
9190 return truncate(inspect(self.actual), 128) + ' ' +
9191 self.operator + ' ' +
9192 truncate(inspect(self.expected), 128);
9193}
9194
9195// At present only the three keys mentioned above are used and
9196// understood by the spec. Implementations or sub modules can pass
9197// other keys to the AssertionError's constructor - they will be
9198// ignored.
9199
9200// 3. All of the following functions must throw an AssertionError
9201// when a corresponding condition is not met, with a message that
9202// may be undefined if not provided. All assertion methods provide
9203// both the actual and expected values to the assertion error for
9204// display purposes.
9205
9206function fail(actual, expected, message, operator, stackStartFunction) {
9207 throw new assert.AssertionError({
9208 message: message,
9209 actual: actual,
9210 expected: expected,
9211 operator: operator,
9212 stackStartFunction: stackStartFunction
9213 });
9214}
9215
9216// EXTENSION! allows for well behaved errors defined elsewhere.
9217assert.fail = fail;
9218
9219// 4. Pure assertion tests whether a value is truthy, as determined
9220// by !!guard.
9221// assert.ok(guard, message_opt);
9222// This statement is equivalent to assert.equal(true, !!guard,
9223// message_opt);. To test strictly for the value true, use
9224// assert.strictEqual(true, guard, message_opt);.
9225
9226function ok(value, message) {
9227 if (!value) fail(value, true, message, '==', assert.ok);
9228}
9229assert.ok = ok;
9230
9231// 5. The equality assertion tests shallow, coercive equality with
9232// ==.
9233// assert.equal(actual, expected, message_opt);
9234
9235assert.equal = function equal(actual, expected, message) {
9236 if (actual != expected) fail(actual, expected, message, '==', assert.equal);
9237};
9238
9239// 6. The non-equality assertion tests for whether two objects are not equal
9240// with != assert.notEqual(actual, expected, message_opt);
9241
9242assert.notEqual = function notEqual(actual, expected, message) {
9243 if (actual == expected) {
9244 fail(actual, expected, message, '!=', assert.notEqual);
9245 }
9246};
9247
9248// 7. The equivalence assertion tests a deep equality relation.
9249// assert.deepEqual(actual, expected, message_opt);
9250
9251assert.deepEqual = function deepEqual(actual, expected, message) {
9252 if (!_deepEqual(actual, expected, false)) {
9253 fail(actual, expected, message, 'deepEqual', assert.deepEqual);
9254 }
9255};
9256
9257assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
9258 if (!_deepEqual(actual, expected, true)) {
9259 fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);
9260 }
9261};
9262
9263function _deepEqual(actual, expected, strict, memos) {
9264 // 7.1. All identical values are equivalent, as determined by ===.
9265 if (actual === expected) {
9266 return true;
9267 } else if (isBuffer(actual) && isBuffer(expected)) {
9268 return compare(actual, expected) === 0;
9269
9270 // 7.2. If the expected value is a Date object, the actual value is
9271 // equivalent if it is also a Date object that refers to the same time.
9272 } else if (util.isDate(actual) && util.isDate(expected)) {
9273 return actual.getTime() === expected.getTime();
9274
9275 // 7.3 If the expected value is a RegExp object, the actual value is
9276 // equivalent if it is also a RegExp object with the same source and
9277 // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
9278 } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
9279 return actual.source === expected.source &&
9280 actual.global === expected.global &&
9281 actual.multiline === expected.multiline &&
9282 actual.lastIndex === expected.lastIndex &&
9283 actual.ignoreCase === expected.ignoreCase;
9284
9285 // 7.4. Other pairs that do not both pass typeof value == 'object',
9286 // equivalence is determined by ==.
9287 } else if ((actual === null || typeof actual !== 'object') &&
9288 (expected === null || typeof expected !== 'object')) {
9289 return strict ? actual === expected : actual == expected;
9290
9291 // If both values are instances of typed arrays, wrap their underlying
9292 // ArrayBuffers in a Buffer each to increase performance
9293 // This optimization requires the arrays to have the same type as checked by
9294 // Object.prototype.toString (aka pToString). Never perform binary
9295 // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their
9296 // bit patterns are not identical.
9297 } else if (isView(actual) && isView(expected) &&
9298 pToString(actual) === pToString(expected) &&
9299 !(actual instanceof Float32Array ||
9300 actual instanceof Float64Array)) {
9301 return compare(new Uint8Array(actual.buffer),
9302 new Uint8Array(expected.buffer)) === 0;
9303
9304 // 7.5 For all other Object pairs, including Array objects, equivalence is
9305 // determined by having the same number of owned properties (as verified
9306 // with Object.prototype.hasOwnProperty.call), the same set of keys
9307 // (although not necessarily the same order), equivalent values for every
9308 // corresponding key, and an identical 'prototype' property. Note: this
9309 // accounts for both named and indexed properties on Arrays.
9310 } else if (isBuffer(actual) !== isBuffer(expected)) {
9311 return false;
9312 } else {
9313 memos = memos || {actual: [], expected: []};
9314
9315 var actualIndex = memos.actual.indexOf(actual);
9316 if (actualIndex !== -1) {
9317 if (actualIndex === memos.expected.indexOf(expected)) {
9318 return true;
9319 }
9320 }
9321
9322 memos.actual.push(actual);
9323 memos.expected.push(expected);
9324
9325 return objEquiv(actual, expected, strict, memos);
9326 }
9327}
9328
9329function isArguments(object) {
9330 return Object.prototype.toString.call(object) == '[object Arguments]';
9331}
9332
9333function objEquiv(a, b, strict, actualVisitedObjects) {
9334 if (a === null || a === undefined || b === null || b === undefined)
9335 return false;
9336 // if one is a primitive, the other must be same
9337 if (util.isPrimitive(a) || util.isPrimitive(b))
9338 return a === b;
9339 if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
9340 return false;
9341 var aIsArgs = isArguments(a);
9342 var bIsArgs = isArguments(b);
9343 if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
9344 return false;
9345 if (aIsArgs) {
9346 a = pSlice.call(a);
9347 b = pSlice.call(b);
9348 return _deepEqual(a, b, strict);
9349 }
9350 var ka = objectKeys(a);
9351 var kb = objectKeys(b);
9352 var key, i;
9353 // having the same number of owned properties (keys incorporates
9354 // hasOwnProperty)
9355 if (ka.length !== kb.length)
9356 return false;
9357 //the same set of keys (although not necessarily the same order),
9358 ka.sort();
9359 kb.sort();
9360 //~~~cheap key test
9361 for (i = ka.length - 1; i >= 0; i--) {
9362 if (ka[i] !== kb[i])
9363 return false;
9364 }
9365 //equivalent values for every corresponding key, and
9366 //~~~possibly expensive deep test
9367 for (i = ka.length - 1; i >= 0; i--) {
9368 key = ka[i];
9369 if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))
9370 return false;
9371 }
9372 return true;
9373}
9374
9375// 8. The non-equivalence assertion tests for any deep inequality.
9376// assert.notDeepEqual(actual, expected, message_opt);
9377
9378assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
9379 if (_deepEqual(actual, expected, false)) {
9380 fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
9381 }
9382};
9383
9384assert.notDeepStrictEqual = notDeepStrictEqual;
9385function notDeepStrictEqual(actual, expected, message) {
9386 if (_deepEqual(actual, expected, true)) {
9387 fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
9388 }
9389}
9390
9391
9392// 9. The strict equality assertion tests strict equality, as determined by ===.
9393// assert.strictEqual(actual, expected, message_opt);
9394
9395assert.strictEqual = function strictEqual(actual, expected, message) {
9396 if (actual !== expected) {
9397 fail(actual, expected, message, '===', assert.strictEqual);
9398 }
9399};
9400
9401// 10. The strict non-equality assertion tests for strict inequality, as
9402// determined by !==. assert.notStrictEqual(actual, expected, message_opt);
9403
9404assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
9405 if (actual === expected) {
9406 fail(actual, expected, message, '!==', assert.notStrictEqual);
9407 }
9408};
9409
9410function expectedException(actual, expected) {
9411 if (!actual || !expected) {
9412 return false;
9413 }
9414
9415 if (Object.prototype.toString.call(expected) == '[object RegExp]') {
9416 return expected.test(actual);
9417 }
9418
9419 try {
9420 if (actual instanceof expected) {
9421 return true;
9422 }
9423 } catch (e) {
9424 // Ignore. The instanceof check doesn't work for arrow functions.
9425 }
9426
9427 if (Error.isPrototypeOf(expected)) {
9428 return false;
9429 }
9430
9431 return expected.call({}, actual) === true;
9432}
9433
9434function _tryBlock(block) {
9435 var error;
9436 try {
9437 block();
9438 } catch (e) {
9439 error = e;
9440 }
9441 return error;
9442}
9443
9444function _throws(shouldThrow, block, expected, message) {
9445 var actual;
9446
9447 if (typeof block !== 'function') {
9448 throw new TypeError('"block" argument must be a function');
9449 }
9450
9451 if (typeof expected === 'string') {
9452 message = expected;
9453 expected = null;
9454 }
9455
9456 actual = _tryBlock(block);
9457
9458 message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
9459 (message ? ' ' + message : '.');
9460
9461 if (shouldThrow && !actual) {
9462 fail(actual, expected, 'Missing expected exception' + message);
9463 }
9464
9465 var userProvidedMessage = typeof message === 'string';
9466 var isUnwantedException = !shouldThrow && util.isError(actual);
9467 var isUnexpectedException = !shouldThrow && actual && !expected;
9468
9469 if ((isUnwantedException &&
9470 userProvidedMessage &&
9471 expectedException(actual, expected)) ||
9472 isUnexpectedException) {
9473 fail(actual, expected, 'Got unwanted exception' + message);
9474 }
9475
9476 if ((shouldThrow && actual && expected &&
9477 !expectedException(actual, expected)) || (!shouldThrow && actual)) {
9478 throw actual;
9479 }
9480}
9481
9482// 11. Expected to throw an error:
9483// assert.throws(block, Error_opt, message_opt);
9484
9485assert.throws = function(block, /*optional*/error, /*optional*/message) {
9486 _throws(true, block, error, message);
9487};
9488
9489// EXTENSION! This is annoying to write outside this module.
9490assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
9491 _throws(false, block, error, message);
9492};
9493
9494assert.ifError = function(err) { if (err) throw err; };
9495
9496var objectKeys = Object.keys || function (obj) {
9497 var keys = [];
9498 for (var key in obj) {
9499 if (hasOwn.call(obj, key)) keys.push(key);
9500 }
9501 return keys;
9502};
9503
9504/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../webpack/buildin/global.js */ 0)))
9505
9506/***/ }),
9507/* 19 */
9508/*!***********************************!*\
9509 !*** ./node_modules/util/util.js ***!
9510 \***********************************/
9511/*! dynamic exports provided */
9512/*! all exports used */
9513/***/ (function(module, exports, __webpack_require__) {
9514
9515/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
9516//
9517// Permission is hereby granted, free of charge, to any person obtaining a
9518// copy of this software and associated documentation files (the
9519// "Software"), to deal in the Software without restriction, including
9520// without limitation the rights to use, copy, modify, merge, publish,
9521// distribute, sublicense, and/or sell copies of the Software, and to permit
9522// persons to whom the Software is furnished to do so, subject to the
9523// following conditions:
9524//
9525// The above copyright notice and this permission notice shall be included
9526// in all copies or substantial portions of the Software.
9527//
9528// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9529// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9530// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
9531// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
9532// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
9533// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
9534// USE OR OTHER DEALINGS IN THE SOFTWARE.
9535
9536var formatRegExp = /%[sdj%]/g;
9537exports.format = function(f) {
9538 if (!isString(f)) {
9539 var objects = [];
9540 for (var i = 0; i < arguments.length; i++) {
9541 objects.push(inspect(arguments[i]));
9542 }
9543 return objects.join(' ');
9544 }
9545
9546 var i = 1;
9547 var args = arguments;
9548 var len = args.length;
9549 var str = String(f).replace(formatRegExp, function(x) {
9550 if (x === '%%') return '%';
9551 if (i >= len) return x;
9552 switch (x) {
9553 case '%s': return String(args[i++]);
9554 case '%d': return Number(args[i++]);
9555 case '%j':
9556 try {
9557 return JSON.stringify(args[i++]);
9558 } catch (_) {
9559 return '[Circular]';
9560 }
9561 default:
9562 return x;
9563 }
9564 });
9565 for (var x = args[i]; i < len; x = args[++i]) {
9566 if (isNull(x) || !isObject(x)) {
9567 str += ' ' + x;
9568 } else {
9569 str += ' ' + inspect(x);
9570 }
9571 }
9572 return str;
9573};
9574
9575
9576// Mark that a method should not be used.
9577// Returns a modified function which warns once by default.
9578// If --no-deprecation is set, then it is a no-op.
9579exports.deprecate = function(fn, msg) {
9580 // Allow for deprecating things in the process of starting up.
9581 if (isUndefined(global.process)) {
9582 return function() {
9583 return exports.deprecate(fn, msg).apply(this, arguments);
9584 };
9585 }
9586
9587 if (process.noDeprecation === true) {
9588 return fn;
9589 }
9590
9591 var warned = false;
9592 function deprecated() {
9593 if (!warned) {
9594 if (process.throwDeprecation) {
9595 throw new Error(msg);
9596 } else if (process.traceDeprecation) {
9597 console.trace(msg);
9598 } else {
9599 console.error(msg);
9600 }
9601 warned = true;
9602 }
9603 return fn.apply(this, arguments);
9604 }
9605
9606 return deprecated;
9607};
9608
9609
9610var debugs = {};
9611var debugEnviron;
9612exports.debuglog = function(set) {
9613 if (isUndefined(debugEnviron))
9614 debugEnviron = process.env.NODE_DEBUG || '';
9615 set = set.toUpperCase();
9616 if (!debugs[set]) {
9617 if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
9618 var pid = process.pid;
9619 debugs[set] = function() {
9620 var msg = exports.format.apply(exports, arguments);
9621 console.error('%s %d: %s', set, pid, msg);
9622 };
9623 } else {
9624 debugs[set] = function() {};
9625 }
9626 }
9627 return debugs[set];
9628};
9629
9630
9631/**
9632 * Echos the value of a value. Trys to print the value out
9633 * in the best way possible given the different types.
9634 *
9635 * @param {Object} obj The object to print out.
9636 * @param {Object} opts Optional options object that alters the output.
9637 */
9638/* legacy: obj, showHidden, depth, colors*/
9639function inspect(obj, opts) {
9640 // default options
9641 var ctx = {
9642 seen: [],
9643 stylize: stylizeNoColor
9644 };
9645 // legacy...
9646 if (arguments.length >= 3) ctx.depth = arguments[2];
9647 if (arguments.length >= 4) ctx.colors = arguments[3];
9648 if (isBoolean(opts)) {
9649 // legacy...
9650 ctx.showHidden = opts;
9651 } else if (opts) {
9652 // got an "options" object
9653 exports._extend(ctx, opts);
9654 }
9655 // set default options
9656 if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
9657 if (isUndefined(ctx.depth)) ctx.depth = 2;
9658 if (isUndefined(ctx.colors)) ctx.colors = false;
9659 if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
9660 if (ctx.colors) ctx.stylize = stylizeWithColor;
9661 return formatValue(ctx, obj, ctx.depth);
9662}
9663exports.inspect = inspect;
9664
9665
9666// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
9667inspect.colors = {
9668 'bold' : [1, 22],
9669 'italic' : [3, 23],
9670 'underline' : [4, 24],
9671 'inverse' : [7, 27],
9672 'white' : [37, 39],
9673 'grey' : [90, 39],
9674 'black' : [30, 39],
9675 'blue' : [34, 39],
9676 'cyan' : [36, 39],
9677 'green' : [32, 39],
9678 'magenta' : [35, 39],
9679 'red' : [31, 39],
9680 'yellow' : [33, 39]
9681};
9682
9683// Don't use 'blue' not visible on cmd.exe
9684inspect.styles = {
9685 'special': 'cyan',
9686 'number': 'yellow',
9687 'boolean': 'yellow',
9688 'undefined': 'grey',
9689 'null': 'bold',
9690 'string': 'green',
9691 'date': 'magenta',
9692 // "name": intentionally not styling
9693 'regexp': 'red'
9694};
9695
9696
9697function stylizeWithColor(str, styleType) {
9698 var style = inspect.styles[styleType];
9699
9700 if (style) {
9701 return '\u001b[' + inspect.colors[style][0] + 'm' + str +
9702 '\u001b[' + inspect.colors[style][1] + 'm';
9703 } else {
9704 return str;
9705 }
9706}
9707
9708
9709function stylizeNoColor(str, styleType) {
9710 return str;
9711}
9712
9713
9714function arrayToHash(array) {
9715 var hash = {};
9716
9717 array.forEach(function(val, idx) {
9718 hash[val] = true;
9719 });
9720
9721 return hash;
9722}
9723
9724
9725function formatValue(ctx, value, recurseTimes) {
9726 // Provide a hook for user-specified inspect functions.
9727 // Check that value is an object with an inspect function on it
9728 if (ctx.customInspect &&
9729 value &&
9730 isFunction(value.inspect) &&
9731 // Filter out the util module, it's inspect function is special
9732 value.inspect !== exports.inspect &&
9733 // Also filter out any prototype objects using the circular check.
9734 !(value.constructor && value.constructor.prototype === value)) {
9735 var ret = value.inspect(recurseTimes, ctx);
9736 if (!isString(ret)) {
9737 ret = formatValue(ctx, ret, recurseTimes);
9738 }
9739 return ret;
9740 }
9741
9742 // Primitive types cannot have properties
9743 var primitive = formatPrimitive(ctx, value);
9744 if (primitive) {
9745 return primitive;
9746 }
9747
9748 // Look up the keys of the object.
9749 var keys = Object.keys(value);
9750 var visibleKeys = arrayToHash(keys);
9751
9752 if (ctx.showHidden) {
9753 keys = Object.getOwnPropertyNames(value);
9754 }
9755
9756 // IE doesn't make error fields non-enumerable
9757 // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
9758 if (isError(value)
9759 && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
9760 return formatError(value);
9761 }
9762
9763 // Some type of object without properties can be shortcutted.
9764 if (keys.length === 0) {
9765 if (isFunction(value)) {
9766 var name = value.name ? ': ' + value.name : '';
9767 return ctx.stylize('[Function' + name + ']', 'special');
9768 }
9769 if (isRegExp(value)) {
9770 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
9771 }
9772 if (isDate(value)) {
9773 return ctx.stylize(Date.prototype.toString.call(value), 'date');
9774 }
9775 if (isError(value)) {
9776 return formatError(value);
9777 }
9778 }
9779
9780 var base = '', array = false, braces = ['{', '}'];
9781
9782 // Make Array say that they are Array
9783 if (isArray(value)) {
9784 array = true;
9785 braces = ['[', ']'];
9786 }
9787
9788 // Make functions say that they are functions
9789 if (isFunction(value)) {
9790 var n = value.name ? ': ' + value.name : '';
9791 base = ' [Function' + n + ']';
9792 }
9793
9794 // Make RegExps say that they are RegExps
9795 if (isRegExp(value)) {
9796 base = ' ' + RegExp.prototype.toString.call(value);
9797 }
9798
9799 // Make dates with properties first say the date
9800 if (isDate(value)) {
9801 base = ' ' + Date.prototype.toUTCString.call(value);
9802 }
9803
9804 // Make error with message first say the error
9805 if (isError(value)) {
9806 base = ' ' + formatError(value);
9807 }
9808
9809 if (keys.length === 0 && (!array || value.length == 0)) {
9810 return braces[0] + base + braces[1];
9811 }
9812
9813 if (recurseTimes < 0) {
9814 if (isRegExp(value)) {
9815 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
9816 } else {
9817 return ctx.stylize('[Object]', 'special');
9818 }
9819 }
9820
9821 ctx.seen.push(value);
9822
9823 var output;
9824 if (array) {
9825 output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
9826 } else {
9827 output = keys.map(function(key) {
9828 return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
9829 });
9830 }
9831
9832 ctx.seen.pop();
9833
9834 return reduceToSingleString(output, base, braces);
9835}
9836
9837
9838function formatPrimitive(ctx, value) {
9839 if (isUndefined(value))
9840 return ctx.stylize('undefined', 'undefined');
9841 if (isString(value)) {
9842 var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
9843 .replace(/'/g, "\\'")
9844 .replace(/\\"/g, '"') + '\'';
9845 return ctx.stylize(simple, 'string');
9846 }
9847 if (isNumber(value))
9848 return ctx.stylize('' + value, 'number');
9849 if (isBoolean(value))
9850 return ctx.stylize('' + value, 'boolean');
9851 // For some reason typeof null is "object", so special case here.
9852 if (isNull(value))
9853 return ctx.stylize('null', 'null');
9854}
9855
9856
9857function formatError(value) {
9858 return '[' + Error.prototype.toString.call(value) + ']';
9859}
9860
9861
9862function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
9863 var output = [];
9864 for (var i = 0, l = value.length; i < l; ++i) {
9865 if (hasOwnProperty(value, String(i))) {
9866 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
9867 String(i), true));
9868 } else {
9869 output.push('');
9870 }
9871 }
9872 keys.forEach(function(key) {
9873 if (!key.match(/^\d+$/)) {
9874 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
9875 key, true));
9876 }
9877 });
9878 return output;
9879}
9880
9881
9882function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
9883 var name, str, desc;
9884 desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
9885 if (desc.get) {
9886 if (desc.set) {
9887 str = ctx.stylize('[Getter/Setter]', 'special');
9888 } else {
9889 str = ctx.stylize('[Getter]', 'special');
9890 }
9891 } else {
9892 if (desc.set) {
9893 str = ctx.stylize('[Setter]', 'special');
9894 }
9895 }
9896 if (!hasOwnProperty(visibleKeys, key)) {
9897 name = '[' + key + ']';
9898 }
9899 if (!str) {
9900 if (ctx.seen.indexOf(desc.value) < 0) {
9901 if (isNull(recurseTimes)) {
9902 str = formatValue(ctx, desc.value, null);
9903 } else {
9904 str = formatValue(ctx, desc.value, recurseTimes - 1);
9905 }
9906 if (str.indexOf('\n') > -1) {
9907 if (array) {
9908 str = str.split('\n').map(function(line) {
9909 return ' ' + line;
9910 }).join('\n').substr(2);
9911 } else {
9912 str = '\n' + str.split('\n').map(function(line) {
9913 return ' ' + line;
9914 }).join('\n');
9915 }
9916 }
9917 } else {
9918 str = ctx.stylize('[Circular]', 'special');
9919 }
9920 }
9921 if (isUndefined(name)) {
9922 if (array && key.match(/^\d+$/)) {
9923 return str;
9924 }
9925 name = JSON.stringify('' + key);
9926 if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
9927 name = name.substr(1, name.length - 2);
9928 name = ctx.stylize(name, 'name');
9929 } else {
9930 name = name.replace(/'/g, "\\'")
9931 .replace(/\\"/g, '"')
9932 .replace(/(^"|"$)/g, "'");
9933 name = ctx.stylize(name, 'string');
9934 }
9935 }
9936
9937 return name + ': ' + str;
9938}
9939
9940
9941function reduceToSingleString(output, base, braces) {
9942 var numLinesEst = 0;
9943 var length = output.reduce(function(prev, cur) {
9944 numLinesEst++;
9945 if (cur.indexOf('\n') >= 0) numLinesEst++;
9946 return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
9947 }, 0);
9948
9949 if (length > 60) {
9950 return braces[0] +
9951 (base === '' ? '' : base + '\n ') +
9952 ' ' +
9953 output.join(',\n ') +
9954 ' ' +
9955 braces[1];
9956 }
9957
9958 return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
9959}
9960
9961
9962// NOTE: These type checking functions intentionally don't use `instanceof`
9963// because it is fragile and can be easily faked with `Object.create()`.
9964function isArray(ar) {
9965 return Array.isArray(ar);
9966}
9967exports.isArray = isArray;
9968
9969function isBoolean(arg) {
9970 return typeof arg === 'boolean';
9971}
9972exports.isBoolean = isBoolean;
9973
9974function isNull(arg) {
9975 return arg === null;
9976}
9977exports.isNull = isNull;
9978
9979function isNullOrUndefined(arg) {
9980 return arg == null;
9981}
9982exports.isNullOrUndefined = isNullOrUndefined;
9983
9984function isNumber(arg) {
9985 return typeof arg === 'number';
9986}
9987exports.isNumber = isNumber;
9988
9989function isString(arg) {
9990 return typeof arg === 'string';
9991}
9992exports.isString = isString;
9993
9994function isSymbol(arg) {
9995 return typeof arg === 'symbol';
9996}
9997exports.isSymbol = isSymbol;
9998
9999function isUndefined(arg) {
10000 return arg === void 0;
10001}
10002exports.isUndefined = isUndefined;
10003
10004function isRegExp(re) {
10005 return isObject(re) && objectToString(re) === '[object RegExp]';
10006}
10007exports.isRegExp = isRegExp;
10008
10009function isObject(arg) {
10010 return typeof arg === 'object' && arg !== null;
10011}
10012exports.isObject = isObject;
10013
10014function isDate(d) {
10015 return isObject(d) && objectToString(d) === '[object Date]';
10016}
10017exports.isDate = isDate;
10018
10019function isError(e) {
10020 return isObject(e) &&
10021 (objectToString(e) === '[object Error]' || e instanceof Error);
10022}
10023exports.isError = isError;
10024
10025function isFunction(arg) {
10026 return typeof arg === 'function';
10027}
10028exports.isFunction = isFunction;
10029
10030function isPrimitive(arg) {
10031 return arg === null ||
10032 typeof arg === 'boolean' ||
10033 typeof arg === 'number' ||
10034 typeof arg === 'string' ||
10035 typeof arg === 'symbol' || // ES6 symbol
10036 typeof arg === 'undefined';
10037}
10038exports.isPrimitive = isPrimitive;
10039
10040exports.isBuffer = __webpack_require__(/*! ./support/isBuffer */ 20);
10041
10042function objectToString(o) {
10043 return Object.prototype.toString.call(o);
10044}
10045
10046
10047function pad(n) {
10048 return n < 10 ? '0' + n.toString(10) : n.toString(10);
10049}
10050
10051
10052var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
10053 'Oct', 'Nov', 'Dec'];
10054
10055// 26 Feb 16:19:34
10056function timestamp() {
10057 var d = new Date();
10058 var time = [pad(d.getHours()),
10059 pad(d.getMinutes()),
10060 pad(d.getSeconds())].join(':');
10061 return [d.getDate(), months[d.getMonth()], time].join(' ');
10062}
10063
10064
10065// log is just a thin wrapper to console.log that prepends a timestamp
10066exports.log = function() {
10067 console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
10068};
10069
10070
10071/**
10072 * Inherit the prototype methods from one constructor into another.
10073 *
10074 * The Function.prototype.inherits from lang.js rewritten as a standalone
10075 * function (not on Function.prototype). NOTE: If this file is to be loaded
10076 * during bootstrapping this function needs to be rewritten using some native
10077 * functions as prototype setup using normal JavaScript does not work as
10078 * expected during bootstrapping (see mirror.js in r114903).
10079 *
10080 * @param {function} ctor Constructor function which needs to inherit the
10081 * prototype.
10082 * @param {function} superCtor Constructor function to inherit prototype from.
10083 */
10084exports.inherits = __webpack_require__(/*! inherits */ 21);
10085
10086exports._extend = function(origin, add) {
10087 // Don't do anything if add isn't an object
10088 if (!add || !isObject(add)) return origin;
10089
10090 var keys = Object.keys(add);
10091 var i = keys.length;
10092 while (i--) {
10093 origin[keys[i]] = add[keys[i]];
10094 }
10095 return origin;
10096};
10097
10098function hasOwnProperty(obj, prop) {
10099 return Object.prototype.hasOwnProperty.call(obj, prop);
10100}
10101
10102/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! ./../webpack/buildin/global.js */ 0), __webpack_require__(/*! ./../process/browser.js */ 2)))
10103
10104/***/ }),
10105/* 20 */
10106/*!******************************************************!*\
10107 !*** ./node_modules/util/support/isBufferBrowser.js ***!
10108 \******************************************************/
10109/*! dynamic exports provided */
10110/*! all exports used */
10111/***/ (function(module, exports) {
10112
10113module.exports = function isBuffer(arg) {
10114 return arg && typeof arg === 'object'
10115 && typeof arg.copy === 'function'
10116 && typeof arg.fill === 'function'
10117 && typeof arg.readUInt8 === 'function';
10118}
10119
10120/***/ }),
10121/* 21 */
10122/*!***************************************************!*\
10123 !*** ./node_modules/inherits/inherits_browser.js ***!
10124 \***************************************************/
10125/*! dynamic exports provided */
10126/*! all exports used */
10127/***/ (function(module, exports) {
10128
10129if (typeof Object.create === 'function') {
10130 // implementation from standard node.js 'util' module
10131 module.exports = function inherits(ctor, superCtor) {
10132 ctor.super_ = superCtor
10133 ctor.prototype = Object.create(superCtor.prototype, {
10134 constructor: {
10135 value: ctor,
10136 enumerable: false,
10137 writable: true,
10138 configurable: true
10139 }
10140 });
10141 };
10142} else {
10143 // old school shim for old browsers
10144 module.exports = function inherits(ctor, superCtor) {
10145 ctor.super_ = superCtor
10146 var TempCtor = function () {}
10147 TempCtor.prototype = superCtor.prototype
10148 ctor.prototype = new TempCtor()
10149 ctor.prototype.constructor = ctor
10150 }
10151}
10152
10153
10154/***/ }),
10155/* 22 */
10156/*!**********************************!*\
10157 !*** ./src/components/Icons.vue ***!
10158 \**********************************/
10159/*! exports provided: default */
10160/*! exports used: default */
10161/***/ (function(module, __webpack_exports__, __webpack_require__) {
10162
10163"use strict";
10164/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_cacheDirectory_true_babelrc_false_presets_Users_egoist_dev_aimer_packages_aimer_node_modules_babel_preset_vue_app_dist_index_common_js_useBuiltIns_true_node_modules_vue_loader_lib_selector_type_script_index_0_Icons_vue__ = __webpack_require__(/*! !babel-loader?{"cacheDirectory":true,"babelrc":false,"presets":[["/Users/egoist/dev/aimer/packages/aimer/node_modules/babel-preset-vue-app/dist/index.common.js",{"useBuiltIns":true}]]}!../../node_modules/vue-loader/lib/selector?type=script&index=0!./Icons.vue */ 24);
10165/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_15140f52_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Icons_vue__ = __webpack_require__(/*! !../../node_modules/vue-loader/lib/template-compiler/index?{"id":"data-v-15140f52","hasScoped":false,"buble":{"transforms":{}}}!../../node_modules/vue-loader/lib/selector?type=template&index=0!./Icons.vue */ 27);
10166function injectStyle (ssrContext) {
10167 __webpack_require__(/*! !../../node_modules/extract-text-webpack-plugin/dist/loader.js?{"omit":1,"remove":true}!vue-style-loader!css-loader?{"autoprefixer":false,"sourceMap":false,"minimize":false}!../../node_modules/vue-loader/lib/style-compiler/index?{"vue":true,"id":"data-v-15140f52","scoped":false,"hasInlineConfig":true}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./Icons.vue */ 23)
10168}
10169var normalizeComponent = __webpack_require__(/*! ../../node_modules/vue-loader/lib/component-normalizer */ 3)
10170/* script */
10171
10172/* template */
10173
10174/* template functional */
10175 var __vue_template_functional__ = false
10176/* styles */
10177var __vue_styles__ = injectStyle
10178/* scopeId */
10179var __vue_scopeId__ = null
10180/* moduleIdentifier (server only) */
10181var __vue_module_identifier__ = null
10182var Component = normalizeComponent(
10183 __WEBPACK_IMPORTED_MODULE_0__babel_loader_cacheDirectory_true_babelrc_false_presets_Users_egoist_dev_aimer_packages_aimer_node_modules_babel_preset_vue_app_dist_index_common_js_useBuiltIns_true_node_modules_vue_loader_lib_selector_type_script_index_0_Icons_vue__["a" /* default */],
10184 __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_15140f52_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Icons_vue__["a" /* default */],
10185 __vue_template_functional__,
10186 __vue_styles__,
10187 __vue_scopeId__,
10188 __vue_module_identifier__
10189)
10190
10191/* harmony default export */ __webpack_exports__["a"] = (Component.exports);
10192
10193
10194/***/ }),
10195/* 23 */
10196/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
10197 !*** ./node_modules/extract-text-webpack-plugin/dist/loader.js?{"omit":1,"remove":true}!./node_modules/vue-style-loader!./node_modules/css-loader?{"autoprefixer":false,"sourceMap":false,"minimize":false}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-15140f52","scoped":false,"hasInlineConfig":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/Icons.vue ***!
10198 \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
10199/*! dynamic exports provided */
10200/*! all exports used */
10201/***/ (function(module, exports) {
10202
10203// removed by extract-text-webpack-plugin
10204
10205/***/ }),
10206/* 24 */
10207/*!***********************************************************************************************************************************************************************************************************************************************************************************************************!*\
10208 !*** ./node_modules/babel-loader/lib?{"cacheDirectory":true,"babelrc":false,"presets":[["/Users/egoist/dev/aimer/packages/aimer/node_modules/babel-preset-vue-app/dist/index.common.js",{"useBuiltIns":true}]]}!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/components/Icons.vue ***!
10209 \***********************************************************************************************************************************************************************************************************************************************************************************************************/
10210/*! exports provided: default */
10211/*! exports used: default */
10212/***/ (function(module, __webpack_exports__, __webpack_require__) {
10213
10214"use strict";
10215/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__svg_to_component_loader_svg_github_svg__ = __webpack_require__(/*! svg-to-component-loader!../svg/github.svg */ 25);
10216/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__svg_to_component_loader_svg_twitter_svg__ = __webpack_require__(/*! svg-to-component-loader!../svg/twitter.svg */ 26);
10217//
10218//
10219//
10220//
10221//
10222//
10223//
10224//
10225//
10226//
10227//
10228
10229
10230
10231
10232/* harmony default export */ __webpack_exports__["a"] = ({
10233 props: {
10234 github: String,
10235 twitter: String
10236 },
10237
10238 methods: {
10239 getUrl: function getUrl(url, domain) {
10240 return (/^https?:/.test(url) ? url : 'https://' + domain + '/' + url
10241 );
10242 }
10243 },
10244
10245 components: {
10246 GitHub: __WEBPACK_IMPORTED_MODULE_0__svg_to_component_loader_svg_github_svg__["a" /* default */],
10247 Twitter: __WEBPACK_IMPORTED_MODULE_1__svg_to_component_loader_svg_twitter_svg__["a" /* default */]
10248 }
10249});
10250
10251/***/ }),
10252/* 25 */
10253/*!*******************************************************************!*\
10254 !*** ./node_modules/svg-to-component-loader!./src/svg/github.svg ***!
10255 \*******************************************************************/
10256/*! exports provided: default */
10257/*! exports used: default */
10258/***/ (function(module, __webpack_exports__, __webpack_require__) {
10259
10260"use strict";
10261/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_helper_vue_jsx_merge_props__ = __webpack_require__(/*! babel-helper-vue-jsx-merge-props */ 4);
10262/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_helper_vue_jsx_merge_props___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_helper_vue_jsx_merge_props__);
10263
10264/* harmony default export */ __webpack_exports__["a"] = ({
10265 name: 'Github',
10266 functional: true,
10267 render: function (h, ctx) {
10268 return h(
10269 "svg",
10270 __WEBPACK_IMPORTED_MODULE_0_babel_helper_vue_jsx_merge_props___default()([{
10271 attrs: { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" },
10272 "class": "feather feather-github" }, ctx.data]),
10273 [h(
10274 "path",
10275 {
10276 attrs: { d: "M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22" }
10277 },
10278 []
10279 )]
10280 );
10281 }
10282});
10283
10284/***/ }),
10285/* 26 */
10286/*!********************************************************************!*\
10287 !*** ./node_modules/svg-to-component-loader!./src/svg/twitter.svg ***!
10288 \********************************************************************/
10289/*! exports provided: default */
10290/*! exports used: default */
10291/***/ (function(module, __webpack_exports__, __webpack_require__) {
10292
10293"use strict";
10294/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_helper_vue_jsx_merge_props__ = __webpack_require__(/*! babel-helper-vue-jsx-merge-props */ 4);
10295/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_babel_helper_vue_jsx_merge_props___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_babel_helper_vue_jsx_merge_props__);
10296
10297/* harmony default export */ __webpack_exports__["a"] = ({
10298 name: 'Twitter',
10299 functional: true,
10300 render: function (h, ctx) {
10301 return h(
10302 "svg",
10303 __WEBPACK_IMPORTED_MODULE_0_babel_helper_vue_jsx_merge_props___default()([{
10304 attrs: { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" },
10305 "class": "feather feather-twitter" }, ctx.data]),
10306 [h(
10307 "path",
10308 {
10309 attrs: { d: "M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z" }
10310 },
10311 []
10312 )]
10313 );
10314 }
10315});
10316
10317/***/ }),
10318/* 27 */
10319/*!***********************************************************************************************************************************************************************************************************************!*\
10320 !*** ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-15140f52","hasScoped":false,"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/components/Icons.vue ***!
10321 \***********************************************************************************************************************************************************************************************************************/
10322/*! exports provided: default */
10323/*! exports used: default */
10324/***/ (function(module, __webpack_exports__, __webpack_require__) {
10325
10326"use strict";
10327var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"aimer-icons"},[(_vm.github)?_c('a',{staticClass:"aimer-icon",attrs:{"target":"_blank","href":_vm.getUrl(_vm.github, 'github.com')}},[_c('git-hub')],1):_vm._e(),_vm._v(" "),(_vm.twitter)?_c('a',{staticClass:"aimer-icon",attrs:{"target":"_blank","href":_vm.getUrl(_vm.twitter, 'twitter.com')}},[_c('twitter')],1):_vm._e()])}
10328var staticRenderFns = []
10329var esExports = { render: render, staticRenderFns: staticRenderFns }
10330/* harmony default export */ __webpack_exports__["a"] = (esExports);
10331
10332/***/ }),
10333/* 28 */
10334/*!************************************************************************************************************************************************************************************************************!*\
10335 !*** ./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-96d8ad28","hasScoped":false,"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/Aimer.vue ***!
10336 \************************************************************************************************************************************************************************************************************/
10337/*! exports provided: default */
10338/*! exports used: default */
10339/***/ (function(module, __webpack_exports__, __webpack_require__) {
10340
10341"use strict";
10342var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"aimer"}},[_c('header',{staticClass:"aimer-header"},[_c('div',{staticClass:"aimer-header__left"},[(!_vm.config.title)?_c('a',{attrs:{"href":"https://github.com/egoist/aimer","target":"_blank"}},[_c('h1',{staticClass:"aimer-brand"},[_vm._v("\n Aimer\n ")])]):_c('h1',{staticClass:"aimer-title"},[_c('a',{attrs:{"href":"./"}},[_vm._v(_vm._s(_vm.config.title))])]),_vm._v(" "),_c('select',{directives:[{name:"model",rawName:"v-model",value:(_vm.currentStorySlug),expression:"currentStorySlug"}],on:{"change":[function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return val}); _vm.currentStorySlug=$event.target.multiple ? $$selectedVal : $$selectedVal[0]},_vm.handleRender]}},_vm._l((_vm.stories),function(story,index){return _c('option',{key:story.title,domProps:{"value":story.slug}},[_vm._v("\n "+_vm._s(story.title)+"\n ")])}))]),_vm._v(" "),_c('div',{staticClass:"aimer-header__right"},[_c('icons',{attrs:{"github":_vm.config.github,"twitter":_vm.config.twitter}})],1)]),_vm._v(" "),_c('section',{staticClass:"aimer-main"},[_c('div',{staticClass:"aimer-cell aimer-component"},[_c('div',{ref:"targetWrapper",staticClass:"aimer-target-wrapper"})]),_vm._v(" "),(_vm.currentStory.example)?_c('div',{staticClass:"aimer-cell aimer-tabs"},[_c('div',{staticClass:"aimer-tab-headers"},[(_vm.currentStory.readme)?_c('div',{staticClass:"aimer-tab-header",class:{'aimer-tab-header__active': _vm.currentTab === 'readme'},on:{"click":function($event){_vm.chooseTab('readme')}}},[_vm._v("\n README\n ")]):_vm._e(),_vm._v(" "),(_vm.currentStory.example)?_c('div',{staticClass:"aimer-tab-header",class:{'aimer-tab-header__active': _vm.currentTab === 'example'},on:{"click":function($event){_vm.chooseTab('example')}}},[_vm._v("\n Example\n ")]):_vm._e()]),_vm._v(" "),(_vm.currentStory.readme && _vm.currentTab === 'readme')?_c('div',{staticClass:"aimer-tab-readme markdown-body",domProps:{"innerHTML":_vm._s(_vm.currentStory.readme)}}):_vm._e(),_vm._v(" "),(_vm.currentStory.example && _vm.currentTab === 'example')?_c('div',{staticClass:"aimer-tab-example"},[_c('pre',[_c('code',[_vm._v(_vm._s(_vm.currentStory.example))])])]):_vm._e()]):_vm._e()])])}
10343var staticRenderFns = []
10344var esExports = { render: render, staticRenderFns: staticRenderFns }
10345/* harmony default export */ __webpack_exports__["a"] = (esExports);
10346
10347/***/ })
10348/******/ ]);
10349});
\No newline at end of file